#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 *, float *);
int main(void) {
  float salary = 0.00f, tax = 0.00f;
  printf("enter your salary:\n");
  scanf("%f", &salary);
  if (salary > 7000.00f) {
    tax = 230.00f + (salary - 7000.00f) * .06;
  } else if (salary > 5250.00f) {
    tax = 142.50f + (salary - 5250.00f) * .05;
  } else if (salary > 3750.00f) {
    tax = 82.50f + (salary - 3750.00f) * .04;
  } else if (salary > 2250.00f) {
    tax = 37.50f + (salary - 2250.0f) * .03;
  } else if (salary > 750) {
    tax = 7.50f + (salary - 750.00f) * .02;
  } else {
    tax = salary * .01;
  }
  printf("the tax of you: $%.2f\n", tax);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
lea    0xf2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf30(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xe96(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11ae <main+0x8e>
movss  -0x8(%rbp),%xmm0
movss  0xe80(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed0(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xecc(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1324 <main+0x204>
movss  -0x8(%rbp),%xmm0
movss  0xe49(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11ff <main+0xdf>
movss  -0x8(%rbp),%xmm0
movss  0xe33(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe6f(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe6b(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    131f <main+0x1ff>
movss  -0x8(%rbp),%xmm0
movss  0xdfc(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1250 <main+0x130>
movss  -0x8(%rbp),%xmm0
movss  0xde6(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe0e(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe0a(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    131a <main+0x1fa>
movss  -0x8(%rbp),%xmm0
movss  0xdaf(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    12a1 <main+0x181>
movss  -0x8(%rbp),%xmm0
movss  0xd99(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdad(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xda9(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1315 <main+0x1f5>
movss  -0x8(%rbp),%xmm0
movss  0xd62(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    12f2 <main+0x1d2>
movss  -0x8(%rbp),%xmm0
movss  0xd4c(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd4c(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd48(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1310 <main+0x1f0>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd15(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1315 <main+0x1f5>
jmp    131a <main+0x1fa>
jmp    131f <main+0x1ff>
jmp    1324 <main+0x204>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd53(%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
movl   $0x0,0x4(%rsp)
lea    0xf5a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf34(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
ucomiss 0xe9d(%rip),%xmm0
jbe    1186 <main+0x56>
addss  0xeb7(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xef7(%rip),%xmm0
addsd  0xef7(%rip),%xmm0
jmp    1231 <main+0x101>
ucomiss 0xe77(%rip),%xmm0
jbe    11b0 <main+0x80>
addss  0xe89(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xebd(%rip),%xmm0
addsd  0xebd(%rip),%xmm0
jmp    1231 <main+0x101>
ucomiss 0xe51(%rip),%xmm0
jbe    11d7 <main+0xa7>
addss  0xe5b(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe83(%rip),%xmm0
addsd  0xe83(%rip),%xmm0
jmp    1231 <main+0x101>
ucomiss 0xe2e(%rip),%xmm0
jbe    11fe <main+0xce>
addss  0xe30(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe4c(%rip),%xmm0
addsd  0xe4c(%rip),%xmm0
jmp    1231 <main+0x101>
ucomiss 0xe0b(%rip),%xmm0
jbe    1225 <main+0xf5>
addss  0xe05(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe15(%rip),%xmm0
addsd  0xe15(%rip),%xmm0
jmp    1231 <main+0x101>
cvtss2sd %xmm0,%xmm0
mulsd  0xdf7(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe43(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"enter your salary:\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [23 x i8] c"the tax of you: $%.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %2
store float 0.000000e+00, float* %3
%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), float* %2)
%6 = load float, float* %2
%7 = fcmp ogt float %6, 7.000000e+03
br i1 %7, label %8, label %14
8: ; preds = %0
%9 = load float, float* %2
%10 = fsub float %9, 7.000000e+03
%11 = fpext float %10 to double
%12 = call double @llvm.fmuladd.f64(double %11, double 6.000000e-02, double 2.300000e+02)
%13 = fptrunc double %12 to float
store float %13, float* %3
br label %59
14: ; preds = %0
%15 = load float, float* %2
%16 = fcmp ogt float %15, 5.250000e+03
br i1 %16, label %17, label %23
17: ; preds = %14
%18 = load float, float* %2
%19 = fsub float %18, 5.250000e+03
%20 = fpext float %19 to double
%21 = call double @llvm.fmuladd.f64(double %20, double 5.000000e-02, double 1.425000e+02)
%22 = fptrunc double %21 to float
store float %22, float* %3
br label %58
23: ; preds = %14
%24 = load float, float* %2
%25 = fcmp ogt float %24, 3.750000e+03
br i1 %25, label %26, label %32
26: ; preds = %23
%27 = load float, float* %2
%28 = fsub float %27, 3.750000e+03
%29 = fpext float %28 to double
%30 = call double @llvm.fmuladd.f64(double %29, double 4.000000e-02, double 8.250000e+01)
%31 = fptrunc double %30 to float
store float %31, float* %3
br label %57
32: ; preds = %23
%33 = load float, float* %2
%34 = fcmp ogt float %33, 2.250000e+03
br i1 %34, label %35, label %41
35: ; preds = %32
%36 = load float, float* %2
%37 = fsub float %36, 2.250000e+03
%38 = fpext float %37 to double
%39 = call double @llvm.fmuladd.f64(double %38, double 3.000000e-02, double 3.750000e+01)
%40 = fptrunc double %39 to float
store float %40, float* %3
br label %56
41: ; preds = %32
%42 = load float, float* %2
%43 = fcmp ogt float %42, 7.500000e+02
br i1 %43, label %44, label %50
44: ; preds = %41
%45 = load float, float* %2
%46 = fsub float %45, 7.500000e+02
%47 = fpext float %46 to double
%48 = call double @llvm.fmuladd.f64(double %47, double 2.000000e-02, double 7.500000e+00)
%49 = fptrunc double %48 to float
store float %49, float* %3
br label %55
50: ; preds = %41
%51 = load float, float* %2
%52 = fpext float %51 to double
%53 = fmul double %52, 1.000000e-02
%54 = fptrunc double %53 to float
store float %54, float* %3
br label %55
55: ; preds = %50, %44
br label %56
56: ; preds = %55, %35
br label %57
57: ; preds = %56, %26
br label %58
58: ; preds = %57, %17
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 ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), double %61)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [23 x i8] c"the tax of you: $%.2f\0A\00"
@str = [19 x i8] c"enter your salary:\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
store float 0.000000e+00, float* %1
%3 = tail call i32 @puts(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), float* %1)
%5 = load float, float* %1
%6 = fcmp ogt float %5, 7.000000e+03
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = fadd float %5, -7.000000e+03
%9 = fpext float %8 to double
%10 = call double @llvm.fmuladd.f64(double %9, double 6.000000e-02, double 2.300000e+02)
br label %38
11: ; preds = %0
%12 = fcmp ogt float %5, 5.250000e+03
br i1 %12, label %13, label %17
13: ; preds = %11
%14 = fadd float %5, -5.250000e+03
%15 = fpext float %14 to double
%16 = call double @llvm.fmuladd.f64(double %15, double 5.000000e-02, double 1.425000e+02)
br label %38
17: ; preds = %11
%18 = fcmp ogt float %5, 3.750000e+03
br i1 %18, label %19, label %23
19: ; preds = %17
%20 = fadd float %5, -3.750000e+03
%21 = fpext float %20 to double
%22 = call double @llvm.fmuladd.f64(double %21, double 4.000000e-02, double 8.250000e+01)
br label %38
23: ; preds = %17
%24 = fcmp ogt float %5, 2.250000e+03
br i1 %24, label %25, label %29
25: ; preds = %23
%26 = fadd float %5, -2.250000e+03
%27 = fpext float %26 to double
%28 = call double @llvm.fmuladd.f64(double %27, double 3.000000e-02, double 3.750000e+01)
br label %38
29: ; preds = %23
%30 = fcmp ogt float %5, 7.500000e+02
br i1 %30, label %31, label %35
31: ; preds = %29
%32 = fadd float %5, -7.500000e+02
%33 = fpext float %32 to double
%34 = call double @llvm.fmuladd.f64(double %33, double 2.000000e-02, double 7.500000e+00)
br label %38
35: ; preds = %29
%36 = fpext float %5 to double
%37 = fmul double %36, 1.000000e-02
br label %38
38: ; preds = %13, %25, %35, %31, %19, %7
%39 = phi double [ %10, %7 ], [ %16, %13 ], [ %22, %19 ], [ %28, %25 ], [ %34, %31 ], [ %37, %35 ]
%40 = fptrunc double %39 to float
%41 = fpext float %40 to double
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), double %41)
ret i32 0
}