(command.CommandList
  children: [
    (command.ShFunction
      name: do_fsck
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (C {<'/sbin/e2fsck'>} {<-p>} {($ Id.VSub_Star '*')})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'EXIT_CODE='> name:EXIT_CODE)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_QMark '?')}
                  spids: [33]
                )
              ]
              redirects: []
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<Id.Lit_LBracket '['>} {(DQ (${ Id.VSub_Name EXIT_CODE))} {<-eq>} {<1>} 
                  {<Id.Lit_RBracket ']'>}
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'EXIT_CODE='> name:EXIT_CODE)
                      op: assign_op.Equal
                      rhs: {<0>}
                      spids: [57]
                    )
                  ]
                  redirects: []
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<Id.Lit_LBracket '['>} {(DQ (${ Id.VSub_Name EXIT_CODE))} {<-eq>} {<2>} {<-o>} 
                  {(DQ (${ Id.VSub_Name EXIT_CODE))} {<-eq>} {<3>} {<Id.Lit_RBracket ']'>}
                )
                (C {<'/sbin/reboot'>})
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<Id.Lit_LBracket '['>} {(DQ (${ Id.VSub_Name EXIT_CODE))} {<-lt>} {<4>} 
                  {<Id.Lit_RBracket ']'>}
                )
                (command.ControlFlow
                  token: <Id.ControlFlow_Return return>
                  arg_word: {(DQ (${ Id.VSub_Name EXIT_CODE))}
                )
              ]
            )
            (C {<'/sbin/e2fsck'>} {<-y>} {($ Id.VSub_Star '*')})
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<Id.Lit_LBracket '['>} {(DQ (${ Id.VSub_Name EXIT_CODE))} {<-eq>} {<1>} 
                  {<Id.Lit_RBracket ']'>}
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'EXIT_CODE='> name:EXIT_CODE)
                      op: assign_op.Equal
                      rhs: {<0>}
                      spids: [157]
                    )
                  ]
                  redirects: []
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<Id.Lit_LBracket '['>} {(DQ (${ Id.VSub_Name EXIT_CODE))} {<-eq>} {<2>} {<-o>} 
                  {(DQ (${ Id.VSub_Name EXIT_CODE))} {<-eq>} {<3>} {<Id.Lit_RBracket ']'>}
                )
                (C {<'/sbin/reboot'>})
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<Id.Lit_LBracket '['>} {(DQ (${ Id.VSub_Name EXIT_CODE))} {<-ge>} {<4>} 
                  {<Id.Lit_RBracket ']'>}
                )
                (C {<printf>} 
                  {
                    (DQ <'Filesystem unrecoverably corrupted, will reformat'> 
                      <Id.Lit_BadBackslash '\\'> <n>
                    )
                  }
                )
              ]
            )
            (command.ControlFlow
              token: <Id.ControlFlow_Return return>
              arg_word: {(DQ (${ Id.VSub_Name EXIT_CODE))}
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: do_fsck_extend_mount
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'DRIVE='> name:DRIVE)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number 1))}
                  spids: [244]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'DATA='> name:DATA)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number 2))}
                  spids: [250]
                )
              ]
              redirects: []
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<do_fsck>} {(DQ ($ Id.VSub_DollarName DATA))})
                (command.ControlFlow
                  token: <Id.ControlFlow_Return return>
                  arg_word: {<1>}
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'PARTITIONS='> name:PARTITIONS)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (command.Pipeline
                            children: [
                              (C {<sfdisk>} {<-J>} {(DQ ($ Id.VSub_DollarName DRIVE))})
                              (C {<jq>} {(SQ <'.partitiontable.partitions | length'>)})
                            ]
                            negated: F
                            stderr_indices: []
                          )
                        right: <Id.Eof_RParen _>
                      )
                    }
                  spids: [275]
                )
              ]
              redirects: []
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.AndOr
                          ops: [Id.Op_DAmp Id.Op_DAmp]
                          children: [
                            (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName PARTITIONS))} {<-eq>} 
                              {<1>} {<Id.Lit_RBracket ']'>}
                            )
                            (command.Pipeline
                              children: [
                                (C {<sfdisk>} {<-F>} {(DQ ($ Id.VSub_DollarName DRIVE))})
                                (C {<grep>} {<-q>} {(SQ <'Unpartitioned space'>)})
                              ]
                              negated: F
                              stderr_indices: []
                            )
                            (command.Pipeline
                              children: [
                                (C {<sfdisk>} {<-F>} {(DQ ($ Id.VSub_DollarName DRIVE))})
                                (C {<grep>} {<-q>} {(SQ <'0 B, 0 bytes, 0 sectors'>)})
                              ]
                              negated: T
                              stderr_indices: []
                            )
                          ]
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'SPACE='> name:SPACE)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: 
                                  (command.Pipeline
                                    children: [
                                      (C {<sfdisk>} {<-F>} {(DQ ($ Id.VSub_DollarName DRIVE))})
                                      (C {<grep>} {(SQ <'Unpartitioned space'>)})
                                    ]
                                    negated: F
                                    stderr_indices: []
                                  )
                                right: <Id.Eof_RParen _>
                              )
                            }
                          spids: [359]
                        )
                      ]
                      redirects: []
                    )
                    (C {<printf>} 
                      {
                        (DQ <'Resizing disk partition: '> ($ Id.VSub_DollarName SPACE) 
                          <Id.Lit_BadBackslash '\\'> <n>
                        )
                      }
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'START='> name:START)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: 
                                  (command.Pipeline
                                    children: [
                                      (C {<sfdisk>} {<-J>} {(DQ ($ Id.VSub_DollarName DRIVE))})
                                      (C {<jq>} {<-e>} 
                                        {
                                          (SQ 
                                            <
'.partitiontable.partitions | map(select(.type=="83")) | .[0].start'
                                            >
                                          )
                                        }
                                      )
                                    ]
                                    negated: F
                                    stderr_indices: []
                                  )
                                right: <Id.Eof_RParen _>
                              )
                            }
                          spids: [394]
                        )
                      ]
                      redirects: []
                    )
                    (command.Simple
                      words: [{<sfdisk>} {<-q>} {<--delete>} {(DQ ($ Id.VSub_DollarName DRIVE))}]
                      redirects: [
                        (redir
                          op: <Id.Redir_Great '2>'>
                          loc: (redir_loc.Fd fd:2)
                          arg: {<'/dev/null'>}
                        )
                      ]
                      more_env: []
                      do_fork: T
                    )
                    (command.Pipeline
                      children: [
                        (C {<echo>} {(DQ (${ Id.VSub_Name START) <',,83;'>)})
                        (C {<sfdisk>} {<-q>} {(DQ ($ Id.VSub_DollarName DRIVE))})
                      ]
                      negated: F
                      stderr_indices: []
                    )
                    (C {<sfdisk>} {<-A>} {(DQ ($ Id.VSub_DollarName DRIVE))} {<1>})
                    (command.Simple
                      words: [{<blockdev>} {<--rereadpt>} {($ Id.VSub_DollarName diskdev)}]
                      redirects: [
                        (redir
                          op: <Id.Redir_Great '2>'>
                          loc: (redir_loc.Fd fd:2)
                          arg: {<'/dev/null'>}
                        )
                      ]
                      more_env: []
                      do_fork: T
                    )
                    (C {<mdev>} {<-s>})
                    (command.ForEach
                      iter_names: [i]
                      iterable: 
                        (for_iter.Words
                          words: [
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: (C {<seq>} {<1>} {<50>})
                                right: <Id.Eof_RParen _>
                              )
                            }
                          ]
                        )
                      body: 
                        (command.DoGroup
                          children: [
                            (command.Sentence
                              child: 
                                (command.AndOr
                                  ops: [Id.Op_DAmp Id.Op_DPipe]
                                  children: [
                                    (C {<test>} {<-b>} {(DQ ($ Id.VSub_DollarName DATA))})
                                    (command.ControlFlow
                                      token: <Id.ControlFlow_Break break>
                                    )
                                    (C {<sleep>} {<.1>})
                                  ]
                                )
                              terminator: <Id.Op_Semi _>
                            )
                            (command.Sentence
                              child: (C {<mdev>} {<-s>})
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                        )
                      redirects: []
                    )
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (C {<do_fsck>} {<-f>} {(DQ ($ Id.VSub_DollarName DATA))})
                        (command.ControlFlow
                          token: <Id.ControlFlow_Return return>
                          arg_word: {<1>}
                        )
                      ]
                    )
                    (C {<resize2fs>} {(DQ ($ Id.VSub_DollarName DATA))})
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (C {<do_fsck>} {(DQ ($ Id.VSub_DollarName DATA))})
                        (command.ControlFlow
                          token: <Id.ControlFlow_Return return>
                          arg_word: {<1>}
                        )
                      ]
                    )
                  ]
                  spids: [296 356]
                )
              ]
              else_action: []
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: do_mkfs
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'diskdev='> name:diskdev)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number 1))}
                  spids: [591]
                )
              ]
              redirects: []
            )
            (command.Pipeline
              children: [
                (C {<echo>} {(DQ <w>)})
                (command.Simple
                  words: [{<fdisk>} {($ Id.VSub_DollarName diskdev)}]
                  redirects: [
                    (redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {<'/dev/null'>}
                    )
                  ]
                  more_env: []
                  do_fork: T
                )
              ]
              negated: F
              stderr_indices: []
            )
            (command.Pipeline
              children: [
                (C {<echo>} {(DQ <';'>)})
                (C {<sfdisk>} {<--quiet>} {($ Id.VSub_DollarName diskdev)})
              ]
              negated: F
              stderr_indices: []
            )
            (command.Simple
              words: [{<blockdev>} {<--rereadpt>} {($ Id.VSub_DollarName diskdev)}]
              redirects: [(redir op:<Id.Redir_Great '2>'> loc:(redir_loc.Fd fd:2) arg:{<'/dev/null'>})]
              more_env: []
              do_fork: T
            )
            (command.ForEach
              iter_names: [i]
              iterable: 
                (for_iter.Words
                  words: [
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: (C {<seq>} {<1>} {<50>})
                        right: <Id.Eof_RParen _>
                      )
                    }
                  ]
                )
              body: 
                (command.DoGroup
                  children: [
                    (command.Sentence
                      child: 
                        (command.AndOr
                          ops: [Id.Op_DAmp Id.Op_DPipe]
                          children: [
                            (C {<test>} {<-b>} {(DQ ($ Id.VSub_DollarName DATA))})
                            (command.ControlFlow
                              token: <Id.ControlFlow_Break break>
                            )
                            (C {<sleep>} {<.1>})
                          ]
                        )
                      terminator: <Id.Op_Semi _>
                    )
                    (command.Sentence
                      child: (C {<mdev>} {<-s>})
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                )
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'FSOPTS='> name:FSOPTS)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        <
'-O resize_inode,has_journal,extent,huge_file,flex_bg,uninit_bg,64bit,dir_nlink,extra_isize'
                        >
                      )
                    }
                  spids: [716]
                )
              ]
              redirects: []
            )
            (C {<mkfs.ext4>} {<-q>} {<-F>} {($ Id.VSub_DollarName FSOPTS)} {(${ Id.VSub_Name diskdev) <1>})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'DEV='> name:DEV)
          op: assign_op.Equal
          rhs: 
            {
              (DQ 
                (command_sub
                  left_token: <Id.Left_DollarParen '$('>
                  child: 
                    (command.Pipeline
                      children: [
                        (C {<find>} {<'/dev'>} {<-maxdepth>} {<1>} {<-type>} {<b>} {<Id.KW_Bang '!'>} 
                          {<-name>} {(SQ <'loop*'>)}
                        )
                        (C {<grep>} {<-v>} {(SQ <'[0-9]$'>)})
                        (C {<sed>} {(SQ <'s@.*/dev/@@'>)})
                        (C {<sort>})
                        (C {<head>} {<-1>})
                      ]
                      negated: F
                      stderr_indices: []
                    )
                  right: <Id.Eof_RParen _>
                )
              )
            }
          spids: [742]
        )
      ]
      redirects: []
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ (${ Id.VSub_Name DEV))} {<Id.Lit_RBracket ']'>})
        (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'DRIVE='> name:DRIVE)
          op: assign_op.Equal
          rhs: {(DQ <'/dev/'> (${ Id.VSub_Name DEV))}
          spids: [816]
        )
      ]
      redirects: []
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Simple
                  words: [{<sfdisk>} {<-d>} {(DQ (${ Id.VSub_Name DRIVE))}]
                  redirects: [
                    (redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {<'/dev/null'>}
                    )
                    (redir
                      op: <Id.Redir_Great '2>'>
                      loc: (redir_loc.Fd fd:2)
                      arg: {<'/dev/null'>}
                    )
                  ]
                  more_env: []
                  do_fork: T
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'DATA='> name:DATA)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (command.Pipeline
                            children: [
                              (C {<sfdisk>} {<-J>} {(DQ ($ Id.VSub_DollarName DRIVE))})
                              (C {<jq>} {<-e>} {<-r>} 
                                {
                                  (SQ 
                                    <
'.partitiontable.partitions | map(select(.type=="83")) | .[0].node'
                                    >
                                  )
                                }
                              )
                            ]
                            negated: F
                            stderr_indices: []
                          )
                        right: <Id.Eof_RParen _>
                      )
                    }
                  spids: [849]
                )
              ]
              redirects: []
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {($ Id.VSub_QMark '?')} {<-eq>} {<0>} 
                          {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  action: [
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (C {<do_fsck_extend_mount>} {(DQ ($ Id.VSub_DollarName DRIVE))} 
                          {(DQ ($ Id.VSub_DollarName DATA))}
                        )
                        (C {<do_mkfs>} {(DQ ($ Id.VSub_DollarName DRIVE))})
                      ]
                    )
                  ]
                  spids: [873 886]
                )
              ]
              else_action: [(C {<do_mkfs>} {(DQ ($ Id.VSub_DollarName DRIVE))})]
              redirects: []
            )
          ]
          spids: [828 846]
        )
      ]
      else_action: [(C {<do_mkfs>} {(DQ ($ Id.VSub_DollarName DRIVE))})]
      redirects: []
    )
  ]
)