; LLVM IR from HRI-EU/Rcs :: src/RcsCore (Rcs_geometry)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [39 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@__func__.Math_polyVertexDistance = external hidden unnamed_addr constant [24 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [25 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind
declare double @sqrt(double noundef) #1

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

declare void @print_trace() #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

; Function Attrs: nounwind uwtable
define dso_local double @Math_polyVertexDistance(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) #5 {
  %5 = alloca double, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !9
  br label %16

16:                                               ; preds = %4
  %17 = load i32, ptr %8, align 4, !tbaa !9
  %18 = load i32, ptr %7, align 4, !tbaa !9
  %19 = icmp ult i32 %17, %18
  br i1 %19, label %29, label %20

20:                                               ; preds = %16
  %21 = load ptr, ptr @stderr, align 8, !tbaa !5
  %22 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %21, ptr noundef @.str, ptr noundef @.str.1, ptr noundef @__func__.Math_polyVertexDistance, i32 noundef 1527, ptr noundef @.str.14) #6
  %23 = load ptr, ptr @stderr, align 8, !tbaa !5
  %24 = load i32, ptr %8, align 4, !tbaa !9
  %25 = load i32, ptr %7, align 4, !tbaa !9
  %26 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef @.str.15, i32 noundef %24, i32 noundef %25) #6
  %27 = load ptr, ptr @stderr, align 8, !tbaa !5
  %28 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %27, ptr noundef @.str.4) #6
  call void @print_trace()
  call void @exit(i32 noundef 1) #7
  unreachable

29:                                               ; preds = %16
  br label %30

30:                                               ; preds = %29
  br label %31

31:                                               ; preds = %30
  %32 = load i32, ptr %9, align 4, !tbaa !9
  %33 = load i32, ptr %7, align 4, !tbaa !9
  %34 = icmp ult i32 %32, %33
  br i1 %34, label %44, label %35

35:                                               ; preds = %31
  %36 = load ptr, ptr @stderr, align 8, !tbaa !5
  %37 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %36, ptr noundef @.str, ptr noundef @.str.1, ptr noundef @__func__.Math_polyVertexDistance, i32 noundef 1528, ptr noundef @.str.16) #6
  %38 = load ptr, ptr @stderr, align 8, !tbaa !5
  %39 = load i32, ptr %9, align 4, !tbaa !9
  %40 = load i32, ptr %7, align 4, !tbaa !9
  %41 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %38, ptr noundef @.str.17, i32 noundef %39, i32 noundef %40) #6
  %42 = load ptr, ptr @stderr, align 8, !tbaa !5
  %43 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %42, ptr noundef @.str.4) #6
  call void @print_trace()
  call void @exit(i32 noundef 1) #7
  unreachable

44:                                               ; preds = %31
  br label %45

45:                                               ; preds = %44
  %46 = load i32, ptr %8, align 4, !tbaa !9
  %47 = load i32, ptr %9, align 4, !tbaa !9
  %48 = icmp eq i32 %46, %47
  br i1 %48, label %52, label %49

49:                                               ; preds = %45
  %50 = load i32, ptr %7, align 4, !tbaa !9
  %51 = icmp ult i32 %50, 2
  br i1 %51, label %52, label %53

52:                                               ; preds = %49, %45
  store double 0.000000e+00, ptr %5, align 8
  br label %244

53:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store double 0.000000e+00, ptr %12, align 8, !tbaa !11
  %54 = load i32, ptr %9, align 4, !tbaa !9
  %55 = load i32, ptr %8, align 4, !tbaa !9
  %56 = icmp ugt i32 %54, %55
  br i1 %56, label %57, label %107

57:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %58 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %58, ptr %13, align 4, !tbaa !9
  br label %59

59:                                               ; preds = %103, %57
  %60 = load i32, ptr %13, align 4, !tbaa !9
  %61 = load i32, ptr %9, align 4, !tbaa !9
  %62 = sub i32 %61, 1
  %63 = icmp ult i32 %60, %62
  br i1 %63, label %65, label %64

64:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %106

