#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*/ HECMW_vis_print_exit(char *);
double fabs(double);
void find_projection_range2(double view_point[3], double n_f[3][3],
                            double scr_area[4]) {
  int i;
  double p[3][2];
  for (i = 0; i < 3; i++) {
    if (fabs(n_f[i][2] - view_point[2]) < 0.00000001)
      HECMW_vis_print_exit(
          "ERROR: HEC-MW-VIS-E2002: The viewpoint position is not correct");
    p[i][0] = view_point[0] - view_point[2] / (n_f[i][2] - view_point[2]) *
                                  (n_f[i][0] - view_point[0]);
    p[i][1] = view_point[1] - view_point[2] / (n_f[i][2] - view_point[2]) *
                                  (n_f[i][1] - view_point[1]);
  }
  scr_area[0] = scr_area[1] = p[0][0];
  scr_area[2] = scr_area[3] = p[0][1];
  for (i = 0; i < 3; i++) {
    if (p[i][0] < scr_area[0])
      scr_area[0] = p[i][0];
    if (p[i][0] > scr_area[1])
      scr_area[1] = p[i][0];
    if (p[i][1] < scr_area[2])
      scr_area[2] = p[i][1];
    if (p[i][1] > scr_area[3])
      scr_area[3] = p[i][1];
  }
  return;
}


