#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 */
char *ho_strpbrk(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
char *strpbrk(char *, char *);
int main() {
  printf("%s\n", strpbrk("12345678", "8"));
  printf("%s\n", strpbrk("12345678", "1"));
  printf("%s\n", strpbrk("12345678", "654"));
  printf("%s\n", strpbrk("12345678", "#"));
  printf("========\n");
  printf("%s\n", ho_strpbrk("12345678", "8"));
  printf("%s\n", ho_strpbrk("12345678", "1"));
  printf("%s\n", ho_strpbrk("12345678", "654"));
  printf("%s\n", ho_strpbrk("12345678", "#"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xebe(%rip),%rdi
lea    0xebe(%rip),%rsi
call   1050 <strpbrk@plt>
mov    %rax,%rsi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9a(%rip),%rdi
lea    0xe9c(%rip),%rsi
call   1050 <strpbrk@plt>
mov    %rax,%rsi
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe76(%rip),%rdi
lea    0xe7a(%rip),%rsi
call   1050 <strpbrk@plt>
mov    %rax,%rsi
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe52(%rip),%rdi
lea    0xe5a(%rip),%rsi
call   1050 <strpbrk@plt>
mov    %rax,%rsi
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe20(%rip),%rdi
lea    0xe20(%rip),%rsi
call   1040 <ho_strpbrk@plt>
mov    %rax,%rsi
lea    0xe06(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdfc(%rip),%rdi
lea    0xdfe(%rip),%rsi
call   1040 <ho_strpbrk@plt>
mov    %rax,%rsi
lea    0xde2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdd8(%rip),%rdi
lea    0xddc(%rip),%rsi
call   1040 <ho_strpbrk@plt>
mov    %rax,%rsi
lea    0xdbe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdb4(%rip),%rdi
lea    0xdbc(%rip),%rsi
call   1040 <ho_strpbrk@plt>
mov    %rax,%rsi
lea    0xd9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1030 <puts@plt>
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
lea    0xea5(%rip),%rsi
mov    %rbx,%rdi
call   1040 <ho_strpbrk@plt>
mov    %rax,%rdi
call   1030 <puts@plt>
lea    0xe90(%rip),%rsi
mov    %rbx,%rdi
call   1040 <ho_strpbrk@plt>
mov    %rax,%rdi
call   1030 <puts@plt>
lea    0xe7b(%rip),%rsi
mov    %rbx,%rdi
call   1040 <ho_strpbrk@plt>
mov    %rax,%rdi
call   1030 <puts@plt>
lea    0xe68(%rip),%rsi
mov    %rbx,%rdi
call   1040 <ho_strpbrk@plt>
mov    %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [9 x i8] c"12345678\00"
@.str.2 = [2 x i8] c"8\00"
@.str.3 = [2 x i8] c"1\00"
@.str.4 = [4 x i8] c"654\00"
@.str.5 = [2 x i8] c"#\00"
@.str.6 = [10 x i8] c"========\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i8* @strpbrk(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i8* @strpbrk(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i8* @strpbrk(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i8* @strpbrk(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%11 = call i8* @ho_strpbrk(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i8* @ho_strpbrk(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = call i8* @ho_strpbrk(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = call i8* @ho_strpbrk(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %17)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"12345678\00"
@.str.2 = [2 x i8] c"8\00"
@.str.3 = [2 x i8] c"1\00"
@.str.4 = [4 x i8] c"654\00"
@.str.5 = [2 x i8] c"#\00"
@str = [9 x i8] c"========\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 7))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 3))
%4 = tail call i32 @puts(i8* dereferenceable(1) null)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%6 = tail call i8* @ho_strpbrk(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) %6)
%8 = tail call i8* @ho_strpbrk(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) %8)
%10 = tail call i8* @ho_strpbrk(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) %10)
%12 = tail call i8* @ho_strpbrk(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) %12)
ret i32 0
}