#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*/ media_ponderada(double *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int n, j;
  scanf("%d", &n);
  for (j = 0; j < n; j++) {
    double v[3];
    scanf("%lf %lf %lf", &v[0], &v[1], &v[2]);
    printf("%.1lf\n", media_ponderada(v));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11ab <main+0x7b>
lea    -0x30(%rbp),%rsi
lea    -0x30(%rbp),%rdx
add    $0x8,%rdx
lea    -0x30(%rbp),%rcx
add    $0x10,%rcx
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    -0x30(%rbp),%rdi
call   1040 <media_ponderada@plt>
mov    %eax,%esi
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1158 <main+0x28>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xebb(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11ae <main+0x7e>
lea    0x18(%rsp),%r14
lea    0x20(%rsp),%r15
lea    0xe9a(%rip),%r12
lea    0x10(%rsp),%rbx
lea    0xe9a(%rip),%r13
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <media_ponderada@plt>
mov    %r13,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    0xc(%rsp),%ebp
jl     1180 <main+0x50>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"%lf %lf %lf\00"
@.str.2 = [7 x i8] c"%.1lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [3 x double]
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %3
br label %6
6: ; preds = %18, %0
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%12 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 1
%13 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 2
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double* %11, double* %12, double* %13)
%15 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%16 = call i32 @media_ponderada(double* %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %6
21: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"%lf %lf %lf\00"
@.str.2 = [7 x i8] c"%.1lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x double]
%3 = bitcast i32* %1 to i8*
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %20
7: ; preds = %0
%8 = bitcast [3 x double]* %2 to i8*
%9 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%10 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 1
%11 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 2
br label %12
12: ; preds = %7, %12
%13 = phi i32 [ 0, %7 ], [ %17, %12 ]
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double* %9, double* %10, double* %11)
%15 = call i32 @media_ponderada(double* %9)
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %15)
%17 = add nuw nsw i32 %13, 1
%18 = load i32, i32* %1
%19 = icmp slt i32 %17, %18
br i1 %19, label %12, label %20
20: ; preds = %12, %0
ret i32 0
}