; LLVM IR from Lut1n/ImpGears :: src/ImpGears/Geometry/Path.ll (ZN3imp12Intersection10isCrossingERKNS_4PathERKNS_4EdgeEb)

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

%"class.imp::Edge" = type { %"class.imp::Object", %"class.imp::Vec3", %"class.imp::Vec3" }
%"class.imp::Object" = type { ptr, %"class.std::shared_ptr" }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.imp::Vec3" = type { %"class.imp::Vec.base", [4 x i8] }
%"class.imp::Vec.base" = type <{ %"class.imp::Object", [3 x float] }>
%"class.imp::Intersection" = type { %"class.imp::Object", [2 x %"class.imp::Edge"], %"class.imp::Vec3", %"class.imp::Vec3" }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3imp3VecILi3EfEeqERKS1_(ptr noundef nonnull align 8 dereferenceable(36), ptr noundef nonnull align 8 dereferenceable(36)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3imp4Path5countEv(ptr noundef nonnull align 8 dereferenceable(48)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3imp4Path4edgeEi(ptr dead_on_unwind noalias writable sret(%"class.imp::Edge") align 8, ptr noundef nonnull align 8 dereferenceable(48), i32 noundef) #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN3imp12Intersection10isCrossingERKNS_4PathERKNS_4EdgeEb(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(104) %1, i1 noundef zeroext %2) #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i8, align 1
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"class.imp::Edge", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.imp::Intersection", align 8
  %14 = alloca %"class.imp::Edge", align 8
  %15 = alloca %"class.imp::Edge", align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  %16 = zext i1 %2 to i8
  store i8 %16, ptr %7, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !11
  br label %17

17:                                               ; preds = %87, %3
  %18 = load i32, ptr %8, align 4, !tbaa !11
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = call noundef i32 @_ZNK3imp4Path5countEv(ptr noundef nonnull align 8 dereferenceable(48) %19)
  %21 = icmp slt i32 %18, %20
  br i1 %21, label %23, label %22

22:                                               ; preds = %17
  store i32 2, ptr %9, align 4
  br label %92

23:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 104, ptr %10) #4
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = load i32, ptr %8, align 4, !tbaa !11
  call void @_ZNK3imp4Path4edgeEi(ptr dead_on_unwind writable sret(%"class.imp::Edge") align 8 %10, ptr noundef nonnull align 8 dereferenceable(48) %24, i32 noundef %25)
  %26 = load i8, ptr %7, align 1, !tbaa !9, !range !13, !noundef !14
  %27 = trunc i8 %26 to i1
  br i1 %27, label %28, label %57

28:                                               ; preds = %23
  %29 = getelementptr inbounds %"class.imp::Edge", ptr %10, i32 0, i32 1
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = getelementptr inbounds %"class.imp::Edge", ptr %30, i32 0, i32 1
  %32 = invoke noundef zeroext i1 @_ZNK3imp3VecILi3EfEeqERKS1_(ptr noundef nonnull align 8 dereferenceable(36) %29, ptr noundef nonnull align 8 dereferenceable(36) %31)
          to label %33 unwind label %53

33:                                               ; preds = %28
  br i1 %32, label %52, label %34

34:                                               ; preds = %33
  %35 = getelementptr inbounds %"class.imp::Edge", ptr %10, i32 0, i32 2
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = getelementptr inbounds %"class.imp::Edge", ptr %36, i32 0, i32 1
  %38 = invoke noundef zeroext i1 @_ZNK3imp3VecILi3EfEeqERKS1_(ptr noundef nonnull align 8 dereferenceable(36) %35, ptr noundef nonnull align 8 dereferenceable(36) %37)
          to label %39 unwind label %53

39:                                               ; preds = %34
  br i1 %38, label %52, label %40

40:                                               ; preds = %39
  %41 = getelementptr inbounds %"class.imp::Edge", ptr %10, i32 0, i32 1
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = getelementptr inbounds %"class.imp::Edge", ptr %42, i32 0, i32 2
  %44 = invoke noundef zeroext i1 @_ZNK3imp3VecILi3EfEeqERKS1_(ptr noundef nonnull align 8 dereferenceable(36) %41, ptr noundef nonnull align 8 dereferenceable(36) %43)
          to label %45 unwind label %53

45:                                               ; preds = %40
  br i1 %44, label %52, label %46

46:                                               ; preds = %45
  %47 = getelementptr inbounds %"class.imp::Edge", ptr %10, i32 0, i32 2
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = getelementptr inbounds %"class.imp::Edge", ptr %48, i32 0, i32 2
  %50 = invoke noundef zeroext i1 @_ZNK3imp3VecILi3EfEeqERKS1_(ptr noundef nonnull align 8 dereferenceable(36) %47, ptr noundef nonnull align 8 dereferenceable(36) %49)
          to label %51 unwind label %53

51:                                               ; preds = %46
  br i1 %50, label %52, label %57

52:                                               ; preds = %51, %45, %39, %33
  store i32 4, ptr %9, align 4
  br label %84

53:                                               ; preds = %46, %40, %34, %28
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %11, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %12, align 4
  br label %91

57:                                               ; preds = %51, %23
  call void @llvm.lifetime.start.p0(i64 312, ptr %13) #4
  invoke void @_ZN3imp4EdgeC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(104) %14, ptr noundef nonnull align 8 dereferenceable(104) %10)
          to label %58 unwind label %65

