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

```asm
<reflect>:
  endbr64
  push   %rbx
  movapd %xmm2,%xmm4
  movapd %xmm1,%xmm3
  subsd  %xmm1,%xmm4
  sub    $0x30,%rsp
  movsd  D29(%rip),%xmm1
  comisd %xmm4,%xmm1
  ja     L86
L52:
  comisd %xmm0,%xmm3
  jbe    L31
  movapd %xmm3,%xmm5
  xor    %ebx,%ebx
  subsd  %xmm0,%xmm5
L44:
  ucomisd D49(%rip),%xmm5
  jp     L5
  jne    L5
L28:
  add    $0x30,%rsp
  pop    %rbx
  ret
  nopl   0x0(%rax)
L31:
  comisd %xmm2,%xmm0
  jbe    L28
  movapd %xmm0,%xmm5
  mov    $0x1,%ebx
  subsd  %xmm2,%xmm5
  jmp    L44
  nopl   (%rax)
L5:
  movapd %xmm5,%xmm6
  movsd  D25(%rip),%xmm1
  movsd  D60(%rip),%xmm7
  divsd  %xmm4,%xmm6
  movapd %xmm6,%xmm0
  andpd  %xmm1,%xmm0
  ucomisd %xmm0,%xmm7
  ja     L58
L46:
  movsd  D62(%rip),%xmm1
  movapd %xmm6,%xmm0
  movsd  %xmm3,0x20(%rsp)
  movsd  %xmm5,0x18(%rsp)
  movsd  %xmm4,0x10(%rsp)
  movsd  %xmm6,0x8(%rsp)
  movsd  %xmm2,0x28(%rsp)
  call   <fmod@plt>
  movsd  0x8(%rsp),%xmm6
  mov    $0x1,%eax
  movsd  0x10(%rsp),%xmm4
  sub    %ebx,%eax
  comisd D73(%rip),%xmm0
  movsd  0x18(%rsp),%xmm5
  mulsd  %xmm6,%xmm4
  movsd  0x20(%rsp),%xmm3
  cmova  %eax,%ebx
  test   %ebx,%ebx
  subsd  %xmm4,%xmm5
  je     L7
  movsd  0x28(%rsp),%xmm2
  add    $0x30,%rsp
  pop    %rbx
  subsd  %xmm5,%xmm2
  movapd %xmm2,%xmm0
  ret
  nopl   0x0(%rax,%rax,1)
L86:
  movapd %xmm3,%xmm1
  lea    D77(%rip),%rdi
  movsd  %xmm4,0x20(%rsp)
  movsd  %xmm2,0x18(%rsp)
  movsd  %xmm3,0x10(%rsp)
  movsd  %xmm0,0x8(%rsp)
  call   <printf@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
  movsd  0x20(%rsp),%xmm4
  movsd  0x18(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm3
  movsd  0x8(%rsp),%xmm0
  jmp    L52
  nop
L7:
  addsd  %xmm5,%xmm3
  add    $0x30,%rsp
  pop    %rbx
  movapd %xmm3,%xmm0
  ret
  xchg   %ax,%ax
L58:
  cvttsd2si %xmm6,%rax
  pxor   %xmm0,%xmm0
  andnpd %xmm6,%xmm1
  movsd  D28(%rip),%xmm8
  cvtsi2sd %rax,%xmm0
  movapd %xmm0,%xmm7
  cmpnlesd %xmm6,%xmm7
  andpd  %xmm8,%xmm7
  subsd  %xmm7,%xmm0
  movapd %xmm0,%xmm6
  orpd   %xmm1,%xmm6
  jmp    L46
```

tool_calls: name: unpack_data
arguments: label: D29
type_guessed: byte[8]
name: unpack_data
arguments: label: D49
type_guessed: f64
name: unpack_data
arguments: label: D25
type_guessed: byte[8]
name: unpack_data
arguments: label: D60
type_guessed: byte[8]
name: unpack_data
arguments: label: D62
type_guessed: f64
name: unpack_data
arguments: label: D73
type_guessed: f64[2]
name: unpack_data
arguments: label: D77
type_guessed: string
name: unpack_data
arguments: label: D28
type_guessed: byte[8]

tool: {"D29": [0x30,0x05,0x8e,0xe4,0x2e,0xff,0x2b,0x2b]}

tool: D49: 0

tool: {"D25": [0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f]}

tool: {"D60": [0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x43]}

tool: D62: 2

tool: {"D73": [0.1,null]}

tool: D77: 
improper range x0=%.6g (%.6g, %.6g)


tool: {"D28": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

assistant: ```c
double reflect(double x, double a, double b) {
  int side = 0;
  double n, e = 0, small = 1e-100;
  if (b - a < small) {
    printf("\nimproper range x0=%.6g (%.6g, %.6g)\n", x, a, b);
    exit(-1);
  }
  if (x < a) {
    e = a - x;
    side = 0;
  } else if (x > b) {
    e = x - b;
    side = 1;
  }
  if (e) {
    n = floor(e / (b - a));
    if (fmod(n, 2.0) > 0.1)
      side = 1 - side;
    e -= n * (b - a);
    x = (side ? b - e : a + e);
  }
  return (x);
}
```