user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  movl   $0x1f5,0xc(%rsp)
  mov    D104(%rip),%r12
  mov    D112(%rip),%r14
  mov    %r14,%r15
  mov    D77(%rip),%r13
  jmp    L115
L142:
  movq   %rbx,%xmm2
  addsd  D146(%rip),%xmm2
  movq   %xmm2,%rbx
  sub    $0x1,%ebp
  je     L152
L205:
  movq   %rbx,%xmm1
  movq   %r12,%xmm0
  call   <calcError@plt>
  movq   %r13,%xmm3
  comisd %xmm0,%xmm3
  jbe    L142
  mov    %rbx,%r14
  mov    %r12,%r15
  movq   %xmm0,%r13
  jmp    L142
L152:
  movq   %r12,%xmm4
  addsd  D146(%rip),%xmm4
  movq   %xmm4,%r12
  subl   $0x1,0xc(%rsp)
  je     L153
L115:
  mov    $0x1f5,%ebp
  mov    D104(%rip),%rbx
  jmp    L205
L153:
  movq   %r15,%xmm0
  lea    D34(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movq   %r14,%xmm0
  lea    D114(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movq   %r13,%xmm0
  lea    D67(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  lea    D132(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%ebx
  lea    D73(%rip),%r12
  jmp    L13
L189:
  mov    $0x20,%edi
  call   <putchar@plt>
  mov    %ebp,%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmp    $0x3f,%ebx
  je     L168
  mov    $0x2c,%edi
  call   <putchar@plt>
  jmp    L141
L145:
  mov    $0x2c,%edi
  call   <putchar@plt>
  cmp    $0x7,%r13d
  je     L168
L141:
  add    $0x1,%ebx
  cmp    $0x40,%ebx
  je     L41
L13:
  mov    %ebx,%edi
  call   <calcTEDSound@plt>
  mov    %eax,%edi
  movq   %r14,%xmm1
  movq   %r15,%xmm0
  call   <calcDistortion@plt>
  mov    %eax,%ebp
  mov    %ebx,%r13d
  and    $0x7,%r13d
  je     L189
  mov    %eax,%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmp    $0x3f,%ebx
  jne    L145
L168:
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L141
L41:
  lea    D92(%rip),%rdi
  call   <puts@plt>
  lea    D119(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%ebx
  lea    D73(%rip),%r12
  jmp    L125
L75:
  mov    $0x20,%edi
  call   <putchar@plt>
  mov    %ebp,%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmp    $0x12c,%ebx
  je     L65
  mov    $0x2c,%edi
  call   <putchar@plt>
  jmp    L194
L65:
  mov    $0xa,%edi
  call   <putchar@plt>
L194:
  add    $0x1,%ebx
  cmp    $0x12d,%ebx
  je     L154
L125:
  movq   %r14,%xmm1
  movq   %r15,%xmm0
  mov    %ebx,%edi
  call   <calcDistortion@plt>
  mov    %eax,%ebp
  mov    %ebx,%r13d
  and    $0x7,%r13d
  je     L75
  mov    %eax,%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmp    $0x12c,%ebx
  je     L65
  mov    $0x2c,%edi
  call   <putchar@plt>
  cmp    $0x7,%r13d
  jne    L194
  jmp    L65
L154:
  lea    D92(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: parse_data
arguments: tag: D104
type_infered: f64
name: parse_data
arguments: tag: D112
type_infered: f64
name: parse_data
arguments: tag: D77
type_infered: f64
name: parse_data
arguments: tag: D146
type_infered: f64
name: parse_data
arguments: tag: D34
type_infered: string
name: parse_data
arguments: tag: D114
type_infered: string
name: parse_data
arguments: tag: D67
type_infered: string
name: parse_data
arguments: tag: D132
type_infered: string
name: parse_data
arguments: tag: D73
type_infered: string
name: parse_data
arguments: tag: D92
type_infered: string
name: parse_data
arguments: tag: D119
type_infered: string

tool: D104: 1

tool: D112: 0

tool: D77: 1000000000000

tool: D146: 0.001

tool: D34: gamma0 = %f


tool: D114: gamma1 = %f


tool: D67: err = %f


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

tool: D73: %6d

tool: D92: };

tool: D119: 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;
}
```