#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 */
unsigned long CalculateProduct(int *, int);
int CheckForZero(int *, int);
int /*<<< orphan*/ CopySubstring(int *, int *, int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int strlen(char *);
int main(void) {
  FILE *fp_aux = NULL;
  int *input_array = malloc(1000 * sizeof *input_array);
  int *tmp_array = malloc(13 * sizeof *tmp_array);
  char buffer[50];
  int digit = 0, curr_idx = 0, found_idx = -1, count = 0;
  unsigned long int product = 0, tmp_product = 0;
  fp_aux = fopen("../../../addendum/0008.txt", "r");
  if (fp_aux == NULL) {
    printf("Nay! Something went wrong! >.<");
    exit(1);
  }
  while (fgets(buffer, 50 + 1, fp_aux) != NULL && strlen(buffer) > 1) {
    for (digit = 0; digit < 50; digit++) {
      input_array[curr_idx++] = buffer[digit] - '0';
    }
  }
  curr_idx = 0;
  while (curr_idx < 1000 - 13) {
    CopySubstring(tmp_array, input_array, curr_idx, 13);
    found_idx = CheckForZero(tmp_array, 13);
    if (found_idx < 0) {
      tmp_product = CalculateProduct(tmp_array, 13);
      curr_idx++;
    } else {
      curr_idx += found_idx + 1;
    }
    if (tmp_product > product) {
      product = tmp_product;
    }
  }
  printf("%lu\n", product);
  fclose(fp_aux);
  free(input_array);
  input_array = NULL;
  free(tmp_array);
  tmp_array = NULL;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0xfa0,%edi
call   1090 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x34,%edi
call   1090 <malloc@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x64(%rbp)
movl   $0x0,-0x68(%rbp)
movl   $0xffffffff,-0x6c(%rbp)
movl   $0x0,-0x70(%rbp)
movq   $0x0,-0x78(%rbp)
movq   $0x0,-0x80(%rbp)
lea    0xde7(%rip),%rdi
lea    0xdfb(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    124c <main+0x9c>
lea    0xde2(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
jmp    1251 <main+0xa1>
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x33,%esi
call   1080 <fgets@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x81(%rbp)
je     128d <main+0xdd>
lea    -0x60(%rbp),%rdi
call   1050 <strlen@plt>
cmp    $0x1,%eax
setg   %al
mov    %al,-0x81(%rbp)
mov    -0x81(%rbp),%al
test   $0x1,%al
jne    12a0 <main+0xf0>
jmp    12e5 <main+0x135>
movl   $0x0,-0x64(%rbp)
cmpl   $0x32,-0x64(%rbp)
jge    12e0 <main+0x130>
movslq -0x64(%rbp),%rax
movsbl -0x60(%rbp,%rax,1),%edx
sub    $0x30,%edx
mov    -0x18(%rbp),%rax
mov    -0x68(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x68(%rbp)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    12a7 <main+0xf7>
jmp    1251 <main+0xa1>
movl   $0x0,-0x68(%rbp)
cmpl   $0x3db,-0x68(%rbp)
jge    1370 <main+0x1c0>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x68(%rbp),%edx
mov    $0xd,%ecx
call   10a0 <CopySubstring@plt>
mov    -0x20(%rbp),%rdi
mov    $0xd,%esi
call   1060 <CheckForZero@plt>
mov    %eax,-0x6c(%rbp)
cmpl   $0x0,-0x6c(%rbp)
jge    1349 <main+0x199>
mov    -0x20(%rbp),%rdi
mov    $0xd,%esi
call   10d0 <CalculateProduct@plt>
mov    %rax,-0x80(%rbp)
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    1355 <main+0x1a5>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
add    -0x68(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x80(%rbp),%rax
cmp    -0x78(%rbp),%rax
jbe    136b <main+0x1bb>
mov    -0x80(%rbp),%rax
mov    %rax,-0x78(%rbp)
jmp    12ec <main+0x13c>
mov    -0x78(%rbp),%rsi
lea    0xcc1(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x20(%rbp)
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    $0xfa0,%edi
call   1090 <malloc@plt>
mov    %rax,%r13
mov    $0x34,%edi
call   1090 <malloc@plt>
mov    %rax,%r14
lea    0xe31(%rip),%rdi
lea    0xe45(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     147b <main+0x2cb>
mov    %rax,%r15
mov    %rsp,%rdi
mov    $0x33,%esi
mov    %rax,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     13e0 <main+0x230>
xor    %ebx,%ebx
mov    %rsp,%r12
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r12,%rdi
call   1050 <strlen@plt>
cmp    $0x2,%eax
jl     13e0 <main+0x230>
movslq %ebx,%rbx
punpcklbw (%rsp),%xmm0
punpcklwd %xmm0,%xmm0
psrad  $0x18,%xmm0
movdqa 0xdb6(%rip),%xmm1
paddd  %xmm1,%xmm0
movdqu %xmm0,0x0(%r13,%rbx,4)
movd   0x4(%rsp),%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
psrad  $0x18,%xmm0
paddd  %xmm1,%xmm0
movdqu %xmm0,0x10(%r13,%rbx,4)
movq   0x8(%rsp),%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
psrad  $0x18,%xmm0
paddd  %xmm1,%xmm0
movdqu %xmm0,0x20(%r13,%rbx,4)
movd   0xc(%rsp),%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
psrad  $0x18,%xmm0
paddd  %xmm1,%xmm0
movdqu %xmm0,0x30(%r13,%rbx,4)
punpcklbw 0x10(%rsp),%xmm0
punpcklwd %xmm0,%xmm0
psrad  $0x18,%xmm0
paddd  %xmm1,%xmm0
movdqu %xmm0,0x40(%r13,%rbx,4)
movd   0x14(%rsp),%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
psrad  $0x18,%xmm0
paddd  %xmm1,%xmm0
movdqu %xmm0,0x50(%r13,%rbx,4)
movq   0x18(%rsp),%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
psrad  $0x18,%xmm0
paddd  %xmm1,%xmm0
movdqu %xmm0,0x60(%r13,%rbx,4)
movd   0x1c(%rsp),%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
psrad  $0x18,%xmm0
paddd  %xmm1,%xmm0
movdqu %xmm0,0x70(%r13,%rbx,4)
punpcklbw 0x20(%rsp),%xmm0
punpcklwd %xmm0,%xmm0
psrad  $0x18,%xmm0
paddd  %xmm1,%xmm0
movdqu %xmm0,0x80(%r13,%rbx,4)
movd   0x24(%rsp),%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
psrad  $0x18,%xmm0
paddd  %xmm1,%xmm0
movdqu %xmm0,0x90(%r13,%rbx,4)
movq   0x28(%rsp),%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
psrad  $0x18,%xmm0
paddd  %xmm1,%xmm0
movdqu %xmm0,0xa0(%r13,%rbx,4)
movd   0x2c(%rsp),%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
psrad  $0x18,%xmm0
paddd  %xmm1,%xmm0
movdqu %xmm0,0xb0(%r13,%rbx,4)
movsbl 0x30(%rsp),%eax
add    $0xffffffd0,%eax
mov    %eax,0xc0(%r13,%rbx,4)
movsbl 0x31(%rsp),%eax
add    $0xffffffd0,%eax
mov    %eax,0xc4(%r13,%rbx,4)
add    $0x32,%rbx
mov    %r12,%rdi
mov    $0x33,%esi
mov    %r15,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
jne    1220 <main+0x70>
xor    %ebp,%ebp
xor    %ebx,%ebx
xor    %r12d,%r12d
jmp    1407 <main+0x257>
nopl   0x0(%rax)
add    %eax,%r12d
add    $0x1,%r12d
cmp    %rbx,%rbp
cmova  %rbp,%rbx
cmp    $0x3db,%r12d
jge    1441 <main+0x291>
mov    %r14,%rdi
mov    %r13,%rsi
mov    %r12d,%edx
mov    $0xd,%ecx
call   10a0 <CopySubstring@plt>
mov    %r14,%rdi
mov    $0xd,%esi
call   1060 <CheckForZero@plt>
test   %eax,%eax
jns    13f0 <main+0x240>
mov    %r14,%rdi
mov    $0xd,%esi
call   10d0 <CalculateProduct@plt>
mov    %rax,%rbp
add    $0x1,%r12d
jmp    13f7 <main+0x247>
lea    0xc04(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r15,%rdi
call   1040 <fclose@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %r14,%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    0xbab(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"../../../addendum/0008.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [31 x i8] c"Nay! Something went wrong! >.<\00"
@.str.3 = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [50 x i8]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64
%11 = alloca i64
store i32 0, i32* %1
store i32* null, i32** %2
%12 = call i32* @malloc(i32 4000)
store i32* %12, i32** %3
%13 = call i32* @malloc(i32 52)
store i32* %13, i32** %4
store i32 0, i32* %6
store i32 0, i32* %7
store i32 -1, i32* %8
store i32 0, i32* %9
store i64 0, i64* %10
store i64 0, i64* %11
%14 = call i32* @fopen(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %14, i32** %2
%15 = load i32*, i32** %2
%16 = icmp eq i32* %15, null
br i1 %16, label %17, label %20
17: ; preds = %0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %0
br label %21
21: ; preds = %51, %20
%22 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%23 = load i32*, i32** %2
%24 = call i32* @fgets(i8* %22, i32 51, i32* %23)
%25 = icmp ne i32* %24, null
br i1 %25, label %26, label %30
26: ; preds = %21
%27 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%28 = call i32 @strlen(i8* %27)
%29 = icmp sgt i32 %28, 1
br label %30
30: ; preds = %26, %21
%31 = phi i1 [ false, %21 ], [ %29, %26 ]
br i1 %31, label %32, label %52
32: ; preds = %30
store i32 0, i32* %6
br label %33
33: ; preds = %48, %32
%34 = load i32, i32* %6
%35 = icmp slt i32 %34, 50
br i1 %35, label %36, label %51
36: ; preds = %33
%37 = load i32, i32* %6
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 %38
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = sub nsw i32 %41, 48
%43 = load i32*, i32** %3
%44 = load i32, i32* %7
%45 = add nsw i32 %44, 1
store i32 %45, i32* %7
%46 = sext i32 %44 to i64
%47 = getelementptr inbounds i32, i32* %43, i64 %46
store i32 %42, i32* %47
br label %48
48: ; preds = %36
%49 = load i32, i32* %6
%50 = add nsw i32 %49, 1
store i32 %50, i32* %6
br label %33
51: ; preds = %33
br label %21
52: ; preds = %30
store i32 0, i32* %7
br label %53
53: ; preds = %81, %52
%54 = load i32, i32* %7
%55 = icmp slt i32 %54, 987
br i1 %55, label %56, label %82
56: ; preds = %53
%57 = load i32*, i32** %4
%58 = load i32*, i32** %3
%59 = load i32, i32* %7
%60 = call i32 @CopySubstring(i32* %57, i32* %58, i32 %59, i32 13)
%61 = load i32*, i32** %4
%62 = call i32 @CheckForZero(i32* %61, i32 13)
store i32 %62, i32* %8
%63 = load i32, i32* %8
%64 = icmp slt i32 %63, 0
br i1 %64, label %65, label %70
65: ; preds = %56
%66 = load i32*, i32** %4
%67 = call i64 @CalculateProduct(i32* %66, i32 13)
store i64 %67, i64* %11
%68 = load i32, i32* %7
%69 = add nsw i32 %68, 1
store i32 %69, i32* %7
br label %75
70: ; preds = %56
%71 = load i32, i32* %8
%72 = add nsw i32 %71, 1
%73 = load i32, i32* %7
%74 = add nsw i32 %73, %72
store i32 %74, i32* %7
br label %75
75: ; preds = %70, %65
%76 = load i64, i64* %11
%77 = load i64, i64* %10
%78 = icmp ugt i64 %76, %77
br i1 %78, label %79, label %81
79: ; preds = %75
%80 = load i64, i64* %11
store i64 %80, i64* %10
br label %81
81: ; preds = %79, %75
br label %53
82: ; preds = %53
%83 = load i64, i64* %10
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i64 %83)
%85 = load i32*, i32** %2
%86 = call i32 @fclose(i32* %85)
%87 = load i32*, i32** %3
%88 = call i32 @free(i32* %87)
store i32* null, i32** %3
%89 = load i32*, i32** %4
%90 = call i32 @free(i32* %89)
store i32* null, i32** %4
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"../../../addendum/0008.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [31 x i8] c"Nay! Something went wrong! >.<\00"
@.str.3 = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = tail call i32* @malloc(i32 4000)
%3 = tail call i32* @malloc(i32 52)
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32* %5, null
br i1 %6, label %37, label %7
7: ; preds = %0
%8 = call i32* @fgets(i8* %4, i32 51, i32* %5)
%9 = icmp eq i32* %8, null
br i1 %9, label %36, label %10
10: ; preds = %7
%11 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 48
%12 = bitcast [50 x i8]* %1 to <4 x i8>*
%13 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 4
%14 = bitcast i8* %13 to <4 x i8>*
%15 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 8
%16 = bitcast i8* %15 to <4 x i8>*
%17 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 12
%18 = bitcast i8* %17 to <4 x i8>*
%19 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 16
%20 = bitcast i8* %19 to <4 x i8>*
%21 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 20
%22 = bitcast i8* %21 to <4 x i8>*
%23 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 24
%24 = bitcast i8* %23 to <4 x i8>*
%25 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 28
%26 = bitcast i8* %25 to <4 x i8>*
%27 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 32
%28 = bitcast i8* %27 to <4 x i8>*
%29 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 36
%30 = bitcast i8* %29 to <4 x i8>*
%31 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 40
%32 = bitcast i8* %31 to <4 x i8>*
%33 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 44
%34 = bitcast i8* %33 to <4 x i8>*
%35 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 49
br label %40
36: ; preds = %40, %44, %7
br label %131
37: ; preds = %0
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%39 = tail call i32 @exit(i32 1)
unreachable
40: ; preds = %10, %44
%41 = phi i64 [ %127, %44 ], [ 0, %10 ]
%42 = call i32 @strlen(i8* %4)
%43 = icmp sgt i32 %42, 1
br i1 %43, label %44, label %36
44: ; preds = %40
%45 = shl i64 %41, 32
%46 = ashr exact i64 %45, 32
%47 = add nsw i64 %46, 48
%48 = load <4 x i8>, <4 x i8>* %12
%49 = sext <4 x i8> %48 to <4 x i32>
%50 = add nsw <4 x i32> %49, <i32 -48, i32 -48, i32 -48, i32 -48>
%51 = getelementptr inbounds i32, i32* %2, i64 %46
%52 = bitcast i32* %51 to <4 x i32>*
store <4 x i32> %50, <4 x i32>* %52
%53 = add nsw i64 %46, 4
%54 = load <4 x i8>, <4 x i8>* %14
%55 = sext <4 x i8> %54 to <4 x i32>
%56 = add nsw <4 x i32> %55, <i32 -48, i32 -48, i32 -48, i32 -48>
%57 = getelementptr inbounds i32, i32* %2, i64 %53
%58 = bitcast i32* %57 to <4 x i32>*
store <4 x i32> %56, <4 x i32>* %58
%59 = add nsw i64 %46, 8
%60 = load <4 x i8>, <4 x i8>* %16
%61 = sext <4 x i8> %60 to <4 x i32>
%62 = add nsw <4 x i32> %61, <i32 -48, i32 -48, i32 -48, i32 -48>
%63 = getelementptr inbounds i32, i32* %2, i64 %59
%64 = bitcast i32* %63 to <4 x i32>*
store <4 x i32> %62, <4 x i32>* %64
%65 = add nsw i64 %46, 12
%66 = load <4 x i8>, <4 x i8>* %18
%67 = sext <4 x i8> %66 to <4 x i32>
%68 = add nsw <4 x i32> %67, <i32 -48, i32 -48, i32 -48, i32 -48>
%69 = getelementptr inbounds i32, i32* %2, i64 %65
%70 = bitcast i32* %69 to <4 x i32>*
store <4 x i32> %68, <4 x i32>* %70
%71 = add nsw i64 %46, 16
%72 = load <4 x i8>, <4 x i8>* %20
%73 = sext <4 x i8> %72 to <4 x i32>
%74 = add nsw <4 x i32> %73, <i32 -48, i32 -48, i32 -48, i32 -48>
%75 = getelementptr inbounds i32, i32* %2, i64 %71
%76 = bitcast i32* %75 to <4 x i32>*
store <4 x i32> %74, <4 x i32>* %76
%77 = add nsw i64 %46, 20
%78 = load <4 x i8>, <4 x i8>* %22
%79 = sext <4 x i8> %78 to <4 x i32>
%80 = add nsw <4 x i32> %79, <i32 -48, i32 -48, i32 -48, i32 -48>
%81 = getelementptr inbounds i32, i32* %2, i64 %77
%82 = bitcast i32* %81 to <4 x i32>*
store <4 x i32> %80, <4 x i32>* %82
%83 = add nsw i64 %46, 24
%84 = load <4 x i8>, <4 x i8>* %24
%85 = sext <4 x i8> %84 to <4 x i32>
%86 = add nsw <4 x i32> %85, <i32 -48, i32 -48, i32 -48, i32 -48>
%87 = getelementptr inbounds i32, i32* %2, i64 %83
%88 = bitcast i32* %87 to <4 x i32>*
store <4 x i32> %86, <4 x i32>* %88
%89 = add nsw i64 %46, 28
%90 = load <4 x i8>, <4 x i8>* %26
%91 = sext <4 x i8> %90 to <4 x i32>
%92 = add nsw <4 x i32> %91, <i32 -48, i32 -48, i32 -48, i32 -48>
%93 = getelementptr inbounds i32, i32* %2, i64 %89
%94 = bitcast i32* %93 to <4 x i32>*
store <4 x i32> %92, <4 x i32>* %94
%95 = add nsw i64 %46, 32
%96 = load <4 x i8>, <4 x i8>* %28
%97 = sext <4 x i8> %96 to <4 x i32>
%98 = add nsw <4 x i32> %97, <i32 -48, i32 -48, i32 -48, i32 -48>
%99 = getelementptr inbounds i32, i32* %2, i64 %95
%100 = bitcast i32* %99 to <4 x i32>*
store <4 x i32> %98, <4 x i32>* %100
%101 = add nsw i64 %46, 36
%102 = load <4 x i8>, <4 x i8>* %30
%103 = sext <4 x i8> %102 to <4 x i32>
%104 = add nsw <4 x i32> %103, <i32 -48, i32 -48, i32 -48, i32 -48>
%105 = getelementptr inbounds i32, i32* %2, i64 %101
%106 = bitcast i32* %105 to <4 x i32>*
store <4 x i32> %104, <4 x i32>* %106
%107 = add nsw i64 %46, 40
%108 = load <4 x i8>, <4 x i8>* %32
%109 = sext <4 x i8> %108 to <4 x i32>
%110 = add nsw <4 x i32> %109, <i32 -48, i32 -48, i32 -48, i32 -48>
%111 = getelementptr inbounds i32, i32* %2, i64 %107
%112 = bitcast i32* %111 to <4 x i32>*
store <4 x i32> %110, <4 x i32>* %112
%113 = add nsw i64 %46, 44
%114 = load <4 x i8>, <4 x i8>* %34
%115 = sext <4 x i8> %114 to <4 x i32>
%116 = add nsw <4 x i32> %115, <i32 -48, i32 -48, i32 -48, i32 -48>
%117 = getelementptr inbounds i32, i32* %2, i64 %113
%118 = bitcast i32* %117 to <4 x i32>*
store <4 x i32> %116, <4 x i32>* %118
%119 = load i8, i8* %11
%120 = sext i8 %119 to i32
%121 = add nsw i32 %120, -48
%122 = add nsw i64 %46, 49
%123 = getelementptr inbounds i32, i32* %2, i64 %47
store i32 %121, i32* %123
%124 = load i8, i8* %35
%125 = sext i8 %124 to i32
%126 = add nsw i32 %125, -48
%127 = add nsw i64 %46, 50
%128 = getelementptr inbounds i32, i32* %2, i64 %122
store i32 %126, i32* %128
%129 = call i32* @fgets(i8* %4, i32 51, i32* %5)
%130 = icmp eq i32* %129, null
br i1 %130, label %36, label %40
131: ; preds = %36, %144
%132 = phi i64 [ %146, %144 ], [ 0, %36 ]
%133 = phi i64 [ %148, %144 ], [ 0, %36 ]
%134 = phi i32 [ %145, %144 ], [ 0, %36 ]
%135 = call i32 @CopySubstring(i32* %3, i32* %2, i32 %134, i32 13)
%136 = call i32 @CheckForZero(i32* %3, i32 13)
%137 = icmp slt i32 %136, 0
br i1 %137, label %138, label %141
138: ; preds = %131
%139 = call i64 @CalculateProduct(i32* %3, i32 13)
%140 = add nsw i32 %134, 1
br label %144
141: ; preds = %131
%142 = add nsw i32 %134, 1
%143 = add i32 %142, %136
br label %144
144: ; preds = %141, %138
%145 = phi i32 [ %140, %138 ], [ %143, %141 ]
%146 = phi i64 [ %139, %138 ], [ %132, %141 ]
%147 = icmp ugt i64 %146, %133
%148 = select i1 %147, i64 %146, i64 %133
%149 = icmp slt i32 %145, 987
br i1 %149, label %131, label %150
150: ; preds = %144
%151 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i64 %148)
%152 = call i32 @fclose(i32* %5)
%153 = call i32 @free(i32* %2)
%154 = call i32 @free(i32* %3)
ret i32 0
}