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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %edi,-0x54(%rbp)
  mov    %rsi,-0x60(%rbp)
  movl   $0x0,-0x3c(%rbp)
  cmpl   $0x2,-0x54(%rbp)
  jg     L98
  lea    D54(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D40(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D36(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D42(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
  jmp    L112
L98:
  cmpl   $0x4,-0x54(%rbp)
  jne    L112
  mov    -0x60(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%rax
  mov    $0x2,%edx
  lea    D41(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,-0x3c(%rbp)
L112:
  mov    -0x60(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x38(%rbp)
  mov    -0x60(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x34(%rbp)
  mov    $0x1,%edi
  call   <srand@plt>
  mov    -0x38(%rbp),%eax
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x30(%rbp)
  mov    -0x38(%rbp),%eax
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x28(%rbp)
  mov    -0x38(%rbp),%eax
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0x38(%rbp),%eax
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x34(%rbp),%eax
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x34(%rbp),%eax
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x44(%rbp)
  jmp    L114
L132:
  mov    $0x0,%eax
  call   <rand@plt>
  movslq %eax,%rdx
  imul   $0x10624dd3,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x6,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0x3e8,%edx,%ecx
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    -0x44(%rbp),%eax
  lea    0x0(,%rax,4),%rcx
  mov    -0x10(%rbp),%rax
  add    %rcx,%rax
  pxor   %xmm0,%xmm0
  cvtsi2ss %edx,%xmm0
  movss  %xmm0,(%rax)
  mov    $0x0,%eax
  call   <rand@plt>
  movslq %eax,%rdx
  imul   $0x10624dd3,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x6,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0x3e8,%edx,%ecx
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    -0x44(%rbp),%eax
  lea    0x0(,%rax,4),%rcx
  mov    -0x8(%rbp),%rax
  add    %rcx,%rax
  pxor   %xmm0,%xmm0
  cvtsi2ss %edx,%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x44(%rbp)
L114:
  mov    -0x44(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jb     L132
  movl   $0x0,-0x44(%rbp)
  jmp    L122
L58:
  mov    -0x44(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  movl   $0x0,-0x40(%rbp)
  jmp    L166
L94:
  mov    $0x0,%eax
  call   <rand@plt>
  and    $0x1,%eax
  test   %eax,%eax
  je     L39
  mov    -0x40(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm2
  movss  %xmm2,-0x58(%rbp)
  mov    -0x40(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  mov    -0x44(%rbp),%eax
  test   %rax,%rax
  js     L30
  pxor   %xmm0,%xmm0
  cvtsi2ss %rax,%xmm0
  jmp    L69
L30:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2ss %rdx,%xmm0
  addss  %xmm0,%xmm0
L69:
  mulss  %xmm0,%xmm1
  movd   %xmm1,%eax
  movd   %eax,%xmm0
  call   <cos@plt>
  movss  -0x58(%rbp),%xmm1
  mulss  %xmm0,%xmm1
  mov    -0x44(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x44(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  addss  %xmm1,%xmm0
  movss  %xmm0,(%rax)
  jmp    L72
L39:
  mov    -0x40(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm3
  movss  %xmm3,-0x58(%rbp)
  mov    -0x40(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  mov    -0x44(%rbp),%eax
  test   %rax,%rax
  js     L13
  pxor   %xmm0,%xmm0
  cvtsi2ss %rax,%xmm0
  jmp    L137
L13:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2ss %rdx,%xmm0
  addss  %xmm0,%xmm0
L137:
  mulss  %xmm0,%xmm1
  movd   %xmm1,%eax
  movd   %eax,%xmm0
  call   <sin@plt>
  movss  -0x58(%rbp),%xmm1
  mulss  %xmm0,%xmm1
  mov    -0x44(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x44(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  addss  %xmm1,%xmm0
  movss  %xmm0,(%rax)
L72:
  mov    -0x44(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x40(%rbp)
L166:
  mov    -0x40(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jb     L94
  addl   $0x1,-0x44(%rbp)
L122:
  mov    -0x44(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jb     L58
  mov    -0x18(%rbp),%r8
  mov    -0x20(%rbp),%rdi
  mov    -0x28(%rbp),%rcx
  mov    -0x30(%rbp),%rdx
  mov    -0x3c(%rbp),%esi
  mov    -0x38(%rbp),%eax
  mov    %r8,%r9
  mov    %rdi,%r8
  mov    %eax,%edi
  call   <fft_float@plt>
  lea    D55(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x0,-0x44(%rbp)
  jmp    L71
L129:
  mov    -0x44(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  pxor   %xmm4,%xmm4
  cvtss2sd %xmm0,%xmm4
  movq   %xmm4,%rax
  movq   %rax,%xmm0
  lea    D34(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  addl   $0x1,-0x44(%rbp)
L71:
  mov    -0x44(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jb     L129
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    D69(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x0,-0x44(%rbp)
  jmp    L87
L128:
  mov    -0x44(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  pxor   %xmm5,%xmm5
  cvtss2sd %xmm0,%xmm5
  movq   %xmm5,%rax
  movq   %rax,%xmm0
  lea    D34(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  addl   $0x1,-0x44(%rbp)
L87:
  mov    -0x44(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jb     L128
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D54
type_infered: string
name: retrieve_data
arguments: data_label: D40
type_infered: string
name: retrieve_data
arguments: data_label: D36
type_infered: string
name: retrieve_data
arguments: data_label: D42
type_infered: string
name: retrieve_data
arguments: data_label: D41
type_infered: string
name: retrieve_data
arguments: data_label: D55
type_infered: string
name: retrieve_data
arguments: data_label: D34
type_infered: string
name: retrieve_data
arguments: data_label: D69
type_infered: string

tool: D54: Usage: fft <waves> <length> -i

tool: D40: -i performs an inverse fft

tool: D36: make <waves> random sinusoids

tool: D42: <length> is the number of samples

tool: D41: -i

tool: D55: RealOut:

tool: D34: %f 	

tool: D69: ImagOut:

assistant: ```c
int main(int argc, char *argv[]) {
  unsigned MAXSIZE;
  unsigned MAXWAVES;
  unsigned i, j;
  float *RealIn;
  float *ImagIn;
  float *RealOut;
  float *ImagOut;
  float *coeff;
  float *amp;
  int invfft = 0;
  if (argc < 3) {
    printf("Usage: fft <waves> <length> -i\n");
    printf("-i performs an inverse fft\n");
    printf("make <waves> random sinusoids");
    printf("<length> is the number of samples\n");
    exit(-1);
  } else if (argc == 4)
    invfft = !strncmp(argv[3], "-i", 2);
  MAXSIZE = atoi(argv[2]);
  MAXWAVES = atoi(argv[1]);
  srand(1);
  RealIn = (float *)malloc(sizeof(float) * MAXSIZE);
  ImagIn = (float *)malloc(sizeof(float) * MAXSIZE);
  RealOut = (float *)malloc(sizeof(float) * MAXSIZE);
  ImagOut = (float *)malloc(sizeof(float) * MAXSIZE);
  coeff = (float *)malloc(sizeof(float) * MAXWAVES);
  amp = (float *)malloc(sizeof(float) * MAXWAVES);
  for (i = 0; i < MAXWAVES; i++) {
    coeff[i] = rand() % 1000;
    amp[i] = rand() % 1000;
  }
  for (i = 0; i < MAXSIZE; i++) {
    RealIn[i] = 0;
    for (j = 0; j < MAXWAVES; j++) {
      if (rand() % 2) {
        RealIn[i] += coeff[j] * cos(amp[j] * i);
      } else {
        RealIn[i] += coeff[j] * sin(amp[j] * i);
      }
      ImagIn[i] = 0;
    }
  }
  fft_float(MAXSIZE, invfft, RealIn, ImagIn, RealOut, ImagOut);
  printf("RealOut:\n");
  for (i = 0; i < MAXSIZE; i++)
    printf("%f \t", RealOut[i]);
  printf("\n");
  printf("ImagOut:\n");
  for (i = 0; i < MAXSIZE; i++)
    printf("%f \t", ImagOut[i]);
  printf("\n");
  free(RealIn);
  free(ImagIn);
  free(RealOut);
  free(ImagOut);
  free(coeff);
  free(amp);
  exit(0);
}
```