(CommandList
  children: [
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (C {(Lit_Other "[")} {(DQ ($ VSub_Pound "$#"))} {(-ne)} {(DQ (3))} {(Lit_Other "]")})
              terminator: <Op_Semi ";">
            )
          ]
          action: [
            (SimpleCommand
              words: [
                {(echo)}
                {
                  (DQ ("Usage: ") 
                    (CommandSubPart
                      command_list: (CommandList children:[(C {(basename)} {($ VSub_Number "$0")})])
                      left_token: <Left_Backtick "`">
                      spids: [49 53]
                    ) (" <image_filename> <partition # (1,2,...)> <mount point>")
                  )
                }
              ]
              redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[57])]
            )
            (C {(exit)} {(1)})
          ]
          spids: [-1 42]
        )
      ]
      spids: [-1 65]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:FILE) op:Equal rhs:{($ VSub_Number "$1")} spids:[68])]
      spids: [68]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:PART) op:Equal rhs:{($ VSub_Number "$2")} spids:[71])]
      spids: [71]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:DEST) op:Equal rhs:{($ VSub_Number "$3")} spids:[74])]
      spids: [74]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (SimpleCommand
                  words: [{(parted)} {(--version)}]
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: -1
                      arg_word: {(/dev/null)}
                      spids: [84]
                    )
                    (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[87])
                  ]
                )
              terminator: <Op_Semi ";">
            )
          ]
          action: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:UNITS)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (Pipeline
                                children: [
                                  (SimpleCommand
                                    words: [
                                      {(parted)}
                                      {(-s)}
                                      {($ VSub_Name "$FILE")}
                                      {(unit)}
                                      {(s)}
                                      {(print)}
                                    ]
                                    redirects: [
                                      (Redir
                                        op_id: Redir_Great
                                        fd: 2
                                        arg_word: {(/dev/null)}
                                        spids: [111]
                                      )
                                    ]
                                  )
                                  (C {(grep)} {(DQ (" ") ($ VSub_Name "$PART") (" "))})
                                  (C {(tr)} {(-d)} {(SQ <s>)})
                                  (C {(awk)} {(SQ <"{print $2}">)})
                                ]
                                negated: False
                              )
                            ]
                          )
                        left_token: <Left_CommandSub "$(">
                        spids: [98 142]
                      )
                    }
                  spids: [97]
                )
              ]
              spids: [97]
            )
          ]
          spids: [-1 91]
        )
        (if_arm
          cond: [
            (Sentence
              child: 
                (SimpleCommand
                  words: [{(fdisk)} {(-v)}]
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: -1
                      arg_word: {(/dev/null)}
                      spids: [150]
                    )
                    (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[153])
                  ]
                )
              terminator: <Op_Semi ";">
            )
          ]
          action: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:UNITS)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (Pipeline
                                children: [
                                  (SimpleCommand
                                    words: [{(fdisk)} {(-lu)} {($ VSub_Name "$FILE")}]
                                    redirects: [
                                      (Redir
                                        op_id: Redir_Great
                                        fd: 2
                                        arg_word: {(/dev/null)}
                                        spids: [168]
                                      )
                                    ]
                                  )
                                  (C {(grep)} {(DQ ($ VSub_Name "$FILE") ($ VSub_Name "$PART") (" "))})
                                  (C {(tr)} {(-d)} {(SQ <"*">)})
                                  (C {(awk)} {(SQ <"{print $2}">)})
                                ]
                                negated: False
                              )
                            ]
                          )
                        left_token: <Left_CommandSub "$(">
                        spids: [161 199]
                      )
                    }
                  spids: [160]
                )
              ]
              spids: [160]
            )
          ]
          spids: [144 157]
        )
      ]
      else_action: [
        (SimpleCommand
          words: [{(echo)} {(DQ ("Can't find the fdisk or parted utils. Are you root?"))}]
          redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[210])]
        )
        (C {(exit)} {(1)})
      ]
      spids: [201 218]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:OFFSET)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [(C {(expr)} {(512)} {(SQ <"*">)} {($ VSub_Name "$UNITS")})]
                  )
                left_token: <Left_Backtick "`">
                spids: [222 232]
              )
            }
          spids: [221]
        )
      ]
      spids: [221]
    )
    (C {(mount)} {(-o)} {(loop) (Lit_Comma ",") (Lit_VarLike "offset=") ($ VSub_Name "$OFFSET")} 
      {($ VSub_Name "$FILE")} {($ VSub_Name "$DEST")}
    )
  ]
)