#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 /*<<< orphan*/ printf(char *, ...);
void print_eigenvalues(char *desc, int n, double *wr, double *wi) {
  int j;
  printf("\n %s\n", desc);
  for (j = 0; j < n; j++) {
    if (wi[j] == (double)0.0) {
      printf(" %6.2f", wr[j]);
    } else {
      printf(" (%6.2f,%6.2f)", wr[j], wi[j]);
    }
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_eigenvalues>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11c7 <print_eigenvalues+0xb7>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    118c <print_eigenvalues+0x7c>
jp     118c <print_eigenvalues+0x7c>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe86(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    11b4 <print_eigenvalues+0xa4>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
lea    0xe60(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
jmp    11b9 <print_eigenvalues+0xa9>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1140 <print_eigenvalues+0x30>
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_eigenvalues>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r13
mov    %esi,%ebp
mov    %rdi,%rsi
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebp,%ebp
jle    1198 <print_eigenvalues+0x78>
mov    %ebp,%ebp
xor    %ebx,%ebx
lea    0xebb(%rip),%r15
lea    0xebb(%rip),%r12
jmp    1173 <print_eigenvalues+0x53>
nopl   0x0(%rax)
mov    %r12,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
je     1198 <print_eigenvalues+0x78>
movsd  (%r14,%rbx,8),%xmm1
ucomisd 0xe7f(%rip),%xmm1
movsd  0x0(%r13,%rbx,8),%xmm0
jne    1160 <print_eigenvalues+0x40>
jp     1160 <print_eigenvalues+0x40>
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    116a <print_eigenvalues+0x4a>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\0A %s\0A\00"
@.str.1 = [7 x i8] c" %6.2f\00"
@.str.2 = [15 x i8] c" (%6.2f,%6.2f)\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @print_eigenvalues(i8* %0, i32 %1, double* %2, double* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store double* %2, double** %7
store double* %3, double** %8
%10 = load i8*, i8** %5
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %10)
store i32 0, i32* %9
br label %12
12: ; preds = %43, %4
%13 = load i32, i32* %9
%14 = load i32, i32* %6
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %46
16: ; preds = %12
%17 = load double*, double** %8
%18 = load i32, i32* %9
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds double, double* %17, i64 %19
%21 = load double, double* %20
%22 = fcmp oeq double %21, 0.000000e+00
br i1 %22, label %23, label %30
23: ; preds = %16
%24 = load double*, double** %7
%25 = load i32, i32* %9
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds double, double* %24, i64 %26
%28 = load double, double* %27
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %28)
br label %42
30: ; preds = %16
%31 = load double*, double** %7
%32 = load i32, i32* %9
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds double, double* %31, i64 %33
%35 = load double, double* %34
%36 = load double*, double** %8
%37 = load i32, i32* %9
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds double, double* %36, i64 %38
%40 = load double, double* %39
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %35, double %40)
br label %42
42: ; preds = %30, %23
br label %43
43: ; preds = %42
%44 = load i32, i32* %9
%45 = add nsw i32 %44, 1
store i32 %45, i32* %9
br label %12
46: ; preds = %12
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\0A %s\0A\00"
@.str.1 = [7 x i8] c" %6.2f\00"
@.str.2 = [15 x i8] c" (%6.2f,%6.2f)\00"
define void @print_eigenvalues(i8* %0, i32 %1, double* nocapture %2, double* nocapture %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %23
7: ; preds = %4
%8 = zext i32 %1 to i64
br label %9
9: ; preds = %7, %20
%10 = phi i64 [ 0, %7 ], [ %21, %20 ]
%11 = getelementptr inbounds double, double* %3, i64 %10
%12 = load double, double* %11
%13 = fcmp oeq double %12, 0.000000e+00
%14 = getelementptr inbounds double, double* %2, i64 %10
%15 = load double, double* %14
br i1 %13, label %16, label %18
16: ; preds = %9
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %15)
br label %20
18: ; preds = %9
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %15, double %12)
br label %20
20: ; preds = %16, %18
%21 = add nuw nsw i64 %10, 1
%22 = icmp eq i64 %21, %8
br i1 %22, label %23, label %9
23: ; preds = %20, %4
%24 = tail call i32 @putchar(i32 10)
ret void
}