#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 */
typedef int /*<<< orphan*/ B;
typedef int /*<<< orphan*/ A;

/* Variables and functions */
int /*<<< orphan*/ output(int *, int);
int removeDuplicates(int *, int);
int main() {
  int A[] = {1, 2, 3, 4};
  int B[] = {1, 2, 3, 3, 4, 5, 5};
  output(A, sizeof(A) / sizeof(int));
  output(B, sizeof(B) / sizeof(int));
  output(A, removeDuplicates(A, sizeof(A) / sizeof(int)));
  output(B, removeDuplicates(B, sizeof(B) / sizeof(int)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xebc(%rip),%eax
mov    %eax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1030 <output@plt>
lea    -0x40(%rbp),%rdi
mov    $0x7,%esi
call   1030 <output@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x50(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1040 <removeDuplicates@plt>
mov    -0x50(%rbp),%rdi
mov    %eax,%esi
call   1030 <output@plt>
lea    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    -0x40(%rbp),%rdi
mov    $0x7,%esi
call   1040 <removeDuplicates@plt>
mov    -0x48(%rbp),%rdi
mov    %eax,%esi
call   1030 <output@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
movaps 0xed2(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xee3(%rip),%xmm0
movups %xmm0,0x1c(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <output@plt>
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    $0x7,%esi
call   1030 <output@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <removeDuplicates@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <output@plt>
mov    %r14,%rdi
mov    $0x7,%esi
call   1040 <removeDuplicates@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <output@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.A = [4 x i32] [i32 1, i32 2, i32 3, i32 4]
@__const.main.B = [7 x i32] [i32 1, i32 2, i32 3, i32 3, i32 4, i32 5, i32 5]
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca [7 x i32]
store i32 0, i32* %1
%4 = bitcast [4 x i32]* %2 to i8*
%5 = bitcast [7 x i32]* %3 to i8*
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%7 = call i32 @output(i32* %6, i32 4)
%8 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%9 = call i32 @output(i32* %8, i32 7)
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%11 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%12 = call i32 @removeDuplicates(i32* %11, i32 4)
%13 = call i32 @output(i32* %10, i32 %12)
%14 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%15 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%16 = call i32 @removeDuplicates(i32* %15, i32 7)
%17 = call i32 @output(i32* %14, i32 %16)
ret i32 0
}

LLVM IR (-O2):
@__const.main.A = [4 x i32] [i32 1, i32 2, i32 3, i32 4]
@__const.main.B = [7 x i32] [i32 1, i32 2, i32 3, i32 3, i32 4, i32 5, i32 5]
define i32 @main() {
%1 = alloca [4 x i32]
%2 = alloca [7 x i32]
%3 = bitcast [4 x i32]* %1 to i8*
%4 = bitcast [7 x i32]* %2 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%6 = call i32 @output(i32* %5, i32 4)
%7 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%8 = call i32 @output(i32* %7, i32 7)
%9 = call i32 @removeDuplicates(i32* %5, i32 4)
%10 = call i32 @output(i32* %5, i32 %9)
%11 = call i32 @removeDuplicates(i32* %7, i32 7)
%12 = call i32 @output(i32* %7, i32 %11)
ret i32 0
}