#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int a;
  printf("Please enter an integer that is greater than 0:");
  scanf("%d", &a);
  if (a <= 0)
    printf("The number you entered is out of range, please enter an integer "
           "greater than 0.");
  else if (a % 2 == 0)
    printf("The number is even.");
  else if (a % 2 == 1)
    printf("The number is odd.");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x4(%rbp)
jg     115f <main+0x3f>
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
jmp    11ae <main+0x8e>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1184 <main+0x64>
lea    0xf09(%rip),%rdi
call   1030 <printf@plt>
jmp    11a9 <main+0x89>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    11a4 <main+0x84>
lea    0xef8(%rip),%rdi
call   1030 <printf@plt>
jmp    11a9 <main+0x89>
jmp    11ae <main+0x8e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xefc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   $0x1,%al
lea    0xf38(%rip),%rcx
lea    0xf45(%rip),%rdx
cmove  %rcx,%rdx
test   %eax,%eax
lea    0xed4(%rip),%rdi
cmovg  %rdx,%rdi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [48 x i8] c"Please enter an integer that is greater than 0:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [80 x i8] c"The number you entered is out of range, please enter an integer greater than 0.\00"
@.str.3 = [20 x i8] c"The number is even.\00"
@.str.4 = [19 x i8] c"The number is odd.\00"
define void @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sle i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.2, i64 0, i64 0))
br label %22
8: ; preds = %0
%9 = load i32, i32* %1
%10 = srem i32 %9, 2
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
br label %21
14: ; preds = %8
%15 = load i32, i32* %1
%16 = srem i32 %15, 2
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
br label %20
20: ; preds = %18, %14
br label %21
21: ; preds = %20, %12
br label %22
22: ; preds = %21, %6
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"Please enter an integer that is greater than 0:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [80 x i8] c"The number you entered is out of range, please enter an integer greater than 0.\00"
@.str.3 = [20 x i8] c"The number is even.\00"
@.str.4 = [19 x i8] c"The number is odd.\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 1
%7 = and i32 %5, 1
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0)
%10 = select i1 %6, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.2, i64 0, i64 0), i8* %9
%11 = call i32 @printf(i8* dereferenceable(1) %10)
ret void
}