#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 padcon_get_homotopy_continuation_parameter(int, double *);
int padcon_get_quaddobl_denominator_coefficient(int, int, int /*<<< orphan*/,
                                                double *, double *);
int padcon_get_quaddobl_numerator_coefficient(int, int, int /*<<< orphan*/,
                                              double *, double *);
int /*<<< orphan*/ printf(char *, int, ...);
void show_quaddobl_pade_coefficients(int dim) {
  int fail, lead, idx, numdeg, dendeg;
  double val, re, im;
  fail = padcon_get_homotopy_continuation_parameter(2, &val);
  numdeg = (int)val;
  fail = padcon_get_homotopy_continuation_parameter(3, &val);
  dendeg = (int)val;
  for (lead = 1; lead <= dim; lead++) {
    printf("Numerator coefficient of Pade approximant %d :\n", lead);
    for (idx = 0; idx <= numdeg; idx++) {
      fail = padcon_get_quaddobl_numerator_coefficient(lead, idx, 0, &re, &im);
      printf(" %d : %.14e  %.14e\n", idx, re, im);
    }
  }
  for (lead = 1; lead <= dim; lead++) {
    printf("Denominator coefficient of Pade approximant %d :\n", lead);
    for (idx = 0; idx <= dendeg; idx++) {
      fail =
          padcon_get_quaddobl_denominator_coefficient(lead, idx, 0, &re, &im);
      printf(" %d : %.14e  %.14e\n", idx, re, im);
    }
  }
}


