#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 */

/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ myWarn_Loc(int, char *, int, char *);
scalar_t__ realloc(void *, size_t);
char *strchr(char const *, char);
int /*<<< orphan*/ strcpy(char *, char const *);
size_t strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
int /*<<< orphan*/ strncpyTrim(char *, char const *, size_t);
int mySplit(const char *data, char symbol, size_t *Argc, char ***Argv,
            char f_trim) {
  const char *head;
  const char *ptr;
  size_t argc;
  char **argv;
  size_t len;
  size_t i;
  for (i = 0; i < *Argc; i++) {
    free((*Argv)[i]);
  }
  argc = 0;
  head = data;
  while (head != NULL) {
    ptr = strchr(head, symbol);
    if (ptr != NULL) {
      head = ptr + 1;
      if ((head != NULL) && (*head == '\0')) {
        head = NULL;
      }
    } else {
      head = NULL;
    }
    ++argc;
  }
  if (*Argc == 0) {
    if ((argv = (char **)malloc(argc * sizeof(char *))) == NULL) {
      myWarn_Loc(3,
                 "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/brianmckenna/rex2nc/refs/"
                 "heads/master/src/libaat/myutil.c",
                 208, "Ran out of memory\n");
      return -1;
    }
  } else if (*Argc != argc) {
    argv = (char **)realloc((void *)(*Argv), argc * sizeof(char *));
    if (argv == NULL) {
      myWarn_Loc(3,
                 "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/brianmckenna/rex2nc/refs/"
                 "heads/master/src/libaat/myutil.c",
                 214, "Ran out of memory\n");
      return -1;
    }
  } else {
    argv = *Argv;
  }
  head = data;
  i = 0;
  while (head != NULL) {
    ptr = strchr(head, symbol);
    if (ptr != NULL) {
      len = ptr - head;
      if ((argv[i] = (char *)malloc(len + 1)) == NULL) {
        myWarn_Loc(3,
                   "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/brianmckenna/rex2nc/refs/"
                   "heads/master/src/libaat/myutil.c",
                   229, "Ran out of memory\n");
        return -1;
      }
      if (f_trim) {
        strncpyTrim(argv[i], head, len);
      } else {
        strncpy(argv[i], head, len);
        argv[i][len] = '\0';
      }
      head = ptr + 1;
      if ((head != NULL) && (*head == '\0')) {
        head = NULL;
      }
    } else {
      len = strlen(head);
      if ((argv[i] = (char *)malloc(len + 1)) == NULL) {
        myWarn_Loc(3,
                   "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/brianmckenna/rex2nc/refs/"
                   "heads/master/src/libaat/myutil.c",
                   247, "Ran out of memory\n");
        return -1;
      }
      if (f_trim) {
        strncpyTrim(argv[i], head, len);
      } else {
        strcpy(argv[i], head);
      }
      head = NULL;
    }
    ++i;
  }
  *Argc = argc;
  *Argv = argv;
  return 0;
}


