; LLVM IR from Lut1n/ImpGears :: src/ImpGears/Geometry (Triangulator)

; 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.std::vector.17" = type { %"struct.std::_Vector_base.18" }
%"struct.std::_Vector_base.18" = type { %"struct.std::_Vector_base<imp::Edge, std::allocator<imp::Edge>>::_Vector_impl" }
%"struct.std::_Vector_base<imp::Edge, std::allocator<imp::Edge>>::_Vector_impl" = type { %"struct.std::_Vector_base<imp::Edge, std::allocator<imp::Edge>>::_Vector_impl_data" }
%"struct.std::_Vector_base<imp::Edge, std::allocator<imp::Edge>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.24" = type { %"struct.std::_Vector_base.25" }
%"struct.std::_Vector_base.25" = type { %"struct.std::_Vector_base<imp::Vec3, std::allocator<imp::Vec3>>::_Vector_impl" }
%"struct.std::_Vector_base<imp::Vec3, std::allocator<imp::Vec3>>::_Vector_impl" = type { %"struct.std::_Vector_base<imp::Vec3, std::allocator<imp::Vec3>>::_Vector_impl_data" }
%"struct.std::_Vector_base<imp::Vec3, std::allocator<imp::Vec3>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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.__gnu_cxx::__normal_iterator.29" = type { ptr }
%"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

declare void @_ZN3imp4EdgeC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 8 dereferenceable(104)) unnamed_addr #1

declare noundef zeroext i1 @_ZNK3imp4Edge11connectedToERKS0_(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 8 dereferenceable(104)) #1

declare void @_ZN3imp4EdgeC1ERKNS_4Vec3ES3_(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 8 dereferenceable(36), ptr noundef nonnull align 8 dereferenceable(36)) unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3imp12points2EdgesERKSt6vectorINS_4Vec3ESaIS1_EES1_(ptr dead_on_unwind noalias writable sret(%"class.std::vector.17") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef %2) #3 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i1, align 1
  %8 = alloca %"class.std::vector.24", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"class.imp::Edge", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator.29", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator.29", align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator.29", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator.29", align 8
  %19 = alloca i8, align 1
  %20 = alloca ptr, align 8
  %21 = alloca %"class.__gnu_cxx::__normal_iterator.29", align 8
  %22 = alloca %"class.__gnu_cxx::__normal_iterator.29", align 8
  %23 = alloca %"class.imp::Edge", align 8
  %24 = alloca %"class.imp::Intersection", align 8
  %25 = alloca %"class.imp::Edge", align 8
  %26 = alloca %"class.imp::Edge", align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  store i1 false, ptr %7, align 1
  call void @_ZNSt6vectorIN3imp4EdgeESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #6
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIN3imp4Vec3ESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %27)
          to label %28 unwind label %35

28:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %165, %28
  %30 = load i32, ptr %11, align 4, !tbaa !9
  %31 = call noundef i64 @_ZNKSt6vectorIN3imp4Vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  %32 = trunc i64 %31 to i32
  %33 = icmp slt i32 %30, %32
  br i1 %33, label %39, label %34

34:                                               ; preds = %29
  store i32 2, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %168

35:                                               ; preds = %3
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %9, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %10, align 4
  br label %170

39:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %40

40:                                               ; preds = %154, %39
  %41 = load i32, ptr %13, align 4, !tbaa !9
  %42 = call noundef i64 @_ZNKSt6vectorIN3imp4Vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  %43 = trunc i64 %42 to i32
  %44 = icmp slt i32 %41, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %40
  store i32 5, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %164

46:                                               ; preds = %40
  %47 = load i32, ptr %11, align 4, !tbaa !9
  %48 = load i32, ptr %13, align 4, !tbaa !9
  %49 = icmp eq i32 %47, %48
  br i1 %49, label %50, label %51

50:                                               ; preds = %46
  br label %154

51:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 104, ptr %14) #6
  %52 = load i32, ptr %11, align 4, !tbaa !9
  %53 = sext i32 %52 to i64
  %54 = call noundef nonnull align 8 dereferenceable(36) ptr @_ZNSt6vectorIN3imp4Vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %53) #6
  %55 = load i32, ptr %13, align 4, !tbaa !9
  %56 = sext i32 %55 to i64
  %57 = call noundef nonnull align 8 dereferenceable(36) ptr @_ZNSt6vectorIN3imp4Vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %56) #6
  invoke void @_ZN3imp4EdgeC1ERKNS_4Vec3ES3_(ptr noundef nonnull align 8 dereferenceable(104) %14, ptr noundef nonnull align 8 dereferenceable(36) %54, ptr noundef nonnull align 8 dereferenceable(36) %57)
          to label %58 unwind label %74

58:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %59 = call ptr @_ZNSt6vectorIN3imp4EdgeESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  %60 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.29", ptr %16, i32 0, i32 0
  store ptr %59, ptr %60, align 8
  %61 = call ptr @_ZNSt6vectorIN3imp4EdgeESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  %62 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.29", ptr %17, i32 0, i32 0
  store ptr %61, ptr %62, align 8
  %63 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.29", ptr %16, i32 0, i32 0
  %64 = load ptr, ptr %63, align 8
  %65 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.29", ptr %17, i32 0, i32 0
  %66 = load ptr, ptr %65, align 8
  %67 = invoke ptr @_ZSt4findIN9__gnu_cxx17__normal_iteratorIPN3imp4EdgeESt6vectorIS3_SaIS3_EEEES3_ET_S9_S9_RKT0_(ptr %64, ptr %66, ptr noundef nonnull align 8 dereferenceable(104) %14)
          to label %68 unwind label %78

68:                                               ; preds = %58
  %69 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.29", ptr %15, i32 0, i32 0
  store ptr %67, ptr %69, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %70 = call ptr @_ZNSt6vectorIN3imp4EdgeESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  %71 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.29", ptr %18, i32 0, i32 0
  store ptr %70, ptr %71, align 8
  %72 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN3imp4EdgeESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br i1 %72, label %73, label %82

73:                                               ; preds = %68
  store i32 7, ptr %12, align 4
  br label %151

74:                                               ; preds = %51
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %9, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %10, align 4
  br label %163

78:                                               ; preds = %58
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %9, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %10, align 4
  br label %162

82:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #6
  store i8 0, ptr %19, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  store ptr %0, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %83 = load ptr, ptr %20, align 8, !tbaa !5
  %84 = call ptr @_ZNSt6vectorIN3imp4EdgeESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %83) #6
  %85 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.29", ptr %21, i32 0, i32 0
  store ptr %84, ptr %85, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %86 = load ptr, ptr %20, align 8, !tbaa !5
  %87 = call ptr @_ZNSt6vectorIN3imp4EdgeESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %86) #6
  %88 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.29", ptr %22, i32 0, i32 0
  store ptr %87, ptr %88, align 8
  br label %89

89:                                               ; preds = %138, %82
  %90 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN3imp4EdgeESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %22) #6
  br i1 %90, label %92, label %91

91:                                               ; preds = %89
  store i32 8, ptr %12, align 4
  br label %143

92:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 104, ptr %23) #6
  %93 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3imp4EdgeESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %21) #6
  invoke void @_ZN3imp4EdgeC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(104) %23, ptr noundef nonnull align 8 dereferenceable(104) %93)
          to label %94 unwind label %98

94:                                               ; preds = %92
  %95 = invoke noundef zeroext i1 @_ZNK3imp4Edge11connectedToERKS0_(ptr noundef nonnull align 8 dereferenceable(104) %14, ptr noundef nonnull align 8 dereferenceable(104) %23)
          to label %96 unwind label %102

96:                                               ; preds = %94
  br i1 %95, label %97, label %106

97:                                               ; preds = %96
  store i32 9, ptr %12, align 4
  br label %135

