; LLVM IR from csviragh/robotsim :: src/utilities (math_utils)

; 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"

@CreateEnvelopeSquareAroundPolygons.smallestx = external hidden global double, align 8
@CreateEnvelopeSquareAroundPolygons.largestx = external hidden global double, align 8
@CreateEnvelopeSquareAroundPolygons.smallesty = external hidden global double, align 8
@CreateEnvelopeSquareAroundPolygons.largesty = external hidden global double, align 8
@CreateEnvelopeSquareAroundPolygons.plussize_x = external hidden global double, align 8
@CreateEnvelopeSquareAroundPolygons.plussize_y = external hidden global double, align 8

; 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #1

; Function Attrs: nounwind uwtable
define dso_local void @CreateEnvelopeSquareAroundPolygons(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) #2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store i32 %3, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store double 2.000000e+222, ptr @CreateEnvelopeSquareAroundPolygons.smallestx, align 8, !tbaa !11
  store double -2.000000e+222, ptr @CreateEnvelopeSquareAroundPolygons.largestx, align 8, !tbaa !11
  store double 2.000000e+222, ptr @CreateEnvelopeSquareAroundPolygons.smallesty, align 8, !tbaa !11
  store double -2.000000e+222, ptr @CreateEnvelopeSquareAroundPolygons.largesty, align 8, !tbaa !11
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %11

11:                                               ; preds = %120, %4
  %12 = load i32, ptr %9, align 4, !tbaa !9
  %13 = load i32, ptr %8, align 4, !tbaa !9
  %14 = icmp slt i32 %12, %13
  br i1 %14, label %15, label %123

15:                                               ; preds = %11
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %16

16:                                               ; preds = %116, %15
  %17 = load i32, ptr %10, align 4, !tbaa !9
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = load i32, ptr %9, align 4, !tbaa !9
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds i32, ptr %18, i64 %20
  %22 = load i32, ptr %21, align 4, !tbaa !9
  %23 = mul nsw i32 %22, 2
  %24 = icmp slt i32 %17, %23
  br i1 %24, label %25, label %119

25:                                               ; preds = %16
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = load i32, ptr %9, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds ptr, ptr %26, i64 %28
  %30 = load ptr, ptr %29, align 8, !tbaa !5
  %31 = load i32, ptr %10, align 4, !tbaa !9
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds double, ptr %30, i64 %32
  %34 = load double, ptr %33, align 8, !tbaa !11
  %35 = load double, ptr @CreateEnvelopeSquareAroundPolygons.smallestx, align 8, !tbaa !11
  %36 = fcmp olt double %34, %35
  br i1 %36, label %37, label %47

37:                                               ; preds = %25
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = load i32, ptr %9, align 4, !tbaa !9
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds ptr, ptr %38, i64 %40
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  %43 = load i32, ptr %10, align 4, !tbaa !9
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds double, ptr %42, i64 %44
  %46 = load double, ptr %45, align 8, !tbaa !11
  store double %46, ptr @CreateEnvelopeSquareAroundPolygons.smallestx, align 8, !tbaa !11
  br label %47

47:                                               ; preds = %37, %25
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = load i32, ptr %9, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds ptr, ptr %48, i64 %50
  %52 = load ptr, ptr %51, align 8, !tbaa !5
  %53 = load i32, ptr %10, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds double, ptr %52, i64 %54
  %56 = load double, ptr %55, align 8, !tbaa !11
  %57 = load double, ptr @CreateEnvelopeSquareAroundPolygons.largestx, align 8, !tbaa !11
  %58 = fcmp ogt double %56, %57
  br i1 %58, label %59, label %69

59:                                               ; preds = %47
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = load i32, ptr %9, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds ptr, ptr %60, i64 %62
  %64 = load ptr, ptr %63, align 8, !tbaa !5
  %65 = load i32, ptr %10, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds double, ptr %64, i64 %66
  %68 = load double, ptr %67, align 8, !tbaa !11
  store double %68, ptr @CreateEnvelopeSquareAroundPolygons.largestx, align 8, !tbaa !11
  br label %69

69:                                               ; preds = %59, %47
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = load i32, ptr %9, align 4, !tbaa !9
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds ptr, ptr %70, i64 %72
  %74 = load ptr, ptr %73, align 8, !tbaa !5
  %75 = load i32, ptr %10, align 4, !tbaa !9
  %76 = add nsw i32 %75, 1
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds double, ptr %74, i64 %77
  %79 = load double, ptr %78, align 8, !tbaa !11
  %80 = load double, ptr @CreateEnvelopeSquareAroundPolygons.smallesty, align 8, !tbaa !11
  %81 = fcmp olt double %79, %80
  br i1 %81, label %82, label %92

