#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 *, double);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  double valores[] = {4, 4.5, 5, 2, 1.5};
  int codigo, quantidade;
  scanf("%d %d", &codigo, &quantidade);
  printf("Total: R$ %.2f\n", valores[codigo - 1] * quantidade);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xeb4(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe9f(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe8a(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe75(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xe91(%rip),%rdi
lea    -0x34(%rbp),%rsi
lea    -0x38(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x34(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0x30(%rbp,%rax,8),%xmm0
cvtsi2sdl -0x38(%rbp),%xmm1
mulsd  %xmm1,%xmm0
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movabs $0x3ff8000000000000,%rax
mov    %rax,0x30(%rsp)
lea    0xece(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rax
xorps  %xmm0,%xmm0
cvtsi2sdl 0x8(%rsp),%xmm0
mulsd  0x8(%rsp,%rax,8),%xmm0
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@.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 [5 x double]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [5 x double]* %2 to i8*
%6 = bitcast i8* %5 to [5 x double]*
%7 = getelementptr inbounds [5 x double], [5 x double]* %6, i32 0, i32 0
store double 4.000000e+00, double* %7
%8 = getelementptr inbounds [5 x double], [5 x double]* %6, i32 0, i32 1
store double 4.500000e+00, double* %8
%9 = getelementptr inbounds [5 x double], [5 x double]* %6, i32 0, i32 2
store double 5.000000e+00, double* %9
%10 = getelementptr inbounds [5 x double], [5 x double]* %6, i32 0, i32 3
store double 2.000000e+00, double* %10
%11 = getelementptr inbounds [5 x double], [5 x double]* %6, i32 0, i32 4
store double 1.500000e+00, double* %11
%12 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [5 x double], [5 x double]* %2, i64 0, i64 %15
%17 = load double, double* %16
%18 = load i32, i32* %4
%19 = sitofp i32 %18 to double
%20 = fmul double %17, %19
%21 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %20)
ret i32 0
}

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