(AndOr
  ops: [Op_DAmp]
  children: [
    (FuncDef
      name: _portinstall
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair lhs:(LhsName name:cur) op:Equal spids:[13])
                (assign_pair lhs:(LhsName name:prev) op:Equal spids:[15])
                (assign_pair lhs:(LhsName name:words) op:Equal spids:[17])
                (assign_pair lhs:(LhsName name:cword) op:Equal spids:[19])
              ]
              spids: [11]
            )
            (AndOr
              ops: [Op_DPipe]
              children: [(C {(_init_completion)}) (ControlFlow token:<ControlFlow_Return return>)]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair lhs:(LhsName name:portsdir) op:Equal spids:[32])
                (assign_pair lhs:(LhsName name:indexfile) op:Equal spids:[34])
              ]
              spids: [30]
            )
            (Assignment
              keyword: Assign_Local
              flags: [-a]
              pairs: [(assign_pair lhs:(LhsName name:COMPREPLY2) op:Equal spids:[41])]
              spids: [37]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:portsdir)
                  op: Equal
                  rhs: 
                    {
                      (BracedVarSub
                        token: <VSub_Name PORTSDIR>
                        suffix_op: 
                          (StringUnary
                            op_id: VTest_ColonHyphen
                            arg_word: {(Lit_Slash /) (usr) (Lit_Slash /) (ports)}
                          )
                        spids: [46 53]
                      ) (/)
                    }
                  spids: [45]
                )
              ]
              spids: [45]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:indexfile)
                  op: Equal
                  rhs: {($ VSub_Name '$portsdir') (/INDEX-5)}
                  spids: [62]
                )
              ]
              spids: [62]
            )
            (AndOr
              ops: [Op_DPipe]
              children: [
                (DBracket
                  expr: 
                    (LogicalAnd
                      left: 
                        (BoolBinary
                          op_id: BoolBinary_GlobDEqual
                          left: 
                            {
                              (DQ 
                                (BracedVarSub
                                  token: <VSub_Name OSTYPE>
                                  suffix_op: (StringUnary op_id:VOp1_Percent arg_word:{('.*')})
                                  spids: [74 78]
                                )
                              )
                            }
                          right: {(freebsd5)}
                        )
                      right: (BoolUnary op_id:BoolUnary_f child:{($ VSub_Name '$indexfile')})
                    )
                )
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:indexfile)
                      op: Equal
                      rhs: {($ VSub_Name '$portsdir') (/INDEX)}
                      spids: [96]
                    )
                  ]
                  spids: [96]
                )
              ]
            )
            (AndOr
              ops: [Op_DAmp]
              children: [
                (DBracket
                  expr: 
                    (LogicalOr
                      left: 
                        (BoolBinary
                          op_id: BoolBinary_GlobDEqual
                          left: {(DQ ($ VSub_Name '$prev'))}
                          right: {(-l)}
                        )
                      right: 
                        (LogicalOr
                          left: 
                            (BoolBinary
                              op_id: BoolBinary_GlobDEqual
                              left: {(DQ ($ VSub_Name '$prev'))}
                              right: {(BoolUnary_L -L)}
                            )
                          right: 
                            (BoolBinary
                              op_id: BoolBinary_GlobDEqual
                              left: {(DQ ($ VSub_Name '$prev'))}
                              right: {(BoolUnary_o -o)}
                            )
                        )
                    )
                )
                (ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})
              ]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:COMPREPLY)
                  op: Equal
                  rhs: 
                    {
                      (ArrayLiteralPart
                        words: [
                          {
                            (CommandSubPart
                              command_list: 
                                (CommandList
                                  children: [
                                    (Pipeline
                                      children: [
                                        (SimpleCommand
                                          words: [
                                            {(command)}
                                            {(grep)}
                                            {(-E)}
                                            {(DQ ('^') ($ VSub_Name '$cur'))}
                                          ]
                                          redirects: [
                                            (Redir
                                              op: <Redir_Great '2>'>
                                              fd: 2
                                              arg_word: {(/dev/null)}
                                            )
                                            (Redir
                                              op: <Redir_Less '<'>
                                              fd: 16777215
                                              arg_word: {($ VSub_Name '$indexfile')}
                                            )
                                          ]
                                        )
                                        (C {(cut)} {(-d) (SQ <'|'>)} {(-f1)})
                                      ]
                                      negated: F
                                    )
                                  ]
                                )
                              left_token: <Left_CommandSub '$('>
                              spids: [145 178]
                            )
                          }
                        ]
                      )
                    }
                  spids: [142]
                )
              ]
              spids: [142]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:COMPREPLY2)
                  op: Equal
                  rhs: 
                    {
                      (ArrayLiteralPart
                        words: [
                          {
                            (CommandSubPart
                              command_list: 
                                (CommandList
                                  children: [
                                    (Pipeline
                                      children: [
                                        (SimpleCommand
                                          words: [
                                            {(command)}
                                            {(grep)}
                                            {(-E)}
                                            {
                                              (DQ ('^[^') (Lit_Other '\\') ('|]+') (Lit_Other '\\') ('|') 
                                                ($ VSub_Name '$portsdir') ($ VSub_Name '$cur')
                                              )
                                            }
                                          ]
                                          redirects: [
                                            (Redir
                                              op: <Redir_Great '2>'>
                                              fd: 2
                                              arg_word: {(/dev/null)}
                                            )
                                            (Redir
                                              op: <Redir_Less '<'>
                                              fd: 16777215
                                              arg_word: {($ VSub_Name '$indexfile')}
                                            )
                                          ]
                                        )
                                        (C {(cut)} {(-d) (SQ <'|'>)} {(-f2)})
                                      ]
                                      negated: F
                                    )
                                  ]
                                )
                              left_token: <Left_CommandSub '$('>
                              spids: [186 224]
                            )
                          }
                        ]
                      )
                    }
                  spids: [183]
                )
              ]
              spids: [183]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:COMPREPLY2)
                  op: Equal
                  rhs: 
                    {
                      (ArrayLiteralPart
                        words: [
                          {
                            (BracedVarSub
                              token: <VSub_Name COMPREPLY2>
                              bracket_op: (WholeArray op_id:Lit_At)
                              suffix_op: 
                                (StringUnary
                                  op_id: VOp1_Pound
                                  arg_word: {($ VSub_Name '$portsdir')}
                                )
                              spids: [232 239]
                            )
                          }
                        ]
                      )
                    }
                  spids: [229]
                )
              ]
              spids: [229]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:COMPREPLY)
                  op: PlusEqual
                  rhs: 
                    {
                      (ArrayLiteralPart
                        words: [
                          {
                            (DQ 
                              (BracedVarSub
                                token: <VSub_Name COMPREPLY2>
                                bracket_op: (WholeArray op_id:Lit_At)
                                spids: [248 253]
                              )
                            )
                          }
                        ]
                      )
                    }
                  spids: [244]
                )
              ]
              spids: [244]
            )
            (ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})
          ]
          spids: [8]
        )
      spids: [4 7]
    )
    (C {(complete)} {(-F)} {(_portinstall)} {(-o)} {(dirnames)} {(portinstall)})
  ]
)