#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int initialize_quaddobl_Laurent_sampler(int);
int initialize_quaddobl_monodromy(int, int, int);
int initialize_quaddobl_sampler(int);
int new_quaddobl_slices(int, int);
int number_of_quaddobl_factors(int *);
int permutation_after_quaddobl_loop(int, int *);
int /*<<< orphan*/ printf(char *, ...);
int quaddobl_monodromy_permutation(int, int *);
int quaddobl_trace_grid_diagnostics(double *, double *);
int quaddobl_trace_sum_difference(int, int *, double *);
int quaddobl_track_paths(int);
int restore_quaddobl_solutions();
int set_quaddobl_trace_slice(int);
int solcon_clear_quaddobl_solutions();
int store_quaddobl_gammas(int);
int store_quaddobl_solutions();
int swap_quaddobl_slices();
int witness_points_of_quaddobl_factor(int, int *, int *);
int quaddobl_monodromy_breakup(int islaurent, int nbloops, int n, int k,
                               int d) {
  int fail, i, j, done;
  double err, dis;
  if (islaurent == 1)
    fail = initialize_quaddobl_Laurent_sampler(k);
  else
    fail = initialize_quaddobl_sampler(k);
  fail = initialize_quaddobl_monodromy(nbloops, d, k);
  if (1 > 0)
    printf("\nInitialized sampler and monodromy permutations ...\n");
  fail = store_quaddobl_solutions();
  printf("... initializing the grid in quad double precision ...\n");
  for (i = 1; i <= 2; i++) {
    fail = set_quaddobl_trace_slice(i);
    fail = store_quaddobl_gammas(n);
    fail = quaddobl_track_paths(islaurent);
    fail = store_quaddobl_solutions();
    fail = restore_quaddobl_solutions();
    fail = swap_quaddobl_slices();
  }
  fail = quaddobl_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 quad double precision ...\n", i);
    fail = new_quaddobl_slices(k, n);
    fail = store_quaddobl_gammas(n);
    fail = quaddobl_track_paths(islaurent);
    fail = solcon_clear_quaddobl_solutions();
    fail = store_quaddobl_gammas(n);
    fail = quaddobl_track_paths(islaurent);
    fail = store_quaddobl_solutions();
    {
      int permutation[d];
      fail = permutation_after_quaddobl_loop(d, permutation);
      printf("the permutation at step %d:", i);
      for (j = 0; j < d; j++)
        printf(" %d", permutation[j]);
      printf("\n");
    }
    fail = quaddobl_monodromy_permutation(d, &done);
    {
      int nf, deg, jp, w[d];
      double trace_difference;
      fail = number_of_quaddobl_factors(&nf);
      printf("number of irreducible factors : %d\n", nf);
      for (j = 1; j <= nf; j++) {
        fail = witness_points_of_quaddobl_factor(j, &deg, w);
        printf(" %d :", j);
        for (jp = 0; jp < deg; jp++)
          printf(" %d", w[jp]);
        fail = quaddobl_trace_sum_difference(deg, w, &trace_difference);
        printf(" : %.3e\n", trace_difference);
      }
    }
    fail = restore_quaddobl_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;
}


