; LLVM IR from xhub/reshop :: gui/external/imgui/imgui_draw.ll (ZN14ImTriangulator15GetNextTriangleEPj)

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

%struct.ImTriangulator = type { i32, ptr, %struct.ImTriangulatorNodeSpan, %struct.ImTriangulatorNodeSpan }
%struct.ImTriangulatorNodeSpan = type <{ ptr, i32, [4 x i8] }>
%struct.ImTriangulatorNode = type { i32, i32, %struct.ImVec2, ptr, ptr }
%struct.ImVec2 = type { float, float }

@.str.1 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [19 x i8], align 1
@__PRETTY_FUNCTION__._ZN14ImTriangulator15GetNextTriangleEPj = external hidden unnamed_addr constant [53 x i8], align 1

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN14ImTriangulator15GetNextTriangleEPj(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef %1) #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %8 = load ptr, ptr %3, align 8
  %9 = getelementptr inbounds %struct.ImTriangulator, ptr %8, i32 0, i32 2
  %10 = getelementptr inbounds %struct.ImTriangulatorNodeSpan, ptr %9, i32 0, i32 1
  %11 = load i32, ptr %10, align 8, !tbaa !9
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %13, label %55

13:                                               ; preds = %2
  call void @_ZN14ImTriangulator12FlipNodeListEv(ptr noundef nonnull align 8 dereferenceable(48) %8)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %14 = getelementptr inbounds %struct.ImTriangulator, ptr %8, i32 0, i32 1
  %15 = load ptr, ptr %14, align 8, !tbaa !13
  store ptr %15, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %16 = getelementptr inbounds %struct.ImTriangulator, ptr %8, i32 0, i32 0
  %17 = load i32, ptr %16, align 8, !tbaa !14
  store i32 %17, ptr %6, align 4, !tbaa !15
  br label %18

18:                                               ; preds = %25, %13
  %19 = load i32, ptr %6, align 4, !tbaa !15
  %20 = icmp sge i32 %19, 0
  br i1 %20, label %22, label %21

21:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %31

22:                                               ; preds = %18
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.ImTriangulatorNode, ptr %23, i32 0, i32 0
  store i32 0, ptr %24, align 8, !tbaa !16
  br label %25

25:                                               ; preds = %22
  %26 = load i32, ptr %6, align 4, !tbaa !15
  %27 = add nsw i32 %26, -1
  store i32 %27, ptr %6, align 4, !tbaa !15
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.ImTriangulatorNode, ptr %28, i32 0, i32 3
  %30 = load ptr, ptr %29, align 8, !tbaa !21
  store ptr %30, ptr %5, align 8, !tbaa !5
  br label %18, !llvm.loop !22

31:                                               ; preds = %21
  %32 = getelementptr inbounds %struct.ImTriangulator, ptr %8, i32 0, i32 3
  %33 = getelementptr inbounds %struct.ImTriangulatorNodeSpan, ptr %32, i32 0, i32 1
  store i32 0, ptr %33, align 8, !tbaa !24
  call void @_ZN14ImTriangulator13BuildReflexesEv(ptr noundef nonnull align 8 dereferenceable(48) %8)
  call void @_ZN14ImTriangulator9BuildEarsEv(ptr noundef nonnull align 8 dereferenceable(48) %8)
  %34 = getelementptr inbounds %struct.ImTriangulator, ptr %8, i32 0, i32 2
  %35 = getelementptr inbounds %struct.ImTriangulatorNodeSpan, ptr %34, i32 0, i32 1
  %36 = load i32, ptr %35, align 8, !tbaa !9
  %37 = icmp eq i32 %36, 0
  br i1 %37, label %38, label %54

38:                                               ; preds = %31
  %39 = getelementptr inbounds %struct.ImTriangulator, ptr %8, i32 0, i32 0
  %40 = load i32, ptr %39, align 8, !tbaa !14
  %41 = icmp sgt i32 %40, 0
  br i1 %41, label %42, label %43

