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

; 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::Vec" = type <{ %"class.imp::Object", [3 x float], [4 x i8] }>
%"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::Edge" = type { %"class.imp::Object", %"class.imp::Vec3", %"class.imp::Vec3" }
%"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 i32 @_ZNK3imp4Path5countEv(ptr noundef nonnull align 8 dereferenceable(48)) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp4Vec3C2ILi3EEERKNS_3VecIXT_EfEEf(ptr noundef nonnull align 8 dereferenceable(36), ptr noundef nonnull align 8 dereferenceable(36), float noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3imp4Path13leftExtremityEv(ptr dead_on_unwind noalias writable sret(%"class.imp::Vec3") align 8, ptr noundef nonnull align 8 dereferenceable(48)) #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 @_ZNK3imp4Path6insideERKNS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(36) %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %"class.imp::Vec3", align 8
  %7 = alloca %"class.imp::Vec", align 8
  %8 = alloca %"class.imp::Vec3", align 8
  %9 = alloca %"class.imp::Vec3", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %"class.imp::Edge", align 8
  %13 = alloca %"class.imp::Vec3", align 8
  %14 = alloca i32, align 4
  %15 = alloca %"class.imp::Intersection", align 8
  %16 = alloca %"class.imp::Edge", align 8
  %17 = alloca %"class.imp::Edge", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %18 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 40, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 40, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 40, ptr %8) #4
  call void @_ZNK3imp4Path13leftExtremityEv(ptr dead_on_unwind writable sret(%"class.imp::Vec3") align 8 %8, ptr noundef nonnull align 8 dereferenceable(48) %18)
  call void @llvm.lifetime.start.p0(i64 40, ptr %9) #4
  invoke void @_ZN3imp4Vec3C2Efff(ptr noundef nonnull align 8 dereferenceable(36) %9, float noundef 1.000000e+01, float noundef 1.000000e+01, float noundef 1.000000e+01)
          to label %19 unwind label %30

19:                                               ; preds = %2
  invoke void @_ZNK3imp3VecILi3EfEmiERKS1_(ptr dead_on_unwind writable sret(%"class.imp::Vec") align 8 %7, ptr noundef nonnull align 8 dereferenceable(36) %8, ptr noundef nonnull align 8 dereferenceable(36) %9)
          to label %20 unwind label %34

20:                                               ; preds = %19
  invoke void @_ZN3imp4Vec3C2ILi3EEERKNS_3VecIXT_EfEEf(ptr noundef nonnull align 8 dereferenceable(36) %6, ptr noundef nonnull align 8 dereferenceable(36) %7, float noundef 1.000000e+00)
          to label %21 unwind label %38

21:                                               ; preds = %20
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %7) #4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %9) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %9) #4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %8) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 104, ptr %12) #4
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZN3imp4EdgeC1ERKNS_4Vec3ES3_(ptr noundef nonnull align 8 dereferenceable(104) %12, ptr noundef nonnull align 8 dereferenceable(36) %6, ptr noundef nonnull align 8 dereferenceable(36) %22)
          to label %23 unwind label %44

23:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 40, ptr %13) #4
  invoke void @_ZNK3imp4Path6normalEv(ptr dead_on_unwind writable sret(%"class.imp::Vec3") align 8 %13, ptr noundef nonnull align 8 dereferenceable(48) %18)
          to label %24 unwind label %48

24:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %81, %24
  %26 = load i32, ptr %14, align 4, !tbaa !9
  %27 = call noundef i32 @_ZNK3imp4Path5countEv(ptr noundef nonnull align 8 dereferenceable(48) %18)
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %52, label %29

29:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %85

30:                                               ; preds = %2
  %31 = landingpad { ptr, i32 }
          cleanup
  %32 = extractvalue { ptr, i32 } %31, 0
  store ptr %32, ptr %10, align 8
  %33 = extractvalue { ptr, i32 } %31, 1
  store i32 %33, ptr %11, align 4
  br label %43

34:                                               ; preds = %19
  %35 = landingpad { ptr, i32 }
          cleanup
  %36 = extractvalue { ptr, i32 } %35, 0
  store ptr %36, ptr %10, align 8
  %37 = extractvalue { ptr, i32 } %35, 1
  store i32 %37, ptr %11, align 4
  br label %42

38:                                               ; preds = %20
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %10, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %11, align 4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %7) #4
  br label %42

