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

```asm
<betaln>:
  endbr64
  push   %rbp
  movapd %xmm0,%xmm3
  movapd %xmm0,%xmm2
  push   %rbx
  minsd  %xmm1,%xmm3
  maxsd  %xmm1,%xmm2
  sub    $0x28,%rsp
  movsd  D123(%rip),%xmm4
  comisd %xmm4,%xmm3
  jae    L149
  movsd  D54(%rip),%xmm1
  comisd %xmm1,%xmm3
  jae    L8
  comisd %xmm4,%xmm2
  jae    L188
  movapd %xmm3,%xmm0
  movsd  %xmm3,0x8(%rsp)
  movsd  %xmm2,(%rsp)
  call   <gamln@plt>
  movsd  (%rsp),%xmm2
  mov    %eax,%ebp
  movapd %xmm2,%xmm0
  call   <gamln@plt>
  movsd  0x8(%rsp),%xmm3
  movsd  (%rsp),%xmm2
  mov    %eax,%ebx
  addsd  %xmm2,%xmm3
  movapd %xmm3,%xmm0
  call   <gamln@plt>
  pxor   %xmm0,%xmm0
  sub    %eax,%ebx
  add    %ebp,%ebx
  cvtsi2sd %ebx,%xmm0
L107:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   (%rax)
L8:
  movsd  D100(%rip),%xmm0
  comisd %xmm0,%xmm3
  ja     L42
  comisd %xmm0,%xmm2
  jbe    L205
  comisd %xmm2,%xmm4
  pxor   %xmm6,%xmm6
  jbe    L188
L82:
  movapd %xmm2,%xmm0
  subsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%edx
  test   %edx,%edx
  jle    L165
  add    $0x1,%edx
  movapd %xmm1,%xmm0
  mov    $0x1,%eax
  nopw   0x0(%rax,%rax,1)
L180:
  subsd  %xmm1,%xmm2
  movapd %xmm3,%xmm5
  add    $0x1,%eax
  addsd  %xmm2,%xmm5
  movapd %xmm2,%xmm4
  divsd  %xmm5,%xmm4
  mulsd  %xmm4,%xmm0
  cmp    %eax,%edx
  jne    L180
L40:
  movsd  %xmm2,0x18(%rsp)
  movsd  %xmm6,(%rsp)
  movsd  %xmm3,0x8(%rsp)
  call   <log@plt>
  movsd  (%rsp),%xmm6
  movsd  0x8(%rsp),%xmm3
  addsd  %xmm6,%xmm0
  movsd  %xmm3,0x10(%rsp)
  movsd  %xmm0,(%rsp)
  movapd %xmm3,%xmm0
  call   <gamln@plt>
  movsd  0x18(%rsp),%xmm2
  mov    %eax,%ebx
  movapd %xmm2,%xmm0
  movsd  %xmm2,0x8(%rsp)
  call   <gamln@plt>
  movsd  0x8(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm3
  mov    %eax,%ebp
  movapd %xmm2,%xmm1
  movapd %xmm3,%xmm0
  call   <gsumln@plt>
  movapd %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebp,%xmm0
  subsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebx,%xmm1
  addsd  %xmm1,%xmm0
  addsd  (%rsp),%xmm0
  jmp    L107
  nopl   0x0(%rax,%rax,1)
L188:
  movapd %xmm3,%xmm0
  movsd  %xmm2,0x8(%rsp)
  movsd  %xmm3,(%rsp)
  call   <gamln@plt>
  movsd  0x8(%rsp),%xmm2
  movsd  (%rsp),%xmm3
  mov    %eax,%ebx
  movapd %xmm3,%xmm0
  movapd %xmm2,%xmm1
  call   <algdiv@plt>
  add    $0x28,%rsp
  pxor   %xmm0,%xmm0
  add    %eax,%ebx
  cvtsi2sd %ebx,%xmm0
  pop    %rbx
  pop    %rbp
  ret
  nop
L149:
  movapd %xmm2,%xmm1
  movapd %xmm3,%xmm0
  movsd  %xmm2,0x8(%rsp)
  movsd  %xmm3,(%rsp)
  call   <bcorr@plt>
  movsd  (%rsp),%xmm3
  movsd  0x8(%rsp),%xmm2
  movsd  D54(%rip),%xmm4
  movsd  %xmm0,0x18(%rsp)
  movapd %xmm3,%xmm1
  movsd  %xmm2,0x10(%rsp)
  divsd  %xmm2,%xmm1
  addsd  %xmm1,%xmm4
  movapd %xmm1,%xmm0
  movsd  %xmm1,0x8(%rsp)
  divsd  %xmm4,%xmm0
  call   <log@plt>
  movsd  (%rsp),%xmm3
  movsd  0x8(%rsp),%xmm1
  subsd  D128(%rip),%xmm3
  xorpd  D86(%rip),%xmm3
  mulsd  %xmm0,%xmm3
  movapd %xmm1,%xmm0
  movsd  %xmm3,(%rsp)
  call   <alnrel@plt>
  movsd  0x10(%rsp),%xmm2
  movapd %xmm0,%xmm1
  mulsd  %xmm2,%xmm1
  comisd (%rsp),%xmm1
  jae    L112
  movapd %xmm2,%xmm0
  movsd  %xmm1,0x8(%rsp)
  call   <log@plt>
  mulsd  D13(%rip),%xmm0
  movsd  0x8(%rsp),%xmm1
  addsd  D47(%rip),%xmm0
  addsd  0x18(%rsp),%xmm0
  subsd  %xmm1,%xmm0
  subsd  (%rsp),%xmm0
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L205:
  movapd %xmm3,%xmm0
  movsd  %xmm3,0x8(%rsp)
  movsd  %xmm2,(%rsp)
  call   <gamln@plt>
  movsd  (%rsp),%xmm2
  mov    %eax,%ebx
  movapd %xmm2,%xmm0
  call   <gamln@plt>
  movsd  (%rsp),%xmm2
  movsd  0x8(%rsp),%xmm3
  mov    %eax,%ebp
  movapd %xmm2,%xmm1
  movapd %xmm3,%xmm0
  add    %ebp,%ebx
  call   <gsumln@plt>
  add    $0x28,%rsp
  movapd %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebx,%xmm0
  pop    %rbx
  pop    %rbp
  subsd  %xmm1,%xmm0
  ret
  nopw   0x0(%rax,%rax,1)
L112:
  movapd %xmm2,%xmm0
  movsd  %xmm1,0x8(%rsp)
  call   <log@plt>
  mulsd  D13(%rip),%xmm0
  movsd  0x8(%rsp),%xmm1
  addsd  D47(%rip),%xmm0
  addsd  0x18(%rsp),%xmm0
  subsd  (%rsp),%xmm0
  subsd  %xmm1,%xmm0
  jmp    L107
  nopl   0x0(%rax)
L42:
  movapd %xmm3,%xmm0
  comisd D117(%rip),%xmm2
  subsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%ebx
  ja     L201
  test   %ebx,%ebx
  jle    L44
  lea    0x1(%rbx),%edx
  movapd %xmm1,%xmm5
  mov    $0x1,%eax
  xchg   %ax,%ax
L179:
  subsd  %xmm1,%xmm3
  add    $0x1,%eax
  movapd %xmm3,%xmm0
  divsd  %xmm2,%xmm0
  movapd %xmm0,%xmm6
  addsd  %xmm1,%xmm6
  divsd  %xmm6,%xmm0
  mulsd  %xmm0,%xmm5
  cmp    %eax,%edx
  jne    L179
L130:
  movapd %xmm5,%xmm0
  movsd  %xmm2,0x8(%rsp)
  movsd  %xmm3,(%rsp)
  call   <log@plt>
  movsd  0x8(%rsp),%xmm2
  movsd  (%rsp),%xmm3
  mov    D123(%rip),%rax
  movapd %xmm0,%xmm6
  movq   %rax,%xmm4
  mov    D54(%rip),%rax
  comisd %xmm2,%xmm4
  movq   %rax,%xmm1
  ja     L82
  movsd  %xmm0,(%rsp)
  movapd %xmm3,%xmm0
  movsd  %xmm2,0x10(%rsp)
  movsd  %xmm3,0x8(%rsp)
  call   <gamln@plt>
  pxor   %xmm0,%xmm0
  movsd  (%rsp),%xmm6
  movsd  0x10(%rsp),%xmm2
  cvtsi2sd %eax,%xmm0
  movsd  0x8(%rsp),%xmm3
  movapd %xmm2,%xmm1
  addsd  %xmm6,%xmm0
  movsd  %xmm0,(%rsp)
  movapd %xmm3,%xmm0
  call   <algdiv@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  addsd  (%rsp),%xmm0
  jmp    L107
  nopl   0x0(%rax,%rax,1)
L201:
  lea    0x1(%rbx),%edx
  movapd %xmm1,%xmm4
  mov    $0x1,%eax
  test   %ebx,%ebx
  jle    L124
  nopl   0x0(%rax,%rax,1)
L117:
  subsd  %xmm1,%xmm3
  add    $0x1,%eax
  movapd %xmm3,%xmm0
  movapd %xmm3,%xmm5
  divsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  divsd  %xmm0,%xmm5
  mulsd  %xmm5,%xmm4
  cmp    %eax,%edx
  jne    L117
L124:
  movapd %xmm4,%xmm0
  movsd  %xmm3,0x8(%rsp)
  movsd  %xmm2,(%rsp)
  call   <log@plt>
  movsd  (%rsp),%xmm2
  movq   %xmm0,%rbp
  movapd %xmm2,%xmm0
  movsd  %xmm2,0x10(%rsp)
  call   <log@plt>
  pxor   %xmm1,%xmm1
  movq   %rbp,%xmm7
  movsd  0x8(%rsp),%xmm3
  cvtsi2sd %ebx,%xmm1
  mulsd  %xmm0,%xmm1
  movapd %xmm3,%xmm0
  subsd  %xmm1,%xmm7
  movsd  %xmm7,(%rsp)
  call   <gamln@plt>
  movsd  0x10(%rsp),%xmm2
  movsd  0x8(%rsp),%xmm3
  mov    %eax,%ebx
  movapd %xmm3,%xmm0
  movapd %xmm2,%xmm1
  call   <algdiv@plt>
  pxor   %xmm0,%xmm0
  add    %eax,%ebx
  cvtsi2sd %ebx,%xmm0
  addsd  (%rsp),%xmm0
  jmp    L107
  nopl   0x0(%rax,%rax,1)
L165:
  movapd %xmm1,%xmm0
  jmp    L40
L44:
  movapd %xmm1,%xmm5
  jmp    L130
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D123
data_type: f64
name: extract_symbolic_data
arguments: data_label: D54
data_type: f64
name: extract_symbolic_data
arguments: data_label: D100
data_type: f64
name: extract_symbolic_data
arguments: data_label: D128
data_type: f64
name: extract_symbolic_data
arguments: data_label: D86
data_type: f32[4]
name: extract_symbolic_data
arguments: data_label: D13
data_type: f32[2]
name: extract_symbolic_data
arguments: data_label: D47
data_type: byte[8]
name: extract_symbolic_data
arguments: data_label: D117
data_type: f32[4]

tool: D123: 8

tool: D54: 1

tool: D100: 2

tool: D128: 0.5

tool: {"D86": [0.0,-0.0,0.0,0.0]}

tool: {"D13": [0.0,-1.75]}

tool: {"D47": [0xb7,0xbe,0x64,0xc8,0xf1,0x67,0xed,0x3f]}

tool: {"D117": [0.0,4.4765625,0.0,-1.75]}

assistant: ```c
double betaln(double a0, double b0) {
  static double e = .918938533204673;
  int i__1;
  double ret_val;
  double a, b, c__, h__;
  int i__, n;
  double u, v, w, z__;
  a = ((a0 < b0) ? a0 : b0);
  b = ((a0 > b0) ? a0 : b0);
  if (a >= 8.0) {
    goto L60;
  }
  if (a >= 1.0) {
    goto L20;
  }
  if (b >= 8.0) {
    goto L10;
  }
  ret_val = gamln(a) + (gamln(b) - gamln(a + b));
  return ret_val;
L10:
  ret_val = gamln(a) + algdiv(a, b);
  return ret_val;
L20:
  if (a > 2.0) {
    goto L30;
  }
  if (b > 2.0) {
    goto L21;
  }
  ret_val = gamln(a) + gamln(b) - gsumln(a, b);
  return ret_val;
L21:
  w = 0.0;
  if (b < 8.0) {
    goto L40;
  }
  ret_val = gamln(a) + algdiv(a, b);
  return ret_val;
L30:
  if (b > 1e3f) {
    goto L50;
  }
  n = a - 1.0;
  w = 1.0;
  i__1 = n;
  for (i__ = 1; i__ <= i__1; ++i__) {
    a += -1.0;
    h__ = a / b;
    w *= h__ / (h__ + 1.0);
  }
  w = log(w);
  if (b < 8.0) {
    goto L40;
  }
  ret_val = w + gamln(a) + algdiv(a, b);
  return ret_val;
L40:
  n = b - 1.0;
  z__ = 1.0;
  i__1 = n;
  for (i__ = 1; i__ <= i__1; ++i__) {
    b += -1.0;
    z__ *= b / (a + b);
  }
  ret_val = w + log(z__) + (gamln(a) + (gamln(b) - gsumln(a, b)));
  return ret_val;
L50:
  n = a - 1.0;
  w = 1.0;
  i__1 = n;
  for (i__ = 1; i__ <= i__1; ++i__) {
    a += -1.0;
    w *= a / (a / b + 1.0);
  }
  ret_val = log(w) - n * log(b) + (gamln(a) + algdiv(a, b));
  return ret_val;
L60:
  w = bcorr(a, b);
  h__ = a / b;
  c__ = h__ / (h__ + 1.0);
  u = -(a - 0.5) * log(c__);
  v = b * alnrel(h__);
  if (u <= v) {
    goto L61;
  }
  ret_val = log(b) * -0.5 + e + w - v - u;
  return ret_val;
L61:
  ret_val = log(b) * -0.5 + e + w - u - v;
  return ret_val;
}
```