user: What would the C source look like for the assembly code provided here?

```asm
<dd_cos>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x108,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0xf8(%rsp)
  xor    %eax,%eax
  call   <dd_is_zero@plt>
  cmp    $0x1,%eax
  jne    L261
  mov    D15(%rip),%rax
  mov    %rax,(%rbx)
  movq   $0x0,0x8(%rbx)
L172:
  mov    0xf8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L157
  add    $0x108,%rsp
  pop    %rbx
  pop    %rbp
  ret
L261:
  lea    0x4(%rsp),%rcx
  mov    %rsp,%rdx
  lea    0x10(%rsp),%rsi
  lea    0xc(%rsp),%r9
  lea    0x8(%rsp),%r8
  mov    %rbp,%rdi
  call   <dd_reduce_modulo_2pi@plt>
  cmpl   $0x1,0xc(%rsp)
  je     L267
  cmpl   $0x0,0x4(%rsp)
  jne    L132
  mov    (%rsp),%eax
  test   %eax,%eax
  je     L102
  cmp    $0x1,%eax
  je     L197
  cmp    $0xffffffff,%eax
  je     L206
  lea    0x10(%rsp),%rdi
  mov    %rbx,%rsi
  call   <dd_cos_taylor@plt>
  mov    %rbx,%rdi
  call   <dd_minus@plt>
  jmp    L172
L267:
  mov    D4(%rip),%rax
  mov    %rax,(%rbx)
  movq   $0x0,0x8(%rbx)
  jmp    L172
L102:
  lea    0x10(%rsp),%rdi
  mov    %rbx,%rsi
  call   <dd_cos_taylor@plt>
  jmp    L172
L197:
  lea    0x10(%rsp),%rdi
  mov    %rbx,%rsi
  call   <dd_sin_taylor@plt>
  mov    %rbx,%rdi
  call   <dd_minus@plt>
  jmp    L172
L206:
  lea    0x10(%rsp),%rdi
  mov    %rbx,%rsi
  call   <dd_sin_taylor@plt>
  jmp    L172
L132:
  lea    0xd0(%rsp),%rcx
  lea    0xb0(%rsp),%rdx
  lea    0x90(%rsp),%rsi
  lea    0x70(%rsp),%rdi
  call   <sincostables@plt>
  mov    0x8(%rsp),%eax
  sub    $0x1,%eax
  cltq
  movsd  0xb0(%rsp,%rax,8),%xmm0
  movsd  %xmm0,0x20(%rsp)
  movsd  0xd0(%rsp,%rax,8),%xmm0
  movsd  %xmm0,0x28(%rsp)
  movsd  0x70(%rsp,%rax,8),%xmm0
  movsd  %xmm0,0x30(%rsp)
  movsd  0x90(%rsp,%rax,8),%xmm0
  movsd  %xmm0,0x38(%rsp)
  lea    0x60(%rsp),%rdx
  lea    0x50(%rsp),%rsi
  lea    0x10(%rsp),%rdi
  call   <dd_sincos_taylor@plt>
  mov    (%rsp),%eax
  test   %eax,%eax
  je     L175
  cmp    $0x1,%eax
  je     L146
  cmp    $0xffffffff,%eax
  je     L74
  lea    0x50(%rsp),%rsi
  lea    0x30(%rsp),%rdi
  mov    %rbx,%rdx
  call   <dd_mul@plt>
  lea    0x40(%rsp),%rdx
  lea    0x60(%rsp),%rsi
  lea    0x20(%rsp),%rdi
  call   <dd_mul@plt>
  cmpl   $0x0,0x4(%rsp)
  jle    L20
  lea    0x40(%rsp),%rsi
  mov    %rbx,%rdi
  call   <dd_dec@plt>
  jmp    L172
L175:
  lea    0x60(%rsp),%rsi
  lea    0x20(%rsp),%rdi
  mov    %rbx,%rdx
  call   <dd_mul@plt>
  lea    0x40(%rsp),%rdx
  lea    0x50(%rsp),%rsi
  lea    0x30(%rsp),%rdi
  call   <dd_mul@plt>
  cmpl   $0x0,0x4(%rsp)
  jle    L60
  lea    0x40(%rsp),%rsi
  mov    %rbx,%rdi
  call   <dd_dec@plt>
  jmp    L172
L60:
  lea    0x40(%rsp),%rsi
  mov    %rbx,%rdi
  call   <dd_inc@plt>
  jmp    L172
L146:
  lea    0x60(%rsp),%rsi
  lea    0x30(%rsp),%rdi
  mov    %rbx,%rdx
  call   <dd_mul@plt>
  lea    0x40(%rsp),%rdx
  lea    0x50(%rsp),%rsi
  lea    0x20(%rsp),%rdi
  call   <dd_mul@plt>
  cmpl   $0x0,0x4(%rsp)
  jle    L54
  mov    %rbx,%rdi
  call   <dd_minus@plt>
  lea    0x40(%rsp),%rsi
  mov    %rbx,%rdi
  call   <dd_dec@plt>
  jmp    L172
L54:
  lea    0x40(%rsp),%rsi
  mov    %rbx,%rdi
  call   <dd_dec@plt>
  jmp    L172
L74:
  lea    0x50(%rsp),%rsi
  lea    0x20(%rsp),%rdi
  mov    %rbx,%rdx
  call   <dd_mul@plt>
  lea    0x40(%rsp),%rdx
  lea    0x60(%rsp),%rsi
  lea    0x30(%rsp),%rdi
  call   <dd_mul@plt>
  cmpl   $0x0,0x4(%rsp)
  jle    L209
  lea    0x40(%rsp),%rsi
  mov    %rbx,%rdi
  call   <dd_inc@plt>
  jmp    L172
L209:
  lea    0x40(%rsp),%rsi
  mov    %rbx,%rdi
  call   <dd_dec@plt>
  jmp    L172
L20:
  mov    %rbx,%rdi
  call   <dd_minus@plt>
  lea    0x40(%rsp),%rsi
  mov    %rbx,%rdi
  call   <dd_dec@plt>
  jmp    L172
L157:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D15
type_guessed: f64
name: disassemble_data
arguments: data_tag: D4
type_guessed: f32[2]

tool: D15: 1

tool: {"D4": [0.0,-2.0]}

assistant: ```c
void dd_cos(const double *a, double *cos_a) {
  if (dd_is_zero(a) == 1) {
    cos_a[0] = 1.0;
    cos_a[1] = 0.0;
  } else {
    double t[2];
    int j, k, abs_k, fail;
    dd_reduce_modulo_2pi(a, t, &j, &k, &abs_k, &fail);
    if (fail == 1) {
      cos_a[0] = -2.0;
      cos_a[1] = 0.0;
    } else if (k == 0) {
      if (j == 0) {
        dd_cos_taylor(t, cos_a);
      } else if (j == 1) {
        dd_sin_taylor(t, cos_a);
        dd_minus(cos_a);
      } else if (j == -1) {
        dd_sin_taylor(t, cos_a);
      } else {
        dd_cos_taylor(t, cos_a);
        dd_minus(cos_a);
      }
    } else {
      double u[2], v[2], w[2], t_sin[2], t_cos[2];
      double sintabhi[4], sintablo[4];
      double costabhi[4], costablo[4];
      sincostables(sintabhi, sintablo, costabhi, costablo);
      u[0] = costabhi[abs_k - 1];
      u[1] = costablo[abs_k - 1];
      v[0] = sintabhi[abs_k - 1];
      v[1] = sintablo[abs_k - 1];
      dd_sincos_taylor(t, t_sin, t_cos);
      if (j == 0) {
        dd_mul(u, t_cos, cos_a);
        dd_mul(v, t_sin, w);
        if (k > 0)
          dd_dec(cos_a, w);
        else
          dd_inc(cos_a, w);
      } else if (j == 1) {
        dd_mul(v, t_cos, cos_a);
        dd_mul(u, t_sin, w);
        if (k > 0) {
          dd_minus(cos_a);
          dd_dec(cos_a, w);
        } else {
          dd_dec(cos_a, w);
        }
      } else if (j == -1) {
        dd_mul(u, t_sin, cos_a);
        dd_mul(v, t_cos, w);
        if (k > 0)
          dd_inc(cos_a, w);
        else
          dd_dec(cos_a, w);
      } else {
        dd_mul(v, t_sin, cos_a);
        dd_mul(u, t_cos, w);
        if (k > 0) {
          dd_dec(cos_a, w);
        } else {
          dd_minus(cos_a);
          dd_dec(cos_a, w);
        }
      }
    }
  }
}
```