42:                                               ; preds = %38
  br label %45

43:                                               ; preds = %38
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.1, i32 noundef 1890, ptr noundef @__PRETTY_FUNCTION__._ZN14ImTriangulator15GetNextTriangleEPj) #5
  unreachable

44:                                               ; No predecessors!
  br label %45

45:                                               ; preds = %44, %42
  %46 = getelementptr inbounds %struct.ImTriangulator, ptr %8, i32 0, i32 1
  %47 = load ptr, ptr %46, align 8, !tbaa !13
  %48 = getelementptr inbounds %struct.ImTriangulator, ptr %8, i32 0, i32 2
  %49 = getelementptr inbounds %struct.ImTriangulatorNodeSpan, ptr %48, i32 0, i32 0
  %50 = load ptr, ptr %49, align 8, !tbaa !25
  %51 = getelementptr inbounds ptr, ptr %50, i64 0
  store ptr %47, ptr %51, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.ImTriangulator, ptr %8, i32 0, i32 2
  %53 = getelementptr inbounds %struct.ImTriangulatorNodeSpan, ptr %52, i32 0, i32 1
  store i32 1, ptr %53, align 8, !tbaa !9
  br label %54

54:                                               ; preds = %45, %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  br label %55

55:                                               ; preds = %54, %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %56 = getelementptr inbounds %struct.ImTriangulator, ptr %8, i32 0, i32 2
  %57 = getelementptr inbounds %struct.ImTriangulatorNodeSpan, ptr %56, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8, !tbaa !25
  %59 = getelementptr inbounds %struct.ImTriangulator, ptr %8, i32 0, i32 2
  %60 = getelementptr inbounds %struct.ImTriangulatorNodeSpan, ptr %59, i32 0, i32 1
  %61 = load i32, ptr %60, align 8, !tbaa !9
  %62 = add nsw i32 %61, -1
  store i32 %62, ptr %60, align 8, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds ptr, ptr %58, i64 %63
  %65 = load ptr, ptr %64, align 8, !tbaa !5
  store ptr %65, ptr %7, align 8, !tbaa !5
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.ImTriangulatorNode, ptr %66, i32 0, i32 4
  %68 = load ptr, ptr %67, align 8, !tbaa !26
  %69 = getelementptr inbounds %struct.ImTriangulatorNode, ptr %68, i32 0, i32 1
  %70 = load i32, ptr %69, align 4, !tbaa !27
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = getelementptr inbounds i32, ptr %71, i64 0
  store i32 %70, ptr %72, align 4, !tbaa !15
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.ImTriangulatorNode, ptr %73, i32 0, i32 1
  %75 = load i32, ptr %74, align 4, !tbaa !27
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = getelementptr inbounds i32, ptr %76, i64 1
  store i32 %75, ptr %77, align 4, !tbaa !15
  %78 = load ptr, ptr %7, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.ImTriangulatorNode, ptr %78, i32 0, i32 3
  %80 = load ptr, ptr %79, align 8, !tbaa !21
  %81 = getelementptr inbounds %struct.ImTriangulatorNode, ptr %80, i32 0, i32 1
  %82 = load i32, ptr %81, align 4, !tbaa !27
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = getelementptr inbounds i32, ptr %83, i64 2
  store i32 %82, ptr %84, align 4, !tbaa !15
  %85 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN18ImTriangulatorNode6UnlinkEv(ptr noundef nonnull align 8 dereferenceable(32) %85)
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.ImTriangulator, ptr %8, i32 0, i32 1
  %88 = load ptr, ptr %87, align 8, !tbaa !13
  %89 = icmp eq ptr %86, %88
  br i1 %89, label %90, label %95

