#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 find_missing(int /*<<< orphan*/, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ range_with_missing_number(int /*<<< orphan*/, int, int);
int main(int argc, const char *argv[]) {
  printf("Expect to find missing 9, found: %i\n",
         find_missing(range_with_missing_number(0, 10, 9), 9, 0));
  printf("Expect to find missing 99, found: %i\n",
         find_missing(range_with_missing_number(0, 99999, 99), 99, 0));
  printf("Expect to find missing 112, found: %i\n",
         find_missing(range_with_missing_number(0, 99999, 112), 112, 0));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
mov    $0xa,%esi
mov    $0x9,%edx
call   1050 <range_with_missing_number@plt>
mov    %eax,%edi
mov    $0x9,%esi
xor    %edx,%edx
call   1030 <find_missing@plt>
mov    %eax,%esi
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
mov    $0x1869f,%esi
mov    $0x63,%edx
call   1050 <range_with_missing_number@plt>
mov    %eax,%edi
mov    $0x63,%esi
xor    %edx,%edx
call   1030 <find_missing@plt>
mov    %eax,%esi
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
mov    $0x1869f,%esi
mov    $0x70,%edx
call   1050 <range_with_missing_number@plt>
mov    %eax,%edi
mov    $0x70,%esi
xor    %edx,%edx
call   1030 <find_missing@plt>
mov    %eax,%esi
lea    0xe83(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0xa,%esi
mov    $0x9,%edx
call   1050 <range_with_missing_number@plt>
mov    %eax,%edi
mov    $0x9,%esi
xor    %edx,%edx
call   1030 <find_missing@plt>
lea    0xea9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %edi,%edi
mov    $0x1869f,%esi
mov    $0x63,%edx
call   1050 <range_with_missing_number@plt>
mov    %eax,%edi
mov    $0x63,%esi
xor    %edx,%edx
call   1030 <find_missing@plt>
lea    0xea1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %edi,%edi
mov    $0x1869f,%esi
mov    $0x70,%edx
call   1050 <range_with_missing_number@plt>
mov    %eax,%edi
mov    $0x70,%esi
xor    %edx,%edx
call   1030 <find_missing@plt>
lea    0xe9a(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Expect to find missing 9, found: %i\0A\00"
@.str.1 = [38 x i8] c"Expect to find missing 99, found: %i\0A\00"
@.str.2 = [39 x i8] c"Expect to find missing 112, found: %i\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @range_with_missing_number(i32 0, i32 10, i32 9)
%7 = call i32 @find_missing(i32 %6, i32 9, i32 0)
%8 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @range_with_missing_number(i32 0, i32 99999, i32 99)
%10 = call i32 @find_missing(i32 %9, i32 99, i32 0)
%11 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = call i32 @range_with_missing_number(i32 0, i32 99999, i32 112)
%13 = call i32 @find_missing(i32 %12, i32 112, i32 0)
%14 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"Expect to find missing 9, found: %i\0A\00"
@.str.1 = [38 x i8] c"Expect to find missing 99, found: %i\0A\00"
@.str.2 = [39 x i8] c"Expect to find missing 112, found: %i\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @range_with_missing_number(i32 0, i32 10, i32 9)
%4 = tail call i32 @find_missing(i32 %3, i32 9, i32 0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @range_with_missing_number(i32 0, i32 99999, i32 99)
%7 = tail call i32 @find_missing(i32 %6, i32 99, i32 0)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = tail call i32 @range_with_missing_number(i32 0, i32 99999, i32 112)
%10 = tail call i32 @find_missing(i32 %9, i32 112, i32 0)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %10)
ret i32 0
}