(command.CommandList
  children: [
    (command.ShFunction
      name: usage
      body: 
        (command.BraceGroup
          children: [
            (command.Simple
              words: [
                {<echo>}
                {
                  (DQ <'Usage: '> 
                    (command_sub
                      left_token: <Id.Left_DollarParen '$('>
                      command_list: 
                        (command.CommandList
                          children: [(C {<basename>} {($ Id.VSub_Number '$0')})]
                        )
                    ) <' file|device string'>
                  )
                }
              ]
              redirects: [(redir.Redir op:<Id.Redir_GreatAnd '>&'> fd:-1 arg_word:{<2>})]
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
        )
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:COLUMNS)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                command_list: (command.CommandList children:[(C {<tput>} {<cols>})])
              )
            }
          spids: [75]
        )
      ]
    )
    (command.ShFunction
      name: progress
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:DONE)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (word_part.ArithSub
                        anode: 
                          (arith_expr.Binary
                            op_id: Id.Arith_Slash
                            left: 
                              (arith_expr.Binary
                                op_id: Id.Arith_Star
                                left: 
                                  (arith_expr.Binary
                                    op_id: Id.Arith_Minus
                                    left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$COLUMNS')})
                                    right: (arith_expr.ArithWord w:{<Id.Lit_Digits 2>})
                                  )
                                right: (arith_expr.ArithWord w:{($ Id.VSub_Number '$1')})
                              )
                            right: (arith_expr.ArithWord w:{<Id.Lit_Digits 100>})
                          )
                      )
                    }
                  spids: [93]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:TODO)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (word_part.ArithSub
                        anode: 
                          (arith_expr.Binary
                            op_id: Id.Arith_Minus
                            left: 
                              (arith_expr.Binary
                                op_id: Id.Arith_Minus
                                left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$COLUMNS')})
                                right: (arith_expr.ArithWord w:{<Id.Lit_Digits 2>})
                              )
                            right: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$DONE')})
                          )
                      )
                    }
                  spids: [112]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:DONE)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.Pipeline
                                children: [
                                  (C {<printf>} {(DQ <'%'> (${ Id.VSub_Name DONE) <s>)})
                                  (C {<tr>} {(SQ <' '>)} {<Id.Lit_Equals '='>})
                                ]
                                negated: F
                              )
                            ]
                          )
                      )
                    }
                  spids: [123]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:TODO)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.Pipeline
                                children: [
                                  (C {<printf>} {(DQ <'%'> (${ Id.VSub_Name TODO) <s>)})
                                  (C {<tr>} {(SQ <' '>)} {<->})
                                ]
                                negated: F
                              )
                            ]
                          )
                      )
                    }
                  spids: [147]
                )
              ]
            )
            (command.Simple
              words: [
                {<printf>}
                {
                  (DQ <'['> ($ Id.VSub_DollarName '$DONE') ($ Id.VSub_DollarName '$TODO') <']'> 
                    <Id.Lit_Other '\\'> <r>
                  )
                }
              ]
              redirects: [(redir.Redir op:<Id.Redir_Great '>'> fd:-1 arg_word:{</dev/tty>})]
            )
          ]
        )
    )
    (command.ShFunction
      name: print
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:CLEAR)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        command_list: 
                          (command.CommandList
                            children: [(C {<printf>} {(DQ <'%'> (${ Id.VSub_Name COLUMNS) <s>)})]
                          )
                      )
                    }
                  spids: [199]
                )
              ]
            )
            (C {<printf>} {(DQ ($ Id.VSub_DollarName '$CLEAR') <Id.Lit_Other '\\'> <r>)})
            (C {<echo>} {(DQ ($ Id.VSub_At '$@'))})
          ]
        )
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (C {<Id.Lit_LBracket '['>} {($ Id.VSub_Pound '$#')} {<-ne>} {<2>} {<Id.Lit_RBracket ']'>})
        (C {<usage>})
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:DISK)
          op: assign_op.Equal
          rhs: {(DQ ($ Id.VSub_Number '$1'))}
          spids: [245]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:STRING)
          op: assign_op.Equal
          rhs: {(DQ ($ Id.VSub_Number '$2'))}
          spids: [250]
        )
      ]
    )
    (C {<export>} {<Id.Lit_VarLike 'LANG='> <C>})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:CHUNK_SIZE)
          op: assign_op.Equal
          rhs: 
            {
              (word_part.ArithSub
                anode: 
                  (arith_expr.Binary
                    op_id: Id.Arith_Star
                    left: 
                      (arith_expr.Binary
                        op_id: Id.Arith_Star
                        left: (arith_expr.ArithWord w:{<Id.Lit_Digits 8>})
                        right: (arith_expr.ArithWord w:{<Id.Lit_Digits 1024>})
                      )
                    right: (arith_expr.ArithWord w:{<Id.Lit_Digits 1024>})
                  )
              )
            }
          spids: [280]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {<Id.Lit_LBracket '['>} {<-b>} {(DQ ($ Id.VSub_DollarName '$DISK'))} 
                  {<Id.Lit_RBracket ']'>}
                )
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:SIZE)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (command_sub
                            left_token: <Id.Left_DollarParen '$('>
                            command_list: 
                              (command.CommandList
                                children: [
                                  (C {</sbin/blockdev>} {<--getsize64>} {($ Id.VSub_DollarName '$DISK')})
                                ]
                              )
                          )
                        }
                      spids: [306]
                    )
                  ]
                )
                (command.ControlFlow
                  token: <Id.ControlFlow_Exit exit>
                  arg_word: {($ Id.VSub_QMark '$?')}
                )
              ]
            )
          ]
          spids: [290 303]
        )
      ]
      else_action: [
        (command.AndOr
          ops: [Id.Op_DPipe]
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:SIZE)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        command_list: 
                          (command.CommandList
                            children: [
                              (C {<stat>} {<--format>} {<Id.Lit_Other '%'> <s>} 
                                {(DQ ($ Id.VSub_DollarName '$DISK'))}
                              )
                            ]
                          )
                      )
                    }
                  spids: [327]
                )
              ]
            )
            (command.ControlFlow
              token: <Id.ControlFlow_Exit exit>
              arg_word: {($ Id.VSub_QMark '$?')}
            )
          ]
        )
      ]
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$SIZE')} {<-eq>} {<0>} {<Id.Lit_RBracket ']'>})
        (command.ControlFlow token:<Id.ControlFlow_Exit exit>)
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:CHUNKS)
          op: assign_op.Equal
          rhs: 
            {
              (word_part.ArithSub
                anode: 
                  (arith_expr.Binary
                    op_id: Id.Arith_Slash
                    left: 
                      (arith_expr.Binary
                        op_id: Id.Arith_Minus
                        left: 
                          (arith_expr.Binary
                            op_id: Id.Arith_Plus
                            left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$SIZE')})
                            right: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$CHUNK_SIZE')})
                          )
                        right: (arith_expr.ArithWord w:{<Id.Lit_Digits 1>})
                      )
                    right: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$CHUNK_SIZE')})
                  )
              )
            }
          spids: [363]
        )
      ]
    )
    (command.ShAssignment
      pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:i) op:assign_op.Equal rhs:{<0>} spids:[378])]
    )
    (command.WhileUntil
      keyword: <Id.KW_While while>
      cond: [(command.Sentence child:(C {<true>}) terminator:<Id.Op_Semi _>)]
      body: 
        (command.DoGroup
          children: [
            (C {<progress>} 
              {
                (word_part.ArithSub
                  anode: 
                    (arith_expr.Binary
                      op_id: Id.Arith_Slash
                      left: 
                        (arith_expr.Binary
                          op_id: Id.Arith_Star
                          left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$i')})
                          right: (arith_expr.ArithWord w:{<Id.Lit_Digits 100>})
                        )
                      right: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$CHUNKS')})
                    )
                )
              }
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$i'))} {<-ge>} 
                  {(DQ ($ Id.VSub_DollarName '$CHUNKS'))} {<Id.Lit_RBracket ']'>}
                )
                (command.ControlFlow token:<Id.ControlFlow_Break break>)
              ]
            )
            (command.Pipeline
              children: [
                (command.Simple
                  words: [
                    {<dd>}
                    {<Id.Lit_VarLike 'if='> ($ Id.VSub_DollarName '$DISK')}
                    {<Id.Lit_VarLike 'iflag='> <direct>}
                    {<Id.Lit_VarLike 'conv='> <noerror>}
                    {<Id.Lit_VarLike 'bs='> ($ Id.VSub_DollarName '$CHUNK_SIZE')}
                    {<Id.Lit_VarLike 'count='> <1>}
                    {<Id.Lit_VarLike 'skip='> ($ Id.VSub_DollarName '$i')}
                  ]
                  redirects: [(redir.Redir op:<Id.Redir_Great '2>'> fd:2 arg_word:{</dev/null>})]
                )
                (command.Simple
                  words: [
                    {<grep>}
                    {<--binary-files> <Id.Lit_Equals '='> <text>}
                    {<-U>}
                    {<-F>}
                    {(DQ ($ Id.VSub_DollarName '$STRING'))}
                  ]
                  redirects: [(redir.Redir op:<Id.Redir_Great '>'> fd:-1 arg_word:{</dev/null>})]
                )
              ]
              negated: F
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:status)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        command_list: 
                          (command.CommandList
                            children: [
                              (C {<echo>} 
                                {
                                  (braced_var_sub
                                    token: <Id.VSub_Name PIPESTATUS>
                                    bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                                  )
                                }
                              )
                            ]
                          )
                      )
                    }
                  spids: [472]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:dd_status)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.Pipeline
                                children: [
                                  (C {<echo>} {($ Id.VSub_DollarName '$status')})
                                  (C {<cut>} {<-f1>} {<-d>} {(SQ <' '>)})
                                ]
                                negated: F
                              )
                            ]
                          )
                      )
                    }
                  spids: [485]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:re_status)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.Pipeline
                                children: [
                                  (C {<echo>} {($ Id.VSub_DollarName '$status')})
                                  (C {<cut>} {<-f2>} {<-d>} {(SQ <' '>)})
                                ]
                                negated: F
                              )
                            ]
                          )
                      )
                    }
                  spids: [505]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$dd_status')} {<-ne>} {<0>} 
                  {<Id.Lit_RBracket ']'>}
                )
                (command.BraceGroup
                  children: [
                    (command.Sentence
                      child: 
                        (command.Simple
                          words: [{<echo>} {(DQ <'dd error'>)}]
                          redirects: [(redir.Redir op:<Id.Redir_GreatAnd '>&'> fd:-1 arg_word:{<2>})]
                        )
                      terminator: <Id.Op_Semi _>
                    )
                    (command.Sentence
                      child: 
                        (command.ControlFlow
                          token: <Id.ControlFlow_Exit exit>
                          arg_word: {($ Id.VSub_DollarName '$dd_status')}
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$re_status')} {<-eq>} {<0>} 
                  {<Id.Lit_RBracket ']'>}
                )
                (command.BraceGroup
                  children: [
                    (command.Sentence
                      child: 
                        (C {<print>} 
                          {
                            (DQ <'dd if='> ($ Id.VSub_DollarName '$DISK') <' iflag=direct bs='> 
                              ($ Id.VSub_DollarName '$CHUNK_SIZE') <' count=1 skip='> ($ Id.VSub_DollarName '$i') <' > disk_grep.'> ($ Id.VSub_DollarName '$i')
                            )
                          }
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:i)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (word_part.ArithSub
                        anode: 
                          (arith_expr.Binary
                            op_id: Id.Arith_Plus
                            left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$i')})
                            right: (arith_expr.ArithWord w:{<Id.Lit_Digits 1>})
                          )
                      )
                    }
                  spids: [588]
                )
              ]
            )
          ]
        )
    )
    (C {<echo>})
  ]
)