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

```asm
<unroot>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  lea    -0x2(%rsi),%r13d
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdx,0x20(%rsp)
  mov    %rcx,0x48(%rsp)
  mov    %r8,0x40(%rsp)
  mov    %r9,0x38(%rsp)
  test   %r13d,%r13d
  jle    L642
  mov    (%rdi),%rax
  lea    -0x3(%rsi),%edx
  mov    %edx,0xc(%rsp)
  lea    0x4(%rax,%rdx,4),%rdx
  jmp    L652
  nopl   (%rax)
L417:
  add    $0x4,%rax
  cmp    %rdx,%rax
  je     L165
L652:
  mov    (%rax),%r10d
  test   %r10d,%r10d
  je     L417
  add    $0x58,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L642:
  lea    -0x3(%rsi),%eax
  mov    %eax,0xc(%rsp)
L165:
  mov    0xc(%rsp),%r9d
  test   %r9d,%r9d
  jle    L543
  lea    -0x1(%rbp),%eax
  movl   $0x0,0x8(%rsp)
  xor    %r10d,%r10d
  mov    $0x1,%r11d
  mov    %eax,0x28(%rsp)
  lea    0x8(%r12),%rax
  mov    %rax,%rbx
  mov    %rax,0x10(%rsp)
  mov    %ebp,%eax
  movq   $0x0,0x30(%rsp)
  lea    (%rbx,%rax,8),%rdx
  mov    %r13d,%eax
  lea    0x10(%r12,%rax,8),%r14
L65:
  mov    %r12,%rax
  xor    %r9d,%r9d
  test   %ebp,%ebp
  js     L78
  nopl   0x0(%rax,%rax,1)
L20:
  mov    (%rax),%rcx
  add    $0x8,%rax
  add    (%rcx,%r10,1),%r9d
  cmp    %rdx,%rax
  jne    L20
L78:
  movslq 0x8(%rsp),%rax
  lea    0x1(%rax),%r15d
  cmp    0x28(%rsp),%r9d
  je     L472
  lea    0x4(%r10),%rax
  mov    %r15d,%ebx
  mov    %rax,0x18(%rsp)
  cmp    %r15d,%r13d
  jle    L54
  nopl   (%rax)
L771:
  mov    %r12,%rcx
  xor    %esi,%esi
  test   %ebp,%ebp
  js     L552
  nopl   (%rax)
L614:
  mov    (%rcx),%rdi
  add    $0x8,%rcx
  add    (%rdi,%rax,1),%esi
  cmp    %rdx,%rcx
  jne    L614
  mov    %ebp,%ecx
  sub    %esi,%ecx
L803:
  cmp    %ecx,%r9d
  je     L510
L670:
  add    $0x1,%ebx
  add    $0x4,%rax
  cmp    %r13d,%ebx
  jne    L771
L54:
  addq   $0x1,0x30(%rsp)
  mov    0x18(%rsp),%r10
  cmp    %r15d,0xc(%rsp)
  je     L543
  mov    %r15d,0x8(%rsp)
  jmp    L65
  nopl   0x0(%rax)
L510:
  cmp    $0x1,%ebp
  jle    L121
  mov    0x10(%rsp),%rsi
  xor    %edi,%edi
  nopl   0x0(%rax)
L45:
  mov    (%rsi),%r8
  mov    (%r8,%r10,1),%ecx
  sub    (%r8,%rax,1),%ecx
  mov    %ecx,%r8d
  neg    %r8d
  cmovns %r8d,%ecx
  cmp    $0x1,%ecx
  cmovne %r11d,%edi
  add    $0x8,%rsi
  cmp    %r14,%rsi
  jne    L45
  test   %edi,%edi
  jne    L670
L121:
  mov    0x20(%rsp),%rax
  mov    %r15d,0x18(%rsp)
  test   %rax,%rax
  je     L125
  mov    0x30(%rsp),%rdx
  movsd  (%rax,%rdx,8),%xmm0
L370:
  cmpq   $0x0,0xa0(%rsp)
  je     L220
L474:
  test   %ebp,%ebp
  jle    L637
  movslq 0x8(%rsp),%rax
  mov    $0xffffffff,%esi
  lea    0x0(,%rax,4),%rdi
L523:
  mov    0x38(%rsp),%r8
  mov    $0x1,%eax
  xor    %r14d,%r14d
  xor    %r15d,%r15d
  mov    0x90(%rsp),%r9
  mov    0x98(%rsp),%r10
  jmp    L735
L410:
  movslq %r15d,%rcx
  add    $0x1,%rax
  add    $0x1,%r15d
  mov    %rdx,(%r9,%rcx,8)
  cmp    %eax,%ebp
  jl     L340
L735:
  mov    (%r12,%rax,8),%rcx
  mov    (%r8,%rax,8),%rdx
  mov    (%rcx,%rdi,1),%ecx
  test   %ecx,%ecx
  je     L410
  movslq %r14d,%rcx
  add    $0x1,%rax
  add    $0x1,%r14d
  mov    %rdx,(%r10,%rcx,8)
  cmp    %eax,%ebp
  jge    L735
L340:
  test   %r15d,%r15d
  jle    L662
  test   %r14d,%r14d
  jle    L662
L33:
  mov    0xa0(%rsp),%rax
  mov    %r15d,(%rax)
  mov    0xa8(%rsp),%rax
  mov    %r14d,(%rax)
  cmp    $0xffffffff,%esi
  je     L22
  mov    0x48(%rsp),%rdx
  movslq %esi,%rax
  movsd  (%rdx,%rax,8),%xmm1
  mov    0xb0(%rsp),%rdx
  movapd %xmm1,%xmm2
  addsd  %xmm0,%xmm2
  divsd  %xmm2,%xmm1
  movsd  %xmm1,(%rdx)
  cmp    $0xffffffff,%ebx
  je     L820
  mov    0x20(%rsp),%rsi
  movslq %ebx,%rdx
  movapd %xmm0,%xmm2
  movsd  (%rsi,%rdx,8),%xmm1
  mov    0xb0(%rsp),%rdx
  addsd  %xmm1,%xmm2
  divsd  %xmm2,%xmm1
  movsd  %xmm1,(%rdx)
L820:
  mov    0x48(%rsp),%rdx
  lea    (%rdx,%rax,8),%rax
  movsd  (%rax),%xmm1
  addsd  %xmm0,%xmm1
  movsd  %xmm1,(%rax)
L220:
  cmp    $0xffffffff,%ebx
  je     L48
  mov    0x20(%rsp),%rax
  movslq %ebx,%rbx
  lea    (%rax,%rbx,8),%rax
L90:
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
L48:
  mov    0x8(%rsp),%ebx
  cmp    %ebx,0xc(%rsp)
  jle    L821
L202:
  cmpq   $0x0,0x20(%rsp)
  je     L154
  movslq 0x8(%rsp),%rax
  cmpq   $0x0,0x40(%rsp)
  mov    %rax,%rbx
  je     L373
  mov    %ebp,%esi
  lea    0x1(%rax),%ecx
  mov    $0x8,%edi
  mov    0x20(%rsp),%r10
  sub    %eax,%esi
  mov    0x40(%rsp),%r11
  lea    0x0(,%rax,8),%rdx
  sub    $0x4,%esi
  cmp    %ecx,%r13d
  lea    0x8(%rdx),%rbx
  mov    $0x10,%ecx
  lea    0x8(,%rsi,8),%r15
  lea    0x10(,%rsi,8),%rsi
  cmovle %rdi,%r15
  lea    (%r11,%rdx,1),%r14
  lea    (%r10,%rdx,1),%rdi
  cmovle %rcx,%rsi
  lea    (%r10,%rbx,1),%r8
  lea    (%r15,%rdx,1),%r9
  add    %rsi,%rdx
  add    %r11,%rdx
  cmp    %rdx,%rdi
  lea    (%r10,%r9,1),%rdx
  setae  %cl
  cmp    %rdx,%r14
  setae  %dl
  or     %cl,%dl
  je     L818
  lea    (%r15,%rbx,1),%rdx
  add    %r10,%rdx
  cmp    %rdx,%r14
  lea    (%r11,%r9,1),%rdx
  setae  %cl
  cmp    %rdx,%r8
  setae  %dl
  or     %cl,%dl
  je     L818
  mov    %r15,%rdx
  mov    %r8,%rsi
  call   <memmove@plt>
  mov    0x40(%rsp),%rsi
  mov    %r15,%rdx
  mov    %r14,%rdi
  add    %rbx,%rsi
  call   <memmove@plt>
L821:
  cmpq   $0x0,0x48(%rsp)
  je     L240
L829:
  test   %ebp,%ebp
  jle    L145
  mov    0x48(%rsp),%rdi
  movslq %ebp,%rbx
  lea    0x0(,%rbx,8),%rdx
  lea    0x8(%rdi),%rsi
  call   <memmove@plt>
  cmpq   $0x0,0x38(%rsp)
  je     L615
  mov    0x38(%rsp),%rax
  mov    (%rax),%rdi
  call   <free@plt>
L665:
  lea    -0x1(%rbp),%eax
  mov    0x38(%rsp),%rdi
  test   %ebp,%ebp
  lea    0x8(,%rax,8),%rdx
  mov    $0x8,%eax
  cmovle %rax,%rdx
  lea    0x8(%rdi),%rsi
  call   <memmove@plt>
L67:
  mov    0x38(%rsp),%rax
  mov    $0x1,%esi
  mov    $0x65,%edi
  lea    (%rax,%rbx,8),%rbx
  call   <check_alloc@plt>
  mov    %rax,(%rbx)
L615:
  cmp    $0x2,%ebp
  jle    L694
  lea    -0x1(%rbp),%eax
  lea    0x8(%r12),%rbx
  mov    %r12,%rsi
  mov    %r13d,%edi
  lea    (%rbx,%rax,8),%r14
  mov    %eax,0x28(%rsp)
  mov    %r13d,%eax
  mov    %rbx,0x10(%rsp)
  mov    %r13d,%ebx
  shr    $0x2,%eax
  and    $0xfffffffc,%ebx
  lea    -0x1(%rax),%ecx
  lea    0x2(%rbx),%eax
  lea    0x1(%rbx),%r10d
  add    $0x1,%rcx
  mov    %ebx,%r11d
  mov    %eax,0x8(%rsp)
  shl    $0x4,%rcx
  mov    %r10,%r15
  shl    $0x2,%r11
  shl    $0x2,%r10
  lea    0x0(,%rax,4),%rbp
L522:
  mov    0x8(%rsi),%rax
  mov    (%rsi),%rdx
  lea    0x4(%rax),%r9
  mov    %rdx,%r8
  sub    %r9,%r8
  cmp    $0x8,%r8
  jbe    L236
  xor    %r8d,%r8d
  cmpl   $0x2,0xc(%rsp)
  jbe    L236
  nopl   0x0(%rax,%rax,1)
L179:
  movdqu (%rax,%r8,1),%xmm3
  movups %xmm3,(%rdx,%r8,1)
  add    $0x10,%r8
  cmp    %r8,%rcx
  jne    L179
  cmp    %ebx,%r13d
  je     L778
  mov    (%rax,%r11,1),%r8d
  mov    %r8d,(%rdx,%r11,1)
  cmp    %r13d,%r15d
  jge    L778
  mov    (%rax,%r10,1),%r8d
  mov    %r8d,(%rdx,%r10,1)
  cmp    %r13d,0x8(%rsp)
  jge    L778
  mov    (%rax,%rbp,1),%eax
  mov    %eax,(%rdx,%rbp,1)
L778:
  add    $0x8,%rsi
  cmp    %r14,%rsi
  jne    L522
  cmp    0x18(%rsp),%r13d
  jle    L59
L720:
  movslq 0x18(%rsp),%rax
  mov    0xc(%rsp),%r9d
  mov    0x10(%rsp),%rbx
  sub    %eax,%r9d
  lea    -0x4(,%rax,4),%rsi
  add    %rax,%r9
  mov    0x28(%rsp),%eax
  shl    $0x2,%r9
  lea    (%rbx,%rax,8),%r8
L418:
  mov    %rsi,%rdi
  mov    %r12,%rax
  add    $0x4,%rsi
  xchg   %ax,%ax
L209:
  mov    (%rax),%rdx
  add    $0x8,%rax
  mov    (%rdx,%rsi,1),%ecx
  mov    %ecx,(%rdx,%rdi,1)
  cmp    %rax,%r8
  jne    L209
  cmp    %r9,%rsi
  jne    L418
L59:
  add    $0x58,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L552:
  mov    %ebp,%ecx
  jmp    L803
L236:
  xor    %r8d,%r8d
  nopw   0x0(%rax,%rax,1)
L35:
  mov    (%rax,%r8,4),%r9d
  mov    %r9d,(%rdx,%r8,4)
  add    $0x1,%r8
  cmp    %r8,%rdi
  jne    L35
  jmp    L778
L496:
  cmpq   $0x0,0xa0(%rsp)
  mov    $0xffffffff,%ebx
  jne    L474
  cmp    %eax,0xc(%rsp)
  jg     L202
L240:
  mov    0x38(%rsp),%rax
  test   %rax,%rax
  je     L615
  mov    (%rax),%rdi
  movslq %ebp,%rbx
  call   <free@plt>
  test   %ebp,%ebp
  jg     L665
  jmp    L67
  nopw   0x0(%rax,%rax,1)
L125:
  mov    $0xffffffff,%ebx
  jmp    L370
L472:
  cmpq   $0x0,0x48(%rsp)
  mov    %r15d,0x18(%rsp)
  je     L496
  mov    0x20(%rsp),%rbx
  movsd  (%rbx,%rax,8),%xmm0
  test   %ebp,%ebp
  jle    L100
  lea    0x0(,%rax,4),%rdi
  mov    $0x1,%eax
  jmp    L324
L559:
  add    $0x1,%rax
  cmp    %eax,%ebp
  jl     L116
L324:
  mov    (%r12,%rax,8),%rdx
  mov    %eax,%esi
  mov    (%rdx,%rdi,1),%r8d
  test   %r8d,%r8d
  jne    L559
  cmpq   $0x0,0xa0(%rsp)
  mov    $0xffffffff,%ebx
  cltq
  jne    L523
  jmp    L820
  xchg   %ax,%ax
L543:
  movl   $0x0,0x18(%rsp)
  mov    $0xffffffff,%ebx
  movl   $0xffffffff,0x8(%rsp)
  jmp    L370
L22:
  cmp    $0xffffffff,%ebx
  je     L48
  mov    0x20(%rsp),%rax
  movslq %ebx,%rbx
  movapd %xmm0,%xmm2
  lea    (%rax,%rbx,8),%rax
  mov    0xb0(%rsp),%rbx
  movsd  (%rax),%xmm1
  addsd  %xmm1,%xmm2
  divsd  %xmm2,%xmm1
  movsd  %xmm1,(%rbx)
  jmp    L90
L637:
  xor    %r14d,%r14d
  xor    %r15d,%r15d
  mov    $0xffffffff,%esi
L662:
  lea    D7(%rip),%rdi
  mov    %esi,0x10(%rsp)
  movsd  %xmm0,0x28(%rsp)
  call   <printf@plt>
  movsd  0x28(%rsp),%xmm0
  mov    0x10(%rsp),%esi
  jmp    L33
L373:
  lea    -0x4(%rbp),%edx
  lea    0x1(%rbx),%ecx
  shl    $0x3,%rax
  sub    %ebx,%edx
  mov    0x20(%rsp),%rbx
  cmp    %r13d,%ecx
  mov    $0x8,%ecx
  lea    0x8(,%rdx,8),%rdx
  cmovge %rcx,%rdx
  lea    0x8(%rbx,%rax,1),%rsi
  lea    (%rbx,%rax,1),%rdi
  call   <memmove@plt>
  jmp    L821
L154:
  mov    0x40(%rsp),%rbx
  test   %rbx,%rbx
  je     L821
  movslq 0x8(%rsp),%rax
  lea    -0x4(%rbp),%edx
  mov    %rax,%rsi
  shl    $0x3,%rax
  sub    %esi,%edx
  lea    0x1(%rsi),%ecx
  lea    (%rbx,%rax,1),%rdi
  cmp    %r13d,%ecx
  lea    0x8(,%rdx,8),%rdx
  mov    $0x8,%ecx
  cmovge %rcx,%rdx
  lea    0x8(%rbx,%rax,1),%rsi
  call   <memmove@plt>
  jmp    L821
L116:
  cmpq   $0x0,0xa0(%rsp)
  mov    $0xffffffff,%ebx
  mov    $0xffffffff,%esi
  jne    L523
L361:
  mov    0x8(%rsp),%ebx
  cmp    %ebx,0xc(%rsp)
  jg     L202
  jmp    L829
  nopl   (%rax)
L694:
  cmp    0x18(%rsp),%r13d
  jle    L59
  test   %ebp,%ebp
  jle    L59
  lea    -0x1(%rbp),%eax
  mov    %eax,0x28(%rsp)
  lea    0x8(%r12),%rax
  mov    %rax,0x10(%rsp)
  jmp    L720
L145:
  cmpq   $0x0,0x38(%rsp)
  je     L59
  mov    0x38(%rsp),%rax
  movslq %ebp,%rbx
  mov    (%rax),%rdi
  call   <free@plt>
  jmp    L67
L100:
  cmpq   $0x0,0xa0(%rsp)
  je     L361
  xor    %r14d,%r14d
  xor    %r15d,%r15d
  mov    $0xffffffff,%ebx
  mov    $0xffffffff,%esi
  jmp    L662
L818:
  mov    %r10,%rdx
  mov    %r11,%rcx
L449:
  movsd  0x8(%rdx,%rax,8),%xmm0
  movsd  %xmm0,(%rdx,%rax,8)
  movsd  0x8(%rcx,%rax,8),%xmm0
  movsd  %xmm0,(%rcx,%rax,8)
  add    $0x1,%rax
  cmp    %eax,0xc(%rsp)
  jg     L449
  jmp    L821
```

