#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 __get_array_length(char const *);
int __infer_nondet_int();
int /*<<< orphan*/ __require_allocated_array(char const *);
char *strpbrk(const char *s1, const char *s2) {
  int size1;
  int nondet;
  int offset;
  nondet = __infer_nondet_int();
  offset = __infer_nondet_int();
  __require_allocated_array(s1);
  size1 = __get_array_length(s1);
  __require_allocated_array(s2);
  if (nondet)
    return 0;
  if (offset < 0 || offset >= size1)
    while (1)
      ;
  return (char *)s1 + offset;
}


x86 assembly (clang, -O0):
<strpbrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
mov    %eax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <__require_allocated_array@plt>
mov    -0x10(%rbp),%rdi
call   1050 <__get_array_length@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <__require_allocated_array@plt>
cmpl   $0x0,-0x20(%rbp)
je     1189 <strpbrk+0x59>
movq   $0x0,-0x8(%rbp)
jmp    11b8 <strpbrk+0x88>
cmpl   $0x0,-0x24(%rbp)
jl     119f <strpbrk+0x6f>
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jl     11a9 <strpbrk+0x79>
jmp    11a4 <strpbrk+0x74>
jmp    11a4 <strpbrk+0x74>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strpbrk>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r13
mov    %rdi,%rbx
xor    %r14d,%r14d
xor    %eax,%eax
call   1030 <__infer_nondet_int@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <__infer_nondet_int@plt>
mov    %eax,%r12d
mov    %rbx,%rdi
call   1040 <__require_allocated_array@plt>
mov    %rbx,%rdi
call   1050 <__get_array_length@plt>
mov    %eax,%r15d
mov    %r13,%rdi
call   1040 <__require_allocated_array@plt>
test   %ebp,%ebp
jne    1189 <strpbrk+0x59>
test   %r12d,%r12d
js     11a0 <strpbrk+0x70>
cmp    %r15d,%r12d
jge    11a0 <strpbrk+0x70>
mov    %r12d,%eax
add    %rax,%rbx
mov    %rbx,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
nopl   0x0(%rax,%rax,1)
jmp    11a0 <strpbrk+0x70>

LLVM IR (-O0):
define i8* @strpbrk(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%9 = call i32 (...) @__infer_nondet_int()
store i32 %9, i32* %7
%10 = call i32 (...) @__infer_nondet_int()
store i32 %10, i32* %8
%11 = load i8*, i8** %4
%12 = call i32 @__require_allocated_array(i8* %11)
%13 = load i8*, i8** %4
%14 = call i32 @__get_array_length(i8* %13)
store i32 %14, i32* %6
%15 = load i8*, i8** %5
%16 = call i32 @__require_allocated_array(i8* %15)
%17 = load i32, i32* %7
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %2
store i8* null, i8** %3
br label %34
20: ; preds = %2
%21 = load i32, i32* %8
%22 = icmp slt i32 %21, 0
br i1 %22, label %27, label %23
23: ; preds = %20
%24 = load i32, i32* %8
%25 = load i32, i32* %6
%26 = icmp sge i32 %24, %25
br i1 %26, label %27, label %29
27: ; preds = %23, %20
br label %28
28: ; preds = %27, %28
br label %28
29: ; preds = %23
%30 = load i8*, i8** %4
%31 = load i32, i32* %8
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %30, i64 %32
store i8* %33, i8** %3
br label %34
34: ; preds = %29, %19
%35 = load i8*, i8** %3
ret i8* %35
}

LLVM IR (-O2):
define i8* @strpbrk(i8* %0, i8* %1) {
%3 = tail call i32 (...) @__infer_nondet_int()
%4 = tail call i32 (...) @__infer_nondet_int()
%5 = tail call i32 @__require_allocated_array(i8* %0)
%6 = tail call i32 @__get_array_length(i8* %0)
%7 = tail call i32 @__require_allocated_array(i8* %1)
%8 = icmp eq i32 %3, 0
br i1 %8, label %9, label %17
9: ; preds = %2
%10 = icmp sgt i32 %4, -1
%11 = icmp slt i32 %4, %6
%12 = select i1 %10, i1 %11, i1 false
br i1 %12, label %14, label %13
13: ; preds = %9, %13
br label %13
14: ; preds = %9
%15 = zext i32 %4 to i64
%16 = getelementptr inbounds i8, i8* %0, i64 %15
br label %17
17: ; preds = %2, %14
%18 = phi i8* [ %16, %14 ], [ null, %2 ]
ret i8* %18
}