#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(int);
int /*<<< orphan*/ parse_file(char *, char *, int *, char *);
int /*<<< orphan*/ print_help();
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
size_t strlen(char *);
int main(int argc, char **argv) {
  int i = 0;
  size_t length = 0;
  char *prefixstring = 0;
  char *logfile = 0;
  char *outputfile = 0;
  int count = 0;
  printf("%d\n", argc);
  for (i = 1; i < argc; i++) {
    if (strcmp(argv[i], "--help") == 0 || strcmp(argv[i], "-h") == 0) {
      print_help();
      return -1;
    }
    if (strcmp(argv[i], "-p") == 0) {
      if (i + 1 == argc) {
        printf("no config file specified after -p\n");
        return -1;
      }
      prefixstring = argv[i + 1];
      i++;
      continue;
    }
    if (strcmp(argv[i], "-o") == 0) {
      if (outputfile != 0) {
        printf("multiple output files specified");
        return -1;
      }
      if (i + 1 == argc) {
        printf("no output file specified after --output");
        return -1;
      }
      outputfile = argv[i + 1];
      i++;
      continue;
    }
    if (logfile == 0) {
      logfile = argv[i];
      continue;
    } else {
      printf("multiple log files not supported\n");
    }
  }
  if (prefixstring == 0) {
    length = strlen("%m [%p]: [%s %c-%l] %S");
    prefixstring = (char *)malloc(sizeof(char) * length + 1);
    if (prefixstring == 0) {
      printf("%s:%d: Could not allocate memory",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/myYearbook/playr/refs/heads/master/src/"
             "parsr.c",
             75);
      return -1;
    }
    strcpy(prefixstring, "%m [%p]: [%s %c-%l] %S");
  }
  if (outputfile == 0) {
    outputfile = (char *)malloc(sizeof(char) * 9);
    if (outputfile == 0) {
      printf("%s:%d: Could not allocate memory",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/myYearbook/playr/refs/heads/master/src/"
             "parsr.c",
             83);
      return -1;
    }
    strcpy(outputfile, "file.out");
  }
  if (logfile == 0) {
    printf("logfile not specified\n");
    return -1;
  }
  printf("config file: %s\n", prefixstring);
  printf("output file: %s\n", outputfile);
  printf("log file: %s\n", logfile);
  parse_file(logfile, outputfile, &count, prefixstring);
  free(prefixstring);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1381 <main+0x201>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe09(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     122c <main+0xac>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdee(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    123f <main+0xbf>
mov    $0x0,%al
call   10a0 <print_help@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14ce <main+0x34e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdbc(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    12ad <main+0x12d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cmp    -0x8(%rbp),%eax
jne    128a <main+0x10a>
lea    0xd9a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14ce <main+0x34e>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1373 <main+0x1f3>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd74(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1340 <main+0x1c0>
cmpq   $0x0,-0x38(%rbp)
je     12f4 <main+0x174>
lea    0xd56(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14ce <main+0x34e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cmp    -0x8(%rbp),%eax
jne    131d <main+0x19d>
lea    0xd4d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14ce <main+0x34e>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x38(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1373 <main+0x1f3>
cmpq   $0x0,-0x30(%rbp)
jne    1360 <main+0x1e0>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x30(%rbp)
jmp    1373 <main+0x1f3>
lea    0xd18(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1373 <main+0x1f3>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11dc <main+0x5c>
cmpq   $0x0,-0x28(%rbp)
jne    13f4 <main+0x274>
lea    0xd0e(%rip),%rdi
call   1050 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
shl    $0x0,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    13e4 <main+0x264>
lea    0xcf3(%rip),%rdi
lea    0xd0d(%rip),%rsi
mov    $0x4b,%edx
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14ce <main+0x34e>
mov    -0x28(%rbp),%rdi
lea    0xcb2(%rip),%rsi
call   1040 <strcpy@plt>
cmpq   $0x0,-0x38(%rbp)
jne    144e <main+0x2ce>
mov    $0x9,%edi
call   1080 <malloc@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    143e <main+0x2be>
lea    0xc99(%rip),%rdi
lea    0xcb3(%rip),%rsi
mov    $0x53,%edx
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14ce <main+0x34e>
mov    -0x38(%rbp),%rdi
lea    0xd19(%rip),%rsi
call   1040 <strcpy@plt>
cmpq   $0x0,-0x30(%rbp)
jne    1473 <main+0x2f3>
lea    0xd0b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14ce <main+0x34e>
mov    -0x28(%rbp),%rsi
lea    0xd04(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x38(%rbp),%rsi
lea    0xd03(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x30(%rbp),%rsi
lea    0xd02(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x28(%rbp),%rcx
lea    -0x3c(%rbp),%rdx
call   1090 <parse_file@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
movl   $0x0,0xc(%rsp)
lea    0xe5e(%rip),%rdi
xor    %r12d,%r12d
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    $0x2,%ebp
jl     12a2 <main+0x122>
mov    $0x1,%r13d
xor    %r12d,%r12d
xor    %r15d,%r15d
xor    %eax,%eax
mov    %rax,0x10(%rsp)
jmp    11e9 <main+0x69>
nopl   0x0(%rax)
lea    0xf92(%rip),%rdi
call   1050 <puts@plt>
add    $0x1,%r13d
cmp    %ebp,%r13d
jge    1381 <main+0x201>
movslq %r13d,%r14
mov    (%rbx,%r14,8),%rdi
lea    0xe0d(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     132d <main+0x1ad>
mov    (%rbx,%r14,8),%rdi
lea    0xdfb(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     132d <main+0x1ad>
mov    (%rbx,%r14,8),%rdi
lea    0xf80(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1260 <main+0xe0>
mov    (%rbx,%r14,8),%rdi
lea    0xdd0(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1280 <main+0x100>
test   %r15,%r15
jne    11d0 <main+0x50>
mov    (%rbx,%r14,8),%r15
jmp    11dc <main+0x5c>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%r13d
cmp    %ebp,%r13d
je     13b0 <main+0x230>
movslq %r13d,%rax
mov    (%rbx,%rax,8),%rax
mov    %rax,0x10(%rsp)
jmp    11dc <main+0x5c>
xchg   %ax,%ax
test   %r12,%r12
jne    13be <main+0x23e>
add    $0x1,%r13d
cmp    %ebp,%r13d
je     13c7 <main+0x247>
movslq %r13d,%rax
mov    (%rbx,%rax,8),%r12
jmp    11dc <main+0x5c>
xor    %r15d,%r15d
mov    $0x17,%edi
call   1080 <malloc@plt>
test   %rax,%rax
je     1339 <main+0x1b9>
mov    %rax,%rbp
lea    0xd97(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
test   %r12,%r12
je     134e <main+0x1ce>
test   %r15,%r15
je     1378 <main+0x1f8>
lea    0xe44(%rip),%rdi
xor    %ebx,%ebx
mov    %rbp,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe42(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe42(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xc(%rsp),%rdx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbp,%rcx
call   1090 <parse_file@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
jmp    13da <main+0x25a>
xor    %eax,%eax
call   10a0 <print_help@plt>
jmp    13d5 <main+0x255>
lea    0xd30(%rip),%rdi
lea    0xd4a(%rip),%rsi
mov    $0x4b,%edx
jmp    13a7 <main+0x227>
mov    $0x9,%edi
call   1080 <malloc@plt>
test   %rax,%rax
je     1394 <main+0x214>
mov    %rax,%r12
lea    0xdb3(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
test   %r15,%r15
jne    12d8 <main+0x158>
lea    0xdd4(%rip),%rdi
jmp    13b7 <main+0x237>
mov    0x10(%rsp),%rbp
test   %rbp,%rbp
jne    12ca <main+0x14a>
jmp    12a5 <main+0x125>
lea    0xcd5(%rip),%rdi
lea    0xcef(%rip),%rsi
mov    $0x53,%edx
xor    %eax,%eax
call   1060 <printf@plt>
jmp    13d5 <main+0x255>
lea    0xdd3(%rip),%rdi
call   1050 <puts@plt>
jmp    13d5 <main+0x255>
lea    0xc4c(%rip),%rdi
jmp    13ce <main+0x24e>
lea    0xc63(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [7 x i8] c"--help\00"
@.str.2 = [3 x i8] c"-h\00"
@.str.3 = [3 x i8] c"-p\00"
@.str.4 = [35 x i8] c"no config file specified after -p\0A\00"
@.str.5 = [3 x i8] c"-o\00"
@.str.6 = [32 x i8] c"multiple output files specified\00"
@.str.7 = [40 x i8] c"no output file specified after --output\00"
@.str.8 = [34 x i8] c"multiple log files not supported\0A\00"
@.str.9 = [23 x i8] c"%m [%p]: [%s %c-%l] %S\00"
@.str.10 = [33 x i8] c"%s:%d: Could not allocate memory\00"
@.str.11 = [137 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/myYearbook/playr/refs/heads/master/src/parsr.c\00"
@.str.12 = [9 x i8] c"file.out\00"
@.str.13 = [23 x i8] c"logfile not specified\0A\00"
@.str.14 = [17 x i8] c"config file: %s\0A\00"
@.str.15 = [17 x i8] c"output file: %s\0A\00"
@.str.16 = [14 x i8] c"log file: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i64 0, i64* %7
store i8* null, i8** %8
store i8* null, i8** %9
store i8* null, i8** %10
store i32 0, i32* %11
%12 = load i32, i32* %4
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
store i32 1, i32* %6
br label %14
14: ; preds = %101, %2
%15 = load i32, i32* %6
%16 = load i32, i32* %4
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %104
18: ; preds = %14
%19 = load i8**, i8*** %5
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %19, i64 %21
%23 = load i8*, i8** %22
%24 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %34, label %26
26: ; preds = %18
%27 = load i8**, i8*** %5
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8*, i8** %27, i64 %29
%31 = load i8*, i8** %30
%32 = call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %26, %18
%35 = call i32 (...) @print_help()
store i32 -1, i32* %3
br label %153
36: ; preds = %26
%37 = load i8**, i8*** %5
%38 = load i32, i32* %6
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i8*, i8** %37, i64 %39
%41 = load i8*, i8** %40
%42 = call i64 @strcmp(i8* %41, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %60
44: ; preds = %36
%45 = load i32, i32* %6
%46 = add nsw i32 %45, 1
%47 = load i32, i32* %4
%48 = icmp eq i32 %46, %47
br i1 %48, label %49, label %51
49: ; preds = %44
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
store i32 -1, i32* %3
br label %153
51: ; preds = %44
%52 = load i8**, i8*** %5
%53 = load i32, i32* %6
%54 = add nsw i32 %53, 1
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i8*, i8** %52, i64 %55
%57 = load i8*, i8** %56
store i8* %57, i8** %8
%58 = load i32, i32* %6
%59 = add nsw i32 %58, 1
store i32 %59, i32* %6
br label %101
60: ; preds = %36
%61 = load i8**, i8*** %5
%62 = load i32, i32* %6
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i8*, i8** %61, i64 %63
%65 = load i8*, i8** %64
%66 = call i64 @strcmp(i8* %65, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%67 = icmp eq i64 %66, 0
br i1 %67, label %68, label %89
68: ; preds = %60
%69 = load i8*, i8** %10
%70 = icmp ne i8* %69, null
br i1 %70, label %71, label %73
71: ; preds = %68
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0))
store i32 -1, i32* %3
br label %153
73: ; preds = %68
%74 = load i32, i32* %6
%75 = add nsw i32 %74, 1
%76 = load i32, i32* %4
%77 = icmp eq i32 %75, %76
br i1 %77, label %78, label %80
78: ; preds = %73
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.7, i64 0, i64 0))
store i32 -1, i32* %3
br label %153
80: ; preds = %73
%81 = load i8**, i8*** %5
%82 = load i32, i32* %6
%83 = add nsw i32 %82, 1
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i8*, i8** %81, i64 %84
%86 = load i8*, i8** %85
store i8* %86, i8** %10
%87 = load i32, i32* %6
%88 = add nsw i32 %87, 1
store i32 %88, i32* %6
br label %101
89: ; preds = %60
%90 = load i8*, i8** %9
%91 = icmp eq i8* %90, null
br i1 %91, label %92, label %98
92: ; preds = %89
%93 = load i8**, i8*** %5
%94 = load i32, i32* %6
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds i8*, i8** %93, i64 %95
%97 = load i8*, i8** %96
store i8* %97, i8** %9
br label %101
98: ; preds = %89
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0))
br label %100
100: ; preds = %98
br label %101
101: ; preds = %100, %92, %80, %51
%102 = load i32, i32* %6
%103 = add nsw i32 %102, 1
store i32 %103, i32* %6
br label %14
104: ; preds = %14
%105 = load i8*, i8** %8
%106 = icmp eq i8* %105, null
br i1 %106, label %107, label %122
107: ; preds = %104
%108 = call i64 @strlen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0))
store i64 %108, i64* %7
%109 = load i64, i64* %7
%110 = mul i64 1, %109
%111 = add i64 %110, 1
%112 = trunc i64 %111 to i32
%113 = call i64 @malloc(i32 %112)
%114 = inttoptr i64 %113 to i8*
store i8* %114, i8** %8
%115 = load i8*, i8** %8
%116 = icmp eq i8* %115, null
br i1 %116, label %117, label %119
117: ; preds = %107
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.11, i64 0, i64 0), i32 75)
store i32 -1, i32* %3
br label %153
119: ; preds = %107
%120 = load i8*, i8** %8
%121 = call i32 @strcpy(i8* %120, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0))
br label %122
122: ; preds = %119, %104
%123 = load i8*, i8** %10
%124 = icmp eq i8* %123, null
br i1 %124, label %125, label %135
125: ; preds = %122
%126 = call i64 @malloc(i32 9)
%127 = inttoptr i64 %126 to i8*
store i8* %127, i8** %10
%128 = load i8*, i8** %10
%129 = icmp eq i8* %128, null
br i1 %129, label %130, label %132
130: ; preds = %125
%131 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.11, i64 0, i64 0), i32 83)
store i32 -1, i32* %3
br label %153
132: ; preds = %125
%133 = load i8*, i8** %10
%134 = call i32 @strcpy(i8* %133, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0))
br label %135
135: ; preds = %132, %122
%136 = load i8*, i8** %9
%137 = icmp eq i8* %136, null
br i1 %137, label %138, label %140
138: ; preds = %135
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.13, i64 0, i64 0))
store i32 -1, i32* %3
br label %153
140: ; preds = %135
%141 = load i8*, i8** %8
%142 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0), i8* %141)
%143 = load i8*, i8** %10
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.15, i64 0, i64 0), i8* %143)
%145 = load i8*, i8** %9
%146 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.16, i64 0, i64 0), i8* %145)
%147 = load i8*, i8** %9
%148 = load i8*, i8** %10
%149 = load i8*, i8** %8
%150 = call i32 @parse_file(i8* %147, i8* %148, i32* %11, i8* %149)
%151 = load i8*, i8** %8
%152 = call i32 @free(i8* %151)
store i32 0, i32* %3
br label %153
153: ; preds = %140, %138, %130, %117, %78, %71, %49, %34
%154 = load i32, i32* %3
ret i32 %154
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [7 x i8] c"--help\00"
@.str.2 = [3 x i8] c"-h\00"
@.str.3 = [3 x i8] c"-p\00"
@.str.5 = [3 x i8] c"-o\00"
@.str.6 = [32 x i8] c"multiple output files specified\00"
@.str.7 = [40 x i8] c"no output file specified after --output\00"
@.str.9 = [23 x i8] c"%m [%p]: [%s %c-%l] %S\00"
@.str.10 = [33 x i8] c"%s:%d: Could not allocate memory\00"
@.str.11 = [137 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/myYearbook/playr/refs/heads/master/src/parsr.c\00"
@.str.12 = [9 x i8] c"file.out\00"
@.str.14 = [17 x i8] c"config file: %s\0A\00"
@.str.15 = [17 x i8] c"output file: %s\0A\00"
@.str.16 = [14 x i8] c"log file: %s\0A\00"
@str = [22 x i8] c"logfile not specified\00"
@str.17 = [33 x i8] c"multiple log files not supported\00"
@str.18 = [34 x i8] c"no config file specified after -p\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = icmp sgt i32 %0, 1
br i1 %6, label %7, label %68
7: ; preds = %2, %59
%8 = phi i8* [ %63, %59 ], [ null, %2 ]
%9 = phi i8* [ %62, %59 ], [ null, %2 ]
%10 = phi i8* [ %61, %59 ], [ null, %2 ]
%11 = phi i32 [ %64, %59 ], [ 1, %2 ]
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8*, i8** %1, i64 %12
%14 = load i8*, i8** %13
%15 = tail call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %21, label %17
17: ; preds = %7
%18 = load i8*, i8** %13
%19 = tail call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %17, %7
%22 = tail call i32 (...) @print_help()
br label %102
23: ; preds = %17
%24 = load i8*, i8** %13
%25 = tail call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %36
27: ; preds = %23
%28 = add nsw i32 %11, 1
%29 = icmp eq i32 %28, %0
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.18, i64 0, i64 0))
br label %102
32: ; preds = %27
%33 = sext i32 %28 to i64
%34 = getelementptr inbounds i8*, i8** %1, i64 %33
%35 = load i8*, i8** %34
br label %59
36: ; preds = %23
%37 = load i8*, i8** %13
%38 = tail call i64 @strcmp(i8* %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %53
40: ; preds = %36
%41 = icmp eq i8* %8, null
br i1 %41, label %44, label %42
42: ; preds = %40
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0))
br label %102
44: ; preds = %40
%45 = add nsw i32 %11, 1
%46 = icmp eq i32 %45, %0
br i1 %46, label %47, label %49
47: ; preds = %44
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.7, i64 0, i64 0))
br label %102
49: ; preds = %44
%50 = sext i32 %45 to i64
%51 = getelementptr inbounds i8*, i8** %1, i64 %50
%52 = load i8*, i8** %51
br label %59
53: ; preds = %36
%54 = icmp eq i8* %9, null
br i1 %54, label %55, label %57
55: ; preds = %53
%56 = load i8*, i8** %13
br label %59
57: ; preds = %53
%58 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.17, i64 0, i64 0))
br label %59
59: ; preds = %57, %55, %49, %32
%60 = phi i32 [ %28, %32 ], [ %45, %49 ], [ %11, %55 ], [ %11, %57 ]
%61 = phi i8* [ %35, %32 ], [ %10, %49 ], [ %10, %55 ], [ %10, %57 ]
%62 = phi i8* [ %9, %32 ], [ %9, %49 ], [ %56, %55 ], [ %9, %57 ]
%63 = phi i8* [ %8, %32 ], [ %52, %49 ], [ %8, %55 ], [ %8, %57 ]
%64 = add nsw i32 %60, 1
%65 = icmp slt i32 %64, %0
br i1 %65, label %7, label %66
66: ; preds = %59
%67 = icmp eq i8* %61, null
br i1 %67, label %68, label %78
68: ; preds = %2, %66
%69 = phi i8* [ %63, %66 ], [ null, %2 ]
%70 = phi i8* [ %62, %66 ], [ null, %2 ]
%71 = tail call i64 @malloc(i32 23)
%72 = inttoptr i64 %71 to i8*
%73 = icmp eq i64 %71, 0
br i1 %73, label %74, label %76
74: ; preds = %68
%75 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.11, i64 0, i64 0), i32 75)
br label %102
76: ; preds = %68
%77 = tail call i32 @strcpy(i8* %72, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0))
br label %78
78: ; preds = %76, %66
%79 = phi i8* [ %69, %76 ], [ %63, %66 ]
%80 = phi i8* [ %70, %76 ], [ %62, %66 ]
%81 = phi i8* [ %72, %76 ], [ %61, %66 ]
%82 = icmp eq i8* %79, null
br i1 %82, label %83, label %91
83: ; preds = %78
%84 = tail call i64 @malloc(i32 9)
%85 = inttoptr i64 %84 to i8*
%86 = icmp eq i64 %84, 0
br i1 %86, label %87, label %89
87: ; preds = %83
%88 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.11, i64 0, i64 0), i32 83)
br label %102
89: ; preds = %83
%90 = tail call i32 @strcpy(i8* %85, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0))
br label %91
91: ; preds = %89, %78
%92 = phi i8* [ %85, %89 ], [ %79, %78 ]
%93 = icmp eq i8* %80, null
br i1 %93, label %94, label %96
94: ; preds = %91
%95 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
br label %102
96: ; preds = %91
%97 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0), i8* %81)
%98 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.15, i64 0, i64 0), i8* %92)
%99 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.16, i64 0, i64 0), i8* %80)
%100 = call i32 @parse_file(i8* %80, i8* %92, i32* %3, i8* %81)
%101 = call i32 @free(i8* %81)
br label %102
102: ; preds = %96, %94, %87, %74, %47, %42, %30, %21
%103 = phi i32 [ -1, %21 ], [ -1, %30 ], [ -1, %42 ], [ -1, %47 ], [ -1, %74 ], [ -1, %87 ], [ -1, %94 ], [ 0, %96 ]
ret i32 %103
}