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

```asm
<main>:
  endbr64
  push   %r15
  lea    D118(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x808,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x7f8(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  lea    0x1c(%rsp),%rsi
  lea    D98(%rip),%rdi
  call   <scanf@plt>
  mov    0x1c(%rsp),%ecx
  test   %ecx,%ecx
  jle    L132
  xor    %esi,%esi
  lea    0x20(%rsp),%r8
  mov    $0xcccccccd,%r10d
  xchg   %ax,%ax
L27:
  mov    %ecx,%eax
  mov    %ecx,%r9d
  mov    %esi,%edx
  imul   %r10,%rax
  shr    $0x23,%rax
  lea    (%rax,%rax,4),%edi
  add    %edi,%edi
  sub    %edi,%r9d
  mov    %ecx,%edi
  mov    %eax,%ecx
  mov    %r9d,(%r8,%rsi,4)
  add    $0x1,%rsi
  cmp    $0x9,%edi
  jg     L27
  mov    %eax,0x1c(%rsp)
  xor    %ebp,%ebp
  movslq %edx,%rax
  xor    %r12d,%r12d
  xor    %r13d,%r13d
  xor    %r14d,%r14d
  xor    %r15d,%r15d
  xor    %ebx,%ebx
  xor    %r9d,%r9d
  xor    %r10d,%r10d
  xor    %r11d,%r11d
  xor    %esi,%esi
  jmp    L42
  nopl   0x0(%rax)
L147:
  add    $0x1,%esi
  nopl   0x0(%rax,%rax,1)
L94:
  sub    $0x1,%rax
  cmp    $0xffffffff,%eax
  je     L45
L42:
  mov    (%r8,%rax,4),%edx
  test   %edx,%edx
  je     L147
  cmp    $0x1,%edx
  jne    L119
  sub    $0x1,%rax
  add    $0x1,%r11d
  cmp    $0xffffffff,%eax
  jne    L42
L45:
  lea    D43(%rip),%rdi
  xor    %eax,%eax
  mov    %r9d,0xc(%rsp)
  mov    %r10d,0x8(%rsp)
  mov    %r11d,0x4(%rsp)
  call   <printf@plt>
  mov    0x4(%rsp),%esi
  lea    D42(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x8(%rsp),%esi
  lea    D30(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0xc(%rsp),%esi
  lea    D75(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %ebx,%esi
  lea    D61(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r15d,%esi
  lea    D21(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r14d,%esi
  lea    D54(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r13d,%esi
  lea    D11(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r12d,%esi
  lea    D56(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  mov    %ebp,%esi
  lea    D59(%rip),%rdi
  call   <printf@plt>
  mov    0x7f8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L153
  add    $0x808,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L119:
  cmp    $0x2,%edx
  jne    L126
  add    $0x1,%r10d
  jmp    L94
L126:
  cmp    $0x3,%edx
  jne    L31
  add    $0x1,%r9d
  jmp    L94
L31:
  cmp    $0x4,%edx
  jne    L1
  add    $0x1,%ebx
  jmp    L94
L1:
  cmp    $0x5,%edx
  jne    L53
  add    $0x1,%r15d
  jmp    L94
L53:
  cmp    $0x6,%edx
  jne    L222
  add    $0x1,%r14d
  jmp    L94
L222:
  cmp    $0x7,%edx
  jne    L212
  add    $0x1,%r13d
  jmp    L94
L212:
  cmp    $0x8,%edx
  jne    L207
  add    $0x1,%r12d
  jmp    L94
L207:
  cmp    $0x9,%edx
  jne    L94
  add    $0x1,%ebp
  jmp    L94
L132:
  xor    %ebp,%ebp
  xor    %r12d,%r12d
  xor    %r13d,%r13d
  xor    %r14d,%r14d
  xor    %r15d,%r15d
  xor    %ebx,%ebx
  xor    %r9d,%r9d
  xor    %r10d,%r10d
  xor    %r11d,%r11d
  xor    %esi,%esi
  jmp    L45
L153:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D118
type: string
name: read_data
arguments: tag: D98
type: string
name: read_data
arguments: tag: D43
type: string
name: read_data
arguments: tag: D42
type: string
name: read_data
arguments: tag: D30
type: string
name: read_data
arguments: tag: D75
type: string
name: read_data
arguments: tag: D61
type: string
name: read_data
arguments: tag: D21
type: string
name: read_data
arguments: tag: D54
type: string
name: read_data
arguments: tag: D11
type: string
name: read_data
arguments: tag: D56
type: string
name: read_data
arguments: tag: D59
type: string

tool: D118: a=

tool: D98: %d

tool: D43: 
c0=%d

tool: D42: 
c1=%d

tool: D30: 
c2=%d

tool: D75: 
c3=%d

tool: D61: 
c4=%d

tool: D21: 
c5=%d

tool: D54: 
c6=%d

tool: D11: 
c7=%d

tool: D56: 
c8=%d

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