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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xc90,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
L0:
  movl   $0x0,-0xc8c(%rbp)
  jmp    L153
L169:
  mov    -0xc8c(%rbp),%eax
  cltq
  movl   $0xffffffff,-0xc50(%rbp,%rax,4)
  addl   $0x1,-0xc8c(%rbp)
L153:
  cmpl   $0x310,-0xc8c(%rbp)
  jle    L169
  lea    -0xc90(%rbp),%rax
  mov    %rax,%rsi
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0xc90(%rbp),%eax
  test   %eax,%eax
  jle    L103
  mov    -0xc90(%rbp),%eax
  cmp    $0x16e,%eax
  jg     L103
  mov    -0xc90(%rbp),%eax
  mov    %eax,-0xc8c(%rbp)
  movl   $0x310,-0xc88(%rbp)
  jmp    L64
L93:
  mov    -0xc8c(%rbp),%ecx
  movslq %ecx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %ecx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  mov    -0xc88(%rbp),%eax
  cltq
  mov    %edx,-0xc50(%rbp,%rax,4)
  mov    -0xc8c(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0xc8c(%rbp)
  subl   $0x1,-0xc88(%rbp)
L64:
  cmpl   $0x0,-0xc8c(%rbp)
  jg     L93
  movl   $0x0,-0xc84(%rbp)
  mov    -0xc90(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0xc8c(%rbp)
  jmp    L74
L189:
  movl   $0x310,-0xc88(%rbp)
  jmp    L146
L114:
  mov    -0xc88(%rbp),%eax
  cltq
  mov    -0xc50(%rbp,%rax,4),%eax
  imul   -0xc8c(%rbp),%eax
  add    %eax,-0xc84(%rbp)
  mov    -0xc84(%rbp),%ecx
  movslq %ecx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %ecx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  mov    -0xc88(%rbp),%eax
  cltq
  mov    %edx,-0xc50(%rbp,%rax,4)
  mov    -0xc84(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0xc84(%rbp)
  subl   $0x1,-0xc88(%rbp)
L146:
  mov    -0xc88(%rbp),%eax
  cltq
  mov    -0xc50(%rbp,%rax,4),%eax
  test   %eax,%eax
  jns    L114
  mov    -0xc84(%rbp),%ecx
  movslq %ecx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %ecx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  mov    -0xc88(%rbp),%eax
  cltq
  mov    %edx,-0xc50(%rbp,%rax,4)
  mov    -0xc84(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0xc84(%rbp)
  mov    -0xc88(%rbp),%eax
  sub    $0x1,%eax
  cltq
  mov    -0xc84(%rbp),%edx
  mov    %edx,-0xc50(%rbp,%rax,4)
  movl   $0x0,-0xc84(%rbp)
  jmp    L177
L134:
  mov    -0xc84(%rbp),%eax
  cltq
  movl   $0xffffffff,-0xc50(%rbp,%rax,4)
  addl   $0x1,-0xc84(%rbp)
L177:
  mov    -0xc84(%rbp),%eax
  cltq
  mov    -0xc50(%rbp,%rax,4),%eax
  test   %eax,%eax
  jle    L134
  movl   $0x0,-0xc84(%rbp)
  subl   $0x1,-0xc8c(%rbp)
L74:
  cmpl   $0x0,-0xc8c(%rbp)
  jg     L189
  movq   $0x0,-0xc80(%rbp)
  movq   $0x0,-0xc78(%rbp)
  movq   $0x0,-0xc70(%rbp)
  movq   $0x0,-0xc68(%rbp)
  movq   $0x0,-0xc60(%rbp)
  movl   $0x0,-0xc8c(%rbp)
  jmp    L45
L38:
  movl   $0x0,-0xc88(%rbp)
  jmp    L83
L7:
  mov    -0xc88(%rbp),%eax
  cltq
  mov    -0xc50(%rbp,%rax,4),%eax
  cmp    %eax,-0xc8c(%rbp)
  jne    L84
  mov    -0xc8c(%rbp),%eax
  cltq
  mov    -0xc80(%rbp,%rax,4),%eax
  lea    0x1(%rax),%edx
  mov    -0xc8c(%rbp),%eax
  cltq
  mov    %edx,-0xc80(%rbp,%rax,4)
L84:
  addl   $0x1,-0xc88(%rbp)
L83:
  cmpl   $0x310,-0xc88(%rbp)
  jle    L7
  addl   $0x1,-0xc8c(%rbp)
L45:
  cmpl   $0x9,-0xc8c(%rbp)
  jle    L38
  mov    -0xc90(%rbp),%eax
  mov    %eax,%esi
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0xc70(%rbp),%edi
  mov    -0xc74(%rbp),%esi
  mov    -0xc78(%rbp),%ecx
  mov    -0xc7c(%rbp),%edx
  mov    -0xc80(%rbp),%eax
  mov    %edi,%r9d
  mov    %esi,%r8d
  mov    %eax,%esi
  lea    D39(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0xc5c(%rbp),%edi
  mov    -0xc60(%rbp),%esi
  mov    -0xc64(%rbp),%ecx
  mov    -0xc68(%rbp),%edx
  mov    -0xc6c(%rbp),%eax
  mov    %edi,%r9d
  mov    %esi,%r8d
  mov    %eax,%esi
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L0
L103:
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L97
  call   <__stack_chk_fail@plt>
L97:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D13
type_infered: string
name: read_data
arguments: data_label: D2
type_infered: string
name: read_data
arguments: data_label: D39
type_infered: string
name: read_data
arguments: data_label: D24
type_infered: string

tool: D13: %d

tool: D2: %d! --


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


tool: D24:    (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;
}
```