(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:tid)
          op: assign_op.Equal
          rhs: {(DQ <'login with different key types'>)}
          spids: [7]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:TIME)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_Backtick '`'>
                child: 
                  (command.Simple
                    words: [{<which>} {<Id.KW_Time time>}]
                    redirects: [
                      (redir
                        op: <Id.Redir_Great '2>'>
                        loc: (redir_loc.Fd fd:2)
                        arg: {<'/dev/null'>}
                      )
                    ]
                    do_fork: T
                  )
              )
            }
          spids: [13]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: (C {<test>} {<Id.KW_Bang '!'>} {<-x>} {(DQ ($ Id.VSub_DollarName '$TIME'))})
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:TIME)
                  op: assign_op.Equal
                  rhs: {(DQ )}
                  spids: [41]
                )
              ]
            )
          ]
          spids: [25 38]
        )
      ]
    )
    (C {<cp>} {($ Id.VSub_DollarName '$OBJ') <'/sshd_proxy'>} 
      {($ Id.VSub_DollarName '$OBJ') <'/sshd_proxy_bak'>}
    )
    (C {<cp>} {($ Id.VSub_DollarName '$OBJ') <'/ssh_proxy'>} 
      {($ Id.VSub_DollarName '$OBJ') <'/ssh_proxy_bak'>}
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:ktypes)
          op: assign_op.Equal
          rhs: {(DQ <'dsa-1024 rsa-2048 rsa-3072 ed25519-512'>)}
          spids: [68]
        )
      ]
    )
    (command.ForEach
      iter_name: i
      iter_words: [
        {
          (command_sub
            left_token: <Id.Left_Backtick '`'>
            child: (C {($ Id.VSub_DollarName '$SSH')} {<-Q>} {<key>})
          )
        }
      ]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (command.Case
              to_match: {(DQ ($ Id.VSub_DollarName '$i'))}
              arms: [
                (case_arm
                  pat_list: [{<ecdsa-sha2-nistp256>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:ktypes)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName '$ktypes') <' ecdsa-256'>)}
                          spids: [108]
                        )
                      ]
                    )
                  ]
                  spids: [105 106 114 -1]
                )
                (case_arm
                  pat_list: [{<ecdsa-sha2-nistp384>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:ktypes)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName '$ktypes') <' ecdsa-384'>)}
                          spids: [120]
                        )
                      ]
                    )
                  ]
                  spids: [117 118 126 -1]
                )
                (case_arm
                  pat_list: [{<ecdsa-sha2-nistp521>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:ktypes)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName '$ktypes') <' ecdsa-521'>)}
                          spids: [132]
                        )
                      ]
                    )
                  ]
                  spids: [129 130 138 -1]
                )
              ]
            )
          ]
        )
    )
    (command.ForEach
      iter_name: kt
      iter_words: [{($ Id.VSub_DollarName '$ktypes')}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (C {<rm>} {<-f>} {($ Id.VSub_DollarName '$OBJ') <'/key.'> ($ Id.VSub_DollarName '$kt')})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:bits)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_Backtick '`'>
                        child: 
                          (command.Pipeline
                            children: [
                              (C {<echo>} {(${ Id.VSub_Name kt)})
                              (C {<awk>} {<-F->} {(SQ <'{print $2}'>)})
                            ]
                            negated: F
                          )
                      )
                    }
                  spids: [168]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:type)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_Backtick '`'>
                        child: 
                          (command.Pipeline
                            children: [
                              (C {<echo>} {(${ Id.VSub_Name kt)})
                              (C {<awk>} {<-F->} {(SQ <'{print $1}'>)})
                            ]
                            negated: F
                          )
                      )
                    }
                  spids: [190]
                )
              ]
            )
            (C {<printf>} 
              {
                (DQ <'keygen '> ($ Id.VSub_DollarName '$type') <', '> ($ Id.VSub_DollarName '$bits') 
                  <' bits:'> <Id.Lit_BadBackslash '\\'> <t>
                )
              }
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {(${ Id.VSub_Name TIME)} {(${ Id.VSub_Name SSHKEYGEN)} {<-b>} 
                  {($ Id.VSub_DollarName '$bits')} {<-q>} {<-N>} {(SQ )} {<-t>} {($ Id.VSub_DollarName '$type')} {<-f>} 
                  {($ Id.VSub_DollarName '$OBJ') <'/key.'> ($ Id.VSub_DollarName '$kt')}
                )
                (C {<fail>} 
                  {
                    (DQ <'ssh-keygen for type '> ($ Id.VSub_DollarName '$type') <', '> 
                      ($ Id.VSub_DollarName '$bits') <' bits failed'>
                    )
                  }
                )
              ]
            )
          ]
        )
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:tries)
          op: assign_op.Equal
          rhs: {(DQ <'1 2 3'>)}
          spids: [270]
        )
      ]
    )
    (command.ForEach
      iter_name: ut
      iter_words: [{($ Id.VSub_DollarName '$ktypes')}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:htypes)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_DollarName '$ut')}
                  spids: [288]
                )
              ]
            )
            (command.ForEach
              iter_name: ht
              iter_words: [{($ Id.VSub_DollarName '$htypes')}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.Case
                      to_match: {($ Id.VSub_DollarName '$ht')}
                      arms: [
                        (case_arm
                          pat_list: [{<dsa-1024>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:t)
                                  op: assign_op.Equal
                                  rhs: {<ssh-dss>}
                                  spids: [319]
                                )
                              ]
                            )
                          ]
                          spids: [316 317 321 -1]
                        )
                        (case_arm
                          pat_list: [{<ecdsa-256>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:t)
                                  op: assign_op.Equal
                                  rhs: {<ecdsa-sha2-nistp256>}
                                  spids: [327]
                                )
                              ]
                            )
                          ]
                          spids: [324 325 329 -1]
                        )
                        (case_arm
                          pat_list: [{<ecdsa-384>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:t)
                                  op: assign_op.Equal
                                  rhs: {<ecdsa-sha2-nistp384>}
                                  spids: [335]
                                )
                              ]
                            )
                          ]
                          spids: [332 333 337 -1]
                        )
                        (case_arm
                          pat_list: [{<ecdsa-521>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:t)
                                  op: assign_op.Equal
                                  rhs: {<ecdsa-sha2-nistp521>}
                                  spids: [343]
                                )
                              ]
                            )
                          ]
                          spids: [340 341 345 -1]
                        )
                        (case_arm
                          pat_list: [{<ed25519-512>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:t)
                                  op: assign_op.Equal
                                  rhs: {<ssh-ed25519>}
                                  spids: [351]
                                )
                              ]
                            )
                          ]
                          spids: [348 349 353 -1]
                        )
                        (case_arm
                          pat_list: [{<rsa-> <Id.Lit_Star '*'>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:t)
                                  op: assign_op.Equal
                                  rhs: {<ssh-rsa>}
                                  spids: [360]
                                )
                              ]
                            )
                          ]
                          spids: [356 358 362 -1]
                        )
                      ]
                    )
                    (C {<trace>} 
                      {
                        (DQ <'ssh connect, userkey '> ($ Id.VSub_DollarName '$ut') <', hostkey '> 
                          ($ Id.VSub_DollarName '$ht')
                        )
                      }
                    )
                    (command.Subshell
                      child: 
                        (command.CommandList
                          children: [
                            (C {<grep>} {<-v>} {<HostKey>} 
                              {($ Id.VSub_DollarName '$OBJ') <'/sshd_proxy_bak'>}
                            )
                            (C {<echo>} {<HostKey>} 
                              {($ Id.VSub_DollarName '$OBJ') <'/key.'> ($ Id.VSub_DollarName '$ht')}
                            )
                            (C {<echo>} {<PubkeyAcceptedKeyTypes>} {($ Id.VSub_DollarName '$t')})
                            (C {<echo>} {<HostKeyAlgorithms>} {($ Id.VSub_DollarName '$t')})
                          ]
                        )
                      redirects: [
                        (redir
                          op: <Id.Redir_Great '>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {($ Id.VSub_DollarName '$OBJ') <'/sshd_proxy'>}
                        )
                      ]
                    )
                    (command.Subshell
                      child: 
                        (command.CommandList
                          children: [
                            (C {<grep>} {<-v>} {<IdentityFile>} 
                              {($ Id.VSub_DollarName '$OBJ') <'/ssh_proxy_bak'>}
                            )
                            (C {<echo>} {<IdentityFile>} 
                              {($ Id.VSub_DollarName '$OBJ') <'/key.'> ($ Id.VSub_DollarName '$ut')}
                            )
                            (C {<echo>} {<PubkeyAcceptedKeyTypes>} {($ Id.VSub_DollarName '$t')})
                            (C {<echo>} {<HostKeyAlgorithms>} {($ Id.VSub_DollarName '$t')})
                          ]
                        )
                      redirects: [
                        (redir
                          op: <Id.Redir_Great '>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {($ Id.VSub_DollarName '$OBJ') <'/ssh_proxy'>}
                        )
                      ]
                    )
                    (command.Subshell
                      child: 
                        (command.CommandList
                          children: [
                            (C {<printf>} {(SQ <'localhost-with-alias,127.0.0.1,::1 '>)})
                            (C {<cat>} 
                              {($ Id.VSub_DollarName '$OBJ') <'/key.'> ($ Id.VSub_DollarName '$ht') 
                                <.pub>
                              }
                            )
                          ]
                        )
                      redirects: [
                        (redir
                          op: <Id.Redir_Great '>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {($ Id.VSub_DollarName '$OBJ') <'/known_hosts'>}
                        )
                      ]
                    )
                    (command.Simple
                      words: [
                        {<cat>}
                        {($ Id.VSub_DollarName '$OBJ') <'/key.'> ($ Id.VSub_DollarName '$ut') <.pub>}
                      ]
                      redirects: [
                        (redir
                          op: <Id.Redir_Great '>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: 
                            {($ Id.VSub_DollarName '$OBJ') <'/authorized_keys_'> 
                              ($ Id.VSub_DollarName '$USER')
                            }
                        )
                      ]
                      do_fork: T
                    )
                    (command.ForEach
                      iter_name: i
                      iter_words: [{($ Id.VSub_DollarName '$tries')}]
                      do_arg_iter: F
                      body: 
                        (command.DoGroup
                          children: [
                            (C {<printf>} 
                              {
                                (DQ <'userkey '> ($ Id.VSub_DollarName '$ut') <', hostkey '> 
                                  (${ Id.VSub_Name ht) <':'> <Id.Lit_BadBackslash '\\'> <t>
                                )
                              }
                            )
                            (C {(${ Id.VSub_Name TIME)} {(${ Id.VSub_Name SSH)} {<-F>} 
                              {($ Id.VSub_DollarName '$OBJ') <'/ssh_proxy'>} {<999.999.999.999>} {<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 userkey '> ($ Id.VSub_DollarName '$ut') 
                                          <', hostkey '> ($ Id.VSub_DollarName '$ht') <' failed'>
                                        )
                                      }
                                    )
                                  ]
                                  spids: [553 566]
                                )
                              ]
                            )
                          ]
                        )
                    )
                  ]
                )
            )
          ]
        )
    )
  ]
)