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

```asm
<make_tx_filter>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x60000(%rsp),%r11
L29:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L29
  sub    $0x38,%rsp
  mov    %edi,%r15d
  mov    %edi,0x18(%rsp)
  mov    %esi,%r13d
  movapd %xmm1,%xmm0
  movapd %xmm2,%xmm1
  mov    %edx,%r12d
  mov    %rcx,%r14
  mov    %fs:0x28,%rax
  mov    %rax,0x60028(%rsp)
  xor    %eax,%eax
  mov    %edi,%ebp
  imul   %esi,%ebp
  lea    0x1(%rbp),%ebx
  pxor   %xmm3,%xmm3
  cvtsi2sd %edi,%xmm3
  mulsd  %xmm0,%xmm3
  addsd  %xmm3,%xmm3
  divsd  %xmm3,%xmm0
  lea    0x20(%rsp),%rdi
  mov    $0x0,%ecx
  mov    $0x1,%edx
  mov    %ebx,%esi
  call   <compute_raised_cosine_filter@plt>
  mov    %r15d,%eax
  shr    $0x1f,%eax
  add    %r15d,%eax
  sar    %eax
  cmp    %eax,%ebx
  jle    L89
  movslq %r15d,%rcx
  cltq
  pxor   %xmm1,%xmm1
  lea    0x20(%rsp),%rdx
L4:
  addsd  (%rdx,%rax,8),%xmm1
  add    %rcx,%rax
  cmp    %eax,%ebx
  jg     L4
L309:
  test   %ebx,%ebx
  jle    L243
  lea    0x20(%rsp),%rax
  mov    %ebp,%edx
  lea    0x28(%rsp,%rdx,8),%rdx
L145:
  movsd  (%rax),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L145
  test   %r12d,%r12d
  jne    L285
L265:
  movsd  D243(%rip),%xmm0
  mov    %r14,%rsi
  lea    D232(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    0x18(%rsp),%edx
  mov    %r14,%rsi
  lea    D269(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D204(%rip),%rsi
L165:
  mov    %r13d,%r8d
  mov    %r14,%rcx
  mov    %r14,%rdx
  lea    D59(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D134(%rip),%rdi
  call   <puts@plt>
  mov    0x18(%rsp),%ecx
  test   %ecx,%ecx
  jle    L41
  mov    %ecx,%eax
  mov    %rax,0x10(%rsp)
  sub    $0x1,%r13d
  movslq %ecx,%rax
  shl    $0x3,%rax
  mov    %rax,(%rsp)
  test   %r13d,%r13d
  mov    $0x1,%eax
  cmovg  %r13d,%eax
  imul   %ecx,%eax
  mov    %eax,0x1c(%rsp)
  mov    $0x0,%r15d
  jmp    L152
L89:
  pxor   %xmm1,%xmm1
  jmp    L309
L243:
  test   %r12d,%r12d
  je     L265
  movsd  D91(%rip),%xmm2
  movsd  D243(%rip),%xmm3
  jmp    L122
L285:
  mov    $0x0,%eax
  movsd  D264(%rip),%xmm1
  movq   D259(%rip),%xmm2
L84:
  movsd  0x20(%rsp,%rax,8),%xmm0
  andpd  %xmm2,%xmm0
  maxsd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
  add    $0x1,%rax
  lea    -0x1(%rax),%edx
  cmp    %edx,%ebp
  jg     L84
  comisd D243(%rip),%xmm0
  jb     L54
  movsd  D91(%rip),%xmm2
  divsd  %xmm0,%xmm2
  movsd  D243(%rip),%xmm3
  divsd  %xmm0,%xmm3
L122:
  test   %ebx,%ebx
  jle    L91
  lea    0x20(%rsp),%rax
  mov    %ebp,%ebp
  lea    0x28(%rsp,%rbp,8),%rdx
L23:
  movapd %xmm2,%xmm0
  mulsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L23
L91:
  movapd %xmm3,%xmm0
  mov    %r14,%rsi
  lea    D232(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    0x18(%rsp),%edx
  mov    %r14,%rsi
  lea    D269(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D129(%rip),%rsi
  jmp    L165
L54:
  movsd  D91(%rip),%xmm2
  movsd  D243(%rip),%xmm3
  jmp    L122
L187:
  movsd  0x20(%rsp,%r15,8),%xmm0
  mov    0xc(%rsp),%esi
  lea    D95(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  cmp    $0x1,%r13d
  jg     L215
  mov    0xc(%rsp),%eax
  add    0x1c(%rsp),%eax
L98:
  cltq
  movsd  0x20(%rsp,%rax,8),%xmm0
  lea    D217(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  jmp    L231
L182:
  movsd  0x0(%rbp),%xmm0
  lea    D100(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
L226:
  add    $0x1,%ebx
  add    (%rsp),%rbp
  cmp    %r13d,%ebx
  je     L214
L42:
  test   %r12d,%r12d
  je     L182
  cvttsd2si 0x0(%rbp),%esi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L226
L214:
  mov    0xc(%rsp),%eax
  add    0x1c(%rsp),%eax
  test   %r12d,%r12d
  je     L98
L56:
  cltq
  cvttsd2si 0x20(%rsp,%rax,8),%esi
  lea    D248(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L231:
  mov    0x18(%rsp),%eax
  sub    $0x1,%eax
  cmp    %r15d,%eax
  jle    L133
  lea    D177(%rip),%rdi
  call   <puts@plt>
L18:
  add    $0x1,%r15
  cmp    0x10(%rsp),%r15
  je     L41
L152:
  mov    %r15d,%ebx
  mov    %r15d,0xc(%rsp)
  lea    D80(%rip),%rdi
  call   <puts@plt>
  test   %r12d,%r12d
  je     L187
  cvttsd2si 0x20(%rsp,%r15,8),%esi
  mov    %r15d,%edx
  lea    D96(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmp    $0x1,%r13d
  jle    L185
L215:
  add    0x18(%rsp),%ebx
  movslq %ebx,%rbx
  lea    0x20(%rsp,%rbx,8),%rbp
  mov    $0x1,%ebx
  lea    D87(%rip),%r14
  jmp    L42
L133:
  lea    D212(%rip),%rdi
  call   <puts@plt>
  jmp    L18
L41:
  lea    D110(%rip),%rdi
  call   <puts@plt>
  mov    0x60028(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  add    $0x60038,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L185:
  mov    0xc(%rsp),%eax
  add    0x1c(%rsp),%eax
  jmp    L56
L0:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D243
datatype: f64[2]
name: retrieve_data
arguments: data_tag: D232
datatype: string
name: retrieve_data
arguments: data_tag: D269
datatype: string
name: retrieve_data
arguments: data_tag: D204
datatype: string
name: retrieve_data
arguments: data_tag: D59
datatype: string
name: retrieve_data
arguments: data_tag: D134
datatype: string
name: retrieve_data
arguments: data_tag: D91
datatype: f64
name: retrieve_data
arguments: data_tag: D264
datatype: f32[2]
name: retrieve_data
arguments: data_tag: D259
datatype: qword
name: retrieve_data
arguments: data_tag: D129
datatype: string
name: retrieve_data
arguments: data_tag: D95
datatype: string
name: retrieve_data
arguments: data_tag: D217
datatype: string
name: retrieve_data
arguments: data_tag: D100
datatype: string
name: retrieve_data
arguments: data_tag: D248
datatype: string
name: retrieve_data
arguments: data_tag: D177
datatype: string
name: retrieve_data
arguments: data_tag: D80
datatype: string
name: retrieve_data
arguments: data_tag: D96
datatype: string
name: retrieve_data
arguments: data_tag: D87
datatype: string
name: retrieve_data
arguments: data_tag: D212
datatype: string
name: retrieve_data
arguments: data_tag: D110
datatype: string

tool: {"D243": [1.0,0.0]}

tool: D232: #define TX_PULSESHAPER%s_GAIN        %ff


tool: D269: #define TX_PULSESHAPER%s_COEFF_SETS  %d


tool: D204: float

tool: D59: static const %s tx_pulseshaper%s[TX_PULSESHAPER%s_COEFF_SETS][%d] =


tool: D134: {

tool: D91: 32767

tool: {"D264": [0.0,-1.875]}

tool: D259: 9223372036854775807

tool: D129: int16_t

tool: D95:         %15.10ff,     /* Filter %d */


tool: D217:         %15.10ff


tool: D100:         %15.10ff,


tool: D248:         %8d


tool: D177:     },

tool: D80:     {

tool: D96:         %8d,     /* Filter %d */


tool: D87:         %8d,


tool: D212:     }

tool: D110: };

assistant: ```c
void make_tx_filter(int coeff_sets, int coeffs_per_filter, double carrier, double baud_rate, double excess_bandwidth, int fixed_point, const char *tag) {
  int i;
  int j;
  int x;
  int total_coeffs;
  double alpha;
  double beta;
  double gain;
  double scaling;
  double peak;
  double coeffs[384 * 128 + 1];
  total_coeffs = coeff_sets * coeffs_per_filter + 1;
  alpha = baud_rate / (2.0 * (double)(coeff_sets * baud_rate));
  beta = excess_bandwidth;
  compute_raised_cosine_filter(coeffs, total_coeffs, (!0), 0, alpha, beta);
  gain = 0.0;
  for (i = coeff_sets / 2; i < total_coeffs; i += coeff_sets)
    gain += coeffs[i];
  for (i = 0; i < total_coeffs; i++)
    coeffs[i] /= gain;
  gain = 1.0;
  if (fixed_point) {
    peak = -1.0;
    for (i = 0; i < total_coeffs; i++) {
      if (fabs(coeffs[i]) > peak)
        peak = fabs(coeffs[i]);
    }
    scaling = 32767.0;
    if (peak >= 1.0) {
      scaling /= peak;
      gain = 1.0 / peak;
    }
    for (i = 0; i < total_coeffs; i++)
      coeffs[i] *= scaling;
  }
  printf("#define TX_PULSESHAPER%s_GAIN        %ff\n", tag, gain);
  printf("#define TX_PULSESHAPER%s_COEFF_SETS  %d\n", tag, coeff_sets);
  printf("static const %s tx_pulseshaper%s[TX_PULSESHAPER%s_COEFF_SETS][%d] =\n", (fixed_point) ? "int16_t" : "float", tag, tag, coeffs_per_filter);
  printf("{\n");
  for (j = 0; j < coeff_sets; j++) {
    x = j;
    printf("    {\n");
    if (fixed_point)
      printf("        %8d,     /* Filter %d */\n", (int)coeffs[x], j);
    else
      printf("        %15.10ff,     /* Filter %d */\n", coeffs[x], j);
    for (i = 1; i < coeffs_per_filter - 1; i++) {
      x = i * coeff_sets + j;
      if (fixed_point)
        printf("        %8d,\n", (int)coeffs[x]);
      else
        printf("        %15.10ff,\n", coeffs[x]);
    }
    x = i * coeff_sets + j;
    if (fixed_point)
      printf("        %8d\n", (int)coeffs[x]);
    else
      printf("        %15.10ff\n", coeffs[x]);
    if (j < coeff_sets - 1)
      printf("    },\n");
    else
      printf("    }\n");
  }
  printf("};\n");
}
```