#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 *, float const);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int cod, qtt;
  const float PRICES[5] = {4.00, 4.50, 5.00, 2.00, 1.50};
  scanf("%d %d", &cod, &qtt);
  printf("Total: R$ %.2f\n", PRICES[cod - 1] * qtt);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    0xebf(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
movss  -0x20(%rbp,%rax,4),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
mulss  %xmm1,%xmm0
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
cvtsi2ssl (%rsp),%xmm0
movslq 0x4(%rsp),%rax
lea    0xeba(%rip),%rcx
mulss  -0x4(%rcx,%rax,4),%xmm0
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.PRICES = [5 x float] [float 4.000000e+00, float 4.500000e+00, float 5.000000e+00, float 2.000000e+00, float 1.500000e+00]
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [16 x i8] c"Total: R$ %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [5 x float]
store i32 0, i32* %1
%5 = bitcast [5 x float]* %4 to i8*
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [5 x float], [5 x float]* %4, i64 0, i64 %9
%11 = load float, float* %10
%12 = load i32, i32* %3
%13 = sitofp i32 %12 to float
%14 = fmul float %11, %13
%15 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), float %14)
ret i32 0
}

LLVM IR (-O2):
@__const.main.PRICES = [5 x float] [float 4.000000e+00, float 4.500000e+00, float 5.000000e+00, float 2.000000e+00, float 1.500000e+00]
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [16 x i8] c"Total: R$ %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = add nsw i32 %6, -1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [5 x float], [5 x float]* @__const.main.PRICES, i64 0, i64 %8
%10 = load float, float* %9
%11 = load i32, i32* %2
%12 = sitofp i32 %11 to float
%13 = fmul float %10, %12
%14 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), float %13)
ret i32 0
}