#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 */
scalar_t__ SegmentsIntersect(double const *, double const *, double const *,
                             double const *, double *, double *);
double pythag2(double, double);
int intersection_polygon_segment(int n, const double *P, const double seg0[2],
                                 const double segd[2], double *isect,
                                 double *cross, double *cross0,
                                 double *cross1) {
  int p, q, c = 0;
  const double seg1[2] = {seg0[0] + segd[0], seg0[1] + segd[1]};
  if (NULL != cross) {
    *cross = 0;
  }
  for (p = n - 1, q = 0; q < n; p = q++) {
    double *xp = (NULL == isect) ? NULL : &isect[2 * c];
    double t;
    if (SegmentsIntersect(&P[2 * p], &P[2 * q], seg0, seg1, xp, &t)) {
      if (NULL != cross) {
        double u[2] = {P[2 * q + 0] - P[2 * p + 0],
                       P[2 * q + 1] - P[2 * p + 1]};
        double lu = pythag2(u[0], u[1]);
        if (0 == lu) {
          lu = 1;
        } else {
          *cross += (u[0] * segd[1] - u[1] * segd[0]) / lu;
          if (NULL != cross0 && NULL != cross1) {
            *cross0 += t * (u[0] * segd[1] - u[1] * segd[0]) / lu;
            *cross1 += (1 - t) * (u[0] * segd[1] - u[1] * segd[0]) / lu;
          }
        }
      }
      ++c;
    }
  }
  return c;
}