98:                                               ; preds = %92
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %9, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %10, align 4
  br label %142

102:                                              ; preds = %94
  %103 = landingpad { ptr, i32 }
          cleanup
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %9, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %10, align 4
  br label %141

106:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 312, ptr %24) #6
  invoke void @_ZN3imp4EdgeC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(104) %25, ptr noundef nonnull align 8 dereferenceable(104) %14)
          to label %107 unwind label %114

107:                                              ; preds = %106
  invoke void @_ZN3imp4EdgeC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(104) %26, ptr noundef nonnull align 8 dereferenceable(104) %23)
          to label %108 unwind label %118

108:                                              ; preds = %107
  invoke void @_ZN3imp12IntersectionC1ENS_4EdgeES1_(ptr noundef nonnull align 8 dereferenceable(312) %24, ptr noundef %25, ptr noundef %26)
          to label %109 unwind label %122

109:                                              ; preds = %108
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %26) #6
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %25) #6
  invoke void @_ZN3imp12Intersection9setNormalERKNS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(312) %24, ptr noundef nonnull align 8 dereferenceable(36) %2)
          to label %110 unwind label %127

110:                                              ; preds = %109
  %111 = invoke noundef zeroext i1 @_ZN3imp12Intersection7computeEv(ptr noundef nonnull align 8 dereferenceable(312) %24)
          to label %112 unwind label %127

112:                                              ; preds = %110
  br i1 %111, label %113, label %131

113:                                              ; preds = %112
  store i8 1, ptr %19, align 1, !tbaa !11
  store i32 8, ptr %12, align 4
  br label %132

114:                                              ; preds = %106
  %115 = landingpad { ptr, i32 }
          cleanup
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %9, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %10, align 4
  br label %140

118:                                              ; preds = %107
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %9, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %10, align 4
  br label %126

122:                                              ; preds = %108
  %123 = landingpad { ptr, i32 }
          cleanup
  %124 = extractvalue { ptr, i32 } %123, 0
  store ptr %124, ptr %9, align 8
  %125 = extractvalue { ptr, i32 } %123, 1
  store i32 %125, ptr %10, align 4
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %26) #6
  br label %126

126:                                              ; preds = %122, %118
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %25) #6
  br label %140

127:                                              ; preds = %110, %109
  %128 = landingpad { ptr, i32 }
          cleanup
  %129 = extractvalue { ptr, i32 } %128, 0
  store ptr %129, ptr %9, align 8
  %130 = extractvalue { ptr, i32 } %128, 1
  store i32 %130, ptr %10, align 4
  call void @_ZN3imp12IntersectionD2Ev(ptr noundef nonnull align 8 dereferenceable(312) %24) #6
  br label %140

131:                                              ; preds = %112
  store i32 0, ptr %12, align 4
  br label %132

132:                                              ; preds = %131, %113
  call void @_ZN3imp12IntersectionD2Ev(ptr noundef nonnull align 8 dereferenceable(312) %24) #6
  call void @llvm.lifetime.end.p0(i64 312, ptr %24) #6
  %133 = load i32, ptr %12, align 4
  switch i32 %133, label %135 [
    i32 0, label %134
  ]

134:                                              ; preds = %132
  store i32 0, ptr %12, align 4
  br label %135

135:                                              ; preds = %134, %132, %97
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %23) #6
  call void @llvm.lifetime.end.p0(i64 104, ptr %23) #6
  %136 = load i32, ptr %12, align 4
  switch i32 %136, label %143 [
    i32 0, label %137
    i32 9, label %138
  ]

137:                                              ; preds = %135
  br label %138

138:                                              ; preds = %137, %135
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPN3imp4EdgeESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %21) #6
  br label %89

140:                                              ; preds = %127, %126, %114
  call void @llvm.lifetime.end.p0(i64 312, ptr %24) #6
  br label %141

141:                                              ; preds = %140, %102
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %23) #6
  br label %142

