user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x1d0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x1c4(%rbp)
  movl   $0x0,-0x1c8(%rbp)
  lea    -0x1cc(%rbp),%rax
  mov    %rax,%rsi
  lea    D36(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  jmp    L132
L105:
  mov    -0x1cc(%rbp),%edx
  mov    -0x1c4(%rbp),%eax
  cltq
  mov    %edx,-0x1a0(%rbp,%rax,4)
  mov    -0x1cc(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  -0x1b0(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x1b0(%rbp)
  addl   $0x1,-0x1c4(%rbp)
  lea    -0x1cc(%rbp),%rax
  mov    %rax,%rsi
  lea    D36(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
L132:
  mov    -0x1cc(%rbp),%eax
  cmp    $0xffffffff,%eax
  jne    L105
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x1c4(%rbp),%xmm1
  movsd  -0x1b0(%rbp),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x1a8(%rbp)
  cmpl   $0x0,-0x1c4(%rbp)
  jle    L131
  mov    -0x1a8(%rbp),%rax
  movq   %rax,%xmm0
  lea    D68(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
L131:
  lea    D134(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D92(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D115(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D52(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D163(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D61(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D71(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0x1c8(%rbp),%rax
  mov    %rax,%rsi
  lea    D36(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0x1c8(%rbp),%eax
  cmp    $0x4,%eax
  je     L178
  cmp    $0x4,%eax
  jg     L140
  cmp    $0x3,%eax
  je     L25
  cmp    $0x3,%eax
  jg     L140
  cmp    $0x1,%eax
  je     L260
  cmp    $0x2,%eax
  je     L39
  jmp    L140
L260:
  mov    -0x1a8(%rbp),%rax
  movq   %rax,%xmm0
  lea    D136(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movl   $0x0,-0x1c0(%rbp)
  jmp    L112
L235:
  mov    -0x1c0(%rbp),%eax
  cltq
  mov    -0x1a0(%rbp,%rax,4),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  comisd -0x1a8(%rbp),%xmm0
  jbe    L248
  mov    -0x1c0(%rbp),%eax
  cltq
  mov    -0x1a0(%rbp,%rax,4),%eax
  mov    %eax,%esi
  lea    D143(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L248:
  addl   $0x1,-0x1c0(%rbp)
L112:
  mov    -0x1c0(%rbp),%eax
  cmp    -0x1c4(%rbp),%eax
  jle    L235
  jmp    L141
L39:
  mov    -0x1a8(%rbp),%rax
  movq   %rax,%xmm0
  lea    D154(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movl   $0x0,-0x1bc(%rbp)
  jmp    L212
L15:
  mov    -0x1bc(%rbp),%eax
  cltq
  mov    -0x1a0(%rbp,%rax,4),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  -0x1a8(%rbp),%xmm0
  comisd %xmm1,%xmm0
  jbe    L226
  mov    -0x1bc(%rbp),%eax
  cltq
  mov    -0x1a0(%rbp,%rax,4),%eax
  mov    %eax,%esi
  lea    D143(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L226:
  addl   $0x1,-0x1bc(%rbp)
L212:
  mov    -0x1bc(%rbp),%eax
  cmp    -0x1c4(%rbp),%eax
  jle    L15
  jmp    L141
L25:
  mov    -0x1a8(%rbp),%rax
  movq   %rax,%xmm0
  lea    D64(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movl   $0x0,-0x1b8(%rbp)
  jmp    L33
L184:
  mov    -0x1b8(%rbp),%eax
  cltq
  mov    -0x1a0(%rbp,%rax,4),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  comisd -0x1a8(%rbp),%xmm0
  jb     L165
  mov    -0x1b8(%rbp),%eax
  cltq
  mov    -0x1a0(%rbp,%rax,4),%eax
  mov    %eax,%esi
  lea    D143(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L165:
  addl   $0x1,-0x1b8(%rbp)
L33:
  mov    -0x1b8(%rbp),%eax
  cmp    -0x1c4(%rbp),%eax
  jle    L184
  jmp    L141
L178:
  mov    -0x1a8(%rbp),%rax
  movq   %rax,%xmm0
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movl   $0x0,-0x1b4(%rbp)
  jmp    L162
L225:
  mov    -0x1b4(%rbp),%eax
  cltq
  mov    -0x1a0(%rbp,%rax,4),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  comisd -0x1a8(%rbp),%xmm0
  jb     L83
  mov    -0x1b4(%rbp),%eax
  cltq
  mov    -0x1a0(%rbp,%rax,4),%eax
  mov    %eax,%esi
  lea    D72(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L83:
  addl   $0x1,-0x1b4(%rbp)
L162:
  mov    -0x1b4(%rbp),%eax
  cmp    -0x1c4(%rbp),%eax
  jle    L225
  jmp    L141
L140:
  lea    D95(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  nop
L141:
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L69
  call   <__stack_chk_fail@plt>
L69:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D36
data_type: string
name: disassemble_data
arguments: tag: D68
data_type: string
name: disassemble_data
arguments: tag: D134
data_type: string
name: disassemble_data
arguments: tag: D92
data_type: string
name: disassemble_data
arguments: tag: D115
data_type: string
name: disassemble_data
arguments: tag: D52
data_type: string
name: disassemble_data
arguments: tag: D163
data_type: string
name: disassemble_data
arguments: tag: D61
data_type: string
name: disassemble_data
arguments: tag: D71
data_type: string
name: disassemble_data
arguments: tag: D136
data_type: string
name: disassemble_data
arguments: tag: D143
data_type: string
name: disassemble_data
arguments: tag: D154
data_type: string
name: disassemble_data
arguments: tag: D64
data_type: string
name: disassemble_data
arguments: tag: D13
data_type: string
name: disassemble_data
arguments: tag: D72
data_type: string
name: disassemble_data
arguments: tag: D95
data_type: string

tool: D36: %d

tool: D68: The average is:%f


tool: D134: Now you can choose to show the number which have a diff to the average.

tool: D92: You can choose from the list:

tool: D115: 1. >

tool: D52: 2. <

tool: D163: 3. >=

tool: D61: 4. <=

tool: D71: Now Enter your choice(The number please.):

tool: D136: The numbers larger than(>) the average(%f) are:


tool: D143:  %d 

tool: D154: The numbers larger than(<) the average(%f) are:


tool: D64: The numbers larger than(>=) the average(%f) are:


tool: D13: And the numbers larger than(<=) the average(%f) are:


tool: D72:  %d 

tool: D95: Skipped

assistant: ```c
int main() {
  int x;
  double sum;
  double average;
  int cnt = 0;
  int number[100];
  int choice = 0;
  scanf("%d", &x);
  while (x != -1) {
    number[cnt] = x;
    sum += x;
    cnt++;
    scanf("%d", &x);
  }
  average = sum / cnt;
  if (cnt > 0) {
    printf("The average is:%f\n", average);
  }
  printf("Now you can choose to show the number which have a diff to the average.");
  printf("You can choose from the list:\n");
  printf("1. >\n");
  printf("2. <\n");
  printf("3. >=\n");
  printf("4. <=\n");
  printf("Now Enter your choice(The number please.):");
  scanf("%d", &choice);
  switch (choice) {
  case 1:
    printf("The numbers larger than(>) the average(%f) are:\n", average);
    for (int i = 0; i <= cnt; i++) {
      if (number[i] > average) {
        printf(" %d ", number[i]);
      }
    }
    break;
  case 2:
    printf("The numbers larger than(<) the average(%f) are:\n", average);
    for (int i = 0; i <= cnt; i++) {
      if (number[i] < average) {
        printf(" %d ", number[i]);
      }
    }
    break;
  case 3:
    printf("The numbers larger than(>=) the average(%f) are:\n", average);
    for (int i = 0; i <= cnt; i++) {
      if (number[i] >= average) {
        printf(" %d ", number[i]);
      }
    }
    break;
  case 4:
    printf("And the numbers larger than(<=) the average(%f) are:\n", average);
    for (int i = 0; i <= cnt; i++) {
      if (number[i] >= average) {
        printf(" %d \f", number[i]);
      }
    }
    break;
  default:
    printf("Skipped");
    break;
  }
  return 0;
}
```