#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 income;
  float tax;
  printf("enter the income: ");
  scanf("%d", &income);
  if (income < 750)
    tax = (1.0 / 100) * income;
  else if (income <= 2250)
    tax = 7.5f + 0.02 * (income - 750);
  else if (income <= 3750)
    tax = 37.50f + 0.03 * (income - 2250);
  else if (income <= 5250)
    tax = 82.50f + 0.04 * (income - 3750);
  else if (income <= 7000)
    tax = 142.50f + 0.05 * (income - 5250);
  else
    tax = 230.00f + 0.06 * (income - 7000);
  printf("the tax amount you need to pay is %.2f\n", tax);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf27(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x2ee,-0x8(%rbp)
jge    1179 <main+0x59>
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xee9(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    12b6 <main+0x196>
cmpl   $0x8ca,-0x8(%rbp)
jg     11b8 <main+0x98>
mov    -0x8(%rbp),%eax
sub    $0x2ee,%eax
cvtsi2sd %eax,%xmm0
movsd  0xea6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea2(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    12b1 <main+0x191>
cmpl   $0xea6,-0x8(%rbp)
jg     11f7 <main+0xd7>
mov    -0x8(%rbp),%eax
sub    $0x8ca,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe57(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe53(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    12ac <main+0x18c>
cmpl   $0x1482,-0x8(%rbp)
jg     1236 <main+0x116>
mov    -0x8(%rbp),%eax
sub    $0xea6,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe08(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe04(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    12a7 <main+0x187>
cmpl   $0x1b58,-0x8(%rbp)
jg     1275 <main+0x155>
mov    -0x8(%rbp),%eax
sub    $0x1482,%eax
cvtsi2sd %eax,%xmm0
movsd  0xdb9(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdb5(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    12a2 <main+0x182>
mov    -0x8(%rbp),%eax
sub    $0x1b58,%eax
cvtsi2sd %eax,%xmm0
movsd  0xd77(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd73(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    12a7 <main+0x187>
jmp    12ac <main+0x18c>
jmp    12b1 <main+0x191>
jmp    12b6 <main+0x196>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xda8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf30(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf35(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x2ed,%eax
jg     115c <main+0x3c>
cvtsi2sd %eax,%xmm0
mulsd  0xef9(%rip),%xmm0
jmp    11fd <main+0xdd>
cmp    $0x8ca,%eax
ja     117e <main+0x5e>
add    $0xfffffd12,%eax
cvtsi2sd %eax,%xmm0
mulsd  0xecc(%rip),%xmm0
addsd  0xecc(%rip),%xmm0
jmp    11fd <main+0xdd>
cmp    $0xea6,%eax
ja     11a0 <main+0x80>
add    $0xfffff736,%eax
cvtsi2sd %eax,%xmm0
mulsd  0xe9a(%rip),%xmm0
addsd  0xe9a(%rip),%xmm0
jmp    11fd <main+0xdd>
cmp    $0x1482,%eax
ja     11c2 <main+0xa2>
add    $0xfffff15a,%eax
cvtsi2sd %eax,%xmm0
mulsd  0xe68(%rip),%xmm0
addsd  0xe68(%rip),%xmm0
jmp    11fd <main+0xdd>
cmp    $0x1b58,%eax
ja     11e4 <main+0xc4>
add    $0xffffeb7e,%eax
cvtsi2sd %eax,%xmm0
mulsd  0xe36(%rip),%xmm0
addsd  0xe36(%rip),%xmm0
jmp    11fd <main+0xdd>
add    $0xffffe4a8,%eax
cvtsi2sd %eax,%xmm0
mulsd  0xe0b(%rip),%xmm0
addsd  0xe0b(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe62(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"enter the income: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [40 x i8] c"the tax amount you need to pay is %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 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 slt i32 %6, 750
br i1 %7, label %8, label %13
8: ; preds = %0
%9 = load i32, i32* %2
%10 = sitofp i32 %9 to double
%11 = fmul double 1.000000e-02, %10
%12 = fptrunc double %11 to float
store float %12, float* %3
br label %59
13: ; preds = %0
%14 = load i32, i32* %2
%15 = icmp sle i32 %14, 2250
br i1 %15, label %16, label %22
16: ; preds = %13
%17 = load i32, i32* %2
%18 = sub nsw i32 %17, 750
%19 = sitofp i32 %18 to double
%20 = call double @llvm.fmuladd.f64(double 2.000000e-02, double %19, double 7.500000e+00)
%21 = fptrunc double %20 to float
store float %21, float* %3
br label %58
22: ; preds = %13
%23 = load i32, i32* %2
%24 = icmp sle i32 %23, 3750
br i1 %24, label %25, label %31
25: ; preds = %22
%26 = load i32, i32* %2
%27 = sub nsw i32 %26, 2250
%28 = sitofp i32 %27 to double
%29 = call double @llvm.fmuladd.f64(double 3.000000e-02, double %28, double 3.750000e+01)
%30 = fptrunc double %29 to float
store float %30, float* %3
br label %57
31: ; preds = %22
%32 = load i32, i32* %2
%33 = icmp sle i32 %32, 5250
br i1 %33, label %34, label %40
34: ; preds = %31
%35 = load i32, i32* %2
%36 = sub nsw i32 %35, 3750
%37 = sitofp i32 %36 to double
%38 = call double @llvm.fmuladd.f64(double 4.000000e-02, double %37, double 8.250000e+01)
%39 = fptrunc double %38 to float
store float %39, float* %3
br label %56
40: ; preds = %31
%41 = load i32, i32* %2
%42 = icmp sle i32 %41, 7000
br i1 %42, label %43, label %49
43: ; preds = %40
%44 = load i32, i32* %2
%45 = sub nsw i32 %44, 5250
%46 = sitofp i32 %45 to double
%47 = call double @llvm.fmuladd.f64(double 5.000000e-02, double %46, double 1.425000e+02)
%48 = fptrunc double %47 to float
store float %48, float* %3
br label %55
49: ; preds = %40
%50 = load i32, i32* %2
%51 = sub nsw i32 %50, 7000
%52 = sitofp i32 %51 to double
%53 = call double @llvm.fmuladd.f64(double 6.000000e-02, double %52, double 2.300000e+02)
%54 = fptrunc double %53 to float
store float %54, float* %3
br label %55
55: ; preds = %49, %43
br label %56
56: ; preds = %55, %34
br label %57
57: ; preds = %56, %25
br label %58
58: ; preds = %57, %16
br label %59
59: ; preds = %58, %8
%60 = load float, float* %3
%61 = fpext float %60 to double
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), double %61)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"enter the income: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [40 x i8] c"the tax amount you need to pay is %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 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, 750
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = sitofp i32 %5 to double
%9 = fmul double %8, 1.000000e-02
br label %38
10: ; preds = %0
%11 = icmp ult i32 %5, 2251
br i1 %11, label %12, label %16
12: ; preds = %10
%13 = add nsw i32 %5, -750
%14 = sitofp i32 %13 to double
%15 = call double @llvm.fmuladd.f64(double %14, double 2.000000e-02, double 7.500000e+00)
br label %38
16: ; preds = %10
%17 = icmp ult i32 %5, 3751
br i1 %17, label %18, label %22
18: ; preds = %16
%19 = add nsw i32 %5, -2250
%20 = sitofp i32 %19 to double
%21 = call double @llvm.fmuladd.f64(double %20, double 3.000000e-02, double 3.750000e+01)
br label %38
22: ; preds = %16
%23 = icmp ult i32 %5, 5251
br i1 %23, label %24, label %28
24: ; preds = %22
%25 = add nsw i32 %5, -3750
%26 = sitofp i32 %25 to double
%27 = call double @llvm.fmuladd.f64(double %26, double 4.000000e-02, double 8.250000e+01)
br label %38
28: ; preds = %22
%29 = icmp ult i32 %5, 7001
br i1 %29, label %30, label %34
30: ; preds = %28
%31 = add nsw i32 %5, -5250
%32 = sitofp i32 %31 to double
%33 = call double @llvm.fmuladd.f64(double %32, double 5.000000e-02, double 1.425000e+02)
br label %38
34: ; preds = %28
%35 = add nsw i32 %5, -7000
%36 = sitofp i32 %35 to double
%37 = call double @llvm.fmuladd.f64(double %36, double 6.000000e-02, double 2.300000e+02)
br label %38
38: ; preds = %12, %24, %34, %30, %18, %7
%39 = phi double [ %9, %7 ], [ %15, %12 ], [ %21, %18 ], [ %27, %24 ], [ %33, %30 ], [ %37, %34 ]
%40 = fptrunc double %39 to float
%41 = fpext float %40 to double
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), double %41)
ret i32 0
}