42:                                               ; preds = %38, %34
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %9) #4
  br label %43

43:                                               ; preds = %42, %30
  call void @llvm.lifetime.end.p0(i64 40, ptr %9) #4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %8) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %7) #4
  br label %91

44:                                               ; preds = %21
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %10, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %11, align 4
  br label %90

48:                                               ; preds = %23
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %10, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %11, align 4
  br label %89

52:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 312, ptr %15) #4
  %53 = load i32, ptr %14, align 4, !tbaa !9
  invoke void @_ZNK3imp4Path4edgeEi(ptr dead_on_unwind writable sret(%"class.imp::Edge") align 8 %16, ptr noundef nonnull align 8 dereferenceable(48) %18, i32 noundef %53)
          to label %54 unwind label %63

54:                                               ; preds = %52
  invoke void @_ZN3imp4EdgeC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(104) %17, ptr noundef nonnull align 8 dereferenceable(104) %12)
          to label %55 unwind label %67

55:                                               ; preds = %54
  invoke void @_ZN3imp12IntersectionC1ENS_4EdgeES1_(ptr noundef nonnull align 8 dereferenceable(312) %15, ptr noundef %16, ptr noundef %17)
          to label %56 unwind label %71

56:                                               ; preds = %55
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %17) #4
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %16) #4
  invoke void @_ZN3imp12Intersection9setNormalERKNS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(312) %15, ptr noundef nonnull align 8 dereferenceable(36) %13)
          to label %57 unwind label %76

57:                                               ; preds = %56
  %58 = invoke noundef zeroext i1 @_ZN3imp12Intersection7computeEv(ptr noundef nonnull align 8 dereferenceable(312) %15)
          to label %59 unwind label %76

59:                                               ; preds = %57
  br i1 %58, label %60, label %80

60:                                               ; preds = %59
  %61 = load i32, ptr %5, align 4, !tbaa !9
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %5, align 4, !tbaa !9
  br label %80

63:                                               ; preds = %52
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %10, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %11, align 4
  br label %84

67:                                               ; preds = %54
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %10, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %11, align 4
  br label %75

71:                                               ; preds = %55
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %10, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %11, align 4
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %17) #4
  br label %75

75:                                               ; preds = %71, %67
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %16) #4
  br label %84

76:                                               ; preds = %57, %56
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %10, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %11, align 4
  call void @_ZN3imp12IntersectionD2Ev(ptr noundef nonnull align 8 dereferenceable(312) %15) #4
  br label %84

80:                                               ; preds = %60, %59
  call void @_ZN3imp12IntersectionD2Ev(ptr noundef nonnull align 8 dereferenceable(312) %15) #4
  call void @llvm.lifetime.end.p0(i64 312, ptr %15) #4
  br label %81

81:                                               ; preds = %80
  %82 = load i32, ptr %14, align 4, !tbaa !9
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %14, align 4, !tbaa !9
  br label %25, !llvm.loop !11

84:                                               ; preds = %76, %75, %63
  call void @llvm.lifetime.end.p0(i64 312, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %13) #4
  br label %89

85:                                               ; preds = %29
  %86 = load i32, ptr %5, align 4, !tbaa !9
  %87 = srem i32 %86, 2
  %88 = icmp sgt i32 %87, 0
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %13) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %13) #4
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %12) #4
  call void @llvm.lifetime.end.p0(i64 104, ptr %12) #4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %6) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  ret i1 %88

89:                                               ; preds = %84, %48
  call void @llvm.lifetime.end.p0(i64 40, ptr %13) #4
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %12) #4
  br label %90

90:                                               ; preds = %89, %44
  call void @llvm.lifetime.end.p0(i64 104, ptr %12) #4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %6) #4
  br label %91