82:                                               ; preds = %69
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = load i32, ptr %9, align 4, !tbaa !9
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds ptr, ptr %83, i64 %85
  %87 = load ptr, ptr %86, align 8, !tbaa !5
  %88 = load i32, ptr %10, align 4, !tbaa !9
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds double, ptr %87, i64 %89
  %91 = load double, ptr %90, align 8, !tbaa !11
  store double %91, ptr @CreateEnvelopeSquareAroundPolygons.smallesty, align 8, !tbaa !11
  br label %92

92:                                               ; preds = %82, %69
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = load i32, ptr %9, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds ptr, ptr %93, i64 %95
  %97 = load ptr, ptr %96, align 8, !tbaa !5
  %98 = load i32, ptr %10, align 4, !tbaa !9
  %99 = add nsw i32 %98, 1
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds double, ptr %97, i64 %100
  %102 = load double, ptr %101, align 8, !tbaa !11
  %103 = load double, ptr @CreateEnvelopeSquareAroundPolygons.largesty, align 8, !tbaa !11
  %104 = fcmp ogt double %102, %103
  br i1 %104, label %105, label %115

105:                                              ; preds = %92
  %106 = load ptr, ptr %6, align 8, !tbaa !5
  %107 = load i32, ptr %9, align 4, !tbaa !9
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds ptr, ptr %106, i64 %108
  %110 = load ptr, ptr %109, align 8, !tbaa !5
  %111 = load i32, ptr %10, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds double, ptr %110, i64 %112
  %114 = load double, ptr %113, align 8, !tbaa !11
  store double %114, ptr @CreateEnvelopeSquareAroundPolygons.largesty, align 8, !tbaa !11
  br label %115

115:                                              ; preds = %105, %92
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %10, align 4, !tbaa !9
  %118 = add nsw i32 %117, 2
  store i32 %118, ptr %10, align 4, !tbaa !9
  br label %16, !llvm.loop !13

119:                                              ; preds = %16
  br label %120

120:                                              ; preds = %119
  %121 = load i32, ptr %9, align 4, !tbaa !9
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %9, align 4, !tbaa !9
  br label %11, !llvm.loop !15