142:                                              ; preds = %141, %98
  call void @llvm.lifetime.end.p0(i64 104, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %161

143:                                              ; preds = %135, %91
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %144

144:                                              ; preds = %143
  %145 = load i8, ptr %19, align 1, !tbaa !11, !range !13, !noundef !14
  %146 = trunc i8 %145 to i1
  br i1 %146, label %147, label %148

147:                                              ; preds = %144
  store i32 7, ptr %12, align 4
  br label %150

148:                                              ; preds = %144
  invoke void @_ZNSt6vectorIN3imp4EdgeESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(104) %14)
          to label %149 unwind label %157

149:                                              ; preds = %148
  store i32 0, ptr %12, align 4
  br label %150

150:                                              ; preds = %149, %147
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #6
  br label %151

151:                                              ; preds = %150, %73
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %14) #6
  call void @llvm.lifetime.end.p0(i64 104, ptr %14) #6
  %152 = load i32, ptr %12, align 4
  switch i32 %152, label %178 [
    i32 0, label %153
    i32 7, label %154
  ]

153:                                              ; preds = %151
  br label %154

154:                                              ; preds = %153, %151, %50
  %155 = load i32, ptr %13, align 4, !tbaa !9
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %13, align 4, !tbaa !9
  br label %40, !llvm.loop !15

157:                                              ; preds = %148
  %158 = landingpad { ptr, i32 }
          cleanup
  %159 = extractvalue { ptr, i32 } %158, 0
  store ptr %159, ptr %9, align 8
  %160 = extractvalue { ptr, i32 } %158, 1
  store i32 %160, ptr %10, align 4
  br label %161

161:                                              ; preds = %157, %142
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #6
  br label %162

162:                                              ; preds = %161, %78
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %14) #6
  br label %163

163:                                              ; preds = %162, %74
  call void @llvm.lifetime.end.p0(i64 104, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @_ZNSt6vectorIN3imp4Vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  br label %170

164:                                              ; preds = %45
  br label %165

165:                                              ; preds = %164
  %166 = load i32, ptr %11, align 4, !tbaa !9
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %11, align 4, !tbaa !9
  br label %29, !llvm.loop !17

168:                                              ; preds = %34
  store i1 true, ptr %7, align 1
  store i32 1, ptr %12, align 4
  call void @_ZNSt6vectorIN3imp4Vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #6
  %169 = load i1, ptr %7, align 1
  br i1 %169, label %172, label %171

170:                                              ; preds = %163, %35
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #6
  call void @_ZNSt6vectorIN3imp4EdgeESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  br label %173

171:                                              ; preds = %168
  call void @_ZNSt6vectorIN3imp4EdgeESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  br label %172

172:                                              ; preds = %171, %168
  ret void

173:                                              ; preds = %170
  %174 = load ptr, ptr %9, align 8
  %175 = load i32, ptr %10, align 4
  %176 = insertvalue { ptr, i32 } poison, ptr %174, 0
  %177 = insertvalue { ptr, i32 } %176, i32 %175, 1
  resume { ptr, i32 } %177

178:                                              ; preds = %151
  unreachable
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN3imp4Vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(36) ptr @_ZNSt6vectorIN3imp4Vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt4findIN9__gnu_cxx17__normal_iteratorIPN3imp4EdgeESt6vectorIS3_SaIS3_EEEES3_ET_S9_S9_RKT0_(ptr, ptr, ptr noundef nonnull align 8 dereferenceable(104)) #5

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

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

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

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

declare void @_ZN3imp12IntersectionC1ENS_4EdgeES1_(ptr noundef nonnull align 8 dereferenceable(312), ptr noundef, ptr noundef) unnamed_addr #1

declare void @_ZN3imp12Intersection9setNormalERKNS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(312), ptr noundef nonnull align 8 dereferenceable(36)) #1

