#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 atoi(char *);
int /*<<< orphan*/ free(char *);
char *malloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char *);
char *strdup(char const *);
scalar_t__ strlen(char const *);
char *strtok(char *, char *);
int pgheader_parse(const char *header, char **variants, char **comment) {
  int ret, count, j;
  char *header_dup;
  char *token;
  char *variant;
  int nbpredef;
  int cf;
  header_dup = strdup(header);
  *variants = malloc(strlen(header) + 1);
  *comment = malloc(strlen(header) + 1);
  ret = 0;
  (*variants)[0] = '\0';
  (*comment)[0] = '\0';
  token = strtok(header_dup, "\x0a");
  cf = 0;
  if (token) {
    token = strtok(NULL, "\x0a");
    if (token) {
      token = strtok(NULL, "\x0a");
      if (token) {
        nbpredef = atoi(token);
        token = strtok(NULL, "\x0a");
        if (token) {
          count = atoi(token);
          cf++;
          if (count >= 0) {
            for (j = 0; j < count; j++) {
              variant = strtok(NULL, "\x0a");
              cf++;
              if ((*variants)[0] != 0) {
                strcat(*variants, "\x0a");
              }
              strcat(*variants, variant);
            }
          } else {
            ret = 1;
          }
        } else {
          ret = 1;
        }
      } else {
        ret = 1;
      }
    } else {
      ret = 1;
    }
  } else {
    ret = 1;
  }
  if (ret == 0 && cf <= nbpredef) {
    while ((cf++) < nbpredef) {
      token = strtok(NULL, "\x0a");
      if (!token) {
        ret = 1;
      }
    }
  }
  if (ret == 0) {
    token = strtok(NULL, "\x0a");
    while (token) {
      if ((*comment)[0] != 0) {
        strcat(*comment, "\x0a");
      }
      strcat(*comment, token);
      token = strtok(NULL, "\x0a");
    }
  } else {
    free(*variants);
    free(*comment);
    free(header_dup);
    *variants = NULL;
    *comment = NULL;
    return 6;
  }
  free(header_dup);
  return 0;
}


x86 assembly (clang, -O0):
<pgheader_parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1090 <strdup@plt>
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
movb   $0x0,(%rax)
mov    -0x38(%rbp),%rdi
lea    0xe0b(%rip),%rsi
call   1060 <strtok@plt>
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x50(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     1341 <pgheader_parse+0x1d1>
xor    %eax,%eax
mov    %eax,%edi
lea    0xde5(%rip),%rsi
call   1060 <strtok@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     1335 <pgheader_parse+0x1c5>
xor    %eax,%eax
mov    %eax,%edi
lea    0xdc6(%rip),%rsi
call   1060 <strtok@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     1329 <pgheader_parse+0x1b9>
mov    -0x40(%rbp),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x4c(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xd9b(%rip),%rsi
call   1060 <strtok@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     131d <pgheader_parse+0x1ad>
mov    -0x40(%rbp),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x28(%rbp)
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
cmpl   $0x0,-0x28(%rbp)
jl     1311 <pgheader_parse+0x1a1>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    130c <pgheader_parse+0x19c>
xor    %eax,%eax
mov    %eax,%edi
lea    0xd4a(%rip),%rsi
call   1060 <strtok@plt>
mov    %rax,-0x48(%rbp)
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     12ee <pgheader_parse+0x17e>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xd17(%rip),%rsi
call   1080 <strcat@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x48(%rbp),%rsi
call   1080 <strcat@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    129f <pgheader_parse+0x12f>
jmp    1318 <pgheader_parse+0x1a8>
movl   $0x1,-0x24(%rbp)
jmp    1324 <pgheader_parse+0x1b4>
movl   $0x1,-0x24(%rbp)
jmp    1330 <pgheader_parse+0x1c0>
movl   $0x1,-0x24(%rbp)
jmp    133c <pgheader_parse+0x1cc>
movl   $0x1,-0x24(%rbp)
jmp    1348 <pgheader_parse+0x1d8>
movl   $0x1,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    13a7 <pgheader_parse+0x237>
mov    -0x50(%rbp),%eax
cmp    -0x4c(%rbp),%eax
jg     13a7 <pgheader_parse+0x237>
jmp    1363 <pgheader_parse+0x1f3>
mov    -0x50(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x50(%rbp)
cmp    -0x4c(%rbp),%eax
jge    13a2 <pgheader_parse+0x232>
xor    %eax,%eax
mov    %eax,%edi
lea    0xc7e(%rip),%rsi
call   1060 <strtok@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    139d <pgheader_parse+0x22d>
movl   $0x1,-0x24(%rbp)
jmp    1363 <pgheader_parse+0x1f3>
jmp    13a7 <pgheader_parse+0x237>
cmpl   $0x0,-0x24(%rbp)
jne    1424 <pgheader_parse+0x2b4>
xor    %eax,%eax
mov    %eax,%edi
lea    0xc44(%rip),%rsi
call   1060 <strtok@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     141f <pgheader_parse+0x2af>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     13f6 <pgheader_parse+0x286>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xc0f(%rip),%rsi
call   1080 <strcat@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
mov    -0x40(%rbp),%rsi
call   1080 <strcat@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xbef(%rip),%rsi
call   1060 <strtok@plt>
mov    %rax,-0x40(%rbp)
jmp    13c5 <pgheader_parse+0x255>
jmp    1467 <pgheader_parse+0x2f7>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x20(%rbp),%rax
movq   $0x0,(%rax)
movl   $0x6,-0x4(%rbp)
jmp    1477 <pgheader_parse+0x307>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pgheader_parse>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r15
mov    %rsi,%r13
mov    %rdi,%rbp
call   1090 <strdup@plt>
mov    %rax,%r14
mov    %rbp,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,0x0(%r13)
mov    %rbp,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,(%r15)
mov    0x0(%r13),%rax
movb   $0x0,(%rax)
mov    (%r15),%rax
movb   $0x0,(%rax)
lea    0xe34(%rip),%rsi
mov    %r14,%rdi
call   1060 <strtok@plt>
test   %rax,%rax
je     12df <pgheader_parse+0x16f>
lea    0xe1c(%rip),%rsi
xor    %edi,%edi
call   1060 <strtok@plt>
test   %rax,%rax
je     12df <pgheader_parse+0x16f>
lea    0xe05(%rip),%rsi
xor    %edi,%edi
call   1060 <strtok@plt>
test   %rax,%rax
je     12df <pgheader_parse+0x16f>
mov    %rax,%rdi
call   1070 <atoi@plt>
mov    %eax,%ebp
lea    0xde4(%rip),%rsi
xor    %edi,%edi
call   1060 <strtok@plt>
test   %rax,%rax
je     12df <pgheader_parse+0x16f>
mov    %rax,%rdi
call   1070 <atoi@plt>
test   %eax,%eax
js     12df <pgheader_parse+0x16f>
mov    %r14,0x10(%rsp)
je     12a4 <pgheader_parse+0x134>
lea    0xdb6(%rip),%rbx
mov    %eax,0xc(%rsp)
mov    %eax,%r14d
jmp    126e <pgheader_parse+0xfe>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r12,%rsi
call   1080 <strcat@plt>
add    $0xffffffff,%r14d
je     1292 <pgheader_parse+0x122>
xor    %edi,%edi
mov    %rbx,%rsi
call   1060 <strtok@plt>
mov    %rax,%r12
mov    0x0(%r13),%rdi
cmpb   $0x0,(%rdi)
je     1260 <pgheader_parse+0xf0>
mov    %rbx,%rsi
call   1080 <strcat@plt>
mov    0x0(%r13),%rdi
jmp    1260 <pgheader_parse+0xf0>
mov    0xc(%rsp),%eax
add    $0x1,%eax
mov    0x10(%rsp),%r14
cmp    %ebp,%eax
jl     12ad <pgheader_parse+0x13d>
jmp    131d <pgheader_parse+0x1ad>
mov    $0x1,%eax
cmp    %ebp,%eax
jge    131d <pgheader_parse+0x1ad>
sub    %eax,%ebp
xor    %ebx,%ebx
lea    0xd48(%rip),%r12
mov    $0x1,%r14d
xchg   %ax,%ax
xor    %edi,%edi
mov    %r12,%rsi
call   1060 <strtok@plt>
test   %rax,%rax
cmove  %r14d,%ebx
add    $0xffffffff,%ebp
jne    12c0 <pgheader_parse+0x150>
test   %ebx,%ebx
mov    0x10(%rsp),%r14
je     131d <pgheader_parse+0x1ad>
mov    0x0(%r13),%rdi
call   1030 <free@plt>
mov    (%r15),%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
movq   $0x0,0x0(%r13)
movq   $0x0,(%r15)
mov    $0x6,%ebx
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcdc(%rip),%rsi
xor    %ebx,%ebx
xor    %edi,%edi
call   1060 <strtok@plt>
test   %rax,%rax
je     136f <pgheader_parse+0x1ff>
mov    %rax,%rbp
lea    0xcc4(%rip),%r12
jmp    135a <pgheader_parse+0x1ea>
xchg   %ax,%ax
mov    %rbp,%rsi
call   1080 <strcat@plt>
xor    %edi,%edi
mov    %r12,%rsi
call   1060 <strtok@plt>
mov    %rax,%rbp
test   %rax,%rax
je     136f <pgheader_parse+0x1ff>
mov    (%r15),%rdi
cmpb   $0x0,(%rdi)
je     1340 <pgheader_parse+0x1d0>
mov    %r12,%rsi
call   1080 <strcat@plt>
mov    (%r15),%rdi
jmp    1340 <pgheader_parse+0x1d0>
mov    %r14,%rdi
call   1030 <free@plt>
jmp    130c <pgheader_parse+0x19c>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define i32 @pgheader_parse(i8* %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32
%15 = alloca i32
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%16 = load i8*, i8** %5
%17 = call i8* @strdup(i8* %16)
store i8* %17, i8** %11
%18 = load i8*, i8** %5
%19 = call i64 @strlen(i8* %18)
%20 = add nsw i64 %19, 1
%21 = call i8* @malloc(i64 %20)
%22 = load i8**, i8*** %6
store i8* %21, i8** %22
%23 = load i8*, i8** %5
%24 = call i64 @strlen(i8* %23)
%25 = add nsw i64 %24, 1
%26 = call i8* @malloc(i64 %25)
%27 = load i8**, i8*** %7
store i8* %26, i8** %27
store i32 0, i32* %8
%28 = load i8**, i8*** %6
%29 = load i8*, i8** %28
%30 = getelementptr inbounds i8, i8* %29, i64 0
store i8 0, i8* %30
%31 = load i8**, i8*** %7
%32 = load i8*, i8** %31
%33 = getelementptr inbounds i8, i8* %32, i64 0
store i8 0, i8* %33
%34 = load i8*, i8** %11
%35 = call i8* @strtok(i8* %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %35, i8** %12
store i32 0, i32* %15
%36 = load i8*, i8** %12
%37 = icmp ne i8* %36, null
br i1 %37, label %38, label %95
38: ; preds = %3
%39 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %39, i8** %12
%40 = load i8*, i8** %12
%41 = icmp ne i8* %40, null
br i1 %41, label %42, label %93
42: ; preds = %38
%43 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %43, i8** %12
%44 = load i8*, i8** %12
%45 = icmp ne i8* %44, null
br i1 %45, label %46, label %91
46: ; preds = %42
%47 = load i8*, i8** %12
%48 = call i32 @atoi(i8* %47)
store i32 %48, i32* %14
%49 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %49, i8** %12
%50 = load i8*, i8** %12
%51 = icmp ne i8* %50, null
br i1 %51, label %52, label %89
52: ; preds = %46
%53 = load i8*, i8** %12
%54 = call i32 @atoi(i8* %53)
store i32 %54, i32* %9
%55 = load i32, i32* %15
%56 = add nsw i32 %55, 1
store i32 %56, i32* %15
%57 = load i32, i32* %9
%58 = icmp sge i32 %57, 0
br i1 %58, label %59, label %87
59: ; preds = %52
store i32 0, i32* %10
br label %60
60: ; preds = %83, %59
%61 = load i32, i32* %10
%62 = load i32, i32* %9
%63 = icmp slt i32 %61, %62
br i1 %63, label %64, label %86
64: ; preds = %60
%65 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %65, i8** %13
%66 = load i32, i32* %15
%67 = add nsw i32 %66, 1
store i32 %67, i32* %15
%68 = load i8**, i8*** %6
%69 = load i8*, i8** %68
%70 = getelementptr inbounds i8, i8* %69, i64 0
%71 = load i8, i8* %70
%72 = sext i8 %71 to i32
%73 = icmp ne i32 %72, 0
br i1 %73, label %74, label %78
74: ; preds = %64
%75 = load i8**, i8*** %6
%76 = load i8*, i8** %75
%77 = call i32 @strcat(i8* %76, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %78
78: ; preds = %74, %64
%79 = load i8**, i8*** %6
%80 = load i8*, i8** %79
%81 = load i8*, i8** %13
%82 = call i32 @strcat(i8* %80, i8* %81)
br label %83
83: ; preds = %78
%84 = load i32, i32* %10
%85 = add nsw i32 %84, 1
store i32 %85, i32* %10
br label %60
86: ; preds = %60
br label %88
87: ; preds = %52
store i32 1, i32* %8
br label %88
88: ; preds = %87, %86
br label %90
89: ; preds = %46
store i32 1, i32* %8
br label %90
90: ; preds = %89, %88
br label %92
91: ; preds = %42
store i32 1, i32* %8
br label %92
92: ; preds = %91, %90
br label %94
93: ; preds = %38
store i32 1, i32* %8
br label %94
94: ; preds = %93, %92
br label %96
95: ; preds = %3
store i32 1, i32* %8
br label %96
96: ; preds = %95, %94
%97 = load i32, i32* %8
%98 = icmp eq i32 %97, 0
br i1 %98, label %99, label %116
99: ; preds = %96
%100 = load i32, i32* %15
%101 = load i32, i32* %14
%102 = icmp sle i32 %100, %101
br i1 %102, label %103, label %116
103: ; preds = %99
br label %104
104: ; preds = %114, %103
%105 = load i32, i32* %15
%106 = add nsw i32 %105, 1
store i32 %106, i32* %15
%107 = load i32, i32* %14
%108 = icmp slt i32 %105, %107
br i1 %108, label %109, label %115
109: ; preds = %104
%110 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %110, i8** %12
%111 = load i8*, i8** %12
%112 = icmp ne i8* %111, null
br i1 %112, label %114, label %113
113: ; preds = %109
store i32 1, i32* %8
br label %114
114: ; preds = %113, %109
br label %104
115: ; preds = %104
br label %116
116: ; preds = %115, %99, %96
%117 = load i32, i32* %8
%118 = icmp eq i32 %117, 0
br i1 %118, label %119, label %142
119: ; preds = %116
%120 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %120, i8** %12
br label %121
121: ; preds = %135, %119
%122 = load i8*, i8** %12
%123 = icmp ne i8* %122, null
br i1 %123, label %124, label %141
124: ; preds = %121
%125 = load i8**, i8*** %7
%126 = load i8*, i8** %125
%127 = getelementptr inbounds i8, i8* %126, i64 0
%128 = load i8, i8* %127
%129 = sext i8 %128 to i32
%130 = icmp ne i32 %129, 0
br i1 %130, label %131, label %135
131: ; preds = %124
%132 = load i8**, i8*** %7
%133 = load i8*, i8** %132
%134 = call i32 @strcat(i8* %133, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %135
135: ; preds = %131, %124
%136 = load i8**, i8*** %7
%137 = load i8*, i8** %136
%138 = load i8*, i8** %12
%139 = call i32 @strcat(i8* %137, i8* %138)
%140 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %140, i8** %12
br label %121
141: ; preds = %121
br label %153
142: ; preds = %116
%143 = load i8**, i8*** %6
%144 = load i8*, i8** %143
%145 = call i32 @free(i8* %144)
%146 = load i8**, i8*** %7
%147 = load i8*, i8** %146
%148 = call i32 @free(i8* %147)
%149 = load i8*, i8** %11
%150 = call i32 @free(i8* %149)
%151 = load i8**, i8*** %6
store i8* null, i8** %151
%152 = load i8**, i8*** %7
store i8* null, i8** %152
store i32 6, i32* %4
br label %156
153: ; preds = %141
%154 = load i8*, i8** %11
%155 = call i32 @free(i8* %154)
store i32 0, i32* %4
br label %156
156: ; preds = %153, %142
%157 = load i32, i32* %4
ret i32 %157
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define i32 @pgheader_parse(i8* nocapture %0, i8** nocapture %1, i8** nocapture %2) {
%4 = tail call i8* @strdup(i8* %0)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = add nsw i64 %5, 1
%7 = tail call i8* @malloc(i64 %6)
store i8* %7, i8** %1
%8 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%9 = add nsw i64 %8, 1
%10 = tail call i8* @malloc(i64 %9)
store i8* %10, i8** %2
%11 = load i8*, i8** %1
store i8 0, i8* %11
%12 = load i8*, i8** %2
store i8 0, i8* %12
%13 = tail call i8* @strtok(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i8* %13, null
br i1 %14, label %75, label %15
15: ; preds = %3
%16 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%17 = icmp eq i8* %16, null
br i1 %17, label %75, label %18
18: ; preds = %15
%19 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%20 = icmp eq i8* %19, null
br i1 %20, label %75, label %21
21: ; preds = %18
%22 = tail call i32 @atoi(i8* %19)
%23 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%24 = icmp eq i8* %23, null
br i1 %24, label %75, label %25
25: ; preds = %21
%26 = tail call i32 @atoi(i8* %23)
%27 = icmp sgt i32 %26, -1
br i1 %27, label %28, label %75
28: ; preds = %25
%29 = icmp eq i32 %26, 0
br i1 %29, label %46, label %30
30: ; preds = %28, %39
%31 = phi i32 [ %42, %39 ], [ 0, %28 ]
%32 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%33 = load i8*, i8** %1
%34 = load i8, i8* %33
%35 = icmp eq i8 %34, 0
br i1 %35, label %39, label %36
36: ; preds = %30
%37 = tail call i32 @strcat(i8* %33, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%38 = load i8*, i8** %1
br label %39
39: ; preds = %36, %30
%40 = phi i8* [ %38, %36 ], [ %33, %30 ]
%41 = tail call i32 @strcat(i8* %40, i8* %32)
%42 = add nuw nsw i32 %31, 1
%43 = icmp eq i32 %42, %26
br i1 %43, label %44, label %30
44: ; preds = %39
%45 = add i32 %26, 1
br label %46
46: ; preds = %44, %28
%47 = phi i32 [ 1, %28 ], [ %45, %44 ]
%48 = icmp slt i32 %47, %22
br i1 %48, label %49, label %59
49: ; preds = %46, %49
%50 = phi i32 [ %52, %49 ], [ %47, %46 ]
%51 = phi i32 [ %55, %49 ], [ 0, %46 ]
%52 = add nuw nsw i32 %50, 1
%53 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%54 = icmp eq i8* %53, null
%55 = select i1 %54, i32 1, i32 %51
%56 = icmp eq i32 %52, %22
br i1 %56, label %57, label %49
57: ; preds = %49
%58 = icmp eq i32 %55, 0
br i1 %58, label %59, label %75
59: ; preds = %46, %57
%60 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%61 = icmp eq i8* %60, null
br i1 %61, label %81, label %62
62: ; preds = %59, %70
%63 = phi i8* [ %73, %70 ], [ %60, %59 ]
%64 = load i8*, i8** %2
%65 = load i8, i8* %64
%66 = icmp eq i8 %65, 0
br i1 %66, label %70, label %67
67: ; preds = %62
%68 = tail call i32 @strcat(i8* %64, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%69 = load i8*, i8** %2
br label %70
70: ; preds = %67, %62
%71 = phi i8* [ %69, %67 ], [ %64, %62 ]
%72 = tail call i32 @strcat(i8* %71, i8* %63)
%73 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%74 = icmp eq i8* %73, null
br i1 %74, label %81, label %62
75: ; preds = %25, %21, %18, %15, %3, %57
%76 = load i8*, i8** %1
%77 = tail call i32 @free(i8* %76)
%78 = load i8*, i8** %2
%79 = tail call i32 @free(i8* %78)
%80 = tail call i32 @free(i8* %4)
store i8* null, i8** %1
store i8* null, i8** %2
br label %83
81: ; preds = %70, %59
%82 = tail call i32 @free(i8* %4)
br label %83
83: ; preds = %81, %75
%84 = phi i32 [ 0, %81 ], [ 6, %75 ]
ret i32 %84
}