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

```asm
<ubbf3>:
  endbr64
  push   %r15
  push   %r14
  lea    D80(%rip),%r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  sub    $0x78,%rsp
  movsd  (%rsi),%xmm4
  movsd  D70(%rip),%xmm8
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  nop
L9:
  movapd %xmm4,%xmm1
  movapd %xmm4,%xmm0
  subsd  %xmm8,%xmm1
  addsd  %xmm8,%xmm0
  addsd  D74(%rip),%xmm0
  comisd %xmm1,%xmm0
  jb     L61
  movsd  0x0(%rbp),%xmm3
  mov    $0x1,%eax
  xchg   %ax,%ax
L158:
  movapd %xmm3,%xmm2
  movapd %xmm3,%xmm0
  lea    0x1(%rax),%ebx
  subsd  %xmm8,%xmm2
  addsd  %xmm8,%xmm0
  movslq %ebx,%rbx
  addsd  D74(%rip),%xmm0
  lea    0x10(%rsp),%r15
  comisd %xmm2,%xmm0
  jb     L155
  nop
L162:
  movsd  (%r12),%xmm0
  mov    $0x3,%eax
  movsd  %xmm2,0x8(%rsp)
  movsd  %xmm1,(%rsp)
  call   <d5@plt>
  mov    D70(%rip),%rcx
  movsd  0x0(%rbp),%xmm3
  mov    %ebx,%eax
  movsd  0x8(%rsp),%xmm2
  movsd  %xmm0,-0x8(%r15,%rbx,8)
  add    $0x1,%rbx
  movsd  (%rsp),%xmm1
  movq   %rcx,%xmm8
  movapd %xmm3,%xmm0
  addsd  %xmm8,%xmm2
  addsd  %xmm8,%xmm0
  addsd  D74(%rip),%xmm0
  comisd %xmm2,%xmm0
  jae    L162
  movsd  0x0(%r13),%xmm4
  addsd  %xmm8,%xmm1
  movapd %xmm4,%xmm0
  addsd  %xmm8,%xmm0
  addsd  D74(%rip),%xmm0
  comisd %xmm1,%xmm0
  jae    L158
L61:
  sub    $0x8,%rsp
  mov    $0x8,%eax
  push   0x60(%rsp)
  movsd  0x60(%rsp),%xmm7
  movsd  0x58(%rsp),%xmm6
  movsd  0x50(%rsp),%xmm5
  movsd  0x48(%rsp),%xmm4
  movsd  0x40(%rsp),%xmm3
  movsd  0x38(%rsp),%xmm2
  movsd  0x30(%rsp),%xmm1
  movsd  0x28(%rsp),%xmm0
  call   <i_min@plt>
  mov    D70(%rip),%rsi
  pop    %rdx
  cmp    $0x1,%eax
  pop    %rcx
  movq   %rsi,%xmm8
  je     L89
  cmp    $0x9,%eax
  ja     L96
  mov    %eax,%edx
  movslq (%r14,%rdx,4),%rdx
  add    %r14,%rdx
  notrack jmp *%rdx
  movsd  0x0(%r13),%xmm0
  addsd  %xmm8,%xmm0
L119:
  movsd  %xmm0,0x0(%r13)
  movsd  0x0(%rbp),%xmm0
  subsd  %xmm8,%xmm0
  movsd  %xmm0,0x0(%rbp)
  movsd  0x0(%r13),%xmm4
  jmp    L9
  movsd  0x0(%r13),%xmm0
  subsd  %xmm8,%xmm0
L43:
  movsd  %xmm0,0x0(%r13)
  movsd  0x0(%rbp),%xmm0
  addsd  %xmm8,%xmm0
  movsd  %xmm0,0x0(%rbp)
  movsd  0x0(%r13),%xmm4
  jmp    L9
  movsd  0x0(%r13),%xmm0
  addsd  %xmm8,%xmm0
  jmp    L43
  movsd  0x0(%r13),%xmm4
  addsd  %xmm8,%xmm4
  movsd  %xmm4,0x0(%r13)
  jmp    L9
  movsd  0x0(%r13),%xmm4
  subsd  %xmm8,%xmm4
  movsd  %xmm4,0x0(%r13)
  jmp    L9
L96:
  mov    0x68(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L84
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L155:
  movapd %xmm4,%xmm5
  addsd  %xmm8,%xmm1
  addsd  %xmm8,%xmm5
  addsd  D74(%rip),%xmm5
  comisd %xmm1,%xmm5
  jb     L61
  comisd %xmm2,%xmm0
  jae    L158
  nopw   0x0(%rax,%rax,1)
L115:
  addsd  %xmm8,%xmm1
  comisd %xmm1,%xmm5
  jae    L115
  jmp    L61
L89:
  movsd  0x0(%r13),%xmm0
  subsd  %xmm8,%xmm0
  jmp    L119
L84:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D70
datatype: byte[8]
name: disassemble_data
arguments: label: D74
datatype: f64

tool: {"D70": [0x50,0x45,0x52,0x54,0xfb,0x21,0x19,0x40]}

tool: D74: 0.1

assistant: ```c
int ubbf3(a1, a2, a3)
double *a1, *a2, *a3;
{
  double s[10], aa2, aa3;
  int ic, ik;
  double d5(), Pi2;
  int i_min();
  Pi2 = 3.141592654 * 2.;
l1:
  ik = 1;
  for (aa2 = *a2 - Pi2; aa2 <= *a2 + Pi2 + 0.1; aa2 += Pi2) {
    for (aa3 = *a3 - Pi2; aa3 <= *a3 + Pi2 + 0.1; aa3 += Pi2) {
      s[ik] = d5(*a1, aa2, aa3);
      ik++;
    }
  }
  ic = i_min(s[1], s[2], s[3], s[4], s[5], s[6], s[7], s[8], s[9]);
  if (ic == 1) {
    *a2 -= Pi2;
    *a3 -= Pi2;
    goto l1;
  }
  if (ic == 2) {
    *a2 -= Pi2;
    goto l1;
  }
  if (ic == 3) {
    *a2 -= Pi2;
    *a3 += Pi2;
    goto l1;
  }
  if (ic == 4) {
    *a3 -= Pi2;
    goto l1;
  }
  if (ic == 5) {
    goto l2;
  }
  if (ic == 6) {
    *a3 += Pi2;
    goto l1;
  }
  if (ic == 7) {
    *a2 += Pi2;
    *a3 -= Pi2;
    goto l1;
  }
  if (ic == 8) {
    *a2 += Pi2;
    goto l1;
  }
  if (ic == 9) {
    *a2 += Pi2;
    *a3 += Pi2;
    goto l1;
  }
l2:
  return ic;
}
```