65:                                               ; preds = %59
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = load i32, ptr %13, align 4, !tbaa !9
  %68 = add i32 %67, 1
  %69 = zext i32 %68 to i64
  %70 = getelementptr inbounds [2 x double], ptr %66, i64 %69
  %71 = getelementptr inbounds [2 x double], ptr %70, i64 0, i64 0
  %72 = load double, ptr %71, align 8, !tbaa !11
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = load i32, ptr %13, align 4, !tbaa !9
  %75 = zext i32 %74 to i64
  %76 = getelementptr inbounds [2 x double], ptr %73, i64 %75
  %77 = getelementptr inbounds [2 x double], ptr %76, i64 0, i64 0
  %78 = load double, ptr %77, align 8, !tbaa !11
  %79 = fsub double %72, %78
  store double %79, ptr %10, align 8, !tbaa !11
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = load i32, ptr %13, align 4, !tbaa !9
  %82 = add i32 %81, 1
  %83 = zext i32 %82 to i64
  %84 = getelementptr inbounds [2 x double], ptr %80, i64 %83
  %85 = getelementptr inbounds [2 x double], ptr %84, i64 0, i64 1
  %86 = load double, ptr %85, align 8, !tbaa !11
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = load i32, ptr %13, align 4, !tbaa !9
  %89 = zext i32 %88 to i64
  %90 = getelementptr inbounds [2 x double], ptr %87, i64 %89
  %91 = getelementptr inbounds [2 x double], ptr %90, i64 0, i64 1
  %92 = load double, ptr %91, align 8, !tbaa !11
  %93 = fsub double %86, %92
  store double %93, ptr %11, align 8, !tbaa !11
  %94 = load double, ptr %10, align 8, !tbaa !11
  %95 = load double, ptr %10, align 8, !tbaa !11
  %96 = load double, ptr %11, align 8, !tbaa !11
  %97 = load double, ptr %11, align 8, !tbaa !11
  %98 = fmul double %96, %97
  %99 = call double @llvm.fmuladd.f64(double %94, double %95, double %98)
  %100 = call double @sqrt(double noundef %99) #6
  %101 = load double, ptr %12, align 8, !tbaa !11
  %102 = fadd double %101, %100
  store double %102, ptr %12, align 8, !tbaa !11
  br label %103

103:                                              ; preds = %65
  %104 = load i32, ptr %13, align 4, !tbaa !9
  %105 = add i32 %104, 1
  store i32 %105, ptr %13, align 4, !tbaa !9
  br label %59, !llvm.loop !13

106:                                              ; preds = %64
  br label %242

107:                                              ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %108 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %108, ptr %14, align 4, !tbaa !9
  br label %109

109:                                              ; preds = %153, %107
  %110 = load i32, ptr %14, align 4, !tbaa !9
  %111 = load i32, ptr %7, align 4, !tbaa !9
  %112 = sub i32 %111, 2
  %113 = icmp ult i32 %110, %112
  br i1 %113, label %115, label %114

114:                                              ; preds = %109
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %156

115:                                              ; preds = %109
  %116 = load ptr, ptr %6, align 8, !tbaa !5
  %117 = load i32, ptr %14, align 4, !tbaa !9
  %118 = add i32 %117, 1
  %119 = zext i32 %118 to i64
  %120 = getelementptr inbounds [2 x double], ptr %116, i64 %119
  %121 = getelementptr inbounds [2 x double], ptr %120, i64 0, i64 0
  %122 = load double, ptr %121, align 8, !tbaa !11
  %123 = load ptr, ptr %6, align 8, !tbaa !5
  %124 = load i32, ptr %14, align 4, !tbaa !9
  %125 = zext i32 %124 to i64
  %126 = getelementptr inbounds [2 x double], ptr %123, i64 %125
  %127 = getelementptr inbounds [2 x double], ptr %126, i64 0, i64 0
  %128 = load double, ptr %127, align 8, !tbaa !11
  %129 = fsub double %122, %128
  store double %129, ptr %10, align 8, !tbaa !11
  %130 = load ptr, ptr %6, align 8, !tbaa !5
  %131 = load i32, ptr %14, align 4, !tbaa !9
  %132 = add i32 %131, 1
  %133 = zext i32 %132 to i64
  %134 = getelementptr inbounds [2 x double], ptr %130, i64 %133
  %135 = getelementptr inbounds [2 x double], ptr %134, i64 0, i64 1
  %136 = load double, ptr %135, align 8, !tbaa !11
  %137 = load ptr, ptr %6, align 8, !tbaa !5
  %138 = load i32, ptr %14, align 4, !tbaa !9
  %139 = zext i32 %138 to i64
  %140 = getelementptr inbounds [2 x double], ptr %137, i64 %139
  %141 = getelementptr inbounds [2 x double], ptr %140, i64 0, i64 1
  %142 = load double, ptr %141, align 8, !tbaa !11
  %143 = fsub double %136, %142
  store double %143, ptr %11, align 8, !tbaa !11
  %144 = load double, ptr %10, align 8, !tbaa !11
  %145 = load double, ptr %10, align 8, !tbaa !11
  %146 = load double, ptr %11, align 8, !tbaa !11
  %147 = load double, ptr %11, align 8, !tbaa !11
  %148 = fmul double %146, %147
  %149 = call double @llvm.fmuladd.f64(double %144, double %145, double %148)
  %150 = call double @sqrt(double noundef %149) #6
  %151 = load double, ptr %12, align 8, !tbaa !11
  %152 = fadd double %151, %150
  store double %152, ptr %12, align 8, !tbaa !11
  br label %153

