user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<main>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %rsi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  cmp    $0x2,%edi
  jne    L112
L35:
  lea    0x4(%rsp),%rdx
  mov    0x8(%rbx),%rdi
  lea    D12(%rip),%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  jne    L64
L29:
  cmpl   $0x0,0x4(%rsp)
  jle    L47
L13:
  mov    0x4(%rsp),%ebx
  lea    0x3(%rbx),%ebp
  test   %ebx,%ebx
  cmovns %ebx,%ebp
  sar    $0x2,%ebp
  lea    D32(%rip),%rdi
  call   <puts@plt>
  mov    0x4(%rsp),%esi
  lea    D124(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %ebp,%esi
  lea    D33(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmp    $0x3,%ebx
  jle    L31
  mov    $0x0,%ebx
  lea    D3(%rip),%r12
  jmp    L100
L112:
  mov    (%rsi),%rsi
  lea    D76(%rip),%rdi
  call   <printf@plt>
  lea    D64(%rip),%rdi
  call   <puts@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L35
L64:
  lea    D43(%rip),%rdi
  call   <puts@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L29
L47:
  lea    D43(%rip),%rdi
  call   <puts@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L13
L27:
  mov    %ebx,%edx
  sar    $0x1f,%edx
  shr    $0x1d,%edx
  lea    (%rbx,%rdx,1),%eax
  and    $0x7,%eax
  sub    %edx,%eax
  cmp    $0x7,%eax
  je     L138
L66:
  add    $0x1,%ebx
  cmp    %ebx,%ebp
  jle    L31
L100:
  pxor   %xmm1,%xmm1
  cvtsi2sdl 0x4(%rsp),%xmm1
  movsd  D74(%rip),%xmm0
  divsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebx,%xmm1
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%edi
  call   <sin@plt>
  mulsd  D105(%rip),%xmm0
  addsd  D104(%rip),%xmm0
  cvttsd2si %xmm0,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0x1(%rbp),%eax
  cmp    %ebx,%eax
  je     L27
  lea    D4(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L27
L138:
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L66
L31:
  lea    D58(%rip),%rdi
  call   <puts@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L55
  mov    $0x0,%eax
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L55:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D12
type: string
name: disassemble_data
arguments: data_label: D32
type: string
name: disassemble_data
arguments: data_label: D124
type: string
name: disassemble_data
arguments: data_label: D33
type: string
name: disassemble_data
arguments: data_label: D3
type: string
name: disassemble_data
arguments: data_label: D76
type: string
name: disassemble_data
arguments: data_label: D64
type: string
name: disassemble_data
arguments: data_label: D43
type: string
name: disassemble_data
arguments: data_label: D74
type: byte[8]
name: disassemble_data
arguments: data_label: D105
type: byte[8]
name: disassemble_data
arguments: data_label: D104
type: f64
name: disassemble_data
arguments: data_label: D4
type: string
name: disassemble_data
arguments: data_label: D58
type: string

tool: D12: %d

tool: D32: // Table generated using gen_twiddle.

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


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


tool: D3: 0x%04x

tool: D76: Usage: %s <size>


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

tool: D43: Error: Invalid size

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

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

tool: D104: 0.5

tool: D4: , 

tool: D58: };

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");
}
```