123:                                              ; preds = %11
  %124 = load double, ptr @CreateEnvelopeSquareAroundPolygons.largestx, align 8, !tbaa !11
  %125 = load double, ptr @CreateEnvelopeSquareAroundPolygons.smallestx, align 8, !tbaa !11
  %126 = fsub double %124, %125
  %127 = call double @llvm.fabs.f64(double %126)
  %128 = fmul double %127, 5.000000e-01
  store double %128, ptr @CreateEnvelopeSquareAroundPolygons.plussize_x, align 8, !tbaa !11
  %129 = load double, ptr @CreateEnvelopeSquareAroundPolygons.largesty, align 8, !tbaa !11
  %130 = load double, ptr @CreateEnvelopeSquareAroundPolygons.smallesty, align 8, !tbaa !11
  %131 = fsub double %129, %130
  %132 = call double @llvm.fabs.f64(double %131)
  %133 = fmul double %132, 5.000000e-01
  store double %133, ptr @CreateEnvelopeSquareAroundPolygons.plussize_y, align 8, !tbaa !11
  %134 = load double, ptr @CreateEnvelopeSquareAroundPolygons.smallestx, align 8, !tbaa !11
  %135 = load double, ptr @CreateEnvelopeSquareAroundPolygons.plussize_x, align 8, !tbaa !11
  %136 = fsub double %134, %135
  %137 = load ptr, ptr %5, align 8, !tbaa !5
  %138 = getelementptr inbounds ptr, ptr %137, i64 0
  %139 = load ptr, ptr %138, align 8, !tbaa !5
  %140 = getelementptr inbounds double, ptr %139, i64 0
  store double %136, ptr %140, align 8, !tbaa !11
  %141 = load double, ptr @CreateEnvelopeSquareAroundPolygons.smallesty, align 8, !tbaa !11
  %142 = load double, ptr @CreateEnvelopeSquareAroundPolygons.plussize_y, align 8, !tbaa !11
  %143 = fsub double %141, %142
  %144 = load ptr, ptr %5, align 8, !tbaa !5
  %145 = getelementptr inbounds ptr, ptr %144, i64 0
  %146 = load ptr, ptr %145, align 8, !tbaa !5
  %147 = getelementptr inbounds double, ptr %146, i64 1
  store double %143, ptr %147, align 8, !tbaa !11
  %148 = load double, ptr @CreateEnvelopeSquareAroundPolygons.largestx, align 8, !tbaa !11
  %149 = load double, ptr @CreateEnvelopeSquareAroundPolygons.plussize_x, align 8, !tbaa !11
  %150 = fadd double %148, %149
  %151 = load ptr, ptr %5, align 8, !tbaa !5
  %152 = getelementptr inbounds ptr, ptr %151, i64 1
  %153 = load ptr, ptr %152, align 8, !tbaa !5
  %154 = getelementptr inbounds double, ptr %153, i64 0
  store double %150, ptr %154, align 8, !tbaa !11
  %155 = load double, ptr @CreateEnvelopeSquareAroundPolygons.smallesty, align 8, !tbaa !11
  %156 = load double, ptr @CreateEnvelopeSquareAroundPolygons.plussize_y, align 8, !tbaa !11
  %157 = fsub double %155, %156
  %158 = load ptr, ptr %5, align 8, !tbaa !5
  %159 = getelementptr inbounds ptr, ptr %158, i64 1
  %160 = load ptr, ptr %159, align 8, !tbaa !5
  %161 = getelementptr inbounds double, ptr %160, i64 1
  store double %157, ptr %161, align 8, !tbaa !11
  %162 = load double, ptr @CreateEnvelopeSquareAroundPolygons.largestx, align 8, !tbaa !11
  %163 = load double, ptr @CreateEnvelopeSquareAroundPolygons.plussize_x, align 8, !tbaa !11
  %164 = fadd double %162, %163
  %165 = load ptr, ptr %5, align 8, !tbaa !5
  %166 = getelementptr inbounds ptr, ptr %165, i64 2
  %167 = load ptr, ptr %166, align 8, !tbaa !5
  %168 = getelementptr inbounds double, ptr %167, i64 0
  store double %164, ptr %168, align 8, !tbaa !11
  %169 = load double, ptr @CreateEnvelopeSquareAroundPolygons.largesty, align 8, !tbaa !11
  %170 = load double, ptr @CreateEnvelopeSquareAroundPolygons.plussize_y, align 8, !tbaa !11
  %171 = fadd double %169, %170
  %172 = load ptr, ptr %5, align 8, !tbaa !5
  %173 = getelementptr inbounds ptr, ptr %172, i64 2
  %174 = load ptr, ptr %173, align 8, !tbaa !5
  %175 = getelementptr inbounds double, ptr %174, i64 1
  store double %171, ptr %175, align 8, !tbaa !11
  %176 = load double, ptr @CreateEnvelopeSquareAroundPolygons.smallestx, align 8, !tbaa !11
  %177 = load double, ptr @CreateEnvelopeSquareAroundPolygons.plussize_x, align 8, !tbaa !11
  %178 = fsub double %176, %177
  %179 = load ptr, ptr %5, align 8, !tbaa !5
  %180 = getelementptr inbounds ptr, ptr %179, i64 3
  %181 = load ptr, ptr %180, align 8, !tbaa !5
  %182 = getelementptr inbounds double, ptr %181, i64 0
  store double %178, ptr %182, align 8, !tbaa !11
  %183 = load double, ptr @CreateEnvelopeSquareAroundPolygons.largesty, align 8, !tbaa !11
  %184 = load double, ptr @CreateEnvelopeSquareAroundPolygons.plussize_y, align 8, !tbaa !11
  %185 = fsub double %183, %184
  %186 = load ptr, ptr %5, align 8, !tbaa !5
  %187 = getelementptr inbounds ptr, ptr %186, i64 3
  %188 = load ptr, ptr %187, align 8, !tbaa !5
  %189 = getelementptr inbounds double, ptr %188, i64 1
  store double %185, ptr %189, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 #3 = { 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}


; 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"

@CreateEnvelopeSquareAroundPolygons.smallestx = external hidden local_unnamed_addr global double, align 8
@CreateEnvelopeSquareAroundPolygons.largestx = external hidden local_unnamed_addr global double, align 8
@CreateEnvelopeSquareAroundPolygons.smallesty = external hidden local_unnamed_addr global double, align 8
@CreateEnvelopeSquareAroundPolygons.largesty = external hidden local_unnamed_addr global double, align 8
@CreateEnvelopeSquareAroundPolygons.plussize_x = external hidden local_unnamed_addr global double, align 8
@CreateEnvelopeSquareAroundPolygons.plussize_y = external hidden local_unnamed_addr global double, align 8

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

; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @CreateEnvelopeSquareAroundPolygons(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3) local_unnamed_addr #1 {
  store double 2.000000e+222, ptr @CreateEnvelopeSquareAroundPolygons.smallestx, align 8, !tbaa !5
  store double -2.000000e+222, ptr @CreateEnvelopeSquareAroundPolygons.largestx, align 8, !tbaa !5
  store double 2.000000e+222, ptr @CreateEnvelopeSquareAroundPolygons.smallesty, align 8, !tbaa !5
  store double -2.000000e+222, ptr @CreateEnvelopeSquareAroundPolygons.largesty, align 8, !tbaa !5
  %5 = icmp sgt i32 %3, 0
  br i1 %5, label %.preheader.preheader, label %._crit_edge67

.preheader.preheader:                             ; preds = %4
  %wide.trip.count = zext nneg i32 %3 to i64
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge
  %indvars.iv69 = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next70, %._crit_edge ]
  %CreateEnvelopeSquareAroundPolygons.smallestx.promoted4665 = phi double [ 2.000000e+222, %.preheader.preheader ], [ %CreateEnvelopeSquareAroundPolygons.smallestx.promoted43, %._crit_edge ]
  %CreateEnvelopeSquareAroundPolygons.largestx.promoted5164 = phi double [ -2.000000e+222, %.preheader.preheader ], [ %CreateEnvelopeSquareAroundPolygons.largestx.promoted48, %._crit_edge ]
  %CreateEnvelopeSquareAroundPolygons.smallesty.promoted5663 = phi double [ 2.000000e+222, %.preheader.preheader ], [ %CreateEnvelopeSquareAroundPolygons.smallesty.promoted53, %._crit_edge ]
  %CreateEnvelopeSquareAroundPolygons.largesty.promoted6162 = phi double [ -2.000000e+222, %.preheader.preheader ], [ %CreateEnvelopeSquareAroundPolygons.largesty.promoted58, %._crit_edge ]
  %6 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv69
  %7 = load i32, ptr %6, align 4, !tbaa !9
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %9 = shl nuw nsw i32 %7, 1
  %10 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv69
  %11 = load ptr, ptr %10, align 8, !tbaa !11
  %12 = zext nneg i32 %9 to i64
  br label %13

13:                                               ; preds = %.lr.ph, %41
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %41 ]
  %CreateEnvelopeSquareAroundPolygons.largesty.promoted60 = phi double [ %CreateEnvelopeSquareAroundPolygons.largesty.promoted6162, %.lr.ph ], [ %CreateEnvelopeSquareAroundPolygons.largesty.promoted59, %41 ]
  %CreateEnvelopeSquareAroundPolygons.smallesty.promoted55 = phi double [ %CreateEnvelopeSquareAroundPolygons.smallesty.promoted5663, %.lr.ph ], [ %CreateEnvelopeSquareAroundPolygons.smallesty.promoted54, %41 ]
  %CreateEnvelopeSquareAroundPolygons.largestx.promoted50 = phi double [ %CreateEnvelopeSquareAroundPolygons.largestx.promoted5164, %.lr.ph ], [ %CreateEnvelopeSquareAroundPolygons.largestx.promoted49, %41 ]
  %CreateEnvelopeSquareAroundPolygons.smallestx.promoted45 = phi double [ %CreateEnvelopeSquareAroundPolygons.smallestx.promoted4665, %.lr.ph ], [ %CreateEnvelopeSquareAroundPolygons.smallestx.promoted44, %41 ]
  %14 = phi double [ %CreateEnvelopeSquareAroundPolygons.smallestx.promoted4665, %.lr.ph ], [ %24, %41 ]
  %15 = phi double [ %CreateEnvelopeSquareAroundPolygons.largestx.promoted5164, %.lr.ph ], [ %28, %41 ]
  %16 = phi double [ %CreateEnvelopeSquareAroundPolygons.smallesty.promoted5663, %.lr.ph ], [ %37, %41 ]
  %17 = phi double [ %CreateEnvelopeSquareAroundPolygons.largesty.promoted6162, %.lr.ph ], [ %42, %41 ]
  %18 = getelementptr inbounds double, ptr %11, i64 %indvars.iv
  %19 = load double, ptr %18, align 8, !tbaa !5
  %20 = fcmp olt double %19, %14
  br i1 %20, label %21, label %22

