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

```asm
<quadprog>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %edi,%ebx
  mov    %rsi,0x28(%rsp)
  mov    %rdx,0x30(%rsp)
  mov    %ecx,0x8(%rsp)
  mov    %r9,(%rsp)
  mov    0xb0(%rsp),%r13d
  mov    0xb8(%rsp),%r12
  mov    0xc0(%rsp),%rax
  mov    %rax,0x10(%rsp)
  mov    0xc8(%rsp),%rdi
  mov    %rdi,0x38(%rsp)
  mov    0xd0(%rsp),%rcx
  mov    %rcx,0x40(%rsp)
  mov    0xd8(%rsp),%rax
  mov    %rax,0x50(%rsp)
  mov    0xe0(%rsp),%rax
  mov    %rax,0x48(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  cmovne %ebx,%eax
  mov    %eax,0x18(%rsp)
  test   %rcx,%rcx
  mov    $0x0,%eax
  cmovne %ebx,%eax
  mov    %eax,0x1c(%rsp)
  test   %rsi,%rsi
  je     L182
  mov    %r8,%r14
  test   %rdx,%rdx
  je     L182
  test   %r8,%r8
  sete   %al
  test   %r9,%r9
  sete   %dl
  or     %dl,%al
  je     L197
  movl   $0x0,0x8(%rsp)
L197:
  test   %r12,%r12
  sete   %al
  cmpq   $0x0,0x10(%rsp)
  sete   %dl
  or     %dl,%al
  je     L49
  mov    $0x0,%r13d
L49:
  lea    0x0(%r13,%r13,1),%eax
  mov    %eax,0x20(%rsp)
  add    0x8(%rsp),%eax
  mov    %eax,0x58(%rsp)
  add    0x18(%rsp),%eax
  mov    %eax,0x5c(%rsp)
  add    0x1c(%rsp),%eax
  mov    %eax,%r15d
  mov    %eax,0x24(%rsp)
  mov    %eax,%edi
  imul   %ebx,%edi
  shl    $0x3,%edi
  call   <malloc@plt>
  mov    %rax,%rbp
  lea    0x0(,%r15,8),%edi
  call   <malloc@plt>
  mov    %rax,%r15
  mov    0x8(%rsp),%eax
  test   %eax,%eax
  je     L20
  mov    %eax,%edx
  imul   %ebx,%edx
  test   %edx,%edx
  jle    L190
  mov    %rbp,%rax
  mov    %edx,%edx
  lea    0x0(%rbp,%rdx,8),%rdx
L224:
  pxor   %xmm0,%xmm0
  cvtss2sd (%r14),%xmm0
  movsd  %xmm0,(%rax)
  add    $0x4,%r14
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L224
L190:
  mov    0x8(%rsp),%edi
  test   %edi,%edi
  jle    L20
  mov    (%rsp),%rdx
  mov    %r15,%rax
  mov    %edi,%ecx
  lea    (%r15,%rcx,8),%rcx
L198:
  pxor   %xmm0,%xmm0
  cvtss2sd (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  add    $0x4,%rdx
  add    $0x8,%rax
  cmp    %rcx,%rax
  jne    L198
L20:
  test   %r13d,%r13d
  jle    L91
  mov    0x8(%rsp),%edi
  mov    %edi,%esi
  imul   %ebx,%esi
  mov    %esi,0xc(%rsp)
  mov    %ebx,%eax
  imul   %r13d,%eax
  add    %esi,%eax
  mov    %eax,(%rsp)
  mov    0x10(%rsp),%r10
  movslq %edi,%rdx
  lea    (%r15,%rdx,8),%r8
  lea    -0x1(%r13),%eax
  add    %rdx,%rax
  lea    0x8(%r15,%rax,8),%r11
  movslq %r13d,%r13
  shl    $0x3,%r13
  mov    $0x0,%r9d
  movss  D9(%rip),%xmm2
  lea    -0x1(%rbx),%eax
  mov    %rax,0x10(%rsp)
  lea    0x8(%rbp),%r14
  movaps %xmm2,%xmm1
L74:
  pxor   %xmm0,%xmm0
  cvtss2sd (%r10),%xmm0
  movsd  %xmm0,(%r8)
  movss  (%r10),%xmm0
  xorps  %xmm2,%xmm0
  cvtss2sd %xmm0,%xmm0
  movsd  %xmm0,(%r8,%r13,1)
  test   %ebx,%ebx
  jle    L146
  movslq %r9d,%rax
  lea    (%r12,%rax,4),%rdx
  mov    0xc(%rsp),%eax
  lea    (%rax,%r9,1),%edi
  movslq %edi,%rdi
  lea    0x0(%rbp,%rdi,8),%rax
  mov    0x10(%rsp),%rsi
  lea    (%rsi,%rdi,1),%rcx
  lea    (%r14,%rcx,8),%rsi
  mov    (%rsp),%ecx
  add    %r9d,%ecx
  movslq %ecx,%rcx
  sub    %rdi,%rcx
  shl    $0x3,%rcx
L162:
  pxor   %xmm0,%xmm0
  cvtss2sd (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  movss  (%rdx),%xmm0
  xorps  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  movsd  %xmm0,(%rax,%rcx,1)
  add    $0x4,%rdx
  add    $0x8,%rax
  cmp    %rsi,%rax
  jne    L162
L146:
  add    $0x4,%r10
  add    $0x8,%r8
  add    %ebx,%r9d
  cmp    %r11,%r8
  jne    L74
L91:
  mov    0x38(%rsp),%r13
  test   %r13,%r13
  je     L226
  mov    0x8(%rsp),%r12d
  imul   %ebx,%r12d
  movslq %r12d,%r12
  mov    0x20(%rsp),%eax
  imul   %ebx,%eax
  cltq
  add    %rax,%r12
  shl    $0x3,%r12
  mov    0x18(%rsp),%r14d
  mov    %r14d,%edx
  imul   %r14d,%edx
  shl    $0x3,%edx
  lea    0x0(%rbp,%r12,1),%rdi
  mov    $0x0,%esi
  call   <memset@plt>
  test   %r14d,%r14d
  jle    L226
  movslq %r14d,%rax
  lea    0x8(,%rax,8),%rsi
  add    %rbp,%r12
  mov    %r13,%rdx
  movslq 0x58(%rsp),%rcx
  lea    (%r15,%rcx,8),%rax
  lea    -0x1(%r14),%edi
  add    %rdi,%rcx
  lea    0x8(%r15,%rcx,8),%rcx
  movsd  D27(%rip),%xmm2
  movss  D9(%rip),%xmm1
L147:
  movsd  %xmm2,(%r12)
  movss  (%rdx),%xmm0
  xorps  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  add    %rsi,%r12
  add    $0x4,%rdx
  add    $0x8,%rax
  cmp    %rcx,%rax
  jne    L147
L226:
  mov    0x40(%rsp),%r13
  test   %r13,%r13
  je     L210
  mov    0x8(%rsp),%r12d
  imul   %ebx,%r12d
  movslq %r12d,%r12
  mov    0x18(%rsp),%eax
  imul   %eax,%eax
  cltq
  add    %rax,%r12
  mov    0x20(%rsp),%eax
  imul   %ebx,%eax
  cltq
  add    %rax,%r12
  shl    $0x3,%r12
  mov    0x1c(%rsp),%r14d
  mov    %r14d,%edx
  imul   %r14d,%edx
  shl    $0x3,%edx
  lea    0x0(%rbp,%r12,1),%rdi
  mov    $0x0,%esi
  call   <memset@plt>
  test   %r14d,%r14d
  jle    L210
  movslq %r14d,%rax
  lea    0x8(,%rax,8),%rsi
  add    %rbp,%r12
  mov    %r13,%rdx
  movslq 0x5c(%rsp),%rcx
  lea    (%r15,%rcx,8),%rax
  lea    -0x1(%r14),%edi
  add    %rdi,%rcx
  lea    0x8(%r15,%rcx,8),%rcx
  movsd  D15(%rip),%xmm1
L77:
  movsd  %xmm1,(%r12)
  pxor   %xmm0,%xmm0
  cvtss2sd (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  add    %rsi,%r12
  add    $0x4,%rdx
  add    $0x8,%rax
  cmp    %rcx,%rax
  jne    L77
L210:
  lea    0x0(,%rbx,8),%edi
  call   <malloc@plt>
  mov    %rax,%r12
  sub    $0x8,%rsp
  lea    0x68(%rsp),%rax
  push   %rax
  push   %r12
  mov    0x3c(%rsp),%eax
  push   %rax
  mov    %ebx,%r9d
  mov    $0x0,%r8d
  mov    %r15,%rcx
  mov    %rbp,%rdx
  mov    0x50(%rsp),%rsi
  mov    0x48(%rsp),%rdi
  call   <quadprog_ineq@plt>
  mov    %eax,%r13d
  add    $0x20,%rsp
  test   %ebx,%ebx
  jle    L8
  mov    %r12,%rax
  mov    0x50(%rsp),%rdx
  mov    %ebx,%ebx
  lea    (%r12,%rbx,8),%rcx
L55:
  pxor   %xmm0,%xmm0
  cvtsd2ss (%rax),%xmm0
  movss  %xmm0,(%rdx)
  add    $0x8,%rax
  add    $0x4,%rdx
  cmp    %rax,%rcx
  jne    L55
L8:
  mov    %r12,%rdi
  call   <free@plt>
  pxor   %xmm0,%xmm0
  cvtsd2ss 0x60(%rsp),%xmm0
  mov    0x48(%rsp),%rax
  movss  %xmm0,(%rax)
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r15,%rdi
  call   <free@plt>
L113:
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L196
  mov    %r13d,%eax
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L182:
  mov    $0xfffffffe,%r13d
  jmp    L113
L196:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D9
data_type: byte[4]
name: extract_symbolic_data
arguments: data_tag: D27
data_type: byte[8]
name: extract_symbolic_data
arguments: data_tag: D15
data_type: f64

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

tool: {"D27": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xbf]}

tool: D15: 1

assistant: ```c
int32_t quadprog(int problemLen, double *H, double *f, int inequalityLen, float *A, float *b, int equalityLen, float *Aeq, float *beq, float *lb, float *ub, float *outAns, float *fv) {
  int i;
  int lowerBoundLen = 0;
  int upperBoundLen = 0;
  if (lb)
    lowerBoundLen = problemLen;
  if (ub)
    upperBoundLen = problemLen;
  if (!H || !f)
    return -2;
  if ((!A || !b) && inequalityLen)
    inequalityLen = 0;
  if ((!Aeq || !beq) && equalityLen)
    equalityLen = 0;
  int constraintLength = inequalityLen + (equalityLen << 1) + lowerBoundLen + upperBoundLen;
  double *synthesizedA = (double *)malloc(constraintLength * problemLen * sizeof(double));
  double *synthesizedb = (double *)malloc(constraintLength * sizeof(double));
  if (inequalityLen) {
    for (i = 0; i < inequalityLen * problemLen; i++)
      synthesizedA[i] = A[i];
    for (i = 0; i < inequalityLen; i++)
      synthesizedb[i] = b[i];
  }
  if (equalityLen) {
    for (i = 0; i < equalityLen; i++) {
      synthesizedb[inequalityLen + i] = beq[i];
      synthesizedb[inequalityLen + equalityLen + i] = -beq[i];
      for (int j = 0; j < problemLen; j++) {
        synthesizedA[inequalityLen * problemLen + i * problemLen + j] = Aeq[i * problemLen + j];
        synthesizedA[inequalityLen * problemLen + equalityLen * problemLen + i * problemLen + j] = -Aeq[i * problemLen + j];
      }
    }
  }
  if (lb) {
    memset(synthesizedA + inequalityLen * problemLen + (equalityLen << 1) * problemLen, 0, lowerBoundLen * lowerBoundLen * sizeof(double));
    for (i = 0; i < lowerBoundLen; i++) {
      synthesizedA[inequalityLen * problemLen + (equalityLen << 1) * problemLen + i * lowerBoundLen + i] = -1.0;
      synthesizedb[inequalityLen + (equalityLen << 1) + i] = -lb[i];
    }
  }
  if (ub) {
    memset(synthesizedA + inequalityLen * problemLen + (equalityLen << 1) * problemLen + lowerBoundLen * lowerBoundLen, 0, upperBoundLen * upperBoundLen * sizeof(double));
    for (i = 0; i < upperBoundLen; i++) {
      synthesizedA[inequalityLen * problemLen + (equalityLen << 1) * problemLen + lowerBoundLen * lowerBoundLen + i * upperBoundLen + i] = 1.0;
      synthesizedb[inequalityLen + (equalityLen << 1) + lowerBoundLen + i] = ub[i];
    }
  }
  double *ans = (double *)malloc(problemLen * sizeof(double));
  double fval;
  int err = quadprog_ineq(H, f, synthesizedA, synthesizedb, 0, problemLen, constraintLength, ans, &fval);
  for (i = 0; i < problemLen; i++)
    outAns[i] = (float)ans[i];
  free(ans);
  *fv = (float)fval;
  free(synthesizedA);
  free(synthesizedb);
  return err;
}
```