#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);
int /*<<< orphan*/ scanf(char *, int *, int *, float *);
int main() {
  int codigo_peca_1, numero_peca_1, codigo_peca_2, numero_peca_2;
  float valor_peca_1, valor_peca_2, total;
  scanf("%d %d %f", &codigo_peca_1, &numero_peca_1, &valor_peca_1);
  scanf("%d %d %f", &codigo_peca_2, &numero_peca_2, &valor_peca_2);
  total = ((valor_peca_1 * numero_peca_1) + (valor_peca_2 * numero_peca_2));
  printf("VALOR A PAGAR: R$ %.2f\n", total);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1040 <scanf@plt>
lea    0xeb2(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1040 <scanf@plt>
movss  -0x18(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm2
movss  -0x1c(%rbp),%xmm1
cvtsi2ssl -0x14(%rbp),%xmm3
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rbx
lea    0x1c(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0xc(%rsp),%rcx
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x18(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %rbx,%rdi
call   1040 <scanf@plt>
cvtsi2ssl 0x14(%rsp),%xmm0
cvtsi2ssl 0x10(%rsp),%xmm1
mulss  0x8(%rsp),%xmm1
mulss  0xc(%rsp),%xmm0
addss  %xmm1,%xmm0
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d %d %f\00"
@.str.1 = [24 x i8] c"VALOR A PAGAR: R$ %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
%7 = alloca float
%8 = alloca float
store i32 0, i32* %1
%9 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, float* %6)
%10 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %4, i32* %5, float* %7)
%11 = load float, float* %6
%12 = load i32, i32* %3
%13 = sitofp i32 %12 to float
%14 = load float, float* %7
%15 = load i32, i32* %5
%16 = sitofp i32 %15 to float
%17 = fmul float %14, %16
%18 = call float @llvm.fmuladd.f32(float %11, float %13, float %17)
store float %18, float* %8
%19 = load float, float* %8
%20 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), float %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %f\00"
@.str.1 = [24 x i8] c"VALOR A PAGAR: R$ %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = bitcast i32* %1 to i8*
%8 = bitcast i32* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast float* %5 to i8*
%12 = bitcast float* %6 to i8*
%13 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, float* %5)
%14 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4, float* %6)
%15 = load float, float* %5
%16 = load i32, i32* %2
%17 = sitofp i32 %16 to float
%18 = load float, float* %6
%19 = load i32, i32* %4
%20 = sitofp i32 %19 to float
%21 = fmul float %18, %20
%22 = call float @llvm.fmuladd.f32(float %15, float %17, float %21)
%23 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), float %22)
ret i32 0
}