#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 */
scalar_t__ find(int *, int);
scalar_t__ find_brute(int *, int);
int test_not_missing() {
  int array_odd[] = {6, 3, 9, 1, 5, 4, 7, 8, 2};
  int array_even[] = {6, 3, 1, 5, 4, 7, 8, 2};
  return 0 == find_brute(array_odd, 9) && 0 == find(array_odd, 9) &&
         0 == find_brute(array_even, 8) && 0 == find(array_even, 8);
}


x86 assembly (clang, -O0):
<test_not_missing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
mov    0xedc(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xed9(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xed6(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
call   1030 <find_brute@plt>
mov    %rax,%rdx
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %rdx,%rcx
mov    %al,-0x51(%rbp)
jne    11f8 <test_not_missing+0xc8>
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
call   1050 <find@plt>
mov    %rax,%rdx
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %rdx,%rcx
mov    %al,-0x51(%rbp)
jne    11f8 <test_not_missing+0xc8>
lea    -0x50(%rbp),%rdi
mov    $0x8,%esi
call   1030 <find_brute@plt>
mov    %rax,%rdx
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %rdx,%rcx
mov    %al,-0x51(%rbp)
jne    11f8 <test_not_missing+0xc8>
lea    -0x50(%rbp),%rdi
mov    $0x8,%esi
call   1050 <find@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
mov    %al,-0x51(%rbp)
mov    -0x51(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_not_missing>:
push   %rbx
sub    $0x50,%rsp
mov    0xef5(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xeda(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebe(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xef3(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xed7(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    %rsp,%rdi
mov    $0x9,%esi
call   1030 <find_brute@plt>
xor    %ebx,%ebx
test   %rax,%rax
jne    11af <test_not_missing+0x8f>
mov    %rsp,%rdi
mov    $0x9,%esi
call   1040 <find@plt>
test   %rax,%rax
jne    11af <test_not_missing+0x8f>
lea    0x30(%rsp),%rdi
mov    $0x8,%esi
call   1030 <find_brute@plt>
test   %rax,%rax
jne    11af <test_not_missing+0x8f>
lea    0x30(%rsp),%rdi
mov    $0x8,%esi
call   1040 <find@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
mov    %ebx,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_not_missing.array_odd = [9 x i32] [i32 6, i32 3, i32 9, i32 1, i32 5, i32 4, i32 7, i32 8, i32 2]
@__const.test_not_missing.array_even = [8 x i32] [i32 6, i32 3, i32 1, i32 5, i32 4, i32 7, i32 8, i32 2]
define i32 @test_not_missing() {
%1 = alloca [9 x i32]
%2 = alloca [8 x i32]
%3 = bitcast [9 x i32]* %1 to i8*
%4 = bitcast [8 x i32]* %2 to i8*
%5 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%6 = call i64 @find_brute(i32* %5, i32 9)
%7 = icmp eq i64 0, %6
br i1 %7, label %8, label %20
8: ; preds = %0
%9 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%10 = call i64 @find(i32* %9, i32 9)
%11 = icmp eq i64 0, %10
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%14 = call i64 @find_brute(i32* %13, i32 8)
%15 = icmp eq i64 0, %14
br i1 %15, label %16, label %20
16: ; preds = %12
%17 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%18 = call i64 @find(i32* %17, i32 8)
%19 = icmp eq i64 0, %18
br label %20
20: ; preds = %16, %12, %8, %0
%21 = phi i1 [ false, %12 ], [ false, %8 ], [ false, %0 ], [ %19, %16 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
@__const.test_not_missing.array_odd = [9 x i32] [i32 6, i32 3, i32 9, i32 1, i32 5, i32 4, i32 7, i32 8, i32 2]
@__const.test_not_missing.array_even = [8 x i32] [i32 6, i32 3, i32 1, i32 5, i32 4, i32 7, i32 8, i32 2]
define i32 @test_not_missing() {
%1 = alloca [9 x i32]
%2 = alloca [8 x i32]
%3 = bitcast [9 x i32]* %1 to i8*
%4 = bitcast [8 x i32]* %2 to i8*
%5 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%6 = call i64 @find_brute(i32* %5, i32 9)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %19
8: ; preds = %0
%9 = call i64 @find(i32* %5, i32 9)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%13 = call i64 @find_brute(i32* %12, i32 8)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = call i64 @find(i32* %12, i32 8)
%17 = icmp eq i64 %16, 0
%18 = zext i1 %17 to i32
br label %19
19: ; preds = %15, %11, %8, %0
%20 = phi i32 [ 0, %11 ], [ 0, %8 ], [ 0, %0 ], [ %18, %15 ]
ret i32 %20
}