#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);
char *strpbrk(char *, char *);
int main() {
  char *sentence = "Bob is fun";
  char *sentence2 = "Tim likes to draw";
  char *addr = strpbrk(sentence, "aeiouAEIOU");
  char *addr2 = strpbrk(sentence2, "aeiouAEIOU");
  char *addr3 = strpbrk(sentence2, "xyz");
  printf("%c\n", *addr);
  printf("%c\n", *addr2);
  while (addr != NULL) {
    printf("%c ", *addr);
    addr = strpbrk(addr + 1, "aeiouAEIOU");
  }
  if (addr != NULL)
    printf("%c\n", *addr3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xecd(%rip),%rsi
call   1040 <strpbrk@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <strpbrk@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xeb0(%rip),%rsi
call   1040 <strpbrk@plt>
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
lea    0xea0(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
lea    0xe8d(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
cmpq   $0x0,-0x20(%rbp)
je     11e2 <main+0xc2>
mov    -0x20(%rbp),%rax
lea    0xe73(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
lea    0xe49(%rip),%rsi
call   1040 <strpbrk@plt>
mov    %rax,-0x20(%rbp)
jmp    11a7 <main+0x87>
cmpq   $0x0,-0x20(%rbp)
je     1200 <main+0xe0>
mov    -0x30(%rbp),%rax
lea    0xe34(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xeea(%rip),%rbx
mov    %rbx,%rdi
mov    $0x6f,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x69,%esi
call   1030 <printf@plt>
lea    0xeb4(%rip),%rbx
lea    0xec6(%rip),%r14
lea    0xeb0(%rip),%r15
nopl   0x0(%rax,%rax,1)
movsbl (%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <strpbrk@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1160 <main+0x40>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Bob is fun\00"
@.str.1 = [18 x i8] c"Tim likes to draw\00"
@.str.2 = [11 x i8] c"aeiouAEIOU\00"
@.str.3 = [4 x i8] c"xyz\00"
@.str.4 = [4 x i8] c"%c\0A\00"
@.str.5 = [4 x i8] c"%c \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8** %3
%7 = load i8*, i8** %2
%8 = call i8* @strpbrk(i8* %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
store i8* %8, i8** %4
%9 = load i8*, i8** %3
%10 = call i8* @strpbrk(i8* %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
store i8* %10, i8** %5
%11 = load i8*, i8** %3
%12 = call i8* @strpbrk(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
store i8* %12, i8** %6
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8 signext %14)
%16 = load i8*, i8** %5
%17 = load i8, i8* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8 signext %17)
br label %19
19: ; preds = %22, %0
%20 = load i8*, i8** %4
%21 = icmp ne i8* %20, null
br i1 %21, label %22, label %29
22: ; preds = %19
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8 signext %24)
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i64 1
%28 = call i8* @strpbrk(i8* %27, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
store i8* %28, i8** %4
br label %19
29: ; preds = %19
%30 = load i8*, i8** %4
%31 = icmp ne i8* %30, null
br i1 %31, label %32, label %36
32: ; preds = %29
%33 = load i8*, i8** %6
%34 = load i8, i8* %33
%35 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8 signext %34)
br label %36
36: ; preds = %32, %29
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Bob is fun\00"
@.str.2 = [11 x i8] c"aeiouAEIOU\00"
@.str.4 = [4 x i8] c"%c\0A\00"
@.str.5 = [4 x i8] c"%c \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8 signext 111)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8 signext 105)
br label %3
3: ; preds = %0, %3
%4 = phi i8* [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 1), %0 ], [ %8, %3 ]
%5 = load i8, i8* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8 signext %5)
%7 = getelementptr inbounds i8, i8* %4, i64 1
%8 = tail call i8* @strpbrk(i8* %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %3
10: ; preds = %3
ret i32 0
}