#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 */
double atof(char *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, unsigned int, char *, int);
scalar_t__ realloc(void *, int);
char *strsep(char **, char *);
unsigned int loadfile_fileptr_fs(FILE *in, unsigned int ncolumns,
                                 unsigned int columns[], double *data[],
                                 char *fs) {
  unsigned int i, j, ialloc;
  char buffer[1024];
  char **ap, *argv[100], *inputstring;
  int loadon;
  for (j = 0; j < ncolumns; j++) {
    if ((data[j] = (double *)malloc(sizeof(double) * 512)) == NULL) {
      printf("Unable to allocate data[%d] in %s:%d\n", j,
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/UBC-Astrophysics/kd-match/refs/heads/"
             "master/loadfile.c",
             48);
      return 0;
    }
  }
  ialloc = 512;
  i = 0;
  loadon = 1;
  while (fgets(buffer, 1023, in)) {
    if (buffer[0] == '*')
      loadon = 1 - loadon;
    if (buffer[0] == '#' || buffer[0] == '*' || !loadon) {
    } else {
      inputstring = buffer;
      for (ap = argv; (*ap = strsep(&inputstring, fs)) != NULL;)
        if (**ap != '\0')
          if (++ap >= &argv[100])
            break;
      if (ap > argv) {
        for (j = 0; j < ncolumns; j++) {
          data[j][i] = (argv + columns[j] <= ap ? atof(argv[columns[j] - 1])
                                                : 0.0 / 0.0);
        }
        i++;
        if (i == ialloc) {
          for (j = 0; j < ncolumns; j++) {
            if ((data[j] = (double *)realloc(
                     (void *)data[j], sizeof(double) * (i + 512))) == NULL) {
              printf("Unable to reallocate data[%d] in %s:%d\n", j,
                     "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                     "outputs/2022-01-22/02-19-57/repos/UBC-Astrophysics/"
                     "kd-match/refs/heads/master/loadfile.c",
                     78);
              return 0;
            }
          }
          ialloc = i + 512;
        }
      }
    }
  }
  for (j = 0; j < ncolumns; j++) {
    if ((data[j] = (double *)realloc((void *)data[j], sizeof(double) * i)) ==
        NULL) {
      printf("Unable to reallocate data[%d] in %s:%d\n", j,
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/UBC-Astrophysics/kd-match/refs/heads/"
             "master/loadfile.c",
             90);
      return 0;
    }
  }
  return i;
}