90:                                               ; preds = %55
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.ImTriangulatorNode, ptr %91, i32 0, i32 3
  %93 = load ptr, ptr %92, align 8, !tbaa !21
  %94 = getelementptr inbounds %struct.ImTriangulator, ptr %8, i32 0, i32 1
  store ptr %93, ptr %94, align 8, !tbaa !13
  br label %95

95:                                               ; preds = %90, %55
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.ImTriangulatorNode, ptr %96, i32 0, i32 4
  %98 = load ptr, ptr %97, align 8, !tbaa !26
  call void @_ZN14ImTriangulator14ReclassifyNodeEP18ImTriangulatorNode(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef %98)
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.ImTriangulatorNode, ptr %99, i32 0, i32 3
  %101 = load ptr, ptr %100, align 8, !tbaa !21
  call void @_ZN14ImTriangulator14ReclassifyNodeEP18ImTriangulatorNode(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef %101)
  %102 = getelementptr inbounds %struct.ImTriangulator, ptr %8, i32 0, i32 0
  %103 = load i32, ptr %102, align 8, !tbaa !14
  %104 = add nsw i32 %103, -1
  store i32 %104, ptr %102, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  ret void
}

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn 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 #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { noreturn 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, !11, i64 24}
!10 = !{!"_ZTS14ImTriangulator", !11, i64 0, !6, i64 8, !12, i64 16, !12, i64 32}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTS22ImTriangulatorNodeSpan", !6, i64 0, !11, i64 8}
!13 = !{!10, !6, i64 8}
!14 = !{!10, !11, i64 0}
!15 = !{!11, !11, i64 0}
!16 = !{!17, !18, i64 0}
!17 = !{!"_ZTS18ImTriangulatorNode", !18, i64 0, !11, i64 4, !19, i64 8, !6, i64 16, !6, i64 24}
!18 = !{!"_ZTS22ImTriangulatorNodeType", !7, i64 0}
!19 = !{!"_ZTS6ImVec2", !20, i64 0, !20, i64 4}
!20 = !{!"float", !7, i64 0}
!21 = !{!17, !6, i64 16}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!10, !11, i64 40}
!25 = !{!10, !6, i64 16}
!26 = !{!17, !6, i64 24}
!27 = !{!17, !11, i64 4}


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

