#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 *DynamicArrayAppend(int *, int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ printf(char *, ...);
int strlen(char *);
int main(void) {
  FILE *fp_aux = NULL;
  int *ptr_sum = NULL;
  int input_ary[100][50], digit = 0, num = 0, val = 0, i = 0, j = 0, size = 0,
                          remainder = 0;
  unsigned int col_sum = 0;
  char buffer[50 + 1];
  fp_aux = fopen("../../../addendum/0013.txt", "r");
  if (fp_aux == NULL) {
    printf("Nay!\n");
    return 1;
  } else {
    while (fgets(buffer, 50 + 2, fp_aux) != NULL && strlen(buffer) > 1) {
      buffer[50] = '\0';
      for (digit = 0; digit < 50; digit++) {
        input_ary[num][digit] = buffer[digit] - '0';
      }
      num++;
    }
  }
  for (i = 50; i > 0; i--) {
    for (j = 0; j < 100; j++) {
      col_sum += input_ary[j][i - 1];
    }
    size++;
    ptr_sum = DynamicArrayAppend(ptr_sum, size);
    ptr_sum[size - 1] = col_sum % 10;
    col_sum /= 10;
  }
  remainder = col_sum;
  while (remainder != 0) {
    size++;
    ptr_sum = DynamicArrayAppend(ptr_sum, size);
    ptr_sum[size - 1] = remainder % 10;
    remainder /= 10;
  }
  for (i = size; i > 0; i--) {
    printf("%d", ptr_sum[i - 1]);
  }
  fclose(fp_aux);
  free(ptr_sum);
  ptr_sum = NULL;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4eb0,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x4e44(%rbp)
movl   $0x0,-0x4e48(%rbp)
movl   $0x0,-0x4e4c(%rbp)
movl   $0x0,-0x4e50(%rbp)
movl   $0x0,-0x4e54(%rbp)
movl   $0x0,-0x4e58(%rbp)
movl   $0x0,-0x4e5c(%rbp)
movl   $0x0,-0x4e60(%rbp)
lea    0xe17(%rip),%rdi
lea    0xe2b(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    121e <main+0xae>
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14bd <main+0x34d>
jmp    1223 <main+0xb3>
lea    -0x4ea0(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x34,%esi
call   1070 <fgets@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x4ea1(%rbp)
je     1265 <main+0xf5>
lea    -0x4ea0(%rbp),%rdi
call   1050 <strlen@plt>
cmp    $0x1,%eax
setg   %al
mov    %al,-0x4ea1(%rbp)
mov    -0x4ea1(%rbp),%al
test   $0x1,%al
jne    1278 <main+0x108>
jmp    12f2 <main+0x182>
movb   $0x0,-0x4e6e(%rbp)
movl   $0x0,-0x4e44(%rbp)
cmpl   $0x32,-0x4e44(%rbp)
jge    12de <main+0x16e>
movslq -0x4e44(%rbp),%rax
movsbl -0x4ea0(%rbp,%rax,1),%edx
ff
sub    $0x30,%edx
movslq -0x4e48(%rbp),%rcx
lea    -0x4e40(%rbp),%rax
imul   $0xc8,%rcx,%rcx
add    %rcx,%rax
movslq -0x4e44(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x4e44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4e44(%rbp)
jmp    1289 <main+0x119>
mov    -0x4e48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4e48(%rbp)
jmp    1223 <main+0xb3>
jmp    12f7 <main+0x187>
movl   $0x32,-0x4e50(%rbp)
cmpl   $0x0,-0x4e50(%rbp)
jle    13d9 <main+0x269>
movl   $0x0,-0x4e54(%rbp)
cmpl   $0x64,-0x4e54(%rbp)
jge    136c <main+0x1fc>
movslq -0x4e54(%rbp),%rcx
lea    -0x4e40(%rbp),%rax
imul   $0xc8,%rcx,%rcx
add    %rcx,%rax
mov    -0x4e50(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
add    -0x4e60(%rbp),%eax
mov    %eax,-0x4e60(%rbp)
mov    -0x4e54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4e54(%rbp)
jmp    1318 <main+0x1a8>
mov    -0x4e58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4e58(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x4e58(%rbp),%esi
call   1080 <DynamicArrayAppend@plt>
mov    %rax,-0x18(%rbp)
mov    -0x4e60(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    -0x18(%rbp),%rax
mov    -0x4e58(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x4e60(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x4e60(%rbp)
mov    -0x4e50(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4e50(%rbp)
jmp    1301 <main+0x191>
mov    -0x4e60(%rbp),%eax
mov    %eax,-0x4e5c(%rbp)
cmpl   $0x0,-0x4e5c(%rbp)
je     144e <main+0x2de>
mov    -0x4e58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4e58(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x4e58(%rbp),%esi
call   1080 <DynamicArrayAppend@plt>
mov    %rax,-0x18(%rbp)
mov    -0x4e5c(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%rax
mov    -0x4e58(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x4e5c(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4e5c(%rbp)
jmp    13e5 <main+0x275>
mov    -0x4e58(%rbp),%eax
mov    %eax,-0x4e50(%rbp)
cmpl   $0x0,-0x4e50(%rbp)
jle    149c <main+0x32c>
mov    -0x18(%rbp),%rax
mov    -0x4e50(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xba2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x4e50(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4e50(%rbp)
jmp    145a <main+0x2ea>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x4eb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x4e78,%rsp
lea    0xe78(%rip),%rdi
lea    0xe8c(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1458 <main+0x2d8>
mov    %rax,%rbp
lea    0x10(%rsp),%rdi
mov    $0x34,%esi
mov    %rax,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     1386 <main+0x206>
lea    0x114(%rsp),%rbx
lea    0x10(%rsp),%r15
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1060 <strlen@plt>
cmp    $0x2,%eax
jl     1386 <main+0x206>
movb   $0x0,0x42(%rsp)
punpcklbw 0x10(%rsp),%xmm0
punpcklwd %xmm0,%xmm0
psrad  $0x18,%xmm0
movdqa 0xdf3(%rip),%xmm1
paddd  %xmm1,%xmm0
movdqu %xmm0,-0xc4(%rbx)
ff
movd   0x14(%rsp),%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
psrad  $0x18,%xmm0
paddd  %xmm1,%xmm0
movdqu %xmm0,-0xb4(%rbx)
ff
movq   0x18(%rsp),%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
psrad  $0x18,%xmm0
paddd  %xmm1,%xmm0
movdqu %xmm0,-0xa4(%rbx)
ff
movd   0x1c(%rsp),%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
psrad  $0x18,%xmm0
paddd  %xmm1,%xmm0
movdqu %xmm0,-0x94(%rbx)
ff
punpcklbw 0x20(%rsp),%xmm0
punpcklwd %xmm0,%xmm0
psrad  $0x18,%xmm0
paddd  %xmm1,%xmm0
movdqu %xmm0,-0x84(%rbx)
ff
movd   0x24(%rsp),%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
psrad  $0x18,%xmm0
paddd  %xmm1,%xmm0
movdqu %xmm0,-0x74(%rbx)
movq   0x28(%rsp),%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
psrad  $0x18,%xmm0
paddd  %xmm1,%xmm0
movdqu %xmm0,-0x64(%rbx)
movd   0x2c(%rsp),%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
psrad  $0x18,%xmm0
paddd  %xmm1,%xmm0
movdqu %xmm0,-0x54(%rbx)
punpcklbw 0x30(%rsp),%xmm0
punpcklwd %xmm0,%xmm0
psrad  $0x18,%xmm0
paddd  %xmm1,%xmm0
movdqu %xmm0,-0x44(%rbx)
movd   0x34(%rsp),%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
psrad  $0x18,%xmm0
paddd  %xmm1,%xmm0
movdqu %xmm0,-0x34(%rbx)
movq   0x38(%rsp),%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
psrad  $0x18,%xmm0
paddd  %xmm1,%xmm0
movdqu %xmm0,-0x24(%rbx)
movd   0x3c(%rsp),%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
psrad  $0x18,%xmm0
paddd  %xmm1,%xmm0
movdqu %xmm0,-0x14(%rbx)
movsbl 0x40(%rsp),%eax
add    $0xffffffd0,%eax
mov    %eax,-0x4(%rbx)
movsbl 0x41(%rsp),%eax
add    $0xffffffd0,%eax
mov    %eax,(%rbx)
mov    %r15,%rdi
mov    $0x34,%esi
mov    %rbp,%rdx
call   1080 <fgets@plt>
add    $0xc8,%rbx
test   %rax,%rax
jne    11e0 <main+0x60>
mov    %rbp,0x8(%rsp)
xor    %r14d,%r14d
lea    0x50(%rsp),%rbx
xor    %r13d,%r13d
xor    %r12d,%r12d
nopl   0x0(%rax)
movd   %r13d,%xmm0
mov    $0x31c,%eax
nopw   0x0(%rax,%rax,1)
movd   (%rbx,%rax,1),%xmm1
movd   -0xc8(%rbx,%rax,1),%xmm2
ff ff
punpckldq %xmm1,%xmm2
movd   -0x190(%rbx,%rax,1),%xmm1
ff ff
movd   -0x258(%rbx,%rax,1),%xmm3
ff ff
punpckldq %xmm1,%xmm3
punpcklqdq %xmm2,%xmm3
paddd  %xmm3,%xmm0
add    $0x320,%rax
cmp    $0x513c,%rax
jne    13b0 <main+0x230>
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%ebp
lea    0x1(%r14),%r15
mov    %r12,%rdi
mov    %r15d,%esi
call   1090 <DynamicArrayAppend@plt>
mov    %rax,%r12
mov    %rbp,%r13
mov    $0xcccccccd,%eax
imul   %rax,%r13
shr    $0x23,%r13
lea    0x0(%r13,%r13,1),%eax
lea    (%rax,%rax,4),%eax
mov    %ebp,%ecx
sub    %eax,%ecx
mov    %ecx,(%r12,%r14,4)
add    $0xfffffffffffffffc,%rbx
mov    %r15,%r14
cmp    $0x32,%r15
jne    13a0 <main+0x220>
mov    $0x32,%eax
cmp    $0xa,%ebp
jae    146e <main+0x2ee>
mov    0x8(%rsp),%r14
jmp    14c8 <main+0x348>
lea    0xbd1(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%eax
jmp    150b <main+0x38b>
mov    $0x32,%r15d
mov    0x8(%rsp),%r14
nopl   0x0(%rax)
mov    %r15,%rbx
add    $0x1,%r15
mov    %r12,%rdi
mov    %r15d,%esi
call   1090 <DynamicArrayAppend@plt>
mov    %rax,%r12
movslq %r13d,%rax
imul   $0x66666667,%rax,%r13
mov    %r13,%rcx
shr    $0x3f,%rcx
sar    $0x22,%r13
add    %ecx,%r13d
lea    0x0(%r13,%r13,1),%ecx
lea    (%rcx,%rcx,4),%ecx
mov    %eax,%edx
sub    %ecx,%edx
mov    %edx,(%r12,%rbx,4)
add    $0x9,%eax
cmp    $0x13,%eax
jae    1480 <main+0x300>
mov    %r15d,%eax
lea    0x1(%rax),%ebx
add    $0xffffffff,%eax
lea    (%r12,%rax,4),%rbp
lea    0xb54(%rip),%r15
nopl   0x0(%rax)
mov    0x0(%rbp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
add    $0xffffffff,%ebx
add    $0xfffffffffffffffc,%rbp
cmp    $0x1,%ebx
jg     14e0 <main+0x360>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %r12,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x4e78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"../../../addendum/0013.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [6 x i8] c"Nay!\0A\00"
@.str.3 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca [100 x [50 x i32]]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca [51 x i8]
store i32 0, i32* %1
store i32* null, i32** %2
store i32* null, i32** %3
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
%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 %19
17: ; preds = %0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %1
br label %137
19: ; preds = %0
br label %20
20: ; preds = %52, %19
%21 = getelementptr inbounds [51 x i8], [51 x i8]* %13, i64 0, i64 0
%22 = load i32*, i32** %2
%23 = call i32* @fgets(i8* %21, i32 52, i32* %22)
%24 = icmp ne i32* %23, null
br i1 %24, label %25, label %29
25: ; preds = %20
%26 = getelementptr inbounds [51 x i8], [51 x i8]* %13, i64 0, i64 0
%27 = call i32 @strlen(i8* %26)
%28 = icmp sgt i32 %27, 1
br label %29
29: ; preds = %25, %20
%30 = phi i1 [ false, %20 ], [ %28, %25 ]
br i1 %30, label %31, label %55
31: ; preds = %29
%32 = getelementptr inbounds [51 x i8], [51 x i8]* %13, i64 0, i64 50
store i8 0, i8* %32
store i32 0, i32* %5
br label %33
33: ; preds = %49, %31
%34 = load i32, i32* %5
%35 = icmp slt i32 %34, 50
br i1 %35, label %36, label %52
36: ; preds = %33
%37 = load i32, i32* %5
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [51 x i8], [51 x i8]* %13, 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* %6
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [100 x [50 x i32]], [100 x [50 x i32]]* %4, i64 0, i64 %44
%46 = load i32, i32* %5
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [50 x i32], [50 x i32]* %45, i64 0, i64 %47
store i32 %42, i32* %48
br label %49
49: ; preds = %36
%50 = load i32, i32* %5
%51 = add nsw i32 %50, 1
store i32 %51, i32* %5
br label %33
52: ; preds = %33
%53 = load i32, i32* %6
%54 = add nsw i32 %53, 1
store i32 %54, i32* %6
br label %20
55: ; preds = %29
br label %56
56: ; preds = %55
store i32 50, i32* %8
br label %57
57: ; preds = %93, %56
%58 = load i32, i32* %8
%59 = icmp sgt i32 %58, 0
br i1 %59, label %60, label %96
60: ; preds = %57
store i32 0, i32* %9
br label %61
61: ; preds = %75, %60
%62 = load i32, i32* %9
%63 = icmp slt i32 %62, 100
br i1 %63, label %64, label %78
64: ; preds = %61
%65 = load i32, i32* %9
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [100 x [50 x i32]], [100 x [50 x i32]]* %4, i64 0, i64 %66
%68 = load i32, i32* %8
%69 = sub nsw i32 %68, 1
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [50 x i32], [50 x i32]* %67, i64 0, i64 %70
%72 = load i32, i32* %71
%73 = load i32, i32* %12
%74 = add i32 %73, %72
store i32 %74, i32* %12
br label %75
75: ; preds = %64
%76 = load i32, i32* %9
%77 = add nsw i32 %76, 1
store i32 %77, i32* %9
br label %61
78: ; preds = %61
%79 = load i32, i32* %10
%80 = add nsw i32 %79, 1
store i32 %80, i32* %10
%81 = load i32*, i32** %3
%82 = load i32, i32* %10
%83 = call i32* @DynamicArrayAppend(i32* %81, i32 %82)
store i32* %83, i32** %3
%84 = load i32, i32* %12
%85 = urem i32 %84, 10
%86 = load i32*, i32** %3
%87 = load i32, i32* %10
%88 = sub nsw i32 %87, 1
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds i32, i32* %86, i64 %89
store i32 %85, i32* %90
%91 = load i32, i32* %12
%92 = udiv i32 %91, 10
store i32 %92, i32* %12
br label %93
93: ; preds = %78
%94 = load i32, i32* %8
%95 = add nsw i32 %94, -1
store i32 %95, i32* %8
br label %57
96: ; preds = %57
%97 = load i32, i32* %12
store i32 %97, i32* %11
br label %98
98: ; preds = %101, %96
%99 = load i32, i32* %11
%100 = icmp ne i32 %99, 0
br i1 %100, label %101, label %116
101: ; preds = %98
%102 = load i32, i32* %10
%103 = add nsw i32 %102, 1
store i32 %103, i32* %10
%104 = load i32*, i32** %3
%105 = load i32, i32* %10
%106 = call i32* @DynamicArrayAppend(i32* %104, i32 %105)
store i32* %106, i32** %3
%107 = load i32, i32* %11
%108 = srem i32 %107, 10
%109 = load i32*, i32** %3
%110 = load i32, i32* %10
%111 = sub nsw i32 %110, 1
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds i32, i32* %109, i64 %112
store i32 %108, i32* %113
%114 = load i32, i32* %11
%115 = sdiv i32 %114, 10
store i32 %115, i32* %11
br label %98
116: ; preds = %98
%117 = load i32, i32* %10
store i32 %117, i32* %8
br label %118
118: ; preds = %129, %116
%119 = load i32, i32* %8
%120 = icmp sgt i32 %119, 0
br i1 %120, label %121, label %132
121: ; preds = %118
%122 = load i32*, i32** %3
%123 = load i32, i32* %8
%124 = sub nsw i32 %123, 1
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds i32, i32* %122, i64 %125
%127 = load i32, i32* %126
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %127)
br label %129
129: ; preds = %121
%130 = load i32, i32* %8
%131 = add nsw i32 %130, -1
store i32 %131, i32* %8
br label %118
132: ; preds = %118
%133 = load i32*, i32** %2
%134 = call i32 @fclose(i32* %133)
%135 = load i32*, i32** %3
%136 = call i32 @free(i32* %135)
store i32* null, i32** %3
store i32 0, i32* %1
br label %137
137: ; preds = %132, %17
%138 = load i32, i32* %1
ret i32 %138
}

LLVM IR (-O2):
@.str = [27 x i8] c"../../../addendum/0013.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.3 = [3 x i8] c"%d\00"
@str = [5 x i8] c"Nay!\00"
define i32 @main() {
%1 = alloca [100 x [50 x i32]]
%2 = alloca [51 x i8]
%3 = bitcast [100 x [50 x i32]]* %1 to i8*
%4 = getelementptr inbounds [51 x i8], [51 x i8]* %2, 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 52, i32* %5)
%9 = icmp eq i32* %8, null
br i1 %9, label %115, label %10
10: ; preds = %7
%11 = getelementptr inbounds [51 x i8], [51 x i8]* %2, i64 0, i64 50
%12 = getelementptr inbounds [51 x i8], [51 x i8]* %2, i64 0, i64 48
%13 = bitcast [51 x i8]* %2 to <4 x i8>*
%14 = getelementptr inbounds [51 x i8], [51 x i8]* %2, i64 0, i64 4
%15 = bitcast i8* %14 to <4 x i8>*
%16 = getelementptr inbounds [51 x i8], [51 x i8]* %2, i64 0, i64 8
%17 = bitcast i8* %16 to <4 x i8>*
%18 = getelementptr inbounds [51 x i8], [51 x i8]* %2, i64 0, i64 12
%19 = bitcast i8* %18 to <4 x i8>*
%20 = getelementptr inbounds [51 x i8], [51 x i8]* %2, i64 0, i64 16
%21 = bitcast i8* %20 to <4 x i8>*
%22 = getelementptr inbounds [51 x i8], [51 x i8]* %2, i64 0, i64 20
%23 = bitcast i8* %22 to <4 x i8>*
%24 = getelementptr inbounds [51 x i8], [51 x i8]* %2, i64 0, i64 24
%25 = bitcast i8* %24 to <4 x i8>*
%26 = getelementptr inbounds [51 x i8], [51 x i8]* %2, i64 0, i64 28
%27 = bitcast i8* %26 to <4 x i8>*
%28 = getelementptr inbounds [51 x i8], [51 x i8]* %2, i64 0, i64 32
%29 = bitcast i8* %28 to <4 x i8>*
%30 = getelementptr inbounds [51 x i8], [51 x i8]* %2, i64 0, i64 36
%31 = bitcast i8* %30 to <4 x i8>*
%32 = getelementptr inbounds [51 x i8], [51 x i8]* %2, i64 0, i64 40
%33 = bitcast i8* %32 to <4 x i8>*
%34 = getelementptr inbounds [51 x i8], [51 x i8]* %2, i64 0, i64 44
%35 = bitcast i8* %34 to <4 x i8>*
%36 = getelementptr inbounds [51 x i8], [51 x i8]* %2, i64 0, i64 49
br label %39
37: ; preds = %0
%38 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
br label %184
39: ; preds = %10, %43
%40 = phi i64 [ 0, %10 ], [ %112, %43 ]
%41 = call i32 @strlen(i8* %4)
%42 = icmp sgt i32 %41, 1
br i1 %42, label %43, label %115
43: ; preds = %39
store i8 0, i8* %11
%44 = load <4 x i8>, <4 x i8>* %13
%45 = sext <4 x i8> %44 to <4 x i32>
%46 = add nsw <4 x i32> %45, <i32 -48, i32 -48, i32 -48, i32 -48>
%47 = getelementptr inbounds [100 x [50 x i32]], [100 x [50 x i32]]* %1, i64 0, i64 %40, i64 0
%48 = bitcast i32* %47 to <4 x i32>*
store <4 x i32> %46, <4 x i32>* %48
%49 = load <4 x i8>, <4 x i8>* %15
%50 = sext <4 x i8> %49 to <4 x i32>
%51 = add nsw <4 x i32> %50, <i32 -48, i32 -48, i32 -48, i32 -48>
%52 = getelementptr inbounds [100 x [50 x i32]], [100 x [50 x i32]]* %1, i64 0, i64 %40, i64 4
%53 = bitcast i32* %52 to <4 x i32>*
store <4 x i32> %51, <4 x i32>* %53
%54 = load <4 x i8>, <4 x i8>* %17
%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 [100 x [50 x i32]], [100 x [50 x i32]]* %1, i64 0, i64 %40, i64 8
%58 = bitcast i32* %57 to <4 x i32>*
store <4 x i32> %56, <4 x i32>* %58
%59 = load <4 x i8>, <4 x i8>* %19
%60 = sext <4 x i8> %59 to <4 x i32>
%61 = add nsw <4 x i32> %60, <i32 -48, i32 -48, i32 -48, i32 -48>
%62 = getelementptr inbounds [100 x [50 x i32]], [100 x [50 x i32]]* %1, i64 0, i64 %40, i64 12
%63 = bitcast i32* %62 to <4 x i32>*
store <4 x i32> %61, <4 x i32>* %63
%64 = load <4 x i8>, <4 x i8>* %21
%65 = sext <4 x i8> %64 to <4 x i32>
%66 = add nsw <4 x i32> %65, <i32 -48, i32 -48, i32 -48, i32 -48>
%67 = getelementptr inbounds [100 x [50 x i32]], [100 x [50 x i32]]* %1, i64 0, i64 %40, i64 16
%68 = bitcast i32* %67 to <4 x i32>*
store <4 x i32> %66, <4 x i32>* %68
%69 = load <4 x i8>, <4 x i8>* %23
%70 = sext <4 x i8> %69 to <4 x i32>
%71 = add nsw <4 x i32> %70, <i32 -48, i32 -48, i32 -48, i32 -48>
%72 = getelementptr inbounds [100 x [50 x i32]], [100 x [50 x i32]]* %1, i64 0, i64 %40, i64 20
%73 = bitcast i32* %72 to <4 x i32>*
store <4 x i32> %71, <4 x i32>* %73
%74 = load <4 x i8>, <4 x i8>* %25
%75 = sext <4 x i8> %74 to <4 x i32>
%76 = add nsw <4 x i32> %75, <i32 -48, i32 -48, i32 -48, i32 -48>
%77 = getelementptr inbounds [100 x [50 x i32]], [100 x [50 x i32]]* %1, i64 0, i64 %40, i64 24
%78 = bitcast i32* %77 to <4 x i32>*
store <4 x i32> %76, <4 x i32>* %78
%79 = load <4 x i8>, <4 x i8>* %27
%80 = sext <4 x i8> %79 to <4 x i32>
%81 = add nsw <4 x i32> %80, <i32 -48, i32 -48, i32 -48, i32 -48>
%82 = getelementptr inbounds [100 x [50 x i32]], [100 x [50 x i32]]* %1, i64 0, i64 %40, i64 28
%83 = bitcast i32* %82 to <4 x i32>*
store <4 x i32> %81, <4 x i32>* %83
%84 = load <4 x i8>, <4 x i8>* %29
%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 [100 x [50 x i32]], [100 x [50 x i32]]* %1, i64 0, i64 %40, i64 32
%88 = bitcast i32* %87 to <4 x i32>*
store <4 x i32> %86, <4 x i32>* %88
%89 = load <4 x i8>, <4 x i8>* %31
%90 = sext <4 x i8> %89 to <4 x i32>
%91 = add nsw <4 x i32> %90, <i32 -48, i32 -48, i32 -48, i32 -48>
%92 = getelementptr inbounds [100 x [50 x i32]], [100 x [50 x i32]]* %1, i64 0, i64 %40, i64 36
%93 = bitcast i32* %92 to <4 x i32>*
store <4 x i32> %91, <4 x i32>* %93
%94 = load <4 x i8>, <4 x i8>* %33
%95 = sext <4 x i8> %94 to <4 x i32>
%96 = add nsw <4 x i32> %95, <i32 -48, i32 -48, i32 -48, i32 -48>
%97 = getelementptr inbounds [100 x [50 x i32]], [100 x [50 x i32]]* %1, i64 0, i64 %40, i64 40
%98 = bitcast i32* %97 to <4 x i32>*
store <4 x i32> %96, <4 x i32>* %98
%99 = load <4 x i8>, <4 x i8>* %35
%100 = sext <4 x i8> %99 to <4 x i32>
%101 = add nsw <4 x i32> %100, <i32 -48, i32 -48, i32 -48, i32 -48>
%102 = getelementptr inbounds [100 x [50 x i32]], [100 x [50 x i32]]* %1, i64 0, i64 %40, i64 44
%103 = bitcast i32* %102 to <4 x i32>*
store <4 x i32> %101, <4 x i32>* %103
%104 = load i8, i8* %12
%105 = sext i8 %104 to i32
%106 = add nsw i32 %105, -48
%107 = getelementptr inbounds [100 x [50 x i32]], [100 x [50 x i32]]* %1, i64 0, i64 %40, i64 48
store i32 %106, i32* %107
%108 = load i8, i8* %36
%109 = sext i8 %108 to i32
%110 = add nsw i32 %109, -48
%111 = getelementptr inbounds [100 x [50 x i32]], [100 x [50 x i32]]* %1, i64 0, i64 %40, i64 49
store i32 %110, i32* %111
%112 = add nuw i64 %40, 1
%113 = call i32* @fgets(i8* %4, i32 52, i32* %5)
%114 = icmp eq i32* %113, null
br i1 %114, label %115, label %39
115: ; preds = %43, %39, %7
br label %116
116: ; preds = %115, %144
%117 = phi i64 [ %121, %144 ], [ 50, %115 ]
%118 = phi i64 [ %146, %144 ], [ 0, %115 ]
%119 = phi i32 [ %151, %144 ], [ 0, %115 ]
%120 = phi i32* [ %148, %144 ], [ null, %115 ]
%121 = add nsw i64 %117, -1
%122 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %119, i64 0
br label %123
123: ; preds = %123, %116
%124 = phi i64 [ 0, %116 ], [ %142, %123 ]
%125 = phi <4 x i32> [ %122, %116 ], [ %141, %123 ]
%126 = or i64 %124, 1
%127 = or i64 %124, 2
%128 = or i64 %124, 3
%129 = getelementptr inbounds [100 x [50 x i32]], [100 x [50 x i32]]* %1, i64 0, i64 %124, i64 %121
%130 = getelementptr inbounds [100 x [50 x i32]], [100 x [50 x i32]]* %1, i64 0, i64 %126, i64 %121
%131 = getelementptr inbounds [100 x [50 x i32]], [100 x [50 x i32]]* %1, i64 0, i64 %127, i64 %121
%132 = getelementptr inbounds [100 x [50 x i32]], [100 x [50 x i32]]* %1, i64 0, i64 %128, i64 %121
%133 = load i32, i32* %129
%134 = load i32, i32* %130
%135 = load i32, i32* %131
%136 = load i32, i32* %132
%137 = insertelement <4 x i32> poison, i32 %133, i64 0
%138 = insertelement <4 x i32> %137, i32 %134, i64 1
%139 = insertelement <4 x i32> %138, i32 %135, i64 2
%140 = insertelement <4 x i32> %139, i32 %136, i64 3
%141 = add <4 x i32> %140, %125
%142 = add nuw i64 %124, 4
%143 = icmp eq i64 %142, 100
br i1 %143, label %144, label %123
144: ; preds = %123
%145 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %141)
%146 = add nuw nsw i64 %118, 1
%147 = trunc i64 %146 to i32
%148 = call i32* @DynamicArrayAppend(i32* %120, i32 %147)
%149 = urem i32 %145, 10
%150 = getelementptr inbounds i32, i32* %148, i64 %118
store i32 %149, i32* %150
%151 = udiv i32 %145, 10
%152 = icmp eq i64 %146, 50
br i1 %152, label %153, label %116
153: ; preds = %144
%154 = icmp ult i32 %145, 10
br i1 %154, label %157, label %160
155: ; preds = %160
%156 = and i64 %164, 4294967295
br label %157
157: ; preds = %153, %155
%158 = phi i32* [ %148, %153 ], [ %166, %155 ]
%159 = phi i64 [ 50, %153 ], [ %156, %155 ]
br label %172
160: ; preds = %153, %160
%161 = phi i64 [ %164, %160 ], [ 50, %153 ]
%162 = phi i32 [ %169, %160 ], [ %151, %153 ]
%163 = phi i32* [ %166, %160 ], [ %148, %153 ]
%164 = add nuw i64 %161, 1
%165 = trunc i64 %164 to i32
%166 = call i32* @DynamicArrayAppend(i32* %163, i32 %165)
%167 = srem i32 %162, 10
%168 = getelementptr inbounds i32, i32* %166, i64 %161
store i32 %167, i32* %168
%169 = sdiv i32 %162, 10
%170 = add nsw i32 %162, 9
%171 = icmp ult i32 %170, 19
br i1 %171, label %155, label %160
172: ; preds = %157, %172
%173 = phi i64 [ %159, %157 ], [ %174, %172 ]
%174 = add nsw i64 %173, -1
%175 = and i64 %174, 4294967295
%176 = getelementptr inbounds i32, i32* %158, i64 %175
%177 = load i32, i32* %176
%178 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %177)
%179 = trunc i64 %173 to i32
%180 = icmp sgt i32 %179, 1
br i1 %180, label %172, label %181
181: ; preds = %172
%182 = call i32 @fclose(i32* %5)
%183 = call i32 @free(i32* %158)
br label %184
184: ; preds = %181, %37
%185 = phi i32 [ 1, %37 ], [ 0, %181 ]
ret i32 %185
}