#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 g;
  float t;
  printf("Enter the GROSS salary [E.g 1658000] : ");
  scanf("%d", &g);
  if (g >= 1 && g <= 99999) {
    printf("Salary is non-taxable. Less than 100,000.\n");
  } else if (g >= 100000 && g <= 159999) {
    int x = g * 0.10;
    printf("Gross Salary Entered : %d\n", g);
    printf("Total Tax Due : = %d\n", x);
  } else if (g >= 160000 && g <= 249999) {
    int x = g * 0.20;
    printf("Gross Salary Entered : %d\n", g);
    printf("Total Tax Due : = %d\n", x);
  } else if (g >= 250000) {
    int x = g * 0.30;
    printf("Gross Salary Entered : %d\n", g);
    printf("Total Tax Due : = %d\n", x);
  } else
    printf("Your input did not matched or = 0.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jl     1177 <main+0x57>
cmpl   $0x1869f,-0x8(%rbp)
jg     1177 <main+0x57>
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1292 <main+0x172>
cmpl   $0x186a0,-0x8(%rbp)
jl     11d0 <main+0xb0>
cmpl   $0x270ff,-0x8(%rbp)
jg     11d0 <main+0xb0>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xe72(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    128d <main+0x16d>
cmpl   $0x27100,-0x8(%rbp)
jl     1229 <main+0x109>
cmpl   $0x3d08f,-0x8(%rbp)
jg     1229 <main+0x109>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xe11(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1288 <main+0x168>
cmpl   $0x3d090,-0x8(%rbp)
jl     1275 <main+0x155>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xdbd(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe16(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1283 <main+0x163>
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1288 <main+0x168>
jmp    128d <main+0x16d>
jmp    1292 <main+0x172>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef6(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%esi
lea    -0x1(%rsi),%eax
cmp    $0x1869e,%eax
ja     1170 <main+0x40>
lea    0xf2e(%rip),%rdi
call   1030 <puts@plt>
jmp    11dc <main+0xac>
lea    -0x186a0(%rsi),%eax
cmp    $0xea5f,%eax
ja     118b <main+0x5b>
cvtsi2sd %esi,%xmm0
mulsd  0xe87(%rip),%xmm0
jmp    11ba <main+0x8a>
lea    -0x27100(%rsi),%eax
cmp    $0x15f8f,%eax
ja     11a6 <main+0x76>
cvtsi2sd %esi,%xmm0
mulsd  0xe64(%rip),%xmm0
jmp    11ba <main+0x8a>
cmp    $0x3d090,%esi
jl     11e4 <main+0xb4>
cvtsi2sd %esi,%xmm0
mulsd  0xe46(%rip),%xmm0
cvttsd2si %xmm0,%ebx
lea    0xe7e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe8b(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret
lea    0xe89(%rip),%rdi
jmp    1169 <main+0x39>

LLVM IR (-O0):
@.str = [40 x i8] c"Enter the GROSS salary [E.g 1658000] : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [43 x i8] c"Salary is non-taxable. Less than 100,000.\0A\00"
@.str.3 = [27 x i8] c"Gross Salary Entered : %d\0A\00"
@.str.4 = [22 x i8] c"Total Tax Due : = %d\0A\00"
@.str.5 = [36 x i8] c"Your input did not matched or = 0.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 1
br i1 %10, label %11, label %16
11: ; preds = %0
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 99999
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
br label %63
16: ; preds = %11, %0
%17 = load i32, i32* %2
%18 = icmp sge i32 %17, 100000
br i1 %18, label %19, label %31
19: ; preds = %16
%20 = load i32, i32* %2
%21 = icmp sle i32 %20, 159999
br i1 %21, label %22, label %31
22: ; preds = %19
%23 = load i32, i32* %2
%24 = sitofp i32 %23 to double
%25 = fmul double %24, 1.000000e-01
%26 = fptosi double %25 to i32
store i32 %26, i32* %4
%27 = load i32, i32* %2
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %27)
%29 = load i32, i32* %4
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %29)
br label %62
31: ; preds = %19, %16
%32 = load i32, i32* %2
%33 = icmp sge i32 %32, 160000
br i1 %33, label %34, label %46
34: ; preds = %31
%35 = load i32, i32* %2
%36 = icmp sle i32 %35, 249999
br i1 %36, label %37, label %46
37: ; preds = %34
%38 = load i32, i32* %2
%39 = sitofp i32 %38 to double
%40 = fmul double %39, 2.000000e-01
%41 = fptosi double %40 to i32
store i32 %41, i32* %5
%42 = load i32, i32* %2
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %42)
%44 = load i32, i32* %5
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %44)
br label %61
46: ; preds = %34, %31
%47 = load i32, i32* %2
%48 = icmp sge i32 %47, 250000
br i1 %48, label %49, label %58
49: ; preds = %46
%50 = load i32, i32* %2
%51 = sitofp i32 %50 to double
%52 = fmul double %51, 3.000000e-01
%53 = fptosi double %52 to i32
store i32 %53, i32* %6
%54 = load i32, i32* %2
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %54)
%56 = load i32, i32* %6
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %56)
br label %60
58: ; preds = %46
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0))
br label %60
60: ; preds = %58, %49
br label %61
61: ; preds = %60, %37
br label %62
62: ; preds = %61, %22
br label %63
63: ; preds = %62, %14
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"Enter the GROSS salary [E.g 1658000] : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [27 x i8] c"Gross Salary Entered : %d\0A\00"
@.str.4 = [22 x i8] c"Total Tax Due : = %d\0A\00"
@str = [35 x i8] c"Your input did not matched or = 0.\00"
@str.6 = [42 x i8] c"Salary is non-taxable. Less than 100,000.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 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 = add i32 %5, -1
%7 = icmp ult i32 %6, 99999
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.6, i64 0, i64 0))
br label %38
10: ; preds = %0
%11 = add i32 %5, -100000
%12 = icmp ult i32 %11, 60000
br i1 %12, label %13, label %19
13: ; preds = %10
%14 = sitofp i32 %5 to double
%15 = fmul double %14, 1.000000e-01
%16 = fptosi double %15 to i32
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %5)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %16)
br label %38
19: ; preds = %10
%20 = add i32 %5, -160000
%21 = icmp ult i32 %20, 90000
br i1 %21, label %22, label %28
22: ; preds = %19
%23 = sitofp i32 %5 to double
%24 = fmul double %23, 2.000000e-01
%25 = fptosi double %24 to i32
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %5)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %25)
br label %38
28: ; preds = %19
%29 = icmp sgt i32 %5, 249999
br i1 %29, label %30, label %36
30: ; preds = %28
%31 = sitofp i32 %5 to double
%32 = fmul double %31, 3.000000e-01
%33 = fptosi double %32 to i32
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %5)
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %33)
br label %38
36: ; preds = %28
%37 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
br label %38
38: ; preds = %13, %30, %36, %22, %8
ret i32 0
}