#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*/ crossprod_st(double *, double *, double *, int);
int all_Hori_valid(double *us, int *idx) {
  double p[3], q[3];
  double *a, *b, *c, *d;
  a = us + 6 * idx[0];
  b = us + 6 * idx[1];
  c = us + 6 * idx[2];
  d = us + 6 * idx[3];
  crossprod_st(p, a, b, 1);
  crossprod_st(q, a + 3, b + 3, 1);
  if ((p[0] * c[0] + p[1] * c[1] + p[2] * c[2]) *
          (q[0] * c[3] + q[1] * c[4] + q[2] * c[5]) <
      0)
    return 0;
  if ((p[0] * d[0] + p[1] * d[1] + p[2] * d[2]) *
          (q[0] * d[3] + q[1] * d[4] + q[2] * d[5]) <
      0)
    return 0;
  crossprod_st(p, c, d, 1);
  crossprod_st(q, c + 3, d + 3, 1);
  if ((p[0] * a[0] + p[1] * a[1] + p[2] * a[2]) *
          (q[0] * a[3] + q[1] * a[4] + q[2] * a[5]) <
      0)
    return 0;
  if ((p[0] * b[0] + p[1] * b[1] + p[2] * b[2]) *
          (q[0] * b[3] + q[1] * b[4] + q[2] * b[5]) <
      0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<all_Hori_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
imul   $0x6,(%rcx),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
imul   $0x6,0x4(%rcx),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
imul   $0x6,0x8(%rcx),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x68(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
imul   $0x6,0xc(%rcx),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x70(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x60(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <crossprod_st@plt>
lea    -0x50(%rbp),%rdi
mov    -0x58(%rbp),%rsi
add    $0x18,%rsi
mov    -0x60(%rbp),%rdx
add    $0x18,%rdx
mov    $0x1,%ecx
call   1030 <crossprod_st@plt>
movsd  -0x30(%rbp),%xmm0
mov    -0x68(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x28(%rbp),%xmm1
mov    -0x68(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mov    -0x68(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm2
mov    -0x68(%rbp),%rax
movsd  0x18(%rax),%xmm3
movsd  -0x48(%rbp),%xmm0
mov    -0x68(%rbp),%rax
mulsd  0x20(%rax),%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
movsd  -0x40(%rbp),%xmm0
mov    -0x68(%rbp),%rax
movsd  0x28(%rax),%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    124b <all_Hori_valid+0x13b>
movl   $0x0,-0x4(%rbp)
jmp    1436 <all_Hori_valid+0x326>
movsd  -0x30(%rbp),%xmm0
mov    -0x70(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x28(%rbp),%xmm1
mov    -0x70(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mov    -0x70(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm2
mov    -0x70(%rbp),%rax
movsd  0x18(%rax),%xmm3
movsd  -0x48(%rbp),%xmm0
mov    -0x70(%rbp),%rax
mulsd  0x20(%rax),%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
movsd  -0x40(%rbp),%xmm0
mov    -0x70(%rbp),%rax
movsd  0x28(%rax),%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    12db <all_Hori_valid+0x1cb>
movl   $0x0,-0x4(%rbp)
jmp    1436 <all_Hori_valid+0x326>
lea    -0x30(%rbp),%rdi
mov    -0x68(%rbp),%rsi
mov    -0x70(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <crossprod_st@plt>
lea    -0x50(%rbp),%rdi
mov    -0x68(%rbp),%rsi
add    $0x18,%rsi
mov    -0x70(%rbp),%rdx
add    $0x18,%rdx
mov    $0x1,%ecx
call   1030 <crossprod_st@plt>
movsd  -0x30(%rbp),%xmm0
mov    -0x58(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x28(%rbp),%xmm1
mov    -0x58(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mov    -0x58(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm2
mov    -0x58(%rbp),%rax
movsd  0x18(%rax),%xmm3
movsd  -0x48(%rbp),%xmm0
mov    -0x58(%rbp),%rax
mulsd  0x20(%rax),%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
movsd  -0x40(%rbp),%xmm0
mov    -0x58(%rbp),%rax
movsd  0x28(%rax),%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    139f <all_Hori_valid+0x28f>
movl   $0x0,-0x4(%rbp)
jmp    1436 <all_Hori_valid+0x326>
movsd  -0x30(%rbp),%xmm0
mov    -0x60(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x28(%rbp),%xmm1
mov    -0x60(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mov    -0x60(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm2
mov    -0x60(%rbp),%rax
movsd  0x18(%rax),%xmm3
movsd  -0x48(%rbp),%xmm0
mov    -0x60(%rbp),%rax
mulsd  0x20(%rax),%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
movsd  -0x40(%rbp),%xmm0
mov    -0x60(%rbp),%rax
movsd  0x28(%rax),%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    142f <all_Hori_valid+0x31f>
movl   $0x0,-0x4(%rbp)
jmp    1436 <all_Hori_valid+0x326>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_Hori_valid>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rdi,%r15
movslq (%rsi),%rax
lea    (%rax,%rax,2),%rbx
shl    $0x4,%rbx
lea    (%rdi,%rbx,1),%r13
movslq 0x4(%rsi),%rax
lea    (%rax,%rax,2),%rbp
shl    $0x4,%rbp
lea    (%rdi,%rbp,1),%rdx
movslq 0x8(%rsi),%rax
lea    (%rax,%rax,2),%r14
shl    $0x4,%r14
movslq 0xc(%rsi),%r12
lea    0x20(%rsp),%rdi
mov    %r13,%rsi
mov    %rdx,0x40(%rsp)
mov    $0x1,%ecx
call   1030 <crossprod_st@plt>
lea    (%r15,%rbx,1),%rsi
add    $0x18,%rsi
lea    (%r15,%rbp,1),%rdx
add    $0x18,%rdx
mov    %rsp,%rdi
mov    $0x1,%ecx
call   1030 <crossprod_st@plt>
movapd 0x20(%rsp),%xmm0
movupd 0x28(%rsp),%xmm1
movhpd 0x8(%rsp),%xmm1
movsd  (%r15,%r14,1),%xmm3
movsd  0x8(%r15,%r14,1),%xmm2
movsd  0x10(%r15,%r14,1),%xmm4
movhpd 0x20(%r15,%r14,1),%xmm2
movhpd (%rsp),%xmm0
movhpd 0x18(%r15,%r14,1),%xmm3
mulpd  %xmm1,%xmm2
mulpd  %xmm0,%xmm3
addpd  %xmm2,%xmm3
movsd  0x30(%rsp),%xmm2
movhpd 0x10(%rsp),%xmm2
movhpd 0x28(%r15,%r14,1),%xmm4
mulpd  %xmm2,%xmm4
addpd  %xmm3,%xmm4
movapd %xmm4,%xmm5
unpckhpd %xmm4,%xmm5
mulsd  %xmm4,%xmm5
xor    %ebx,%ebx
xorpd  %xmm3,%xmm3
ucomisd %xmm5,%xmm3
ja     1340 <all_Hori_valid+0x230>
lea    (%r12,%r12,2),%rdx
shl    $0x4,%rdx
add    %r15,%rdx
movsd  (%rdx),%xmm4
movsd  0x8(%rdx),%xmm5
movsd  0x10(%rdx),%xmm6
movhpd 0x20(%rdx),%xmm5
mulpd  %xmm5,%xmm1
movhpd 0x18(%rdx),%xmm4
mulpd  %xmm4,%xmm0
addpd  %xmm1,%xmm0
movhpd 0x28(%rdx),%xmm6
mulpd  %xmm6,%xmm2
addpd  %xmm0,%xmm2
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
ucomisd %xmm0,%xmm3
ja     1340 <all_Hori_valid+0x230>
lea    (%r15,%r14,1),%rsi
lea    (%r15,%r14,1),%rbp
add    $0x18,%rbp
lea    0x18(%rdx),%r12
lea    0x20(%rsp),%rdi
mov    $0x1,%ecx
call   1030 <crossprod_st@plt>
mov    %rsp,%rdi
mov    %rbp,%rsi
mov    %r12,%rdx
mov    $0x1,%ecx
call   1030 <crossprod_st@plt>
movapd 0x20(%rsp),%xmm0
movupd 0x28(%rsp),%xmm1
movhpd 0x8(%rsp),%xmm1
movsd  0x0(%r13),%xmm3
movsd  0x8(%r13),%xmm4
movhpd 0x20(%r13),%xmm4
movsd  0x10(%r13),%xmm5
mulpd  %xmm1,%xmm4
movhpd (%rsp),%xmm0
movhpd 0x18(%r13),%xmm3
mulpd  %xmm0,%xmm3
movsd  0x30(%rsp),%xmm2
movhpd 0x10(%rsp),%xmm2
movhpd 0x28(%r13),%xmm5
addpd  %xmm4,%xmm3
mulpd  %xmm2,%xmm5
addpd  %xmm3,%xmm5
movapd %xmm5,%xmm4
unpckhpd %xmm5,%xmm4
mulsd  %xmm5,%xmm4
xorpd  %xmm3,%xmm3
ucomisd %xmm4,%xmm3
ja     1340 <all_Hori_valid+0x230>
mov    0x40(%rsp),%rax
movsd  (%rax),%xmm4
movsd  0x8(%rax),%xmm5
movsd  0x10(%rax),%xmm6
movhpd 0x20(%rax),%xmm5
mulpd  %xmm5,%xmm1
movhpd 0x18(%rax),%xmm4
mulpd  %xmm4,%xmm0
addpd  %xmm1,%xmm0
movhpd 0x28(%rax),%xmm6
mulpd  %xmm6,%xmm2
addpd  %xmm0,%xmm2
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
xor    %ebx,%ebx
ucomisd %xmm0,%xmm3
setbe  %bl
mov    %ebx,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @all_Hori_valid(double* %0, i32* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32*
%6 = alloca [3 x double]
%7 = alloca [3 x double]
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
store double* %0, double** %4
store i32* %1, i32** %5
%12 = load double*, double** %4
%13 = load i32*, i32** %5
%14 = getelementptr inbounds i32, i32* %13, i64 0
%15 = load i32, i32* %14
%16 = mul nsw i32 6, %15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %12, i64 %17
store double* %18, double** %8
%19 = load double*, double** %4
%20 = load i32*, i32** %5
%21 = getelementptr inbounds i32, i32* %20, i64 1
%22 = load i32, i32* %21
%23 = mul nsw i32 6, %22
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double, double* %19, i64 %24
store double* %25, double** %9
%26 = load double*, double** %4
%27 = load i32*, i32** %5
%28 = getelementptr inbounds i32, i32* %27, i64 2
%29 = load i32, i32* %28
%30 = mul nsw i32 6, %29
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds double, double* %26, i64 %31
store double* %32, double** %10
%33 = load double*, double** %4
%34 = load i32*, i32** %5
%35 = getelementptr inbounds i32, i32* %34, i64 3
%36 = load i32, i32* %35
%37 = mul nsw i32 6, %36
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds double, double* %33, i64 %38
store double* %39, double** %11
%40 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%41 = load double*, double** %8
%42 = load double*, double** %9
%43 = call i32 @crossprod_st(double* %40, double* %41, double* %42, i32 1)
%44 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%45 = load double*, double** %8
%46 = getelementptr inbounds double, double* %45, i64 3
%47 = load double*, double** %9
%48 = getelementptr inbounds double, double* %47, i64 3
%49 = call i32 @crossprod_st(double* %44, double* %46, double* %48, i32 1)
%50 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%51 = load double, double* %50
%52 = load double*, double** %10
%53 = getelementptr inbounds double, double* %52, i64 0
%54 = load double, double* %53
%55 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 1
%56 = load double, double* %55
%57 = load double*, double** %10
%58 = getelementptr inbounds double, double* %57, i64 1
%59 = load double, double* %58
%60 = fmul double %56, %59
%61 = call double @llvm.fmuladd.f64(double %51, double %54, double %60)
%62 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 2
%63 = load double, double* %62
%64 = load double*, double** %10
%65 = getelementptr inbounds double, double* %64, i64 2
%66 = load double, double* %65
%67 = call double @llvm.fmuladd.f64(double %63, double %66, double %61)
%68 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%69 = load double, double* %68
%70 = load double*, double** %10
%71 = getelementptr inbounds double, double* %70, i64 3
%72 = load double, double* %71
%73 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
%74 = load double, double* %73
%75 = load double*, double** %10
%76 = getelementptr inbounds double, double* %75, i64 4
%77 = load double, double* %76
%78 = fmul double %74, %77
%79 = call double @llvm.fmuladd.f64(double %69, double %72, double %78)
%80 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 2
%81 = load double, double* %80
%82 = load double*, double** %10
%83 = getelementptr inbounds double, double* %82, i64 5
%84 = load double, double* %83
%85 = call double @llvm.fmuladd.f64(double %81, double %84, double %79)
%86 = fmul double %67, %85
%87 = fcmp olt double %86, 0.000000e+00
br i1 %87, label %88, label %89
88: ; preds = %2
store i32 0, i32* %3
br label %220
89: ; preds = %2
%90 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%91 = load double, double* %90
%92 = load double*, double** %11
%93 = getelementptr inbounds double, double* %92, i64 0
%94 = load double, double* %93
%95 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 1
%96 = load double, double* %95
%97 = load double*, double** %11
%98 = getelementptr inbounds double, double* %97, i64 1
%99 = load double, double* %98
%100 = fmul double %96, %99
%101 = call double @llvm.fmuladd.f64(double %91, double %94, double %100)
%102 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 2
%103 = load double, double* %102
%104 = load double*, double** %11
%105 = getelementptr inbounds double, double* %104, i64 2
%106 = load double, double* %105
%107 = call double @llvm.fmuladd.f64(double %103, double %106, double %101)
%108 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%109 = load double, double* %108
%110 = load double*, double** %11
%111 = getelementptr inbounds double, double* %110, i64 3
%112 = load double, double* %111
%113 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
%114 = load double, double* %113
%115 = load double*, double** %11
%116 = getelementptr inbounds double, double* %115, i64 4
%117 = load double, double* %116
%118 = fmul double %114, %117
%119 = call double @llvm.fmuladd.f64(double %109, double %112, double %118)
%120 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 2
%121 = load double, double* %120
%122 = load double*, double** %11
%123 = getelementptr inbounds double, double* %122, i64 5
%124 = load double, double* %123
%125 = call double @llvm.fmuladd.f64(double %121, double %124, double %119)
%126 = fmul double %107, %125
%127 = fcmp olt double %126, 0.000000e+00
br i1 %127, label %128, label %129
128: ; preds = %89
store i32 0, i32* %3
br label %220
129: ; preds = %89
%130 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%131 = load double*, double** %10
%132 = load double*, double** %11
%133 = call i32 @crossprod_st(double* %130, double* %131, double* %132, i32 1)
%134 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%135 = load double*, double** %10
%136 = getelementptr inbounds double, double* %135, i64 3
%137 = load double*, double** %11
%138 = getelementptr inbounds double, double* %137, i64 3
%139 = call i32 @crossprod_st(double* %134, double* %136, double* %138, i32 1)
%140 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%141 = load double, double* %140
%142 = load double*, double** %8
%143 = getelementptr inbounds double, double* %142, i64 0
%144 = load double, double* %143
%145 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 1
%146 = load double, double* %145
%147 = load double*, double** %8
%148 = getelementptr inbounds double, double* %147, i64 1
%149 = load double, double* %148
%150 = fmul double %146, %149
%151 = call double @llvm.fmuladd.f64(double %141, double %144, double %150)
%152 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 2
%153 = load double, double* %152
%154 = load double*, double** %8
%155 = getelementptr inbounds double, double* %154, i64 2
%156 = load double, double* %155
%157 = call double @llvm.fmuladd.f64(double %153, double %156, double %151)
%158 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%159 = load double, double* %158
%160 = load double*, double** %8
%161 = getelementptr inbounds double, double* %160, i64 3
%162 = load double, double* %161
%163 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
%164 = load double, double* %163
%165 = load double*, double** %8
%166 = getelementptr inbounds double, double* %165, i64 4
%167 = load double, double* %166
%168 = fmul double %164, %167
%169 = call double @llvm.fmuladd.f64(double %159, double %162, double %168)
%170 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 2
%171 = load double, double* %170
%172 = load double*, double** %8
%173 = getelementptr inbounds double, double* %172, i64 5
%174 = load double, double* %173
%175 = call double @llvm.fmuladd.f64(double %171, double %174, double %169)
%176 = fmul double %157, %175
%177 = fcmp olt double %176, 0.000000e+00
br i1 %177, label %178, label %179
178: ; preds = %129
store i32 0, i32* %3
br label %220
179: ; preds = %129
%180 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%181 = load double, double* %180
%182 = load double*, double** %9
%183 = getelementptr inbounds double, double* %182, i64 0
%184 = load double, double* %183
%185 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 1
%186 = load double, double* %185
%187 = load double*, double** %9
%188 = getelementptr inbounds double, double* %187, i64 1
%189 = load double, double* %188
%190 = fmul double %186, %189
%191 = call double @llvm.fmuladd.f64(double %181, double %184, double %190)
%192 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 2
%193 = load double, double* %192
%194 = load double*, double** %9
%195 = getelementptr inbounds double, double* %194, i64 2
%196 = load double, double* %195
%197 = call double @llvm.fmuladd.f64(double %193, double %196, double %191)
%198 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%199 = load double, double* %198
%200 = load double*, double** %9
%201 = getelementptr inbounds double, double* %200, i64 3
%202 = load double, double* %201
%203 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
%204 = load double, double* %203
%205 = load double*, double** %9
%206 = getelementptr inbounds double, double* %205, i64 4
%207 = load double, double* %206
%208 = fmul double %204, %207
%209 = call double @llvm.fmuladd.f64(double %199, double %202, double %208)
%210 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 2
%211 = load double, double* %210
%212 = load double*, double** %9
%213 = getelementptr inbounds double, double* %212, i64 5
%214 = load double, double* %213
%215 = call double @llvm.fmuladd.f64(double %211, double %214, double %209)
%216 = fmul double %197, %215
%217 = fcmp olt double %216, 0.000000e+00
br i1 %217, label %218, label %219
218: ; preds = %179
store i32 0, i32* %3
br label %220
219: ; preds = %179
store i32 1, i32* %3
br label %220
220: ; preds = %219, %218, %178, %128, %88
%221 = load i32, i32* %3
ret i32 %221
}

LLVM IR (-O2):
define i32 @all_Hori_valid(double* %0, i32* nocapture %1) {
%3 = alloca [3 x double]
%4 = alloca [3 x double]
%5 = bitcast [3 x double]* %3 to i8*
%6 = bitcast [3 x double]* %4 to i8*
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, 6
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds double, double* %0, i64 %9
%11 = getelementptr inbounds i32, i32* %1, i64 1
%12 = load i32, i32* %11
%13 = mul nsw i32 %12, 6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double, double* %0, i64 %14
%16 = getelementptr inbounds i32, i32* %1, i64 2
%17 = load i32, i32* %16
%18 = mul nsw i32 %17, 6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds double, double* %0, i64 %19
%21 = getelementptr inbounds i32, i32* %1, i64 3
%22 = load i32, i32* %21
%23 = mul nsw i32 %22, 6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double, double* %0, i64 %24
%26 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%27 = call i32 @crossprod_st(double* %26, double* %10, double* %15, i32 1)
%28 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%29 = getelementptr inbounds double, double* %10, i64 3
%30 = getelementptr inbounds double, double* %15, i64 3
%31 = call i32 @crossprod_st(double* %28, double* %29, double* %30, i32 1)
%32 = bitcast [3 x double]* %3 to <2 x double>*
%33 = load <2 x double>, <2 x double>* %32
%34 = load double, double* %20
%35 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 1
%36 = bitcast double* %35 to <2 x double>*
%37 = load <2 x double>, <2 x double>* %36
%38 = getelementptr inbounds double, double* %20, i64 1
%39 = load double, double* %38
%40 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 2
%41 = load double, double* %40
%42 = getelementptr inbounds double, double* %20, i64 2
%43 = load double, double* %42
%44 = load double, double* %28
%45 = getelementptr inbounds double, double* %20, i64 3
%46 = load double, double* %45
%47 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 1
%48 = load double, double* %47
%49 = getelementptr inbounds double, double* %20, i64 4
%50 = load double, double* %49
%51 = insertelement <2 x double> %37, double %48, i64 1
%52 = insertelement <2 x double> poison, double %39, i64 0
%53 = insertelement <2 x double> %52, double %50, i64 1
%54 = fmul <2 x double> %51, %53
%55 = insertelement <2 x double> %33, double %44, i64 1
%56 = insertelement <2 x double> poison, double %34, i64 0
%57 = insertelement <2 x double> %56, double %46, i64 1
%58 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %55, <2 x double> %57, <2 x double> %54)
%59 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 2
%60 = load double, double* %59
%61 = getelementptr inbounds double, double* %20, i64 5
%62 = load double, double* %61
%63 = insertelement <2 x double> poison, double %41, i64 0
%64 = insertelement <2 x double> %63, double %60, i64 1
%65 = insertelement <2 x double> poison, double %43, i64 0
%66 = insertelement <2 x double> %65, double %62, i64 1
%67 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %64, <2 x double> %66, <2 x double> %58)
%68 = shufflevector <2 x double> %67, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%69 = fmul <2 x double> %67, %68
%70 = extractelement <2 x double> %69, i64 0
%71 = fcmp olt double %70, 0.000000e+00
br i1 %71, label %160, label %72
72: ; preds = %2
%73 = load double, double* %25
%74 = getelementptr inbounds double, double* %25, i64 1
%75 = load double, double* %74
%76 = getelementptr inbounds double, double* %25, i64 2
%77 = load double, double* %76
%78 = getelementptr inbounds double, double* %25, i64 3
%79 = load double, double* %78
%80 = getelementptr inbounds double, double* %25, i64 4
%81 = load double, double* %80
%82 = insertelement <2 x double> poison, double %75, i64 0
%83 = insertelement <2 x double> %82, double %81, i64 1
%84 = fmul <2 x double> %51, %83
%85 = insertelement <2 x double> poison, double %73, i64 0
%86 = insertelement <2 x double> %85, double %79, i64 1
%87 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %55, <2 x double> %86, <2 x double> %84)
%88 = getelementptr inbounds double, double* %25, i64 5
%89 = load double, double* %88
%90 = insertelement <2 x double> poison, double %77, i64 0
%91 = insertelement <2 x double> %90, double %89, i64 1
%92 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %64, <2 x double> %91, <2 x double> %87)
%93 = shufflevector <2 x double> %92, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%94 = fmul <2 x double> %92, %93
%95 = extractelement <2 x double> %94, i64 0
%96 = fcmp olt double %95, 0.000000e+00
br i1 %96, label %160, label %97
97: ; preds = %72
%98 = call i32 @crossprod_st(double* %26, double* %20, double* %25, i32 1)
%99 = call i32 @crossprod_st(double* %28, double* %45, double* %78, i32 1)
%100 = bitcast [3 x double]* %3 to <2 x double>*
%101 = load <2 x double>, <2 x double>* %100
%102 = load double, double* %10
%103 = bitcast double* %35 to <2 x double>*
%104 = load <2 x double>, <2 x double>* %103
%105 = getelementptr inbounds double, double* %10, i64 1
%106 = load double, double* %105
%107 = load double, double* %40
%108 = getelementptr inbounds double, double* %10, i64 2
%109 = load double, double* %108
%110 = load double, double* %28
%111 = load double, double* %29
%112 = load double, double* %47
%113 = getelementptr inbounds double, double* %10, i64 4
%114 = load double, double* %113
%115 = insertelement <2 x double> %104, double %112, i64 1
%116 = insertelement <2 x double> poison, double %106, i64 0
%117 = insertelement <2 x double> %116, double %114, i64 1
%118 = fmul <2 x double> %115, %117
%119 = insertelement <2 x double> %101, double %110, i64 1
%120 = insertelement <2 x double> poison, double %102, i64 0
%121 = insertelement <2 x double> %120, double %111, i64 1
%122 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %119, <2 x double> %121, <2 x double> %118)
%123 = load double, double* %59
%124 = getelementptr inbounds double, double* %10, i64 5
%125 = load double, double* %124
%126 = insertelement <2 x double> poison, double %107, i64 0
%127 = insertelement <2 x double> %126, double %123, i64 1
%128 = insertelement <2 x double> poison, double %109, i64 0
%129 = insertelement <2 x double> %128, double %125, i64 1
%130 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %127, <2 x double> %129, <2 x double> %122)
%131 = shufflevector <2 x double> %130, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%132 = fmul <2 x double> %130, %131
%133 = extractelement <2 x double> %132, i64 0
%134 = fcmp olt double %133, 0.000000e+00
br i1 %134, label %160, label %135
135: ; preds = %97
%136 = load double, double* %15
%137 = getelementptr inbounds double, double* %15, i64 1
%138 = load double, double* %137
%139 = getelementptr inbounds double, double* %15, i64 2
%140 = load double, double* %139
%141 = load double, double* %30
%142 = getelementptr inbounds double, double* %15, i64 4
%143 = load double, double* %142
%144 = insertelement <2 x double> poison, double %138, i64 0
%145 = insertelement <2 x double> %144, double %143, i64 1
%146 = fmul <2 x double> %115, %145
%147 = insertelement <2 x double> poison, double %136, i64 0
%148 = insertelement <2 x double> %147, double %141, i64 1
%149 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %119, <2 x double> %148, <2 x double> %146)
%150 = getelementptr inbounds double, double* %15, i64 5
%151 = load double, double* %150
%152 = insertelement <2 x double> poison, double %140, i64 0
%153 = insertelement <2 x double> %152, double %151, i64 1
%154 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %127, <2 x double> %153, <2 x double> %149)
%155 = shufflevector <2 x double> %154, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%156 = fmul <2 x double> %154, %155
%157 = extractelement <2 x double> %156, i64 0
%158 = fcmp uge double %157, 0.000000e+00
%159 = zext i1 %158 to i32
br label %160
160: ; preds = %135, %97, %72, %2
%161 = phi i32 [ 0, %2 ], [ 0, %72 ], [ 0, %97 ], [ %159, %135 ]
ret i32 %161
}