#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*/ FLine(int /*<<< orphan*/ *);
char *FLineSpace(int /*<<< orphan*/ *);
int charExists(char, char *, int);
int charLoc(char, char *);
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int instancesOfInt(int, int *, int);
int intLoc(int, int *);
char *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ printfArr(int *, int);
int secondSmallestNum(int *, int, int /*<<< orphan*/);
int /*<<< orphan*/ smallestNum(int *, int);
int strtoi(int /*<<< orphan*/);
int /*<<< orphan*/ zero(int *, int);
int /*<<< orphan*/ zeroStr(char *, int);
int main(void) {
  FILE *fl = fopen("notlast.in", "r");
  FILE *fout = fopen("notlast.out", "w");
  int logs = strtoi(FLine(fl));
  char *cows = malloc(sizeof(char) * logs);
  zeroStr(cows, logs);
  char cow;
  int pos = 0;
  int amount[logs];
  zero(amount, logs);
  char *grb;
  int i;
  printf("%s\n", cows);
  for (i = 0; i < logs; i++) {
    cow = fgetc(fl);
    grb = FLineSpace(fl);
    printf("%c\n", cow);
    if (charExists(cow, cows, logs) == 1) {
      *(amount + charLoc(cow, cows)) =
          *(amount + charLoc(cow, cows)) + strtoi(FLine(fl));
    } else {
      pos = 0;
      while (*(cows + pos) != '0') {
        pos++;
      }
      *(cows + pos) = cow;
      *(amount + pos) = *(amount + pos) + strtoi(FLine(fl));
    }
  }
  printf("%s\n", cows);
  printfArr(amount, logs);
  printf("\n");
  pos = 0;
  while (*(cows + pos) != '0') {
    pos++;
  }
  logs = pos;
  if (secondSmallestNum(amount, logs, smallestNum(amount, logs)) ==
      2000000000) {
    printf("Tie\n");
    fprintf(fout, "Tie\n");
  } else if (instancesOfInt(
                 secondSmallestNum(amount, logs, smallestNum(amount, logs)),
                 amount, logs) > 1) {
    printf("Tie\n");
    fprintf(fout, "Tie\n");
  } else {
    char secondLowCow =
        *(cows +
          intLoc(secondSmallestNum(amount, logs, smallestNum(amount, logs)),
                 amount));
    if (secondLowCow == 'H') {
      fprintf(fout, "Henrietta\n");
      printf("Henrietta\n");
    } else if (secondLowCow == 'B') {
      fprintf(fout, "Bessie\n");
      printf("Bessie\n");
    } else if (secondLowCow == 'G') {
      fprintf(fout, "Gertie\n");
      printf("Gertie\n");
    } else if (secondLowCow == 'D') {
      fprintf(fout, "Daisy\n");
      printf("Daisy\n");
    } else if (secondLowCow == 'A') {
      fprintf(fout, "Annabelle\n");
      printf("Annabelle\n");
    } else if (secondLowCow == 'E') {
      fprintf(fout, "Elsie\n");
      printf("Elsie\n");
    } else {
      fprintf(fout, "Maggie\n");
      printf("Maggie\n");
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xdd7(%rip),%rdi
lea    0xddb(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    0xdcd(%rip),%rdi
lea    0xdd2(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   10c0 <FLine@plt>
mov    %eax,%edi
call   1080 <strtoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   10d0 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <zeroStr@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x1c(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x38(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x58(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x40(%rbp)
mov    -0x1c(%rbp),%esi
call   10e0 <zero@plt>
mov    -0x28(%rbp),%rsi
lea    0xd5f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    13f4 <main+0x1e4>
mov    -0x10(%rbp),%rdi
call   1090 <fgetc@plt>
mov    %al,-0x29(%rbp)
mov    -0x10(%rbp),%rdi
call   1100 <FLineSpace@plt>
mov    %rax,-0x48(%rbp)
movsbl -0x29(%rbp),%esi
lea    0xd25(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x29(%rbp),%al
mov    -0x28(%rbp),%rsi
mov    -0x1c(%rbp),%edx
movsbl %al,%edi
call   1060 <charExists@plt>
cmp    $0x1,%eax
jne    1377 <main+0x167>
mov    -0x29(%rbp),%al
mov    -0x28(%rbp),%rsi
movsbl %al,%edi
call   1110 <charLoc@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x60(%rbp)
mov    -0x10(%rbp),%rdi
call   10c0 <FLine@plt>
mov    %eax,%edi
call   1080 <strtoi@plt>
mov    %eax,%ecx
mov    -0x60(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x29(%rbp),%al
mov    -0x28(%rbp),%rsi
movsbl %al,%edi
call   1110 <charLoc@plt>
mov    -0x5c(%rbp),%edx
mov    %eax,%ecx
mov    -0x58(%rbp),%rax
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
jmp    13e1 <main+0x1d1>
movl   $0x0,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
je     13a1 <main+0x191>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    137e <main+0x16e>
mov    -0x58(%rbp),%rax
mov    -0x29(%rbp),%sil
mov    -0x28(%rbp),%rcx
movslq -0x30(%rbp),%rdx
mov    %sil,(%rcx,%rdx,1)
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x64(%rbp)
mov    -0x10(%rbp),%rdi
call   10c0 <FLine@plt>
mov    %eax,%edi
call   1080 <strtoi@plt>
mov    -0x64(%rbp),%edx
mov    %eax,%ecx
mov    -0x58(%rbp),%rax
add    %ecx,%edx
movslq -0x30(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    13e6 <main+0x1d6>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    12ca <main+0xba>
mov    -0x28(%rbp),%rsi
lea    0xc1c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x58(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1120 <printfArr@plt>
lea    0xc18(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
je     144a <main+0x23a>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1427 <main+0x217>
mov    -0x58(%rbp),%rdi
mov    -0x30(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x1c(%rbp),%esi
call   1070 <smallestNum@plt>
mov    -0x58(%rbp),%rdi
mov    -0x68(%rbp),%esi
mov    %eax,%edx
call   10b0 <secondSmallestNum@plt>
cmp    $0x77359400,%eax
jne    149e <main+0x28e>
lea    0xba1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    0xb8f(%rip),%rsi
call   10a0 <fprintf@plt>
jmp    169b <main+0x48b>
mov    -0x58(%rbp),%rdi
mov    -0x1c(%rbp),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x1c(%rbp),%esi
call   1070 <smallestNum@plt>
mov    -0x6c(%rbp),%esi
mov    -0x58(%rbp),%rdi
mov    %eax,%edx
call   10b0 <secondSmallestNum@plt>
mov    -0x58(%rbp),%rsi
mov    %eax,%edi
mov    -0x1c(%rbp),%edx
call   1040 <instancesOfInt@plt>
cmp    $0x1,%eax
jle    14f8 <main+0x2e8>
lea    0xb47(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    0xb35(%rip),%rsi
call   10a0 <fprintf@plt>
jmp    1696 <main+0x486>
mov    -0x58(%rbp),%rdi
mov    -0x28(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x1c(%rbp),%esi
call   1070 <smallestNum@plt>
mov    -0x7c(%rbp),%esi
mov    -0x58(%rbp),%rdi
mov    %eax,%edx
call   10b0 <secondSmallestNum@plt>
mov    -0x58(%rbp),%rsi
mov    %eax,%edi
call   1130 <intLoc@plt>
mov    %eax,%ecx
mov    -0x78(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x4d(%rbp)
movsbl -0x4d(%rbp),%eax
cmp    $0x48,%eax
jne    156a <main+0x35a>
mov    -0x18(%rbp),%rdi
lea    0xad6(%rip),%rsi
call   10a0 <fprintf@plt>
lea    0xaca(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1691 <main+0x481>
movsbl -0x4d(%rbp),%eax
cmp    $0x42,%eax
jne    159a <main+0x38a>
mov    -0x18(%rbp),%rdi
lea    0xab1(%rip),%rsi
call   10a0 <fprintf@plt>
lea    0xaa5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    168c <main+0x47c>
movsbl -0x4d(%rbp),%eax
cmp    $0x47,%eax
jne    15ca <main+0x3ba>
mov    -0x18(%rbp),%rdi
lea    0xa89(%rip),%rsi
call   10a0 <fprintf@plt>
lea    0xa7d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1687 <main+0x477>
movsbl -0x4d(%rbp),%eax
cmp    $0x44,%eax
jne    15fa <main+0x3ea>
mov    -0x18(%rbp),%rdi
lea    0xa61(%rip),%rsi
call   10a0 <fprintf@plt>
lea    0xa55(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1682 <main+0x472>
movsbl -0x4d(%rbp),%eax
cmp    $0x41,%eax
jne    162a <main+0x41a>
mov    -0x18(%rbp),%rdi
lea    0xa38(%rip),%rsi
call   10a0 <fprintf@plt>
lea    0xa2c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    167d <main+0x46d>
movsbl -0x4d(%rbp),%eax
cmp    $0x45,%eax
jne    165a <main+0x44a>
mov    -0x18(%rbp),%rdi
lea    0xa13(%rip),%rsi
call   10a0 <fprintf@plt>
lea    0xa07(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1678 <main+0x468>
mov    -0x18(%rbp),%rdi
lea    0x9f7(%rip),%rsi
call   10a0 <fprintf@plt>
lea    0x9eb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    167d <main+0x46d>
jmp    1682 <main+0x472>
jmp    1687 <main+0x477>
jmp    168c <main+0x47c>
jmp    1691 <main+0x481>
jmp    1696 <main+0x486>
jmp    169b <main+0x48b>
mov    -0x38(%rbp),%rax
mov    %rax,%rsp
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    $0x28,%rsp
lea    0xdd8(%rip),%rdi
lea    0xddc(%rip),%rsi
call   1100 <fopen@plt>
mov    %rax,%r12
lea    0xdcf(%rip),%rdi
lea    0xdd4(%rip),%rsi
call   1100 <fopen@plt>
mov    %rax,-0x30(%rbp)
mov    %r12,%rdi
call   10d0 <FLine@plt>
mov    %eax,%edi
call   10a0 <strtoi@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   10e0 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %ebx,%esi
call   1040 <zeroStr@plt>
mov    %ebx,%eax
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%rdi
sub    %rax,%rdi
mov    %rdi,%rsp
mov    %rdi,-0x38(%rbp)
mov    %ebx,%esi
call   10f0 <zero@plt>
mov    %r14,%rdi
call   1050 <puts@plt>
test   %ebx,%ebx
jle    13b6 <main+0x186>
xor    %r13d,%r13d
mov    %r12,-0x40(%rbp)
mov    %ebx,-0x48(%rbp)
jmp    1333 <main+0x103>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12d,%edi
mov    %r14,%rsi
call   1120 <charLoc@plt>
cltq
mov    -0x38(%rbp),%rbx
mov    (%rbx,%rax,4),%eax
mov    %eax,-0x44(%rbp)
mov    -0x40(%rbp),%rdi
call   10d0 <FLine@plt>
mov    %eax,%edi
call   10a0 <strtoi@plt>
mov    %eax,%r15d
add    -0x44(%rbp),%r15d
mov    %r12d,%edi
mov    %r14,%rsi
call   1120 <charLoc@plt>
cltq
mov    %r15d,(%rbx,%rax,4)
add    $0x1,%r13d
mov    -0x48(%rbp),%ebx
cmp    %ebx,%r13d
mov    -0x40(%rbp),%r12
je     13b6 <main+0x186>
mov    %r12,%rdi
call   10b0 <fgetc@plt>
mov    %eax,%r15d
mov    %r12,%rdi
call   1110 <FLineSpace@plt>
movsbl %r15b,%r12d
lea    0xcea(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r12d,%edi
mov    %r14,%rsi
mov    %ebx,%edx
call   1080 <charExists@plt>
cmp    $0x1,%eax
je     12e0 <main+0xb0>
mov    $0xffffffffffffffff,%rax
nopl   0x0(%rax,%rax,1)
cmpb   $0x30,0x1(%r14,%rax,1)
lea    0x1(%rax),%rax
jne    1380 <main+0x150>
mov    %eax,%ebx
mov    %r15b,(%r14,%rbx,1)
mov    -0x38(%rbp),%r12
mov    (%r12,%rbx,4),%r15d
mov    -0x40(%rbp),%rdi
call   10d0 <FLine@plt>
mov    %eax,%edi
call   10a0 <strtoi@plt>
add    %r15d,%eax
mov    %eax,(%r12,%rbx,4)
jmp    131f <main+0xef>
mov    %r14,%rdi
call   1050 <puts@plt>
mov    -0x38(%rbp),%rdi
mov    %ebx,%esi
call   1140 <printfArr@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xffffffff,%ebx
mov    %r14,%rax
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmpb   $0x30,(%rax)
lea    0x1(%rax),%rax
jne    13e0 <main+0x1b0>
mov    -0x38(%rbp),%r15
mov    %r15,%rdi
mov    %ebx,%esi
call   1090 <smallestNum@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   10c0 <secondSmallestNum@plt>
cmp    $0x77359400,%eax
je     1438 <main+0x208>
mov    -0x38(%rbp),%r15
mov    %r15,%rdi
mov    %ebx,%esi
call   1090 <smallestNum@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   10c0 <secondSmallestNum@plt>
mov    %eax,%edi
mov    %r15,%rsi
mov    %ebx,%edx
call   1060 <instancesOfInt@plt>
cmp    $0x2,%eax
jl     1463 <main+0x233>
lea    0xc76(%rip),%rdi
call   1050 <puts@plt>
lea    0xbf4(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    -0x30(%rbp),%rcx
call   1130 <fwrite@plt>
jmp    15a7 <main+0x377>
mov    -0x38(%rbp),%r15
mov    %r15,%rdi
mov    %ebx,%esi
call   1090 <smallestNum@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   10c0 <secondSmallestNum@plt>
mov    %eax,%edi
mov    %r15,%rsi
call   1150 <intLoc@plt>
cltq
mov    (%r14,%rax,1),%al
add    $0xbf,%al
cmp    $0x7,%al
ja     14f2 <main+0x2c2>
movzbl %al,%eax
lea    0xb63(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xbb9(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
mov    -0x30(%rbp),%rcx
call   1130 <fwrite@plt>
lea    0xbc6(%rip),%rdi
jmp    15a2 <main+0x372>
lea    0xb7c(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
mov    -0x30(%rbp),%rcx
call   1130 <fwrite@plt>
lea    0xbb7(%rip),%rdi
jmp    15a2 <main+0x372>
lea    0xb7f(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
mov    -0x30(%rbp),%rcx
call   1130 <fwrite@plt>
lea    0xb6d(%rip),%rdi
jmp    15a2 <main+0x372>
lea    0xb40(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    -0x30(%rbp),%rcx
call   1130 <fwrite@plt>
lea    0xb5e(%rip),%rdi
jmp    15a2 <main+0x372>
lea    0xb2f(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    -0x30(%rbp),%rcx
call   1130 <fwrite@plt>
lea    0xb2b(%rip),%rdi
jmp    15a2 <main+0x372>
lea    0xaf2(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
mov    -0x30(%rbp),%rcx
call   1130 <fwrite@plt>
lea    0xb1e(%rip),%rdi
jmp    15a2 <main+0x372>
lea    0xabc(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
mov    -0x30(%rbp),%rcx
call   1130 <fwrite@plt>
lea    0xb09(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"notlast.in\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [12 x i8] c"notlast.out\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [4 x i8] c"%s\0A\00"
@.str.5 = [4 x i8] c"%c\0A\00"
@.str.6 = [2 x i8] c"\0A\00"
@.str.7 = [5 x i8] c"Tie\0A\00"
@.str.8 = [11 x i8] c"Henrietta\0A\00"
@.str.9 = [8 x i8] c"Bessie\0A\00"
@.str.10 = [8 x i8] c"Gertie\0A\00"
@.str.11 = [7 x i8] c"Daisy\0A\00"
@.str.12 = [11 x i8] c"Annabelle\0A\00"
@.str.13 = [7 x i8] c"Elsie\0A\00"
@.str.14 = [8 x i8] c"Maggie\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8
store i32 0, i32* %1
%13 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %13, i32** %2
%14 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 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* %14, i32** %3
%15 = load i32*, i32** %2
%16 = call i32 @FLine(i32* %15)
%17 = call i32 @strtoi(i32 %16)
store i32 %17, i32* %4
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = mul i64 1, %19
%21 = trunc i64 %20 to i32
%22 = call i8* @malloc(i32 %21)
store i8* %22, i8** %5
%23 = load i8*, i8** %5
%24 = load i32, i32* %4
%25 = call i32 @zeroStr(i8* %23, i32 %24)
store i32 0, i32* %7
%26 = load i32, i32* %4
%27 = zext i32 %26 to i64
%28 = call i8* @llvm.stacksave()
store i8* %28, i8** %8
%29 = alloca i32, i64 %27
store i64 %27, i64* %9
%30 = load i32, i32* %4
%31 = call i32 @zero(i32* %29, i32 %30)
%32 = load i8*, i8** %5
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %32)
store i32 0, i32* %11
br label %34
34: ; preds = %97, %0
%35 = load i32, i32* %11
%36 = load i32, i32* %4
%37 = icmp slt i32 %35, %36
br i1 %37, label %38, label %100
38: ; preds = %34
%39 = load i32*, i32** %2
%40 = call signext i8 @fgetc(i32* %39)
store i8 %40, i8* %6
%41 = load i32*, i32** %2
%42 = call i8* @FLineSpace(i32* %41)
store i8* %42, i8** %10
%43 = load i8, i8* %6
%44 = sext i8 %43 to i32
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %44)
%46 = load i8, i8* %6
%47 = load i8*, i8** %5
%48 = load i32, i32* %4
%49 = call i32 @charExists(i8 signext %46, i8* %47, i32 %48)
%50 = icmp eq i32 %49, 1
br i1 %50, label %51, label %67
51: ; preds = %38
%52 = load i8, i8* %6
%53 = load i8*, i8** %5
%54 = call i32 @charLoc(i8 signext %52, i8* %53)
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i32, i32* %29, i64 %55
%57 = load i32, i32* %56
%58 = load i32*, i32** %2
%59 = call i32 @FLine(i32* %58)
%60 = call i32 @strtoi(i32 %59)
%61 = add nsw i32 %57, %60
%62 = load i8, i8* %6
%63 = load i8*, i8** %5
%64 = call i32 @charLoc(i8 signext %62, i8* %63)
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i32, i32* %29, i64 %65
store i32 %61, i32* %66
br label %96
67: ; preds = %38
store i32 0, i32* %7
br label %68
68: ; preds = %76, %67
%69 = load i8*, i8** %5
%70 = load i32, i32* %7
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds i8, i8* %69, i64 %71
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = icmp ne i32 %74, 48
br i1 %75, label %76, label %79
76: ; preds = %68
%77 = load i32, i32* %7
%78 = add nsw i32 %77, 1
store i32 %78, i32* %7
br label %68
79: ; preds = %68
%80 = load i8, i8* %6
%81 = load i8*, i8** %5
%82 = load i32, i32* %7
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds i8, i8* %81, i64 %83
store i8 %80, i8* %84
%85 = load i32, i32* %7
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds i32, i32* %29, i64 %86
%88 = load i32, i32* %87
%89 = load i32*, i32** %2
%90 = call i32 @FLine(i32* %89)
%91 = call i32 @strtoi(i32 %90)
%92 = add nsw i32 %88, %91
%93 = load i32, i32* %7
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds i32, i32* %29, i64 %94
store i32 %92, i32* %95
br label %96
96: ; preds = %79, %51
br label %97
97: ; preds = %96
%98 = load i32, i32* %11
%99 = add nsw i32 %98, 1
store i32 %99, i32* %11
br label %34
100: ; preds = %34
%101 = load i8*, i8** %5
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %101)
%103 = load i32, i32* %4
%104 = call i32 @printfArr(i32* %29, i32 %103)
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %7
br label %106
106: ; preds = %114, %100
%107 = load i8*, i8** %5
%108 = load i32, i32* %7
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds i8, i8* %107, i64 %109
%111 = load i8, i8* %110
%112 = sext i8 %111 to i32
%113 = icmp ne i32 %112, 48
br i1 %113, label %114, label %117
114: ; preds = %106
%115 = load i32, i32* %7
%116 = add nsw i32 %115, 1
store i32 %116, i32* %7
br label %106
117: ; preds = %106
%118 = load i32, i32* %7
store i32 %118, i32* %4
%119 = load i32, i32* %4
%120 = load i32, i32* %4
%121 = call i32 @smallestNum(i32* %29, i32 %120)
%122 = call i32 @secondSmallestNum(i32* %29, i32 %119, i32 %121)
%123 = icmp eq i32 %122, 2000000000
br i1 %123, label %124, label %128
124: ; preds = %117
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%126 = load i32*, i32** %3
%127 = call i32 @fprintf(i32* %126, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
br label %208
128: ; preds = %117
%129 = load i32, i32* %4
%130 = load i32, i32* %4
%131 = call i32 @smallestNum(i32* %29, i32 %130)
%132 = call i32 @secondSmallestNum(i32* %29, i32 %129, i32 %131)
%133 = load i32, i32* %4
%134 = call i32 @instancesOfInt(i32 %132, i32* %29, i32 %133)
%135 = icmp sgt i32 %134, 1
br i1 %135, label %136, label %140
136: ; preds = %128
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%138 = load i32*, i32** %3
%139 = call i32 @fprintf(i32* %138, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
br label %207
140: ; preds = %128
%141 = load i8*, i8** %5
%142 = load i32, i32* %4
%143 = load i32, i32* %4
%144 = call i32 @smallestNum(i32* %29, i32 %143)
%145 = call i32 @secondSmallestNum(i32* %29, i32 %142, i32 %144)
%146 = call i32 @intLoc(i32 %145, i32* %29)
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds i8, i8* %141, i64 %147
%149 = load i8, i8* %148
store i8 %149, i8* %12
%150 = load i8, i8* %12
%151 = sext i8 %150 to i32
%152 = icmp eq i32 %151, 72
br i1 %152, label %153, label %157
153: ; preds = %140
%154 = load i32*, i32** %3
%155 = call i32 @fprintf(i32* %154, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
%156 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
br label %206
157: ; preds = %140
%158 = load i8, i8* %12
%159 = sext i8 %158 to i32
%160 = icmp eq i32 %159, 66
br i1 %160, label %161, label %165
161: ; preds = %157
%162 = load i32*, i32** %3
%163 = call i32 @fprintf(i32* %162, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%164 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
br label %205
165: ; preds = %157
%166 = load i8, i8* %12
%167 = sext i8 %166 to i32
%168 = icmp eq i32 %167, 71
br i1 %168, label %169, label %173
169: ; preds = %165
%170 = load i32*, i32** %3
%171 = call i32 @fprintf(i32* %170, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0))
%172 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0))
br label %204
173: ; preds = %165
%174 = load i8, i8* %12
%175 = sext i8 %174 to i32
%176 = icmp eq i32 %175, 68
br i1 %176, label %177, label %181
177: ; preds = %173
%178 = load i32*, i32** %3
%179 = call i32 @fprintf(i32* %178, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
%180 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
br label %203
181: ; preds = %173
%182 = load i8, i8* %12
%183 = sext i8 %182 to i32
%184 = icmp eq i32 %183, 65
br i1 %184, label %185, label %189
185: ; preds = %181
%186 = load i32*, i32** %3
%187 = call i32 @fprintf(i32* %186, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0))
%188 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0))
br label %202
189: ; preds = %181
%190 = load i8, i8* %12
%191 = sext i8 %190 to i32
%192 = icmp eq i32 %191, 69
br i1 %192, label %193, label %197
193: ; preds = %189
%194 = load i32*, i32** %3
%195 = call i32 @fprintf(i32* %194, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
%196 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
br label %201
197: ; preds = %189
%198 = load i32*, i32** %3
%199 = call i32 @fprintf(i32* %198, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0))
%200 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0))
br label %201
201: ; preds = %197, %193
br label %202
202: ; preds = %201, %185
br label %203
203: ; preds = %202, %177
br label %204
204: ; preds = %203, %169
br label %205
205: ; preds = %204, %161
br label %206
206: ; preds = %205, %153
br label %207
207: ; preds = %206, %136
br label %208
208: ; preds = %207, %124
%209 = load i8*, i8** %8
%210 = load i32, i32* %1
ret i32 %210
}

LLVM IR (-O2):
@.str = [11 x i8] c"notlast.in\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [12 x i8] c"notlast.out\00"
@.str.3 = [2 x i8] c"w\00"
@.str.5 = [4 x i8] c"%c\0A\00"
@.str.7 = [5 x i8] c"Tie\0A\00"
@.str.8 = [11 x i8] c"Henrietta\0A\00"
@.str.9 = [8 x i8] c"Bessie\0A\00"
@.str.10 = [8 x i8] c"Gertie\0A\00"
@.str.11 = [7 x i8] c"Daisy\0A\00"
@.str.12 = [11 x i8] c"Annabelle\0A\00"
@.str.13 = [7 x i8] c"Elsie\0A\00"
@.str.14 = [8 x i8] c"Maggie\0A\00"
@str = [7 x i8] c"Maggie\00"
@str.15 = [6 x i8] c"Elsie\00"
@str.16 = [10 x i8] c"Annabelle\00"
@str.17 = [6 x i8] c"Daisy\00"
@str.18 = [7 x i8] c"Gertie\00"
@str.19 = [7 x i8] c"Bessie\00"
@str.20 = [10 x i8] c"Henrietta\00"
@str.22 = [4 x i8] c"Tie\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 @FLine(i32* %1)
%4 = tail call i32 @strtoi(i32 %3)
%5 = tail call i8* @malloc(i32 %4)
%6 = tail call i32 @zeroStr(i8* %5, i32 %4)
%7 = zext i32 %4 to i64
%8 = alloca i32, i64 %7
%9 = call i32 @zero(i32* %8, i32 %4)
%10 = call i32 @puts(i8* dereferenceable(1) %5)
%11 = icmp sgt i32 %4, 0
br i1 %11, label %12, label %48
12: ; preds = %0, %45
%13 = phi i32 [ %46, %45 ], [ 0, %0 ]
%14 = call signext i8 @fgetc(i32* %1)
%15 = call i8* @FLineSpace(i32* %1)
%16 = sext i8 %14 to i32
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %16)
%18 = call i32 @charExists(i8 signext %14, i8* %5, i32 %4)
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %31
20: ; preds = %12
%21 = call i32 @charLoc(i8 signext %14, i8* %5)
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %8, i64 %22
%24 = load i32, i32* %23
%25 = call i32 @FLine(i32* %1)
%26 = call i32 @strtoi(i32 %25)
%27 = add nsw i32 %26, %24
%28 = call i32 @charLoc(i8 signext %14, i8* %5)
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32, i32* %8, i64 %29
store i32 %27, i32* %30
br label %45
31: ; preds = %12, %31
%32 = phi i64 [ %36, %31 ], [ 0, %12 ]
%33 = getelementptr inbounds i8, i8* %5, i64 %32
%34 = load i8, i8* %33
%35 = icmp eq i8 %34, 48
%36 = add nuw i64 %32, 1
br i1 %35, label %37, label %31
37: ; preds = %31
%38 = and i64 %32, 4294967295
%39 = getelementptr inbounds i8, i8* %5, i64 %38
store i8 %14, i8* %39
%40 = getelementptr inbounds i32, i32* %8, i64 %38
%41 = load i32, i32* %40
%42 = call i32 @FLine(i32* %1)
%43 = call i32 @strtoi(i32 %42)
%44 = add nsw i32 %43, %41
store i32 %44, i32* %40
br label %45
45: ; preds = %20, %37
%46 = add nuw nsw i32 %13, 1
%47 = icmp eq i32 %46, %4
br i1 %47, label %48, label %12
48: ; preds = %45, %0
%49 = call i32 @puts(i8* dereferenceable(1) %5)
%50 = call i32 @printfArr(i32* %8, i32 %4)
%51 = call i32 @putchar(i32 10)
br label %52
52: ; preds = %52, %48
%53 = phi i64 [ %57, %52 ], [ 0, %48 ]
%54 = getelementptr inbounds i8, i8* %5, i64 %53
%55 = load i8, i8* %54
%56 = icmp eq i8 %55, 48
%57 = add nuw i64 %53, 1
br i1 %56, label %58, label %52
58: ; preds = %52
%59 = trunc i64 %53 to i32
%60 = call i32 @smallestNum(i32* %8, i32 %59)
%61 = call i32 @secondSmallestNum(i32* %8, i32 %59, i32 %60)
%62 = icmp eq i32 %61, 2000000000
br i1 %62, label %63, label %66
63: ; preds = %58
%64 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.22, i64 0, i64 0))
%65 = call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i64 4, i64 1, i32* %2)
br label %102
66: ; preds = %58
%67 = call i32 @smallestNum(i32* %8, i32 %59)
%68 = call i32 @secondSmallestNum(i32* %8, i32 %59, i32 %67)
%69 = call i32 @instancesOfInt(i32 %68, i32* %8, i32 %59)
%70 = icmp sgt i32 %69, 1
br i1 %70, label %71, label %74
71: ; preds = %66
%72 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.22, i64 0, i64 0))
%73 = call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i64 4, i64 1, i32* %2)
br label %102
74: ; preds = %66
%75 = call i32 @smallestNum(i32* %8, i32 %59)
%76 = call i32 @secondSmallestNum(i32* %8, i32 %59, i32 %75)
%77 = call i32 @intLoc(i32 %76, i32* %8)
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i8, i8* %5, i64 %78
%80 = load i8, i8* %79
switch i8 %80, label %99 [
i8 72, label %81
i8 66, label %84
i8 71, label %87
i8 68, label %90
i8 65, label %93
i8 69, label %96
]
81: ; preds = %74
%82 = call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i64 10, i64 1, i32* %2)
%83 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.20, i64 0, i64 0))
br label %102
84: ; preds = %74
%85 = call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i64 7, i64 1, i32* %2)
%86 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.19, i64 0, i64 0))
br label %102
87: ; preds = %74
%88 = call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i64 7, i64 1, i32* %2)
%89 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.18, i64 0, i64 0))
br label %102
90: ; preds = %74
%91 = call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i64 6, i64 1, i32* %2)
%92 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.17, i64 0, i64 0))
br label %102
93: ; preds = %74
%94 = call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0), i64 10, i64 1, i32* %2)
%95 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.16, i64 0, i64 0))
br label %102
96: ; preds = %74
%97 = call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i64 6, i64 1, i32* %2)
%98 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.15, i64 0, i64 0))
br label %102
99: ; preds = %74
%100 = call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i64 7, i64 1, i32* %2)
%101 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
br label %102
102: ; preds = %81, %87, %93, %99, %96, %90, %84, %71, %63
ret i32 0
}