#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*/ OS_HP_UX_print();
int /*<<< orphan*/ OS_Solaris_print();
int /*<<< orphan*/ OS_Windows_print();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  printf("Enter the number (1-3):\n");
  scanf("%d", &num);
  switch (num) {
  case 1:
    OS_Solaris_print();
    break;
  case 2:
    OS_Windows_print();
    break;
  case 3:
    OS_HP_UX_print();
    break;
  default:
    printf("Hmm! only 1-3 :-)\n");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
lea    0xea7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     11b1 <main+0x61>
jmp    118f <main+0x3f>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     11bd <main+0x6d>
jmp    11a0 <main+0x50>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     11c9 <main+0x79>
jmp    11d5 <main+0x85>
mov    $0x0,%al
call   1050 <OS_Solaris_print@plt>
jmp    11e1 <main+0x91>
mov    $0x0,%al
call   1070 <OS_Windows_print@plt>
jmp    11e1 <main+0x91>
mov    $0x0,%al
call   1030 <OS_HP_UX_print@plt>
jmp    11e1 <main+0x91>
lea    0xe40(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeab(%rip),%rdi
call   1040 <puts@plt>
lea    0xe9c(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x3,%eax
je     118a <main+0x3a>
cmp    $0x2,%eax
je     1193 <main+0x43>
cmp    $0x1,%eax
jne    119c <main+0x4c>
xor    %eax,%eax
call   1050 <OS_Solaris_print@plt>
jmp    11a8 <main+0x58>
xor    %eax,%eax
call   1030 <OS_HP_UX_print@plt>
jmp    11a8 <main+0x58>
xor    %eax,%eax
call   1070 <OS_Windows_print@plt>
jmp    11a8 <main+0x58>
lea    0xe78(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Enter the number (1-3):\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"Hmm! only 1-3 :-)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 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* %2)
%5 = load i32, i32* %2
switch i32 %5, label %12 [
i32 1, label %6
i32 2, label %8
i32 3, label %10
]
6: ; preds = %0
%7 = call i32 (...) @OS_Solaris_print()
br label %14
8: ; preds = %0
%9 = call i32 (...) @OS_Windows_print()
br label %14
10: ; preds = %0
%11 = call i32 (...) @OS_HP_UX_print()
br label %14
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %14
14: ; preds = %12, %10, %8, %6
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [24 x i8] c"Enter the number (1-3):\00"
@str.3 = [18 x i8] c"Hmm! only 1-3 :-)\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 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
switch i32 %5, label %12 [
i32 1, label %6
i32 2, label %8
i32 3, label %10
]
6: ; preds = %0
%7 = call i32 (...) @OS_Solaris_print()
br label %14
8: ; preds = %0
%9 = call i32 (...) @OS_Windows_print()
br label %14
10: ; preds = %0
%11 = call i32 (...) @OS_HP_UX_print()
br label %14
12: ; preds = %0
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.3, i64 0, i64 0))
br label %14
14: ; preds = %12, %10, %8, %6
ret i32 0
}