(command.CommandList
  children: [
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (C {<Id.Lit_LBracket '['>} 
          {
            (braced_var_sub
              token: <Id.VSub_Name VARIABLES_QUEUE_SH>
              suffix_op: (suffix_op.Unary op_id:Id.VTest_Plus arg_word:{<true>})
            )
          } {<Id.Lit_RBracket ']'>}
        )
        (command.ControlFlow token:<Id.ControlFlow_Return return>)
      ]
    )
    (C {<declare>} {<-g>} {<Id.Lit_VarLike 'VARIABLES_QUEUE_SH='> <true>})
    (C {<.>} 
      {
        (braced_var_sub
          token: <Id.VSub_Name BASH_SOURCE>
          suffix_op: (suffix_op.Unary op_id:Id.VOp1_Percent arg_word:{<Id.Lit_Slash /> <'*'>})
        ) </common.sh>
      }
    )
    (C {<.>} 
      {
        (braced_var_sub
          token: <Id.VSub_Name BASH_SOURCE>
          suffix_op: (suffix_op.Unary op_id:Id.VOp1_Percent arg_word:{<Id.Lit_Slash /> <'*'>})
        ) </logger.sh>
      }
    )
    (C {<.>} 
      {
        (braced_var_sub
          token: <Id.VSub_Name BASH_SOURCE>
          suffix_op: (suffix_op.Unary op_id:Id.VOp1_Percent arg_word:{<Id.Lit_Slash /> <'*'>})
        ) </variables.sh>
      }
    )
    (C {<.>} 
      {
        (braced_var_sub
          token: <Id.VSub_Name BASH_SOURCE>
          suffix_op: (suffix_op.Unary op_id:Id.VOp1_Percent arg_word:{<Id.Lit_Slash /> <'*'>})
        ) </variables.atom.sh>
      }
    )
    (C {<.>} 
      {
        (braced_var_sub
          token: <Id.VSub_Name BASH_SOURCE>
          suffix_op: (suffix_op.Unary op_id:Id.VOp1_Percent arg_word:{<Id.Lit_Slash /> <'*'>})
        ) </variables.arraylist.sh>
      }
    )
    (C 
      {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <type> <Id.Lit_Other ':'> <Id.Lit_Other ':'> 
        <define>
      } {<ArrayQueue>} {<ArrayList>}
    )
    (command.ShFunction
      name: 'variable::ArrayQueue::new'
      body: 
        (command.BraceGroup
          children: [
            (C {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <new>} {<ArrayQueue>} 
              {(DQ (${ Id.VSub_At '@'))}
            )
          ]
        )
    )
    (command.ShFunction
      name: 'variable::ArrayQueue::enqueue'
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.Binary
                              op_id: Id.BoolBinary_GlobDEqual
                              left: {(${ Id.VSub_Name VARIABLES_DEBUG)}
                              right: {<1>}
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.Sentence
                      child: 
                        (C {<stderr>} {(DQ <'variable::ArrayQueue::enqueue '> (${ Id.VSub_At '@'))})
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  spids: [167 182]
                )
              ]
            )
            (C {<declare>} {<Id.Lit_VarLike 'token='> (DQ (${ Id.VSub_Number 1))})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.Pipeline
                          children: [
                            (C 
                              {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <type> 
                                <Id.Lit_Other ':'> <Id.Lit_Other ':'> <instanceOf>
                              } {(DQ (${ Id.VSub_Name token))} {<ArrayQueue>}
                            )
                          ]
                          negated: T
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (C {<stderr>} 
                      {
                        (DQ <'Variable ['> (${ Id.VSub_Name token) 
                          <'] is not of type ArrayQueue (actual type ['> (${ Id.VSub_Name RESULT) <'])'>
                        )
                      }
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [209 231]
                )
              ]
            )
            (C 
              {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <ArrayList> <Id.Lit_Other ':'> 
                <Id.Lit_Other ':'> <append>
              } {(DQ (${ Id.VSub_At '@'))}
            )
          ]
        )
    )
    (command.ShFunction
      name: 'variable::ArrayQueue::dequeue'
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.Binary
                              op_id: Id.BoolBinary_GlobDEqual
                              left: {(${ Id.VSub_Name VARIABLES_DEBUG)}
                              right: {<1>}
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.Sentence
                      child: 
                        (C {<stderr>} {(DQ <'variable::ArrayList::isEmpty_c '> (${ Id.VSub_At '@'))})
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  spids: [299 314]
                )
              ]
            )
            (C {<declare>} {<Id.Lit_VarLike 'token='> (DQ (${ Id.VSub_Number 1))})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.Pipeline
                          children: [
                            (C 
                              {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <type> 
                                <Id.Lit_Other ':'> <Id.Lit_Other ':'> <instanceOf>
                              } {(DQ (${ Id.VSub_Name token))} {<ArrayQueue>}
                            )
                          ]
                          negated: T
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (C {<stderr>} 
                      {
                        (DQ <'Variable ['> (${ Id.VSub_Name token) 
                          <'] is not of type ArrayQueue (actual type ['> (${ Id.VSub_Name RESULT) <'])'>
                        )
                      }
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [341 363]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C 
                          {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <ArrayList> 
                            <Id.Lit_Other ':'> <Id.Lit_Other ':'> <isEmpty_c>
                          } {(DQ (${ Id.VSub_Name token))}
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (C {<stderr>} {(DQ <'Cannot dequeue from an empty queue'>)})
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [390 408]
                )
              ]
            )
            (command.Sentence
              child: 
                (C 
                  {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <ArrayQueue> <Id.Lit_Other ':'> 
                    <Id.Lit_Other ':'> <peek>
                  } {(DQ (${ Id.VSub_Name token))}
                )
              terminator: <Id.Op_Semi _>
            )
            (C {<declare>} {<Id.Lit_VarLike 'result='> ($ Id.VSub_DollarName '$RESULT')})
            (command.Sentence
              child: 
                (C {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <type>} 
                  {($ Id.VSub_DollarName '$token')}
                )
              terminator: <Id.Op_Semi _>
            )
            (C {<declare>} {<Id.Lit_VarLike 'type='> ($ Id.VSub_DollarName '$RESULT')})
            (command.Sentence
              child: 
                (C 
                  {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <ArrayList> <Id.Lit_Other ':'> 
                    <Id.Lit_Other ':'> <rest>
                  } {($ Id.VSub_DollarName '$token')}
                )
              terminator: <Id.Op_Semi _>
            )
            (C {<declare>} {<Id.Lit_VarLike 'value='> ($ Id.VSub_DollarName '$RESULT')})
            (C {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <Id.KW_Set set>} 
              {(DQ ($ Id.VSub_DollarName '$token'))} {(DQ ($ Id.VSub_DollarName '$type'))} {(DQ ($ Id.VSub_DollarName '$value'))}
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:RESULT)
                  op: assign_op.Equal
                  rhs: {(DQ (${ Id.VSub_Name result))}
                  spids: [497]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: 'variable::ArrayQueue::peek'
      body: 
        (command.BraceGroup
          children: [
            (C {<declare>} {<Id.Lit_VarLike 'token='> (DQ (${ Id.VSub_Number 1))})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.Pipeline
                          children: [
                            (C 
                              {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <type> 
                                <Id.Lit_Other ':'> <Id.Lit_Other ':'> <instanceOf>
                              } {(DQ (${ Id.VSub_Name token))} {<ArrayQueue>}
                            )
                          ]
                          negated: T
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (C {<stderr>} 
                      {
                        (DQ <'Variable ['> (${ Id.VSub_Name token) 
                          <'] is not of type ArrayQueue (actual type ['> (${ Id.VSub_Name RESULT) <'])'>
                        )
                      }
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [542 564]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C 
                          {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <ArrayList> 
                            <Id.Lit_Other ':'> <Id.Lit_Other ':'> <isEmpty_c>
                          } {($ Id.VSub_DollarName '$token')}
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (C {<stderr>} {(DQ <'Cannot peek from an empty queue'>)})
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [591 605]
                )
              ]
            )
            (command.Sentence
              child: 
                (C 
                  {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <ArrayList> <Id.Lit_Other ':'> 
                    <Id.Lit_Other ':'> <first>
                  } {($ Id.VSub_DollarName '$token')}
                )
              terminator: <Id.Op_Semi _>
            )
            (C {<declare>} {<Id.Lit_VarLike 'result='> ($ Id.VSub_DollarName '$RESULT')})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:RESULT)
                  op: assign_op.Equal
                  rhs: {(DQ (${ Id.VSub_Name result))}
                  spids: [644]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: '_variable::ArrayQueue::peek_p'
      body: 
        (command.BraceGroup
          children: [
            (C 
              {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <ArrayQueue> <Id.Lit_Other ':'> 
                <Id.Lit_Other ':'> <peek>
              } {(DQ (${ Id.VSub_At '@'))}
            )
            (C {<echo>} {(DQ ($ Id.VSub_DollarName '$RESULT'))})
          ]
        )
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {<Id.Lit_LBracket '['>} {($ Id.VSub_Number '$0')} 
                  {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {($ Id.VSub_DollarName '$BASH_SOURCE')} {<Id.Lit_RBracket ']'>}
                )
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [(command.ControlFlow token:<Id.ControlFlow_Return return>)]
          spids: [697 711]
        )
      ]
    )
    (command.CommandList
      children: [
        (command.Sentence
          child: 
            (C 
              {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <ArrayQueue> <Id.Lit_Other ':'> 
                <Id.Lit_Other ':'> <new>
              }
            )
          terminator: <Id.Op_Semi _>
        )
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:vCode)
              op: assign_op.Equal
              rhs: {(${ Id.VSub_Name RESULT)}
              spids: [738]
            )
          ]
        )
      ]
    )
    (command.CommandList
      children: [
        (command.Sentence
          child: (C {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <new>} {<String>} {(DQ <first>)})
          terminator: <Id.Op_Semi _>
        )
        (C 
          {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <ArrayQueue> <Id.Lit_Other ':'> 
            <Id.Lit_Other ':'> <enqueue>
          } {(${ Id.VSub_Name vCode)} {(${ Id.VSub_Name RESULT)}
        )
      ]
    )
    (command.CommandList
      children: [
        (command.Sentence
          child: (C {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <new>} {<String>} {(DQ <second>)})
          terminator: <Id.Op_Semi _>
        )
        (C 
          {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <ArrayQueue> <Id.Lit_Other ':'> 
            <Id.Lit_Other ':'> <enqueue>
          } {(${ Id.VSub_Name vCode)} {(${ Id.VSub_Name RESULT)}
        )
      ]
    )
    (command.CommandList
      children: [
        (command.Sentence
          child: (C {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <new>} {<String>} {(DQ <third>)})
          terminator: <Id.Op_Semi _>
        )
        (C 
          {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <ArrayQueue> <Id.Lit_Other ':'> 
            <Id.Lit_Other ':'> <enqueue>
          } {(${ Id.VSub_Name vCode)} {(${ Id.VSub_Name RESULT)}
        )
      ]
    )
    (command.CommandList
      children: [
        (command.Sentence
          child: 
            (C 
              {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <ArrayQueue> <Id.Lit_Other ':'> 
                <Id.Lit_Other ':'> <peek>
              } {($ Id.VSub_DollarName '$vCode')}
            )
          terminator: <Id.Op_Semi _>
        )
        (command.Sentence
          child: 
            (C {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <value>} 
              {(DQ (${ Id.VSub_Name RESULT))}
            )
          terminator: <Id.Op_Semi _>
        )
        (C {<assert> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <equals>} {(DQ <first>)} 
          {(DQ ($ Id.VSub_DollarName '$RESULT'))} {(DQ <'queue:peek first'>)}
        )
      ]
    )
    (command.CommandList
      children: [
        (command.Sentence
          child: 
            (C 
              {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <ArrayQueue> <Id.Lit_Other ':'> 
                <Id.Lit_Other ':'> <dequeue>
              } {($ Id.VSub_DollarName '$vCode')}
            )
          terminator: <Id.Op_Semi _>
        )
        (command.Sentence
          child: 
            (C {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <value>} 
              {(DQ (${ Id.VSub_Name RESULT))}
            )
          terminator: <Id.Op_Semi _>
        )
        (C {<assert> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <equals>} {(DQ <first>)} 
          {(DQ ($ Id.VSub_DollarName '$RESULT'))} {(DQ <'queue::dequeue first'>)}
        )
      ]
    )
    (command.CommandList
      children: [
        (command.Sentence
          child: 
            (C 
              {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <ArrayQueue> <Id.Lit_Other ':'> 
                <Id.Lit_Other ':'> <peek>
              } {($ Id.VSub_DollarName '$vCode')}
            )
          terminator: <Id.Op_Semi _>
        )
        (command.Sentence
          child: 
            (C {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <value>} 
              {(DQ (${ Id.VSub_Name RESULT))}
            )
          terminator: <Id.Op_Semi _>
        )
        (C {<assert> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <equals>} {(DQ <second>)} 
          {(DQ ($ Id.VSub_DollarName '$RESULT'))} {(DQ <'queue:peek second'>)}
        )
      ]
    )
    (command.CommandList
      children: [
        (command.Sentence
          child: 
            (C 
              {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <ArrayQueue> <Id.Lit_Other ':'> 
                <Id.Lit_Other ':'> <dequeue>
              } {($ Id.VSub_DollarName '$vCode')}
            )
          terminator: <Id.Op_Semi _>
        )
        (command.Sentence
          child: 
            (C {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <value>} 
              {(DQ (${ Id.VSub_Name RESULT))}
            )
          terminator: <Id.Op_Semi _>
        )
        (C {<assert> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <equals>} {(DQ <second>)} 
          {(DQ ($ Id.VSub_DollarName '$RESULT'))} {(DQ <'queue::dequeue second'>)}
        )
      ]
    )
    (C {<assert> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <report>})
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.AndOr
                  ops: [Id.Op_DAmp]
                  children: [
                    (C {<Id.Lit_LBracket '['>} 
                      {
                        (braced_var_sub
                          token: <Id.VSub_Number 1>
                          suffix_op: (suffix_op.Unary op_id:Id.VTest_Plus arg_word:{<isset>})
                        )
                      } {<Id.Lit_RBracket ']'>}
                    )
                    (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_Number '$1'))} 
                      {<Id.Lit_Equals '='> <Id.Lit_Equals '='>} {(DQ <debug>)} {<Id.Lit_RBracket ']'>}
                    )
                  ]
                )
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [(C {<variable> <Id.Lit_Other ':'> <Id.Lit_Other ':'> <printMetadata>})]
          spids: [1014 1044]
        )
      ]
    )
  ]
)