user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %r14
  push   %r13
  mov    $0xcccccccd,%r13d
  push   %r12
  push   %rbp
  lea    D12(%rip),%rbp
  push   %rbx
  lea    D13(%rip),%rbx
  sub    $0xc90,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xc88(%rsp)
  xor    %eax,%eax
  lea    0x40(%rsp),%r14
  lea    0xc(%rsp),%r12
L4:
  mov    $0xffffffffffffffff,%rax
  mov    $0x188,%ecx
  mov    %r14,%rdi
  mov    %r12,%rsi
  rep stos %rax,%es:(%rdi)
  movl   $0xffffffff,(%rdi)
  mov    %rbp,%rdi
  call   <scanf@plt>
  mov    0xc(%rsp),%r8d
  lea    -0x1(%r8),%r9d
  cmp    $0x16d,%r9d
  ja     L86
  lea    0xc80(%rsp),%rsi
  mov    %r8d,%edx
L92:
  mov    %edx,%eax
  sub    $0x4,%rsi
  imul   %r13,%rax
  shr    $0x23,%rax
  lea    (%rax,%rax,4),%ecx
  add    %ecx,%ecx
  sub    %ecx,%edx
  mov    %edx,0x4(%rsi)
  mov    %eax,%edx
  test   %eax,%eax
  jne    L92
  test   %r9d,%r9d
  je     L85
L28:
  mov    0xc80(%rsp),%ecx
  lea    0xc7c(%rsp),%rsi
  xor    %eax,%eax
  mov    $0x310,%edi
  test   %ecx,%ecx
  js     L71
  nopl   (%rax)
L45:
  imul   %r9d,%ecx
  sub    $0x4,%rsi
  add    %ecx,%eax
  mov    %rax,%rcx
  imul   %r13,%rax
  shr    $0x23,%rax
  lea    (%rax,%rax,4),%r10d
  add    %r10d,%r10d
  sub    %r10d,%ecx
  mov    %edi,%r10d
  sub    $0x1,%edi
  mov    %ecx,0x8(%rsi)
  mov    0x4(%rsi),%ecx
  test   %ecx,%ecx
  jns    L45
  mov    %eax,%ecx
  sub    $0x2,%r10d
  imul   %r13,%rcx
  shr    $0x23,%rcx
  lea    (%rcx,%rcx,4),%r11d
  mov    %ecx,%esi
  add    %r11d,%r11d
  sub    %r11d,%eax
  mov    %eax,%ecx
L51:
  movslq %edi,%rdi
  movslq %r10d,%r10
  mov    %r14,%rax
  mov    %ecx,0x40(%rsp,%rdi,4)
  mov    %esi,0x40(%rsp,%r10,4)
  mov    0x40(%rsp),%esi
  test   %esi,%esi
  jg     L113
  nopl   (%rax)
L49:
  movl   $0xffffffff,(%rax)
  mov    0x4(%rax),%ecx
  add    $0x4,%rax
  test   %ecx,%ecx
  jle    L49
L113:
  sub    $0x1,%r9d
  jne    L28
L85:
  movq   $0x0,0x30(%rsp)
  pxor   %xmm0,%xmm0
  lea    0x10(%rsp),%rsi
  lea    0xc84(%rsp),%rcx
  movaps %xmm0,0x10(%rsp)
  movaps %xmm0,0x20(%rsp)
L7:
  mov    %r14,%rax
  nopw   0x0(%rax,%rax,1)
L138:
  cmp    %edx,(%rax)
  jne    L0
  addl   $0x1,(%rsi)
L0:
  add    $0x4,%rax
  cmp    %rax,%rcx
  jne    L138
  add    $0x1,%edx
  add    $0x4,%rsi
  cmp    $0xa,%edx
  jne    L7
  mov    %r8d,%esi
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x20(%rsp),%r9d
  mov    0x18(%rsp),%ecx
  xor    %eax,%eax
  mov    0x1c(%rsp),%r8d
  mov    0x14(%rsp),%edx
  lea    D6(%rip),%rdi
  mov    0x10(%rsp),%esi
  call   <printf@plt>
  mov    0x34(%rsp),%r9d
  mov    0x2c(%rsp),%ecx
  xor    %eax,%eax
  mov    0x30(%rsp),%r8d
  mov    0x28(%rsp),%edx
  lea    D21(%rip),%rdi
  mov    0x24(%rsp),%esi
  call   <printf@plt>
  jmp    L4
L71:
  xor    %esi,%esi
  xor    %ecx,%ecx
  mov    $0x30f,%r10d
  jmp    L51
L86:
  mov    0xc88(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L101
  add    $0xc90,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L101:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D12
type: string
name: read_data
arguments: data_tag: D13
type: string
name: read_data
arguments: data_tag: D6
type: string
name: read_data
arguments: data_tag: D21
type: string

tool: D12: %d

tool: D13: %d! --


tool: D6:    (0)%5d    (1)%5d    (2)%5d    (3)%5d    (4)%5d


tool: D21:    (5)%5d    (6)%5d    (7)%5d    (8)%5d    (9)%5d 


assistant: ```c
int main() {
  for (;;) {
    int a[785], x, i;
    for (i = 0; i < 785; i++)
      a[i] = -1;
    scanf("%d", &x);
    if (x < 1 || x > 366)
      break;
    int j;
    i = x;
    for (j = 784; i > 0; j--) {
      a[j] = i % 10;
      i = i / 10;
    }
    int k = 0;
    for (i = x - 1; i > 0; i--) {
      for (j = 784; a[j] >= 0; j--) {
        k = (i * a[j]) + k;
        a[j] = k % 10;
        k = k / 10;
      }
      a[j] = k % 10;
      k = k / 10;
      a[j - 1] = k;
      for (k = 0; a[k] < 1; k++)
        a[k] = -1;
      k = 0;
    }
    int num[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
    for (i = 0; i < 10; i++)
      for (j = 0; j < 785; j++)
        if (i == a[j])
          num[i]++;
    printf("%d! --\n", x);
    printf("   (0)%5d    (1)%5d    (2)%5d    (3)%5d    (4)%5d\n", num[0], num[1], num[2], num[3], num[4]);
    printf("   (5)%5d    (6)%5d    (7)%5d    (8)%5d    (9)%5d \n", num[5], num[6], num[7], num[8], num[9]);
  }
  return 0;
}
```