(command.CommandList
  children: [
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(Id.Lit_LBracket '[')} {(DQ ($ Id.VSub_Pound '$#'))} {(-ne)} {(DQ (3))} 
                  {(Id.Lit_RBracket ']')}
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:40)
            )
          ]
          action: [
            (command.Simple
              words: [
                {(echo)}
                {
                  (DQ ('Usage: ') 
                    (command_sub
                      left_token: (Token id:Id.Left_Backtick val:'`' span_id:49)
                      command_list: 
                        (command.CommandList
                          children: [(C {(basename)} {($ Id.VSub_Number '$0')})]
                        )
                    ) (' <image_filename> <partition # (1,2,...)> <mount point>')
                  )
                }
              ]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:59)
                  fd: -1
                  arg_word: {(2)}
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:63)
              arg_word: {(1)}
            )
          ]
          spids: [25 42]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:FILE)
          op: assign_op.Equal
          rhs: {($ Id.VSub_Number '$1')}
          spids: [70]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:PART)
          op: assign_op.Equal
          rhs: {($ Id.VSub_Number '$2')}
          spids: [73]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:DEST)
          op: assign_op.Equal
          rhs: {($ Id.VSub_Number '$3')}
          spids: [76]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.Simple
                  words: [{(parted)} {(--version)}]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_Great val:'>' span_id:86)
                      fd: -1
                      arg_word: {(/dev/null)}
                    )
                    (redir.Redir
                      op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:89)
                      fd: 2
                      arg_word: {(1)}
                    )
                  ]
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:91)
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:UNITS)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:100)
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.Pipeline
                                children: [
                                  (command.Simple
                                    words: [
                                      {(parted)}
                                      {(-s)}
                                      {($ Id.VSub_DollarName '$FILE')}
                                      {(unit)}
                                      {(s)}
                                      {(print)}
                                    ]
                                    redirects: [
                                      (redir.Redir
                                        op: (Token id:Id.Redir_Great val:'2>' span_id:113)
                                        fd: 2
                                        arg_word: {(/dev/null)}
                                      )
                                    ]
                                  )
                                  (C {(grep)} {(DQ (' ') ($ Id.VSub_DollarName '$PART') (' '))})
                                  (C {(tr)} {(-d)} {(SQ (Token id:Id.Lit_Chars val:s span_id:134))})
                                  (C {(awk)} {(SQ (Token id:Id.Lit_Chars val:'{print $2}' span_id:142))})
                                ]
                                negated: F
                              )
                            ]
                          )
                      )
                    }
                  spids: [99]
                )
              ]
            )
          ]
          spids: [80 93]
        )
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.Simple
                  words: [{(fdisk)} {(-v)}]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_Great val:'>' span_id:152)
                      fd: -1
                      arg_word: {(/dev/null)}
                    )
                    (redir.Redir
                      op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:155)
                      fd: 2
                      arg_word: {(1)}
                    )
                  ]
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:157)
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:UNITS)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:163)
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.Pipeline
                                children: [
                                  (command.Simple
                                    words: [{(fdisk)} {(-lu)} {($ Id.VSub_DollarName '$FILE')}]
                                    redirects: [
                                      (redir.Redir
                                        op: (Token id:Id.Redir_Great val:'2>' span_id:170)
                                        fd: 2
                                        arg_word: {(/dev/null)}
                                      )
                                    ]
                                  )
                                  (C {(grep)} 
                                    {
                                      (DQ ($ Id.VSub_DollarName '$FILE') 
                                        ($ Id.VSub_DollarName '$PART') (' ')
                                      )
                                    }
                                  )
                                  (C {(tr)} {(-d)} {(SQ (Token id:Id.Lit_Chars val:'*' span_id:191))})
                                  (C {(awk)} {(SQ (Token id:Id.Lit_Chars val:'{print $2}' span_id:199))})
                                ]
                                negated: F
                              )
                            ]
                          )
                      )
                    }
                  spids: [162]
                )
              ]
            )
          ]
          spids: [146 159]
        )
      ]
      else_action: [
        (command.Simple
          words: [{(echo)} {(DQ ("Can't find the fdisk or parted utils. Are you root?"))}]
          redirects: [
            (redir.Redir
              op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:212)
              fd: -1
              arg_word: {(2)}
            )
          ]
        )
        (command.ControlFlow
          token: (Token id:Id.ControlFlow_Exit val:exit span_id:216)
          arg_word: {(1)}
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:OFFSET)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: (Token id:Id.Left_Backtick val:'`' span_id:224)
                command_list: 
                  (command.CommandList
                    children: [
                      (C {(expr)} {(512)} {(SQ (Token id:Id.Lit_Chars val:'*' span_id:232))} 
                        {($ Id.VSub_DollarName '$UNITS')}
                      )
                    ]
                  )
              )
            }
          spids: [223]
        )
      ]
    )
    (C {(mount)} {(-o)} 
      {(loop) (Id.Lit_Comma ',') (Id.Lit_VarLike 'offset=') ($ Id.VSub_DollarName '$OFFSET')} {($ Id.VSub_DollarName '$FILE')} {($ Id.VSub_DollarName '$DEST')}
    )
  ]
)