#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 p_code[2], p_u[2], i;
  float price[2], pay;
  for (i = 0; i < 2; i++) {
    scanf("%d %d %f", &p_code[i], &p_u[i], &price[i]);
  }
  pay = ((price[0] * p_u[0]) + (price[1] * p_u[1]));
  printf("VALOR A PAGAR: R$ %.2f\n", pay);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x2,-0x18(%rbp)
jge    1187 <main+0x67>
movslq -0x18(%rbp),%rax
lea    -0xc(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
movslq -0x18(%rbp),%rax
lea    -0x14(%rbp),%rdx
shl    $0x2,%rax
add    %rax,%rdx
movslq -0x18(%rbp),%rax
lea    -0x20(%rbp),%rcx
shl    $0x2,%rax
add    %rax,%rcx
lea    0xe8c(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1136 <main+0x16>
movss  -0x20(%rbp),%xmm0
cvtsi2ssl -0x14(%rbp),%xmm2
movss  -0x1c(%rbp),%xmm1
cvtsi2ssl -0x10(%rbp),%xmm3
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
lea    0xe51(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rbx
lea    0x18(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x1c(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0xc(%rsp),%rcx
mov    %rbx,%rdi
call   1040 <scanf@plt>
cvtsi2ssl 0x10(%rsp),%xmm0
cvtsi2ssl 0x14(%rsp),%xmm1
mulss  0xc(%rsp),%xmm1
mulss  0x8(%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 [2 x i32]
%3 = alloca [2 x i32]
%4 = alloca i32
%5 = alloca [2 x float]
%6 = alloca float
store i32 0, i32* %1
store i32 0, i32* %4
br label %7
7: ; preds = %21, %0
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %24
10: ; preds = %7
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 %12
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 %15
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [2 x float], [2 x float]* %5, i64 0, i64 %18
%20 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %13, i32* %16, float* %19)
br label %21
21: ; preds = %10
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %7
24: ; preds = %7
%25 = getelementptr inbounds [2 x float], [2 x float]* %5, i64 0, i64 0
%26 = load float, float* %25
%27 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%28 = load i32, i32* %27
%29 = sitofp i32 %28 to float
%30 = getelementptr inbounds [2 x float], [2 x float]* %5, i64 0, i64 1
%31 = load float, float* %30
%32 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%33 = load i32, i32* %32
%34 = sitofp i32 %33 to float
%35 = fmul float %31, %34
%36 = call float @llvm.fmuladd.f32(float %26, float %29, float %35)
store float %36, float* %6
%37 = load float, float* %6
%38 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), float %37)
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 [2 x i32]
%2 = alloca [2 x i32]
%3 = alloca [2 x float]
%4 = bitcast [2 x i32]* %1 to i8*
%5 = bitcast [2 x i32]* %2 to i8*
%6 = bitcast [2 x float]* %3 to i8*
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%9 = getelementptr inbounds [2 x float], [2 x float]* %3, i64 0, i64 0
%10 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %7, i32* %8, float* %9)
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%13 = getelementptr inbounds [2 x float], [2 x float]* %3, i64 0, i64 1
%14 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %11, i32* %12, float* %13)
%15 = load float, float* %9
%16 = load i32, i32* %8
%17 = sitofp i32 %16 to float
%18 = load float, float* %13
%19 = load i32, i32* %12
%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
}