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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x4000(%rsp),%r11
L69:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L69
  sub    $0xe38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x4e28(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r12
  lea    D8(%rip),%r13
  lea    D5(%rip),%r14
  lea    0x2710(%rsp),%r15
  jmp    L73
L24:
  test   %ebx,%ebx
  jle    L4
  movslq %ebx,%rax
  add    %r12,%rax
  mov    $0x0,%ebp
L105:
  movzbl -0x2(%rax),%edi
  cmp    %dil,-0x1(%rax)
  jne    L129
  add    $0x1,%ebp
  sub    $0x1,%rax
  cmp    %ebp,%ebx
  jne    L105
  mov    %ebx,%ebp
L129:
  mov    %ebp,%esi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %ebx,%esi
  sub    %ebp,%esi
  mov    %r12,%rdi
  call   <lengthtobeadd@plt>
  mov    %eax,%ebp
  mov    %eax,%esi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  test   $0x1,%bpl
  jne    L121
  add    %ebp,%ebp
  sub    %ebp,%ebx
L64:
  mov    $0x0,%eax
  test   %ebx,%ebx
  js     L34
  movslq %ebx,%rdx
  add    %r12,%rdx
  lea    0x2710(%rsp),%rax
  mov    %ebx,%ecx
  lea    0x2711(%rsp,%rcx,1),%rsi
L118:
  movzbl (%rdx),%ecx
  mov    %cl,(%rax)
  sub    $0x1,%rdx
  add    $0x1,%rax
  cmp    %rsi,%rax
  jne    L118
  lea    0x1(%rbx),%eax
  mov    $0xffffffff,%ebx
L34:
  cltq
  movb   $0x0,0x2710(%rsp,%rax,1)
  movslq %ebx,%rbx
  movb   $0x0,(%rsp,%rbx,1)
  mov    %r15,%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  mov    %r12,%rdi
  call   <puts@plt>
L73:
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <scanf@plt>
  cmp    $0x1,%eax
  jne    L21
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %eax,%ebx
  mov    %r12,%rdi
  call   <ispalindrome@plt>
  test   %rax,%rax
  je     L24
  mov    %r12,%rdi
  call   <puts@plt>
  jmp    L73
L4:
  mov    $0x0,%ebp
  jmp    L129
L121:
  sub    %ebp,%ebx
  mov    %ebp,%eax
  shr    $0x1f,%eax
  add    %ebp,%eax
  sar    %eax
  sub    %eax,%ebx
  sub    $0x1,%ebx
  jmp    L64
L21:
  mov    0x4e28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L71
  mov    $0x0,%eax
  add    $0x4e38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L71:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D8
datatype: string
name: parse_data
arguments: data_tag: D5
datatype: string

tool: D8: %s

tool: D5: %d


assistant: ```c
int main() {
  int i, j, k, l, m, len;
  char a[10000], b[10000];
  while (scanf("%s", a) == 1) {
    l = 0;
    len = strlen(a);
    if (ispalindrome(a))
      printf("%s\n", a);
    else {
      for (i = len - 1; i >= 0; i--) {
        if (a[i] == a[i - 1]) {
          l++;
        } else
          break;
      }
      printf("%d\n", l);
      m = len - l;
      j = lengthtobeadd(a, m);
      printf("%d\n", j);
      k = 0;
      if (j % 2 == 0) {
        len = len - 2 * j;
      } else {
        len = len - j - (j / 2) - 1;
      }
      for (i = len; i >= 0; i--) {
        b[k] = a[i];
        k++;
      }
      b[k] = '\0';
      a[i] = '\0';
      strcat(a, b);
      printf("%s\n", a);
    }
  }
  return 0;
}
```