#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 *findDisappearedNumbers(int *, int, int *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int a[8] = {4, 3, 2, 7, 8, 2, 3, 1};
  int returnSize = 0;
  int *ans = NULL;
  ans = findDisappearedNumbers(a, 8, &returnSize);
  for (int i = 0; i < returnSize; i++)
    printf("%d,", ans[i]);
  printf(" is disappeared\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x34(%rbp)
movq   $0x0,-0x40(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x8,%esi
lea    -0x34(%rbp),%rdx
call   1040 <findDisappearedNumbers@plt>
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    11ba <main+0x9a>
mov    -0x40(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1187 <main+0x67>
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
movaps 0xed0(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rdx
mov    $0x8,%esi
call   1050 <findDisappearedNumbers@plt>
cmpl   $0x0,0xc(%rsp)
jle    119c <main+0x6c>
mov    %rax,%r15
lea    0xea2(%rip),%r14
xor    %ebx,%ebx
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
cmp    %rax,%rbx
jl     1180 <main+0x50>
lea    0xe81(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.a = [8 x i32] [i32 4, i32 3, i32 2, i32 7, i32 8, i32 2, i32 3, i32 1]
@.str = [4 x i8] c"%d,\00"
@.str.1 = [17 x i8] c" is disappeared\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [8 x i32]* %2 to i8*
store i32 0, i32* %3
store i32* null, i32** %4
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%8 = call i32* @findDisappearedNumbers(i32* %7, i32 8, i32* %3)
store i32* %8, i32** %4
store i32 0, i32* %5
br label %9
9: ; preds = %20, %0
%10 = load i32, i32* %5
%11 = load i32, i32* %3
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %23
13: ; preds = %9
%14 = load i32*, i32** %4
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %13
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %9
23: ; preds = %9
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [8 x i32] [i32 4, i32 3, i32 2, i32 7, i32 8, i32 2, i32 3, i32 1]
@.str = [4 x i8] c"%d,\00"
@str = [16 x i8] c" is disappeared\00"
define i32 @main() {
%1 = alloca [8 x i32]
%2 = alloca i32
%3 = bitcast [8 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%6 = call i32* @findDisappearedNumbers(i32* %5, i32 8, i32* %2)
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %11, %0
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
11: ; preds = %0, %11
%12 = phi i64 [ %16, %11 ], [ 0, %0 ]
%13 = getelementptr inbounds i32, i32* %6, i64 %12
%14 = load i32, i32* %13
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = add nuw nsw i64 %12, 1
%17 = load i32, i32* %2
%18 = sext i32 %17 to i64
%19 = icmp slt i64 %16, %18
br i1 %19, label %11, label %9
}