#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*/ convert_currency(double, double *, double *, double *,
                                    double *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main(void) {
  double dollars = 0, euro = 0, rupees = 0, ruble = 0, yen = 0;
  printf("Enter the currency in dollars => ");
  scanf("%lf", &dollars);
  convert_currency(dollars, &euro, &rupees, &ruble, &yen);
  printf("\nDollars   Euros     Rupees    Ruble     Yen\n");
  printf("%-9.2lf %-9.2lf %-9.2lf %-9.2lf %-9.2lf\n", dollars, euro, rupees,
         ruble, yen);
  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)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea6(%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 <convert_currency@plt>
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
movsd  -0x30(%rbp),%xmm4
lea    0xe87(%rip),%rdi
mov    $0x5,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movq   $0x0,(%rsp)
movq   $0x0,0x20(%rsp)
movq   $0x0,0x18(%rsp)
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0xe89(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe9d(%rip),%rdi
mov    %rsp,%rsi
call   1060 <scanf@plt>
movsd  (%rsp),%xmm0
lea    0x20(%rsp),%rdi
lea    0x18(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1050 <convert_currency@plt>
lea    0xe9d(%rip),%rdi
call   1030 <puts@plt>
movsd  (%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movsd  0x10(%rsp),%xmm3
movsd  0x8(%rsp),%xmm4
lea    0xe4b(%rip),%rdi
mov    $0x5,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Enter the currency in dollars => \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [46 x i8] c"\0ADollars Euros Rupees Ruble Yen\0A\00"
@.str.3 = [41 x i8] c"%-9.2lf %-9.2lf %-9.2lf %-9.2lf %-9.2lf\0A\00"
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
store double 0.000000e+00, double* %2
store double 0.000000e+00, double* %3
store double 0.000000e+00, double* %4
store double 0.000000e+00, double* %5
store double 0.000000e+00, double* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%9 = load double, double* %2
%10 = call i32 @convert_currency(double %9, double* %3, double* %4, double* %5, double* %6)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%12 = load double, double* %2
%13 = load double, double* %3
%14 = load double, double* %4
%15 = load double, double* %5
%16 = load double, double* %6
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), double %12, double %13, double %14, double %15, double %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"Enter the currency in dollars => \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.3 = [41 x i8] c"%-9.2lf %-9.2lf %-9.2lf %-9.2lf %-9.2lf\0A\00"
@str = [45 x i8] c"\0ADollars Euros Rupees Ruble Yen\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = bitcast double* %1 to i8*
store double 0.000000e+00, double* %1
%7 = bitcast double* %2 to i8*
store double 0.000000e+00, double* %2
%8 = bitcast double* %3 to i8*
store double 0.000000e+00, double* %3
%9 = bitcast double* %4 to i8*
store double 0.000000e+00, double* %4
%10 = bitcast double* %5 to i8*
store double 0.000000e+00, double* %5
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%13 = load double, double* %1
%14 = call i32 @convert_currency(double %13, double* %2, double* %3, double* %4, double* %5)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%16 = load double, double* %1
%17 = load double, double* %2
%18 = load double, double* %3
%19 = load double, double* %4
%20 = load double, double* %5
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), double %16, double %17, double %18, double %19, double %20)
ret i32 0
}