#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 *);
int main() {
  int num, i;
  printf("Enter real number\n");
  scanf("%d", &num);
  if (num % 2 == 0)
    i = 1;
  else
    i = 0;
  switch (i) {
  case 1:
    printf("the number is even\n");
    break;
  default:
    switch (i) {
    case 0:
      printf("the numver is odd\n");
      break;
    default:
      printf("Try again plz\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    116b <main+0x4b>
movl   $0x1,-0xc(%rbp)
jmp    1172 <main+0x52>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
jne    1194 <main+0x74>
jmp    1183 <main+0x63>
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
jmp    11c6 <main+0xa6>
mov    -0xc(%rbp),%eax
test   %eax,%eax
jne    11b5 <main+0x95>
jmp    11a4 <main+0x84>
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
jmp    11c1 <main+0xa1>
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
jmp    11c6 <main+0xa6>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
testb  $0x1,0x4(%rsp)
lea    0xedd(%rip),%rax
lea    0xec4(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Enter real number\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"the number is even\0A\00"
@.str.3 = [19 x i8] c"the numver is odd\0A\00"
@.str.4 = [15 x i8] c"Try again plz\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = srem i32 %6, 2
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 1, i32* %3
br label %11
10: ; preds = %0
store i32 0, i32* %3
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %3
switch i32 %12, label %15 [
i32 1, label %13
]
13: ; preds = %11
%14 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %22
15: ; preds = %11
%16 = load i32, i32* %3
switch i32 %16, label %19 [
i32 0, label %17
]
17: ; preds = %15
%18 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
br label %21
19: ; preds = %15
%20 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
br label %21
21: ; preds = %19, %17
br label %22
22: ; preds = %21, %13
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [18 x i8] c"Enter real number\00"
@str.5 = [18 x i8] c"the numver is odd\00"
@str.6 = [19 x i8] c"the number is even\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 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 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.6, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str.5, i64 0, i64 0)
%9 = call i32 @puts(i8* dereferenceable(1) %8)
ret i32 0
}