#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 EXIT_SUCCESS;
int /*<<< orphan*/ convCurrency(double, double *, double *, double *, double *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main(void) {
  double inputDollars, convEuro, convDkk, convRubles, convYen;
  printf("Please input amount of dollars to be converted: ");
  scanf(" %lf", &inputDollars);
  convCurrency(inputDollars, &convEuro, &convDkk, &convRubles, &convYen);
  printf("$%.2f is %.2f EUR, %.2f DKK, %.2f Rubles and %.2f Yen.\n",
         inputDollars, convEuro, convDkk, convRubles, convYen);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x28(%rbp),%rdx
lea    -0x30(%rbp),%rcx
call   1040 <convCurrency@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
movsd  -0x30(%rbp),%xmm4
lea    0xe9f(%rip),%rdi
mov    $0x5,%al
call   1030 <printf@plt>
mov    0x2e3b(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
lea    0x20(%rsp),%rdi
lea    0x18(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1040 <convCurrency@plt>
movsd  (%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movsd  0x10(%rsp),%xmm3
movsd  0x8(%rsp),%xmm4
lea    0xea3(%rip),%rdi
mov    $0x5,%al
call   1030 <printf@plt>
mov    0x2e3f(%rip),%rax
mov    (%rax),%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [49 x i8] c"Please input amount of dollars to be converted: \00"
@.str.1 = [5 x i8] c" %lf\00"
@.str.2 = [56 x i8] c"$%.2f is %.2f EUR, %.2f DKK, %.2f Rubles and %.2f Yen.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double* %2)
%9 = load double, double* %2
%10 = call i32 @convCurrency(double %9, double* %3, double* %4, double* %5, double* %6)
%11 = load double, double* %2
%12 = load double, double* %3
%13 = load double, double* %4
%14 = load double, double* %5
%15 = load double, double* %6
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0), double %11, double %12, double %13, double %14, double %15)
%17 = load i32, i32* @EXIT_SUCCESS
ret i32 %17
}

LLVM IR (-O2):
@.str = [49 x i8] c"Please input amount of dollars to be converted: \00"
@.str.1 = [5 x i8] c" %lf\00"
@.str.2 = [56 x i8] c"$%.2f is %.2f EUR, %.2f DKK, %.2f Rubles and %.2f Yen.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = bitcast double* %1 to i8*
%7 = bitcast double* %2 to i8*
%8 = bitcast double* %3 to i8*
%9 = bitcast double* %4 to i8*
%10 = bitcast double* %5 to i8*
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double* %1)
%13 = load double, double* %1
%14 = call i32 @convCurrency(double %13, double* %2, double* %3, double* %4, double* %5)
%15 = load double, double* %1
%16 = load double, double* %2
%17 = load double, double* %3
%18 = load double, double* %4
%19 = load double, double* %5
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0), double %15, double %16, double %17, double %18, double %19)
%21 = load i32, i32* @EXIT_SUCCESS
ret i32 %21
}