#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*/ deigen_(double *, double *, int *);
int /*<<< orphan*/ dmatcop_(double *, double *, int *);
int /*<<< orphan*/ dmatmul_(double *, double *, double *, int *);
int /*<<< orphan*/ dtranspos_(double *, double *, int *);
int /*<<< orphan*/ errm(char *);
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int sqrt(double);
void dgeigen(double *sig1, double *sig2, double *lambda, double *E, int *pn) {
  double *C, *Ct, *M, *W1, *W2, dmin;
  int n, nn, i, j, n1;
  int debug = 0;
  int status = 0;
  n = *pn;
  nn = n * n;
  n1 = n + 1;
  if (!(C = (double *)malloc(nn * sizeof(double))))
    errm("dgeiegn");
  if (!(Ct = (double *)malloc(nn * sizeof(double))))
    errm("dgeiegn");
  if (!(M = (double *)malloc(nn * sizeof(double))))
    errm("dgeiegn");
  if (!(W1 = (double *)malloc(nn * sizeof(double))))
    errm("dgeiegn");
  if (!(W2 = (double *)malloc(nn * sizeof(double))))
    errm("dgeiegn");
  dmatcop_(sig2, M, pn);
  if (debug)
    printf("before diagonalizing sig2\n");
  deigen_(M, W2, pn);
  if (debug)
    printf("after  diagonalizing sig2\n");
  if (debug)
    printf("condition number before inversion = %.5g\n", M[0] / M[nn - 1]);
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) {
      if (j == i) {
        if (M[i + n * j] > 0.0) {
          M[i + n * j] = 1. / sqrt(M[i + n * j]);
        } else {
          M[i + n * j] = 1.e6 * M[0];
          status++;
        }
      } else {
        M[i + n * j] = 0.0;
      }
    }
  if (status)
    printf("dgeigen warning: ill-conditioned sig2\n");
  dmatmul_(W2, M, C, pn);
  dtranspos_(C, Ct, pn);
  dmatmul_(Ct, sig1, M, pn);
  dmatmul_(M, C, lambda, pn);
  if (debug)
    printf("before diagonalizing sig1\n");
  deigen_(lambda, W1, pn);
  if (debug)
    printf("after  diagonalizing sig1\n");
  dmatmul_(C, W1, E, pn);
  free(C);
  free(Ct);
  free(M);
  free(W1);
  free(W2);
}