x86 assembly (clang, -O0):
<find_projection_range2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    128b <find_projection_range2+0x17b>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  0x10(%rax),%xmm1
mov    -0x8(%rbp),%rax
subsd  0x10(%rax),%xmm1
movaps 0xeb7(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xe9b(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    117b <find_projection_range2+0x6b>
lea    0xeaa(%rip),%rdi
call   1030 <HECMW_vis_print_exit@plt>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  0x10(%rax),%xmm2
mov    -0x8(%rbp),%rax
subsd  0x10(%rax),%xmm2
divsd  %xmm2,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movslq -0x1c(%rbp),%rcx
lea    -0x50(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  0x10(%rax),%xmm2
mov    -0x8(%rbp),%rax
subsd  0x10(%rax),%xmm2
divsd  %xmm2,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  0x8(%rax),%xmm2
mov    -0x8(%rbp),%rax
subsd  0x8(%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movslq -0x1c(%rbp),%rcx
lea    -0x50(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movsd  %xmm0,0x8(%rax)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112b <find_projection_range2+0x1b>
movsd  -0x50(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x48(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    13de <find_projection_range2+0x2ce>
movslq -0x1c(%rbp),%rcx
lea    -0x50(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1309 <find_projection_range2+0x1f9>
movslq -0x1c(%rbp),%rcx
lea    -0x50(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movslq -0x1c(%rbp),%rcx
lea    -0x50(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd 0x8(%rax),%xmm0
jbe    1347 <find_projection_range2+0x237>
movslq -0x1c(%rbp),%rcx
lea    -0x50(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movslq -0x1c(%rbp),%rcx
lea    -0x50(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movsd  0x8(%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    138b <find_projection_range2+0x27b>
movslq -0x1c(%rbp),%rcx
lea    -0x50(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movslq -0x1c(%rbp),%rcx
lea    -0x50(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd 0x18(%rax),%xmm0
jbe    13cb <find_projection_range2+0x2bb>
movslq -0x1c(%rbp),%rcx
lea    -0x50(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x18(%rax)
jmp    13d0 <find_projection_range2+0x2c0>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    12bf <find_projection_range2+0x1af>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_projection_range2>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
movsd  0x10(%rsi),%xmm1
movsd  0x10(%rdi),%xmm2
subsd  %xmm2,%xmm1
movapd 0xec8(%rip),%xmm0
andpd  %xmm1,%xmm0
movsd  0xedb(%rip),%xmm8
ucomisd %xmm0,%xmm8
jbe    1170 <find_projection_range2+0x60>
lea    0xed5(%rip),%rdi
call   1030 <HECMW_vis_print_exit@plt>
movsd  0xebf(%rip),%xmm8
movsd  0x10(%r15),%xmm2
movsd  0x10(%rbx),%xmm1
subsd  %xmm2,%xmm1
movapd 0xe98(%rip),%xmm4
xorpd  %xmm2,%xmm4
movapd %xmm4,%xmm7
divsd  %xmm1,%xmm7
movupd (%r15),%xmm0
movupd (%rbx),%xmm1
subpd  %xmm0,%xmm1
unpcklpd %xmm7,%xmm7
mulpd  %xmm1,%xmm7
movsd  0x28(%rbx),%xmm3
subsd  %xmm2,%xmm3
movapd 0xe56(%rip),%xmm1
andpd  %xmm3,%xmm1
ucomisd %xmm1,%xmm8
jbe    1202 <find_projection_range2+0xf2>
lea    0xe6c(%rip),%rdi
movapd %xmm7,0x10(%rsp)
movapd %xmm0,(%rsp)
call   1030 <HECMW_vis_print_exit@plt>
movapd (%rsp),%xmm0
movsd  0xe46(%rip),%xmm8
movapd 0x10(%rsp),%xmm7
movsd  0x10(%r15),%xmm2
movsd  0x28(%rbx),%xmm3
movupd (%r15),%xmm11
subsd  %xmm2,%xmm3
movapd 0xe14(%rip),%xmm4
xorpd  %xmm2,%xmm4
jmp    1207 <find_projection_range2+0xf7>
movapd %xmm0,%xmm11
addpd  %xmm0,%xmm7
movsd  0x18(%rbx),%xmm0
movsd  0x20(%rbx),%xmm1
subsd  %xmm11,%xmm0
movapd %xmm4,%xmm5
divsd  %xmm3,%xmm5
mulsd  %xmm5,%xmm0
addsd  %xmm11,%xmm0
movapd %xmm11,%xmm9
unpckhpd %xmm11,%xmm9
subsd  %xmm9,%xmm1
movsd  0x40(%rbx),%xmm6
subsd  %xmm2,%xmm6
movapd 0xdb5(%rip),%xmm2
andpd  %xmm6,%xmm2
ucomisd %xmm2,%xmm8
jbe    12ba <find_projection_range2+0x1aa>
lea    0xdcb(%rip),%rdi
movapd %xmm7,0x10(%rsp)
movsd  %xmm5,(%rsp)
movsd  %xmm0,0x28(%rsp)
movapd %xmm9,0x30(%rsp)
movsd  %xmm1,0x20(%rsp)
call   1030 <HECMW_vis_print_exit@plt>
movsd  0x20(%rsp),%xmm1
movapd 0x30(%rsp),%xmm9
movsd  0x28(%rsp),%xmm0
movsd  (%rsp),%xmm5
movapd 0x10(%rsp),%xmm7
movsd  0x10(%r15),%xmm4
movsd  0x40(%rbx),%xmm6
movupd (%r15),%xmm11
subsd  %xmm4,%xmm6
xorpd  0xd56(%rip),%xmm4
mulsd  %xmm1,%xmm5
movsd  0x30(%rbx),%xmm3
movsd  0x38(%rbx),%xmm10
movlpd %xmm7,(%r14)
movapd %xmm7,%xmm2
unpckhpd %xmm7,%xmm2
movhpd %xmm7,0x18(%r14)
movupd %xmm7,0x8(%r14)
ucomisd %xmm0,%xmm7
movapd %xmm7,%xmm8
jbe    12f7 <find_projection_range2+0x1e7>
movsd  %xmm0,(%r14)
movapd %xmm0,%xmm8
subsd  %xmm11,%xmm3
divsd  %xmm6,%xmm4
addsd  %xmm9,%xmm5
ucomisd %xmm7,%xmm0
jbe    1315 <find_projection_range2+0x205>
movsd  %xmm0,0x8(%r14)
movapd %xmm0,%xmm7
movapd %xmm11,%xmm6
unpckhpd %xmm11,%xmm6
mulsd  %xmm4,%xmm3
ucomisd %xmm5,%xmm2
movapd %xmm2,%xmm9
jbe    1339 <find_projection_range2+0x229>
movsd  %xmm5,0x10(%r14)
movapd %xmm5,%xmm9
subsd  %xmm6,%xmm10
addsd  %xmm11,%xmm3
ucomisd %xmm2,%xmm5
jbe    1353 <find_projection_range2+0x243>
movsd  %xmm5,0x18(%r14)
movapd %xmm5,%xmm2
mulsd  %xmm10,%xmm4
ucomisd %xmm3,%xmm8
jbe    1364 <find_projection_range2+0x254>
movsd  %xmm3,(%r14)
addsd  %xmm6,%xmm4
ucomisd %xmm7,%xmm3
ja     138b <find_projection_range2+0x27b>
ucomisd %xmm4,%xmm9
ja     1398 <find_projection_range2+0x288>
ucomisd %xmm2,%xmm4
jbe    1381 <find_projection_range2+0x271>
movsd  %xmm4,0x18(%r14)
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
movsd  %xmm3,0x8(%r14)
ucomisd %xmm4,%xmm9
jbe    1375 <find_projection_range2+0x265>
movsd  %xmm4,0x10(%r14)
ucomisd %xmm2,%xmm4
ja     137b <find_projection_range2+0x26b>
jmp    1381 <find_projection_range2+0x271>

LLVM IR (-O0):
@.str = [63 x i8] c"ERROR: HEC-MW-VIS-E2002: The viewpoint position is not correct\00"
define void @find_projection_range2(double* %0, [3 x double]* %1, double* %2) {
%4 = alloca double*
%5 = alloca [3 x double]*
%6 = alloca double*
%7 = alloca i32
%8 = alloca [3 x [2 x double]]
store double* %0, double** %4
store [3 x double]* %1, [3 x double]** %5
store double* %2, double** %6
store i32 0, i32* %7
br label %9
9: ; preds = %94, %3
%10 = load i32, i32* %7
%11 = icmp slt i32 %10, 3
br i1 %11, label %12, label %97
12: ; preds = %9
%13 = load [3 x double]*, [3 x double]** %5
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 %15
%17 = getelementptr inbounds [3 x double], [3 x double]* %16, i64 0, i64 2
%18 = load double, double* %17
%19 = load double*, double** %4
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = fsub double %18, %21
%23 = call double @llvm.fabs.f64(double %22)
%24 = fcmp olt double %23, 1.000000e-08
br i1 %24, label %25, label %27
25: ; preds = %12
%26 = call i32 @HECMW_vis_print_exit(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
br label %27
27: ; preds = %25, %12
%28 = load double*, double** %4
%29 = getelementptr inbounds double, double* %28, i64 0
%30 = load double, double* %29
%31 = load double*, double** %4
%32 = getelementptr inbounds double, double* %31, i64 2
%33 = load double, double* %32
%34 = load [3 x double]*, [3 x double]** %5
%35 = load i32, i32* %7
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [3 x double], [3 x double]* %34, i64 %36
%38 = getelementptr inbounds [3 x double], [3 x double]* %37, i64 0, i64 2
%39 = load double, double* %38
%40 = load double*, double** %4
%41 = getelementptr inbounds double, double* %40, i64 2
%42 = load double, double* %41
%43 = fsub double %39, %42
%44 = fdiv double %33, %43
%45 = load [3 x double]*, [3 x double]** %5
%46 = load i32, i32* %7
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [3 x double], [3 x double]* %45, i64 %47
%49 = getelementptr inbounds [3 x double], [3 x double]* %48, i64 0, i64 0
%50 = load double, double* %49
%51 = load double*, double** %4
%52 = getelementptr inbounds double, double* %51, i64 0
%53 = load double, double* %52
%54 = fsub double %50, %53
%55 = fneg double %44
%56 = call double @llvm.fmuladd.f64(double %55, double %54, double %30)
%57 = load i32, i32* %7
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [3 x [2 x double]], [3 x [2 x double]]* %8, i64 0, i64 %58
%60 = getelementptr inbounds [2 x double], [2 x double]* %59, i64 0, i64 0
store double %56, double* %60
%61 = load double*, double** %4
%62 = getelementptr inbounds double, double* %61, i64 1
%63 = load double, double* %62
%64 = load double*, double** %4
%65 = getelementptr inbounds double, double* %64, i64 2
%66 = load double, double* %65
%67 = load [3 x double]*, [3 x double]** %5
%68 = load i32, i32* %7
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [3 x double], [3 x double]* %67, i64 %69
%71 = getelementptr inbounds [3 x double], [3 x double]* %70, i64 0, i64 2
%72 = load double, double* %71
%73 = load double*, double** %4
%74 = getelementptr inbounds double, double* %73, i64 2
%75 = load double, double* %74
%76 = fsub double %72, %75
%77 = fdiv double %66, %76
%78 = load [3 x double]*, [3 x double]** %5
%79 = load i32, i32* %7
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [3 x double], [3 x double]* %78, i64 %80
%82 = getelementptr inbounds [3 x double], [3 x double]* %81, i64 0, i64 1
%83 = load double, double* %82
%84 = load double*, double** %4
%85 = getelementptr inbounds double, double* %84, i64 1
%86 = load double, double* %85
%87 = fsub double %83, %86
%88 = fneg double %77
%89 = call double @llvm.fmuladd.f64(double %88, double %87, double %63)
%90 = load i32, i32* %7
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds [3 x [2 x double]], [3 x [2 x double]]* %8, i64 0, i64 %91
%93 = getelementptr inbounds [2 x double], [2 x double]* %92, i64 0, i64 1
store double %89, double* %93
br label %94
94: ; preds = %27
%95 = load i32, i32* %7
%96 = add nsw i32 %95, 1
store i32 %96, i32* %7
br label %9
97: ; preds = %9
%98 = getelementptr inbounds [3 x [2 x double]], [3 x [2 x double]]* %8, i64 0, i64 0
%99 = getelementptr inbounds [2 x double], [2 x double]* %98, i64 0, i64 0
%100 = load double, double* %99
%101 = load double*, double** %6
%102 = getelementptr inbounds double, double* %101, i64 1
store double %100, double* %102
%103 = load double*, double** %6
%104 = getelementptr inbounds double, double* %103, i64 0
store double %100, double* %104
%105 = getelementptr inbounds [3 x [2 x double]], [3 x [2 x double]]* %8, i64 0, i64 0
%106 = getelementptr inbounds [2 x double], [2 x double]* %105, i64 0, i64 1
%107 = load double, double* %106
%108 = load double*, double** %6
%109 = getelementptr inbounds double, double* %108, i64 3
store double %107, double* %109
%110 = load double*, double** %6
%111 = getelementptr inbounds double, double* %110, i64 2
store double %107, double* %111
store i32 0, i32* %7
br label %112
112: ; preds = %188, %97
%113 = load i32, i32* %7
%114 = icmp slt i32 %113, 3
br i1 %114, label %115, label %191
115: ; preds = %112
%116 = load i32, i32* %7
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds [3 x [2 x double]], [3 x [2 x double]]* %8, i64 0, i64 %117
%119 = getelementptr inbounds [2 x double], [2 x double]* %118, i64 0, i64 0
%120 = load double, double* %119
%121 = load double*, double** %6
%122 = getelementptr inbounds double, double* %121, i64 0
%123 = load double, double* %122
%124 = fcmp olt double %120, %123
br i1 %124, label %125, label %133
125: ; preds = %115
%126 = load i32, i32* %7
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds [3 x [2 x double]], [3 x [2 x double]]* %8, i64 0, i64 %127
%129 = getelementptr inbounds [2 x double], [2 x double]* %128, i64 0, i64 0
%130 = load double, double* %129
%131 = load double*, double** %6
%132 = getelementptr inbounds double, double* %131, i64 0
store double %130, double* %132
br label %133
133: ; preds = %125, %115
%134 = load i32, i32* %7
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds [3 x [2 x double]], [3 x [2 x double]]* %8, i64 0, i64 %135
%137 = getelementptr inbounds [2 x double], [2 x double]* %136, i64 0, i64 0
%138 = load double, double* %137
%139 = load double*, double** %6
%140 = getelementptr inbounds double, double* %139, i64 1
%141 = load double, double* %140
%142 = fcmp ogt double %138, %141
br i1 %142, label %143, label %151
143: ; preds = %133
%144 = load i32, i32* %7
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds [3 x [2 x double]], [3 x [2 x double]]* %8, i64 0, i64 %145
%147 = getelementptr inbounds [2 x double], [2 x double]* %146, i64 0, i64 0
%148 = load double, double* %147
%149 = load double*, double** %6
%150 = getelementptr inbounds double, double* %149, i64 1
store double %148, double* %150
br label %151
151: ; preds = %143, %133
%152 = load i32, i32* %7
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds [3 x [2 x double]], [3 x [2 x double]]* %8, i64 0, i64 %153
%155 = getelementptr inbounds [2 x double], [2 x double]* %154, i64 0, i64 1
%156 = load double, double* %155
%157 = load double*, double** %6
%158 = getelementptr inbounds double, double* %157, i64 2
%159 = load double, double* %158
%160 = fcmp olt double %156, %159
br i1 %160, label %161, label %169
161: ; preds = %151
%162 = load i32, i32* %7
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds [3 x [2 x double]], [3 x [2 x double]]* %8, i64 0, i64 %163
%165 = getelementptr inbounds [2 x double], [2 x double]* %164, i64 0, i64 1
%166 = load double, double* %165
%167 = load double*, double** %6
%168 = getelementptr inbounds double, double* %167, i64 2
store double %166, double* %168
br label %169
169: ; preds = %161, %151
%170 = load i32, i32* %7
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds [3 x [2 x double]], [3 x [2 x double]]* %8, i64 0, i64 %171
%173 = getelementptr inbounds [2 x double], [2 x double]* %172, i64 0, i64 1
%174 = load double, double* %173
%175 = load double*, double** %6
%176 = getelementptr inbounds double, double* %175, i64 3
%177 = load double, double* %176
%178 = fcmp ogt double %174, %177
br i1 %178, label %179, label %187
179: ; preds = %169
%180 = load i32, i32* %7
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds [3 x [2 x double]], [3 x [2 x double]]* %8, i64 0, i64 %181
%183 = getelementptr inbounds [2 x double], [2 x double]* %182, i64 0, i64 1
%184 = load double, double* %183
%185 = load double*, double** %6
%186 = getelementptr inbounds double, double* %185, i64 3
store double %184, double* %186
br label %187
187: ; preds = %179, %169
br label %188
188: ; preds = %187
%189 = load i32, i32* %7
%190 = add nsw i32 %189, 1
store i32 %190, i32* %7
br label %112
191: ; preds = %112
ret void
}

LLVM IR (-O2):
@.str = [63 x i8] c"ERROR: HEC-MW-VIS-E2002: The viewpoint position is not correct\00"
define void @find_projection_range2(double* nocapture %0, [3 x double]* nocapture %1, double* nocapture %2) {
%4 = getelementptr inbounds double, double* %0, i64 2
%5 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 2
%6 = load double, double* %5
%7 = load double, double* %4
%8 = fsub double %6, %7
%9 = tail call double @llvm.fabs.f64(double %8)
%10 = fcmp olt double %9, 1.000000e-08
br i1 %10, label %11, label %16
11: ; preds = %3
%12 = tail call i32 @HECMW_vis_print_exit(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%13 = load double, double* %4
%14 = load double, double* %5
%15 = fsub double %14, %13
br label %16
16: ; preds = %11, %3
%17 = phi double [ %15, %11 ], [ %8, %3 ]
%18 = phi double [ %13, %11 ], [ %7, %3 ]
%19 = fneg double %18
%20 = fdiv double %19, %17
%21 = bitcast double* %0 to <2 x double>*
%22 = load <2 x double>, <2 x double>* %21
%23 = bitcast [3 x double]* %1 to <2 x double>*
%24 = load <2 x double>, <2 x double>* %23
%25 = fsub <2 x double> %24, %22
%26 = insertelement <2 x double> poison, double %20, i64 0
%27 = shufflevector <2 x double> %26, <2 x double> poison, <2 x i32> zeroinitializer
%28 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %27, <2 x double> %25, <2 x double> %22)
%29 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 1, i64 2
%30 = load double, double* %29
%31 = fsub double %30, %18
%32 = tail call double @llvm.fabs.f64(double %31)
%33 = fcmp olt double %32, 1.000000e-08
br i1 %33, label %34, label %42
34: ; preds = %16
%35 = tail call i32 @HECMW_vis_print_exit(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%36 = load double, double* %4
%37 = load double, double* %29
%38 = bitcast double* %0 to <2 x double>*
%39 = load <2 x double>, <2 x double>* %38
%40 = fsub double %37, %36
%41 = fneg double %36
br label %42
42: ; preds = %34, %16
%43 = phi double [ %41, %34 ], [ %19, %16 ]
%44 = phi double [ %40, %34 ], [ %31, %16 ]
%45 = phi double [ %36, %34 ], [ %18, %16 ]
%46 = phi <2 x double> [ %39, %34 ], [ %22, %16 ]
%47 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 1, i64 0
%48 = load double, double* %47
%49 = extractelement <2 x double> %46, i64 0
%50 = fsub double %48, %49
%51 = fdiv double %43, %44
%52 = tail call double @llvm.fmuladd.f64(double %51, double %50, double %49)
%53 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 1, i64 1
%54 = load double, double* %53
%55 = extractelement <2 x double> %46, i64 1
%56 = fsub double %54, %55
%57 = tail call double @llvm.fmuladd.f64(double %51, double %56, double %55)
%58 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 2, i64 2
%59 = load double, double* %58
%60 = fsub double %59, %45
%61 = tail call double @llvm.fabs.f64(double %60)
%62 = fcmp olt double %61, 1.000000e-08
br i1 %62, label %63, label %71
63: ; preds = %42
%64 = tail call i32 @HECMW_vis_print_exit(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%65 = load double, double* %4
%66 = load double, double* %58
%67 = bitcast double* %0 to <2 x double>*
%68 = load <2 x double>, <2 x double>* %67
%69 = fsub double %66, %65
%70 = fneg double %65
br label %71
71: ; preds = %63, %42
%72 = phi double [ %70, %63 ], [ %43, %42 ]
%73 = phi double [ %69, %63 ], [ %60, %42 ]
%74 = phi <2 x double> [ %68, %63 ], [ %46, %42 ]
%75 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 2, i64 0
%76 = load double, double* %75
%77 = extractelement <2 x double> %74, i64 0
%78 = fsub double %76, %77
%79 = fdiv double %72, %73
%80 = tail call double @llvm.fmuladd.f64(double %79, double %78, double %77)
%81 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 2, i64 1
%82 = load double, double* %81
%83 = extractelement <2 x double> %74, i64 1
%84 = fsub double %82, %83
%85 = tail call double @llvm.fmuladd.f64(double %79, double %84, double %83)
%86 = getelementptr inbounds double, double* %2, i64 1
%87 = extractelement <2 x double> %28, i64 0
store double %87, double* %2
%88 = getelementptr inbounds double, double* %2, i64 3
%89 = extractelement <2 x double> %28, i64 1
store double %89, double* %88
%90 = getelementptr inbounds double, double* %2, i64 2
%91 = bitcast double* %86 to <2 x double>*
store <2 x double> %28, <2 x double>* %91
%92 = fcmp olt double %52, %87
br i1 %92, label %93, label %94
93: ; preds = %71
store double %52, double* %2
br label %94
94: ; preds = %93, %71
%95 = phi double [ %52, %93 ], [ %87, %71 ]
%96 = fcmp ogt double %52, %87
br i1 %96, label %97, label %98
97: ; preds = %94
store double %52, double* %86
br label %98
98: ; preds = %97, %94
%99 = phi double [ %52, %97 ], [ %87, %94 ]
%100 = fcmp olt double %57, %89
br i1 %100, label %101, label %102
101: ; preds = %98
store double %57, double* %90
br label %102
102: ; preds = %101, %98
%103 = phi double [ %57, %101 ], [ %89, %98 ]
%104 = fcmp ogt double %57, %89
br i1 %104, label %105, label %106
105: ; preds = %102
store double %57, double* %88
br label %106
106: ; preds = %105, %102
%107 = phi double [ %89, %102 ], [ %57, %105 ]
%108 = fcmp olt double %80, %95
br i1 %108, label %109, label %110
109: ; preds = %106
store double %80, double* %2
br label %110
110: ; preds = %109, %106
%111 = fcmp ogt double %80, %99
br i1 %111, label %112, label %113
112: ; preds = %110
store double %80, double* %86
br label %113
113: ; preds = %112, %110
%114 = fcmp olt double %85, %103
br i1 %114, label %115, label %116
115: ; preds = %113
store double %85, double* %90
br label %116
116: ; preds = %115, %113
%117 = fcmp ogt double %85, %107
br i1 %117, label %118, label %119
118: ; preds = %116
store double %85, double* %88
br label %119
119: ; preds = %118, %116
ret void
}