#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 *, ...);
main() {
  double hwr, payment, tax_reduction;
  int id, w;
  printf("Please enter your identification number : \n");
  scanf("%d", &id);
  printf("Please enter the hourly wage rate : \n");
  scanf("%lf", &hwr);
  printf("Please enter the number of hour's worked weekly : \n");
  scanf("%d", &w);
  if (w > 40) {
    payment = 1.5 * (hwr * w);
    tax_reduction = payment - (payment * (3.625 / 100));
  } else {
    payment = hwr * w;
    tax_reduction = payment - (payment * (3.625 / 100));
  }
  printf("IDENTIFICATION NUMBER : %d\n", id);
  printf("YOUR HOURLY WAGE RATE : %f\n", hwr);
  printf("NUMBER OF HOUR'S YOU HAVE WORKED : %d\n", w);
  printf("YOUR TOTAL PAYROLL  : Rs.%f\n", payment);
  printf("AVERAGE AMOUNT OF YOUR PAY : Rs.%f\n", tax_reduction);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
lea    -0x24(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xee9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf01(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xef3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x28,-0x28(%rbp)
jle    11f3 <main+0xd3>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x28(%rbp),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xe59(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe1f(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    123c <main+0x11c>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xdd1(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x24(%rbp),%esi
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xe60(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%esi
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xe7f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xe89(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xf7b(%rip),%rdi
call   1030 <puts@plt>
lea    0xec8(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xf84(%rip),%rdi
call   1030 <puts@plt>
lea    0xea9(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xf8a(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    (%rsp),%eax
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
cmp    $0x29,%eax
jl     11a9 <main+0x79>
mulsd  0xe57(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xe51(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
mov    0x4(%rsp),%esi
lea    0xe47(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
lea    0xe4f(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    (%rsp),%esi
lea    0xe5a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe73(%rip),%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe7c(%rip),%rdi
movsd  0x18(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Please enter your identification number : \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [38 x i8] c"Please enter the hourly wage rate : \0A\00"
@.str.3 = [4 x i8] c"%lf\00"
@.str.4 = [52 x i8] c"Please enter the number of hour's worked weekly : \0A\00"
@.str.5 = [28 x i8] c"IDENTIFICATION NUMBER : %d\0A\00"
@.str.6 = [28 x i8] c"YOUR HOURLY WAGE RATE : %f\0A\00"
@.str.7 = [39 x i8] c"NUMBER OF HOUR'S YOU HAVE WORKED : %d\0A\00"
@.str.8 = [29 x i8] c"YOUR TOTAL PAYROLL : Rs.%f\0A\00"
@.str.9 = [36 x i8] c"AVERAGE AMOUNT OF YOUR PAY : Rs.%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %2)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%13 = load i32, i32* %6
%14 = icmp sgt i32 %13, 40
br i1 %14, label %15, label %25
15: ; preds = %0
%16 = load double, double* %2
%17 = load i32, i32* %6
%18 = sitofp i32 %17 to double
%19 = fmul double %16, %18
%20 = fmul double 1.500000e+00, %19
store double %20, double* %3
%21 = load double, double* %3
%22 = load double, double* %3
%23 = fneg double %22
%24 = call double @llvm.fmuladd.f64(double %23, double 3.625000e-02, double %21)
store double %24, double* %4
br label %34
25: ; preds = %0
%26 = load double, double* %2
%27 = load i32, i32* %6
%28 = sitofp i32 %27 to double
%29 = fmul double %26, %28
store double %29, double* %3
%30 = load double, double* %3
%31 = load double, double* %3
%32 = fneg double %31
%33 = call double @llvm.fmuladd.f64(double %32, double 3.625000e-02, double %30)
store double %33, double* %4
br label %34
34: ; preds = %25, %15
%35 = load i32, i32* %5
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i32 %35)
%37 = load double, double* %2
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), double %37)
%39 = load i32, i32* %6
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0), i32 %39)
%41 = load double, double* %3
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), double %41)
%43 = load double, double* %4
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i64 0, i64 0), double %43)
%45 = load i32, i32* %1
ret i32 %45
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [4 x i8] c"%lf\00"
@.str.5 = [28 x i8] c"IDENTIFICATION NUMBER : %d\0A\00"
@.str.6 = [28 x i8] c"YOUR HOURLY WAGE RATE : %f\0A\00"
@.str.7 = [39 x i8] c"NUMBER OF HOUR'S YOU HAVE WORKED : %d\0A\00"
@.str.8 = [29 x i8] c"YOUR TOTAL PAYROLL : Rs.%f\0A\00"
@.str.9 = [36 x i8] c"AVERAGE AMOUNT OF YOUR PAY : Rs.%f\0A\00"
@str = [43 x i8] c"Please enter your identification number : \00"
@str.10 = [37 x i8] c"Please enter the hourly wage rate : \00"
@str.11 = [51 x i8] c"Please enter the number of hour's worked weekly : \00"
define i32 @main() {
%1 = alloca double
%2 = alloca i32
%3 = alloca i32
%4 = bitcast double* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.10, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %1)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.11, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%13 = load i32, i32* %3
%14 = icmp sgt i32 %13, 40
%15 = load double, double* %1
%16 = sitofp i32 %13 to double
%17 = fmul double %15, %16
%18 = fmul double %17, 1.500000e+00
%19 = select i1 %14, double %18, double %17
%20 = fneg double %19
%21 = call double @llvm.fmuladd.f64(double %20, double 3.625000e-02, double %19)
%22 = load i32, i32* %2
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i32 %22)
%24 = load double, double* %1
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), double %24)
%26 = load i32, i32* %3
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0), i32 %26)
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), double %19)
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i64 0, i64 0), double %21)
ret i32 0
}