#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 */
int BUFSIZ;
double CLOCKS_PER_SEC;
int INT_MIN;
scalar_t__ clock();
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *, ...);
int sscanf(char *, char *, int *, int *);
int main(int argc, char **argv) {
  clock_t begin, end;
  double time_spent;
  begin = clock();
  if (argc < 2) {
    printf("Not enough arguments. Provide input file location in the rerun\n");
    return -27;
  } else {
    int integers[10000];
    char *path = argv[1];
    FILE *in;
    in = fopen(path, "r");
    if (in != NULL) {
      char line[BUFSIZ];
      int count = 0;
      while (fgets(line, sizeof line, in) != NULL) {
        char *start = line;
        int num;
        int n;
        while (sscanf(start, "%d%n", &num, &n) == 1) {
          start += n;
          integers[count] = num;
          count++;
        }
      }
      fclose(in);
      int i;
      int finalMax = INT_MIN;
      int curMax;
      for (i = 0; i < count; i++) {
        curMax = integers[i];
        if (curMax > finalMax) {
          finalMax = curMax;
        }
      }
      FILE *out;
      out = fopen("serial-max-integer-out.txt", "w");
      if (out != NULL) {
        fprintf(out, "Location of the input file: %s\n", path);
        fprintf(out, "Among %d integers that've been read, the maximum is %d\n",
                count, finalMax);
        end = clock();
        fprintf(out, "Runtime: %f", (double)(end - begin) / CLOCKS_PER_SEC);
        printf("Done. Runtime: %f\n", (double)(end - begin) / CLOCKS_PER_SEC);
      }
      fclose(out);
    }
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9cd0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11b8 <main+0x48>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffe5,-0x4(%rbp)
jmp    143c <main+0x2cc>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x9c78(%rbp)
mov    -0x9c78(%rbp),%rdi
lea    0xe6b(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x9c80(%rbp)
cmpq   $0x0,-0x9c80(%rbp)
je     1435 <main+0x2c5>
mov    0x2dda(%rip),%rax
mov    (%rax),%eax
mov    %rax,-0x9cd0(%rbp)
mov    %rsp,%rcx
mov    %rcx,-0x9c88(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x9cc8(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x9c90(%rbp)
movl   $0x0,-0x9c94(%rbp)
mov    -0x9cc8(%rbp),%rdi
mov    -0x9cd0(%rbp),%rax
mov    %eax,%esi
mov    -0x9c80(%rbp),%rdx
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     12da <main+0x16a>
mov    -0x9cc8(%rbp),%rax
mov    %rax,-0x9ca0(%rbp)
mov    -0x9ca0(%rbp),%rdi
lea    0xdcb(%rip),%rsi
lea    -0x9ca4(%rbp),%rdx
lea    -0x9ca8(%rbp),%rcx
call   1080 <sscanf@plt>
cmp    $0x1,%eax
jne    12d5 <main+0x165>
mov    -0x9ca8(%rbp),%ecx
mov    -0x9ca0(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x9ca0(%rbp)
mov    -0x9ca4(%rbp),%ecx
movslq -0x9c94(%rbp),%rax
mov    %ecx,-0x9c70(%rbp,%rax,4)
mov    -0x9c94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c94(%rbp)
jmp    1269 <main+0xf9>
jmp    1235 <main+0xc5>
mov    -0x9c80(%rbp),%rdi
call   1040 <fclose@plt>
mov    0x2cf3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x9cb0(%rbp)
movl   $0x0,-0x9cac(%rbp)
mov    -0x9cac(%rbp),%eax
cmp    -0x9c94(%rbp),%eax
jge    135c <main+0x1ec>
movslq -0x9cac(%rbp),%rax
mov    -0x9c70(%rbp,%rax,4),%eax
mov    %eax,-0x9cb4(%rbp)
mov    -0x9cb4(%rbp),%eax
cmp    -0x9cb0(%rbp),%eax
jle    1343 <main+0x1d3>
mov    -0x9cb4(%rbp),%eax
mov    %eax,-0x9cb0(%rbp)
jmp    1348 <main+0x1d8>
mov    -0x9cac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9cac(%rbp)
jmp    12ff <main+0x18f>
lea    0xce4(%rip),%rdi
lea    0xcf8(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x9cc0(%rbp)
cmpq   $0x0,-0x9cc0(%rbp)
je     141f <main+0x2af>
mov    -0x9cc0(%rbp),%rdi
mov    -0x9c78(%rbp),%rdx
lea    0xccb(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x9cc0(%rbp),%rdi
mov    -0x9c94(%rbp),%edx
mov    -0x9cb0(%rbp),%ecx
lea    0xcca(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x20(%rbp)
mov    -0x9cc0(%rbp),%rdi
mov    -0x20(%rbp),%rax
sub    -0x18(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    0x2c01(%rip),%rax
divsd  (%rax),%xmm0
lea    0xcca(%rip),%rsi
mov    $0x1,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rax
sub    -0x18(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    0x2bdb(%rip),%rax
divsd  (%rax),%xmm0
lea    0xcb0(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x9cc0(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x9c88(%rbp),%rax
mov    %rax,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x9c78,%rsp
mov    %rsi,%r14
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <clock@plt>
cmp    $0x1,%ebx
jg     11bb <main+0x3b>
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffe5,%eax
jmp    1534 <main+0x3b4>
mov    %rax,%r13
mov    0x8(%r14),%rbx
lea    0xe37(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1532 <main+0x3b2>
mov    %rax,%r14
mov    %rsp,%r15
mov    0x2de9(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdi
mov    %rsi,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdi
mov    %rdi,%rsp
mov    %rdi,-0x30(%rbp)
mov    %rsi,-0x60(%rbp)
mov    %r14,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
mov    %rbx,-0x50(%rbp)
je     12ec <main+0x16c>
mov    %r13,-0x48(%rbp)
mov    %r15,-0x38(%rbp)
xor    %ebx,%ebx
lea    0xdd7(%rip),%rsi
lea    -0x40(%rbp),%rdx
lea    -0x3c(%rbp),%rcx
mov    -0x30(%rbp),%r15
mov    %r14,-0x58(%rbp)
jmp    1269 <main+0xe9>
nopl   (%rax)
mov    -0x30(%rbp),%r15
mov    %r15,%rdi
mov    -0x60(%rbp),%rsi
mov    -0x58(%rbp),%r14
mov    %r14,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
lea    0xda1(%rip),%rsi
mov    %r13,%rdx
mov    %r12,%rcx
je     12c0 <main+0x140>
mov    %r15,%rdi
mov    %rdx,%r13
mov    %rcx,%r12
call   1090 <sscanf@plt>
cmp    $0x1,%eax
jne    1240 <main+0xc0>
mov    %r15,%r14
movslq %ebx,%rax
lea    -0x9ca0(,%rax,4),%r15
ff
add    %rbp,%r15
nopl   (%rax)
movslq -0x3c(%rbp),%rax
add    %rax,%r14
mov    -0x40(%rbp),%eax
mov    %eax,(%r15)
mov    %r14,%rdi
lea    0xd5b(%rip),%rsi
mov    %r13,%rdx
mov    %r12,%rcx
call   1090 <sscanf@plt>
add    $0x4,%r15
add    $0x1,%ebx
cmp    $0x1,%eax
je     1290 <main+0x110>
jmp    1240 <main+0xc0>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    0x2d11(%rip),%rax
mov    (%rax),%r12d
test   %ebx,%ebx
mov    -0x48(%rbp),%r13
jle    1305 <main+0x185>
mov    %ebx,%eax
cmp    $0x8,%ebx
jae    130e <main+0x18e>
xor    %ecx,%ecx
mov    -0x38(%rbp),%r15
jmp    1480 <main+0x300>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    0x2ce5(%rip),%rax
mov    (%rax),%r12d
xor    %ebx,%ebx
jmp    1497 <main+0x317>
mov    -0x38(%rbp),%r15
jmp    1497 <main+0x317>
mov    %eax,%ecx
and    $0xfffffff8,%ecx
movd   %r12d,%xmm0
pshufd $0x0,%xmm0,%xmm0
lea    -0x8(%rcx),%rsi
mov    %rsi,%rdx
shr    $0x3,%rdx
add    $0x1,%rdx
test   %rsi,%rsi
je     13d0 <main+0x250>
mov    %rdx,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %esi,%esi
movdqa %xmm0,%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movdqa -0x9ca0(%rbp,%rsi,4),%xmm2
ff ff
movdqa -0x9c90(%rbp,%rsi,4),%xmm3
ff ff
movdqa -0x9c80(%rbp,%rsi,4),%xmm4
ff ff
movdqa -0x9c70(%rbp,%rsi,4),%xmm5
ff ff
movdqa %xmm2,%xmm6
pcmpgtd %xmm0,%xmm6
pand   %xmm6,%xmm2
pandn  %xmm0,%xmm6
por    %xmm2,%xmm6
movdqa %xmm3,%xmm2
pcmpgtd %xmm1,%xmm2
pand   %xmm2,%xmm3
pandn  %xmm1,%xmm2
por    %xmm3,%xmm2
movdqa %xmm4,%xmm0
pcmpgtd %xmm6,%xmm0
pand   %xmm0,%xmm4
pandn  %xmm6,%xmm0
por    %xmm4,%xmm0
movdqa %xmm5,%xmm1
pcmpgtd %xmm2,%xmm1
pand   %xmm1,%xmm5
pandn  %xmm2,%xmm1
por    %xmm5,%xmm1
add    $0x10,%rsi
add    $0xfffffffffffffffe,%rdi
jne    1350 <main+0x1d0>
jmp    13d6 <main+0x256>
xor    %esi,%esi
movdqa %xmm0,%xmm1
test   $0x1,%dl
mov    -0x38(%rbp),%r15
je     1421 <main+0x2a1>
movdqa -0x9ca0(%rbp,%rsi,4),%xmm2
ff ff
movdqa -0x9c90(%rbp,%rsi,4),%xmm3
ff ff
movdqa %xmm2,%xmm4
pcmpgtd %xmm0,%xmm4
pand   %xmm4,%xmm2
pandn  %xmm0,%xmm4
por    %xmm2,%xmm4
movdqa %xmm3,%xmm2
pcmpgtd %xmm1,%xmm2
pand   %xmm2,%xmm3
pandn  %xmm1,%xmm2
por    %xmm3,%xmm2
movdqa %xmm4,%xmm0
movdqa %xmm2,%xmm1
movdqa %xmm0,%xmm2
pcmpgtd %xmm1,%xmm2
pand   %xmm2,%xmm0
pandn  %xmm1,%xmm2
por    %xmm0,%xmm2
pshufd $0xee,%xmm2,%xmm0
movdqa %xmm2,%xmm1
pcmpgtd %xmm0,%xmm1
pand   %xmm1,%xmm2
pandn  %xmm0,%xmm1
por    %xmm2,%xmm1
pshufd $0x55,%xmm1,%xmm0
movdqa %xmm1,%xmm2
pcmpgtd %xmm0,%xmm2
pand   %xmm2,%xmm1
pandn  %xmm0,%xmm2
por    %xmm1,%xmm2
movd   %xmm2,%r12d
cmp    %rax,%rcx
je     1497 <main+0x317>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    -0x9ca0(%rbp,%rcx,4),%edx
cmp    %r12d,%edx
cmovg  %edx,%r12d
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1480 <main+0x300>
lea    0xb69(%rip),%rdi
lea    0xb7d(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%r14
test   %rax,%rax
je     1527 <main+0x3a7>
lea    0xb6b(%rip),%rsi
mov    %r14,%rdi
mov    -0x50(%rbp),%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0xb76(%rip),%rsi
mov    %r14,%rdi
mov    %ebx,%edx
mov    %r12d,%ecx
xor    %eax,%eax
call   1080 <fprintf@plt>
xor    %eax,%eax
call   1040 <clock@plt>
sub    %r13,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    0x2aed(%rip),%rbx
divsd  (%rbx),%xmm0
lea    0xb76(%rip),%rsi
mov    %r14,%rdi
mov    $0x1,%al
call   1080 <fprintf@plt>
movsd  -0x30(%rbp),%xmm0
divsd  (%rbx),%xmm0
lea    0xb68(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %r15,%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [64 x i8] c"Not enough arguments. Provide input file location in the rerun\0A\00"
@.str.1 = [2 x i8] c"r\00"
@BUFSIZ = global i32 0
@.str.2 = [5 x i8] c"%d%n\00"
@INT_MIN = global i32 0
@.str.3 = [27 x i8] c"serial-max-integer-out.txt\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [32 x i8] c"Location of the input file: %s\0A\00"
@.str.6 = [56 x i8] c"Among %d integers that've been read, the maximum is %d\0A\00"
@.str.7 = [12 x i8] c"Runtime: %f\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
@.str.8 = [19 x i8] c"Done. Runtime: %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
%8 = alloca double
%9 = alloca [10000 x i32]
%10 = alloca i8*
%11 = alloca i32*
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%22 = call i64 (...) @clock()
store i64 %22, i64* %6
%23 = load i32, i32* %4
%24 = icmp slt i32 %23, 2
br i1 %24, label %25, label %27
25: ; preds = %2
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
store i32 -27, i32* %3
br label %117
27: ; preds = %2
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
store i8* %30, i8** %10
%31 = load i8*, i8** %10
%32 = call i32* @fopen(i8* %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %32, i32** %11
%33 = load i32*, i32** %11
%34 = icmp ne i32* %33, null
br i1 %34, label %35, label %116
35: ; preds = %27
%36 = load i32, i32* @BUFSIZ
%37 = zext i32 %36 to i64
%38 = call i8* @llvm.stacksave()
store i8* %38, i8** %12
%39 = alloca i8, i64 %37
store i64 %37, i64* %13
store i32 0, i32* %14
br label %40
40: ; preds = %61, %35
%41 = trunc i64 %37 to i32
%42 = load i32*, i32** %11
%43 = call i32* @fgets(i8* %39, i32 %41, i32* %42)
%44 = icmp ne i32* %43, null
br i1 %44, label %45, label %62
45: ; preds = %40
store i8* %39, i8** %15
br label %46
46: ; preds = %50, %45
%47 = load i8*, i8** %15
%48 = call i32 @sscanf(i8* %47, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32* %16, i32* %17)
%49 = icmp eq i32 %48, 1
br i1 %49, label %50, label %61
50: ; preds = %46
%51 = load i32, i32* %17
%52 = load i8*, i8** %15
%53 = sext i32 %51 to i64
%54 = getelementptr inbounds i8, i8* %52, i64 %53
store i8* %54, i8** %15
%55 = load i32, i32* %16
%56 = load i32, i32* %14
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [10000 x i32], [10000 x i32]* %9, i64 0, i64 %57
store i32 %55, i32* %58
%59 = load i32, i32* %14
%60 = add nsw i32 %59, 1
store i32 %60, i32* %14
br label %46
61: ; preds = %46
br label %40
62: ; preds = %40
%63 = load i32*, i32** %11
%64 = call i32 @fclose(i32* %63)
%65 = load i32, i32* @INT_MIN
store i32 %65, i32* %19
store i32 0, i32* %18
br label %66
66: ; preds = %81, %62
%67 = load i32, i32* %18
%68 = load i32, i32* %14
%69 = icmp slt i32 %67, %68
br i1 %69, label %70, label %84
70: ; preds = %66
%71 = load i32, i32* %18
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [10000 x i32], [10000 x i32]* %9, i64 0, i64 %72
%74 = load i32, i32* %73
store i32 %74, i32* %20
%75 = load i32, i32* %20
%76 = load i32, i32* %19
%77 = icmp sgt i32 %75, %76
br i1 %77, label %78, label %80
78: ; preds = %70
%79 = load i32, i32* %20
store i32 %79, i32* %19
br label %80
80: ; preds = %78, %70
br label %81
81: ; preds = %80
%82 = load i32, i32* %18
%83 = add nsw i32 %82, 1
store i32 %83, i32* %18
br label %66
84: ; preds = %66
%85 = call i32* @fopen(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %85, i32** %21
%86 = load i32*, i32** %21
%87 = icmp ne i32* %86, null
br i1 %87, label %88, label %112
88: ; preds = %84
%89 = load i32*, i32** %21
%90 = load i8*, i8** %10
%91 = call i32 (i32*, i8*, ...) @fprintf(i32* %89, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i8* %90)
%92 = load i32*, i32** %21
%93 = load i32, i32* %14
%94 = load i32, i32* %19
%95 = call i32 (i32*, i8*, ...) @fprintf(i32* %92, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.6, i64 0, i64 0), i32 %93, i32 %94)
%96 = call i64 (...) @clock()
store i64 %96, i64* %7
%97 = load i32*, i32** %21
%98 = load i64, i64* %7
%99 = load i64, i64* %6
%100 = sub nsw i64 %98, %99
%101 = sitofp i64 %100 to double
%102 = load double, double* @CLOCKS_PER_SEC
%103 = fdiv double %101, %102
%104 = call i32 (i32*, i8*, ...) @fprintf(i32* %97, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), double %103)
%105 = load i64, i64* %7
%106 = load i64, i64* %6
%107 = sub nsw i64 %105, %106
%108 = sitofp i64 %107 to double
%109 = load double, double* @CLOCKS_PER_SEC
%110 = fdiv double %108, %109
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), double %110)
br label %112
112: ; preds = %88, %84
%113 = load i32*, i32** %21
%114 = call i32 @fclose(i32* %113)
%115 = load i8*, i8** %12
br label %116
116: ; preds = %112, %27
store i32 0, i32* %3
br label %117
117: ; preds = %116, %25
%118 = load i32, i32* %3
ret i32 %118
}

LLVM IR (-O2):
@.str.1 = [2 x i8] c"r\00"
@BUFSIZ = global i32 0
@.str.2 = [5 x i8] c"%d%n\00"
@INT_MIN = global i32 0
@.str.3 = [27 x i8] c"serial-max-integer-out.txt\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [32 x i8] c"Location of the input file: %s\0A\00"
@.str.6 = [56 x i8] c"Among %d integers that've been read, the maximum is %d\0A\00"
@.str.7 = [12 x i8] c"Runtime: %f\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
@.str.8 = [19 x i8] c"Done. Runtime: %f\0A\00"
@str = [63 x i8] c"Not enough arguments. Provide input file location in the rerun\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [10000 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = tail call i64 (...) @clock()
%7 = icmp slt i32 %0, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
br label %156
10: ; preds = %2
%11 = bitcast [10000 x i32]* %3 to i8*
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = tail call i32* @fopen(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i32* %14, null
br i1 %15, label %155, label %16
16: ; preds = %10
%17 = load i32, i32* @BUFSIZ
%18 = zext i32 %17 to i64
%19 = tail call i8* @llvm.stacksave()
%20 = alloca i8, i64 %18
%21 = call i32* @fgets(i8* %20, i32 %17, i32* %14)
%22 = icmp eq i32* %21, null
br i1 %22, label %23, label %26
23: ; preds = %16
%24 = call i32 @fclose(i32* %14)
%25 = load i32, i32* @INT_MIN
br label %136
26: ; preds = %16
%27 = bitcast i32* %4 to i8*
%28 = bitcast i32* %5 to i8*
br label %29
29: ; preds = %26, %48
%30 = phi i32 [ 0, %26 ], [ %49, %48 ]
%31 = call i32 @sscanf(i8* %20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32* %4, i32* %5)
%32 = icmp eq i32 %31, 1
br i1 %32, label %33, label %48
33: ; preds = %29
%34 = sext i32 %30 to i64
br label %35
35: ; preds = %33, %35
%36 = phi i64 [ %34, %33 ], [ %43, %35 ]
%37 = phi i8* [ %20, %33 ], [ %40, %35 ]
%38 = load i32, i32* %5
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i8, i8* %37, i64 %39
%41 = load i32, i32* %4
%42 = getelementptr inbounds [10000 x i32], [10000 x i32]* %3, i64 0, i64 %36
store i32 %41, i32* %42
%43 = add i64 %36, 1
%44 = call i32 @sscanf(i8* %40, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32* %4, i32* %5)
%45 = icmp eq i32 %44, 1
br i1 %45, label %35, label %46
46: ; preds = %35
%47 = trunc i64 %43 to i32
br label %48
48: ; preds = %46, %29
%49 = phi i32 [ %30, %29 ], [ %47, %46 ]
%50 = call i32* @fgets(i8* %20, i32 %17, i32* %14)
%51 = icmp eq i32* %50, null
br i1 %51, label %52, label %29
52: ; preds = %48
%53 = call i32 @fclose(i32* %14)
%54 = load i32, i32* @INT_MIN
%55 = icmp sgt i32 %49, 0
br i1 %55, label %56, label %136
56: ; preds = %52
%57 = zext i32 %49 to i64
%58 = icmp ult i32 %49, 8
br i1 %58, label %124, label %59
59: ; preds = %56
%60 = and i64 %57, 4294967288
%61 = insertelement <4 x i32> poison, i32 %54, i64 0
%62 = shufflevector <4 x i32> %61, <4 x i32> poison, <4 x i32> zeroinitializer
%63 = add nsw i64 %60, -8
%64 = lshr exact i64 %63, 3
%65 = add nuw nsw i64 %64, 1
%66 = and i64 %65, 1
%67 = icmp eq i64 %63, 0
br i1 %67, label %99, label %68
68: ; preds = %59
%69 = and i64 %65, 4611686018427387902
br label %70
70: ; preds = %70, %68
%71 = phi i64 [ 0, %68 ], [ %96, %70 ]
%72 = phi <4 x i32> [ %62, %68 ], [ %94, %70 ]
%73 = phi <4 x i32> [ %62, %68 ], [ %95, %70 ]
%74 = phi i64 [ 0, %68 ], [ %97, %70 ]
%75 = getelementptr inbounds [10000 x i32], [10000 x i32]* %3, i64 0, i64 %71
%76 = bitcast i32* %75 to <4 x i32>*
%77 = load <4 x i32>, <4 x i32>* %76
%78 = getelementptr inbounds i32, i32* %75, i64 4
%79 = bitcast i32* %78 to <4 x i32>*
%80 = load <4 x i32>, <4 x i32>* %79
%81 = icmp sgt <4 x i32> %77, %72
%82 = icmp sgt <4 x i32> %80, %73
%83 = select <4 x i1> %81, <4 x i32> %77, <4 x i32> %72
%84 = select <4 x i1> %82, <4 x i32> %80, <4 x i32> %73
%85 = or i64 %71, 8
%86 = getelementptr inbounds [10000 x i32], [10000 x i32]* %3, i64 0, i64 %85
%87 = bitcast i32* %86 to <4 x i32>*
%88 = load <4 x i32>, <4 x i32>* %87
%89 = getelementptr inbounds i32, i32* %86, i64 4
%90 = bitcast i32* %89 to <4 x i32>*
%91 = load <4 x i32>, <4 x i32>* %90
%92 = icmp sgt <4 x i32> %88, %83
%93 = icmp sgt <4 x i32> %91, %84
%94 = select <4 x i1> %92, <4 x i32> %88, <4 x i32> %83
%95 = select <4 x i1> %93, <4 x i32> %91, <4 x i32> %84
%96 = add nuw i64 %71, 16
%97 = add i64 %74, 2
%98 = icmp eq i64 %97, %69
br i1 %98, label %99, label %70
99: ; preds = %70, %59
%100 = phi <4 x i32> [ undef, %59 ], [ %94, %70 ]
%101 = phi <4 x i32> [ undef, %59 ], [ %95, %70 ]
%102 = phi i64 [ 0, %59 ], [ %96, %70 ]
%103 = phi <4 x i32> [ %62, %59 ], [ %94, %70 ]
%104 = phi <4 x i32> [ %62, %59 ], [ %95, %70 ]
%105 = icmp eq i64 %66, 0
br i1 %105, label %117, label %106
106: ; preds = %99
%107 = getelementptr inbounds [10000 x i32], [10000 x i32]* %3, i64 0, i64 %102
%108 = bitcast i32* %107 to <4 x i32>*
%109 = load <4 x i32>, <4 x i32>* %108
%110 = getelementptr inbounds i32, i32* %107, i64 4
%111 = bitcast i32* %110 to <4 x i32>*
%112 = load <4 x i32>, <4 x i32>* %111
%113 = icmp sgt <4 x i32> %109, %103
%114 = icmp sgt <4 x i32> %112, %104
%115 = select <4 x i1> %113, <4 x i32> %109, <4 x i32> %103
%116 = select <4 x i1> %114, <4 x i32> %112, <4 x i32> %104
br label %117
117: ; preds = %99, %106
%118 = phi <4 x i32> [ %100, %99 ], [ %115, %106 ]
%119 = phi <4 x i32> [ %101, %99 ], [ %116, %106 ]
%120 = icmp sgt <4 x i32> %118, %119
%121 = select <4 x i1> %120, <4 x i32> %118, <4 x i32> %119
%122 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %121)
%123 = icmp eq i64 %60, %57
br i1 %123, label %136, label %124
124: ; preds = %56, %117
%125 = phi i64 [ 0, %56 ], [ %60, %117 ]
%126 = phi i32 [ %54, %56 ], [ %122, %117 ]
br label %127
127: ; preds = %124, %127
%128 = phi i64 [ %134, %127 ], [ %125, %124 ]
%129 = phi i32 [ %133, %127 ], [ %126, %124 ]
%130 = getelementptr inbounds [10000 x i32], [10000 x i32]* %3, i64 0, i64 %128
%131 = load i32, i32* %130
%132 = icmp sgt i32 %131, %129
%133 = select i1 %132, i32 %131, i32 %129
%134 = add nuw nsw i64 %128, 1
%135 = icmp eq i64 %134, %57
br i1 %135, label %136, label %127
136: ; preds = %127, %117, %23, %52
%137 = phi i32 [ %49, %52 ], [ 0, %23 ], [ %49, %117 ], [ %49, %127 ]
%138 = phi i32 [ %54, %52 ], [ %25, %23 ], [ %122, %117 ], [ %133, %127 ]
%139 = call i32* @fopen(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%140 = icmp eq i32* %139, null
br i1 %140, label %153, label %141
141: ; preds = %136
%142 = call i32 (i32*, i8*, ...) @fprintf(i32* %139, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i8* %13)
%143 = call i32 (i32*, i8*, ...) @fprintf(i32* %139, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.6, i64 0, i64 0), i32 %137, i32 %138)
%144 = call i64 (...) @clock()
%145 = sub nsw i64 %144, %6
%146 = sitofp i64 %145 to double
%147 = load double, double* @CLOCKS_PER_SEC
%148 = fdiv double %146, %147
%149 = call i32 (i32*, i8*, ...) @fprintf(i32* %139, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), double %148)
%150 = load double, double* @CLOCKS_PER_SEC
%151 = fdiv double %146, %150
%152 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), double %151)
br label %153
153: ; preds = %141, %136
%154 = call i32 @fclose(i32* %139)
br label %155
155: ; preds = %153, %10
br label %156
156: ; preds = %155, %8
%157 = phi i32 [ -27, %8 ], [ 0, %155 ]
ret i32 %157
}