; LLVM IR from SOHNE/Dura2D :: src/collision/d2Shape.ll (ZN14d2PolygonShapeC2EPK6d2Vec2i)

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

%struct.d2Vec2 = type { float, float }
%struct.d2PolygonShape = type { %struct.d2Shape, float, float, i32, ptr, ptr }
%struct.d2Shape = type { ptr }

@_ZTV14d2PolygonShape = external dso_local unnamed_addr constant { [8 x ptr] }, align 8

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7d2ShapeC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN14d2PolygonShapeC2EPK6d2Vec2i(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef %1, i32 noundef %2) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  %14 = load ptr, ptr %4, align 8
  call void @_ZN7d2ShapeC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #8
  store ptr getelementptr inbounds inrange(-16, 48) ({ [8 x ptr] }, ptr @_ZTV14d2PolygonShape, i32 0, i32 0, i32 2), ptr %14, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  %15 = call noundef float @_ZNSt14numeric_limitsIfE3maxEv() #8
  store float %15, ptr %7, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  %16 = call noundef float @_ZNSt14numeric_limitsIfE3maxEv() #8
  store float %16, ptr %8, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  %17 = call noundef float @_ZNSt14numeric_limitsIfE6lowestEv() #8
  store float %17, ptr %9, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  %18 = call noundef float @_ZNSt14numeric_limitsIfE6lowestEv() #8
  store float %18, ptr %10, align 4, !tbaa !13
  %19 = load i32, ptr %6, align 4, !tbaa !9
  %20 = sext i32 %19 to i64
  %21 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %20, i64 8)
  %22 = extractvalue { i64, i1 } %21, 1
  %23 = extractvalue { i64, i1 } %21, 0
  %24 = select i1 %22, i64 -1, i64 %23
  %25 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %24) #9
          to label %26 unwind label %60

26:                                               ; preds = %3
  %27 = icmp eq i64 %20, 0
  br i1 %27, label %35, label %28

28:                                               ; preds = %26
  %29 = getelementptr inbounds %struct.d2Vec2, ptr %25, i64 %20
  br label %30

30:                                               ; preds = %32, %28
  %31 = phi ptr [ %25, %28 ], [ %33, %32 ]
  invoke void @_ZN6d2Vec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %31)
          to label %32 unwind label %64

32:                                               ; preds = %30
  %33 = getelementptr inbounds %struct.d2Vec2, ptr %31, i64 1
  %34 = icmp eq ptr %33, %29
  br i1 %34, label %35, label %30

35:                                               ; preds = %32, %26
  %36 = getelementptr inbounds %struct.d2PolygonShape, ptr %14, i32 0, i32 4
  store ptr %25, ptr %36, align 8, !tbaa !15
  %37 = load i32, ptr %6, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %38, i64 8)
  %40 = extractvalue { i64, i1 } %39, 1
  %41 = extractvalue { i64, i1 } %39, 0
  %42 = select i1 %40, i64 -1, i64 %41
  %43 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %42) #9
          to label %44 unwind label %60

44:                                               ; preds = %35
  %45 = icmp eq i64 %38, 0
  br i1 %45, label %53, label %46

46:                                               ; preds = %44
  %47 = getelementptr inbounds %struct.d2Vec2, ptr %43, i64 %38
  br label %48

48:                                               ; preds = %50, %46
  %49 = phi ptr [ %43, %46 ], [ %51, %50 ]
  invoke void @_ZN6d2Vec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %49)
          to label %50 unwind label %68

50:                                               ; preds = %48
  %51 = getelementptr inbounds %struct.d2Vec2, ptr %49, i64 1
  %52 = icmp eq ptr %51, %47
  br i1 %52, label %53, label %48

53:                                               ; preds = %50, %44
  %54 = getelementptr inbounds %struct.d2PolygonShape, ptr %14, i32 0, i32 5
  store ptr %43, ptr %54, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %55

55:                                               ; preds = %131, %53
  %56 = load i32, ptr %13, align 4, !tbaa !9
  %57 = load i32, ptr %6, align 4, !tbaa !9
  %58 = icmp slt i32 %56, %57
  br i1 %58, label %72, label %59

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

