#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 fabs(double);
int find_first_inter_point(double point_o[3], double view_p[3],
                           double ray_direction[3], double orig_xyz[3],
                           double dxyz[3], int r_level[3], double first_p[3]) {
  int i, j, mincomp, intersection;
  double minmax[6], t[6], mint;
  for (i = 0; i < 3; i++) {
    minmax[i * 2] = orig_xyz[i];
    minmax[i * 2 + 1] = orig_xyz[i] + dxyz[i];
  }
  for (i = 0; i < 3; i++) {
    if (fabs(ray_direction[i]) < 0.00000001) {
      t[i * 2] = 1.0E+17;
      t[i * 2 + 1] = 1.0E+17;
    } else {
      t[i * 2] = (minmax[i * 2] - view_p[i]) / ray_direction[i];
      t[i * 2 + 1] = (minmax[i * 2 + 1] - view_p[i]) / ray_direction[i];
    }
  }
  mint = 1.0E+17;
  mincomp = -1;
  for (i = 0; i < 6; i++) {
    if ((mint > t[i]) && (t[i] > 0.00000001)) {
      for (j = 0; j < 3; j++)
        first_p[j] = view_p[j] + t[i] * ray_direction[j];
      if ((first_p[0] >= minmax[0] - 0.00000001) &&
          (first_p[0] <= minmax[1] + 0.00000001) &&
          (first_p[1] >= minmax[2] - 0.00000001) &&
          (first_p[1] <= minmax[3] + 0.00000001) &&
          (first_p[2] >= minmax[4] - 0.00000001) &&
          (first_p[2] <= minmax[5] + 0.00000001)) {
        mint = t[i];
        mincomp = i;
      }
    }
  }
  if ((mincomp >= 0) && (mincomp <= 5)) {
    intersection = 1;
    for (i = 0; i < 3; i++)
      first_p[i] = view_p[i] + mint * ray_direction[i];
  } else {
    intersection = 0;
  }
  return (mincomp);
}