21:                                               ; preds = %13
  store double %19, ptr @CreateEnvelopeSquareAroundPolygons.smallestx, align 8, !tbaa !5
  %.pre = load double, ptr %18, align 8, !tbaa !5
  br label %22

22:                                               ; preds = %21, %13
  %23 = phi double [ %.pre, %21 ], [ %19, %13 ]
  %CreateEnvelopeSquareAroundPolygons.smallestx.promoted44 = phi double [ %19, %21 ], [ %CreateEnvelopeSquareAroundPolygons.smallestx.promoted45, %13 ]
  %24 = phi double [ %19, %21 ], [ %14, %13 ]
  %25 = fcmp ogt double %23, %15
  br i1 %25, label %26, label %27

26:                                               ; preds = %22
  store double %23, ptr @CreateEnvelopeSquareAroundPolygons.largestx, align 8, !tbaa !5
  br label %27

27:                                               ; preds = %26, %22
  %CreateEnvelopeSquareAroundPolygons.largestx.promoted49 = phi double [ %23, %26 ], [ %CreateEnvelopeSquareAroundPolygons.largestx.promoted50, %22 ]
  %28 = phi double [ %23, %26 ], [ %15, %22 ]
  %29 = or disjoint i64 %indvars.iv, 1
  %30 = getelementptr inbounds double, ptr %11, i64 %29
  %31 = load double, ptr %30, align 8, !tbaa !5
  %32 = fcmp olt double %31, %16
  br i1 %32, label %33, label %35

33:                                               ; preds = %27
  %34 = load double, ptr %18, align 8, !tbaa !5
  store double %34, ptr @CreateEnvelopeSquareAroundPolygons.smallesty, align 8, !tbaa !5
  %.pre72 = load double, ptr %30, align 8, !tbaa !5
  br label %35

35:                                               ; preds = %33, %27
  %36 = phi double [ %.pre72, %33 ], [ %31, %27 ]
  %CreateEnvelopeSquareAroundPolygons.smallesty.promoted54 = phi double [ %34, %33 ], [ %CreateEnvelopeSquareAroundPolygons.smallesty.promoted55, %27 ]
  %37 = phi double [ %34, %33 ], [ %16, %27 ]
  %38 = fcmp ogt double %36, %17
  br i1 %38, label %39, label %41

39:                                               ; preds = %35
  %40 = load double, ptr %18, align 8, !tbaa !5
  store double %40, ptr @CreateEnvelopeSquareAroundPolygons.largesty, align 8, !tbaa !5
  br label %41

