#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 const *);
scalar_t__ strB(char const *, char);
int main() {
  int i;
  const char *words[4] = {
      "Hello world",
      "yeB-bye!",
      "Are you ok?",
      "Beyond!",
  };
  for (i = 0; i < 4; i++) {
    if (strB(words[i], 'B') != 0) {
      printf("%s\n", words[i]);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2cca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2cc7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2cc4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cc1(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    11b1 <main+0x91>
movslq -0x8(%rbp),%rax
mov    -0x30(%rbp,%rax,8),%rdi
mov    $0x42,%esi
call   1040 <strB@plt>
cmp    $0x0,%rax
je     119e <main+0x7e>
movslq -0x8(%rbp),%rax
mov    -0x30(%rbp,%rax,8),%rsi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
jmp    11a3 <main+0x83>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1162 <main+0x42>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x42,%esi
call   1040 <strB@plt>
test   %rax,%rax
je     114a <main+0x2a>
lea    0xeeb(%rip),%rdi
lea    0xebb(%rip),%rsi
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
mov    $0x42,%esi
call   1040 <strB@plt>
test   %rax,%rax
je     1173 <main+0x53>
lea    0xec2(%rip),%rdi
lea    0xe9e(%rip),%rsi
call   1030 <printf@plt>
lea    0xe9b(%rip),%rdi
mov    $0x42,%esi
call   1040 <strB@plt>
test   %rax,%rax
je     119c <main+0x7c>
lea    0xe99(%rip),%rdi
lea    0xe7e(%rip),%rsi
call   1030 <printf@plt>
lea    0xe7e(%rip),%rdi
mov    $0x42,%esi
call   1040 <strB@plt>
test   %rax,%rax
je     11c5 <main+0xa5>
lea    0xe70(%rip),%rdi
lea    0xe61(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Hello world\00"
@.str.1 = [9 x i8] c"yeB-bye!\00"
@.str.2 = [12 x i8] c"Are you ok?\00"
@.str.3 = [8 x i8] c"Beyond!\00"
@__const.main.words = [4 x i8*] [i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i32 0, i32 0)]
@.str.4 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [4 x i8*]
store i32 0, i32* %1
%4 = bitcast [4 x i8*]* %3 to i8*
store i32 0, i32* %2
br label %5
5: ; preds = %22, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %25
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [4 x i8*], [4 x i8*]* %3, i64 0, i64 %10
%12 = load i8*, i8** %11
%13 = call i64 @strB(i8* %12, i8 signext 66)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %8
%16 = load i32, i32* %2
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [4 x i8*], [4 x i8*]* %3, i64 0, i64 %17
%19 = load i8*, i8** %18
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %19)
br label %21
21: ; preds = %15, %8
br label %22
22: ; preds = %21
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 1
store i32 %24, i32* %2
br label %5
25: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello world\00"
@.str.1 = [9 x i8] c"yeB-bye!\00"
@.str.2 = [12 x i8] c"Are you ok?\00"
@.str.3 = [8 x i8] c"Beyond!\00"
@.str.4 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i64 @strB(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 signext 66)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = tail call i64 @strB(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8 signext 66)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
%11 = tail call i64 @strB(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8 signext 66)
%12 = icmp eq i64 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %13, %10
%16 = tail call i64 @strB(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8 signext 66)
%17 = icmp eq i64 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %15
%19 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %20
20: ; preds = %18, %15
ret i32 0
}