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

```asm
<dobldobl_monodromy_breakup>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x98,%rsp
  mov    %edi,-0x94(%rbp)
  mov    %esi,-0x98(%rbp)
  mov    %edx,-0x9c(%rbp)
  mov    %ecx,-0xa0(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    -0x9c(%rbp),%eax
  mov    %eax,%edi
  call   <initialize_dobldobl_sampler@plt>
  mov    %eax,-0x80(%rbp)
  mov    -0x9c(%rbp),%edx
  mov    -0xa0(%rbp),%ecx
  mov    -0x94(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <initialize_dobldobl_monodromy@plt>
  mov    %eax,-0x80(%rbp)
  lea    D86(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  call   <store_dobldobl_solutions@plt>
  mov    %eax,-0x80(%rbp)
  lea    D32(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x1,-0x7c(%rbp)
  jmp    L49
L35:
  mov    -0x7c(%rbp),%eax
  mov    %eax,%edi
  call   <set_dobldobl_trace_slice@plt>
  mov    %eax,-0x80(%rbp)
  mov    -0x98(%rbp),%eax
  mov    %eax,%edi
  call   <store_dobldobl_gammas@plt>
  mov    %eax,-0x80(%rbp)
  mov    $0x0,%eax
  call   <dobldobl_track_paths@plt>
  mov    %eax,-0x80(%rbp)
  mov    $0x0,%eax
  call   <store_dobldobl_solutions@plt>
  mov    %eax,-0x80(%rbp)
  mov    $0x0,%eax
  call   <restore_dobldobl_solutions@plt>
  mov    %eax,-0x80(%rbp)
  mov    $0x0,%eax
  call   <swap_dobldobl_slices@plt>
  mov    %eax,-0x80(%rbp)
  addl   $0x1,-0x7c(%rbp)
L49:
  cmpl   $0x2,-0x7c(%rbp)
  jle    L35
  lea    -0x68(%rbp),%rdx
  lea    -0x70(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <dobldobl_trace_grid_diagnostics@plt>
  mov    %eax,-0x80(%rbp)
  lea    D94(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x70(%rbp),%rax
  movq   %rax,%xmm0
  lea    D126(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    -0x68(%rbp),%rax
  movq   %rax,%xmm0
  lea    D5(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movl   $0x0,-0x8c(%rbp)
  movl   $0x1,-0x7c(%rbp)
  jmp    L115
L94:
  mov    -0x7c(%rbp),%eax
  mov    %eax,%esi
  lea    D59(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x98(%rbp),%edx
  mov    -0x9c(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <new_dobldobl_slices@plt>
  mov    %eax,-0x80(%rbp)
  mov    -0x98(%rbp),%eax
  mov    %eax,%edi
  call   <store_dobldobl_gammas@plt>
  mov    %eax,-0x80(%rbp)
  mov    $0x0,%eax
  call   <dobldobl_track_paths@plt>
  mov    %eax,-0x80(%rbp)
  mov    $0x0,%eax
  call   <solcon_clear_dobldobl_solutions@plt>
  mov    %eax,-0x80(%rbp)
  mov    -0x98(%rbp),%eax
  mov    %eax,%edi
  call   <store_dobldobl_gammas@plt>
  mov    %eax,-0x80(%rbp)
  mov    $0x0,%eax
  call   <dobldobl_track_paths@plt>
  mov    %eax,-0x80(%rbp)
  mov    $0x0,%eax
  call   <store_dobldobl_solutions@plt>
  mov    %eax,-0x80(%rbp)
  mov    %rsp,%rax
  mov    %rax,%rbx
  mov    -0xa0(%rbp),%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x58(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r12
  mov    $0x0,%r13d
  movslq %eax,%rdx
  mov    %rdx,%r14
  mov    $0x0,%r15d
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L164:
  cmp    %rdx,%rsp
  je     L186
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L164
L186:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L122
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L122:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x50(%rbp)
  mov    -0x50(%rbp),%rdx
  mov    -0xa0(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <permutation_after_dobldobl_loop@plt>
  mov    %eax,-0x80(%rbp)
  mov    -0x7c(%rbp),%eax
  mov    %eax,%esi
  lea    D117(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x78(%rbp)
  jmp    L29
L174:
  mov    -0x50(%rbp),%rax
  mov    -0x78(%rbp),%edx
  movslq %edx,%rdx
  mov    (%rax,%rdx,4),%eax
  mov    %eax,%esi
  lea    D34(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x78(%rbp)
L29:
  mov    -0x78(%rbp),%eax
  cmp    -0xa0(%rbp),%eax
  jl     L174
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %rbx,%rsp
  lea    -0x8c(%rbp),%rdx
  mov    -0xa0(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <dobldobl_monodromy_permutation@plt>
  mov    %eax,-0x80(%rbp)
  mov    %rsp,%rax
  mov    %rax,%rbx
  mov    -0xa0(%rbp),%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x48(%rbp)
  movslq %eax,%rdx
  mov    %rdx,-0xb0(%rbp)
  movq   $0x0,-0xa8(%rbp)
  movslq %eax,%rdx
  mov    %rdx,-0xc0(%rbp)
  movq   $0x0,-0xb8(%rbp)
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%ecx
  mov    $0x0,%edx
  div    %rcx
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L58:
  cmp    %rdx,%rsp
  je     L50
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L58
L50:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L109
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L109:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x40(%rbp)
  lea    -0x88(%rbp),%rax
  mov    %rax,%rdi
  call   <number_of_dobldobl_factors@plt>
  mov    %eax,-0x80(%rbp)
  mov    -0x88(%rbp),%eax
  mov    %eax,%esi
  lea    D31(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x1,-0x78(%rbp)
  jmp    L30
L121:
  mov    -0x40(%rbp),%rdx
  lea    -0x84(%rbp),%rcx
  mov    -0x78(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <witness_points_of_dobldobl_factor@plt>
  mov    %eax,-0x80(%rbp)
  mov    -0x78(%rbp),%eax
  mov    %eax,%esi
  lea    D52(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x74(%rbp)
  jmp    L96
L114:
  mov    -0x40(%rbp),%rax
  mov    -0x74(%rbp),%edx
  movslq %edx,%rdx
  mov    (%rax,%rdx,4),%eax
  mov    %eax,%esi
  lea    D34(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x74(%rbp)
L96:
  mov    -0x84(%rbp),%eax
  cmp    %eax,-0x74(%rbp)
  jl     L114
  mov    -0x84(%rbp),%eax
  lea    -0x60(%rbp),%rdx
  mov    -0x40(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <dobldobl_trace_sum_difference@plt>
  mov    %eax,-0x80(%rbp)
  mov    -0x60(%rbp),%rax
  movq   %rax,%xmm0
  lea    D103(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  addl   $0x1,-0x78(%rbp)
L30:
  mov    -0x88(%rbp),%eax
  cmp    %eax,-0x78(%rbp)
  jle    L121
  mov    %rbx,%rsp
  mov    $0x0,%eax
  call   <restore_dobldobl_solutions@plt>
  mov    %eax,-0x80(%rbp)
  addl   $0x1,-0x7c(%rbp)
L115:
  mov    -0x7c(%rbp),%eax
  cmp    -0x94(%rbp),%eax
  jg     L79
  mov    -0x8c(%rbp),%eax
  test   %eax,%eax
  je     L94
L79:
  mov    -0x8c(%rbp),%eax
  cmp    $0x1,%eax
  jne    L40
  mov    -0x7c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,%esi
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L81
L40:
  mov    -0x7c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,%esi
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L81:
  mov    -0x80(%rbp),%eax
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L150
  call   <__stack_chk_fail@plt>
L150:
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

tool_calls: name: read_data
arguments: data_tag: D86
type_guessed: string
name: read_data
arguments: data_tag: D32
type_guessed: string
name: read_data
arguments: data_tag: D94
type_guessed: string
name: read_data
arguments: data_tag: D126
type_guessed: string
name: read_data
arguments: data_tag: D5
type_guessed: string
name: read_data
arguments: data_tag: D59
type_guessed: string
name: read_data
arguments: data_tag: D117
type_guessed: string
name: read_data
arguments: data_tag: D34
type_guessed: string
name: read_data
arguments: data_tag: D31
type_guessed: string
name: read_data
arguments: data_tag: D52
type_guessed: string
name: read_data
arguments: data_tag: D103
type_guessed: string
name: read_data
arguments: data_tag: D17
type_guessed: string
name: read_data
arguments: data_tag: D13
type_guessed: string

tool: D86: 
Initialized sampler and monodromy permutations ...

tool: D32: ... initializing the grid in double double precision...

tool: D94: Trace grid diagnostics : 

tool: D126:   largest error of the samples : %.3e


tool: D5:   smallest distance between samples : %.3e


tool: D59: ... starting loop #%d in double double precision ...


tool: D117: the permutation at step %d:

tool: D34:  %d

tool: D31: number of irreducible factors : %d


tool: D52:  %d :

tool: D103:  : %.3e


tool: D17: Found factorization using %d loops.


tool: D13: Failed to factor using %d loops.


assistant: ```c
int dobldobl_monodromy_breakup(int nbloops, int n, int k, int d) {
  int fail, i, j, done;
  double err, dis;
  fail = initialize_dobldobl_sampler(k);
  fail = initialize_dobldobl_monodromy(nbloops, d, k);
  if (1 > 0)
    printf("\nInitialized sampler and monodromy permutations ...\n");
  fail = store_dobldobl_solutions();
  printf("... initializing the grid in double double precision...\n");
  for (i = 1; i <= 2; i++) {
    fail = set_dobldobl_trace_slice(i);
    fail = store_dobldobl_gammas(n);
    fail = dobldobl_track_paths();
    fail = store_dobldobl_solutions();
    fail = restore_dobldobl_solutions();
    fail = swap_dobldobl_slices();
  }
  fail = dobldobl_trace_grid_diagnostics(&err, &dis);
  printf("Trace grid diagnostics : \n");
  printf("  largest error of the samples : %.3e\n", err);
  printf("  smallest distance between samples : %.3e\n", dis);
  done = 0;
  for (i = 1; (i <= nbloops) && (done == 0); i++) {
    printf("... starting loop #\%d in double double precision ...\n", i);
    fail = new_dobldobl_slices(k, n);
    fail = store_dobldobl_gammas(n);
    fail = dobldobl_track_paths();
    fail = solcon_clear_dobldobl_solutions();
    fail = store_dobldobl_gammas(n);
    fail = dobldobl_track_paths();
    fail = store_dobldobl_solutions();
    {
      int permutation[d];
      fail = permutation_after_dobldobl_loop(d, permutation);
      printf("the permutation at step %d:", i);
      for (j = 0; j < d; j++)
        printf(" %d", permutation[j]);
      printf("\n");
    }
    fail = dobldobl_monodromy_permutation(d, &done);
    {
      int nf, deg, jp, w[d];
      double trace_difference;
      fail = number_of_dobldobl_factors(&nf);
      printf("number of irreducible factors : %d\n", nf);
      for (j = 1; j <= nf; j++) {
        fail = witness_points_of_dobldobl_factor(j, &deg, w);
        printf(" %d :", j);
        for (jp = 0; jp < deg; jp++)
          printf(" %d", w[jp]);
        fail = dobldobl_trace_sum_difference(deg, w, &trace_difference);
        printf(" : %.3e\n", trace_difference);
      }
    }
    fail = restore_dobldobl_solutions();
  }
  if (done == 1)
    printf("Found factorization using %d loops.\n", i - 1);
  else
    printf("Failed to factor using %d loops.\n", i - 1);
  return fail;
}
```