x86 assembly (clang, -O0):
<find_first_inter_point>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x3,-0x34(%rbp)
jge    1189 <find_first_inter_point+0x89>
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x34(%rbp),%eax
shl    $0x1,%eax
cltq
movsd  %xmm0,-0x70(%rbp,%rax,8)
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x34(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
cltq
movsd  %xmm0,-0x70(%rbp,%rax,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    112b <find_first_inter_point+0x2b>
movl   $0x0,-0x34(%rbp)
cmpl   $0x3,-0x34(%rbp)
jge    1289 <find_first_inter_point+0x189>
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movaps 0xe62(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xe4e(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11fe <find_first_inter_point+0xfe>
mov    -0x34(%rbp),%eax
shl    $0x1,%eax
cltq
movsd  0xe2c(%rip),%xmm0
movsd  %xmm0,-0xa0(%rbp,%rax,8)
ff ff
mov    -0x34(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
cltq
movsd  0xe10(%rip),%xmm0
movsd  %xmm0,-0xa0(%rbp,%rax,8)
ff ff
jmp    1276 <find_first_inter_point+0x176>
mov    -0x34(%rbp),%eax
shl    $0x1,%eax
cltq
movsd  -0x70(%rbp,%rax,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
mov    -0x34(%rbp),%eax
shl    $0x1,%eax
cltq
movsd  %xmm0,-0xa0(%rbp,%rax,8)
ff ff
mov    -0x34(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
cltq
movsd  -0x70(%rbp,%rax,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
mov    -0x34(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
cltq
movsd  %xmm0,-0xa0(%rbp,%rax,8)
ff ff
jmp    127b <find_first_inter_point+0x17b>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1190 <find_first_inter_point+0x90>
movsd  0xd6f(%rip),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movl   $0xffffffff,-0x3c(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x6,-0x34(%rbp)
jge    1443 <find_first_inter_point+0x343>
movsd  -0xa8(%rbp),%xmm0
ff
movslq -0x34(%rbp),%rax
ucomisd -0xa0(%rbp,%rax,8),%xmm0
ff ff
jbe    1430 <find_first_inter_point+0x330>
movslq -0x34(%rbp),%rax
movsd  -0xa0(%rbp,%rax,8),%xmm0
ff ff
movsd  0xd27(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1430 <find_first_inter_point+0x330>
movl   $0x0,-0x38(%rbp)
cmpl   $0x3,-0x38(%rbp)
jge    1346 <find_first_inter_point+0x246>
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movslq -0x34(%rbp),%rax
movsd  -0xa0(%rbp,%rax,8),%xmm0
ff ff
mov    -0x18(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    12f2 <find_first_inter_point+0x1f2>
mov    0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x70(%rbp),%xmm1
movsd  0xcad(%rip),%xmm2
subsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jb     142b <find_first_inter_point+0x32b>
mov    0x10(%rbp),%rax
movsd  (%rax),%xmm1
movsd  0xc8f(%rip),%xmm0
addsd  -0x68(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     142b <find_first_inter_point+0x32b>
mov    0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x60(%rbp),%xmm1
movsd  0xc6a(%rip),%xmm2
subsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jb     142b <find_first_inter_point+0x32b>
mov    0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
movsd  0xc4b(%rip),%xmm0
addsd  -0x58(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     142b <find_first_inter_point+0x32b>
mov    0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  0xc26(%rip),%xmm2
subsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jb     142b <find_first_inter_point+0x32b>
mov    0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
movsd  0xc07(%rip),%xmm0
addsd  -0x48(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     142b <find_first_inter_point+0x32b>
movslq -0x34(%rbp),%rax
movsd  -0xa0(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0x34(%rbp),%eax
mov    %eax,-0x3c(%rbp)
jmp    1430 <find_first_inter_point+0x330>
jmp    1435 <find_first_inter_point+0x335>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    12a7 <find_first_inter_point+0x1a7>
cmpl   $0x0,-0x3c(%rbp)
jl     14b9 <find_first_inter_point+0x3b9>
cmpl   $0x5,-0x3c(%rbp)
jg     14b9 <find_first_inter_point+0x3b9>
movl   $0x1,-0x40(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x3,-0x34(%rbp)
jge    14b4 <find_first_inter_point+0x3b4>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1465 <find_first_inter_point+0x365>
jmp    14c0 <find_first_inter_point+0x3c0>
movl   $0x0,-0x40(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_first_inter_point>:
movsd  (%rcx),%xmm0
movsd  0x8(%rcx),%xmm10
movsd  (%r8),%xmm2
addsd  %xmm0,%xmm2
movsd  0x10(%rcx),%xmm8
movsd  (%rdx),%xmm5
movapd 0xedb(%rip),%xmm1
andpd  %xmm5,%xmm1
movapd 0xedf(%rip),%xmm3
movsd  0xee7(%rip),%xmm4
ucomisd %xmm1,%xmm4
movapd %xmm3,%xmm7
ja     115f <find_first_inter_point+0x5f>
movapd %xmm0,%xmm7
unpcklpd %xmm2,%xmm7
movsd  (%rsi),%xmm1
unpcklpd %xmm1,%xmm1
subpd  %xmm1,%xmm7
unpcklpd %xmm5,%xmm5
divpd  %xmm5,%xmm7
movsd  0x8(%r8),%xmm11
addsd  %xmm10,%xmm11
movsd  0x10(%r8),%xmm9
addsd  %xmm8,%xmm9
movapd %xmm7,-0x38(%rsp)
movsd  0x8(%rdx),%xmm1
movapd 0xe78(%rip),%xmm5
andpd  %xmm1,%xmm5
ucomisd %xmm5,%xmm4
movapd %xmm3,%xmm5
ja     11b5 <find_first_inter_point+0xb5>
movapd %xmm10,%xmm5
unpcklpd %xmm11,%xmm5
movsd  0x8(%rsi),%xmm6
unpcklpd %xmm6,%xmm6
subpd  %xmm6,%xmm5
unpcklpd %xmm1,%xmm1
divpd  %xmm1,%xmm5
movapd %xmm5,-0x28(%rsp)
movsd  0x10(%rdx),%xmm1
movapd 0xe38(%rip),%xmm5
andpd  %xmm1,%xmm5
ucomisd %xmm5,%xmm4
ja     11f1 <find_first_inter_point+0xf1>
movapd %xmm8,%xmm3
unpcklpd %xmm9,%xmm3
movsd  0x10(%rsi),%xmm5
unpcklpd %xmm5,%xmm5
subpd  %xmm5,%xmm3
unpcklpd %xmm1,%xmm1
divpd  %xmm1,%xmm3
mov    0x8(%rsp),%r8
movapd %xmm3,-0x18(%rsp)
movsd  0xe24(%rip),%xmm1
addsd  %xmm1,%xmm0
addsd  %xmm4,%xmm2
addsd  %xmm1,%xmm10
addsd  %xmm4,%xmm11
addsd  %xmm1,%xmm8
addsd  %xmm4,%xmm9
mov    $0xffffffff,%eax
movsd  0xe03(%rip),%xmm3
xor    %edi,%edi
ucomisd %xmm7,%xmm3
jbe    12c0 <find_first_inter_point+0x1c0>
nopl   0x0(%rax)
ucomisd %xmm4,%xmm7
jbe    12c0 <find_first_inter_point+0x1c0>
movsd  (%rdx),%xmm1
mulsd  %xmm7,%xmm1
addsd  (%rsi),%xmm1
movsd  %xmm1,(%r8)
movsd  0x8(%rdx),%xmm6
mulsd  %xmm7,%xmm6
addsd  0x8(%rsi),%xmm6
movsd  %xmm6,0x8(%r8)
movsd  0x10(%rdx),%xmm5
mulsd  %xmm7,%xmm5
addsd  0x10(%rsi),%xmm5
movsd  %xmm5,0x10(%r8)
ucomisd %xmm0,%xmm1
jb     12c0 <find_first_inter_point+0x1c0>
ucomisd %xmm1,%xmm2
jb     12c0 <find_first_inter_point+0x1c0>
ucomisd %xmm10,%xmm6
jb     12c0 <find_first_inter_point+0x1c0>
ucomisd %xmm6,%xmm11
jb     12c0 <find_first_inter_point+0x1c0>
ucomisd %xmm8,%xmm5
setb   %r9b
ucomisd %xmm5,%xmm9
setb   %cl
or     %r9b,%cl
cmove  %edi,%eax
jne    12c0 <find_first_inter_point+0x1c0>
movapd %xmm7,%xmm3
cs nopw 0x0(%rax,%rax,1)
cmp    $0x5,%rdi
je     12dc <find_first_inter_point+0x1dc>
movsd  -0x30(%rsp,%rdi,8),%xmm7
add    $0x1,%rdi
ucomisd %xmm7,%xmm3
ja     1240 <find_first_inter_point+0x140>
jmp    12c0 <find_first_inter_point+0x1c0>
test   %eax,%eax
js     1315 <find_first_inter_point+0x215>
movsd  (%rdx),%xmm0
mulsd  %xmm3,%xmm0
addsd  (%rsi),%xmm0
movsd  %xmm0,(%r8)
movsd  0x8(%rdx),%xmm0
mulsd  %xmm3,%xmm0
addsd  0x8(%rsi),%xmm0
movsd  %xmm0,0x8(%r8)
mulsd  0x10(%rdx),%xmm3
addsd  0x10(%rsi),%xmm3
movsd  %xmm3,0x10(%r8)
ret

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

LLVM IR (-O2):
define i32 @find_first_inter_point(double* nocapture readnone %0, double* nocapture %1, double* nocapture %2, double* nocapture %3, double* nocapture %4, i32* nocapture readnone %5, double* nocapture %6) {
%8 = alloca [6 x double]
%9 = bitcast [6 x double]* %8 to i8*
%10 = load double, double* %3
%11 = load double, double* %4
%12 = fadd double %10, %11
%13 = getelementptr inbounds double, double* %3, i64 1
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %4, i64 1
%16 = load double, double* %15
%17 = fadd double %14, %16
%18 = getelementptr inbounds double, double* %3, i64 2
%19 = load double, double* %18
%20 = getelementptr inbounds double, double* %4, i64 2
%21 = load double, double* %20
%22 = fadd double %19, %21
%23 = load double, double* %2
%24 = tail call double @llvm.fabs.f64(double %23)
%25 = fcmp olt double %24, 1.000000e-08
br i1 %25, label %36, label %26
26: ; preds = %7
%27 = load double, double* %1
%28 = insertelement <2 x double> poison, double %10, i64 0
%29 = insertelement <2 x double> %28, double %12, i64 1
%30 = insertelement <2 x double> poison, double %27, i64 0
%31 = shufflevector <2 x double> %30, <2 x double> poison, <2 x i32> zeroinitializer
%32 = fsub <2 x double> %29, %31
%33 = insertelement <2 x double> poison, double %23, i64 0
%34 = shufflevector <2 x double> %33, <2 x double> poison, <2 x i32> zeroinitializer
%35 = fdiv <2 x double> %32, %34
br label %36
36: ; preds = %7, %26
%37 = phi <2 x double> [ %35, %26 ], [ <double 1.000000e+17, double 1.000000e+17>, %7 ]
%38 = bitcast [6 x double]* %8 to <2 x double>*
store <2 x double> %37, <2 x double>* %38
%39 = getelementptr inbounds double, double* %2, i64 1
%40 = load double, double* %39
%41 = tail call double @llvm.fabs.f64(double %40)
%42 = fcmp olt double %41, 1.000000e-08
br i1 %42, label %54, label %43
43: ; preds = %36
%44 = getelementptr inbounds double, double* %1, i64 1
%45 = load double, double* %44
%46 = insertelement <2 x double> poison, double %14, i64 0
%47 = insertelement <2 x double> %46, double %17, i64 1
%48 = insertelement <2 x double> poison, double %45, i64 0
%49 = shufflevector <2 x double> %48, <2 x double> poison, <2 x i32> zeroinitializer
%50 = fsub <2 x double> %47, %49
%51 = insertelement <2 x double> poison, double %40, i64 0
%52 = shufflevector <2 x double> %51, <2 x double> poison, <2 x i32> zeroinitializer
%53 = fdiv <2 x double> %50, %52
br label %54
54: ; preds = %36, %43
%55 = phi <2 x double> [ %53, %43 ], [ <double 1.000000e+17, double 1.000000e+17>, %36 ]
%56 = getelementptr inbounds [6 x double], [6 x double]* %8, i64 0, i64 2
%57 = bitcast double* %56 to <2 x double>*
store <2 x double> %55, <2 x double>* %57
%58 = getelementptr inbounds double, double* %2, i64 2
%59 = load double, double* %58
%60 = tail call double @llvm.fabs.f64(double %59)
%61 = fcmp olt double %60, 1.000000e-08
br i1 %61, label %73, label %62
62: ; preds = %54
%63 = getelementptr inbounds double, double* %1, i64 2
%64 = load double, double* %63
%65 = insertelement <2 x double> poison, double %19, i64 0
%66 = insertelement <2 x double> %65, double %22, i64 1
%67 = insertelement <2 x double> poison, double %64, i64 0
%68 = shufflevector <2 x double> %67, <2 x double> poison, <2 x i32> zeroinitializer
%69 = fsub <2 x double> %66, %68
%70 = insertelement <2 x double> poison, double %59, i64 0
%71 = shufflevector <2 x double> %70, <2 x double> poison, <2 x i32> zeroinitializer
%72 = fdiv <2 x double> %69, %71
br label %73
73: ; preds = %54, %62
%74 = phi <2 x double> [ %72, %62 ], [ <double 1.000000e+17, double 1.000000e+17>, %54 ]
%75 = getelementptr inbounds [6 x double], [6 x double]* %8, i64 0, i64 4
%76 = bitcast double* %75 to <2 x double>*
store <2 x double> %74, <2 x double>* %76
%77 = fadd double %10, -1.000000e-08
%78 = fadd double %12, 1.000000e-08
%79 = getelementptr inbounds double, double* %6, i64 1
%80 = fadd double %14, -1.000000e-08
%81 = fadd double %17, 1.000000e-08
%82 = getelementptr inbounds double, double* %6, i64 2
%83 = fadd double %19, -1.000000e-08
%84 = fadd double %22, 1.000000e-08
%85 = getelementptr inbounds double, double* %1, i64 1
%86 = getelementptr inbounds double, double* %1, i64 2
%87 = extractelement <2 x double> %37, i64 0
br label %88
88: ; preds = %125, %73
%89 = phi double [ %87, %73 ], [ %127, %125 ]
%90 = phi i64 [ 0, %73 ], [ %123, %125 ]
%91 = phi double [ 1.000000e+17, %73 ], [ %122, %125 ]
%92 = phi i32 [ -1, %73 ], [ %121, %125 ]
%93 = fcmp ogt double %91, %89
%94 = fcmp ogt double %89, 1.000000e-08
%95 = and i1 %93, %94
br i1 %95, label %96, label %120
96: ; preds = %88
%97 = load double, double* %1
%98 = load double, double* %2
%99 = tail call double @llvm.fmuladd.f64(double %89, double %98, double %97)
store double %99, double* %6
%100 = load double, double* %85
%101 = load double, double* %39
%102 = tail call double @llvm.fmuladd.f64(double %89, double %101, double %100)
store double %102, double* %79
%103 = load double, double* %86
%104 = load double, double* %58
%105 = tail call double @llvm.fmuladd.f64(double %89, double %104, double %103)
store double %105, double* %82
%106 = fcmp ult double %99, %77
%107 = fcmp ugt double %99, %78
%108 = select i1 %106, i1 true, i1 %107
br i1 %108, label %120, label %109
109: ; preds = %96
%110 = fcmp ult double %102, %80
%111 = fcmp ugt double %102, %81
%112 = select i1 %110, i1 true, i1 %111
br i1 %112, label %120, label %113
113: ; preds = %109
%114 = fcmp ult double %105, %83
%115 = fcmp ugt double %105, %84
%116 = select i1 %114, i1 true, i1 %115
%117 = trunc i64 %90 to i32
%118 = select i1 %116, i32 %92, i32 %117
%119 = select i1 %116, double %91, double %89
br label %120
120: ; preds = %113, %88, %109, %96
%121 = phi i32 [ %92, %109 ], [ %92, %96 ], [ %92, %88 ], [ %118, %113 ]
%122 = phi double [ %91, %109 ], [ %91, %96 ], [ %91, %88 ], [ %119, %113 ]
%123 = add nuw nsw i64 %90, 1
%124 = icmp eq i64 %123, 6
br i1 %124, label %128, label %125
125: ; preds = %120
%126 = getelementptr inbounds [6 x double], [6 x double]* %8, i64 0, i64 %123
%127 = load double, double* %126
br label %88
128: ; preds = %120
%129 = icmp sgt i32 %121, -1
br i1 %129, label %130, label %142
130: ; preds = %128
%131 = load double, double* %1
%132 = load double, double* %2
%133 = tail call double @llvm.fmuladd.f64(double %122, double %132, double %131)
store double %133, double* %6
%134 = getelementptr inbounds double, double* %1, i64 1
%135 = load double, double* %134
%136 = load double, double* %39
%137 = tail call double @llvm.fmuladd.f64(double %122, double %136, double %135)
store double %137, double* %79
%138 = getelementptr inbounds double, double* %1, i64 2
%139 = load double, double* %138
%140 = load double, double* %58
%141 = tail call double @llvm.fmuladd.f64(double %122, double %140, double %139)
store double %141, double* %82
br label %142
142: ; preds = %130, %128
ret i32 %121
}