x86 assembly (clang, -O0):
<dgeigen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movl   $0x0,-0x70(%rbp)
movl   $0x0,-0x74(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
imul   -0x5c(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
movslq -0x60(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    1202 <dgeigen+0x72>
lea    0xe13(%rip),%rdi
call   1050 <errm@plt>
movslq -0x60(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    122b <dgeigen+0x9b>
lea    0xdea(%rip),%rdi
call   1050 <errm@plt>
movslq -0x60(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
jne    1254 <dgeigen+0xc4>
lea    0xdc1(%rip),%rdi
call   1050 <errm@plt>
movslq -0x60(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x48(%rbp)
cmp    $0x0,%rax
jne    127d <dgeigen+0xed>
lea    0xd98(%rip),%rdi
call   1050 <errm@plt>
movslq -0x60(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x50(%rbp)
cmp    $0x0,%rax
jne    12a6 <dgeigen+0x116>
lea    0xd6f(%rip),%rdi
call   1050 <errm@plt>
mov    -0x10(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1060 <dmatcop_@plt>
cmpl   $0x0,-0x70(%rbp)
je     12cf <dgeigen+0x13f>
lea    0xd50(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x40(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1070 <deigen_@plt>
cmpl   $0x0,-0x70(%rbp)
je     12f8 <dgeigen+0x168>
lea    0xd42(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x70(%rbp)
je     132a <dgeigen+0x19a>
mov    -0x40(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x40(%rbp),%rax
mov    -0x60(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
divsd  (%rax,%rcx,8),%xmm0
lea    0xd2b(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x5c(%rbp),%eax
jge    1442 <dgeigen+0x2b2>
movl   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%eax
cmp    -0x5c(%rbp),%eax
jge    142f <dgeigen+0x29f>
mov    -0x68(%rbp),%eax
cmp    -0x64(%rbp),%eax
jne    1401 <dgeigen+0x271>
mov    -0x40(%rbp),%rax
mov    -0x64(%rbp),%ecx
mov    -0x5c(%rbp),%edx
imul   -0x68(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    13cb <dgeigen+0x23b>
mov    -0x40(%rbp),%rax
mov    -0x64(%rbp),%ecx
mov    -0x5c(%rbp),%edx
imul   -0x68(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1090 <sqrt@plt>
cvtsi2sd %eax,%xmm1
movsd  0xc5e(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
mov    -0x64(%rbp),%ecx
mov    -0x5c(%rbp),%edx
imul   -0x68(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    13fc <dgeigen+0x26c>
mov    -0x40(%rbp),%rax
movsd  0xc29(%rip),%xmm0
mulsd  (%rax),%xmm0
mov    -0x40(%rbp),%rax
mov    -0x64(%rbp),%ecx
mov    -0x5c(%rbp),%edx
imul   -0x68(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    141c <dgeigen+0x28c>
mov    -0x40(%rbp),%rax
mov    -0x64(%rbp),%ecx
mov    -0x5c(%rbp),%edx
imul   -0x68(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    1421 <dgeigen+0x291>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    1344 <dgeigen+0x1b4>
jmp    1434 <dgeigen+0x2a4>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1331 <dgeigen+0x1a1>
cmpl   $0x0,-0x74(%rbp)
je     145a <dgeigen+0x2ca>
lea    0xc25(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x50(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   10b0 <dmatmul_@plt>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   10a0 <dtranspos_@plt>
mov    -0x38(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   10b0 <dmatmul_@plt>
mov    -0x40(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   10b0 <dmatmul_@plt>
cmpl   $0x0,-0x70(%rbp)
je     14c2 <dgeigen+0x332>
lea    0xbe4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1070 <deigen_@plt>
cmpl   $0x0,-0x70(%rbp)
je     14eb <dgeigen+0x35b>
lea    0xbd6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   10b0 <dmatmul_@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dgeigen>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r8,%r15
mov    %rcx,0x48(%rsp)
mov    %rdx,%r12
mov    %rsi,(%rsp)
mov    %rdi,0x38(%rsp)
mov    (%r8),%eax
mov    %rax,0x8(%rsp)
mov    %eax,%ebp
imul   %eax,%ebp
shl    $0x3,%ebp
mov    %ebp,%edi
call   1080 <malloc@plt>
mov    %rax,%r13
test   %rax,%rax
jne    11dd <dgeigen+0x4d>
lea    0xe38(%rip),%rdi
call   1050 <errm@plt>
mov    %ebp,%edi
call   1080 <malloc@plt>
mov    %rax,0x40(%rsp)
test   %rax,%rax
jne    11fa <dgeigen+0x6a>
lea    0xe1b(%rip),%rdi
call   1050 <errm@plt>
mov    %ebp,%edi
call   1080 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
jne    1215 <dgeigen+0x85>
lea    0xe00(%rip),%rdi
call   1050 <errm@plt>
mov    %ebp,%edi
call   1080 <malloc@plt>
mov    %rax,0x30(%rsp)
test   %rax,%rax
jne    1232 <dgeigen+0xa2>
lea    0xde3(%rip),%rdi
call   1050 <errm@plt>
mov    %ebp,%edi
call   1080 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    124d <dgeigen+0xbd>
lea    0xdc8(%rip),%rdi
call   1050 <errm@plt>
mov    (%rsp),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1060 <dmatcop_@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1070 <deigen_@plt>
mov    0x8(%rsp),%rax
test   %eax,%eax
jle    137c <dgeigen+0x1ec>
mov    %rbx,0x10(%rsp)
mov    %r13,0x18(%rsp)
mov    %r12,0x20(%rsp)
mov    %r15,0x28(%rsp)
lea    0x0(,%rax,8),%r12
xor    %r15d,%r15d
xorpd  %xmm1,%xmm1
mov    %r14,%r13
xor    %ecx,%ecx
mov    %r14,0x50(%rsp)
jmp    12c5 <dgeigen+0x135>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r15
mov    (%rsp),%r13
add    $0x8,%r13
cmp    %rax,%r15
je     1358 <dgeigen+0x1c8>
mov    %r15,%rbp
imul   %rax,%rbp
add    %r15,%rbp
mov    %r13,(%rsp)
xor    %ebx,%ebx
jmp    12f4 <dgeigen+0x164>
nopw   0x0(%rax,%rax,1)
movq   $0x0,0x0(%r13)
add    $0x1,%rbx
add    %r12,%r13
cmp    %rbx,%rax
je     12b0 <dgeigen+0x120>
cmp    %rbx,%r15
jne    12e0 <dgeigen+0x150>
movsd  (%r14,%rbp,8),%xmm0
ucomisd %xmm1,%xmm0
jbe    1340 <dgeigen+0x1b0>
mov    %ecx,%r14d
call   1090 <sqrt@plt>
mov    %r14d,%ecx
mov    0x50(%rsp),%r14
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    0x8(%rsp),%rax
movsd  0xcdf(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r14,%rbp,8)
xorpd  %xmm1,%xmm1
jmp    12e8 <dgeigen+0x158>
nopl   0x0(%rax)
movsd  (%r14),%xmm0
mulsd  0xcb3(%rip),%xmm0
movsd  %xmm0,(%r14,%rbp,8)
add    $0x1,%ecx
jmp    12e8 <dgeigen+0x158>
test   %ecx,%ecx
mov    0x28(%rsp),%r15
mov    0x20(%rsp),%r12
mov    0x18(%rsp),%r13
mov    0x10(%rsp),%rbx
je     137c <dgeigen+0x1ec>
lea    0xca1(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r13,%rdx
mov    %r15,%rcx
call   10b0 <dmatmul_@plt>
mov    %r13,%rdi
mov    0x40(%rsp),%rbp
mov    %rbp,%rsi
mov    %r15,%rdx
call   10a0 <dtranspos_@plt>
mov    %rbp,%rdi
mov    0x38(%rsp),%rsi
mov    %r14,%rdx
mov    %r15,%rcx
call   10b0 <dmatmul_@plt>
mov    %r14,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
call   10b0 <dmatmul_@plt>
mov    %r12,%rdi
mov    %rbx,%r12
mov    0x30(%rsp),%rbx
mov    %rbx,%rsi
mov    %r15,%rdx
call   1070 <deigen_@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
mov    0x48(%rsp),%rdx
mov    %r15,%rcx
call   10b0 <dmatmul_@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"dgeiegn\00"
@.str.1 = [27 x i8] c"before diagonalizing sig2\0A\00"
@.str.2 = [27 x i8] c"after diagonalizing sig2\0A\00"
@.str.3 = [42 x i8] c"condition number before inversion = %.5g\0A\00"
@.str.4 = [39 x i8] c"dgeigen warning: ill-conditioned sig2\0A\00"
@.str.5 = [27 x i8] c"before diagonalizing sig1\0A\00"
@.str.6 = [27 x i8] c"after diagonalizing sig1\0A\00"
define void @dgeigen(double* %0, double* %1, double* %2, double* %3, i32* %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca i32*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca double
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
store double* %0, double** %6
store double* %1, double** %7
store double* %2, double** %8
store double* %3, double** %9
store i32* %4, i32** %10
store i32 0, i32* %22
store i32 0, i32* %23
%24 = load i32*, i32** %10
%25 = load i32, i32* %24
store i32 %25, i32* %17
%26 = load i32, i32* %17
%27 = load i32, i32* %17
%28 = mul nsw i32 %26, %27
store i32 %28, i32* %18
%29 = load i32, i32* %17
%30 = add nsw i32 %29, 1
store i32 %30, i32* %21
%31 = load i32, i32* %18
%32 = sext i32 %31 to i64
%33 = mul i64 %32, 8
%34 = trunc i64 %33 to i32
%35 = call i64 @malloc(i32 %34)
%36 = inttoptr i64 %35 to double*
store double* %36, double** %11
%37 = icmp ne double* %36, null
br i1 %37, label %40, label %38
38: ; preds = %5
%39 = call i32 @errm(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %40
40: ; preds = %38, %5
%41 = load i32, i32* %18
%42 = sext i32 %41 to i64
%43 = mul i64 %42, 8
%44 = trunc i64 %43 to i32
%45 = call i64 @malloc(i32 %44)
%46 = inttoptr i64 %45 to double*
store double* %46, double** %12
%47 = icmp ne double* %46, null
br i1 %47, label %50, label %48
48: ; preds = %40
%49 = call i32 @errm(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %50
50: ; preds = %48, %40
%51 = load i32, i32* %18
%52 = sext i32 %51 to i64
%53 = mul i64 %52, 8
%54 = trunc i64 %53 to i32
%55 = call i64 @malloc(i32 %54)
%56 = inttoptr i64 %55 to double*
store double* %56, double** %13
%57 = icmp ne double* %56, null
br i1 %57, label %60, label %58
58: ; preds = %50
%59 = call i32 @errm(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %60
60: ; preds = %58, %50
%61 = load i32, i32* %18
%62 = sext i32 %61 to i64
%63 = mul i64 %62, 8
%64 = trunc i64 %63 to i32
%65 = call i64 @malloc(i32 %64)
%66 = inttoptr i64 %65 to double*
store double* %66, double** %14
%67 = icmp ne double* %66, null
br i1 %67, label %70, label %68
68: ; preds = %60
%69 = call i32 @errm(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %70
70: ; preds = %68, %60
%71 = load i32, i32* %18
%72 = sext i32 %71 to i64
%73 = mul i64 %72, 8
%74 = trunc i64 %73 to i32
%75 = call i64 @malloc(i32 %74)
%76 = inttoptr i64 %75 to double*
store double* %76, double** %15
%77 = icmp ne double* %76, null
br i1 %77, label %80, label %78
78: ; preds = %70
%79 = call i32 @errm(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %80
80: ; preds = %78, %70
%81 = load double*, double** %7
%82 = load double*, double** %13
%83 = load i32*, i32** %10
%84 = call i32 @dmatcop_(double* %81, double* %82, i32* %83)
%85 = load i32, i32* %22
%86 = icmp ne i32 %85, 0
br i1 %86, label %87, label %89
87: ; preds = %80
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
br label %89
89: ; preds = %87, %80
%90 = load double*, double** %13
%91 = load double*, double** %15
%92 = load i32*, i32** %10
%93 = call i32 @deigen_(double* %90, double* %91, i32* %92)
%94 = load i32, i32* %22
%95 = icmp ne i32 %94, 0
br i1 %95, label %96, label %98
96: ; preds = %89
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %98
98: ; preds = %96, %89
%99 = load i32, i32* %22
%100 = icmp ne i32 %99, 0
br i1 %100, label %101, label %113
101: ; preds = %98
%102 = load double*, double** %13
%103 = getelementptr inbounds double, double* %102, i64 0
%104 = load double, double* %103
%105 = load double*, double** %13
%106 = load i32, i32* %18
%107 = sub nsw i32 %106, 1
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds double, double* %105, i64 %108
%110 = load double, double* %109
%111 = fdiv double %104, %110
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), double %111)
br label %113
113: ; preds = %101, %98
store i32 0, i32* %19
br label %114
114: ; preds = %189, %113
%115 = load i32, i32* %19
%116 = load i32, i32* %17
%117 = icmp slt i32 %115, %116
br i1 %117, label %118, label %192
118: ; preds = %114
store i32 0, i32* %20
br label %119
119: ; preds = %185, %118
%120 = load i32, i32* %20
%121 = load i32, i32* %17
%122 = icmp slt i32 %120, %121
br i1 %122, label %123, label %188
123: ; preds = %119
%124 = load i32, i32* %20
%125 = load i32, i32* %19
%126 = icmp eq i32 %124, %125
br i1 %126, label %127, label %175
127: ; preds = %123
%128 = load double*, double** %13
%129 = load i32, i32* %19
%130 = load i32, i32* %17
%131 = load i32, i32* %20
%132 = mul nsw i32 %130, %131
%133 = add nsw i32 %129, %132
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds double, double* %128, i64 %134
%136 = load double, double* %135
%137 = fcmp ogt double %136, 0.000000e+00
br i1 %137, label %138, label %159
138: ; preds = %127
%139 = load double*, double** %13
%140 = load i32, i32* %19
%141 = load i32, i32* %17
%142 = load i32, i32* %20
%143 = mul nsw i32 %141, %142
%144 = add nsw i32 %140, %143
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds double, double* %139, i64 %145
%147 = load double, double* %146
%148 = call i32 @sqrt(double %147)
%149 = sitofp i32 %148 to double
%150 = fdiv double 1.000000e+00, %149
%151 = load double*, double** %13
%152 = load i32, i32* %19
%153 = load i32, i32* %17
%154 = load i32, i32* %20
%155 = mul nsw i32 %153, %154
%156 = add nsw i32 %152, %155
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds double, double* %151, i64 %157
store double %150, double* %158
br label %174
159: ; preds = %127
%160 = load double*, double** %13
%161 = getelementptr inbounds double, double* %160, i64 0
%162 = load double, double* %161
%163 = fmul double 1.000000e+06, %162
%164 = load double*, double** %13
%165 = load i32, i32* %19
%166 = load i32, i32* %17
%167 = load i32, i32* %20
%168 = mul nsw i32 %166, %167
%169 = add nsw i32 %165, %168
%170 = sext i32 %169 to i64
%171 = getelementptr inbounds double, double* %164, i64 %170
store double %163, double* %171
%172 = load i32, i32* %23
%173 = add nsw i32 %172, 1
store i32 %173, i32* %23
br label %174
174: ; preds = %159, %138
br label %184
175: ; preds = %123
%176 = load double*, double** %13
%177 = load i32, i32* %19
%178 = load i32, i32* %17
%179 = load i32, i32* %20
%180 = mul nsw i32 %178, %179
%181 = add nsw i32 %177, %180
%182 = sext i32 %181 to i64
%183 = getelementptr inbounds double, double* %176, i64 %182
store double 0.000000e+00, double* %183
br label %184
184: ; preds = %175, %174
br label %185
185: ; preds = %184
%186 = load i32, i32* %20
%187 = add nsw i32 %186, 1
store i32 %187, i32* %20
br label %119
188: ; preds = %119
br label %189
189: ; preds = %188
%190 = load i32, i32* %19
%191 = add nsw i32 %190, 1
store i32 %191, i32* %19
br label %114
192: ; preds = %114
%193 = load i32, i32* %23
%194 = icmp ne i32 %193, 0
br i1 %194, label %195, label %197
195: ; preds = %192
%196 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
br label %197
197: ; preds = %195, %192
%198 = load double*, double** %15
%199 = load double*, double** %13
%200 = load double*, double** %11
%201 = load i32*, i32** %10
%202 = call i32 @dmatmul_(double* %198, double* %199, double* %200, i32* %201)
%203 = load double*, double** %11
%204 = load double*, double** %12
%205 = load i32*, i32** %10
%206 = call i32 @dtranspos_(double* %203, double* %204, i32* %205)
%207 = load double*, double** %12
%208 = load double*, double** %6
%209 = load double*, double** %13
%210 = load i32*, i32** %10
%211 = call i32 @dmatmul_(double* %207, double* %208, double* %209, i32* %210)
%212 = load double*, double** %13
%213 = load double*, double** %11
%214 = load double*, double** %8
%215 = load i32*, i32** %10
%216 = call i32 @dmatmul_(double* %212, double* %213, double* %214, i32* %215)
%217 = load i32, i32* %22
%218 = icmp ne i32 %217, 0
br i1 %218, label %219, label %221
219: ; preds = %197
%220 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
br label %221
221: ; preds = %219, %197
%222 = load double*, double** %8
%223 = load double*, double** %14
%224 = load i32*, i32** %10
%225 = call i32 @deigen_(double* %222, double* %223, i32* %224)
%226 = load i32, i32* %22
%227 = icmp ne i32 %226, 0
br i1 %227, label %228, label %230
228: ; preds = %221
%229 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
br label %230
230: ; preds = %228, %221
%231 = load double*, double** %11
%232 = load double*, double** %14
%233 = load double*, double** %9
%234 = load i32*, i32** %10
%235 = call i32 @dmatmul_(double* %231, double* %232, double* %233, i32* %234)
%236 = load double*, double** %11
%237 = call i32 @free(double* %236)
%238 = load double*, double** %12
%239 = call i32 @free(double* %238)
%240 = load double*, double** %13
%241 = call i32 @free(double* %240)
%242 = load double*, double** %14
%243 = call i32 @free(double* %242)
%244 = load double*, double** %15
%245 = call i32 @free(double* %244)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"dgeiegn\00"
@str = [38 x i8] c"dgeigen warning: ill-conditioned sig2\00"
define void @dgeigen(double* %0, double* %1, double* %2, double* %3, i32* %4) {
%6 = load i32, i32* %4
%7 = shl i32 %6, 3
%8 = mul i32 %7, %6
%9 = tail call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to double*
%11 = icmp eq i64 %9, 0
br i1 %11, label %12, label %14
12: ; preds = %5
%13 = tail call i32 @errm(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %5
%15 = tail call i64 @malloc(i32 %8)
%16 = inttoptr i64 %15 to double*
%17 = icmp eq i64 %15, 0
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = tail call i32 @errm(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %20
20: ; preds = %18, %14
%21 = tail call i64 @malloc(i32 %8)
%22 = inttoptr i64 %21 to double*
%23 = icmp eq i64 %21, 0
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = tail call i32 @errm(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %26
26: ; preds = %24, %20
%27 = tail call i64 @malloc(i32 %8)
%28 = inttoptr i64 %27 to double*
%29 = icmp eq i64 %27, 0
br i1 %29, label %30, label %32
30: ; preds = %26
%31 = tail call i32 @errm(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %32
32: ; preds = %30, %26
%33 = tail call i64 @malloc(i32 %8)
%34 = inttoptr i64 %33 to double*
%35 = icmp eq i64 %33, 0
br i1 %35, label %36, label %38
36: ; preds = %32
%37 = tail call i32 @errm(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %38
38: ; preds = %36, %32
%39 = tail call i32 @dmatcop_(double* %1, double* %22, i32* %4)
%40 = tail call i32 @deigen_(double* %22, double* %34, i32* %4)
%41 = icmp sgt i32 %6, 0
br i1 %41, label %42, label %81
42: ; preds = %38
%43 = zext i32 %6 to i64
%44 = zext i32 %6 to i64
br label %45
45: ; preds = %74, %42
%46 = phi i64 [ 0, %42 ], [ %75, %74 ]
%47 = phi i32 [ 0, %42 ], [ %71, %74 ]
%48 = mul nsw i64 %46, %43
%49 = add nuw nsw i64 %48, %46
%50 = getelementptr inbounds double, double* %22, i64 %49
br label %51
51: ; preds = %45, %70
%52 = phi i64 [ 0, %45 ], [ %72, %70 ]
%53 = phi i32 [ %47, %45 ], [ %71, %70 ]
%54 = icmp eq i64 %52, %46
br i1 %54, label %55, label %66
55: ; preds = %51
%56 = load double, double* %50
%57 = fcmp ogt double %56, 0.000000e+00
br i1 %57, label %58, label %62
58: ; preds = %55
%59 = tail call i32 @sqrt(double %56)
%60 = sitofp i32 %59 to double
%61 = fdiv double 1.000000e+00, %60
store double %61, double* %50
br label %70
62: ; preds = %55
%63 = load double, double* %22
%64 = fmul double %63, 1.000000e+06
store double %64, double* %50
%65 = add nsw i32 %53, 1
br label %70
66: ; preds = %51
%67 = mul nsw i64 %52, %43
%68 = add nuw nsw i64 %67, %46
%69 = getelementptr inbounds double, double* %22, i64 %68
store double 0.000000e+00, double* %69
br label %70
70: ; preds = %66, %62, %58
%71 = phi i32 [ %53, %58 ], [ %65, %62 ], [ %53, %66 ]
%72 = add nuw nsw i64 %52, 1
%73 = icmp eq i64 %72, %44
br i1 %73, label %74, label %51
74: ; preds = %70
%75 = add nuw nsw i64 %46, 1
%76 = icmp eq i64 %75, %44
br i1 %76, label %77, label %45
77: ; preds = %74
%78 = icmp eq i32 %71, 0
br i1 %78, label %81, label %79
79: ; preds = %77
%80 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
br label %81
81: ; preds = %38, %79, %77
%82 = tail call i32 @dmatmul_(double* %34, double* %22, double* %10, i32* %4)
%83 = tail call i32 @dtranspos_(double* %10, double* %16, i32* %4)
%84 = tail call i32 @dmatmul_(double* %16, double* %0, double* %22, i32* %4)
%85 = tail call i32 @dmatmul_(double* %22, double* %10, double* %2, i32* %4)
%86 = tail call i32 @deigen_(double* %2, double* %28, i32* %4)
%87 = tail call i32 @dmatmul_(double* %10, double* %28, double* %3, i32* %4)
%88 = tail call i32 @free(double* %10)
%89 = tail call i32 @free(double* %16)
%90 = tail call i32 @free(double* %22)
%91 = tail call i32 @free(double* %28)
%92 = tail call i32 @free(double* %34)
ret void
}