#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() {
  float b, d, h, g, n, t, m;
  m = 300;
  printf("Enter basic salary\n");
  scanf("%f", &b);
  d = 0.35 * b;
  h = 0.15 * b;
  t = 0.12 * b;
  g = b + d + h + m;
  printf("Gross salary=\n%f\n", g);
  n = g - t;
  printf("Net salary=\n%f", n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xee1(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xea5(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe7f(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe59(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
addss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe53(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
subss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe3f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xf02(%rip),%rdi
call   1030 <puts@plt>
lea    0xef3(%rip),%rdi
lea    0x14(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe9d(%rip),%xmm2
mulsd  %xmm1,%xmm2
cvtsd2ss %xmm2,%xmm3
movsd  0xe95(%rip),%xmm2
mulsd  %xmm1,%xmm2
cvtsd2ss %xmm2,%xmm2
mulsd  0xe8d(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
movss  %xmm1,0x10(%rsp)
addss  %xmm0,%xmm3
addss  %xmm2,%xmm3
addss  0xe7b(%rip),%xmm3
movss  %xmm3,0xc(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm3,%xmm0
lea    0xe6b(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0xc(%rsp),%xmm0
addss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe5f(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Enter basic salary\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [18 x i8] c"Gross salary=\0A%f\0A\00"
@.str.3 = [15 x i8] c"Net salary=\0A%f\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
%8 = alloca float
store i32 0, i32* %1
store float 3.000000e+02, float* %8
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%11 = load float, float* %2
%12 = fpext float %11 to double
%13 = fmul double 3.500000e-01, %12
%14 = fptrunc double %13 to float
store float %14, float* %3
%15 = load float, float* %2
%16 = fpext float %15 to double
%17 = fmul double 1.500000e-01, %16
%18 = fptrunc double %17 to float
store float %18, float* %4
%19 = load float, float* %2
%20 = fpext float %19 to double
%21 = fmul double 1.200000e-01, %20
%22 = fptrunc double %21 to float
store float %22, float* %7
%23 = load float, float* %2
%24 = load float, float* %3
%25 = fadd float %23, %24
%26 = load float, float* %4
%27 = fadd float %25, %26
%28 = load float, float* %8
%29 = fadd float %27, %28
store float %29, float* %5
%30 = load float, float* %5
%31 = fpext float %30 to double
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), double %31)
%33 = load float, float* %5
%34 = load float, float* %7
%35 = fsub float %33, %34
store float %35, float* %6
%36 = load float, float* %6
%37 = fpext float %36 to double
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), double %37)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [18 x i8] c"Gross salary=\0A%f\0A\00"
@.str.3 = [15 x i8] c"Net salary=\0A%f\00"
@str = [19 x i8] c"Enter basic salary\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%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 = fpext float %5 to double
%7 = fmul double %6, 3.500000e-01
%8 = fptrunc double %7 to float
%9 = fmul double %6, 1.500000e-01
%10 = fptrunc double %9 to float
%11 = fmul double %6, 1.200000e-01
%12 = fptrunc double %11 to float
%13 = fadd float %5, %8
%14 = fadd float %13, %10
%15 = fadd float %14, 3.000000e+02
%16 = fpext float %15 to double
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), double %16)
%18 = fsub float %15, %12
%19 = fpext float %18 to double
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), double %19)
ret i32 0
}