58:                                               ; preds = %57
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN3imp4EdgeC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(104) %15, ptr noundef nonnull align 8 dereferenceable(104) %59)
          to label %60 unwind label %69

60:                                               ; preds = %58
  invoke void @_ZN3imp12IntersectionC1ENS_4EdgeES1_(ptr noundef nonnull align 8 dereferenceable(312) %13, ptr noundef %14, ptr noundef %15)
          to label %61 unwind label %73

61:                                               ; preds = %60
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %15) #4
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %14) #4
  %62 = invoke noundef zeroext i1 @_ZN3imp12Intersection7computeEv(ptr noundef nonnull align 8 dereferenceable(312) %13)
          to label %63 unwind label %78

63:                                               ; preds = %61
  br i1 %62, label %64, label %82

64:                                               ; preds = %63
  store i1 true, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %83

65:                                               ; preds = %57
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %11, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %12, align 4
  br label %90

69:                                               ; preds = %58
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %11, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %12, align 4
  br label %77

73:                                               ; preds = %60
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %11, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %12, align 4
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %15) #4
  br label %77

77:                                               ; preds = %73, %69
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %14) #4
  br label %90

78:                                               ; preds = %61
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %11, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %12, align 4
  call void @_ZN3imp12IntersectionD2Ev(ptr noundef nonnull align 8 dereferenceable(312) %13) #4
  br label %90

82:                                               ; preds = %63
  store i32 0, ptr %9, align 4
  br label %83

83:                                               ; preds = %82, %64
  call void @_ZN3imp12IntersectionD2Ev(ptr noundef nonnull align 8 dereferenceable(312) %13) #4
  call void @llvm.lifetime.end.p0(i64 312, ptr %13) #4
  br label %84

84:                                               ; preds = %83, %52
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %10) #4
  call void @llvm.lifetime.end.p0(i64 104, ptr %10) #4
  %85 = load i32, ptr %9, align 4
  switch i32 %85, label %92 [
    i32 0, label %86
    i32 4, label %87
  ]

86:                                               ; preds = %84
  br label %87

87:                                               ; preds = %86, %84
  %88 = load i32, ptr %8, align 4, !tbaa !11
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %8, align 4, !tbaa !11
  br label %17, !llvm.loop !15

90:                                               ; preds = %78, %77, %65
  call void @llvm.lifetime.end.p0(i64 312, ptr %13) #4
  br label %91

91:                                               ; preds = %90, %53
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %10) #4
  call void @llvm.lifetime.end.p0(i64 104, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %97

92:                                               ; preds = %84, %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  %93 = load i32, ptr %9, align 4
  switch i32 %93, label %102 [
    i32 2, label %94
    i32 1, label %95
  ]

94:                                               ; preds = %92
  store i1 false, ptr %4, align 1
  br label %95

95:                                               ; preds = %94, %92
  %96 = load i1, ptr %4, align 1
  ret i1 %96

97:                                               ; preds = %91
  %98 = load ptr, ptr %11, align 8
  %99 = load i32, ptr %12, align 4
  %100 = insertvalue { ptr, i32 } poison, ptr %98, 0
  %101 = insertvalue { ptr, i32 } %100, i32 %99, 1
  resume { ptr, i32 } %101

102:                                              ; preds = %92
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3imp12Intersection7computeEv(ptr noundef nonnull align 8 dereferenceable(312)) #2 align 2

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

declare void @_ZN3imp4EdgeC1ERKS0_(ptr, ptr)

declare void @_ZN3imp12IntersectionC1ENS_4EdgeES1_(ptr, ptr, ptr)

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { 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 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


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

%"class.imp::Edge" = type { %"class.imp::Object", %"class.imp::Vec3", %"class.imp::Vec3" }
%"class.imp::Object" = type { ptr, %"class.std::shared_ptr" }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.imp::Vec3" = type { %"class.imp::Vec.base", [4 x i8] }
%"class.imp::Vec.base" = type <{ %"class.imp::Object", [3 x float] }>
%"class.imp::Intersection" = type { %"class.imp::Object", [2 x %"class.imp::Edge"], %"class.imp::Vec3", %"class.imp::Vec3" }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3imp3VecILi3EfEeqERKS1_(ptr noundef nonnull align 8 dereferenceable(36), ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3imp4Path5countEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3imp4Path4edgeEi(ptr dead_on_unwind noalias writable sret(%"class.imp::Edge") align 8, ptr noundef nonnull align 8 dereferenceable(48), i32 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN3imp12Intersection10isCrossingERKNS_4PathERKNS_4EdgeEb(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(104) %1, i1 noundef zeroext %2) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.imp::Edge", align 8
  %5 = alloca %"class.imp::Intersection", align 8
  %6 = alloca %"class.imp::Edge", align 8
  %7 = alloca %"class.imp::Edge", align 8
  %8 = tail call noundef i32 @_ZNK3imp4Path5countEv(ptr noundef nonnull align 8 dereferenceable(48) %0)
  %.not33 = icmp sgt i32 %8, 0
  br i1 %.not33, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %3
  %9 = getelementptr inbounds i8, ptr %4, i64 24
  %10 = getelementptr inbounds i8, ptr %1, i64 24
  %11 = getelementptr inbounds i8, ptr %4, i64 64
  %12 = getelementptr inbounds i8, ptr %1, i64 64
  br i1 %2, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %26
  %.01934.us = phi i32 [ %27, %26 ], [ 0, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %4) #4
  call void @_ZNK3imp4Path4edgeEi(ptr dead_on_unwind nonnull writable sret(%"class.imp::Edge") align 8 %4, ptr noundef nonnull align 8 dereferenceable(48) %0, i32 noundef %.01934.us)
  %13 = call noundef zeroext i1 @_ZNK3imp3VecILi3EfEeqERKS1_(ptr noundef nonnull align 8 dereferenceable(36) %9, ptr noundef nonnull align 8 dereferenceable(36) %10)
  br i1 %13, label %26, label %14

14:                                               ; preds = %.lr.ph.split.us
  %15 = call noundef zeroext i1 @_ZNK3imp3VecILi3EfEeqERKS1_(ptr noundef nonnull align 8 dereferenceable(36) %11, ptr noundef nonnull align 8 dereferenceable(36) %10)
  br i1 %15, label %26, label %16

16:                                               ; preds = %14
  %17 = call noundef zeroext i1 @_ZNK3imp3VecILi3EfEeqERKS1_(ptr noundef nonnull align 8 dereferenceable(36) %9, ptr noundef nonnull align 8 dereferenceable(36) %12)
  br i1 %17, label %26, label %18

18:                                               ; preds = %16
  %19 = call noundef zeroext i1 @_ZNK3imp3VecILi3EfEeqERKS1_(ptr noundef nonnull align 8 dereferenceable(36) %11, ptr noundef nonnull align 8 dereferenceable(36) %12)
  br i1 %19, label %26, label %20

20:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 312, ptr nonnull %5) #4
  invoke void @_ZN3imp4EdgeC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(104) %6, ptr noundef nonnull align 8 dereferenceable(104) %4)
          to label %21 unwind label %.split.us

21:                                               ; preds = %20
  invoke void @_ZN3imp4EdgeC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(104) %7, ptr noundef nonnull align 8 dereferenceable(104) %1)
          to label %22 unwind label %.split37.us

22:                                               ; preds = %21
  invoke void @_ZN3imp12IntersectionC1ENS_4EdgeES1_(ptr noundef nonnull align 8 dereferenceable(312) %5, ptr noundef nonnull %6, ptr noundef nonnull %7)
          to label %23 unwind label %.split40.us

23:                                               ; preds = %22
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %7) #4
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %6) #4
  %24 = invoke noundef zeroext i1 @_ZN3imp12Intersection7computeEv(ptr noundef nonnull align 8 dereferenceable(312) %5)
          to label %25 unwind label %.split43.us

25:                                               ; preds = %23
  call void @_ZN3imp12IntersectionD2Ev(ptr noundef nonnull align 8 dereferenceable(312) %5) #4
  call void @llvm.lifetime.end.p0(i64 312, ptr nonnull %5) #4
  br i1 %24, label %.split46.us, label %26

26:                                               ; preds = %25, %18, %16, %14, %.lr.ph.split.us
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %4) #4
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %4) #4
  %27 = add nuw nsw i32 %.01934.us, 1
  %28 = call noundef i32 @_ZNK3imp4Path5countEv(ptr noundef nonnull align 8 dereferenceable(48) %0)
  %.not.us = icmp slt i32 %27, %28
  br i1 %.not.us, label %.lr.ph.split.us, label %.loopexit, !llvm.loop !5

