; LLVM IR from Lut1n/ImpGears :: src/ImpGears/Geometry/Polyhedron.ll (ZN3imp10Polyhedron13cutPolyhedronERKS0_S2_RS0_b)

; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.imp::Path" = type { %"class.imp::Object", %"class.std::vector.0" }
%"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.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = 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.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<imp::Path, std::allocator<imp::Path>>::_Vector_impl" }
%"struct.std::_Vector_base<imp::Path, std::allocator<imp::Path>>::_Vector_impl" = type { %"struct.std::_Vector_base<imp::Path, std::allocator<imp::Path>>::_Vector_impl_data" }
%"struct.std::_Vector_base<imp::Path, std::allocator<imp::Path>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.6" = type { %"struct.std::_Vector_base.7" }
%"struct.std::_Vector_base.7" = 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.__gnu_cxx::__normal_iterator.15" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp10processBarEf(float noundef) #0

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZN3imp4PathD1Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3imp4PathC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3imp10Polyhedron7iFacePhERKNS_4PathERKS0_RSt6vectorINS_4EdgeESaIS7_EE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp9addFaceIfERKNS_4PathERKNS_10PolyhedronEbRS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48), i1 noundef zeroext, ptr noundef nonnull align 8 dereferenceable(48)) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3imp10Polyhedron13cutPolyhedronERKS0_S2_RS0_b(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 8 dereferenceable(48) %2, i1 noundef zeroext %3) #0 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.imp::Path", align 8
  %12 = alloca %"class.std::vector.6", align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %"class.std::vector", align 8
  %16 = alloca %"class.std::vector.6", align 8
  %17 = alloca ptr, align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator.15", align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator.15", align 8
  %20 = alloca %"class.imp::Path", align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %21 = zext i1 %3 to i8
  store i8 %21, ptr %8, align 1, !tbaa !9
  call void @_ZN3imp10processBarEf(float noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !11
  br label %22

22:                                               ; preds = %93, %4
  %23 = load i32, ptr %9, align 4, !tbaa !11
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = call noundef i32 @_ZNK3imp10Polyhedron9faceCountEv(ptr noundef nonnull align 8 dereferenceable(48) %24)
  %26 = icmp slt i32 %23, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %22
  store i32 2, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %97

28:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 48, ptr %11) #6
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = load i32, ptr %9, align 4, !tbaa !11
  call void @_ZNK3imp10PolyhedronixEi(ptr dead_on_unwind writable sret(%"class.imp::Path") align 8 %11, ptr noundef nonnull align 8 dereferenceable(48) %29, i32 noundef %30)
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #6
  call void @_ZNSt6vectorIN3imp4EdgeESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #6
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = invoke noundef zeroext i1 @_ZN3imp10Polyhedron7iFacePhERKNS_4PathERKS0_RSt6vectorINS_4EdgeESaIS7_EE(ptr noundef nonnull align 8 dereferenceable(48) %11, ptr noundef nonnull align 8 dereferenceable(48) %31, ptr noundef nonnull align 8 dereferenceable(24) %12)
          to label %33 unwind label %46

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

34:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #6
  invoke void @_ZNSt6vectorIN3imp4EdgeESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 8 dereferenceable(24) %12)
          to label %35 unwind label %50

35:                                               ; preds = %34
  invoke void @_ZN3imp10Polyhedron7cutFaceERKNS_4PathESt6vectorINS_4EdgeESaIS5_EE(ptr dead_on_unwind writable sret(%"class.std::vector") align 8 %15, ptr noundef nonnull align 8 dereferenceable(48) %11, ptr noundef %16)
          to label %36 unwind label %54

36:                                               ; preds = %35
  call void @_ZNSt6vectorIN3imp4EdgeESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  store ptr %15, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %37 = load ptr, ptr %17, align 8, !tbaa !5
  %38 = call ptr @_ZNSt6vectorIN3imp4PathESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %37) #6
  %39 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.15", ptr %18, i32 0, i32 0
  store ptr %38, ptr %39, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %40 = load ptr, ptr %17, align 8, !tbaa !5
  %41 = call ptr @_ZNSt6vectorIN3imp4PathESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %40) #6
  %42 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.15", ptr %19, i32 0, i32 0
  store ptr %41, ptr %42, align 8
  br label %43

43:                                               ; preds = %66, %36
  %44 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN3imp4PathESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #6
  br i1 %44, label %58, label %45

45:                                               ; preds = %43
  store i32 5, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %77

46:                                               ; preds = %85, %79, %28
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %13, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %14, align 4
  br label %96

50:                                               ; preds = %34
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %13, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %14, align 4
  br label %78

54:                                               ; preds = %35
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %13, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %14, align 4
  call void @_ZNSt6vectorIN3imp4EdgeESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  br label %78

58:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 48, ptr %20) #6
  %59 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3imp4PathESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #6
  invoke void @_ZN3imp4PathC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(48) %20, ptr noundef nonnull align 8 dereferenceable(48) %59)
          to label %60 unwind label %68

