#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(void) {
  int number, degisken;
  printf("Enter the number: ");
  scanf("%d", &number);
  printf("Entered number: %d\n", number);
  if (number < 0) {
    degisken = 1;
  } else {
    if (number % 2 == 0) {
      degisken = 2;
    } else {
      degisken = 3;
    }
  }
  switch (degisken) {
  case 1:
    printf("Number is smaller than 0\n");
    break;
  case 2:
    printf("Number is bigger than 0 and cift number\n");
    break;
  case 3:
    printf("Number is bigger than 0 and tek number\n");
    break;
  default:
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
jge    1174 <main+0x54>
movl   $0x1,-0xc(%rbp)
jmp    11a0 <main+0x80>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1194 <main+0x74>
movl   $0x2,-0xc(%rbp)
jmp    119b <main+0x7b>
movl   $0x3,-0xc(%rbp)
jmp    11a0 <main+0x80>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     11d6 <main+0xb6>
jmp    11b4 <main+0x94>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     11e9 <main+0xc9>
jmp    11c5 <main+0xa5>
mov    -0x10(%rbp),%eax
sub    $0x3,%eax
je     11fc <main+0xdc>
jmp    120f <main+0xef>
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1214 <main+0xf4>
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1214 <main+0xf4>
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1214 <main+0xf4>
jmp    1214 <main+0xf4>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%esi
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%ecx
mov    %ecx,%eax
and    $0x1,%eax
add    $0x1,%eax
test   %ecx,%ecx
cmovs  %ebx,%eax
cmp    $0x3,%eax
je     1193 <main+0x63>
mov    %eax,%eax
lea    0xf0d(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Enter the number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"Entered number: %d\0A\00"
@.str.3 = [26 x i8] c"Number is smaller than 0\0A\00"
@.str.4 = [41 x i8] c"Number is bigger than 0 and cift number\0A\00"
@.str.5 = [40 x i8] c"Number is bigger than 0 and tek number\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %0
store i32 1, i32* %3
br label %18
11: ; preds = %0
%12 = load i32, i32* %2
%13 = srem i32 %12, 2
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 2, i32* %3
br label %17
16: ; preds = %11
store i32 3, i32* %3
br label %17
17: ; preds = %16, %15
br label %18
18: ; preds = %17, %10
%19 = load i32, i32* %3
switch i32 %19, label %26 [
i32 1, label %20
i32 2, label %22
i32 3, label %24
]
20: ; preds = %18
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %27
22: ; preds = %18
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0))
br label %27
24: ; preds = %18
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0))
br label %27
26: ; preds = %18
br label %27
27: ; preds = %26, %24, %22, %20
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Enter the number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"Entered number: %d\0A\00"
@str = [39 x i8] c"Number is bigger than 0 and tek number\00"
@str.6 = [40 x i8] c"Number is bigger than 0 and cift number\00"
@str.7 = [25 x i8] c"Number is smaller than 0\00"
@reltable.main = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([25 x i8]* @str.7 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([40 x i8]* @str.6 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([39 x i8]* @str to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 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 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = icmp slt i32 %7, 0
%9 = and i32 %7, 1
%10 = add nuw nsw i32 %9, 1
%11 = select i1 %8, i32 0, i32 %10
%12 = icmp eq i32 %11, 3
br i1 %12, label %18, label %13
13: ; preds = %0
%14 = zext i32 %11 to i64
%15 = shl i64 %14, 2
%16 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.main to i8*), i64 %15)
%17 = call i32 @puts(i8* dereferenceable(1) %16)
br label %18
18: ; preds = %0, %13
ret i32 0
}