user: Translate the below assembly code into C programming language:

```asm
<constrained_least_squares>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xb8,%rsp
  mov    %edi,%eax
  mov    %edi,0x2c(%rsp)
  mov    %esi,0x28(%rsp)
  mov    %rdx,%rbx
  mov    %ecx,0x24(%rsp)
  mov    %fs:0x28,%rdx
  mov    %rdx,0xa8(%rsp)
  xor    %edx,%edx
  test   %edi,%edi
  jle    L127
  mov    %esi,%edi
  mov    %r8,%rbp
  test   %esi,%esi
  jle    L127
  mov    %ecx,%edx
  cmp    %esi,%eax
  jl     L60
  cmp    %ecx,%esi
  jl     L60
  mov    %eax,%ecx
  sub    %edx,%ecx
  mov    %ecx,0x38(%rsp)
  sub    %edx,%edi
  mov    %edi,0x3c(%rsp)
  imul   %eax,%eax
  mov    %eax,0x44(%rsp)
  lea    0x58(%rsp),%rdi
  mov    %eax,%esi
  mov    $0x0,%eax
  call   <allocate_double_vector@plt>
  test   %eax,%eax
  je     L309
  lea    0x60(%rsp),%rdi
  mov    0x24(%rsp),%esi
  mov    $0x0,%eax
  call   <allocate_integer_vector@plt>
  test   %eax,%eax
  je     L459
  lea    0x68(%rsp),%rdi
  mov    0x24(%rsp),%esi
  mov    $0x0,%eax
  call   <allocate_double_vector@plt>
  test   %eax,%eax
  je     L670
  mov    0x2c(%rsp),%esi
  lea    0x70(%rsp),%rdi
  mov    %esi,%edx
  mov    $0x0,%eax
  call   <allocate_double_matrix@plt>
  test   %eax,%eax
  je     L151
  mov    0x28(%rsp),%esi
  lea    0x78(%rsp),%rdi
  mov    %esi,%edx
  mov    $0x0,%eax
  call   <allocate_double_matrix@plt>
  test   %eax,%eax
  je     L134
  mov    0x24(%rsp),%esi
  lea    0x80(%rsp),%rdi
  mov    %esi,%edx
  mov    $0x0,%eax
  call   <allocate_double_matrix@plt>
  test   %eax,%eax
  je     L261
  lea    0x88(%rsp),%rdi
  mov    0x38(%rsp),%edx
  mov    0x28(%rsp),%esi
  mov    $0x0,%eax
  call   <allocate_double_matrix@plt>
  test   %eax,%eax
  je     L51
  mov    0x38(%rsp),%esi
  lea    0x90(%rsp),%rdi
  mov    %esi,%edx
  mov    $0x0,%eax
  call   <allocate_double_matrix@plt>
  test   %eax,%eax
  je     L191
  lea    0x98(%rsp),%rdi
  mov    0x2c(%rsp),%esi
  mov    $0x0,%eax
  call   <allocate_integer_vector@plt>
  test   %eax,%eax
  je     L559
  lea    0xa0(%rsp),%rdi
  mov    0x38(%rsp),%esi
  mov    $0x0,%eax
  call   <allocate_integer_vector@plt>
  test   %eax,%eax
  je     L201
  cmpl   $0x0,0x2c(%rsp)
  jle    L629
  mov    $0x0,%eax
L722:
  mov    0x98(%rsp),%rdx
  movl   $0x0,(%rdx,%rax,4)
  add    $0x1,%rax
  cmp    %eax,0x2c(%rsp)
  jg     L722
  cmpl   $0x0,0x24(%rsp)
  jle    L387
L533:
  mov    $0x0,%eax
L613:
  movslq 0x0(%rbp,%rax,4),%rcx
  mov    0x98(%rsp),%rdx
  movl   $0x1,(%rdx,%rcx,4)
  add    $0x1,%rax
  cmp    %eax,0x24(%rsp)
  jg     L613
L387:
  cmpl   $0x0,0x2c(%rsp)
  jle    L124
  mov    $0x0,%eax
  mov    $0x0,%ecx
  jmp    L529
L404:
  add    $0x1,%rax
  cmp    %eax,0x2c(%rsp)
  jle    L124
L529:
  mov    0x98(%rsp),%rdx
  cmpl   $0x0,(%rdx,%rax,4)
  jne    L404
  movslq %ecx,%rsi
  mov    0xa0(%rsp),%rdx
  mov    %eax,(%rdx,%rsi,4)
  lea    0x1(%rcx),%ecx
  jmp    L404
L124:
  cmpl   $0x0,0x38(%rsp)
  jle    L395
L112:
  mov    $0x0,%r8d
  jmp    L768
L110:
  mov    0xa0(%rsp),%rdx
  movslq (%rdx,%rdi,1),%rcx
  mov    (%rbx,%rax,8),%rdx
  movsd  (%rdx,%rcx,8),%xmm0
  mov    0x70(%rsp),%rdx
  mov    (%rdx,%rsi,1),%rdx
  movsd  %xmm0,(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %eax,0x28(%rsp)
  jg     L110
L579:
  add    $0x1,%r8
  cmp    %r8d,0x38(%rsp)
  jle    L395
L768:
  lea    0x0(,%r8,4),%rdi
  lea    0x0(,%r8,8),%rsi
  mov    $0x0,%eax
  cmpl   $0x0,0x28(%rsp)
  jg     L110
  jmp    L579
L395:
  cmpl   $0x0,0x24(%rsp)
  jle    L180
  mov    %rbp,%rsi
  mov    $0x0,%r8d
  jmp    L546
L727:
  movslq (%rsi),%rcx
  mov    (%rbx,%rax,8),%rdx
  movsd  (%rdx,%rcx,8),%xmm0
  mov    0x78(%rsp),%rdx
  mov    (%rdx,%rdi,1),%rdx
  movsd  %xmm0,(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %eax,0x28(%rsp)
  jg     L727
L47:
  add    $0x1,%r8
  add    $0x4,%rsi
  cmp    %r8d,0x24(%rsp)
  jle    L180
L546:
  lea    0x0(,%r8,8),%rdi
  mov    $0x0,%eax
  cmpl   $0x0,0x28(%rsp)
  jg     L727
  jmp    L47
L0:
  mov    0x80(%rsp),%rcx
  mov    (%rcx,%rsi,1),%rcx
  movsd  %xmm0,(%rcx,%rdx,1)
  add    $0x1,%eax
  add    $0x8,%rdx
  cmp    %eax,0x24(%rsp)
  jle    L169
L417:
  movapd %xmm1,%xmm0
  cmp    %eax,%edi
  jg     L0
  mov    0x78(%rsp),%rcx
  mov    (%rcx,%rdx,1),%rcx
  movsd  (%rcx,%rsi,1),%xmm0
  jmp    L0
L169:
  add    $0x1,%edi
  add    $0x8,%rsi
  cmp    %edi,0x24(%rsp)
  jle    L203
L498:
  mov    $0x0,%edx
  mov    $0x0,%eax
  cmpl   $0x0,0x24(%rsp)
  jg     L417
  jmp    L169
L625:
  mov    %eax,%edx
  add    0x24(%rsp),%edx
  movslq %edx,%rdx
  mov    0x88(%rsp),%rsi
  mov    (%rsi,%rdx,8),%rdx
  movsd  (%rdx,%rcx,1),%xmm0
  mov    0x70(%rsp),%rdx
  mov    (%rdx,%rax,8),%rdx
  movsd  %xmm0,(%rdx,%rcx,1)
  add    $0x1,%rax
  cmp    %eax,0x3c(%rsp)
  jg     L625
L661:
  mov    0x38(%rsp),%eax
  add    $0x1,%rdi
  cmp    %edi,%eax
  jle    L305
L165:
  lea    0x0(,%rdi,8),%rcx
  mov    $0x0,%eax
  cmpl   $0x0,0x3c(%rsp)
  jg     L625
  jmp    L661
L305:
  test   %eax,%eax
  jle    L505
  mov    $0x0,%ecx
  movsd  D54(%rip),%xmm1
  pxor   %xmm2,%xmm2
  jmp    L543
L561:
  mov    0x90(%rsp),%rdx
  mov    (%rdx,%rsi,1),%rdx
  movsd  %xmm0,(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %eax,0x38(%rsp)
  jle    L44
L207:
  movapd %xmm1,%xmm0
  cmp    %eax,%ecx
  je     L561
  movapd %xmm2,%xmm0
  jmp    L561
L44:
  add    $0x1,%rcx
  cmp    %ecx,0x38(%rsp)
  jle    L505
L543:
  lea    0x0(,%rcx,8),%rsi
  mov    $0x0,%eax
  cmpl   $0x0,0x38(%rsp)
  jg     L207
  jmp    L44
L85:
  mov    0x70(%rsp),%rdx
  mov    (%rdx,%rax,8),%rdx
  movsd  (%rdx,%rdi,1),%xmm0
  mov    0xa0(%rsp),%rdx
  movslq (%rdx,%rax,4),%rcx
  mov    (%rbx),%rdx
  movsd  %xmm0,(%rdx,%rcx,8)
  add    $0x1,%rax
  cmp    %eax,0x38(%rsp)
  jg     L85
L708:
  mov    0x28(%rsp),%eax
  add    $0x1,%r8
  add    $0x8,%rbx
  cmp    %r8d,%eax
  jle    L794
L438:
  lea    0x0(,%r8,8),%rdi
  mov    $0x0,%eax
  cmpl   $0x0,0x38(%rsp)
  jg     L85
  jmp    L708
L794:
  test   %eax,%eax
  jle    L560
  mov    $0x0,%r8d
  jmp    L632
L227:
  mov    %eax,%edx
  add    0x38(%rsp),%edx
  movslq %edx,%rdx
  mov    0x70(%rsp),%rcx
  mov    (%rcx,%rdx,8),%rdx
  movsd  (%rdx,%rdi,1),%xmm0
  movslq 0x0(%rbp,%rax,4),%rcx
  mov    (%rsi),%rdx
  movsd  %xmm0,(%rdx,%rcx,8)
  add    $0x1,%rax
  cmp    %eax,0x24(%rsp)
  jg     L227
L337:
  add    $0x1,%r8
  add    $0x8,%rsi
  cmp    %r8d,0x28(%rsp)
  jle    L560
L632:
  lea    0x0(,%r8,8),%rdi
  mov    $0x0,%eax
  cmpl   $0x0,0x24(%rsp)
  jg     L227
  jmp    L337
L560:
  mov    0x58(%rsp),%rdi
  mov    $0x0,%eax
  call   <free_vector@plt>
  mov    0x60(%rsp),%rdi
  mov    $0x0,%eax
  call   <free_vector@plt>
  mov    0x68(%rsp),%rdi
  mov    $0x0,%eax
  call   <free_vector@plt>
  mov    0x98(%rsp),%rdi
  mov    $0x0,%eax
  call   <free_vector@plt>
  mov    0xa0(%rsp),%rdi
  mov    $0x0,%eax
  call   <free_vector@plt>
  mov    0x70(%rsp),%rdi
  mov    $0x0,%eax
  call   <free_matrix@plt>
  mov    0x78(%rsp),%rdi
  mov    $0x0,%eax
  call   <free_matrix@plt>
  mov    0x80(%rsp),%rdi
  mov    $0x0,%eax
  call   <free_matrix@plt>
  mov    0x88(%rsp),%rdi
  mov    $0x0,%eax
  call   <free_matrix@plt>
  mov    0x90(%rsp),%rdi
  mov    $0x0,%eax
  call   <free_matrix@plt>
  mov    $0x1,%eax
L241:
  mov    0xa8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L741
  add    $0xb8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L127:
  mov    $0xfffffffe,%eax
  jmp    L241
L60:
  mov    $0xfffffffe,%eax
  jmp    L241
L309:
  mov    $0xffffffff,%eax
  jmp    L241
L459:
  mov    $0xffffffff,%eax
  jmp    L241
L670:
  mov    $0xffffffff,%eax
  jmp    L241
L151:
  mov    $0xffffffff,%eax
  jmp    L241
L134:
  mov    $0xffffffff,%eax
  jmp    L241
L261:
  mov    $0xffffffff,%eax
  jmp    L241
L51:
  mov    $0xffffffff,%eax
  jmp    L241
L191:
  mov    $0xffffffff,%eax
  jmp    L241
L559:
  mov    $0xffffffff,%eax
  jmp    L241
L201:
  mov    $0xffffffff,%eax
  jmp    L241
L629:
  cmpl   $0x0,0x24(%rsp)
  jg     L533
  cmpl   $0x0,0x38(%rsp)
  jg     L112
L180:
  lea    0x28(%rsp),%rdi
  lea    0x24(%rsp),%rsi
  lea    0x40(%rsp),%rax
  push   %rax
  lea    0x4c(%rsp),%rax
  push   %rax
  mov    0x68(%rsp),%r9
  mov    0x78(%rsp),%r8
  mov    %rdi,%rcx
  mov    0x88(%rsp),%rax
  mov    (%rax),%rdx
  mov    $0x0,%eax
  call   <dgeqrf_@plt>
  add    $0x10,%rsp
  mov    $0x0,%esi
  mov    $0x0,%edi
  pxor   %xmm1,%xmm1
  cmpl   $0x0,0x24(%rsp)
  jg     L498
L203:
  lea    0x28(%rsp),%r13
  lea    0x24(%rsp),%r12
  sub    $0x8,%rsp
  lea    0x48(%rsp),%r14
  push   %r14
  lea    0x54(%rsp),%r15
  push   %r15
  push   0x70(%rsp)
  mov    0x88(%rsp),%r9
  mov    %r13,%r8
  mov    0x98(%rsp),%rax
  mov    (%rax),%rcx
  mov    %r12,%rdx
  mov    %r13,%rsi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <dorgqr_@plt>
  movb   $0x54,0x56(%rsp)
  movb   $0x4e,0x57(%rsp)
  mov    D54(%rip),%rax
  mov    %rax,0x68(%rsp)
  movq   $0x0,0x70(%rsp)
  add    $0x20,%rsp
  lea    0x38(%rsp),%rdx
  lea    0x37(%rsp),%rsi
  lea    0x36(%rsp),%rdi
  sub    $0x8,%rsp
  push   %rdx
  mov    0x98(%rsp),%rax
  push   (%rax)
  lea    0x68(%rsp),%rax
  push   %rax
  push   %r13
  mov    0xa0(%rsp),%rax
  push   (%rax)
  lea    0x5c(%rsp),%rax
  push   %rax
  mov    0xa8(%rsp),%rax
  push   (%rax)
  lea    0x88(%rsp),%r9
  mov    %r13,%r8
  mov    %r13,%rcx
  mov    $0x0,%eax
  call   <dgemm_@plt>
  add    $0x40,%rsp
  mov    %r14,%r9
  mov    0x60(%rsp),%r8
  mov    %r12,%rcx
  mov    0x80(%rsp),%rax
  mov    (%rax),%rdx
  mov    %r12,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <dgetrf_@plt>
  sub    $0x8,%rsp
  push   %r14
  mov    %r15,%r9
  mov    0x68(%rsp),%r8
  mov    0x70(%rsp),%rcx
  mov    %r12,%rdx
  mov    0x90(%rsp),%rax
  mov    (%rax),%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <dgetri_@plt>
  add    $0x10,%rsp
  mov    $0x0,%edi
  cmpl   $0x0,0x38(%rsp)
  jg     L165
L505:
  movb   $0x4e,0x36(%rsp)
  lea    0x2c(%rsp),%r15
  lea    0x38(%rsp),%r12
  lea    0x3c(%rsp),%r14
  lea    0x36(%rsp),%rdi
  sub    $0x8,%rsp
  lea    0x48(%rsp),%rax
  push   %rax
  lea    0x54(%rsp),%rax
  push   %rax
  push   0x70(%rsp)
  push   %r12
  mov    0xb8(%rsp),%rax
  push   (%rax)
  mov    %r15,%r9
  mov    0xa0(%rsp),%rax
  mov    (%rax),%r8
  mov    %r12,%rcx
  mov    %r14,%rdx
  mov    %r12,%rsi
  mov    %rdi,0x38(%rsp)
  mov    $0x0,%eax
  call   <dgels_@plt>
  movb   $0x4e,0x67(%rsp)
  movb   $0x4e,0x66(%rsp)
  mov    D54(%rip),%rax
  mov    %rax,0x78(%rsp)
  movq   $0x0,0x80(%rsp)
  add    $0x30,%rsp
  lea    0x48(%rsp),%rsi
  lea    0x28(%rsp),%r13
  lea    0x37(%rsp),%r10
  sub    $0x8,%rsp
  push   %r15
  mov    0x80(%rsp),%rax
  push   (%rax)
  lea    0x68(%rsp),%rax
  mov    %rax,0x18(%rsp)
  push   %rax
  push   %r12
  mov    0xb8(%rsp),%rax
  push   (%rax)
  push   %r13
  movslq 0x5c(%rsp),%rdx
  mov    0xb0(%rsp),%rax
  push   (%rax,%rdx,8)
  mov    %rsi,0x50(%rsp)
  mov    %rsi,%r9
  mov    %r14,%r8
  mov    %r12,%rcx
  mov    %r13,%rdx
  mov    %r10,0x58(%rsp)
  mov    %r10,%rsi
  mov    0x48(%rsp),%rdi
  mov    $0x0,%eax
  call   <dgemm_@plt>
  mov    D31(%rip),%rcx
  mov    %rcx,0x88(%rsp)
  mov    D54(%rip),%rcx
  mov    %rcx,0x90(%rsp)
  add    $0x40,%rsp
  lea    0x24(%rsp),%r14
  sub    $0x8,%rsp
  push   %r13
  mov    0x88(%rsp),%rax
  push   (%rax)
  push   0x18(%rsp)
  push   %r12
  mov    0xb0(%rsp),%rax
  push   (%rax)
  push   %r15
  mov    0xa8(%rsp),%rax
  push   (%rax)
  mov    0x50(%rsp),%r9
  mov    %r12,%r8
  mov    %r14,%rcx
  mov    %r13,%rdx
  mov    0x58(%rsp),%rsi
  mov    0x48(%rsp),%r12
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <dgemm_@plt>
  mov    D54(%rip),%rdi
  mov    %rdi,0x88(%rsp)
  movq   $0x0,0x90(%rsp)
  add    $0x38,%rsp
  push   %r15
  movslq 0x48(%rsp),%rdx
  mov    0x80(%rsp),%rax
  push   (%rax,%rdx,8)
  push   0x18(%rsp)
  push   %r14
  mov    0xa8(%rsp),%rax
  push   (%rax)
  push   %r13
  mov    0xb0(%rsp),%rax
  push   (%rax)
  mov    0x50(%rsp),%r9
  mov    %r14,%r8
  mov    %r14,%rcx
  mov    %r13,%rdx
  mov    0x58(%rsp),%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <dgemm_@plt>
  add    $0x40,%rsp
  cmpl   $0x0,0x28(%rsp)
  jle    L560
  mov    %rbx,%rsi
  mov    $0x0,%r8d
  jmp    L438
L741:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D54
datatype: f64
name: extract_symbolic_data
arguments: label: D31
datatype: f32[2]

tool: D54: 1

tool: {"D31": [0.0,-1.875]}

assistant: ```c
int constrained_least_squares(int m, int n, double **matrix, int c, int *constrained) {
  if (m < 1 || n < 1 || n > m || c > n)
    return -2;
  int i, j;
  int f = m - c, u = n - c;
  char transa, transb;
  double alpha, beta;
  int info;
  int lwork = m * m;
  double *work;
  if (!allocate_double_vector(&work, lwork)) {
    return -1;
  }
  int *ipiv;
  if (!allocate_integer_vector(&ipiv, c)) {
    return -1;
  }
  double *tau;
  if (!allocate_double_vector(&tau, c)) {
    return -1;
  }
  double **t_matrix;
  if (!allocate_double_matrix(&t_matrix, m, m)) {
    return -1;
  }
  double **c_matrix;
  if (!allocate_double_matrix(&c_matrix, n, n)) {
    return -1;
  }
  double **r_matrix;
  if (!allocate_double_matrix(&r_matrix, c, c)) {
    return -1;
  }
  double **a_matrix;
  if (!allocate_double_matrix(&a_matrix, n, f)) {
    return -1;
  }
  double **d_matrix;
  if (!allocate_double_matrix(&d_matrix, f, f)) {
    return -1;
  }
  int *temp, *unconstrained;
  if (!allocate_integer_vector(&temp, m)) {
    return -1;
  }
  if (!allocate_integer_vector(&unconstrained, f)) {
    return -1;
  }
  for (i = 0; i < m; i++)
    temp[i] = 0;
  for (i = 0; i < c; i++)
    temp[constrained[i]] = 1;
  j = 0;
  for (i = 0; i < m; i++)
    if (!temp[i])
      unconstrained[j++] = i;
  for (i = 0; i < f; i++)
    for (j = 0; j < n; j++)
      t_matrix[i][j] = matrix[j][unconstrained[i]];
  for (i = 0; i < c; i++)
    for (j = 0; j < n; j++)
      c_matrix[i][j] = matrix[j][constrained[i]];
  dgeqrf_(&n, &c, c_matrix[0], &n, tau, work, &lwork, &info);
  for (i = 0; i < c; i++)
    for (j = 0; j < c; j++)
      r_matrix[i][j] = ((j >= i) ? c_matrix[j][i] : 0);
  dorgqr_(&n, &n, &c, c_matrix[0], &n, tau, work, &lwork, &info);
  transa = 'T';
  transb = 'N';
  alpha = 1.0;
  beta = 0.0;
  dgemm_(&transa, &transb, &f, &n, &n, &alpha, t_matrix[0], &m, c_matrix[0], &n, &beta, a_matrix[0], &f);
  dgetrf_(&c, &c, r_matrix[0], &c, ipiv, &info);
  dgetri_(&c, r_matrix[0], &c, ipiv, work, &lwork, &info);
  for (i = 0; i < f; i++)
    for (j = 0; j < u; j++)
      t_matrix[j][i] = a_matrix[j + c][i];
  for (i = 0; i < f; i++)
    for (j = 0; j < f; j++)
      d_matrix[i][j] = (i == j);
  transa = 'N';
  dgels_(&transa, &f, &u, &f, t_matrix[0], &m, d_matrix[0], &f, work, &lwork, &info);
  transa = transb = 'N';
  alpha = 1.0;
  beta = 0.0;
  dgemm_(&transa, &transb, &n, &f, &u, &alpha, c_matrix[c], &n, d_matrix[0], &f, &beta, t_matrix[0], &m);
  alpha = -1.0;
  beta = 1.0;
  dgemm_(&transa, &transb, &n, &c, &f, &alpha, t_matrix[0], &m, a_matrix[0], &f, &beta, c_matrix[0], &n);
  alpha = 1.0;
  beta = 0.0;
  dgemm_(&transa, &transb, &n, &c, &c, &alpha, c_matrix[0], &n, r_matrix[0], &c, &beta, t_matrix[f], &m);
  for (i = 0; i < n; i++)
    for (j = 0; j < f; j++)
      matrix[i][unconstrained[j]] = t_matrix[j][i];
  for (i = 0; i < n; i++)
    for (j = 0; j < c; j++)
      matrix[i][constrained[j]] = t_matrix[j + f][i];
  free_vector(work);
  free_vector(ipiv);
  free_vector(tau);
  free_vector(temp);
  free_vector(unconstrained);
  free_matrix((void **)t_matrix);
  free_matrix((void **)c_matrix);
  free_matrix((void **)r_matrix);
  free_matrix((void **)a_matrix);
  free_matrix((void **)d_matrix);
  return 1;
}
```