(command.ShFunction
  name: validint
  body: 
    (command.BraceGroup
      children: [
        (command.Sentence
          child: 
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:number)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$1'))}
                  spids: [27]
                )
              ]
            )
          terminator: (Token id:Id.Op_Semi val:';' span_id:31)
        )
        (command.Sentence
          child: 
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:min)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$2'))}
                  spids: [33]
                )
              ]
            )
          terminator: (Token id:Id.Op_Semi val:';' span_id:37)
        )
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:max)
              op: assign_op.Equal
              rhs: {(DQ ($ Id.VSub_Number '$3'))}
              spids: [39]
            )
          ]
        )
        (command.If
          arms: [
            (if_arm
              cond: [
                (command.Sentence
                  child: 
                    (C {(Id.Lit_LBracket '[')} {(-z)} {($ Id.VSub_DollarName '$number')} 
                      {(Id.Lit_RBracket ']')}
                    )
                  terminator: (Token id:Id.Op_Semi val:';' span_id:56)
                )
              ]
              action: [
                (command.Sentence
                  child: 
                    (command.Simple
                      words: [{(echo)} {(DQ ("You didn't enter anything. Please enter a number."))}]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:67)
                          fd: -1
                          arg_word: {(2)}
                        )
                      ]
                    )
                  terminator: (Token id:Id.Op_Semi val:';' span_id:70)
                )
                (command.ControlFlow
                  token: (Token id:Id.ControlFlow_Return val:return span_id:72)
                  arg_word: {(1)}
                )
              ]
              spids: [46 58]
            )
          ]
        )
        (command.If
          arms: [
            (if_arm
              cond: [
                (command.Sentence
                  child: 
                    (C {(Id.Lit_LBracket '[')} 
                      {
                        (DQ 
                          (braced_var_sub
                            token: (Token id:Id.VSub_Name val:number span_id:91)
                            suffix_op: 
                              (suffix_op.Unary
                                op_id: Id.VOp1_Percent
                                arg_word: 
                                  {
                                    (braced_var_sub
                                      token: (Token id:Id.VSub_Name val:number span_id:94)
                                      suffix_op: (suffix_op.Unary op_id:Id.VOp1_Pound arg_word:{('?')})
                                    )
                                  }
                              )
                          )
                        )
                      } {(Id.Lit_Equals '=')} {(DQ (-))} {(Id.Lit_RBracket ']')}
                    )
                  terminator: (Token id:Id.Op_Semi val:';' span_id:109)
                )
              ]
              action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:testvalue)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (DQ 
                            (braced_var_sub
                              token: (Token id:Id.VSub_Name val:number span_id:117)
                              suffix_op: (suffix_op.Unary op_id:Id.VOp1_Pound arg_word:{('?')})
                            )
                          )
                        }
                      spids: [114]
                    )
                  ]
                )
              ]
              spids: [85 111]
            )
          ]
          else_action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:testvalue)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_DollarName '$number'))}
                  spids: [130]
                )
              ]
            )
          ]
        )
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:nodigits)
              op: assign_op.Equal
              rhs: 
                {
                  (DQ 
                    (command_sub
                      left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:147)
                      command_list: 
                        (command.CommandList
                          children: [
                            (command.Pipeline
                              children: [
                                (C {(echo)} {($ Id.VSub_DollarName '$testvalue')})
                                (C {(sed)} 
                                  {(SQ (Token id:Id.Lit_Chars val:'s/[[:digit:]]//g' span_id:157))}
                                )
                              ]
                              negated: F
                            )
                          ]
                        )
                    )
                  )
                }
              spids: [145]
            )
          ]
        )
        (command.If
          arms: [
            (if_arm
              cond: [
                (command.Sentence
                  child: 
                    (C {(Id.Lit_LBracket '[')} {(Id.KW_Bang '!')} {(-z)} 
                      {($ Id.VSub_DollarName '$nodigits')} {(Id.Lit_RBracket ']')}
                    )
                  terminator: (Token id:Id.Op_Semi val:';' span_id:181)
                )
              ]
              action: [
                (command.Simple
                  words: [{(echo)} {(DQ ('Invalid number format! Only digits, no commas, spaces, etc'))}]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:192)
                      fd: -1
                      arg_word: {(2)}
                    )
                  ]
                )
                (command.ControlFlow
                  token: (Token id:Id.ControlFlow_Return val:return span_id:196)
                  arg_word: {(1)}
                )
              ]
              spids: [169 183]
            )
          ]
        )
        (command.If
          arms: [
            (if_arm
              cond: [
                (command.Sentence
                  child: 
                    (C {(Id.Lit_LBracket '[')} {(Id.KW_Bang '!')} {(-z)} {($ Id.VSub_DollarName '$min')} 
                      {(Id.Lit_RBracket ']')}
                    )
                  terminator: (Token id:Id.Op_Semi val:';' span_id:218)
                )
              ]
              action: [
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (command.Sentence
                          child: 
                            (C {(Id.Lit_LBracket '[')} {(DQ ($ Id.VSub_DollarName '$number'))} {(-lt)} 
                              {(DQ ($ Id.VSub_DollarName '$min'))} {(Id.Lit_RBracket ']')}
                            )
                          terminator: (Token id:Id.Op_Semi val:';' span_id:243)
                        )
                      ]
                      action: [
                        (command.Simple
                          words: [
                            {(echo)}
                            {
                              (DQ ($ Id.VSub_DollarName '$number') 
                                (' is too small: smallest acceptable value is ') ($ Id.VSub_DollarName '$min')
                              )
                            }
                          ]
                          redirects: [
                            (redir.Redir
                              op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:256)
                              fd: -1
                              arg_word: {(2)}
                            )
                          ]
                        )
                        (command.ControlFlow
                          token: (Token id:Id.ControlFlow_Return val:return span_id:260)
                          arg_word: {(1)}
                        )
                      ]
                      spids: [227 245]
                    )
                  ]
                )
              ]
              spids: [206 220]
            )
          ]
        )
        (command.If
          arms: [
            (if_arm
              cond: [
                (command.Sentence
                  child: 
                    (C {(Id.Lit_LBracket '[')} {(Id.KW_Bang '!')} {(-z)} {($ Id.VSub_DollarName '$max')} 
                      {(Id.Lit_RBracket ']')}
                    )
                  terminator: (Token id:Id.Op_Semi val:';' span_id:283)
                )
              ]
              action: [
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (command.Sentence
                          child: 
                            (C {(Id.Lit_LBracket '[')} {(DQ ($ Id.VSub_DollarName '$number'))} {(-gt)} 
                              {(DQ ($ Id.VSub_DollarName '$max'))} {(Id.Lit_RBracket ']')}
                            )
                          terminator: (Token id:Id.Op_Semi val:';' span_id:308)
                        )
                      ]
                      action: [
                        (command.Simple
                          words: [
                            {(echo)}
                            {
                              (DQ ('Your value is too big: largest acceptable value is ') 
                                ($ Id.VSub_DollarName '$max')
                              )
                            }
                          ]
                          redirects: [
                            (redir.Redir
                              op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:320)
                              fd: -1
                              arg_word: {(2)}
                            )
                          ]
                        )
                        (command.ControlFlow
                          token: (Token id:Id.ControlFlow_Return val:return span_id:324)
                          arg_word: {(1)}
                        )
                      ]
                      spids: [292 310]
                    )
                  ]
                )
              ]
              spids: [271 285]
            )
          ]
        )
        (command.ControlFlow
          token: (Token id:Id.ControlFlow_Return val:return span_id:335)
          arg_word: {(0)}
        )
      ]
    )
)