#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 *, double *);
int main() {
  double hourlyWage = 0.0;
  int hoursPerWeek = 40;
  int weeksPerYear = 52;
  double annualIncome = 0.0;
  int yearlyDollars = 0;
  double yearlyCents = 0.0;
  printf("What is your hourly wage? ");
  scanf(" %lf", &hourlyWage);
  annualIncome = hourlyWage * hoursPerWeek * weeksPerYear;
  yearlyDollars = annualIncome;
  yearlyCents = (annualIncome - yearlyDollars) * 100.0;
  printf("Your total income over a year is %d dollars and %0.0lf cents",
         yearlyDollars, yearlyCents);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x28,-0x14(%rbp)
movl   $0x34,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
cvttsd2si -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
movsd  -0x20(%rbp),%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe4c(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x24(%rbp),%esi
movsd  -0x30(%rbp),%xmm0
lea    0xe5c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
mulsd  0xead(%rip),%xmm0
mulsd  0xead(%rip),%xmm0
cvttsd2si %xmm0,%esi
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
subsd  %xmm1,%xmm0
mulsd  0xe9d(%rip),%xmm0
lea    0xebe(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"What is your hourly wage? \00"
@.str.1 = [5 x i8] c" %lf\00"
@.str.2 = [61 x i8] c"Your total income over a year is %d dollars and %0.0lf cents\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca i32
%7 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
store i32 40, i32* %3
store i32 52, i32* %4
store double 0.000000e+00, double* %5
store i32 0, i32* %6
store double 0.000000e+00, double* %7
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double* %2)
%10 = load double, double* %2
%11 = load i32, i32* %3
%12 = sitofp i32 %11 to double
%13 = fmul double %10, %12
%14 = load i32, i32* %4
%15 = sitofp i32 %14 to double
%16 = fmul double %13, %15
store double %16, double* %5
%17 = load double, double* %5
%18 = fptosi double %17 to i32
store i32 %18, i32* %6
%19 = load double, double* %5
%20 = load i32, i32* %6
%21 = sitofp i32 %20 to double
%22 = fsub double %19, %21
%23 = fmul double %22, 1.000000e+02
store double %23, double* %7
%24 = load i32, i32* %6
%25 = load double, double* %7
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0), i32 %24, double %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"What is your hourly wage? \00"
@.str.1 = [5 x i8] c" %lf\00"
@.str.2 = [61 x i8] c"Your total income over a year is %d dollars and %0.0lf cents\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store double 0.000000e+00, double* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = fmul double %5, 4.000000e+01
%7 = fmul double %6, 5.200000e+01
%8 = fptosi double %7 to i32
%9 = sitofp i32 %8 to double
%10 = fsub double %7, %9
%11 = fmul double %10, 1.000000e+02
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0), i32 %8, double %11)
ret i32 0
}