user: Converte this assembly snippet into its equivalent C code:

```asm
<bidiag_orth>:
  endbr64
  push   %r15
  mov    %edx,%r11d
  push   %r14
  push   %r13
  mov    %r8,%r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  sub    $0xc8,%rsp
  mov    %rdi,0x40(%rsp)
  mov    %rcx,0x68(%rsp)
  cmp    %edx,%esi
  jl     L2
L20:
  lea    0x0(,%rbp,8),%r12d
  mov    %r11d,0xc(%rsp)
  movslq %ebp,%rbx
  mov    %r12d,%edi
  call   <malloc@plt>
  mov    %r12d,%edi
  mov    %ebp,%r12d
  imul   %ebp,%r12d
  mov    %rax,0x58(%rsp)
  mov    %rax,%r14
  call   <malloc@plt>
  mov    %rax,0x18(%rsp)
  shl    $0x3,%r12d
  mov    %r12d,%edi
  call   <malloc@plt>
  mov    %r12d,%edi
  mov    %rax,0x10(%rsp)
  call   <malloc@plt>
  mov    0x68(%rsp),%rdi
  mov    %ebp,%esi
  mov    %rax,0x20(%rsp)
  call   <eye@plt>
  mov    0xc(%rsp),%esi
  mov    %r13,%rdi
  call   <eye@plt>
  mov    0xc(%rsp),%r11d
  test   %r11d,%r11d
  jle    L366
  lea    -0x2(%r11),%edi
  lea    -0x1(%rbp),%eax
  xor    %r10d,%r10d
  movq   $0x0,0x38(%rsp)
  mov    %edi,0x9c(%rsp)
  lea    0x0(,%rbx,8),%r15
  movslq %r11d,%rbx
  mov    %edi,0x30(%rsp)
  mov    %ebp,%edi
  lea    0x0(,%rbx,8),%r12
  sub    %r11d,%edi
  mov    %eax,0x34(%rsp)
  lea    -0x1(%r11),%eax
  mov    %eax,0xb0(%rsp)
  lea    0x2(%rdi),%eax
  mov    %eax,0xa4(%rsp)
  lea    0x8(%r14),%rax
  mov    %r15,0xa8(%rsp)
  mov    %edi,0xa0(%rsp)
  movl   $0x0,0x64(%rsp)
  movl   $0x0,0x60(%rsp)
  mov    %rax,0x90(%rsp)
  mov    %rbx,0xb8(%rsp)
  mov    %r11d,%ebx
  mov    %ebp,%r11d
  mov    %r10,%rbp
  nopw   0x0(%rax,%rax,1)
L292:
  mov    0x30(%rsp),%edi
  mov    0xa4(%rsp),%eax
  mov    %ebp,0x28(%rsp)
  mov    %ebp,0x48(%rsp)
  add    %edi,%eax
  lea    0x2(%rdi),%ecx
  mov    %eax,0xc(%rsp)
  cmp    %ebp,%r11d
  jle    L270
  movslq 0x60(%rsp),%r13
  mov    0x40(%rsp),%rdi
  mov    0x34(%rsp),%esi
  lea    0x0(%r13,%rbp,1),%rax
  lea    (%rdi,%rax,8),%rdx
  mov    0x90(%rsp),%rdi
  mov    0x58(%rsp),%rax
  lea    (%rdi,%rsi,8),%rsi
  nopl   (%rax)
L305:
  movsd  (%rdx),%xmm0
  add    $0x8,%rax
  add    %r12,%rdx
  movsd  %xmm0,-0x8(%rax)
  cmp    %rsi,%rax
  jne    L305
  mov    0xc(%rsp),%esi
  mov    0x58(%rsp),%rdi
  mov    %r11d,0x74(%rsp)
  mov    0x18(%rsp),%rdx
  mov    %ecx,0x70(%rsp)
  call   <house@plt>
  mov    0x40(%rsp),%rax
  mov    0x10(%rsp),%rdi
  mov    0x28(%rsp),%r10d
  mov    0x70(%rsp),%ecx
  movsd  %xmm0,0x50(%rsp)
  lea    (%rax,%r13,8),%r13
  mov    0x74(%rsp),%r11d
  mov    %rdi,%r14
  mov    %r13,%rsi
  nopl   0x0(%rax)
L112:
  mov    %rdi,%rdx
  mov    %rbp,%rax
  xchg   %ax,%ax
L55:
  movsd  (%rsi,%rax,8),%xmm0
  add    $0x1,%rax
  movsd  %xmm0,(%rdx)
  add    %r15,%rdx
  cmp    %eax,%ebx
  jg     L55
  lea    0x1(%r10),%eax
  add    $0x8,%rdi
  add    %r12,%rsi
  cmp    %eax,%r11d
  je     L378
  mov    %eax,%r10d
  jmp    L112
  nopl   0x0(%rax)
L378:
  mov    0xc(%rsp),%r8d
  mov    0x20(%rsp),%rdx
  mov    %r11d,0x78(%rsp)
  mov    $0x1,%r9d
  mov    0x18(%rsp),%rsi
  mov    0x10(%rsp),%rdi
  mov    %r10d,0x74(%rsp)
  mov    %ecx,0x70(%rsp)
  call   <mmult@plt>
  movsd  0x50(%rsp),%xmm0
  mov    0x70(%rsp),%esi
  mov    $0x1,%edx
  mov    0x20(%rsp),%rdi
  call   <scale@plt>
  mov    0xc(%rsp),%ecx
  mov    0x20(%rsp),%rsi
  mov    $0x1,%r8d
  mov    0x70(%rsp),%r9d
  mov    0x10(%rsp),%rdx
  mov    0x18(%rsp),%rdi
  call   <mmult@plt>
  mov    0x28(%rsp),%ecx
  mov    0x74(%rsp),%r10d
  mov    %r12,%rsi
  mov    0x78(%rsp),%r11d
  sub    0x38(%rsp),%rsi
  nop
L334:
  mov    %r14,%rdx
  mov    %rbp,%rax
  cs nopw 0x0(%rax,%rax,1)
L202:
  movsd  0x0(%r13,%rax,8),%xmm0
  subsd  (%rdx),%xmm0
  add    $0x8,%rdx
  movsd  %xmm0,0x0(%r13,%rax,8)
  add    $0x1,%rax
  cmp    %eax,%ebx
  jg     L202
  lea    0x1(%rcx),%eax
  add    %rsi,%r14
  add    %r12,%r13
  cmp    %ecx,%r10d
  je     L354
  mov    %eax,%ecx
  jmp    L334
L270:
  mov    0xc(%rsp),%r14d
  mov    0x18(%rsp),%r13
  mov    %r11d,0x74(%rsp)
  mov    0x58(%rsp),%rdi
  mov    %ecx,0x70(%rsp)
  mov    %r14d,%esi
  mov    %r13,%rdx
  call   <house@plt>
  mov    %r14d,%r8d
  mov    %r14d,0xc(%rsp)
  mov    %r13,%rsi
  mov    0x20(%rsp),%r14
  mov    0x70(%rsp),%ecx
  mov    $0x1,%r9d
  movsd  %xmm0,0x50(%rsp)
  mov    0x10(%rsp),%rdi
  mov    %r14,%rdx
  call   <mmult@plt>
  movsd  0x50(%rsp),%xmm0
  mov    0x70(%rsp),%esi
  mov    %r14,%rdi
  mov    $0x1,%edx
  call   <scale@plt>
  mov    0x70(%rsp),%r9d
  mov    %r14,%rsi
  mov    %r13,%rdi
  mov    0xc(%rsp),%ecx
  mov    0x10(%rsp),%rdx
  mov    $0x1,%r8d
  call   <mmult@plt>
  mov    0x74(%rsp),%r11d
  nop
L354:
  mov    0xb0(%rsp),%r10d
  sub    0x30(%rsp),%r10d
  cmp    %r10d,%r11d
  jle    L288
  mov    0x60(%rsp),%esi
  mov    0x18(%rsp),%rdi
  add    %ebx,%esi
  lea    0x8(%rdi),%rax
  movslq %esi,%rdx
  mov    %esi,0x70(%rsp)
  mov    0x40(%rsp),%rsi
  add    %rbp,%rdx
  lea    (%rsi,%rdx,8),%rdx
  mov    0x34(%rsp),%esi
  lea    -0x1(%rsi),%ecx
  mov    %ecx,0x74(%rsp)
  lea    0x10(%rdi,%rcx,8),%rcx
  nopl   0x0(%rax,%rax,1)
L206:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  movsd  %xmm0,(%rdx)
  add    %r12,%rdx
  cmp    %rcx,%rax
  jne    L206
L171:
  cmp    0x48(%rsp),%r11d
  jle    L227
  movslq 0x64(%rsp),%r14
  mov    0x68(%rsp),%rdi
  mov    0x28(%rsp),%r13d
  mov    0x38(%rsp),%r8
  lea    (%r14,%rbp,1),%rax
  lea    (%rdi,%rax,8),%rdx
  mov    0x34(%rsp),%edi
  mov    0x10(%rsp),%rax
  mov    %rdi,0x78(%rsp)
  shl    $0x3,%rdi
  sub    %rax,%rdx
  mov    %rax,%rsi
  mov    %rdi,0x80(%rsp)
  lea    0x8(%rax,%rdi,1),%rcx
L189:
  mov    %rsi,%rax
  nopl   0x0(%rax,%rax,1)
L27:
  movsd  (%rdx,%rax,1),%xmm0
  add    $0x8,%rax
  movsd  %xmm0,-0x8(%rax)
  cmp    %rcx,%rax
  jne    L27
  lea    0x1(%r13),%edi
  add    %r15,%rsi
  lea    (%rax,%r15,1),%rcx
  add    %r8,%rdx
  cmp    %edi,%r11d
  je     L90
  mov    %edi,%r13d
  jmp    L189
  nopl   0x0(%rax,%rax,1)
L90:
  mov    0xc(%rsp),%r8d
  mov    0x20(%rsp),%rdx
  mov    $0x1,%r9d
  mov    %r11d,0x98(%rsp)
  mov    0x18(%rsp),%rsi
  mov    0x10(%rsp),%rdi
  mov    %r10d,0x88(%rsp)
  mov    %r8d,%ecx
  call   <mmult@plt>
  movsd  0x50(%rsp),%xmm0
  mov    0xc(%rsp),%esi
  mov    $0x1,%edx
  mov    0x20(%rsp),%rdi
  call   <scale@plt>
  mov    0xc(%rsp),%ecx
  mov    0x10(%rsp),%rdx
  mov    $0x1,%r8d
  mov    0x18(%rsp),%rsi
  mov    0x20(%rsp),%rdi
  mov    %ecx,%r9d
  call   <mmult@plt>
  mov    0x68(%rsp),%rdi
  mov    0x10(%rsp),%rcx
  lea    0x0(,%r14,8),%rax
  mov    0x38(%rsp),%r9
  mov    0x28(%rsp),%esi
  sub    %rdi,%rcx
  mov    0xa8(%rsp),%r8
  mov    0x88(%rsp),%r10d
  sub    %r9,%rcx
  mov    0x98(%rsp),%r11d
  sub    %rax,%rcx
  mov    0x78(%rsp),%rax
  add    %r14,%rax
  add    %rbp,%rax
  lea    0x8(%rdi,%rax,8),%rdx
  mov    $0xfffffffffffffff8,%rdi
  sub    0x80(%rsp),%rdi
  nop
L369:
  lea    (%rdi,%rdx,1),%rax
  nopl   0x0(%rax)
L40:
  movsd  (%rax),%xmm0
  subsd  (%rax,%rcx,1),%xmm0
  add    $0x8,%rax
  movsd  %xmm0,-0x8(%rax)
  cmp    %rdx,%rax
  jne    L40
  lea    0x1(%rsi),%eax
  sub    %r9,%rcx
  add    %r8,%rdx
  cmp    %r13d,%esi
  je     L145
  mov    %eax,%esi
  jmp    L369
L227:
  mov    0xc(%rsp),%r14d
  mov    0x20(%rsp),%r13
  mov    %r10d,0x78(%rsp)
  mov    $0x1,%r9d
  mov    0x18(%rsp),%rsi
  mov    0x10(%rsp),%rdi
  mov    %r11d,0x80(%rsp)
  mov    %r14d,%r8d
  mov    %r14d,%ecx
  mov    %r13,%rdx
  call   <mmult@plt>
  mov    $0x1,%edx
  mov    %r14d,%esi
  mov    %r13,%rdi
  movsd  0x50(%rsp),%xmm0
  call   <scale@plt>
  mov    0x10(%rsp),%rdx
  mov    %r14d,%r9d
  mov    %r14d,%ecx
  mov    0x18(%rsp),%rsi
  mov    $0x1,%r8d
  mov    %r13,%rdi
  call   <mmult@plt>
  mov    0x78(%rsp),%r10d
  mov    0x80(%rsp),%r11d
  nopl   0x0(%rax,%rax,1)
L145:
  mov    0x48(%rsp),%edi
  cmp    %edi,0x9c(%rsp)
  jg     L123
L225:
  mov    0x30(%rsp),%eax
  lea    -0x1(%rax),%esi
L330:
  mov    0x70(%rsp),%eax
  mov    %esi,0x30(%rsp)
  add    $0x1,%rbp
  sub    $0x8,%r15
  add    %r11d,0x64(%rsp)
  mov    0xa0(%rsp),%edi
  addq   $0x8,0x38(%rsp)
  mov    %eax,0x60(%rsp)
  cmp    %edi,0x34(%rsp)
  je     L366
  mov    0x74(%rsp),%eax
  mov    %eax,0x34(%rsp)
  jmp    L292
L123:
  cmp    %r10d,%ebx
  jle    L85
  mov    0x30(%rsp),%edx
  mov    0x90(%rsp),%rsi
  mov    0x58(%rsp),%rdi
  lea    (%rsi,%rdx,8),%rcx
  movslq 0x60(%rsp),%rdx
  mov    0x40(%rsp),%rsi
  mov    %rdi,%rax
  add    %rbp,%rdx
  lea    (%rsi,%rdx,8),%rdx
  sub    %rdi,%rdx
  nopw   0x0(%rax,%rax,1)
L168:
  movsd  0x8(%rdx,%rax,1),%xmm0
  add    $0x8,%rax
  movsd  %xmm0,-0x8(%rax)
  cmp    %rax,%rcx
  jne    L168
L85:
  mov    0x30(%rsp),%eax
  mov    0x18(%rsp),%rdx
  mov    %r11d,0x78(%rsp)
  mov    0x58(%rsp),%rdi
  mov    %r10d,0x50(%rsp)
  lea    0x1(%rax),%r14d
  mov    %r14d,%esi
  call   <house@plt>
  mov    0x78(%rsp),%r11d
  cmp    0x48(%rsp),%r11d
  mov    0x50(%rsp),%r10d
  jle    L372
  movslq %r14d,%rax
  mov    0x40(%rsp),%rsi
  mov    %r12,%r9
  mov    0x28(%rsp),%r13d
  lea    0x0(,%rax,8),%rdi
  mov    %rax,0x80(%rsp)
  movslq 0x60(%rsp),%rax
  sub    %rdi,%r9
  mov    %rax,0x78(%rsp)
  add    %rbp,%rax
  lea    (%rsi,%rax,8),%rdx
  mov    0x30(%rsp),%esi
  mov    0x10(%rsp),%rax
  mov    %rsi,0x50(%rsp)
  shl    $0x3,%rsi
  sub    %rax,%rdx
  mov    %rsi,0x48(%rsp)
  lea    0x8(%rax,%rsi,1),%rcx
  mov    %rax,%rsi
  nopl   0x0(%rax,%rax,1)
L230:
  mov    %rsi,%rax
  cmp    %r10d,%ebx
  jle    L160
  nopl   0x0(%rax,%rax,1)
L335:
  movsd  0x8(%rdx,%rax,1),%xmm1
  add    $0x8,%rax
  movsd  %xmm1,-0x8(%rax)
  cmp    %rax,%rcx
  jne    L335
L160:
  lea    0x1(%r13),%eax
  add    %rdi,%rsi
  add    %r9,%rdx
  add    %rdi,%rcx
  cmp    %eax,%r11d
  je     L0
  mov    %eax,%r13d
  jmp    L230
L0:
  mov    0xc(%rsp),%ecx
  mov    0x20(%rsp),%rdx
  mov    %r14d,%r8d
  mov    $0x1,%r9d
  mov    0x18(%rsp),%rsi
  mov    0x10(%rsp),%rdi
  mov    %r11d,0xb4(%rsp)
  mov    %r10d,0x98(%rsp)
  movsd  %xmm0,0x88(%rsp)
  call   <mmult@plt>
  mov    0xc(%rsp),%esi
  mov    0x20(%rsp),%rdi
  mov    $0x1,%edx
  movsd  0x88(%rsp),%xmm0
  call   <scale@plt>
  mov    %r14d,%r9d
  mov    0x10(%rsp),%r14
  mov    0xc(%rsp),%ecx
  mov    0x18(%rsp),%rsi
  mov    0x20(%rsp),%rdi
  mov    $0x1,%r8d
  mov    %r14,%rdx
  call   <mmult@plt>
  mov    0x78(%rsp),%rdi
  mov    0x40(%rsp),%rdx
  mov    %r14,%rcx
  mov    0x80(%rsp),%rax
  sub    0xb8(%rsp),%rax
  sub    %rdx,%rcx
  lea    0x0(,%rax,8),%rsi
  sub    0x38(%rsp),%rcx
  mov    0x28(%rsp),%r8d
  lea    0x0(,%rdi,8),%rax
  mov    0x98(%rsp),%r10d
  mov    0xb4(%rsp),%r11d
  sub    %rax,%rcx
  mov    0x50(%rsp),%rax
  add    %rdi,%rax
  mov    $0xfffffffffffffff8,%rdi
  sub    0x48(%rsp),%rdi
  add    %rbp,%rax
  lea    0x10(%rdx,%rax,8),%rdx
  xchg   %ax,%ax
L249:
  lea    (%rdi,%rdx,1),%rax
  cmp    %r10d,%ebx
  jle    L132
  nopl   0x0(%rax)
L42:
  movsd  (%rax),%xmm0
  subsd  -0x8(%rcx,%rax,1),%xmm0
  add    $0x8,%rax
  movsd  %xmm0,-0x8(%rax)
  cmp    %rax,%rdx
  jne    L42
L132:
  lea    0x1(%r8),%eax
  add    %rsi,%rcx
  add    %r12,%rdx
  cmp    %r13d,%r8d
  je     L53
  mov    %eax,%r8d
  jmp    L249
L372:
  mov    0x20(%rsp),%r13
  mov    0xc(%rsp),%ecx
  mov    %r14d,%r8d
  mov    $0x1,%r9d
  mov    0x18(%rsp),%rsi
  mov    0x10(%rsp),%rdi
  mov    %r11d,0x48(%rsp)
  mov    %r13,%rdx
  movsd  %xmm0,0x28(%rsp)
  call   <mmult@plt>
  movsd  0x28(%rsp),%xmm0
  mov    0xc(%rsp),%esi
  mov    %r13,%rdi
  mov    $0x1,%edx
  call   <scale@plt>
  mov    0xc(%rsp),%ecx
  mov    %r14d,%r9d
  mov    %r13,%rdi
  mov    0x10(%rsp),%rdx
  mov    0x18(%rsp),%rsi
  mov    $0x1,%r8d
  call   <mmult@plt>
  mov    0x48(%rsp),%r11d
L53:
  mov    %ebx,%eax
  sub    0x30(%rsp),%eax
  cmp    %eax,%ebx
  jle    L225
  mov    0x30(%rsp),%esi
  mov    0x18(%rsp),%rdi
  mov    0x40(%rsp),%r9
  lea    -0x1(%rsi),%edx
  lea    0x8(%rdi),%rax
  mov    %rdx,%rsi
  lea    0x10(%rdi,%rdx,8),%rcx
  movslq 0x60(%rsp),%rdx
  add    %rbp,%rdx
  lea    (%r9,%rdx,8),%rdx
  sub    %rdi,%rdx
L223:
  movsd  (%rax),%xmm0
  movsd  %xmm0,0x8(%rdx,%rax,1)
  add    $0x8,%rax
  cmp    %rcx,%rax
  jne    L223
  jmp    L330
L366:
  mov    0x58(%rsp),%rdi
  call   <free@plt>
  mov    0x18(%rsp),%rdi
  call   <free@plt>
  mov    0x10(%rsp),%rdi
  add    $0xc8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10c0 <free@plt>
L288:
  mov    0x60(%rsp),%eax
  add    %ebx,%eax
  mov    %eax,0x70(%rsp)
  mov    0x34(%rsp),%eax
  sub    $0x1,%eax
  mov    %eax,0x74(%rsp)
  jmp    L171
L2:
  lea    D7(%rip),%rdi
  mov    %edx,0xc(%rsp)
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  mov    0xc(%rsp),%r11d
  jmp    L20
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D7
type_infered: string

tool: D7: M should be greater than or equal to N

assistant: ```c
void bidiag_orth(double *A, int M, int N, double *U, double *V) {
  int j, i, k, u, t;
  double *x, *v, *AT, *w;
  double beta;
  if (M < N) {
    printf("M should be greater than or equal to N");
    exit(1);
  }
  x = (double *)malloc(sizeof(double) * M);
  v = (double *)malloc(sizeof(double) * M);
  AT = (double *)malloc(sizeof(double) * M * M);
  w = (double *)malloc(sizeof(double) * M * M);
  eye(U, M);
  eye(V, N);
  for (j = 0; j < N; ++j) {
    for (i = j; i < M; ++i) {
      x[i - j] = A[i * N + j];
    }
    beta = house(x, M - j, v);
    for (i = j; i < M; i++) {
      t = i * N;
      u = 0;
      for (k = j; k < N; k++) {
        AT[u + i - j] = A[k + t];
        u += (M - j);
      }
    }
    mmult(AT, v, w, N - j, M - j, 1);
    scale(w, N - j, 1, beta);
    mmult(v, w, AT, M - j, 1, N - j);
    for (i = j; i < M; i++) {
      t = i * N;
      for (k = j; k < N; k++) {
        A[t + k] -= AT[(i - j) * (N - j) + k - j];
      }
    }
    for (i = j + 1; i < M; ++i) {
      A[i * N + j] = v[i - j];
    }
    for (i = j; i < M; i++) {
      t = i * M;
      u = (i - j) * (M - j);
      for (k = j; k < M; k++) {
        AT[u + k - j] = U[k + t];
      }
    }
    mmult(AT, v, w, M - j, M - j, 1);
    scale(w, M - j, 1, beta);
    mmult(w, v, AT, M - j, 1, M - j);
    for (i = j; i < M; i++) {
      t = i * M;
      u = (i - j) * (M - j);
      for (k = j; k < M; k++) {
        U[k + t] -= AT[u + k - j];
      }
    }
    if (j < N - 2) {
      for (i = j + 1; i < N; ++i) {
        x[i - j - 1] = A[j * N + i];
      }
      beta = house(x, N - j - 1, v);
      for (i = j; i < M; i++) {
        t = i * N;
        u = (i - j) * (N - j - 1);
        for (k = j + 1; k < N; k++) {
          AT[u + k - j - 1] = A[k + t];
        }
      }
      mmult(AT, v, w, M - j, N - j - 1, 1);
      scale(w, M - j, 1, beta);
      mmult(w, v, AT, M - j, 1, N - j - 1);
      for (i = j; i < M; i++) {
        t = i * N;
        u = (i - j) * (N - j - 1);
        for (k = j + 1; k < N; k++) {
          A[k + t] -= AT[u + k - j - 1];
        }
      }
      u = 1;
      t = j * N;
      for (i = j + 2; i < N; ++i) {
        A[t + i] = v[u];
        u++;
      }
    }
  }
  free(x);
  free(v);
  free(AT);
}
```