153:                                              ; preds = %115
  %154 = load i32, ptr %14, align 4, !tbaa !9
  %155 = add i32 %154, 1
  store i32 %155, ptr %14, align 4, !tbaa !9
  br label %109, !llvm.loop !15

156:                                              ; preds = %114
  %157 = load ptr, ptr %6, align 8, !tbaa !5
  %158 = load i32, ptr %7, align 4, !tbaa !9
  %159 = sub i32 %158, 1
  %160 = zext i32 %159 to i64
  %161 = getelementptr inbounds [2 x double], ptr %157, i64 %160
  %162 = getelementptr inbounds [2 x double], ptr %161, i64 0, i64 0
  %163 = load double, ptr %162, align 8, !tbaa !11
  %164 = load ptr, ptr %6, align 8, !tbaa !5
  %165 = getelementptr inbounds [2 x double], ptr %164, i64 0
  %166 = getelementptr inbounds [2 x double], ptr %165, i64 0, i64 0
  %167 = load double, ptr %166, align 8, !tbaa !11
  %168 = fsub double %163, %167
  store double %168, ptr %10, align 8, !tbaa !11
  %169 = load ptr, ptr %6, align 8, !tbaa !5
  %170 = load i32, ptr %7, align 4, !tbaa !9
  %171 = sub i32 %170, 1
  %172 = zext i32 %171 to i64
  %173 = getelementptr inbounds [2 x double], ptr %169, i64 %172
  %174 = getelementptr inbounds [2 x double], ptr %173, i64 0, i64 1
  %175 = load double, ptr %174, align 8, !tbaa !11
  %176 = load ptr, ptr %6, align 8, !tbaa !5
  %177 = getelementptr inbounds [2 x double], ptr %176, i64 0
  %178 = getelementptr inbounds [2 x double], ptr %177, i64 0, i64 1
  %179 = load double, ptr %178, align 8, !tbaa !11
  %180 = fsub double %175, %179
  store double %180, ptr %11, align 8, !tbaa !11
  %181 = load double, ptr %10, align 8, !tbaa !11
  %182 = load double, ptr %10, align 8, !tbaa !11
  %183 = load double, ptr %11, align 8, !tbaa !11
  %184 = load double, ptr %11, align 8, !tbaa !11
  %185 = fmul double %183, %184
  %186 = call double @llvm.fmuladd.f64(double %181, double %182, double %185)
  %187 = call double @sqrt(double noundef %186) #6
  %188 = load double, ptr %12, align 8, !tbaa !11
  %189 = fadd double %188, %187
  store double %189, ptr %12, align 8, !tbaa !11
  %190 = load i32, ptr %9, align 4, !tbaa !9
  %191 = icmp ne i32 %190, 0
  br i1 %191, label %192, label %241

192:                                              ; preds = %156
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %193

193:                                              ; preds = %237, %192
  %194 = load i32, ptr %15, align 4, !tbaa !9
  %195 = load i32, ptr %9, align 4, !tbaa !9
  %196 = sub i32 %195, 1
  %197 = icmp ult i32 %194, %196
  br i1 %197, label %199, label %198

198:                                              ; preds = %193
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %240