60:                                               ; preds = %35, %3
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %11, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %12, align 4
  br label %149

64:                                               ; preds = %30
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %11, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %12, align 4
  call void @_ZdaPvm(ptr noundef %25, i64 noundef %24) #10
  br label %149

68:                                               ; preds = %48
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %11, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %12, align 4
  call void @_ZdaPvm(ptr noundef %43, i64 noundef %42) #10
  br label %149

72:                                               ; preds = %55
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = load i32, ptr %13, align 4, !tbaa !9
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds %struct.d2Vec2, ptr %73, i64 %75
  %77 = getelementptr inbounds %struct.d2PolygonShape, ptr %14, i32 0, i32 4
  %78 = load ptr, ptr %77, align 8, !tbaa !15
  %79 = load i32, ptr %13, align 4, !tbaa !9
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds %struct.d2Vec2, ptr %78, i64 %80
  %82 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN6d2Vec2aSERKS_(ptr noundef nonnull align 4 dereferenceable(8) %81, ptr noundef nonnull align 4 dereferenceable(8) %76)
          to label %83 unwind label %134

83:                                               ; preds = %72
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = load i32, ptr %13, align 4, !tbaa !9
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds %struct.d2Vec2, ptr %84, i64 %86
  %88 = getelementptr inbounds %struct.d2PolygonShape, ptr %14, i32 0, i32 5
  %89 = load ptr, ptr %88, align 8, !tbaa !18
  %90 = load i32, ptr %13, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds %struct.d2Vec2, ptr %89, i64 %91
  %93 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN6d2Vec2aSERKS_(ptr noundef nonnull align 4 dereferenceable(8) %92, ptr noundef nonnull align 4 dereferenceable(8) %87)
          to label %94 unwind label %134

94:                                               ; preds = %83
  %95 = load float, ptr %7, align 4, !tbaa !13
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = load i32, ptr %13, align 4, !tbaa !9
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds %struct.d2Vec2, ptr %96, i64 %98
  %100 = getelementptr inbounds %struct.d2Vec2, ptr %99, i32 0, i32 0
  %101 = load float, ptr %100, align 4, !tbaa !19
  %102 = invoke noundef float @_Z5d2MinIfET_S0_S0_(float noundef %95, float noundef %101)
          to label %103 unwind label %134

103:                                              ; preds = %94
  store float %102, ptr %7, align 4, !tbaa !13
  %104 = load float, ptr %9, align 4, !tbaa !13
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  %106 = load i32, ptr %13, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds %struct.d2Vec2, ptr %105, i64 %107
  %109 = getelementptr inbounds %struct.d2Vec2, ptr %108, i32 0, i32 0
  %110 = load float, ptr %109, align 4, !tbaa !19
  %111 = invoke noundef float @_Z5d2MaxIfET_S0_S0_(float noundef %104, float noundef %110)
          to label %112 unwind label %134

112:                                              ; preds = %103
  store float %111, ptr %9, align 4, !tbaa !13
  %113 = load float, ptr %8, align 4, !tbaa !13
  %114 = load ptr, ptr %5, align 8, !tbaa !5
  %115 = load i32, ptr %13, align 4, !tbaa !9
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds %struct.d2Vec2, ptr %114, i64 %116
  %118 = getelementptr inbounds %struct.d2Vec2, ptr %117, i32 0, i32 1
  %119 = load float, ptr %118, align 4, !tbaa !21
  %120 = invoke noundef float @_Z5d2MinIfET_S0_S0_(float noundef %113, float noundef %119)
          to label %121 unwind label %134

121:                                              ; preds = %112
  store float %120, ptr %8, align 4, !tbaa !13
  %122 = load float, ptr %10, align 4, !tbaa !13
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = load i32, ptr %13, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds %struct.d2Vec2, ptr %123, i64 %125
  %127 = getelementptr inbounds %struct.d2Vec2, ptr %126, i32 0, i32 1
  %128 = load float, ptr %127, align 4, !tbaa !21
  %129 = invoke noundef float @_Z5d2MaxIfET_S0_S0_(float noundef %122, float noundef %128)
          to label %130 unwind label %134

