#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*/ assert(int);
int containsDuplicate(int *, int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  int arr1[] = {3, 3};
  int arr2[] = {};
  int arr3[] = {0};
  assert(containsDuplicate(arr1, 2) == true);
  assert(containsDuplicate(arr2, 0) == false);
  assert(containsDuplicate(arr3, 1) == false);
  printf("All passed\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0xc(%rbp)
lea    -0x14(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
lea    -0xc(%rbp),%rdi
mov    $0x2,%esi
call   1060 <containsDuplicate@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1060 <containsDuplicate@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    -0x14(%rbp),%rdi
mov    $0x1,%esi
call   1060 <containsDuplicate@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xe40(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x300000003,%rax
mov    %rax,0x10(%rsp)
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%rdi
mov    $0x2,%esi
call   1050 <containsDuplicate@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1050 <containsDuplicate@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xc(%rsp),%rdi
mov    $0x1,%esi
call   1050 <containsDuplicate@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xe5c(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@str = [11 x i8] c"All passed\00"
define i32 @main() {
%1 = alloca [0 x i32]
%2 = alloca i64
%3 = alloca [1 x i32]
%4 = bitcast i64* %2 to i8*
store i64 12884901891, i64* %2
%5 = bitcast [0 x i32]* %1 to i8*
%6 = bitcast [1 x i32]* %3 to i8*
%7 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
store i32 0, i32* %7
%8 = bitcast i64* %2 to i32*
%9 = call i32 @containsDuplicate(i32* %8, i32 2)
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = getelementptr inbounds [0 x i32], [0 x i32]* %1, i64 0, i64 0
%14 = call i32 @containsDuplicate(i32* %13, i32 0)
%15 = icmp eq i32 %14, 0
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = call i32 @containsDuplicate(i32* %7, i32 1)
%19 = icmp eq i32 %18, 0
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}