#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*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stderr;
char *strstr(char const *, char const *);
int main(int argc, char **argv) {
  const char haystack[] = "F_BD_CE_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_C3_"
                          "88_20_EF_BF_BD_EF_BF_BD_EF_BF_BD_C3_A7_20_EF_BF_BD";
  const char needle[] = "_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD";
  const char *sub = strstr(haystack, needle);
  if (sub != NULL) {
    int j;
    fprintf(stderr, "BUG: expected NULL, got:\n%s\n%s\n", sub, needle);
    for (j = 0; needle[j] != '\0'; ++j)
      putchar(needle[j] == sub[j] ? ' ' : '^');
    puts("");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xe8c(%rip),%rsi
mov    $0x65,%edx
call   1060 <memcpy@plt>
lea    -0xb0(%rbp),%rdi
lea    0xee4(%rip),%rsi
mov    $0x2e,%edx
call   1060 <memcpy@plt>
lea    -0x80(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
call   1070 <strstr@plt>
mov    %rax,-0xb8(%rbp)
cmpq   $0x0,-0xb8(%rbp)
je     1264 <main+0x114>
mov    0x2e1e(%rip),%rax
mov    (%rax),%edi
mov    -0xb8(%rbp),%rdx
lea    -0xb0(%rbp),%rcx
lea    0xec5(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0x0,-0xbc(%rbp)
movslq -0xbc(%rbp),%rax
movsbl -0xb0(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     124c <main+0xfc>
movslq -0xbc(%rbp),%rax
movsbl -0xb0(%rbp,%rax,1),%edx
ff
mov    -0xb8(%rbp),%rax
movslq -0xbc(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
mov    $0x5e,%eax
mov    $0x20,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    -0xbc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xbc(%rbp)
jmp    11e8 <main+0x98>
lea    0xe6a(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    126b <main+0x11b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x98,%rsp
movaps 0xf0f(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xef0(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xe9c(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xe80(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movabs $0x44425f46425f46,%rax
mov    %rax,0x8d(%rsp)
movups 0xef0(%rip),%xmm0
movups %xmm0,0x1e(%rsp)
movaps 0xed6(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeba(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x30(%rsp),%rdi
mov    %rsp,%rsi
call   1050 <strstr@plt>
test   %rax,%rax
je     1235 <main+0x105>
mov    %rax,%r14
mov    0x2e0a(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
mov    %rsp,%rcx
mov    %r14,%rdx
call   1040 <fprintf@plt>
mov    (%rsp),%al
test   %al,%al
je     1224 <main+0xf4>
xor    %ebx,%ebx
jmp    1212 <main+0xe2>
cs nopw 0x0(%rax,%rax,1)
nop
call   1030 <putchar@plt>
movzbl 0x1(%rsp,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
je     1224 <main+0xf4>
mov    $0x20,%edi
cmp    (%r14,%rbx,1),%al
je     1200 <main+0xd0>
mov    $0x5e,%edi
jmp    1200 <main+0xd0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%eax
jmp    1237 <main+0x107>
xor    %eax,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.haystack = [101 x i8] c"F_BD_CE_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_C3_88_20_EF_BF_BD_EF_BF_BD_EF_BF_BD_C3_A7_20_EF_BF_BD\00"
@__const.main.needle = [46 x i8] c"_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD\00"
@stderr = global i32 0
@.str = [32 x i8] c"BUG: expected NULL, got:\0A%s\0A%s\0A\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [101 x i8]
%7 = alloca [46 x i8]
%8 = alloca i8*
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = bitcast [101 x i8]* %6 to i8*
%11 = bitcast [46 x i8]* %7 to i8*
%12 = getelementptr inbounds [101 x i8], [101 x i8]* %6, i64 0, i64 0
%13 = getelementptr inbounds [46 x i8], [46 x i8]* %7, i64 0, i64 0
%14 = call i8* @strstr(i8* %12, i8* %13)
store i8* %14, i8** %8
%15 = load i8*, i8** %8
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %51
17: ; preds = %2
%18 = load i32, i32* @stderr
%19 = load i8*, i8** %8
%20 = getelementptr inbounds [46 x i8], [46 x i8]* %7, i64 0, i64 0
%21 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %19, i8* %20)
store i32 0, i32* %9
br label %22
22: ; preds = %46, %17
%23 = load i32, i32* %9
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [46 x i8], [46 x i8]* %7, i64 0, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %49
29: ; preds = %22
%30 = load i32, i32* %9
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [46 x i8], [46 x i8]* %7, i64 0, i64 %31
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = load i8*, i8** %8
%36 = load i32, i32* %9
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8, i8* %35, i64 %37
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %34, %40
%42 = zext i1 %41 to i64
%43 = select i1 %41, i32 32, i32 94
%44 = trunc i32 %43 to i8
%45 = call i32 @putchar(i8 signext %44)
br label %46
46: ; preds = %29
%47 = load i32, i32* %9
%48 = add nsw i32 %47, 1
store i32 %48, i32* %9
br label %22
49: ; preds = %22
%50 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %52
51: ; preds = %2
store i32 0, i32* %3
br label %52
52: ; preds = %51, %49
%53 = load i32, i32* %3
ret i32 %53
}

LLVM IR (-O2):
@__const.main.haystack = [101 x i8] c"F_BD_CE_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_C3_88_20_EF_BF_BD_EF_BF_BD_EF_BF_BD_C3_A7_20_EF_BF_BD\00"
@__const.main.needle = [46 x i8] c"_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD\00"
@stderr = global i32 0
@.str = [32 x i8] c"BUG: expected NULL, got:\0A%s\0A%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [101 x i8]
%4 = alloca [46 x i8]
%5 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [46 x i8], [46 x i8]* %4, i64 0, i64 0
%7 = call i8* @strstr(i8* %5, i8* %6)
%8 = icmp eq i8* %7, null
br i1 %8, label %28, label %9
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %6)
%12 = load i8, i8* %6
%13 = icmp eq i8 %12, 0
br i1 %13, label %26, label %14
14: ; preds = %9, %14
%15 = phi i64 [ %22, %14 ], [ 0, %9 ]
%16 = phi i8 [ %24, %14 ], [ %12, %9 ]
%17 = getelementptr inbounds i8, i8* %7, i64 %15
%18 = load i8, i8* %17
%19 = icmp eq i8 %16, %18
%20 = select i1 %19, i8 32, i8 94
%21 = call i32 @putchar(i8 signext %20)
%22 = add nuw i64 %15, 1
%23 = getelementptr inbounds [46 x i8], [46 x i8]* %4, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = icmp eq i8 %24, 0
br i1 %25, label %26, label %14
26: ; preds = %14, %9
%27 = call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
br label %28
28: ; preds = %2, %26
%29 = phi i32 [ 1, %26 ], [ 0, %2 ]
ret i32 %29
}