tool_calls: name: read_data
arguments: tag: D7
data_type: string

tool: D7: probleme


assistant: ```c
int unroot(int **treer, int notu, double *lgbi, double *lgbp, double *bootvals, char **nom, char **list1, char **list2, int *l1, int *l2, double *fracroot1) {
  int i, j, j1, j2, br_a_virer = -1, bp_a_modifier = -1, bi_a_modifier = -1, somme1, somme2, drapeau;
  double l;
  for (j = 0; j < notu - 2; j++)
    if (treer[0][j] != 0)
      return 1;
  for (j1 = 0; j1 < notu - 3; j1++) {
    somme1 = 0;
    for (i = 0; i < notu + 1; i++)
      somme1 += treer[i][j1];
    if (somme1 == notu - 1) {
      br_a_virer = j1;
      if (lgbp) {
        l = lgbi[j1];
        for (i = 1; i < notu + 1; i++)
          if (treer[i][j1] == 0) {
            bp_a_modifier = i;
            break;
          }
      }
      break;
    }
    for (j2 = j1 + 1; j2 < notu - 2; j2++) {
      somme2 = 0;
      for (i = 0; i < notu + 1; i++)
        somme2 += treer[i][j2];
      if (somme1 == notu - somme2) {
        drapeau = 0;
        for (i = 1; i < notu; i++)
          if (abs(treer[i][j1] - treer[i][j2]) != 1)
            drapeau = 1;
        if (drapeau == 0) {
          br_a_virer = j1;
          if (lgbi) {
            bi_a_modifier = j2;
            l = lgbi[j1];
          }
          break;
        }
      }
      if (br_a_virer != -1)
        break;
    }
    if (br_a_virer != -1)
      break;
  }
  if (l1) {
    j1 = j2 = 0;
    for (i = 1; i <= notu; i++) {
      if (treer[i][br_a_virer] == 0) {
        list1[j1] = nom[i];
        j1++;
      } else {
        list2[j2] = nom[i];
        j2++;
      }
    }
    if (j1 < 1 || j2 < 1)
      printf("probleme\n");
    *l1 = j1;
    *l2 = j2;
    if (bp_a_modifier != -1)
      *fracroot1 = lgbp[bp_a_modifier] / (lgbp[bp_a_modifier] + l);
    if (bi_a_modifier != -1)
      *fracroot1 = lgbi[bi_a_modifier] / (lgbi[bi_a_modifier] + l);
  }
  if (bp_a_modifier != -1)
    lgbp[bp_a_modifier] += l;
  if (bi_a_modifier != -1)
    lgbi[bi_a_modifier] += l;
  for (i = br_a_virer; i < notu - 3; i++) {
    if (lgbi)
      lgbi[i] = lgbi[i + 1];
    if (bootvals)
      bootvals[i] = bootvals[i + 1];
  }
  if (lgbp)
    for (i = 0; i < notu; i++)
      lgbp[i] = lgbp[i + 1];
  if (nom) {
    free(nom[0]);
    for (i = 0; i < notu; i++)
      nom[i] = nom[i + 1];
    nom[notu] = check_alloc(100 + 1, sizeof(char));
  }
  for (i = 1; i < notu + 1; i++)
    for (j = 0; j < notu - 2; j++)
      treer[i - 1][j] = treer[i][j];
  for (j = br_a_virer + 1; j < notu - 2; j++)
    for (i = 0; i < notu; i++)
      treer[i][j - 1] = treer[i][j];
  return 0;
}
```