#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 */
char getchar();
int padcon_get_quaddobl_closest_pole(double *, double *);
int padcon_get_quaddobl_estimated_distance(double *);
int padcon_get_quaddobl_hessian_step(double *);
int padcon_get_quaddobl_pole_radius(double *);
int padcon_get_quaddobl_pole_step(double *);
int padcon_get_quaddobl_step_size(double *);
int padcon_get_quaddobl_t_value(double *);
int padcon_initialize_quaddobl_solution(int, int);
int padcon_quaddobl_predict_correct(int *, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ show_quaddobl_pade_coefficients(int);
int /*<<< orphan*/ show_quaddobl_poles(int);
int /*<<< orphan*/ show_quaddobl_series_coefficients(int);
int /*<<< orphan*/ show_quaddobl_solution(int);
int solcon_dimension_of_quaddobl_solutions(int *);
void quaddobl_next_loop(int index) {
  int fail, length, failed, dim;
  char contstep, nlsb;
  double frp, re_pole, im_pole, tval, step, pstep, dstep, eta;
  fail = padcon_initialize_quaddobl_solution(index, 1);
  fail = solcon_dimension_of_quaddobl_solutions(&dim);
  do {
    fail = padcon_quaddobl_predict_correct(&failed, 1);
    show_quaddobl_series_coefficients(dim);
    show_quaddobl_pade_coefficients(dim);
    show_quaddobl_poles(dim);
    if (failed != 0)
      contstep = 'n';
    else {
      fail = padcon_get_quaddobl_pole_radius(&frp);
      fail = padcon_get_quaddobl_closest_pole(&re_pole, &im_pole);
      fail = padcon_get_quaddobl_t_value(&tval);
      fail = padcon_get_quaddobl_step_size(&step);
      fail = padcon_get_quaddobl_pole_step(&pstep);
      fail = padcon_get_quaddobl_hessian_step(&dstep);
      fail = padcon_get_quaddobl_estimated_distance(&eta);
      printf("pole step : %.3e  Hessian step : %.3e\n", pstep, dstep);
      printf("t : %.3e  step : %.3e\n", tval, step);
      printf("Smallest pole radius : %.3e  eta : %.3e\n", frp, eta);
      printf("Closest pole : %.14e  %.14e\n", re_pole, im_pole);
      show_quaddobl_solution(index);
      printf("continue ? (y/n) ");
      contstep = getchar();
      scanf("%c", &nlsb);
    }
  } while (contstep == 'y');
}


x86 assembly (clang, -O0):
<quaddobl_next_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1100 <padcon_initialize_quaddobl_solution@plt>
mov    %eax,-0x8(%rbp)
lea    -0x14(%rbp),%rdi
call   10e0 <solcon_dimension_of_quaddobl_solutions@plt>
mov    %eax,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   10c0 <padcon_quaddobl_predict_correct@plt>
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <show_quaddobl_series_coefficients@plt>
mov    -0x14(%rbp),%edi
call   1080 <show_quaddobl_pade_coefficients@plt>
mov    -0x14(%rbp),%edi
call   1030 <show_quaddobl_poles@plt>
cmpl   $0x0,-0x10(%rbp)
je     1273 <quaddobl_next_loop+0x63>
movb   $0x6e,-0x15(%rbp)
jmp    135b <quaddobl_next_loop+0x14b>
lea    -0x20(%rbp),%rdi
call   1110 <padcon_get_quaddobl_pole_radius@plt>
mov    %eax,-0x8(%rbp)
lea    -0x28(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   10a0 <padcon_get_quaddobl_closest_pole@plt>
mov    %eax,-0x8(%rbp)
lea    -0x38(%rbp),%rdi
call   10b0 <padcon_get_quaddobl_t_value@plt>
mov    %eax,-0x8(%rbp)
lea    -0x40(%rbp),%rdi
call   1130 <padcon_get_quaddobl_step_size@plt>
mov    %eax,-0x8(%rbp)
lea    -0x48(%rbp),%rdi
call   1040 <padcon_get_quaddobl_pole_step@plt>
mov    %eax,-0x8(%rbp)
lea    -0x50(%rbp),%rdi
call   1060 <padcon_get_quaddobl_hessian_step@plt>
mov    %eax,-0x8(%rbp)
lea    -0x58(%rbp),%rdi
call   10f0 <padcon_get_quaddobl_estimated_distance@plt>
mov    %eax,-0x8(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
lea    0xd24(%rip),%rdi
mov    $0x2,%al
call   1090 <printf@plt>
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
lea    0xd33(%rip),%rdi
mov    $0x2,%al
call   1090 <printf@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
lea    0xd32(%rip),%rdi
mov    $0x2,%al
call   1090 <printf@plt>
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
lea    0xd43(%rip),%rdi
mov    $0x2,%al
call   1090 <printf@plt>
mov    -0x4(%rbp),%edi
call   1070 <show_quaddobl_solution@plt>
lea    0xd4a(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    $0x0,%al
call   10d0 <getchar@plt>
mov    %al,-0x15(%rbp)
lea    0xd44(%rip),%rdi
lea    -0x16(%rbp),%rsi
call   1120 <scanf@plt>
jmp    1360 <quaddobl_next_loop+0x150>
movsbl -0x15(%rbp),%eax
cmp    $0x79,%eax
je     1237 <quaddobl_next_loop+0x27>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quaddobl_next_loop>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %edi,%ebx
mov    $0x1,%esi
call   1100 <padcon_initialize_quaddobl_solution@plt>
lea    0xc(%rsp),%rdi
call   10e0 <solcon_dimension_of_quaddobl_solutions@plt>
lea    0xe2c(%rip),%r13
lea    0xe42(%rip),%rbp
lea    0xe4d(%rip),%r15
lea    0x13(%rsp),%r14
xchg   %ax,%ax
lea    0x14(%rsp),%rdi
mov    $0x1,%esi
call   10c0 <padcon_quaddobl_predict_correct@plt>
mov    0xc(%rsp),%edi
call   1050 <show_quaddobl_series_coefficients@plt>
mov    0xc(%rsp),%edi
call   1080 <show_quaddobl_pade_coefficients@plt>
mov    0xc(%rsp),%edi
call   1030 <show_quaddobl_poles@plt>
cmpl   $0x0,0x14(%rsp)
jne    1364 <quaddobl_next_loop+0x154>
lea    0x50(%rsp),%rdi
call   1110 <padcon_get_quaddobl_pole_radius@plt>
lea    0x48(%rsp),%rdi
lea    0x40(%rsp),%rsi
call   10a0 <padcon_get_quaddobl_closest_pole@plt>
lea    0x38(%rsp),%rdi
call   10b0 <padcon_get_quaddobl_t_value@plt>
lea    0x30(%rsp),%rdi
call   1130 <padcon_get_quaddobl_step_size@plt>
lea    0x28(%rsp),%rdi
call   1040 <padcon_get_quaddobl_pole_step@plt>
lea    0x20(%rsp),%rdi
call   1060 <padcon_get_quaddobl_hessian_step@plt>
lea    0x18(%rsp),%rdi
call   10f0 <padcon_get_quaddobl_estimated_distance@plt>
movsd  0x28(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
lea    0xd1d(%rip),%rdi
mov    $0x2,%al
call   1090 <printf@plt>
movsd  0x38(%rsp),%xmm0
movsd  0x30(%rsp),%xmm1
lea    0xd2a(%rip),%rdi
mov    $0x2,%al
call   1090 <printf@plt>
movsd  0x50(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
lea    0xd27(%rip),%rdi
mov    $0x2,%al
call   1090 <printf@plt>
movsd  0x48(%rsp),%xmm0
movsd  0x40(%rsp),%xmm1
mov    %r13,%rdi
mov    $0x2,%al
call   1090 <printf@plt>
mov    %ebx,%edi
call   1070 <show_quaddobl_solution@plt>
mov    %rbp,%rdi
xor    %eax,%eax
call   1090 <printf@plt>
xor    %eax,%eax
call   10d0 <getchar@plt>
mov    %eax,%r12d
mov    %r15,%rdi
mov    %r14,%rsi
call   1120 <scanf@plt>
cmp    $0x79,%r12b
je     1250 <quaddobl_next_loop+0x40>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [39 x i8] c"pole step : %.3e Hessian step : %.3e\0A\00"
@.str.1 = [23 x i8] c"t : %.3e step : %.3e\0A\00"
@.str.2 = [41 x i8] c"Smallest pole radius : %.3e eta : %.3e\0A\00"
@.str.3 = [29 x i8] c"Closest pole : %.14e %.14e\0A\00"
@.str.4 = [18 x i8] c"continue ? (y/n) \00"
@.str.5 = [3 x i8] c"%c\00"
define void @quaddobl_next_loop(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
%8 = alloca i8
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
store i32 %0, i32* %2
%17 = load i32, i32* %2
%18 = call i32 @padcon_initialize_quaddobl_solution(i32 %17, i32 1)
store i32 %18, i32* %3
%19 = call i32 @solcon_dimension_of_quaddobl_solutions(i32* %6)
store i32 %19, i32* %3
br label %20
20: ; preds = %57, %1
%21 = call i32 @padcon_quaddobl_predict_correct(i32* %5, i32 1)
store i32 %21, i32* %3
%22 = load i32, i32* %6
%23 = call i32 @show_quaddobl_series_coefficients(i32 %22)
%24 = load i32, i32* %6
%25 = call i32 @show_quaddobl_pade_coefficients(i32 %24)
%26 = load i32, i32* %6
%27 = call i32 @show_quaddobl_poles(i32 %26)
%28 = load i32, i32* %5
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %20
store i8 110, i8* %7
br label %56
31: ; preds = %20
%32 = call i32 @padcon_get_quaddobl_pole_radius(double* %9)
store i32 %32, i32* %3
%33 = call i32 @padcon_get_quaddobl_closest_pole(double* %10, double* %11)
store i32 %33, i32* %3
%34 = call i32 @padcon_get_quaddobl_t_value(double* %12)
store i32 %34, i32* %3
%35 = call i32 @padcon_get_quaddobl_step_size(double* %13)
store i32 %35, i32* %3
%36 = call i32 @padcon_get_quaddobl_pole_step(double* %14)
store i32 %36, i32* %3
%37 = call i32 @padcon_get_quaddobl_hessian_step(double* %15)
store i32 %37, i32* %3
%38 = call i32 @padcon_get_quaddobl_estimated_distance(double* %16)
store i32 %38, i32* %3
%39 = load double, double* %14
%40 = load double, double* %15
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), double %39, double %40)
%42 = load double, double* %12
%43 = load double, double* %13
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), double %42, double %43)
%45 = load double, double* %9
%46 = load double, double* %16
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), double %45, double %46)
%48 = load double, double* %10
%49 = load double, double* %11
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), double %48, double %49)
%51 = load i32, i32* %2
%52 = call i32 @show_quaddobl_solution(i32 %51)
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%54 = call signext i8 (...) @getchar()
store i8 %54, i8* %7
%55 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %8)
br label %56
56: ; preds = %31, %30
br label %57
57: ; preds = %56
%58 = load i8, i8* %7
%59 = sext i8 %58 to i32
%60 = icmp eq i32 %59, 121
br i1 %60, label %20, label %61
61: ; preds = %57
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"pole step : %.3e Hessian step : %.3e\0A\00"
@.str.1 = [23 x i8] c"t : %.3e step : %.3e\0A\00"
@.str.2 = [41 x i8] c"Smallest pole radius : %.3e eta : %.3e\0A\00"
@.str.3 = [29 x i8] c"Closest pole : %.14e %.14e\0A\00"
@.str.4 = [18 x i8] c"continue ? (y/n) \00"
@.str.5 = [3 x i8] c"%c\00"
define void @quaddobl_next_loop(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = bitcast i32* %2 to i8*
%14 = bitcast i32* %3 to i8*
%15 = bitcast double* %5 to i8*
%16 = bitcast double* %6 to i8*
%17 = bitcast double* %7 to i8*
%18 = bitcast double* %8 to i8*
%19 = bitcast double* %9 to i8*
%20 = bitcast double* %10 to i8*
%21 = bitcast double* %11 to i8*
%22 = bitcast double* %12 to i8*
%23 = tail call i32 @padcon_initialize_quaddobl_solution(i32 %0, i32 1)
%24 = call i32 @solcon_dimension_of_quaddobl_solutions(i32* %3)
br label %25
25: ; preds = %35, %1
%26 = call i32 @padcon_quaddobl_predict_correct(i32* %2, i32 1)
%27 = load i32, i32* %3
%28 = call i32 @show_quaddobl_series_coefficients(i32 %27)
%29 = load i32, i32* %3
%30 = call i32 @show_quaddobl_pade_coefficients(i32 %29)
%31 = load i32, i32* %3
%32 = call i32 @show_quaddobl_poles(i32 %31)
%33 = load i32, i32* %2
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %60
35: ; preds = %25
%36 = call i32 @padcon_get_quaddobl_pole_radius(double* %5)
%37 = call i32 @padcon_get_quaddobl_closest_pole(double* %6, double* %7)
%38 = call i32 @padcon_get_quaddobl_t_value(double* %8)
%39 = call i32 @padcon_get_quaddobl_step_size(double* %9)
%40 = call i32 @padcon_get_quaddobl_pole_step(double* %10)
%41 = call i32 @padcon_get_quaddobl_hessian_step(double* %11)
%42 = call i32 @padcon_get_quaddobl_estimated_distance(double* %12)
%43 = load double, double* %10
%44 = load double, double* %11
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), double %43, double %44)
%46 = load double, double* %8
%47 = load double, double* %9
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), double %46, double %47)
%49 = load double, double* %5
%50 = load double, double* %12
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), double %49, double %50)
%52 = load double, double* %6
%53 = load double, double* %7
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), double %52, double %53)
%55 = call i32 @show_quaddobl_solution(i32 %0)
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%57 = call signext i8 (...) @getchar()
%58 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %4)
%59 = icmp eq i8 %57, 121
br i1 %59, label %25, label %60
60: ; preds = %25, %35
ret void
}