91:                                               ; preds = %90, %43
  call void @llvm.lifetime.end.p0(i64 40, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %92

92:                                               ; preds = %91
  %93 = load ptr, ptr %10, align 8
  %94 = load i32, ptr %11, align 4
  %95 = insertvalue { ptr, i32 } poison, ptr %93, 0
  %96 = insertvalue { ptr, i32 } %95, i32 %94, 1
  resume { ptr, i32 } %96
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp4Vec3C2Efff(ptr noundef nonnull align 8 dereferenceable(36), float noundef, float noundef, float noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3imp12Intersection9setNormalERKNS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(312), ptr noundef nonnull align 8 dereferenceable(36)) #1 align 2

; 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 @_ZN3imp4EdgeC1ERKNS_4Vec3ES3_(ptr, 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 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"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::Vec" = type <{ %"class.imp::Object", [3 x float], [4 x i8] }>
%"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::Edge" = type { %"class.imp::Object", %"class.imp::Vec3", %"class.imp::Vec3" }
%"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 i32 @_ZNK3imp4Path5countEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp4Vec3C2ILi3EEERKNS_3VecIXT_EfEEf(ptr noundef nonnull align 8 dereferenceable(36), ptr noundef nonnull align 8 dereferenceable(36), float noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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: mustprogress uwtable
declare dso_local void @_ZNK3imp4Path6normalEv(ptr dead_on_unwind noalias writable sret(%"class.imp::Vec3") align 8, ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3imp4Path13leftExtremityEv(ptr dead_on_unwind noalias writable sret(%"class.imp::Vec3") align 8, ptr noundef nonnull align 8 dereferenceable(48)) 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 @_ZNK3imp4Path6insideERKNS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(36) %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.imp::Vec3", align 8
  %4 = alloca %"class.imp::Vec", align 8
  %5 = alloca %"class.imp::Vec3", align 8
  %6 = alloca %"class.imp::Vec3", align 8
  %7 = alloca %"class.imp::Edge", align 8
  %8 = alloca %"class.imp::Vec3", align 8
  %9 = alloca %"class.imp::Intersection", align 8
  %10 = alloca %"class.imp::Edge", align 8
  %11 = alloca %"class.imp::Edge", align 8
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #4
  call void @_ZNK3imp4Path13leftExtremityEv(ptr dead_on_unwind nonnull writable sret(%"class.imp::Vec3") align 8 %5, ptr noundef nonnull align 8 dereferenceable(48) %0)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #4
  invoke void @_ZN3imp4Vec3C2Efff(ptr noundef nonnull align 8 dereferenceable(36) %6, float noundef 1.000000e+01, float noundef 1.000000e+01, float noundef 1.000000e+01)
          to label %12 unwind label %20

12:                                               ; preds = %2
  invoke void @_ZNK3imp3VecILi3EfEmiERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.imp::Vec") align 8 %4, ptr noundef nonnull align 8 dereferenceable(36) %5, ptr noundef nonnull align 8 dereferenceable(36) %6)
          to label %13 unwind label %22

13:                                               ; preds = %12
  invoke void @_ZN3imp4Vec3C2ILi3EEERKNS_3VecIXT_EfEEf(ptr noundef nonnull align 8 dereferenceable(36) %3, ptr noundef nonnull align 8 dereferenceable(36) %4, float noundef 1.000000e+00)
          to label %14 unwind label %24

14:                                               ; preds = %13
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %4) #4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %6) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %5) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %7) #4
  invoke void @_ZN3imp4EdgeC1ERKNS_4Vec3ES3_(ptr noundef nonnull align 8 dereferenceable(104) %7, ptr noundef nonnull align 8 dereferenceable(36) %3, ptr noundef nonnull align 8 dereferenceable(36) %1)
          to label %15 unwind label %28

15:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %8) #4
  invoke void @_ZNK3imp4Path6normalEv(ptr dead_on_unwind nonnull writable sret(%"class.imp::Vec3") align 8 %8, ptr noundef nonnull align 8 dereferenceable(48) %0)
          to label %.preheader unwind label %30

.preheader:                                       ; preds = %15
  %16 = call noundef i32 @_ZNK3imp4Path5countEv(ptr noundef nonnull align 8 dereferenceable(48) %0)
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph, label %._crit_edge

._crit_edge.loopexit:                             ; preds = %36
  %18 = and i32 %spec.select, 1
  %19 = icmp ne i32 %18, 0
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %.016.lcssa = phi i1 [ false, %.preheader ], [ %19, %._crit_edge.loopexit ]
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %8) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #4
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %7) #4
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %7) #4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %3) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #4
  ret i1 %.016.lcssa

20:                                               ; preds = %2
  %21 = landingpad { ptr, i32 }
          cleanup
  br label %27

22:                                               ; preds = %12
  %23 = landingpad { ptr, i32 }
          cleanup
  br label %26

