#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 *, float, float, float);
int /*<<< orphan*/ scanf(char *, float *);
int main(void) {
  float wt, salary, tax, net;
  scanf("%f", &wt);
  salary = 10.00 * (wt > 40 ? 40 : wt) + 1.5 * 10.00 * (wt > 40 ? wt - 40 : 0);
  if (salary <= 300)
    tax = salary * 0.15;
  else if (salary <= 450)
    tax = 300 * 0.15 + (salary - 300) * 0.2;
  else
    tax = 300 * 0.15 + 150 * 0.2 + (salary - 450) * 0.25;
  net = salary - tax;
  printf("Total salary: %.2f\nTax: %.2f\nNet salary: %.2f\n", salary, tax, net);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf12(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xeb4(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1167 <main+0x47>
movss  0xea3(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    1171 <main+0x51>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xe74(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11b0 <main+0x90>
movss  -0x8(%rbp),%xmm0
movss  0xe5e(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
jmp    11bd <main+0x9d>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
jmp    11bd <main+0x9d>
movsd  -0x20(%rbp),%xmm0
movss  -0x24(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0xe45(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe31(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xe0c(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     1225 <main+0x105>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe2d(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    12ad <main+0x18d>
movss  0xddb(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     1272 <main+0x152>
movss  -0xc(%rbp),%xmm0
movss  0xdc0(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xddc(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdd8(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    12a8 <main+0x188>
movss  -0xc(%rbp),%xmm0
movss  0xd89(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd91(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd8d(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    12ad <main+0x18d>
movss  -0xc(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
lea    0xd79(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf28(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
movss  0xec0(%rip),%xmm1
movaps %xmm1,%xmm2
minss  %xmm0,%xmm2
cvtss2sd %xmm2,%xmm2
cmpltss %xmm0,%xmm1
addss  0xeac(%rip),%xmm0
andps  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xeb1(%rip),%xmm0
mulsd  0xeb1(%rip),%xmm2
addsd  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
movss  0xe86(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    11b6 <main+0x96>
movss  0xe7d(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    11c7 <main+0xa7>
movss  0xe78(%rip),%xmm1
addss  %xmm0,%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  0xe94(%rip),%xmm1
addsd  0xe94(%rip),%xmm1
jmp    11e7 <main+0xc7>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
mulsd  0xe63(%rip),%xmm1
jmp    11e7 <main+0xc7>
movss  0xe41(%rip),%xmm1
addss  %xmm0,%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  0xe51(%rip),%xmm1
addsd  0xe51(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
movaps %xmm0,%xmm2
subss  %xmm1,%xmm2
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [47 x i8] c"Total salary: %.2f\0ATax: %.2f\0ANet salary: %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%7 = load float, float* %2
%8 = fcmp ogt float %7, 4.000000e+01
br i1 %8, label %9, label %10
9: ; preds = %0
br label %12
10: ; preds = %0
%11 = load float, float* %2
br label %12
12: ; preds = %10, %9
%13 = phi float [ 4.000000e+01, %9 ], [ %11, %10 ]
%14 = fpext float %13 to double
%15 = load float, float* %2
%16 = fcmp ogt float %15, 4.000000e+01
br i1 %16, label %17, label %20
17: ; preds = %12
%18 = load float, float* %2
%19 = fsub float %18, 4.000000e+01
br label %21
20: ; preds = %12
br label %21
21: ; preds = %20, %17
%22 = phi float [ %19, %17 ], [ 0.000000e+00, %20 ]
%23 = fpext float %22 to double
%24 = fmul double 1.500000e+01, %23
%25 = call double @llvm.fmuladd.f64(double 1.000000e+01, double %14, double %24)
%26 = fptrunc double %25 to float
store float %26, float* %3
%27 = load float, float* %3
%28 = fcmp ole float %27, 3.000000e+02
br i1 %28, label %29, label %34
29: ; preds = %21
%30 = load float, float* %3
%31 = fpext float %30 to double
%32 = fmul double %31, 1.500000e-01
%33 = fptrunc double %32 to float
store float %33, float* %4
br label %50
34: ; preds = %21
%35 = load float, float* %3
%36 = fcmp ole float %35, 4.500000e+02
br i1 %36, label %37, label %43
37: ; preds = %34
%38 = load float, float* %3
%39 = fsub float %38, 3.000000e+02
%40 = fpext float %39 to double
%41 = call double @llvm.fmuladd.f64(double %40, double 2.000000e-01, double 4.500000e+01)
%42 = fptrunc double %41 to float
store float %42, float* %4
br label %49
43: ; preds = %34
%44 = load float, float* %3
%45 = fsub float %44, 4.500000e+02
%46 = fpext float %45 to double
%47 = call double @llvm.fmuladd.f64(double %46, double 2.500000e-01, double 7.500000e+01)
%48 = fptrunc double %47 to float
store float %48, float* %4
br label %49
49: ; preds = %43, %37
br label %50
50: ; preds = %49, %29
%51 = load float, float* %3
%52 = load float, float* %4
%53 = fsub float %51, %52
store float %53, float* %5
%54 = load float, float* %3
%55 = load float, float* %4
%56 = load float, float* %5
%57 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), float %54, float %55, float %56)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [47 x i8] c"Total salary: %.2f\0ATax: %.2f\0ANet salary: %.2f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = fcmp ogt float %4, 4.000000e+01
%6 = select i1 %5, float 4.000000e+01, float %4
%7 = fpext float %6 to double
%8 = fadd float %4, -4.000000e+01
%9 = select i1 %5, float %8, float 0.000000e+00
%10 = fpext float %9 to double
%11 = fmul double %10, 1.500000e+01
%12 = call double @llvm.fmuladd.f64(double %7, double 1.000000e+01, double %11)
%13 = fptrunc double %12 to float
%14 = fcmp ugt float %13, 3.000000e+02
br i1 %14, label %18, label %15
15: ; preds = %0
%16 = fpext float %13 to double
%17 = fmul double %16, 1.500000e-01
br label %28
18: ; preds = %0
%19 = fcmp ugt float %13, 4.500000e+02
br i1 %19, label %24, label %20
20: ; preds = %18
%21 = fadd float %13, -3.000000e+02
%22 = fpext float %21 to double
%23 = call double @llvm.fmuladd.f64(double %22, double 2.000000e-01, double 4.500000e+01)
br label %28
24: ; preds = %18
%25 = fadd float %13, -4.500000e+02
%26 = fpext float %25 to double
%27 = call double @llvm.fmuladd.f64(double %26, double 2.500000e-01, double 7.500000e+01)
br label %28
28: ; preds = %20, %24, %15
%29 = phi double [ %17, %15 ], [ %23, %20 ], [ %27, %24 ]
%30 = fptrunc double %29 to float
%31 = fsub float %13, %30
%32 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), float %13, float %30, float %31)
ret i32 0
}