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

```asm
<__gen_ocl_internal_sinpi>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  movss  %xmm0,-0x24(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x24(%rbp),%rax
  mov    (%rax),%eax
  and    $0x7fffffff,%eax
  mov    %eax,-0x10(%rbp)
  cmpl   $0x3e7fffff,-0x10(%rbp)
  jg     L104
  movss  -0x24(%rbp),%xmm1
  movss  D50(%rip),%xmm0
  mulss  %xmm0,%xmm1
  movd   %xmm1,%eax
  movd   %eax,%xmm0
  call   <__gen_ocl_sin@plt>
  jmp    L128
L104:
  movss  -0x24(%rbp),%xmm0
  movss  D127(%rip),%xmm1
  xorps  %xmm1,%xmm0
  movss  %xmm0,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  movd   %eax,%xmm0
  call   <__gen_ocl_rndd@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x1c(%rbp)
  movss  -0x1c(%rbp),%xmm0
  ucomiss -0x18(%rbp),%xmm0
  jp     L145
  ucomiss -0x18(%rbp),%xmm0
  je     L142
L145:
  movss  -0x18(%rbp),%xmm1
  movss  D6(%rip),%xmm0
  mulss  %xmm1,%xmm0
  movss  %xmm0,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  movd   %eax,%xmm0
  call   <__gen_ocl_rndd@plt>
  movaps %xmm0,%xmm1
  movss  -0x18(%rbp),%xmm0
  subss  %xmm1,%xmm0
  addss  %xmm0,%xmm0
  movss  %xmm0,-0x18(%rbp)
  movss  -0x18(%rbp),%xmm1
  movss  D27(%rip),%xmm0
  mulss  %xmm1,%xmm0
  cvttss2si %xmm0,%eax
  mov    %eax,-0x14(%rbp)
  jmp    L188
L142:
  cmpl   $0x4b7fffff,-0x10(%rbp)
  jle    L56
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L188
L56:
  cmpl   $0x4affffff,-0x10(%rbp)
  jg     L34
  movss  -0x18(%rbp),%xmm1
  movss  D130(%rip),%xmm0
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x1c(%rbp)
L34:
  lea    -0x1c(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  andl   $0x1,-0xc(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0xc(%rbp),%xmm0
  movss  %xmm0,-0x18(%rbp)
  shll   $0x2,-0xc(%rbp)
L188:
  cmpl   $0x6,-0x14(%rbp)
  jg     L151
  cmpl   $0x5,-0x14(%rbp)
  jge    L175
  cmpl   $0x4,-0x14(%rbp)
  jg     L151
  cmpl   $0x3,-0x14(%rbp)
  jge    L137
  cmpl   $0x0,-0x14(%rbp)
  je     L24
  cmpl   $0x0,-0x14(%rbp)
  js     L151
  mov    -0x14(%rbp),%eax
  sub    $0x1,%eax
  cmp    $0x1,%eax
  ja     L151
  jmp    L89
L24:
  movss  -0x18(%rbp),%xmm1
  movss  D50(%rip),%xmm0
  mulss  %xmm0,%xmm1
  movd   %xmm1,%eax
  movd   %eax,%xmm0
  call   <__gen_ocl_sin@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x18(%rbp)
  jmp    L116
L89:
  movss  D6(%rip),%xmm0
  movaps %xmm0,%xmm1
  subss  -0x18(%rbp),%xmm1
  movss  D50(%rip),%xmm0
  mulss  %xmm0,%xmm1
  movd   %xmm1,%eax
  movd   %eax,%xmm0
  call   <__gen_ocl_cos@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x18(%rbp)
  jmp    L116
L137:
  movss  D80(%rip),%xmm0
  movaps %xmm0,%xmm1
  subss  -0x18(%rbp),%xmm1
  movss  D50(%rip),%xmm0
  mulss  %xmm0,%xmm1
  movd   %xmm1,%eax
  movd   %eax,%xmm0
  call   <__gen_ocl_sin@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x18(%rbp)
  jmp    L116
L175:
  movss  -0x18(%rbp),%xmm0
  movss  D72(%rip),%xmm2
  movaps %xmm0,%xmm1
  subss  %xmm2,%xmm1
  movss  D50(%rip),%xmm0
  mulss  %xmm0,%xmm1
  movd   %xmm1,%eax
  movd   %eax,%xmm0
  call   <__gen_ocl_cos@plt>
  movd   %xmm0,%eax
  movss  D127(%rip),%xmm0
  movd   %eax,%xmm3
  xorps  %xmm0,%xmm3
  movaps %xmm3,%xmm0
  movss  %xmm0,-0x18(%rbp)
  jmp    L116
L151:
  movss  -0x18(%rbp),%xmm0
  movss  D122(%rip),%xmm2
  movaps %xmm0,%xmm1
  subss  %xmm2,%xmm1
  movss  D50(%rip),%xmm0
  mulss  %xmm0,%xmm1
  movd   %xmm1,%eax
  movd   %eax,%xmm0
  call   <__gen_ocl_sin@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x18(%rbp)
  nop
L116:
  movss  -0x18(%rbp),%xmm0
  movss  D127(%rip),%xmm1
  xorps  %xmm1,%xmm0
L128:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L53
  call   <__stack_chk_fail@plt>
L53:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D50
data_type: byte[4]
name: retrieve_data
arguments: data_tag: D127
data_type: byte[4]
name: retrieve_data
arguments: data_tag: D6
data_type: byte[4]
name: retrieve_data
arguments: data_tag: D27
data_type: byte[4]
name: retrieve_data
arguments: data_tag: D130
data_type: byte[4]
name: retrieve_data
arguments: data_tag: D80
data_type: byte[4]
name: retrieve_data
arguments: data_tag: D72
data_type: byte[4]
name: retrieve_data
arguments: data_tag: D122
data_type: byte[4]

tool: {"D50": [0xdb,0x0f,0x49,0x40]}

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

tool: {"D6": [0x00,0x00,0x00,0x3f]}

tool: {"D27": [0x00,0x00,0x80,0x40]}

tool: {"D130": [0x00,0x00,0x00,0x4b]}

tool: {"D80": [0x00,0x00,0x80,0x3f]}

tool: {"D72": [0x00,0x00,0xc0,0x3f]}

tool: {"D122": [0x00,0x00,0x00,0x40]}

assistant: ```c
__attribute__((overloadable, always_)) float __gen_ocl_internal_sinpi(float x) {
  float y, z;
  int n, ix;
  ix = *(int *)(&x) & 0x7fffffff;
  if (ix < 0x3e800000)
    return __gen_ocl_sin(3.141592653589793F * x);
  y = -x;
  z = __gen_ocl_rndd(y);
  if (z != y) {
    y *= 0.5f;
    y = 2.f * (y - __gen_ocl_rndd(y));
    n = y * 4.f;
  } else {
    if (ix >= 0x4b800000) {
      y = 0;
      n = 0;
    } else {
      if (ix < 0x4b000000)
        z = y + 8.3886080000e+06f;
      int n = *(int *)(&z);
      n &= 1;
      y = n;
      n <<= 2;
    }
  }
  switch (n) {
  case 0:
    y = __gen_ocl_sin(3.141592653589793F * y);
    break;
  case 1:
  case 2:
    y = __gen_ocl_cos(3.141592653589793F * (0.5f - y));
    break;
  case 3:
  case 4:
    y = __gen_ocl_sin(3.141592653589793F * (1.f - y));
    break;
  case 5:
  case 6:
    y = -__gen_ocl_cos(3.141592653589793F * (y - 1.5f));
    break;
  default:
    y = __gen_ocl_sin(3.141592653589793F * (y - 2.f));
    break;
  }
  return -y;
}
```