#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 */
scalar_t__ EOF;
double line(int, int, int, int, int, int);
int /*<<< orphan*/ printf(char *, double);
scalar_t__ scanf(char *, int *, ...);
int main() {
  int num;
  while ((scanf("%d", &num) != EOF) && (num != 0)) {
    double l[num];
    for (int i = 0; i < num; i++) {
      int p[3][2];
      for (int j = 0; j < 3; j++)
        scanf("%d %d", &p[j][0], &p[j][1]);
      l[i] = line(p[0][0], p[0][1], p[1][0], p[1][1], p[2][0], p[2][1]);
      printf("%4.3f\n", l[i]);
    }
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xebd(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    %rax,%rcx
xor    %eax,%eax
mov    0x2e8b(%rip),%rdx
cmp    (%rdx),%rcx
mov    %al,-0x45(%rbp)
je     1173 <main+0x43>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x45(%rbp)
mov    -0x45(%rbp),%al
test   $0x1,%al
jne    1183 <main+0x53>
jmp    1263 <main+0x133>
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x50(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1255 <main+0x125>
movl   $0x0,-0x44(%rbp)
cmpl   $0x3,-0x44(%rbp)
jge    120c <main+0xdc>
movslq -0x44(%rbp),%rax
lea    -0x40(%rbp),%rsi
shl    $0x3,%rax
add    %rax,%rsi
movslq -0x44(%rbp),%rax
lea    -0x40(%rbp),%rdx
shl    $0x3,%rax
add    %rax,%rdx
add    $0x4,%rdx
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11c4 <main+0x94>
mov    -0x40(%rbp),%edi
mov    -0x3c(%rbp),%esi
mov    -0x38(%rbp),%edx
mov    -0x34(%rbp),%ecx
mov    -0x30(%rbp),%r8d
mov    -0x2c(%rbp),%r9d
call   1050 <line@plt>
mov    -0x50(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xdc4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11b1 <main+0x81>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
lea    0xebe(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x2e90(%rip),%rcx
cmp    (%rcx),%rax
je     120d <main+0xdd>
cmpl   $0x0,0xc(%rsp)
je     120d <main+0xdd>
mov    %rsp,0x30(%rsp)
cmpl   $0x0,0xc(%rsp)
jle    1208 <main+0xd8>
lea    0x20(%rsp),%r13
lea    0x24(%rsp),%rbx
lea    0xe73(%rip),%rbp
lea    0x10(%rsp),%r14
lea    0xe6d(%rip),%r15
xor    %r12d,%r12d
nopl   0x0(%rax)
mov    %rbp,%rdi
mov    %r14,%rsi
lea    0x14(%rsp),%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %rbp,%rdi
lea    0x18(%rsp),%rsi
lea    0x1c(%rsp),%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %rbp,%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x10(%rsp),%edi
mov    0x14(%rsp),%esi
mov    0x18(%rsp),%edx
mov    0x1c(%rsp),%ecx
mov    0x20(%rsp),%r8d
mov    0x24(%rsp),%r9d
call   1050 <line@plt>
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x1,%r12d
cmp    0xc(%rsp),%r12d
jl     11a0 <main+0x70>
mov    0x30(%rsp),%rsp
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [7 x i8] c"%4.3f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
%6 = alloca [3 x [2 x i32]]
%7 = alloca i32
store i32 0, i32* %1
br label %8
8: ; preds = %0
%9 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%10 = load i64, i64* @EOF
%11 = icmp ne i64 %9, %10
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32, i32* %2
%14 = icmp ne i32 %13, 0
br label %15
15: ; preds = %12, %8
%16 = phi i1 [ false, %8 ], [ %14, %12 ]
br i1 %16, label %17, label %76
17: ; preds = %15
%18 = load i32, i32* %2
%19 = zext i32 %18 to i64
%20 = call i8* @llvm.stacksave()
store i8* %20, i8** %3
%21 = alloca double, i64 %19
store i64 %19, i64* %4
store i32 0, i32* %5
br label %22
22: ; preds = %71, %17
%23 = load i32, i32* %5
%24 = load i32, i32* %2
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %74
26: ; preds = %22
store i32 0, i32* %7
br label %27
27: ; preds = %40, %26
%28 = load i32, i32* %7
%29 = icmp slt i32 %28, 3
br i1 %29, label %30, label %43
30: ; preds = %27
%31 = load i32, i32* %7
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %6, i64 0, i64 %32
%34 = getelementptr inbounds [2 x i32], [2 x i32]* %33, i64 0, i64 0
%35 = load i32, i32* %7
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %6, i64 0, i64 %36
%38 = getelementptr inbounds [2 x i32], [2 x i32]* %37, i64 0, i64 1
%39 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %34, i32* %38)
br label %40
40: ; preds = %30
%41 = load i32, i32* %7
%42 = add nsw i32 %41, 1
store i32 %42, i32* %7
br label %27
43: ; preds = %27
%44 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %6, i64 0, i64 0
%45 = getelementptr inbounds [2 x i32], [2 x i32]* %44, i64 0, i64 0
%46 = load i32, i32* %45
%47 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %6, i64 0, i64 0
%48 = getelementptr inbounds [2 x i32], [2 x i32]* %47, i64 0, i64 1
%49 = load i32, i32* %48
%50 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %6, i64 0, i64 1
%51 = getelementptr inbounds [2 x i32], [2 x i32]* %50, i64 0, i64 0
%52 = load i32, i32* %51
%53 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %6, i64 0, i64 1
%54 = getelementptr inbounds [2 x i32], [2 x i32]* %53, i64 0, i64 1
%55 = load i32, i32* %54
%56 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %6, i64 0, i64 2
%57 = getelementptr inbounds [2 x i32], [2 x i32]* %56, i64 0, i64 0
%58 = load i32, i32* %57
%59 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %6, i64 0, i64 2
%60 = getelementptr inbounds [2 x i32], [2 x i32]* %59, i64 0, i64 1
%61 = load i32, i32* %60
%62 = call double @line(i32 %46, i32 %49, i32 %52, i32 %55, i32 %58, i32 %61)
%63 = load i32, i32* %5
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds double, double* %21, i64 %64
store double %62, double* %65
%66 = load i32, i32* %5
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds double, double* %21, i64 %67
%69 = load double, double* %68
%70 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %69)
br label %71
71: ; preds = %43
%72 = load i32, i32* %5
%73 = add nsw i32 %72, 1
store i32 %73, i32* %5
br label %22
74: ; preds = %22
store i32 0, i32* %1
%75 = load i8*, i8** %3
br label %76
76: ; preds = %74, %15
%77 = load i32, i32* %1
ret i32 %77
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [7 x i8] c"%4.3f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x [2 x i32]]
%3 = bitcast i32* %1 to i8*
%4 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
%7 = load i32, i32* %1
%8 = icmp ne i32 %7, 0
%9 = select i1 %6, i1 %8, i1 false
br i1 %9, label %10, label %39
10: ; preds = %0
%11 = call i8* @llvm.stacksave()
%12 = load i32, i32* %1
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %22
14: ; preds = %10
%15 = bitcast [3 x [2 x i32]]* %2 to i8*
%16 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %2, i64 0, i64 0, i64 0
%17 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %2, i64 0, i64 0, i64 1
%18 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %2, i64 0, i64 1, i64 0
%19 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %2, i64 0, i64 1, i64 1
%20 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %2, i64 0, i64 2, i64 0
%21 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %2, i64 0, i64 2, i64 1
br label %23
22: ; preds = %23, %10
br label %39
23: ; preds = %14, %23
%24 = phi i32 [ 0, %14 ], [ %36, %23 ]
%25 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %16, i32* %17)
%26 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %18, i32* %19)
%27 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %20, i32* %21)
%28 = load i32, i32* %16
%29 = load i32, i32* %17
%30 = load i32, i32* %18
%31 = load i32, i32* %19
%32 = load i32, i32* %20
%33 = load i32, i32* %21
%34 = call double @line(i32 %28, i32 %29, i32 %30, i32 %31, i32 %32, i32 %33)
%35 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %34)
%36 = add nuw nsw i32 %24, 1
%37 = load i32, i32* %1
%38 = icmp slt i32 %36, %37
br i1 %38, label %23, label %22
39: ; preds = %0, %22
ret i32 0
}