#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 x;
  printf("Enter some numbers:");
  scanf("%d", &x);
  int f = 0;
  if (x < 0) {
    f = -1;
  } else if (x == 0) {
    f = 0;
  } else {
    if (x > 5) {
      f = 2 * x;
    } else {
      f = 3 * x;
    }
  }
  printf("%d\n", f);
  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    0xed0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    116a <main+0x4a>
movl   $0xffffffff,-0xc(%rbp)
jmp    11a9 <main+0x89>
cmpl   $0x0,-0x8(%rbp)
jne    1180 <main+0x60>
movl   $0x0,-0xc(%rbp)
jmp    11a4 <main+0x84>
cmpl   $0x5,-0x8(%rbp)
jle    1198 <main+0x78>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    119f <main+0x7f>
imul   $0x3,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    11a4 <main+0x84>
jmp    11a9 <main+0x89>
mov    -0xc(%rbp),%esi
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
js     115b <main+0x3b>
je     1165 <main+0x45>
cmp    $0x6,%eax
jb     1162 <main+0x42>
add    %eax,%eax
mov    %eax,%ebx
jmp    1165 <main+0x45>
mov    $0xffffffff,%ebx
jmp    1165 <main+0x45>
lea    (%rax,%rax,2),%ebx
lea    0xeab(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Enter some numbers:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d\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 ([20 x i8], [20 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)
store i32 0, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 -1, i32* %3
br label %24
9: ; preds = %0
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 0, i32* %3
br label %23
13: ; preds = %9
%14 = load i32, i32* %2
%15 = icmp sgt i32 %14, 5
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i32, i32* %2
%18 = mul nsw i32 2, %17
store i32 %18, i32* %3
br label %22
19: ; preds = %13
%20 = load i32, i32* %2
%21 = mul nsw i32 3, %20
store i32 %21, i32* %3
br label %22
22: ; preds = %19, %16
br label %23
23: ; preds = %22, %12
br label %24
24: ; preds = %23, %8
%25 = load i32, i32* %3
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Enter some numbers:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 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, 0
br i1 %6, label %15, label %7
7: ; preds = %0
%8 = icmp eq i32 %5, 0
br i1 %8, label %15, label %9
9: ; preds = %7
%10 = icmp ugt i32 %5, 5
br i1 %10, label %11, label %13
11: ; preds = %9
%12 = shl nuw nsw i32 %5, 1
br label %15
13: ; preds = %9
%14 = mul nuw nsw i32 %5, 3
br label %15
15: ; preds = %7, %0, %13, %11
%16 = phi i32 [ %12, %11 ], [ %14, %13 ], [ -1, %0 ], [ 0, %7 ]
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %16)
ret i32 0
}