#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*/ arr;

/* Variables and functions */
int find_missing(int *, int, int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int arr[] = {1, 3, 5, 6, 2, 5, 6, 8, 9, 23, 45, 67, 87};
  int shuffled_arr[] = {1, 2, 5, 6, 8, 9, 3, 45, 87, 6, 67, 5};
  int On = sizeof(arr) / sizeof(arr[1]);
  printf("The missing value is:%d\n", find_missing(arr, On, shuffled_arr));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb3(%rip),%rsi
mov    $0x34,%edx
call   1050 <memcpy@plt>
lea    -0x70(%rbp),%rdi
lea    0xede(%rip),%rsi
mov    $0x30,%edx
call   1050 <memcpy@plt>
movl   $0xd,-0x74(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x74(%rbp),%esi
lea    -0x70(%rbp),%rdx
call   1030 <find_missing@plt>
mov    %eax,%esi
lea    0xee4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x78,%rsp
mov    0xf06(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xeeb(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb3(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xf08(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xeec(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xed0(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
mov    %rsp,%rdi
lea    0x40(%rsp),%rdx
mov    $0xd,%esi
call   1030 <find_missing@plt>
lea    0xee2(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x78,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [13 x i32] [i32 1, i32 3, i32 5, i32 6, i32 2, i32 5, i32 6, i32 8, i32 9, i32 23, i32 45, i32 67, i32 87]
@__const.main.shuffled_arr = [12 x i32] [i32 1, i32 2, i32 5, i32 6, i32 8, i32 9, i32 3, i32 45, i32 87, i32 6, i32 67, i32 5]
@.str = [25 x i8] c"The missing value is:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [13 x i32]
%3 = alloca [12 x i32]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [13 x i32]* %2 to i8*
%6 = bitcast [12 x i32]* %3 to i8*
store i32 13, i32* %4
%7 = getelementptr inbounds [13 x i32], [13 x i32]* %2, i64 0, i64 0
%8 = load i32, i32* %4
%9 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%10 = call i32 @find_missing(i32* %7, i32 %8, i32* %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [13 x i32] [i32 1, i32 3, i32 5, i32 6, i32 2, i32 5, i32 6, i32 8, i32 9, i32 23, i32 45, i32 67, i32 87]
@__const.main.shuffled_arr = [12 x i32] [i32 1, i32 2, i32 5, i32 6, i32 8, i32 9, i32 3, i32 45, i32 87, i32 6, i32 67, i32 5]
@.str = [25 x i8] c"The missing value is:%d\0A\00"
define i32 @main() {
%1 = alloca [13 x i32]
%2 = alloca [12 x i32]
%3 = bitcast [13 x i32]* %1 to i8*
%4 = bitcast [12 x i32]* %2 to i8*
%5 = getelementptr inbounds [13 x i32], [13 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [12 x i32], [12 x i32]* %2, i64 0, i64 0
%7 = call i32 @find_missing(i32* %5, i32 13, i32* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}