#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*/ feof(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, ...);
char *malloc(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
unsigned int timer_ad();
int main() {
  FILE *pFile, *pFile2;
  int i = 0;
  int j = 0;
  int counter = 0;
  char *c = malloc(1024);
  int a[8], time_arr[8];
  unsigned int b, rv[2], z;
  unsigned int start_ad, time_hex;
  char *time_byte = malloc(1024);
  start_ad = timer_ad();
  pFile = fopen("result_byte.txt", "r");
  pFile2 = fopen("temp_dump.mem", "w");
  if (pFile == NULL)
    perror("Error opening file");
  else {
    while (!feof(pFile)) {
      i++;
      fscanf(pFile, "%s", c);
      if ((c[0] == '/') && (c[1] == '/')) {
        while (fgetc(pFile) != '\n')
          ;
        i--;
      }
      if (i > 0) {
        if (c[0] == 'x' && c[1] == 'x') {
          fprintf(pFile2, "00 ");
        } else {
          fprintf(pFile2, "%s ", c);
        }
        if (i % 4 == 0)
          fprintf(pFile2, "\n");
      }
    }
    fclose(pFile);
    fclose(pFile2);
  }
  pFile = fopen("temp_dump.mem", "r");
  printf("measured time in us: ");
  while (j < (start_ad + 8)) {
    j++;
    fscanf(pFile, "%x", &time_hex);
    if (j > start_ad) {
      time_arr[counter] = time_hex;
      counter++;
    }
  }
  fclose(pFile);
  rv[0] = (time_arr[0] << 24) | (time_arr[1] << 16) | (time_arr[2] << 8) |
          time_arr[3];
  rv[1] = (time_arr[4] << 24) | (time_arr[5] << 16) | (time_arr[6] << 8) |
          time_arr[7];
  if (rv[0] > 0) {
    printf("%d %d\n", rv[0], rv[1]);
  } else {
    printf("%d\n", rv[1]);
  }
  free(time_byte);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    $0x400,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    $0x400,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x90(%rbp)
mov    $0x0,%al
call   1040 <timer_ad@plt>
mov    %eax,-0x84(%rbp)
lea    0xdf6(%rip),%rdi
lea    0xdff(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    0xdf1(%rip),%rdi
lea    0xdf8(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    124d <main+0x9d>
lea    0xddf(%rip),%rdi
call   10d0 <perror@plt>
jmp    1372 <main+0x1c2>
jmp    1252 <main+0xa2>
mov    -0x10(%rbp),%rdi
call   10a0 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1270 <main+0xc0>
jmp    1360 <main+0x1b0>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%rdx
lea    0xdad(%rip),%rsi
mov    $0x0,%al
call   1070 <fscanf@plt>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    12d8 <main+0x128>
mov    -0x30(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2f,%eax
jne    12d8 <main+0x128>
jmp    12b5 <main+0x105>
mov    -0x10(%rbp),%rdi
call   1080 <fgetc@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     12cf <main+0x11f>
jmp    12b5 <main+0x105>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    135b <main+0x1ab>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x78,%eax
jne    131a <main+0x16a>
mov    -0x30(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x78,%eax
jne    131a <main+0x16a>
mov    -0x18(%rbp),%rdi
lea    0xd2a(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    1330 <main+0x180>
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%rdx
lea    0xd13(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x1c(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1356 <main+0x1a6>
mov    -0x18(%rbp),%rdi
lea    0xd0f(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    135b <main+0x1ab>
jmp    1252 <main+0xa2>
mov    -0x10(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
lea    0xc99(%rip),%rdi
lea    0xc90(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    0xcb0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%eax
mov    -0x84(%rbp),%ecx
add    $0x8,%ecx
cmp    %ecx,%eax
jae    13f8 <main+0x248>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xc97(%rip),%rsi
lea    -0x88(%rbp),%rdx
mov    $0x0,%al
call   1070 <fscanf@plt>
mov    -0x20(%rbp),%eax
cmp    -0x84(%rbp),%eax
jbe    13f3 <main+0x243>
mov    -0x88(%rbp),%ecx
movslq -0x24(%rbp),%rax
mov    %ecx,-0x70(%rbp,%rax,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1397 <main+0x1e7>
mov    -0x10(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x70(%rbp),%eax
shl    $0x18,%eax
mov    -0x6c(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x68(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
or     -0x64(%rbp),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x60(%rbp),%eax
shl    $0x18,%eax
mov    -0x5c(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x58(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
or     -0x54(%rbp),%eax
mov    %eax,-0x78(%rbp)
cmpl   $0x0,-0x7c(%rbp)
jbe    145c <main+0x2ac>
mov    -0x7c(%rbp),%esi
mov    -0x78(%rbp),%edx
lea    0xc09(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    146d <main+0x2bd>
mov    -0x78(%rbp),%esi
lea    0xbf6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x90(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    $0x400,%edi
call   10c0 <malloc@plt>
mov    %rax,%r15
mov    $0x400,%edi
call   10c0 <malloc@plt>
mov    %rax,0x30(%rsp)
xor    %eax,%eax
call   1040 <timer_ad@plt>
mov    %eax,(%rsp)
lea    0xdf5(%rip),%rdi
lea    0xdfe(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,%rbp
lea    0xdf1(%rip),%rdi
lea    0xdf8(%rip),%rsi
call   10d0 <fopen@plt>
test   %rbp,%rbp
je     1450 <main+0x280>
mov    %rax,%r12
mov    %rbp,%rdi
call   10b0 <feof@plt>
test   %eax,%eax
je     1380 <main+0x1b0>
mov    %rbp,%rdi
call   1050 <fclose@plt>
mov    %r12,%rdi
call   1050 <fclose@plt>
lea    0xdb2(%rip),%rdi
lea    0xda9(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,0x8(%rsp)
lea    0xdc8(%rip),%rdi
xor    %r14d,%r14d
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%rsp),%ebp
add    $0x8,%ebp
je     131b <main+0x14b>
lea    0xdc1(%rip),%r14
lea    0x4(%rsp),%r13
xor    %r15d,%r15d
xor    %ebx,%ebx
jmp    12b5 <main+0xe5>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    %r15d,%ebp
je     12e5 <main+0x115>
mov    %r15d,%r12d
lea    0x1(%r12),%r15d
mov    0x8(%rsp),%rdi
mov    %r14,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1070 <fscanf@plt>
cmp    (%rsp),%r12d
jb     12b0 <main+0xe0>
mov    0x4(%rsp),%eax
movslq %ebx,%rbx
mov    %eax,0x10(%rsp,%rbx,4)
add    $0x1,%ebx
jmp    12b0 <main+0xe0>
mov    0x10(%rsp),%ecx
mov    0x14(%rsp),%eax
mov    0x18(%rsp),%ebp
mov    0x1c(%rsp),%ebx
mov    0x20(%rsp),%esi
mov    0x24(%rsp),%edi
mov    0x28(%rsp),%r14d
mov    0x2c(%rsp),%edx
shl    $0x18,%ecx
shl    $0x10,%eax
shl    $0x8,%ebp
shl    $0x18,%esi
shl    $0x10,%edi
shl    $0x8,%r14d
jmp    1325 <main+0x155>
xor    %edi,%edi
xor    %esi,%esi
xor    %ebp,%ebp
xor    %eax,%eax
xor    %ecx,%ecx
or     %edi,%edx
or     %esi,%r14d
or     %edx,%r14d
or     %ecx,%ebp
or     %eax,%ebp
mov    0x8(%rsp),%rdi
call   1050 <fclose@plt>
or     %ebx,%ebp
je     1354 <main+0x184>
lea    0xd13(%rip),%rdi
mov    %ebp,%esi
mov    %r14d,%edx
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1365 <main+0x195>
lea    0xd01(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x30(%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcae(%rip),%r13
xor    %r14d,%r14d
jmp    13a0 <main+0x1d0>
nopl   0x0(%rax)
mov    %rbp,%rdi
call   10b0 <feof@plt>
test   %eax,%eax
jne    1249 <main+0x79>
mov    %r14d,%ebx
lea    0x1(%rbx),%r14d
mov    %rbp,%rdi
mov    %r13,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1070 <fscanf@plt>
cmpb   $0x2f,(%r15)
jne    13df <main+0x20f>
cmpb   $0x2f,0x1(%r15)
jne    13df <main+0x20f>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbp,%rdi
call   1080 <fgetc@plt>
cmp    $0xa,%al
jne    13d0 <main+0x200>
mov    %ebx,%r14d
test   %r14d,%r14d
jle    1390 <main+0x1c0>
cmpb   $0x78,(%r15)
jne    1420 <main+0x250>
cmpb   $0x78,0x1(%r15)
jne    1420 <main+0x250>
mov    $0x3,%esi
mov    $0x1,%edx
lea    0xc36(%rip),%rdi
mov    %r12,%rcx
call   10f0 <fwrite@plt>
test   $0x3,%r14b
jne    1390 <main+0x1c0>
jmp    143e <main+0x26e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12,%rdi
lea    0xc12(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   10a0 <fprintf@plt>
test   $0x3,%r14b
jne    1390 <main+0x1c0>
mov    $0xa,%edi
mov    %r12,%rsi
call   1090 <fputc@plt>
jmp    1390 <main+0x1c0>
lea    0xbcb(%rip),%rdi
call   10e0 <perror@plt>
jmp    1259 <main+0x89>

LLVM IR (-O0):
@.str = [16 x i8] c"result_byte.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [14 x i8] c"temp_dump.mem\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [19 x i8] c"Error opening file\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [4 x i8] c"00 \00"
@.str.7 = [4 x i8] c"%s \00"
@.str.8 = [2 x i8] c"\0A\00"
@.str.9 = [22 x i8] c"measured time in us: \00"
@.str.10 = [3 x i8] c"%x\00"
@.str.11 = [7 x i8] c"%d %d\0A\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 i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca [8 x i32]
%9 = alloca [8 x i32]
%10 = alloca i32
%11 = alloca [2 x i32]
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i8*
store i32 0, i32* %1
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%16 = call i8* @malloc(i32 1024)
store i8* %16, i8** %7
%17 = call i8* @malloc(i32 1024)
store i8* %17, i8** %15
%18 = call i32 (...) @timer_ad()
store i32 %18, i32* %13
%19 = call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %19, i32** %2
%20 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %20, i32** %3
%21 = load i32*, i32** %2
%22 = icmp eq i32* %21, null
br i1 %22, label %23, label %25
23: ; preds = %0
%24 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
br label %94
25: ; preds = %0
br label %26
26: ; preds = %88, %25
%27 = load i32*, i32** %2
%28 = call i32 @feof(i32* %27)
%29 = icmp ne i32 %28, 0
%30 = xor i1 %29, true
br i1 %30, label %31, label %89
31: ; preds = %26
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 1
store i32 %33, i32* %4
%34 = load i32*, i32** %2
%35 = load i8*, i8** %7
%36 = call i32 (i32*, i8*, ...) @fscanf(i32* %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %35)
%37 = load i8*, i8** %7
%38 = getelementptr inbounds i8, i8* %37, i64 0
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 47
br i1 %41, label %42, label %58
42: ; preds = %31
%43 = load i8*, i8** %7
%44 = getelementptr inbounds i8, i8* %43, i64 1
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = icmp eq i32 %46, 47
br i1 %47, label %48, label %58
48: ; preds = %42
br label %49
49: ; preds = %54, %48
%50 = load i32*, i32** %2
%51 = call signext i8 @fgetc(i32* %50)
%52 = sext i8 %51 to i32
%53 = icmp ne i32 %52, 10
br i1 %53, label %54, label %55
54: ; preds = %49
br label %49
55: ; preds = %49
%56 = load i32, i32* %4
%57 = add nsw i32 %56, -1
store i32 %57, i32* %4
br label %58
58: ; preds = %55, %42, %31
%59 = load i32, i32* %4
%60 = icmp sgt i32 %59, 0
br i1 %60, label %61, label %88
61: ; preds = %58
%62 = load i8*, i8** %7
%63 = getelementptr inbounds i8, i8* %62, i64 0
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = icmp eq i32 %65, 120
br i1 %66, label %67, label %76
67: ; preds = %61
%68 = load i8*, i8** %7
%69 = getelementptr inbounds i8, i8* %68, i64 1
%70 = load i8, i8* %69
%71 = sext i8 %70 to i32
%72 = icmp eq i32 %71, 120
br i1 %72, label %73, label %76
73: ; preds = %67
%74 = load i32*, i32** %3
%75 = call i32 (i32*, i8*, ...) @fprintf(i32* %74, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
br label %80
76: ; preds = %67, %61
%77 = load i32*, i32** %3
%78 = load i8*, i8** %7
%79 = call i32 (i32*, i8*, ...) @fprintf(i32* %77, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %78)
br label %80
80: ; preds = %76, %73
%81 = load i32, i32* %4
%82 = srem i32 %81, 4
%83 = icmp eq i32 %82, 0
br i1 %83, label %84, label %87
84: ; preds = %80
%85 = load i32*, i32** %3
%86 = call i32 (i32*, i8*, ...) @fprintf(i32* %85, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %87
87: ; preds = %84, %80
br label %88
88: ; preds = %87, %58
br label %26
89: ; preds = %26
%90 = load i32*, i32** %2
%91 = call i32 @fclose(i32* %90)
%92 = load i32*, i32** %3
%93 = call i32 @fclose(i32* %92)
br label %94
94: ; preds = %89, %23
%95 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %95, i32** %2
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0))
br label %97
97: ; preds = %117, %94
%98 = load i32, i32* %5
%99 = load i32, i32* %13
%100 = add i32 %99, 8
%101 = icmp ult i32 %98, %100
br i1 %101, label %102, label %118
102: ; preds = %97
%103 = load i32, i32* %5
%104 = add nsw i32 %103, 1
store i32 %104, i32* %5
%105 = load i32*, i32** %2
%106 = call i32 (i32*, i8*, ...) @fscanf(i32* %105, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i32* %14)
%107 = load i32, i32* %5
%108 = load i32, i32* %13
%109 = icmp ugt i32 %107, %108
br i1 %109, label %110, label %117
110: ; preds = %102
%111 = load i32, i32* %14
%112 = load i32, i32* %6
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds [8 x i32], [8 x i32]* %9, i64 0, i64 %113
store i32 %111, i32* %114
%115 = load i32, i32* %6
%116 = add nsw i32 %115, 1
store i32 %116, i32* %6
br label %117
117: ; preds = %110, %102
br label %97
118: ; preds = %97
%119 = load i32*, i32** %2
%120 = call i32 @fclose(i32* %119)
%121 = getelementptr inbounds [8 x i32], [8 x i32]* %9, i64 0, i64 0
%122 = load i32, i32* %121
%123 = shl i32 %122, 24
%124 = getelementptr inbounds [8 x i32], [8 x i32]* %9, i64 0, i64 1
%125 = load i32, i32* %124
%126 = shl i32 %125, 16
%127 = or i32 %123, %126
%128 = getelementptr inbounds [8 x i32], [8 x i32]* %9, i64 0, i64 2
%129 = load i32, i32* %128
%130 = shl i32 %129, 8
%131 = or i32 %127, %130
%132 = getelementptr inbounds [8 x i32], [8 x i32]* %9, i64 0, i64 3
%133 = load i32, i32* %132
%134 = or i32 %131, %133
%135 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
store i32 %134, i32* %135
%136 = getelementptr inbounds [8 x i32], [8 x i32]* %9, i64 0, i64 4
%137 = load i32, i32* %136
%138 = shl i32 %137, 24
%139 = getelementptr inbounds [8 x i32], [8 x i32]* %9, i64 0, i64 5
%140 = load i32, i32* %139
%141 = shl i32 %140, 16
%142 = or i32 %138, %141
%143 = getelementptr inbounds [8 x i32], [8 x i32]* %9, i64 0, i64 6
%144 = load i32, i32* %143
%145 = shl i32 %144, 8
%146 = or i32 %142, %145
%147 = getelementptr inbounds [8 x i32], [8 x i32]* %9, i64 0, i64 7
%148 = load i32, i32* %147
%149 = or i32 %146, %148
%150 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 1
store i32 %149, i32* %150
%151 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
%152 = load i32, i32* %151
%153 = icmp ugt i32 %152, 0
br i1 %153, label %154, label %160
154: ; preds = %118
%155 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
%156 = load i32, i32* %155
%157 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 1
%158 = load i32, i32* %157
%159 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i32 %156, i32 %158)
br label %164
160: ; preds = %118
%161 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 1
%162 = load i32, i32* %161
%163 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i32 %162)
br label %164
164: ; preds = %160, %154
%165 = load i8*, i8** %15
%166 = call i32 @free(i8* %165)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"result_byte.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [14 x i8] c"temp_dump.mem\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [19 x i8] c"Error opening file\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [4 x i8] c"00 \00"
@.str.7 = [4 x i8] c"%s \00"
@.str.9 = [22 x i8] c"measured time in us: \00"
@.str.10 = [3 x i8] c"%x\00"
@.str.11 = [7 x i8] c"%d %d\0A\00"
@.str.12 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [8 x i32]
%2 = alloca i32
%3 = tail call dereferenceable_or_null(1024) i8* @malloc(i32 1024)
%4 = bitcast [8 x i32]* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = tail call dereferenceable_or_null(1024) i8* @malloc(i32 1024)
%7 = tail call i32 (...) @timer_ad()
%8 = tail call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%10 = icmp eq i32* %8, null
br i1 %10, label %16, label %11
11: ; preds = %0
%12 = tail call i32 @feof(i32* %8)
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %51
14: ; preds = %11
%15 = getelementptr inbounds i8, i8* %3, i64 1
br label %18
16: ; preds = %0
%17 = tail call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
br label %54
18: ; preds = %14, %48
%19 = phi i32 [ 0, %14 ], [ %31, %48 ]
%20 = add nsw i32 %19, 1
%21 = tail call i32 (i32*, i8*, ...) @fscanf(i32* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %3)
%22 = load i8, i8* %3
%23 = icmp eq i8 %22, 47
br i1 %23, label %24, label %30
24: ; preds = %18
%25 = load i8, i8* %15
%26 = icmp eq i8 %25, 47
br i1 %26, label %27, label %30
27: ; preds = %24, %27
%28 = tail call signext i8 @fgetc(i32* %8)
%29 = icmp eq i8 %28, 10
br i1 %29, label %30, label %27
30: ; preds = %27, %24, %18
%31 = phi i32 [ %20, %24 ], [ %20, %18 ], [ %19, %27 ]
%32 = icmp sgt i32 %31, 0
br i1 %32, label %33, label %48
33: ; preds = %30
%34 = load i8, i8* %3
%35 = icmp eq i8 %34, 120
br i1 %35, label %36, label %41
36: ; preds = %33
%37 = load i8, i8* %15
%38 = icmp eq i8 %37, 120
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i64 3, i64 1, i32* %9)
br label %43
41: ; preds = %36, %33
%42 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %3)
br label %43
43: ; preds = %41, %39
%44 = and i32 %31, 3
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %43
%47 = tail call i32 @fputc(i32 10, i32* %9)
br label %48
48: ; preds = %43, %46, %30
%49 = tail call i32 @feof(i32* %8)
%50 = icmp eq i32 %49, 0
br i1 %50, label %18, label %51
51: ; preds = %48, %11
%52 = tail call i32 @fclose(i32* %8)
%53 = tail call i32 @fclose(i32* %9)
br label %54
54: ; preds = %51, %16
%55 = tail call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0))
%57 = add i32 %7, 8
%58 = icmp eq i32 %57, 0
br i1 %58, label %96, label %59
59: ; preds = %54, %70
%60 = phi i32 [ %62, %70 ], [ 0, %54 ]
%61 = phi i32 [ %71, %70 ], [ 0, %54 ]
%62 = add nuw i32 %60, 1
%63 = call i32 (i32*, i8*, ...) @fscanf(i32* %55, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i32* %2)
%64 = icmp ult i32 %60, %7
br i1 %64, label %70, label %65
65: ; preds = %59
%66 = load i32, i32* %2
%67 = sext i32 %61 to i64
%68 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 %67
store i32 %66, i32* %68
%69 = add nsw i32 %61, 1
br label %70
70: ; preds = %65, %59
%71 = phi i32 [ %69, %65 ], [ %61, %59 ]
%72 = icmp eq i32 %62, %57
br i1 %72, label %73, label %59
73: ; preds = %70
%74 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%75 = load i32, i32* %74
%76 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 1
%77 = load i32, i32* %76
%78 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 2
%79 = load i32, i32* %78
%80 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 3
%81 = load i32, i32* %80
%82 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 4
%83 = load i32, i32* %82
%84 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 5
%85 = load i32, i32* %84
%86 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 6
%87 = load i32, i32* %86
%88 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 7
%89 = load i32, i32* %88
%90 = shl i32 %75, 24
%91 = shl i32 %77, 16
%92 = shl i32 %79, 8
%93 = shl i32 %83, 24
%94 = shl i32 %85, 16
%95 = shl i32 %87, 8
br label %96
96: ; preds = %73, %54
%97 = phi i32 [ %89, %73 ], [ undef, %54 ]
%98 = phi i32 [ %95, %73 ], [ 0, %54 ]
%99 = phi i32 [ %94, %73 ], [ 0, %54 ]
%100 = phi i32 [ %93, %73 ], [ 0, %54 ]
%101 = phi i32 [ %81, %73 ], [ undef, %54 ]
%102 = phi i32 [ %92, %73 ], [ 0, %54 ]
%103 = phi i32 [ %91, %73 ], [ 0, %54 ]
%104 = phi i32 [ %90, %73 ], [ 0, %54 ]
%105 = call i32 @fclose(i32* %55)
%106 = or i32 %103, %104
%107 = or i32 %106, %102
%108 = or i32 %107, %101
%109 = or i32 %99, %100
%110 = or i32 %109, %98
%111 = or i32 %110, %97
%112 = icmp eq i32 %108, 0
br i1 %112, label %115, label %113
113: ; preds = %96
%114 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i32 %108, i32 %111)
br label %117
115: ; preds = %96
%116 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i32 %111)
br label %117
117: ; preds = %115, %113
%118 = call i32 @free(i8* %6)
ret i32 0
}