.split.us:                                        ; preds = %20
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %48

.split37.us:                                      ; preds = %21
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %42

.split40.us:                                      ; preds = %22
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %41

.split43.us:                                      ; preds = %23
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %44

.lr.ph.split:                                     ; preds = %.lr.ph, %45
  %.01934 = phi i32 [ %46, %45 ], [ 0, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %4) #4
  call void @_ZNK3imp4Path4edgeEi(ptr dead_on_unwind nonnull writable sret(%"class.imp::Edge") align 8 %4, ptr noundef nonnull align 8 dereferenceable(48) %0, i32 noundef %.01934)
  call void @llvm.lifetime.start.p0(i64 312, ptr nonnull %5) #4
  invoke void @_ZN3imp4EdgeC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(104) %6, ptr noundef nonnull align 8 dereferenceable(104) %4)
          to label %33 unwind label %.split

33:                                               ; preds = %.lr.ph.split
  invoke void @_ZN3imp4EdgeC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(104) %7, ptr noundef nonnull align 8 dereferenceable(104) %1)
          to label %34 unwind label %.split37

34:                                               ; preds = %33
  invoke void @_ZN3imp12IntersectionC1ENS_4EdgeES1_(ptr noundef nonnull align 8 dereferenceable(312) %5, ptr noundef nonnull %6, ptr noundef nonnull %7)
          to label %35 unwind label %.split40

35:                                               ; preds = %34
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %7) #4
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %6) #4
  %36 = invoke noundef zeroext i1 @_ZN3imp12Intersection7computeEv(ptr noundef nonnull align 8 dereferenceable(312) %5)
          to label %37 unwind label %.split43

37:                                               ; preds = %35
  call void @_ZN3imp12IntersectionD2Ev(ptr noundef nonnull align 8 dereferenceable(312) %5) #4
  call void @llvm.lifetime.end.p0(i64 312, ptr nonnull %5) #4
  br i1 %36, label %.split46.us, label %45

.split:                                           ; preds = %.lr.ph.split
  %38 = landingpad { ptr, i32 }
          cleanup
  br label %48

.split37:                                         ; preds = %33
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %42

.split40:                                         ; preds = %34
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %41

41:                                               ; preds = %.split40.us, %.split40
  %.us-phi41 = phi { ptr, i32 } [ %40, %.split40 ], [ %31, %.split40.us ]
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %7) #4
  br label %42

42:                                               ; preds = %.split37, %.split37.us, %41
  %.pn = phi { ptr, i32 } [ %.us-phi41, %41 ], [ %39, %.split37 ], [ %30, %.split37.us ]
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %6) #4
  br label %48

.split43:                                         ; preds = %35
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %44

44:                                               ; preds = %.split43.us, %.split43
  %.us-phi44 = phi { ptr, i32 } [ %43, %.split43 ], [ %32, %.split43.us ]
  call void @_ZN3imp12IntersectionD2Ev(ptr noundef nonnull align 8 dereferenceable(312) %5) #4
  br label %48

.split46.us:                                      ; preds = %37, %25
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %4) #4
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %4) #4
  br label %.loopexit

45:                                               ; preds = %37
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %4) #4
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %4) #4
  %46 = add nuw nsw i32 %.01934, 1
  %47 = call noundef i32 @_ZNK3imp4Path5countEv(ptr noundef nonnull align 8 dereferenceable(48) %0)
  %.not = icmp slt i32 %46, %47
  br i1 %.not, label %.lr.ph.split, label %.loopexit, !llvm.loop !5

48:                                               ; preds = %.split, %.split.us, %44, %42
  %.pn24 = phi { ptr, i32 } [ %.us-phi44, %44 ], [ %.pn, %42 ], [ %38, %.split ], [ %29, %.split.us ]
  call void @llvm.lifetime.end.p0(i64 312, ptr nonnull %5) #4
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %4) #4
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %4) #4
  resume { ptr, i32 } %.pn24

.loopexit:                                        ; preds = %45, %26, %3, %.split46.us
  %.not32 = phi i1 [ true, %.split46.us ], [ false, %3 ], [ false, %26 ], [ false, %45 ]
  ret i1 %.not32
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3imp12Intersection7computeEv(ptr noundef nonnull align 8 dereferenceable(312)) local_unnamed_addr #2 align 2

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

declare void @_ZN3imp4EdgeC1ERKS0_(ptr, ptr) local_unnamed_addr

declare void @_ZN3imp12IntersectionC1ENS_4EdgeES1_(ptr, ptr, ptr) local_unnamed_addr

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass