(CommandList
  children: [
    (AndOr
      children: [
        (C {(Lit_Other '[')} {(-f)} {(/etc/profile.d/modules.sh)} {(Lit_Other ']')})
        (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)})
      ]
      op_id: Op_DPipe
    )
    (FuncDef
      name: _module_list
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:modules)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (CommandSubPart
                          command_list: 
                            (CommandList
                              children: [
                                (Pipeline
                                  children: [
                                    (SimpleCommand
                                      words: [{(sed)} {(SQ <'s/:/ /g'>)}]
                                      redirects: [
                                        (Redir
                                          op_id: Redir_TLess
                                          fd: 16777215
                                          arg_word: {($ VSub_Name '$LOADEDMODULES')}
                                          spids: [96]
                                        )
                                      ]
                                    )
                                    (C {(sort)})
                                  ]
                                  negated: False
                                )
                              ]
                            )
                          left_token: <Left_CommandSub '$('>
                          spids: [88 103]
                        )
                      )
                    }
                  spids: [86]
                )
              ]
              spids: [84]
            )
            (C {(compgen)} {(-W)} {(DQ ($ VSub_Name '$modules'))} {(--)} {($ VSub_Number '$1')})
          ]
          spids: [81]
        )
      spids: [76 80]
    )
    (FuncDef
      name: _module_path
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:modules)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (CommandSubPart
                          command_list: 
                            (CommandList
                              children: [
                                (Pipeline
                                  children: [
                                    (SimpleCommand
                                      words: [{(sed)} {(SQ <'s/:/ /g'>)}]
                                      redirects: [
                                        (Redir
                                          op_id: Redir_TLess
                                          fd: 16777215
                                          arg_word: {($ VSub_Name '$MODULEPATH')}
                                          spids: [142]
                                        )
                                      ]
                                    )
                                    (C {(sort)})
                                  ]
                                  negated: False
                                )
                              ]
                            )
                          left_token: <Left_CommandSub '$('>
                          spids: [134 149]
                        )
                      )
                    }
                  spids: [132]
                )
              ]
              spids: [130]
            )
            (C {(compgen)} {(-W)} {(DQ ($ VSub_Name '$modules'))} {(--)} {($ VSub_Number '$1')})
          ]
          spids: [127]
        )
      spids: [122 126]
    )
    (FuncDef
      name: _module_avail
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:modules)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (CommandSubPart
                          command_list: 
                            (CommandList
                              children: [
                                (Pipeline
                                  children: [
                                    (SimpleCommand
                                      words: [{(module)} {(avail)}]
                                      redirects: [
                                        (Redir
                                          op_id: Redir_GreatAnd
                                          fd: 2
                                          arg_word: {(1)}
                                          spids: [188]
                                        )
                                      ]
                                    )
                                    (C {(command)} {(grep)} {(-E)} {(-v)} {(SQ <'^(-|$)'>)})
                                    (C {(xargs)} {(printf)} {(SQ <'%s\\n'>)})
                                    (C {(sed)} {(-e)} {(SQ <'s/(default)//g'>)})
                                    (C {(sort)})
                                  ]
                                  negated: False
                                )
                              ]
                            )
                          left_token: <Left_CommandSub '$('>
                          spids: [180 233]
                        )
                      )
                    }
                  spids: [178]
                )
              ]
              spids: [176]
            )
            (C {(compgen)} {(-W)} {(DQ ($ VSub_Name '$modules'))} {(--)} {($ VSub_Number '$1')})
          ]
          spids: [173]
        )
      spids: [168 172]
    )
    (AndOr
      children: [
        (FuncDef
          name: _module
          body: 
            (BraceGroup
              children: [
                (Assignment
                  keyword: Assign_Local
                  pairs: [
                    (assign_pair lhs:(LhsName name:cur) op:Equal spids:[266])
                    (assign_pair lhs:(LhsName name:prev) op:Equal spids:[268])
                    (assign_pair lhs:(LhsName name:words) op:Equal spids:[270])
                    (assign_pair lhs:(LhsName name:cword) op:Equal spids:[272])
                  ]
                  spids: [264]
                )
                (AndOr
                  children: [(C {(_init_completion)}) (ControlFlow token:<ControlFlow_Return return>)]
                  op_id: Op_DPipe
                )
                (If
                  arms: [
                    (if_arm
                      cond: [
                        (Sentence
                          child: 
                            (DBracket
                              expr: 
                                (BoolBinary
                                  op_id: BoolBinary_eq
                                  left: {($ VSub_Name '$cword')}
                                  right: {(1)}
                                )
                            )
                          terminator: <Op_Semi ';'>
                        )
                      ]
                      action: [
                        (Assignment
                          keyword: Assign_Local
                          pairs: [(assign_pair lhs:(LhsName name:options) op:Equal spids:[306])]
                          spids: [304]
                        )
                        (Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (LhsName name:options)
                              op: Equal
                              rhs: 
                                {
                                  (DQ 
                                    (CommandSubPart
                                      command_list: 
                                        (CommandList
                                          children: [
                                            (Pipeline
                                              children: [
                                                (SimpleCommand
                                                  words: [{(module)} {(help)}]
                                                  redirects: [
                                                    (Redir
                                                      op_id: Redir_GreatAnd
                                                      fd: 2
                                                      arg_word: {(1)}
                                                      spids: [317]
                                                    )
                                                  ]
                                                )
                                                (C {(command)} {(grep)} {(-E)} {(SQ <'^[[:space:]]*\\+'>)})
                                                (C {(awk)} {(SQ <'{print $2}'>)})
                                                (C {(sed)} {(-e)} {(SQ <'s/|/ /g'>)})
                                                (C {(sort)})
                                              ]
                                              negated: False
                                            )
                                          ]
                                        )
                                      left_token: <Left_CommandSub '$('>
                                      spids: [311 356]
                                    )
                                  )
                                }
                              spids: [309]
                            )
                          ]
                          spids: [309]
                        )
                        (Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (LhsName name:COMPREPLY)
                              op: Equal
                              rhs: 
                                {
                                  (ArrayLiteralPart
                                    words: [
                                      {
                                        (CommandSubPart
                                          command_list: 
                                            (CommandList
                                              children: [
                                                (C {(compgen)} {(-W)} {(DQ ($ VSub_Name '$options'))} 
                                                  {(--)} {(DQ ($ VSub_Name '$cur'))}
                                                )
                                              ]
                                            )
                                          left_token: <Left_CommandSub '$('>
                                          spids: [364 378]
                                        )
                                      }
                                    ]
                                  )
                                }
                              spids: [361]
                            )
                          ]
                          spids: [361]
                        )
                      ]
                      spids: [16777215 296]
                    )
                    (if_arm
                      cond: [
                        (Sentence
                          child: 
                            (DBracket
                              expr: 
                                (BoolBinary
                                  op_id: BoolBinary_eq
                                  left: {($ VSub_Name '$cword')}
                                  right: {(2)}
                                )
                            )
                          terminator: <Op_Semi ';'>
                        )
                      ]
                      action: [
                        (Case
                          to_match: {($ VSub_Name '$prev')}
                          arms: [
                            (case_arm
                              pat_list: [{(add)} {(display)} {(help)} {(load)} {(show)} {(whatis)}]
                              action: [
                                (Assignment
                                  keyword: Assign_None
                                  pairs: [
                                    (assign_pair
                                      lhs: (LhsName name:COMPREPLY)
                                      op: Equal
                                      rhs: 
                                        {
                                          (ArrayLiteralPart
                                            words: [
                                              {
                                                (CommandSubPart
                                                  command_list: 
                                                    (CommandList
                                                      children: [
                                                        (C {(_module_avail)} {(DQ ($ VSub_Name '$cur'))})
                                                      ]
                                                    )
                                                  left_token: <Left_CommandSub '$('>
                                                  spids: [424 430]
                                                )
                                              }
                                            ]
                                          )
                                        }
                                      spids: [421]
                                    )
                                  ]
                                  spids: [421]
                                )
                              ]
                              spids: [407 418 435 16777215]
                            )
                            (case_arm
                              pat_list: [{(rm)} {(switch)} {(swap)} {(unload)} {(update)}]
                              action: [
                                (Assignment
                                  keyword: Assign_None
                                  pairs: [
                                    (assign_pair
                                      lhs: (LhsName name:COMPREPLY)
                                      op: Equal
                                      rhs: 
                                        {
                                          (ArrayLiteralPart
                                            words: [
                                              {
                                                (CommandSubPart
                                                  command_list: 
                                                    (CommandList
                                                      children: [
                                                        (C {(_module_list)} {(DQ ($ VSub_Name '$cur'))})
                                                      ]
                                                    )
                                                  left_token: <Left_CommandSub '$('>
                                                  spids: [453 459]
                                                )
                                              }
                                            ]
                                          )
                                        }
                                      spids: [450]
                                    )
                                  ]
                                  spids: [450]
                                )
                              ]
                              spids: [438 447 464 16777215]
                            )
                            (case_arm
                              pat_list: [{(unuse)}]
                              action: [
                                (Assignment
                                  keyword: Assign_None
                                  pairs: [
                                    (assign_pair
                                      lhs: (LhsName name:COMPREPLY)
                                      op: Equal
                                      rhs: 
                                        {
                                          (ArrayLiteralPart
                                            words: [
                                              {
                                                (CommandSubPart
                                                  command_list: 
                                                    (CommandList
                                                      children: [
                                                        (C {(_module_path)} {(DQ ($ VSub_Name '$cur'))})
                                                      ]
                                                    )
                                                  left_token: <Left_CommandSub '$('>
                                                  spids: [474 480]
                                                )
                                              }
                                            ]
                                          )
                                        }
                                      spids: [471]
                                    )
                                  ]
                                  spids: [471]
                                )
                              ]
                              spids: [467 468 485 16777215]
                            )
                          ]
                          spids: [400 404 488]
                        )
                      ]
                      spids: [384 397]
                    )
                    (if_arm
                      cond: [
                        (Sentence
                          child: 
                            (DBracket
                              expr: 
                                (BoolBinary
                                  op_id: BoolBinary_eq
                                  left: {($ VSub_Name '$cword')}
                                  right: {(3)}
                                )
                            )
                          terminator: <Op_Semi ';'>
                        )
                      ]
                      action: [
                        (Case
                          to_match: 
                            {
                              (BracedVarSub
                                token: <VSub_Name words>
                                bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 1)}))
                                spids: [509 514]
                              )
                            }
                          arms: [
                            (case_arm
                              pat_list: [{(swap)} {(switch)}]
                              action: [
                                (Assignment
                                  keyword: Assign_None
                                  pairs: [
                                    (assign_pair
                                      lhs: (LhsName name:COMPREPLY)
                                      op: Equal
                                      rhs: 
                                        {
                                          (ArrayLiteralPart
                                            words: [
                                              {
                                                (CommandSubPart
                                                  command_list: 
                                                    (CommandList
                                                      children: [
                                                        (C {(_module_avail)} {(DQ ($ VSub_Name '$cur'))})
                                                      ]
                                                    )
                                                  left_token: <Left_CommandSub '$('>
                                                  spids: [528 534]
                                                )
                                              }
                                            ]
                                          )
                                        }
                                      spids: [525]
                                    )
                                  ]
                                  spids: [525]
                                )
                              ]
                              spids: [519 522 539 16777215]
                            )
                          ]
                          spids: [507 516 542]
                        )
                      ]
                      spids: [491 504]
                    )
                  ]
                  spids: [16777215 545]
                )
                (ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})
              ]
              spids: [261]
            )
          spids: [256 260]
        )
        (C {(complete)} {(-F)} {(_module)} {(-o)} {(default)} {(module)})
      ]
      op_id: Op_DAmp
    )
  ]
)