user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x808,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x7f8(%rsp)
  xor    %eax,%eax
  lea    D13(%rip),%rdi
  call   <printf@plt>
  lea    0x1c(%rsp),%rsi
  lea    D105(%rip),%rdi
  call   <scanf@plt>
  mov    0x1c(%rsp),%edx
  test   %edx,%edx
  jle    L72
  mov    $0x0,%esi
L106:
  mov    %esi,%ecx
  movslq %edx,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x22,%rax
  mov    %edx,%edi
  sar    $0x1f,%edi
  sub    %edi,%eax
  lea    (%rax,%rax,4),%edi
  add    %edi,%edi
  mov    %edx,%r8d
  sub    %edi,%r8d
  mov    %r8d,0x20(%rsp,%rsi,4)
  mov    %edx,%edi
  mov    %eax,%edx
  add    $0x1,%rsi
  cmp    $0x9,%edi
  jg     L106
  mov    %eax,0x1c(%rsp)
  test   %ecx,%ecx
  js     L141
  movslq %ecx,%rax
  movl   $0x0,0x4(%rsp)
  movl   $0x0,0xc(%rsp)
  movl   $0x0,0x8(%rsp)
  mov    $0x0,%ebx
  mov    $0x0,%ebp
  mov    $0x0,%r12d
  mov    $0x0,%r13d
  mov    $0x0,%r14d
  mov    $0x0,%r15d
  mov    $0x0,%esi
  jmp    L166
L178:
  cmp    $0x1,%edx
  jne    L11
  add    $0x1,%r15d
L131:
  cmp    $0x4,%edx
  jne    L189
  add    $0x1,%r12d
L51:
  cmp    $0x7,%edx
  jne    L186
  addl   $0x1,0x8(%rsp)
L129:
  sub    $0x1,%rax
  test   %eax,%eax
  js     L136
L166:
  mov    0x20(%rsp,%rax,4),%edx
  test   %edx,%edx
  jne    L178
  add    $0x1,%esi
L138:
  cmp    $0x3,%edx
  jne    L131
  add    $0x1,%r13d
L183:
  cmp    $0x6,%edx
  jne    L51
  add    $0x1,%ebx
L119:
  cmp    $0x9,%edx
  jne    L129
  addl   $0x1,0x4(%rsp)
  jmp    L129
L11:
  cmp    $0x2,%edx
  jne    L138
  add    $0x1,%r14d
L189:
  cmp    $0x5,%edx
  jne    L183
  add    $0x1,%ebp
L186:
  cmp    $0x8,%edx
  jne    L119
  addl   $0x1,0xc(%rsp)
  jmp    L129
L72:
  movl   $0x0,0x4(%rsp)
  movl   $0x0,0xc(%rsp)
  movl   $0x0,0x8(%rsp)
  mov    $0x0,%ebx
  mov    $0x0,%ebp
  mov    $0x0,%r12d
  mov    $0x0,%r13d
  mov    $0x0,%r14d
  mov    $0x0,%r15d
  mov    $0x0,%esi
L136:
  lea    D65(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r15d,%esi
  lea    D111(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r14d,%esi
  lea    D26(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r13d,%esi
  lea    D29(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r12d,%esi
  lea    D44(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %ebp,%esi
  lea    D4(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %ebx,%esi
  lea    D85(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x8(%rsp),%esi
  lea    D39(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0xc(%rsp),%esi
  lea    D24(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x4(%rsp),%esi
  lea    D47(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x7f8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L135
  mov    $0x0,%eax
  add    $0x808,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L141:
  movl   $0x0,0x4(%rsp)
  movl   $0x0,0xc(%rsp)
  movl   $0x0,0x8(%rsp)
  mov    $0x0,%ebx
  mov    $0x0,%ebp
  mov    $0x0,%r12d
  mov    $0x0,%r13d
  mov    $0x0,%r14d
  mov    $0x0,%r15d
  mov    $0x0,%esi
  jmp    L136
L135:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D13
type_guessed: string
name: read_data
arguments: data_label: D105
type_guessed: string
name: read_data
arguments: data_label: D65
type_guessed: string
name: read_data
arguments: data_label: D111
type_guessed: string
name: read_data
arguments: data_label: D26
type_guessed: string
name: read_data
arguments: data_label: D29
type_guessed: string
name: read_data
arguments: data_label: D44
type_guessed: string
name: read_data
arguments: data_label: D4
type_guessed: string
name: read_data
arguments: data_label: D85
type_guessed: string
name: read_data
arguments: data_label: D39
type_guessed: string
name: read_data
arguments: data_label: D24
type_guessed: string
name: read_data
arguments: data_label: D47
type_guessed: string

tool: D13: a=

tool: D105: %d

tool: D65: 
c0=%d

tool: D111: 
c1=%d

tool: D26: 
c2=%d

tool: D29: 
c3=%d

tool: D44: 
c4=%d

tool: D4: 
c5=%d

tool: D85: 
c6=%d

tool: D39: 
c7=%d

tool: D24: 
c8=%d

tool: D47: 
c9=%d

assistant: ```c
int main() {
  int c0 = 0, c1 = 1, c2 = 2, c3 = 3, c4 = 4, c5 = 5, c6 = 6, c7 = 7, c8 = 8, c9 = 9, a, g = -1;
  int b[500], b0 = 0, b1 = 0, b2 = 0, b3 = 0, b4 = 0, b5 = 0, b6 = 0, b7 = 0, b8 = 0, b9 = 0;
  printf("a=");
  scanf("%d", &a);
  while (a > 0) {
    g++;
    b[g] = a % 10;
    a = a / 10;
  }
  while (g >= 0) {
    if (c0 == b[g])
      b0++;
    if (c1 == b[g])
      b1++;
    if (c2 == b[g])
      b2++;
    if (c3 == b[g])
      b3++;
    if (c4 == b[g])
      b4++;
    if (c5 == b[g])
      b5++;
    if (c6 == b[g])
      b6++;
    if (c7 == b[g])
      b7++;
    if (c8 == b[g])
      b8++;
    if (c9 == b[g])
      b9++;
    g--;
  }
  printf("\nc0=%d", b0);
  printf("\nc1=%d", b1);
  printf("\nc2=%d", b2);
  printf("\nc3=%d", b3);
  printf("\nc4=%d", b4);
  printf("\nc5=%d", b5);
  printf("\nc6=%d", b6);
  printf("\nc7=%d", b7);
  printf("\nc8=%d", b8);
  printf("\nc9=%d", b9);
  return 0;
}
```