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

/* Variables and functions */
int find_missing0(int *, size_t);
int /*<<< orphan*/ output(int *, size_t);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int retval = 0;
  int array[] = {2, 9, 4, 7, 5, 3, 6, 0, 8};
  size_t len = sizeof(array) / sizeof(array[0]);
  output(array, len);
  printf("missing: %d\n", find_missing0(array, len));
  output(array, len);
  return retval;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xe98(%rip),%rsi
mov    $0x24,%edx
call   1060 <memcpy@plt>
movq   $0x9,-0x48(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   1030 <output@plt>
lea    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   1050 <find_missing0@plt>
mov    %eax,%esi
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   1030 <output@plt>
mov    -0x14(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xee5(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeae(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    $0x9,%esi
mov    %rbx,%rdi
call   1030 <output@plt>
mov    $0x9,%esi
mov    %rbx,%rdi
call   1050 <find_missing0@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x9,%esi
mov    %rbx,%rdi
call   1030 <output@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.array = [9 x i32] [i32 2, i32 9, i32 4, i32 7, i32 5, i32 3, i32 6, i32 0, i32 8]
@.str = [13 x i8] c"missing: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [9 x i32]
%8 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%9 = bitcast [9 x i32]* %7 to i8*
store i64 9, i64* %8
%10 = getelementptr inbounds [9 x i32], [9 x i32]* %7, i64 0, i64 0
%11 = load i64, i64* %8
%12 = call i32 @output(i32* %10, i64 %11)
%13 = getelementptr inbounds [9 x i32], [9 x i32]* %7, i64 0, i64 0
%14 = load i64, i64* %8
%15 = call i32 @find_missing0(i32* %13, i64 %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = getelementptr inbounds [9 x i32], [9 x i32]* %7, i64 0, i64 0
%18 = load i64, i64* %8
%19 = call i32 @output(i32* %17, i64 %18)
%20 = load i32, i32* %6
ret i32 %20
}

LLVM IR (-O2):
@__const.main.array = [9 x i32] [i32 2, i32 9, i32 4, i32 7, i32 5, i32 3, i32 6, i32 0, i32 8]
@.str = [13 x i8] c"missing: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [9 x i32]
%4 = bitcast [9 x i32]* %3 to i8*
%5 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 0
%6 = call i32 @output(i32* %5, i64 9)
%7 = call i32 @find_missing0(i32* %5, i64 9)
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @output(i32* %5, i64 9)
ret i32 0
}