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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x38(%rbp)
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x34(%rbp)
  movl   $0x0,-0x30(%rbp)
  movl   $0x0,-0x2c(%rbp)
  movl   $0x0,-0x28(%rbp)
  movl   $0x0,-0x24(%rbp)
  movl   $0x0,-0x20(%rbp)
  movl   $0x0,-0x1c(%rbp)
  movl   $0x0,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  movl   $0x0,-0x10(%rbp)
  lea    D51(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0x38(%rbp),%rax
  mov    %rax,%rsi
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  jmp    L80
L11:
  mov    -0x38(%rbp),%edx
  movslq %edx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%ecx
  mov    %ecx,%eax
  shl    $0x2,%eax
  add    %ecx,%eax
  add    %eax,%eax
  sub    %eax,%edx
  mov    %edx,-0xc(%rbp)
  mov    -0x38(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x38(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  jne    L77
  addl   $0x1,-0x34(%rbp)
L77:
  cmpl   $0x1,-0xc(%rbp)
  jne    L65
  addl   $0x1,-0x30(%rbp)
L65:
  cmpl   $0x2,-0xc(%rbp)
  jne    L94
  addl   $0x1,-0x2c(%rbp)
L94:
  cmpl   $0x3,-0xc(%rbp)
  jne    L9
  addl   $0x1,-0x28(%rbp)
L9:
  cmpl   $0x4,-0xc(%rbp)
  jne    L64
  addl   $0x1,-0x24(%rbp)
L64:
  cmpl   $0x5,-0xc(%rbp)
  jne    L82
  addl   $0x1,-0x20(%rbp)
L82:
  cmpl   $0x6,-0xc(%rbp)
  jne    L118
  addl   $0x1,-0x1c(%rbp)
L118:
  cmpl   $0x7,-0xc(%rbp)
  jne    L48
  addl   $0x1,-0x18(%rbp)
L48:
  cmpl   $0x8,-0xc(%rbp)
  jne    L50
  addl   $0x1,-0x14(%rbp)
L50:
  cmpl   $0x9,-0xc(%rbp)
  jne    L80
  addl   $0x1,-0x10(%rbp)
L80:
  mov    -0x38(%rbp),%eax
  test   %eax,%eax
  jne    L11
  mov    -0x34(%rbp),%eax
  mov    %eax,%esi
  lea    D40(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x30(%rbp),%eax
  mov    %eax,%esi
  lea    D50(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x2c(%rbp),%eax
  mov    %eax,%esi
  lea    D27(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x28(%rbp),%eax
  mov    %eax,%esi
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x24(%rbp),%eax
  mov    %eax,%esi
  lea    D26(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x20(%rbp),%eax
  mov    %eax,%esi
  lea    D78(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x1c(%rbp),%eax
  mov    %eax,%esi
  lea    D22(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x18(%rbp),%eax
  mov    %eax,%esi
  lea    D38(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x14(%rbp),%eax
  mov    %eax,%esi
  lea    D66(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x10(%rbp),%eax
  mov    %eax,%esi
  lea    D89(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L58
  call   <__stack_chk_fail@plt>
L58:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D51
datatype: string
name: retrieve_data
arguments: tag: D7
datatype: string
name: retrieve_data
arguments: tag: D40
datatype: string
name: retrieve_data
arguments: tag: D50
datatype: string
name: retrieve_data
arguments: tag: D27
datatype: string
name: retrieve_data
arguments: tag: D3
datatype: string
name: retrieve_data
arguments: tag: D26
datatype: string
name: retrieve_data
arguments: tag: D78
datatype: string
name: retrieve_data
arguments: tag: D22
datatype: string
name: retrieve_data
arguments: tag: D38
datatype: string
name: retrieve_data
arguments: tag: D66
datatype: string
name: retrieve_data
arguments: tag: D89
datatype: string

tool: D51: 
 Vuvedi chislo:

tool: D7: %d

tool: D40: 
broi 0: %d

tool: D50: 
broi 1: %d

tool: D27: 
broi 2: %d

tool: D3: 
broi 3: %d

tool: D26: 
broi 4: %d

tool: D78: 
broi 5: %d

tool: D22: 
broi 6: %d

tool: D38: 
broi 7: %d

tool: D66: 
broi 8: %d

tool: D89: 
broi 9: %d

assistant: ```c
int main() {
  int n = 0, i = 0;
  int br0 = 0, br1 = 0, br2 = 0, br3 = 0, br4 = 0, br5 = 0, br6 = 0, br7 = 0, br8 = 0, br9 = 0;
  printf("\n Vuvedi chislo:");
  scanf("%d", &n);
  while (n != 0) {
    i = n % 10;
    n = n / 10;
    if (i == 0) {
      br0++;
    }
    if (i == 1) {
      br1++;
    }
    if (i == 2) {
      br2++;
    }
    if (i == 3) {
      br3++;
    }
    if (i == 4) {
      br4++;
    }
    if (i == 5) {
      br5++;
    }
    if (i == 6) {
      br6++;
    }
    if (i == 7) {
      br7++;
    }
    if (i == 8) {
      br8++;
    }
    if (i == 9) {
      br9++;
    }
  }
  printf("\nbroi 0: %d", br0);
  printf("\nbroi 1: %d", br1);
  printf("\nbroi 2: %d", br2);
  printf("\nbroi 3: %d", br3);
  printf("\nbroi 4: %d", br4);
  printf("\nbroi 5: %d", br5);
  printf("\nbroi 6: %d", br6);
  printf("\nbroi 7: %d", br7);
  printf("\nbroi 8: %d", br8);
  printf("\nbroi 9: %d", br9);
  return 0;
}
```