x86 assembly (clang, -O0):
<intersection_polygon_segment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x20(%rbp),%rax
addsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
xor    %eax,%eax
cmp    -0x30(%rbp),%rax
je     1194 <intersection_polygon_segment+0x74>
mov    -0x30(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    140e <intersection_polygon_segment+0x2ee>
xor    %eax,%eax
cmp    -0x28(%rbp),%rax
jne    11c7 <intersection_polygon_segment+0xa7>
xor    %eax,%eax
mov    %rax,-0x80(%rbp)
jmp    11df <intersection_polygon_segment+0xbf>
mov    -0x28(%rbp),%rax
mov    -0x3c(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x80(%rbp)
mov    -0x80(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x34(%rbp),%eax
shl    $0x1,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x38(%rbp),%eax
shl    $0x1,%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x18(%rbp),%rdx
lea    -0x50(%rbp),%rcx
mov    -0x58(%rbp),%r8
lea    -0x60(%rbp),%r9
call   1040 <SegmentsIntersect@plt>
cmp    $0x0,%rax
je     13f6 <intersection_polygon_segment+0x2d6>
xor    %eax,%eax
cmp    -0x30(%rbp),%rax
je     13ed <intersection_polygon_segment+0x2cd>
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm1
call   1030 <pythag2@plt>
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x78(%rbp),%xmm0
jne    12d0 <intersection_polygon_segment+0x1b0>
jp     12d0 <intersection_polygon_segment+0x1b0>
movsd  0xd3a(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    13e8 <intersection_polygon_segment+0x2c8>
movsd  -0x70(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm2
movsd  -0x68(%rbp),%xmm1
mov    -0x20(%rbp),%rax
mulsd  (%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x78(%rbp),%xmm0
mov    -0x30(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
xor    %eax,%eax
cmp    0x10(%rbp),%rax
je     13e3 <intersection_polygon_segment+0x2c3>
xor    %eax,%eax
cmp    0x18(%rbp),%rax
je     13e3 <intersection_polygon_segment+0x2c3>
movsd  -0x60(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm1
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm3
movsd  -0x68(%rbp),%xmm2
mov    -0x20(%rbp),%rax
mulsd  (%rax),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x78(%rbp),%xmm0
mov    0x10(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
movsd  0xc71(%rip),%xmm0
subsd  -0x60(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm1
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm3
movsd  -0x68(%rbp),%xmm2
mov    -0x20(%rbp),%rax
mulsd  (%rax),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x78(%rbp),%xmm0
mov    0x18(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    13e8 <intersection_polygon_segment+0x2c8>
jmp    13ed <intersection_polygon_segment+0x2cd>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    13fb <intersection_polygon_segment+0x2db>
mov    -0x38(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x38(%rbp)
mov    %eax,-0x34(%rbp)
jmp    11a4 <intersection_polygon_segment+0x84>
mov    -0x3c(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intersection_polygon_segment>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %r8,%rbx
mov    %rsi,0x8(%rsp)
mov    %rdx,0x30(%rsp)
movupd (%rdx),%xmm0
mov    %rcx,0x10(%rsp)
movupd (%rcx),%xmm1
addpd  %xmm0,%xmm1
movapd %xmm1,0x50(%rsp)
test   %r9,%r9
je     115e <intersection_polygon_segment+0x3e>
movq   $0x0,(%r9)
test   %edi,%edi
jle    1303 <intersection_polygon_segment+0x1e3>
mov    %r9,0x20(%rsp)
lea    -0x1(%rdi),%r15d
cmpq   $0x0,0xa0(%rsp)
setne  %al
cmpq   $0x0,0xa8(%rsp)
setne  %cl
and    %al,%cl
mov    %cl,0x7(%rsp)
mov    %edi,%eax
mov    %rax,0x28(%rsp)
xor    %r12d,%r12d
mov    0x8(%rsp),%r13
xor    %ebp,%ebp
jmp    11bd <intersection_polygon_segment+0x9d>
add    $0x1,%ebp
mov    %r12d,%r15d
lea    0x1(%r12),%rax
add    $0x10,%r13
mov    %rax,%r12
cmp    %rax,0x28(%rsp)
je     1305 <intersection_polygon_segment+0x1e5>
lea    0x0(%rbp,%rbp,1),%eax
test   %rbx,%rbx
cltq
lea    (%rbx,%rax,8),%r8
cmove  %rbx,%r8
add    %r15d,%r15d
movslq %r15d,%rax
mov    0x8(%rsp),%rcx
lea    (%rcx,%rax,8),%r14
mov    %r14,%rdi
mov    %r13,%rsi
mov    0x30(%rsp),%rdx
lea    0x50(%rsp),%rcx
lea    0x38(%rsp),%r9
call   1040 <SegmentsIntersect@plt>
test   %rax,%rax
je     11a3 <intersection_polygon_segment+0x83>
cmpq   $0x0,0x20(%rsp)
je     11a0 <intersection_polygon_segment+0x80>
movsd  0x0(%r13),%xmm0
movsd  0x8(%r13),%xmm1
subsd  (%r14),%xmm0
or     $0x1,%r15d
movslq %r15d,%rax
mov    0x8(%rsp),%rcx
subsd  (%rcx,%rax,8),%xmm1
movsd  %xmm0,0x18(%rsp)
movapd %xmm1,0x40(%rsp)
call   1030 <pythag2@plt>
ucomisd 0xdd9(%rip),%xmm0
jne    1247 <intersection_polygon_segment+0x127>
jnp    11a0 <intersection_polygon_segment+0x80>
mov    0x10(%rsp),%rax
movsd  (%rax),%xmm1
mulsd  0x40(%rsp),%xmm1
movsd  0x8(%rax),%xmm2
mulsd  0x18(%rsp),%xmm2
subsd  %xmm1,%xmm2
divsd  %xmm0,%xmm2
mov    0x20(%rsp),%rax
addsd  (%rax),%xmm2
movsd  %xmm2,(%rax)
cmpb   $0x0,0x7(%rsp)
je     11a0 <intersection_polygon_segment+0x80>
movapd 0x40(%rsp),%xmm5
xorpd  0xd71(%rip),%xmm5
movsd  0x38(%rsp),%xmm1
mov    0x10(%rsp),%rax
movsd  (%rax),%xmm2
mulsd  %xmm5,%xmm2
movsd  0x8(%rax),%xmm3
movsd  0x18(%rsp),%xmm4
mulsd  %xmm4,%xmm3
addsd  %xmm2,%xmm3
mulsd  %xmm1,%xmm3
divsd  %xmm0,%xmm3
mov    0xa0(%rsp),%rcx
addsd  (%rcx),%xmm3
movsd  %xmm3,(%rcx)
movsd  0xd3b(%rip),%xmm2
subsd  %xmm1,%xmm2
mulsd  (%rax),%xmm5
mulsd  0x8(%rax),%xmm4
addsd  %xmm5,%xmm4
mulsd  %xmm2,%xmm4
divsd  %xmm0,%xmm4
mov    0xa8(%rsp),%rax
addsd  (%rax),%xmm4
movsd  %xmm4,(%rax)
jmp    11a0 <intersection_polygon_segment+0x80>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @intersection_polygon_segment(i32 %0, double* %1, double* %2, double* nocapture %3, double* %4, double* %5, double* %6, double* %7) {
%9 = alloca <2 x double>
%10 = alloca double
%11 = bitcast <2 x double>* %9 to i8*
%12 = getelementptr inbounds <2 x double>, <2 x double>* %9, i64 0, i64 0
%13 = bitcast double* %2 to <2 x double>*
%14 = load <2 x double>, <2 x double>* %13
%15 = getelementptr inbounds double, double* %3, i64 1
%16 = bitcast double* %3 to <2 x double>*
%17 = load <2 x double>, <2 x double>* %16
%18 = fadd <2 x double> %14, %17
store <2 x double> %18, <2 x double>* %9
%19 = icmp eq double* %5, null
br i1 %19, label %21, label %20
20: ; preds = %8
store double 0.000000e+00, double* %5
br label %21
21: ; preds = %20, %8
%22 = icmp sgt i32 %0, 0
br i1 %22, label %23, label %96
23: ; preds = %21
%24 = add nsw i32 %0, -1
%25 = icmp eq double* %4, null
%26 = bitcast double* %10 to i8*
%27 = icmp ne double* %6, null
%28 = icmp ne double* %7, null
%29 = and i1 %27, %28
%30 = zext i32 %0 to i64
br label %31
31: ; preds = %23, %91
%32 = phi i64 [ 0, %23 ], [ %93, %91 ]
%33 = phi i32 [ %24, %23 ], [ %94, %91 ]
%34 = phi i32 [ 0, %23 ], [ %92, %91 ]
%35 = shl nsw i32 %34, 1
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds double, double* %4, i64 %36
%38 = select i1 %25, double* null, double* %37
%39 = shl nsw i32 %33, 1
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds double, double* %1, i64 %40
%42 = shl nuw nsw i64 %32, 1
%43 = getelementptr inbounds double, double* %1, i64 %42
%44 = call i64 @SegmentsIntersect(double* %41, double* %43, double* %2, double* %12, double* %38, double* %10)
%45 = icmp eq i64 %44, 0
br i1 %45, label %91, label %46
46: ; preds = %31
br i1 %19, label %89, label %47
47: ; preds = %46
%48 = load double, double* %43
%49 = load double, double* %41
%50 = fsub double %48, %49
%51 = or i64 %42, 1
%52 = getelementptr inbounds double, double* %1, i64 %51
%53 = load double, double* %52
%54 = or i32 %39, 1
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds double, double* %1, i64 %55
%57 = load double, double* %56
%58 = fsub double %53, %57
%59 = call double @pythag2(double %50, double %58)
%60 = fcmp oeq double %59, 0.000000e+00
br i1 %60, label %89, label %61
61: ; preds = %47
%62 = load double, double* %15
%63 = load double, double* %3
%64 = fneg double %58
%65 = fmul double %63, %64
%66 = call double @llvm.fmuladd.f64(double %50, double %62, double %65)
%67 = fdiv double %66, %59
%68 = load double, double* %5
%69 = fadd double %68, %67
store double %69, double* %5
br i1 %29, label %70, label %89
70: ; preds = %61
%71 = load double, double* %10
%72 = load double, double* %15
%73 = load double, double* %3
%74 = fmul double %73, %64
%75 = call double @llvm.fmuladd.f64(double %50, double %72, double %74)
%76 = fmul double %71, %75
%77 = fdiv double %76, %59
%78 = load double, double* %6
%79 = fadd double %78, %77
store double %79, double* %6
%80 = fsub double 1.000000e+00, %71
%81 = load double, double* %15
%82 = load double, double* %3
%83 = fmul double %82, %64
%84 = call double @llvm.fmuladd.f64(double %50, double %81, double %83)
%85 = fmul double %80, %84
%86 = fdiv double %85, %59
%87 = load double, double* %7
%88 = fadd double %87, %86
store double %88, double* %7
br label %89
89: ; preds = %70, %61, %47, %46
%90 = add nsw i32 %34, 1
br label %91
91: ; preds = %89, %31
%92 = phi i32 [ %90, %89 ], [ %34, %31 ]
%93 = add nuw nsw i64 %32, 1
%94 = trunc i64 %32 to i32
%95 = icmp eq i64 %93, %30
br i1 %95, label %96, label %31
96: ; preds = %91, %21
%97 = phi i32 [ 0, %21 ], [ %92, %91 ]
ret i32 %97
}