#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 missingNumber(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int arr1[] = {0, 1, 3};
  int arr2[] = {1, 0};
  int arr3[] = {1};
  printf("%d\n", missingNumber(arr1, 3));
  printf("%d\n", missingNumber(arr2, 2));
  printf("%d\n", missingNumber(arr3, 1));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    0xec9(%rip),%rax
mov    %rax,-0x14(%rbp)
mov    0xec7(%rip),%eax
mov    %eax,-0x18(%rbp)
lea    -0xc(%rbp),%rdi
mov    $0x3,%esi
call   1040 <missingNumber@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x14(%rbp),%rdi
mov    $0x2,%esi
call   1040 <missingNumber@plt>
mov    %eax,%esi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
lea    -0x18(%rbp),%rdi
mov    $0x1,%esi
call   1040 <missingNumber@plt>
mov    %eax,%esi
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xedd(%rip),%eax
mov    %eax,0x18(%rsp)
mov    0xeca(%rip),%rax
mov    %rax,0x10(%rsp)
movq   $0x1,0x8(%rsp)
movl   $0x1,0x4(%rsp)
lea    0x10(%rsp),%rdi
mov    $0x3,%esi
call   1040 <missingNumber@plt>
lea    0xeaa(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0x8(%rsp),%rdi
mov    $0x2,%esi
call   1040 <missingNumber@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
call   1040 <missingNumber@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr1 = [3 x i32] [i32 0, i32 1, i32 3]
@__const.main.arr2 = [2 x i32] [i32 1, i32 0]
@__const.main.arr3 = [1 x i32] [i32 1]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca [2 x i32]
%3 = alloca [1 x i32]
%4 = bitcast [3 x i32]* %1 to i8*
%5 = bitcast [2 x i32]* %2 to i8*
%6 = bitcast [1 x i32]* %3 to i8*
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%8 = call i32 @missingNumber(i32* %7, i32 3)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%11 = call i32 @missingNumber(i32* %10, i32 2)
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
%14 = call i32 @missingNumber(i32* %13, i32 1)
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr1 = [3 x i32] [i32 0, i32 1, i32 3]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca i64
%3 = alloca [1 x i32]
%4 = bitcast [3 x i32]* %1 to i8*
%5 = bitcast i64* %2 to i8*
store i64 1, i64* %2
%6 = bitcast [1 x i32]* %3 to i8*
%7 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
store i32 1, i32* %7
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%9 = call i32 @missingNumber(i32* %8, i32 3)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = bitcast i64* %2 to i32*
%12 = call i32 @missingNumber(i32* %11, i32 2)
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = call i32 @missingNumber(i32* %7, i32 1)
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}