declare noundef zeroext i1 @_ZN3imp12Intersection7computeEv(ptr noundef nonnull align 8 dereferenceable(312)) #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN3imp4EdgeESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(104)) #3 align 2

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { 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 #4 = { 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 #5 = { inlinehint 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 #6 = { 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 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !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"

%"class.std::vector.17" = type { %"struct.std::_Vector_base.18" }
%"struct.std::_Vector_base.18" = type { %"struct.std::_Vector_base<imp::Edge, std::allocator<imp::Edge>>::_Vector_impl" }
%"struct.std::_Vector_base<imp::Edge, std::allocator<imp::Edge>>::_Vector_impl" = type { %"struct.std::_Vector_base<imp::Edge, std::allocator<imp::Edge>>::_Vector_impl_data" }
%"struct.std::_Vector_base<imp::Edge, std::allocator<imp::Edge>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.24" = type { %"struct.std::_Vector_base.25" }
%"struct.std::_Vector_base.25" = type { %"struct.std::_Vector_base<imp::Vec3, std::allocator<imp::Vec3>>::_Vector_impl" }
%"struct.std::_Vector_base<imp::Vec3, std::allocator<imp::Vec3>>::_Vector_impl" = type { %"struct.std::_Vector_base<imp::Vec3, std::allocator<imp::Vec3>>::_Vector_impl_data" }
%"struct.std::_Vector_base<imp::Vec3, std::allocator<imp::Vec3>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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.__gnu_cxx::__normal_iterator.29" = type { ptr }
%"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

declare void @_ZN3imp4EdgeC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 8 dereferenceable(104)) unnamed_addr #1

declare noundef zeroext i1 @_ZNK3imp4Edge11connectedToERKS0_(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #1

declare void @_ZN3imp4EdgeC1ERKNS_4Vec3ES3_(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 8 dereferenceable(36), ptr noundef nonnull align 8 dereferenceable(36)) unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3imp12points2EdgesERKSt6vectorINS_4Vec3ESaIS1_EES1_(ptr dead_on_unwind noalias nonnull writable sret(%"class.std::vector.17") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef %2) local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::vector.24", align 8
  %5 = alloca %"class.imp::Edge", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator.29", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator.29", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator.29", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator.29", align 8
  %10 = alloca %"class.imp::Edge", align 8
  %11 = alloca %"class.imp::Intersection", align 8
  %12 = alloca %"class.imp::Edge", align 8
  %13 = alloca %"class.imp::Edge", align 8
  tail call void @_ZNSt6vectorIN3imp4EdgeESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #6
  invoke void @_ZNSt6vectorIN3imp4Vec3ESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %1)
          to label %.preheader46 unwind label %20

.preheader46:                                     ; preds = %3
  %14 = call noundef i64 @_ZNKSt6vectorIN3imp4Vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  %15 = trunc i64 %14 to i32
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.preheader, label %._crit_edge57

.preheader:                                       ; preds = %.preheader46, %._crit_edge
  %indvars.iv66 = phi i64 [ %indvars.iv.next67, %._crit_edge ], [ 0, %.preheader46 ]
  %17 = call noundef i64 @_ZNKSt6vectorIN3imp4Vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  %18 = trunc i64 %17 to i32
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph55, label %._crit_edge

._crit_edge57:                                    ; preds = %._crit_edge, %.preheader46
  call void @_ZNSt6vectorIN3imp4Vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  ret void

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

._crit_edge:                                      ; preds = %76, %.preheader
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %22 = call noundef i64 @_ZNKSt6vectorIN3imp4Vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  %sext70 = shl i64 %22, 32
  %23 = ashr exact i64 %sext70, 32
  %24 = icmp slt i64 %indvars.iv.next67, %23
  br i1 %24, label %.preheader, label %._crit_edge57, !llvm.loop !5

.lr.ph55:                                         ; preds = %.preheader, %76
  %indvars.iv = phi i64 [ %indvars.iv.next, %76 ], [ 0, %.preheader ]
  %25 = icmp eq i64 %indvars.iv66, %indvars.iv
  br i1 %25, label %76, label %26