199:                                              ; preds = %193
  %200 = load ptr, ptr %6, align 8, !tbaa !5
  %201 = load i32, ptr %15, align 4, !tbaa !9
  %202 = add i32 %201, 1
  %203 = zext i32 %202 to i64
  %204 = getelementptr inbounds [2 x double], ptr %200, i64 %203
  %205 = getelementptr inbounds [2 x double], ptr %204, i64 0, i64 0
  %206 = load double, ptr %205, align 8, !tbaa !11
  %207 = load ptr, ptr %6, align 8, !tbaa !5
  %208 = load i32, ptr %15, align 4, !tbaa !9
  %209 = zext i32 %208 to i64
  %210 = getelementptr inbounds [2 x double], ptr %207, i64 %209
  %211 = getelementptr inbounds [2 x double], ptr %210, i64 0, i64 0
  %212 = load double, ptr %211, align 8, !tbaa !11
  %213 = fsub double %206, %212
  store double %213, ptr %10, align 8, !tbaa !11
  %214 = load ptr, ptr %6, align 8, !tbaa !5
  %215 = load i32, ptr %15, align 4, !tbaa !9
  %216 = add i32 %215, 1
  %217 = zext i32 %216 to i64
  %218 = getelementptr inbounds [2 x double], ptr %214, i64 %217
  %219 = getelementptr inbounds [2 x double], ptr %218, i64 0, i64 1
  %220 = load double, ptr %219, align 8, !tbaa !11
  %221 = load ptr, ptr %6, align 8, !tbaa !5
  %222 = load i32, ptr %15, align 4, !tbaa !9
  %223 = zext i32 %222 to i64
  %224 = getelementptr inbounds [2 x double], ptr %221, i64 %223
  %225 = getelementptr inbounds [2 x double], ptr %224, i64 0, i64 1
  %226 = load double, ptr %225, align 8, !tbaa !11
  %227 = fsub double %220, %226
  store double %227, ptr %11, align 8, !tbaa !11
  %228 = load double, ptr %10, align 8, !tbaa !11
  %229 = load double, ptr %10, align 8, !tbaa !11
  %230 = load double, ptr %11, align 8, !tbaa !11
  %231 = load double, ptr %11, align 8, !tbaa !11
  %232 = fmul double %230, %231
  %233 = call double @llvm.fmuladd.f64(double %228, double %229, double %232)
  %234 = call double @sqrt(double noundef %233) #6
  %235 = load double, ptr %12, align 8, !tbaa !11
  %236 = fadd double %235, %234
  store double %236, ptr %12, align 8, !tbaa !11
  br label %237

237:                                              ; preds = %199
  %238 = load i32, ptr %15, align 4, !tbaa !9
  %239 = add i32 %238, 1
  store i32 %239, ptr %15, align 4, !tbaa !9
  br label %193, !llvm.loop !16

240:                                              ; preds = %198
  br label %241

241:                                              ; preds = %240, %156
  br label %242

242:                                              ; preds = %241, %106
  %243 = load double, ptr %12, align 8, !tbaa !11
  store double %243, ptr %5, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %244

244:                                              ; preds = %242, %52
  %245 = load double, ptr %5, align 8
  ret double %245
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
attributes #7 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [39 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@__func__.Math_polyVertexDistance = external hidden unnamed_addr constant [24 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [25 x i8], align 1

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #0

declare void @print_trace() local_unnamed_addr #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

; Function Attrs: nounwind uwtable
define dso_local double @Math_polyVertexDistance(ptr nocapture noundef readonly %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #4 {
  %5 = icmp ult i32 %2, %1
  br i1 %5, label %13, label %6

6:                                                ; preds = %4
  %7 = load ptr, ptr @stderr, align 8, !tbaa !5
  %8 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %7, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.Math_polyVertexDistance, i32 noundef 1527, ptr noundef nonnull @.str.14) #6
  %9 = load ptr, ptr @stderr, align 8, !tbaa !5
  %10 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %9, ptr noundef nonnull @.str.15, i32 noundef %2, i32 noundef %1) #6
  %11 = load ptr, ptr @stderr, align 8, !tbaa !5
  %12 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef nonnull @.str.4) #6
  tail call void @print_trace() #7
  tail call void @exit(i32 noundef 1) #8
  unreachable

13:                                               ; preds = %4
  %14 = icmp ult i32 %3, %1
  br i1 %14, label %22, label %15

15:                                               ; preds = %13
  %16 = load ptr, ptr @stderr, align 8, !tbaa !5
  %17 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.Math_polyVertexDistance, i32 noundef 1528, ptr noundef nonnull @.str.16) #6
  %18 = load ptr, ptr @stderr, align 8, !tbaa !5
  %19 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef nonnull @.str.17, i32 noundef %3, i32 noundef %1) #6
  %20 = load ptr, ptr @stderr, align 8, !tbaa !5
  %21 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %20, ptr noundef nonnull @.str.4) #6
  tail call void @print_trace() #7
  tail call void @exit(i32 noundef 1) #8
  unreachable

