user: Converte this assembly snippet into its equivalent C code:

```asm
<ibase>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  movl   $0xffffffff,-0x10(%rbp)
  movl   $0xffffffff,-0xc(%rbp)
  movl   $0x0,-0x4(%rbp)
  movl   $0x0,-0x8(%rbp)
  cmpl   $0x5,-0x14(%rbp)
  jg     L61
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <noArgument@plt>
L61:
  movl   $0x1,-0x8(%rbp)
  jmp    L102
L53:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  lea    D11(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L134
  addl   $0x1,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  cmp    $0x24,%eax
  jg     L119
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  cmp    $0x1,%eax
  jle    L119
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x10(%rbp)
  jmp    L50
L119:
  mov    $0x0,%eax
  call   <baseNotSupported@plt>
  jmp    L50
L134:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  lea    D10(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L49
  addl   $0x1,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  cmp    $0x24,%eax
  jg     L19
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  cmp    $0x1,%eax
  jle    L19
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0xc(%rbp)
  jmp    L50
L19:
  mov    $0x0,%eax
  call   <baseNotSupported@plt>
  jmp    L50
L49:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  lea    D31(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L170
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <showUsage@plt>
  jmp    L169
L170:
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <invalidArgument@plt>
L50:
  addl   $0x1,-0x8(%rbp)
L102:
  cmpl   $0x3,-0x8(%rbp)
  jle    L53
  cmpl   $0x0,-0x4(%rbp)
  jne    L17
  mov    -0xc(%rbp),%edx
  mov    -0x10(%rbp),%eax
  mov    %eax,%esi
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L165
L115:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0xc(%rbp),%edx
  mov    -0x10(%rbp),%ecx
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <convertBase@plt>
  addl   $0x1,-0x8(%rbp)
L165:
  mov    -0x8(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L115
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L169
L17:
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <showUsage@plt>
L169:
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D11
datatype: string
name: read_data
arguments: tag: D10
datatype: string
name: read_data
arguments: tag: D31
datatype: string
name: read_data
arguments: tag: D8
datatype: string

tool: D11: -i

tool: D10: -o

tool: D31: -h

tool: D8: Base %d to %d, output: 

assistant: ```c
void ibase(int argc, char **argv, char *applet) {
  int in_base = -1, out_base = -1;
  bool pr_help = false;
  int arg = 0;
  if (argc < 6) {
    noArgument(applet);
  }
  for (arg = 1; arg < 4; arg++) {
    if (strcmp(argv[arg], "-i") == 0) {
      arg++;
      if (atoi(argv[arg]) <= 36 && atoi(argv[arg]) > 1) {
        in_base = atoi(argv[arg]);
      } else {
        baseNotSupported();
      }
    } else if (strcmp(argv[arg], "-o") == 0) {
      arg++;
      if (atoi(argv[arg]) <= 36 && atoi(argv[arg]) > 1) {
        out_base = atoi(argv[arg]);
      } else {
        baseNotSupported();
      }
    } else if (strcmp(argv[arg], "-h") == 0) {
      showUsage(applet);
      return;
    } else {
      invalidArgument(applet);
    }
  }
  if (!pr_help) {
    printf("Base %d to %d, output:\x20", in_base, out_base);
    for (; arg < argc; arg++) {
      convertBase(argv[arg], in_base, out_base);
    }
    printf("\n");
  } else {
    showUsage(applet);
  }
}
```