#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 *, int);
int search(int *, int, int *, int);
int main(int argc, char **argv) {
  int A[7] = {1, 2, 3, 4, 5, 6, 7};
  int B[11] = {4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14};
  int C[12] = {6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17};
  printf("Number is %d\n", search(B, 11, A, 7));
  printf("Number is %d\n", search(C, 12, B, 11));
  printf("Number is %d\n", search(C, 12, A, 7));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeb0(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xead(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xea8(%rip),%eax
mov    %eax,-0x18(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xea2(%rip),%rsi
mov    $0x2c,%edx
call   1050 <memcpy@plt>
lea    -0x90(%rbp),%rdi
lea    0xeba(%rip),%rsi
mov    $0x30,%edx
call   1050 <memcpy@plt>
lea    -0x60(%rbp),%rdi
lea    -0x30(%rbp),%rdx
mov    $0xb,%esi
mov    $0x7,%ecx
call   1040 <search@plt>
mov    %eax,%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
lea    -0x90(%rbp),%rdi
lea    -0x60(%rbp),%rdx
mov    $0xc,%esi
mov    $0xb,%ecx
call   1040 <search@plt>
mov    %eax,%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
lea    -0x90(%rbp),%rdi
lea    -0x30(%rbp),%rdx
mov    $0xc,%esi
mov    $0x7,%ecx
call   1040 <search@plt>
mov    %eax,%esi
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x88,%rsp
movups 0xed7(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xef0(%rip),%xmm0
movups %xmm0,0x3c(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xf00(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
lea    0x20(%rsp),%r15
mov    %rsp,%r14
mov    %r15,%rdi
mov    $0xb,%esi
mov    %r14,%rdx
mov    $0x7,%ecx
call   1040 <search@plt>
lea    0xecf(%rip),%r12
mov    %r12,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0x50(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xc,%esi
mov    %r15,%rdx
mov    $0xb,%ecx
call   1040 <search@plt>
mov    %r12,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
mov    %r14,%rdx
mov    $0x7,%ecx
call   1040 <search@plt>
mov    %r12,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.A = [7 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7]
@__const.main.B = [11 x i32] [i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14]
@__const.main.C = [12 x i32] [i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17]
@.str = [14 x i8] c"Number is %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [7 x i32]
%7 = alloca [11 x i32]
%8 = alloca [12 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [7 x i32]* %6 to i8*
%10 = bitcast [11 x i32]* %7 to i8*
%11 = bitcast [12 x i32]* %8 to i8*
%12 = getelementptr inbounds [11 x i32], [11 x i32]* %7, i64 0, i64 0
%13 = getelementptr inbounds [7 x i32], [7 x i32]* %6, i64 0, i64 0
%14 = call i32 @search(i32* %12, i32 11, i32* %13, i32 7)
%15 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = getelementptr inbounds [12 x i32], [12 x i32]* %8, i64 0, i64 0
%17 = getelementptr inbounds [11 x i32], [11 x i32]* %7, i64 0, i64 0
%18 = call i32 @search(i32* %16, i32 12, i32* %17, i32 11)
%19 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %18)
%20 = getelementptr inbounds [12 x i32], [12 x i32]* %8, i64 0, i64 0
%21 = getelementptr inbounds [7 x i32], [7 x i32]* %6, i64 0, i64 0
%22 = call i32 @search(i32* %20, i32 12, i32* %21, i32 7)
%23 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %22)
ret i32 0
}

LLVM IR (-O2):
@__const.main.A = [7 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7]
@__const.main.B = [11 x i32] [i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14]
@__const.main.C = [12 x i32] [i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17]
@.str = [14 x i8] c"Number is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [7 x i32]
%4 = alloca [11 x i32]
%5 = alloca [12 x i32]
%6 = bitcast [7 x i32]* %3 to i8*
%7 = bitcast [11 x i32]* %4 to i8*
%8 = bitcast [12 x i32]* %5 to i8*
%9 = getelementptr inbounds [11 x i32], [11 x i32]* %4, i64 0, i64 0
%10 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%11 = call i32 @search(i32* %9, i32 11, i32* %10, i32 7)
%12 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = getelementptr inbounds [12 x i32], [12 x i32]* %5, i64 0, i64 0
%14 = call i32 @search(i32* %13, i32 12, i32* %9, i32 11)
%15 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = call i32 @search(i32* %13, i32 12, i32* %10, i32 7)
%17 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %16)
ret i32 0
}