user: 请将以下的汇编代码转换成C语言代码：

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    D91(%rip),%rdi
  call   <printf@plt>
  lea    0x14(%rsp),%rsi
  lea    D26(%rip),%rdi
  call   <scanf@plt>
  mov    0x14(%rsp),%edx
  test   %edx,%edx
  jle    L311
  movl   $0x0,0x4(%rsp)
  movl   $0x0,0x8(%rsp)
  mov    $0x0,%ebx
  mov    $0x0,%ebp
  mov    $0x0,%r12d
  mov    $0x0,%r13d
  mov    $0x0,%r14d
  mov    $0x0,%r15d
  movl   $0x0,0xc(%rsp)
  mov    $0x0,%esi
  jmp    L270
L44:
  cmp    $0x1,%eax
  jne    L27
  addl   $0x1,0xc(%rsp)
L108:
  cmp    $0x4,%eax
  jne    L143
  add    $0x1,%r13d
L68:
  cmp    $0x7,%eax
  jne    L193
  add    $0x1,%ebx
L58:
  movslq %edx,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x22,%rax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  cmp    $0x9,%edx
  jle    L236
  mov    %eax,%edx
L270:
  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,%eax
  sub    %ecx,%eax
  jne    L44
  add    $0x1,%esi
L122:
  cmp    $0x3,%eax
  jne    L108
  add    $0x1,%r14d
L159:
  cmp    $0x6,%eax
  jne    L68
  add    $0x1,%ebp
L348:
  cmp    $0x9,%eax
  jne    L58
  addl   $0x1,0x4(%rsp)
  jmp    L58
L27:
  cmp    $0x2,%eax
  jne    L122
  add    $0x1,%r15d
L143:
  cmp    $0x5,%eax
  jne    L159
  add    $0x1,%r12d
L193:
  cmp    $0x8,%eax
  jne    L348
  addl   $0x1,0x8(%rsp)
  jmp    L58
L236:
  mov    %eax,0x14(%rsp)
  test   %esi,%esi
  jg     L131
L158:
  mov    0xc(%rsp),%esi
  test   %esi,%esi
  jg     L73
L197:
  test   %r15d,%r15d
  jg     L11
L20:
  test   %r14d,%r14d
  jg     L244
L357:
  test   %r13d,%r13d
  jg     L121
L342:
  test   %r12d,%r12d
  jg     L90
L257:
  test   %ebp,%ebp
  jg     L162
L327:
  test   %ebx,%ebx
  jg     L22
L312:
  mov    0x8(%rsp),%eax
  test   %eax,%eax
  jg     L273
L192:
  mov    0x4(%rsp),%eax
  test   %eax,%eax
  jg     L314
L249:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L9
  mov    $0x0,%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L131:
  lea    D81(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L158
L73:
  lea    D35(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L197
L311:
  movl   $0x0,0x4(%rsp)
  movl   $0x0,0x8(%rsp)
  mov    $0x0,%ebx
  mov    $0x0,%ebp
  mov    $0x0,%r12d
  mov    $0x0,%r13d
  mov    $0x0,%r14d
  mov    $0x0,%r15d
  jmp    L197
L11:
  mov    %r15d,%esi
  lea    D37(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L20
L244:
  mov    %r14d,%esi
  lea    D109(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L357
L121:
  mov    %r13d,%esi
  lea    D82(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L342
L90:
  mov    %r12d,%esi
  lea    D65(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L257
L162:
  mov    %ebp,%esi
  lea    D92(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L327
L22:
  mov    %ebx,%esi
  lea    D7(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L312
L273:
  mov    %eax,%esi
  lea    D53(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L192
L314:
  mov    %eax,%esi
  lea    D44(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L249
L9:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D91
datatype: string
name: read_data
arguments: data_label: D26
datatype: string
name: read_data
arguments: data_label: D81
datatype: string
name: read_data
arguments: data_label: D35
datatype: string
name: read_data
arguments: data_label: D37
datatype: string
name: read_data
arguments: data_label: D109
datatype: string
name: read_data
arguments: data_label: D82
datatype: string
name: read_data
arguments: data_label: D65
datatype: string
name: read_data
arguments: data_label: D92
datatype: string
name: read_data
arguments: data_label: D7
datatype: string
name: read_data
arguments: data_label: D53
datatype: string
name: read_data
arguments: data_label: D44
datatype: string

tool: D91: Vavedi chislo : 

tool: D26: %d

tool: D81: 
Broiat na nulite = %d

tool: D35: 
Broiat na edinicite = %d

tool: D37: 
Broiat na dvoikite = %d

tool: D109: 
Broiat na troikite = %d

tool: D82: 
Broiat na chetvorkite = %d

tool: D65: 
Broiat na peticite = %d

tool: D92: 
Broiat na shesticite = %d

tool: D7: 
Broiat na sedmicite = %d

tool: D53: 
Broiat na osmicite = %d

tool: D44: 
Broiat na deviatkite = %d

assistant: ```c
int main() {
  int num, r, a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0;
  printf("Vavedi chislo : ");
  scanf("%d", &num);
  while (num > 0) {
    r = num % 10;
    if (r == 0)
      a++;
    if (r == 1)
      b++;
    if (r == 2)
      c++;
    if (r == 3)
      d++;
    if (r == 4)
      e++;
    if (r == 5)
      f++;
    if (r == 6)
      g++;
    if (r == 7)
      h++;
    if (r == 8)
      i++;
    if (r == 9)
      j++;
    num = num / 10;
  }
  if (a > 0) {
    printf("\nBroiat na nulite = %d", a);
  }
  if (b > 0) {
    printf("\nBroiat na edinicite = %d", b);
  }
  if (c > 0) {
    printf("\nBroiat na dvoikite = %d", c);
  }
  if (d > 0) {
    printf("\nBroiat na troikite = %d", d);
  }
  if (e > 0) {
    printf("\nBroiat na chetvorkite = %d", e);
  }
  if (f > 0) {
    printf("\nBroiat na peticite = %d", f);
  }
  if (g > 0) {
    printf("\nBroiat na shesticite = %d", g);
  }
  if (h > 0) {
    printf("\nBroiat na sedmicite = %d", h);
  }
  if (i > 0) {
    printf("\nBroiat na osmicite = %d", i);
  }
  if (j > 0) {
    printf("\nBroiat na deviatkite = %d", j);
  }
  return 0;
}
```