#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*/ findMissingInt(long *, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(void) {
  int dataSize = 200000;
  long int *values = (long int *)malloc(dataSize * sizeof(long int));
  for (long int i = 0; i < dataSize; i++) {
    values[i] = i;
  }
  values[100549] = 0;
  printf("Missing integer is: %li\n", findMissingInt(values, dataSize));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x30d40,-0x8(%rbp)
movslq -0x8(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
cmp    %rcx,%rax
jge    1193 <main+0x63>
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1161 <main+0x31>
mov    -0x10(%rbp),%rax
movq   $0x0,0xc4628(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1040 <findMissingInt@plt>
mov    %eax,%esi
lea    0xe49(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x186a00,%edi
call   1050 <malloc@plt>
movdqa 0xebd(%rip),%xmm0
mov    $0x12,%ecx
movdqa 0xebf(%rip),%xmm8
movdqa 0xec6(%rip),%xmm9
movdqa 0xecd(%rip),%xmm10
movdqa 0xed4(%rip),%xmm11
movdqa 0xedb(%rip),%xmm12
movdqa 0xee3(%rip),%xmm6
movdqa 0xeeb(%rip),%xmm7
movdqa 0xef3(%rip),%xmm1
movdqa 0xefb(%rip),%xmm2
movdqa 0xf03(%rip),%xmm3
nopl   (%rax)
movdqa %xmm0,%xmm4
paddq  %xmm8,%xmm4
movdqu %xmm0,-0x90(%rax,%rcx,8)
ff ff
movdqu %xmm4,-0x80(%rax,%rcx,8)
movdqa %xmm0,%xmm4
paddq  %xmm9,%xmm4
movdqa %xmm0,%xmm5
paddq  %xmm10,%xmm5
movdqu %xmm4,-0x70(%rax,%rcx,8)
movdqu %xmm5,-0x60(%rax,%rcx,8)
movdqa %xmm0,%xmm4
paddq  %xmm11,%xmm4
movdqa %xmm0,%xmm5
paddq  %xmm12,%xmm5
movdqu %xmm4,-0x50(%rax,%rcx,8)
movdqu %xmm5,-0x40(%rax,%rcx,8)
movdqa %xmm0,%xmm4
paddq  %xmm6,%xmm4
movdqa %xmm0,%xmm5
paddq  %xmm7,%xmm5
movdqu %xmm4,-0x30(%rax,%rcx,8)
movdqu %xmm5,-0x20(%rax,%rcx,8)
movdqa %xmm0,%xmm4
paddq  %xmm1,%xmm4
movdqa %xmm0,%xmm5
paddq  %xmm2,%xmm5
movdqu %xmm4,-0x10(%rax,%rcx,8)
movdqu %xmm5,(%rax,%rcx,8)
paddq  %xmm3,%xmm0
add    $0x14,%rcx
cmp    $0x30d52,%rcx
jne    11a0 <main+0x70>
movq   $0x0,0xc4628(%rax)
mov    %rax,%rdi
mov    $0x30d40,%esi
call   1040 <findMissingInt@plt>
lea    0xe51(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Missing integer is: %li\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64*
%4 = alloca i64
store i32 0, i32* %1
store i32 200000, i32* %2
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = mul i64 %6, 8
%8 = trunc i64 %7 to i32
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i64*
store i64* %10, i64** %3
store i64 0, i64* %4
br label %11
11: ; preds = %21, %0
%12 = load i64, i64* %4
%13 = load i32, i32* %2
%14 = sext i32 %13 to i64
%15 = icmp slt i64 %12, %14
br i1 %15, label %16, label %24
16: ; preds = %11
%17 = load i64, i64* %4
%18 = load i64*, i64** %3
%19 = load i64, i64* %4
%20 = getelementptr inbounds i64, i64* %18, i64 %19
store i64 %17, i64* %20
br label %21
21: ; preds = %16
%22 = load i64, i64* %4
%23 = add nsw i64 %22, 1
store i64 %23, i64* %4
br label %11
24: ; preds = %11
%25 = load i64*, i64** %3
%26 = getelementptr inbounds i64, i64* %25, i64 100549
store i64 0, i64* %26
%27 = load i64*, i64** %3
%28 = load i32, i32* %2
%29 = call i32 @findMissingInt(i64* %27, i32 %28)
%30 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Missing integer is: %li\0A\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 1600000)
%2 = inttoptr i64 %1 to i64*
br label %3
3: ; preds = %3, %0
%4 = phi i64 [ 0, %0 ], [ %39, %3 ]
%5 = phi <2 x i64> [ <i64 0, i64 1>, %0 ], [ %40, %3 ]
%6 = add <2 x i64> %5, <i64 2, i64 2>
%7 = getelementptr inbounds i64, i64* %2, i64 %4
%8 = bitcast i64* %7 to <2 x i64>*
store <2 x i64> %5, <2 x i64>* %8
%9 = getelementptr inbounds i64, i64* %7, i64 2
%10 = bitcast i64* %9 to <2 x i64>*
store <2 x i64> %6, <2 x i64>* %10
%11 = add nuw nsw i64 %4, 4
%12 = add <2 x i64> %5, <i64 4, i64 4>
%13 = add <2 x i64> %5, <i64 6, i64 6>
%14 = getelementptr inbounds i64, i64* %2, i64 %11
%15 = bitcast i64* %14 to <2 x i64>*
store <2 x i64> %12, <2 x i64>* %15
%16 = getelementptr inbounds i64, i64* %14, i64 2
%17 = bitcast i64* %16 to <2 x i64>*
store <2 x i64> %13, <2 x i64>* %17
%18 = add nuw nsw i64 %4, 8
%19 = add <2 x i64> %5, <i64 8, i64 8>
%20 = add <2 x i64> %5, <i64 10, i64 10>
%21 = getelementptr inbounds i64, i64* %2, i64 %18
%22 = bitcast i64* %21 to <2 x i64>*
store <2 x i64> %19, <2 x i64>* %22
%23 = getelementptr inbounds i64, i64* %21, i64 2
%24 = bitcast i64* %23 to <2 x i64>*
store <2 x i64> %20, <2 x i64>* %24
%25 = add nuw nsw i64 %4, 12
%26 = add <2 x i64> %5, <i64 12, i64 12>
%27 = add <2 x i64> %5, <i64 14, i64 14>
%28 = getelementptr inbounds i64, i64* %2, i64 %25
%29 = bitcast i64* %28 to <2 x i64>*
store <2 x i64> %26, <2 x i64>* %29
%30 = getelementptr inbounds i64, i64* %28, i64 2
%31 = bitcast i64* %30 to <2 x i64>*
store <2 x i64> %27, <2 x i64>* %31
%32 = add nuw nsw i64 %4, 16
%33 = add <2 x i64> %5, <i64 16, i64 16>
%34 = add <2 x i64> %5, <i64 18, i64 18>
%35 = getelementptr inbounds i64, i64* %2, i64 %32
%36 = bitcast i64* %35 to <2 x i64>*
store <2 x i64> %33, <2 x i64>* %36
%37 = getelementptr inbounds i64, i64* %35, i64 2
%38 = bitcast i64* %37 to <2 x i64>*
store <2 x i64> %34, <2 x i64>* %38
%39 = add nuw nsw i64 %4, 20
%40 = add <2 x i64> %5, <i64 20, i64 20>
%41 = icmp eq i64 %39, 200000
br i1 %41, label %42, label %3
42: ; preds = %3
%43 = getelementptr inbounds i64, i64* %2, i64 100549
store i64 0, i64* %43
%44 = tail call i32 @findMissingInt(i64* %2, i32 200000)
%45 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %44)
ret i32 0
}