22:                                               ; preds = %13
  %23 = icmp eq i32 %2, %3
  %24 = icmp ult i32 %1, 2
  %or.cond = or i1 %24, %23
  br i1 %or.cond, label %.loopexit, label %25

25:                                               ; preds = %22
  %26 = icmp ugt i32 %3, %2
  br i1 %26, label %.preheader, label %.preheader90

.preheader90:                                     ; preds = %25
  %27 = add i32 %1, -2
  %28 = icmp ugt i32 %27, %2
  br i1 %28, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.preheader90
  %29 = zext i32 %2 to i64
  %wide.trip.count = zext i32 %27 to i64
  %.phi.trans.insert = getelementptr inbounds [2 x double], ptr %0, i64 %29
  %.pre = load double, ptr %.phi.trans.insert, align 8, !tbaa !9
  %.phi.trans.insert116 = getelementptr inbounds i8, ptr %.phi.trans.insert, i64 8
  %.pre117 = load double, ptr %.phi.trans.insert116, align 8, !tbaa !9
  %30 = sub nsw i64 %wide.trip.count, %29
  %xtraiter = and i64 %30, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol

.lr.ph.prol:                                      ; preds = %.lr.ph.preheader
  %indvars.iv.next.prol = add nuw nsw i64 %29, 1
  %31 = getelementptr inbounds [2 x double], ptr %0, i64 %indvars.iv.next.prol
  %32 = load double, ptr %31, align 8, !tbaa !9
  %33 = fsub double %32, %.pre
  %34 = getelementptr inbounds i8, ptr %31, i64 8
  %35 = load double, ptr %34, align 8, !tbaa !9
  %36 = fsub double %35, %.pre117
  %37 = fmul double %36, %36
  %38 = tail call double @llvm.fmuladd.f64(double %33, double %33, double %37)
  %sqrt86.prol = tail call double @llvm.sqrt.f64(double %38)
  br label %.lr.ph.prol.loopexit

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader
  %.lcssa130.unr = phi double [ poison, %.lr.ph.preheader ], [ %sqrt86.prol, %.lr.ph.prol ]
  %.unr = phi double [ %.pre117, %.lr.ph.preheader ], [ %35, %.lr.ph.prol ]
  %.unr131 = phi double [ %.pre, %.lr.ph.preheader ], [ %32, %.lr.ph.prol ]
  %indvars.iv.unr = phi i64 [ %29, %.lr.ph.preheader ], [ %indvars.iv.next.prol, %.lr.ph.prol ]
  %.191.unr = phi double [ 0.000000e+00, %.lr.ph.preheader ], [ %sqrt86.prol, %.lr.ph.prol ]
  %39 = add nsw i64 %wide.trip.count, -1
  %40 = icmp eq i64 %39, %29
  br i1 %40, label %._crit_edge, label %.lr.ph

.preheader:                                       ; preds = %25
  %41 = add i32 %3, -1
  %42 = icmp ugt i32 %41, %2
  br i1 %42, label %.lr.ph99.preheader, label %.loopexit

.lr.ph99.preheader:                               ; preds = %.preheader
  %43 = zext i32 %2 to i64
  %wide.trip.count114 = zext i32 %41 to i64
  %.phi.trans.insert118 = getelementptr inbounds [2 x double], ptr %0, i64 %43
  %.pre119 = load double, ptr %.phi.trans.insert118, align 8, !tbaa !9
  %.phi.trans.insert120 = getelementptr inbounds i8, ptr %.phi.trans.insert118, i64 8
  %.pre121 = load double, ptr %.phi.trans.insert120, align 8, !tbaa !9
  %44 = sub nsw i64 %wide.trip.count114, %43
  %xtraiter137 = and i64 %44, 1
  %lcmp.mod138.not = icmp eq i64 %xtraiter137, 0
  br i1 %lcmp.mod138.not, label %.lr.ph99.prol.loopexit, label %.lr.ph99.prol

