(command.CommandList
  children: [
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_Pound '$#'))} {<-ne>} {(DQ <3>)} 
                      {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.Simple
              words: [
                {<echo>}
                {
                  (DQ <'Usage: '> 
                    (command_sub
                      left_token: <Id.Left_Backtick '`'>
                      child: (C {<basename>} {($ Id.VSub_Number '$0')})
                    ) <' <image_filename> <partition # (1,2,...)> <mount point>'>
                  )
                }
              ]
              redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
              do_fork: T
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> 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: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.Simple
                      words: [{<parted>} {<--version>}]
                      redirects: [
                        (redir
                          op: <Id.Redir_Great '>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {<'/dev/null'>}
                        )
                        (redir
                          op: <Id.Redir_GreatAnd '2>&'>
                          loc: (redir_loc.Fd fd:2)
                          arg: {<1>}
                        )
                      ]
                      do_fork: T
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:UNITS)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (command.Pipeline
                            children: [
                              (command.Simple
                                words: [
                                  {<parted>}
                                  {<-s>}
                                  {($ Id.VSub_DollarName '$FILE')}
                                  {<unit>}
                                  {<s>}
                                  {<print>}
                                ]
                                redirects: [
                                  (redir
                                    op: <Id.Redir_Great '2>'>
                                    loc: (redir_loc.Fd fd:2)
                                    arg: {<'/dev/null'>}
                                  )
                                ]
                                do_fork: T
                              )
                              (C {<grep>} {(DQ <' '> ($ Id.VSub_DollarName '$PART') <' '>)})
                              (C {<tr>} {<-d>} {(SQ <s>)})
                              (C {<awk>} {(SQ <'{print $2}'>)})
                            ]
                            negated: F
                          )
                      )
                    }
                  spids: [99]
                )
              ]
            )
          ]
          spids: [80 93]
        )
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.Simple
                      words: [{<fdisk>} {<-v>}]
                      redirects: [
                        (redir
                          op: <Id.Redir_Great '>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {<'/dev/null'>}
                        )
                        (redir
                          op: <Id.Redir_GreatAnd '2>&'>
                          loc: (redir_loc.Fd fd:2)
                          arg: {<1>}
                        )
                      ]
                      do_fork: T
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:UNITS)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (command.Pipeline
                            children: [
                              (command.Simple
                                words: [{<fdisk>} {<-lu>} {($ Id.VSub_DollarName '$FILE')}]
                                redirects: [
                                  (redir
                                    op: <Id.Redir_Great '2>'>
                                    loc: (redir_loc.Fd fd:2)
                                    arg: {<'/dev/null'>}
                                  )
                                ]
                                do_fork: T
                              )
                              (C {<grep>} 
                                {
                                  (DQ ($ Id.VSub_DollarName '$FILE') ($ Id.VSub_DollarName '$PART') 
                                    <' '>
                                  )
                                }
                              )
                              (C {<tr>} {<-d>} {(SQ <'*'>)})
                              (C {<awk>} {(SQ <'{print $2}'>)})
                            ]
                            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 op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
          do_fork: T
        )
        (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:OFFSET)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_Backtick '`'>
                child: (C {<expr>} {<512>} {(SQ <'*'>)} {($ 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')}
    )
  ]
)