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

; 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.6" = type { %"class.imp::Object", [2 x i32] }
%"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 }

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp7Polygon7addPathERKNS_4PathENS0_8PathTypeE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48), i32 noundef) #0 align 2

declare i32 @__gxx_personality_v0(...)

; 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

declare noundef i32 @_ZNK3imp4Path13windingNumberEv(ptr noundef nonnull align 8 dereferenceable(48)) #2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3imp19analyticResolution2ERKNS_4PathERKNS_7PolygonENS3_6OpTypeERS3_(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(48) %1, i32 noundef %2, ptr noundef nonnull align 8 dereferenceable(48) %3) #0 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca %"class.imp::Vec.6", align 8
  %11 = alloca %"class.imp::Vec.6", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.imp::Vec.6", align 8
  %15 = alloca %"class.imp::Vec.6", align 8
  %16 = alloca %"class.imp::Vec.6", align 8
  %17 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #5
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = call noundef zeroext i1 @_ZNK3imp7Polygon6insideERKNS_4PathE(ptr noundef nonnull align 8 dereferenceable(48) %18, ptr noundef nonnull align 8 dereferenceable(48) %19)
  %21 = zext i1 %20 to i8
  store i8 %21, ptr %9, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #5
  call void @_ZN3imp3VecILi2EiEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10)
  %22 = load i32, ptr %7, align 4, !tbaa !9
  %23 = icmp eq i32 %22, 0
  br i1 %23, label %24, label %37

24:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #5
  %25 = load i8, ptr %9, align 1, !tbaa !11, !range !13, !noundef !14
  %26 = trunc i8 %25 to i1
  br i1 %26, label %27, label %29

27:                                               ; preds = %24
  invoke void @_ZN3imp3VecILi2EiEC2IJiEEEiDpT_(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef 0, i32 noundef 0)
          to label %28 unwind label %33

28:                                               ; preds = %27
  br label %31

29:                                               ; preds = %24
  invoke void @_ZN3imp3VecILi2EiEC2IJiEEEiDpT_(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef 1, i32 noundef -1)
          to label %30 unwind label %33

30:                                               ; preds = %29
  br label %31

31:                                               ; preds = %30, %28
  %32 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN3imp3VecILi2EiEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull align 8 dereferenceable(32) %11) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #5
  br label %37

33:                                               ; preds = %29, %27
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %12, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #5
  br label %113

37:                                               ; preds = %31, %4
  %38 = load i32, ptr %7, align 4, !tbaa !9
  %39 = icmp eq i32 %38, 2
  br i1 %39, label %40, label %53

40:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #5
  %41 = load i8, ptr %9, align 1, !tbaa !11, !range !13, !noundef !14
  %42 = trunc i8 %41 to i1
  br i1 %42, label %43, label %45

43:                                               ; preds = %40
  invoke void @_ZN3imp3VecILi2EiEC2IJiEEEiDpT_(ptr noundef nonnull align 8 dereferenceable(32) %14, i32 noundef 0, i32 noundef 0)
          to label %44 unwind label %49

44:                                               ; preds = %43
  br label %47

45:                                               ; preds = %40
  invoke void @_ZN3imp3VecILi2EiEC2IJiEEEiDpT_(ptr noundef nonnull align 8 dereferenceable(32) %14, i32 noundef 1, i32 noundef -1)
          to label %46 unwind label %49

46:                                               ; preds = %45
  br label %47

47:                                               ; preds = %46, %44
  %48 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN3imp3VecILi2EiEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull align 8 dereferenceable(32) %14) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #5
  br label %53

49:                                               ; preds = %45, %43
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %12, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #5
  br label %113

53:                                               ; preds = %47, %37
  %54 = load i32, ptr %7, align 4, !tbaa !9
  %55 = icmp eq i32 %54, 3
  br i1 %55, label %56, label %69

56:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #5
  %57 = load i8, ptr %9, align 1, !tbaa !11, !range !13, !noundef !14
  %58 = trunc i8 %57 to i1
  br i1 %58, label %59, label %61

59:                                               ; preds = %56
  invoke void @_ZN3imp3VecILi2EiEC2IJiEEEiDpT_(ptr noundef nonnull align 8 dereferenceable(32) %15, i32 noundef -1, i32 noundef 1)
          to label %60 unwind label %65

60:                                               ; preds = %59
  br label %63

61:                                               ; preds = %56
  invoke void @_ZN3imp3VecILi2EiEC2IJiEEEiDpT_(ptr noundef nonnull align 8 dereferenceable(32) %15, i32 noundef 0, i32 noundef 0)
          to label %62 unwind label %65

