user: What is the c source code of the assembly code below:

```asm
<main>:
  endbr64
  push   %r15
  lea    D1(%rip),%r15
  push   %r14
  mov    %r15,%rdi
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x20(%rsp),%rsi
  call   <scanf@plt>
  movslq 0x20(%rsp),%rbx
  mov    %ebx,%r14d
  lea    0x0(,%rbx,4),%rdi
  call   <malloc@plt>
  shr    $0x1f,%r14d
  lea    0x0(,%rbx,8),%rdi
  add    %ebx,%r14d
  mov    %rax,%rbp
  call   <malloc@plt>
  sar    %r14d
  movslq %r14d,%r14
  mov    %rax,%r13
  shl    $0x2,%r14
  mov    %r14,%rdi
  call   <malloc@plt>
  mov    %r14,%rdi
  mov    %rax,%r12
  call   <malloc@plt>
  lea    0x24(%rsp),%rsi
  mov    %r15,%rdi
  mov    %rax,0x10(%rsp)
  mov    %rax,%r14
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x20(%rsp),%ebx
  test   %ebx,%ebx
  jle    L351
  lea    -0x1(%rbx),%eax
  mov    0x24(%rsp),%edx
  mov    %rbp,0x8(%rsp)
  mov    %eax,(%rsp)
  cltq
  lea    0x0(%rbp,%rax,4),%r14
  mov    %ebx,%eax
  mov    %ebx,0x18(%rsp)
  mov    %r13,%rbp
  lea    0x0(%r13,%rax,8),%rax
  mov    %r14,%rbx
  mov    %edx,%r15d
  mov    %rax,%r14
  nopw   0x0(%rax,%rax,1)
L168:
  mov    $0x8,%edi
  add    $0x8,%rbp
  sub    $0x4,%rbx
  call   <malloc@plt>
  mov    %r15d,%ecx
  mov    %rax,-0x8(%rbp)
  movslq %r15d,%rax
  sar    $0x1f,%ecx
  imul   $0x66666667,%rax,%rax
  sar    $0x22,%rax
  sub    %ecx,%eax
  lea    (%rax,%rax,4),%ecx
  mov    %eax,0x24(%rsp)
  add    %ecx,%ecx
  sub    %ecx,%r15d
  mov    %r15d,0x4(%rbx)
  mov    %eax,%r15d
  cmp    %rbp,%r14
  jne    L168
  mov    0x8(%rsp),%rbp
  mov    0x18(%rsp),%ebx
  xor    %edi,%edi
  xor    %ecx,%ecx
  mov    (%rsp),%r10d
  mov    $0x1,%r9d
  nopl   0x0(%rax,%rax,1)
L353:
  movslq %edi,%rdx
  lea    0x1(%rdi),%eax
  mov    0x0(%rbp,%rdx,4),%r8d
  cmp    %r8d,0x4(%rbp,%rdx,4)
  jne    L3
  mov    $0x1,%esi
  jmp    L184
  nopl   (%rax)
L101:
  cmp    %edi,%r11d
  je     L109
L184:
  add    $0x1,%eax
  add    $0x1,%esi
  cltd
  idiv   %ebx
  movslq %edx,%r11
  mov    %r11,%rax
  cmp    %r8d,0x0(%rbp,%r11,4)
  je     L101
L109:
  cmp    %r9d,%esi
  jle    L67
  mov    0x0(%r13),%rcx
  mov    %r10d,%r8d
  mov    %edi,(%rcx)
  test   %edx,%edx
  jne    L209
L283:
  mov    %r8d,0x4(%rcx)
  mov    %esi,%r9d
  mov    $0x1,%ecx
L157:
  add    %esi,%edi
  cmp    %ebx,%edi
  jl     L353
  mov    %r9d,0x1c(%rsp)
  movslq %ecx,%rdx
  xor    %eax,%eax
  test   %ecx,%ecx
  je     L284
  nopl   (%rax)
L118:
  mov    %eax,(%r12,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L118
L284:
  cmp    $0x1,%ebx
  jle    L159
  cmp    $0x1,%ecx
  je     L159
  movl   $0x0,0x18(%rsp)
  mov    $0x1,%r9d
  mov    $0xa,%r14d
  movl   $0x1,0x8(%rsp)
  nopl   0x0(%rax,%rax,1)
L29:
  movslq %ecx,%rax
  movslq 0x18(%rsp),%r10
  mov    $0x1,%edi
  mov    %rax,(%rsp)
  cmp    $0x1,%ecx
  jle    L296
  nopw   0x0(%rax,%rax,1)
L145:
  movslq (%r12,%r10,4),%rax
  mov    %edi,%r8d
  mov    0x0(%r13,%rax,8),%rax
  movslq 0x4(%rax),%rcx
  lea    (%rcx,%r9,1),%eax
  cltd
  idiv   %ebx
  mov    %r14d,%eax
  sub    0x0(%rbp,%rcx,4),%eax
  movslq %eax,%rcx
  mov    %eax,%esi
  imul   $0x66666667,%rcx,%rcx
  sar    $0x1f,%esi
  sar    $0x22,%rcx
  sub    %esi,%ecx
  lea    (%rcx,%rcx,4),%ecx
  add    %ecx,%ecx
  sub    %ecx,%eax
  movslq %edx,%rdx
  add    0x0(%rbp,%rdx,4),%eax
  movslq %eax,%rcx
  cltd
  imul   $0x66666667,%rcx,%rcx
  sar    $0x22,%rcx
  sub    %edx,%ecx
  lea    (%rcx,%rcx,4),%edx
  add    %edx,%edx
  sub    %edx,%eax
  mov    %eax,%ecx
  movslq (%r12,%rdi,4),%rax
  mov    %rax,%rsi
  mov    0x0(%r13,%rax,8),%rax
  movslq 0x4(%rax),%r15
  lea    (%r15,%r9,1),%eax
  cltd
  idiv   %ebx
  movslq %edx,%r11
  mov    %r14d,%edx
  sub    0x0(%rbp,%r15,4),%edx
  movslq %edx,%rax
  mov    %edx,%r15d
  imul   $0x66666667,%rax,%rax
  sar    $0x1f,%r15d
  sar    $0x22,%rax
  sub    %r15d,%eax
  lea    (%rax,%rax,4),%eax
  add    %eax,%eax
  sub    %eax,%edx
  add    0x0(%rbp,%r11,4),%edx
  movslq %edx,%rax
  mov    %edx,%r11d
  imul   $0x66666667,%rax,%rax
  sar    $0x1f,%r11d
  sar    $0x22,%rax
  sub    %r11d,%eax
  lea    (%rax,%rax,4),%r11d
  mov    %edx,%eax
  add    %r11d,%r11d
  sub    %r11d,%eax
  cmp    %eax,%ecx
  jle    L232
  mov    0x10(%rsp),%rax
  add    $0x1,%rdi
  mov    %esi,(%rax)
  cmp    (%rsp),%rdi
  je     L48
  movslq %r8d,%r10
  movl   $0x1,0x8(%rsp)
  mov    %r10d,0x18(%rsp)
  jmp    L145
  nopl   0x0(%rax,%rax,1)
L232:
  jne    L248
  movslq 0x8(%rsp),%rax
  mov    0x10(%rsp),%rdx
  mov    %rax,%rsi
  mov    %edi,(%rdx,%rax,4)
  add    $0x1,%esi
  mov    %esi,0x8(%rsp)
L248:
  add    $0x1,%rdi
  cmp    %rdi,(%rsp)
  jne    L145
L296:
  add    $0x1,%r9d
  cmp    %ebx,%r9d
  jge    L48
  mov    0x8(%rsp),%ecx
  cmp    $0x1,%ecx
  je     L48
  mov    0x10(%rsp),%rax
  mov    %r12,0x10(%rsp)
  mov    %rax,%r12
  jmp    L29
  nopl   0x0(%rax,%rax,1)
L67:
  jne    L157
  movslq %ecx,%r8
  mov    %r10d,%r11d
  mov    0x0(%r13,%r8,8),%r8
  mov    %edi,(%r8)
  test   %edx,%edx
  jne    L214
L298:
  mov    %r11d,0x4(%r8)
  add    $0x1,%ecx
  jmp    L157
L3:
  test   %r9d,%r9d
  jg     L128
  mov    0x0(%r13),%rcx
  mov    $0x1,%esi
  mov    %edi,(%rcx)
L209:
  lea    -0x1(%rax),%r8d
  jmp    L283
  nopl   (%rax)
L48:
  mov    0x10(%rsp),%rax
  movslq (%rax),%rax
  mov    0x0(%r13,%rax,8),%rcx
  mov    $0xa,%eax
  movslq 0x4(%rcx),%rdx
  sub    0x0(%rbp,%rdx,4),%eax
  movslq %eax,%rsi
  cltd
  imul   $0x66666667,%rsi,%rsi
  sar    $0x22,%rsi
  sub    %edx,%esi
  lea    (%rsi,%rsi,4),%edx
  add    %edx,%edx
  sub    %edx,%eax
  mov    %eax,%esi
L11:
  mov    (%rcx),%r8d
  xor    %r14d,%r14d
  xor    %ecx,%ecx
  nopl   0x0(%rax)
L170:
  lea    (%rcx,%r8,1),%eax
  lea    (%r14,%r14,4),%edi
  add    $0x1,%ecx
  cltd
  idiv   %ebx
  movslq %edx,%rdx
  mov    0x0(%rbp,%rdx,4),%eax
  add    %esi,%eax
  mov    %eax,%edx
  cltq
  imul   $0x66666667,%rax,%rax
  mov    %edx,%r9d
  sar    $0x1f,%r9d
  sar    $0x22,%rax
  sub    %r9d,%eax
  lea    (%rax,%rax,4),%eax
  add    %eax,%eax
  sub    %eax,%edx
  lea    (%rdx,%rdi,2),%r14d
  cmp    %ebx,%ecx
  jl     L170
  mov    0x1c(%rsp),%eax
  mov    0x1c(%rsp),%r15d
  xor    %ebx,%ebx
  test   %eax,%eax
  jle    L91
  xchg   %ax,%ax
L258:
  mov    $0x30,%edi
  add    $0x1,%ebx
  call   <putchar@plt>
  cmp    %ebx,%r15d
  jne    L258
L91:
  mov    %r14d,%esi
  lea    D0(%rip),%rdi
  xor    %eax,%eax
  mov    %r13,%rbx
  call   <printf@plt>
  mov    0x20(%rsp),%eax
  lea    0x0(%r13,%rax,8),%r14
  test   %eax,%eax
  jle    L146
  nopl   0x0(%rax,%rax,1)
L92:
  mov    (%rbx),%rdi
  add    $0x8,%rbx
  call   <free@plt>
  cmp    %rbx,%r14
  jne    L92
L146:
  mov    %r13,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L139
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L307:
  movslq %ecx,%rdx
  mov    $0x1,%esi
  mov    0x0(%r13,%rdx,8),%r8
  mov    %edi,(%r8)
L214:
  lea    -0x1(%rax),%r11d
  jmp    L298
L128:
  cmp    $0x1,%r9d
  je     L307
  mov    $0x1,%esi
  jmp    L157
L351:
  mov    $0x30,%edi
  call   <putchar@plt>
  mov    %r12,0x10(%rsp)
  mov    %r14,%r12
  xor    %r14d,%r14d
  jmp    L91
L159:
  movslq (%r12),%rax
  mov    $0xa,%edi
  mov    %edi,%edx
  mov    0x0(%r13,%rax,8),%rcx
  movslq 0x4(%rcx),%rax
  sub    0x0(%rbp,%rax,4),%edx
  mov    %edx,%eax
  cltd
  idiv   %edi
  mov    %r12,%rax
  mov    0x10(%rsp),%r12
  mov    %rax,0x10(%rsp)
  mov    %edx,%esi
  jmp    L11
L139:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D1
type_guessed: string
name: disassemble_data
arguments: tag: D0
type_guessed: string

tool: D1: %d

tool: D0: %d


assistant: ```c
int main() {
  int n, entrada;
  int tamclustermax = 1, tamclusteratual = 1, nclusters = 0;
  int candidatosvelho, candidatosnovo, rotmelhor, rotcand, melhor;
  int digposimelhor, digposicand;
  int *clustersvelho, *clustersnovo;
  int *numero, **clusters;
  int resposta;
  int *tmp;
  int i = 0, inicio = 0, j = 0;
  scanf("%d", &n);
  numero = (int *)malloc(n * sizeof(int));
  clusters = (int **)malloc(n * sizeof(int *));
  clustersvelho = (int *)malloc(n / 2 * sizeof(int));
  clustersnovo = (int *)malloc(n / 2 * sizeof(int));
  scanf("%d", &entrada);
  for (i = 0; i < n; i++) {
    clusters[i] = (int *)malloc(2 * sizeof(int));
    numero[n - 1 - i] = entrada % 10;
    entrada = entrada / 10;
  }
  if (0) {
    for (i = 0; i < n; i++)
      printf("%d ", numero[i]);
    printf("\n");
  }
  for (i = 0; i < n; i++) {
    tamclusteratual = 1;
    inicio = i;
    i++;
    while (numero[inicio] == numero[i] && i != inicio) {
      tamclusteratual++;
      i = (i + 1) % n;
    }
    if (tamclusteratual > tamclustermax) {
      nclusters = 1;
      clusters[0][0] = inicio;
      clusters[0][1] = (i ? i - 1 : n - 1);
      tamclustermax = tamclusteratual;
    } else if (tamclusteratual == tamclustermax) {
      clusters[nclusters][0] = inicio;
      clusters[nclusters][1] = (i ? i - 1 : n - 1);
      nclusters++;
    }
    i = inicio + tamclusteratual - 1;
  }
  if (0) {
    for (i = 0; i < nclusters; i++)
      printf("%d %d\n", clusters[i][0], clusters[i][1]);
  }
  candidatosvelho = nclusters;
  candidatosnovo = 1;
  melhor = 0;
  for (i = 0; i < candidatosvelho; i++)
    clustersvelho[i] = i;
  i = 1;
  while (i < n && candidatosvelho != 1) {
    for (j = 1; j < candidatosvelho; j++) {
      rotmelhor = (10 - numero[clusters[clustersvelho[melhor]][1]]) % 10;
      digposimelhor = (numero[(clusters[clustersvelho[melhor]][1] + i) % n] + rotmelhor) % 10;
      rotcand = (10 - numero[clusters[clustersvelho[j]][1]]) % 10;
      digposicand = (numero[(clusters[clustersvelho[j]][1] + i) % n] + rotcand) % 10;
      if (0) {
        printf("melhor = %d e candidato =  %d\n", melhor, j);
        printf("deslocamento = %d \n", i);
        printf("teste = %d x %d\n\n", digposicand, digposimelhor);
      }
      if (digposicand < digposimelhor) {
        clustersnovo[0] = clustersvelho[j];
        candidatosnovo = 1;
        melhor = j;
      } else if (digposicand == digposimelhor) {
        clustersnovo[candidatosnovo] = j;
        candidatosnovo++;
      }
    }
    tmp = clustersvelho;
    clustersvelho = clustersnovo;
    clustersnovo = tmp;
    candidatosvelho = candidatosnovo;
    if (0) {
      printf("candidatos velho = %d\n", candidatosvelho);
    }
    i++;
  }
  if (0) {
    printf("melhor = %d\n", clustersvelho[0]);
  }
  resposta = 0;
  rotmelhor = (10 - numero[clusters[clustersvelho[0]][1]]) % 10;
  for (i = 0; i < n; i++) {
    resposta *= 10;
    j = (clusters[clustersvelho[0]][0] + i) % n;
    resposta += (numero[j] + rotmelhor) % 10;
  }
  for (i = 0; i < tamclustermax; i++)
    printf("0");
  printf("%d\n", resposta);
  for (i = 0; i < n; i++)
    free(clusters[i]);
  free(clusters);
  free(numero);
  free(clustersvelho);
  free(clustersnovo);
  return 0;
}
```