x86 assembly (clang, -O0):
<loadfile_fileptr_fs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x790,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    11ea <loadfile_fileptr_fs+0x8a>
mov    $0x1000,%edi
call   1060 <malloc@plt>
mov    -0x28(%rbp),%rcx
mov    -0x38(%rbp),%edx
mov    %rax,(%rcx,%rdx,8)
cmp    $0x0,%rax
jne    11d7 <loadfile_fileptr_fs+0x77>
mov    -0x38(%rbp),%esi
lea    0xe4e(%rip),%rdi
lea    0xe6d(%rip),%rdx
mov    $0x30,%ecx
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    14ea <loadfile_fileptr_fs+0x38a>
jmp    11dc <loadfile_fileptr_fs+0x7c>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1185 <loadfile_fileptr_fs+0x25>
movl   $0x200,-0x3c(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x1,-0x77c(%rbp)
lea    -0x440(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x3ff,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     1469 <loadfile_fileptr_fs+0x309>
movsbl -0x440(%rbp),%eax
cmp    $0x2a,%eax
jne    1242 <loadfile_fileptr_fs+0xe2>
mov    $0x1,%eax
sub    -0x77c(%rbp),%eax
mov    %eax,-0x77c(%rbp)
movsbl -0x440(%rbp),%eax
cmp    $0x23,%eax
je     126f <loadfile_fileptr_fs+0x10f>
movsbl -0x440(%rbp),%eax
cmp    $0x2a,%eax
je     126f <loadfile_fileptr_fs+0x10f>
cmpl   $0x0,-0x77c(%rbp)
jne    1274 <loadfile_fileptr_fs+0x114>
jmp    1464 <loadfile_fileptr_fs+0x304>
lea    -0x440(%rbp),%rax
mov    %rax,-0x778(%rbp)
lea    -0x770(%rbp),%rax
mov    %rax,-0x448(%rbp)
mov    -0x30(%rbp),%rsi
lea    -0x778(%rbp),%rdi
call   1070 <strsep@plt>
mov    -0x448(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
je     1302 <loadfile_fileptr_fs+0x1a2>
mov    -0x448(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     12fd <loadfile_fileptr_fs+0x19d>
mov    -0x448(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x448(%rbp)
lea    -0x770(%rbp),%rcx
add    $0x320,%rcx
cmp    %rcx,%rax
jb     12f8 <loadfile_fileptr_fs+0x198>
jmp    1302 <loadfile_fileptr_fs+0x1a2>
jmp    12fd <loadfile_fileptr_fs+0x19d>
jmp    1290 <loadfile_fileptr_fs+0x130>
mov    -0x448(%rbp),%rax
lea    -0x770(%rbp),%rcx
cmp    %rcx,%rax
jbe    145f <loadfile_fileptr_fs+0x2ff>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    13b8 <loadfile_fileptr_fs+0x258>
lea    -0x770(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    -0x38(%rbp),%edx
mov    (%rcx,%rdx,4),%ecx
shl    $0x3,%rcx
add    %rcx,%rax
cmp    -0x448(%rbp),%rax
ja     137a <loadfile_fileptr_fs+0x21a>
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
mov    (%rax,%rcx,4),%eax
sub    $0x1,%eax
mov    %eax,%eax
mov    -0x770(%rbp,%rax,8),%rdi
ff
call   1030 <atof@plt>
movsd  %xmm0,-0x788(%rbp)
ff
jmp    138f <loadfile_fileptr_fs+0x22f>
movsd  0xc7e(%rip),%xmm0
movsd  %xmm0,-0x788(%rbp)
ff
jmp    138f <loadfile_fileptr_fs+0x22f>
movsd  -0x788(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%ecx
mov    (%rax,%rcx,8),%rax
mov    -0x34(%rbp),%ecx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1320 <loadfile_fileptr_fs+0x1c0>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jne    145a <loadfile_fileptr_fs+0x2fa>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    144f <loadfile_fileptr_fs+0x2ef>
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
mov    -0x34(%rbp),%eax
add    $0x200,%eax
mov    %eax,%eax
shl    $0x3,%rax
mov    %eax,%esi
call   1080 <realloc@plt>
mov    -0x28(%rbp),%rcx
mov    -0x38(%rbp),%edx
mov    %rax,(%rcx,%rdx,8)
cmp    $0x0,%rax
jne    143c <loadfile_fileptr_fs+0x2dc>
mov    -0x38(%rbp),%esi
lea    0xca0(%rip),%rdi
lea    0xc08(%rip),%rdx
mov    $0x4e,%ecx
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    14ea <loadfile_fileptr_fs+0x38a>
jmp    1441 <loadfile_fileptr_fs+0x2e1>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    13d4 <loadfile_fileptr_fs+0x274>
mov    -0x34(%rbp),%eax
add    $0x200,%eax
mov    %eax,-0x3c(%rbp)
jmp    145f <loadfile_fileptr_fs+0x2ff>
jmp    1464 <loadfile_fileptr_fs+0x304>
jmp    1202 <loadfile_fileptr_fs+0xa2>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    14e4 <loadfile_fileptr_fs+0x384>
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
mov    -0x34(%rbp),%eax
shl    $0x3,%rax
mov    %eax,%esi
call   1080 <realloc@plt>
mov    -0x28(%rbp),%rcx
mov    -0x38(%rbp),%edx
mov    %rax,(%rcx,%rdx,8)
cmp    $0x0,%rax
jne    14d1 <loadfile_fileptr_fs+0x371>
mov    -0x38(%rbp),%esi
lea    0xc0b(%rip),%rdi
lea    0xb73(%rip),%rdx
mov    $0x5a,%ecx
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    14ea <loadfile_fileptr_fs+0x38a>
jmp    14d6 <loadfile_fileptr_fs+0x376>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1470 <loadfile_fileptr_fs+0x310>
mov    -0x34(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x790,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loadfile_fileptr_fs>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x768,%rsp
mov    %r8,%r14
mov    %rcx,0x18(%rsp)
mov    %rdx,0x38(%rsp)
mov    %esi,%r13d
mov    %rdi,0x8(%rsp)
mov    %esi,%r12d
test   %esi,%esi
je     11b1 <loadfile_fileptr_fs+0x51>
xor    %ebp,%ebp
nop
mov    $0x1000,%edi
call   1060 <malloc@plt>
mov    0x18(%rsp),%rcx
mov    %rax,(%rcx,%rbp,8)
test   %rax,%rax
je     11eb <loadfile_fileptr_fs+0x8b>
add    $0x1,%rbp
cmp    %rbp,%r12
jne    1190 <loadfile_fileptr_fs+0x30>
lea    0x360(%rsp),%rdi
mov    $0x3ff,%esi
mov    0x8(%rsp),%rbp
mov    %rbp,%rdx
call   1050 <fgets@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     13c4 <loadfile_fileptr_fs+0x264>
movl   $0x200,0x4(%rsp)
mov    $0x1,%r15d
mov    %r13d,0x14(%rsp)
jmp    123e <loadfile_fileptr_fs+0xde>
lea    0xe16(%rip),%rdi
lea    0xe35(%rip),%rdx
mov    %ebp,%esi
mov    $0x30,%ecx
jmp    142f <loadfile_fileptr_fs+0x2cf>
mov    0x20(%rsp),%rax
add    $0x201,%eax
mov    0x4(%rsp),%ecx
mov    %ecx,%ebx
mov    %eax,0x4(%rsp)
mov    0x8(%rsp),%rbp
xchg   %ax,%ax
lea    0x360(%rsp),%rdi
mov    $0x3ff,%esi
mov    %rbp,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     13c4 <loadfile_fileptr_fs+0x264>
mov    %r15d,%ecx
mov    0x360(%rsp),%al
mov    $0x1,%r15d
sub    %ecx,%r15d
cmp    $0x2a,%al
cmovne %ecx,%r15d
test   %r15d,%r15d
je     1220 <loadfile_fileptr_fs+0xc0>
cmp    $0x23,%al
je     1220 <loadfile_fileptr_fs+0xc0>
cmp    $0x2a,%al
je     1220 <loadfile_fileptr_fs+0xc0>
lea    0x360(%rsp),%rax
mov    %rax,0x30(%rsp)
lea    0x30(%rsp),%rdi
mov    %r14,%rsi
call   1070 <strsep@plt>
mov    %rax,0x40(%rsp)
test   %rax,%rax
je     1220 <loadfile_fileptr_fs+0xc0>
lea    0x40(%rsp),%rbp
jmp    12a6 <loadfile_fileptr_fs+0x146>
nop
lea    0x30(%rsp),%rdi
mov    %r14,%rsi
call   1070 <strsep@plt>
mov    %rax,0x0(%rbp)
test   %rax,%rax
je     12bc <loadfile_fileptr_fs+0x15c>
cmpb   $0x0,(%rax)
je     1290 <loadfile_fileptr_fs+0x130>
add    $0x8,%rbp
lea    0x360(%rsp),%rax
cmp    %rax,%rbp
jb     1290 <loadfile_fileptr_fs+0x130>
lea    0x40(%rsp),%rax
cmp    %rax,%rbp
jbe    1219 <loadfile_fileptr_fs+0xb9>
test   %r13d,%r13d
mov    %rbx,0x20(%rsp)
je     139d <loadfile_fileptr_fs+0x23d>
mov    %rbx,%rcx
mov    %r14,%rbx
mov    %r12,%r14
mov    %ecx,%r12d
xor    %r13d,%r13d
jmp    1308 <loadfile_fileptr_fs+0x1a8>
nopl   0x0(%rax)
mov    0x18(%rsp),%rax
mov    (%rax,%r13,8),%rax
movsd  %xmm0,(%rax,%r12,8)
add    $0x1,%r13
cmp    %r13,%r14
je     1335 <loadfile_fileptr_fs+0x1d5>
mov    0x38(%rsp),%rax
mov    (%rax,%r13,4),%eax
lea    (%rsp,%rax,8),%rcx
add    $0x40,%rcx
movsd  0xcdf(%rip),%xmm0
cmp    %rbp,%rcx
ja     12f0 <loadfile_fileptr_fs+0x190>
add    $0xffffffff,%eax
mov    0x40(%rsp,%rax,8),%rdi
call   1030 <atof@plt>
jmp    12f0 <loadfile_fileptr_fs+0x190>
mov    0x20(%rsp),%rax
add    $0x1,%eax
cmp    0x4(%rsp),%eax
jne    13b1 <loadfile_fileptr_fs+0x251>
mov    0x14(%rsp),%r13d
test   %r13d,%r13d
mov    %r14,%r12
mov    %rbx,%r14
je     1205 <loadfile_fileptr_fs+0xa5>
mov    0x20(%rsp),%rax
lea    0x1008(,%rax,8),%eax
mov    %eax,0x2c(%rsp)
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    0x18(%rsp),%rbx
mov    (%rbx,%rbp,8),%rdi
mov    0x2c(%rsp),%esi
call   1080 <realloc@plt>
mov    %rax,(%rbx,%rbp,8)
test   %rax,%rax
je     141a <loadfile_fileptr_fs+0x2ba>
add    $0x1,%rbp
cmp    %rbp,%r12
jne    1370 <loadfile_fileptr_fs+0x210>
jmp    1205 <loadfile_fileptr_fs+0xa5>
lea    0x1(%rbx),%eax
cmp    0x4(%rsp),%eax
je     1205 <loadfile_fileptr_fs+0xa5>
mov    %eax,%ebx
jmp    1219 <loadfile_fileptr_fs+0xb9>
mov    %r14,%r12
mov    0x14(%rsp),%r13d
mov    %rbx,%r14
mov    %rax,%rbx
jmp    1219 <loadfile_fileptr_fs+0xb9>
test   %r13d,%r13d
je     1436 <loadfile_fileptr_fs+0x2d6>
mov    %rbx,%r15
lea    0x0(,%rbx,8),%r14d
xor    %ebp,%ebp
mov    0x18(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx,%rbp,8),%rdi
mov    %r14d,%esi
call   1080 <realloc@plt>
mov    %rax,(%rbx,%rbp,8)
test   %rax,%rax
je     1403 <loadfile_fileptr_fs+0x2a3>
add    $0x1,%rbp
cmp    %rbp,%r12
jne    13e0 <loadfile_fileptr_fs+0x280>
mov    %r15,%rbx
jmp    1436 <loadfile_fileptr_fs+0x2d6>
lea    0xcb5(%rip),%rdi
lea    0xc1d(%rip),%rdx
mov    %ebp,%esi
mov    $0x5a,%ecx
jmp    142f <loadfile_fileptr_fs+0x2cf>
lea    0xc9e(%rip),%rdi
lea    0xc06(%rip),%rdx
mov    %ebp,%esi
mov    $0x4e,%ecx
call   1040 <printf@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x768,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Unable to allocate data[%d] in %s:%d\0A\00"
@.str.1 = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/UBC-Astrophysics/kd-match/refs/heads/master/loadfile.c\00"
@.str.2 = [40 x i8] c"Unable to reallocate data[%d] in %s:%d\0A\00"
define i32 @loadfile_fileptr_fs(i32* %0, i32 %1, i32* %2, double** %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32*
%10 = alloca double**
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca [1024 x i8]
%16 = alloca i8**
%17 = alloca [100 x i8*]
%18 = alloca i8*
%19 = alloca i32
store i32* %0, i32** %7
store i32 %1, i32* %8
store i32* %2, i32** %9
store double** %3, double*** %10
store i8* %4, i8** %11
store i32 0, i32* %13
br label %20
20: ; preds = %36, %5
%21 = load i32, i32* %13
%22 = load i32, i32* %8
%23 = icmp ult i32 %21, %22
br i1 %23, label %24, label %39
24: ; preds = %20
%25 = call i64 @malloc(i32 4096)
%26 = inttoptr i64 %25 to double*
%27 = load double**, double*** %10
%28 = load i32, i32* %13
%29 = zext i32 %28 to i64
%30 = getelementptr inbounds double*, double** %27, i64 %29
store double* %26, double** %30
%31 = icmp eq double* %26, null
br i1 %31, label %32, label %35
32: ; preds = %24
%33 = load i32, i32* %13
%34 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %33, i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str.1, i64 0, i64 0), i32 48)
store i32 0, i32* %6
br label %209
35: ; preds = %24
br label %36
36: ; preds = %35
%37 = load i32, i32* %13
%38 = add i32 %37, 1
store i32 %38, i32* %13
br label %20
39: ; preds = %20
store i32 512, i32* %14
store i32 0, i32* %12
store i32 1, i32* %19
br label %40
40: ; preds = %176, %39
%41 = getelementptr inbounds [1024 x i8], [1024 x i8]* %15, i64 0, i64 0
%42 = load i32*, i32** %7
%43 = call i64 @fgets(i8* %41, i32 1023, i32* %42)
%44 = icmp ne i64 %43, 0
br i1 %44, label %45, label %177
45: ; preds = %40
%46 = getelementptr inbounds [1024 x i8], [1024 x i8]* %15, i64 0, i64 0
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = icmp eq i32 %48, 42
br i1 %49, label %50, label %53
50: ; preds = %45
%51 = load i32, i32* %19
%52 = sub nsw i32 1, %51
store i32 %52, i32* %19
br label %53
53: ; preds = %50, %45
%54 = getelementptr inbounds [1024 x i8], [1024 x i8]* %15, i64 0, i64 0
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = icmp eq i32 %56, 35
br i1 %57, label %66, label %58
58: ; preds = %53
%59 = getelementptr inbounds [1024 x i8], [1024 x i8]* %15, i64 0, i64 0
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = icmp eq i32 %61, 42
br i1 %62, label %66, label %63
63: ; preds = %58
%64 = load i32, i32* %19
%65 = icmp ne i32 %64, 0
br i1 %65, label %67, label %66
66: ; preds = %63, %58, %53
br label %176
67: ; preds = %63
%68 = getelementptr inbounds [1024 x i8], [1024 x i8]* %15, i64 0, i64 0
store i8* %68, i8** %18
%69 = getelementptr inbounds [100 x i8*], [100 x i8*]* %17, i64 0, i64 0
store i8** %69, i8*** %16
br label %70
70: ; preds = %88, %67
%71 = load i8*, i8** %11
%72 = call i8* @strsep(i8** %18, i8* %71)
%73 = load i8**, i8*** %16
store i8* %72, i8** %73
%74 = icmp ne i8* %72, null
br i1 %74, label %75, label %89
75: ; preds = %70
%76 = load i8**, i8*** %16
%77 = load i8*, i8** %76
%78 = load i8, i8* %77
%79 = sext i8 %78 to i32
%80 = icmp ne i32 %79, 0
br i1 %80, label %81, label %88
81: ; preds = %75
%82 = load i8**, i8*** %16
%83 = getelementptr inbounds i8*, i8** %82, i32 1
store i8** %83, i8*** %16
%84 = getelementptr inbounds [100 x i8*], [100 x i8*]* %17, i64 0, i64 100
%85 = icmp uge i8** %83, %84
br i1 %85, label %86, label %87
86: ; preds = %81
br label %89
87: ; preds = %81
br label %88
88: ; preds = %87, %75
br label %70
89: ; preds = %86, %70
%90 = load i8**, i8*** %16
%91 = getelementptr inbounds [100 x i8*], [100 x i8*]* %17, i64 0, i64 0
%92 = icmp ugt i8** %90, %91
br i1 %92, label %93, label %175
93: ; preds = %89
store i32 0, i32* %13
br label %94
94: ; preds = %131, %93
%95 = load i32, i32* %13
%96 = load i32, i32* %8
%97 = icmp ult i32 %95, %96
br i1 %97, label %98, label %134
98: ; preds = %94
%99 = getelementptr inbounds [100 x i8*], [100 x i8*]* %17, i64 0, i64 0
%100 = load i32*, i32** %9
%101 = load i32, i32* %13
%102 = zext i32 %101 to i64
%103 = getelementptr inbounds i32, i32* %100, i64 %102
%104 = load i32, i32* %103
%105 = zext i32 %104 to i64
%106 = getelementptr inbounds i8*, i8** %99, i64 %105
%107 = load i8**, i8*** %16
%108 = icmp ule i8** %106, %107
br i1 %108, label %109, label %120
109: ; preds = %98
%110 = load i32*, i32** %9
%111 = load i32, i32* %13
%112 = zext i32 %111 to i64
%113 = getelementptr inbounds i32, i32* %110, i64 %112
%114 = load i32, i32* %113
%115 = sub i32 %114, 1
%116 = zext i32 %115 to i64
%117 = getelementptr inbounds [100 x i8*], [100 x i8*]* %17, i64 0, i64 %116
%118 = load i8*, i8** %117
%119 = call double @atof(i8* %118)
br label %121
120: ; preds = %98
br label %121
121: ; preds = %120, %109
%122 = phi double [ %119, %109 ], [ 0x7FF8000000000000, %120 ]
%123 = load double**, double*** %10
%124 = load i32, i32* %13
%125 = zext i32 %124 to i64
%126 = getelementptr inbounds double*, double** %123, i64 %125
%127 = load double*, double** %126
%128 = load i32, i32* %12
%129 = zext i32 %128 to i64
%130 = getelementptr inbounds double, double* %127, i64 %129
store double %122, double* %130
br label %131
131: ; preds = %121
%132 = load i32, i32* %13
%133 = add i32 %132, 1
store i32 %133, i32* %13
br label %94
134: ; preds = %94
%135 = load i32, i32* %12
%136 = add i32 %135, 1
store i32 %136, i32* %12
%137 = load i32, i32* %12
%138 = load i32, i32* %14
%139 = icmp eq i32 %137, %138
br i1 %139, label %140, label %174
140: ; preds = %134
store i32 0, i32* %13
br label %141
141: ; preds = %168, %140
%142 = load i32, i32* %13
%143 = load i32, i32* %8
%144 = icmp ult i32 %142, %143
br i1 %144, label %145, label %171
145: ; preds = %141
%146 = load double**, double*** %10
%147 = load i32, i32* %13
%148 = zext i32 %147 to i64
%149 = getelementptr inbounds double*, double** %146, i64 %148
%150 = load double*, double** %149
%151 = bitcast double* %150 to i8*
%152 = load i32, i32* %12
%153 = add i32 %152, 512
%154 = zext i32 %153 to i64
%155 = mul i64 8, %154
%156 = trunc i64 %155 to i32
%157 = call i64 @realloc(i8* %151, i32 %156)
%158 = inttoptr i64 %157 to double*
%159 = load double**, double*** %10
%160 = load i32, i32* %13
%161 = zext i32 %160 to i64
%162 = getelementptr inbounds double*, double** %159, i64 %161
store double* %158, double** %162
%163 = icmp eq double* %158, null
br i1 %163, label %164, label %167
164: ; preds = %145
%165 = load i32, i32* %13
%166 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 %165, i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str.1, i64 0, i64 0), i32 78)
store i32 0, i32* %6
br label %209
167: ; preds = %145
br label %168
168: ; preds = %167
%169 = load i32, i32* %13
%170 = add i32 %169, 1
store i32 %170, i32* %13
br label %141
171: ; preds = %141
%172 = load i32, i32* %12
%173 = add i32 %172, 512
store i32 %173, i32* %14
br label %174
174: ; preds = %171, %134
br label %175
175: ; preds = %174, %89
br label %176
176: ; preds = %175, %66
br label %40
177: ; preds = %40
store i32 0, i32* %13
br label %178
178: ; preds = %204, %177
%179 = load i32, i32* %13
%180 = load i32, i32* %8
%181 = icmp ult i32 %179, %180
br i1 %181, label %182, label %207
182: ; preds = %178
%183 = load double**, double*** %10
%184 = load i32, i32* %13
%185 = zext i32 %184 to i64
%186 = getelementptr inbounds double*, double** %183, i64 %185
%187 = load double*, double** %186
%188 = bitcast double* %187 to i8*
%189 = load i32, i32* %12
%190 = zext i32 %189 to i64
%191 = mul i64 8, %190
%192 = trunc i64 %191 to i32
%193 = call i64 @realloc(i8* %188, i32 %192)
%194 = inttoptr i64 %193 to double*
%195 = load double**, double*** %10
%196 = load i32, i32* %13
%197 = zext i32 %196 to i64
%198 = getelementptr inbounds double*, double** %195, i64 %197
store double* %194, double** %198
%199 = icmp eq double* %194, null
br i1 %199, label %200, label %203
200: ; preds = %182
%201 = load i32, i32* %13
%202 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 %201, i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str.1, i64 0, i64 0), i32 90)
store i32 0, i32* %6
br label %209
203: ; preds = %182
br label %204
204: ; preds = %203
%205 = load i32, i32* %13
%206 = add i32 %205, 1
store i32 %206, i32* %13
br label %178
207: ; preds = %178
%208 = load i32, i32* %12
store i32 %208, i32* %6
br label %209
209: ; preds = %207, %200, %164, %32
%210 = load i32, i32* %6
ret i32 %210
}

LLVM IR (-O2):
@.str = [38 x i8] c"Unable to allocate data[%d] in %s:%d\0A\00"
@.str.1 = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/UBC-Astrophysics/kd-match/refs/heads/master/loadfile.c\00"
@.str.2 = [40 x i8] c"Unable to reallocate data[%d] in %s:%d\0A\00"
define i32 @loadfile_fileptr_fs(i32* nocapture %0, i32 %1, i32* nocapture %2, double** nocapture %3, i8* %4) {
%6 = alloca [1024 x i8]
%7 = alloca [100 x i8*]
%8 = alloca i8*
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%10 = bitcast [100 x i8*]* %7 to i8*
%11 = bitcast i8** %8 to i8*
%12 = icmp eq i32 %1, 0
br i1 %12, label %15, label %13
13: ; preds = %5
%14 = zext i32 %1 to i64
br label %23
15: ; preds = %32, %5
%16 = call i64 @fgets(i8* %9, i32 1023, i32* %0)
%17 = icmp eq i64 %16, 0
br i1 %17, label %35, label %18
18: ; preds = %15
%19 = getelementptr inbounds [100 x i8*], [100 x i8*]* %7, i64 0, i64 0
%20 = getelementptr inbounds [100 x i8*], [100 x i8*]* %7, i64 0, i64 100
%21 = zext i32 %1 to i64
%22 = zext i32 %1 to i64
br label %40
23: ; preds = %13, %32
%24 = phi i64 [ 0, %13 ], [ %33, %32 ]
%25 = tail call i64 @malloc(i32 4096)
%26 = inttoptr i64 %25 to double*
%27 = getelementptr inbounds double*, double** %3, i64 %24
store double* %26, double** %27
%28 = icmp eq i64 %25, 0
br i1 %28, label %29, label %32
29: ; preds = %23
%30 = trunc i64 %24 to i32
%31 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %30, i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str.1, i64 0, i64 0), i32 48)
br label %137
32: ; preds = %23
%33 = add nuw nsw i64 %24, 1
%34 = icmp eq i64 %33, %14
br i1 %34, label %15, label %23
35: ; preds = %118, %15
%36 = phi i32 [ 0, %15 ], [ %119, %118 ]
br i1 %12, label %137, label %37
37: ; preds = %35
%38 = shl i32 %36, 3
%39 = zext i32 %1 to i64
br label %123
40: ; preds = %18, %118
%41 = phi i32 [ 1, %18 ], [ %48, %118 ]
%42 = phi i32 [ 512, %18 ], [ %120, %118 ]
%43 = phi i32 [ 0, %18 ], [ %119, %118 ]
%44 = load i8, i8* %9
%45 = icmp eq i8 %44, 42
%46 = sub nsw i32 1, %41
%47 = select i1 %45, i32 %46, i32 %41
%48 = freeze i32 %47
%49 = icmp eq i32 %48, 0
br i1 %49, label %118, label %50
50: ; preds = %40
switch i8 %44, label %51 [
i8 42, label %118
i8 35, label %118
]
51: ; preds = %50
store i8* %9, i8** %8
%52 = call i8* @strsep(i8** %8, i8* %4)
store i8* %52, i8** %19
%53 = icmp eq i8* %52, null
br i1 %53, label %118, label %54
54: ; preds = %51, %62
%55 = phi i8* [ %64, %62 ], [ %52, %51 ]
%56 = phi i8** [ %63, %62 ], [ %19, %51 ]
%57 = load i8, i8* %55
%58 = icmp eq i8 %57, 0
br i1 %58, label %62, label %59
59: ; preds = %54
%60 = getelementptr inbounds i8*, i8** %56, i64 1
%61 = icmp ult i8** %60, %20
br i1 %61, label %62, label %66
62: ; preds = %59, %54
%63 = phi i8** [ %60, %59 ], [ %56, %54 ]
%64 = call i8* @strsep(i8** %8, i8* %4)
store i8* %64, i8** %63
%65 = icmp eq i8* %64, null
br i1 %65, label %66, label %54
66: ; preds = %62, %59
%67 = phi i8** [ %63, %62 ], [ %60, %59 ]
%68 = icmp ugt i8** %67, %19
br i1 %68, label %69, label %118
69: ; preds = %66
br i1 %12, label %95, label %70
70: ; preds = %69
%71 = zext i32 %43 to i64
br label %72
72: ; preds = %70, %85
%73 = phi i64 [ 0, %70 ], [ %90, %85 ]
%74 = getelementptr inbounds i32, i32* %2, i64 %73
%75 = load i32, i32* %74
%76 = zext i32 %75 to i64
%77 = getelementptr inbounds [100 x i8*], [100 x i8*]* %7, i64 0, i64 %76
%78 = icmp ugt i8** %77, %67
br i1 %78, label %85, label %79
79: ; preds = %72
%80 = add i32 %75, -1
%81 = zext i32 %80 to i64
%82 = getelementptr inbounds [100 x i8*], [100 x i8*]* %7, i64 0, i64 %81
%83 = load i8*, i8** %82
%84 = call double @atof(i8* %83)
br label %85
85: ; preds = %72, %79
%86 = phi double [ %84, %79 ], [ 0x7FF8000000000000, %72 ]
%87 = getelementptr inbounds double*, double** %3, i64 %73
%88 = load double*, double** %87
%89 = getelementptr inbounds double, double* %88, i64 %71
store double %86, double* %89
%90 = add nuw nsw i64 %73, 1
%91 = icmp eq i64 %90, %21
br i1 %91, label %92, label %72
92: ; preds = %85
%93 = add i32 %43, 1
%94 = icmp eq i32 %93, %42
br i1 %94, label %98, label %118
95: ; preds = %69
%96 = add i32 %43, 1
%97 = icmp eq i32 %96, %42
br i1 %97, label %116, label %118
98: ; preds = %92
br i1 %12, label %116, label %99
99: ; preds = %98
%100 = shl i32 %43, 3
%101 = add i32 %100, 4104
br label %102
102: ; preds = %99, %113
%103 = phi i64 [ 0, %99 ], [ %114, %113 ]
%104 = getelementptr inbounds double*, double** %3, i64 %103
%105 = bitcast double** %104 to i8**
%106 = load i8*, i8** %105
%107 = call i64 @realloc(i8* %106, i32 %101)
%108 = inttoptr i64 %107 to double*
store double* %108, double** %104
%109 = icmp eq i64 %107, 0
br i1 %109, label %110, label %113
110: ; preds = %102
%111 = trunc i64 %103 to i32
%112 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 %111, i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str.1, i64 0, i64 0), i32 78)
br label %137
113: ; preds = %102
%114 = add nuw nsw i64 %103, 1
%115 = icmp eq i64 %114, %22
br i1 %115, label %116, label %102
116: ; preds = %113, %95, %98
%117 = add i32 %43, 513
br label %118
118: ; preds = %51, %95, %50, %50, %40, %66, %116, %92
%119 = phi i32 [ %42, %116 ], [ %93, %92 ], [ %43, %66 ], [ %43, %50 ], [ %43, %40 ], [ %43, %50 ], [ %96, %95 ], [ %43, %51 ]
%120 = phi i32 [ %117, %116 ], [ %42, %92 ], [ %42, %66 ], [ %42, %50 ], [ %42, %40 ], [ %42, %50 ], [ %42, %95 ], [ %42, %51 ]
%121 = call i64 @fgets(i8* %9, i32 1023, i32* %0)
%122 = icmp eq i64 %121, 0
br i1 %122, label %35, label %40
123: ; preds = %37, %134
%124 = phi i64 [ 0, %37 ], [ %135, %134 ]
%125 = getelementptr inbounds double*, double** %3, i64 %124
%126 = bitcast double** %125 to i8**
%127 = load i8*, i8** %126
%128 = call i64 @realloc(i8* %127, i32 %38)
%129 = inttoptr i64 %128 to double*
store double* %129, double** %125
%130 = icmp eq i64 %128, 0
br i1 %130, label %131, label %134
131: ; preds = %123
%132 = trunc i64 %124 to i32
%133 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 %132, i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str.1, i64 0, i64 0), i32 90)
br label %137
134: ; preds = %123
%135 = add nuw nsw i64 %124, 1
%136 = icmp eq i64 %135, %39
br i1 %136, label %137, label %123
137: ; preds = %134, %35, %131, %110, %29
%138 = phi i32 [ 0, %29 ], [ 0, %110 ], [ 0, %131 ], [ %36, %35 ], [ %36, %134 ]
ret i32 %138
}