user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpl   $0x2,-0x24(%rbp)
  je     L7
  mov    -0x30(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rsi
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D134(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L7:
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  lea    -0x18(%rbp),%rdx
  lea    D42(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L79
  lea    D39(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L79:
  mov    -0x18(%rbp),%eax
  test   %eax,%eax
  jg     L17
  lea    D39(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L17:
  mov    -0x18(%rbp),%eax
  lea    0x3(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x2,%eax
  mov    %eax,-0x10(%rbp)
  lea    D110(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x18(%rbp),%eax
  mov    %eax,%esi
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x10(%rbp),%eax
  mov    %eax,%esi
  lea    D135(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x14(%rbp)
  jmp    L35
L53:
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x14(%rbp),%xmm1
  mov    -0x18(%rbp),%eax
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  movsd  D82(%rip),%xmm0
  divsd  %xmm2,%xmm0
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <sin@plt>
  movsd  D32(%rip),%xmm1
  mulsd  %xmm0,%xmm1
  movsd  D104(%rip),%xmm0
  addsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%rax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  lea    D122(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x10(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x14(%rbp)
  je     L54
  lea    D117(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L54:
  mov    -0x14(%rbp),%eax
  cltd
  shr    $0x1d,%edx
  add    %edx,%eax
  and    $0x7,%eax
  sub    %edx,%eax
  cmp    $0x7,%eax
  jne    L51
  mov    $0xa,%edi
  call   <putchar@plt>
L51:
  addl   $0x1,-0x14(%rbp)
L35:
  mov    -0x14(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jl     L53
  lea    D137(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L4
  call   <__stack_chk_fail@plt>
L4:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D37
type_guessed: string
name: extract_symbolic_data
arguments: tag: D134
type_guessed: string
name: extract_symbolic_data
arguments: tag: D42
type_guessed: string
name: extract_symbolic_data
arguments: tag: D39
type_guessed: string
name: extract_symbolic_data
arguments: tag: D110
type_guessed: string
name: extract_symbolic_data
arguments: tag: D2
type_guessed: string
name: extract_symbolic_data
arguments: tag: D135
type_guessed: string
name: extract_symbolic_data
arguments: tag: D82
type_guessed: byte[8]
name: extract_symbolic_data
arguments: tag: D32
type_guessed: byte[8]
name: extract_symbolic_data
arguments: tag: D104
type_guessed: f64
name: extract_symbolic_data
arguments: tag: D122
type_guessed: string
name: extract_symbolic_data
arguments: tag: D117
type_guessed: string
name: extract_symbolic_data
arguments: tag: D137
type_guessed: string

tool: D37: Usage: %s <size>


tool: D134:   <size>: size of (complex) FFT

tool: D42: %d

tool: D39: Error: Invalid size

tool: D110: // Table generated using gen_twiddle.

tool: D2: // FFT size: %d.


tool: D135: const uint16_t twiddle_factor_lookup[%d] = {


tool: {"D82": [0x18,0x2d,0x44,0x54,0xfb,0x21,0x19,0x40]}

tool: {"D32": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x40]}

tool: D104: 0.5

tool: D122: 0x%04x

tool: D117: , 

tool: D137: };

assistant: ```c
int main(int argc, char **argv) {
  int i;
  int fft_size;
  int table_size;
  unsigned int out;
  if (argc != 2) {
    printf("Usage: %s <size>\n", argv[0]);
    printf("  <size>: size of (complex) FFT\n");
    printf("\n");
    exit(1);
  }
  if (sscanf(argv[1], "%d", &fft_size) != 1) {
    printf("Error: Invalid size\n");
    exit(1);
  }
  if (fft_size <= 0) {
    printf("Error: Invalid size\n");
    exit(1);
  }
  table_size = (fft_size / 4);
  printf("// Table generated using gen_twiddle.\n");
  printf("// FFT size: %d.\n", fft_size);
  printf("const uint16_t twiddle_factor_lookup[%d] = {\n", table_size);
  for (i = 0; i < table_size; i++) {
    out = (unsigned int)(sin(i * (2.0 * 3.141592653589793238462643 / (double)fft_size)) * (double)0x00010000 + 0.5);
    printf("0x%04x", out);
    if (i != (table_size - 1)) {
      printf(", ");
    }
    if ((i % 8) == (8 - 1)) {
      printf("\n");
    }
  }
  printf("};\n");
}
```