62:                                               ; preds = %61
  br label %63

63:                                               ; preds = %62, %60
  %64 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN3imp3VecILi2EiEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull align 8 dereferenceable(32) %15) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #5
  br label %69

65:                                               ; preds = %61, %59
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %12, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #5
  br label %113

69:                                               ; preds = %63, %53
  %70 = load i32, ptr %7, align 4, !tbaa !9
  %71 = icmp eq i32 %70, 1
  br i1 %71, label %72, label %85

72:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #5
  %73 = load i8, ptr %9, align 1, !tbaa !11, !range !13, !noundef !14
  %74 = trunc i8 %73 to i1
  br i1 %74, label %75, label %77

75:                                               ; preds = %72
  invoke void @_ZN3imp3VecILi2EiEC2IJiEEEiDpT_(ptr noundef nonnull align 8 dereferenceable(32) %16, i32 noundef 1, i32 noundef -1)
          to label %76 unwind label %81

76:                                               ; preds = %75
  br label %79

77:                                               ; preds = %72
  invoke void @_ZN3imp3VecILi2EiEC2IJiEEEiDpT_(ptr noundef nonnull align 8 dereferenceable(32) %16, i32 noundef 0, i32 noundef 0)
          to label %78 unwind label %81

78:                                               ; preds = %77
  br label %79

79:                                               ; preds = %78, %76
  %80 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN3imp3VecILi2EiEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull align 8 dereferenceable(32) %16) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #5
  br label %85

81:                                               ; preds = %77, %75
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %12, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #5
  br label %113

85:                                               ; preds = %79, %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  %87 = invoke noundef i32 @_ZNK3imp4Path13windingNumberEv(ptr noundef nonnull align 8 dereferenceable(48) %86)
          to label %88 unwind label %108

88:                                               ; preds = %85
  %89 = icmp sgt i32 %87, 0
  %90 = zext i1 %89 to i64
  %91 = select i1 %89, i32 0, i32 1
  store i32 %91, ptr %17, align 4, !tbaa !15
  %92 = load i32, ptr %17, align 4, !tbaa !15
  %93 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EiEixEj(ptr noundef nonnull align 8 dereferenceable(32) %10, i32 noundef %92)
          to label %94 unwind label %108

94:                                               ; preds = %88
  %95 = load i32, ptr %93, align 4, !tbaa !15
  %96 = icmp ne i32 %95, 0
  br i1 %96, label %97, label %112

97:                                               ; preds = %94
  %98 = load ptr, ptr %8, align 8, !tbaa !5
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = load i32, ptr %17, align 4, !tbaa !15
  %101 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EiEixEj(ptr noundef nonnull align 8 dereferenceable(32) %10, i32 noundef %100)
          to label %102 unwind label %108

102:                                              ; preds = %97
  %103 = load i32, ptr %101, align 4, !tbaa !15
  %104 = icmp sgt i32 %103, 0
  %105 = zext i1 %104 to i64
  %106 = select i1 %104, i32 1, i32 2
  invoke void @_ZN3imp7Polygon7addPathERKNS_4PathENS0_8PathTypeE(ptr noundef nonnull align 8 dereferenceable(48) %98, ptr noundef nonnull align 8 dereferenceable(48) %99, i32 noundef %106)
          to label %107 unwind label %108

107:                                              ; preds = %102
  br label %112

108:                                              ; preds = %102, %97, %88, %85
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %12, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %113

112:                                              ; preds = %107, %94
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  ret void

113:                                              ; preds = %108, %81, %65, %49, %33
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  br label %114

114:                                              ; preds = %113
  %115 = load ptr, ptr %12, align 8
  %116 = load i32, ptr %13, align 4
  %117 = insertvalue { ptr, i32 } poison, ptr %115, 0
  %118 = insertvalue { ptr, i32 } %117, i32 %116, 1
  resume { ptr, i32 } %118
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN3imp3VecILi2EiEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

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

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

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 = { "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 = { 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 = { 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 = !{!"_ZTSN3imp7Polygon6OpTypeE", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !7, i64 0}


; 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.6" = type { %"class.imp::Object", [2 x i32] }
%"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 }

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp7Polygon7addPathERKNS_4PathENS0_8PathTypeE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48), i32 noundef) local_unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; 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