x86 assembly (clang, -O0):
<quaddobl_monodromy_breakup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1255 <quaddobl_monodromy_breakup+0x35>
mov    -0x10(%rbp),%edi
call   10f0 <initialize_quaddobl_Laurent_sampler@plt>
mov    %eax,-0x18(%rbp)
jmp    1260 <quaddobl_monodromy_breakup+0x40>
mov    -0x10(%rbp),%edi
call   10c0 <initialize_quaddobl_sampler@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1110 <initialize_quaddobl_monodromy@plt>
mov    %eax,-0x18(%rbp)
lea    0xd88(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x0,%al
call   1120 <store_quaddobl_solutions@plt>
mov    %eax,-0x18(%rbp)
lea    0xda5(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x1c(%rbp)
cmpl   $0x2,-0x1c(%rbp)
jg     12f5 <quaddobl_monodromy_breakup+0xd5>
mov    -0x1c(%rbp),%edi
call   1040 <set_quaddobl_trace_slice@plt>
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1090 <store_quaddobl_gammas@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1100 <quaddobl_track_paths@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1120 <store_quaddobl_solutions@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <restore_quaddobl_solutions@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   10a0 <swap_quaddobl_slices@plt>
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    129e <quaddobl_monodromy_breakup+0x7e>
lea    -0x30(%rbp),%rdi
lea    -0x38(%rbp),%rsi
call   1050 <quaddobl_trace_grid_diagnostics@plt>
mov    %eax,-0x18(%rbp)
lea    0xd61(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movsd  -0x30(%rbp),%xmm0
lea    0xd69(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  -0x38(%rbp),%xmm0
lea    0xd7d(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movl   $0x0,-0x24(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0x71(%rbp)
jg     1362 <quaddobl_monodromy_breakup+0x142>
cmpl   $0x0,-0x24(%rbp)
sete   %al
mov    %al,-0x71(%rbp)
mov    -0x71(%rbp),%al
test   $0x1,%al
jne    1372 <quaddobl_monodromy_breakup+0x152>
jmp    1598 <quaddobl_monodromy_breakup+0x378>
mov    -0x1c(%rbp),%esi
lea    0xd5f(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x81(%rbp)
call   1070 <printf@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1130 <new_quaddobl_slices@plt>
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1090 <store_quaddobl_gammas@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1100 <quaddobl_track_paths@plt>
mov    %eax,%ecx
mov    -0x81(%rbp),%al
mov    %ecx,-0x18(%rbp)
call   1030 <solcon_clear_quaddobl_solutions@plt>
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1090 <store_quaddobl_gammas@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1100 <quaddobl_track_paths@plt>
mov    %eax,%ecx
mov    -0x81(%rbp),%al
mov    %ecx,-0x18(%rbp)
call   1120 <store_quaddobl_solutions@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x40(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rsi
sub    %rcx,%rsi
mov    %rsi,-0x80(%rbp)
mov    %rsi,%rsp
mov    %rax,-0x48(%rbp)
mov    -0x14(%rbp),%edi
call   1080 <permutation_after_quaddobl_loop@plt>
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xcf0(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1460 <quaddobl_monodromy_breakup+0x240>
mov    -0x80(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xce0(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    142d <quaddobl_monodromy_breakup+0x20d>
lea    0xc1f(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    -0x40(%rbp),%rax
mov    %rax,%rsp
mov    -0x14(%rbp),%edi
lea    -0x24(%rbp),%rsi
call   10e0 <quaddobl_monodromy_permutation@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x60(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x90(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x68(%rbp)
lea    -0x4c(%rbp),%rdi
call   10b0 <number_of_quaddobl_factors@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4c(%rbp),%esi
lea    0xc6b(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x4c(%rbp),%eax
jg     1579 <quaddobl_monodromy_breakup+0x359>
mov    -0x90(%rbp),%rdx
mov    -0x20(%rbp),%edi
lea    -0x50(%rbp),%rsi
call   10d0 <witness_points_of_quaddobl_factor@plt>
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%esi
lea    0xc55(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x50(%rbp),%eax
jge    1542 <quaddobl_monodromy_breakup+0x322>
mov    -0x90(%rbp),%rax
movslq -0x54(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xbfe(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    150c <quaddobl_monodromy_breakup+0x2ec>
mov    -0x90(%rbp),%rsi
mov    -0x50(%rbp),%edi
lea    -0x70(%rbp),%rdx
call   1140 <quaddobl_trace_sum_difference@plt>
mov    %eax,-0x18(%rbp)
movsd  -0x70(%rbp),%xmm0
lea    0xb42(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    14d2 <quaddobl_monodromy_breakup+0x2b2>
mov    -0x60(%rbp),%rax
mov    %rax,%rsp
mov    $0x0,%al
call   1060 <restore_quaddobl_solutions@plt>
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1347 <quaddobl_monodromy_breakup+0x127>
cmpl   $0x1,-0x24(%rbp)
jne    15bb <quaddobl_monodromy_breakup+0x39b>
mov    -0x1c(%rbp),%esi
sub    $0x1,%esi
lea    0xbaa(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    15cf <quaddobl_monodromy_breakup+0x3af>
mov    -0x1c(%rbp),%esi
sub    $0x1,%esi
lea    0xbb6(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x18(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quaddobl_monodromy_breakup>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r8d,%ebx
mov    %ecx,%r15d
mov    %edx,-0x3c(%rbp)
mov    %esi,-0x38(%rbp)
mov    %edi,-0x34(%rbp)
cmp    $0x1,%edi
jne    126f <quaddobl_monodromy_breakup+0x2f>
mov    %r15d,%edi
call   1110 <initialize_quaddobl_Laurent_sampler@plt>
jmp    1277 <quaddobl_monodromy_breakup+0x37>
mov    %r15d,%edi
call   10e0 <initialize_quaddobl_sampler@plt>
mov    -0x38(%rbp),%r14d
mov    %r14d,%edi
mov    %ebx,%esi
mov    %r15d,%edx
call   1130 <initialize_quaddobl_monodromy@plt>
lea    0xe89(%rip),%rdi
call   1070 <puts@plt>
xor    %eax,%eax
call   1140 <store_quaddobl_solutions@plt>
lea    0xeaa(%rip),%rdi
call   1070 <puts@plt>
mov    %ebx,-0x2c(%rbp)
mov    $0x1,%ebx
mov    $0x1,%edi
call   1050 <set_quaddobl_trace_slice@plt>
mov    -0x3c(%rbp),%r12d
mov    %r12d,%edi
call   10b0 <store_quaddobl_gammas@plt>
mov    -0x34(%rbp),%r13d
mov    %r13d,%edi
call   1120 <quaddobl_track_paths@plt>
xor    %eax,%eax
call   1140 <store_quaddobl_solutions@plt>
xor    %eax,%eax
call   1080 <restore_quaddobl_solutions@plt>
xor    %eax,%eax
call   10c0 <swap_quaddobl_slices@plt>
mov    $0x2,%edi
call   1050 <set_quaddobl_trace_slice@plt>
mov    %r12d,%edi
call   10b0 <store_quaddobl_gammas@plt>
mov    %r13d,%edi
call   1120 <quaddobl_track_paths@plt>
xor    %eax,%eax
call   1140 <store_quaddobl_solutions@plt>
xor    %eax,%eax
call   1080 <restore_quaddobl_solutions@plt>
xor    %eax,%eax
call   10c0 <swap_quaddobl_slices@plt>
lea    -0x78(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1060 <quaddobl_trace_grid_diagnostics@plt>
mov    %eax,%r13d
lea    0xe57(%rip),%rdi
call   1070 <puts@plt>
movsd  -0x78(%rbp),%xmm0
lea    0xcc3(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
movsd  -0x70(%rbp),%xmm0
lea    0xcd7(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
movl   $0x0,-0x44(%rbp)
test   %r14d,%r14d
jle    1547 <quaddobl_monodromy_breakup+0x307>
mov    -0x2c(%rbp),%r14d
mov    %r14d,%r14d
lea    0xf(,%r14,4),%rax
and    $0xfffffffffffffff0,%rax
mov    %rax,-0x50(%rbp)
lea    0xd1e(%rip),%r12
mov    %r15d,-0x48(%rbp)
nopl   0x0(%rax)
mov    %ebx,%esi
mov    %rsi,-0x58(%rbp)
lea    0xcb6(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %r15d,%edi
mov    -0x3c(%rbp),%ebx
mov    %ebx,%esi
call   1150 <new_quaddobl_slices@plt>
mov    %ebx,%edi
call   10b0 <store_quaddobl_gammas@plt>
mov    -0x34(%rbp),%r15d
mov    %r15d,%edi
call   1120 <quaddobl_track_paths@plt>
xor    %eax,%eax
call   1030 <solcon_clear_quaddobl_solutions@plt>
mov    %ebx,%edi
call   10b0 <store_quaddobl_gammas@plt>
mov    %r15d,%edi
call   1120 <quaddobl_track_paths@plt>
xor    %eax,%eax
call   1140 <store_quaddobl_solutions@plt>
mov    %rsp,%r15
mov    %rsp,%r13
sub    -0x50(%rbp),%r13
mov    %r13,%rsp
mov    -0x2c(%rbp),%ebx
mov    %ebx,%edi
mov    %r13,%rsi
call   10a0 <permutation_after_quaddobl_loop@plt>
lea    0xc85(%rip),%rdi
mov    -0x58(%rbp),%rsi
xor    %eax,%eax
call   1090 <printf@plt>
test   %ebx,%ebx
jle    1438 <quaddobl_monodromy_breakup+0x1f8>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x0(%r13,%rbx,4),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1090 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1420 <quaddobl_monodromy_breakup+0x1e0>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    %r15,%rsp
mov    -0x2c(%rbp),%edi
lea    -0x44(%rbp),%rsi
call   1100 <quaddobl_monodromy_permutation@plt>
mov    %rsp,-0x60(%rbp)
mov    %rsp,%r13
sub    -0x50(%rbp),%r13
mov    %r13,%rsp
lea    -0x30(%rbp),%rdi
call   10d0 <number_of_quaddobl_factors@plt>
mov    -0x30(%rbp),%esi
lea    0xc35(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
cmpl   $0x0,-0x30(%rbp)
jle    1510 <quaddobl_monodromy_breakup+0x2d0>
mov    $0x1,%r15d
jmp    14bc <quaddobl_monodromy_breakup+0x27c>
nopl   0x0(%rax,%rax,1)
mov    %r13,%rsi
lea    -0x68(%rbp),%rdx
call   1160 <quaddobl_trace_sum_difference@plt>
movsd  -0x68(%rbp),%xmm0
lea    0xb76(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
lea    0x1(%r15),%eax
cmp    -0x30(%rbp),%r15d
mov    %eax,%r15d
jge    1510 <quaddobl_monodromy_breakup+0x2d0>
mov    %r15d,%edi
lea    -0x40(%rbp),%rsi
mov    %r13,%rdx
call   10f0 <witness_points_of_quaddobl_factor@plt>
lea    0xbf9(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1090 <printf@plt>
mov    -0x40(%rbp),%edi
test   %edi,%edi
jle    1490 <quaddobl_monodromy_breakup+0x250>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x0(%r13,%rbx,4),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1090 <printf@plt>
add    $0x1,%rbx
movslq -0x40(%rbp),%rdi
cmp    %rdi,%rbx
jl     14f0 <quaddobl_monodromy_breakup+0x2b0>
jmp    1490 <quaddobl_monodromy_breakup+0x250>
xchg   %ax,%ax
mov    -0x60(%rbp),%rsp
xor    %eax,%eax
call   1080 <restore_quaddobl_solutions@plt>
mov    %eax,%r13d
mov    -0x44(%rbp),%eax
mov    -0x58(%rbp),%rsi
cmp    -0x38(%rbp),%esi
mov    -0x48(%rbp),%r15d
jge    1539 <quaddobl_monodromy_breakup+0x2f9>
lea    0x1(%rsi),%ebx
test   %eax,%eax
je     1390 <quaddobl_monodromy_breakup+0x150>
cmp    $0x1,%eax
jne    1549 <quaddobl_monodromy_breakup+0x309>
lea    0xb8c(%rip),%rdi
jmp    1550 <quaddobl_monodromy_breakup+0x310>
xor    %esi,%esi
lea    0xba6(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %r13d,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [53 x i8] c"\0AInitialized sampler and monodromy permutations ...\0A\00"
@.str.1 = [56 x i8] c"... initializing the grid in quad double precision ...\0A\00"
@.str.2 = [27 x i8] c"Trace grid diagnostics : \0A\00"
@.str.3 = [39 x i8] c" largest error of the samples : %.3e\0A\00"
@.str.4 = [44 x i8] c" smallest distance between samples : %.3e\0A\00"
@.str.5 = [52 x i8] c"... starting loop #%d in quad double precision ...\0A\00"
@.str.6 = [28 x i8] c"the permutation at step %d:\00"
@.str.7 = [4 x i8] c" %d\00"
@.str.8 = [2 x i8] c"\0A\00"
@.str.9 = [36 x i8] c"number of irreducible factors : %d\0A\00"
@.str.10 = [6 x i8] c" %d :\00"
@.str.11 = [9 x i8] c" : %.3e\0A\00"
@.str.12 = [37 x i8] c"Found factorization using %d loops.\0A\00"
@.str.13 = [34 x i8] c"Failed to factor using %d loops.\0A\00"
define i32 @quaddobl_monodromy_breakup(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca double
%16 = alloca double
%17 = alloca i8*
%18 = alloca i64
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i8*
%23 = alloca i64
%24 = alloca double
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%25 = load i32, i32* %6
%26 = icmp eq i32 %25, 1
br i1 %26, label %27, label %30
27: ; preds = %5
%28 = load i32, i32* %9
%29 = call i32 @initialize_quaddobl_Laurent_sampler(i32 %28)
store i32 %29, i32* %11
br label %33
30: ; preds = %5
%31 = load i32, i32* %9
%32 = call i32 @initialize_quaddobl_sampler(i32 %31)
store i32 %32, i32* %11
br label %33
33: ; preds = %30, %27
%34 = load i32, i32* %7
%35 = load i32, i32* %10
%36 = load i32, i32* %9
%37 = call i32 @initialize_quaddobl_monodromy(i32 %34, i32 %35, i32 %36)
store i32 %37, i32* %11
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%39 = call i32 (...) @store_quaddobl_solutions()
store i32 %39, i32* %11
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %12
br label %41
41: ; preds = %54, %33
%42 = load i32, i32* %12
%43 = icmp sle i32 %42, 2
br i1 %43, label %44, label %57
44: ; preds = %41
%45 = load i32, i32* %12
%46 = call i32 @set_quaddobl_trace_slice(i32 %45)
store i32 %46, i32* %11
%47 = load i32, i32* %8
%48 = call i32 @store_quaddobl_gammas(i32 %47)
store i32 %48, i32* %11
%49 = load i32, i32* %6
%50 = call i32 @quaddobl_track_paths(i32 %49)
store i32 %50, i32* %11
%51 = call i32 (...) @store_quaddobl_solutions()
store i32 %51, i32* %11
%52 = call i32 (...) @restore_quaddobl_solutions()
store i32 %52, i32* %11
%53 = call i32 (...) @swap_quaddobl_slices()
store i32 %53, i32* %11
br label %54
54: ; preds = %44
%55 = load i32, i32* %12
%56 = add nsw i32 %55, 1
store i32 %56, i32* %12
br label %41
57: ; preds = %41
%58 = call i32 @quaddobl_trace_grid_diagnostics(double* %15, double* %16)
store i32 %58, i32* %11
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%60 = load double, double* %15
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), double %60)
%62 = load double, double* %16
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0), double %62)
store i32 0, i32* %14
store i32 1, i32* %12
br label %64
64: ; preds = %155, %57
%65 = load i32, i32* %12
%66 = load i32, i32* %7
%67 = icmp sle i32 %65, %66
br i1 %67, label %68, label %71
68: ; preds = %64
%69 = load i32, i32* %14
%70 = icmp eq i32 %69, 0
br label %71
71: ; preds = %68, %64
%72 = phi i1 [ false, %64 ], [ %70, %68 ]
br i1 %72, label %73, label %158
73: ; preds = %71
%74 = load i32, i32* %12
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0), i32 %74)
%76 = load i32, i32* %9
%77 = load i32, i32* %8
%78 = call i32 @new_quaddobl_slices(i32 %76, i32 %77)
store i32 %78, i32* %11
%79 = load i32, i32* %8
%80 = call i32 @store_quaddobl_gammas(i32 %79)
store i32 %80, i32* %11
%81 = load i32, i32* %6
%82 = call i32 @quaddobl_track_paths(i32 %81)
store i32 %82, i32* %11
%83 = call i32 (...) @solcon_clear_quaddobl_solutions()
store i32 %83, i32* %11
%84 = load i32, i32* %8
%85 = call i32 @store_quaddobl_gammas(i32 %84)
store i32 %85, i32* %11
%86 = load i32, i32* %6
%87 = call i32 @quaddobl_track_paths(i32 %86)
store i32 %87, i32* %11
%88 = call i32 (...) @store_quaddobl_solutions()
store i32 %88, i32* %11
%89 = load i32, i32* %10
%90 = zext i32 %89 to i64
%91 = call i8* @llvm.stacksave()
store i8* %91, i8** %17
%92 = alloca i32, i64 %90
store i64 %90, i64* %18
%93 = load i32, i32* %10
%94 = call i32 @permutation_after_quaddobl_loop(i32 %93, i32* %92)
store i32 %94, i32* %11
%95 = load i32, i32* %12
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), i32 %95)
store i32 0, i32* %13
br label %97
97: ; preds = %107, %73
%98 = load i32, i32* %13
%99 = load i32, i32* %10
%100 = icmp slt i32 %98, %99
br i1 %100, label %101, label %110
101: ; preds = %97
%102 = load i32, i32* %13
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i32, i32* %92, i64 %103
%105 = load i32, i32* %104
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 %105)
br label %107
107: ; preds = %101
%108 = load i32, i32* %13
%109 = add nsw i32 %108, 1
store i32 %109, i32* %13
br label %97
110: ; preds = %97
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%112 = load i8*, i8** %17
%113 = load i32, i32* %10
%114 = call i32 @quaddobl_monodromy_permutation(i32 %113, i32* %14)
store i32 %114, i32* %11
%115 = load i32, i32* %10
%116 = zext i32 %115 to i64
%117 = call i8* @llvm.stacksave()
store i8* %117, i8** %22
%118 = alloca i32, i64 %116
store i64 %116, i64* %23
%119 = call i32 @number_of_quaddobl_factors(i32* %19)
store i32 %119, i32* %11
%120 = load i32, i32* %19
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i64 0, i64 0), i32 %120)
store i32 1, i32* %13
br label %122
122: ; preds = %149, %110
%123 = load i32, i32* %13
%124 = load i32, i32* %19
%125 = icmp sle i32 %123, %124
br i1 %125, label %126, label %152
126: ; preds = %122
%127 = load i32, i32* %13
%128 = call i32 @witness_points_of_quaddobl_factor(i32 %127, i32* %20, i32* %118)
store i32 %128, i32* %11
%129 = load i32, i32* %13
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i32 %129)
store i32 0, i32* %21
br label %131
131: ; preds = %141, %126
%132 = load i32, i32* %21
%133 = load i32, i32* %20
%134 = icmp slt i32 %132, %133
br i1 %134, label %135, label %144
135: ; preds = %131
%136 = load i32, i32* %21
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds i32, i32* %118, i64 %137
%139 = load i32, i32* %138
%140 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 %139)
br label %141
141: ; preds = %135
%142 = load i32, i32* %21
%143 = add nsw i32 %142, 1
store i32 %143, i32* %21
br label %131
144: ; preds = %131
%145 = load i32, i32* %20
%146 = call i32 @quaddobl_trace_sum_difference(i32 %145, i32* %118, double* %24)
store i32 %146, i32* %11
%147 = load double, double* %24
%148 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), double %147)
br label %149
149: ; preds = %144
%150 = load i32, i32* %13
%151 = add nsw i32 %150, 1
store i32 %151, i32* %13
br label %122
152: ; preds = %122
%153 = load i8*, i8** %22
%154 = call i32 (...) @restore_quaddobl_solutions()
store i32 %154, i32* %11
br label %155
155: ; preds = %152
%156 = load i32, i32* %12
%157 = add nsw i32 %156, 1
store i32 %157, i32* %12
br label %64
158: ; preds = %71
%159 = load i32, i32* %14
%160 = icmp eq i32 %159, 1
br i1 %160, label %161, label %165
161: ; preds = %158
%162 = load i32, i32* %12
%163 = sub nsw i32 %162, 1
%164 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.12, i64 0, i64 0), i32 %163)
br label %169
165: ; preds = %158
%166 = load i32, i32* %12
%167 = sub nsw i32 %166, 1
%168 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0), i32 %167)
br label %169
169: ; preds = %165, %161
%170 = load i32, i32* %11
ret i32 %170
}

LLVM IR (-O2):
@.str.3 = [39 x i8] c" largest error of the samples : %.3e\0A\00"
@.str.4 = [44 x i8] c" smallest distance between samples : %.3e\0A\00"
@.str.5 = [52 x i8] c"... starting loop #%d in quad double precision ...\0A\00"
@.str.6 = [28 x i8] c"the permutation at step %d:\00"
@.str.7 = [4 x i8] c" %d\00"
@.str.9 = [36 x i8] c"number of irreducible factors : %d\0A\00"
@.str.10 = [6 x i8] c" %d :\00"
@.str.11 = [9 x i8] c" : %.3e\0A\00"
@.str.12 = [37 x i8] c"Found factorization using %d loops.\0A\00"
@.str.13 = [34 x i8] c"Failed to factor using %d loops.\0A\00"
@str = [52 x i8] c"\0AInitialized sampler and monodromy permutations ...\00"
@str.14 = [55 x i8] c"... initializing the grid in quad double precision ...\00"
@str.15 = [26 x i8] c"Trace grid diagnostics : \00"
define i32 @quaddobl_monodromy_breakup(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = bitcast i32* %6 to i8*
%13 = bitcast double* %7 to i8*
%14 = bitcast double* %8 to i8*
%15 = icmp eq i32 %0, 1
br i1 %15, label %16, label %18
16: ; preds = %5
%17 = tail call i32 @initialize_quaddobl_Laurent_sampler(i32 %3)
br label %20
18: ; preds = %5
%19 = tail call i32 @initialize_quaddobl_sampler(i32 %3)
br label %20
20: ; preds = %18, %16
%21 = tail call i32 @initialize_quaddobl_monodromy(i32 %1, i32 %4, i32 %3)
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
%23 = tail call i32 (...) @store_quaddobl_solutions()
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.14, i64 0, i64 0))
%25 = tail call i32 @set_quaddobl_trace_slice(i32 1)
%26 = tail call i32 @store_quaddobl_gammas(i32 %2)
%27 = tail call i32 @quaddobl_track_paths(i32 %0)
%28 = tail call i32 (...) @store_quaddobl_solutions()
%29 = tail call i32 (...) @restore_quaddobl_solutions()
%30 = tail call i32 (...) @swap_quaddobl_slices()
%31 = tail call i32 @set_quaddobl_trace_slice(i32 2)
%32 = tail call i32 @store_quaddobl_gammas(i32 %2)
%33 = tail call i32 @quaddobl_track_paths(i32 %0)
%34 = tail call i32 (...) @store_quaddobl_solutions()
%35 = tail call i32 (...) @restore_quaddobl_solutions()
%36 = tail call i32 (...) @swap_quaddobl_slices()
%37 = call i32 @quaddobl_trace_grid_diagnostics(double* %7, double* %8)
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.15, i64 0, i64 0))
%39 = load double, double* %7
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), double %39)
%41 = load double, double* %8
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0), double %41)
store i32 0, i32* %6
%43 = icmp sgt i32 %1, 0
br i1 %43, label %44, label %115
44: ; preds = %20
%45 = zext i32 %4 to i64
%46 = icmp sgt i32 %4, 0
%47 = bitcast i32* %9 to i8*
%48 = bitcast i32* %10 to i8*
%49 = bitcast double* %11 to i8*
br label %50
50: ; preds = %44, %104
%51 = phi i32 [ 1, %44 ], [ %106, %104 ]
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0), i32 %51)
%53 = call i32 @new_quaddobl_slices(i32 %3, i32 %2)
%54 = call i32 @store_quaddobl_gammas(i32 %2)
%55 = call i32 @quaddobl_track_paths(i32 %0)
%56 = call i32 (...) @solcon_clear_quaddobl_solutions()
%57 = call i32 @store_quaddobl_gammas(i32 %2)
%58 = call i32 @quaddobl_track_paths(i32 %0)
%59 = call i32 (...) @store_quaddobl_solutions()
%60 = call i8* @llvm.stacksave()
%61 = alloca i32, i64 %45
%62 = call i32 @permutation_after_quaddobl_loop(i32 %4, i32* %61)
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), i32 %51)
br i1 %46, label %64, label %71
64: ; preds = %50, %64
%65 = phi i64 [ %69, %64 ], [ 0, %50 ]
%66 = getelementptr inbounds i32, i32* %61, i64 %65
%67 = load i32, i32* %66
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 %67)
%69 = add nuw nsw i64 %65, 1
%70 = icmp eq i64 %69, %45
br i1 %70, label %71, label %64
71: ; preds = %64, %50
%72 = call i32 @putchar(i32 10)
%73 = call i32 @quaddobl_monodromy_permutation(i32 %4, i32* %6)
%74 = call i8* @llvm.stacksave()
%75 = alloca i32, i64 %45
%76 = call i32 @number_of_quaddobl_factors(i32* %9)
%77 = load i32, i32* %9
%78 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i64 0, i64 0), i32 %77)
%79 = load i32, i32* %9
%80 = icmp slt i32 %79, 1
br i1 %80, label %104, label %81
81: ; preds = %71, %96
%82 = phi i32 [ %101, %96 ], [ 1, %71 ]
%83 = call i32 @witness_points_of_quaddobl_factor(i32 %82, i32* %10, i32* %75)
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i32 %82)
%85 = load i32, i32* %10
%86 = icmp sgt i32 %85, 0
br i1 %86, label %87, label %96
87: ; preds = %81, %87
%88 = phi i64 [ %92, %87 ], [ 0, %81 ]
%89 = getelementptr inbounds i32, i32* %75, i64 %88
%90 = load i32, i32* %89
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 %90)
%92 = add nuw nsw i64 %88, 1
%93 = load i32, i32* %10
%94 = sext i32 %93 to i64
%95 = icmp slt i64 %92, %94
br i1 %95, label %87, label %96
96: ; preds = %87, %81
%97 = phi i32 [ %85, %81 ], [ %93, %87 ]
%98 = call i32 @quaddobl_trace_sum_difference(i32 %97, i32* %75, double* %11)
%99 = load double, double* %11
%100 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), double %99)
%101 = add nuw nsw i32 %82, 1
%102 = load i32, i32* %9
%103 = icmp slt i32 %82, %102
br i1 %103, label %81, label %104
104: ; preds = %96, %71
%105 = call i32 (...) @restore_quaddobl_solutions()
%106 = add nuw nsw i32 %51, 1
%107 = load i32, i32* %6
%108 = icmp slt i32 %51, %1
%109 = icmp eq i32 %107, 0
%110 = select i1 %108, i1 %109, i1 false
br i1 %110, label %50, label %111
111: ; preds = %104
%112 = icmp eq i32 %107, 1
br i1 %112, label %113, label %115
113: ; preds = %111
%114 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.12, i64 0, i64 0), i32 %51)
br label %119
115: ; preds = %20, %111
%116 = phi i32 [ %105, %111 ], [ %37, %20 ]
%117 = phi i32 [ %51, %111 ], [ 0, %20 ]
%118 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0), i32 %117)
br label %119
119: ; preds = %115, %113
%120 = phi i32 [ %116, %115 ], [ %105, %113 ]
ret i32 %120
}