#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 i, a;
  printf("1.English\n 2.Telugu\n 3.Hindi\n 4.Sanskrit\n\n");
  printf("Enter your choic\n\n");
  scanf("%d", &a);
  switch (a) {
  case 1:
    printf("Welcome to C");
    break;
  case 2:
    printf("C ki swagatam");
    break;
  case 3:
    printf("C ka swagat hay");
    break;
  case 4:
    printf("C ka swagataha");
    break;
  default:
    printf("Invalid option");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x3,%eax
ja     11c4 <main+0xa4>
mov    -0x18(%rbp),%rax
lea    0xe89(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
jmp    11d0 <main+0xb0>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
jmp    11d0 <main+0xb0>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
jmp    11d0 <main+0xb0>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
jmp    11d0 <main+0xb0>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf14(%rip),%rdi
call   1030 <puts@plt>
lea    0xf32(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x3,%eax
ja     1178 <main+0x48>
cltq
lea    0xf19(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    117f <main+0x4f>
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"1.English\0A 2.Telugu\0A 3.Hindi\0A 4.Sanskrit\0A\0A\00"
@.str.1 = [19 x i8] c"Enter your choic\0A\0A\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [13 x i8] c"Welcome to C\00"
@.str.4 = [14 x i8] c"C ki swagatam\00"
@.str.5 = [16 x i8] c"C ka swagat hay\00"
@.str.6 = [15 x i8] c"C ka swagataha\00"
@.str.7 = [15 x i8] c"Invalid option\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 ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
switch i32 %7, label %16 [
i32 1, label %8
i32 2, label %10
i32 3, label %12
i32 4, label %14
]
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
br label %18
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
br label %18
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
br label %18
14: ; preds = %0
%15 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
br label %18
16: ; preds = %0
%17 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0))
br label %18
18: ; preds = %16, %14, %12, %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [13 x i8] c"Welcome to C\00"
@.str.4 = [14 x i8] c"C ki swagatam\00"
@.str.5 = [16 x i8] c"C ka swagat hay\00"
@.str.6 = [15 x i8] c"C ka swagataha\00"
@.str.7 = [15 x i8] c"Invalid option\00"
@str = [42 x i8] c"1.English\0A 2.Telugu\0A 3.Hindi\0A 4.Sanskrit\0A\00"
@str.8 = [18 x i8] c"Enter your choic\0A\00"
@reltable.main = [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.3 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.4 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str.5 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str.6 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.8, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = add i32 %6, -1
%8 = icmp ult i32 %7, 4
br i1 %8, label %9, label %13
9: ; preds = %0
%10 = sext i32 %7 to i64
%11 = shl i64 %10, 2
%12 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.main to i8*), i64 %11)
br label %13
13: ; preds = %0, %9
%14 = phi i8* [ %12, %9 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), %0 ]
%15 = call i32 @printf(i8* dereferenceable(1) %14)
ret i32 0
}