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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x168,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x1158(%rsp)
  xor    %eax,%eax
  lea    0x1c(%rsp),%rsi
  lea    D106(%rip),%rdi
  call   <scanf@plt>
  cmpl   $0x0,0x1c(%rsp)
  jle    L158
  lea    0x20(%rsp),%rbx
  mov    %rbx,%r12
  mov    $0x0,%ebp
  lea    D106(%rip),%r13
L236:
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <scanf@plt>
  add    $0x1,%ebp
  mov    0x1c(%rsp),%eax
  add    $0x4,%r12
  cmp    %ebp,%eax
  jg     L236
  test   %eax,%eax
  jle    L158
  lea    -0x1(%rax),%eax
  lea    0x4(%rbx,%rax,4),%rdi
  mov    $0x0,%r8d
  mov    $0x0,%r15d
  mov    $0xc4653600,%ebp
  mov    $0x0,%r12d
  movl   $0x0,0xc(%rsp)
  mov    $0x0,%r14d
  mov    $0x0,%r10d
  mov    $0x0,%r13d
  movl   $0x0,0x8(%rsp)
  mov    $0x0,%ecx
  mov    $0x0,%esi
  mov    $0x0,%r9d
  jmp    L127
L122:
  add    $0x1,%r13d
  test   %r8d,%r8d
  jne    L1
  add    %edx,0x8(%rsp)
  mov    %eax,%r8d
L25:
  cmp    $0x4,%eax
  jne    L224
  add    $0x1,%r15d
  cmp    %edx,%ebp
  cmovl  %edx,%ebp
  jmp    L224
L1:
  sub    %edx,0x8(%rsp)
  mov    %r9d,%r8d
  jmp    L25
L22:
  cmp    $0x3,%eax
  jne    L25
  add    %edx,0xc(%rsp)
  add    $0x1,%r12d
L224:
  add    $0x4,%rbx
  cmp    %rdi,%rbx
  je     L211
L127:
  mov    (%rbx),%edx
  movslq %edx,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x22,%rax
  mov    %edx,%r11d
  sar    $0x1f,%r11d
  sub    %r11d,%eax
  lea    (%rax,%rax,4),%eax
  add    %eax,%eax
  cmp    %eax,%edx
  jne    L214
  add    %edx,%esi
  add    $0x1,%ecx
L214:
  movslq %edx,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x21,%rax
  mov    %edx,%r11d
  sar    $0x1f,%r11d
  sub    %r11d,%eax
  lea    (%rax,%rax,4),%r11d
  mov    %edx,%eax
  sub    %r11d,%eax
  cmp    $0x1,%eax
  je     L122
  cmp    $0x2,%eax
  jne    L22
  add    $0x1,%r10d
  add    $0x1,%r14d
  jmp    L224
L211:
  mov    %r10d,%ebx
  test   %ecx,%ecx
  je     L190
  lea    D59(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L57
L132:
  mov    0x8(%rsp),%esi
  lea    D59(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L130
L28:
  mov    %ebx,%esi
  lea    D59(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L38
L86:
  pxor   %xmm0,%xmm0
  cvtsi2ssl 0xc(%rsp),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ss %r12d,%xmm1
  divss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  lea    D90(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  jmp    L177
L21:
  mov    %ebp,%esi
  lea    D106(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L20
L158:
  mov    $0x0,%r15d
  mov    $0xc4653600,%ebp
  mov    $0x0,%r12d
  movl   $0x0,0xc(%rsp)
  mov    $0x0,%r14d
  mov    $0x0,%ebx
  mov    $0x0,%r13d
  movl   $0x0,0x8(%rsp)
L190:
  lea    D102(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L57:
  test   %r13d,%r13d
  jne    L132
  lea    D102(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L130:
  test   %r14d,%r14d
  jne    L28
  lea    D102(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L38:
  test   %r12d,%r12d
  jne    L86
  lea    D102(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L177:
  test   %r15d,%r15d
  jne    L21
  mov    $0x4e,%edi
  call   <putchar@plt>
L20:
  mov    0x1158(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L181
  mov    $0x0,%eax
  add    $0x1168,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L181:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D106
type_guessed: string
name: retrieve_data
arguments: tag: D59
type_guessed: string
name: retrieve_data
arguments: tag: D90
type_guessed: string
name: retrieve_data
arguments: tag: D102
type_guessed: string

tool: D106: %d

tool: D59: %d 

tool: D90: %.1f 

tool: D102: N 

assistant: ```c
int main() {
  int n;
  int a[1100];
  scanf("%d", &n);
  int a1 = 0, count_a1 = 0;
  int a2 = 0, count_a2 = 0;
  int a3 = 0, count_a3 = 0;
  int a4 = 0, count_a4 = 0;
  int a5 = -1000000000, count_a5 = 0;
  int flag = 0;
  for (int i = 0; i < n; i++)
    scanf("%d", a + i);
  for (int i = 0; i < n; i++) {
    if (a[i] % 10 == 0) {
      a1 += a[i];
      count_a1++;
    }
    if (a[i] % 5 == 1) {
      count_a2++;
      if (flag == 0) {
        a2 += a[i];
        flag = 1;
      } else {
        a2 -= a[i];
        flag = 0;
      }
    }
    if (a[i] % 5 == 2) {
      a3++;
      count_a3++;
    }
    if (a[i] % 5 == 3) {
      a4 += a[i];
      count_a4++;
    }
    if (a[i] % 5 == 4) {
      count_a5++;
      if (a[i] > a5)
        a5 = a[i];
    }
  }
  if (count_a1 == 0)
    printf("N ");
  else
    printf("%d ", a1);
  if (count_a2 == 0)
    printf("N ");
  else
    printf("%d ", a2);
  if (count_a3 == 0)
    printf("N ");
  else
    printf("%d ", a3);
  if (count_a4 == 0)
    printf("N ");
  else
    printf("%.1f ", (float)a4 / count_a4);
  if (count_a5 == 0)
    printf("N");
  else
    printf("%d", a5);
  return 0;
}
```