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

```asm
<__gen_ocl_internal_sinpi>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  movd   %xmm0,%ebx
  mov    $0x7fffffff,%r12d
  and    %ebx,%r12d
  cmp    $0x3e7fffff,%r12d
  jle    L2
  movaps %xmm0,%xmm2
  xorps  D140(%rip),%xmm2
  movss  %xmm2,0xc(%rsp)
  movaps %xmm2,%xmm0
  call   <__gen_ocl_rndd@plt>
  movss  0xc(%rsp),%xmm2
  ucomiss %xmm2,%xmm0
  jp     L15
  jne    L15
  cmp    $0x4b7fffff,%r12d
  jg     L79
  cmp    $0x4affffff,%r12d
  jg     L138
  movss  D120(%rip),%xmm0
  movd   %ebx,%xmm4
  subss  %xmm4,%xmm0
L138:
  movd   %xmm0,%eax
  and    $0x1,%eax
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
L107:
  cmp    $0x4,%ebp
  jg     L142
  cmp    $0x2,%ebp
  jg     L154
  test   %ebp,%ebp
  je     L99
  sub    $0x1,%ebp
  cmp    $0x1,%ebp
  ja     L100
  movss  D103(%rip),%xmm0
  subss  %xmm1,%xmm0
  mulss  D34(%rip),%xmm0
  call   <__gen_ocl_cos@plt>
L70:
  xorps  D140(%rip),%xmm0
L33:
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L2:
  mulss  D34(%rip),%xmm0
  call   <__gen_ocl_sin@plt>
  jmp    L33
L15:
  movss  0xc(%rsp),%xmm3
  mulss  D103(%rip),%xmm3
  movd   %xmm3,%ebx
  movaps %xmm3,%xmm0
  call   <__gen_ocl_rndd@plt>
  movd   %ebx,%xmm1
  subss  %xmm0,%xmm1
  addss  %xmm1,%xmm1
  movaps %xmm1,%xmm0
  mulss  D48(%rip),%xmm0
  cvttss2si %xmm0,%ebp
  jmp    L107
L142:
  sub    $0x5,%ebp
  cmp    $0x1,%ebp
  ja     L100
  subss  D1(%rip),%xmm1
  mulss  D34(%rip),%xmm1
  movaps %xmm1,%xmm0
  call   <__gen_ocl_cos@plt>
  xorps  D140(%rip),%xmm0
  jmp    L70
L79:
  pxor   %xmm1,%xmm1
L99:
  mulss  D34(%rip),%xmm1
  movaps %xmm1,%xmm0
  call   <__gen_ocl_sin@plt>
  jmp    L70
L154:
  movss  D131(%rip),%xmm0
  subss  %xmm1,%xmm0
  mulss  D34(%rip),%xmm0
  call   <__gen_ocl_sin@plt>
  jmp    L70
L100:
  subss  D0(%rip),%xmm1
  mulss  D34(%rip),%xmm1
  movaps %xmm1,%xmm0
  call   <__gen_ocl_sin@plt>
  jmp    L70
```

tool_calls: name: retrieve_data
arguments: data_tag: D140
type_infered: byte[16]
name: retrieve_data
arguments: data_tag: D120
type_infered: byte[4]
name: retrieve_data
arguments: data_tag: D103
type_infered: byte[4]
name: retrieve_data
arguments: data_tag: D34
type_infered: byte[4]
name: retrieve_data
arguments: data_tag: D48
type_infered: byte[4]
name: retrieve_data
arguments: data_tag: D1
type_infered: byte[4]
name: retrieve_data
arguments: data_tag: D131
type_infered: byte[4]
name: retrieve_data
arguments: data_tag: D0
type_infered: byte[4]

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

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

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

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

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

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

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

tool: {"D0": [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;
}
```