24:                                               ; preds = %13
  %25 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %4) #4
  br label %26

26:                                               ; preds = %24, %22
  %.pn = phi { ptr, i32 } [ %25, %24 ], [ %23, %22 ]
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %6) #4
  br label %27

27:                                               ; preds = %26, %20
  %.pn.pn = phi { ptr, i32 } [ %.pn, %26 ], [ %21, %20 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %5) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #4
  br label %53

28:                                               ; preds = %14
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %52

30:                                               ; preds = %15
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %51

.lr.ph:                                           ; preds = %.preheader, %36
  %.032 = phi i32 [ %38, %36 ], [ 0, %.preheader ]
  %.01631 = phi i32 [ %spec.select, %36 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 312, ptr nonnull %9) #4
  invoke void @_ZNK3imp4Path4edgeEi(ptr dead_on_unwind nonnull writable sret(%"class.imp::Edge") align 8 %10, ptr noundef nonnull align 8 dereferenceable(48) %0, i32 noundef %.032)
          to label %32 unwind label %41

32:                                               ; preds = %.lr.ph
  invoke void @_ZN3imp4EdgeC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(104) %11, ptr noundef nonnull align 8 dereferenceable(104) %7)
          to label %33 unwind label %43

33:                                               ; preds = %32
  invoke void @_ZN3imp12IntersectionC1ENS_4EdgeES1_(ptr noundef nonnull align 8 dereferenceable(312) %9, ptr noundef nonnull %10, ptr noundef nonnull %11)
          to label %34 unwind label %45

34:                                               ; preds = %33
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %11) #4
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %10) #4
  call void @_ZN3imp12Intersection9setNormalERKNS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(312) %9, ptr noundef nonnull align 8 dereferenceable(36) %8)
  %35 = invoke noundef zeroext i1 @_ZN3imp12Intersection7computeEv(ptr noundef nonnull align 8 dereferenceable(312) %9)
          to label %36 unwind label %48

36:                                               ; preds = %34
  %37 = zext i1 %35 to i32
  %spec.select = add nuw nsw i32 %.01631, %37
  call void @_ZN3imp12IntersectionD2Ev(ptr noundef nonnull align 8 dereferenceable(312) %9) #4
  call void @llvm.lifetime.end.p0(i64 312, ptr nonnull %9) #4
  %38 = add nuw nsw i32 %.032, 1
  %39 = call noundef i32 @_ZNK3imp4Path5countEv(ptr noundef nonnull align 8 dereferenceable(48) %0)
  %40 = icmp slt i32 %38, %39
  br i1 %40, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !5

41:                                               ; preds = %.lr.ph
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %50

43:                                               ; preds = %32
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %47

45:                                               ; preds = %33
  %46 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %11) #4
  br label %47

47:                                               ; preds = %45, %43
  %.pn20 = phi { ptr, i32 } [ %46, %45 ], [ %44, %43 ]
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %10) #4
  br label %50

48:                                               ; preds = %34
  %49 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3imp12IntersectionD2Ev(ptr noundef nonnull align 8 dereferenceable(312) %9) #4
  br label %50

50:                                               ; preds = %48, %47, %41
  %.pn22 = phi { ptr, i32 } [ %49, %48 ], [ %.pn20, %47 ], [ %42, %41 ]
  call void @llvm.lifetime.end.p0(i64 312, ptr nonnull %9) #4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %8) #4
  br label %51

51:                                               ; preds = %50, %30
  %.pn22.pn = phi { ptr, i32 } [ %.pn22, %50 ], [ %31, %30 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #4
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %7) #4
  br label %52

52:                                               ; preds = %51, %28
  %.pn22.pn.pn = phi { ptr, i32 } [ %.pn22.pn, %51 ], [ %29, %28 ]
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %7) #4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %3) #4
  br label %53

53:                                               ; preds = %52, %27
  %.pn22.pn.pn.pn = phi { ptr, i32 } [ %.pn22.pn.pn, %52 ], [ %.pn.pn, %27 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #4
  resume { ptr, i32 } %.pn22.pn.pn.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp4Vec3C2Efff(ptr noundef nonnull align 8 dereferenceable(36), float noundef, float noundef, float noundef) unnamed_addr #2 align 2

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

; 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 @_ZN3imp4EdgeC1ERKNS_4Vec3ES3_(ptr, 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: GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass