#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*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float euro[5], dollar[5];
  int i;
  const float rate = 1.35;
  printf("Input 5 values for euro:\n");
  for (i = 0; i < 5; i++) {
    scanf("%f", &euro[i]);
  }
  for (i = 0; i < 5; i++) {
    dollar[i] = euro[i];
  }
  for (i = 0; i < 5; i++) {
    dollar[i] = euro[i] * rate;
  }
  for (i = 0; i < 5; i++) {
    printf("\nDollars: %.2f	Euros: %.2f\n", dollar[i], euro[i]);
  }
  printf("\n[Press ENTER to close] ");
  getchar();
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xeb9(%rip),%xmm0
movss  %xmm0,-0x48(%rbp)
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x44(%rbp)
cmpl   $0x5,-0x44(%rbp)
jge    1194 <main+0x64>
movslq -0x44(%rbp),%rax
lea    -0x20(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe9d(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1161 <main+0x31>
movl   $0x0,-0x44(%rbp)
cmpl   $0x5,-0x44(%rbp)
jge    11c7 <main+0x97>
movslq -0x44(%rbp),%rax
movss  -0x20(%rbp,%rax,4),%xmm0
movslq -0x44(%rbp),%rax
movss  %xmm0,-0x40(%rbp,%rax,4)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    119b <main+0x6b>
movl   $0x0,-0x44(%rbp)
cmpl   $0x5,-0x44(%rbp)
jge    1202 <main+0xd2>
movslq -0x44(%rbp),%rax
movss  0xe1c(%rip),%xmm0
mulss  -0x20(%rbp,%rax,4),%xmm0
movslq -0x44(%rbp),%rax
movss  %xmm0,-0x40(%rbp,%rax,4)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11ce <main+0x9e>
movl   $0x0,-0x44(%rbp)
cmpl   $0x5,-0x44(%rbp)
jge    124b <main+0x11b>
movslq -0x44(%rbp),%rax
movss  -0x40(%rbp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
movslq -0x44(%rbp),%rax
movss  -0x20(%rbp,%rax,4),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xdeb(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1209 <main+0xd9>
lea    0xdeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movss  (%rsp),%xmm0
movss  0xe5c(%rip),%xmm2
cvtss2sd %xmm0,%xmm1
mulss  %xmm2,%xmm0
movss  0x4(%rsp),%xmm3
mulss  %xmm2,%xmm3
movss  %xmm3,0x20(%rsp)
movss  0x8(%rsp),%xmm3
mulss  %xmm2,%xmm3
movss  %xmm3,0x24(%rsp)
movss  0xc(%rsp),%xmm3
mulss  %xmm2,%xmm3
movss  %xmm3,0x28(%rsp)
mulss  0x10(%rsp),%xmm2
movss  %xmm2,0x2c(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xe14(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0x20(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x4(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0x24(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x8(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0x28(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0xc(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0x2c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x10(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xda7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Input 5 values for euro:\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [28 x i8] c"\0ADollars: %.2f\09Euros: %.2f\0A\00"
@.str.3 = [25 x i8] c"\0A[Press ENTER to close] \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x float]
%3 = alloca [5 x float]
%4 = alloca i32
%5 = alloca float
store i32 0, i32* %1
store float 0x3FF59999A0000000, float* %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %7
7: ; preds = %15, %0
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 5
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [5 x float], [5 x float]* %2, i64 0, i64 %12
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %13)
br label %15
15: ; preds = %10
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %7
18: ; preds = %7
store i32 0, i32* %4
br label %19
19: ; preds = %30, %18
%20 = load i32, i32* %4
%21 = icmp slt i32 %20, 5
br i1 %21, label %22, label %33
22: ; preds = %19
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [5 x float], [5 x float]* %2, i64 0, i64 %24
%26 = load float, float* %25
%27 = load i32, i32* %4
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [5 x float], [5 x float]* %3, i64 0, i64 %28
store float %26, float* %29
br label %30
30: ; preds = %22
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
store i32 %32, i32* %4
br label %19
33: ; preds = %19
store i32 0, i32* %4
br label %34
34: ; preds = %46, %33
%35 = load i32, i32* %4
%36 = icmp slt i32 %35, 5
br i1 %36, label %37, label %49
37: ; preds = %34
%38 = load i32, i32* %4
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [5 x float], [5 x float]* %2, i64 0, i64 %39
%41 = load float, float* %40
%42 = fmul float %41, 0x3FF59999A0000000
%43 = load i32, i32* %4
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [5 x float], [5 x float]* %3, i64 0, i64 %44
store float %42, float* %45
br label %46
46: ; preds = %37
%47 = load i32, i32* %4
%48 = add nsw i32 %47, 1
store i32 %48, i32* %4
br label %34
49: ; preds = %34
store i32 0, i32* %4
br label %50
50: ; preds = %65, %49
%51 = load i32, i32* %4
%52 = icmp slt i32 %51, 5
br i1 %52, label %53, label %68
53: ; preds = %50
%54 = load i32, i32* %4
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [5 x float], [5 x float]* %3, i64 0, i64 %55
%57 = load float, float* %56
%58 = fpext float %57 to double
%59 = load i32, i32* %4
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [5 x float], [5 x float]* %2, i64 0, i64 %60
%62 = load float, float* %61
%63 = fpext float %62 to double
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), double %58, double %63)
br label %65
65: ; preds = %53
%66 = load i32, i32* %4
%67 = add nsw i32 %66, 1
store i32 %67, i32* %4
br label %50
68: ; preds = %50
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%70 = call i32 (...) @getchar()
%71 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [28 x i8] c"\0ADollars: %.2f\09Euros: %.2f\0A\00"
@.str.3 = [25 x i8] c"\0A[Press ENTER to close] \00"
@str = [25 x i8] c"Input 5 values for euro:\00"
define i32 @main() {
%1 = alloca [5 x float]
%2 = bitcast [5 x float]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [5 x float], [5 x float]* %1, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%6 = getelementptr inbounds [5 x float], [5 x float]* %1, i64 0, i64 1
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %6)
%8 = getelementptr inbounds [5 x float], [5 x float]* %1, i64 0, i64 2
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %8)
%10 = getelementptr inbounds [5 x float], [5 x float]* %1, i64 0, i64 3
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %10)
%12 = getelementptr inbounds [5 x float], [5 x float]* %1, i64 0, i64 4
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %12)
%14 = load float, float* %4
%15 = fmul float %14, 0x3FF59999A0000000
%16 = load float, float* %6
%17 = fmul float %16, 0x3FF59999A0000000
%18 = load float, float* %8
%19 = fmul float %18, 0x3FF59999A0000000
%20 = load float, float* %10
%21 = fmul float %20, 0x3FF59999A0000000
%22 = load float, float* %12
%23 = fmul float %22, 0x3FF59999A0000000
%24 = fpext float %15 to double
%25 = fpext float %14 to double
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), double %24, double %25)
%27 = fpext float %17 to double
%28 = load float, float* %6
%29 = fpext float %28 to double
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), double %27, double %29)
%31 = fpext float %19 to double
%32 = load float, float* %8
%33 = fpext float %32 to double
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), double %31, double %33)
%35 = fpext float %21 to double
%36 = load float, float* %10
%37 = fpext float %36 to double
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), double %35, double %37)
%39 = fpext float %23 to double
%40 = load float, float* %12
%41 = fpext float %40 to double
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), double %39, double %41)
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%44 = call i32 (...) @getchar()
%45 = call i32 (...) @getchar()
ret i32 0
}