#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 rw, hw, extra, extra_wage, total, n;
  printf("\nEnter regular wage, for 40 hours (in Rs): ");
  scanf("%f", &rw);
  printf("\nEnter hourly rate (in Rs): ");
  scanf("%f", &hw);
  printf("\nEnter number of hours worked by worker: ");
  scanf("%f", &n);
  if (n > 40) {
    extra = n - 40;
    extra_wage = extra * hw;
    total = rw + extra_wage;
    printf("\nTotal wage of the worker: %f", total);
  } else
    printf("\nTotal wage of the worker: %f", rw);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf4e(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf30(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf12(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x1c(%rbp),%xmm0
movss  0xe6a(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11ef <main+0xcf>
movss  -0x1c(%rbp),%xmm0
movss  0xe54(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe94(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1206 <main+0xe6>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe78(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf5c(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xee6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0x8(%rsp),%xmm0
ucomiss 0xe76(%rip),%xmm0
jbe    11a2 <main+0x82>
addss  0xe70(%rip),%xmm0
mulss  0xc(%rsp),%xmm0
addss  0x4(%rsp),%xmm0
jmp    11a8 <main+0x88>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"\0AEnter regular wage, for 40 hours (in Rs): \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [29 x i8] c"\0AEnter hourly rate (in Rs): \00"
@.str.3 = [42 x i8] c"\0AEnter number of hours worked by worker: \00"
@.str.4 = [30 x i8] c"\0ATotal wage of the worker: %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
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %7)
%14 = load float, float* %7
%15 = fcmp ogt float %14, 4.000000e+01
br i1 %15, label %16, label %28
16: ; preds = %0
%17 = load float, float* %7
%18 = fsub float %17, 4.000000e+01
store float %18, float* %4
%19 = load float, float* %4
%20 = load float, float* %3
%21 = fmul float %19, %20
store float %21, float* %5
%22 = load float, float* %2
%23 = load float, float* %5
%24 = fadd float %22, %23
store float %24, float* %6
%25 = load float, float* %6
%26 = fpext float %25 to double
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), double %26)
br label %32
28: ; preds = %0
%29 = load float, float* %2
%30 = fpext float %29 to double
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), double %30)
br label %32
32: ; preds = %28, %16
ret i32 0
}

LLVM IR (-O2):
@.str = [44 x i8] c"\0AEnter regular wage, for 40 hours (in Rs): \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [29 x i8] c"\0AEnter hourly rate (in Rs): \00"
@.str.3 = [42 x i8] c"\0AEnter number of hours worked by worker: \00"
@.str.4 = [30 x i8] c"\0ATotal wage of the worker: %f\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, 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 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%13 = load float, float* %3
%14 = fcmp ogt float %13, 4.000000e+01
br i1 %14, label %15, label %21
15: ; preds = %0
%16 = fadd float %13, -4.000000e+01
%17 = load float, float* %2
%18 = fmul float %16, %17
%19 = load float, float* %1
%20 = fadd float %19, %18
br label %23
21: ; preds = %0
%22 = load float, float* %1
br label %23
23: ; preds = %21, %15
%24 = phi float [ %22, %21 ], [ %20, %15 ]
%25 = fpext float %24 to double
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), double %25)
ret i32 0
}