60:                                               ; preds = %58
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = load i8, ptr %8, align 1, !tbaa !9, !range !13, !noundef !14
  %63 = trunc i8 %62 to i1
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  invoke void @_ZN3imp9addFaceIfERKNS_4PathERKNS_10PolyhedronEbRS3_(ptr noundef nonnull align 8 dereferenceable(48) %20, ptr noundef nonnull align 8 dereferenceable(48) %61, i1 noundef zeroext %63, ptr noundef nonnull align 8 dereferenceable(48) %64)
          to label %65 unwind label %72

65:                                               ; preds = %60
  call void @_ZN3imp4PathD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %20) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %20) #6
  br label %66

66:                                               ; preds = %65
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPN3imp4PathESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #6
  br label %43

68:                                               ; preds = %58
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %13, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %14, align 4
  br label %76

72:                                               ; preds = %60
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %13, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %14, align 4
  call void @_ZN3imp4PathD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %20) #6
  br label %76

76:                                               ; preds = %72, %68
  call void @llvm.lifetime.end.p0(i64 48, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @_ZNSt6vectorIN3imp4PathESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #6
  br label %78

77:                                               ; preds = %45
  call void @_ZNSt6vectorIN3imp4PathESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #6
  br label %85

78:                                               ; preds = %76, %54, %50
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #6
  br label %96

79:                                               ; preds = %33
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = load i8, ptr %8, align 1, !tbaa !9, !range !13, !noundef !14
  %82 = trunc i8 %81 to i1
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  invoke void @_ZN3imp9addFaceIfERKNS_4PathERKNS_10PolyhedronEbRS3_(ptr noundef nonnull align 8 dereferenceable(48) %11, ptr noundef nonnull align 8 dereferenceable(48) %80, i1 noundef zeroext %82, ptr noundef nonnull align 8 dereferenceable(48) %83)
          to label %84 unwind label %46

84:                                               ; preds = %79
  br label %85

85:                                               ; preds = %84, %77
  %86 = load i32, ptr %9, align 4, !tbaa !11
  %87 = sitofp i32 %86 to float
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = call noundef i32 @_ZNK3imp10Polyhedron9faceCountEv(ptr noundef nonnull align 8 dereferenceable(48) %88)
  %90 = sitofp i32 %89 to float
  %91 = fdiv float %87, %90
  invoke void @_ZN3imp10processBarEf(float noundef %91)
          to label %92 unwind label %46

92:                                               ; preds = %85
  call void @_ZNSt6vectorIN3imp4EdgeESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #6
  call void @_ZN3imp4PathD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %11) #6
  br label %93

93:                                               ; preds = %92
  %94 = load i32, ptr %9, align 4, !tbaa !11
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %9, align 4, !tbaa !11
  br label %22, !llvm.loop !15

96:                                               ; preds = %78, %46
  call void @_ZNSt6vectorIN3imp4EdgeESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #6
  call void @_ZN3imp4PathD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %99

97:                                               ; preds = %27
  call void @_ZN3imp10processBarEf(float noundef 1.000000e+00)
  %98 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret void

99:                                               ; preds = %96
  %100 = load ptr, ptr %13, align 8
  %101 = load i32, ptr %14, align 4
  %102 = insertvalue { ptr, i32 } poison, ptr %100, 0
  %103 = insertvalue { ptr, i32 } %102, i32 %101, 1
  resume { ptr, i32 } %103
}

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { 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 #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 = !{!"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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.imp::Path" = type { %"class.imp::Object", %"class.std::vector.0" }
%"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.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = 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.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<imp::Path, std::allocator<imp::Path>>::_Vector_impl" }
%"struct.std::_Vector_base<imp::Path, std::allocator<imp::Path>>::_Vector_impl" = type { %"struct.std::_Vector_base<imp::Path, std::allocator<imp::Path>>::_Vector_impl_data" }
%"struct.std::_Vector_base<imp::Path, std::allocator<imp::Path>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.6" = type { %"struct.std::_Vector_base.7" }
%"struct.std::_Vector_base.7" = 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.__gnu_cxx::__normal_iterator.15" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp10processBarEf(float noundef) local_unnamed_addr #0

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZN3imp4PathD1Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3imp4PathC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3imp10Polyhedron7iFacePhERKNS_4PathERKS0_RSt6vectorINS_4EdgeESaIS7_EE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp10Polyhedron7cutFaceERKNS_4PathESt6vectorINS_4EdgeESaIS5_EE(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8, ptr noundef nonnull align 8 dereferenceable(48), ptr noundef) local_unnamed_addr #0 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp9addFaceIfERKNS_4PathERKNS_10PolyhedronEbRS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48), i1 noundef zeroext, ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3imp10Polyhedron13cutPolyhedronERKS0_S2_RS0_b(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 8 dereferenceable(48) %2, i1 noundef zeroext %3) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.imp::Path", align 8
  %6 = alloca %"class.std::vector.6", align 8
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca %"class.std::vector.6", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator.15", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator.15", align 8
  %11 = alloca %"class.imp::Path", align 8
  tail call void @_ZN3imp10processBarEf(float noundef 0.000000e+00)
  %12 = tail call noundef i32 @_ZNK3imp10Polyhedron9faceCountEv(ptr noundef nonnull align 8 dereferenceable(48) %0)
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph26, label %._crit_edge27