@.str.1 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [19 x i8], align 1
@__PRETTY_FUNCTION__._ZN14ImTriangulator15GetNextTriangleEPj = external hidden unnamed_addr constant [53 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN14ImTriangulator15GetNextTriangleEPj(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr nocapture noundef writeonly %1) local_unnamed_addr #1 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 16
  %4 = getelementptr inbounds i8, ptr %0, i64 24
  %5 = load i32, ptr %4, align 8, !tbaa !5
  %6 = icmp eq i32 %5, 0
  br i1 %6, label %7, label %34

7:                                                ; preds = %2
  tail call void @_ZN14ImTriangulator12FlipNodeListEv(ptr noundef nonnull align 8 dereferenceable(48) %0)
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = load i32, ptr %0, align 8, !tbaa !12
  %10 = icmp sgt i32 %9, -1
  br i1 %10, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %7
  %11 = add nuw i32 %9, 1
  %xtraiter = and i32 %11, 7
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol

.lr.ph.prol:                                      ; preds = %.lr.ph.preheader, %.lr.ph.prol
  %.0.in17.prol = phi ptr [ %13, %.lr.ph.prol ], [ %8, %.lr.ph.preheader ]
  %.01516.prol = phi i32 [ %12, %.lr.ph.prol ], [ %9, %.lr.ph.preheader ]
  %prol.iter = phi i32 [ %prol.iter.next, %.lr.ph.prol ], [ 0, %.lr.ph.preheader ]
  %.0.prol = load ptr, ptr %.0.in17.prol, align 8, !tbaa !13
  store i32 0, ptr %.0.prol, align 8, !tbaa !14
  %12 = add nsw i32 %.01516.prol, -1
  %13 = getelementptr inbounds i8, ptr %.0.prol, i64 16
  %prol.iter.next = add i32 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i32 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol, !llvm.loop !19

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader
  %.0.in17.unr = phi ptr [ %8, %.lr.ph.preheader ], [ %13, %.lr.ph.prol ]
  %.01516.unr = phi i32 [ %9, %.lr.ph.preheader ], [ %12, %.lr.ph.prol ]
  %14 = icmp ult i32 %9, 7
  br i1 %14, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %7
  %15 = getelementptr inbounds i8, ptr %0, i64 40
  store i32 0, ptr %15, align 8, !tbaa !21
  tail call void @_ZN14ImTriangulator13BuildReflexesEv(ptr noundef nonnull align 8 dereferenceable(48) %0)
  tail call void @_ZN14ImTriangulator9BuildEarsEv(ptr noundef nonnull align 8 dereferenceable(48) %0)
  %16 = load i32, ptr %4, align 8, !tbaa !5
  %17 = icmp eq i32 %16, 0
  br i1 %17, label %27, label %34

.lr.ph:                                           ; preds = %.lr.ph.prol.loopexit, %.lr.ph
  %.0.in17 = phi ptr [ %26, %.lr.ph ], [ %.0.in17.unr, %.lr.ph.prol.loopexit ]
  %.01516 = phi i32 [ %25, %.lr.ph ], [ %.01516.unr, %.lr.ph.prol.loopexit ]
  %.0 = load ptr, ptr %.0.in17, align 8, !tbaa !13
  store i32 0, ptr %.0, align 8, !tbaa !14
  %18 = getelementptr inbounds i8, ptr %.0, i64 16
  %.0.1 = load ptr, ptr %18, align 8, !tbaa !13
  store i32 0, ptr %.0.1, align 8, !tbaa !14
  %19 = getelementptr inbounds i8, ptr %.0.1, i64 16
  %.0.2 = load ptr, ptr %19, align 8, !tbaa !13
  store i32 0, ptr %.0.2, align 8, !tbaa !14
  %20 = getelementptr inbounds i8, ptr %.0.2, i64 16
  %.0.3 = load ptr, ptr %20, align 8, !tbaa !13
  store i32 0, ptr %.0.3, align 8, !tbaa !14
  %21 = getelementptr inbounds i8, ptr %.0.3, i64 16
  %.0.4 = load ptr, ptr %21, align 8, !tbaa !13
  store i32 0, ptr %.0.4, align 8, !tbaa !14
  %22 = getelementptr inbounds i8, ptr %.0.4, i64 16
  %.0.5 = load ptr, ptr %22, align 8, !tbaa !13
  store i32 0, ptr %.0.5, align 8, !tbaa !14
  %23 = getelementptr inbounds i8, ptr %.0.5, i64 16
  %.0.6 = load ptr, ptr %23, align 8, !tbaa !13
  store i32 0, ptr %.0.6, align 8, !tbaa !14
  %24 = getelementptr inbounds i8, ptr %.0.6, i64 16
  %.0.7 = load ptr, ptr %24, align 8, !tbaa !13
  store i32 0, ptr %.0.7, align 8, !tbaa !14
  %25 = add nsw i32 %.01516, -8
  %26 = getelementptr inbounds i8, ptr %.0.7, i64 16
  %.not.7 = icmp eq i32 %.01516, 7
  br i1 %.not.7, label %._crit_edge, label %.lr.ph, !llvm.loop !22

27:                                               ; preds = %._crit_edge
  %28 = load i32, ptr %0, align 8, !tbaa !12
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %31, label %30

30:                                               ; preds = %27
  tail call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.1, i32 noundef 1890, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14ImTriangulator15GetNextTriangleEPj) #3
  unreachable

31:                                               ; preds = %27
  %32 = load ptr, ptr %8, align 8, !tbaa !24
  %33 = load ptr, ptr %3, align 8, !tbaa !25
  store ptr %32, ptr %33, align 8, !tbaa !13
  br label %34