41:                                               ; preds = %35, %39
  %CreateEnvelopeSquareAroundPolygons.largesty.promoted59 = phi double [ %CreateEnvelopeSquareAroundPolygons.largesty.promoted60, %35 ], [ %40, %39 ]
  %42 = phi double [ %17, %35 ], [ %40, %39 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 2
  %43 = icmp ult i64 %indvars.iv.next, %12
  br i1 %43, label %13, label %._crit_edge, !llvm.loop !13

._crit_edge:                                      ; preds = %41, %.preheader
  %CreateEnvelopeSquareAroundPolygons.largesty.promoted58 = phi double [ %CreateEnvelopeSquareAroundPolygons.largesty.promoted6162, %.preheader ], [ %CreateEnvelopeSquareAroundPolygons.largesty.promoted59, %41 ]
  %CreateEnvelopeSquareAroundPolygons.smallesty.promoted53 = phi double [ %CreateEnvelopeSquareAroundPolygons.smallesty.promoted5663, %.preheader ], [ %CreateEnvelopeSquareAroundPolygons.smallesty.promoted54, %41 ]
  %CreateEnvelopeSquareAroundPolygons.largestx.promoted48 = phi double [ %CreateEnvelopeSquareAroundPolygons.largestx.promoted5164, %.preheader ], [ %CreateEnvelopeSquareAroundPolygons.largestx.promoted49, %41 ]
  %CreateEnvelopeSquareAroundPolygons.smallestx.promoted43 = phi double [ %CreateEnvelopeSquareAroundPolygons.smallestx.promoted4665, %.preheader ], [ %CreateEnvelopeSquareAroundPolygons.smallestx.promoted44, %41 ]
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next70, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge67.loopexit, label %.preheader, !llvm.loop !15

._crit_edge67.loopexit:                           ; preds = %._crit_edge
  %44 = fsub double %CreateEnvelopeSquareAroundPolygons.largesty.promoted58, %CreateEnvelopeSquareAroundPolygons.smallesty.promoted53
  br label %._crit_edge67

._crit_edge67:                                    ; preds = %._crit_edge67.loopexit, %4
  %45 = phi double [ %CreateEnvelopeSquareAroundPolygons.smallestx.promoted43, %._crit_edge67.loopexit ], [ 2.000000e+222, %4 ]
  %46 = phi double [ %CreateEnvelopeSquareAroundPolygons.largestx.promoted48, %._crit_edge67.loopexit ], [ -2.000000e+222, %4 ]
  %47 = phi double [ %44, %._crit_edge67.loopexit ], [ -4.000000e+222, %4 ]
  %48 = fsub double %46, %45
  %49 = tail call double @llvm.fabs.f64(double %48)
  %50 = fmul double %49, 5.000000e-01
  store double %50, ptr @CreateEnvelopeSquareAroundPolygons.plussize_x, align 8, !tbaa !5
  %51 = tail call double @llvm.fabs.f64(double %47)
  %52 = fmul double %51, 5.000000e-01
  store double %52, ptr @CreateEnvelopeSquareAroundPolygons.plussize_y, align 8, !tbaa !5
  %53 = fsub double %45, %50
  %54 = load ptr, ptr %0, align 8, !tbaa !11
  store double %53, ptr %54, align 8, !tbaa !5
  %55 = load double, ptr @CreateEnvelopeSquareAroundPolygons.smallesty, align 8, !tbaa !5
  %56 = load double, ptr @CreateEnvelopeSquareAroundPolygons.plussize_y, align 8, !tbaa !5
  %57 = fsub double %55, %56
  %58 = getelementptr inbounds i8, ptr %54, i64 8
  store double %57, ptr %58, align 8, !tbaa !5
  %59 = load double, ptr @CreateEnvelopeSquareAroundPolygons.largestx, align 8, !tbaa !5
  %60 = load double, ptr @CreateEnvelopeSquareAroundPolygons.plussize_x, align 8, !tbaa !5
  %61 = fadd double %59, %60
  %62 = getelementptr inbounds i8, ptr %0, i64 8
  %63 = load ptr, ptr %62, align 8, !tbaa !11
  store double %61, ptr %63, align 8, !tbaa !5
  %64 = load double, ptr @CreateEnvelopeSquareAroundPolygons.smallesty, align 8, !tbaa !5
  %65 = load double, ptr @CreateEnvelopeSquareAroundPolygons.plussize_y, align 8, !tbaa !5
  %66 = fsub double %64, %65
  %67 = getelementptr inbounds i8, ptr %63, i64 8
  store double %66, ptr %67, align 8, !tbaa !5
  %68 = load double, ptr @CreateEnvelopeSquareAroundPolygons.largestx, align 8, !tbaa !5
  %69 = load double, ptr @CreateEnvelopeSquareAroundPolygons.plussize_x, align 8, !tbaa !5
  %70 = fadd double %68, %69
  %71 = getelementptr inbounds i8, ptr %0, i64 16
  %72 = load ptr, ptr %71, align 8, !tbaa !11
  store double %70, ptr %72, align 8, !tbaa !5
  %73 = load double, ptr @CreateEnvelopeSquareAroundPolygons.largesty, align 8, !tbaa !5
  %74 = load double, ptr @CreateEnvelopeSquareAroundPolygons.plussize_y, align 8, !tbaa !5
  %75 = fadd double %73, %74
  %76 = getelementptr inbounds i8, ptr %72, i64 8
  store double %75, ptr %76, align 8, !tbaa !5
  %77 = load double, ptr @CreateEnvelopeSquareAroundPolygons.smallestx, align 8, !tbaa !5
  %78 = load double, ptr @CreateEnvelopeSquareAroundPolygons.plussize_x, align 8, !tbaa !5
  %79 = fsub double %77, %78
  %80 = getelementptr inbounds i8, ptr %0, i64 24
  %81 = load ptr, ptr %80, align 8, !tbaa !11
  store double %79, ptr %81, align 8, !tbaa !5
  %82 = load double, ptr @CreateEnvelopeSquareAroundPolygons.largesty, align 8, !tbaa !5
  %83 = load double, ptr @CreateEnvelopeSquareAroundPolygons.plussize_y, align 8, !tbaa !5
  %84 = fsub double %82, %83
  %85 = getelementptr inbounds i8, ptr %81, i64 8
  store double %84, ptr %85, align 8, !tbaa !5
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) 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" }

!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 = !{!"double", !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 = !{!"any pointer", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


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