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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x9000(%rsp),%r11
L55:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L55
  sub    $0xc98,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x9c88(%rsp)
  xor    %eax,%eax
  lea    0x38(%rsp),%rsi
  lea    D28(%rip),%rdi
  call   <scanf@plt>
  cmpl   $0x0,0x38(%rsp)
  jle    L112
  movl   $0x0,0x1c(%rsp)
  lea    0x3c(%rsp),%rax
  mov    %rax,0x20(%rsp)
  lea    0x44(%rsp),%rax
  mov    %rax,0x28(%rsp)
  jmp    L52
L6:
  cmp    $0x1,%eax
  jne    L101
  add    $0x1,%r10d
L166:
  cmp    $0x4,%eax
  jne    L121
  add    $0x1,%r9d
L104:
  cmp    $0x7,%eax
  jne    L142
  add    $0x1,%r12d
L137:
  cmp    $0x9,%ecx
  jle    L214
L63:
  movslq %edx,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x22,%rax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  mov    %eax,%esi
  lea    (%rax,%rax,4),%ecx
  add    %ecx,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %edx,%ecx
  mov    %esi,%edx
  jne    L6
  add    $0x1,%edi
L125:
  cmp    $0x3,%eax
  jne    L166
  add    $0x1,%r8d
L47:
  cmp    $0x6,%eax
  jne    L104
  add    $0x1,%ebp
L201:
  cmp    $0x9,%eax
  jne    L137
  add    $0x1,%r14d
  jmp    L137
L101:
  cmp    $0x2,%eax
  jne    L125
  add    $0x1,%r11d
L121:
  cmp    $0x5,%eax
  jne    L47
  add    $0x1,%ebx
L142:
  cmp    $0x8,%eax
  jne    L201
  add    $0x1,%r13d
  jmp    L137
L214:
  mov    0x8(%rsp),%rax
  mov    %edx,(%rax)
L187:
  add    $0x4,%r15
  cmp    %r15,0x10(%rsp)
  je     L193
L195:
  mov    %r15,0x8(%rsp)
  mov    (%r15),%edx
  test   %edx,%edx
  jg     L63
  jmp    L187
L114:
  mov    $0x0,%r14d
  mov    $0x0,%r13d
  mov    $0x0,%r12d
  mov    $0x0,%ebp
  mov    $0x0,%ebx
  mov    $0x0,%r9d
  mov    $0x0,%r8d
  mov    $0x0,%r11d
  mov    $0x0,%r10d
  mov    $0x0,%edi
L193:
  sub    $0x8,%rsp
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %r11d,%ecx
  mov    %r10d,%edx
  mov    %edi,%esi
  lea    D22(%rip),%rdi
  call   <printf@plt>
  addl   $0x1,0x4c(%rsp)
  mov    0x4c(%rsp),%eax
  add    $0x30,%rsp
  cmp    %eax,0x38(%rsp)
  jle    L112
L52:
  mov    0x20(%rsp),%rsi
  lea    D28(%rip),%rdi
  call   <scanf@plt>
  mov    0x3c(%rsp),%eax
  test   %eax,%eax
  jle    L114
  lea    -0x1(%rax),%ecx
  lea    0x2(%rcx),%rdx
  mov    $0x1,%eax
L231:
  mov    %eax,0x3c(%rsp,%rax,4)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L231
  lea    0x40(%rsp),%r15
  mov    0x28(%rsp),%rax
  lea    (%rax,%rcx,4),%rax
  mov    %rax,0x10(%rsp)
  mov    $0x0,%r14d
  mov    $0x0,%r13d
  mov    $0x0,%r12d
  mov    $0x0,%ebp
  mov    $0x0,%ebx
  mov    $0x0,%r9d
  mov    $0x0,%r8d
  mov    $0x0,%r11d
  mov    $0x0,%r10d
  mov    $0x0,%edi
  jmp    L195
L112:
  mov    0x9c88(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L24
  mov    $0x0,%eax
  add    $0x9c98,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L24:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D28
datatype: string
name: read_data
arguments: tag: D22
datatype: string

tool: D28: %d

tool: D22: %d %d %d %d %d %d %d %d %d %d


assistant: ```c
int main() {
  int t, i, n, ara[10002], j, zero, one, two, three, four, five, six, seven, eight, nine, k;
  scanf("%d", &t);
  for (i = 0; i < t; i++) {
    int lastdigit;
    zero = 0, one = 0, two = 0, three = 0, four = 0, five = 0, six = 0, seven = 0, eight = 0, nine = 0;
    scanf("%d", &n);
    for (j = 0, k = 1; j < n; j++, k++) {
      ara[j] = k;
    }
    for (j = 0; j < n; j++) {
      for (k = 0; ara[j] > 0; k++) {
        lastdigit = ara[j] % 10;
        ara[j] = ara[j] / 10;
        if (lastdigit == 0)
          zero++;
        if (lastdigit == 1)
          one++;
        if (lastdigit == 2)
          two++;
        if (lastdigit == 3)
          three++;
        if (lastdigit == 4)
          four++;
        if (lastdigit == 5)
          five++;
        if (lastdigit == 6)
          six++;
        if (lastdigit == 7)
          seven++;
        if (lastdigit == 8)
          eight++;
        if (lastdigit == 9)
          nine++;
      }
    }
    printf("%d %d %d %d %d %d %d %d %d %d\n", zero, one, two, three, four, five, six, seven, eight, nine);
  }
  return 0;
}
```