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

```asm
<find_optimal_freq>:
  endbr64
  push   %r15
  push   %r14
  mov    %edx,%r14d
  push   %r13
  push   %r12
  push   %rbp
  mov    %r8d,%ebp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x368,%rsp
  mov    %esi,0x1c(%rsp)
  mov    %r9,0x10(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x358(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x18(%rsp)
  test   %esi,%esi
  jne    L17
  test   %r8d,%r8d
  jle    L17
  movslq %r8d,%rax
  mov    %edi,%r13d
  xor    %r15d,%r15d
  mov    $0x186a0,%r12d
  mov    %rax,0x8(%rsp)
  jmp    L364
  nopl   0x0(%rax)
L269:
  add    $0x1,%r15
  cmp    0x8(%rsp),%r15
  je     L17
L364:
  mov    %r13d,%edi
  sub    (%rbx,%r15,4),%edi
  call   <fabs@plt>
  cmp    %r12d,%eax
  jge    L269
  mov    %r13d,%edi
  sub    (%rbx,%r15,4),%edi
  call   <fabs@plt>
  mov    %r15d,0x18(%rsp)
  add    $0x1,%r15
  mov    %eax,%r12d
  cmp    0x8(%rsp),%r15
  jne    L364
L17:
  pxor   %xmm0,%xmm0
  lea    0x50(%rsp),%r13
  mov    %ebp,%ecx
  mov    %rbx,%rdx
  movaps %xmm0,0x50(%rsp)
  mov    %r13,%r8
  lea    0x20(%rsp),%r12
  movaps %xmm0,0x60(%rsp)
  movaps %xmm0,0x70(%rsp)
  movaps %xmm0,0x80(%rsp)
  movaps %xmm0,0x90(%rsp)
  movaps %xmm0,0xa0(%rsp)
  movaps %xmm0,0xb0(%rsp)
  movaps %xmm0,0xc0(%rsp)
  movaps %xmm0,0xd0(%rsp)
  movaps %xmm0,0xe0(%rsp)
  movaps %xmm0,0xf0(%rsp)
  movaps %xmm0,0x100(%rsp)
  movaps %xmm0,0x110(%rsp)
  movaps %xmm0,0x120(%rsp)
  movaps %xmm0,0x130(%rsp)
  movaps %xmm0,0x140(%rsp)
  movaps %xmm0,0x150(%rsp)
  movaps %xmm0,0x160(%rsp)
  movaps %xmm0,0x170(%rsp)
  movaps %xmm0,0x180(%rsp)
  movaps %xmm0,0x190(%rsp)
  movaps %xmm0,0x1a0(%rsp)
  movaps %xmm0,0x1b0(%rsp)
  movaps %xmm0,0x1c0(%rsp)
  movaps %xmm0,0x1d0(%rsp)
  movaps %xmm0,0x1e0(%rsp)
  movaps %xmm0,0x1f0(%rsp)
  movaps %xmm0,0x200(%rsp)
  movaps %xmm0,0x210(%rsp)
  movaps %xmm0,0x220(%rsp)
  movaps %xmm0,0x230(%rsp)
  movaps %xmm0,0x240(%rsp)
  movaps %xmm0,0x250(%rsp)
  mov    0x3a0(%rsp),%esi
  mov    0x10(%rsp),%rdi
  movaps %xmm0,0x260(%rsp)
  movaps %xmm0,0x270(%rsp)
  movaps %xmm0,0x280(%rsp)
  movaps %xmm0,0x290(%rsp)
  movaps %xmm0,0x2a0(%rsp)
  movaps %xmm0,0x2b0(%rsp)
  movaps %xmm0,0x2c0(%rsp)
  movaps %xmm0,0x2d0(%rsp)
  movaps %xmm0,0x2e0(%rsp)
  movaps %xmm0,0x2f0(%rsp)
  movaps %xmm0,0x300(%rsp)
  movaps %xmm0,0x310(%rsp)
  movaps %xmm0,0x320(%rsp)
  movaps %xmm0,0x330(%rsp)
  movaps %xmm0,0x340(%rsp)
  call   <compute_scatter_percentage@plt>
  mov    %r14d,%ecx
  mov    %r12,%rdx
  mov    %ebp,%esi
  mov    %r13,%rdi
  call   <average_scatter_percentages@plt>
  test   %ebp,%ebp
  jle    L188
  movss  0x20(%rsp),%xmm0
  comiss D107(%rip),%xmm0
  jb     L46
L8:
  cmp    $0x1,%ebp
  je     L303
  movss  0x24(%rsp),%xmm1
  xor    %edx,%edx
  comiss %xmm0,%xmm1
  jae    L152
L271:
  cmp    $0x2,%ebp
  je     L344
  movss  0x28(%rsp),%xmm1
  comiss %xmm0,%xmm1
  jae    L256
L0:
  cmp    $0x3,%ebp
  je     L344
  movss  0x2c(%rsp),%xmm1
  comiss %xmm0,%xmm1
  jae    L365
L180:
  cmp    $0x4,%ebp
  je     L344
  movss  0x30(%rsp),%xmm1
  comiss %xmm0,%xmm1
  jb     L382
  movaps %xmm1,%xmm0
  mov    $0x4,%edx
L382:
  cmp    $0x5,%ebp
  je     L344
  movss  0x34(%rsp),%xmm1
  comiss %xmm0,%xmm1
  jb     L289
  movaps %xmm1,%xmm0
  mov    $0x5,%edx
L289:
  cmp    $0x6,%ebp
  je     L344
  movss  0x38(%rsp),%xmm1
  comiss %xmm0,%xmm1
  jb     L97
  movaps %xmm1,%xmm0
  mov    $0x6,%edx
L97:
  cmp    $0x7,%ebp
  je     L344
  movss  0x3c(%rsp),%xmm1
  comiss %xmm0,%xmm1
  jae    L300
L88:
  cmp    $0x8,%ebp
  je     L344
  movss  0x40(%rsp),%xmm1
  comiss %xmm0,%xmm1
  jae    L455
L294:
  cmp    $0x9,%ebp
  je     L344
  movss  0x44(%rsp),%xmm1
  comiss %xmm0,%xmm1
  jae    L184
L134:
  cmp    $0xa,%ebp
  je     L344
  movss  0x48(%rsp),%xmm1
  comiss %xmm0,%xmm1
  jae    L413
L72:
  cmp    $0xb,%ebp
  je     L344
  movss  0x4c(%rsp),%xmm1
  comiss %xmm0,%xmm1
  jae    L66
L344:
  pxor   %xmm3,%xmm3
  cvtss2sd %xmm0,%xmm3
L126:
  movslq 0x18(%rsp),%rax
  pxor   %xmm1,%xmm1
  movss  0x20(%rsp,%rax,4),%xmm2
  cvtss2sd %xmm2,%xmm1
  mulsd  D53(%rip),%xmm1
  comisd %xmm3,%xmm1
  ja     L349
  subss  %xmm2,%xmm0
  movss  D31(%rip),%xmm1
  ucomiss %xmm0,%xmm1
  cmovbe %rdx,%rax
L349:
  mov    (%rbx,%rax,4),%eax
  lea    D32(%rip),%rsi
  lea    D86(%rip),%rdi
  mov    %eax,0x18(%rsp)
  call   <fopen@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L142
  test   %ebp,%ebp
  jle    L24
  movslq %ebp,%rax
  xor    %r15d,%r15d
  lea    D69(%rip),%rbp
  mov    %rax,0x8(%rsp)
  test   %r14d,%r14d
  je     L70
  nopl   0x0(%rax,%rax,1)
L212:
  pxor   %xmm1,%xmm1
  movss  (%r12,%r15,4),%xmm0
  mov    %r15d,%edx
  mov    %rbp,%rsi
  cvtsi2ss %r15d,%xmm1
  mov    (%rbx,%r15,4),%ecx
  mov    %r13,%rdi
  mov    $0x1,%eax
  add    $0x1,%r15
  divss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  call   <fprintf@plt>
  cmp    0x8(%rsp),%r15
  jne    L212
L24:
  mov    0x1c(%rsp),%edx
  lea    D21(%rip),%rsi
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  mov    %r14d,%edx
  mov    %r13,%rdi
  xor    %eax,%eax
  lea    D57(%rip),%rsi
  call   <fprintf@plt>
  mov    0x18(%rsp),%edx
  mov    %r13,%rdi
  xor    %eax,%eax
  lea    D27(%rip),%rsi
  call   <fprintf@plt>
  mov    $0xa,%edi
  mov    %r13,%rsi
  call   <fputc@plt>
  mov    %r13,%rdi
  call   <fclose@plt>
L142:
  mov    0x358(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L198
  mov    0x18(%rsp),%eax
  add    $0x368,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L70:
  mov    (%rbx,%r15,4),%ecx
  mov    %r15d,%edx
  pxor   %xmm0,%xmm0
  mov    %rbp,%rsi
  mov    %r13,%rdi
  mov    $0x1,%eax
  cvtss2sd (%r12,%r15,4),%xmm0
  add    $0x1,%r15
  call   <fprintf@plt>
  cmp    0x8(%rsp),%r15
  jne    L70
  jmp    L24
L46:
  movss  D107(%rip),%xmm0
  jmp    L8
L152:
  movaps %xmm1,%xmm0
  mov    $0x1,%edx
  jmp    L271
L256:
  movaps %xmm1,%xmm0
  mov    $0x2,%edx
  jmp    L0
L365:
  movaps %xmm1,%xmm0
  mov    $0x3,%edx
  jmp    L180
L300:
  movaps %xmm1,%xmm0
  mov    $0x7,%edx
  jmp    L88
L455:
  movaps %xmm1,%xmm0
  mov    $0x8,%edx
  jmp    L294
L184:
  movaps %xmm1,%xmm0
  mov    $0x9,%edx
  jmp    L134
L413:
  movaps %xmm1,%xmm0
  mov    $0xa,%edx
  jmp    L72
L66:
  movaps %xmm1,%xmm0
  mov    $0xb,%edx
  jmp    L344
L303:
  xor    %edx,%edx
  jmp    L344
L188:
  movsd  D66(%rip),%xmm3
  movss  D107(%rip),%xmm0
  xor    %edx,%edx
  jmp    L126
L198:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D107
data_type: byte[4]
name: disassemble_data
arguments: data_label: D53
data_type: f64
name: disassemble_data
arguments: data_label: D31
data_type: f32
name: disassemble_data
arguments: data_label: D32
data_type: string
name: disassemble_data
arguments: data_label: D86
data_type: string
name: disassemble_data
arguments: data_label: D69
data_type: string
name: disassemble_data
arguments: data_label: D21
data_type: string
name: disassemble_data
arguments: data_label: D57
data_type: string
name: disassemble_data
arguments: data_label: D27
data_type: string
name: disassemble_data
arguments: data_label: D66
data_type: byte[8]

tool: {"D107": [0x00,0x00,0x20,0xc1]}

tool: D53: 1.15

tool: D31: 0.75

tool: D32: w

tool: D86: /tmp/freq_search.out

tool: D69: 
%2d %d %10.7lf

tool: D21: 
Cutlass: %d

tool: D57: 
Freq Weighting: %d

tool: D27: 
Returned Frequency: %d kHz

tool: {"D66": [0x00,0x00,0x00,0x00,0x00,0x00,0x24,0xc0]}

assistant: ```c
int find_optimal_freq(int start_freq, int cutlass, int fw, int sounder_freqs[], int sft, struct sounder_struct *sounder_data, int act_snd_rec) {
  int i, j;
  int def_freq, def_freq_bin = 0;
  float iscat_percent[12][16];
  float average_iscat_percent[12];
  float max_scatter = -10;
  int max_freq_bin = 0;
  int dlf;
  FILE *out;
  if (!cutlass) {
    dlf = 100000;
    for (i = 0; i < sft; i++) {
      if (fabs(start_freq - sounder_freqs[i]) < dlf) {
        dlf = fabs(start_freq - sounder_freqs[i]);
        def_freq_bin = i;
      }
    }
  }
  for (i = 0; i < 12; i++)
    for (j = 0; j < 16; j++) {
      iscat_percent[i][j] = 0;
    }
  compute_scatter_percentage(sounder_data, act_snd_rec, sounder_freqs, sft, iscat_percent);
  average_scatter_percentages(iscat_percent, sft, average_iscat_percent, fw);
  max_scatter = -10;
  for (i = 0; i < sft; i++)
    if (average_iscat_percent[i] >= max_scatter) {
      max_scatter = average_iscat_percent[i];
      max_freq_bin = i;
    }
  if (max_scatter < 1.15 * average_iscat_percent[def_freq_bin] || (max_scatter - average_iscat_percent[def_freq_bin]) < 0.75)
    max_freq_bin = def_freq_bin;
  def_freq = sounder_freqs[max_freq_bin];
  out = fopen("/tmp/freq_search.out", "w");
  if (out != NULL) {
    for (i = 0; i < sft; i++) {
      if (!fw)
        fprintf(out, "\n%2d %d %10.7lf", i, sounder_freqs[i], average_iscat_percent[i]);
      else
        fprintf(out, "\n%2d %d %10.7lf", i, sounder_freqs[i], average_iscat_percent[i] / i);
    }
    fprintf(out, "\nCutlass: %d", cutlass);
    fprintf(out, "\nFreq Weighting: %d", fw);
    fprintf(out, "\nReturned Frequency: %d kHz", def_freq);
    fprintf(out, "\n");
    fclose(out);
  }
  return (def_freq);
}
```