26:                                               ; preds = %.lr.ph55
  call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %5) #6
  %27 = call noundef nonnull align 8 dereferenceable(36) ptr @_ZNSt6vectorIN3imp4Vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv66) #6
  %28 = call noundef nonnull align 8 dereferenceable(36) ptr @_ZNSt6vectorIN3imp4Vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv) #6
  invoke void @_ZN3imp4EdgeC1ERKNS_4Vec3ES3_(ptr noundef nonnull align 8 dereferenceable(104) %5, ptr noundef nonnull align 8 dereferenceable(36) %27, ptr noundef nonnull align 8 dereferenceable(36) %28)
          to label %29 unwind label %36

29:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %30 = call ptr @_ZNSt6vectorIN3imp4EdgeESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  %31 = call ptr @_ZNSt6vectorIN3imp4EdgeESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  %32 = invoke ptr @_ZSt4findIN9__gnu_cxx17__normal_iteratorIPN3imp4EdgeESt6vectorIS3_SaIS3_EEEES3_ET_S9_S9_RKT0_(ptr %30, ptr %31, ptr noundef nonnull align 8 dereferenceable(104) %5)
          to label %33 unwind label %38

33:                                               ; preds = %29
  store ptr %32, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %34 = call ptr @_ZNSt6vectorIN3imp4EdgeESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  store ptr %34, ptr %7, align 8
  %35 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN3imp4EdgeESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br i1 %35, label %75, label %40

36:                                               ; preds = %26
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %83

38:                                               ; preds = %29
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %82

40:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %41 = call ptr @_ZNSt6vectorIN3imp4EdgeESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  store ptr %41, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %42 = call ptr @_ZNSt6vectorIN3imp4EdgeESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  store ptr %42, ptr %9, align 8
  %43 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN3imp4EdgeESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  br i1 %43, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %40, %69
  call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %10) #6
  %44 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3imp4EdgeESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  invoke void @_ZN3imp4EdgeC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(104) %10, ptr noundef nonnull align 8 dereferenceable(104) %44)
          to label %45 unwind label %48

45:                                               ; preds = %.lr.ph
  %46 = invoke noundef zeroext i1 @_ZNK3imp4Edge11connectedToERKS0_(ptr noundef nonnull align 8 dereferenceable(104) %5, ptr noundef nonnull align 8 dereferenceable(104) %10)
          to label %47 unwind label %50

47:                                               ; preds = %45
  br i1 %46, label %69, label %52

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

50:                                               ; preds = %45
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %73

52:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 312, ptr nonnull %11) #6
  invoke void @_ZN3imp4EdgeC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(104) %12, ptr noundef nonnull align 8 dereferenceable(104) %5)
          to label %53 unwind label %59

53:                                               ; preds = %52
  invoke void @_ZN3imp4EdgeC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(104) %13, ptr noundef nonnull align 8 dereferenceable(104) %10)
          to label %54 unwind label %61

54:                                               ; preds = %53
  invoke void @_ZN3imp12IntersectionC1ENS_4EdgeES1_(ptr noundef nonnull align 8 dereferenceable(312) %11, ptr noundef nonnull %12, ptr noundef nonnull %13)
          to label %55 unwind label %63

55:                                               ; preds = %54
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %13) #6
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %12) #6
  invoke void @_ZN3imp12Intersection9setNormalERKNS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(312) %11, ptr noundef nonnull align 8 dereferenceable(36) %2)
          to label %56 unwind label %66

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

58:                                               ; preds = %56
  call void @_ZN3imp12IntersectionD2Ev(ptr noundef nonnull align 8 dereferenceable(312) %11) #6
  call void @llvm.lifetime.end.p0(i64 312, ptr nonnull %11) #6
  br i1 %57, label %68, label %69

59:                                               ; preds = %52
  %60 = landingpad { ptr, i32 }
          cleanup
  br label %72

61:                                               ; preds = %53
  %62 = landingpad { ptr, i32 }
          cleanup
  br label %65

