#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_dobldobl_pole(int, int, int /*<<< orphan*/, double *, double *);
int padcon_get_homotopy_continuation_parameter(int, double *);
int /*<<< orphan*/ printf(char *, int, ...);
void show_dobldobl_poles(int dim) {
  int fail, dendeg, leadidx, poleidx;
  double val, re, im;
  fail = padcon_get_homotopy_continuation_parameter(3, &val);
  dendeg = (int)val;
  for (leadidx = 1; leadidx <= dim; leadidx++) {
    printf("poles for Pade approximant %d :\n", leadidx);
    for (poleidx = 1; poleidx <= dendeg; poleidx++) {
      fail = padcon_get_dobldobl_pole(leadidx, poleidx, 0, &re, &im);
      printf(" %d : %.14e  %.14e\n", poleidx, re, im);
    }
  }
}


x86 assembly (clang, -O0):
<show_dobldobl_poles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%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,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     11df <show_dobldobl_poles+0xaf>
mov    -0x10(%rbp),%esi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11cc <show_dobldobl_poles+0x9c>
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
xor    %edx,%edx
lea    -0x28(%rbp),%rcx
lea    -0x30(%rbp),%r8
call   1050 <padcon_get_dobldobl_pole@plt>
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%esi
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
lea    0xe6a(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    117f <show_dobldobl_poles+0x4f>
jmp    11d1 <show_dobldobl_poles+0xa1>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    115b <show_dobldobl_poles+0x2b>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_dobldobl_poles>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %edi,%ebx
lea    0x20(%rsp),%rsi
mov    $0x3,%edi
call   1030 <padcon_get_homotopy_continuation_parameter@plt>
mov    %ebx,0xc(%rsp)
test   %ebx,%ebx
jle    1202 <show_dobldobl_poles+0xd2>
cvttsd2si 0x20(%rsp),%eax
mov    %eax,0x8(%rsp)
mov    %eax,%r15d
neg    %r15d
mov    $0x1,%ebx
lea    0x18(%rsp),%r12
lea    0x10(%rsp),%r13
lea    0xea0(%rip),%rbp
jmp    119b <show_dobldobl_poles+0x6b>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0x1(%rbx),%eax
cmp    0xc(%rsp),%ebx
mov    %eax,%ebx
je     1202 <show_dobldobl_poles+0xd2>
lea    0xe5e(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x0,0x8(%rsp)
jle    1190 <show_dobldobl_poles+0x60>
mov    $0x1,%r14d
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r14d,%esi
xor    %edx,%edx
mov    %r12,%rcx
mov    %r13,%r8
call   1050 <padcon_get_dobldobl_pole@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    %rbp,%rdi
mov    %r14d,%esi
mov    $0x2,%al
call   1040 <printf@plt>
lea    (%r15,%r14,1),%eax
add    $0x1,%eax
mov    %r14d,%ecx
add    $0x1,%ecx
mov    %ecx,%r14d
cmp    $0x1,%eax
jne    11c0 <show_dobldobl_poles+0x90>
jmp    1190 <show_dobldobl_poles+0x60>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"poles for Pade approximant %d :\0A\00"
@.str.1 = [20 x i8] c" %d : %.14e %.14e\0A\00"
define void @show_dobldobl_poles(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca double
store i32 %0, i32* %2
%10 = call i32 @padcon_get_homotopy_continuation_parameter(i32 3, double* %7)
store i32 %10, i32* %3
%11 = load double, double* %7
%12 = fptosi double %11 to i32
store i32 %12, i32* %4
store i32 1, i32* %5
br label %13
13: ; preds = %36, %1
%14 = load i32, i32* %5
%15 = load i32, i32* %2
%16 = icmp sle i32 %14, %15
br i1 %16, label %17, label %39
17: ; preds = %13
%18 = load i32, i32* %5
%19 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %18)
store i32 1, i32* %6
br label %20
20: ; preds = %32, %17
%21 = load i32, i32* %6
%22 = load i32, i32* %4
%23 = icmp sle i32 %21, %22
br i1 %23, label %24, label %35
24: ; preds = %20
%25 = load i32, i32* %5
%26 = load i32, i32* %6
%27 = call i32 @padcon_get_dobldobl_pole(i32 %25, i32 %26, i32 0, double* %8, double* %9)
store i32 %27, i32* %3
%28 = load i32, i32* %6
%29 = load double, double* %8
%30 = load double, double* %9
%31 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %28, double %29, double %30)
br label %32
32: ; preds = %24
%33 = load i32, i32* %6
%34 = add nsw i32 %33, 1
store i32 %34, i32* %6
br label %20
35: ; preds = %20
br label %36
36: ; preds = %35
%37 = load i32, i32* %5
%38 = add nsw i32 %37, 1
store i32 %38, i32* %5
br label %13
39: ; preds = %13
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"poles for Pade approximant %d :\0A\00"
@.str.1 = [20 x i8] c" %d : %.14e %.14e\0A\00"
define void @show_dobldobl_poles(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 3, double* %2)
%9 = load double, double* %2
%10 = fptosi double %9 to i32
%11 = icmp slt i32 %0, 1
br i1 %11, label %28, label %12
12: ; preds = %1
%13 = icmp slt i32 %10, 1
br label %14
14: ; preds = %12, %25
%15 = phi i32 [ 1, %12 ], [ %26, %25 ]
%16 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %15)
br i1 %13, label %25, label %17
17: ; preds = %14, %17
%18 = phi i32 [ %23, %17 ], [ 1, %14 ]
%19 = call i32 @padcon_get_dobldobl_pole(i32 %15, i32 %18, i32 0, double* %3, double* %4)
%20 = load double, double* %3
%21 = load double, double* %4
%22 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %18, double %20, double %21)
%23 = add nuw i32 %18, 1
%24 = icmp eq i32 %18, %10
br i1 %24, label %25, label %17
25: ; preds = %17, %14
%26 = add nuw i32 %15, 1
%27 = icmp eq i32 %15, %0
br i1 %27, label %28, label %14
28: ; preds = %25, %1
ret void
}