#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*/ clr();
int /*<<< orphan*/ gotoxy(int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, long *);
int main() {
  long int a, b;
  clr();
  gotoxy(10, 10);
  printf("Enter your grade: ");
  scanf("%ld", &a);
  if (a > 40 && a < 60) {
    b = 1;
  } else if (a >= 60 && a <= 70) {
    b = 2;
  } else if (a > 70 && a < 100) {
    b = 3;
  }
  switch (b) {
  case 1:
    printf("\n \t You'll be good at Arts");
  case 2:
    printf("\n \t You'll be god at Commerce");
  case 3:
    printf("\n \t You'll be good at Science");
    break;
  default:
    printf("\n \tDefault");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clr@plt>
mov    $0xa,%esi
mov    %esi,%edi
call   1060 <gotoxy@plt>
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
lea    0xe9e(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
cmpq   $0x28,-0x10(%rbp)
jle    11a1 <main+0x61>
cmpq   $0x3c,-0x10(%rbp)
jge    11a1 <main+0x61>
movq   $0x1,-0x18(%rbp)
jmp    11ec <main+0xac>
cmpq   $0x3c,-0x10(%rbp)
jl     11c4 <main+0x84>
cmpq   $0x46,-0x10(%rbp)
jg     11c4 <main+0x84>
movq   $0x2,-0x18(%rbp)
jmp    11e7 <main+0xa7>
cmpq   $0x46,-0x10(%rbp)
jle    11e2 <main+0xa2>
cmpq   $0x64,-0x10(%rbp)
jge    11e2 <main+0xa2>
movq   $0x3,-0x18(%rbp)
jmp    11e7 <main+0xa7>
jmp    11ec <main+0xac>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
sub    $0x1,%rax
je     1229 <main+0xe9>
jmp    1203 <main+0xc3>
mov    -0x20(%rbp),%rax
sub    $0x2,%rax
je     1235 <main+0xf5>
jmp    1216 <main+0xd6>
mov    -0x20(%rbp),%rax
sub    $0x3,%rax
je     1241 <main+0x101>
jmp    1252 <main+0x112>
lea    0xde7(%rip),%rdi
call   1040 <printf@plt>
lea    0xdf6(%rip),%rdi
call   1040 <printf@plt>
lea    0xe08(%rip),%rdi
call   1040 <printf@plt>
jmp    125e <main+0x11e>
lea    0xe15(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <clr@plt>
mov    $0xa,%edi
mov    $0xa,%esi
call   1060 <gotoxy@plt>
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
lea    0xea9(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
mov    (%rsp),%rax
lea    -0x29(%rax),%rcx
cmp    $0x13,%rcx
jae    118e <main+0x4e>
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
jmp    1198 <main+0x58>
add    $0xffffffffffffffc4,%rax
cmp    $0xb,%rax
jae    11a4 <main+0x64>
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Enter your grade: \00"
@.str.1 = [4 x i8] c"%ld\00"
@.str.2 = [27 x i8] c"\0A \09 You'll be good at Arts\00"
@.str.3 = [30 x i8] c"\0A \09 You'll be god at Commerce\00"
@.str.4 = [30 x i8] c"\0A \09 You'll be good at Science\00"
@.str.5 = [11 x i8] c"\0A \09Default\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
%4 = call i32 (...) @clr()
%5 = call i32 @gotoxy(i32 10, i32 10)
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %2)
%8 = load i64, i64* %2
%9 = icmp sgt i64 %8, 40
br i1 %9, label %10, label %14
10: ; preds = %0
%11 = load i64, i64* %2
%12 = icmp slt i64 %11, 60
br i1 %12, label %13, label %14
13: ; preds = %10
store i64 1, i64* %3
br label %30
14: ; preds = %10, %0
%15 = load i64, i64* %2
%16 = icmp sge i64 %15, 60
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = load i64, i64* %2
%19 = icmp sle i64 %18, 70
br i1 %19, label %20, label %21
20: ; preds = %17
store i64 2, i64* %3
br label %29
21: ; preds = %17, %14
%22 = load i64, i64* %2
%23 = icmp sgt i64 %22, 70
br i1 %23, label %24, label %28
24: ; preds = %21
%25 = load i64, i64* %2
%26 = icmp slt i64 %25, 100
br i1 %26, label %27, label %28
27: ; preds = %24
store i64 3, i64* %3
br label %28
28: ; preds = %27, %24, %21
br label %29
29: ; preds = %28, %20
br label %30
30: ; preds = %29, %13
%31 = load i64, i64* %3
switch i64 %31, label %38 [
i64 1, label %32
i64 2, label %34
i64 3, label %36
]
32: ; preds = %30
%33 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %34
34: ; preds = %30, %32
%35 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
br label %36
36: ; preds = %30, %34
%37 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
br label %40
38: ; preds = %30
%39 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
br label %40
40: ; preds = %38, %36
%41 = load i32, i32* %1
ret i32 %41
}

LLVM IR (-O2):
@.str = [19 x i8] c"Enter your grade: \00"
@.str.1 = [4 x i8] c"%ld\00"
@.str.2 = [27 x i8] c"\0A \09 You'll be good at Arts\00"
@.str.3 = [30 x i8] c"\0A \09 You'll be god at Commerce\00"
@.str.4 = [30 x i8] c"\0A \09 You'll be good at Science\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i32 (...) @clr()
%4 = tail call i32 @gotoxy(i32 10, i32 10)
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%7 = load i64, i64* %1
%8 = add i64 %7, -41
%9 = icmp ult i64 %8, 19
br i1 %9, label %13, label %10
10: ; preds = %0
%11 = add i64 %7, -60
%12 = icmp ult i64 %11, 11
br i1 %12, label %15, label %17
13: ; preds = %0
%14 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %10, %13
%16 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
br label %17
17: ; preds = %10, %15
%18 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}