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

```asm
<occultuniform>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  movsd  %xmm0,(%rsp)
  subsd  D54(%rip),%xmm0
  andpd  D161(%rip),%xmm0
  movsd  D89(%rip),%xmm1
  comisd %xmm0,%xmm1
  jbe    L138
  movsd  D54(%rip),%xmm4
  movsd  %xmm4,(%rsp)
L138:
  test   %edx,%edx
  jle    L94
  mov    %rdi,%rbp
  mov    %rsi,%r12
  lea    -0x1(%rdx),%eax
  lea    0x8(%rdi,%rax,8),%r13
  movsd  (%rsp),%xmm7
  addsd  D23(%rip),%xmm7
  movsd  %xmm7,0x8(%rsp)
  jmp    L55
L54:
  mov    D23(%rip),%rax
  mov    %rax,(%r12)
L179:
  add    $0x8,%rbp
  add    $0x8,%r12
  cmp    %r13,%rbp
  je     L94
L55:
  mov    0x0(%rbp),%rbx
  movq   %rbx,%xmm3
  comisd 0x8(%rsp),%xmm3
  jae    L54
  movsd  (%rsp),%xmm2
  comisd D23(%rip),%xmm2
  jb     L62
  movapd %xmm2,%xmm0
  subsd  D23(%rip),%xmm0
  comisd %xmm3,%xmm0
  jae    L168
L62:
  movsd  D23(%rip),%xmm0
  subsd  (%rsp),%xmm0
  movapd %xmm0,%xmm1
  andpd  D161(%rip),%xmm1
  movq   %rbx,%xmm6
  comisd %xmm1,%xmm6
  jb     L80
  movsd  0x8(%rsp),%xmm6
  movq   %rbx,%xmm5
  comisd %xmm5,%xmm6
  jae    L4
L80:
  movq   %rbx,%xmm7
  comisd %xmm7,%xmm0
  jb     L179
  movsd  D23(%rip),%xmm0
  movsd  (%rsp),%xmm7
  movapd %xmm7,%xmm1
  mulsd  %xmm7,%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%r12)
  jmp    L179
L168:
  movq   $0x0,(%r12)
  jmp    L179
L4:
  movsd  (%rsp),%xmm3
  movapd %xmm3,%xmm6
  mulsd  %xmm3,%xmm6
  movsd  %xmm6,0x10(%rsp)
  movq   %rbx,%xmm4
  mulsd  %xmm5,%xmm4
  movsd  %xmm4,0x18(%rsp)
  movsd  D23(%rip),%xmm1
  movapd %xmm1,%xmm0
  subsd  %xmm6,%xmm0
  addsd  %xmm4,%xmm0
  mulsd  D54(%rip),%xmm0
  divsd  %xmm5,%xmm0
  comisd %xmm0,%xmm1
  ja     L95
  movapd %xmm1,%xmm0
L95:
  call   <acos@plt>
  movq   %xmm0,%r14
  movsd  D23(%rip),%xmm1
  movsd  0x10(%rsp),%xmm0
  addsd  0x18(%rsp),%xmm0
  subsd  %xmm1,%xmm0
  mulsd  D54(%rip),%xmm0
  divsd  (%rsp),%xmm0
  movq   %rbx,%xmm5
  divsd  %xmm5,%xmm0
  comisd %xmm0,%xmm1
  ja     L171
  movapd %xmm1,%xmm0
L171:
  call   <acos@plt>
  movsd  0x10(%rsp),%xmm6
  mulsd  %xmm6,%xmm0
  movq   %r14,%xmm3
  addsd  %xmm3,%xmm0
  movq   %xmm0,%r14
  movsd  0x18(%rsp),%xmm1
  addsd  D23(%rip),%xmm1
  subsd  %xmm6,%xmm1
  movq   %rbx,%xmm0
  mulsd  D95(%rip),%xmm0
  movq   %rbx,%xmm7
  mulsd  %xmm7,%xmm0
  mulsd  %xmm1,%xmm1
  subsd  %xmm1,%xmm0
  comisd D18(%rip),%xmm0
  jbe    L165
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L51
L167:
  sqrtsd %xmm0,%xmm0
L87:
  mulsd  D54(%rip),%xmm0
  movq   %r14,%xmm1
  subsd  %xmm0,%xmm1
  divsd  D9(%rip),%xmm1
  movapd %xmm1,%xmm0
  movsd  D23(%rip),%xmm1
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%r12)
  jmp    L179
L165:
  pxor   %xmm0,%xmm0
  jmp    L167
L51:
  call   <sqrt@plt>
  jmp    L87
L94:
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

tool_calls: name: read_data
arguments: data_label: D54
type_guessed: f64
name: read_data
arguments: data_label: D161
type_guessed: qword[2]
name: read_data
arguments: data_label: D89
type_guessed: f64
name: read_data
arguments: data_label: D23
type_guessed: f64[2]
name: read_data
arguments: data_label: D95
type_guessed: f64
name: read_data
arguments: data_label: D18
type_guessed: f64
name: read_data
arguments: data_label: D9
type_guessed: byte[8]

tool: D54: 0.5

tool: {"D161": [0x7fffffffffffffff,0x0000000000000000]}

tool: D89: 0.001

tool: {"D23": [1.0,0.001]}

tool: D95: 4

tool: D18: 0

tool: {"D9": [0x18,0x2d,0x44,0x54,0xfb,0x21,0x09,0x40]}

assistant: ```c
void occultuniform(double *b0, double w, double *muo1, int nb) {
  int i;
  double z, pi, lambdae, kap0, kap1;
  if (fabs(w - 0.5) < 0.001)
    w = 0.5;
  pi = acos(-1.);
  for (i = 0; i < nb; i++) {
    z = b0[i];
    if (z >= 1.0 + w) {
      muo1[i] = 1.;
      continue;
    }
    if (w >= 1.0 && z <= w - 1.0) {
      muo1[i] = 0.0;
      continue;
    }
    if (z >= fabs(1.0 - w) && z <= 1.0 + w) {
      kap1 = acos((((1.0 - w * w + z * z) / 2.0 / z) < (1.0) ? ((1.0 - w * w + z * z) / 2.0 / z) : (1.0)));
      kap0 = acos((((w * w + z * z - 1.0) / 2.0 / w / z) < (1.0) ? ((w * w + z * z - 1.0) / 2.0 / w / z) : (1.0)));
      lambdae = w * w * kap0 + kap1;
      lambdae = (lambdae - 0.5 * sqrt(((4.0 * z * z - ((1.0 + z * z - w * w) * (1.0 + z * z - w * w))) > (0.0) ? (4.0 * z * z - ((1.0 + z * z - w * w) * (1.0 + z * z - w * w))) : (0.0)))) / pi;
      muo1[i] = 1.0 - lambdae;
      continue;
    }
    if (z <= 1.0 - w)
      muo1[i] = 1.0 - w * w;
  }
  return;
}
```