user: Please show me the C implementation that matches the assembly code listed below:

```asm
<sin>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  movsd  %xmm0,-0x38(%rbp)
  movsd  -0x38(%rbp),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movl   $0x1,-0x24(%rbp)
  jmp    L34
L3:
  movsd  -0x20(%rbp),%xmm1
  movsd  D48(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
L34:
  movsd  D19(%rip),%xmm0
  comisd -0x20(%rbp),%xmm0
  ja     L3
  jmp    L59
L9:
  movsd  -0x20(%rbp),%xmm0
  movsd  D48(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
L59:
  movsd  -0x20(%rbp),%xmm0
  comisd D61(%rip),%xmm0
  ja     L9
  movsd  -0x20(%rbp),%xmm0
  comisd D5(%rip),%xmm0
  jbe    L6
  movsd  -0x20(%rbp),%xmm0
  movsd  D13(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movl   $0xffffffff,-0x24(%rbp)
L6:
  movsd  -0x20(%rbp),%xmm0
  movsd  D55(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x18(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x10(%rbp),%xmm1
  movsd  D31(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  D52(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x10(%rbp),%xmm1
  movsd  D121(%rip),%xmm0
  addsd  %xmm1,%xmm0
  mulsd  -0x10(%rbp),%xmm0
  movsd  D28(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x10(%rbp),%xmm1
  movsd  D96(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  -0x18(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  jns    L12
  movsd  -0x8(%rbp),%xmm0
  movq   D93(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  jmp    L28
L12:
  movsd  -0x8(%rbp),%xmm0
L28:
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  pop    %rbp
  ret
```

tool_calls: name: parse_data
arguments: tag: D48
type_infered: f64
name: parse_data
arguments: tag: D19
type_infered: byte[8]
name: parse_data
arguments: tag: D61
type_infered: f64[2]
name: parse_data
arguments: tag: D5
type_infered: f64[2]
name: parse_data
arguments: tag: D13
type_infered: f64
name: parse_data
arguments: tag: D55
type_infered: f64
name: parse_data
arguments: tag: D31
type_infered: byte[8]
name: parse_data
arguments: tag: D52
type_infered: byte[8]
name: parse_data
arguments: tag: D121
type_infered: byte[8]
name: parse_data
arguments: tag: D28
type_infered: byte[8]
name: parse_data
arguments: tag: D96
type_infered: f64
name: parse_data
arguments: tag: D93
type_infered: byte[8]

tool: D48: 6.283185307179586

tool: {"D19": [0x18,0x2d,0x44,0x54,0xfb,0x21,0xf9,0xbf]}

tool: {"D61": [4.71238898038469,1.5707963267948966]}

tool: {"D5": [1.5707963267948966,3.141592653589793]}

tool: D13: 3.141592653589793

tool: D55: 1.57079632679

tool: {"D31": [0xaf,0x90,0xa8,0x48,0xf7,0xda,0x23,0x3f]}

tool: {"D52": [0x0e,0x6d,0x5b,0x64,0xcc,0x24,0x73,0x3f]}

tool: {"D121": [0xa5,0x19,0x56,0xf6,0x8a,0x66,0xb4,0x3f]}

tool: {"D28": [0xcd,0xf9,0xac,0x16,0xbc,0xab,0xe4,0x3f]}

tool: D96: 1.57079631847

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

assistant: ```c
double sin(x)
double x;
{
  double xi, y, q, q2;
  int sign;
  xi = x;
  sign = 1;
  while (xi < -1.57079632679489661923)
    xi += 6.28318530717958647692;
  while (xi > 4.71238898038468985769)
    xi -= 6.28318530717958647692;
  if (xi > 1.57079632679489661923) {
    xi -= 3.141592653589793238462643;
    sign = -1;
  }
  q = xi / 1.57079632679;
  q2 = q * q;
  y = ((((.00015148419 * q2 - .00467376557) * q2 + .07968967928) * q2 - .64596371106) * q2 + 1.57079631847) * q;
  return (sign < 0 ? -y : y);
}
```