(command.CommandList
  children: [
    (command.ShFunction
      name: print_version_string
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Simple
                      words: [{(grep)} {(GIT)} {(DQ ($ Id.VSub_Number '$1'))}]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_Great val:'>' span_id:20)
                          fd: -1
                          arg_word: {(/dev/null)}
                        )
                      ]
                    )
                  ]
                  action: [
                    (command.Simple
                      words: [{(read)} {(ver)}]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_Less val:'<' span_id:31)
                          fd: -1
                          arg_word: {(DQ ($ Id.VSub_Number '$1'))}
                        )
                      ]
                    )
                    (command.Pipeline
                      children: [
                        (C {(echo)} {($ Id.VSub_DollarName '$ver')})
                        (C {(tr)} {(-d)} {(SQ (Token id:Id.Lit_Chars val:'\\012' span_id:48))})
                      ]
                      negated: F
                    )
                    (C {(date)} 
                      {(Id.Lit_Other '+') (_) (Id.Lit_Other '%') (Y_) (Id.Lit_Other '%') (m_) 
                        (Id.Lit_Other '%') (d)
                      }
                    )
                  ]
                  spids: [10 24]
                )
              ]
              else_action: [(C {(cat)} {(DQ ($ Id.VSub_Number '$1'))})]
            )
          ]
        )
    )
    (command.If
      arms: [
        (if_arm
          cond: [(C {(test)} {($ Id.VSub_Pound '$#')} {(Id.KW_Bang '!') (Id.Lit_Equals '=')} {(3)})]
          action: [
            (command.Simple
              words: [
                {(echo)}
                {(DQ ('Usage: gen_version_header.sh <version file> <template> <output file>'))}
              ]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'1>&' span_id:98)
                  fd: 1
                  arg_word: {(2)}
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:102)
              arg_word: {(1)}
            )
          ]
          spids: [78 89]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:version_string)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: (Token id:Id.Left_Backtick val:'`' span_id:109)
                command_list: 
                  (command.CommandList
                    children: [(C {(print_version_string)} {(DQ ($ Id.VSub_Number '$1'))})]
                  )
              )
            }
          spids: [108]
        )
      ]
    )
    (command.Simple
      words: [
        {(sed)}
        {(DQ ('s/%%LIBPCAP_VERSION%%/') ($ Id.VSub_DollarName '$version_string') (/))}
        {(DQ ($ Id.VSub_Number '$2'))}
      ]
      redirects: [
        (redir.Redir
          op: (Token id:Id.Redir_Great val:'>' span_id:131)
          fd: -1
          arg_word: {(DQ ($ Id.VSub_Number '$3'))}
        )
      ]
    )
  ]
)