#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 *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int n1, n2, n3, p1, p2, p3, mediapond;
  printf("Digite as tres notas!\n");
  scanf("%d %d %d", &n1, &n2, &n3);
  printf("Digite os pesos!\n");
  scanf("%d %d %d", &p1, &p2, &p3);
  mediapond = (n1 * p1) * (n2 * p2) + (n3 * p3);
  printf("%d\n", mediapond);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xead(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0x18(%rbp),%ecx
imul   %ecx,%eax
mov    -0x10(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%esi
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rbx
lea    0x1c(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x14(%rsp),%rcx
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x10(%rsp),%eax
imul   0x1c(%rsp),%eax
imul   0x18(%rsp),%eax
imul   0xc(%rsp),%eax
mov    0x8(%rsp),%esi
imul   0x14(%rsp),%esi
add    %eax,%esi
lea    0xe62(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Digite as tres notas!\0A\00"
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.2 = [18 x i8] c"Digite os pesos!\0A\00"
@.str.3 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %5, i32* %6, i32* %7)
%13 = load i32, i32* %2
%14 = load i32, i32* %5
%15 = mul nsw i32 %13, %14
%16 = load i32, i32* %3
%17 = load i32, i32* %6
%18 = mul nsw i32 %16, %17
%19 = mul nsw i32 %15, %18
%20 = load i32, i32* %4
%21 = load i32, i32* %7
%22 = mul nsw i32 %20, %21
%23 = add nsw i32 %19, %22
store i32 %23, i32* %8
%24 = load i32, i32* %8
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %24)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.3 = [4 x i8] c"%d\0A\00"
@str = [22 x i8] c"Digite as tres notas!\00"
@str.4 = [17 x i8] c"Digite os pesos!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%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 i32* %5 to i8*
%12 = bitcast i32* %6 to i8*
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.4, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %5, i32* %6)
%17 = load i32, i32* %1
%18 = load i32, i32* %4
%19 = load i32, i32* %2
%20 = load i32, i32* %5
%21 = mul i32 %18, %17
%22 = mul i32 %21, %19
%23 = mul i32 %22, %20
%24 = load i32, i32* %3
%25 = load i32, i32* %6
%26 = mul nsw i32 %25, %24
%27 = add nsw i32 %26, %23
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %27)
ret i32 0
}