#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 maximal_series_degree();
int padcon_get_dobldobl_series_coefficient(int, int, int /*<<< orphan*/,
                                           double *, double *);
int /*<<< orphan*/ printf(char *, int, ...);
void show_dobldobl_series_coefficients(int dim) {
  int fail, leadidx, idx;
  const int maxdeg = maximal_series_degree();
  double re, im;
  for (leadidx = 1; leadidx <= dim; leadidx++) {
    printf("Coefficient of series at component %d :\n", leadidx);
    for (idx = 0; idx <= maxdeg; idx++) {
      fail = padcon_get_dobldobl_series_coefficient(leadidx, idx, 0, &re, &im);
      printf(" %d : %.14e  %.14e\n", idx, re, im);
    }
  }
}


x86 assembly (clang, -O0):
<show_dobldobl_series_coefficients>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <maximal_series_degree@plt>
mov    %eax,-0x14(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     11d0 <show_dobldobl_series_coefficients+0xa0>
mov    -0xc(%rbp),%esi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11bd <show_dobldobl_series_coefficients+0x8d>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
xor    %edx,%edx
lea    -0x20(%rbp),%rcx
lea    -0x28(%rbp),%r8
call   1050 <padcon_get_dobldobl_series_coefficient@plt>
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%esi
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
lea    0xe81(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1170 <show_dobldobl_series_coefficients+0x40>
jmp    11c2 <show_dobldobl_series_coefficients+0x92>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114c <show_dobldobl_series_coefficients+0x1c>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_dobldobl_series_coefficients>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <maximal_series_degree@plt>
mov    %rax,0x10(%rsp)
mov    %ebx,0xc(%rsp)
test   %ebx,%ebx
jle    11e6 <show_dobldobl_series_coefficients+0xb6>
mov    0x10(%rsp),%rax
lea    0x1(%rax),%r12d
mov    $0x1,%ebp
lea    0x20(%rsp),%r13
lea    0x18(%rsp),%rbx
lea    0xeb2(%rip),%r14
jmp    118b <show_dobldobl_series_coefficients+0x5b>
nopl   0x0(%rax)
lea    0x1(%rbp),%eax
cmp    0xc(%rsp),%ebp
mov    %eax,%ebp
je     11e6 <show_dobldobl_series_coefficients+0xb6>
lea    0xe6e(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0x0,0x10(%rsp)
js     1180 <show_dobldobl_series_coefficients+0x50>
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebp,%edi
mov    %r15d,%esi
xor    %edx,%edx
mov    %r13,%rcx
mov    %rbx,%r8
call   1050 <padcon_get_dobldobl_series_coefficient@plt>
movsd  0x20(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
mov    %r14,%rdi
mov    %r15d,%esi
mov    $0x2,%al
call   1030 <printf@plt>
add    $0x1,%r15d
cmp    %r15d,%r12d
jne    11b0 <show_dobldobl_series_coefficients+0x80>
jmp    1180 <show_dobldobl_series_coefficients+0x50>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [41 x i8] c"Coefficient of series at component %d :\0A\00"
@.str.1 = [20 x i8] c" %d : %.14e %.14e\0A\00"
define void @show_dobldobl_series_coefficients(i32 %0) {
%2 = alloca double
%3 = alloca double
%4 = tail call i32 (...) @maximal_series_degree()
%5 = bitcast double* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = icmp slt i32 %0, 1
br i1 %7, label %24, label %8
8: ; preds = %1
%9 = icmp slt i32 %4, 0
br label %10
10: ; preds = %8, %21
%11 = phi i32 [ 1, %8 ], [ %22, %21 ]
%12 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %11)
br i1 %9, label %21, label %13
13: ; preds = %10, %13
%14 = phi i32 [ %19, %13 ], [ 0, %10 ]
%15 = call i32 @padcon_get_dobldobl_series_coefficient(i32 %11, i32 %14, i32 0, double* %2, double* %3)
%16 = load double, double* %2
%17 = load double, double* %3
%18 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %14, double %16, double %17)
%19 = add nuw i32 %14, 1
%20 = icmp eq i32 %14, %4
br i1 %20, label %21, label %13
21: ; preds = %13, %10
%22 = add nuw i32 %11, 1
%23 = icmp eq i32 %11, %0
br i1 %23, label %24, label %10
24: ; preds = %21, %1
ret void
}