#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 DBL_EPSILON;
int /*<<< orphan*/ exit(int);
double fabs(double);
double norma_inf(double **, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ swap_rows(double **, int, int, int);
double lupp(int n, double **A, int *p) {
  int i = 0;
  int j = 0;
  int k = 0;
  int temp = 0;
  double detA = 1;
  double norma = norma_inf(A, n);
  double mult = 0;
  for (k = 0; k < n - 1; k++) {
    i = k;
    while (i < n && fabs(A[i][k]) < DBL_EPSILON * norma)
      i++;
    if (i != k) {
      swap_rows(A, i, k, n);
      temp = p[i];
      p[i] = p[k];
      p[k] = temp;
      detA *= -1;
    }
    detA *= A[k][k];
    if (detA == 0) {
      printf("La matriu A és singular.\n");
      exit(1);
    }
    for (i = k + 1; i < n; i++) {
      mult = A[i][k] / A[k][k];
      for (j = k + 1; j < n; j++) {
        A[i][j] -= mult * A[k][j];
      }
      A[i][k] = mult;
    }
  }
  detA *= A[n - 1][n - 1];
  if (detA == 0) {
    printf("La matriu A és singular.\n");
    exit(1);
  }
  return detA;
}


x86 assembly (clang, -O0):
<lupp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movsd  0xe89(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1050 <norma_inf@plt>
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    13c0 <lupp+0x280>
mov    -0x24(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
xor    %eax,%eax
cmp    -0x4(%rbp),%ecx
mov    %al,-0x41(%rbp)
jge    11fe <lupp+0xbe>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movaps 0xe30(%rip),%xmm0
pand   %xmm0,%xmm1
mov    0x2dfd(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x38(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x41(%rbp)
mov    -0x41(%rbp),%al
test   $0x1,%al
jne    120e <lupp+0xce>
jmp    121c <lupp+0xdc>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11b3 <lupp+0x73>
mov    -0x1c(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     127e <lupp+0x13e>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x4(%rbp),%ecx
call   1040 <swap_rows@plt>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x28(%rbp),%edx
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
movsd  0xd94(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    12cb <lupp+0x18b>
jp     12cb <lupp+0x18b>
lea    0xd64(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    13ad <lupp+0x26d>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1385 <lupp+0x245>
movsd  -0x40(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%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    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1318 <lupp+0x1d8>
movsd  -0x40(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    12d4 <lupp+0x194>
jmp    13b2 <lupp+0x272>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    119c <lupp+0x5c>
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1417 <lupp+0x2d7>
jp     1417 <lupp+0x2d7>
lea    0xc18(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
movsd  -0x30(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lupp>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %rdx,0x58(%rsp)
mov    %edi,%ebx
mov    %rsi,0x8(%rsp)
mov    %rsi,%rdi
mov    %ebx,%esi
call   1050 <norma_inf@plt>
movsd  %xmm0,0x50(%rsp)
lea    -0x1(%rbx),%eax
cmp    $0x2,%ebx
mov    %eax,0x1c(%rsp)
jl     1557 <lupp+0x417>
mov    %rbx,0x48(%rsp)
mov    %ebx,%r12d
mov    %eax,%eax
mov    %rax,0x60(%rsp)
mov    %r12,%r9
neg    %r9
lea    -0x5(%r12),%rax
mov    %rax,0x20(%rsp)
movsd  0xe5c(%rip),%xmm0
mov    $0x1,%r10d
mov    $0x7,%eax
mov    %rax,0x10(%rsp)
xor    %r15d,%r15d
movapd 0xe50(%rip),%xmm9
xorpd  %xmm10,%xmm10
movapd 0xe52(%rip),%xmm11
mov    0x8(%rsp),%rdi
mov    %r9,0x28(%rsp)
jmp    1200 <lupp+0xc0>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r10
addq   $0x1,0x10(%rsp)
addq   $0xffffffffffffffff,0x20(%rsp)
mov    0x68(%rsp),%r15
cmp    0x60(%rsp),%r15
je     1564 <lupp+0x424>
mov    %r15d,%eax
cmp    %r12,%r15
jae    1241 <lupp+0x101>
mov    0x2dd9(%rip),%rax
movsd  (%rax),%xmm2
mulsd  0x50(%rsp),%xmm2
mov    %r15,%rax
nopl   0x0(%rax)
mov    (%rdi,%rax,8),%rcx
movsd  (%rcx,%r15,8),%xmm1
andpd  %xmm9,%xmm1
ucomisd %xmm1,%xmm2
jbe    1241 <lupp+0x101>
add    $0x1,%rax
cmp    %rax,%r12
jne    1220 <lupp+0xe0>
mov    %r12d,%eax
mov    %eax,%r13d
cmp    %r13,%r15
je     12a6 <lupp+0x166>
mov    %r13d,%esi
mov    %r15d,%edx
mov    0x48(%rsp),%rcx
movapd %xmm0,0x30(%rsp)
mov    %r10,%rbx
call   1040 <swap_rows@plt>
mov    %rbx,%r10
movapd 0xdb2(%rip),%xmm11
xorpd  %xmm10,%xmm10
movapd 0xd94(%rip),%xmm9
mov    0x28(%rsp),%r9
movapd 0x30(%rsp),%xmm0
mov    0x8(%rsp),%rdi
mov    0x58(%rsp),%rdx
mov    (%rdx,%r13,4),%eax
mov    (%rdx,%r15,4),%ecx
mov    %ecx,(%rdx,%r13,4)
mov    %eax,(%rdx,%r15,4)
xorpd  %xmm11,%xmm0
mov    (%rdi,%r15,8),%rcx
movsd  (%rcx,%r15,8),%xmm1
mulsd  %xmm1,%xmm0
ucomisd %xmm10,%xmm0
jne    12c1 <lupp+0x181>
jnp    1590 <lupp+0x450>
lea    0x1(%r15),%rax
mov    %rax,0x68(%rsp)
cmp    %r12,%rax
jae    11e0 <lupp+0xa0>
mov    0x20(%rsp),%rax
shr    $0x2,%rax
add    $0x1,%rax
mov    %r15,%rbx
not    %rbx
lea    (%rbx,%r12,1),%rdx
add    $0xfffffffffffffffc,%rdx
mov    %rdx,0x90(%rsp)
shr    $0x2,%rdx
and    $0xfffffffffffffffe,%rax
mov    %rax,0x70(%rsp)
add    %r12,%rbx
add    $0x1,%rdx
mov    %rdx,0x88(%rsp)
lea    (%rcx,%r10,8),%rax
mov    %rax,0x30(%rsp)
lea    (%rcx,%r12,8),%rsi
mov    %rbx,%rax
and    $0xfffffffffffffffc,%rax
mov    %rax,0x80(%rsp)
add    %r10,%rax
mov    %rax,0x78(%rsp)
mov    0x10(%rsp),%rax
lea    (%rcx,%rax,8),%r8
mov    %r10,%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rdi,%r14,8),%r13
movsd  0x0(%r13,%r15,8),%xmm8
divsd  %xmm1,%xmm8
movapd %xmm8,%xmm1
xorpd  %xmm11,%xmm1
mov    %r10,%rdx
cmp    $0x4,%rbx
jb     14c0 <lupp+0x380>
lea    0x0(,%r10,8),%rax
add    %r13,%rax
cmp    %rsi,%rax
jae    13a0 <lupp+0x260>
lea    0x0(,%r12,8),%rax
add    %r13,%rax
mov    %r10,%rdx
cmp    %rax,0x30(%rsp)
jb     14c0 <lupp+0x380>
mov    %r10,%rdx
movapd %xmm1,%xmm2
unpcklpd %xmm1,%xmm2
cmpq   $0x4,0x90(%rsp)
jae    13be <lupp+0x27e>
xor    %r9d,%r9d
jmp    145b <lupp+0x31b>
mov    0x10(%rsp),%rax
lea    0x0(,%rax,8),%r10
add    %r13,%r10
mov    0x70(%rsp),%r11
xor    %r9d,%r9d
cs nopw 0x0(%rax,%rax,1)
movupd -0x30(%r8,%r9,8),%xmm3
movupd -0x20(%r8,%r9,8),%xmm4
mulpd  %xmm2,%xmm3
movupd -0x30(%r10,%r9,8),%xmm5
addpd  %xmm3,%xmm5
movupd -0x20(%r10,%r9,8),%xmm3
movupd -0x10(%r10,%r9,8),%xmm6
movupd (%r10,%r9,8),%xmm7
mulpd  %xmm2,%xmm4
addpd  %xmm3,%xmm4
movupd %xmm5,-0x30(%r10,%r9,8)
movupd %xmm4,-0x20(%r10,%r9,8)
movupd -0x10(%r8,%r9,8),%xmm3
movupd (%r8,%r9,8),%xmm4
mulpd  %xmm2,%xmm3
addpd  %xmm6,%xmm3
mulpd  %xmm2,%xmm4
addpd  %xmm7,%xmm4
movupd %xmm3,-0x10(%r10,%r9,8)
movupd %xmm4,(%r10,%r9,8)
add    $0x8,%r9
add    $0xfffffffffffffffe,%r11
jne    13e0 <lupp+0x2a0>
testb  $0x1,0x88(%rsp)
01
mov    %rdx,%r10
je     14a4 <lupp+0x364>
add    %r10,%r9
movupd (%rcx,%r9,8),%xmm3
movupd 0x10(%rcx,%r9,8),%xmm4
movupd 0x0(%r13,%r9,8),%xmm5
movupd 0x10(%r13,%r9,8),%xmm6
mulpd  %xmm2,%xmm3
addpd  %xmm5,%xmm3
mulpd  %xmm2,%xmm4
addpd  %xmm6,%xmm4
movupd %xmm3,0x0(%r13,%r9,8)
movupd %xmm4,0x10(%r13,%r9,8)
mov    0x78(%rsp),%rdx
cmp    0x80(%rsp),%rbx
mov    0x8(%rsp),%rdi
mov    0x28(%rsp),%r9
je     1538 <lupp+0x3f8>
nopl   (%rax)
mov    %r12d,%ebp
sub    %edx,%ebp
mov    %rdx,%rax
test   $0x1,%bpl
je     14e9 <lupp+0x3a9>
movsd  (%rcx,%rdx,8),%xmm2
mulsd  %xmm1,%xmm2
addsd  0x0(%r13,%rdx,8),%xmm2
movsd  %xmm2,0x0(%r13,%rdx,8)
lea    0x1(%rdx),%rax
not    %rdx
cmp    %r9,%rdx
je     1538 <lupp+0x3f8>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%rcx,%rax,8),%xmm2
mulsd  %xmm1,%xmm2
addsd  0x0(%r13,%rax,8),%xmm2
movsd  %xmm2,0x0(%r13,%rax,8)
movsd  0x8(%rcx,%rax,8),%xmm2
mulsd  %xmm1,%xmm2
addsd  0x8(%r13,%rax,8),%xmm2
movsd  %xmm2,0x8(%r13,%rax,8)
add    $0x2,%rax
cmp    %rax,%r12
jne    1500 <lupp+0x3c0>
movsd  %xmm8,0x0(%r13,%r15,8)
add    $0x1,%r14
cmp    %r12,%r14
je     11e0 <lupp+0xa0>
movsd  (%rcx,%r15,8),%xmm1
jmp    1350 <lupp+0x210>
movsd  0xaa1(%rip),%xmm0
mov    0x8(%rsp),%rdi
movslq 0x1c(%rsp),%rax
mov    (%rdi,%rax,8),%rcx
mulsd  (%rcx,%rax,8),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    157e <lupp+0x43e>
jnp    1590 <lupp+0x450>
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xa99(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

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

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