#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 salary, tax;
  printf("Enter your salary: ");
  scanf("%d", &salary);
  if (salary <= 100000)
    tax = salary * 0;
  else if (salary > 100000 && salary <= 150000)
    tax = (salary - 100000) * 0.15 + 100000 * 0;
  else
    tax = (salary - 150000) * 0.25 + (150000 - 100000) * 0.15 + 100000 * 0;
  printf("\nThe net salary is %d", salary - tax);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x186a0,-0x8(%rbp)
jg     1166 <main+0x46>
imul   $0x0,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    11e2 <main+0xc2>
cmpl   $0x186a0,-0x8(%rbp)
jle    11ab <main+0x8b>
cmpl   $0x249f0,-0x8(%rbp)
jg     11ab <main+0x8b>
mov    -0x8(%rbp),%eax
sub    $0x186a0,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe7c(%rip),%xmm1
mulsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
jmp    11dd <main+0xbd>
mov    -0x8(%rbp),%eax
sub    $0x249f0,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe41(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe3d(%rip),%xmm1
addsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
jmp    11e2 <main+0xc2>
mov    -0x8(%rbp),%esi
sub    -0xc(%rbp),%esi
lea    0xe3d(%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    0xeec(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
cmp    $0x186a1,%esi
jl     1194 <main+0x74>
cmp    $0x249f0,%esi
ja     116e <main+0x4e>
lea    -0x186a0(%rsi),%eax
cvtsi2sd %eax,%xmm0
mulsd  0xea4(%rip),%xmm0
jmp    1188 <main+0x68>
lea    -0x249f0(%rsi),%eax
cvtsi2sd %eax,%xmm0
mulsd  0xe80(%rip),%xmm0
addsd  0xe80(%rip),%xmm0
xorpd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
cvttsd2si %xmm1,%ebx
sub    %ebx,%esi
lea    0xe8f(%rip),%rdi
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 your salary: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"\0AThe net salary is %d\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)
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 100000
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i32, i32* %2
%10 = mul nsw i32 %9, 0
store i32 %10, i32* %3
br label %31
11: ; preds = %0
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 100000
br i1 %13, label %14, label %23
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp sle i32 %15, 150000
br i1 %16, label %17, label %23
17: ; preds = %14
%18 = load i32, i32* %2
%19 = sub nsw i32 %18, 100000
%20 = sitofp i32 %19 to double
%21 = call double @llvm.fmuladd.f64(double %20, double 1.500000e-01, double 0.000000e+00)
%22 = fptosi double %21 to i32
store i32 %22, i32* %3
br label %30
23: ; preds = %14, %11
%24 = load i32, i32* %2
%25 = sub nsw i32 %24, 150000
%26 = sitofp i32 %25 to double
%27 = call double @llvm.fmuladd.f64(double %26, double 2.500000e-01, double 7.500000e+03)
%28 = fadd double %27, 0.000000e+00
%29 = fptosi double %28 to i32
store i32 %29, i32* %3
br label %30
30: ; preds = %23, %17
br label %31
31: ; preds = %30, %8
%32 = load i32, i32* %2
%33 = load i32, i32* %3
%34 = sub nsw i32 %32, %33
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %34)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Enter your salary: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"\0AThe net salary is %d\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, 100001
br i1 %6, label %20, label %7
7: ; preds = %0
%8 = icmp ult i32 %5, 150001
br i1 %8, label %9, label %14
9: ; preds = %7
%10 = add nsw i32 %5, -100000
%11 = sitofp i32 %10 to double
%12 = call double @llvm.fmuladd.f64(double %11, double 1.500000e-01, double 0.000000e+00)
%13 = fptosi double %12 to i32
br label %20
14: ; preds = %7
%15 = add nsw i32 %5, -150000
%16 = sitofp i32 %15 to double
%17 = call double @llvm.fmuladd.f64(double %16, double 2.500000e-01, double 7.500000e+03)
%18 = fadd double %17, 0.000000e+00
%19 = fptosi double %18 to i32
br label %20
20: ; preds = %0, %9, %14
%21 = phi i32 [ %13, %9 ], [ %19, %14 ], [ 0, %0 ]
%22 = sub nsw i32 %5, %21
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %22)
ret i32 0
}