#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_HoriR_valid(double *us, int *idx) {
  double p[3], q[3];
  double *a, *b, *c, *d, ori;
  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);
  ori = (p[0] * c[0] + p[1] * c[1] + p[2] * c[2]) *
        (q[0] * c[3] + q[1] * c[4] + q[2] * c[5]);
  if (ori * (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 (ori * (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 (ori * (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_HoriR_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%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),%xmm1
mov    -0x68(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x28(%rbp),%xmm0
mov    -0x68(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mov    -0x68(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x50(%rbp),%xmm2
mov    -0x68(%rbp),%rax
movsd  0x18(%rax),%xmm3
movsd  -0x48(%rbp),%xmm1
mov    -0x68(%rbp),%rax
mulsd  0x20(%rax),%xmm1
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x40(%rbp),%xmm1
mov    -0x68(%rbp),%rax
movsd  0x28(%rax),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
mov    -0x70(%rbp),%rax
movsd  (%rax),%xmm3
movsd  -0x28(%rbp),%xmm0
mov    -0x70(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
mov    -0x70(%rbp),%rax
movsd  0x10(%rax),%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
mulsd  %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    12d3 <all_HoriR_valid+0x1c3>
movl   $0x0,-0x4(%rbp)
jmp    1440 <all_HoriR_valid+0x330>
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  -0x78(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
mov    -0x58(%rbp),%rax
movsd  (%rax),%xmm3
movsd  -0x28(%rbp),%xmm0
mov    -0x58(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
mov    -0x58(%rbp),%rax
movsd  0x10(%rax),%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
mulsd  %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    13a0 <all_HoriR_valid+0x290>
movl   $0x0,-0x4(%rbp)
jmp    1440 <all_HoriR_valid+0x330>
movsd  -0x78(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
mov    -0x60(%rbp),%rax
movsd  (%rax),%xmm3
movsd  -0x28(%rbp),%xmm0
mov    -0x60(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
mov    -0x60(%rbp),%rax
movsd  0x10(%rax),%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
mulsd  %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    1439 <all_HoriR_valid+0x329>
movl   $0x0,-0x4(%rbp)
jmp    1440 <all_HoriR_valid+0x330>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_HoriR_valid>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rdi,%rbx
movslq (%rsi),%rax
lea    (%rax,%rax,2),%r13
shl    $0x4,%r13
lea    (%rdi,%r13,1),%r15
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),%r12
shl    $0x4,%r12
movslq 0xc(%rsi),%rax
lea    (%rax,%rax,2),%r14
shl    $0x4,%r14
lea    0x20(%rsp),%rdi
mov    %r15,%rsi
mov    %rdx,0x38(%rsp)
mov    $0x1,%ecx
call   1030 <crossprod_st@plt>
lea    (%rbx,%r13,1),%rsi
add    $0x18,%rsi
lea    (%rbx,%rbp,1),%rdx
add    $0x18,%rdx
mov    %rsp,%rdi
mov    $0x1,%ecx
call   1030 <crossprod_st@plt>
movsd  0x20(%rsp),%xmm3
movsd  0x28(%rsp),%xmm4
movsd  0x30(%rsp),%xmm0
movsd  (%rsp),%xmm1
movsd  0x8(%rsp),%xmm8
movapd %xmm4,%xmm5
unpcklpd %xmm8,%xmm5
movsd  (%rbx,%r12,1),%xmm6
movsd  0x8(%rbx,%r12,1),%xmm7
movsd  0x10(%rbx,%r12,1),%xmm2
movhpd 0x20(%rbx,%r12,1),%xmm7
mulpd  %xmm5,%xmm7
movapd %xmm3,%xmm5
unpcklpd %xmm1,%xmm5
movhpd 0x18(%rbx,%r12,1),%xmm6
mulpd  %xmm5,%xmm6
addpd  %xmm7,%xmm6
movsd  0x10(%rsp),%xmm5
movapd %xmm0,%xmm7
unpcklpd %xmm5,%xmm7
movhpd 0x28(%rbx,%r12,1),%xmm2
mulpd  %xmm7,%xmm2
addpd  %xmm6,%xmm2
movapd %xmm2,%xmm6
unpckhpd %xmm2,%xmm6
mulsd  %xmm2,%xmm6
mulsd  0x8(%rbx,%r14,1),%xmm4
mulsd  (%rbx,%r14,1),%xmm3
mulsd  0x10(%rbx,%r14,1),%xmm0
addsd  %xmm4,%xmm3
addsd  %xmm3,%xmm0
mulsd  0x20(%rbx,%r14,1),%xmm8
mulsd  %xmm6,%xmm0
mulsd  0x18(%rbx,%r14,1),%xmm1
addsd  %xmm8,%xmm1
mulsd  0x28(%rbx,%r14,1),%xmm5
addsd  %xmm1,%xmm5
mulsd  %xmm0,%xmm5
xor    %r13d,%r13d
xorpd  %xmm0,%xmm0
ucomisd %xmm5,%xmm0
ja     1378 <all_HoriR_valid+0x268>
lea    (%rbx,%r12,1),%rsi
lea    (%rbx,%r14,1),%rdx
add    %rbx,%r12
add    $0x18,%r12
lea    0x18(%rbx,%r14,1),%rbx
lea    0x20(%rsp),%rdi
mov    $0x1,%ecx
movapd %xmm6,0x40(%rsp)
call   1030 <crossprod_st@plt>
mov    %rsp,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    $0x1,%ecx
call   1030 <crossprod_st@plt>
movapd 0x40(%rsp),%xmm9
movsd  0x20(%rsp),%xmm0
movsd  0x28(%rsp),%xmm8
movsd  0x8(%r15),%xmm1
mulsd  %xmm8,%xmm1
movsd  (%r15),%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm1,%xmm3
movsd  0x30(%rsp),%xmm1
movsd  0x10(%r15),%xmm6
mulsd  %xmm1,%xmm6
addsd  %xmm3,%xmm6
mulsd  %xmm9,%xmm6
movsd  (%rsp),%xmm3
movsd  0x8(%rsp),%xmm4
movsd  0x20(%r15),%xmm5
mulsd  %xmm4,%xmm5
movsd  0x18(%r15),%xmm7
mulsd  %xmm3,%xmm7
addsd  %xmm5,%xmm7
movsd  0x10(%rsp),%xmm5
movsd  0x28(%r15),%xmm2
mulsd  %xmm5,%xmm2
addsd  %xmm7,%xmm2
mulsd  %xmm6,%xmm2
xorpd  %xmm6,%xmm6
ucomisd %xmm2,%xmm6
ja     1378 <all_HoriR_valid+0x268>
mov    0x38(%rsp),%rax
mulsd  0x8(%rax),%xmm8
mulsd  (%rax),%xmm0
addsd  %xmm8,%xmm0
mulsd  0x10(%rax),%xmm1
addsd  %xmm0,%xmm1
mulsd  0x20(%rax),%xmm4
mulsd  0x18(%rax),%xmm3
mulsd  %xmm1,%xmm9
addsd  %xmm4,%xmm3
mulsd  0x28(%rax),%xmm5
addsd  %xmm3,%xmm5
mulsd  %xmm9,%xmm5
xorpd  %xmm0,%xmm0
xor    %r13d,%r13d
ucomisd %xmm5,%xmm0
setbe  %r13b
mov    %r13d,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @all_HoriR_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 = load double, double* %26
%33 = load double, double* %20
%34 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 1
%35 = load double, double* %34
%36 = getelementptr inbounds double, double* %20, i64 1
%37 = load double, double* %36
%38 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 2
%39 = load double, double* %38
%40 = getelementptr inbounds double, double* %20, i64 2
%41 = load double, double* %40
%42 = load double, double* %28
%43 = getelementptr inbounds double, double* %20, i64 3
%44 = load double, double* %43
%45 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 1
%46 = load double, double* %45
%47 = getelementptr inbounds double, double* %20, i64 4
%48 = load double, double* %47
%49 = insertelement <2 x double> poison, double %35, i64 0
%50 = insertelement <2 x double> %49, double %46, i64 1
%51 = insertelement <2 x double> poison, double %37, i64 0
%52 = insertelement <2 x double> %51, double %48, i64 1
%53 = fmul <2 x double> %50, %52
%54 = insertelement <2 x double> poison, double %32, i64 0
%55 = insertelement <2 x double> %54, double %42, i64 1
%56 = insertelement <2 x double> poison, double %33, i64 0
%57 = insertelement <2 x double> %56, double %44, i64 1
%58 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %55, <2 x double> %57, <2 x double> %53)
%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 %39, i64 0
%64 = insertelement <2 x double> %63, double %60, i64 1
%65 = insertelement <2 x double> poison, double %41, 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 = load double, double* %25
%72 = getelementptr inbounds double, double* %25, i64 1
%73 = load double, double* %72
%74 = fmul double %35, %73
%75 = call double @llvm.fmuladd.f64(double %32, double %71, double %74)
%76 = getelementptr inbounds double, double* %25, i64 2
%77 = load double, double* %76
%78 = call double @llvm.fmuladd.f64(double %39, double %77, double %75)
%79 = fmul double %70, %78
%80 = getelementptr inbounds double, double* %25, i64 3
%81 = load double, double* %80
%82 = getelementptr inbounds double, double* %25, i64 4
%83 = load double, double* %82
%84 = fmul double %46, %83
%85 = call double @llvm.fmuladd.f64(double %42, double %81, double %84)
%86 = getelementptr inbounds double, double* %25, i64 5
%87 = load double, double* %86
%88 = call double @llvm.fmuladd.f64(double %60, double %87, double %85)
%89 = fmul double %79, %88
%90 = fcmp olt double %89, 0.000000e+00
br i1 %90, label %140, label %91
91: ; preds = %2
%92 = call i32 @crossprod_st(double* %26, double* %20, double* %25, i32 1)
%93 = call i32 @crossprod_st(double* %28, double* %43, double* %80, i32 1)
%94 = load double, double* %26
%95 = load double, double* %10
%96 = load double, double* %34
%97 = getelementptr inbounds double, double* %10, i64 1
%98 = load double, double* %97
%99 = fmul double %96, %98
%100 = call double @llvm.fmuladd.f64(double %94, double %95, double %99)
%101 = load double, double* %38
%102 = getelementptr inbounds double, double* %10, i64 2
%103 = load double, double* %102
%104 = call double @llvm.fmuladd.f64(double %101, double %103, double %100)
%105 = fmul double %70, %104
%106 = load double, double* %28
%107 = load double, double* %29
%108 = load double, double* %45
%109 = getelementptr inbounds double, double* %10, i64 4
%110 = load double, double* %109
%111 = fmul double %108, %110
%112 = call double @llvm.fmuladd.f64(double %106, double %107, double %111)
%113 = load double, double* %59
%114 = getelementptr inbounds double, double* %10, i64 5
%115 = load double, double* %114
%116 = call double @llvm.fmuladd.f64(double %113, double %115, double %112)
%117 = fmul double %105, %116
%118 = fcmp olt double %117, 0.000000e+00
br i1 %118, label %140, label %119
119: ; preds = %91
%120 = load double, double* %15
%121 = getelementptr inbounds double, double* %15, i64 1
%122 = load double, double* %121
%123 = fmul double %96, %122
%124 = call double @llvm.fmuladd.f64(double %94, double %120, double %123)
%125 = getelementptr inbounds double, double* %15, i64 2
%126 = load double, double* %125
%127 = call double @llvm.fmuladd.f64(double %101, double %126, double %124)
%128 = fmul double %70, %127
%129 = load double, double* %30
%130 = getelementptr inbounds double, double* %15, i64 4
%131 = load double, double* %130
%132 = fmul double %108, %131
%133 = call double @llvm.fmuladd.f64(double %106, double %129, double %132)
%134 = getelementptr inbounds double, double* %15, i64 5
%135 = load double, double* %134
%136 = call double @llvm.fmuladd.f64(double %113, double %135, double %133)
%137 = fmul double %128, %136
%138 = fcmp uge double %137, 0.000000e+00
%139 = zext i1 %138 to i32
br label %140
140: ; preds = %119, %91, %2
%141 = phi i32 [ 0, %2 ], [ 0, %91 ], [ %139, %119 ]
ret i32 %141
}