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

```asm
<r4>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x38,%rsp
  movss  %xmm0,-0x24(%rbp)
  movss  %xmm1,-0x28(%rbp)
  movss  %xmm2,-0x2c(%rbp)
  movss  -0x24(%rbp),%xmm0
  mulss  -0x28(%rbp),%xmm0
  movss  %xmm0,-0x38(%rbp)
  movss  -0x24(%rbp),%xmm0
  subss  -0x2c(%rbp),%xmm0
  movaps %xmm0,%xmm6
  divss  -0x28(%rbp),%xmm6
  movd   %xmm6,%eax
  movd   %eax,%xmm0
  call   <sqrt@plt>
  pxor   %xmm4,%xmm4
  cvtsi2sd %eax,%xmm4
  movq   %xmm4,%rax
  movq   %rax,%xmm0
  call   <acos@plt>
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  mulss  -0x38(%rbp),%xmm0
  pxor   %xmm4,%xmm4
  cvtss2sd %xmm0,%xmm4
  movsd  %xmm4,-0x38(%rbp)
  movss  -0x24(%rbp),%xmm0
  movaps %xmm0,%xmm1
  subss  -0x2c(%rbp),%xmm1
  movss  -0x28(%rbp),%xmm0
  subss  -0x24(%rbp),%xmm0
  addss  -0x2c(%rbp),%xmm0
  mulss  %xmm0,%xmm1
  movd   %xmm1,%eax
  movd   %eax,%xmm0
  call   <sqrt@plt>
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  movss  -0x24(%rbp),%xmm0
  addss  %xmm0,%xmm0
  movaps %xmm0,%xmm2
  addss  -0x28(%rbp),%xmm2
  movss  -0x2c(%rbp),%xmm0
  addss  %xmm0,%xmm0
  addss  %xmm2,%xmm0
  mulss  %xmm1,%xmm0
  movss  D114(%rip),%xmm1
  xorps  %xmm1,%xmm0
  movss  %xmm0,-0x30(%rbp)
  mov    -0x28(%rbp),%eax
  mov    $0x2,%edi
  movd   %eax,%xmm0
  call   <pow@plt>
  mov    %eax,%ebx
  movss  -0x24(%rbp),%xmm0
  movaps %xmm0,%xmm7
  subss  -0x2c(%rbp),%xmm7
  movaps %xmm7,%xmm1
  movss  -0x28(%rbp),%xmm0
  movaps %xmm0,%xmm5
  divss  %xmm1,%xmm5
  movd   %xmm5,%eax
  movd   %eax,%xmm0
  call   <sqrt@plt>
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  D40(%rip),%xmm0
  movapd %xmm0,%xmm6
  divsd  %xmm1,%xmm6
  movq   %xmm6,%rax
  movq   %rax,%xmm0
  call   <acos@plt>
  imul   %ebx,%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  movss  -0x30(%rbp),%xmm1
  subss  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtss2sd %xmm1,%xmm0
  movsd  D5(%rip),%xmm1
  divsd  %xmm1,%xmm0
  addsd  -0x38(%rbp),%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x18(%rbp)
  movss  -0x24(%rbp),%xmm1
  movss  D107(%rip),%xmm0
  mulss  %xmm0,%xmm1
  movss  %xmm1,-0x38(%rbp)
  movss  -0x24(%rbp),%xmm0
  subss  -0x2c(%rbp),%xmm0
  movaps %xmm0,%xmm1
  movss  -0x28(%rbp),%xmm0
  subss  -0x24(%rbp),%xmm0
  addss  -0x2c(%rbp),%xmm0
  movaps %xmm1,%xmm7
  mulss  %xmm0,%xmm7
  movd   %xmm7,%eax
  movd   %eax,%xmm0
  call   <sqrt@plt>
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  mulss  -0x38(%rbp),%xmm0
  movss  %xmm0,-0x38(%rbp)
  movss  -0x24(%rbp),%xmm0
  movaps %xmm0,%xmm1
  subss  -0x2c(%rbp),%xmm1
  movss  -0x28(%rbp),%xmm0
  subss  -0x24(%rbp),%xmm0
  addss  -0x2c(%rbp),%xmm0
  mulss  %xmm0,%xmm1
  movd   %xmm1,%eax
  movd   %eax,%xmm0
  call   <sqrt@plt>
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  mulss  -0x28(%rbp),%xmm0
  movss  -0x38(%rbp),%xmm3
  subss  %xmm0,%xmm3
  movss  %xmm3,-0x38(%rbp)
  movss  -0x2c(%rbp),%xmm1
  movss  D37(%rip),%xmm0
  mulss  %xmm0,%xmm1
  movss  %xmm1,-0x30(%rbp)
  movss  -0x24(%rbp),%xmm0
  subss  -0x2c(%rbp),%xmm0
  movaps %xmm0,%xmm1
  movss  -0x28(%rbp),%xmm0
  subss  -0x24(%rbp),%xmm0
  addss  -0x2c(%rbp),%xmm0
  movaps %xmm1,%xmm4
  mulss  %xmm0,%xmm4
  movd   %xmm4,%eax
  movd   %eax,%xmm0
  call   <sqrt@plt>
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  mulss  -0x30(%rbp),%xmm0
  addss  -0x38(%rbp),%xmm0
  movss  %xmm0,-0x38(%rbp)
  movss  -0x24(%rbp),%xmm0
  movaps %xmm0,%xmm5
  addss  %xmm0,%xmm5
  movss  %xmm5,-0x30(%rbp)
  movss  -0x2c(%rbp),%xmm0
  movaps %xmm0,%xmm2
  addss  %xmm0,%xmm2
  movss  -0x24(%rbp),%xmm0
  movaps %xmm0,%xmm1
  subss  %xmm2,%xmm1
  movss  -0x28(%rbp),%xmm0
  movaps %xmm0,%xmm2
  subss  -0x24(%rbp),%xmm2
  movss  -0x2c(%rbp),%xmm0
  addss  %xmm0,%xmm0
  addss  %xmm2,%xmm0
  mulss  %xmm0,%xmm1
  movd   %xmm1,%eax
  movd   %eax,%xmm0
  call   <sqrt@plt>
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  mulss  -0x30(%rbp),%xmm0
  movaps %xmm0,%xmm6
  addss  -0x38(%rbp),%xmm6
  movss  %xmm6,-0x38(%rbp)
  movss  -0x2c(%rbp),%xmm0
  movaps %xmm0,%xmm2
  addss  %xmm0,%xmm2
  movss  -0x24(%rbp),%xmm0
  movaps %xmm0,%xmm1
  subss  %xmm2,%xmm1
  movss  -0x28(%rbp),%xmm0
  movaps %xmm0,%xmm2
  subss  -0x24(%rbp),%xmm2
  movss  -0x2c(%rbp),%xmm0
  addss  %xmm0,%xmm0
  addss  %xmm2,%xmm0
  mulss  %xmm0,%xmm1
  movd   %xmm1,%eax
  movd   %eax,%xmm0
  call   <sqrt@plt>
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  mulss  -0x28(%rbp),%xmm0
  addss  -0x38(%rbp),%xmm0
  movss  %xmm0,-0x38(%rbp)
  movss  -0x2c(%rbp),%xmm1
  movss  D62(%rip),%xmm0
  mulss  %xmm0,%xmm1
  movss  %xmm1,-0x30(%rbp)
  movss  -0x2c(%rbp),%xmm0
  movaps %xmm0,%xmm2
  addss  %xmm0,%xmm2
  movss  -0x24(%rbp),%xmm0
  movaps %xmm0,%xmm7
  subss  %xmm2,%xmm7
  movaps %xmm7,%xmm1
  movss  -0x28(%rbp),%xmm0
  movaps %xmm0,%xmm2
  subss  -0x24(%rbp),%xmm2
  movss  -0x2c(%rbp),%xmm0
  addss  %xmm0,%xmm0
  addss  %xmm2,%xmm0
  movaps %xmm1,%xmm3
  mulss  %xmm0,%xmm3
  movd   %xmm3,%eax
  movd   %eax,%xmm0
  call   <sqrt@plt>
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  movss  -0x30(%rbp),%xmm1
  mulss  %xmm0,%xmm1
  movss  -0x38(%rbp),%xmm0
  subss  %xmm1,%xmm0
  addss  %xmm0,%xmm0
  movss  %xmm0,-0x38(%rbp)
  movss  -0x24(%rbp),%xmm1
  movss  D135(%rip),%xmm0
  mulss  %xmm1,%xmm0
  movaps %xmm0,%xmm1
  addss  -0x28(%rbp),%xmm1
  movss  -0x2c(%rbp),%xmm2
  movss  D28(%rip),%xmm0
  mulss  %xmm2,%xmm0
  addss  %xmm1,%xmm0
  movaps %xmm0,%xmm7
  mulss  -0x28(%rbp),%xmm7
  movss  %xmm7,-0x30(%rbp)
  movss  -0x24(%rbp),%xmm1
  movss  D107(%rip),%xmm0
  mulss  %xmm1,%xmm0
  movaps %xmm0,%xmm1
  addss  -0x28(%rbp),%xmm1
  movss  -0x2c(%rbp),%xmm0
  addss  %xmm0,%xmm0
  addss  %xmm1,%xmm0
  pxor   %xmm3,%xmm3
  cvtss2sd %xmm0,%xmm3
  movsd  %xmm3,-0x40(%rbp)
  movss  -0x24(%rbp),%xmm0
  movaps %xmm0,%xmm5
  subss  -0x2c(%rbp),%xmm5
  movaps %xmm5,%xmm1
  movss  -0x28(%rbp),%xmm0
  subss  -0x24(%rbp),%xmm0
  addss  -0x2c(%rbp),%xmm0
  movaps %xmm1,%xmm6
  mulss  %xmm0,%xmm6
  movd   %xmm6,%eax
  movd   %eax,%xmm0
  call   <sqrt@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  addsd  %xmm0,%xmm0
  movsd  -0x40(%rbp),%xmm1
  divsd  %xmm0,%xmm1
  cvttsd2si %xmm1,%eax
  mov    %eax,%edi
  call   <atan@plt>
  mulss  -0x30(%rbp),%xmm0
  movss  -0x38(%rbp),%xmm4
  subss  %xmm0,%xmm4
  movss  %xmm4,-0x38(%rbp)
  movss  -0x24(%rbp),%xmm1
  movss  D135(%rip),%xmm0
  mulss  %xmm1,%xmm0
  movaps %xmm0,%xmm1
  addss  -0x28(%rbp),%xmm1
  movss  -0x2c(%rbp),%xmm2
  movss  D28(%rip),%xmm0
  mulss  %xmm2,%xmm0
  addss  %xmm1,%xmm0
  mulss  -0x28(%rbp),%xmm0
  movss  %xmm0,-0x30(%rbp)
  movss  -0x24(%rbp),%xmm1
  movss  D107(%rip),%xmm0
  mulss  %xmm1,%xmm0
  movaps %xmm0,%xmm1
  addss  -0x28(%rbp),%xmm1
  movss  -0x2c(%rbp),%xmm2
  movss  D62(%rip),%xmm0
  mulss  %xmm2,%xmm0
  addss  %xmm1,%xmm0
  pxor   %xmm5,%xmm5
  cvtss2sd %xmm0,%xmm5
  movsd  %xmm5,-0x40(%rbp)
  movss  -0x2c(%rbp),%xmm0
  movaps %xmm0,%xmm2
  addss  %xmm0,%xmm2
  movss  -0x24(%rbp),%xmm0
  movaps %xmm0,%xmm6
  subss  %xmm2,%xmm6
  movaps %xmm6,%xmm1
  movss  -0x28(%rbp),%xmm0
  movaps %xmm0,%xmm2
  subss  -0x24(%rbp),%xmm2
  movss  -0x2c(%rbp),%xmm0
  addss  %xmm0,%xmm0
  addss  %xmm2,%xmm0
  movaps %xmm1,%xmm7
  mulss  %xmm0,%xmm7
  movd   %xmm7,%eax
  movd   %eax,%xmm0
  call   <sqrt@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  addsd  %xmm0,%xmm0
  movsd  -0x40(%rbp),%xmm1
  divsd  %xmm0,%xmm1
  cvttsd2si %xmm1,%eax
  mov    %eax,%edi
  call   <atan@plt>
  mulss  -0x30(%rbp),%xmm0
  addss  -0x38(%rbp),%xmm0
  cvtss2sd %xmm0,%xmm0
  movsd  D41(%rip),%xmm1
  divsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x14(%rbp)
  movss  -0x18(%rbp),%xmm0
  addss  -0x14(%rbp),%xmm0
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: read_data
arguments: data_tag: D114
type: byte[4]
name: read_data
arguments: data_tag: D40
type: f64
name: read_data
arguments: data_tag: D5
type: f64
name: read_data
arguments: data_tag: D107
type: byte[4]
name: read_data
arguments: data_tag: D37
type: byte[4]
name: read_data
arguments: data_tag: D62
type: byte[4]
name: read_data
arguments: data_tag: D135
type: byte[4]
name: read_data
arguments: data_tag: D28
type: f32
name: read_data
arguments: data_tag: D41
type: byte[8]

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

tool: D40: 1

tool: D5: 4

tool: {"D107": [0x00,0x00,0x00,0xc0]}

tool: {"D37": [0x00,0x00,0xc0,0x40]}

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

tool: {"D135": [0x00,0x00,0x80,0xc0]}

tool: D28: 8

tool: {"D41": [0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x40]}

assistant: ```c
float r4(float t, float Tr, float Ts) {
  float p1;
  float p2;
  p1 = t * Tr * acos(sqrt((t - Ts) / Tr)) + (-(sqrt((t - Ts) * (-t + Tr + Ts)) * (2 * t + Tr + 2 * Ts)) - pow(Tr, 2) * acos(1.0 / sqrt(Tr / (t - Ts)))) / 4.;
  p2 = (2 * (-2 * t * sqrt((t - Ts) * (-t + Tr + Ts)) - Tr * sqrt((t - Ts) * (-t + Tr + Ts)) + 6 * Ts * sqrt((t - Ts) * (-t + Tr + Ts)) + 2 * t * sqrt((t - 2 * Ts) * (-t + Tr + 2 * Ts)) + Tr * sqrt((t - 2 * Ts) * (-t + Tr + 2 * Ts)) - 4 * Ts * sqrt((t - 2 * Ts) * (-t + Tr + 2 * Ts))) - Tr * (-4 * t + Tr + 8 * Ts) * atan((-2 * t + Tr + 2 * Ts) / (2. * sqrt((t - Ts) * (-t + Tr + Ts)))) + Tr * (-4 * t + Tr + 8 * Ts) * atan((-2 * t + Tr + 4 * Ts) / (2. * sqrt((t - 2 * Ts) * (-t + Tr + 2 * Ts))))) / 8.;
  return p1 + p2;
}
```