(command.CommandList
  children: [
    (command.Assignment
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:PATH)
          op: Equal
          rhs: {(/sbin) (Lit_Other ':') (/bin) (Lit_Other ':') (/usr/bin)}
        )
      ]
    )
    (command.Assignment
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:FSCK_LOGFILE)
          op: Equal
          rhs: {(/var/log/fsck/checkfs)}
        )
      ]
    )
    (command.AndOr
      ops: [Op_DPipe]
      children: [
        (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$FSCKFIX'))} {(Lit_RBracket ']')})
        (command.Assignment
          pairs: [(assign_pair lhs:(lhs_expr.LhsName name:FSCKFIX) op:Equal rhs:{(no)})]
        )
      ]
    )
    (C {(.)} {(/lib/init/vars.sh)})
    (C {(.)} {(/lib/lsb/init-functions)})
    (C {(.)} {(/lib/init/mount-functions.sh)})
    (C {(.)} {(/lib/init/swap-functions.sh)})
    (command.FuncDef
      name: do_start
      body: 
        (command.BraceGroup
          children: [
            (C {(trap)} {(DQ )} {(INT)})
            (command.Assignment
              pairs: [(assign_pair lhs:(lhs_expr.LhsName name:BAT) op:Equal rhs:{(DQ )})]
            )
            (command.Assignment
              pairs: [(assign_pair lhs:(lhs_expr.LhsName name:fscheck) op:Equal rhs:{(DQ (yes))})]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [(C {(is_fastboot_active)})]
                  action: [
                    (command.AndOr
                      ops: [Op_DAmp]
                      children: [
                        (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$fscheck'))} {(Lit_Other '=')} 
                          {(yes)} {(Lit_RBracket ']')}
                        )
                        (C {(log_warning_msg)} 
                          {(DQ ('Fast boot enabled, so skipping file system check.'))}
                        )
                      ]
                    )
                    (command.Assignment
                      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:fscheck) op:Equal rhs:{(no)})]
                    )
                  ]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.AndOr
                      ops: [Op_DAmp Op_DAmp]
                      children: [
                        (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$fscheck'))} {(Lit_Other '=')} 
                          {(yes)} {(Lit_RBracket ']')}
                        )
                        (C {(Lit_LBracket '[')} {(KW_Bang '!')} {(DQ ($ VSub_DollarName '$BAT'))} 
                          {(Lit_RBracket ']')}
                        )
                        (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$FSCKTYPES'))} 
                          {(KW_Bang '!') (Lit_Other '=')} {(DQ (none))} {(Lit_RBracket ']')}
                        )
                      ]
                    )
                  ]
                  action: [
                    (C {(swaponagain)} {(SQ <'lvm and md'>)})
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.AndOr
                              ops: [Op_DPipe]
                              children: [
                                (C {(Lit_LBracket '[')} {(-f)} {(/forcefsck)} {(Lit_RBracket ']')})
                                (C {(grep)} {(-q)} {(-s)} {(-w)} {(-i)} {(DQ (forcefsck))} {(/proc/cmdline)})
                              ]
                            )
                          ]
                          action: [
                            (command.Assignment
                              pairs: [
                                (assign_pair
                                  lhs: (lhs_expr.LhsName name:force)
                                  op: Equal
                                  rhs: {(DQ (-f))}
                                )
                              ]
                            )
                          ]
                        )
                      ]
                      else_action: [
                        (command.Assignment
                          pairs: [(assign_pair lhs:(lhs_expr.LhsName name:force) op:Equal rhs:{(DQ )})]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$FSCKFIX'))} 
                              {(Lit_Other '=')} {(yes)} {(Lit_RBracket ']')}
                            )
                          ]
                          action: [
                            (command.Assignment
                              pairs: [
                                (assign_pair
                                  lhs: (lhs_expr.LhsName name:fix)
                                  op: Equal
                                  rhs: {(DQ (-y))}
                                )
                              ]
                            )
                          ]
                        )
                      ]
                      else_action: [
                        (command.Assignment
                          pairs: [(assign_pair lhs:(lhs_expr.LhsName name:fix) op:Equal rhs:{(DQ (-a))})]
                        )
                      ]
                    )
                    (command.Assignment
                      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:spinner) op:Equal rhs:{(DQ (-C))})]
                    )
                    (command.Case
                      to_match: {(DQ ($ VSub_DollarName '$TERM'))}
                      arms: [
                        (case_arm
                          pat_list: [{(dumb)} {(network)} {(unknown)} {(DQ )}]
                          action: [
                            (command.Assignment
                              pairs: [(assign_pair lhs:(lhs_expr.LhsName name:spinner) op:Equal rhs:{(DQ )})]
                            )
                          ]
                        )
                      ]
                    )
                    (command.AndOr
                      ops: [Op_DAmp]
                      children: [
                        (C {(Lit_LBracket '[')} 
                          {
                            (DQ 
                              (word_part.CommandSub
                                left_token: <Left_DollarParen '$('>
                                command_list: (command.CommandList children:[(C {(uname)} {(-m)})])
                              )
                            )
                          } {(Lit_Other '=')} {(s390x)} {(Lit_RBracket ']')}
                        )
                        (command.Assignment
                          pairs: [(assign_pair lhs:(lhs_expr.LhsName name:spinner) op:Equal rhs:{(DQ )})]
                        )
                      ]
                    )
                    (command.Assignment
                      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:FSCKTYPES_OPT) op:Equal rhs:{(DQ )})]
                    )
                    (command.AndOr
                      ops: [Op_DAmp]
                      children: [
                        (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$FSCKTYPES'))} 
                          {(Lit_RBracket ']')}
                        )
                        (command.Assignment
                          pairs: [
                            (assign_pair
                              lhs: (lhs_expr.LhsName name:FSCKTYPES_OPT)
                              op: Equal
                              rhs: {(DQ ('-t ') ($ VSub_DollarName '$FSCKTYPES'))}
                            )
                          ]
                        )
                      ]
                    )
                    (command.FuncDef
                      name: handle_failed_fsck
                      body: 
                        (command.BraceGroup
                          children: [
                            (C {(log_failure_msg)} 
                              {
                                (DQ ('File system check failed. \n') ('A log is being saved in ') 
                                  (${ VSub_Name FSCK_LOGFILE) (' if that location is writable. \n') ('Please repair the file system manually.')
                                )
                              }
                            )
                            (C {(log_warning_msg)} 
                              {
                                (DQ ('A maintenance shell will now be started. \n') 
                                  ('CONTROL-D will terminate this shell and resume system boot.')
                                )
                              }
                            )
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Pipeline
                                      children: [(C {(sulogin)} {($ VSub_DollarName '$CONSOLE')})]
                                      negated: T
                                    )
                                  ]
                                  action: [
                                    (C {(log_failure_msg)} 
                                      {
                                        (DQ ('Attempt to start maintenance shell failed. \n') 
                                          ('Continuing with system boot in 5 seconds.')
                                        )
                                      }
                                    )
                                    (C {(sleep)} {(5)})
                                  ]
                                )
                              ]
                            )
                          ]
                        )
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$VERBOSE'))} 
                              {(Lit_Other '=')} {(no)} {(Lit_RBracket ']')}
                            )
                          ]
                          action: [
                            (C {(log_action_begin_msg)} {(DQ ('Checking file systems'))})
                            (C {(logsave)} {(-s)} {($ VSub_DollarName '$FSCK_LOGFILE')} {(fsck)} 
                              {($ VSub_DollarName '$spinner')} {(-M)} {(-A)} {($ VSub_DollarName '$fix')} {($ VSub_DollarName '$force')} 
                              {($ VSub_DollarName '$FSCKTYPES_OPT')}
                            )
                            (command.Assignment
                              pairs: [
                                (assign_pair
                                  lhs: (lhs_expr.LhsName name:FSCKCODE)
                                  op: Equal
                                  rhs: {($ VSub_QMark '$?')}
                                )
                              ]
                            )
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$FSCKCODE'))} 
                                      {(-eq)} {(32)} {(Lit_RBracket ']')}
                                    )
                                  ]
                                  action: [
                                    (C {(log_action_end_msg)} {(1)} 
                                      {(DQ ('code ') ($ VSub_DollarName '$FSCKCODE'))}
                                    )
                                    (C {(log_warning_msg)} 
                                      {(DQ ('File system check was interrupted by user'))}
                                    )
                                  ]
                                )
                                (if_arm
                                  cond: [
                                    (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$FSCKCODE'))} 
                                      {(-gt)} {(1)} {(Lit_RBracket ']')}
                                    )
                                  ]
                                  action: [
                                    (C {(log_action_end_msg)} {(1)} 
                                      {(DQ ('code ') ($ VSub_DollarName '$FSCKCODE'))}
                                    )
                                    (C {(handle_failed_fsck)})
                                  ]
                                )
                              ]
                              else_action: [(C {(log_action_end_msg)} {(0)})]
                            )
                          ]
                        )
                      ]
                      else_action: [
                        (command.If
                          arms: [
                            (if_arm
                              cond: [
                                (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$FSCKTYPES'))} 
                                  {(Lit_RBracket ']')}
                                )
                              ]
                              action: [
                                (C {(log_action_msg)} 
                                  {
                                    (DQ ('Will now check all file systems of types ') 
                                      ($ VSub_DollarName '$FSCKTYPES')
                                    )
                                  }
                                )
                              ]
                            )
                          ]
                          else_action: [
                            (C {(log_action_msg)} {(DQ ('Will now check all file systems'))})
                          ]
                        )
                        (C {(logsave)} {(-s)} {($ VSub_DollarName '$FSCK_LOGFILE')} {(fsck)} 
                          {($ VSub_DollarName '$spinner')} {(-V)} {(-M)} {(-A)} {($ VSub_DollarName '$fix')} {($ VSub_DollarName '$force')} 
                          {($ VSub_DollarName '$FSCKTYPES_OPT')}
                        )
                        (command.Assignment
                          pairs: [
                            (assign_pair
                              lhs: (lhs_expr.LhsName name:FSCKCODE)
                              op: Equal
                              rhs: {($ VSub_QMark '$?')}
                            )
                          ]
                        )
                        (command.If
                          arms: [
                            (if_arm
                              cond: [
                                (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$FSCKCODE'))} {(-eq)} 
                                  {(32)} {(Lit_RBracket ']')}
                                )
                              ]
                              action: [
                                (C {(log_warning_msg)} 
                                  {(DQ ('File system check was interrupted by user'))}
                                )
                              ]
                            )
                            (if_arm
                              cond: [
                                (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$FSCKCODE'))} {(-gt)} 
                                  {(1)} {(Lit_RBracket ']')}
                                )
                              ]
                              action: [(C {(handle_failed_fsck)})]
                            )
                          ]
                          else_action: [
                            (C {(log_success_msg)} 
                              {
                                (DQ ('Done checking file systems. \n') ('A log is being saved in ') 
                                  (${ VSub_Name FSCK_LOGFILE) (' if that location is writable.')
                                )
                              }
                            )
                          ]
                        )
                      ]
                    )
                  ]
                )
              ]
            )
            (command.Simple
              words: [{(rm)} {(-f)} {(/fastboot)} {(/forcefsck)}]
              redirects: [(redir.Redir op:<Redir_Great '2>'> fd:2 arg_word:{(/dev/null)})]
            )
          ]
        )
    )
    (command.Case
      to_match: {(DQ ($ VSub_Number '$1'))}
      arms: [
        (case_arm pat_list:[{(start)} {(DQ )}] action:[(C {(do_start)})])
        (case_arm
          pat_list: [{(restart)} {(reload)} {(force-reload)}]
          action: [
            (command.Simple
              words: [{(echo)} {(DQ ("Error: argument '") ($ VSub_Number '$1') ("' not supported"))}]
              redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})]
            )
            (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(3)})
          ]
        )
        (case_arm pat_list:[{(stop)} {(status)}])
        (case_arm
          pat_list: [{(Lit_Star '*')}]
          action: [
            (command.Simple
              words: [{(echo)} {(DQ ('Usage: checkfs.sh [start|stop]'))}]
              redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})]
            )
            (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(3)})
          ]
        )
      ]
    )
    (C {(Lit_Other ':')})
  ]
)