; LLVM IR from yangfengzzz/DigitalVox4 :: editor (imgui_node_editor)

; 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.vox::NodeEditor::Detail::Object" = type <{ ptr, ptr, i8, [7 x i8] }>
%"struct.vox::NodeEditor::Detail::Node" = type <{ %"struct.vox::NodeEditor::Detail::Object.base", [7 x i8], %"struct.vox::NodeEditor::NodeId", i32, %struct.ImRect, i32, ptr, %struct.ImVec2, i32, i32, float, float, i32, i32, float, float, %struct.ImRect, i8, i8, [6 x i8] }>
%"struct.vox::NodeEditor::Detail::Object.base" = type <{ ptr, ptr, i8 }>
%"struct.vox::NodeEditor::NodeId" = type { %"struct.vox::NodeEditor::Details::SafePointerType.6" }
%"struct.vox::NodeEditor::Details::SafePointerType.6" = type { %"struct.vox::NodeEditor::Details::SafeType.7" }
%"struct.vox::NodeEditor::Details::SafeType.7" = type { i64 }
%struct.ImVec2 = type { float, float }
%struct.ImRect = type { %struct.ImVec2, %struct.ImVec2 }

; 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: mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZL7IsGroupPKN3vox10NodeEditor6Detail4NodeE(ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3vox10NodeEditor6Detail4Node15GetGroupedNodesERSt6vectorIPS2_SaIS4_EEb(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i1 noundef zeroext %2) #2 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %9 = zext i1 %2 to i8
  store i8 %9, ptr %6, align 1, !tbaa !9
  %10 = load ptr, ptr %4, align 8
  %11 = load i8, ptr %6, align 1, !tbaa !9, !range !11, !noundef !12
  %12 = trunc i8 %11 to i1
  br i1 %12, label %15, label %13

13:                                               ; preds = %3
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZNSt6vectorIPN3vox10NodeEditor6Detail4NodeESaIS4_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef 0)
  br label %15

15:                                               ; preds = %13, %3
  %16 = call noundef zeroext i1 @_ZL7IsGroupPKN3vox10NodeEditor6Detail4NodeE(ptr noundef %10)
  br i1 %16, label %18, label %17

17:                                               ; preds = %15
  br label %42

18:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = call noundef i64 @_ZNKSt6vectorIPN3vox10NodeEditor6Detail4NodeESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #3
  store i64 %20, ptr %7, align 8, !tbaa !13
  %21 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::Object", ptr %10, i32 0, i32 1
  %22 = load ptr, ptr %21, align 8, !tbaa !15
  %23 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::Node", ptr %10, i32 0, i32 16
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN3vox10NodeEditor6Detail13EditorContext15FindNodesInRectERK6ImRectRSt6vectorIPNS1_4NodeESaIS8_EEbb(ptr noundef nonnull align 8 dereferenceable(2040) %22, ptr noundef nonnull align 4 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(24) %24, i1 noundef zeroext true, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %25 = load i64, ptr %7, align 8, !tbaa !13
  store i64 %25, ptr %8, align 8, !tbaa !13
  br label %26

26:                                               ; preds = %38, %18
  %27 = load i64, ptr %8, align 8, !tbaa !13
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = call noundef i64 @_ZNKSt6vectorIPN3vox10NodeEditor6Detail4NodeESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #3
  %30 = icmp ult i64 %27, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  br label %41

32:                                               ; preds = %26
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = load i64, ptr %8, align 8, !tbaa !13
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN3vox10NodeEditor6Detail4NodeESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef %34) #3
  %36 = load ptr, ptr %35, align 8, !tbaa !5
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN3vox10NodeEditor6Detail4Node15GetGroupedNodesERSt6vectorIPS2_SaIS4_EEb(ptr noundef nonnull align 8 dereferenceable(128) %36, ptr noundef nonnull align 8 dereferenceable(24) %37, i1 noundef zeroext true)
  br label %38

