#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*/ puts(char *);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float amount, bp, jy;
  float d2p = 0.5407;
  float d2y = 106.79;
  printf("Enter the amount in dollars : $ ");
  scanf("%f", &amount);
  bp = amount * d2p;
  jy = amount * d2y;
  puts("\nCurrency converter ...");
  printf("\t%c%9.2f\n", 0x9c, bp);
  printf("\t%c%9.f\n", 0x9e, jy);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xebd(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xeac(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x8(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
lea    0xe90(%rip),%rdi
call   1030 <puts@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe93(%rip),%rdi
mov    $0x9c,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe81(%rip),%rdi
mov    $0x9e,%esi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee0(%rip),%rdi
lea    0x14(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x14(%rsp),%xmm0
movss  0xe9f(%rip),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
mulss  0xe91(%rip),%xmm0
movss  %xmm0,0x10(%rsp)
lea    0xeac(%rip),%rdi
call   1030 <puts@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeae(%rip),%rdi
mov    $0x9c,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9b(%rip),%rdi
mov    $0x9e,%esi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Enter the amount in dollars : $ \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [24 x i8] c"\0ACurrency converter ...\00"
@.str.3 = [10 x i8] c"\09%c%9.2f\0A\00"
@.str.4 = [9 x i8] c"\09%c%9.f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store i32 0, i32* %1
store float 0x3FE14D6A20000000, float* %5
store float 0x405AB28F60000000, float* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 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* %2)
%9 = load float, float* %2
%10 = load float, float* %5
%11 = fmul float %9, %10
store float %11, float* %3
%12 = load float, float* %2
%13 = load float, float* %6
%14 = fmul float %12, %13
store float %14, float* %4
%15 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%16 = load float, float* %3
%17 = fpext float %16 to double
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 156, double %17)
%19 = load float, float* %4
%20 = fpext float %19 to double
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 158, double %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Enter the amount in dollars : $ \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [24 x i8] c"\0ACurrency converter ...\00"
@.str.3 = [10 x i8] c"\09%c%9.2f\0A\00"
@.str.4 = [9 x i8] c"\09%c%9.f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fmul float %5, 0x3FE14D6A20000000
%7 = fmul float %5, 0x405AB28F60000000
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%9 = fpext float %6 to double
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 156, double %9)
%11 = fpext float %7 to double
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 158, double %11)
ret i32 0
}