#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 *strpbrk(char *, char *);
int test_strpbrk(void) {
  char x1[] = "test";
  do {
    if (!(strpbrk("", "") == NULL)) {
      printf("expression '%s' untrue at %d\n", "strpbrk(\"\", \"\") == NULL",
             300);
      return 0;
    }
  } while (0);
  do {
    if (!(strpbrk(x1, "") == NULL)) {
      printf("expression '%s' untrue at %d\n", "strpbrk(x1, \"\") == NULL",
             301);
      return 0;
    }
  } while (0);
  do {
    if (!(strpbrk(x1, "x") == NULL)) {
      printf("expression '%s' untrue at %d\n", "strpbrk(x1, \"x\") == NULL",
             302);
      return 0;
    }
  } while (0);
  do {
    if (!(strpbrk(x1, "t") == x1)) {
      printf("expression '%s' untrue at %d\n", "strpbrk(x1, \"t\") == x1", 303);
      return 0;
    }
  } while (0);
  do {
    if (!(strpbrk(x1, "xyze") == x1 + 1)) {
      printf("expression '%s' untrue at %d\n", "strpbrk(x1, \"xyze\") == x1+1",
             304);
      return 0;
    }
  } while (0);
  return 1;
}


x86 assembly (clang, -O0):
<test_strpbrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xecd(%rip),%al
mov    %al,-0x5(%rbp)
lea    0xee1(%rip),%rsi
mov    %rsi,%rdi
call   1040 <strpbrk@plt>
cmp    $0x0,%rax
je     1177 <test_strpbrk+0x57>
lea    0xeab(%rip),%rdi
lea    0xec2(%rip),%rsi
mov    $0x12c,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    12ad <test_strpbrk+0x18d>
jmp    117c <test_strpbrk+0x5c>
jmp    1181 <test_strpbrk+0x61>
lea    -0x9(%rbp),%rdi
lea    0xe96(%rip),%rsi
call   1040 <strpbrk@plt>
cmp    $0x0,%rax
je     11bf <test_strpbrk+0x9f>
lea    0xe63(%rip),%rdi
lea    0xe92(%rip),%rsi
mov    $0x12d,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    12ad <test_strpbrk+0x18d>
jmp    11c4 <test_strpbrk+0xa4>
jmp    11c9 <test_strpbrk+0xa9>
lea    -0x9(%rbp),%rdi
lea    0xe7f(%rip),%rsi
call   1040 <strpbrk@plt>
cmp    $0x0,%rax
je     1207 <test_strpbrk+0xe7>
lea    0xe1b(%rip),%rdi
lea    0xe64(%rip),%rsi
mov    $0x12e,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    12ad <test_strpbrk+0x18d>
jmp    120c <test_strpbrk+0xec>
jmp    1211 <test_strpbrk+0xf1>
lea    -0x9(%rbp),%rdi
lea    0xde7(%rip),%rsi
call   1040 <strpbrk@plt>
lea    -0x9(%rbp),%rcx
cmp    %rcx,%rax
je     1252 <test_strpbrk+0x132>
lea    0xdd0(%rip),%rdi
lea    0xe32(%rip),%rsi
mov    $0x12f,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    12ad <test_strpbrk+0x18d>
jmp    1257 <test_strpbrk+0x137>
jmp    125c <test_strpbrk+0x13c>
lea    -0x9(%rbp),%rdi
lea    0xe1e(%rip),%rsi
call   1040 <strpbrk@plt>
lea    -0x9(%rbp),%rcx
add    $0x1,%rcx
cmp    %rcx,%rax
je     12a1 <test_strpbrk+0x181>
lea    0xd81(%rip),%rdi
lea    0xdff(%rip),%rsi
mov    $0x130,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    12ad <test_strpbrk+0x18d>
jmp    12a6 <test_strpbrk+0x186>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strpbrk>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xc(%rsp)
movl   $0x74736574,0x8(%rsp)
74
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x78,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     116e <test_strpbrk+0x3e>
lea    0xea5(%rip),%rdi
lea    0xebc(%rip),%rsi
mov    $0x12e,%edx
jmp    11c3 <test_strpbrk+0x93>
mov    %rbx,%rdi
mov    $0x74,%esi
call   1030 <strchr@plt>
cmp    %rbx,%rax
je     1195 <test_strpbrk+0x65>
lea    0xe7e(%rip),%rdi
lea    0xeae(%rip),%rsi
mov    $0x12f,%edx
jmp    11c3 <test_strpbrk+0x93>
lea    0xeb7(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1050 <strpbrk@plt>
lea    0x9(%rsp),%rcx
cmp    %rcx,%rax
je     11d0 <test_strpbrk+0xa0>
lea    0xe4e(%rip),%rdi
lea    0xe9a(%rip),%rsi
mov    $0x130,%edx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret
mov    $0x1,%eax
jmp    11ca <test_strpbrk+0x9a>

LLVM IR (-O0):
@__const.test_strpbrk.x1 = [5 x i8] c"test\00"
@.str = [1 x i8] zeroinitializer
@.str.1 = [30 x i8] c"expression '%s' untrue at %d\0A\00"
@.str.2 = [24 x i8] c"strpbrk(\22\22, \22\22) == NULL\00"
@.str.3 = [24 x i8] c"strpbrk(x1, \22\22) == NULL\00"
@.str.4 = [2 x i8] c"x\00"
@.str.5 = [25 x i8] c"strpbrk(x1, \22x\22) == NULL\00"
@.str.6 = [2 x i8] c"t\00"
@.str.7 = [23 x i8] c"strpbrk(x1, \22t\22) == x1\00"
@.str.8 = [5 x i8] c"xyze\00"
@.str.9 = [28 x i8] c"strpbrk(x1, \22xyze\22) == x1+1\00"
define i32 @test_strpbrk() {
%1 = alloca i32
%2 = alloca [5 x i8]
%3 = bitcast [5 x i8]* %2 to i8*
br label %4
4: ; preds = %0
%5 = call i8* @strpbrk(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 300)
store i32 0, i32* %1
br label %46
9: ; preds = %4
br label %10
10: ; preds = %9
br label %11
11: ; preds = %10
%12 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%13 = call i8* @strpbrk(i8* %12, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i8* %13, null
br i1 %14, label %17, label %15
15: ; preds = %11
%16 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 301)
store i32 0, i32* %1
br label %46
17: ; preds = %11
br label %18
18: ; preds = %17
br label %19
19: ; preds = %18
%20 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%21 = call i8* @strpbrk(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%22 = icmp eq i8* %21, null
br i1 %22, label %25, label %23
23: ; preds = %19
%24 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 302)
store i32 0, i32* %1
br label %46
25: ; preds = %19
br label %26
26: ; preds = %25
br label %27
27: ; preds = %26
%28 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%29 = call i8* @strpbrk(i8* %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%30 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%31 = icmp eq i8* %29, %30
br i1 %31, label %34, label %32
32: ; preds = %27
%33 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i32 303)
store i32 0, i32* %1
br label %46
34: ; preds = %27
br label %35
35: ; preds = %34
br label %36
36: ; preds = %35
%37 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%38 = call i8* @strpbrk(i8* %37, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%39 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%40 = getelementptr inbounds i8, i8* %39, i64 1
%41 = icmp eq i8* %38, %40
br i1 %41, label %44, label %42
42: ; preds = %36
%43 = 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.9, i64 0, i64 0), i32 304)
store i32 0, i32* %1
br label %46
44: ; preds = %36
br label %45
45: ; preds = %44
store i32 1, i32* %1
br label %46
46: ; preds = %45, %42, %32, %23, %15, %7
%47 = load i32, i32* %1
ret i32 %47
}

LLVM IR (-O2):
@__const.test_strpbrk.x1 = [5 x i8] c"test\00"
@.str.1 = [30 x i8] c"expression '%s' untrue at %d\0A\00"
@.str.5 = [25 x i8] c"strpbrk(x1, \22x\22) == NULL\00"
@.str.7 = [23 x i8] c"strpbrk(x1, \22t\22) == x1\00"
@.str.8 = [5 x i8] c"xyze\00"
@.str.9 = [28 x i8] c"strpbrk(x1, \22xyze\22) == x1+1\00"
define i32 @test_strpbrk() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i8* @strchr(i8* %2, i32 120)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 302)
br label %18
7: ; preds = %0
%8 = call i8* @strchr(i8* %2, i32 116)
%9 = icmp eq i8* %8, %2
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i32 303)
br label %18
12: ; preds = %7
%13 = call i8* @strpbrk(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%14 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 1
%15 = icmp eq i8* %13, %14
br i1 %15, label %18, label %16
16: ; preds = %12
%17 = 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.9, i64 0, i64 0), i32 304)
br label %18
18: ; preds = %12, %16, %10, %5
%19 = phi i32 [ 0, %16 ], [ 0, %10 ], [ 0, %5 ], [ 1, %12 ]
ret i32 %19
}