130:                                              ; preds = %121
  store float %129, ptr %10, align 4, !tbaa !13
  br label %131

131:                                              ; preds = %130
  %132 = load i32, ptr %13, align 4, !tbaa !9
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %13, align 4, !tbaa !9
  br label %55, !llvm.loop !22

134:                                              ; preds = %121, %112, %103, %94, %83, %72
  %135 = landingpad { ptr, i32 }
          cleanup
  %136 = extractvalue { ptr, i32 } %135, 0
  store ptr %136, ptr %11, align 8
  %137 = extractvalue { ptr, i32 } %135, 1
  store i32 %137, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %149

138:                                              ; preds = %59
  %139 = load float, ptr %9, align 4, !tbaa !13
  %140 = load float, ptr %7, align 4, !tbaa !13
  %141 = fsub float %139, %140
  %142 = getelementptr inbounds %struct.d2PolygonShape, ptr %14, i32 0, i32 1
  store float %141, ptr %142, align 8, !tbaa !24
  %143 = load float, ptr %10, align 4, !tbaa !13
  %144 = load float, ptr %8, align 4, !tbaa !13
  %145 = fsub float %143, %144
  %146 = getelementptr inbounds %struct.d2PolygonShape, ptr %14, i32 0, i32 2
  store float %145, ptr %146, align 4, !tbaa !25
  %147 = load i32, ptr %6, align 4, !tbaa !9
  %148 = getelementptr inbounds %struct.d2PolygonShape, ptr %14, i32 0, i32 3
  store i32 %147, ptr %148, align 8, !tbaa !26
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  ret void

149:                                              ; preds = %134, %68, %64, %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  call void @_ZN7d2ShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #8
  br label %150

150:                                              ; preds = %149
  %151 = load ptr, ptr %11, align 8
  %152 = load i32, ptr %12, align 4
  %153 = insertvalue { ptr, i32 } poison, ptr %151, 0
  %154 = insertvalue { ptr, i32 } %153, i32 %152, 1
  resume { ptr, i32 } %154
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNSt14numeric_limitsIfE3maxEv() #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNSt14numeric_limitsIfE6lowestEv() #3 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #4

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6d2Vec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #3 align 2

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPvm(ptr noundef, i64 noundef) #6

declare noundef nonnull align 4 dereferenceable(8) ptr @_ZN6d2Vec2aSERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #7

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_Z5d2MinIfET_S0_S0_(float noundef, float noundef) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_Z5d2MaxIfET_S0_S0_(float noundef, float noundef) #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7d2ShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

attributes #0 = { inlinehint mustprogress 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 #1 = { mustprogress 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nobuiltin allocsize(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 = { nobuiltin 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 #7 = { "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 #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { builtin 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{!16, !6, i64 24}
!16 = !{!"_ZTS14d2PolygonShape", !17, i64 0, !14, i64 8, !14, i64 12, !10, i64 16, !6, i64 24, !6, i64 32}
!17 = !{!"_ZTS7d2Shape"}
!18 = !{!16, !6, i64 32}
!19 = !{!20, !14, i64 0}
!20 = !{!"_ZTS6d2Vec2", !14, i64 0, !14, i64 4}
!21 = !{!20, !14, i64 4}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!16, !14, i64 8}
!25 = !{!16, !14, i64 12}
!26 = !{!16, !10, i64 16}


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

%struct.d2Vec2 = type { float, float }