.lr.ph99.prol:                                    ; preds = %.lr.ph99.preheader
  %indvars.iv.next112.prol = add nuw nsw i64 %43, 1
  %45 = getelementptr inbounds [2 x double], ptr %0, i64 %indvars.iv.next112.prol
  %46 = load double, ptr %45, align 8, !tbaa !9
  %47 = fsub double %46, %.pre119
  %48 = getelementptr inbounds i8, ptr %45, i64 8
  %49 = load double, ptr %48, align 8, !tbaa !9
  %50 = fsub double %49, %.pre121
  %51 = fmul double %50, %50
  %52 = tail call double @llvm.fmuladd.f64(double %47, double %47, double %51)
  %sqrt.prol = tail call double @llvm.sqrt.f64(double %52)
  br label %.lr.ph99.prol.loopexit

.lr.ph99.prol.loopexit:                           ; preds = %.lr.ph99.prol, %.lr.ph99.preheader
  %.lcssa.unr = phi double [ poison, %.lr.ph99.preheader ], [ %sqrt.prol, %.lr.ph99.prol ]
  %.unr139 = phi double [ %.pre121, %.lr.ph99.preheader ], [ %49, %.lr.ph99.prol ]
  %.unr140 = phi double [ %.pre119, %.lr.ph99.preheader ], [ %46, %.lr.ph99.prol ]
  %indvars.iv111.unr = phi i64 [ %43, %.lr.ph99.preheader ], [ %indvars.iv.next112.prol, %.lr.ph99.prol ]
  %.07997.unr = phi double [ 0.000000e+00, %.lr.ph99.preheader ], [ %sqrt.prol, %.lr.ph99.prol ]
  %53 = add nsw i64 %wide.trip.count114, -1
  %54 = icmp eq i64 %53, %43
  br i1 %54, label %.loopexit, label %.lr.ph99

.lr.ph99:                                         ; preds = %.lr.ph99.prol.loopexit, %.lr.ph99
  %55 = phi double [ %71, %.lr.ph99 ], [ %.unr139, %.lr.ph99.prol.loopexit ]
  %56 = phi double [ %68, %.lr.ph99 ], [ %.unr140, %.lr.ph99.prol.loopexit ]
  %indvars.iv111 = phi i64 [ %indvars.iv.next112.1, %.lr.ph99 ], [ %indvars.iv111.unr, %.lr.ph99.prol.loopexit ]
  %.07997 = phi double [ %75, %.lr.ph99 ], [ %.07997.unr, %.lr.ph99.prol.loopexit ]
  %57 = getelementptr [2 x double], ptr %0, i64 %indvars.iv111
  %58 = getelementptr i8, ptr %57, i64 16
  %59 = load double, ptr %58, align 8, !tbaa !9
  %60 = fsub double %59, %56
  %61 = getelementptr i8, ptr %57, i64 24
  %62 = load double, ptr %61, align 8, !tbaa !9
  %63 = fsub double %62, %55
  %64 = fmul double %63, %63
  %65 = tail call double @llvm.fmuladd.f64(double %60, double %60, double %64)
  %sqrt = tail call double @llvm.sqrt.f64(double %65)
  %66 = fadd double %.07997, %sqrt
  %indvars.iv.next112.1 = add nuw nsw i64 %indvars.iv111, 2
  %67 = getelementptr inbounds [2 x double], ptr %0, i64 %indvars.iv.next112.1
  %68 = load double, ptr %67, align 8, !tbaa !9
  %69 = fsub double %68, %59
  %70 = getelementptr inbounds i8, ptr %67, i64 8
  %71 = load double, ptr %70, align 8, !tbaa !9
  %72 = fsub double %71, %62
  %73 = fmul double %72, %72
  %74 = tail call double @llvm.fmuladd.f64(double %69, double %69, double %73)
  %sqrt.1 = tail call double @llvm.sqrt.f64(double %74)
  %75 = fadd double %66, %sqrt.1
  %exitcond115.not.1 = icmp eq i64 %indvars.iv.next112.1, %wide.trip.count114
  br i1 %exitcond115.not.1, label %.loopexit, label %.lr.ph99, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %.preheader90
  %.1.lcssa = phi double [ 0.000000e+00, %.preheader90 ], [ %.lcssa130.unr, %.lr.ph.prol.loopexit ], [ %112, %.lr.ph ]
  %76 = add i32 %1, -1
  %77 = zext i32 %76 to i64
  %78 = getelementptr inbounds [2 x double], ptr %0, i64 %77
  %79 = load double, ptr %78, align 8, !tbaa !9
  %80 = load double, ptr %0, align 8, !tbaa !9
  %81 = fsub double %79, %80
  %82 = getelementptr inbounds i8, ptr %78, i64 8
  %83 = load double, ptr %82, align 8, !tbaa !9
  %84 = getelementptr inbounds i8, ptr %0, i64 8
  %85 = load double, ptr %84, align 8, !tbaa !9
  %86 = fsub double %83, %85
  %87 = fmul double %86, %86
  %88 = tail call double @llvm.fmuladd.f64(double %81, double %81, double %87)
  %sqrt85 = tail call double @llvm.sqrt.f64(double %88)
  %89 = fadd double %.1.lcssa, %sqrt85
  %.not = icmp eq i32 %3, 0
  br i1 %.not, label %.loopexit, label %.preheader88

.preheader88:                                     ; preds = %._crit_edge
  %90 = add i32 %3, -1
  %.not101 = icmp eq i32 %90, 0
  br i1 %.not101, label %.loopexit, label %.lr.ph95.preheader

.lr.ph95.preheader:                               ; preds = %.preheader88
  %wide.trip.count109 = zext i32 %90 to i64
  %xtraiter132 = and i64 %wide.trip.count109, 1
  %91 = icmp eq i32 %90, 1
  br i1 %91, label %.loopexit.loopexit128.unr-lcssa, label %.lr.ph95.preheader.new

.lr.ph95.preheader.new:                           ; preds = %.lr.ph95.preheader
  %unroll_iter = and i64 %wide.trip.count109, 4294967294
  br label %.lr.ph95

.lr.ph:                                           ; preds = %.lr.ph.prol.loopexit, %.lr.ph
  %92 = phi double [ %108, %.lr.ph ], [ %.unr, %.lr.ph.prol.loopexit ]
  %93 = phi double [ %105, %.lr.ph ], [ %.unr131, %.lr.ph.prol.loopexit ]
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %.lr.ph ], [ %indvars.iv.unr, %.lr.ph.prol.loopexit ]
  %.191 = phi double [ %112, %.lr.ph ], [ %.191.unr, %.lr.ph.prol.loopexit ]
  %94 = getelementptr [2 x double], ptr %0, i64 %indvars.iv
  %95 = getelementptr i8, ptr %94, i64 16
  %96 = load double, ptr %95, align 8, !tbaa !9
  %97 = fsub double %96, %93
  %98 = getelementptr i8, ptr %94, i64 24
  %99 = load double, ptr %98, align 8, !tbaa !9
  %100 = fsub double %99, %92
  %101 = fmul double %100, %100
  %102 = tail call double @llvm.fmuladd.f64(double %97, double %97, double %101)
  %sqrt86 = tail call double @llvm.sqrt.f64(double %102)
  %103 = fadd double %.191, %sqrt86
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %104 = getelementptr inbounds [2 x double], ptr %0, i64 %indvars.iv.next.1
  %105 = load double, ptr %104, align 8, !tbaa !9
  %106 = fsub double %105, %96
  %107 = getelementptr inbounds i8, ptr %104, i64 8
  %108 = load double, ptr %107, align 8, !tbaa !9
  %109 = fsub double %108, %99
  %110 = fmul double %109, %109
  %111 = tail call double @llvm.fmuladd.f64(double %106, double %106, double %110)
  %sqrt86.1 = tail call double @llvm.sqrt.f64(double %111)
  %112 = fadd double %103, %sqrt86.1
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %wide.trip.count
  br i1 %exitcond.not.1, label %._crit_edge, label %.lr.ph, !llvm.loop !13

.lr.ph95:                                         ; preds = %.lr.ph95, %.lr.ph95.preheader.new
  %113 = phi double [ %85, %.lr.ph95.preheader.new ], [ %128, %.lr.ph95 ]
  %114 = phi double [ %80, %.lr.ph95.preheader.new ], [ %125, %.lr.ph95 ]
  %indvars.iv106 = phi i64 [ 0, %.lr.ph95.preheader.new ], [ %indvars.iv.next107.1, %.lr.ph95 ]
  %.293 = phi double [ %89, %.lr.ph95.preheader.new ], [ %132, %.lr.ph95 ]
  %niter = phi i64 [ 0, %.lr.ph95.preheader.new ], [ %niter.next.1, %.lr.ph95 ]
  %indvars.iv.next107 = or disjoint i64 %indvars.iv106, 1
  %115 = getelementptr inbounds [2 x double], ptr %0, i64 %indvars.iv.next107
  %116 = load double, ptr %115, align 8, !tbaa !9
  %117 = fsub double %116, %114
  %118 = getelementptr inbounds i8, ptr %115, i64 8
  %119 = load double, ptr %118, align 8, !tbaa !9
  %120 = fsub double %119, %113
  %121 = fmul double %120, %120
  %122 = tail call double @llvm.fmuladd.f64(double %117, double %117, double %121)
  %sqrt87 = tail call double @llvm.sqrt.f64(double %122)
  %123 = fadd double %.293, %sqrt87
  %indvars.iv.next107.1 = add nuw nsw i64 %indvars.iv106, 2
  %124 = getelementptr inbounds [2 x double], ptr %0, i64 %indvars.iv.next107.1
  %125 = load double, ptr %124, align 8, !tbaa !9
  %126 = fsub double %125, %116
  %127 = getelementptr inbounds i8, ptr %124, i64 8
  %128 = load double, ptr %127, align 8, !tbaa !9
  %129 = fsub double %128, %119
  %130 = fmul double %129, %129
  %131 = tail call double @llvm.fmuladd.f64(double %126, double %126, double %130)
  %sqrt87.1 = tail call double @llvm.sqrt.f64(double %131)
  %132 = fadd double %123, %sqrt87.1
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.loopexit.loopexit128.unr-lcssa.loopexit, label %.lr.ph95, !llvm.loop !14

.loopexit.loopexit128.unr-lcssa.loopexit:         ; preds = %.lr.ph95
  %133 = add nuw nsw i64 %indvars.iv106, 3
  br label %.loopexit.loopexit128.unr-lcssa

.loopexit.loopexit128.unr-lcssa:                  ; preds = %.loopexit.loopexit128.unr-lcssa.loopexit, %.lr.ph95.preheader
  %.lcssa129.ph = phi double [ poison, %.lr.ph95.preheader ], [ %132, %.loopexit.loopexit128.unr-lcssa.loopexit ]
  %.unr133 = phi double [ %85, %.lr.ph95.preheader ], [ %128, %.loopexit.loopexit128.unr-lcssa.loopexit ]
  %.unr134 = phi double [ %80, %.lr.ph95.preheader ], [ %125, %.loopexit.loopexit128.unr-lcssa.loopexit ]
  %indvars.iv106.unr = phi i64 [ 1, %.lr.ph95.preheader ], [ %133, %.loopexit.loopexit128.unr-lcssa.loopexit ]
  %.293.unr = phi double [ %89, %.lr.ph95.preheader ], [ %132, %.loopexit.loopexit128.unr-lcssa.loopexit ]
  %lcmp.mod135.not = icmp eq i64 %xtraiter132, 0
  br i1 %lcmp.mod135.not, label %.loopexit, label %.lr.ph95.epil

.lr.ph95.epil:                                    ; preds = %.loopexit.loopexit128.unr-lcssa
  %134 = getelementptr inbounds [2 x double], ptr %0, i64 %indvars.iv106.unr
  %135 = load double, ptr %134, align 8, !tbaa !9
  %136 = fsub double %135, %.unr134
  %137 = getelementptr inbounds i8, ptr %134, i64 8
  %138 = load double, ptr %137, align 8, !tbaa !9
  %139 = fsub double %138, %.unr133
  %140 = fmul double %139, %139
  %141 = tail call double @llvm.fmuladd.f64(double %136, double %136, double %140)
  %sqrt87.epil = tail call double @llvm.sqrt.f64(double %141)
  %142 = fadd double %.293.unr, %sqrt87.epil
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph95.epil, %.loopexit.loopexit128.unr-lcssa, %.lr.ph99.prol.loopexit, %.lr.ph99, %.preheader88, %.preheader, %._crit_edge, %22
  %.080 = phi double [ 0.000000e+00, %22 ], [ %89, %._crit_edge ], [ 0.000000e+00, %.preheader ], [ %89, %.preheader88 ], [ %.lcssa.unr, %.lr.ph99.prol.loopexit ], [ %75, %.lr.ph99 ], [ %.lcssa129.ph, %.loopexit.loopexit128.unr-lcssa ], [ %142, %.lr.ph95.epil ]
  ret double %.080
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.sqrt.f64(double) #5

attributes #0 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { cold nounwind }
attributes #7 = { nounwind }
attributes #8 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}


; Effective O3 passes: AggressiveInstCombinePass,BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass