#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*/ printf(char *, char *, int);
char *strtok(char *, char *);
int test_strtok(void) {
  char input[] = "testing?:1:2:3::4";
  char input2[] = "xxayyzzcyyzzyyxxyyzz";
  do {
    if (!(input == strtok(input, ":"))) {
      printf("expression '%s' untrue at %d\n", "input == strtok(input, \":\")",
             140);
      return 0;
    }
  } while (0);
  do {
    if (!(input[8] == 0)) {
      printf("expression '%s' untrue at %d\n", "input[8] == 0", 141);
      return 0;
    }
  } while (0);
  do {
    if (!(&input[9] == strtok(NULL, ":"))) {
      printf("expression '%s' untrue at %d\n",
             "&input[9] == strtok(NULL, \":\")", 142);
      return 0;
    }
  } while (0);
  do {
    if (!(input[10] == 0)) {
      printf("expression '%s' untrue at %d\n", "input[10] == 0", 143);
      return 0;
    }
  } while (0);
  do {
    if (!(&input[11] == strtok(NULL, ":"))) {
      printf("expression '%s' untrue at %d\n",
             "&input[11] == strtok(NULL, \":\")", 144);
      return 0;
    }
  } while (0);
  do {
    if (!(input[12] == 0)) {
      printf("expression '%s' untrue at %d\n", "input[12] == 0", 145);
      return 0;
    }
  } while (0);
  do {
    if (!(&input[13] == strtok(NULL, ":"))) {
      printf("expression '%s' untrue at %d\n",
             "&input[13] == strtok(NULL, \":\")", 146);
      return 0;
    }
  } while (0);
  do {
    if (!(input[14] == 0)) {
      printf("expression '%s' untrue at %d\n", "input[14] == 0", 147);
      return 0;
    }
  } while (0);
  do {
    if (!(&input[16] == strtok(NULL, ":"))) {
      printf("expression '%s' untrue at %d\n",
             "&input[16] == strtok(NULL, \":\")", 148);
      return 0;
    }
  } while (0);
  do {
    if (!(NULL == strtok(NULL, ":"))) {
      printf("expression '%s' untrue at %d\n", "NULL == strtok(NULL, \":\")",
             149);
      return 0;
    }
  } while (0);
  do {
    if (!(NULL == strtok(NULL, ":"))) {
      printf("expression '%s' untrue at %d\n", "NULL == strtok(NULL, \":\")",
             150);
      return 0;
    }
  } while (0);
  do {
    if (!(&input2[2] == strtok(input2, "xyz"))) {
      printf("expression '%s' untrue at %d\n",
             "&input2[2] == strtok(input2, \"xyz\")", 152);
      return 0;
    }
  } while (0);
  do {
    if (!(&input2[7] == strtok(NULL, "xyz"))) {
      printf("expression '%s' untrue at %d\n",
             "&input2[7] == strtok(NULL, \"xyz\")", 153);
      return 0;
    }
  } while (0);
  do {
    if (!(NULL == strtok(NULL, "xyz"))) {
      printf("expression '%s' untrue at %d\n", "NULL == strtok(NULL, \"xyz\")",
             154);
      return 0;
    }
  } while (0);
  return 1;
}


