#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 */
double fabs(double);
int LU_factor(int M, int N, double **A, int *pivot) {
  int minMN = M < N ? M : N;
  int j = 0;
  for (j = 0; j < minMN; j++) {
    int jp = j;
    int i;
    double t = fabs(A[j][j]);
    for (i = j + 1; i < M; i++) {
      double ab = fabs(A[i][j]);
      if (ab > t) {
        jp = i;
        t = ab;
      }
    }
    pivot[j] = jp;
    if (A[jp][j] == 0)
      return 1;
    if (jp != j) {
      double *tA = A[j];
      A[j] = A[jp];
      A[jp] = tA;
    }
    if (j < M - 1) {
      double recp = 1.0 / A[j][j];
      int k;
      for (k = j + 1; k < M; k++)
        A[k][j] *= recp;
    }
    if (j < minMN - 1) {
      int ii;
      for (ii = j + 1; ii < M; ii++) {
        double *Aii = A[ii];
        double *Aj = A[j];
        double AiiJ = Aii[j];
        int jj;
        for (jj = j + 1; jj < N; jj++)
          Aii[jj] -= AiiJ * Aj[jj];
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<LU_factor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1129 <LU_factor+0x29>
mov    -0x8(%rbp),%eax
mov    %eax,-0x78(%rbp)
jmp    112f <LU_factor+0x2f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x78(%rbp)
mov    -0x78(%rbp),%eax
mov    %eax,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    13d0 <LU_factor+0x2d0>
mov    -0x28(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xe8f(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11e7 <LU_factor+0xe7>
mov    -0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xe55(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
ucomisd -0x38(%rbp),%xmm0
jbe    11d4 <LU_factor+0xd4>
mov    -0x30(%rbp),%eax
mov    %eax,-0x2c(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    11d9 <LU_factor+0xd9>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1183 <LU_factor+0x83>
mov    -0x2c(%rbp),%edx
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1229 <LU_factor+0x129>
jp     1229 <LU_factor+0x129>
movl   $0x1,-0x4(%rbp)
jmp    13d7 <LU_factor+0x2d7>
mov    -0x2c(%rbp),%eax
cmp    -0x28(%rbp),%eax
je     126d <LU_factor+0x16d>
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x48(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x48(%rbp),%rdx
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    12e7 <LU_factor+0x1e7>
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  0xd7a(%rip),%xmm0
divsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12e2 <LU_factor+0x1e2>
movsd  -0x50(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x54(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    12a9 <LU_factor+0x1a9>
jmp    12e7 <LU_factor+0x1e7>
mov    -0x28(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    13bd <LU_factor+0x2bd>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    13b8 <LU_factor+0x2b8>
mov    -0x18(%rbp),%rax
movslq -0x58(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x60(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x68(%rbp)
mov    -0x60(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
mov    -0x74(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    13a5 <LU_factor+0x2a5>
movsd  -0x70(%rbp),%xmm0
mov    -0x68(%rbp),%rax
movslq -0x74(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x60(%rbp),%rax
movslq -0x74(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movq   %xmm0,%rdx
movabs $0x8000000000000000,%rsi
xor    %rsi,%rdx
movq   %rdx,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1348 <LU_factor+0x248>
jmp    13aa <LU_factor+0x2aa>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    1301 <LU_factor+0x201>
jmp    13bd <LU_factor+0x2bd>
jmp    13c2 <LU_factor+0x2c2>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1143 <LU_factor+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LU_factor>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rcx,-0x30(%rsp)
cmp    %esi,%edi
mov    %esi,%eax
cmovl  %edi,%eax
test   %eax,%eax
jle    151d <LU_factor+0x41d>
lea    -0x1(%rdi),%ecx
lea    -0x1(%rax),%ebp
mov    %rbp,-0x50(%rsp)
movslq %edi,%rbp
mov    %rbp,-0x80(%rsp)
movslq %esi,%r12
movslq %ecx,%rcx
mov    %rcx,-0x40(%rsp)
mov    %eax,%eax
mov    %rax,-0x48(%rsp)
mov    %edi,%r8d
mov    %esi,%r9d
mov    %r9,%r13
neg    %r13
lea    -0x5(%r9),%rax
mov    %rax,-0x70(%rsp)
mov    $0x1,%r11d
mov    $0x7,%eax
mov    %rax,-0x78(%rsp)
xor    %r10d,%r10d
movapd 0xe89(%rip),%xmm0
xorpd  %xmm9,%xmm9
movsd  0xe9b(%rip),%xmm8
movapd 0xe82(%rip),%xmm10
mov    %r8,%r14
mov    %rdx,%r15
mov    %r12,-0x20(%rsp)
mov    %r13,-0x28(%rsp)
jmp    11cd <LU_factor+0xcd>
add    $0x1,%r11
mov    -0x68(%rsp),%r15
add    $0x8,%r15
mov    -0x60(%rsp),%r14
add    $0xffffffffffffffff,%r14
addq   $0x1,-0x78(%rsp)
addq   $0xffffffffffffffff,-0x70(%rsp)
cmp    -0x48(%rsp),%r10
je     151d <LU_factor+0x41d>
mov    %r10,%rax
mov    (%rdx,%r10,8),%rcx
add    $0x1,%r10
cmp    -0x80(%rsp),%r10
jge    1220 <LU_factor+0x120>
movsd  (%rcx,%rax,8),%xmm4
andpd  %xmm0,%xmm4
mov    %r11,%rdi
mov    %eax,%ebp
nopl   (%rax)
mov    (%rdx,%rdi,8),%rbx
movsd  (%rbx,%rax,8),%xmm5
andpd  %xmm0,%xmm5
ucomisd %xmm4,%xmm5
cmova  %edi,%ebp
maxsd  %xmm4,%xmm5
add    $0x1,%rdi
movapd %xmm5,%xmm4
cmp    %rdi,%r8
jne    11f0 <LU_factor+0xf0>
jmp    1222 <LU_factor+0x122>
nopw   0x0(%rax,%rax,1)
mov    %eax,%ebp
mov    -0x30(%rsp),%rsi
mov    %ebp,(%rsi,%rax,4)
movslq %ebp,%rdi
mov    (%rdx,%rdi,8),%rbx
movsd  (%rbx,%rax,8),%xmm4
ucomisd %xmm9,%xmm4
jne    1243 <LU_factor+0x143>
jnp    1521 <LU_factor+0x421>
mov    %ebp,%ebp
cmp    %rbp,%rax
je     1252 <LU_factor+0x152>
mov    %rbx,(%rdx,%rax,8)
mov    %rcx,(%rdx,%rdi,8)
cmp    -0x40(%rsp),%rax
mov    %r14,-0x60(%rsp)
mov    %r15,-0x68(%rsp)
jge    12ab <LU_factor+0x1ab>
cmp    -0x80(%rsp),%r10
jge    11a0 <LU_factor+0xa0>
mov    (%rdx,%rax,8),%rcx
movapd %xmm8,%xmm4
divsd  (%rcx,%rax,8),%xmm4
mov    $0x1,%ecx
mov    -0x60(%rsp),%r14
mov    -0x68(%rsp),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rcx,8),%rdi
movsd  (%rdi,%rax,8),%xmm5
mulsd  %xmm4,%xmm5
movsd  %xmm5,(%rdi,%rax,8)
add    $0x1,%rcx
cmp    %rcx,%r14
jne    1290 <LU_factor+0x190>
cmp    -0x50(%rsp),%rax
jae    11a0 <LU_factor+0xa0>
cmp    -0x80(%rsp),%r10
jge    11a0 <LU_factor+0xa0>
mov    -0x70(%rsp),%rcx
shr    $0x2,%rcx
add    $0x1,%rcx
mov    %rax,%rsi
not    %rsi
lea    (%rsi,%r9,1),%rdi
add    $0xfffffffffffffffc,%rdi
mov    %rdi,(%rsp)
shr    $0x2,%rdi
and    $0xfffffffffffffffe,%rcx
mov    %rcx,-0x38(%rsp)
add    %r9,%rsi
add    $0x1,%rdi
mov    %rdi,-0x8(%rsp)
mov    (%rdx,%rax,8),%r14
lea    (%r14,%r11,8),%rcx
mov    %rcx,0x8(%rsp)
lea    (%r14,%r9,8),%rcx
mov    %rcx,0x10(%rsp)
mov    %rsi,-0x58(%rsp)
and    $0xfffffffffffffffc,%rsi
mov    %rsi,-0x10(%rsp)
lea    (%r11,%rsi,1),%rcx
mov    %rcx,-0x18(%rsp)
mov    -0x78(%rsp),%rcx
lea    (%r14,%rcx,8),%rcx
mov    %r11,%rbx
jmp    134d <LU_factor+0x24d>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rbx
cmp    %r8,%rbx
je     11a0 <LU_factor+0xa0>
cmp    %r12,%r10
jge    1340 <LU_factor+0x240>
mov    (%rdx,%rbx,8),%r15
movsd  (%r15,%rax,8),%xmm4
xorpd  %xmm10,%xmm4
mov    %r11,%rdi
cmpq   $0x4,-0x58(%rsp)
jb     14a0 <LU_factor+0x3a0>
lea    (%r15,%r11,8),%rdi
cmp    0x10(%rsp),%rdi
jae    138d <LU_factor+0x28d>
lea    (%r15,%r9,8),%rbp
mov    %r11,%rdi
cmp    %rbp,0x8(%rsp)
jb     14a0 <LU_factor+0x3a0>
movapd %xmm4,%xmm5
unpcklpd %xmm4,%xmm5
cmpq   $0x4,(%rsp)
jae    13a4 <LU_factor+0x2a4>
xor    %r12d,%r12d
jmp    143d <LU_factor+0x33d>
mov    -0x78(%rsp),%rsi
lea    (%r15,%rsi,8),%r13
mov    -0x38(%rsp),%rbp
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nop
movupd -0x30(%rcx,%r12,8),%xmm6
movupd -0x20(%rcx,%r12,8),%xmm7
mulpd  %xmm5,%xmm6
movupd -0x30(%r13,%r12,8),%xmm2
addpd  %xmm6,%xmm2
movupd -0x20(%r13,%r12,8),%xmm6
movupd -0x10(%r13,%r12,8),%xmm1
movupd 0x0(%r13,%r12,8),%xmm3
mulpd  %xmm5,%xmm7
addpd  %xmm6,%xmm7
movupd %xmm2,-0x30(%r13,%r12,8)
movupd %xmm7,-0x20(%r13,%r12,8)
movupd -0x10(%rcx,%r12,8),%xmm2
movupd (%rcx,%r12,8),%xmm6
mulpd  %xmm5,%xmm2
addpd  %xmm1,%xmm2
mulpd  %xmm5,%xmm6
addpd  %xmm3,%xmm6
movupd %xmm2,-0x10(%r13,%r12,8)
movupd %xmm6,0x0(%r13,%r12,8)
add    $0x8,%r12
add    $0xfffffffffffffffe,%rbp
jne    13c0 <LU_factor+0x2c0>
testb  $0x1,-0x8(%rsp)
mov    -0x28(%rsp),%r13
je     1483 <LU_factor+0x383>
add    %r11,%r12
movupd (%r14,%r12,8),%xmm1
movupd 0x10(%r14,%r12,8),%xmm2
movupd (%r15,%r12,8),%xmm3
movupd 0x10(%r15,%r12,8),%xmm6
mulpd  %xmm5,%xmm1
addpd  %xmm3,%xmm1
mulpd  %xmm5,%xmm2
addpd  %xmm6,%xmm2
movupd %xmm1,(%r15,%r12,8)
movupd %xmm2,0x10(%r15,%r12,8)
mov    -0x18(%rsp),%rdi
mov    -0x10(%rsp),%rsi
cmp    %rsi,-0x58(%rsp)
mov    -0x20(%rsp),%r12
je     1340 <LU_factor+0x240>
nopl   (%rax)
mov    %r9d,%esi
sub    %edi,%esi
mov    %rdi,%rbp
test   $0x1,%sil
je     14c8 <LU_factor+0x3c8>
movsd  (%r14,%rdi,8),%xmm1
mulsd  %xmm4,%xmm1
addsd  (%r15,%rdi,8),%xmm1
movsd  %xmm1,(%r15,%rdi,8)
lea    0x1(%rdi),%rbp
not    %rdi
cmp    %r13,%rdi
je     1340 <LU_factor+0x240>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%r14,%rbp,8),%xmm1
mulsd  %xmm4,%xmm1
addsd  (%r15,%rbp,8),%xmm1
movsd  %xmm1,(%r15,%rbp,8)
movsd  0x8(%r14,%rbp,8),%xmm1
mulsd  %xmm4,%xmm1
addsd  0x8(%r15,%rbp,8),%xmm1
movsd  %xmm1,0x8(%r15,%rbp,8)
add    $0x2,%rbp
cmp    %rbp,%r9
jne    14e0 <LU_factor+0x3e0>
jmp    1340 <LU_factor+0x240>
xor    %eax,%eax
jmp    1526 <LU_factor+0x426>
mov    $0x1,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @LU_factor(i32 %0, i32 %1, double** %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double**
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca double
%15 = alloca double
%16 = alloca double*
%17 = alloca double
%18 = alloca i32
%19 = alloca i32
%20 = alloca double*
%21 = alloca double*
%22 = alloca double
%23 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store double** %2, double*** %8
store i32* %3, i32** %9
%24 = load i32, i32* %6
%25 = load i32, i32* %7
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %29
27: ; preds = %4
%28 = load i32, i32* %6
br label %31
29: ; preds = %4
%30 = load i32, i32* %7
br label %31
31: ; preds = %29, %27
%32 = phi i32 [ %28, %27 ], [ %30, %29 ]
store i32 %32, i32* %10
store i32 0, i32* %11
store i32 0, i32* %11
br label %33
33: ; preds = %212, %31
%34 = load i32, i32* %11
%35 = load i32, i32* %10
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %215
37: ; preds = %33
%38 = load i32, i32* %11
store i32 %38, i32* %12
%39 = load double**, double*** %8
%40 = load i32, i32* %11
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds double*, double** %39, i64 %41
%43 = load double*, double** %42
%44 = load i32, i32* %11
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds double, double* %43, i64 %45
%47 = load double, double* %46
%48 = call double @llvm.fabs.f64(double %47)
store double %48, double* %14
%49 = load i32, i32* %11
%50 = add nsw i32 %49, 1
store i32 %50, i32* %13
br label %51
51: ; preds = %73, %37
%52 = load i32, i32* %13
%53 = load i32, i32* %6
%54 = icmp slt i32 %52, %53
br i1 %54, label %55, label %76
55: ; preds = %51
%56 = load double**, double*** %8
%57 = load i32, i32* %13
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds double*, double** %56, i64 %58
%60 = load double*, double** %59
%61 = load i32, i32* %11
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds double, double* %60, i64 %62
%64 = load double, double* %63
%65 = call double @llvm.fabs.f64(double %64)
store double %65, double* %15
%66 = load double, double* %15
%67 = load double, double* %14
%68 = fcmp ogt double %66, %67
br i1 %68, label %69, label %72
69: ; preds = %55
%70 = load i32, i32* %13
store i32 %70, i32* %12
%71 = load double, double* %15
store double %71, double* %14
br label %72
72: ; preds = %69, %55
br label %73
73: ; preds = %72
%74 = load i32, i32* %13
%75 = add nsw i32 %74, 1
store i32 %75, i32* %13
br label %51
76: ; preds = %51
%77 = load i32, i32* %12
%78 = load i32*, i32** %9
%79 = load i32, i32* %11
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds i32, i32* %78, i64 %80
store i32 %77, i32* %81
%82 = load double**, double*** %8
%83 = load i32, i32* %12
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds double*, double** %82, i64 %84
%86 = load double*, double** %85
%87 = load i32, i32* %11
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds double, double* %86, i64 %88
%90 = load double, double* %89
%91 = fcmp oeq double %90, 0.000000e+00
br i1 %91, label %92, label %93
92: ; preds = %76
store i32 1, i32* %5
br label %216
93: ; preds = %76
%94 = load i32, i32* %12
%95 = load i32, i32* %11
%96 = icmp ne i32 %94, %95
br i1 %96, label %97, label %117
97: ; preds = %93
%98 = load double**, double*** %8
%99 = load i32, i32* %11
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds double*, double** %98, i64 %100
%102 = load double*, double** %101
store double* %102, double** %16
%103 = load double**, double*** %8
%104 = load i32, i32* %12
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds double*, double** %103, i64 %105
%107 = load double*, double** %106
%108 = load double**, double*** %8
%109 = load i32, i32* %11
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds double*, double** %108, i64 %110
store double* %107, double** %111
%112 = load double*, double** %16
%113 = load double**, double*** %8
%114 = load i32, i32* %12
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds double*, double** %113, i64 %115
store double* %112, double** %116
br label %117
117: ; preds = %97, %93
%118 = load i32, i32* %11
%119 = load i32, i32* %6
%120 = sub nsw i32 %119, 1
%121 = icmp slt i32 %118, %120
br i1 %121, label %122, label %155
122: ; preds = %117
%123 = load double**, double*** %8
%124 = load i32, i32* %11
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds double*, double** %123, i64 %125
%127 = load double*, double** %126
%128 = load i32, i32* %11
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds double, double* %127, i64 %129
%131 = load double, double* %130
%132 = fdiv double 1.000000e+00, %131
store double %132, double* %17
%133 = load i32, i32* %11
%134 = add nsw i32 %133, 1
store i32 %134, i32* %18
br label %135
135: ; preds = %151, %122
%136 = load i32, i32* %18
%137 = load i32, i32* %6
%138 = icmp slt i32 %136, %137
br i1 %138, label %139, label %154
139: ; preds = %135
%140 = load double, double* %17
%141 = load double**, double*** %8
%142 = load i32, i32* %18
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds double*, double** %141, i64 %143
%145 = load double*, double** %144
%146 = load i32, i32* %11
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds double, double* %145, i64 %147
%149 = load double, double* %148
%150 = fmul double %149, %140
store double %150, double* %148
br label %151
151: ; preds = %139
%152 = load i32, i32* %18
%153 = add nsw i32 %152, 1
store i32 %153, i32* %18
br label %135
154: ; preds = %135
br label %155
155: ; preds = %154, %117
%156 = load i32, i32* %11
%157 = load i32, i32* %10
%158 = sub nsw i32 %157, 1
%159 = icmp slt i32 %156, %158
br i1 %159, label %160, label %211
160: ; preds = %155
%161 = load i32, i32* %11
%162 = add nsw i32 %161, 1
store i32 %162, i32* %19
br label %163
163: ; preds = %207, %160
%164 = load i32, i32* %19
%165 = load i32, i32* %6
%166 = icmp slt i32 %164, %165
br i1 %166, label %167, label %210
167: ; preds = %163
%168 = load double**, double*** %8
%169 = load i32, i32* %19
%170 = sext i32 %169 to i64
%171 = getelementptr inbounds double*, double** %168, i64 %170
%172 = load double*, double** %171
store double* %172, double** %20
%173 = load double**, double*** %8
%174 = load i32, i32* %11
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds double*, double** %173, i64 %175
%177 = load double*, double** %176
store double* %177, double** %21
%178 = load double*, double** %20
%179 = load i32, i32* %11
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds double, double* %178, i64 %180
%182 = load double, double* %181
store double %182, double* %22
%183 = load i32, i32* %11
%184 = add nsw i32 %183, 1
store i32 %184, i32* %23
br label %185
185: ; preds = %203, %167
%186 = load i32, i32* %23
%187 = load i32, i32* %7
%188 = icmp slt i32 %186, %187
br i1 %188, label %189, label %206
189: ; preds = %185
%190 = load double, double* %22
%191 = load double*, double** %21
%192 = load i32, i32* %23
%193 = sext i32 %192 to i64
%194 = getelementptr inbounds double, double* %191, i64 %193
%195 = load double, double* %194
%196 = load double*, double** %20
%197 = load i32, i32* %23
%198 = sext i32 %197 to i64
%199 = getelementptr inbounds double, double* %196, i64 %198
%200 = load double, double* %199
%201 = fneg double %190
%202 = call double @llvm.fmuladd.f64(double %201, double %195, double %200)
store double %202, double* %199
br label %203
203: ; preds = %189
%204 = load i32, i32* %23
%205 = add nsw i32 %204, 1
store i32 %205, i32* %23
br label %185
206: ; preds = %185
br label %207
207: ; preds = %206
%208 = load i32, i32* %19
%209 = add nsw i32 %208, 1
store i32 %209, i32* %19
br label %163
210: ; preds = %163
br label %211
211: ; preds = %210, %155
br label %212
212: ; preds = %211
%213 = load i32, i32* %11
%214 = add nsw i32 %213, 1
store i32 %214, i32* %11
br label %33
215: ; preds = %33
store i32 0, i32* %5
br label %216
216: ; preds = %215, %92
%217 = load i32, i32* %5
ret i32 %217
}

LLVM IR (-O2):
define i32 @LU_factor(i32 %0, i32 %1, double** nocapture %2, i32* nocapture writeonly %3) {
%5 = icmp slt i32 %0, %1
%6 = select i1 %5, i32 %0, i32 %1
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %218
8: ; preds = %4
%9 = add nsw i32 %0, -1
%10 = add nsw i32 %6, -1
%11 = sext i32 %0 to i64
%12 = sext i32 %1 to i64
%13 = zext i32 %10 to i64
%14 = sext i32 %9 to i64
%15 = zext i32 %6 to i64
%16 = zext i32 %0 to i64
%17 = zext i32 %0 to i64
%18 = zext i32 %0 to i64
%19 = zext i32 %1 to i64
%20 = sub nsw i64 0, %19
br label %21
21: ; preds = %8, %215
%22 = phi i64 [ 0, %8 ], [ %33, %215 ]
%23 = phi i64 [ 1, %8 ], [ %216, %215 ]
%24 = xor i64 %22, -1
%25 = add nsw i64 %24, %19
%26 = add i64 %25, -4
%27 = lshr i64 %26, 2
%28 = add nuw nsw i64 %27, 1
%29 = xor i64 %22, -1
%30 = add nsw i64 %29, %19
%31 = getelementptr inbounds double*, double** %2, i64 %22
%32 = load double*, double** %31
%33 = add nuw nsw i64 %22, 1
%34 = icmp slt i64 %33, %11
%35 = trunc i64 %22 to i32
br i1 %34, label %36, label %55
36: ; preds = %21
%37 = getelementptr inbounds double, double* %32, i64 %22
%38 = load double, double* %37
%39 = tail call double @llvm.fabs.f64(double %38)
br label %40
40: ; preds = %36, %40
%41 = phi i64 [ %23, %36 ], [ %53, %40 ]
%42 = phi i32 [ %35, %36 ], [ %52, %40 ]
%43 = phi double [ %39, %36 ], [ %50, %40 ]
%44 = getelementptr inbounds double*, double** %2, i64 %41
%45 = load double*, double** %44
%46 = getelementptr inbounds double, double* %45, i64 %22
%47 = load double, double* %46
%48 = tail call double @llvm.fabs.f64(double %47)
%49 = fcmp ogt double %48, %43
%50 = select i1 %49, double %48, double %43
%51 = trunc i64 %41 to i32
%52 = select i1 %49, i32 %51, i32 %42
%53 = add nuw nsw i64 %41, 1
%54 = icmp eq i64 %53, %16
br i1 %54, label %55, label %40
55: ; preds = %40, %21
%56 = phi i32 [ %35, %21 ], [ %52, %40 ]
%57 = getelementptr inbounds i32, i32* %3, i64 %22
store i32 %56, i32* %57
%58 = sext i32 %56 to i64
%59 = getelementptr inbounds double*, double** %2, i64 %58
%60 = load double*, double** %59
%61 = getelementptr inbounds double, double* %60, i64 %22
%62 = load double, double* %61
%63 = fcmp oeq double %62, 0.000000e+00
br i1 %63, label %218, label %64
64: ; preds = %55
%65 = zext i32 %56 to i64
%66 = icmp eq i64 %22, %65
br i1 %66, label %68, label %67
67: ; preds = %64
store double* %60, double** %31
store double* %32, double** %59
br label %68
68: ; preds = %67, %64
%69 = icmp slt i64 %22, %14
br i1 %69, label %70, label %84
70: ; preds = %68
%71 = load double*, double** %31
%72 = getelementptr inbounds double, double* %71, i64 %22
%73 = load double, double* %72
%74 = fdiv double 1.000000e+00, %73
br i1 %34, label %75, label %215
75: ; preds = %70, %75
%76 = phi i64 [ %82, %75 ], [ %23, %70 ]
%77 = getelementptr inbounds double*, double** %2, i64 %76
%78 = load double*, double** %77
%79 = getelementptr inbounds double, double* %78, i64 %22
%80 = load double, double* %79
%81 = fmul double %74, %80
store double %81, double* %79
%82 = add nuw nsw i64 %76, 1
%83 = icmp eq i64 %82, %17
br i1 %83, label %84, label %75
84: ; preds = %75, %68
%85 = icmp ult i64 %22, %13
%86 = select i1 %85, i1 %34, i1 false
br i1 %86, label %87, label %215
87: ; preds = %84
%88 = load double*, double** %31
%89 = icmp slt i64 %33, %12
%90 = getelementptr double, double* %88, i64 %23
%91 = getelementptr double, double* %88, i64 %19
%92 = icmp ult i64 %30, 4
%93 = and i64 %30, -4
%94 = add i64 %23, %93
%95 = and i64 %28, 1
%96 = icmp ult i64 %26, 4
%97 = and i64 %28, 9223372036854775806
%98 = icmp eq i64 %95, 0
%99 = icmp eq i64 %30, %93
br label %100
100: ; preds = %87, %212
%101 = phi i64 [ %23, %87 ], [ %213, %212 ]
%102 = getelementptr inbounds double*, double** %2, i64 %101
%103 = load double*, double** %102
br i1 %89, label %104, label %212
104: ; preds = %100
%105 = getelementptr inbounds double, double* %103, i64 %22
%106 = load double, double* %105
%107 = fneg double %106
br i1 %92, label %181, label %108
108: ; preds = %104
%109 = getelementptr double, double* %103, i64 %23
%110 = getelementptr double, double* %103, i64 %19
%111 = icmp ult double* %109, %91
%112 = icmp ult double* %90, %110
%113 = and i1 %111, %112
br i1 %113, label %181, label %114
114: ; preds = %108
%115 = insertelement <2 x double> poison, double %107, i64 0
%116 = shufflevector <2 x double> %115, <2 x double> poison, <2 x i32> zeroinitializer
%117 = insertelement <2 x double> poison, double %107, i64 0
%118 = shufflevector <2 x double> %117, <2 x double> poison, <2 x i32> zeroinitializer
br i1 %96, label %160, label %119
119: ; preds = %114, %119
%120 = phi i64 [ %157, %119 ], [ 0, %114 ]
%121 = phi i64 [ %158, %119 ], [ 0, %114 ]
%122 = add i64 %23, %120
%123 = getelementptr inbounds double, double* %88, i64 %122
%124 = bitcast double* %123 to <2 x double>*
%125 = load <2 x double>, <2 x double>* %124
%126 = getelementptr inbounds double, double* %123, i64 2
%127 = bitcast double* %126 to <2 x double>*
%128 = load <2 x double>, <2 x double>* %127
%129 = getelementptr inbounds double, double* %103, i64 %122
%130 = bitcast double* %129 to <2 x double>*
%131 = load <2 x double>, <2 x double>* %130
%132 = getelementptr inbounds double, double* %129, i64 2
%133 = bitcast double* %132 to <2 x double>*
%134 = load <2 x double>, <2 x double>* %133
%135 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %116, <2 x double> %125, <2 x double> %131)
%136 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %118, <2 x double> %128, <2 x double> %134)
%137 = bitcast double* %129 to <2 x double>*
store <2 x double> %135, <2 x double>* %137
%138 = bitcast double* %132 to <2 x double>*
store <2 x double> %136, <2 x double>* %138
%139 = or i64 %120, 4
%140 = add i64 %23, %139
%141 = getelementptr inbounds double, double* %88, i64 %140
%142 = bitcast double* %141 to <2 x double>*
%143 = load <2 x double>, <2 x double>* %142
%144 = getelementptr inbounds double, double* %141, i64 2
%145 = bitcast double* %144 to <2 x double>*
%146 = load <2 x double>, <2 x double>* %145
%147 = getelementptr inbounds double, double* %103, i64 %140
%148 = bitcast double* %147 to <2 x double>*
%149 = load <2 x double>, <2 x double>* %148
%150 = getelementptr inbounds double, double* %147, i64 2
%151 = bitcast double* %150 to <2 x double>*
%152 = load <2 x double>, <2 x double>* %151
%153 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %116, <2 x double> %143, <2 x double> %149)
%154 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %118, <2 x double> %146, <2 x double> %152)
%155 = bitcast double* %147 to <2 x double>*
store <2 x double> %153, <2 x double>* %155
%156 = bitcast double* %150 to <2 x double>*
store <2 x double> %154, <2 x double>* %156
%157 = add nuw i64 %120, 8
%158 = add i64 %121, 2
%159 = icmp eq i64 %158, %97
br i1 %159, label %160, label %119
160: ; preds = %119, %114
%161 = phi i64 [ 0, %114 ], [ %157, %119 ]
br i1 %98, label %180, label %162
162: ; preds = %160
%163 = add i64 %23, %161
%164 = getelementptr inbounds double, double* %88, i64 %163
%165 = bitcast double* %164 to <2 x double>*
%166 = load <2 x double>, <2 x double>* %165
%167 = getelementptr inbounds double, double* %164, i64 2
%168 = bitcast double* %167 to <2 x double>*
%169 = load <2 x double>, <2 x double>* %168
%170 = getelementptr inbounds double, double* %103, i64 %163
%171 = bitcast double* %170 to <2 x double>*
%172 = load <2 x double>, <2 x double>* %171
%173 = getelementptr inbounds double, double* %170, i64 2
%174 = bitcast double* %173 to <2 x double>*
%175 = load <2 x double>, <2 x double>* %174
%176 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %116, <2 x double> %166, <2 x double> %172)
%177 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %118, <2 x double> %169, <2 x double> %175)
%178 = bitcast double* %170 to <2 x double>*
store <2 x double> %176, <2 x double>* %178
%179 = bitcast double* %173 to <2 x double>*
store <2 x double> %177, <2 x double>* %179
br label %180
180: ; preds = %160, %162
br i1 %99, label %212, label %181
181: ; preds = %108, %104, %180
%182 = phi i64 [ %23, %108 ], [ %23, %104 ], [ %94, %180 ]
%183 = sub i64 %19, %182
%184 = xor i64 %182, -1
%185 = and i64 %183, 1
%186 = icmp eq i64 %185, 0
br i1 %186, label %194, label %187
187: ; preds = %181
%188 = getelementptr inbounds double, double* %88, i64 %182
%189 = load double, double* %188
%190 = getelementptr inbounds double, double* %103, i64 %182
%191 = load double, double* %190
%192 = tail call double @llvm.fmuladd.f64(double %107, double %189, double %191)
store double %192, double* %190
%193 = add nuw nsw i64 %182, 1
br label %194
194: ; preds = %187, %181
%195 = phi i64 [ %182, %181 ], [ %193, %187 ]
%196 = icmp eq i64 %184, %20
br i1 %196, label %212, label %197
197: ; preds = %194, %197
%198 = phi i64 [ %210, %197 ], [ %195, %194 ]
%199 = getelementptr inbounds double, double* %88, i64 %198
%200 = load double, double* %199
%201 = getelementptr inbounds double, double* %103, i64 %198
%202 = load double, double* %201
%203 = tail call double @llvm.fmuladd.f64(double %107, double %200, double %202)
store double %203, double* %201
%204 = add nuw nsw i64 %198, 1
%205 = getelementptr inbounds double, double* %88, i64 %204
%206 = load double, double* %205
%207 = getelementptr inbounds double, double* %103, i64 %204
%208 = load double, double* %207
%209 = tail call double @llvm.fmuladd.f64(double %107, double %206, double %208)
store double %209, double* %207
%210 = add nuw nsw i64 %198, 2
%211 = icmp eq i64 %210, %19
br i1 %211, label %212, label %197
212: ; preds = %194, %197, %180, %100
%213 = add nuw nsw i64 %101, 1
%214 = icmp eq i64 %213, %18
br i1 %214, label %215, label %100
215: ; preds = %212, %70, %84
%216 = add nuw nsw i64 %23, 1
%217 = icmp eq i64 %33, %15
br i1 %217, label %218, label %21
218: ; preds = %215, %55, %4
%219 = phi i32 [ 0, %4 ], [ 1, %55 ], [ 0, %215 ]
ret i32 %219
}