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

```asm
<bdr>:
  endbr64
  push   %r15
  mov    %rsi,%r15
  push   %r14
  mov    %rdx,%r14
  push   %r13
  mov    %rcx,%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x1b8,%rsp
  lea    0x120(%rsp),%rax
  lea    0x160(%rsp),%rbp
  mov    %fs:0x28,%rcx
  mov    %rcx,0x1a8(%rsp)
  xor    %ecx,%ecx
  mov    %rax,0x8(%rsp)
  lea    0x140(%rsp),%rax
  mov    %rax,0x18(%rsp)
  lea    0x180(%rsp),%rax
  mov    %rax,0x10(%rsp)
L10:
  movsd  (%r12,%rbx,1),%xmm0
  mov    0x8(%rsp),%rax
  movsd  %xmm0,(%rbx,%rax,1)
  movsd  (%r15,%rbx,1),%xmm0
  mov    0x18(%rsp),%rax
  movsd  %xmm0,(%rax,%rbx,1)
  movsd  (%r14,%rbx,1),%xmm0
  call   <log@plt>
  movsd  %xmm0,0x0(%rbp,%rbx,1)
  movsd  0x0(%r13,%rbx,1),%xmm0
  call   <log@plt>
  mov    0x10(%rsp),%rax
  movsd  %xmm0,(%rax,%rbx,1)
  add    $0x8,%rbx
  cmp    $0x20,%rbx
  jne    L10
  mov    0x8(%rsp),%rdx
  xor    %r8d,%r8d
  movsd  0x120(%rsp),%xmm0
  lea    0xa0(%rsp),%rdi
  lea    0xc0(%rsp),%rsi
  lea    0xe0(%rsp),%rcx
  movsd  0x138(%rsp),%xmm1
  minsd  0x158(%rsp),%xmm1
  movapd %xmm0,%xmm4
  maxsd  0x140(%rsp),%xmm4
  lea    0x100(%rsp),%r9
  lea    0x90(%rsp),%r10
  movapd %xmm1,%xmm3
  movapd %xmm4,%xmm2
  mulsd  %xmm1,%xmm3
  mulsd  %xmm4,%xmm2
  movapd %xmm3,%xmm7
  mulsd  %xmm1,%xmm3
  subsd  %xmm2,%xmm7
  mulsd  %xmm4,%xmm2
  movsd  %xmm7,0x70(%rsp)
  movapd %xmm3,%xmm6
  subsd  %xmm2,%xmm6
  mulsd  %xmm1,%xmm3
  subsd  %xmm4,%xmm1
  mulsd  %xmm4,%xmm2
  movsd  %xmm6,0x78(%rsp)
  movsd  %xmm1,0x88(%rsp)
  subsd  %xmm2,%xmm3
  movsd  %xmm3,0x80(%rsp)
L46:
  xor    %eax,%eax
L39:
  movapd %xmm0,%xmm1
  movsd  %xmm0,(%rdi,%rax,1)
  mulsd  %xmm0,%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm1,(%rsi,%rax,1)
  movsd  %xmm0,(%rcx,%rax,1)
  add    $0x8,%rax
  cmp    $0x20,%rax
  je     L32
  movsd  (%rdx,%rax,1),%xmm0
  jmp    L39
  nopw   0x0(%rax,%rax,1)
L32:
  movsd  0xd0(%rsp),%xmm3
  mov    %r8,%rax
  add    $0x20,%rdx
  movsd  0xf0(%rsp),%xmm5
  movsd  0xc8(%rsp),%xmm2
  shl    $0x5,%rax
  movsd  0xe8(%rsp),%xmm7
  add    %rbp,%rax
  movapd %xmm3,%xmm14
  movapd %xmm5,%xmm11
  movsd  0xb0(%rsp),%xmm1
  movdqu (%rax),%xmm6
  mulsd  %xmm2,%xmm11
  movsd  0xc0(%rsp),%xmm12
  movsd  0xc0(%rsp),%xmm10
  movsd  0xa0(%rsp),%xmm8
  xorpd  D52(%rip),%xmm8
  movaps %xmm6,(%r9)
  movdqu 0x10(%rax),%xmm4
  movsd  0xf8(%rsp),%xmm6
  mulsd  %xmm5,%xmm10
  movsd  0xc0(%rsp),%xmm9
  movaps %xmm4,0x10(%r9)
  movsd  0xd8(%rsp),%xmm4
  mulsd  %xmm6,%xmm14
  movapd %xmm6,%xmm13
  mulsd  %xmm2,%xmm13
  movapd %xmm4,%xmm0
  mulsd  %xmm5,%xmm0
  mulsd  %xmm6,%xmm12
  mulsd  %xmm7,%xmm9
  movapd %xmm13,%xmm15
  movsd  0xe0(%rsp),%xmm13
  subsd  %xmm0,%xmm14
  movapd %xmm4,%xmm0
  mulsd  %xmm7,%xmm0
  subsd  %xmm0,%xmm15
  movapd %xmm3,%xmm0
  mulsd  %xmm7,%xmm0
  mulsd  %xmm15,%xmm1
  movsd  %xmm15,0x8(%rsp)
  subsd  %xmm0,%xmm11
  movsd  0xa8(%rsp),%xmm0
  mulsd  %xmm14,%xmm0
  subsd  %xmm1,%xmm0
  movsd  0xb8(%rsp),%xmm1
  mulsd  %xmm11,%xmm1
  addsd  %xmm1,%xmm0
  movapd %xmm4,%xmm1
  mulsd  %xmm13,%xmm1
  movsd  %xmm0,0x18(%rsp)
  movsd  0xb0(%rsp),%xmm0
  subsd  %xmm1,%xmm12
  movapd %xmm3,%xmm1
  mulsd  %xmm13,%xmm1
  mulsd  %xmm12,%xmm0
  movsd  %xmm12,0x28(%rsp)
  subsd  %xmm1,%xmm10
  movapd %xmm14,%xmm1
  mulsd  %xmm8,%xmm1
  mulsd  %xmm11,%xmm8
  movsd  %xmm10,0x10(%rsp)
  addsd  %xmm1,%xmm0
  movsd  0xb8(%rsp),%xmm1
  mulsd  %xmm10,%xmm1
  subsd  %xmm1,%xmm0
  movapd %xmm2,%xmm1
  mulsd  %xmm13,%xmm1
  movsd  %xmm0,0x20(%rsp)
  movsd  0xa8(%rsp),%xmm0
  mulsd  %xmm12,%xmm0
  subsd  %xmm1,%xmm9
  movsd  0xa0(%rsp),%xmm1
  mulsd  %xmm15,%xmm1
  movapd %xmm6,%xmm15
  movsd  %xmm9,0x30(%rsp)
  subsd  %xmm0,%xmm1
  movsd  0xb8(%rsp),%xmm0
  mulsd  %xmm9,%xmm0
  addsd  %xmm0,%xmm1
  movsd  0xa8(%rsp),%xmm0
  mulsd  %xmm10,%xmm0
  movapd %xmm1,%xmm12
  addsd  %xmm8,%xmm0
  movsd  0xb0(%rsp),%xmm8
  mulsd  %xmm9,%xmm8
  movapd %xmm0,%xmm1
  subsd  %xmm8,%xmm1
  movsd  0x18(%rsp),%xmm8
  addsd  0x20(%rsp),%xmm8
  movsd  %xmm12,0x60(%rsp)
  movsd  0x118(%rsp),%xmm9
  movsd  0x110(%rsp),%xmm10
  movsd  0x108(%rsp),%xmm0
  addsd  %xmm12,%xmm8
  mulsd  %xmm10,%xmm15
  movapd %xmm5,%xmm12
  mulsd  %xmm9,%xmm12
  addsd  %xmm1,%xmm8
  subsd  %xmm12,%xmm15
  movapd %xmm7,%xmm12
  movsd  %xmm8,0x68(%rsp)
  movsd  0x100(%rsp),%xmm8
  mulsd  %xmm9,%xmm12
  movsd  %xmm15,0x38(%rsp)
  movapd %xmm6,%xmm15
  mulsd  %xmm0,%xmm15
  mulsd  %xmm8,%xmm6
  subsd  %xmm12,%xmm15
  movapd %xmm7,%xmm12
  mulsd  %xmm10,%xmm12
  mulsd  %xmm8,%xmm7
  movsd  %xmm15,0x40(%rsp)
  movapd %xmm5,%xmm15
  mulsd  %xmm0,%xmm15
  mulsd  %xmm8,%xmm5
  subsd  %xmm12,%xmm15
  movsd  %xmm15,0x48(%rsp)
  movapd %xmm6,%xmm15
  movapd %xmm13,%xmm6
  mulsd  %xmm9,%xmm6
  movapd %xmm15,%xmm12
  movapd %xmm5,%xmm15
  movapd %xmm13,%xmm5
  mulsd  %xmm10,%xmm5
  mulsd  %xmm0,%xmm13
  subsd  %xmm6,%xmm12
  movapd %xmm15,%xmm6
  subsd  %xmm5,%xmm6
  movapd %xmm3,%xmm5
  mulsd  %xmm9,%xmm5
  subsd  %xmm13,%xmm7
  movsd  %xmm12,0x50(%rsp)
  movapd %xmm5,%xmm15
  movapd %xmm4,%xmm5
  mulsd  %xmm10,%xmm5
  movapd %xmm15,%xmm13
  subsd  %xmm5,%xmm13
  movapd %xmm2,%xmm5
  mulsd  %xmm9,%xmm5
  movapd %xmm13,%xmm12
  movapd %xmm5,%xmm15
  movapd %xmm4,%xmm5
  mulsd  %xmm0,%xmm5
  movapd %xmm15,%xmm13
  mulsd  %xmm8,%xmm4
  subsd  %xmm5,%xmm13
  movapd %xmm2,%xmm5
  mulsd  %xmm10,%xmm5
  mulsd  %xmm8,%xmm2
  movapd %xmm5,%xmm15
  movapd %xmm3,%xmm5
  mulsd  %xmm0,%xmm5
  mulsd  %xmm8,%xmm3
  subsd  %xmm5,%xmm15
  movsd  0xc0(%rsp),%xmm5
  mulsd  %xmm9,%xmm5
  movsd  %xmm15,0x58(%rsp)
  subsd  %xmm4,%xmm5
  movsd  0xc0(%rsp),%xmm4
  mulsd  %xmm10,%xmm4
  subsd  %xmm3,%xmm4
  movsd  0xc0(%rsp),%xmm3
  mulsd  %xmm0,%xmm3
  subsd  %xmm2,%xmm3
  movapd %xmm14,%xmm2
  mulsd  %xmm0,%xmm2
  mulsd  %xmm8,%xmm14
  movapd %xmm2,%xmm15
  movsd  0x8(%rsp),%xmm2
  mulsd  %xmm10,%xmm2
  subsd  %xmm2,%xmm15
  movapd %xmm11,%xmm2
  mulsd  %xmm9,%xmm2
  mulsd  %xmm8,%xmm11
  addsd  %xmm2,%xmm15
  subsd  %xmm14,%xmm15
  movsd  0x28(%rsp),%xmm14
  movapd %xmm14,%xmm2
  mulsd  %xmm10,%xmm2
  addsd  %xmm2,%xmm15
  movsd  0x10(%rsp),%xmm2
  mulsd  %xmm9,%xmm2
  subsd  %xmm2,%xmm15
  movsd  0x8(%rsp),%xmm2
  mulsd  %xmm8,%xmm2
  mulsd  0x18(%rsp),%xmm8
  addsd  %xmm2,%xmm15
  movapd %xmm14,%xmm2
  movsd  0x30(%rsp),%xmm14
  mulsd  %xmm0,%xmm2
  subsd  %xmm2,%xmm15
  movapd %xmm14,%xmm2
  mulsd  %xmm9,%xmm2
  addsd  %xmm2,%xmm15
  movsd  0x10(%rsp),%xmm2
  mulsd  %xmm0,%xmm2
  subsd  %xmm11,%xmm15
  movsd  0x68(%rsp),%xmm11
  mulsd  0x20(%rsp),%xmm0
  addsd  %xmm2,%xmm15
  movapd %xmm14,%xmm2
  movsd  0x38(%rsp),%xmm14
  mulsd  %xmm10,%xmm2
  addsd  %xmm0,%xmm8
  movapd %xmm9,%xmm0
  movsd  0x40(%rsp),%xmm9
  mulsd  0x60(%rsp),%xmm10
  mulsd  %xmm1,%xmm0
  movsd  0xa8(%rsp),%xmm1
  mulsd  %xmm14,%xmm1
  subsd  %xmm2,%xmm15
  addsd  %xmm10,%xmm8
  divsd  %xmm11,%xmm15
  addsd  %xmm8,%xmm0
  movsd  0x88(%rsp),%xmm8
  divsd  %xmm11,%xmm0
  mulsd  0x70(%rsp),%xmm15
  mulsd  D20(%rip),%xmm15
  movsd  0xb0(%rsp),%xmm2
  movsd  0x48(%rsp),%xmm10
  mulsd  0xa0(%rsp),%xmm14
  mulsd  %xmm9,%xmm2
  mulsd  0xa0(%rsp),%xmm9
  subsd  %xmm2,%xmm1
  movsd  0xb8(%rsp),%xmm2
  mulsd  %xmm10,%xmm2
  mulsd  0xa0(%rsp),%xmm10
  addsd  %xmm2,%xmm1
  movsd  0xb0(%rsp),%xmm2
  subsd  %xmm14,%xmm1
  movsd  0x50(%rsp),%xmm14
  mulsd  %xmm14,%xmm2
  mulsd  0xa8(%rsp),%xmm14
  mulsd  %xmm8,%xmm0
  addsd  %xmm2,%xmm1
  movsd  0xb8(%rsp),%xmm2
  mulsd  %xmm6,%xmm2
  mulsd  0xa8(%rsp),%xmm6
  addsd  %xmm15,%xmm0
  subsd  %xmm2,%xmm1
  movsd  0xb8(%rsp),%xmm2
  mulsd  %xmm7,%xmm2
  mulsd  0xb0(%rsp),%xmm7
  addsd  %xmm9,%xmm1
  subsd  %xmm14,%xmm1
  addsd  %xmm2,%xmm1
  movsd  0xb0(%rsp),%xmm2
  mulsd  %xmm13,%xmm2
  mulsd  0xa0(%rsp),%xmm13
  subsd  %xmm10,%xmm1
  addsd  %xmm6,%xmm1
  subsd  %xmm7,%xmm1
  movsd  0x58(%rsp),%xmm7
  divsd  %xmm11,%xmm1
  mulsd  0x78(%rsp),%xmm1
  divsd  D40(%rip),%xmm1
  addsd  %xmm0,%xmm1
  movsd  0xa8(%rsp),%xmm0
  mulsd  %xmm12,%xmm0
  mulsd  0xa0(%rsp),%xmm12
  subsd  %xmm2,%xmm0
  movsd  0xb8(%rsp),%xmm2
  mulsd  %xmm7,%xmm2
  mulsd  0xa0(%rsp),%xmm7
  addsd  %xmm2,%xmm0
  movsd  0xb0(%rsp),%xmm2
  mulsd  %xmm5,%xmm2
  mulsd  0xa8(%rsp),%xmm5
  subsd  %xmm12,%xmm0
  addsd  %xmm2,%xmm0
  movsd  0xb8(%rsp),%xmm2
  mulsd  %xmm4,%xmm2
  mulsd  0xa8(%rsp),%xmm4
  subsd  %xmm2,%xmm0
  movsd  0xb8(%rsp),%xmm2
  mulsd  %xmm3,%xmm2
  mulsd  0xb0(%rsp),%xmm3
  addsd  %xmm13,%xmm0
  subsd  %xmm5,%xmm0
  addsd  %xmm2,%xmm0
  subsd  %xmm7,%xmm0
  addsd  %xmm4,%xmm0
  subsd  %xmm3,%xmm0
  divsd  %xmm11,%xmm0
  mulsd  0x80(%rsp),%xmm0
  mulsd  D7(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movsd  %xmm1,(%r10,%r8,8)
  cmp    $0x1,%r8
  jne    L7
  movsd  0x98(%rsp),%xmm0
  subsd  0x90(%rsp),%xmm0
  divsd  %xmm8,%xmm0
  call   <exp@plt>
  subsd  D51(%rip),%xmm0
  mulsd  D9(%rip),%xmm0
  mov    0x1a8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L21
  add    $0x1b8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L7:
  movsd  (%rdx),%xmm0
  mov    $0x1,%r8d
  jmp    L46
L21:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D52
datatype: byte[16]
name: disassemble_data
arguments: data_tag: D20
datatype: byte[8]
name: disassemble_data
arguments: data_tag: D40
datatype: byte[8]
name: disassemble_data
arguments: data_tag: D7
datatype: byte[8]
name: disassemble_data
arguments: data_tag: D51
datatype: byte[8]
name: disassemble_data
arguments: data_tag: D9
datatype: byte[8]

tool: {"D52": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

tool: {"D20": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x3f]}

tool: {"D40": [0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x40]}

tool: {"D7": [0x00,0x00,0x00,0x00,0x00,0x00,0xd0,0x3f]}

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

tool: {"D9": [0x00,0x00,0x00,0x00,0x00,0x00,0x59,0x40]}

assistant: ```c
double bdr(const double ref_psnr[4], const double new_psnr[4], const double ref_bitrate[4], const double new_bitrate[4]) {
  double xl, xh;
  double diff;
  double E[4], F[4], G[4], H[4];
  double SUM[2];
  int i, j;
  double DET0, DET1, DET2, DET3, DET;
  double D0, D1, D2, D3;
  double A, B, C, D;
  double X[2][4];
  double Y[2][4];
  for (i = 0; i < 4; i++) {
    X[0][i] = ref_psnr[i];
    X[1][i] = new_psnr[i];
    Y[0][i] = log(ref_bitrate[i]);
    Y[1][i] = log(new_bitrate[i]);
  }
  xl = ((X[0][0]) > (X[1][0]) ? (X[0][0]) : (X[1][0]));
  xh = ((X[0][3]) < (X[1][3]) ? (X[0][3]) : (X[1][3]));
  for (j = 0; j < 2; j++) {
    for (i = 0; i < 4; i++) {
      E[i] = X[j][i];
      F[i] = E[i] * E[i];
      G[i] = E[i] * E[i] * E[i];
      H[i] = Y[j][i];
    }
    DET0 = E[1] * (F[2] * G[3] - F[3] * G[2]) - E[2] * (F[1] * G[3] - F[3] * G[1]) + E[3] * (F[1] * G[2] - F[2] * G[1]);
    DET1 = -E[0] * (F[2] * G[3] - F[3] * G[2]) + E[2] * (F[0] * G[3] - F[3] * G[0]) - E[3] * (F[0] * G[2] - F[2] * G[0]);
    DET2 = E[0] * (F[1] * G[3] - F[3] * G[1]) - E[1] * (F[0] * G[3] - F[3] * G[0]) + E[3] * (F[0] * G[1] - F[1] * G[0]);
    DET3 = -E[0] * (F[1] * G[2] - F[2] * G[1]) + E[1] * (F[0] * G[2] - F[2] * G[0]) - E[2] * (F[0] * G[1] - F[1] * G[0]);
    DET = DET0 + DET1 + DET2 + DET3;
    D0 = H[0] * DET0 + H[1] * DET1 + H[2] * DET2 + H[3] * DET3;
    D1 = H[1] * (F[2] * G[3] - F[3] * G[2]) - H[2] * (F[1] * G[3] - F[3] * G[1]) + H[3] * (F[1] * G[2] - F[2] * G[1]) - H[0] * (F[2] * G[3] - F[3] * G[2]) + H[2] * (F[0] * G[3] - F[3] * G[0]) - H[3] * (F[0] * G[2] - F[2] * G[0]) + H[0] * (F[1] * G[3] - F[3] * G[1]) - H[1] * (F[0] * G[3] - F[3] * G[0]) + H[3] * (F[0] * G[1] - F[1] * G[0]) - H[0] * (F[1] * G[2] - F[2] * G[1]) + H[1] * (F[0] * G[2] - F[2] * G[0]) - H[2] * (F[0] * G[1] - F[1] * G[0]);
    D2 = E[1] * (H[2] * G[3] - H[3] * G[2]) - E[2] * (H[1] * G[3] - H[3] * G[1]) + E[3] * (H[1] * G[2] - H[2] * G[1]) - E[0] * (H[2] * G[3] - H[3] * G[2]) + E[2] * (H[0] * G[3] - H[3] * G[0]) - E[3] * (H[0] * G[2] - H[2] * G[0]) + E[0] * (H[1] * G[3] - H[3] * G[1]) - E[1] * (H[0] * G[3] - H[3] * G[0]) + E[3] * (H[0] * G[1] - H[1] * G[0]) - E[0] * (H[1] * G[2] - H[2] * G[1]) + E[1] * (H[0] * G[2] - H[2] * G[0]) - E[2] * (H[0] * G[1] - H[1] * G[0]);
    D3 = E[1] * (F[2] * H[3] - F[3] * H[2]) - E[2] * (F[1] * H[3] - F[3] * H[1]) + E[3] * (F[1] * H[2] - F[2] * H[1]) - E[0] * (F[2] * H[3] - F[3] * H[2]) + E[2] * (F[0] * H[3] - F[3] * H[0]) - E[3] * (F[0] * H[2] - F[2] * H[0]) + E[0] * (F[1] * H[3] - F[3] * H[1]) - E[1] * (F[0] * H[3] - F[3] * H[0]) + E[3] * (F[0] * H[1] - F[1] * H[0]) - E[0] * (F[1] * H[2] - F[2] * H[1]) + E[1] * (F[0] * H[2] - F[2] * H[0]) - E[2] * (F[0] * H[1] - F[1] * H[0]);
    A = D0 / DET;
    B = D1 / DET;
    C = D2 / DET;
    D = D3 / DET;
    SUM[j] = A * (xh - xl) + B * (xh * xh - xl * xl) / 2 + C * (xh * xh * xh - xl * xl * xl) / 3 + D * (xh * xh * xh * xh - xl * xl * xl * xl) / 4;
  }
  diff = (SUM[1] - SUM[0]) / (xh - xl);
  diff = (exp(diff) - 1) * 100;
  return diff;
}
```