(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:tid)
          op: assign_op.Equal
          rhs: {(DQ <'port number parsing'>)}
          spids: [7]
        )
      ]
    )
    (command.ShFunction
      name: badport
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:port)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$1')}
                  spids: [20]
                )
              ]
            )
            (C {<verbose>} 
              {(DQ ($ Id.VSub_DollarName '$tid') <': invalid port '> ($ Id.VSub_DollarName '$port'))}
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Simple
                              words: [
                                {(${ Id.VSub_Name SSH)}
                                {<-F>}
                                {($ Id.VSub_DollarName '$OBJ') <'/ssh_proxy'>}
                                {<-p>}
                                {($ Id.VSub_DollarName '$port')}
                                {<somehost>}
                                {<true>}
                              ]
                              redirects: [
                                (redir
                                  op: <Id.Redir_Great '2>'>
                                  loc: (redir_loc.Fd fd:2)
                                  arg: {<'/dev/null'>}
                                )
                              ]
                              do_fork: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<fail>} 
                      {
                        (DQ ($ Id.VSub_DollarName '$tid') <' accepted invalid port '> 
                          ($ Id.VSub_DollarName '$port')
                        )
                      }
                    )
                  ]
                  spids: [33 57]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: goodport
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:port)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$1')}
                  spids: [80]
                )
              ]
            )
            (C {<verbose>} 
              {(DQ ($ Id.VSub_DollarName '$tid') <': valid port '> ($ Id.VSub_DollarName '$port'))}
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Simple
                              words: [
                                {(${ Id.VSub_Name SSH)}
                                {<-F>}
                                {($ Id.VSub_DollarName '$OBJ') <'/ssh_proxy'>}
                                {<-p>}
                                {($ Id.VSub_DollarName '$port')}
                                {<somehost>}
                                {<true>}
                              ]
                              redirects: [
                                (redir
                                  op: <Id.Redir_Great '2>'>
                                  loc: (redir_loc.Fd fd:2)
                                  arg: {<'/dev/null'>}
                                )
                              ]
                              do_fork: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [(C {<Id.Lit_Colon ':'>})]
                  spids: [93 117]
                )
              ]
              else_action: [
                (C {<fail>} 
                  {
                    (DQ ($ Id.VSub_DollarName '$tid') <' rejected valid port '> 
                      ($ Id.VSub_DollarName '$port')
                    )
                  }
                )
              ]
            )
          ]
        )
    )
    (C {<badport>} {<0>})
    (C {<badport>} {<65536>})
    (C {<badport>} {<131073>})
    (C {<badport>} {<2000blah>})
    (C {<badport>} {<blah2000>})
    (C {<goodport>} {<1>})
    (C {<goodport>} {<22>})
    (C {<goodport>} {<2222>})
    (C {<goodport>} {<22222>})
    (C {<goodport>} {<65535>})
  ]
)