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

```asm
<main>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xc90,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xc88(%rsp)
  xor    %eax,%eax
  lea    D3(%rip),%r14
  mov    $0x0,%r12d
  lea    D23(%rip),%r13
  jmp    L89
L171:
  imul   %r8d,%edx
  add    %eax,%edx
  movslq %edx,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x22,%rax
  mov    %edx,%r9d
  sar    $0x1f,%r9d
  sub    %r9d,%eax
  lea    (%rax,%rax,4),%r9d
  add    %r9d,%r9d
  sub    %r9d,%edx
  mov    %edx,0x4(%rcx)
  sub    $0x1,%edi
  sub    $0x4,%rcx
  mov    0x4(%rcx),%edx
  test   %edx,%edx
  jns    L171
L68:
  movslq %edi,%r9
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  sar    $0x22,%rdx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  lea    (%rdx,%rdx,4),%ecx
  add    %ecx,%ecx
  sub    %ecx,%eax
  mov    %eax,0x40(%rsp,%r9,4)
  lea    -0x1(%rdi),%eax
  cltq
  mov    %edx,0x40(%rsp,%rax,4)
  cmpl   $0x0,0x40(%rsp)
  jg     L115
  mov    %rbp,%rax
L37:
  movl   $0xffffffff,(%rax)
  add    $0x4,%rax
  cmpl   $0x0,(%rax)
  jle    L37
L115:
  sub    $0x1,%r8d
  je     L169
L114:
  mov    0xc80(%rsp),%edx
  lea    0xc7c(%rsp),%rcx
  mov    %r12d,%eax
  mov    $0x310,%edi
  test   %edx,%edx
  jns    L171
  jmp    L68
L109:
  add    $0x4,%rax
  cmp    %rbx,%rax
  je     L173
L146:
  cmp    %edx,(%rax)
  jne    L109
  addl   $0x1,(%rcx)
  jmp    L109
L173:
  add    $0x1,%edx
  add    $0x4,%rcx
  cmp    $0xa,%edx
  je     L153
L122:
  mov    %rbp,%rax
  jmp    L146
L153:
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x20(%rsp),%r9d
  mov    0x1c(%rsp),%r8d
  mov    0x18(%rsp),%ecx
  mov    0x14(%rsp),%edx
  mov    0x10(%rsp),%esi
  lea    D19(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x34(%rsp),%r9d
  mov    0x30(%rsp),%r8d
  mov    0x2c(%rsp),%ecx
  mov    0x28(%rsp),%edx
  mov    0x24(%rsp),%esi
  lea    D24(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L89:
  lea    0x40(%rsp),%rbp
  lea    0xc84(%rsp),%rbx
  mov    %rbp,%rax
L4:
  movl   $0xffffffff,(%rax)
  add    $0x4,%rax
  cmp    %rbx,%rax
  jne    L4
  lea    0xc(%rsp),%rsi
  mov    %r14,%rdi
  call   <scanf@plt>
  mov    0xc(%rsp),%esi
  lea    -0x1(%rsi),%eax
  cmp    $0x16d,%eax
  ja     L65
  lea    0xc80(%rsp),%rdi
  mov    %esi,%edx
L175:
  movslq %edx,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x22,%rax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  lea    (%rax,%rax,4),%ecx
  add    %ecx,%ecx
  mov    %edx,%r8d
  sub    %ecx,%r8d
  mov    %r8d,(%rdi)
  mov    %edx,%ecx
  mov    %eax,%edx
  sub    $0x4,%rdi
  cmp    $0x9,%ecx
  jg     L175
  lea    -0x1(%rsi),%r8d
  test   %r8d,%r8d
  jg     L114
L169:
  movq   $0x0,0x10(%rsp)
  movq   $0x0,0x18(%rsp)
  movq   $0x0,0x20(%rsp)
  movq   $0x0,0x28(%rsp)
  movq   $0x0,0x30(%rsp)
  lea    0x10(%rsp),%rcx
  mov    $0x0,%edx
  jmp    L122
L65:
  mov    0xc88(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L121
  mov    $0x0,%eax
  add    $0xc90,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L121:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D3
type_infered: string
name: extract_symbolic_data
arguments: data_label: D23
type_infered: string
name: extract_symbolic_data
arguments: data_label: D19
type_infered: string
name: extract_symbolic_data
arguments: data_label: D24
type_infered: string

tool: D3: %d

tool: D23: %d! --


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