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

```asm
<lp_base_case>:
  endbr64
  push   %r15
  push   %r14
  mov    %r8,%r14
  push   %r13
  mov    %rcx,%r13
  push   %r12
  mov    %rdx,%r12
  mov    %r9,%rdx
  push   %rbp
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%r15
  lea    0x8(%rsp),%rbp
  sub    $0x8,%rsp
  lea    0xc(%rsp),%rax
  mov    %r15,%r9
  mov    %rbp,%r8
  push   %rax
  mov    0x60(%rsp),%rcx
  call   <wedge@plt>
  pop    %rdx
  pop    %rcx
  test   %eax,%eax
  je     L167
  cmp    $0x2,%eax
  je     L142
  movss  (%r12),%xmm2
  movss  0x4(%r13),%xmm4
  pxor   %xmm7,%xmm7
  movss  0x4(%r12),%xmm3
  movss  0x0(%r13),%xmm1
  movaps %xmm2,%xmm0
  mulss  %xmm4,%xmm0
  movaps %xmm3,%xmm5
  mulss  %xmm1,%xmm5
  subss  %xmm5,%xmm0
  comiss %xmm7,%xmm0
  jbe    L29
L83:
  movsd  D0(%rip),%xmm8
  cvtss2sd %xmm0,%xmm0
  comisd %xmm0,%xmm8
  jbe    L19
  movaps %xmm3,%xmm9
  movaps %xmm2,%xmm0
  movss  0x8(%rsp),%xmm6
  movss  0xc(%rsp),%xmm5
  mulss  %xmm3,%xmm9
  mulss  %xmm2,%xmm0
  addss  %xmm9,%xmm0
  cvtss2sd %xmm0,%xmm0
  comisd %xmm0,%xmm8
  ja     L23
  mulss  %xmm1,%xmm1
  mulss  %xmm4,%xmm4
  addss  %xmm4,%xmm1
  cvtss2sd %xmm1,%xmm1
  comisd %xmm8,%xmm1
  ja     L23
  mov    0x4(%rsp),%eax
  movss  0x14(%rsp),%xmm1
  movss  0x10(%rsp),%xmm4
  test   %eax,%eax
  jne    L148
  movaps %xmm2,%xmm8
  movaps %xmm3,%xmm0
  mulss  %xmm5,%xmm8
  mulss  %xmm6,%xmm0
  subss  %xmm8,%xmm0
  comiss %xmm0,%xmm7
  jae    L90
L148:
  movaps %xmm2,%xmm0
  movaps %xmm3,%xmm7
  mulss  %xmm6,%xmm0
  mulss  %xmm5,%xmm7
  mulss  %xmm4,%xmm2
  mulss  %xmm1,%xmm3
  addss  %xmm7,%xmm0
  addss  %xmm3,%xmm2
  comiss %xmm2,%xmm0
  jbe    L44
  movss  %xmm4,(%r14)
  mov    $0x1,%eax
  movss  %xmm1,0x4(%r14)
  nopl   0x0(%rax,%rax,1)
L167:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L103
  add    $0x20,%rsp
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L29:
  xorps  D26(%rip),%xmm0
  jmp    L83
  nopl   0x0(%rax)
L23:
  movss  %xmm6,(%r14)
  mov    $0x3,%eax
  movss  %xmm5,0x4(%r14)
  jmp    L167
  nopw   0x0(%rax,%rax,1)
L19:
  mov    0x4(%rsp),%edi
  mov    %r14,%r9
  mov    %r13,%r8
  mov    %r12,%rcx
  mov    %r15,%rdx
  mov    %rbp,%rsi
  call   <lp_min_lin_rat@plt>
  mov    $0x1,%eax
  jmp    L167
  nop
L142:
  mov    %r14,%rcx
  mov    %r13,%rdx
  mov    %r12,%rsi
  mov    $0x1,%edi
  call   <lp_no_constraints@plt>
  jmp    L167
  nopl   0x0(%rax,%rax,1)
L44:
  movss  %xmm6,(%r14)
  mov    $0x1,%eax
  movss  %xmm5,0x4(%r14)
  jmp    L167
  nopl   (%rax)
L90:
  movaps %xmm3,%xmm8
  movaps %xmm2,%xmm0
  mulss  %xmm4,%xmm8
  mulss  %xmm1,%xmm0
  subss  %xmm8,%xmm0
  comiss %xmm0,%xmm7
  jb     L148
  movss  D26(%rip),%xmm1
  mov    $0x1,%eax
  xorps  %xmm1,%xmm2
  movss  %xmm2,(%r14)
  movss  0x4(%r12),%xmm0
  xorps  %xmm1,%xmm0
  movss  %xmm0,0x4(%r14)
  jmp    L167
L103:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D0
type_infered: byte[8]
name: read_data
arguments: tag: D26
type_infered: byte[16]

tool: {"D0": [0x9a,0x2b,0xa1,0x86,0x9b,0x84,0x16,0x3d]}

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

assistant: ```c
int lp_base_case(float halves[][2], int m, float n_vec[2], float d_vec[2], float opt[2], int next[], int prev[]) {
  float cw_vec[2], ccw_vec[2];
  int status, degen;
  float ab;
  status = wedge(halves, m, next, prev, cw_vec, ccw_vec, &degen);
  if (status == 0)
    return (status);
  if (status == 2) {
    return (lp_no_constraints(1, n_vec, d_vec, opt));
  }
  ab = ((((n_vec)[0] * (d_vec)[1] - (n_vec)[1] * (d_vec)[0])) > 0.0 ? (((n_vec)[0] * (d_vec)[1] - (n_vec)[1] * (d_vec)[0])) : -(((n_vec)[0] * (d_vec)[1] - (n_vec)[1] * (d_vec)[0])));
  if (ab < 2 * 1.0e-7 * 1.0e-7) {
    if (((n_vec)[0] * (n_vec)[0] + (n_vec)[1] * (n_vec)[1]) < 2 * 1.0e-7 * 1.0e-7 || ((d_vec)[0] * (d_vec)[0] + (d_vec)[1] * (d_vec)[1]) > 2 * 1.0e-7 * 1.0e-7) {
      opt[0] = cw_vec[0];
      opt[1] = cw_vec[1];
      status = 3;
    } else {
      if (!degen && ((cw_vec)[0] * (n_vec)[1] - (cw_vec)[1] * (n_vec)[0]) <= 0.0 && ((n_vec)[0] * (ccw_vec)[1] - (n_vec)[1] * (ccw_vec)[0]) <= 0.0) {
        opt[0] = -n_vec[0];
        opt[1] = -n_vec[1];
      } else if (((n_vec)[0] * (cw_vec)[0] + (n_vec)[1] * (cw_vec)[1]) > ((n_vec)[0] * (ccw_vec)[0] + (n_vec)[1] * (ccw_vec)[1])) {
        opt[0] = ccw_vec[0];
        opt[1] = ccw_vec[1];
      } else {
        opt[0] = cw_vec[0];
        opt[1] = cw_vec[1];
      }
      status = 1;
    }
  } else {
    lp_min_lin_rat(degen, cw_vec, ccw_vec, n_vec, d_vec, opt);
    status = 1;
  }
  return (status);
}
```