@_ZTV14d2PolygonShape = external dso_local unnamed_addr constant { [8 x ptr] }, align 8

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7d2ShapeC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN14d2PolygonShapeC2EPK6d2Vec2i(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef %1, i32 noundef %2) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  tail call void @_ZN7d2ShapeC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #5
  store ptr getelementptr inbounds inrange(-16, 48) (i8, ptr @_ZTV14d2PolygonShape, i64 16), ptr %0, align 8, !tbaa !5
  %4 = tail call noundef float @_ZNSt14numeric_limitsIfE3maxEv() #5
  %5 = tail call noundef float @_ZNSt14numeric_limitsIfE3maxEv() #5
  %6 = tail call noundef float @_ZNSt14numeric_limitsIfE6lowestEv() #5
  %7 = tail call noundef float @_ZNSt14numeric_limitsIfE6lowestEv() #5
  %8 = sext i32 %2 to i64
  %9 = icmp slt i32 %2, 0
  %10 = shl nsw i64 %8, 3
  %11 = select i1 %9, i64 -1, i64 %10
  %12 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %11) #6
          to label %13 unwind label %38

13:                                               ; preds = %3
  %14 = icmp eq i32 %2, 0
  br i1 %14, label %.loopexit39, label %15

15:                                               ; preds = %13
  %16 = getelementptr inbounds %struct.d2Vec2, ptr %12, i64 %8
  br label %17

17:                                               ; preds = %17, %15
  %18 = phi ptr [ %12, %15 ], [ %19, %17 ]
  tail call void @_ZN6d2Vec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %18)
  %19 = getelementptr inbounds i8, ptr %18, i64 8
  %20 = icmp eq ptr %19, %16
  br i1 %20, label %.loopexit39, label %17

.loopexit39:                                      ; preds = %17, %13
  %21 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr %12, ptr %21, align 8, !tbaa !8
  %22 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %11) #6
          to label %23 unwind label %38

23:                                               ; preds = %.loopexit39
  br i1 %14, label %.loopexit.thread, label %25

.loopexit.thread:                                 ; preds = %23
  %24 = getelementptr inbounds i8, ptr %0, i64 32
  store ptr %22, ptr %24, align 8, !tbaa !15
  br label %._crit_edge

25:                                               ; preds = %23
  %26 = getelementptr inbounds %struct.d2Vec2, ptr %22, i64 %8
  br label %27

27:                                               ; preds = %27, %25
  %28 = phi ptr [ %22, %25 ], [ %29, %27 ]
  tail call void @_ZN6d2Vec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %28)
  %29 = getelementptr inbounds i8, ptr %28, i64 8
  %30 = icmp eq ptr %29, %26
  br i1 %30, label %.loopexit, label %27

.loopexit:                                        ; preds = %27
  %31 = getelementptr inbounds i8, ptr %0, i64 32
  store ptr %22, ptr %31, align 8, !tbaa !15
  %32 = icmp sgt i32 %2, 0
  br i1 %32, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.loopexit
  %wide.trip.count = zext nneg i32 %2 to i64
  br label %.lr.ph

._crit_edge:                                      ; preds = %48, %.loopexit.thread, %.loopexit
  %.035.lcssa = phi float [ %4, %.loopexit ], [ %4, %.loopexit.thread ], [ %50, %48 ]
  %.034.lcssa = phi float [ %5, %.loopexit ], [ %5, %.loopexit.thread ], [ %55, %48 ]
  %.033.lcssa = phi float [ %6, %.loopexit ], [ %6, %.loopexit.thread ], [ %52, %48 ]
  %.032.lcssa = phi float [ %7, %.loopexit ], [ %7, %.loopexit.thread ], [ %57, %48 ]
  %33 = fsub float %.033.lcssa, %.035.lcssa
  %34 = getelementptr inbounds i8, ptr %0, i64 8
  store float %33, ptr %34, align 8, !tbaa !16
  %35 = fsub float %.032.lcssa, %.034.lcssa
  %36 = getelementptr inbounds i8, ptr %0, i64 12
  store float %35, ptr %36, align 4, !tbaa !17
  %37 = getelementptr inbounds i8, ptr %0, i64 16
  store i32 %2, ptr %37, align 8, !tbaa !18
  ret void

38:                                               ; preds = %.loopexit39, %3
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %60

