#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*/ interseccionA(int *, int *, int *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(char);
int main(void) {
  int array1[] = {1, 2, 3, 3, 4, 5, 7, 7, -1};
  int array2[] = {3, 4, 5, 6, 7, 9, 10, 11, -1};
  int resultado[12], i;
  interseccionA(array1, array2, resultado);
  for (i = 0; array1[i] != -1; i++) {
    printf("%d\t", array1[i]);
  }
  putchar('\n');
  for (i = 0; array2[i] != -1; i++) {
    printf("%d\t", array2[i]);
  }
  putchar('\n');
  for (i = 0; resultado[i] != -1; i++) {
    printf("%d\t", resultado[i]);
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xea3(%rip),%rsi
mov    $0x24,%edx
call   1060 <memcpy@plt>
lea    -0x60(%rbp),%rdi
lea    0xebe(%rip),%rsi
mov    $0x24,%edx
call   1060 <memcpy@plt>
lea    -0x30(%rbp),%rdi
lea    -0x60(%rbp),%rsi
lea    -0x90(%rbp),%rdx
call   1050 <interseccionA@plt>
movl   $0x0,-0x94(%rbp)
movslq -0x94(%rbp),%rax
cmpl   $0xffffffff,-0x30(%rbp,%rax,4)
je     11d7 <main+0x97>
movslq -0x94(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    119a <main+0x5a>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x94(%rbp)
movslq -0x94(%rbp),%rax
cmpl   $0xffffffff,-0x60(%rbp,%rax,4)
je     1228 <main+0xe8>
movslq -0x94(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%esi
lea    0xe45(%rip),%rdi
call   1040 <printf@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    11eb <main+0xab>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x94(%rbp)
movslq -0x94(%rbp),%rax
cmpl   $0xffffffff,-0x90(%rbp,%rax,4)
ff
je     127f <main+0x13f>
movslq -0x94(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%esi
lea    0xdee(%rip),%rdi
call   1040 <printf@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    123c <main+0xfc>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x98,%rsp
mov    0xee0(%rip),%eax
mov    %eax,0x50(%rsp)
movaps 0xec5(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xea9(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    0xeee(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xed3(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb7(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x30(%rsp),%rdi
mov    %rsp,%rsi
lea    0x60(%rsp),%rdx
call   1050 <interseccionA@plt>
mov    0x30(%rsp),%esi
cmp    $0xffffffff,%esi
je     11c3 <main+0x93>
lea    0x34(%rsp),%rbx
lea    0xeb0(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1040 <printf@plt>
mov    (%rbx),%esi
add    $0x4,%rbx
cmp    $0xffffffff,%esi
jne    11b0 <main+0x80>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    (%rsp),%esi
cmp    $0xffffffff,%esi
je     1203 <main+0xd3>
lea    0x4(%rsp),%rbx
lea    0xe73(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <printf@plt>
mov    (%rbx),%esi
add    $0x4,%rbx
cmp    $0xffffffff,%esi
jne    11f0 <main+0xc0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x60(%rsp),%esi
cmp    $0xffffffff,%esi
je     1243 <main+0x113>
lea    0x64(%rsp),%rbx
lea    0xe32(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
call   1040 <printf@plt>
mov    (%rbx),%esi
add    $0x4,%rbx
cmp    $0xffffffff,%esi
jne    1230 <main+0x100>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.array1 = [9 x i32] [i32 1, i32 2, i32 3, i32 3, i32 4, i32 5, i32 7, i32 7, i32 -1]
@__const.main.array2 = [9 x i32] [i32 3, i32 4, i32 5, i32 6, i32 7, i32 9, i32 10, i32 11, i32 -1]
@.str = [4 x i8] c"%d\09\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i32]
%3 = alloca [9 x i32]
%4 = alloca [12 x i32]
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [9 x i32]* %2 to i8*
%7 = bitcast [9 x i32]* %3 to i8*
%8 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%9 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 0
%10 = getelementptr inbounds [12 x i32], [12 x i32]* %4, i64 0, i64 0
%11 = call i32 @interseccionA(i32* %8, i32* %9, i32* %10)
store i32 0, i32* %5
br label %12
12: ; preds = %24, %0
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 %14
%16 = load i32, i32* %15
%17 = icmp ne i32 %16, -1
br i1 %17, label %18, label %27
18: ; preds = %12
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 %20
%22 = load i32, i32* %21
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %18
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %12
27: ; preds = %12
%28 = call i32 @putchar(i8 signext 10)
store i32 0, i32* %5
br label %29
29: ; preds = %41, %27
%30 = load i32, i32* %5
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 %31
%33 = load i32, i32* %32
%34 = icmp ne i32 %33, -1
br i1 %34, label %35, label %44
35: ; preds = %29
%36 = load i32, i32* %5
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 %37
%39 = load i32, i32* %38
%40 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %39)
br label %41
41: ; preds = %35
%42 = load i32, i32* %5
%43 = add nsw i32 %42, 1
store i32 %43, i32* %5
br label %29
44: ; preds = %29
%45 = call i32 @putchar(i8 signext 10)
store i32 0, i32* %5
br label %46
46: ; preds = %58, %44
%47 = load i32, i32* %5
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [12 x i32], [12 x i32]* %4, i64 0, i64 %48
%50 = load i32, i32* %49
%51 = icmp ne i32 %50, -1
br i1 %51, label %52, label %61
52: ; preds = %46
%53 = load i32, i32* %5
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [12 x i32], [12 x i32]* %4, i64 0, i64 %54
%56 = load i32, i32* %55
%57 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %56)
br label %58
58: ; preds = %52
%59 = load i32, i32* %5
%60 = add nsw i32 %59, 1
store i32 %60, i32* %5
br label %46
61: ; preds = %46
%62 = call i32 @putchar(i8 signext 10)
%63 = load i32, i32* %1
ret i32 %63
}

LLVM IR (-O2):
@__const.main.array1 = [9 x i32] [i32 1, i32 2, i32 3, i32 3, i32 4, i32 5, i32 7, i32 7, i32 -1]
@__const.main.array2 = [9 x i32] [i32 3, i32 4, i32 5, i32 6, i32 7, i32 9, i32 10, i32 11, i32 -1]
@.str = [4 x i8] c"%d\09\00"
define i32 @main() {
%1 = alloca [9 x i32]
%2 = alloca [9 x i32]
%3 = alloca [12 x i32]
%4 = bitcast [9 x i32]* %1 to i8*
%5 = bitcast [9 x i32]* %2 to i8*
%6 = bitcast [12 x i32]* %3 to i8*
%7 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%9 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%10 = call i32 @interseccionA(i32* %7, i32* %8, i32* %9)
%11 = load i32, i32* %7
%12 = icmp eq i32 %11, -1
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 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = add nuw i64 %14, 1
%18 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = icmp eq i32 %19, -1
br i1 %20, label %21, label %13
21: ; preds = %13, %0
%22 = call i32 @putchar(i8 signext 10)
%23 = load i32, i32* %8
%24 = icmp eq i32 %23, -1
br i1 %24, label %33, label %25
25: ; preds = %21, %25
%26 = phi i64 [ %29, %25 ], [ 0, %21 ]
%27 = phi i32 [ %31, %25 ], [ %23, %21 ]
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %27)
%29 = add nuw i64 %26, 1
%30 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 %29
%31 = load i32, i32* %30
%32 = icmp eq i32 %31, -1
br i1 %32, label %33, label %25
33: ; preds = %25, %21
%34 = call i32 @putchar(i8 signext 10)
%35 = load i32, i32* %9
%36 = icmp eq i32 %35, -1
br i1 %36, label %45, label %37
37: ; preds = %33, %37
%38 = phi i64 [ %41, %37 ], [ 0, %33 ]
%39 = phi i32 [ %43, %37 ], [ %35, %33 ]
%40 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %39)
%41 = add nuw i64 %38, 1
%42 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 %41
%43 = load i32, i32* %42
%44 = icmp eq i32 %43, -1
br i1 %44, label %45, label %37
45: ; preds = %37, %33
%46 = call i32 @putchar(i8 signext 10)
ret i32 0
}