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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x28(%rbp)
  movl   $0x0,-0x20(%rbp)
  lea    -0x2c(%rbp),%rax
  mov    %rax,%rsi
  lea    D10(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0x2c(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L128
L142:
  mov    -0x2c(%rbp),%eax
  cltd
  shr    $0x1c,%edx
  add    %edx,%eax
  and    $0xf,%eax
  sub    %edx,%eax
  mov    %eax,-0x18(%rbp)
  cmpl   $0x9,-0x18(%rbp)
  jg     L19
  mov    -0x18(%rbp),%eax
  add    $0x30,%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  cltq
  mov    %dl,-0x12(%rbp,%rax,1)
  jmp    L152
L19:
  mov    -0x18(%rbp),%eax
  add    $0x37,%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  cltq
  mov    %dl,-0x12(%rbp,%rax,1)
L152:
  mov    -0x2c(%rbp),%eax
  lea    0xf(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x4,%eax
  mov    %eax,-0x2c(%rbp)
  addl   $0x1,-0x24(%rbp)
L128:
  mov    -0x2c(%rbp),%eax
  test   %eax,%eax
  jg     L142
  jmp    L17
L120:
  mov    -0x28(%rbp),%eax
  cltq
  movzbl -0x12(%rbp,%rax,1),%edx
  mov    -0x24(%rbp),%eax
  sub    -0x28(%rbp),%eax
  sub    $0x1,%eax
  cltq
  movzbl -0x12(%rbp,%rax,1),%eax
  cmp    %al,%dl
  je     L154
  movl   $0x1,-0x20(%rbp)
L154:
  addl   $0x1,-0x28(%rbp)
L17:
  mov    -0x24(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  cmp    %eax,-0x28(%rbp)
  jle    L120
  jmp    L11
L185:
  addl   $0x1,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L180
L167:
  mov    -0x2c(%rbp),%eax
  cltd
  shr    $0x1c,%edx
  add    %edx,%eax
  and    $0xf,%eax
  sub    %edx,%eax
  mov    %eax,-0x18(%rbp)
  cmpl   $0x9,-0x18(%rbp)
  jg     L79
  mov    -0x18(%rbp),%eax
  add    $0x30,%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  cltq
  mov    %dl,-0x12(%rbp,%rax,1)
  jmp    L87
L79:
  mov    -0x18(%rbp),%eax
  add    $0x37,%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  cltq
  mov    %dl,-0x12(%rbp,%rax,1)
L87:
  mov    -0x2c(%rbp),%eax
  lea    0xf(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x4,%eax
  mov    %eax,-0x2c(%rbp)
  addl   $0x1,-0x24(%rbp)
L180:
  mov    -0x2c(%rbp),%eax
  test   %eax,%eax
  jg     L167
  movl   $0x0,-0x20(%rbp)
  movl   $0x0,-0x28(%rbp)
  jmp    L26
L21:
  mov    -0x28(%rbp),%eax
  cltq
  movzbl -0x12(%rbp,%rax,1),%edx
  mov    -0x24(%rbp),%eax
  sub    -0x28(%rbp),%eax
  sub    $0x1,%eax
  cltq
  movzbl -0x12(%rbp,%rax,1),%eax
  cmp    %al,%dl
  je     L187
  movl   $0x1,-0x20(%rbp)
L187:
  addl   $0x1,-0x28(%rbp)
L26:
  mov    -0x24(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  cmp    %eax,-0x28(%rbp)
  jle    L21
L11:
  cmpl   $0x1,-0x20(%rbp)
  je     L185
  jmp    L164
L104:
  mov    -0x24(%rbp),%eax
  sub    $0x1,%eax
  cltq
  movzbl -0x12(%rbp,%rax,1),%eax
  movsbl %al,%eax
  mov    %eax,%esi
  lea    D0(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  subl   $0x1,-0x24(%rbp)
L164:
  cmpl   $0x0,-0x24(%rbp)
  jg     L104
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L54
  call   <__stack_chk_fail@plt>
L54:
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D10
datatype: string
name: parse_data
arguments: label: D0
datatype: string

tool: D10: %d

tool: D0: %c

assistant: ```c
int main() {
  int a = 0, num, i, ezway, end = 0, off;
  char hexa[10];
  scanf("%d", &num);
  off = num;
  for (i = 0; num > 0; i++) {
    ezway = num % 16;
    if (ezway < 10)
      hexa[i] = ezway + '0';
    else
      hexa[i] = ezway + 55;
    num /= 16;
  }
  while (a <= i / 2) {
    if (hexa[a] != hexa[i - a - 1])
      end = 1;
    a++;
  }
  while (end == 1) {
    off++;
    num = off;
    for (i = 0; num > 0; i++) {
      ezway = num % 16;
      if (ezway < 10)
        hexa[i] = ezway + '0';
      else
        hexa[i] = ezway + 55;
      num /= 16;
    }
    end = 0;
    a = 0;
    while (a <= i / 2) {
      if (hexa[a] != hexa[i - a - 1])
        end = 1;
      a++;
    }
  }
  while (i > 0) {
    printf("%c", hexa[i - 1]);
    i--;
  }
  return 0;
}
```