#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 *, ...);
int main() {
  float PHPToUSD = 0.02265;
  float PHPToJPY = 2.43877;
  float PHPToEUR = 0.01443;
  float CorvertedAmount = 0;
  float PHPAmount = 0;
  printf("Enter Amount You Want Corvert: ");
  scanf("%f", &PHPAmount);
  int CurrencyCorvert = 0;
  printf("\nWhat Type Currency You Want To Corvert");
  printf("\n1 = USD, 2 = JPY, 3 = EUR. : ");
  scanf("%d", &CurrencyCorvert);
  switch (CurrencyCorvert) {
  case 1:
    CorvertedAmount = PHPAmount * PHPToUSD;
    printf("\nTotal Amount in USD:%f", CorvertedAmount);
    break;
  case 2:
    CorvertedAmount = PHPAmount * PHPToJPY;
    printf("\nTotal Amount in JPY:%f", CorvertedAmount);
    break;
  case 3:
    CorvertedAmount = PHPAmount * PHPToEUR;
    printf("\nTotal Amount in EUR:%f", CorvertedAmount);
    break;
  default:
    printf("\nInvaid Input");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3cb98c7e,-0x8(%rbp)
movl   $0x401c14cf,-0xc(%rbp)
movl   $0x3c6c6bcf,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xea7(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x21(%rbp)
call   1030 <printf@plt>
mov    -0x21(%rbp),%al
lea    0xf12(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x21(%rbp),%al
movl   $0x0,-0x1c(%rbp)
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    -0x21(%rbp),%al
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x21(%rbp),%al
lea    0xec2(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
sub    $0x1,%eax
je     11e4 <main+0xc4>
jmp    11c2 <main+0xa2>
mov    -0x20(%rbp),%eax
sub    $0x2,%eax
je     120f <main+0xef>
jmp    11d3 <main+0xb3>
mov    -0x20(%rbp),%eax
sub    $0x3,%eax
je     123a <main+0x11a>
jmp    1265 <main+0x145>
movss  -0x18(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe67(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1273 <main+0x153>
movss  -0x18(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe54(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1273 <main+0x153>
movss  -0x18(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe41(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1273 <main+0x153>
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,(%rsp)
lea    0xedd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf4e(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movl   $0x0,0x4(%rsp)
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf01(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x3,%eax
je     11ab <main+0x8b>
cmp    $0x2,%eax
je     11c5 <main+0xa5>
cmp    $0x1,%eax
jne    11e6 <main+0xc6>
movss  (%rsp),%xmm0
mulss  0xe6a(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xecd(%rip),%rdi
jmp    11dd <main+0xbd>
movss  (%rsp),%xmm0
mulss  0xe48(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xee3(%rip),%rdi
jmp    11dd <main+0xbd>
movss  (%rsp),%xmm0
mulss  0xe32(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    11f4 <main+0xd4>
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Enter Amount You Want Corvert: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [40 x i8] c"\0AWhat Type Currency You Want To Corvert\00"
@.str.3 = [31 x i8] c"\0A1 = USD, 2 = JPY, 3 = EUR. : \00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [24 x i8] c"\0ATotal Amount in USD:%f\00"
@.str.6 = [24 x i8] c"\0ATotal Amount in JPY:%f\00"
@.str.7 = [24 x i8] c"\0ATotal Amount in EUR:%f\00"
@.str.8 = [14 x i8] c"\0AInvaid Input\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca i32
store i32 0, i32* %1
store float 0x3F97318FC0000000, float* %2
store float 0x40038299E0000000, float* %3
store float 0x3F8D8D79E0000000, float* %4
store float 0.000000e+00, float* %5
store float 0.000000e+00, float* %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %6)
store i32 0, i32* %7
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %7)
%13 = load i32, i32* %7
switch i32 %13, label %35 [
i32 1, label %14
i32 2, label %21
i32 3, label %28
]
14: ; preds = %0
%15 = load float, float* %6
%16 = load float, float* %2
%17 = fmul float %15, %16
store float %17, float* %5
%18 = load float, float* %5
%19 = fpext float %18 to double
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), double %19)
br label %37
21: ; preds = %0
%22 = load float, float* %6
%23 = load float, float* %3
%24 = fmul float %22, %23
store float %24, float* %5
%25 = load float, float* %5
%26 = fpext float %25 to double
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), double %26)
br label %37
28: ; preds = %0
%29 = load float, float* %6
%30 = load float, float* %4
%31 = fmul float %29, %30
store float %31, float* %5
%32 = load float, float* %5
%33 = fpext float %32 to double
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), double %33)
br label %37
35: ; preds = %0
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
br label %37
37: ; preds = %35, %28, %21, %14
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"Enter Amount You Want Corvert: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [40 x i8] c"\0AWhat Type Currency You Want To Corvert\00"
@.str.3 = [31 x i8] c"\0A1 = USD, 2 = JPY, 3 = EUR. : \00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [24 x i8] c"\0ATotal Amount in USD:%f\00"
@.str.6 = [24 x i8] c"\0ATotal Amount in JPY:%f\00"
@.str.7 = [24 x i8] c"\0ATotal Amount in EUR:%f\00"
@.str.8 = [14 x i8] c"\0AInvaid Input\00"
define i32 @main() {
%1 = alloca float
%2 = alloca i32
%3 = bitcast float* %1 to i8*
store float 0.000000e+00, float* %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%6 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
switch i32 %10, label %26 [
i32 1, label %11
i32 2, label %16
i32 3, label %21
]
11: ; preds = %0
%12 = load float, float* %1
%13 = fmul float %12, 0x3F97318FC0000000
%14 = fpext float %13 to double
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), double %14)
br label %28
16: ; preds = %0
%17 = load float, float* %1
%18 = fmul float %17, 0x40038299E0000000
%19 = fpext float %18 to double
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), double %19)
br label %28
21: ; preds = %0
%22 = load float, float* %1
%23 = fmul float %22, 0x3F8D8D79E0000000
%24 = fpext float %23 to double
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), double %24)
br label %28
26: ; preds = %0
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
br label %28
28: ; preds = %26, %21, %16, %11
ret i32 0
}