x86 assembly (clang, -O0):
<mySplit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %r8b,%al
mov    %rdi,-0x10(%rbp)
mov    %sil,-0x11(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %al,-0x29(%rbp)
movq   $0x0,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%rax
jae    11ec <mySplit+0x5c>
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    -0x60(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x60(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x60(%rbp)
jmp    11b6 <mySplit+0x26>
movq   $0x0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     1270 <mySplit+0xe0>
mov    -0x38(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1070 <strchr@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     1257 <mySplit+0xc7>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     1252 <mySplit+0xc2>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1252 <mySplit+0xc2>
movq   $0x0,-0x38(%rbp)
jmp    125f <mySplit+0xcf>
movq   $0x0,-0x38(%rbp)
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    11fc <mySplit+0x6c>
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
jne    12c7 <mySplit+0x137>
mov    -0x48(%rbp),%rdi
shl    $0x3,%rdi
call   1080 <malloc@plt>
mov    %rax,-0x50(%rbp)
cmp    $0x0,%rax
jne    12c2 <mySplit+0x132>
mov    $0x3,%edi
lea    0xd5b(%rip),%rsi
mov    $0xd0,%edx
lea    0xde3(%rip),%rcx
call   10b0 <myWarn_Loc@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1520 <mySplit+0x390>
jmp    1339 <mySplit+0x1a9>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
cmp    -0x48(%rbp),%rax
je     1329 <mySplit+0x199>
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
mov    -0x48(%rbp),%rsi
shl    $0x3,%rsi
call   1090 <realloc@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    1324 <mySplit+0x194>
mov    $0x3,%edi
lea    0xcf9(%rip),%rsi
mov    $0xd6,%edx
lea    0xd81(%rip),%rcx
call   10b0 <myWarn_Loc@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1520 <mySplit+0x390>
jmp    1334 <mySplit+0x1a4>
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x50(%rbp)
jmp    1339 <mySplit+0x1a9>
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
movq   $0x0,-0x60(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     1503 <mySplit+0x373>
mov    -0x38(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1070 <strchr@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     1454 <mySplit+0x2c4>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
add    $0x1,%rdi
call   1080 <malloc@plt>
mov    -0x50(%rbp),%rcx
mov    -0x60(%rbp),%rdx
mov    %rax,(%rcx,%rdx,8)
cmp    $0x0,%rax
jne    13cb <mySplit+0x23b>
mov    $0x3,%edi
lea    0xc52(%rip),%rsi
mov    $0xe5,%edx
lea    0xcda(%rip),%rcx
call   10b0 <myWarn_Loc@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1520 <mySplit+0x390>
cmpb   $0x0,-0x29(%rbp)
je     13f3 <mySplit+0x263>
mov    -0x50(%rbp),%rax
mov    -0x60(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x58(%rbp),%rdx
call   10a0 <strncpyTrim@plt>
jmp    1420 <mySplit+0x290>
mov    -0x50(%rbp),%rax
mov    -0x60(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x58(%rbp),%rdx
call   1040 <strncpy@plt>
mov    -0x50(%rbp),%rax
mov    -0x60(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x58(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     144f <mySplit+0x2bf>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    144f <mySplit+0x2bf>
movq   $0x0,-0x38(%rbp)
jmp    14f2 <mySplit+0x362>
mov    -0x38(%rbp),%rdi
call   1060 <strlen@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
add    $0x1,%rdi
call   1080 <malloc@plt>
mov    -0x50(%rbp),%rcx
mov    -0x60(%rbp),%rdx
mov    %rax,(%rcx,%rdx,8)
cmp    $0x0,%rax
jne    14ad <mySplit+0x31d>
mov    $0x3,%edi
lea    0xb70(%rip),%rsi
mov    $0xf7,%edx
lea    0xbf8(%rip),%rcx
call   10b0 <myWarn_Loc@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1520 <mySplit+0x390>
cmpb   $0x0,-0x29(%rbp)
je     14d5 <mySplit+0x345>
mov    -0x50(%rbp),%rax
mov    -0x60(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x58(%rbp),%rdx
call   10a0 <strncpyTrim@plt>
jmp    14ea <mySplit+0x35a>
mov    -0x50(%rbp),%rax
mov    -0x60(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x38(%rbp),%rsi
call   1050 <strcpy@plt>
movq   $0x0,-0x38(%rbp)
mov    -0x60(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x60(%rbp)
jmp    1349 <mySplit+0x1b9>
mov    -0x48(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x50(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mySplit>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r8d,0x14(%rsp)
mov    %rcx,%r15
mov    %rdx,%r12
mov    %esi,%r14d
mov    %rdi,%r13
cmpq   $0x0,(%rdx)
je     11db <mySplit+0x4b>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r15),%rax
mov    (%rax,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
mov    (%r12),%rbp
cmp    %rbp,%rbx
jb     11c0 <mySplit+0x30>
jmp    11dd <mySplit+0x4d>
xor    %ebp,%ebp
movsbl %r14b,%ebx
test   %r13,%r13
mov    %r12,0x20(%rsp)
je     1231 <mySplit+0xa1>
mov    %r13,%rdi
mov    %ebx,%esi
call   1070 <strchr@plt>
mov    $0x1,%r12d
test   %rax,%rax
je     121d <mySplit+0x8d>
cmpb   $0x0,0x1(%rax)
je     121d <mySplit+0x8d>
add    $0x1,%rax
add    $0x1,%r12
mov    %rax,%rdi
mov    %ebx,%esi
call   1070 <strchr@plt>
test   %rax,%rax
jne    1200 <mySplit+0x70>
test   %rbp,%rbp
je     1239 <mySplit+0xa9>
cmp    %r12,%rbp
jne    126d <mySplit+0xdd>
mov    (%r15),%rax
mov    %rax,0x8(%rsp)
jmp    128b <mySplit+0xfb>
xor    %r12d,%r12d
test   %rbp,%rbp
jne    1222 <mySplit+0x92>
lea    0x0(,%r12,8),%rdi
call   1080 <malloc@plt>
mov    %rax,0x8(%rsp)
test   %rax,%rax
jne    128b <mySplit+0xfb>
lea    0xda9(%rip),%rsi
lea    0xe36(%rip),%rcx
mov    $0x3,%edi
mov    $0xd0,%edx
jmp    13e1 <mySplit+0x251>
mov    (%r15),%rdi
lea    0x0(,%r12,8),%rsi
call   1090 <realloc@plt>
mov    %rax,0x8(%rsp)
test   %rax,%rax
je     1395 <mySplit+0x205>
mov    %r15,0x18(%rsp)
test   %r13,%r13
je     13f8 <mySplit+0x268>
mov    %r13,%rdi
mov    %ebx,%esi
call   1070 <strchr@plt>
test   %rax,%rax
je     1359 <mySplit+0x1c9>
mov    %rax,%r15
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rbp
sub    %r13,%rbp
lea    0x1(%rbp),%rdi
call   1080 <malloc@plt>
mov    0x8(%rsp),%rcx
mov    %rax,(%rcx,%r14,8)
test   %rax,%rax
je     13af <mySplit+0x21f>
cmpb   $0x0,0x14(%rsp)
je     1310 <mySplit+0x180>
mov    %rax,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   10a0 <strncpyTrim@plt>
cmpb   $0x0,0x1(%r15)
jne    1336 <mySplit+0x1a6>
jmp    13f8 <mySplit+0x268>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rax,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1040 <strncpy@plt>
mov    0x8(%rsp),%rax
mov    (%rax,%r14,8),%rax
movb   $0x0,(%rax,%rbp,1)
cmpb   $0x0,0x1(%r15)
je     13f8 <mySplit+0x268>
mov    %r15,%r13
add    $0x1,%r13
add    $0x1,%r14
mov    %r13,%rdi
mov    %ebx,%esi
call   1070 <strchr@plt>
mov    %rax,%r15
test   %rax,%rax
jne    12c0 <mySplit+0x130>
jmp    135c <mySplit+0x1cc>
xor    %r14d,%r14d
mov    %r13,%rdi
call   1060 <strlen@plt>
mov    %rax,%rbp
lea    0x1(%rax),%rdi
call   1080 <malloc@plt>
mov    0x8(%rsp),%rcx
mov    %rax,(%rcx,%r14,8)
test   %rax,%rax
je     13c9 <mySplit+0x239>
cmpb   $0x0,0x14(%rsp)
je     13ed <mySplit+0x25d>
mov    %rax,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   10a0 <strncpyTrim@plt>
jmp    13f8 <mySplit+0x268>
lea    0xc64(%rip),%rsi
lea    0xcf1(%rip),%rcx
mov    $0x3,%edi
mov    $0xd6,%edx
jmp    13e1 <mySplit+0x251>
lea    0xc4a(%rip),%rsi
lea    0xcd7(%rip),%rcx
mov    $0x3,%edi
mov    $0xe5,%edx
jmp    13e1 <mySplit+0x251>
lea    0xc30(%rip),%rsi
lea    0xcbd(%rip),%rcx
mov    $0x3,%edi
mov    $0xf7,%edx
call   10b0 <myWarn_Loc@plt>
mov    $0xffffffff,%eax
jmp    140f <mySplit+0x27f>
mov    %rax,%rdi
mov    %r13,%rsi
call   1050 <strcpy@plt>
mov    0x20(%rsp),%rax
mov    %r12,(%rax)
mov    0x18(%rsp),%rax
mov    0x8(%rsp),%rcx
mov    %rcx,(%rax)
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/brianmckenna/rex2nc/refs/heads/master/src/libaat/myutil.c\00"
@.str.1 = [19 x i8] c"Ran out of memory\0A\00"
define i32 @mySplit(i8* %0, i8 signext %1, i64* nocapture %2, i8*** nocapture %3, i8 signext %4) {
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %14, %5
%9 = phi i64 [ 0, %5 ], [ %21, %14 ]
%10 = icmp eq i8* %0, null
br i1 %10, label %33, label %11
11: ; preds = %8
%12 = tail call i8* @strchr(i8* %0, i8 signext %1)
%13 = icmp eq i8* %12, null
br i1 %13, label %33, label %23
14: ; preds = %5, %14
%15 = phi i64 [ %20, %14 ], [ 0, %5 ]
%16 = load i8**, i8*** %3
%17 = getelementptr inbounds i8*, i8** %16, i64 %15
%18 = load i8*, i8** %17
%19 = tail call i32 @free(i8* %18)
%20 = add nuw i64 %15, 1
%21 = load i64, i64* %2
%22 = icmp ult i64 %20, %21
br i1 %22, label %14, label %8
23: ; preds = %11, %29
%24 = phi i8* [ %31, %29 ], [ %12, %11 ]
%25 = phi i64 [ %30, %29 ], [ 1, %11 ]
%26 = getelementptr inbounds i8, i8* %24, i64 1
%27 = load i8, i8* %26
%28 = icmp eq i8 %27, 0
br i1 %28, label %33, label %29
29: ; preds = %23
%30 = add i64 %25, 1
%31 = tail call i8* @strchr(i8* %26, i8 signext %1)
%32 = icmp eq i8* %31, null
br i1 %32, label %33, label %23
33: ; preds = %23, %29, %11, %8
%34 = phi i64 [ 0, %8 ], [ 1, %11 ], [ %30, %29 ], [ %25, %23 ]
%35 = icmp eq i64 %9, 0
br i1 %35, label %36, label %43
36: ; preds = %33
%37 = shl i64 %34, 3
%38 = tail call i64 @malloc(i64 %37)
%39 = inttoptr i64 %38 to i8**
%40 = icmp eq i64 %38, 0
br i1 %40, label %41, label %56
41: ; preds = %36
%42 = tail call i32 @myWarn_Loc(i32 3, i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i32 208, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %108
43: ; preds = %33
%44 = icmp eq i64 %9, %34
br i1 %44, label %54, label %45
45: ; preds = %43
%46 = bitcast i8*** %3 to i8**
%47 = load i8*, i8** %46
%48 = shl i64 %34, 3
%49 = tail call i64 @realloc(i8* %47, i64 %48)
%50 = inttoptr i64 %49 to i8**
%51 = icmp eq i64 %49, 0
br i1 %51, label %52, label %56
52: ; preds = %45
%53 = tail call i32 @myWarn_Loc(i32 3, i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i32 214, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %108
54: ; preds = %43
%55 = load i8**, i8*** %3
br label %56
56: ; preds = %54, %45, %36
%57 = phi i8** [ %39, %36 ], [ %50, %45 ], [ %55, %54 ]
br i1 %10, label %107, label %58
58: ; preds = %56
%59 = icmp eq i8 %4, 0
%60 = tail call i8* @strchr(i8* %0, i8 signext %1)
%61 = icmp eq i8* %60, null
br i1 %61, label %87, label %62
62: ; preds = %58, %103
%63 = phi i8* [ %105, %103 ], [ %60, %58 ]
%64 = phi i8* [ %84, %103 ], [ %0, %58 ]
%65 = phi i64 [ %104, %103 ], [ 0, %58 ]
%66 = ptrtoint i8* %63 to i64
%67 = ptrtoint i8* %64 to i64
%68 = sub i64 %66, %67
%69 = add i64 %68, 1
%70 = tail call i64 @malloc(i64 %69)
%71 = inttoptr i64 %70 to i8*
%72 = getelementptr inbounds i8*, i8** %57, i64 %65
store i8* %71, i8** %72
%73 = icmp eq i64 %70, 0
br i1 %73, label %74, label %76
74: ; preds = %62
%75 = tail call i32 @myWarn_Loc(i32 3, i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i32 229, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %108
76: ; preds = %62
br i1 %59, label %79, label %77
77: ; preds = %76
%78 = tail call i32 @strncpyTrim(i8* %71, i8* %64, i64 %68)
br label %83
79: ; preds = %76
%80 = tail call i32 @strncpy(i8* %71, i8* %64, i64 %68)
%81 = load i8*, i8** %72
%82 = getelementptr inbounds i8, i8* %81, i64 %68
store i8 0, i8* %82
br label %83
83: ; preds = %79, %77
%84 = getelementptr inbounds i8, i8* %63, i64 1
%85 = load i8, i8* %84
%86 = icmp eq i8 %85, 0
br i1 %86, label %107, label %103
87: ; preds = %103, %58
%88 = phi i64 [ 0, %58 ], [ %104, %103 ]
%89 = phi i8* [ %0, %58 ], [ %84, %103 ]
%90 = tail call i64 @strlen(i8* %89)
%91 = add i64 %90, 1
%92 = tail call i64 @malloc(i64 %91)
%93 = inttoptr i64 %92 to i8*
%94 = getelementptr inbounds i8*, i8** %57, i64 %88
store i8* %93, i8** %94
%95 = icmp eq i64 %92, 0
br i1 %95, label %96, label %98
96: ; preds = %87
%97 = tail call i32 @myWarn_Loc(i32 3, i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i32 247, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %108
98: ; preds = %87
br i1 %59, label %101, label %99
99: ; preds = %98
%100 = tail call i32 @strncpyTrim(i8* %93, i8* %89, i64 %90)
br label %107
101: ; preds = %98
%102 = tail call i32 @strcpy(i8* %93, i8* %89)
br label %107
103: ; preds = %83
%104 = add i64 %65, 1
%105 = tail call i8* @strchr(i8* %84, i8 signext %1)
%106 = icmp eq i8* %105, null
br i1 %106, label %87, label %62
107: ; preds = %83, %99, %101, %56
store i64 %34, i64* %2
store i8** %57, i8*** %3
br label %108
108: ; preds = %107, %96, %74, %52, %41
%109 = phi i32 [ -1, %41 ], [ -1, %74 ], [ -1, %96 ], [ 0, %107 ], [ -1, %52 ]
ret i32 %109
}