x86 assembly (clang, -O0):
<show_quaddobl_pade_coefficients>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2,%edi
lea    -0x20(%rbp),%rsi
call   1030 <padcon_get_homotopy_continuation_parameter@plt>
mov    %eax,-0x8(%rbp)
cvttsd2si -0x20(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x3,%edi
lea    -0x20(%rbp),%rsi
call   1030 <padcon_get_homotopy_continuation_parameter@plt>
mov    %eax,-0x8(%rbp)
cvttsd2si -0x20(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1208 <show_quaddobl_pade_coefficients+0xc8>
mov    -0xc(%rbp),%esi
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11f5 <show_quaddobl_pade_coefficients+0xb5>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
xor    %edx,%edx
lea    -0x28(%rbp),%rcx
lea    -0x30(%rbp),%r8
call   1040 <padcon_get_quaddobl_numerator_coefficient@plt>
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%esi
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
lea    0xe50(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11a8 <show_quaddobl_pade_coefficients+0x68>
jmp    11fa <show_quaddobl_pade_coefficients+0xba>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1184 <show_quaddobl_pade_coefficients+0x44>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1293 <show_quaddobl_pade_coefficients+0x153>
mov    -0xc(%rbp),%esi
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     1280 <show_quaddobl_pade_coefficients+0x140>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
xor    %edx,%edx
lea    -0x28(%rbp),%rcx
lea    -0x30(%rbp),%r8
call   1060 <padcon_get_quaddobl_denominator_coefficient@plt>
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%esi
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
lea    0xdc5(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1233 <show_quaddobl_pade_coefficients+0xf3>
jmp    1285 <show_quaddobl_pade_coefficients+0x145>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    120f <show_quaddobl_pade_coefficients+0xcf>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_quaddobl_pade_coefficients>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %edi,%ebp
lea    0x28(%rsp),%rbx
mov    $0x2,%edi
mov    %rbx,%rsi
call   1030 <padcon_get_homotopy_continuation_parameter@plt>
cvttsd2si 0x28(%rsp),%r14d
mov    $0x3,%edi
mov    %rbx,%rsi
call   1030 <padcon_get_homotopy_continuation_parameter@plt>
mov    %ebp,0xc(%rsp)
test   %ebp,%ebp
jle    12b6 <show_quaddobl_pade_coefficients+0x176>
cvttsd2si 0x28(%rsp),%eax
mov    %rax,0x20(%rsp)
lea    0x1(%r14),%r15d
mov    $0x1,%ebx
lea    0x18(%rsp),%r12
lea    0x10(%rsp),%r13
lea    0xe89(%rip),%rbp
mov    %r14,0x30(%rsp)
jmp    11c0 <show_quaddobl_pade_coefficients+0x80>
xchg   %ax,%ax
lea    0x1(%rbx),%eax
cmp    0xc(%rsp),%ebx
mov    %eax,%ebx
mov    0x30(%rsp),%r14
je     1216 <show_quaddobl_pade_coefficients+0xd6>
lea    0xe39(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r14d,%r14d
js     11b0 <show_quaddobl_pade_coefficients+0x70>
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r14d,%esi
xor    %edx,%edx
mov    %r12,%rcx
mov    %r13,%r8
call   1040 <padcon_get_quaddobl_numerator_coefficient@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    %rbp,%rdi
mov    %r14d,%esi
mov    $0x2,%al
call   1050 <printf@plt>
add    $0x1,%r14d
cmp    %r14d,%r15d
jne    11e0 <show_quaddobl_pade_coefficients+0xa0>
jmp    11b0 <show_quaddobl_pade_coefficients+0x70>
cmpl   $0x0,0xc(%rsp)
jle    12b6 <show_quaddobl_pade_coefficients+0x176>
mov    0x20(%rsp),%rax
lea    0x1(%rax),%ebp
mov    $0x1,%ebx
lea    0x18(%rsp),%r12
lea    0x10(%rsp),%r13
lea    0xdf1(%rip),%r15
jmp    125b <show_quaddobl_pade_coefficients+0x11b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x1(%rbx),%eax
cmp    0xc(%rsp),%ebx
mov    %eax,%ebx
je     12b6 <show_quaddobl_pade_coefficients+0x176>
lea    0xde2(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0x20(%rsp)
js     1250 <show_quaddobl_pade_coefficients+0x110>
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
mov    %r14d,%esi
xor    %edx,%edx
mov    %r12,%rcx
mov    %r13,%r8
call   1060 <padcon_get_quaddobl_denominator_coefficient@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    %r15,%rdi
mov    %r14d,%esi
mov    $0x2,%al
call   1050 <printf@plt>
add    $0x1,%r14d
cmp    %r14d,%ebp
jne    1280 <show_quaddobl_pade_coefficients+0x140>
jmp    1250 <show_quaddobl_pade_coefficients+0x110>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [48 x i8] c"Numerator coefficient of Pade approximant %d :\0A\00"
@.str.1 = [20 x i8] c" %d : %.14e %.14e\0A\00"
@.str.2 = [50 x i8] c"Denominator coefficient of Pade approximant %d :\0A\00"
define void @show_quaddobl_pade_coefficients(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca double
store i32 %0, i32* %2
%11 = call i32 @padcon_get_homotopy_continuation_parameter(i32 2, double* %8)
store i32 %11, i32* %3
%12 = load double, double* %8
%13 = fptosi double %12 to i32
store i32 %13, i32* %6
%14 = call i32 @padcon_get_homotopy_continuation_parameter(i32 3, double* %8)
store i32 %14, i32* %3
%15 = load double, double* %8
%16 = fptosi double %15 to i32
store i32 %16, i32* %7
store i32 1, i32* %4
br label %17
17: ; preds = %40, %1
%18 = load i32, i32* %4
%19 = load i32, i32* %2
%20 = icmp sle i32 %18, %19
br i1 %20, label %21, label %43
21: ; preds = %17
%22 = load i32, i32* %4
%23 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %22)
store i32 0, i32* %5
br label %24
24: ; preds = %36, %21
%25 = load i32, i32* %5
%26 = load i32, i32* %6
%27 = icmp sle i32 %25, %26
br i1 %27, label %28, label %39
28: ; preds = %24
%29 = load i32, i32* %4
%30 = load i32, i32* %5
%31 = call i32 @padcon_get_quaddobl_numerator_coefficient(i32 %29, i32 %30, i32 0, double* %9, double* %10)
store i32 %31, i32* %3
%32 = load i32, i32* %5
%33 = load double, double* %9
%34 = load double, double* %10
%35 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %32, double %33, double %34)
br label %36
36: ; preds = %28
%37 = load i32, i32* %5
%38 = add nsw i32 %37, 1
store i32 %38, i32* %5
br label %24
39: ; preds = %24
br label %40
40: ; preds = %39
%41 = load i32, i32* %4
%42 = add nsw i32 %41, 1
store i32 %42, i32* %4
br label %17
43: ; preds = %17
store i32 1, i32* %4
br label %44
44: ; preds = %67, %43
%45 = load i32, i32* %4
%46 = load i32, i32* %2
%47 = icmp sle i32 %45, %46
br i1 %47, label %48, label %70
48: ; preds = %44
%49 = load i32, i32* %4
%50 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0), i32 %49)
store i32 0, i32* %5
br label %51
51: ; preds = %63, %48
%52 = load i32, i32* %5
%53 = load i32, i32* %7
%54 = icmp sle i32 %52, %53
br i1 %54, label %55, label %66
55: ; preds = %51
%56 = load i32, i32* %4
%57 = load i32, i32* %5
%58 = call i32 @padcon_get_quaddobl_denominator_coefficient(i32 %56, i32 %57, i32 0, double* %9, double* %10)
store i32 %58, i32* %3
%59 = load i32, i32* %5
%60 = load double, double* %9
%61 = load double, double* %10
%62 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %59, double %60, double %61)
br label %63
63: ; preds = %55
%64 = load i32, i32* %5
%65 = add nsw i32 %64, 1
store i32 %65, i32* %5
br label %51
66: ; preds = %51
br label %67
67: ; preds = %66
%68 = load i32, i32* %4
%69 = add nsw i32 %68, 1
store i32 %69, i32* %4
br label %44
70: ; preds = %44
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"Numerator coefficient of Pade approximant %d :\0A\00"
@.str.1 = [20 x i8] c" %d : %.14e %.14e\0A\00"
@.str.2 = [50 x i8] c"Denominator coefficient of Pade approximant %d :\0A\00"
define void @show_quaddobl_pade_coefficients(i32 %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = bitcast double* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = bitcast double* %4 to i8*
%8 = call i32 @padcon_get_homotopy_continuation_parameter(i32 2, double* %2)
%9 = load double, double* %2
%10 = fptosi double %9 to i32
%11 = call i32 @padcon_get_homotopy_continuation_parameter(i32 3, double* %2)
%12 = load double, double* %2
%13 = fptosi double %12 to i32
%14 = icmp slt i32 %0, 1
br i1 %14, label %48, label %15
15: ; preds = %1
%16 = icmp slt i32 %10, 0
br label %20
17: ; preds = %31
br i1 %14, label %48, label %18
18: ; preds = %17
%19 = icmp slt i32 %13, 0
br label %34
20: ; preds = %15, %31
%21 = phi i32 [ 1, %15 ], [ %32, %31 ]
%22 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %21)
br i1 %16, label %31, label %23
23: ; preds = %20, %23
%24 = phi i32 [ %29, %23 ], [ 0, %20 ]
%25 = call i32 @padcon_get_quaddobl_numerator_coefficient(i32 %21, i32 %24, i32 0, double* %3, double* %4)
%26 = load double, double* %3
%27 = load double, double* %4
%28 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %24, double %26, double %27)
%29 = add nuw i32 %24, 1
%30 = icmp eq i32 %24, %10
br i1 %30, label %31, label %23
31: ; preds = %23, %20
%32 = add nuw i32 %21, 1
%33 = icmp eq i32 %21, %0
br i1 %33, label %17, label %20
34: ; preds = %18, %45
%35 = phi i32 [ 1, %18 ], [ %46, %45 ]
%36 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0), i32 %35)
br i1 %19, label %45, label %37
37: ; preds = %34, %37
%38 = phi i32 [ %43, %37 ], [ 0, %34 ]
%39 = call i32 @padcon_get_quaddobl_denominator_coefficient(i32 %35, i32 %38, i32 0, double* %3, double* %4)
%40 = load double, double* %3
%41 = load double, double* %4
%42 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %38, double %40, double %41)
%43 = add nuw i32 %38, 1
%44 = icmp eq i32 %38, %13
br i1 %44, label %45, label %37
45: ; preds = %37, %34
%46 = add nuw i32 %35, 1
%47 = icmp eq i32 %35, %0
br i1 %47, label %48, label %34
48: ; preds = %45, %1, %17
ret void
}