#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*/ memset(int *, int /*<<< orphan*/, int);
bool containsDuplicate(int *nums, int numsSize) {
  int arr[1000000];
  int i;
  memset(arr, 0, 1000000);
  for (i = 0; i < numsSize; i++) {
    if (arr[nums[i]] == 1)
      return true;
    arr[nums[i]] = 1;
  }
  return false;
}


x86 assembly (clang, -O0):
<containsDuplicate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3d0930,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
lea    -0x3d0920(%rbp),%rdi
xor    %esi,%esi
mov    $0xf4240,%edx
call   1030 <memset@plt>
movl   $0x0,-0x3d0924(%rbp)
mov    -0x3d0924(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11a5 <containsDuplicate+0x95>
mov    -0x10(%rbp),%rax
movslq -0x3d0924(%rbp),%rcx
movslq (%rax,%rcx,4),%rax
cmpl   $0x1,-0x3d0920(%rbp,%rax,4)
01
jne    1177 <containsDuplicate+0x67>
movl   $0x1,-0x4(%rbp)
jmp    11ac <containsDuplicate+0x9c>
mov    -0x10(%rbp),%rax
movslq -0x3d0924(%rbp),%rcx
movslq (%rax,%rcx,4),%rax
movl   $0x1,-0x3d0920(%rbp,%rax,4)
mov    -0x3d0924(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3d0924(%rbp)
jmp    113f <containsDuplicate+0x2f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3d0930,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<containsDuplicate>:
push   %rbp
push   %r14
push   %rbx
sub    $0x3d0900,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rsp,%rdi
xor    %r14d,%r14d
xor    %esi,%esi
mov    $0xf4240,%edx
call   1030 <memset@plt>
test   %ebp,%ebp
jle    1165 <containsDuplicate+0x55>
mov    %ebp,%eax
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
movslq (%rbx,%rcx,4),%rdx
cmpl   $0x1,(%rsp,%rdx,4)
je     115f <containsDuplicate+0x4f>
movl   $0x1,(%rsp,%rdx,4)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1140 <containsDuplicate+0x30>
xor    %r14d,%r14d
jmp    1165 <containsDuplicate+0x55>
mov    $0x1,%r14d
mov    %r14d,%eax
add    $0x3d0900,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @containsDuplicate(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca [1000000 x i32]
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%8 = getelementptr inbounds [1000000 x i32], [1000000 x i32]* %6, i64 0, i64 0
%9 = call i32 @memset(i32* %8, i32 0, i32 1000000)
store i32 0, i32* %7
br label %10
10: ; preds = %33, %2
%11 = load i32, i32* %7
%12 = load i32, i32* %5
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %36
14: ; preds = %10
%15 = load i32*, i32** %4
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [1000000 x i32], [1000000 x i32]* %6, i64 0, i64 %20
%22 = load i32, i32* %21
%23 = icmp eq i32 %22, 1
br i1 %23, label %24, label %25
24: ; preds = %14
store i32 1, i32* %3
br label %37
25: ; preds = %14
%26 = load i32*, i32** %4
%27 = load i32, i32* %7
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i32, i32* %26, i64 %28
%30 = load i32, i32* %29
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [1000000 x i32], [1000000 x i32]* %6, i64 0, i64 %31
store i32 1, i32* %32
br label %33
33: ; preds = %25
%34 = load i32, i32* %7
%35 = add nsw i32 %34, 1
store i32 %35, i32* %7
br label %10
36: ; preds = %10
store i32 0, i32* %3
br label %37
37: ; preds = %36, %24
%38 = load i32, i32* %3
ret i32 %38
}

LLVM IR (-O2):
define i32 @containsDuplicate(i32* nocapture %0, i32 %1) {
%3 = alloca [1000000 x i32]
%4 = bitcast [1000000 x i32]* %3 to i8*
%5 = getelementptr inbounds [1000000 x i32], [1000000 x i32]* %3, i64 0, i64 0
%6 = call i32 @memset(i32* %5, i32 0, i32 1000000)
%7 = icmp sgt i32 %1, 0
br i1 %7, label %8, label %21
8: ; preds = %2
%9 = zext i32 %1 to i64
br label %10
10: ; preds = %8, %18
%11 = phi i64 [ 0, %8 ], [ %19, %18 ]
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [1000000 x i32], [1000000 x i32]* %3, i64 0, i64 %14
%16 = load i32, i32* %15
%17 = icmp eq i32 %16, 1
br i1 %17, label %21, label %18
18: ; preds = %10
store i32 1, i32* %15
%19 = add nuw nsw i64 %11, 1
%20 = icmp eq i64 %19, %9
br i1 %20, label %21, label %10
21: ; preds = %10, %18, %2
%22 = phi i32 [ 0, %2 ], [ 0, %18 ], [ 1, %10 ]
ret i32 %22
}