#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 */
double atof(char *);
scalar_t__ att(double);
double min(double, double);
int points(scalar_t__);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, ...);
scalar_t__ strcmp(char *, char *);
int main() {
  int n;
  int fail = 0;
  int grades[6];
  double sub[6][5];
  int i, j;
  char marks[6][5][10];
  int tot_points[6];
  double gpa;
  scanf("%d", &n);
  while (n--) {
    double total = 0;
    for (i = 0; i < 6; i++) {
      scanf("%d", &grades[i]);
      total += grades[i];
    }
    for (i = 0; i < 6; i++) {
      for (j = 0; j < 5; j++) {
        scanf("%s", marks[i][j]);
        if (strcmp(marks[i][j], "ab") == 0)
          sub[i][j] = 0;
        else
          sub[i][j] = atof(marks[i][j]);
      }
    }
    double sum = 0;
    for (i = 0; i < 6; i++) {
      tot_points[i] = points(((sub[i][0] + sub[i][1] + sub[i][2]) -
                              min(sub[i][0], min(sub[i][1], sub[i][2]))) *
                                 45 / 40 +
                             sub[i][3] * 0.5 + att(sub[i][4]));
    }
    fail = 0;
    for (i = 0; i < 6; i++) {
      if (tot_points[i] == 0)
        fail = 1;
      sum += tot_points[i] * grades[i];
    }
    gpa = (sum * 1.0) / (total * 1.0);
    if (fail == 1)
      printf("FAILED, %.2lf\n", gpa);
    else
      printf("PASSED, %.2lf\n", gpa);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2b0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xe90(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     15d7 <main+0x467>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x290(%rbp)
ff
movl   $0x0,-0x124(%rbp)
cmpl   $0x6,-0x124(%rbp)
jge    1222 <main+0xb2>
movslq -0x124(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1090 <scanf@plt>
movslq -0x124(%rbp),%rax
cvtsi2sdl -0x30(%rbp,%rax,4),%xmm0
addsd  -0x290(%rbp),%xmm0
ff
movsd  %xmm0,-0x290(%rbp)
ff
mov    -0x124(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x124(%rbp)
jmp    11c4 <main+0x54>
movl   $0x0,-0x124(%rbp)
cmpl   $0x6,-0x124(%rbp)
jge    135e <main+0x1ee>
movl   $0x0,-0x128(%rbp)
cmpl   $0x5,-0x128(%rbp)
jge    1345 <main+0x1d5>
movslq -0x124(%rbp),%rax
lea    -0x260(%rbp),%rsi
imul   $0x32,%rax,%rax
add    %rax,%rsi
movslq -0x128(%rbp),%rax
imul   $0xa,%rax,%rax
add    %rax,%rsi
lea    0xda9(%rip),%rdi
mov    $0x0,%al
call   1090 <scanf@plt>
movslq -0x124(%rbp),%rax
lea    -0x260(%rbp),%rdi
imul   $0x32,%rax,%rax
add    %rax,%rdi
movslq -0x128(%rbp),%rax
imul   $0xa,%rax,%rax
add    %rax,%rdi
lea    0xd7b(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    12e3 <main+0x173>
movslq -0x124(%rbp),%rcx
lea    -0x120(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x128(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    132c <main+0x1bc>
movslq -0x124(%rbp),%rax
lea    -0x260(%rbp),%rdi
imul   $0x32,%rax,%rax
add    %rax,%rdi
movslq -0x128(%rbp),%rax
imul   $0xa,%rax,%rax
add    %rax,%rdi
call   1040 <atof@plt>
movslq -0x124(%rbp),%rcx
lea    -0x120(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x128(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1331 <main+0x1c1>
mov    -0x128(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x128(%rbp)
jmp    1243 <main+0xd3>
jmp    134a <main+0x1da>
mov    -0x124(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x124(%rbp)
jmp    122c <main+0xbc>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x298(%rbp)
ff
movl   $0x0,-0x124(%rbp)
cmpl   $0x6,-0x124(%rbp)
jge    14f3 <main+0x383>
movslq -0x124(%rbp),%rcx
lea    -0x120(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm0
movslq -0x124(%rbp),%rcx
lea    -0x120(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
addsd  0x8(%rax),%xmm0
movslq -0x124(%rbp),%rcx
lea    -0x120(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
addsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x2a8(%rbp)
ff
movslq -0x124(%rbp),%rcx
lea    -0x120(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x2b0(%rbp)
ff
movslq -0x124(%rbp),%rcx
lea    -0x120(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movsd  0x8(%rax),%xmm0
movslq -0x124(%rbp),%rcx
lea    -0x120(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movsd  0x10(%rax),%xmm1
call   1070 <min@plt>
movaps %xmm0,%xmm1
movsd  -0x2b0(%rbp),%xmm0
ff
call   1070 <min@plt>
movsd  -0x2a8(%rbp),%xmm1
ff
subsd  %xmm0,%xmm1
movsd  0xbc5(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xbb1(%rip),%xmm0
divsd  %xmm0,%xmm1
movslq -0x124(%rbp),%rcx
lea    -0x120(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movsd  0x18(%rax),%xmm0
movsd  0xb83(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x2a0(%rbp)
ff
movslq -0x124(%rbp),%rcx
lea    -0x120(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movsd  0x20(%rax),%xmm0
call   1030 <att@plt>
movsd  -0x2a0(%rbp),%xmm0
ff
cvtsi2sd %rax,%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1050 <points@plt>
mov    %eax,%ecx
movslq -0x124(%rbp),%rax
mov    %ecx,-0x280(%rbp,%rax,4)
mov    -0x124(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x124(%rbp)
jmp    1373 <main+0x203>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x124(%rbp)
cmpl   $0x6,-0x124(%rbp)
jge    156f <main+0x3ff>
movslq -0x124(%rbp),%rax
cmpl   $0x0,-0x280(%rbp,%rax,4)
jne    152d <main+0x3bd>
movl   $0x1,-0xc(%rbp)
movslq -0x124(%rbp),%rax
mov    -0x280(%rbp,%rax,4),%eax
movslq -0x124(%rbp),%rcx
imul   -0x30(%rbp,%rcx,4),%eax
cvtsi2sd %eax,%xmm0
addsd  -0x298(%rbp),%xmm0
ff
movsd  %xmm0,-0x298(%rbp)
ff
mov    -0x124(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x124(%rbp)
jmp    1504 <main+0x394>
movsd  0xa89(%rip),%xmm0
mulsd  -0x298(%rbp),%xmm0
ff
movsd  0xa79(%rip),%xmm1
mulsd  -0x290(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x288(%rbp)
ff
cmpl   $0x1,-0xc(%rbp)
jne    15be <main+0x44e>
movsd  -0x288(%rbp),%xmm0
ff
lea    0xa75(%rip),%rdi
call   1060 <printf@plt>
jmp    15d2 <main+0x462>
movsd  -0x288(%rbp),%xmm0
ff
lea    0xa6b(%rip),%rdi
call   1060 <printf@plt>
jmp    119b <main+0x2b>
xor    %eax,%eax
add    $0x2b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x298,%rsp
lea    0xe90(%rip),%rdi
lea    0x2c(%rsp),%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
subl   $0x1,0x2c(%rsp)
jb     156f <main+0x3ff>
lea    0xe75(%rip),%r15
lea    0xe71(%rip),%r12
nopl   (%rax)
lea    0xe61(%rip),%rbx
mov    %rbx,%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
mov    (%rsp),%eax
mov    %eax,0x20(%rsp)
mov    %rbx,%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdl 0x4(%rsp),%xmm0
movsd  %xmm0,0x38(%rsp)
mov    %rbx,%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdl 0x8(%rsp),%xmm0
movsd  %xmm0,0x30(%rsp)
mov    %rbx,%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdl 0xc(%rsp),%xmm0
movsd  %xmm0,0x60(%rsp)
mov    %rbx,%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdl 0x10(%rsp),%xmm0
movsd  %xmm0,0x58(%rsp)
mov    %rbx,%rdi
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdl 0x14(%rsp),%xmm0
movsd  %xmm0,0x68(%rsp)
xor    %r14d,%r14d
lea    0x1c0(%rsp),%rbp
jmp    1292 <main+0x122>
xchg   %ax,%ax
mov    %rbx,%rdi
call   1040 <atof@plt>
movsd  %xmm0,0x0(%rbp)
add    $0x28,%rbp
add    $0x32,%r14
cmp    $0x12c,%r14
je     13b0 <main+0x240>
lea    (%rsp,%r14,1),%r13
add    $0x70,%r13
mov    %r15,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
mov    %r13,%rdi
mov    %r12,%rsi
call   1080 <strcmp@plt>
xorpd  %xmm0,%xmm0
test   %rax,%rax
je     12c3 <main+0x153>
mov    %r13,%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
lea    (%rsp,%r14,1),%rbx
add    $0x7a,%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
xorpd  %xmm0,%xmm0
je     12f9 <main+0x189>
mov    %rbx,%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0x18(%rbp)
lea    (%rsp,%r14,1),%rbx
add    $0x84,%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1080 <strcmp@plt>
xorpd  %xmm0,%xmm0
test   %rax,%rax
je     1332 <main+0x1c2>
mov    %rbx,%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0x10(%rbp)
lea    (%rsp,%r14,1),%rbx
add    $0x8e,%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
xorpd  %xmm0,%xmm0
je     136b <main+0x1fb>
mov    %rbx,%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0x8(%rbp)
lea    (%rsp,%r14,1),%rbx
add    $0x98,%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
jne    1270 <main+0x100>
xorpd  %xmm0,%xmm0
jmp    1278 <main+0x108>
cs nopw 0x0(%rax,%rax,1)
nop
xorps  %xmm0,%xmm0
cvtsi2sdl 0x20(%rsp),%xmm0
addsd  0x38(%rsp),%xmm0
addsd  0x30(%rsp),%xmm0
addsd  0x60(%rsp),%xmm0
addsd  0x58(%rsp),%xmm0
movsd  %xmm0,0x30(%rsp)
lea    0x1c0(%rsp),%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  -0x20(%rbx),%xmm2
movsd  %xmm2,0x38(%rsp)
movsd  -0x18(%rbx),%xmm0
addsd  %xmm0,%xmm2
movsd  -0x10(%rbx),%xmm1
addsd  %xmm1,%xmm2
movsd  %xmm2,0x20(%rsp)
call   1070 <min@plt>
movapd %xmm0,%xmm1
movsd  0x38(%rsp),%xmm0
call   1070 <min@plt>
movsd  0x20(%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xbc7(%rip),%xmm1
divsd  0xbc7(%rip),%xmm1
movsd  (%rbx),%xmm0
movsd  -0x8(%rbx),%xmm2
mulsd  0xbbe(%rip),%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x20(%rsp)
call   1030 <att@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x20(%rsp),%xmm0
cvttsd2si %xmm0,%rdi
call   1050 <points@plt>
mov    %eax,0x40(%rsp,%rbp,4)
add    $0x1,%rbp
add    $0x28,%rbx
cmp    $0x6,%rbp
jne    13f0 <main+0x280>
mov    0x40(%rsp),%esi
mov    0x44(%rsp),%r14d
mov    (%rsp),%edi
imul   %esi,%edi
mov    0x4(%rsp),%ebx
imul   %r14d,%ebx
mov    0x48(%rsp),%r11d
mov    0x8(%rsp),%edx
imul   %r11d,%edx
mov    0x4c(%rsp),%r10d
mov    0xc(%rsp),%eax
imul   %r10d,%eax
mov    0x50(%rsp),%r9d
mov    0x10(%rsp),%ebp
imul   %r9d,%ebp
mov    0x54(%rsp),%r8d
mov    0x14(%rsp),%ecx
imul   %r8d,%ecx
test   %esi,%esi
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
lea    0xb46(%rip),%rdi
lea    0xb30(%rip),%rsi
cmove  %rsi,%rdi
test   %r14d,%r14d
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
addsd  %xmm0,%xmm1
cmove  %rsi,%rdi
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
test   %r11d,%r11d
addsd  %xmm1,%xmm0
cmove  %rsi,%rdi
test   %r10d,%r10d
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
addsd  %xmm0,%xmm1
cmove  %rsi,%rdi
xorps  %xmm2,%xmm2
cvtsi2sd %ebp,%xmm2
test   %r9d,%r9d
addsd  %xmm1,%xmm2
cmove  %rsi,%rdi
test   %r8d,%r8d
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
addsd  %xmm2,%xmm0
movsd  0x30(%rsp),%xmm1
addsd  0x68(%rsp),%xmm1
divsd  %xmm1,%xmm0
cmove  %rsi,%rdi
call   1060 <printf@plt>
subl   $0x1,0x2c(%rsp)
jae    11b0 <main+0x40>
xor    %eax,%eax
add    $0x298,%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 = [3 x i8] c"%s\00"
@.str.2 = [3 x i8] c"ab\00"
@.str.3 = [15 x i8] c"FAILED, %.2lf\0A\00"
@.str.4 = [15 x i8] c"PASSED, %.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [6 x i32]
%5 = alloca [6 x [5 x double]]
%6 = alloca i32
%7 = alloca i32
%8 = alloca [6 x [5 x [10 x i8]]]
%9 = alloca [6 x i32]
%10 = alloca double
%11 = alloca double
%12 = alloca double
store i32 0, i32* %1
store i32 0, i32* %3
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %14
14: ; preds = %198, %0
%15 = load i32, i32* %2
%16 = add nsw i32 %15, -1
store i32 %16, i32* %2
%17 = icmp ne i32 %15, 0
br i1 %17, label %18, label %199
18: ; preds = %14
store double 0.000000e+00, double* %11
store i32 0, i32* %6
br label %19
19: ; preds = %34, %18
%20 = load i32, i32* %6
%21 = icmp slt i32 %20, 6
br i1 %21, label %22, label %37
22: ; preds = %19
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [6 x i32], [6 x i32]* %4, i64 0, i64 %24
%26 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %25)
%27 = load i32, i32* %6
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [6 x i32], [6 x i32]* %4, i64 0, i64 %28
%30 = load i32, i32* %29
%31 = sitofp i32 %30 to double
%32 = load double, double* %11
%33 = fadd double %32, %31
store double %33, double* %11
br label %34
34: ; preds = %22
%35 = load i32, i32* %6
%36 = add nsw i32 %35, 1
store i32 %36, i32* %6
br label %19
37: ; preds = %19
store i32 0, i32* %6
br label %38
38: ; preds = %90, %37
%39 = load i32, i32* %6
%40 = icmp slt i32 %39, 6
br i1 %40, label %41, label %93
41: ; preds = %38
store i32 0, i32* %7
br label %42
42: ; preds = %86, %41
%43 = load i32, i32* %7
%44 = icmp slt i32 %43, 5
br i1 %44, label %45, label %89
45: ; preds = %42
%46 = load i32, i32* %6
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [6 x [5 x [10 x i8]]], [6 x [5 x [10 x i8]]]* %8, i64 0, i64 %47
%49 = load i32, i32* %7
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [5 x [10 x i8]], [5 x [10 x i8]]* %48, i64 0, i64 %50
%52 = getelementptr inbounds [10 x i8], [10 x i8]* %51, i64 0, i64 0
%53 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %52)
%54 = load i32, i32* %6
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [6 x [5 x [10 x i8]]], [6 x [5 x [10 x i8]]]* %8, i64 0, i64 %55
%57 = load i32, i32* %7
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [5 x [10 x i8]], [5 x [10 x i8]]* %56, i64 0, i64 %58
%60 = getelementptr inbounds [10 x i8], [10 x i8]* %59, i64 0, i64 0
%61 = call i64 @strcmp(i8* %60, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%62 = icmp eq i64 %61, 0
br i1 %62, label %63, label %70
63: ; preds = %45
%64 = load i32, i32* %6
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [6 x [5 x double]], [6 x [5 x double]]* %5, i64 0, i64 %65
%67 = load i32, i32* %7
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [5 x double], [5 x double]* %66, i64 0, i64 %68
store double 0.000000e+00, double* %69
br label %85
70: ; preds = %45
%71 = load i32, i32* %6
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [6 x [5 x [10 x i8]]], [6 x [5 x [10 x i8]]]* %8, i64 0, i64 %72
%74 = load i32, i32* %7
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [5 x [10 x i8]], [5 x [10 x i8]]* %73, i64 0, i64 %75
%77 = getelementptr inbounds [10 x i8], [10 x i8]* %76, i64 0, i64 0
%78 = call double @atof(i8* %77)
%79 = load i32, i32* %6
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [6 x [5 x double]], [6 x [5 x double]]* %5, i64 0, i64 %80
%82 = load i32, i32* %7
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [5 x double], [5 x double]* %81, i64 0, i64 %83
store double %78, double* %84
br label %85
85: ; preds = %70, %63
br label %86
86: ; preds = %85
%87 = load i32, i32* %7
%88 = add nsw i32 %87, 1
store i32 %88, i32* %7
br label %42
89: ; preds = %42
br label %90
90: ; preds = %89
%91 = load i32, i32* %6
%92 = add nsw i32 %91, 1
store i32 %92, i32* %6
br label %38
93: ; preds = %38
store double 0.000000e+00, double* %12
store i32 0, i32* %6
br label %94
94: ; preds = %154, %93
%95 = load i32, i32* %6
%96 = icmp slt i32 %95, 6
br i1 %96, label %97, label %157
97: ; preds = %94
%98 = load i32, i32* %6
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds [6 x [5 x double]], [6 x [5 x double]]* %5, i64 0, i64 %99
%101 = getelementptr inbounds [5 x double], [5 x double]* %100, i64 0, i64 0
%102 = load double, double* %101
%103 = load i32, i32* %6
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds [6 x [5 x double]], [6 x [5 x double]]* %5, i64 0, i64 %104
%106 = getelementptr inbounds [5 x double], [5 x double]* %105, i64 0, i64 1
%107 = load double, double* %106
%108 = fadd double %102, %107
%109 = load i32, i32* %6
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds [6 x [5 x double]], [6 x [5 x double]]* %5, i64 0, i64 %110
%112 = getelementptr inbounds [5 x double], [5 x double]* %111, i64 0, i64 2
%113 = load double, double* %112
%114 = fadd double %108, %113
%115 = load i32, i32* %6
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds [6 x [5 x double]], [6 x [5 x double]]* %5, i64 0, i64 %116
%118 = getelementptr inbounds [5 x double], [5 x double]* %117, i64 0, i64 0
%119 = load double, double* %118
%120 = load i32, i32* %6
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds [6 x [5 x double]], [6 x [5 x double]]* %5, i64 0, i64 %121
%123 = getelementptr inbounds [5 x double], [5 x double]* %122, i64 0, i64 1
%124 = load double, double* %123
%125 = load i32, i32* %6
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds [6 x [5 x double]], [6 x [5 x double]]* %5, i64 0, i64 %126
%128 = getelementptr inbounds [5 x double], [5 x double]* %127, i64 0, i64 2
%129 = load double, double* %128
%130 = call double @min(double %124, double %129)
%131 = call double @min(double %119, double %130)
%132 = fsub double %114, %131
%133 = fmul double %132, 4.500000e+01
%134 = fdiv double %133, 4.000000e+01
%135 = load i32, i32* %6
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds [6 x [5 x double]], [6 x [5 x double]]* %5, i64 0, i64 %136
%138 = getelementptr inbounds [5 x double], [5 x double]* %137, i64 0, i64 3
%139 = load double, double* %138
%140 = call double @llvm.fmuladd.f64(double %139, double 5.000000e-01, double %134)
%141 = load i32, i32* %6
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds [6 x [5 x double]], [6 x [5 x double]]* %5, i64 0, i64 %142
%144 = getelementptr inbounds [5 x double], [5 x double]* %143, i64 0, i64 4
%145 = load double, double* %144
%146 = call i64 @att(double %145)
%147 = sitofp i64 %146 to double
%148 = fadd double %140, %147
%149 = fptosi double %148 to i64
%150 = call i32 @points(i64 %149)
%151 = load i32, i32* %6
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds [6 x i32], [6 x i32]* %9, i64 0, i64 %152
store i32 %150, i32* %153
br label %154
154: ; preds = %97
%155 = load i32, i32* %6
%156 = add nsw i32 %155, 1
store i32 %156, i32* %6
br label %94
157: ; preds = %94
store i32 0, i32* %3
store i32 0, i32* %6
br label %158
158: ; preds = %181, %157
%159 = load i32, i32* %6
%160 = icmp slt i32 %159, 6
br i1 %160, label %161, label %184
161: ; preds = %158
%162 = load i32, i32* %6
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds [6 x i32], [6 x i32]* %9, i64 0, i64 %163
%165 = load i32, i32* %164
%166 = icmp eq i32 %165, 0
br i1 %166, label %167, label %168
167: ; preds = %161
store i32 1, i32* %3
br label %168
168: ; preds = %167, %161
%169 = load i32, i32* %6
%170 = sext i32 %169 to i64
%171 = getelementptr inbounds [6 x i32], [6 x i32]* %9, i64 0, i64 %170
%172 = load i32, i32* %171
%173 = load i32, i32* %6
%174 = sext i32 %173 to i64
%175 = getelementptr inbounds [6 x i32], [6 x i32]* %4, i64 0, i64 %174
%176 = load i32, i32* %175
%177 = mul nsw i32 %172, %176
%178 = sitofp i32 %177 to double
%179 = load double, double* %12
%180 = fadd double %179, %178
store double %180, double* %12
br label %181
181: ; preds = %168
%182 = load i32, i32* %6
%183 = add nsw i32 %182, 1
store i32 %183, i32* %6
br label %158
184: ; preds = %158
%185 = load double, double* %12
%186 = fmul double %185, 1.000000e+00
%187 = load double, double* %11
%188 = fmul double %187, 1.000000e+00
%189 = fdiv double %186, %188
store double %189, double* %10
%190 = load i32, i32* %3
%191 = icmp eq i32 %190, 1
br i1 %191, label %192, label %195
192: ; preds = %184
%193 = load double, double* %10
%194 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), double %193)
br label %198
195: ; preds = %184
%196 = load double, double* %10
%197 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %196)
br label %198
198: ; preds = %195, %192
br label %14
199: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [3 x i8] c"ab\00"
@.str.3 = [15 x i8] c"FAILED, %.2lf\0A\00"
@.str.4 = [15 x i8] c"PASSED, %.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca [6 x [5 x double]]
%4 = alloca [6 x [5 x [10 x i8]]]
%5 = alloca [6 x i32]
%6 = bitcast i32* %1 to i8*
%7 = bitcast [6 x i32]* %2 to i8*
%8 = bitcast [6 x [5 x double]]* %3 to i8*
%9 = getelementptr inbounds [6 x [5 x [10 x i8]]], [6 x [5 x [10 x i8]]]* %4, i64 0, i64 0, i64 0, i64 0
%10 = bitcast [6 x i32]* %5 to i8*
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%12 = load i32, i32* %1
%13 = add nsw i32 %12, -1
store i32 %13, i32* %1
%14 = icmp eq i32 %12, 0
br i1 %14, label %177, label %15
15: ; preds = %0
%16 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%17 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 1
%18 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 2
%19 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 3
%20 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 4
%21 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 5
%22 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 0
%23 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 1
%24 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 2
%25 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 3
%26 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 4
%27 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 5
br label %28
28: ; preds = %15, %129
%29 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %16)
%30 = load i32, i32* %16
%31 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %17)
%32 = load i32, i32* %17
%33 = sitofp i32 %32 to double
%34 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %18)
%35 = load i32, i32* %18
%36 = sitofp i32 %35 to double
%37 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %19)
%38 = load i32, i32* %19
%39 = sitofp i32 %38 to double
%40 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %20)
%41 = load i32, i32* %20
%42 = sitofp i32 %41 to double
%43 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %21)
%44 = load i32, i32* %21
%45 = sitofp i32 %44 to double
br label %46
46: ; preds = %28, %90
%47 = phi i64 [ 0, %28 ], [ %93, %90 ]
%48 = getelementptr inbounds [6 x [5 x [10 x i8]]], [6 x [5 x [10 x i8]]]* %4, i64 0, i64 %47, i64 0, i64 0
%49 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %48)
%50 = call i64 @strcmp(i8* %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%51 = icmp eq i64 %50, 0
br i1 %51, label %54, label %52
52: ; preds = %46
%53 = call double @atof(i8* %48)
br label %54
54: ; preds = %46, %52
%55 = phi double [ %53, %52 ], [ 0.000000e+00, %46 ]
%56 = getelementptr inbounds [6 x [5 x double]], [6 x [5 x double]]* %3, i64 0, i64 %47, i64 0
store double %55, double* %56
%57 = getelementptr inbounds [6 x [5 x [10 x i8]]], [6 x [5 x [10 x i8]]]* %4, i64 0, i64 %47, i64 1, i64 0
%58 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %57)
%59 = call i64 @strcmp(i8* %57, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
br i1 %60, label %63, label %61
61: ; preds = %54
%62 = call double @atof(i8* %57)
br label %63
63: ; preds = %54, %61
%64 = phi double [ %62, %61 ], [ 0.000000e+00, %54 ]
%65 = getelementptr inbounds [6 x [5 x double]], [6 x [5 x double]]* %3, i64 0, i64 %47, i64 1
store double %64, double* %65
%66 = getelementptr inbounds [6 x [5 x [10 x i8]]], [6 x [5 x [10 x i8]]]* %4, i64 0, i64 %47, i64 2, i64 0
%67 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %66)
%68 = call i64 @strcmp(i8* %66, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%69 = icmp eq i64 %68, 0
br i1 %69, label %72, label %70
70: ; preds = %63
%71 = call double @atof(i8* %66)
br label %72
72: ; preds = %63, %70
%73 = phi double [ %71, %70 ], [ 0.000000e+00, %63 ]
%74 = getelementptr inbounds [6 x [5 x double]], [6 x [5 x double]]* %3, i64 0, i64 %47, i64 2
store double %73, double* %74
%75 = getelementptr inbounds [6 x [5 x [10 x i8]]], [6 x [5 x [10 x i8]]]* %4, i64 0, i64 %47, i64 3, i64 0
%76 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %75)
%77 = call i64 @strcmp(i8* %75, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%78 = icmp eq i64 %77, 0
br i1 %78, label %81, label %79
79: ; preds = %72
%80 = call double @atof(i8* %75)
br label %81
81: ; preds = %72, %79
%82 = phi double [ %80, %79 ], [ 0.000000e+00, %72 ]
%83 = getelementptr inbounds [6 x [5 x double]], [6 x [5 x double]]* %3, i64 0, i64 %47, i64 3
store double %82, double* %83
%84 = getelementptr inbounds [6 x [5 x [10 x i8]]], [6 x [5 x [10 x i8]]]* %4, i64 0, i64 %47, i64 4, i64 0
%85 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %84)
%86 = call i64 @strcmp(i8* %84, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%87 = icmp eq i64 %86, 0
br i1 %87, label %90, label %88
88: ; preds = %81
%89 = call double @atof(i8* %84)
br label %90
90: ; preds = %81, %88
%91 = phi double [ %89, %88 ], [ 0.000000e+00, %81 ]
%92 = getelementptr inbounds [6 x [5 x double]], [6 x [5 x double]]* %3, i64 0, i64 %47, i64 4
store double %91, double* %92
%93 = add nuw nsw i64 %47, 1
%94 = icmp eq i64 %93, 6
br i1 %94, label %95, label %46
95: ; preds = %90
%96 = sitofp i32 %30 to double
%97 = fadd double %96, %33
%98 = fadd double %97, %36
%99 = fadd double %98, %39
%100 = fadd double %99, %42
br label %101
101: ; preds = %95, %101
%102 = phi i64 [ 0, %95 ], [ %127, %101 ]
%103 = getelementptr inbounds [6 x [5 x double]], [6 x [5 x double]]* %3, i64 0, i64 %102, i64 0
%104 = load double, double* %103
%105 = getelementptr inbounds [6 x [5 x double]], [6 x [5 x double]]* %3, i64 0, i64 %102, i64 1
%106 = load double, double* %105
%107 = fadd double %104, %106
%108 = getelementptr inbounds [6 x [5 x double]], [6 x [5 x double]]* %3, i64 0, i64 %102, i64 2
%109 = load double, double* %108
%110 = fadd double %107, %109
%111 = call double @min(double %106, double %109)
%112 = call double @min(double %104, double %111)
%113 = fsub double %110, %112
%114 = fmul double %113, 4.500000e+01
%115 = fdiv double %114, 4.000000e+01
%116 = getelementptr inbounds [6 x [5 x double]], [6 x [5 x double]]* %3, i64 0, i64 %102, i64 3
%117 = load double, double* %116
%118 = call double @llvm.fmuladd.f64(double %117, double 5.000000e-01, double %115)
%119 = getelementptr inbounds [6 x [5 x double]], [6 x [5 x double]]* %3, i64 0, i64 %102, i64 4
%120 = load double, double* %119
%121 = call i64 @att(double %120)
%122 = sitofp i64 %121 to double
%123 = fadd double %118, %122
%124 = fptosi double %123 to i64
%125 = call i32 @points(i64 %124)
%126 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 %102
store i32 %125, i32* %126
%127 = add nuw nsw i64 %102, 1
%128 = icmp eq i64 %127, 6
br i1 %128, label %129, label %101
129: ; preds = %101
%130 = load i32, i32* %22
%131 = icmp eq i32 %130, 0
%132 = load i32, i32* %16
%133 = mul nsw i32 %132, %130
%134 = sitofp i32 %133 to double
%135 = load i32, i32* %23
%136 = icmp eq i32 %135, 0
%137 = load i32, i32* %17
%138 = mul nsw i32 %137, %135
%139 = sitofp i32 %138 to double
%140 = fadd double %134, %139
%141 = load i32, i32* %24
%142 = icmp eq i32 %141, 0
%143 = load i32, i32* %18
%144 = mul nsw i32 %143, %141
%145 = sitofp i32 %144 to double
%146 = fadd double %140, %145
%147 = load i32, i32* %25
%148 = icmp eq i32 %147, 0
%149 = load i32, i32* %19
%150 = mul nsw i32 %149, %147
%151 = sitofp i32 %150 to double
%152 = fadd double %146, %151
%153 = load i32, i32* %26
%154 = icmp eq i32 %153, 0
%155 = load i32, i32* %20
%156 = mul nsw i32 %155, %153
%157 = sitofp i32 %156 to double
%158 = fadd double %152, %157
%159 = load i32, i32* %27
%160 = icmp eq i32 %159, 0
%161 = select i1 %160, i1 true, i1 %154
%162 = select i1 %161, i1 true, i1 %148
%163 = select i1 %162, i1 true, i1 %142
%164 = select i1 %163, i1 true, i1 %136
%165 = select i1 %164, i1 true, i1 %131
%166 = load i32, i32* %21
%167 = mul nsw i32 %166, %159
%168 = sitofp i32 %167 to double
%169 = fadd double %158, %168
%170 = fadd double %100, %45
%171 = fdiv double %169, %170
%172 = select i1 %165, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0)
%173 = call i32 @printf(i8* %172, double %171)
%174 = load i32, i32* %1
%175 = add nsw i32 %174, -1
store i32 %175, i32* %1
%176 = icmp eq i32 %174, 0
br i1 %176, label %177, label %28
177: ; preds = %129, %0
ret i32 0
}