(command.CommandList
  children: [
    (C {<.>} {(${ Id.VSub_Name BACKEND) <'/functions.sh'>})
    (C {<.>} {(${ Id.VSub_Name BACKEND) <'/functions-parse.sh'>})
    (command.Sentence
      child: 
        (command.ShFunction
          name: run_chroot_cmd
          body: 
            (BraceGroup
              children: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:CMD)
                      op: assign_op.Equal
                      rhs: {(DQ ($ Id.VSub_At '$@'))}
                      spids: [105]
                    )
                  ]
                )
                (C {<echo_log>} {(DQ <'Running chroot command: '> (${ Id.VSub_Name CMD))})
                (command.Simple
                  words: [{<echo>} {(DQ ($ Id.VSub_DollarName '$CMD'))}]
                  redirects: [
                    (redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {(${ Id.VSub_Name FSMNT) <'/.runcmd.sh'>}
                    )
                  ]
                  do_fork: T
                )
                (C {<chmod>} {<755>} {(${ Id.VSub_Name FSMNT) <'/.runcmd.sh'>})
                (C {<chroot>} {(${ Id.VSub_Name FSMNT)} {<sh>} {<'/.runcmd.sh'>})
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:RES)
                      op: assign_op.Equal
                      rhs: {($ Id.VSub_QMark '$?')}
                      spids: [155]
                    )
                  ]
                )
                (C {<rm>} {(${ Id.VSub_Name FSMNT) <'/.runcmd.sh'>})
                (command.ControlFlow
                  token: <Id.ControlFlow_Return return>
                  arg_word: {(${ Id.VSub_Name RES)}
                )
              ]
            )
        )
      terminator: <Id.Op_Semi _>
    )
    (command.Sentence
      child: 
        (command.ShFunction
          name: run_chroot_script
          body: 
            (BraceGroup
              children: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:SCRIPT)
                      op: assign_op.Equal
                      rhs: {(DQ ($ Id.VSub_At '$@'))}
                      spids: [185]
                    )
                  ]
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:SBASE)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (command_sub
                            left_token: <Id.Left_Backtick '`'>
                            child: (C {<basename>} {($ Id.VSub_DollarName '$SCRIPT')})
                          )
                        }
                      spids: [191]
                    )
                  ]
                )
                (C {<cp>} {(${ Id.VSub_Name SCRIPT)} 
                  {(${ Id.VSub_Name FSMNT) <'/.'> ($ Id.VSub_DollarName '$SBASE')}
                )
                (C {<chmod>} {<755>} {(${ Id.VSub_Name FSMNT) <'/.'> (${ Id.VSub_Name SBASE)})
                (C {<echo_log>} {(DQ <'Running chroot script: '> (${ Id.VSub_Name SCRIPT))})
                (C {<chroot>} {(${ Id.VSub_Name FSMNT)} {<'/.'> (${ Id.VSub_Name SBASE)})
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:RES)
                      op: assign_op.Equal
                      rhs: {($ Id.VSub_QMark '$?')}
                      spids: [251]
                    )
                  ]
                )
                (C {<rm>} {(${ Id.VSub_Name FSMNT) <'/.'> (${ Id.VSub_Name SBASE)})
                (command.ControlFlow
                  token: <Id.ControlFlow_Return return>
                  arg_word: {(${ Id.VSub_Name RES)}
                )
              ]
            )
        )
      terminator: <Id.Op_Semi _>
    )
    (command.Sentence
      child: 
        (command.ShFunction
          name: run_ext_cmd
          body: 
            (BraceGroup
              children: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:CMD)
                      op: assign_op.Equal
                      rhs: {(DQ ($ Id.VSub_At '$@'))}
                      spids: [285]
                    )
                  ]
                )
                (C {<export>} {<FSMNT>})
                (C {<echo_log>} {(DQ <'Running external command: '> (${ Id.VSub_Name CMD))})
                (command.Simple
                  words: [{<echo>} {(DQ (${ Id.VSub_Name CMD))}]
                  redirects: [
                    (redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {(${ Id.VSub_Name TMPDIR) <'/.runcmd.sh'>}
                    )
                  ]
                  do_fork: T
                )
                (C {<chmod>} {<755>} {(${ Id.VSub_Name TMPDIR) <'/.runcmd.sh'>})
                (C {<sh>} {(${ Id.VSub_Name TMPDIR) <'/.runcmd.sh'>})
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:RES)
                      op: assign_op.Equal
                      rhs: {($ Id.VSub_QMark '$?')}
                      spids: [343]
                    )
                  ]
                )
                (C {<rm>} {(${ Id.VSub_Name TMPDIR) <'/.runcmd.sh'>})
                (command.ControlFlow
                  token: <Id.ControlFlow_Return return>
                  arg_word: {(${ Id.VSub_Name RES)}
                )
              ]
            )
        )
      terminator: <Id.Op_Semi _>
    )
    (command.Sentence
      child: 
        (command.ShFunction
          name: run_commands
          body: 
            (BraceGroup
              children: [
                (command.WhileUntil
                  keyword: <Id.KW_While while>
                  cond: (condition.Shell commands:[(C {<read>} {<line>})])
                  body: 
                    (command.DoGroup
                      children: [
                        (command.Pipeline
                          children: [
                            (C {<echo>} {($ Id.VSub_DollarName '$line')})
                            (command.Simple
                              words: [
                                {<grep>}
                                {<-q>}
                                {<Id.Lit_Other '^'> <Id.Lit_VarLike 'runCommand='>}
                              ]
                              redirects: [
                                (redir
                                  op: <Id.Redir_Great '2>'>
                                  loc: (redir_loc.Fd fd:2)
                                  arg: {<'/dev/null'>}
                                )
                              ]
                              do_fork: T
                            )
                          ]
                          negated: F
                        )
                        (command.If
                          arms: [
                            (if_arm
                              cond: 
                                (condition.Shell
                                  commands: [
                                    (C {<Id.Lit_LBracket '['>} {($ Id.VSub_QMark '$?')} {<-eq>} {<0>} 
                                      {<Id.Lit_RBracket ']'>}
                                    )
                                  ]
                                )
                              action: [
                                (C {<get_value_from_string>} {(DQ ($ Id.VSub_DollarName '$line'))})
                                (C {<run_chroot_cmd>} {(DQ ($ Id.VSub_DollarName '$VAL'))})
                              ]
                              spids: [408 421]
                            )
                          ]
                        )
                        (command.Pipeline
                          children: [
                            (C {<echo>} {($ Id.VSub_DollarName '$line')})
                            (command.Simple
                              words: [{<grep>} {<-q>} {<Id.Lit_Other '^'> <Id.Lit_VarLike 'runScript='>}]
                              redirects: [
                                (redir
                                  op: <Id.Redir_Great '2>'>
                                  loc: (redir_loc.Fd fd:2)
                                  arg: {<'/dev/null'>}
                                )
                              ]
                              do_fork: T
                            )
                          ]
                          negated: F
                        )
                        (command.If
                          arms: [
                            (if_arm
                              cond: 
                                (condition.Shell
                                  commands: [
                                    (C {<Id.Lit_LBracket '['>} {($ Id.VSub_QMark '$?')} {<-eq>} {<0>} 
                                      {<Id.Lit_RBracket ']'>}
                                    )
                                  ]
                                )
                              action: [
                                (C {<get_value_from_string>} {(DQ ($ Id.VSub_DollarName '$line'))})
                                (C {<run_chroot_script>} {(DQ ($ Id.VSub_DollarName '$VAL'))})
                              ]
                              spids: [463 476]
                            )
                          ]
                        )
                        (command.Pipeline
                          children: [
                            (C {<echo>} {($ Id.VSub_DollarName '$line')})
                            (command.Simple
                              words: [
                                {<grep>}
                                {<-q>}
                                {<Id.Lit_Other '^'> <Id.Lit_VarLike 'runExtCommand='>}
                              ]
                              redirects: [
                                (redir
                                  op: <Id.Redir_Great '2>'>
                                  loc: (redir_loc.Fd fd:2)
                                  arg: {<'/dev/null'>}
                                )
                              ]
                              do_fork: T
                            )
                          ]
                          negated: F
                        )
                        (command.If
                          arms: [
                            (if_arm
                              cond: 
                                (condition.Shell
                                  commands: [
                                    (C {<Id.Lit_LBracket '['>} {($ Id.VSub_QMark '$?')} {<-eq>} {<0>} 
                                      {<Id.Lit_RBracket ']'>}
                                    )
                                  ]
                                )
                              action: [
                                (C {<get_value_from_string>} {(DQ ($ Id.VSub_DollarName '$line'))})
                                (C {<run_ext_cmd>} {(DQ ($ Id.VSub_DollarName '$VAL'))})
                              ]
                              spids: [518 531]
                            )
                          ]
                        )
                      ]
                    )
                  redirects: [
                    (redir
                      op: <Id.Redir_Less '<'>
                      loc: (redir_loc.Fd fd:0)
                      arg: {(${ Id.VSub_Name CFGF)}
                    )
                  ]
                )
              ]
            )
        )
      terminator: <Id.Op_Semi _>
    )
  ]
)