#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 dir, hra, ta, it, gross, nets;
  printf("\nEnter basic salary:");
  scanf("%f", &dir);
  hra = .1 * dir;
  ta = .05 * dir;
  it = .025 * dir;
  nets = dir + hra + ta - it;
  printf("\nBasic Salary = %.2f\nHRA = %.2f\nTA = %.2f\nIT = %.2f", dir, hra,
         ta, it);
  printf("\nNet Salary = %.2f\n", nets);
  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    0xee9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeb2(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe8c(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe66(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
subss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x10(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  -0x14(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
lea    0xe45(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe62(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm4
cvtss2sd %xmm4,%xmm0
movsd  0xeae(%rip),%xmm1
mulsd  %xmm0,%xmm1
cvtsd2ss %xmm1,%xmm1
movsd  0xea6(%rip),%xmm2
mulsd  %xmm0,%xmm2
cvtsd2ss %xmm2,%xmm2
movsd  0xe9e(%rip),%xmm3
mulsd  %xmm0,%xmm3
cvtsd2ss %xmm3,%xmm3
addss  %xmm1,%xmm4
addss  %xmm2,%xmm4
subss  %xmm3,%xmm4
movss  %xmm4,(%rsp)
cvtss2sd %xmm1,%xmm1
cvtss2sd %xmm2,%xmm2
cvtss2sd %xmm3,%xmm3
lea    0xe92(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeaf(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"\0AEnter basic salary:\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [52 x i8] c"\0ABasic Salary = %.2f\0AHRA = %.2f\0ATA = %.2f\0AIT = %.2f\00"
@.str.3 = [20 x i8] c"\0ANet Salary = %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%10 = load float, float* %2
%11 = fpext float %10 to double
%12 = fmul double 1.000000e-01, %11
%13 = fptrunc double %12 to float
store float %13, float* %3
%14 = load float, float* %2
%15 = fpext float %14 to double
%16 = fmul double 5.000000e-02, %15
%17 = fptrunc double %16 to float
store float %17, float* %4
%18 = load float, float* %2
%19 = fpext float %18 to double
%20 = fmul double 2.500000e-02, %19
%21 = fptrunc double %20 to float
store float %21, float* %5
%22 = load float, float* %2
%23 = load float, float* %3
%24 = fadd float %22, %23
%25 = load float, float* %4
%26 = fadd float %24, %25
%27 = load float, float* %5
%28 = fsub float %26, %27
store float %28, float* %7
%29 = load float, float* %2
%30 = fpext float %29 to double
%31 = load float, float* %3
%32 = fpext float %31 to double
%33 = load float, float* %4
%34 = fpext float %33 to double
%35 = load float, float* %5
%36 = fpext float %35 to double
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), double %30, double %32, double %34, double %36)
%38 = load float, float* %7
%39 = fpext float %38 to double
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), double %39)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"\0AEnter basic salary:\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [52 x i8] c"\0ABasic Salary = %.2f\0AHRA = %.2f\0ATA = %.2f\0AIT = %.2f\00"
@.str.3 = [20 x i8] c"\0ANet Salary = %.2f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 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 = fpext float %5 to double
%7 = fmul double %6, 1.000000e-01
%8 = fptrunc double %7 to float
%9 = fmul double %6, 5.000000e-02
%10 = fptrunc double %9 to float
%11 = fmul double %6, 2.500000e-02
%12 = fptrunc double %11 to float
%13 = fadd float %5, %8
%14 = fadd float %13, %10
%15 = fsub float %14, %12
%16 = fpext float %8 to double
%17 = fpext float %10 to double
%18 = fpext float %12 to double
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), double %6, double %16, double %17, double %18)
%20 = fpext float %15 to double
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), double %20)
ret i32 0
}