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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, int, int);
int /*<<< orphan*/ sscanf(char *, char *, int *, int *, int *, int *, double *);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void readPirna(int evenId, int oddId, int n1, int n2, int location,
               double *****rnaupCollections, char *fileName2) {
  double ****rnaWins;
  double INF_1 = 9999;
  rnaWins = (double ****)malloc(sizeof(double ***) * (n1 + 1));
  int i, j, k;
  for (i = 0; i <= n1; i++) {
    rnaWins[i] = (double ***)malloc(sizeof(double **) * (n2 + 1));
    for (j = 0; j <= n2; j++) {
      rnaWins[i][j] = (double **)malloc(sizeof(double *) * (26));
      for (k = 0; k <= 25; k++) {
        rnaWins[i][j][k] = (double *)malloc(sizeof(double) * (26));
        int k2 = 0;
        for (k2 = 0; k2 <= 25; k2++) {
          rnaWins[i][j][k][k2] = INF_1;
        }
      }
    }
  }
  char fileName[50];
  printf("filename2 = *%s* \n", fileName2);
  if (!strcmp(fileName2, "default")) {
    printf("here 1\n");
    printf("Reading default file... \n");
    sprintf(fileName, "pirna_out_%d_%d.dat", evenId, oddId);
    printf("File name = %s \n\n", fileName);
  } else {
    printf("here 2 \n");
    strcpy(fileName, fileName2);
    printf("Reading file %s... \n", fileName);
  }
  int count = 0;
  FILE *file = fopen(fileName, "rt");
  if (file != NULL) {
    char line[500];
    while (fgets(line, sizeof line, file) != NULL) {
      int i1, j1, i2, j2;
      double energy;
      sscanf(line, "%d\t%d\t%d\t%d\t%lf\n", &i1, &j1, &i2, &j2, &energy);
      int w1 = j1 - i1;
      int w2 = j2 - i2;
      rnaWins[j1 + 1][j2 + 1][w1][w2] = energy;
    }
    fclose(file);
    printf("Read file \n\n");
    rnaupCollections[location] = rnaWins;
  } else {
    printf("File read error! \n");
  }
}


