#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 EOF;
int /*<<< orphan*/ EXIT_FAILURE;
char *calloc(size_t, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
scalar_t__ isspace(int);
int /*<<< orphan*/ printf(char *, char *, int);
char *ReadString(FILE *fp) {
  char *string, *tmp;
  int c;
  int a = 0, b;
  do
    c = fgetc(fp);
  while (isspace(c) != 0);
  string = calloc((size_t)(20 + 1), sizeof(char));
  if (string == NULL) {
    printf("Out of Memory! %s:%d\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/timmassingham/SLR/refs/heads/master/src/"
           "utility.c",
           242);
    exit(EXIT_FAILURE);
  };
  do {
    string[a++] = c;
    if (a % 20 == 0) {
      tmp = calloc((size_t)(a + 20), sizeof(char));
      if (tmp == NULL) {
        printf("Out of Memory! %s:%d\n",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/timmassingham/SLR/refs/heads/"
               "master/src/utility.c",
               247);
        exit(EXIT_FAILURE);
      };
      for (b = 0; b < a; b++)
        tmp[b] = string[b];
      free(string);
      string = tmp;
    }
  } while ((c = fgetc(fp)) != EOF);
  string[a] = '\0';
  tmp = calloc((size_t)(a + 1), sizeof(char));
  if (tmp == NULL) {
    printf("Out of Memory! %s:%d\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/timmassingham/SLR/refs/heads/master/src/"
           "utility.c",
           257);
    exit(EXIT_FAILURE);
  };
  for (b = 0; b < a + 1; b++)
    tmp[b] = string[b];
  free(string);
  return tmp;
}


x86 assembly (clang, -O0):
<ReadString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1060 <isspace@plt>
cmp    $0x0,%rax
jne    1173 <ReadString+0x13>
mov    $0x15,%edi
mov    $0x1,%esi
call   1070 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11d5 <ReadString+0x75>
lea    0xe4a(%rip),%rdi
lea    0xe59(%rip),%rsi
mov    $0xf2,%edx
call   1040 <printf@plt>
mov    0x2e0a(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
jmp    11da <ReadString+0x7a>
mov    -0x1c(%rbp),%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x20(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%eax
mov    $0x14,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1298 <ReadString+0x138>
mov    -0x20(%rbp),%eax
add    $0x14,%eax
movslq %eax,%rdi
mov    $0x1,%esi
call   1070 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1250 <ReadString+0xf0>
lea    0xdcf(%rip),%rdi
lea    0xdde(%rip),%rsi
mov    $0xf7,%edx
call   1040 <printf@plt>
mov    0x2d8f(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1287 <ReadString+0x127>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1257 <ReadString+0xf7>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    129d <ReadString+0x13d>
mov    -0x8(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %eax,-0x1c(%rbp)
mov    0x2d38(%rip),%rcx
cmp    (%rcx),%eax
jne    11da <ReadString+0x7a>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdi
mov    $0x1,%esi
call   1070 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    130c <ReadString+0x1ac>
lea    0xd13(%rip),%rdi
lea    0xd22(%rip),%rsi
mov    $0x101,%edx
call   1040 <printf@plt>
mov    0x2cd3(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1348 <ReadString+0x1e8>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1313 <ReadString+0x1b3>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadString>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <fgetc@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1060 <isspace@plt>
test   %rax,%rax
jne    1180 <ReadString+0x20>
mov    %rbx,0x10(%rsp)
mov    $0x15,%edi
mov    $0x1,%esi
call   1070 <calloc@plt>
test   %rax,%rax
je     15bf <ReadString+0x45f>
mov    %rax,%rbx
mov    $0x1,%r12d
mov    $0x2,%eax
mov    $0xffffffffffffffe1,%r14
xor    %r13d,%r13d
jmp    11fd <ReadString+0x9d>
nopl   (%rax)
mov    %rbx,%r15
mov    0x10(%rsp),%rdi
call   1050 <fgetc@plt>
mov    %eax,%ebp
add    $0x1,%r12
mov    (%rsp),%rax
add    $0x1,%eax
add    $0x1,%r14
mov    0x2df3(%rip),%rcx
cmp    (%rcx),%ebp
je     140f <ReadString+0x2af>
mov    %r13,%rcx
mov    %rax,(%rsp)
add    $0x1,%r13
mov    %bpl,(%rbx,%rcx,1)
imul   $0xcccccccd,%r13d,%eax
ror    $0x2,%eax
cmp    $0xccccccc,%eax
mov    %rcx,0x8(%rsp)
ja     11d0 <ReadString+0x70>
lea    0x15(%rcx),%rdi
mov    $0x1,%esi
call   1070 <calloc@plt>
test   %rax,%rax
je     1599 <ReadString+0x439>
mov    %rax,%r15
cmp    $0x8,%r12
jb     125c <ReadString+0xfc>
lea    (%rbx,%r12,1),%rax
cmp    %rax,%r15
jae    12df <ReadString+0x17f>
lea    (%r15,%r12,1),%rax
cmp    %rax,%rbx
jae    12df <ReadString+0x17f>
xor    %eax,%eax
mov    0x8(%rsp),%rsi
sub    %rax,%rsi
test   $0x3,%r12b
je     1292 <ReadString+0x132>
mov    %r12d,%edx
and    $0x3,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rbx,%rax,1),%ecx
mov    %cl,(%r15,%rax,1)
add    $0x1,%rax
add    $0xffffffffffffffff,%rdx
jne    1280 <ReadString+0x120>
cmp    $0x3,%rsi
jb     12cf <ReadString+0x16f>
nopl   0x0(%rax,%rax,1)
movzbl (%rbx,%rax,1),%ecx
mov    %cl,(%r15,%rax,1)
movzbl 0x1(%rbx,%rax,1),%ecx
mov    %cl,0x1(%r15,%rax,1)
movzbl 0x2(%rbx,%rax,1),%ecx
mov    %cl,0x2(%r15,%rax,1)
movzbl 0x3(%rbx,%rax,1),%ecx
mov    %cl,0x3(%r15,%rax,1)
add    $0x4,%rax
cmp    %rax,%r12
jne    12a0 <ReadString+0x140>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rbx
jmp    11d3 <ReadString+0x73>
cmp    $0x20,%r12
jae    12ec <ReadString+0x18c>
xor    %eax,%eax
jmp    13de <ReadString+0x27e>
mov    %r14,%rcx
shr    $0x5,%rcx
lea    -0x20(%r12),%rax
mov    %rax,%rsi
shr    $0x5,%rsi
add    $0x1,%rsi
cmp    $0x60,%rax
jae    130d <ReadString+0x1ad>
xor    %edx,%edx
jmp    1380 <ReadString+0x220>
lea    0x1(%rcx),%rax
and    $0xfffffffffffffffc,%rax
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
movups (%rbx,%rdx,1),%xmm0
movups 0x10(%rbx,%rdx,1),%xmm1
movups %xmm0,(%r15,%rdx,1)
movups %xmm1,0x10(%r15,%rdx,1)
movups 0x20(%rbx,%rdx,1),%xmm0
movups 0x30(%rbx,%rdx,1),%xmm1
movups %xmm0,0x20(%r15,%rdx,1)
movups %xmm1,0x30(%r15,%rdx,1)
movups 0x40(%rbx,%rdx,1),%xmm0
movups 0x50(%rbx,%rdx,1),%xmm1
movups %xmm0,0x40(%r15,%rdx,1)
movups %xmm1,0x50(%r15,%rdx,1)
movups 0x60(%rbx,%rdx,1),%xmm0
movups 0x70(%rbx,%rdx,1),%xmm1
movups %xmm0,0x60(%r15,%rdx,1)
movups %xmm1,0x70(%r15,%rdx,1)
sub    $0xffffffffffffff80,%rdx
add    $0xfffffffffffffffc,%rax
jne    1320 <ReadString+0x1c0>
mov    %r12,%rax
and    $0xffffffffffffffe0,%rax
test   $0x3,%sil
je     13cb <ReadString+0x26b>
add    $0x1,%cl
movzbl %cl,%ecx
and    $0x3,%ecx
shl    $0x5,%rcx
lea    (%r15,%rdx,1),%rsi
add    $0x10,%rsi
add    %rbx,%rdx
add    $0x10,%rdx
xor    %edi,%edi
nopl   0x0(%rax,%rax,1)
movups -0x10(%rdx,%rdi,1),%xmm0
movups (%rdx,%rdi,1),%xmm1
movups %xmm0,-0x10(%rsi,%rdi,1)
movups %xmm1,(%rsi,%rdi,1)
add    $0x20,%rdi
cmp    %rdi,%rcx
jne    13b0 <ReadString+0x250>
cmp    %rax,%r12
je     12cf <ReadString+0x16f>
test   $0x18,%r12b
je     125e <ReadString+0xfe>
mov    %rax,%rcx
mov    %r12,%rdx
and    $0xfffffffffffffff8,%rdx
mov    %r13,%rax
and    $0xfffffffffffffff8,%rax
nop
mov    (%rbx,%rcx,1),%rsi
mov    %rsi,(%r15,%rcx,1)
add    $0x8,%rcx
cmp    %rcx,%rdx
jne    13f0 <ReadString+0x290>
cmp    %rax,%r13
je     12cf <ReadString+0x16f>
jmp    125e <ReadString+0xfe>
mov    %r13d,%eax
movb   $0x0,(%r15,%rax,1)
mov    0x8(%rsp),%rax
add    $0x2,%rax
mov    %rax,%r12
mov    %eax,%r14d
mov    %r14,%rdi
mov    $0x1,%esi
call   1070 <calloc@plt>
test   %rax,%rax
je     15d4 <ReadString+0x474>
mov    %rax,%rbx
cmp    $0x8,%r14d
jae    1450 <ReadString+0x2f0>
xor    %eax,%eax
mov    (%rsp),%rbp
jmp    1506 <ReadString+0x3a6>
lea    (%r15,%r14,1),%rax
cmp    %rax,%rbx
mov    (%rsp),%rbp
jae    146f <ReadString+0x30f>
mov    %rbx,%rax
add    %r14,%rax
cmp    %rax,%r15
jae    146f <ReadString+0x30f>
xor    %eax,%eax
jmp    1506 <ReadString+0x3a6>
mov    %ebp,%ecx
cmp    $0x20,%r14d
jae    147b <ReadString+0x31b>
xor    %eax,%eax
jmp    14cb <ReadString+0x36b>
mov    %r12d,%edx
and    $0x1f,%edx
mov    %r14,%rax
sub    %rdx,%rax
mov    %ebp,%edi
and    $0x1f,%edi
mov    %rcx,%rsi
sub    %rdi,%rsi
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movups (%r15,%rdi,1),%xmm0
movups 0x10(%r15,%rdi,1),%xmm1
movups %xmm0,(%rbx,%rdi,1)
movups %xmm1,0x10(%rbx,%rdi,1)
add    $0x20,%rdi
cmp    %rdi,%rsi
jne    14a0 <ReadString+0x340>
test   %rdx,%rdx
je     157f <ReadString+0x41f>
cmp    $0x8,%edx
jb     1506 <ReadString+0x3a6>
mov    %rax,%rdx
mov    %r12d,%esi
and    $0x7,%esi
mov    %r14,%rax
sub    %rsi,%rax
mov    %ebp,%edi
and    $0x7,%edi
sub    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r15,%rdx,1),%rdi
mov    %rdi,(%rbx,%rdx,1)
add    $0x8,%rdx
cmp    %rdx,%rcx
jne    14f0 <ReadString+0x390>
test   %rsi,%rsi
je     157f <ReadString+0x41f>
sub    %eax,%r12d
mov    %rax,%rcx
not    %rcx
add    %rcx,%r14
test   $0x3,%r12b
je     1542 <ReadString+0x3e2>
mov    %ebp,%ecx
sub    %al,%cl
movzbl %cl,%ecx
and    $0x3,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%r15,%rax,1),%edx
mov    %dl,(%rbx,%rax,1)
add    $0x1,%rax
add    $0xffffffffffffffff,%rcx
jne    1530 <ReadString+0x3d0>
cmp    $0x3,%r14
jb     157f <ReadString+0x41f>
mov    %ebp,%ecx
nopw   0x0(%rax,%rax,1)
movzbl (%r15,%rax,1),%edx
mov    %dl,(%rbx,%rax,1)
movzbl 0x1(%r15,%rax,1),%edx
mov    %dl,0x1(%rbx,%rax,1)
movzbl 0x2(%r15,%rax,1),%edx
mov    %dl,0x2(%rbx,%rax,1)
movzbl 0x3(%r15,%rax,1),%edx
mov    %dl,0x3(%rbx,%rax,1)
add    $0x4,%rax
cmp    %rax,%rcx
jne    1550 <ReadString+0x3f0>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xa60(%rip),%rdi
lea    0xa6f(%rip),%rsi
mov    $0xf7,%edx
call   1040 <printf@plt>
mov    0x2a20(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
lea    0xa3a(%rip),%rdi
lea    0xa49(%rip),%rsi
mov    $0xf2,%edx
jmp    15ac <ReadString+0x44c>
lea    0xa25(%rip),%rdi
lea    0xa34(%rip),%rsi
mov    $0x101,%edx
jmp    15ac <ReadString+0x44c>

LLVM IR (-O0):
@.str = [22 x i8] c"Out of Memory! %s:%d\0A\00"
@.str.1 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/timmassingham/SLR/refs/heads/master/src/utility.c\00"
@EXIT_FAILURE = global i32 0
@EOF = global i32 0
define i8* @ReadString(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %6
br label %8
8: ; preds = %11, %1
%9 = load i32*, i32** %2
%10 = call i32 @fgetc(i32* %9)
store i32 %10, i32* %5
br label %11
11: ; preds = %8
%12 = load i32, i32* %5
%13 = call i64 @isspace(i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %8, label %15
15: ; preds = %11
%16 = call i8* @calloc(i64 21, i32 1)
store i8* %16, i8** %3
%17 = load i8*, i8** %3
%18 = icmp eq i8* %17, null
br i1 %18, label %19, label %23
19: ; preds = %15
%20 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i32 242)
%21 = load i32, i32* @EXIT_FAILURE
%22 = call i32 @exit(i32 %21)
unreachable
23: ; preds = %15
br label %24
24: ; preds = %69, %23
%25 = load i32, i32* %5
%26 = trunc i32 %25 to i8
%27 = load i8*, i8** %3
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
%30 = sext i32 %28 to i64
%31 = getelementptr inbounds i8, i8* %27, i64 %30
store i8 %26, i8* %31
%32 = load i32, i32* %6
%33 = srem i32 %32, 20
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %68
35: ; preds = %24
%36 = load i32, i32* %6
%37 = add nsw i32 %36, 20
%38 = sext i32 %37 to i64
%39 = call i8* @calloc(i64 %38, i32 1)
store i8* %39, i8** %4
%40 = load i8*, i8** %4
%41 = icmp eq i8* %40, null
br i1 %41, label %42, label %46
42: ; preds = %35
%43 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i32 247)
%44 = load i32, i32* @EXIT_FAILURE
%45 = call i32 @exit(i32 %44)
unreachable
46: ; preds = %35
store i32 0, i32* %7
br label %47
47: ; preds = %61, %46
%48 = load i32, i32* %7
%49 = load i32, i32* %6
%50 = icmp slt i32 %48, %49
br i1 %50, label %51, label %64
51: ; preds = %47
%52 = load i8*, i8** %3
%53 = load i32, i32* %7
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i8, i8* %52, i64 %54
%56 = load i8, i8* %55
%57 = load i8*, i8** %4
%58 = load i32, i32* %7
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i8, i8* %57, i64 %59
store i8 %56, i8* %60
br label %61
61: ; preds = %51
%62 = load i32, i32* %7
%63 = add nsw i32 %62, 1
store i32 %63, i32* %7
br label %47
64: ; preds = %47
%65 = load i8*, i8** %3
%66 = call i32 @free(i8* %65)
%67 = load i8*, i8** %4
store i8* %67, i8** %3
br label %68
68: ; preds = %64, %24
br label %69
69: ; preds = %68
%70 = load i32*, i32** %2
%71 = call i32 @fgetc(i32* %70)
store i32 %71, i32* %5
%72 = load i32, i32* @EOF
%73 = icmp ne i32 %71, %72
br i1 %73, label %24, label %74
74: ; preds = %69
%75 = load i8*, i8** %3
%76 = load i32, i32* %6
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds i8, i8* %75, i64 %77
store i8 0, i8* %78
%79 = load i32, i32* %6
%80 = add nsw i32 %79, 1
%81 = sext i32 %80 to i64
%82 = call i8* @calloc(i64 %81, i32 1)
store i8* %82, i8** %4
%83 = load i8*, i8** %4
%84 = icmp eq i8* %83, null
br i1 %84, label %85, label %89
85: ; preds = %74
%86 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i32 257)
%87 = load i32, i32* @EXIT_FAILURE
%88 = call i32 @exit(i32 %87)
unreachable
89: ; preds = %74
store i32 0, i32* %7
br label %90
90: ; preds = %105, %89
%91 = load i32, i32* %7
%92 = load i32, i32* %6
%93 = add nsw i32 %92, 1
%94 = icmp slt i32 %91, %93
br i1 %94, label %95, label %108
95: ; preds = %90
%96 = load i8*, i8** %3
%97 = load i32, i32* %7
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds i8, i8* %96, i64 %98
%100 = load i8, i8* %99
%101 = load i8*, i8** %4
%102 = load i32, i32* %7
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i8, i8* %101, i64 %103
store i8 %100, i8* %104
br label %105
105: ; preds = %95
%106 = load i32, i32* %7
%107 = add nsw i32 %106, 1
store i32 %107, i32* %7
br label %90
108: ; preds = %90
%109 = load i8*, i8** %3
%110 = call i32 @free(i8* %109)
%111 = load i8*, i8** %4
ret i8* %111
}

LLVM IR (-O2):
@.str = [22 x i8] c"Out of Memory! %s:%d\0A\00"
@.str.1 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/timmassingham/SLR/refs/heads/master/src/utility.c\00"
@EXIT_FAILURE = global i32 0
@EOF = global i32 0
define i8* @ReadString(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @fgetc(i32* %0)
%4 = tail call i64 @isspace(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
%7 = tail call i8* @calloc(i64 21, i32 1)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i32 242)
%11 = load i32, i32* @EXIT_FAILURE
%12 = tail call i32 @exit(i32 %11)
unreachable
13: ; preds = %6, %177
%14 = phi i64 [ %23, %177 ], [ 0, %6 ]
%15 = phi i64 [ %182, %177 ], [ 1, %6 ]
%16 = phi i8* [ %178, %177 ], [ %7, %6 ]
%17 = phi i32 [ %179, %177 ], [ %3, %6 ]
%18 = add i64 %15, -32
%19 = lshr i64 %18, 5
%20 = add nuw nsw i64 %19, 1
%21 = add i64 %14, 1
%22 = trunc i32 %17 to i8
%23 = add nuw i64 %14, 1
%24 = getelementptr inbounds i8, i8* %16, i64 %14
store i8 %22, i8* %24
%25 = trunc i64 %23 to i32
%26 = urem i32 %25, 20
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %177
28: ; preds = %13
%29 = add nuw nsw i64 %14, 21
%30 = tail call i8* @calloc(i64 %29, i32 1)
%31 = icmp eq i8* %30, null
br i1 %31, label %152, label %32
32: ; preds = %28
%33 = icmp ult i64 %15, 8
br i1 %33, label %135, label %34
34: ; preds = %32
%35 = getelementptr i8, i8* %30, i64 %15
%36 = getelementptr i8, i8* %16, i64 %15
%37 = icmp ult i8* %30, %36
%38 = icmp ult i8* %16, %35
%39 = and i1 %37, %38
br i1 %39, label %135, label %40
40: ; preds = %34
%41 = icmp ult i64 %15, 32
br i1 %41, label %121, label %42
42: ; preds = %40
%43 = and i64 %15, -32
%44 = and i64 %20, 3
%45 = icmp ult i64 %18, 96
br i1 %45, label %97, label %46
46: ; preds = %42
%47 = and i64 %20, 1152921504606846972
br label %48
48: ; preds = %48, %46
%49 = phi i64 [ 0, %46 ], [ %94, %48 ]
%50 = phi i64 [ 0, %46 ], [ %95, %48 ]
%51 = getelementptr inbounds i8, i8* %16, i64 %49
%52 = bitcast i8* %51 to <16 x i8>*
%53 = load <16 x i8>, <16 x i8>* %52
%54 = getelementptr inbounds i8, i8* %51, i64 16
%55 = bitcast i8* %54 to <16 x i8>*
%56 = load <16 x i8>, <16 x i8>* %55
%57 = getelementptr inbounds i8, i8* %30, i64 %49
%58 = bitcast i8* %57 to <16 x i8>*
store <16 x i8> %53, <16 x i8>* %58
%59 = getelementptr inbounds i8, i8* %57, i64 16
%60 = bitcast i8* %59 to <16 x i8>*
store <16 x i8> %56, <16 x i8>* %60
%61 = or i64 %49, 32
%62 = getelementptr inbounds i8, i8* %16, i64 %61
%63 = bitcast i8* %62 to <16 x i8>*
%64 = load <16 x i8>, <16 x i8>* %63
%65 = getelementptr inbounds i8, i8* %62, i64 16
%66 = bitcast i8* %65 to <16 x i8>*
%67 = load <16 x i8>, <16 x i8>* %66
%68 = getelementptr inbounds i8, i8* %30, i64 %61
%69 = bitcast i8* %68 to <16 x i8>*
store <16 x i8> %64, <16 x i8>* %69
%70 = getelementptr inbounds i8, i8* %68, i64 16
%71 = bitcast i8* %70 to <16 x i8>*
store <16 x i8> %67, <16 x i8>* %71
%72 = or i64 %49, 64
%73 = getelementptr inbounds i8, i8* %16, i64 %72
%74 = bitcast i8* %73 to <16 x i8>*
%75 = load <16 x i8>, <16 x i8>* %74
%76 = getelementptr inbounds i8, i8* %73, i64 16
%77 = bitcast i8* %76 to <16 x i8>*
%78 = load <16 x i8>, <16 x i8>* %77
%79 = getelementptr inbounds i8, i8* %30, i64 %72
%80 = bitcast i8* %79 to <16 x i8>*
store <16 x i8> %75, <16 x i8>* %80
%81 = getelementptr inbounds i8, i8* %79, i64 16
%82 = bitcast i8* %81 to <16 x i8>*
store <16 x i8> %78, <16 x i8>* %82
%83 = or i64 %49, 96
%84 = getelementptr inbounds i8, i8* %16, i64 %83
%85 = bitcast i8* %84 to <16 x i8>*
%86 = load <16 x i8>, <16 x i8>* %85
%87 = getelementptr inbounds i8, i8* %84, i64 16
%88 = bitcast i8* %87 to <16 x i8>*
%89 = load <16 x i8>, <16 x i8>* %88
%90 = getelementptr inbounds i8, i8* %30, i64 %83
%91 = bitcast i8* %90 to <16 x i8>*
store <16 x i8> %86, <16 x i8>* %91
%92 = getelementptr inbounds i8, i8* %90, i64 16
%93 = bitcast i8* %92 to <16 x i8>*
store <16 x i8> %89, <16 x i8>* %93
%94 = add nuw i64 %49, 128
%95 = add i64 %50, 4
%96 = icmp eq i64 %95, %47
br i1 %96, label %97, label %48
97: ; preds = %48, %42
%98 = phi i64 [ 0, %42 ], [ %94, %48 ]
%99 = icmp eq i64 %44, 0
br i1 %99, label %116, label %100
100: ; preds = %97, %100
%101 = phi i64 [ %113, %100 ], [ %98, %97 ]
%102 = phi i64 [ %114, %100 ], [ 0, %97 ]
%103 = getelementptr inbounds i8, i8* %16, i64 %101
%104 = bitcast i8* %103 to <16 x i8>*
%105 = load <16 x i8>, <16 x i8>* %104
%106 = getelementptr inbounds i8, i8* %103, i64 16
%107 = bitcast i8* %106 to <16 x i8>*
%108 = load <16 x i8>, <16 x i8>* %107
%109 = getelementptr inbounds i8, i8* %30, i64 %101
%110 = bitcast i8* %109 to <16 x i8>*
store <16 x i8> %105, <16 x i8>* %110
%111 = getelementptr inbounds i8, i8* %109, i64 16
%112 = bitcast i8* %111 to <16 x i8>*
store <16 x i8> %108, <16 x i8>* %112
%113 = add nuw i64 %101, 32
%114 = add i64 %102, 1
%115 = icmp eq i64 %114, %44
br i1 %115, label %116, label %100
116: ; preds = %100, %97
%117 = icmp eq i64 %15, %43
br i1 %117, label %175, label %118
118: ; preds = %116
%119 = and i64 %15, 24
%120 = icmp eq i64 %119, 0
br i1 %120, label %135, label %121
121: ; preds = %40, %118
%122 = phi i64 [ %43, %118 ], [ 0, %40 ]
%123 = and i64 %21, -8
br label %124
124: ; preds = %124, %121
%125 = phi i64 [ %122, %121 ], [ %131, %124 ]
%126 = getelementptr inbounds i8, i8* %16, i64 %125
%127 = bitcast i8* %126 to <8 x i8>*
%128 = load <8 x i8>, <8 x i8>* %127
%129 = getelementptr inbounds i8, i8* %30, i64 %125
%130 = bitcast i8* %129 to <8 x i8>*
store <8 x i8> %128, <8 x i8>* %130
%131 = add nuw i64 %125, 8
%132 = icmp eq i64 %131, %123
br i1 %132, label %133, label %124
133: ; preds = %124
%134 = icmp eq i64 %21, %123
br i1 %134, label %175, label %135
135: ; preds = %34, %32, %118, %133
%136 = phi i64 [ 0, %32 ], [ 0, %34 ], [ %43, %118 ], [ %123, %133 ]
%137 = sub i64 %14, %136
%138 = and i64 %15, 3
%139 = icmp eq i64 %138, 0
br i1 %139, label %149, label %140
140: ; preds = %135, %140
%141 = phi i64 [ %146, %140 ], [ %136, %135 ]
%142 = phi i64 [ %147, %140 ], [ 0, %135 ]
%143 = getelementptr inbounds i8, i8* %16, i64 %141
%144 = load i8, i8* %143
%145 = getelementptr inbounds i8, i8* %30, i64 %141
store i8 %144, i8* %145
%146 = add nuw nsw i64 %141, 1
%147 = add i64 %142, 1
%148 = icmp eq i64 %147, %138
br i1 %148, label %149, label %140
149: ; preds = %140, %135
%150 = phi i64 [ %136, %135 ], [ %146, %140 ]
%151 = icmp ult i64 %137, 3
br i1 %151, label %175, label %156
152: ; preds = %28
%153 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i32 247)
%154 = load i32, i32* @EXIT_FAILURE
%155 = tail call i32 @exit(i32 %154)
unreachable
156: ; preds = %149, %156
%157 = phi i64 [ %173, %156 ], [ %150, %149 ]
%158 = getelementptr inbounds i8, i8* %16, i64 %157
%159 = load i8, i8* %158
%160 = getelementptr inbounds i8, i8* %30, i64 %157
store i8 %159, i8* %160
%161 = add nuw nsw i64 %157, 1
%162 = getelementptr inbounds i8, i8* %16, i64 %161
%163 = load i8, i8* %162
%164 = getelementptr inbounds i8, i8* %30, i64 %161
store i8 %163, i8* %164
%165 = add nuw nsw i64 %157, 2
%166 = getelementptr inbounds i8, i8* %16, i64 %165
%167 = load i8, i8* %166
%168 = getelementptr inbounds i8, i8* %30, i64 %165
store i8 %167, i8* %168
%169 = add nuw nsw i64 %157, 3
%170 = getelementptr inbounds i8, i8* %16, i64 %169
%171 = load i8, i8* %170
%172 = getelementptr inbounds i8, i8* %30, i64 %169
store i8 %171, i8* %172
%173 = add nuw nsw i64 %157, 4
%174 = icmp eq i64 %173, %15
br i1 %174, label %175, label %156
175: ; preds = %149, %156, %133, %116
%176 = tail call i32 @free(i8* %16)
br label %177
177: ; preds = %13, %175
%178 = phi i8* [ %30, %175 ], [ %16, %13 ]
%179 = tail call i32 @fgetc(i32* %0)
%180 = load i32, i32* @EOF
%181 = icmp eq i32 %179, %180
%182 = add nuw i64 %15, 1
br i1 %181, label %183, label %13
183: ; preds = %177
%184 = and i64 %23, 4294967295
%185 = getelementptr inbounds i8, i8* %178, i64 %184
store i8 0, i8* %185
%186 = add i64 %14, 2
%187 = and i64 %186, 4294967295
%188 = tail call i8* @calloc(i64 %187, i32 1)
%189 = icmp eq i8* %188, null
br i1 %189, label %255, label %190
190: ; preds = %183
%191 = icmp ult i64 %187, 8
br i1 %191, label %236, label %192
192: ; preds = %190
%193 = getelementptr i8, i8* %188, i64 %187
%194 = getelementptr i8, i8* %178, i64 %187
%195 = icmp ult i8* %188, %194
%196 = icmp ult i8* %178, %193
%197 = and i1 %195, %196
br i1 %197, label %236, label %198
198: ; preds = %192
%199 = icmp ult i64 %187, 32
br i1 %199, label %221, label %200
200: ; preds = %198
%201 = and i64 %186, 31
%202 = sub nsw i64 %187, %201
br label %203
203: ; preds = %203, %200
%204 = phi i64 [ 0, %200 ], [ %215, %203 ]
%205 = getelementptr inbounds i8, i8* %178, i64 %204
%206 = bitcast i8* %205 to <16 x i8>*
%207 = load <16 x i8>, <16 x i8>* %206
%208 = getelementptr inbounds i8, i8* %205, i64 16
%209 = bitcast i8* %208 to <16 x i8>*
%210 = load <16 x i8>, <16 x i8>* %209
%211 = getelementptr inbounds i8, i8* %188, i64 %204
%212 = bitcast i8* %211 to <16 x i8>*
store <16 x i8> %207, <16 x i8>* %212
%213 = getelementptr inbounds i8, i8* %211, i64 16
%214 = bitcast i8* %213 to <16 x i8>*
store <16 x i8> %210, <16 x i8>* %214
%215 = add nuw i64 %204, 32
%216 = icmp eq i64 %215, %202
br i1 %216, label %217, label %203
217: ; preds = %203
%218 = icmp eq i64 %201, 0
br i1 %218, label %278, label %219
219: ; preds = %217
%220 = icmp ult i64 %201, 8
br i1 %220, label %236, label %221
221: ; preds = %198, %219
%222 = phi i64 [ %202, %219 ], [ 0, %198 ]
%223 = and i64 %186, 7
%224 = sub nsw i64 %187, %223
br label %225
225: ; preds = %225, %221
%226 = phi i64 [ %222, %221 ], [ %232, %225 ]
%227 = getelementptr inbounds i8, i8* %178, i64 %226
%228 = bitcast i8* %227 to <8 x i8>*
%229 = load <8 x i8>, <8 x i8>* %228
%230 = getelementptr inbounds i8, i8* %188, i64 %226
%231 = bitcast i8* %230 to <8 x i8>*
store <8 x i8> %229, <8 x i8>* %231
%232 = add nuw i64 %226, 8
%233 = icmp eq i64 %232, %224
br i1 %233, label %234, label %225
234: ; preds = %225
%235 = icmp eq i64 %223, 0
br i1 %235, label %278, label %236
236: ; preds = %192, %190, %219, %234
%237 = phi i64 [ 0, %190 ], [ 0, %192 ], [ %202, %219 ], [ %224, %234 ]
%238 = sub i64 %186, %237
%239 = xor i64 %237, -1
%240 = add nsw i64 %187, %239
%241 = and i64 %238, 3
%242 = icmp eq i64 %241, 0
br i1 %242, label %252, label %243
243: ; preds = %236, %243
%244 = phi i64 [ %249, %243 ], [ %237, %236 ]
%245 = phi i64 [ %250, %243 ], [ 0, %236 ]
%246 = getelementptr inbounds i8, i8* %178, i64 %244
%247 = load i8, i8* %246
%248 = getelementptr inbounds i8, i8* %188, i64 %244
store i8 %247, i8* %248
%249 = add nuw nsw i64 %244, 1
%250 = add i64 %245, 1
%251 = icmp eq i64 %250, %241
br i1 %251, label %252, label %243
252: ; preds = %243, %236
%253 = phi i64 [ %237, %236 ], [ %249, %243 ]
%254 = icmp ult i64 %240, 3
br i1 %254, label %278, label %259
255: ; preds = %183
%256 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i32 257)
%257 = load i32, i32* @EXIT_FAILURE
%258 = tail call i32 @exit(i32 %257)
unreachable
259: ; preds = %252, %259
%260 = phi i64 [ %276, %259 ], [ %253, %252 ]
%261 = getelementptr inbounds i8, i8* %178, i64 %260
%262 = load i8, i8* %261
%263 = getelementptr inbounds i8, i8* %188, i64 %260
store i8 %262, i8* %263
%264 = add nuw nsw i64 %260, 1
%265 = getelementptr inbounds i8, i8* %178, i64 %264
%266 = load i8, i8* %265
%267 = getelementptr inbounds i8, i8* %188, i64 %264
store i8 %266, i8* %267
%268 = add nuw nsw i64 %260, 2
%269 = getelementptr inbounds i8, i8* %178, i64 %268
%270 = load i8, i8* %269
%271 = getelementptr inbounds i8, i8* %188, i64 %268
store i8 %270, i8* %271
%272 = add nuw nsw i64 %260, 3
%273 = getelementptr inbounds i8, i8* %178, i64 %272
%274 = load i8, i8* %273
%275 = getelementptr inbounds i8, i8* %188, i64 %272
store i8 %274, i8* %275
%276 = add nuw nsw i64 %260, 4
%277 = icmp eq i64 %276, %187
br i1 %277, label %278, label %259
278: ; preds = %252, %259, %234, %217
%279 = tail call i32 @free(i8* %178)
ret i8* %188
}