63:                                               ; preds = %54
  %64 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %13) #6
  br label %65

65:                                               ; preds = %63, %61
  %.pn = phi { ptr, i32 } [ %64, %63 ], [ %62, %61 ]
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %12) #6
  br label %72

66:                                               ; preds = %56, %55
  %67 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3imp12IntersectionD2Ev(ptr noundef nonnull align 8 dereferenceable(312) %11) #6
  br label %72

68:                                               ; preds = %58
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %10) #6
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %75

69:                                               ; preds = %58, %47
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %10) #6
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %10) #6
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPN3imp4EdgeESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  %71 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN3imp4EdgeESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  br i1 %71, label %.lr.ph, label %.loopexit

72:                                               ; preds = %66, %65, %59
  %.pn34 = phi { ptr, i32 } [ %67, %66 ], [ %.pn, %65 ], [ %60, %59 ]
  call void @llvm.lifetime.end.p0(i64 312, ptr nonnull %11) #6
  br label %73

73:                                               ; preds = %72, %50
  %.pn34.pn = phi { ptr, i32 } [ %.pn34, %72 ], [ %51, %50 ]
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %10) #6
  br label %74

74:                                               ; preds = %73, %48
  %.pn34.pn.pn = phi { ptr, i32 } [ %.pn34.pn, %73 ], [ %49, %48 ]
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %82

.loopexit:                                        ; preds = %69, %40
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  invoke void @_ZNSt6vectorIN3imp4EdgeESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(104) %5)
          to label %75 unwind label %80

75:                                               ; preds = %68, %.loopexit, %33
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %5) #6
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %5) #6
  br label %76

76:                                               ; preds = %75, %.lr.ph55
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %77 = call noundef i64 @_ZNKSt6vectorIN3imp4Vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  %sext = shl i64 %77, 32
  %78 = ashr exact i64 %sext, 32
  %79 = icmp slt i64 %indvars.iv.next, %78
  br i1 %79, label %.lr.ph55, label %._crit_edge, !llvm.loop !7

80:                                               ; preds = %.loopexit
  %81 = landingpad { ptr, i32 }
          cleanup
  br label %82

82:                                               ; preds = %74, %80, %38
  %.pn38.pn = phi { ptr, i32 } [ %39, %38 ], [ %81, %80 ], [ %.pn34.pn.pn, %74 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @_ZN3imp4EdgeD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %5) #6
  br label %83

83:                                               ; preds = %82, %36
  %.pn38.pn.pn = phi { ptr, i32 } [ %.pn38.pn, %82 ], [ %37, %36 ]
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %5) #6
  call void @_ZNSt6vectorIN3imp4Vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  br label %84

84:                                               ; preds = %83, %20
  %.pn38.pn.pn.pn = phi { ptr, i32 } [ %.pn38.pn.pn, %83 ], [ %21, %20 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  call void @_ZNSt6vectorIN3imp4EdgeESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  resume { ptr, i32 } %.pn38.pn.pn.pn
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN3imp4Vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(36) ptr @_ZNSt6vectorIN3imp4Vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt4findIN9__gnu_cxx17__normal_iteratorIPN3imp4EdgeESt6vectorIS3_SaIS3_EEEES3_ET_S9_S9_RKT0_(ptr, ptr, ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIN3imp4EdgeESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIN3imp4EdgeESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(104) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3imp4EdgeESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

declare void @_ZN3imp12IntersectionC1ENS_4EdgeES1_(ptr noundef nonnull align 8 dereferenceable(312), ptr noundef, ptr noundef) unnamed_addr #1

declare void @_ZN3imp12Intersection9setNormalERKNS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(312), ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #1

declare noundef zeroext i1 @_ZN3imp12Intersection7computeEv(ptr noundef nonnull align 8 dereferenceable(312)) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN3imp4EdgeESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #3 align 2

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { 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 #4 = { 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 #5 = { inlinehint 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 #6 = { 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"}
!7 = distinct !{!7, !6}


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