x86 assembly (clang, -O0):
<readPirna>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2c0,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9,-0x20(%rbp)
movsd  0xe45(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1303 <readPirna+0x173>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,%rdx
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     12f0 <readPirna+0x160>
mov    $0xd0,%edi
call   1080 <malloc@plt>
mov    %rax,%rdx
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x38(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
movl   $0x0,-0x3c(%rbp)
cmpl   $0x19,-0x3c(%rbp)
jg     12dd <readPirna+0x14d>
mov    $0xd0,%edi
call   1080 <malloc@plt>
mov    %rax,%rdx
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x3c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
movl   $0x0,-0x40(%rbp)
movl   $0x0,-0x40(%rbp)
cmpl   $0x19,-0x40(%rbp)
jg     12ca <readPirna+0x13a>
movsd  -0x30(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x40(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1288 <readPirna+0xf8>
jmp    12cf <readPirna+0x13f>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1247 <readPirna+0xb7>
jmp    12e2 <readPirna+0x152>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1213 <readPirna+0x83>
jmp    12f5 <readPirna+0x165>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11de <readPirna+0x4e>
mov    0x10(%rbp),%rsi
lea    0xcfa(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x10(%rbp),%rdi
lea    0xcfb(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1377 <readPirna+0x1e7>
lea    0xcee(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xce8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x80(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xcea(%rip),%rsi
call   10b0 <sprintf@plt>
lea    -0x80(%rbp),%rsi
lea    0xcee(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    13a4 <readPirna+0x214>
lea    0xced(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x80(%rbp),%rdi
mov    0x10(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x80(%rbp),%rsi
lea    0xcd7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x84(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xcd0(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x90(%rbp)
cmpq   $0x0,-0x90(%rbp)
je     14cf <readPirna+0x33f>
jmp    13d8 <readPirna+0x248>
lea    -0x290(%rbp),%rdi
mov    -0x90(%rbp),%rdx
mov    $0x1f4,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     14a0 <readPirna+0x310>
lea    -0x290(%rbp),%rdi
lea    0xc84(%rip),%rsi
lea    -0x294(%rbp),%rdx
lea    -0x298(%rbp),%rcx
lea    -0x29c(%rbp),%r8
lea    -0x2a0(%rbp),%r9
lea    -0x2a8(%rbp),%rax
mov    %rax,(%rsp)
call   1090 <sscanf@plt>
mov    -0x298(%rbp),%eax
sub    -0x294(%rbp),%eax
mov    %eax,-0x2ac(%rbp)
mov    -0x2a0(%rbp),%eax
sub    -0x29c(%rbp),%eax
mov    %eax,-0x2b0(%rbp)
movsd  -0x2a8(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
mov    -0x298(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x2a0(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x2ac(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x2b0(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    13d8 <readPirna+0x248>
mov    -0x90(%rbp),%rdi
call   1040 <fclose@plt>
lea    0xbea(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
jmp    14dd <readPirna+0x34d>
lea    0xbd4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
add    $0x2c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readPirna>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x278,%rsp
mov    %r9,0x30(%rsp)
mov    %r8d,0x10(%rsp)
mov    %rcx,0x28(%rsp)
mov    %edx,%r15d
mov    %esi,0xc(%rsp)
mov    %edi,0x8(%rsp)
lea    0x8(,%r15,8),%edi
call   1090 <malloc@plt>
mov    %rax,%rbx
test   %r15d,%r15d
js     12d7 <readPirna+0x137>
mov    0x28(%rsp),%rax
lea    0x8(,%rax,8),%ecx
mov    %ecx,0x14(%rsp)
lea    0x1(%rax),%r13d
add    $0x1,%r15d
xor    %ebp,%ebp
jmp    120d <readPirna+0x6d>
add    $0x1,%rbp
cmp    %r15,%rbp
je     12d7 <readPirna+0x137>
mov    0x14(%rsp),%edi
call   1090 <malloc@plt>
mov    %rax,(%rbx,%rbp,8)
cmpl   $0x0,0x28(%rsp)
js     1200 <readPirna+0x60>
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0xd0,%edi
call   1090 <malloc@plt>
mov    (%rbx,%rbp,8),%rcx
mov    %rax,(%rcx,%r14,8)
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xd0,%edi
call   1090 <malloc@plt>
mov    (%rbx,%rbp,8),%rcx
mov    (%rcx,%r14,8),%rcx
mov    %rax,(%rcx,%r12,8)
mov    (%rbx,%rbp,8),%rax
mov    (%rax,%r14,8),%rax
mov    (%rax,%r12,8),%rax
movaps 0xd87(%rip),%xmm0
movups %xmm0,(%rax)
movups %xmm0,0x10(%rax)
movups %xmm0,0x20(%rax)
movups %xmm0,0x30(%rax)
movups %xmm0,0x40(%rax)
movups %xmm0,0x50(%rax)
movups %xmm0,0x60(%rax)
movups %xmm0,0x70(%rax)
movups %xmm0,0x80(%rax)
movups %xmm0,0x90(%rax)
movups %xmm0,0xa0(%rax)
movups %xmm0,0xb0(%rax)
movups %xmm0,0xc0(%rax)
add    $0x1,%r12
cmp    $0x1a,%r12
jne    1250 <readPirna+0xb0>
add    $0x1,%r14
cmp    %r13,%r14
jne    1230 <readPirna+0x90>
jmp    1200 <readPirna+0x60>
lea    0xd32(%rip),%rdi
mov    0x2b0(%rsp),%rbp
mov    %rbp,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd2c(%rip),%rsi
mov    %rbp,%rdi
call   1080 <strcmp@plt>
test   %eax,%eax
je     1325 <readPirna+0x185>
lea    0xdae(%rip),%rdi
call   1040 <puts@plt>
lea    0x40(%rsp),%rdi
mov    %rbp,%rsi
call   1030 <strcpy@plt>
lea    0xd2e(%rip),%rdi
jmp    135d <readPirna+0x1bd>
lea    0xd4e(%rip),%rdi
call   1040 <puts@plt>
lea    0xd49(%rip),%rdi
call   1040 <puts@plt>
lea    0xce7(%rip),%rsi
lea    0x40(%rsp),%rdi
mov    0x8(%rsp),%edx
mov    0xc(%rsp),%ecx
call   10c0 <sprintf@plt>
lea    0xce2(%rip),%rdi
lea    0x40(%rsp),%rbp
mov    %rbp,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xcf3(%rip),%rsi
mov    %rbp,%rdi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1452 <readPirna+0x2b2>
mov    %rax,%r15
lea    0x80(%rsp),%rdi
mov    $0x1f4,%esi
mov    %rax,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     142e <readPirna+0x28e>
lea    0x80(%rsp),%rbp
lea    0x20(%rsp),%r13
lea    0x1c(%rsp),%r14
lea    0x18(%rsp),%r12
nopl   0x0(%rax)
lea    0x38(%rsp),%rax
mov    %rax,(%rsp)
mov    %rbp,%rdi
lea    0xc96(%rip),%rsi
lea    0x24(%rsp),%rdx
mov    %r13,%rcx
mov    %r14,%r8
mov    %r12,%r9
call   10a0 <sscanf@plt>
movslq 0x20(%rsp),%rax
movslq 0x24(%rsp),%rcx
movslq 0x18(%rsp),%rdx
movslq 0x1c(%rsp),%rsi
movsd  0x38(%rsp),%xmm0
mov    0x8(%rbx,%rax,8),%rdi
sub    %rcx,%rax
mov    0x8(%rdi,%rdx,8),%rcx
sub    %rsi,%rdx
mov    (%rcx,%rax,8),%rax
movsd  %xmm0,(%rax,%rdx,8)
mov    %rbp,%rdi
mov    $0x1f4,%esi
mov    %r15,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
jne    13c0 <readPirna+0x220>
mov    %r15,%rdi
call   1050 <fclose@plt>
lea    0xc6f(%rip),%rdi
call   1040 <puts@plt>
movslq 0x10(%rsp),%rax
mov    0x30(%rsp),%rcx
mov    %rbx,(%rcx,%rax,8)
jmp    145e <readPirna+0x2be>
lea    0xc41(%rip),%rdi
call   1040 <puts@plt>
add    $0x278,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"filename2 = *%s* \0A\00"
@.str.1 = [8 x i8] c"default\00"
@.str.2 = [8 x i8] c"here 1\0A\00"
@.str.3 = [26 x i8] c"Reading default file... \0A\00"
@.str.4 = [20 x i8] c"pirna_out_%d_%d.dat\00"
@.str.5 = [18 x i8] c"File name = %s \0A\0A\00"
@.str.6 = [9 x i8] c"here 2 \0A\00"
@.str.7 = [21 x i8] c"Reading file %s... \0A\00"
@.str.8 = [3 x i8] c"rt\00"
@.str.9 = [17 x i8] c"%d\09%d\09%d\09%d\09%lf\0A\00"
@.str.10 = [13 x i8] c"Read file \0A\0A\00"
@.str.11 = [19 x i8] c"File read error! \0A\00"
define void @readPirna(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, double***** %5, i8* %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca double*****
%14 = alloca i8*
%15 = alloca double****
%16 = alloca double
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca [50 x i8]
%22 = alloca i32
%23 = alloca i32*
%24 = alloca [500 x i8]
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca double
%30 = alloca i32
%31 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store double***** %5, double****** %13
store i8* %6, i8** %14
store double 9.999000e+03, double* %16
%32 = load i32, i32* %10
%33 = add nsw i32 %32, 1
%34 = sext i32 %33 to i64
%35 = mul i64 8, %34
%36 = trunc i64 %35 to i32
%37 = call i64 @malloc(i32 %36)
%38 = inttoptr i64 %37 to double****
store double**** %38, double***** %15
store i32 0, i32* %17
br label %39
39: ; preds = %121, %7
%40 = load i32, i32* %17
%41 = load i32, i32* %10
%42 = icmp sle i32 %40, %41
br i1 %42, label %43, label %124
43: ; preds = %39
%44 = load i32, i32* %11
%45 = add nsw i32 %44, 1
%46 = sext i32 %45 to i64
%47 = mul i64 8, %46
%48 = trunc i64 %47 to i32
%49 = call i64 @malloc(i32 %48)
%50 = inttoptr i64 %49 to double***
%51 = load double****, double***** %15
%52 = load i32, i32* %17
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds double***, double**** %51, i64 %53
store double*** %50, double**** %54
store i32 0, i32* %18
br label %55
55: ; preds = %117, %43
%56 = load i32, i32* %18
%57 = load i32, i32* %11
%58 = icmp sle i32 %56, %57
br i1 %58, label %59, label %120
59: ; preds = %55
%60 = call i64 @malloc(i32 208)
%61 = inttoptr i64 %60 to double**
%62 = load double****, double***** %15
%63 = load i32, i32* %17
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds double***, double**** %62, i64 %64
%66 = load double***, double**** %65
%67 = load i32, i32* %18
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds double**, double*** %66, i64 %68
store double** %61, double*** %69
store i32 0, i32* %19
br label %70
70: ; preds = %113, %59
%71 = load i32, i32* %19
%72 = icmp sle i32 %71, 25
br i1 %72, label %73, label %116
73: ; preds = %70
%74 = call i64 @malloc(i32 208)
%75 = inttoptr i64 %74 to double*
%76 = load double****, double***** %15
%77 = load i32, i32* %17
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds double***, double**** %76, i64 %78
%80 = load double***, double**** %79
%81 = load i32, i32* %18
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds double**, double*** %80, i64 %82
%84 = load double**, double*** %83
%85 = load i32, i32* %19
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds double*, double** %84, i64 %86
store double* %75, double** %87
store i32 0, i32* %20
store i32 0, i32* %20
br label %88
88: ; preds = %109, %73
%89 = load i32, i32* %20
%90 = icmp sle i32 %89, 25
br i1 %90, label %91, label %112
91: ; preds = %88
%92 = load double, double* %16
%93 = load double****, double***** %15
%94 = load i32, i32* %17
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds double***, double**** %93, i64 %95
%97 = load double***, double**** %96
%98 = load i32, i32* %18
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds double**, double*** %97, i64 %99
%101 = load double**, double*** %100
%102 = load i32, i32* %19
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds double*, double** %101, i64 %103
%105 = load double*, double** %104
%106 = load i32, i32* %20
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds double, double* %105, i64 %107
store double %92, double* %108
br label %109
109: ; preds = %91
%110 = load i32, i32* %20
%111 = add nsw i32 %110, 1
store i32 %111, i32* %20
br label %88
112: ; preds = %88
br label %113
113: ; preds = %112
%114 = load i32, i32* %19
%115 = add nsw i32 %114, 1
store i32 %115, i32* %19
br label %70
116: ; preds = %70
br label %117
117: ; preds = %116
%118 = load i32, i32* %18
%119 = add nsw i32 %118, 1
store i32 %119, i32* %18
br label %55
120: ; preds = %55
br label %121
121: ; preds = %120
%122 = load i32, i32* %17
%123 = add nsw i32 %122, 1
store i32 %123, i32* %17
br label %39
124: ; preds = %39
%125 = load i8*, i8** %14
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %125)
%127 = load i8*, i8** %14
%128 = call i32 @strcmp(i8* %127, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%129 = icmp ne i32 %128, 0
br i1 %129, label %139, label %130
130: ; preds = %124
%131 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%133 = getelementptr inbounds [50 x i8], [50 x i8]* %21, i64 0, i64 0
%134 = load i32, i32* %8
%135 = load i32, i32* %9
%136 = call i32 @sprintf(i8* %133, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %134, i32 %135)
%137 = getelementptr inbounds [50 x i8], [50 x i8]* %21, i64 0, i64 0
%138 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %137)
br label %146
139: ; preds = %124
%140 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%141 = getelementptr inbounds [50 x i8], [50 x i8]* %21, i64 0, i64 0
%142 = load i8*, i8** %14
%143 = call i32 @strcpy(i8* %141, i8* %142)
%144 = getelementptr inbounds [50 x i8], [50 x i8]* %21, i64 0, i64 0
%145 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i8* %144)
br label %146
146: ; preds = %139, %130
store i32 0, i32* %22
%147 = getelementptr inbounds [50 x i8], [50 x i8]* %21, i64 0, i64 0
%148 = call i32* @fopen(i8* %147, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
store i32* %148, i32** %23
%149 = load i32*, i32** %23
%150 = icmp ne i32* %149, null
br i1 %150, label %151, label %194
151: ; preds = %146
br label %152
152: ; preds = %157, %151
%153 = getelementptr inbounds [500 x i8], [500 x i8]* %24, i64 0, i64 0
%154 = load i32*, i32** %23
%155 = call i32* @fgets(i8* %153, i32 500, i32* %154)
%156 = icmp ne i32* %155, null
br i1 %156, label %157, label %185
157: ; preds = %152
%158 = getelementptr inbounds [500 x i8], [500 x i8]* %24, i64 0, i64 0
%159 = call i32 @sscanf(i8* %158, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), i32* %25, i32* %26, i32* %27, i32* %28, double* %29)
%160 = load i32, i32* %26
%161 = load i32, i32* %25
%162 = sub nsw i32 %160, %161
store i32 %162, i32* %30
%163 = load i32, i32* %28
%164 = load i32, i32* %27
%165 = sub nsw i32 %163, %164
store i32 %165, i32* %31
%166 = load double, double* %29
%167 = load double****, double***** %15
%168 = load i32, i32* %26
%169 = add nsw i32 %168, 1
%170 = sext i32 %169 to i64
%171 = getelementptr inbounds double***, double**** %167, i64 %170
%172 = load double***, double**** %171
%173 = load i32, i32* %28
%174 = add 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* %30
%179 = sext i32 %178 to i64
%180 = getelementptr inbounds double*, double** %177, i64 %179
%181 = load double*, double** %180
%182 = load i32, i32* %31
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds double, double* %181, i64 %183
store double %166, double* %184
br label %152
185: ; preds = %152
%186 = load i32*, i32** %23
%187 = call i32 @fclose(i32* %186)
%188 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0))
%189 = load double****, double***** %15
%190 = load double*****, double****** %13
%191 = load i32, i32* %12
%192 = sext i32 %191 to i64
%193 = getelementptr inbounds double****, double***** %190, i64 %192
store double**** %189, double***** %193
br label %196
194: ; preds = %146
%195 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0))
br label %196
196: ; preds = %194, %185
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"filename2 = *%s* \0A\00"
@.str.1 = [8 x i8] c"default\00"
@.str.4 = [20 x i8] c"pirna_out_%d_%d.dat\00"
@.str.5 = [18 x i8] c"File name = %s \0A\0A\00"
@.str.7 = [21 x i8] c"Reading file %s... \0A\00"
@.str.8 = [3 x i8] c"rt\00"
@.str.9 = [17 x i8] c"%d\09%d\09%d\09%d\09%lf\0A\00"
@str = [7 x i8] c"here 1\00"
@str.12 = [25 x i8] c"Reading default file... \00"
@str.13 = [18 x i8] c"File read error! \00"
@str.14 = [12 x i8] c"Read file \0A\00"
@str.15 = [8 x i8] c"here 2 \00"
define void @readPirna(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, double***** nocapture writeonly %5, i8* %6) {
%8 = alloca [50 x i8]
%9 = alloca [500 x i8]
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca double
%15 = shl i32 %2, 3
%16 = add i32 %15, 8
%17 = tail call i64 @malloc(i32 %16)
%18 = inttoptr i64 %17 to double****
%19 = icmp slt i32 %2, 0
br i1 %19, label %85, label %20
20: ; preds = %7
%21 = shl i32 %3, 3
%22 = add i32 %21, 8
%23 = icmp slt i32 %3, 0
%24 = add i32 %3, 1
%25 = add nuw i32 %2, 1
%26 = zext i32 %25 to i64
%27 = zext i32 %24 to i64
br label %28
28: ; preds = %20, %82
%29 = phi i64 [ 0, %20 ], [ %83, %82 ]
%30 = tail call i64 @malloc(i32 %22)
%31 = inttoptr i64 %30 to double***
%32 = getelementptr inbounds double***, double**** %18, i64 %29
store double*** %31, double**** %32
br i1 %23, label %82, label %33
33: ; preds = %28, %79
%34 = phi i64 [ %80, %79 ], [ 0, %28 ]
%35 = tail call i64 @malloc(i32 208)
%36 = inttoptr i64 %35 to double**
%37 = load double***, double**** %32
%38 = getelementptr inbounds double**, double*** %37, i64 %34
store double** %36, double*** %38
br label %39
39: ; preds = %33, %39
%40 = phi i64 [ 0, %33 ], [ %77, %39 ]
%41 = tail call i64 @malloc(i32 208)
%42 = inttoptr i64 %41 to double*
%43 = load double***, double**** %32
%44 = getelementptr inbounds double**, double*** %43, i64 %34
%45 = load double**, double*** %44
%46 = getelementptr inbounds double*, double** %45, i64 %40
store double* %42, double** %46
%47 = load double***, double**** %32
%48 = getelementptr inbounds double**, double*** %47, i64 %34
%49 = load double**, double*** %48
%50 = getelementptr inbounds double*, double** %49, i64 %40
%51 = load double*, double** %50
%52 = bitcast double* %51 to <2 x double>*
store <2 x double> <double 9.999000e+03, double 9.999000e+03>, <2 x double>* %52
%53 = getelementptr inbounds double, double* %51, i64 2
%54 = bitcast double* %53 to <2 x double>*
store <2 x double> <double 9.999000e+03, double 9.999000e+03>, <2 x double>* %54
%55 = getelementptr inbounds double, double* %51, i64 4
%56 = bitcast double* %55 to <2 x double>*
store <2 x double> <double 9.999000e+03, double 9.999000e+03>, <2 x double>* %56
%57 = getelementptr inbounds double, double* %51, i64 6
%58 = bitcast double* %57 to <2 x double>*
store <2 x double> <double 9.999000e+03, double 9.999000e+03>, <2 x double>* %58
%59 = getelementptr inbounds double, double* %51, i64 8
%60 = bitcast double* %59 to <2 x double>*
store <2 x double> <double 9.999000e+03, double 9.999000e+03>, <2 x double>* %60
%61 = getelementptr inbounds double, double* %51, i64 10
%62 = bitcast double* %61 to <2 x double>*
store <2 x double> <double 9.999000e+03, double 9.999000e+03>, <2 x double>* %62
%63 = getelementptr inbounds double, double* %51, i64 12
%64 = bitcast double* %63 to <2 x double>*
store <2 x double> <double 9.999000e+03, double 9.999000e+03>, <2 x double>* %64
%65 = getelementptr inbounds double, double* %51, i64 14
%66 = bitcast double* %65 to <2 x double>*
store <2 x double> <double 9.999000e+03, double 9.999000e+03>, <2 x double>* %66
%67 = getelementptr inbounds double, double* %51, i64 16
%68 = bitcast double* %67 to <2 x double>*
store <2 x double> <double 9.999000e+03, double 9.999000e+03>, <2 x double>* %68
%69 = getelementptr inbounds double, double* %51, i64 18
%70 = bitcast double* %69 to <2 x double>*
store <2 x double> <double 9.999000e+03, double 9.999000e+03>, <2 x double>* %70
%71 = getelementptr inbounds double, double* %51, i64 20
%72 = bitcast double* %71 to <2 x double>*
store <2 x double> <double 9.999000e+03, double 9.999000e+03>, <2 x double>* %72
%73 = getelementptr inbounds double, double* %51, i64 22
%74 = bitcast double* %73 to <2 x double>*
store <2 x double> <double 9.999000e+03, double 9.999000e+03>, <2 x double>* %74
%75 = getelementptr inbounds double, double* %51, i64 24
%76 = bitcast double* %75 to <2 x double>*
store <2 x double> <double 9.999000e+03, double 9.999000e+03>, <2 x double>* %76
%77 = add nuw nsw i64 %40, 1
%78 = icmp eq i64 %77, 26
br i1 %78, label %79, label %39
79: ; preds = %39
%80 = add nuw nsw i64 %34, 1
%81 = icmp eq i64 %80, %27
br i1 %81, label %82, label %33
82: ; preds = %79, %28
%83 = add nuw nsw i64 %29, 1
%84 = icmp eq i64 %83, %26
br i1 %84, label %85, label %28
85: ; preds = %82, %7
%86 = getelementptr inbounds [50 x i8], [50 x i8]* %8, i64 0, i64 0
%87 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %6)
%88 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%89 = icmp eq i32 %88, 0
br i1 %89, label %90, label %94
90: ; preds = %85
%91 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%92 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.12, i64 0, i64 0))
%93 = call i32 @sprintf(i8* %86, i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %0, i32 %1)
br label %97
94: ; preds = %85
%95 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.15, i64 0, i64 0))
%96 = call i32 @strcpy(i8* %86, i8* %6)
br label %97
97: ; preds = %94, %90
%98 = phi i8* [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), %94 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), %90 ]
%99 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %98, i8* %86)
%100 = call i32* @fopen(i8* %86, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%101 = icmp eq i32* %100, null
br i1 %101, label %141, label %102
102: ; preds = %97
%103 = getelementptr inbounds [500 x i8], [500 x i8]* %9, i64 0, i64 0
%104 = call i32* @fgets(i8* %103, i32 500, i32* %100)
%105 = icmp eq i32* %104, null
br i1 %105, label %136, label %106
106: ; preds = %102
%107 = bitcast i32* %10 to i8*
%108 = bitcast i32* %11 to i8*
%109 = bitcast i32* %12 to i8*
%110 = bitcast i32* %13 to i8*
%111 = bitcast double* %14 to i8*
br label %112
112: ; preds = %106, %112
%113 = call i32 @sscanf(i8* %103, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), i32* %10, i32* %11, i32* %12, i32* %13, double* %14)
%114 = load i32, i32* %11
%115 = load i32, i32* %10
%116 = sub nsw i32 %114, %115
%117 = load i32, i32* %13
%118 = load i32, i32* %12
%119 = sub nsw i32 %117, %118
%120 = load double, double* %14
%121 = add nsw i32 %114, 1
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds double***, double**** %18, i64 %122
%124 = load double***, double**** %123
%125 = add nsw i32 %117, 1
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds double**, double*** %124, i64 %126
%128 = load double**, double*** %127
%129 = sext i32 %116 to i64
%130 = getelementptr inbounds double*, double** %128, i64 %129
%131 = load double*, double** %130
%132 = sext i32 %119 to i64
%133 = getelementptr inbounds double, double* %131, i64 %132
store double %120, double* %133
%134 = call i32* @fgets(i8* %103, i32 500, i32* %100)
%135 = icmp eq i32* %134, null
br i1 %135, label %136, label %112
136: ; preds = %112, %102
%137 = call i32 @fclose(i32* %100)
%138 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.14, i64 0, i64 0))
%139 = sext i32 %4 to i64
%140 = getelementptr inbounds double****, double***** %5, i64 %139
store double**** %18, double***** %140
br label %143
141: ; preds = %97
%142 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.13, i64 0, i64 0))
br label %143
143: ; preds = %141, %136
ret void
}