#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 *, float *, float *, float *, float *, float *,
                         float *, float *, float *);
int main(void) {
  float p1, p2, p3, t1, t2, t3, t4, t5, p, t, m;
  scanf("%f%f%f%f%f%f%f%f", &p1, &p2, &p3, &t1, &t2, &t3, &t4, &t5);
  p = (3 * p1 + 3 * p2 + 4 * p3) / 10;
  t = (t1 + t2 + t3 + t4 + t5) / 5;
  if (p < 5.0 || t < 5.0)
    m = (p < t) ? p : t;
  else
    m = (7 * p + 3 * t) / 10;
  printf("%g\n", m);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee6(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
lea    -0x18(%rbp),%r9
lea    -0x1c(%rbp),%r11
lea    -0x20(%rbp),%r10
lea    -0x24(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm1
movss  0xe9e(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  0xe91(%rip),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
movss  0xe78(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xe64(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x14(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
addss  -0x1c(%rbp),%xmm0
addss  -0x20(%rbp),%xmm0
addss  -0x24(%rbp),%xmm0
movss  0xe36(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe14(%rip),%xmm0
ucomisd %xmm1,%xmm0
ja     1211 <main+0xf1>
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xdf9(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    124c <main+0x12c>
movss  -0x28(%rbp),%xmm1
movss  -0x2c(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1233 <main+0x113>
movss  -0x28(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
jmp    123d <main+0x11d>
movss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x34(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
jmp    127f <main+0x15f>
movss  -0x28(%rbp),%xmm0
movss  0xdbb(%rip),%xmm1
mulss  -0x2c(%rbp),%xmm1
movss  0xdb2(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xd96(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x30(%rbp),%xmm0
lea    0xda2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x30,%rsp
lea    0x10(%rsp),%rax
lea    0x14(%rsp),%r10
lea    0x18(%rsp),%r11
lea    0xef6(%rip),%rdi
lea    0x2c(%rsp),%rsi
lea    0x28(%rsp),%rdx
lea    0x24(%rsp),%rcx
lea    0x20(%rsp),%r8
lea    0x1c(%rsp),%r9
push   %rax
push   %r10
push   %r11
call   1040 <scanf@plt>
add    $0x20,%rsp
movss  0xe97(%rip),%xmm0
movss  0x20(%rsp),%xmm1
mulss  %xmm0,%xmm1
mulss  0x24(%rsp),%xmm0
movss  0x1c(%rsp),%xmm2
mulss  0xe7d(%rip),%xmm2
addss  %xmm1,%xmm0
movss  0x18(%rsp),%xmm1
addss  0x14(%rsp),%xmm1
addss  0x10(%rsp),%xmm1
addss  0xc(%rsp),%xmm1
addss  %xmm0,%xmm2
addss  0x8(%rsp),%xmm1
unpcklps %xmm2,%xmm1
divps  0xe59(%rip),%xmm1
movaps %xmm1,%xmm0
cmpltps 0xe5e(%rip),%xmm0
01
unpcklps %xmm0,%xmm0
movmskpd %xmm0,%eax
test   %eax,%eax
je     11da <main+0xba>
movaps %xmm1,%xmm0
shufps $0x55,%xmm1,%xmm0
minss  %xmm1,%xmm0
jmp    1201 <main+0xe1>
movss  0xe1e(%rip),%xmm0
mulss  %xmm1,%xmm0
shufps $0x55,%xmm1,%xmm1
mulss  0xe16(%rip),%xmm1
addss  %xmm0,%xmm1
divss  0xe0e(%rip),%xmm1
movaps %xmm1,%xmm0
lea    0xe39(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"%f%f%f%f%f%f%f%f\00"
@.str.1 = [4 x i8] c"%g\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store i32 0, i32* %1
%13 = call i32 @scanf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), float* %2, float* %3, float* %4, float* %5, float* %6, float* %7, float* %8, float* %9)
%14 = load float, float* %2
%15 = load float, float* %3
%16 = fmul float 3.000000e+00, %15
%17 = call float @llvm.fmuladd.f32(float 3.000000e+00, float %14, float %16)
%18 = load float, float* %4
%19 = call float @llvm.fmuladd.f32(float 4.000000e+00, float %18, float %17)
%20 = fdiv float %19, 1.000000e+01
store float %20, float* %10
%21 = load float, float* %5
%22 = load float, float* %6
%23 = fadd float %21, %22
%24 = load float, float* %7
%25 = fadd float %23, %24
%26 = load float, float* %8
%27 = fadd float %25, %26
%28 = load float, float* %9
%29 = fadd float %27, %28
%30 = fdiv float %29, 5.000000e+00
store float %30, float* %11
%31 = load float, float* %10
%32 = fpext float %31 to double
%33 = fcmp olt double %32, 5.000000e+00
br i1 %33, label %38, label %34
34: ; preds = %0
%35 = load float, float* %11
%36 = fpext float %35 to double
%37 = fcmp olt double %36, 5.000000e+00
br i1 %37, label %38, label %48
38: ; preds = %34, %0
%39 = load float, float* %10
%40 = load float, float* %11
%41 = fcmp olt float %39, %40
br i1 %41, label %42, label %44
42: ; preds = %38
%43 = load float, float* %10
br label %46
44: ; preds = %38
%45 = load float, float* %11
br label %46
46: ; preds = %44, %42
%47 = phi float [ %43, %42 ], [ %45, %44 ]
store float %47, float* %12
br label %54
48: ; preds = %34
%49 = load float, float* %10
%50 = load float, float* %11
%51 = fmul float 3.000000e+00, %50
%52 = call float @llvm.fmuladd.f32(float 7.000000e+00, float %49, float %51)
%53 = fdiv float %52, 1.000000e+01
store float %53, float* %12
br label %54
54: ; preds = %48, %46
%55 = load float, float* %12
%56 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %55)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"%f%f%f%f%f%f%f%f\00"
@.str.1 = [4 x i8] c"%g\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = bitcast float* %1 to i8*
%10 = bitcast float* %2 to i8*
%11 = bitcast float* %3 to i8*
%12 = bitcast float* %4 to i8*
%13 = bitcast float* %5 to i8*
%14 = bitcast float* %6 to i8*
%15 = bitcast float* %7 to i8*
%16 = bitcast float* %8 to i8*
%17 = call i32 @scanf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), float* %1, float* %2, float* %3, float* %4, float* %5, float* %6, float* %7, float* %8)
%18 = load float, float* %1
%19 = load float, float* %2
%20 = fmul float %19, 3.000000e+00
%21 = call float @llvm.fmuladd.f32(float %18, float 3.000000e+00, float %20)
%22 = load float, float* %3
%23 = call float @llvm.fmuladd.f32(float %22, float 4.000000e+00, float %21)
%24 = load float, float* %4
%25 = load float, float* %5
%26 = fadd float %24, %25
%27 = load float, float* %6
%28 = fadd float %26, %27
%29 = load float, float* %7
%30 = fadd float %28, %29
%31 = load float, float* %8
%32 = fadd float %30, %31
%33 = insertelement <2 x float> poison, float %32, i64 0
%34 = insertelement <2 x float> %33, float %23, i64 1
%35 = fdiv <2 x float> %34, <float 5.000000e+00, float 1.000000e+01>
%36 = fcmp olt <2 x float> %35, <float 5.000000e+00, float 5.000000e+00>
%37 = extractelement <2 x i1> %36, i64 0
%38 = extractelement <2 x i1> %36, i64 1
%39 = select i1 %38, i1 true, i1 %37
br i1 %39, label %40, label %45
40: ; preds = %0
%41 = extractelement <2 x float> %35, i64 0
%42 = extractelement <2 x float> %35, i64 1
%43 = fcmp olt float %42, %41
%44 = select i1 %43, float %42, float %41
br label %51
45: ; preds = %0
%46 = extractelement <2 x float> %35, i64 0
%47 = fmul float %46, 3.000000e+00
%48 = extractelement <2 x float> %35, i64 1
%49 = call float @llvm.fmuladd.f32(float %48, float 7.000000e+00, float %47)
%50 = fdiv float %49, 1.000000e+01
br label %51
51: ; preds = %45, %40
%52 = phi float [ %44, %40 ], [ %50, %45 ]
%53 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %52)
ret i32 0
}