(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:tid)
          op: assign_op.Equal
          rhs: {(DQ <dhgex>)}
          spids: [7]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:LOG)
          op: assign_op.Equal
          rhs: {(${ Id.VSub_Name TEST_SSH_LOGFILE)}
          spids: [13]
        )
      ]
    )
    (C {<rm>} {<-f>} {(${ Id.VSub_Name LOG)})
    (C {<cp>} {($ Id.VSub_DollarName '$OBJ') <'/sshd_proxy'>} 
      {($ Id.VSub_DollarName '$OBJ') <'/sshd_proxy_bak'>}
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:kexs)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_Backtick '`'>
                child: 
                  (command.Pipeline
                    children: [
                      (C {(${ Id.VSub_Name SSH)} {<-Q>} {<kex>})
                      (C {<grep>} {<diffie-hellman-group-exchange>})
                    ]
                    negated: F
                  )
              )
            }
          spids: [35]
        )
      ]
    )
    (command.ShFunction
      name: ssh_test_dhgex
      body: 
        (BraceGroup
          children: [
            (command.Sentence
              child: 
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:bits)
                      op: assign_op.Equal
                      rhs: {(DQ ($ Id.VSub_Number '$1'))}
                      spids: [62]
                    )
                  ]
                )
              terminator: <Id.Op_Semi _>
            )
            (C {<shift>})
            (command.Sentence
              child: 
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:cipher)
                      op: assign_op.Equal
                      rhs: {(DQ ($ Id.VSub_Number '$1'))}
                      spids: [71]
                    )
                  ]
                )
              terminator: <Id.Op_Semi _>
            )
            (C {<shift>})
            (command.Sentence
              child: 
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:kex)
                      op: assign_op.Equal
                      rhs: {(DQ ($ Id.VSub_Number '$1'))}
                      spids: [80]
                    )
                  ]
                )
              terminator: <Id.Op_Semi _>
            )
            (C {<shift>})
            (C {<cp>} {($ Id.VSub_DollarName '$OBJ') <'/sshd_proxy_bak'>} 
              {($ Id.VSub_DollarName '$OBJ') <'/sshd_proxy'>}
            )
            (command.Simple
              words: [{<echo>} {(DQ <'KexAlgorithms='> ($ Id.VSub_DollarName '$kex'))}]
              redirects: [
                (redir
                  op: <Id.Redir_DGreat '>>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {($ Id.VSub_DollarName '$OBJ') <'/sshd_proxy'>}
                )
              ]
              do_fork: T
            )
            (command.Simple
              words: [{<echo>} {(DQ <'Ciphers='> ($ Id.VSub_DollarName '$cipher'))}]
              redirects: [
                (redir
                  op: <Id.Redir_DGreat '>>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {($ Id.VSub_DollarName '$OBJ') <'/sshd_proxy'>}
                )
              ]
              do_fork: T
            )
            (C {<rm>} {<-f>} {(${ Id.VSub_Name LOG)})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:opts)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ <'-oKexAlgorithms='> ($ Id.VSub_DollarName '$kex') <' -oCiphers='> 
                        ($ Id.VSub_DollarName '$cipher')
                      )
                    }
                  spids: [134]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:min)
                  op: assign_op.Equal
                  rhs: {<2048>}
                  spids: [143]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:max)
                  op: assign_op.Equal
                  rhs: {<8192>}
                  spids: [147]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:groupsz)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ ($ Id.VSub_DollarName '$min') <'<'> ($ Id.VSub_DollarName '$bits') <'<'> 
                        ($ Id.VSub_DollarName '$max')
                      )
                    }
                  spids: [151]
                )
              ]
            )
            (C {<verbose>} 
              {
                (DQ ($ Id.VSub_DollarName '$tid') <' bits '> ($ Id.VSub_DollarName '$bits') <' '> 
                  ($ Id.VSub_DollarName '$kex') <' '> ($ Id.VSub_DollarName '$cipher')
                )
              }
            )
            (C {(${ Id.VSub_Name SSH)} {(${ Id.VSub_Name opts)} {($ Id.VSub_At '$@')} {<-vvv>} {<-F>} 
              {(${ Id.VSub_Name OBJ) <'/ssh_proxy'>} {<somehost>} {<true>}
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {($ Id.VSub_QMark '$?')} {<-ne>} {<0>} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [(C {<fail>} {(DQ <'ssh failed ('> ($ Id.VSub_At '$@') <')'>)})]
                  spids: [198 211]
                )
              ]
            )
            (command.Simple
              words: [
                {<grep>}
                {(DQ <'SSH2_MSG_KEX_DH_GEX_REQUEST('> ($ Id.VSub_DollarName '$groupsz') <') sent'>)}
                {(${ Id.VSub_Name LOG)}
              ]
              redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<'/dev/null'>})]
              do_fork: T
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {($ Id.VSub_QMark '$?')} 
                              {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {<0>} {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:got)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_Backtick '`'>
                                child: 
                                  (C {<egrep>} {(DQ <'SSH2_MSG_KEX_DH_GEX_REQUEST(.*) sent'>)} 
                                    {(${ Id.VSub_Name LOG)}
                                  )
                              )
                            }
                          spids: [263]
                        )
                      ]
                    )
                    (C {<fail>} 
                      {
                        (DQ ($ Id.VSub_DollarName '$tid') <' unexpected GEX sizes, expected '> 
                          ($ Id.VSub_DollarName '$groupsz') <', got '> ($ Id.VSub_DollarName '$got')
                        )
                      }
                    )
                  ]
                  spids: [246 260]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:gotbits)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (command_sub
                          left_token: <Id.Left_Backtick '`'>
                          child: 
                            (command.Pipeline
                              children: [
                                (C {<awk>} {(SQ <'/bits set:/{print $4}'>)} {(${ Id.VSub_Name LOG)})
                                (C {<head>} {<-1>})
                                (C {<cut>} {<-f2>} {<'-d/'>})
                              ]
                              negated: F
                            )
                        )
                      )
                    }
                  spids: [297]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$gotbits'))} {<-lt>} 
                              {(DQ ($ Id.VSub_DollarName '$bits'))} {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<fatal>} 
                      {
                        (DQ ($ Id.VSub_DollarName '$tid') <' expected '> ($ Id.VSub_DollarName '$bits') 
                          <' bit group, got '> ($ Id.VSub_DollarName '$gotbits')
                        )
                      }
                    )
                  ]
                  spids: [329 346]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: check
      body: 
        (BraceGroup
          children: [
            (command.Sentence
              child: 
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:bits)
                      op: assign_op.Equal
                      rhs: {(DQ ($ Id.VSub_Number '$1'))}
                      spids: [372]
                    )
                  ]
                )
              terminator: <Id.Op_Semi _>
            )
            (C {<shift>})
            (command.ForEach
              iter_name: c
              iter_words: [{($ Id.VSub_At '$@')}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.ForEach
                      iter_name: k
                      iter_words: [{($ Id.VSub_DollarName '$kexs')}]
                      do_arg_iter: F
                      body: 
                        (command.DoGroup
                          children: [
                            (C {<ssh_test_dhgex>} {($ Id.VSub_DollarName '$bits')} 
                              {($ Id.VSub_DollarName '$c')} {($ Id.VSub_DollarName '$k')}
                            )
                          ]
                        )
                    )
                  ]
                )
            )
          ]
        )
    )
    (C {<check>} {<3072>} 
      {
        (command_sub
          left_token: <Id.Left_Backtick '`'>
          child: 
            (command.Pipeline
              children: [(C {(${ Id.VSub_Name SSH)} {<-Q>} {<cipher>}) (C {<grep>} {<128>})]
              negated: F
            )
        )
      }
    )
    (C {<check>} {<3072>} {<arcfour>} {<blowfish-cbc>})
    (C {<check>} {<7680>} 
      {
        (command_sub
          left_token: <Id.Left_Backtick '`'>
          child: 
            (command.Pipeline
              children: [(C {(${ Id.VSub_Name SSH)} {<-Q>} {<cipher>}) (C {<grep>} {<192>})]
              negated: F
            )
        )
      }
    )
    (C {<check>} {<8192>} 
      {
        (command_sub
          left_token: <Id.Left_Backtick '`'>
          child: 
            (command.Pipeline
              children: [(C {(${ Id.VSub_Name SSH)} {<-Q>} {<cipher>}) (C {<grep>} {<256>})]
              negated: F
            )
        )
      }
    )
    (C {<check>} {<8192>} {<rijndael-cbc> <Id.Lit_Splice '@lysator'> <.liu.se>} 
      {<chacha20-poly1305> <Id.Lit_Splice '@openssh'> <.com>}
    )
  ]
)