x86 assembly (clang, -O0):
<test_strtok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    0xece(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec8(%rip),%ax
mov    %ax,-0x10(%rbp)
mov    0xecd(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x30(%rbp)
mov    0xec3(%rip),%al
mov    %al,-0x2c(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    -0x20(%rbp),%rdi
lea    0xeae(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,%rcx
mov    -0x48(%rbp),%rax
cmp    %rcx,%rax
je     11c0 <test_strtok+0xa0>
lea    0xe94(%rip),%rdi
lea    0xeab(%rip),%rsi
mov    $0x8c,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15b8 <test_strtok+0x498>
jmp    11c5 <test_strtok+0xa5>
jmp    11ca <test_strtok+0xaa>
movsbl -0x18(%rbp),%eax
cmp    $0x0,%eax
je     11fb <test_strtok+0xdb>
lea    0xe59(%rip),%rdi
lea    0xe8c(%rip),%rsi
mov    $0x8d,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15b8 <test_strtok+0x498>
jmp    1200 <test_strtok+0xe0>
jmp    1205 <test_strtok+0xe5>
lea    -0x20(%rbp),%rax
add    $0x9,%rax
mov    %rax,-0x50(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xe19(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,%rcx
mov    -0x50(%rbp),%rax
cmp    %rcx,%rax
je     1255 <test_strtok+0x135>
lea    0xdff(%rip),%rdi
lea    0xe40(%rip),%rsi
mov    $0x8e,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15b8 <test_strtok+0x498>
jmp    125a <test_strtok+0x13a>
jmp    125f <test_strtok+0x13f>
movsbl -0x16(%rbp),%eax
cmp    $0x0,%eax
je     1290 <test_strtok+0x170>
lea    0xdc4(%rip),%rdi
lea    0xe24(%rip),%rsi
mov    $0x8f,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15b8 <test_strtok+0x498>
jmp    1295 <test_strtok+0x175>
jmp    129a <test_strtok+0x17a>
lea    -0x20(%rbp),%rax
add    $0xb,%rax
mov    %rax,-0x58(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xd84(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,%rcx
mov    -0x58(%rbp),%rax
cmp    %rcx,%rax
je     12ea <test_strtok+0x1ca>
lea    0xd6a(%rip),%rdi
lea    0xdd9(%rip),%rsi
mov    $0x90,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15b8 <test_strtok+0x498>
jmp    12ef <test_strtok+0x1cf>
jmp    12f4 <test_strtok+0x1d4>
movsbl -0x14(%rbp),%eax
cmp    $0x0,%eax
je     1325 <test_strtok+0x205>
lea    0xd2f(%rip),%rdi
lea    0xdbe(%rip),%rsi
mov    $0x91,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15b8 <test_strtok+0x498>
jmp    132a <test_strtok+0x20a>
jmp    132f <test_strtok+0x20f>
lea    -0x20(%rbp),%rax
add    $0xd,%rax
mov    %rax,-0x60(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xcef(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,%rcx
mov    -0x60(%rbp),%rax
cmp    %rcx,%rax
je     137f <test_strtok+0x25f>
lea    0xcd5(%rip),%rdi
lea    0xd73(%rip),%rsi
mov    $0x92,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15b8 <test_strtok+0x498>
jmp    1384 <test_strtok+0x264>
jmp    1389 <test_strtok+0x269>
movsbl -0x12(%rbp),%eax
cmp    $0x0,%eax
je     13ba <test_strtok+0x29a>
lea    0xc9a(%rip),%rdi
lea    0xd58(%rip),%rsi
mov    $0x93,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15b8 <test_strtok+0x498>
jmp    13bf <test_strtok+0x29f>
jmp    13c4 <test_strtok+0x2a4>
lea    -0x20(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x68(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xc5a(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,%rcx
mov    -0x68(%rbp),%rax
cmp    %rcx,%rax
je     1414 <test_strtok+0x2f4>
lea    0xc40(%rip),%rdi
lea    0xd0d(%rip),%rsi
mov    $0x94,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15b8 <test_strtok+0x498>
jmp    1419 <test_strtok+0x2f9>
jmp    141e <test_strtok+0x2fe>
xor    %eax,%eax
mov    %eax,%edi
lea    0xc0c(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1460 <test_strtok+0x340>
lea    0xbf4(%rip),%rdi
lea    0xce1(%rip),%rsi
mov    $0x95,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15b8 <test_strtok+0x498>
jmp    1465 <test_strtok+0x345>
jmp    146a <test_strtok+0x34a>
xor    %eax,%eax
mov    %eax,%edi
lea    0xbc0(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     14ac <test_strtok+0x38c>
lea    0xba8(%rip),%rdi
lea    0xc95(%rip),%rsi
mov    $0x96,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15b8 <test_strtok+0x498>
jmp    14b1 <test_strtok+0x391>
jmp    14b6 <test_strtok+0x396>
lea    -0x40(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x70(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xc78(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,%rcx
mov    -0x70(%rbp),%rax
cmp    %rcx,%rax
je     1506 <test_strtok+0x3e6>
lea    0xb4e(%rip),%rdi
lea    0xc59(%rip),%rsi
mov    $0x98,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15b8 <test_strtok+0x498>
jmp    150b <test_strtok+0x3eb>
jmp    1510 <test_strtok+0x3f0>
lea    -0x40(%rbp),%rax
add    $0x7,%rax
mov    %rax,-0x78(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xc1e(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,%rcx
mov    -0x78(%rbp),%rax
cmp    %rcx,%rax
je     1560 <test_strtok+0x440>
lea    0xaf4(%rip),%rdi
lea    0xc23(%rip),%rsi
mov    $0x99,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15b8 <test_strtok+0x498>
jmp    1565 <test_strtok+0x445>
jmp    156a <test_strtok+0x44a>
xor    %eax,%eax
mov    %eax,%edi
lea    0xbd0(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     15ac <test_strtok+0x48c>
lea    0xaa8(%rip),%rdi
lea    0xbf9(%rip),%rsi
mov    $0x9a,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15b8 <test_strtok+0x498>
jmp    15b1 <test_strtok+0x491>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strtok>:
push   %r14
push   %rbx
sub    $0x38,%rsp
movaps 0xed2(%rip),%xmm0
movaps %xmm0,(%rsp)
movw   $0x34,0x10(%rsp)
movaps 0xee0(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movabs $0x7a7a7979787879,%rax
mov    %rax,0x2d(%rsp)
lea    0xeda(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <strtok@plt>
cmp    %rax,%rbx
je     1180 <test_strtok+0x60>
lea    0xec5(%rip),%rdi
lea    0xedc(%rip),%rsi
mov    $0x8c,%edx
jmp    119a <test_strtok+0x7a>
cmpb   $0x0,0x8(%rsp)
je     11ab <test_strtok+0x8b>
lea    0xea9(%rip),%rdi
lea    0xedc(%rip),%rsi
mov    $0x8d,%edx
call   1030 <printf@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret
lea    0x9(%rsp),%r14
lea    0xe7e(%rip),%rsi
xor    %ebx,%ebx
xor    %edi,%edi
call   1040 <strtok@plt>
cmp    %rax,%r14
je     11dd <test_strtok+0xbd>
lea    0xe6b(%rip),%rdi
lea    0xeac(%rip),%rsi
mov    $0x8e,%edx
jmp    13b1 <test_strtok+0x291>
cmpb   $0x0,0xa(%rsp)
je     11fc <test_strtok+0xdc>
lea    0xe4c(%rip),%rdi
lea    0xeac(%rip),%rsi
mov    $0x8f,%edx
jmp    13b1 <test_strtok+0x291>
lea    0xb(%rsp),%r14
lea    0xe2d(%rip),%rsi
xor    %ebx,%ebx
xor    %edi,%edi
call   1040 <strtok@plt>
cmp    %rax,%r14
je     122e <test_strtok+0x10e>
lea    0xe1a(%rip),%rdi
lea    0xe89(%rip),%rsi
mov    $0x90,%edx
jmp    13b1 <test_strtok+0x291>
cmpb   $0x0,0xc(%rsp)
je     124d <test_strtok+0x12d>
lea    0xdfb(%rip),%rdi
lea    0xe8a(%rip),%rsi
mov    $0x91,%edx
jmp    13b1 <test_strtok+0x291>
lea    0xd(%rsp),%r14
lea    0xddc(%rip),%rsi
xor    %ebx,%ebx
xor    %edi,%edi
call   1040 <strtok@plt>
cmp    %rax,%r14
je     127f <test_strtok+0x15f>
lea    0xdc9(%rip),%rdi
lea    0xe67(%rip),%rsi
mov    $0x92,%edx
jmp    13b1 <test_strtok+0x291>
cmpb   $0x0,0xe(%rsp)
je     129e <test_strtok+0x17e>
lea    0xdaa(%rip),%rdi
lea    0xe68(%rip),%rsi
mov    $0x93,%edx
jmp    13b1 <test_strtok+0x291>
lea    0x10(%rsp),%r14
lea    0xd8b(%rip),%rsi
xor    %ebx,%ebx
xor    %edi,%edi
call   1040 <strtok@plt>
cmp    %rax,%r14
je     12d0 <test_strtok+0x1b0>
lea    0xd78(%rip),%rdi
lea    0xe45(%rip),%rsi
mov    $0x94,%edx
jmp    13b1 <test_strtok+0x291>
lea    0xd5e(%rip),%rsi
xor    %ebx,%ebx
xor    %edi,%edi
call   1040 <strtok@plt>
test   %rax,%rax
je     12fd <test_strtok+0x1dd>
lea    0xd4b(%rip),%rdi
lea    0xe38(%rip),%rsi
mov    $0x95,%edx
jmp    13b1 <test_strtok+0x291>
lea    0xd31(%rip),%rsi
xor    %ebx,%ebx
xor    %edi,%edi
call   1040 <strtok@plt>
test   %rax,%rax
je     132a <test_strtok+0x20a>
lea    0xd1e(%rip),%rdi
lea    0xe0b(%rip),%rsi
mov    $0x96,%edx
jmp    13b1 <test_strtok+0x291>
lea    0x22(%rsp),%r14
lea    0xe0f(%rip),%rsi
lea    0x20(%rsp),%rdi
call   1040 <strtok@plt>
cmp    %rax,%r14
je     135a <test_strtok+0x23a>
lea    0xceb(%rip),%rdi
lea    0xdf6(%rip),%rsi
mov    $0x98,%edx
jmp    13b1 <test_strtok+0x291>
lea    0x27(%rsp),%r14
lea    0xddf(%rip),%rsi
xor    %ebx,%ebx
xor    %edi,%edi
call   1040 <strtok@plt>
cmp    %rax,%r14
je     1389 <test_strtok+0x269>
lea    0xcbc(%rip),%rdi
lea    0xdeb(%rip),%rsi
mov    $0x99,%edx
jmp    13b1 <test_strtok+0x291>
lea    0xdb5(%rip),%rsi
xor    %ebx,%ebx
xor    %edi,%edi
call   1040 <strtok@plt>
test   %rax,%rax
je     13bb <test_strtok+0x29b>
lea    0xc92(%rip),%rdi
lea    0xde3(%rip),%rsi
mov    $0x9a,%edx
call   1030 <printf@plt>
jmp    11a1 <test_strtok+0x81>
mov    $0x1,%ebx
jmp    11a1 <test_strtok+0x81>

LLVM IR (-O0):
@__const.test_strtok.input = [18 x i8] c"testing?:1:2:3::4\00"
@__const.test_strtok.input2 = [21 x i8] c"xxayyzzcyyzzyyxxyyzz\00"
@.str = [2 x i8] c":\00"
@.str.1 = [30 x i8] c"expression '%s' untrue at %d\0A\00"
@.str.2 = [28 x i8] c"input == strtok(input, \22:\22)\00"
@.str.3 = [14 x i8] c"input[8] == 0\00"
@.str.4 = [31 x i8] c"&input[9] == strtok(NULL, \22:\22)\00"
@.str.5 = [15 x i8] c"input[10] == 0\00"
@.str.6 = [32 x i8] c"&input[11] == strtok(NULL, \22:\22)\00"
@.str.7 = [15 x i8] c"input[12] == 0\00"
@.str.8 = [32 x i8] c"&input[13] == strtok(NULL, \22:\22)\00"
@.str.9 = [15 x i8] c"input[14] == 0\00"
@.str.10 = [32 x i8] c"&input[16] == strtok(NULL, \22:\22)\00"
@.str.11 = [26 x i8] c"NULL == strtok(NULL, \22:\22)\00"
@.str.12 = [4 x i8] c"xyz\00"
@.str.13 = [36 x i8] c"&input2[2] == strtok(input2, \22xyz\22)\00"
@.str.14 = [34 x i8] c"&input2[7] == strtok(NULL, \22xyz\22)\00"
@.str.15 = [28 x i8] c"NULL == strtok(NULL, \22xyz\22)\00"
define i32 @test_strtok() {
%1 = alloca i32
%2 = alloca [18 x i8]
%3 = alloca [21 x i8]
%4 = bitcast [18 x i8]* %2 to i8*
%5 = bitcast [21 x i8]* %3 to i8*
br label %6
6: ; preds = %0
%7 = getelementptr inbounds [18 x i8], [18 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [18 x i8], [18 x i8]* %2, i64 0, i64 0
%9 = call i8* @strtok(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i8* %7, %9
br i1 %10, label %13, label %11
11: ; preds = %6
%12 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 140)
store i32 0, i32* %1
br label %121
13: ; preds = %6
br label %14
14: ; preds = %13
br label %15
15: ; preds = %14
%16 = getelementptr inbounds [18 x i8], [18 x i8]* %2, i64 0, i64 8
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %15
%21 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 141)
store i32 0, i32* %1
br label %121
22: ; preds = %15
br label %23
23: ; preds = %22
br label %24
24: ; preds = %23
%25 = getelementptr inbounds [18 x i8], [18 x i8]* %2, i64 0, i64 9
%26 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%27 = icmp eq i8* %25, %26
br i1 %27, label %30, label %28
28: ; preds = %24
%29 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i32 142)
store i32 0, i32* %1
br label %121
30: ; preds = %24
br label %31
31: ; preds = %30
br label %32
32: ; preds = %31
%33 = getelementptr inbounds [18 x i8], [18 x i8]* %2, i64 0, i64 10
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 0
br i1 %36, label %39, label %37
37: ; preds = %32
%38 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 143)
store i32 0, i32* %1
br label %121
39: ; preds = %32
br label %40
40: ; preds = %39
br label %41
41: ; preds = %40
%42 = getelementptr inbounds [18 x i8], [18 x i8]* %2, i64 0, i64 11
%43 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%44 = icmp eq i8* %42, %43
br i1 %44, label %47, label %45
45: ; preds = %41
%46 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i32 144)
store i32 0, i32* %1
br label %121
47: ; preds = %41
br label %48
48: ; preds = %47
br label %49
49: ; preds = %48
%50 = getelementptr inbounds [18 x i8], [18 x i8]* %2, i64 0, i64 12
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = icmp eq i32 %52, 0
br i1 %53, label %56, label %54
54: ; preds = %49
%55 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i32 145)
store i32 0, i32* %1
br label %121
56: ; preds = %49
br label %57
57: ; preds = %56
br label %58
58: ; preds = %57
%59 = getelementptr inbounds [18 x i8], [18 x i8]* %2, i64 0, i64 13
%60 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%61 = icmp eq i8* %59, %60
br i1 %61, label %64, label %62
62: ; preds = %58
%63 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0), i32 146)
store i32 0, i32* %1
br label %121
64: ; preds = %58
br label %65
65: ; preds = %64
br label %66
66: ; preds = %65
%67 = getelementptr inbounds [18 x i8], [18 x i8]* %2, i64 0, i64 14
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = icmp eq i32 %69, 0
br i1 %70, label %73, label %71
71: ; preds = %66
%72 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 147)
store i32 0, i32* %1
br label %121
73: ; preds = %66
br label %74
74: ; preds = %73
br label %75
75: ; preds = %74
%76 = getelementptr inbounds [18 x i8], [18 x i8]* %2, i64 0, i64 16
%77 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%78 = icmp eq i8* %76, %77
br i1 %78, label %81, label %79
79: ; preds = %75
%80 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0), i32 148)
store i32 0, i32* %1
br label %121
81: ; preds = %75
br label %82
82: ; preds = %81
br label %83
83: ; preds = %82
%84 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%85 = icmp eq i8* null, %84
br i1 %85, label %88, label %86
86: ; preds = %83
%87 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0), i32 149)
store i32 0, i32* %1
br label %121
88: ; preds = %83
br label %89
89: ; preds = %88
br label %90
90: ; preds = %89
%91 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%92 = icmp eq i8* null, %91
br i1 %92, label %95, label %93
93: ; preds = %90
%94 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0), i32 150)
store i32 0, i32* %1
br label %121
95: ; preds = %90
br label %96
96: ; preds = %95
br label %97
97: ; preds = %96
%98 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 2
%99 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 0
%100 = call i8* @strtok(i8* %99, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%101 = icmp eq i8* %98, %100
br i1 %101, label %104, label %102
102: ; preds = %97
%103 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.13, i64 0, i64 0), i32 152)
store i32 0, i32* %1
br label %121
104: ; preds = %97
br label %105
105: ; preds = %104
br label %106
106: ; preds = %105
%107 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 7
%108 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%109 = icmp eq i8* %107, %108
br i1 %109, label %112, label %110
110: ; preds = %106
%111 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.14, i64 0, i64 0), i32 153)
store i32 0, i32* %1
br label %121
112: ; preds = %106
br label %113
113: ; preds = %112
br label %114
114: ; preds = %113
%115 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%116 = icmp eq i8* null, %115
br i1 %116, label %119, label %117
117: ; preds = %114
%118 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.15, i64 0, i64 0), i32 154)
store i32 0, i32* %1
br label %121
119: ; preds = %114
br label %120
120: ; preds = %119
store i32 1, i32* %1
br label %121
121: ; preds = %120, %117, %110, %102, %93, %86, %79, %71, %62, %54, %45, %37, %28, %20, %11
%122 = load i32, i32* %1
ret i32 %122
}

LLVM IR (-O2):
@__const.test_strtok.input = [18 x i8] c"testing?:1:2:3::4\00"
@__const.test_strtok.input2 = [21 x i8] c"xxayyzzcyyzzyyxxyyzz\00"
@.str = [2 x i8] c":\00"
@.str.1 = [30 x i8] c"expression '%s' untrue at %d\0A\00"
@.str.2 = [28 x i8] c"input == strtok(input, \22:\22)\00"
@.str.3 = [14 x i8] c"input[8] == 0\00"
@.str.4 = [31 x i8] c"&input[9] == strtok(NULL, \22:\22)\00"
@.str.5 = [15 x i8] c"input[10] == 0\00"
@.str.6 = [32 x i8] c"&input[11] == strtok(NULL, \22:\22)\00"
@.str.7 = [15 x i8] c"input[12] == 0\00"
@.str.8 = [32 x i8] c"&input[13] == strtok(NULL, \22:\22)\00"
@.str.9 = [15 x i8] c"input[14] == 0\00"
@.str.10 = [32 x i8] c"&input[16] == strtok(NULL, \22:\22)\00"
@.str.11 = [26 x i8] c"NULL == strtok(NULL, \22:\22)\00"
@.str.12 = [4 x i8] c"xyz\00"
@.str.13 = [36 x i8] c"&input2[2] == strtok(input2, \22xyz\22)\00"
@.str.14 = [34 x i8] c"&input2[7] == strtok(NULL, \22xyz\22)\00"
@.str.15 = [28 x i8] c"NULL == strtok(NULL, \22xyz\22)\00"
define i32 @test_strtok() {
%1 = alloca [18 x i8]
%2 = alloca [21 x i8]
%3 = getelementptr inbounds [18 x i8], [18 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%5 = call i8* @strtok(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i8* %3, %5
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 140)
br label %84
9: ; preds = %0
%10 = getelementptr inbounds [18 x i8], [18 x i8]* %1, i64 0, i64 8
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %9
%14 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 141)
br label %84
15: ; preds = %9
%16 = getelementptr inbounds [18 x i8], [18 x i8]* %1, i64 0, i64 9
%17 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%18 = icmp eq i8* %16, %17
br i1 %18, label %21, label %19
19: ; preds = %15
%20 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i32 142)
br label %84
21: ; preds = %15
%22 = getelementptr inbounds [18 x i8], [18 x i8]* %1, i64 0, i64 10
%23 = load i8, i8* %22
%24 = icmp eq i8 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %21
%26 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 143)
br label %84
27: ; preds = %21
%28 = getelementptr inbounds [18 x i8], [18 x i8]* %1, i64 0, i64 11
%29 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%30 = icmp eq i8* %28, %29
br i1 %30, label %33, label %31
31: ; preds = %27
%32 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i32 144)
br label %84
33: ; preds = %27
%34 = getelementptr inbounds [18 x i8], [18 x i8]* %1, i64 0, i64 12
%35 = load i8, i8* %34
%36 = icmp eq i8 %35, 0
br i1 %36, label %39, label %37
37: ; preds = %33
%38 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i32 145)
br label %84
39: ; preds = %33
%40 = getelementptr inbounds [18 x i8], [18 x i8]* %1, i64 0, i64 13
%41 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%42 = icmp eq i8* %40, %41
br i1 %42, label %45, label %43
43: ; preds = %39
%44 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0), i32 146)
br label %84
45: ; preds = %39
%46 = getelementptr inbounds [18 x i8], [18 x i8]* %1, i64 0, i64 14
%47 = load i8, i8* %46
%48 = icmp eq i8 %47, 0
br i1 %48, label %51, label %49
49: ; preds = %45
%50 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 147)
br label %84
51: ; preds = %45
%52 = getelementptr inbounds [18 x i8], [18 x i8]* %1, i64 0, i64 16
%53 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%54 = icmp eq i8* %52, %53
br i1 %54, label %57, label %55
55: ; preds = %51
%56 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0), i32 148)
br label %84
57: ; preds = %51
%58 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%59 = icmp eq i8* %58, null
br i1 %59, label %62, label %60
60: ; preds = %57
%61 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0), i32 149)
br label %84
62: ; preds = %57
%63 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%64 = icmp eq i8* %63, null
br i1 %64, label %67, label %65
65: ; preds = %62
%66 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0), i32 150)
br label %84
67: ; preds = %62
%68 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 2
%69 = call i8* @strtok(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%70 = icmp eq i8* %68, %69
br i1 %70, label %73, label %71
71: ; preds = %67
%72 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.13, i64 0, i64 0), i32 152)
br label %84
73: ; preds = %67
%74 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 7
%75 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%76 = icmp eq i8* %74, %75
br i1 %76, label %79, label %77
77: ; preds = %73
%78 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.14, i64 0, i64 0), i32 153)
br label %84
79: ; preds = %73
%80 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%81 = icmp eq i8* %80, null
br i1 %81, label %84, label %82
82: ; preds = %79
%83 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.15, i64 0, i64 0), i32 154)
br label %84
84: ; preds = %79, %82, %77, %71, %65, %60, %55, %49, %43, %37, %31, %25, %19, %13, %7
%85 = phi i32 [ 0, %82 ], [ 0, %77 ], [ 0, %71 ], [ 0, %65 ], [ 0, %60 ], [ 0, %55 ], [ 0, %49 ], [ 0, %43 ], [ 0, %37 ], [ 0, %31 ], [ 0, %25 ], [ 0, %19 ], [ 0, %13 ], [ 0, %7 ], [ 1, %79 ]
ret i32 %85
}