declare noundef i32 @_ZNK3imp4Path13windingNumberEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3imp19analyticResolution2ERKNS_4PathERKNS_7PolygonENS3_6OpTypeERS3_(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(48) %1, i32 noundef %2, ptr noundef nonnull align 8 dereferenceable(48) %3) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.imp::Vec.6", align 8
  %6 = alloca %"class.imp::Vec.6", align 8
  %7 = alloca %"class.imp::Vec.6", align 8
  %8 = alloca %"class.imp::Vec.6", align 8
  %9 = alloca %"class.imp::Vec.6", align 8
  %10 = tail call noundef zeroext i1 @_ZNK3imp7Polygon6insideERKNS_4PathE(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 8 dereferenceable(48) %0)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #5
  call void @_ZN3imp3VecILi2EiEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5)
  switch i32 %2, label %27 [
    i32 0, label %.invoke
    i32 2, label %.invoke18
    i32 3, label %.invoke19
    i32 1, label %.invoke20
  ]

.invoke:                                          ; preds = %4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #5
  %not.29 = xor i1 %10, true
  %. = zext i1 %not.29 to i32
  %not.30 = xor i1 %10, true
  %.21 = sext i1 %not.30 to i32
  invoke void @_ZN3imp3VecILi2EiEC2IJiEEEiDpT_(ptr noundef nonnull align 8 dereferenceable(32) %6, i32 noundef %., i32 noundef %.21)
          to label %11 unwind label %13

11:                                               ; preds = %.invoke
  %12 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN3imp3VecILi2EiEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  br label %27

13:                                               ; preds = %.invoke
  %14 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  br label %41

.invoke18:                                        ; preds = %4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #5
  %not. = xor i1 %10, true
  %.22 = zext i1 %not. to i32
  %not.28 = xor i1 %10, true
  %.23 = sext i1 %not.28 to i32
  invoke void @_ZN3imp3VecILi2EiEC2IJiEEEiDpT_(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef %.22, i32 noundef %.23)
          to label %15 unwind label %17

15:                                               ; preds = %.invoke18
  %16 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN3imp3VecILi2EiEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  br label %27

17:                                               ; preds = %.invoke18
  %18 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  br label %41

.invoke19:                                        ; preds = %4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #5
  %.24 = sext i1 %10 to i32
  %.25 = zext i1 %10 to i32
  invoke void @_ZN3imp3VecILi2EiEC2IJiEEEiDpT_(ptr noundef nonnull align 8 dereferenceable(32) %8, i32 noundef %.24, i32 noundef %.25)
          to label %19 unwind label %21

19:                                               ; preds = %.invoke19
  %20 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN3imp3VecILi2EiEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #5
  br label %27

21:                                               ; preds = %.invoke19
  %22 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #5
  br label %41

.invoke20:                                        ; preds = %4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #5
  %.26 = zext i1 %10 to i32
  %.27 = sext i1 %10 to i32
  invoke void @_ZN3imp3VecILi2EiEC2IJiEEEiDpT_(ptr noundef nonnull align 8 dereferenceable(32) %9, i32 noundef %.26, i32 noundef %.27)
          to label %23 unwind label %25

23:                                               ; preds = %.invoke20
  %24 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN3imp3VecILi2EiEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(32) %9) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #5
  br label %27

25:                                               ; preds = %.invoke20
  %26 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #5
  br label %41

27:                                               ; preds = %19, %15, %11, %4, %23
  %28 = invoke noundef i32 @_ZNK3imp4Path13windingNumberEv(ptr noundef nonnull align 8 dereferenceable(48) %0)
          to label %29 unwind label %38

29:                                               ; preds = %27
  %30 = icmp slt i32 %28, 1
  %31 = zext i1 %30 to i32
  %32 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EiEixEj(ptr noundef nonnull align 8 dereferenceable(32) %5, i32 noundef %31)
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %.not = icmp eq i32 %33, 0
  br i1 %.not, label %40, label %34

34:                                               ; preds = %29
  %35 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EiEixEj(ptr noundef nonnull align 8 dereferenceable(32) %5, i32 noundef %31)
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %.inv = icmp slt i32 %36, 1
  %37 = select i1 %.inv, i32 2, i32 1
  invoke void @_ZN3imp7Polygon7addPathERKNS_4PathENS0_8PathTypeE(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(48) %0, i32 noundef %37)
          to label %40 unwind label %38

38:                                               ; preds = %34, %27
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %41

40:                                               ; preds = %34, %29
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  ret void

41:                                               ; preds = %38, %25, %21, %17, %13
  %.pn = phi { ptr, i32 } [ %39, %38 ], [ %26, %25 ], [ %22, %21 ], [ %18, %17 ], [ %14, %13 ]
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  resume { ptr, i32 } %.pn
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN3imp3VecILi2EiEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

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

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

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 = { "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 = { 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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


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