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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %edi,-0x44(%rbp)
  mov    %rsi,-0x50(%rbp)
  movsd  D79(%rip),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  D154(%rip),%xmm0
  movsd  %xmm0,-0x18(%rbp)
L5:
  movsd  D154(%rip),%xmm0
  movsd  %xmm0,-0x10(%rbp)
L115:
  movsd  -0x10(%rbp),%xmm0
  mov    -0x18(%rbp),%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <calcError@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  movsd  -0x30(%rbp),%xmm0
  comisd -0x8(%rbp),%xmm0
  jbe    L27
  movsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
L27:
  movsd  -0x10(%rbp),%xmm1
  movsd  D134(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  D64(%rip),%xmm0
  comisd -0x10(%rbp),%xmm0
  ja     L115
  movsd  -0x18(%rbp),%xmm1
  movsd  D134(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  D64(%rip),%xmm0
  comisd -0x18(%rbp),%xmm0
  ja     L5
  mov    -0x28(%rbp),%rax
  movq   %rax,%xmm0
  lea    D158(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    -0x20(%rbp),%rax
  movq   %rax,%xmm0
  lea    D62(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    -0x30(%rbp),%rax
  movq   %rax,%xmm0
  lea    D34(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  lea    D31(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x0,-0x3c(%rbp)
  jmp    L110
L118:
  mov    -0x3c(%rbp),%eax
  mov    %eax,%edi
  call   <calcTEDSound@plt>
  mov    %eax,%edx
  movsd  -0x20(%rbp),%xmm0
  mov    -0x28(%rbp),%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  mov    %edx,%edi
  call   <calcDistortion@plt>
  mov    %eax,-0x34(%rbp)
  mov    -0x3c(%rbp),%eax
  and    $0x7,%eax
  test   %eax,%eax
  jne    L119
  mov    $0x20,%edi
  call   <putchar@plt>
L119:
  mov    -0x34(%rbp),%eax
  mov    %eax,%esi
  lea    D51(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmpl   $0x3f,-0x3c(%rbp)
  je     L41
  mov    $0x2c,%edi
  call   <putchar@plt>
L41:
  mov    -0x3c(%rbp),%eax
  and    $0x7,%eax
  cmp    $0x7,%eax
  jne    L60
  mov    $0xa,%edi
  call   <putchar@plt>
L60:
  addl   $0x1,-0x3c(%rbp)
L110:
  cmpl   $0x3f,-0x3c(%rbp)
  jle    L118
  lea    D156(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D115(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x0,-0x3c(%rbp)
  jmp    L78
L104:
  movsd  -0x20(%rbp),%xmm0
  mov    -0x28(%rbp),%rdx
  mov    -0x3c(%rbp),%eax
  movapd %xmm0,%xmm1
  movq   %rdx,%xmm0
  mov    %eax,%edi
  call   <calcDistortion@plt>
  mov    %eax,-0x38(%rbp)
  mov    -0x3c(%rbp),%eax
  and    $0x7,%eax
  test   %eax,%eax
  jne    L10
  mov    $0x20,%edi
  call   <putchar@plt>
L10:
  mov    -0x38(%rbp),%eax
  mov    %eax,%esi
  lea    D51(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmpl   $0x12c,-0x3c(%rbp)
  je     L59
  mov    $0x2c,%edi
  call   <putchar@plt>
L59:
  mov    -0x3c(%rbp),%eax
  and    $0x7,%eax
  cmp    $0x7,%eax
  je     L99
  cmpl   $0x12c,-0x3c(%rbp)
  jne    L56
L99:
  mov    $0xa,%edi
  call   <putchar@plt>
L56:
  addl   $0x1,-0x3c(%rbp)
L78:
  cmpl   $0x12c,-0x3c(%rbp)
  jle    L104
  lea    D156(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D79
datatype: f64
name: extract_symbolic_data
arguments: label: D154
datatype: f64
name: extract_symbolic_data
arguments: label: D134
datatype: f64
name: extract_symbolic_data
arguments: label: D64
datatype: f64
name: extract_symbolic_data
arguments: label: D158
datatype: string
name: extract_symbolic_data
arguments: label: D62
datatype: string
name: extract_symbolic_data
arguments: label: D34
datatype: string
name: extract_symbolic_data
arguments: label: D31
datatype: string
name: extract_symbolic_data
arguments: label: D51
datatype: string
name: extract_symbolic_data
arguments: label: D156
datatype: string
name: extract_symbolic_data
arguments: label: D115
datatype: string

tool: D79: 1000000000000

tool: D154: 1

tool: D134: 0.001

tool: D64: 1.5

tool: D158: gamma0 = %f


tool: D62: gamma1 = %f


tool: D34: err = %f


tool: D31: static const int16_t soundVolumeTable[64] = {

tool: D51: %6d

tool: D156: };

tool: D115: static const int16_t tedSoundDistortionTable[301] = {

assistant: ```c
int main(int argc, char **argv) {
  double bestError = 1000000000000.0;
  double bestGamma0 = 0.0;
  double bestGamma1 = 0.0;
  double gamma0 = 1.0;
  int i;
  do {
    double gamma1 = 1.0;
    do {
      double err = calcError(gamma0, gamma1);
      if (err < bestError) {
        bestGamma0 = gamma0;
        bestGamma1 = gamma1;
        bestError = err;
      }
      gamma1 = gamma1 + 0.001;
    } while (gamma1 < 1.5);
    gamma0 = gamma0 + 0.001;
  } while (gamma0 < 1.5);
  printf("gamma0 = %f\n", bestGamma0);
  printf("gamma1 = %f\n", bestGamma1);
  printf("err = %f\n", bestError);
  printf("static const int16_t soundVolumeTable[64] = {\n");
  for (i = 0; i < 64; i++) {
    int tmp2 = calcDistortion(calcTEDSound(i), bestGamma0, bestGamma1);
    if (!(i & 7))
      printf(" ");
    printf("%6d", tmp2);
    if (i != 63)
      printf(",");
    if ((i & 7) == 7)
      printf("\n");
  }
  printf("};\n");
  printf("static const int16_t tedSoundDistortionTable[301] = {\n");
  for (i = 0; i <= 300; i++) {
    int tmp2 = calcDistortion(i, bestGamma0, bestGamma1);
    if (!(i & 7))
      printf(" ");
    printf("%6d", tmp2);
    if (i != 300)
      printf(",");
    if ((i & 7) == 7 || i == 300)
      printf("\n");
  }
  printf("};\n");
  return 0;
}
```