#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*/ Factorize(double *, double *, int const);
void FactorizeMatrix(double *mat, const int n, double *ev, double *v,
                     double *space) {
  int i;
  if (NULL == mat || NULL == ev || NULL == v || NULL == space || n < 1)
    return;
  for (i = 0; i < n * n; i++)
    ev[i] = mat[i];
  Factorize(ev, v, n);
}


x86 assembly (clang, -O0):
<FactorizeMatrix>:
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    %r8,-0x28(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     1165 <FactorizeMatrix+0x55>
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
je     1165 <FactorizeMatrix+0x55>
xor    %eax,%eax
cmp    -0x20(%rbp),%rax
je     1165 <FactorizeMatrix+0x55>
xor    %eax,%eax
cmp    -0x28(%rbp),%rax
je     1165 <FactorizeMatrix+0x55>
cmpl   $0x1,-0xc(%rbp)
jge    116a <FactorizeMatrix+0x5a>
jmp    11bb <FactorizeMatrix+0xab>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
cmp    %ecx,%eax
jge    11ab <FactorizeMatrix+0x9b>
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1171 <FactorizeMatrix+0x61>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <Factorize@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FactorizeMatrix>:
test   %esi,%esi
jle    11dc <FactorizeMatrix+0xcc>
test   %rdi,%rdi
je     11dc <FactorizeMatrix+0xcc>
test   %rdx,%rdx
je     11dc <FactorizeMatrix+0xcc>
test   %rcx,%rcx
je     11dc <FactorizeMatrix+0xcc>
test   %r8,%r8
je     11dc <FactorizeMatrix+0xcc>
push   %rbx
mov    %esi,%r9d
mov    %esi,%eax
imul   %r9d,%eax
test   %eax,%eax
je     12b6 <FactorizeMatrix+0x1a6>
mov    %eax,%r10d
cmp    $0x4,%eax
jb     116c <FactorizeMatrix+0x5c>
lea    (%rdi,%r10,8),%rax
cmp    %rdx,%rax
jbe    11dd <FactorizeMatrix+0xcd>
lea    (%rdx,%r10,8),%rax
cmp    %rdi,%rax
jbe    11dd <FactorizeMatrix+0xcd>
xor    %esi,%esi
mov    %rsi,%r8
not    %r8
add    %r10,%r8
mov    %r10,%rax
and    $0x3,%rax
je     1194 <FactorizeMatrix+0x84>
movsd  (%rdi,%rsi,8),%xmm0
movsd  %xmm0,(%rdx,%rsi,8)
add    $0x1,%rsi
add    $0xffffffffffffffff,%rax
jne    1180 <FactorizeMatrix+0x70>
cmp    $0x3,%r8
jb     12b6 <FactorizeMatrix+0x1a6>
xchg   %ax,%ax
movsd  (%rdi,%rsi,8),%xmm0
movsd  %xmm0,(%rdx,%rsi,8)
movsd  0x8(%rdi,%rsi,8),%xmm0
movsd  %xmm0,0x8(%rdx,%rsi,8)
movsd  0x10(%rdi,%rsi,8),%xmm0
movsd  %xmm0,0x10(%rdx,%rsi,8)
movsd  0x18(%rdi,%rsi,8),%xmm0
movsd  %xmm0,0x18(%rdx,%rsi,8)
add    $0x4,%rsi
cmp    %rsi,%r10
jne    11a0 <FactorizeMatrix+0x90>
jmp    12b6 <FactorizeMatrix+0x1a6>
ret
mov    %r10d,%esi
and    $0xfffffffc,%esi
lea    -0x4(%rsi),%rax
mov    %rax,%r11
shr    $0x2,%r11
add    $0x1,%r11
mov    %r11d,%r8d
and    $0x3,%r8d
cmp    $0xc,%rax
jae    1203 <FactorizeMatrix+0xf3>
xor    %eax,%eax
jmp    1268 <FactorizeMatrix+0x158>
and    $0xfffffffffffffffc,%r11
xor    %eax,%eax
nopl   0x0(%rax)
movups (%rdi,%rax,8),%xmm0
movups 0x10(%rdi,%rax,8),%xmm1
movups %xmm0,(%rdx,%rax,8)
movups %xmm1,0x10(%rdx,%rax,8)
movups 0x20(%rdi,%rax,8),%xmm0
movups 0x30(%rdi,%rax,8),%xmm1
movups %xmm0,0x20(%rdx,%rax,8)
movups %xmm1,0x30(%rdx,%rax,8)
movups 0x40(%rdi,%rax,8),%xmm0
movups 0x50(%rdi,%rax,8),%xmm1
movups %xmm0,0x40(%rdx,%rax,8)
movups %xmm1,0x50(%rdx,%rax,8)
movups 0x60(%rdi,%rax,8),%xmm0
movups 0x70(%rdi,%rax,8),%xmm1
movups %xmm0,0x60(%rdx,%rax,8)
movups %xmm1,0x70(%rdx,%rax,8)
add    $0x10,%rax
add    $0xfffffffffffffffc,%r11
jne    1210 <FactorizeMatrix+0x100>
test   %r8,%r8
je     12ad <FactorizeMatrix+0x19d>
lea    (%rdx,%rax,8),%r11
add    $0x10,%r11
lea    (%rdi,%rax,8),%rax
add    $0x10,%rax
shl    $0x5,%r8
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movups -0x10(%rax,%rbx,1),%xmm0
movups (%rax,%rbx,1),%xmm1
movups %xmm0,-0x10(%r11,%rbx,1)
movups %xmm1,(%r11,%rbx,1)
add    $0x20,%rbx
cmp    %rbx,%r8
jne    1290 <FactorizeMatrix+0x180>
cmp    %r10,%rsi
jne    116e <FactorizeMatrix+0x5e>
mov    %rdx,%rdi
mov    %rcx,%rsi
mov    %r9d,%edx
pop    %rbx
jmp    1030 <Factorize@plt>

LLVM IR (-O0):
define void @FactorizeMatrix(double* %0, i32 %1, double* %2, double* %3, double* %4) {
%6 = alloca double*
%7 = alloca i32
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca i32
store double* %0, double** %6
store i32 %1, i32* %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
%12 = load double*, double** %6
%13 = icmp eq double* null, %12
br i1 %13, label %26, label %14
14: ; preds = %5
%15 = load double*, double** %8
%16 = icmp eq double* null, %15
br i1 %16, label %26, label %17
17: ; preds = %14
%18 = load double*, double** %9
%19 = icmp eq double* null, %18
br i1 %19, label %26, label %20
20: ; preds = %17
%21 = load double*, double** %10
%22 = icmp eq double* null, %21
br i1 %22, label %26, label %23
23: ; preds = %20
%24 = load i32, i32* %7
%25 = icmp slt i32 %24, 1
br i1 %25, label %26, label %27
26: ; preds = %23, %20, %17, %14, %5
br label %52
27: ; preds = %23
store i32 0, i32* %11
br label %28
28: ; preds = %44, %27
%29 = load i32, i32* %11
%30 = load i32, i32* %7
%31 = load i32, i32* %7
%32 = mul nsw i32 %30, %31
%33 = icmp slt i32 %29, %32
br i1 %33, label %34, label %47
34: ; preds = %28
%35 = load double*, double** %6
%36 = load i32, i32* %11
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds double, double* %35, i64 %37
%39 = load double, double* %38
%40 = load double*, double** %8
%41 = load i32, i32* %11
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds double, double* %40, i64 %42
store double %39, double* %43
br label %44
44: ; preds = %34
%45 = load i32, i32* %11
%46 = add nsw i32 %45, 1
store i32 %46, i32* %11
br label %28
47: ; preds = %28
%48 = load double*, double** %8
%49 = load double*, double** %9
%50 = load i32, i32* %7
%51 = call i32 @Factorize(double* %48, double* %49, i32 %50)
br label %52
52: ; preds = %47, %26
ret void
}

LLVM IR (-O2):
define void @FactorizeMatrix(double* %0, i32 %1, double* %2, double* %3, double* readnone %4) {
%6 = icmp eq double* %0, null
%7 = icmp eq double* %2, null
%8 = or i1 %6, %7
%9 = icmp eq double* %3, null
%10 = or i1 %8, %9
%11 = icmp eq double* %4, null
%12 = or i1 %10, %11
%13 = icmp slt i32 %1, 1
%14 = or i1 %13, %12
br i1 %14, label %145, label %15
15: ; preds = %5
%16 = mul i32 %1, %1
%17 = icmp eq i32 %16, 0
br i1 %17, label %143, label %18
18: ; preds = %15
%19 = zext i32 %16 to i64
%20 = icmp ult i32 %16, 4
br i1 %20, label %106, label %21
21: ; preds = %18
%22 = getelementptr double, double* %2, i64 %19
%23 = getelementptr double, double* %0, i64 %19
%24 = icmp ugt double* %23, %2
%25 = icmp ugt double* %22, %0
%26 = and i1 %24, %25
br i1 %26, label %106, label %27
27: ; preds = %21
%28 = and i64 %19, 4294967292
%29 = add nsw i64 %28, -4
%30 = lshr exact i64 %29, 2
%31 = add nuw nsw i64 %30, 1
%32 = and i64 %31, 3
%33 = icmp ult i64 %29, 12
br i1 %33, label %85, label %34
34: ; preds = %27
%35 = and i64 %31, 9223372036854775804
br label %36
36: ; preds = %36, %34
%37 = phi i64 [ 0, %34 ], [ %82, %36 ]
%38 = phi i64 [ 0, %34 ], [ %83, %36 ]
%39 = getelementptr inbounds double, double* %0, i64 %37
%40 = bitcast double* %39 to <2 x double>*
%41 = load <2 x double>, <2 x double>* %40
%42 = getelementptr inbounds double, double* %39, i64 2
%43 = bitcast double* %42 to <2 x double>*
%44 = load <2 x double>, <2 x double>* %43
%45 = getelementptr inbounds double, double* %2, i64 %37
%46 = bitcast double* %45 to <2 x double>*
store <2 x double> %41, <2 x double>* %46
%47 = getelementptr inbounds double, double* %45, i64 2
%48 = bitcast double* %47 to <2 x double>*
store <2 x double> %44, <2 x double>* %48
%49 = or i64 %37, 4
%50 = getelementptr inbounds double, double* %0, i64 %49
%51 = bitcast double* %50 to <2 x double>*
%52 = load <2 x double>, <2 x double>* %51
%53 = getelementptr inbounds double, double* %50, i64 2
%54 = bitcast double* %53 to <2 x double>*
%55 = load <2 x double>, <2 x double>* %54
%56 = getelementptr inbounds double, double* %2, i64 %49
%57 = bitcast double* %56 to <2 x double>*
store <2 x double> %52, <2 x double>* %57
%58 = getelementptr inbounds double, double* %56, i64 2
%59 = bitcast double* %58 to <2 x double>*
store <2 x double> %55, <2 x double>* %59
%60 = or i64 %37, 8
%61 = getelementptr inbounds double, double* %0, i64 %60
%62 = bitcast double* %61 to <2 x double>*
%63 = load <2 x double>, <2 x double>* %62
%64 = getelementptr inbounds double, double* %61, i64 2
%65 = bitcast double* %64 to <2 x double>*
%66 = load <2 x double>, <2 x double>* %65
%67 = getelementptr inbounds double, double* %2, i64 %60
%68 = bitcast double* %67 to <2 x double>*
store <2 x double> %63, <2 x double>* %68
%69 = getelementptr inbounds double, double* %67, i64 2
%70 = bitcast double* %69 to <2 x double>*
store <2 x double> %66, <2 x double>* %70
%71 = or i64 %37, 12
%72 = getelementptr inbounds double, double* %0, i64 %71
%73 = bitcast double* %72 to <2 x double>*
%74 = load <2 x double>, <2 x double>* %73
%75 = getelementptr inbounds double, double* %72, i64 2
%76 = bitcast double* %75 to <2 x double>*
%77 = load <2 x double>, <2 x double>* %76
%78 = getelementptr inbounds double, double* %2, i64 %71
%79 = bitcast double* %78 to <2 x double>*
store <2 x double> %74, <2 x double>* %79
%80 = getelementptr inbounds double, double* %78, i64 2
%81 = bitcast double* %80 to <2 x double>*
store <2 x double> %77, <2 x double>* %81
%82 = add nuw i64 %37, 16
%83 = add nuw i64 %38, 4
%84 = icmp eq i64 %83, %35
br i1 %84, label %85, label %36
85: ; preds = %36, %27
%86 = phi i64 [ 0, %27 ], [ %82, %36 ]
%87 = icmp eq i64 %32, 0
br i1 %87, label %104, label %88
88: ; preds = %85, %88
%89 = phi i64 [ %101, %88 ], [ %86, %85 ]
%90 = phi i64 [ %102, %88 ], [ 0, %85 ]
%91 = getelementptr inbounds double, double* %0, i64 %89
%92 = bitcast double* %91 to <2 x double>*
%93 = load <2 x double>, <2 x double>* %92
%94 = getelementptr inbounds double, double* %91, i64 2
%95 = bitcast double* %94 to <2 x double>*
%96 = load <2 x double>, <2 x double>* %95
%97 = getelementptr inbounds double, double* %2, i64 %89
%98 = bitcast double* %97 to <2 x double>*
store <2 x double> %93, <2 x double>* %98
%99 = getelementptr inbounds double, double* %97, i64 2
%100 = bitcast double* %99 to <2 x double>*
store <2 x double> %96, <2 x double>* %100
%101 = add nuw i64 %89, 4
%102 = add i64 %90, 1
%103 = icmp eq i64 %102, %32
br i1 %103, label %104, label %88
104: ; preds = %88, %85
%105 = icmp eq i64 %28, %19
br i1 %105, label %143, label %106
106: ; preds = %21, %18, %104
%107 = phi i64 [ 0, %21 ], [ 0, %18 ], [ %28, %104 ]
%108 = xor i64 %107, -1
%109 = add nsw i64 %108, %19
%110 = and i64 %19, 3
%111 = icmp eq i64 %110, 0
br i1 %111, label %121, label %112
112: ; preds = %106, %112
%113 = phi i64 [ %118, %112 ], [ %107, %106 ]
%114 = phi i64 [ %119, %112 ], [ 0, %106 ]
%115 = getelementptr inbounds double, double* %0, i64 %113
%116 = load double, double* %115
%117 = getelementptr inbounds double, double* %2, i64 %113
store double %116, double* %117
%118 = add nuw nsw i64 %113, 1
%119 = add i64 %114, 1
%120 = icmp eq i64 %119, %110
br i1 %120, label %121, label %112
121: ; preds = %112, %106
%122 = phi i64 [ %107, %106 ], [ %118, %112 ]
%123 = icmp ult i64 %109, 3
br i1 %123, label %143, label %124
124: ; preds = %121, %124
%125 = phi i64 [ %141, %124 ], [ %122, %121 ]
%126 = getelementptr inbounds double, double* %0, i64 %125
%127 = load double, double* %126
%128 = getelementptr inbounds double, double* %2, i64 %125
store double %127, double* %128
%129 = add nuw nsw i64 %125, 1
%130 = getelementptr inbounds double, double* %0, i64 %129
%131 = load double, double* %130
%132 = getelementptr inbounds double, double* %2, i64 %129
store double %131, double* %132
%133 = add nuw nsw i64 %125, 2
%134 = getelementptr inbounds double, double* %0, i64 %133
%135 = load double, double* %134
%136 = getelementptr inbounds double, double* %2, i64 %133
store double %135, double* %136
%137 = add nuw nsw i64 %125, 3
%138 = getelementptr inbounds double, double* %0, i64 %137
%139 = load double, double* %138
%140 = getelementptr inbounds double, double* %2, i64 %137
store double %139, double* %140
%141 = add nuw nsw i64 %125, 4
%142 = icmp eq i64 %141, %19
br i1 %142, label %143, label %124
143: ; preds = %121, %124, %104, %15
%144 = tail call i32 @Factorize(double* %2, double* %3, i32 %1)
br label %145
145: ; preds = %5, %143
ret void
}