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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  xor    %r13d,%r13d
  push   %r12
  lea    D3(%rip),%r12
  push   %rbp
  mov    %r12,%rdi
  push   %rbx
  sub    $0xfd8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xfc8(%rsp)
  xor    %eax,%eax
  lea    0x18(%rsp),%rsi
  call   <scanf@plt>
  lea    0x1c(%rsp),%rax
  mov    %rax,0x8(%rsp)
  mov    0x18(%rsp),%eax
  test   %eax,%eax
  jle    L78
  nopl   (%rax)
L45:
  mov    0x8(%rsp),%rsi
  mov    %r12,%rdi
  call   <scanf@plt>
  mov    0x1c(%rsp),%esi
  test   %esi,%esi
  jle    L106
  xor    %ebx,%ebx
  xor    %r15d,%r15d
  lea    0x20(%rsp),%rbp
  nopl   0x0(%rax,%rax,1)
L112:
  lea    0x0(%rbp,%rbx,4),%rsi
  mov    %r12,%rdi
  mov    %rbp,%r14
  call   <scanf@plt>
  mov    0x1c(%rsp),%esi
  add    0x0(%rbp,%rbx,4),%r15d
  add    $0x1,%rbx
  cmp    %ebx,%esi
  jg     L112
  mov    %r15d,%eax
  cltd
  idiv   %esi
  test   %esi,%esi
  jle    L106
  lea    -0x1(%rsi),%edx
  cmp    $0x2,%edx
  jbe    L144
  mov    %esi,%edx
  movd   %eax,%xmm3
  pxor   %xmm0,%xmm0
  shr    $0x2,%edx
  pshufd $0x0,%xmm3,%xmm2
  sub    $0x1,%edx
  shl    $0x4,%rdx
  lea    0x30(%rsp,%rdx,1),%rdx
  nopl   0x0(%rax)
L151:
  movdqa (%r14),%xmm1
  add    $0x10,%r14
  pcmpgtd %xmm2,%xmm1
  psubd  %xmm1,%xmm0
  cmp    %r14,%rdx
  jne    L151
  movdqa %xmm0,%xmm1
  mov    %esi,%ecx
  psrldq $0x8,%xmm1
  and    $0xfffffffc,%ecx
  paddd  %xmm1,%xmm0
  movdqa %xmm0,%xmm1
  psrldq $0x4,%xmm1
  paddd  %xmm1,%xmm0
  movd   %xmm0,%edx
  test   $0x3,%sil
  je     L123
L25:
  movslq %ecx,%rdi
  cmp    0x20(%rsp,%rdi,4),%eax
  jge    L76
  add    $0x1,%edx
L76:
  lea    0x1(%rcx),%edi
  cmp    %edi,%esi
  jle    L123
  movslq %edi,%rdi
  cmp    0x20(%rsp,%rdi,4),%eax
  jge    L147
  add    $0x1,%edx
L147:
  add    $0x2,%ecx
  cmp    %ecx,%esi
  jle    L123
  movslq %ecx,%rcx
  cmp    %eax,0x20(%rsp,%rcx,4)
  jle    L123
  add    $0x1,%edx
L123:
  pxor   %xmm0,%xmm0
  cvtsi2sd %edx,%xmm0
  mulsd  D10(%rip),%xmm0
L119:
  pxor   %xmm1,%xmm1
  lea    D14(%rip),%rdi
  add    $0x1,%r13d
  cvtsi2sd %esi,%xmm1
  divsd  %xmm1,%xmm0
  call   <printf@plt>
  cmp    %r13d,0x18(%rsp)
  jg     L45
L78:
  mov    0xfc8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L155
  add    $0xfd8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L106:
  pxor   %xmm0,%xmm0
  jmp    L119
L144:
  xor    %ecx,%ecx
  xor    %edx,%edx
  jmp    L25
L155:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D3
datatype: string
name: extract_symbolic_data
arguments: label: D10
datatype: f64
name: extract_symbolic_data
arguments: label: D14
datatype: string

tool: D3: %d

tool: D10: 100

tool: D14: %.3lf%%


assistant: ```c
main() {
  int Media, QtdAcima, Cont, Soma, TotCasos, Caso, TotAlunos, TotNotasAlu[1000];
  double PorcenAcima;
  scanf("%d", &TotCasos);
  for (Caso = 0; Caso < TotCasos; Caso++) {
    scanf("%d", &TotAlunos);
    Soma = 0;
    for (Cont = 0; Cont < TotAlunos; Cont++) {
      scanf("%d", &TotNotasAlu[Cont]);
      Soma = Soma + TotNotasAlu[Cont];
    }
    QtdAcima = 0;
    Media = Soma / TotAlunos;
    for (Cont = 0; Cont < TotAlunos; Cont++) {
      if (TotNotasAlu[Cont] > Media)
        QtdAcima++;
    }
    PorcenAcima = (double)(QtdAcima * 100.0) / TotAlunos;
    printf("%.3lf%%\n", PorcenAcima);
  }
  return 0;
}
```