#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;
  printf("epsilon=%.60lf\n", DBL_EPSILON * norma);
  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;
    }
    printf("Etapa %d: %d <-> %d\n", k, k, i);
    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)
mov    0x2e4c(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x38(%rbp),%xmm0
lea    0xe74(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    13f7 <lupp+0x2b7>
mov    -0x24(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
xor    %eax,%eax
cmp    -0x4(%rbp),%ecx
mov    %al,-0x41(%rbp)
jge    121c <lupp+0xdc>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movaps 0xe12(%rip),%xmm0
pand   %xmm0,%xmm1
mov    0x2ddf(%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    122c <lupp+0xec>
jmp    123a <lupp+0xfa>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11d1 <lupp+0x91>
mov    -0x1c(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     129c <lupp+0x15c>
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  0xd76(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x24(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xd84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
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    1302 <lupp+0x1c2>
jp     1302 <lupp+0x1c2>
lea    0xd54(%rip),%rdi
mov    $0x0,%al
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    13e4 <lupp+0x2a4>
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    13bc <lupp+0x27c>
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    134f <lupp+0x20f>
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    130b <lupp+0x1cb>
jmp    13e9 <lupp+0x2a9>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11ba <lupp+0x7a>
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    1450 <lupp+0x310>
jp     1450 <lupp+0x310>
lea    0xc06(%rip),%rdi
mov    $0x0,%al
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,0x10(%rsp)
mov    %rsi,%rdi
mov    %ebx,%esi
call   1060 <norma_inf@plt>
movapd %xmm0,%xmm1
mov    0x2e66(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm1,0x50(%rsp)
mulsd  %xmm1,%xmm0
lea    0xe99(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    -0x1(%rbx),%eax
cmp    $0x2,%ebx
mov    %eax,0x1c(%rsp)
jl     1563 <lupp+0x413>
mov    %rbx,0x48(%rsp)
mov    %ebx,%r12d
mov    %eax,%eax
mov    %rax,0x60(%rsp)
mov    %r12,%rax
neg    %rax
mov    %rax,0x40(%rsp)
lea    -0x5(%r12),%rax
mov    %rax,0x38(%rsp)
movsd  0xe26(%rip),%xmm0
mov    $0x1,%r15d
mov    $0x7,%eax
mov    %rax,0x8(%rsp)
movapd 0xe1e(%rip),%xmm3
xor    %ebx,%ebx
mov    0x10(%rsp),%rdi
jmp    1228 <lupp+0xd8>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r15
addq   $0x1,0x8(%rsp)
addq   $0xffffffffffffffff,0x38(%rsp)
mov    0x68(%rsp),%rbx
cmp    0x60(%rsp),%rbx
movapd 0xdee(%rip),%xmm3
je     1570 <lupp+0x420>
mov    %ebx,%eax
cmp    %r12,%rbx
jae    126f <lupp+0x11f>
mov    0x2db2(%rip),%rax
movsd  (%rax),%xmm2
mulsd  0x50(%rsp),%xmm2
mov    %rbx,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rdi,%rax,8),%rcx
movsd  (%rcx,%rbx,8),%xmm1
andpd  %xmm3,%xmm1
ucomisd %xmm1,%xmm2
jbe    126f <lupp+0x11f>
add    $0x1,%rax
cmp    %rax,%r12
jne    1250 <lupp+0x100>
mov    %r12d,%eax
mov    %eax,%ebp
cmp    %rbp,%rbx
movapd %xmm0,0x20(%rsp)
jne    1290 <lupp+0x140>
mov    %rdi,%r14
jmp    12c6 <lupp+0x176>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,%esi
mov    %ebx,%edx
mov    0x48(%rsp),%rcx
mov    %rdi,%r14
call   1050 <swap_rows@plt>
mov    0x58(%rsp),%rdx
mov    (%rdx,%rbp,4),%eax
mov    (%rdx,%rbx,4),%ecx
mov    %ecx,(%rdx,%rbp,4)
mov    %eax,(%rdx,%rbx,4)
movapd 0x20(%rsp),%xmm0
xorpd  0xd60(%rip),%xmm0
movapd %xmm0,0x20(%rsp)
lea    0xd73(%rip),%rdi
mov    %ebx,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r14,%rbx,8),%rcx
movsd  (%rcx,%rbx,8),%xmm1
movapd 0x20(%rsp),%xmm0
mulsd  %xmm1,%xmm0
ucomisd 0xd13(%rip),%xmm0
jne    12fd <lupp+0x1ad>
jnp    159c <lupp+0x44c>
mov    %r14,%rdi
lea    0x1(%rbx),%rax
mov    %rax,0x68(%rsp)
cmp    %r12,%rax
mov    0x40(%rsp),%r9
movapd 0xd06(%rip),%xmm9
jae    1200 <lupp+0xb0>
mov    0x38(%rsp),%rax
shr    $0x2,%rax
add    $0x1,%rax
mov    %rbx,%r13
not    %r13
lea    (%r12,%r13,1),%rdx
add    $0xfffffffffffffffc,%rdx
mov    %rdx,0x90(%rsp)
shr    $0x2,%rdx
and    $0xfffffffffffffffe,%rax
mov    %rax,0x70(%rsp)
add    %r12,%r13
add    $0x1,%rdx
mov    %rdx,0x88(%rsp)
lea    (%rcx,%r15,8),%rax
mov    %rax,0x20(%rsp)
lea    (%rcx,%r12,8),%rsi
mov    %r13,%rax
and    $0xfffffffffffffffc,%rax
mov    %rax,0x80(%rsp)
add    %r15,%rax
mov    %rax,0x78(%rsp)
mov    0x8(%rsp),%rax
lea    (%rcx,%rax,8),%r8
mov    %r15,%r14
nop
mov    (%rdi,%r14,8),%r11
movsd  (%r11,%rbx,8),%xmm8
divsd  %xmm1,%xmm8
movapd %xmm8,%xmm1
xorpd  %xmm9,%xmm1
mov    %r15,%rbp
cmp    $0x4,%r13
jb     14e0 <lupp+0x390>
lea    (%r11,%r15,8),%rdx
cmp    %rsi,%rdx
jae    13d1 <lupp+0x281>
lea    (%r11,%r12,8),%rdx
mov    %r15,%rbp
cmp    %rdx,0x20(%rsp)
jb     14e0 <lupp+0x390>
movapd %xmm1,%xmm2
unpcklpd %xmm1,%xmm2
cmpq   $0x4,0x90(%rsp)
jae    13ec <lupp+0x29c>
xor    %r9d,%r9d
jmp    147b <lupp+0x32b>
mov    0x8(%rsp),%rax
lea    (%r11,%rax,8),%r10
mov    0x70(%rsp),%rdx
xor    %r9d,%r9d
nopl   (%rax)
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,%rdx
jne    1400 <lupp+0x2b0>
testb  $0x1,0x88(%rsp)
01
je     14bf <lupp+0x36f>
add    %r15,%r9
movupd (%rcx,%r9,8),%xmm3
movupd 0x10(%rcx,%r9,8),%xmm4
movupd (%r11,%r9,8),%xmm5
movupd 0x10(%r11,%r9,8),%xmm6
mulpd  %xmm2,%xmm3
addpd  %xmm5,%xmm3
mulpd  %xmm2,%xmm4
addpd  %xmm6,%xmm4
movupd %xmm3,(%r11,%r9,8)
movupd %xmm4,0x10(%r11,%r9,8)
mov    0x78(%rsp),%rbp
cmp    0x80(%rsp),%r13
mov    0x40(%rsp),%r9
mov    0x10(%rsp),%rdi
je     1546 <lupp+0x3f6>
nopl   0x0(%rax,%rax,1)
mov    %r12d,%eax
sub    %ebp,%eax
mov    %rbp,%rdx
test   $0x1,%al
je     1505 <lupp+0x3b5>
movsd  (%rcx,%rbp,8),%xmm2
mulsd  %xmm1,%xmm2
addsd  (%r11,%rbp,8),%xmm2
movsd  %xmm2,(%r11,%rbp,8)
lea    0x1(%rbp),%rdx
not    %rbp
cmp    %r9,%rbp
je     1546 <lupp+0x3f6>
nopl   (%rax)
movsd  (%rcx,%rdx,8),%xmm2
mulsd  %xmm1,%xmm2
addsd  (%r11,%rdx,8),%xmm2
movsd  %xmm2,(%r11,%rdx,8)
movsd  0x8(%rcx,%rdx,8),%xmm2
mulsd  %xmm1,%xmm2
addsd  0x8(%r11,%rdx,8),%xmm2
movsd  %xmm2,0x8(%r11,%rdx,8)
add    $0x2,%rdx
cmp    %rdx,%r12
jne    1510 <lupp+0x3c0>
movsd  %xmm8,(%r11,%rbx,8)
add    $0x1,%r14
cmp    %r12,%r14
je     1200 <lupp+0xb0>
movsd  (%rcx,%rbx,8),%xmm1
jmp    1390 <lupp+0x240>
movsd  0xa95(%rip),%xmm0
mov    0x10(%rsp),%rdi
movslq 0x1c(%rsp),%rax
mov    (%rdi,%rax,8),%rcx
mulsd  (%rcx,%rax,8),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    158a <lupp+0x43a>
jnp    159c <lupp+0x44c>
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xab2(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

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

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