._crit_edge27:                                    ; preds = %46, %4
  call void @_ZN3imp10processBarEf(float noundef 1.000000e+00)
  %14 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret void

.lr.ph26:                                         ; preds = %4, %46
  %.024 = phi i32 [ %47, %46 ], [ 0, %4 ]
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #6
  call void @_ZNK3imp10PolyhedronixEi(ptr dead_on_unwind nonnull writable sret(%"class.imp::Path") align 8 %5, ptr noundef nonnull align 8 dereferenceable(48) %0, i32 noundef %.024)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  call void @_ZNSt6vectorIN3imp4EdgeESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  %15 = invoke noundef zeroext i1 @_ZN3imp10Polyhedron7iFacePhERKNS_4PathERKS0_RSt6vectorINS_4EdgeESaIS7_EE(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %16 unwind label %23

16:                                               ; preds = %.lr.ph26
  br i1 %15, label %17, label %40

17:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  invoke void @_ZNSt6vectorIN3imp4EdgeESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %18 unwind label %25

18:                                               ; preds = %17
  invoke void @_ZN3imp10Polyhedron7cutFaceERKNS_4PathESt6vectorINS_4EdgeESaIS5_EE(ptr dead_on_unwind nonnull writable sret(%"class.std::vector") align 8 %7, ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull %8)
          to label %19 unwind label %27

19:                                               ; preds = %18
  call void @_ZNSt6vectorIN3imp4EdgeESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %20 = call ptr @_ZNSt6vectorIN3imp4PathESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  store ptr %20, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %21 = call ptr @_ZNSt6vectorIN3imp4PathESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  store ptr %21, ptr %10, align 8
  %22 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN3imp4PathESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  br i1 %22, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %31, %19
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @_ZNSt6vectorIN3imp4PathESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  br label %41

23:                                               ; preds = %41, %40, %.lr.ph26
  %24 = landingpad { ptr, i32 }
          cleanup
  br label %50

25:                                               ; preds = %17
  %26 = landingpad { ptr, i32 }
          cleanup
  br label %39

27:                                               ; preds = %18
  %28 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIN3imp4EdgeESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  br label %39

.lr.ph:                                           ; preds = %19, %31
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %11) #6
  %29 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3imp4PathESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  invoke void @_ZN3imp4PathC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(48) %11, ptr noundef nonnull align 8 dereferenceable(48) %29)
          to label %30 unwind label %34

30:                                               ; preds = %.lr.ph
  invoke void @_ZN3imp9addFaceIfERKNS_4PathERKNS_10PolyhedronEbRS3_(ptr noundef nonnull align 8 dereferenceable(48) %11, ptr noundef nonnull align 8 dereferenceable(48) %1, i1 noundef zeroext %3, ptr noundef nonnull align 8 dereferenceable(48) %2)
          to label %31 unwind label %36

31:                                               ; preds = %30
  call void @_ZN3imp4PathD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %11) #6
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPN3imp4PathESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  %33 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN3imp4PathESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  br i1 %33, label %.lr.ph, label %._crit_edge

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

36:                                               ; preds = %30
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3imp4PathD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #6
  br label %38

38:                                               ; preds = %36, %34
  %.pn = phi { ptr, i32 } [ %37, %36 ], [ %35, %34 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @_ZNSt6vectorIN3imp4PathESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  br label %39

39:                                               ; preds = %38, %27, %25
  %.pn.pn = phi { ptr, i32 } [ %.pn, %38 ], [ %28, %27 ], [ %26, %25 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  br label %50

40:                                               ; preds = %16
  invoke void @_ZN3imp9addFaceIfERKNS_4PathERKNS_10PolyhedronEbRS3_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(48) %1, i1 noundef zeroext %3, ptr noundef nonnull align 8 dereferenceable(48) %2)
          to label %41 unwind label %23

41:                                               ; preds = %40, %._crit_edge
  %42 = uitofp nneg i32 %.024 to float
  %43 = call noundef i32 @_ZNK3imp10Polyhedron9faceCountEv(ptr noundef nonnull align 8 dereferenceable(48) %0)
  %44 = sitofp i32 %43 to float
  %45 = fdiv float %42, %44
  invoke void @_ZN3imp10processBarEf(float noundef %45)
          to label %46 unwind label %23

46:                                               ; preds = %41
  call void @_ZNSt6vectorIN3imp4EdgeESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  call void @_ZN3imp4PathD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #6
  %47 = add nuw nsw i32 %.024, 1
  %48 = call noundef i32 @_ZNK3imp10Polyhedron9faceCountEv(ptr noundef nonnull align 8 dereferenceable(48) %0)
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %.lr.ph26, label %._crit_edge27, !llvm.loop !5

50:                                               ; preds = %39, %23
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %39 ], [ %24, %23 ]
  call void @_ZNSt6vectorIN3imp4EdgeESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  call void @_ZN3imp4PathD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #6
  resume { ptr, i32 } %.pn.pn.pn
}

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

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


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