#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 /*<<< orphan*/ clrKeyboardBuffer();
int /*<<< orphan*/ oneness(int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char **argv) {
  int firstGivenNumber, secondGivenNumber;
  printf("__--Oneness Property--__\n");
  printf("Enter a starting point (a number between 1-1,000): ");
  scanf("%d", &firstGivenNumber);
  while (firstGivenNumber <= 1 || firstGivenNumber >= 1000) {
    clrKeyboardBuffer();
    printf("I'm sorry. The first number should be between 1 and 1000. Try "
           "again: ");
    scanf("%d", &firstGivenNumber);
  }
  printf("Enter an ending point (a number between previous number-10,000): ");
  scanf("%d", &secondGivenNumber);
  while (secondGivenNumber <= firstGivenNumber || secondGivenNumber >= 10000) {
    clrKeyboardBuffer();
    printf("Sorry, but the second number must be higher than the first number "
           "and less than 10,000. Please, try again: ");
    scanf("%d", &secondGivenNumber);
  }
  oneness(firstGivenNumber, secondGivenNumber);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
lea    0xed9(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1060 <scanf@plt>
mov    $0x1,%al
cmpl   $0x1,-0x14(%rbp)
mov    %al,-0x19(%rbp)
jle    119a <main+0x5a>
cmpl   $0x3e8,-0x14(%rbp)
setge  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    11aa <main+0x6a>
jmp    11d2 <main+0x92>
mov    $0x0,%al
call   1050 <clrKeyboardBuffer@plt>
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
lea    0xe8a(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1060 <scanf@plt>
jmp    117e <main+0x3e>
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
lea    0xe69(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x18(%rbp),%ecx
mov    $0x1,%al
cmp    -0x14(%rbp),%ecx
mov    %al,-0x1a(%rbp)
jle    120c <main+0xcc>
cmpl   $0x2710,-0x18(%rbp)
setge  %al
mov    %al,-0x1a(%rbp)
mov    -0x1a(%rbp),%al
test   $0x1,%al
jne    121c <main+0xdc>
jmp    1244 <main+0x104>
mov    $0x0,%al
call   1050 <clrKeyboardBuffer@plt>
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
lea    0xe18(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1060 <scanf@plt>
jmp    11ee <main+0xae>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <oneness@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xfcd(%rip),%rdi
call   1030 <puts@plt>
lea    0xe96(%rip),%rdi
call   1050 <printf@plt>
lea    0xebe(%rip),%rdi
mov    %rsp,%rsi
call   1070 <scanf@plt>
mov    $0xfffffc18,%ebp
mov    (%rsp),%eax
add    %ebp,%eax
cmp    $0xfffffc19,%eax
ja     11c6 <main+0x76>
lea    0xea1(%rip),%r14
lea    0xe97(%rip),%r15
mov    %rsp,%rbx
xor    %eax,%eax
call   1060 <clrKeyboardBuffer@plt>
mov    %r14,%rdi
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
mov    (%rsp),%eax
add    %ebp,%eax
cmp    $0xfffffc1a,%eax
jb     11a0 <main+0x50>
lea    0xeb0(%rip),%rdi
call   1050 <printf@plt>
lea    0xe5b(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1070 <scanf@plt>
mov    0x4(%rsp),%esi
cmp    $0x270f,%esi
jg     11f6 <main+0xa6>
mov    (%rsp),%edi
cmp    %edi,%esi
jg     123d <main+0xed>
lea    0xec2(%rip),%r14
lea    0xe30(%rip),%r15
lea    0x4(%rsp),%rbx
nopl   0x0(%rax)
xor    %eax,%eax
call   1060 <clrKeyboardBuffer@plt>
mov    %r14,%rdi
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
mov    0x4(%rsp),%esi
cmp    $0x270f,%esi
jg     1210 <main+0xc0>
mov    (%rsp),%edi
cmp    %edi,%esi
jle    1210 <main+0xc0>
call   1040 <oneness@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"__--Oneness Property--__\0A\00"
@.str.1 = [52 x i8] c"Enter a starting point (a number between 1-1,000): \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [70 x i8] c"I'm sorry. The first number should be between 1 and 1000. Try again: \00"
@.str.4 = [66 x i8] c"Enter an ending point (a number between previous number-10,000): \00"
@.str.5 = [108 x i8] c"Sorry, but the second number must be higher than the first number and less than 10,000. Please, try again: \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %6)
br label %11
11: ; preds = %19, %2
%12 = load i32, i32* %6
%13 = icmp sle i32 %12, 1
br i1 %13, label %17, label %14
14: ; preds = %11
%15 = load i32, i32* %6
%16 = icmp sge i32 %15, 1000
br label %17
17: ; preds = %14, %11
%18 = phi i1 [ true, %11 ], [ %16, %14 ]
br i1 %18, label %19, label %23
19: ; preds = %17
%20 = call i32 (...) @clrKeyboardBuffer()
%21 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.3, i64 0, i64 0))
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %6)
br label %11
23: ; preds = %17
%24 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.4, i64 0, i64 0))
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %7)
br label %26
26: ; preds = %35, %23
%27 = load i32, i32* %7
%28 = load i32, i32* %6
%29 = icmp sle i32 %27, %28
br i1 %29, label %33, label %30
30: ; preds = %26
%31 = load i32, i32* %7
%32 = icmp sge i32 %31, 10000
br label %33
33: ; preds = %30, %26
%34 = phi i1 [ true, %26 ], [ %32, %30 ]
br i1 %34, label %35, label %39
35: ; preds = %33
%36 = call i32 (...) @clrKeyboardBuffer()
%37 = call i32 @printf(i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str.5, i64 0, i64 0))
%38 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %7)
br label %26
39: ; preds = %33
%40 = load i32, i32* %6
%41 = load i32, i32* %7
%42 = call i32 @oneness(i32 %40, i32 %41)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [52 x i8] c"Enter a starting point (a number between 1-1,000): \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [70 x i8] c"I'm sorry. The first number should be between 1 and 1000. Try again: \00"
@.str.4 = [66 x i8] c"Enter an ending point (a number between previous number-10,000): \00"
@.str.5 = [108 x i8] c"Sorry, but the second number must be higher than the first number and less than 10,000. Please, try again: \00"
@str = [25 x i8] c"__--Oneness Property--__\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%10 = load i32, i32* %3
%11 = add i32 %10, -1000
%12 = icmp ult i32 %11, -998
br i1 %12, label %13, label %20
13: ; preds = %2, %13
%14 = call i32 (...) @clrKeyboardBuffer()
%15 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%17 = load i32, i32* %3
%18 = add i32 %17, -1000
%19 = icmp ult i32 %18, -998
br i1 %19, label %13, label %20
20: ; preds = %13, %2
%21 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @.str.4, i64 0, i64 0))
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%23 = load i32, i32* %4
%24 = load i32, i32* %3
%25 = icmp sle i32 %23, %24
%26 = icmp sgt i32 %23, 9999
%27 = or i1 %26, %25
br i1 %27, label %28, label %37
28: ; preds = %20, %28
%29 = call i32 (...) @clrKeyboardBuffer()
%30 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([108 x i8], [108 x i8]* @.str.5, i64 0, i64 0))
%31 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%32 = load i32, i32* %4
%33 = load i32, i32* %3
%34 = icmp sle i32 %32, %33
%35 = icmp sgt i32 %32, 9999
%36 = or i1 %35, %34
br i1 %36, label %28, label %37
37: ; preds = %28, %20
%38 = phi i32 [ %23, %20 ], [ %32, %28 ]
%39 = phi i32 [ %24, %20 ], [ %33, %28 ]
%40 = call i32 @oneness(i32 %39, i32 %38)
ret i32 0
}