.lr.ph:                                           ; preds = %.lr.ph.preheader, %48
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %48 ]
  %.03247 = phi float [ %7, %.lr.ph.preheader ], [ %57, %48 ]
  %.03346 = phi float [ %6, %.lr.ph.preheader ], [ %52, %48 ]
  %.03445 = phi float [ %5, %.lr.ph.preheader ], [ %55, %48 ]
  %.03544 = phi float [ %4, %.lr.ph.preheader ], [ %50, %48 ]
  %40 = getelementptr inbounds %struct.d2Vec2, ptr %1, i64 %indvars.iv
  %41 = load ptr, ptr %21, align 8, !tbaa !8
  %42 = getelementptr inbounds %struct.d2Vec2, ptr %41, i64 %indvars.iv
  %43 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN6d2Vec2aSERKS_(ptr noundef nonnull align 4 dereferenceable(8) %42, ptr noundef nonnull align 4 dereferenceable(8) %40)
          to label %44 unwind label %58

44:                                               ; preds = %.lr.ph
  %45 = load ptr, ptr %31, align 8, !tbaa !15
  %46 = getelementptr inbounds %struct.d2Vec2, ptr %45, i64 %indvars.iv
  %47 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN6d2Vec2aSERKS_(ptr noundef nonnull align 4 dereferenceable(8) %46, ptr noundef nonnull align 4 dereferenceable(8) %40)
          to label %48 unwind label %58

48:                                               ; preds = %44
  %49 = load float, ptr %40, align 4, !tbaa !19
  %50 = tail call noundef float @_Z5d2MinIfET_S0_S0_(float noundef %.03544, float noundef %49)
  %51 = load float, ptr %40, align 4, !tbaa !19
  %52 = tail call noundef float @_Z5d2MaxIfET_S0_S0_(float noundef %.03346, float noundef %51)
  %53 = getelementptr inbounds i8, ptr %40, i64 4
  %54 = load float, ptr %53, align 4, !tbaa !21
  %55 = tail call noundef float @_Z5d2MinIfET_S0_S0_(float noundef %.03445, float noundef %54)
  %56 = load float, ptr %53, align 4, !tbaa !21
  %57 = tail call noundef float @_Z5d2MaxIfET_S0_S0_(float noundef %.03247, float noundef %56)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !22

58:                                               ; preds = %44, %.lr.ph
  %59 = landingpad { ptr, i32 }
          cleanup
  br label %60

60:                                               ; preds = %58, %38
  %.pn = phi { ptr, i32 } [ %59, %58 ], [ %39, %38 ]
  tail call void @_ZN7d2ShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #5
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNSt14numeric_limitsIfE3maxEv() local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNSt14numeric_limitsIfE6lowestEv() local_unnamed_addr #2 align 2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6d2Vec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #2 align 2

declare noundef nonnull align 4 dereferenceable(8) ptr @_ZN6d2Vec2aSERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_Z5d2MinIfET_S0_S0_(float noundef, float noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_Z5d2MaxIfET_S0_S0_(float noundef, float noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7d2ShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2 align 2

attributes #0 = { inlinehint mustprogress 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 #1 = { mustprogress 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 #2 = { mustprogress 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 = { nobuiltin allocsize(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 #4 = { "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 = { nounwind }
attributes #6 = { builtin allocsize(0) }

!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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !14, i64 24}
!9 = !{!"_ZTS14d2PolygonShape", !10, i64 0, !11, i64 8, !11, i64 12, !13, i64 16, !14, i64 24, !14, i64 32}
!10 = !{!"_ZTS7d2Shape"}
!11 = !{!"float", !12, i64 0}
!12 = !{!"omnipotent char", !7, i64 0}
!13 = !{!"int", !12, i64 0}
!14 = !{!"any pointer", !12, i64 0}
!15 = !{!9, !14, i64 32}
!16 = !{!9, !11, i64 8}
!17 = !{!9, !11, i64 12}
!18 = !{!9, !13, i64 16}
!19 = !{!20, !11, i64 0}
!20 = !{!"_ZTS6d2Vec2", !11, i64 0, !11, i64 4}
!21 = !{!20, !11, i64 4}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}


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