#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 main(void) {
  int n, i;
  float x1, y1, x2, y2, x3, y3, x4, y4;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%f %f %f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4);
    if ((y2 - y1) * (x4 - x3) - (x2 - x1) * (y4 - y3) == 0) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1213 <main+0xf3>
lea    0xea8(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
lea    -0x20(%rbp),%r9
lea    -0x24(%rbp),%r11
lea    -0x28(%rbp),%r10
lea    -0x2c(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0x1c(%rbp),%xmm0
subss  -0x14(%rbp),%xmm0
movss  -0x28(%rbp),%xmm2
subss  -0x20(%rbp),%xmm2
movss  -0x18(%rbp),%xmm1
subss  -0x10(%rbp),%xmm1
movss  -0x2c(%rbp),%xmm3
subss  -0x24(%rbp),%xmm3
mulss  %xmm3,%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    11f4 <main+0xd4>
jp     11f4 <main+0xd4>
lea    0xe31(%rip),%rdi
call   1030 <printf@plt>
jmp    1200 <main+0xe0>
lea    0xe25(%rip),%rdi
call   1030 <printf@plt>
jmp    1205 <main+0xe5>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1148 <main+0x28>
xor    %eax,%eax
add    $0x50,%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    0xecf(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    120f <main+0xef>
lea    0x18(%rsp),%r13
lea    0x14(%rsp),%rbp
lea    0xec2(%rip),%r14
lea    0xebe(%rip),%r15
xor    %r12d,%r12d
nopw   0x0(%rax,%rax,1)
sub    $0x8,%rsp
lea    0xe8c(%rip),%rdi
lea    0x2c(%rsp),%rsi
lea    0x28(%rsp),%rdx
lea    0x24(%rsp),%rcx
mov    %r13,%r8
mov    %rbp,%r9
xor    %eax,%eax
lea    0x10(%rsp),%rbx
push   %rbx
lea    0x1c(%rsp),%rbx
push   %rbx
lea    0x28(%rsp),%rbx
push   %rbx
call   1040 <scanf@plt>
add    $0x20,%rsp
movss  0x18(%rsp),%xmm0
subss  0x20(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
subss  0x14(%rsp),%xmm1
movss  0x1c(%rsp),%xmm2
subss  0x24(%rsp),%xmm2
mulss  %xmm0,%xmm1
movss  0x8(%rsp),%xmm0
subss  0x10(%rsp),%xmm0
mulss  %xmm2,%xmm0
subss  %xmm0,%xmm1
ucomiss 0xe10(%rip),%xmm1
mov    %r15,%rdi
cmovne %r14,%rdi
cmovp  %r14,%rdi
call   1030 <puts@plt>
add    $0x1,%r12d
cmp    0x4(%rsp),%r12d
jl     1170 <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 = [24 x i8] c"%f %f %f %f %f %f %f %f\00"
@.str.2 = [5 x i8] c"YES\0A\00"
@.str.3 = [4 x i8] c"NO\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
store i32 0, i32* %1
%12 = 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 %13
13: ; preds = %40, %0
%14 = load i32, i32* %3
%15 = load i32, i32* %2
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %43
17: ; preds = %13
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), float* %4, float* %5, float* %6, float* %7, float* %8, float* %9, float* %10, float* %11)
%19 = load float, float* %7
%20 = load float, float* %5
%21 = fsub float %19, %20
%22 = load float, float* %10
%23 = load float, float* %8
%24 = fsub float %22, %23
%25 = load float, float* %6
%26 = load float, float* %4
%27 = fsub float %25, %26
%28 = load float, float* %11
%29 = load float, float* %9
%30 = fsub float %28, %29
%31 = fmul float %27, %30
%32 = fneg float %31
%33 = call float @llvm.fmuladd.f32(float %21, float %24, float %32)
%34 = fcmp oeq float %33, 0.000000e+00
br i1 %34, label %35, label %37
35: ; preds = %17
%36 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %39
37: ; preds = %17
%38 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %39
39: ; preds = %37, %35
br label %40
40: ; preds = %39
%41 = load i32, i32* %3
%42 = add nsw i32 %41, 1
store i32 %42, i32* %3
br label %13
43: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [24 x i8] c"%f %f %f %f %f %f %f %f\00"
@str = [3 x i8] c"NO\00"
@str.4 = [4 x i8] c"YES\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 = bitcast i32* %1 to i8*
%11 = bitcast float* %2 to i8*
%12 = bitcast float* %3 to i8*
%13 = bitcast float* %4 to i8*
%14 = bitcast float* %5 to i8*
%15 = bitcast float* %6 to i8*
%16 = bitcast float* %7 to i8*
%17 = bitcast float* %8 to i8*
%18 = bitcast float* %9 to i8*
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%20 = load i32, i32* %1
%21 = icmp sgt i32 %20, 0
br i1 %21, label %22, label %46
22: ; preds = %0, %22
%23 = phi i32 [ %43, %22 ], [ 0, %0 ]
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %3, float* %4, float* %5, float* %6, float* %7, float* %8, float* %9)
%25 = load float, float* %5
%26 = load float, float* %3
%27 = fsub float %25, %26
%28 = load float, float* %8
%29 = load float, float* %6
%30 = fsub float %28, %29
%31 = load float, float* %4
%32 = load float, float* %2
%33 = fsub float %31, %32
%34 = load float, float* %9
%35 = load float, float* %7
%36 = fsub float %34, %35
%37 = fneg float %33
%38 = fmul float %36, %37
%39 = call float @llvm.fmuladd.f32(float %27, float %30, float %38)
%40 = fcmp oeq float %39, 0.000000e+00
%41 = select i1 %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0)
%42 = call i32 @puts(i8* dereferenceable(1) %41)
%43 = add nuw nsw i32 %23, 1
%44 = load i32, i32* %1
%45 = icmp slt i32 %43, %44
br i1 %45, label %22, label %46
46: ; preds = %22, %0
ret i32 0
}