user: 这段汇编代码用C语言表示是什么样的:

```asm
<gen_wave>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    %ecx,-0x24(%rbp)
  mov    %r8d,-0x28(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L36
L203:
  mov    -0x10(%rbp),%eax
  imul   -0x20(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  D28(%rip),%xmm1
  divsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0xc(%rbp)
  cmpl   $0x3,-0x1c(%rbp)
  je     L41
  cmpl   $0x3,-0x1c(%rbp)
  jg     L72
  cmpl   $0x2,-0x1c(%rbp)
  je     L167
  cmpl   $0x2,-0x1c(%rbp)
  jg     L72
  cmpl   $0x0,-0x1c(%rbp)
  je     L82
  cmpl   $0x1,-0x1c(%rbp)
  je     L65
  jmp    L72
L82:
  movss  -0xc(%rbp),%xmm0
  addss  %xmm0,%xmm0
  cvttss2si %xmm0,%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L71
  movss  -0xc(%rbp),%xmm1
  movss  D61(%rip),%xmm0
  mulss  %xmm1,%xmm0
  jmp    L112
L71:
  movss  -0xc(%rbp),%xmm0
  addss  %xmm0,%xmm0
L112:
  cvtss2sd %xmm0,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  jmp    L72
L65:
  movss  -0xc(%rbp),%xmm0
  addss  %xmm0,%xmm0
  cvttss2si %xmm0,%eax
  and    $0x1,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  jmp    L72
L167:
  pxor   %xmm1,%xmm1
  cvtss2sd -0xc(%rbp),%xmm1
  movsd  D10(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  pxor   %xmm3,%xmm3
  cvtsd2ss %xmm0,%xmm3
  movd   %xmm3,%eax
  movd   %eax,%xmm0
  call   <sin@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  jmp    L72
L41:
  movss  -0xc(%rbp),%xmm0
  movaps %xmm0,%xmm1
  addss  %xmm0,%xmm1
  movss  D12(%rip),%xmm0
  subss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  nop
L72:
  cmpl   $0x3,-0x24(%rbp)
  je     L188
  cmpl   $0x3,-0x24(%rbp)
  jg     L173
  cmpl   $0x1,-0x24(%rbp)
  je     L66
  cmpl   $0x2,-0x24(%rbp)
  je     L99
  jmp    L173
L66:
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x10(%rbp),%xmm0
  movsd  D45(%rip),%xmm2
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  movsd  D66(%rip),%xmm0
  subsd  %xmm1,%xmm0
  movsd  -0x8(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  jmp    L173
L99:
  mov    -0x10(%rbp),%eax
  neg    %eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  D45(%rip),%xmm1
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <sqrt@plt>
  mov    $0x1,%edx
  sub    %eax,%edx
  pxor   %xmm0,%xmm0
  cvtsi2sd %edx,%xmm0
  movsd  -0x8(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  jmp    L173
L188:
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x10(%rbp),%xmm1
  movsd  D45(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <sqrt@plt>
  mov    $0x1,%edx
  sub    %eax,%edx
  pxor   %xmm0,%xmm0
  cvtsi2sd %edx,%xmm0
  movsd  -0x8(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  nop
L173:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  -0x8(%rbp),%xmm2
  movsd  D18(%rip),%xmm0
  mulsd  %xmm2,%xmm0
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x10(%rbp)
L36:
  cmpl   $0x3ff,-0x10(%rbp)
  jle    L203
  nop
  nop
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D28
type_guessed: f64
name: disassemble_data
arguments: tag: D61
type_guessed: byte[4]
name: disassemble_data
arguments: tag: D10
type_guessed: f64
name: disassemble_data
arguments: tag: D12
type_guessed: byte[4]
name: disassemble_data
arguments: tag: D45
type_guessed: byte[8]
name: disassemble_data
arguments: tag: D66
type_guessed: byte[8]
name: disassemble_data
arguments: tag: D18
type_guessed: byte[8]

tool: D28: 8000

tool: {"D61": [0x00,0x00,0x00,0xc0]}

tool: D10: 6.28

tool: {"D12": [0x00,0x00,0x80,0x3f]}

tool: {"D45": [0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x40]}

tool: {"D66": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

tool: {"D18": [0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x40]}

assistant: ```c
void gen_wave(int8_t *arr, uint8_t type, uint16_t freq, uint8_t lfo_type, uint8_t lfo_coef) {
  int i;
  float x;
  double cv;
  for (i = 0; i < 1024; i++) {
    x = i * freq / 8000.0;
    switch (type) {
    case 0:
      cv = (int)(x * 2) % 2 ? -2 * x : 2 * x;
      break;
    case 1:
      cv = (int)(x * 2) % 2 ? 1 : 0;
      break;
    case 2:
      cv = sin(x * 6.28);
      break;
    case 3:
      cv = 1 - 2 * x;
      break;
    }
    switch (lfo_type) {
    case 1:
      cv *= (1 - i / (double)1024);
      break;
    case 2:
      cv *= (1 - sqrt(-i / (double)1024));
      break;
    case 3:
      cv *= (1 - sqrt(i * (double)(1024)));
      break;
    }
    arr[i] += cv * 128;
  }
}
```