38:                                               ; preds = %32
  %39 = load i64, ptr %8, align 8, !tbaa !13
  %40 = add i64 %39, 1
  store i64 %40, ptr %8, align 8, !tbaa !13
  br label %26, !llvm.loop !17

41:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  br label %42

42:                                               ; preds = %41, %17
  ret void
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3vox10NodeEditor6Detail13EditorContext15FindNodesInRectERK6ImRectRSt6vectorIPNS1_4NodeESaIS8_EEbb(ptr noundef nonnull align 8 dereferenceable(2040), ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(24), i1 noundef zeroext, i1 noundef zeroext) #2 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!16, !6, i64 8}
!16 = !{!"_ZTSN3vox10NodeEditor6Detail6ObjectE", !6, i64 8, !10, i64 16}
!17 = distinct !{!17, !18}
!18 = !{!"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"

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZL7IsGroupPKN3vox10NodeEditor6Detail4NodeE(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3vox10NodeEditor6Detail4Node15GetGroupedNodesERSt6vectorIPS2_SaIS4_EEb(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i1 noundef zeroext %2) local_unnamed_addr #1 align 2 {
  br i1 %2, label %5, label %4

4:                                                ; preds = %3
  tail call void @_ZNSt6vectorIPN3vox10NodeEditor6Detail4NodeESaIS4_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 0)
  br label %5

5:                                                ; preds = %4, %3
  %6 = tail call noundef zeroext i1 @_ZL7IsGroupPKN3vox10NodeEditor6Detail4NodeE(ptr noundef nonnull %0)
  br i1 %6, label %7, label %.loopexit

7:                                                ; preds = %5
  %8 = tail call noundef i64 @_ZNKSt6vectorIPN3vox10NodeEditor6Detail4NodeESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #2
  %9 = getelementptr inbounds i8, ptr %0, i64 8
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %0, i64 104
  tail call void @_ZN3vox10NodeEditor6Detail13EditorContext15FindNodesInRectERK6ImRectRSt6vectorIPNS1_4NodeESaIS8_EEbb(ptr noundef nonnull align 8 dereferenceable(2040) %10, ptr noundef nonnull align 4 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(24) %1, i1 noundef zeroext true, i1 noundef zeroext false)
  %12 = tail call noundef i64 @_ZNKSt6vectorIPN3vox10NodeEditor6Detail4NodeESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #2
  %13 = icmp ult i64 %8, %12
  br i1 %13, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %7, %.lr.ph
  %.011 = phi i64 [ %16, %.lr.ph ], [ %8, %7 ]
  %14 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN3vox10NodeEditor6Detail4NodeESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.011) #2
  %15 = load ptr, ptr %14, align 8, !tbaa !11
  tail call void @_ZN3vox10NodeEditor6Detail4Node15GetGroupedNodesERSt6vectorIPS2_SaIS4_EEb(ptr noundef nonnull align 8 dereferenceable(128) %15, ptr noundef nonnull align 8 dereferenceable(24) %1, i1 noundef zeroext true)
  %16 = add nuw i64 %.011, 1
  %17 = tail call noundef i64 @_ZNKSt6vectorIPN3vox10NodeEditor6Detail4NodeESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #2
  %18 = icmp ult i64 %16, %17
  br i1 %18, label %.lr.ph, label %.loopexit, !llvm.loop !12

.loopexit:                                        ; preds = %.lr.ph, %7, %5
  ret void
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3vox10NodeEditor6Detail13EditorContext15FindNodesInRectERK6ImRectRSt6vectorIPNS1_4NodeESaIS8_EEbb(ptr noundef nonnull align 8 dereferenceable(2040), ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(24), i1 noundef zeroext, i1 noundef zeroext) local_unnamed_addr #1 align 2

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

attributes #0 = { 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 #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 = { 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 8}
!6 = !{!"_ZTSN3vox10NodeEditor6Detail6ObjectE", !7, i64 8, !10, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"bool", !8, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


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