#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*/ find_a_in_b_stored_to_c(int *, int, int *, int, int *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int a[7] = {1, 3, 5, 6, 7, 9, 10};
  int b[8] = {2, 3, 4, 6, 8, 9, 11, 12};
  int c[7] = {};
  int i;
  find_a_in_b_stored_to_c(a, 7, b, 8, c);
  for (i = 0; c[i] != 0; i++) {
    printf("%d\t", c[i]);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeb2(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xeb0(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xead(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x1c,%edx
call   1050 <memset@plt>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rdx
lea    -0x60(%rbp),%r8
mov    $0x7,%esi
mov    $0x8,%ecx
call   1030 <find_a_in_b_stored_to_c@plt>
movl   $0x0,-0x64(%rbp)
movslq -0x64(%rbp),%rax
cmpl   $0x0,-0x60(%rbp,%rax,4)
je     11fa <main+0xca>
movslq -0x64(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%esi
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    11c7 <main+0x97>
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
movups 0xece(%rip),%xmm0
movups %xmm0,0x2c(%rsp)
movaps 0xeb6(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeda(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xebe(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
xorps  %xmm0,%xmm0
movups %xmm0,0xc(%rsp)
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%rdi
lea    0x40(%rsp),%rdx
mov    %rsp,%r8
mov    $0x7,%esi
mov    $0x8,%ecx
call   1040 <find_a_in_b_stored_to_c@plt>
mov    (%rsp),%esi
test   %esi,%esi
je     11c4 <main+0x94>
lea    0x4(%rsp),%rbx
lea    0xe9e(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rbx),%esi
add    $0x4,%rbx
test   %esi,%esi
jne    11b0 <main+0x80>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.a = [7 x i32] [i32 1, i32 3, i32 5, i32 6, i32 7, i32 9, i32 10]
@__const.main.b = [8 x i32] [i32 2, i32 3, i32 4, i32 6, i32 8, i32 9, i32 11, i32 12]
@.str = [4 x i8] c"%d\09\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i32]
%3 = alloca [8 x i32]
%4 = alloca [7 x i32]
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [7 x i32]* %2 to i8*
%7 = bitcast [8 x i32]* %3 to i8*
%8 = bitcast [7 x i32]* %4 to i8*
%9 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%10 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%11 = getelementptr inbounds [7 x i32], [7 x i32]* %4, i64 0, i64 0
%12 = call i32 @find_a_in_b_stored_to_c(i32* %9, i32 7, i32* %10, i32 8, i32* %11)
store i32 0, i32* %5
br label %13
13: ; preds = %25, %0
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [7 x i32], [7 x i32]* %4, i64 0, i64 %15
%17 = load i32, i32* %16
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %28
19: ; preds = %13
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [7 x i32], [7 x i32]* %4, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %19
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %13
28: ; preds = %13
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [7 x i32] [i32 1, i32 3, i32 5, i32 6, i32 7, i32 9, i32 10]
@__const.main.b = [8 x i32] [i32 2, i32 3, i32 4, i32 6, i32 8, i32 9, i32 11, i32 12]
@.str = [4 x i8] c"%d\09\00"
define i32 @main() {
%1 = alloca [7 x i32]
%2 = alloca [8 x i32]
%3 = alloca [7 x i32]
%4 = bitcast [7 x i32]* %1 to i8*
%5 = bitcast [8 x i32]* %2 to i8*
%6 = bitcast [7 x i32]* %3 to i8*
%7 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%9 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%10 = call i32 @find_a_in_b_stored_to_c(i32* %7, i32 7, i32* %8, i32 8, i32* %9)
%11 = load i32, i32* %9
%12 = icmp eq i32 %11, 0
br i1 %12, label %21, label %13
13: ; preds = %0, %13
%14 = phi i64 [ %17, %13 ], [ 0, %0 ]
%15 = phi i32 [ %19, %13 ], [ %11, %0 ]
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = add nuw i64 %14, 1
%18 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %13
21: ; preds = %13, %0
%22 = call i32 @putchar(i32 10)
ret i32 0
}