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

```asm
<validateBase>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %esi,%r13d
  push   %r12
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    -0x2(%rsi),%eax
  cmp    $0x21,%eax
  ja     L51
  sub    $0x2,%ebp
  cmp    $0x21,%ebp
  ja     L6
L18:
  mov    %rbx,%rdi
  call   <strlen@plt>
  cmp    $0x20,%eax
  jg     L47
L29:
  cmp    $0xa,%r13d
  jle    L56
  movdqa D19(%rip),%xmm0
  lea    0x10(%rsp),%rax
  movsbl (%rbx),%edi
  xor    %ebp,%ebp
  movl   $0x5a595857,0x30(%rsp)
  movaps %xmm0,0x10(%rsp)
  movdqa D25(%rip),%xmm0
  mov    %rax,0x8(%rsp)
  lea    -0x1(%r13),%eax
  movaps %xmm0,0x20(%rsp)
  lea    0x11(%rsp,%rax,1),%r12
  nopl   0x0(%rax,%rax,1)
L114:
  mov    0x8(%rsp),%r14
  mov    $0x1,%r15d
  jmp    L19
  nopl   (%rax)
L64:
  movsbl (%rbx),%edi
L19:
  call   <toupper@plt>
  cmp    (%r14),%al
  cmove  %ebp,%r15d
  add    $0x1,%r14
  cmp    %r12,%r14
  jne    L64
  cmp    $0x1,%r15d
  je     L13
L89:
  movsbl 0x1(%rbx),%edi
  add    $0x1,%rbx
  test   %dil,%dil
  jne    L114
L56:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L45
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L13:
  movsbl (%rbx),%esi
  mov    %r13d,%edx
  lea    D60(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D1(%rip),%rdi
  call   <puts@plt>
  xor    %edi,%edi
  call   <exit@plt>
  jmp    L89
L51:
  lea    D50(%rip),%rdi
  sub    $0x2,%ebp
  call   <puts@plt>
  xor    %edi,%edi
  call   <exit@plt>
  cmp    $0x21,%ebp
  jbe    L18
L6:
  lea    D50(%rip),%rdi
  call   <puts@plt>
  xor    %edi,%edi
  call   <exit@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  cmp    $0x20,%eax
  jle    L29
L47:
  lea    D52(%rip),%rdi
  call   <puts@plt>
  xor    %edi,%edi
  call   <exit@plt>
  jmp    L29
L45:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D19
datatype: byte[16]
name: disassemble_data
arguments: tag: D25
datatype: byte[16]
name: disassemble_data
arguments: tag: D60
datatype: string
name: disassemble_data
arguments: tag: D1
datatype: string
name: disassemble_data
arguments: tag: D50
datatype: string
name: disassemble_data
arguments: tag: D52
datatype: string

tool: {"D19": [0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x41,0x42,0x43,0x44,0x45,0x46]}

tool: {"D25": [0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52,0x53,0x54,0x55,0x56]}

tool: D60: Quitting for %c with base %d


tool: D1: The entered number is invalid for the given base

tool: D50: The bases should lie between 2 and 35

tool: D52: The entered number is longer than 32 digits, please enter a smaller number

assistant: ```c
void validateBase(char num[], int frombase, int tobase) {
  if (frombase < 2 || frombase > 35) {
    printf("The bases should lie between 2 and 35\n");
    exit(0);
  }
  if (tobase < 2 || tobase > 35) {
    printf("The bases should lie between 2 and 35\n");
    exit(0);
  }
  if (strlen(num) > 32) {
    printf("The entered number is longer than 32 digits, please enter a smaller number\n");
    exit(0);
  }
  if (frombase > 10) {
    char base_digits[36] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};
    int i;
    i = 0;
    do {
      int j;
      int invalid = 1;
      for (j = 0; j < frombase; j++) {
        if (toupper(num[i]) == base_digits[j]) {
          invalid = 0;
        }
      }
      if (invalid == 1) {
        printf("Quitting for %c with base %d\n", num[i], frombase);
        printf("The entered number is invalid for the given base\n");
        exit(0);
      }
      i++;
    } while (num[i] != '\0');
  }
}
```