#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() {
  int basic_salary;
  float house_rent, transportation_bill, gross_salary;
  printf("Enter Your Basic Salary In Taka:");
  scanf("%d", &basic_salary);
  house_rent = 0.40 * basic_salary;
  transportation_bill = 0.20 * basic_salary;
  gross_salary = basic_salary + house_rent + transportation_bill;
  printf("\n\nYour Gross Salary Is : %f", gross_salary);
  printf("\n\nYou Are Getting Extra %.2f Taka BDT For House Rent ", house_rent);
  printf("\n\nYou Are Getting Extra %.2f Taka BDT For Transportation\n\n",
         transportation_bill);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xeb5(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xe93(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe96(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeba(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
lea    0x14(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x14(%rsp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xead(%rip),%xmm1
mulsd  %xmm0,%xmm1
cvtsd2ss %xmm1,%xmm2
movss  %xmm2,0xc(%rsp)
mulsd  0xe9f(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
movss  %xmm1,0x10(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
addss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec6(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Enter Your Basic Salary In Taka:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [28 x i8] c"\0A\0AYour Gross Salary Is : %f\00"
@.str.3 = [54 x i8] c"\0A\0AYou Are Getting Extra %.2f Taka BDT For House Rent \00"
@.str.4 = [59 x i8] c"\0A\0AYou Are Getting Extra %.2f Taka BDT For Transportation\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = sitofp i32 %7 to double
%9 = fmul double 4.000000e-01, %8
%10 = fptrunc double %9 to float
store float %10, float* %2
%11 = load i32, i32* %1
%12 = sitofp i32 %11 to double
%13 = fmul double 2.000000e-01, %12
%14 = fptrunc double %13 to float
store float %14, float* %3
%15 = load i32, i32* %1
%16 = sitofp i32 %15 to float
%17 = load float, float* %2
%18 = fadd float %16, %17
%19 = load float, float* %3
%20 = fadd float %18, %19
store float %20, float* %4
%21 = load float, float* %4
%22 = fpext float %21 to double
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), double %22)
%24 = load float, float* %2
%25 = fpext float %24 to double
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.3, i64 0, i64 0), double %25)
%27 = load float, float* %3
%28 = fpext float %27 to double
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.4, i64 0, i64 0), double %28)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Enter Your Basic Salary In Taka:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [28 x i8] c"\0A\0AYour Gross Salary Is : %f\00"
@.str.3 = [54 x i8] c"\0A\0AYou Are Getting Extra %.2f Taka BDT For House Rent \00"
@.str.4 = [59 x i8] c"\0A\0AYou Are Getting Extra %.2f Taka BDT For Transportation\0A\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 ([33 x i8], [33 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 = sitofp i32 %5 to double
%7 = fmul double %6, 4.000000e-01
%8 = fptrunc double %7 to float
%9 = fmul double %6, 2.000000e-01
%10 = fptrunc double %9 to float
%11 = sitofp i32 %5 to float
%12 = fadd float %11, %8
%13 = fadd float %12, %10
%14 = fpext float %13 to double
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), double %14)
%16 = fpext float %8 to double
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.3, i64 0, i64 0), double %16)
%18 = fpext float %10 to double
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.4, i64 0, i64 0), double %18)
ret i32 0
}