34:                                               ; preds = %._crit_edge, %31, %2
  %35 = phi i32 [ %16, %._crit_edge ], [ 1, %31 ], [ %5, %2 ]
  %36 = load ptr, ptr %3, align 8, !tbaa !25
  %37 = add nsw i32 %35, -1
  store i32 %37, ptr %4, align 8, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds ptr, ptr %36, i64 %38
  %40 = load ptr, ptr %39, align 8, !tbaa !13
  %41 = getelementptr inbounds i8, ptr %40, i64 24
  %42 = load ptr, ptr %41, align 8, !tbaa !26
  %43 = getelementptr inbounds i8, ptr %42, i64 4
  %44 = load i32, ptr %43, align 4, !tbaa !27
  store i32 %44, ptr %1, align 4, !tbaa !28
  %45 = getelementptr inbounds i8, ptr %40, i64 4
  %46 = load i32, ptr %45, align 4, !tbaa !27
  %47 = getelementptr inbounds i8, ptr %1, i64 4
  store i32 %46, ptr %47, align 4, !tbaa !28
  %48 = getelementptr inbounds i8, ptr %40, i64 16
  %49 = load ptr, ptr %48, align 8, !tbaa !29
  %50 = getelementptr inbounds i8, ptr %49, i64 4
  %51 = load i32, ptr %50, align 4, !tbaa !27
  %52 = getelementptr inbounds i8, ptr %1, i64 8
  store i32 %51, ptr %52, align 4, !tbaa !28
  tail call void @_ZN18ImTriangulatorNode6UnlinkEv(ptr noundef nonnull align 8 dereferenceable(32) %40)
  %53 = getelementptr inbounds i8, ptr %0, i64 8
  %54 = load ptr, ptr %53, align 8, !tbaa !24
  %55 = icmp eq ptr %40, %54
  br i1 %55, label %56, label %58

56:                                               ; preds = %34
  %57 = load ptr, ptr %48, align 8, !tbaa !29
  store ptr %57, ptr %53, align 8, !tbaa !24
  br label %58

58:                                               ; preds = %56, %34
  %59 = load ptr, ptr %41, align 8, !tbaa !26
  tail call void @_ZN14ImTriangulator14ReclassifyNodeEP18ImTriangulatorNode(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef %59)
  %60 = load ptr, ptr %48, align 8, !tbaa !29
  tail call void @_ZN14ImTriangulator14ReclassifyNodeEP18ImTriangulatorNode(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef %60)
  %61 = load i32, ptr %0, align 8, !tbaa !12
  %62 = add nsw i32 %61, -1
  store i32 %62, ptr %0, align 8, !tbaa !12
  ret void
}

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

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

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

attributes #0 = { noreturn 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 #1 = { 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 #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 = { noreturn 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, !7, i64 24}
!6 = !{!"_ZTS14ImTriangulator", !7, i64 0, !10, i64 8, !11, i64 16, !11, i64 32}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_ZTS22ImTriangulatorNodeSpan", !10, i64 0, !7, i64 8}
!12 = !{!6, !7, i64 0}
!13 = !{!10, !10, i64 0}
!14 = !{!15, !16, i64 0}
!15 = !{!"_ZTS18ImTriangulatorNode", !16, i64 0, !7, i64 4, !17, i64 8, !10, i64 16, !10, i64 24}
!16 = !{!"_ZTS22ImTriangulatorNodeType", !8, i64 0}
!17 = !{!"_ZTS6ImVec2", !18, i64 0, !18, i64 4}
!18 = !{!"float", !8, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.unroll.disable"}
!21 = !{!6, !7, i64 40}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!6, !10, i64 8}
!25 = !{!6, !10, i64 16}
!26 = !{!15, !10, i64 24}
!27 = !{!15, !7, i64 4}
!28 = !{!7, !7, i64 0}
!29 = !{!15, !10, i64 16}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass