#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 */
typedef scalar_t__ clock_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
float CLOCKS_PER_SEC;
scalar_t__ clock();
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ free_matrix(double **, int);
double **generate_random_matrix(int);
double lupp(int, double **, int *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int read_dimension();
double **read_matrix(char *, int);
int /*<<< orphan*/ stdin;
int strlen(char *);
int /*<<< orphan*/ write_matrix(char *, double **, int);
int main() {
  int n = read_dimension();
  int *p;
  int i;
  double **matrixA;
  double detA = 0;
  char filename[256];
  FILE *fp;
  clock_t time;
  printf("Dimensio n=%d\n", n);
  p = (int *)malloc(sizeof(int) * n);
  for (i = 0; i < n; i++)
    p[i] = i;
  printf("Arxiu? (buit per matriu random) ");
  fgets(filename, 255, stdin);
  if (filename[0] != '\n') {
    if (filename[strlen(filename) - 1] == '\n') {
      filename[strlen(filename) - 1] = '\0';
    }
    printf("\nMatriu de l'arxiu %s\n", filename);
    matrixA = read_matrix(filename, n);
  } else {
    printf("\nMatriu random\n");
    matrixA = generate_random_matrix(n);
  }
  printf("Iniciant el calcul de PA = LU...\n");
  time = clock();
  detA = lupp(n, matrixA, p);
  time = clock() - time;
  printf("Calcul finalitzat.\n");
  printf("Temps de calcul: t = %f\n", (float)time / CLOCKS_PER_SEC);
  printf("det A = %+.6lf\n", detA);
  printf("Es guardara la matriu LU a output_lu.txt i el vector P a "
         "output_p.txt\n");
  write_matrix("output_lu.txt", matrixA, n);
  fp = fopen("output_p.txt", "w");
  for (i = 0; i < n; i++) {
    fprintf(fp, "%d\n", p[i]);
  }
  free_matrix(matrixA, n);
  free(p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   10e0 <read_dimension@plt>
mov    %eax,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%esi
lea    0xdf2(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1257 <main+0x77>
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    122f <main+0x4f>
lea    0xdb1(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x130(%rbp),%rdi
mov    0x2d75(%rip),%rax
mov    (%rax),%edx
mov    $0xff,%esi
call   10a0 <fgets@plt>
movsbl -0x130(%rbp),%eax
cmp    $0xa,%eax
je     12f7 <main+0x117>
lea    -0x130(%rbp),%rdi
call   1070 <strlen@plt>
sub    $0x1,%eax
cltq
movsbl -0x130(%rbp,%rax,1),%eax
ff
cmp    $0xa,%eax
jne    12ca <main+0xea>
lea    -0x130(%rbp),%rdi
call   1070 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0x130(%rbp,%rax,1)
lea    -0x130(%rbp),%rsi
lea    0xd58(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x130(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   10d0 <read_matrix@plt>
mov    %rax,-0x20(%rbp)
jmp    1311 <main+0x131>
lea    0xd49(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x8(%rbp),%edi
call   1090 <generate_random_matrix@plt>
mov    %rax,-0x20(%rbp)
lea    0xd3f(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x0,%al
call   1060 <clock@plt>
mov    %rax,-0x140(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1100 <lupp@plt>
movsd  %xmm0,-0x28(%rbp)
mov    $0x0,%al
call   1060 <clock@plt>
sub    -0x140(%rbp),%rax
mov    %rax,-0x140(%rbp)
lea    0xd1b(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
cvtsi2ssq -0x140(%rbp),%xmm0
ff ff
mov    0x2c6b(%rip),%rax
divss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd09(%rip),%rdi
mov    $0x1,%al
call   1080 <printf@plt>
movsd  -0x28(%rbp),%xmm0
lea    0xd0f(%rip),%rdi
mov    $0x1,%al
call   1080 <printf@plt>
lea    0xd11(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x20(%rbp),%rsi
mov    -0x8(%rbp),%edx
lea    0xd43(%rip),%rdi
call   1030 <write_matrix@plt>
lea    0xd45(%rip),%rdi
lea    0xd4b(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x138(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1418 <main+0x238>
mov    -0x138(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xc06(%rip),%rsi
call   10b0 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    13e0 <main+0x200>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1050 <free_matrix@plt>
mov    -0x10(%rbp),%rdi
call   1040 <free@plt>
xor    %eax,%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
xor    %eax,%eax
call   10f0 <read_dimension@plt>
mov    %eax,%r14d
lea    0xe7e(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0x0(,%r14,4),%edi
call   10d0 <malloc@plt>
mov    %rax,%r12
mov    %r14d,%ebp
test   %r14d,%r14d
jle    13bd <main+0x1cd>
cmp    $0x8,%r14d
jae    1244 <main+0x54>
xor    %eax,%eax
jmp    13b0 <main+0x1c0>
mov    %ebp,%eax
and    $0xfffffff8,%eax
lea    -0x8(%rax),%rsi
mov    %rsi,%rdx
shr    $0x3,%rdx
add    $0x1,%rdx
mov    %edx,%ecx
and    $0x3,%ecx
cmp    $0x18,%rsi
jae    1272 <main+0x82>
movdqa 0xd95(%rip),%xmm0
xor    %esi,%esi
jmp    1350 <main+0x160>
and    $0xfffffffffffffffc,%rdx
movdqa 0xd82(%rip),%xmm0
xor    %esi,%esi
movdqa 0xd87(%rip),%xmm8
movdqa 0xd8e(%rip),%xmm9
movdqa 0xd95(%rip),%xmm10
movdqa 0xd9d(%rip),%xmm4
movdqa 0xda5(%rip),%xmm5
movdqa 0xdad(%rip),%xmm6
movdqa 0xdb5(%rip),%xmm7
movdqa 0xdbd(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movdqa %xmm0,%xmm2
paddd  %xmm8,%xmm2
movdqu %xmm0,(%r12,%rsi,4)
movdqu %xmm2,0x10(%r12,%rsi,4)
movdqa %xmm0,%xmm2
paddd  %xmm9,%xmm2
movdqa %xmm0,%xmm3
paddd  %xmm10,%xmm3
movdqu %xmm2,0x20(%r12,%rsi,4)
movdqu %xmm3,0x30(%r12,%rsi,4)
movdqa %xmm0,%xmm2
paddd  %xmm4,%xmm2
movdqa %xmm0,%xmm3
paddd  %xmm5,%xmm3
movdqu %xmm2,0x40(%r12,%rsi,4)
movdqu %xmm3,0x50(%r12,%rsi,4)
movdqa %xmm0,%xmm2
paddd  %xmm6,%xmm2
movdqa %xmm0,%xmm3
paddd  %xmm7,%xmm3
movdqu %xmm2,0x60(%r12,%rsi,4)
movdqu %xmm3,0x70(%r12,%rsi,4)
add    $0x20,%rsi
paddd  %xmm1,%xmm0
add    $0xfffffffffffffffc,%rdx
jne    12d0 <main+0xe0>
test   %rcx,%rcx
je     13a0 <main+0x1b0>
lea    (%r12,%rsi,4),%rdx
add    $0x10,%rdx
shl    $0x5,%rcx
xor    %esi,%esi
movdqa 0xca5(%rip),%xmm1
movdqa 0xcad(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movdqa %xmm0,%xmm3
paddd  %xmm1,%xmm3
movdqu %xmm0,-0x10(%rdx,%rsi,1)
movdqu %xmm3,(%rdx,%rsi,1)
paddd  %xmm2,%xmm0
add    $0x20,%rsi
cmp    %rsi,%rcx
jne    1380 <main+0x190>
cmp    %rbp,%rax
je     13bd <main+0x1cd>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %eax,(%r12,%rax,4)
add    $0x1,%rax
cmp    %rax,%rbp
jne    13b0 <main+0x1c0>
lea    0xcdb(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x2c16(%rip),%rax
mov    (%rax),%edx
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    $0xff,%esi
call   10b0 <fgets@plt>
cmpb   $0xa,0x10(%rsp)
jne    1403 <main+0x213>
lea    0xd1c(%rip),%rdi
call   1050 <puts@plt>
mov    %r14d,%edi
call   10a0 <generate_random_matrix@plt>
jmp    1446 <main+0x256>
mov    %r15,%rdi
call   1080 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%r15,1)
jne    1425 <main+0x235>
mov    %r15,%rdi
call   1080 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%r15,1)
lea    0xc94(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
call   10e0 <read_matrix@plt>
mov    %rax,%r15
lea    0xccf(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1070 <clock@plt>
mov    %rax,%r13
mov    %r14d,%edi
mov    %r15,%rsi
mov    %r12,%rdx
call   1110 <lupp@plt>
movq   %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1070 <clock@plt>
mov    %rax,%rbx
sub    %r13,%rbx
lea    0xcb9(%rip),%rdi
call   1050 <puts@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rbx,%xmm0
mov    0x2b45(%rip),%rax
divss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc2d(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
lea    0xc38(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1090 <printf@plt>
lea    0xc87(%rip),%rdi
call   1050 <puts@plt>
lea    0xc28(%rip),%rdi
mov    %r15,0x8(%rsp)
mov    %r15,%rsi
mov    %r14d,%edx
call   1030 <write_matrix@plt>
lea    0xc9d(%rip),%rdi
lea    0xc18(%rip),%rsi
call   1100 <fopen@plt>
mov    %r14,%r15
test   %r14d,%r14d
jle    1528 <main+0x338>
mov    %rax,%rbx
xor    %r14d,%r14d
lea    0xb8b(%rip),%r13
mov    (%r12,%r14,4),%edx
mov    %rbx,%rdi
mov    %r13,%rsi
call   10c0 <fprintf@plt>
add    $0x1,%r14
cmp    %r14,%rbp
jne    1510 <main+0x320>
mov    0x8(%rsp),%rdi
mov    %r15d,%esi
call   1060 <free_matrix@plt>
mov    %r12,%rdi
call   1040 <free@plt>
xor    %eax,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Dimensio n=%d\0A\00"
@.str.1 = [33 x i8] c"Arxiu? (buit per matriu random) \00"
@stdin = global i32 0
@.str.2 = [23 x i8] c"\0AMatriu de l'arxiu %s\0A\00"
@.str.3 = [16 x i8] c"\0AMatriu random\0A\00"
@.str.4 = [34 x i8] c"Iniciant el calcul de PA = LU...\0A\00"
@.str.5 = [20 x i8] c"Calcul finalitzat.\0A\00"
@.str.6 = [25 x i8] c"Temps de calcul: t = %f\0A\00"
@CLOCKS_PER_SEC = global float 0.000000e+00
@.str.7 = [16 x i8] c"det A = %+.6lf\0A\00"
@.str.8 = [71 x i8] c"Es guardara la matriu LU a output_lu.txt i el vector P a output_p.txt\0A\00"
@.str.9 = [14 x i8] c"output_lu.txt\00"
@.str.10 = [13 x i8] c"output_p.txt\00"
@.str.11 = [2 x i8] c"w\00"
@.str.12 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double**
%6 = alloca double
%7 = alloca [256 x i8]
%8 = alloca i32*
%9 = alloca i64
store i32 0, i32* %1
%10 = call i32 (...) @read_dimension()
store i32 %10, i32* %2
store double 0.000000e+00, double* %6
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %2
%14 = sext i32 %13 to i64
%15 = mul i64 4, %14
%16 = trunc i64 %15 to i32
%17 = call i64 @malloc(i32 %16)
%18 = inttoptr i64 %17 to i32*
store i32* %18, i32** %3
store i32 0, i32* %4
br label %19
19: ; preds = %29, %0
%20 = load i32, i32* %4
%21 = load i32, i32* %2
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %32
23: ; preds = %19
%24 = load i32, i32* %4
%25 = load i32*, i32** %3
%26 = load i32, i32* %4
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %25, i64 %27
store i32 %24, i32* %28
br label %29
29: ; preds = %23
%30 = load i32, i32* %4
%31 = add nsw i32 %30, 1
store i32 %31, i32* %4
br label %19
32: ; preds = %19
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%34 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%35 = load i32, i32* @stdin
%36 = call i32 @fgets(i8* %34, i32 255, i32 %35)
%37 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp ne i32 %39, 10
br i1 %40, label %41, label %62
41: ; preds = %32
%42 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%43 = call i32 @strlen(i8* %42)
%44 = sub nsw i32 %43, 1
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 %45
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = icmp eq i32 %48, 10
br i1 %49, label %50, label %56
50: ; preds = %41
%51 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%52 = call i32 @strlen(i8* %51)
%53 = sub nsw i32 %52, 1
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 %54
store i8 0, i8* %55
br label %56
56: ; preds = %50, %41
%57 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %57)
%59 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%60 = load i32, i32* %2
%61 = call double** @read_matrix(i8* %59, i32 %60)
store double** %61, double*** %5
br label %66
62: ; preds = %32
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%64 = load i32, i32* %2
%65 = call double** @generate_random_matrix(i32 %64)
store double** %65, double*** %5
br label %66
66: ; preds = %62, %56
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
%68 = call i64 (...) @clock()
store i64 %68, i64* %9
%69 = load i32, i32* %2
%70 = load double**, double*** %5
%71 = load i32*, i32** %3
%72 = call double @lupp(i32 %69, double** %70, i32* %71)
store double %72, double* %6
%73 = call i64 (...) @clock()
%74 = load i64, i64* %9
%75 = sub nsw i64 %73, %74
store i64 %75, i64* %9
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%77 = load i64, i64* %9
%78 = sitofp i64 %77 to float
%79 = load float, float* @CLOCKS_PER_SEC
%80 = fdiv float %78, %79
%81 = fpext float %80 to double
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), double %81)
%83 = load double, double* %6
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), double %83)
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.8, i64 0, i64 0))
%86 = load double**, double*** %5
%87 = load i32, i32* %2
%88 = call i32 @write_matrix(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), double** %86, i32 %87)
%89 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
store i32* %89, i32** %8
store i32 0, i32* %4
br label %90
90: ; preds = %102, %66
%91 = load i32, i32* %4
%92 = load i32, i32* %2
%93 = icmp slt i32 %91, %92
br i1 %93, label %94, label %105
94: ; preds = %90
%95 = load i32*, i32** %8
%96 = load i32*, i32** %3
%97 = load i32, i32* %4
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds i32, i32* %96, i64 %98
%100 = load i32, i32* %99
%101 = call i32 @fprintf(i32* %95, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i32 %100)
br label %102
102: ; preds = %94
%103 = load i32, i32* %4
%104 = add nsw i32 %103, 1
store i32 %104, i32* %4
br label %90
105: ; preds = %90
%106 = load double**, double*** %5
%107 = load i32, i32* %2
%108 = call i32 @free_matrix(double** %106, i32 %107)
%109 = load i32*, i32** %3
%110 = call i32 @free(i32* %109)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Dimensio n=%d\0A\00"
@.str.1 = [33 x i8] c"Arxiu? (buit per matriu random) \00"
@stdin = global i32 0
@.str.2 = [23 x i8] c"\0AMatriu de l'arxiu %s\0A\00"
@.str.6 = [25 x i8] c"Temps de calcul: t = %f\0A\00"
@CLOCKS_PER_SEC = global float 0.000000e+00
@.str.7 = [16 x i8] c"det A = %+.6lf\0A\00"
@.str.9 = [14 x i8] c"output_lu.txt\00"
@.str.10 = [13 x i8] c"output_p.txt\00"
@.str.11 = [2 x i8] c"w\00"
@.str.12 = [4 x i8] c"%d\0A\00"
@str = [15 x i8] c"\0AMatriu random\00"
@str.13 = [33 x i8] c"Iniciant el calcul de PA = LU...\00"
@str.14 = [19 x i8] c"Calcul finalitzat.\00"
@str.15 = [70 x i8] c"Es guardara la matriu LU a output_lu.txt i el vector P a output_p.txt\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = tail call i32 (...) @read_dimension()
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %2)
%5 = shl i32 %2, 2
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i32*
%8 = icmp sgt i32 %2, 0
br i1 %8, label %9, label %82
9: ; preds = %0
%10 = zext i32 %2 to i64
%11 = icmp ult i32 %2, 8
br i1 %11, label %74, label %12
12: ; preds = %9
%13 = and i64 %10, 4294967288
%14 = add nsw i64 %13, -8
%15 = lshr exact i64 %14, 3
%16 = add nuw nsw i64 %15, 1
%17 = and i64 %16, 3
%18 = icmp ult i64 %14, 24
br i1 %18, label %55, label %19
19: ; preds = %12
%20 = and i64 %16, 4611686018427387900
br label %21
21: ; preds = %21, %19
%22 = phi i64 [ 0, %19 ], [ %51, %21 ]
%23 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %19 ], [ %52, %21 ]
%24 = phi i64 [ 0, %19 ], [ %53, %21 ]
%25 = add <4 x i32> %23, <i32 4, i32 4, i32 4, i32 4>
%26 = getelementptr inbounds i32, i32* %7, i64 %22
%27 = bitcast i32* %26 to <4 x i32>*
store <4 x i32> %23, <4 x i32>* %27
%28 = getelementptr inbounds i32, i32* %26, i64 4
%29 = bitcast i32* %28 to <4 x i32>*
store <4 x i32> %25, <4 x i32>* %29
%30 = or i64 %22, 8
%31 = add <4 x i32> %23, <i32 8, i32 8, i32 8, i32 8>
%32 = add <4 x i32> %23, <i32 12, i32 12, i32 12, i32 12>
%33 = getelementptr inbounds i32, i32* %7, i64 %30
%34 = bitcast i32* %33 to <4 x i32>*
store <4 x i32> %31, <4 x i32>* %34
%35 = getelementptr inbounds i32, i32* %33, i64 4
%36 = bitcast i32* %35 to <4 x i32>*
store <4 x i32> %32, <4 x i32>* %36
%37 = or i64 %22, 16
%38 = add <4 x i32> %23, <i32 16, i32 16, i32 16, i32 16>
%39 = add <4 x i32> %23, <i32 20, i32 20, i32 20, i32 20>
%40 = getelementptr inbounds i32, i32* %7, i64 %37
%41 = bitcast i32* %40 to <4 x i32>*
store <4 x i32> %38, <4 x i32>* %41
%42 = getelementptr inbounds i32, i32* %40, i64 4
%43 = bitcast i32* %42 to <4 x i32>*
store <4 x i32> %39, <4 x i32>* %43
%44 = or i64 %22, 24
%45 = add <4 x i32> %23, <i32 24, i32 24, i32 24, i32 24>
%46 = add <4 x i32> %23, <i32 28, i32 28, i32 28, i32 28>
%47 = getelementptr inbounds i32, i32* %7, i64 %44
%48 = bitcast i32* %47 to <4 x i32>*
store <4 x i32> %45, <4 x i32>* %48
%49 = getelementptr inbounds i32, i32* %47, i64 4
%50 = bitcast i32* %49 to <4 x i32>*
store <4 x i32> %46, <4 x i32>* %50
%51 = add nuw i64 %22, 32
%52 = add <4 x i32> %23, <i32 32, i32 32, i32 32, i32 32>
%53 = add i64 %24, 4
%54 = icmp eq i64 %53, %20
br i1 %54, label %55, label %21
55: ; preds = %21, %12
%56 = phi i64 [ 0, %12 ], [ %51, %21 ]
%57 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %12 ], [ %52, %21 ]
%58 = icmp eq i64 %17, 0
br i1 %58, label %72, label %59
59: ; preds = %55, %59
%60 = phi i64 [ %68, %59 ], [ %56, %55 ]
%61 = phi <4 x i32> [ %69, %59 ], [ %57, %55 ]
%62 = phi i64 [ %70, %59 ], [ 0, %55 ]
%63 = add <4 x i32> %61, <i32 4, i32 4, i32 4, i32 4>
%64 = getelementptr inbounds i32, i32* %7, i64 %60
%65 = bitcast i32* %64 to <4 x i32>*
store <4 x i32> %61, <4 x i32>* %65
%66 = getelementptr inbounds i32, i32* %64, i64 4
%67 = bitcast i32* %66 to <4 x i32>*
store <4 x i32> %63, <4 x i32>* %67
%68 = add nuw i64 %60, 8
%69 = add <4 x i32> %61, <i32 8, i32 8, i32 8, i32 8>
%70 = add i64 %62, 1
%71 = icmp eq i64 %70, %17
br i1 %71, label %72, label %59
72: ; preds = %59, %55
%73 = icmp eq i64 %13, %10
br i1 %73, label %82, label %74
74: ; preds = %9, %72
%75 = phi i64 [ 0, %9 ], [ %13, %72 ]
br label %76
76: ; preds = %74, %76
%77 = phi i64 [ %80, %76 ], [ %75, %74 ]
%78 = getelementptr inbounds i32, i32* %7, i64 %77
%79 = trunc i64 %77 to i32
store i32 %79, i32* %78
%80 = add nuw nsw i64 %77, 1
%81 = icmp eq i64 %80, %10
br i1 %81, label %82, label %76
82: ; preds = %76, %72, %0
%83 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%84 = load i32, i32* @stdin
%85 = call i32 @fgets(i8* %3, i32 255, i32 %84)
%86 = load i8, i8* %3
%87 = icmp eq i8 %86, 10
br i1 %87, label %103, label %88
88: ; preds = %82
%89 = call i32 @strlen(i8* %3)
%90 = add nsw i32 %89, -1
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 %91
%93 = load i8, i8* %92
%94 = icmp eq i8 %93, 10
br i1 %94, label %95, label %100
95: ; preds = %88
%96 = call i32 @strlen(i8* %3)
%97 = add nsw i32 %96, -1
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 %98
store i8 0, i8* %99
br label %100
100: ; preds = %95, %88
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%102 = call double** @read_matrix(i8* %3, i32 %2)
br label %106
103: ; preds = %82
%104 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%105 = call double** @generate_random_matrix(i32 %2)
br label %106
106: ; preds = %103, %100
%107 = phi double** [ %102, %100 ], [ %105, %103 ]
%108 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.13, i64 0, i64 0))
%109 = call i64 (...) @clock()
%110 = call double @lupp(i32 %2, double** %107, i32* %7)
%111 = call i64 (...) @clock()
%112 = sub nsw i64 %111, %109
%113 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.14, i64 0, i64 0))
%114 = sitofp i64 %112 to float
%115 = load float, float* @CLOCKS_PER_SEC
%116 = fdiv float %114, %115
%117 = fpext float %116 to double
%118 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), double %117)
%119 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), double %110)
%120 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str.15, i64 0, i64 0))
%121 = call i32 @write_matrix(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), double** %107, i32 %2)
%122 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
br i1 %8, label %123, label %132
123: ; preds = %106
%124 = zext i32 %2 to i64
br label %125
125: ; preds = %123, %125
%126 = phi i64 [ 0, %123 ], [ %130, %125 ]
%127 = getelementptr inbounds i32, i32* %7, i64 %126
%128 = load i32, i32* %127
%129 = call i32 @fprintf(i32* %122, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i32 %128)
%130 = add nuw nsw i64 %126, 1
%131 = icmp eq i64 %130, %124
br i1 %131, label %132, label %125
132: ; preds = %125, %106
%133 = call i32 @free_matrix(double** %107, i32 %2)
%134 = call i32 @free(i32* %7)
ret i32 0
}