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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  lea    D45(%rip),%r13
  push   %r12
  push   %rbp
  lea    D58(%rip),%rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x108,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xf8(%rsp)
  xor    %eax,%eax
  lea    0x90(%rsp),%rsi
  mov    $0x1,%eax
  lea    0x1c(%rsp),%r12
  mov    %rsi,(%rsp)
  sub    %esi,%eax
  mov    %eax,%r15d
  nopl   0x0(%rax,%rax,1)
L134:
  lea    D89(%rip),%rdi
  call   <puts@plt>
  lea    D88(%rip),%rdi
  call   <puts@plt>
  lea    D71(%rip),%rdi
  call   <puts@plt>
  lea    D4(%rip),%rdi
  call   <puts@plt>
  nopl   0x0(%rax,%rax,1)
L72:
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x1c(%rsp),%eax
  cmp    $0x3,%eax
  ja     L72
  cmp    $0x2,%eax
  je     L193
  cmp    $0x3,%eax
  je     L91
  cmp    $0x1,%eax
  je     L76
L175:
  test   %eax,%eax
  jne    L134
  mov    0xf8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L210
  add    $0x108,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L76:
  lea    D36(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    0x20(%rsp),%rsi
  lea    D66(%rip),%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x1c(%rsp),%eax
  jmp    L175
  nop
L91:
  mov    (%rsp),%rcx
  movzbl 0x20(%rsp,%r14,1),%edx
  lea    0x20(%rsp),%rsi
  xor    %eax,%eax
  add    %r14,%rsi
  add    %r14,%rcx
  test   %dl,%dl
  je     L98
  nopl   0x0(%rax,%rax,1)
L195:
  mov    %dl,(%rcx,%rax,1)
  add    $0x1,%rax
  movzbl (%rsi,%rax,1),%edx
  test   %dl,%dl
  jne    L195
L98:
  movzbl 0x90(%rsp),%ecx
  mov    $0x1,%r8d
  lea    0x8f(%rsp),%r9
  xor    %r14d,%r14d
  test   %cl,%cl
  je     L134
  mov    %r12,0x8(%rsp)
  mov    %r9,%r14
  mov    %r15d,%r12d
  mov    %ebx,%r15d
  mov    %r8,%rbx
  jmp    L211
  nopl   0x0(%rax,%rax,1)
L63:
  mov    %ebx,%eax
  add    $0x1,%rbx
  movzbl (%r14,%rbx,1),%ecx
  test   %cl,%cl
  je     L213
L211:
  movsbl %cl,%esi
  cmp    $0x30,%cl
  je     L63
  movzbl 0x90(%rsp),%edx
  test   %dl,%dl
  je     L57
  mov    (%rsp),%rax
  xor    %r10d,%r10d
  cs nopw 0x0(%rax,%rax,1)
L85:
  cmp    %cl,%dl
  jne    L136
  movb   $0x30,(%rax)
  add    $0x1,%r10d
L136:
  lea    (%r12,%rax,1),%r15d
  movzbl 0x1(%rax),%edx
  add    $0x1,%rax
  test   %dl,%dl
  jne    L85
L81:
  mov    %r10d,%edx
  lea    D96(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %ebx,%eax
  add    $0x1,%rbx
  movzbl (%r14,%rbx,1),%ecx
  test   %cl,%cl
  jne    L211
L213:
  movslq %eax,%r14
  mov    %r15d,%ebx
  mov    0x1c(%rsp),%eax
  mov    %r12d,%r15d
  mov    0x8(%rsp),%r12
  jmp    L175
  nopw   0x0(%rax,%rax,1)
L193:
  movslq %ebx,%rcx
  lea    0x1(%rbx),%eax
  lea    0x1f(%rsp),%rdx
  cmpb   $0x0,0x20(%rsp,%rcx,1)
  cltq
  je     L170
  nopl   0x0(%rax)
L179:
  mov    %eax,%ebx
  add    $0x1,%rax
  cmpb   $0x0,(%rdx,%rax,1)
  jne    L179
L170:
  mov    %ebx,%esi
  lea    D85(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x1c(%rsp),%eax
  jmp    L175
  nopl   (%rax)
L57:
  xor    %r10d,%r10d
  xor    %r15d,%r15d
  jmp    L81
L210:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D45
type_guessed: string
name: disassemble_data
arguments: data_label: D58
type_guessed: string
name: disassemble_data
arguments: data_label: D89
type_guessed: string
name: disassemble_data
arguments: data_label: D88
type_guessed: string
name: disassemble_data
arguments: data_label: D71
type_guessed: string
name: disassemble_data
arguments: data_label: D4
type_guessed: string
name: disassemble_data
arguments: data_label: D36
type_guessed: string
name: disassemble_data
arguments: data_label: D66
type_guessed: string
name: disassemble_data
arguments: data_label: D96
type_guessed: string
name: disassemble_data
arguments: data_label: D85
type_guessed: string

tool: D45: Inserisci scelta(0-3):
 

tool: D58: %d

tool: D89: 1-Inserisci il nome 

tool: D88: 2-Calcola la lunghezza del nome inserito 

tool: D71: 3-Calcola la frequenza caratteri 

tool: D4: 0-EXIT 

tool: D36: Inserisci un nome qualsiasi: 

tool: D66: %s

tool: D96: Il carattere %c si ripete %d volte


tool: D85: Il nome inserito e' lungo %d caratteri


assistant: ```c
int main() {
  int scelta;
  char nome[100];
  char copia[100];
  int i;
  int c;
  int cont;
  int freq;
  c = 0;
  do {
    printf("1-Inserisci il nome \n");
    printf("2-Calcola la lunghezza del nome inserito \n");
    printf("3-Calcola la frequenza caratteri \n");
    printf("0-EXIT \n");
    do {
      printf("Inserisci scelta(0-3):\n ");
      scanf("%d", &scelta);
    } while ((scelta < 0) || (scelta > 3));
    switch (scelta) {
    case 1:
      printf("Inserisci un nome qualsiasi: ");
      scanf("%s", nome);
      break;
    case 2:
      while (nome[c] != '\0') {
        c++;
      }
      printf("Il nome inserito e' lungo %d caratteri\n", c);
      break;
    case 3:
      while (nome[i] != 0) {
        copia[i] = nome[i];
        i++;
      }
      i = 0;
      while (copia[i] != 0) {
        cont = copia[i];
        if (cont != '0') {
          c = 0;
          freq = 0;
          while (copia[c] != 0) {
            if (copia[c] == cont) {
              freq++;
              copia[c] = '0';
            }
            c++;
          }
          printf("Il carattere %c si ripete %d volte\n", cont, freq);
        }
        i++;
      }
    }
  } while (scelta != 0);
}
```