; 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::CreateItemAction" = type <{ %"struct.vox::NodeEditor::Detail::EditorAction", i8, [3 x i8], i32, i32, i32, i32, i32, float, [4 x i8], ptr, ptr, i8, [7 x i8], ptr, i32, i8, [3 x i8] }>
%"struct.vox::NodeEditor::Detail::EditorAction" = type { ptr, ptr }
%"struct.vox::NodeEditor::Detail::Control" = type <{ ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, i8, i8, [4 x i8] }>

@.str.1 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [12 x i8], align 1
@__PRETTY_FUNCTION__._ZN3vox10NodeEditor6Detail16CreateItemAction6AcceptERKNS1_7ControlE = external hidden unnamed_addr constant [106 x i8], align 1

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

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

declare noundef zeroext i1 @_ZN5ImGui15IsMouseDraggingEif(i32 noundef, float noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN3vox10NodeEditor6Detail16CreateItemAction6AcceptERKNS1_7ControlE(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(132) %1) unnamed_addr #3 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %6 = load ptr, ptr %4, align 8
  %7 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::CreateItemAction", ptr %6, i32 0, i32 12
  %8 = load i8, ptr %7, align 8, !tbaa !9, !range !18, !noundef !19
  %9 = trunc i8 %8 to i1
  %10 = xor i1 %9, true
  br i1 %10, label %11, label %12

11:                                               ; preds = %2
  br label %14

12:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.30, ptr noundef @.str.1, i32 noundef 3687, ptr noundef @__PRETTY_FUNCTION__._ZN3vox10NodeEditor6Detail16CreateItemAction6AcceptERKNS1_7ControlE) #4
  unreachable

13:                                               ; No predecessors!
  br label %14

14:                                               ; preds = %13, %11
  %15 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::CreateItemAction", ptr %6, i32 0, i32 12
  %16 = load i8, ptr %15, align 8, !tbaa !9, !range !18, !noundef !19
  %17 = trunc i8 %16 to i1
  br i1 %17, label %18, label %19

18:                                               ; preds = %14
  store i32 0, ptr %3, align 4
  br label %44

19:                                               ; preds = %14
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::Control", ptr %20, i32 0, i32 9
  %22 = load ptr, ptr %21, align 8, !tbaa !20
  %23 = icmp ne ptr %22, null
  br i1 %23, label %24, label %35

24:                                               ; preds = %19
  %25 = call noundef zeroext i1 @_ZN5ImGui15IsMouseDraggingEif(i32 noundef 0, float noundef -1.000000e+00)
  br i1 %25, label %26, label %35

26:                                               ; preds = %24
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::Control", ptr %27, i32 0, i32 9
  %29 = load ptr, ptr %28, align 8, !tbaa !20
  %30 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::CreateItemAction", ptr %6, i32 0, i32 14
  store ptr %29, ptr %30, align 8, !tbaa !22
  %31 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::CreateItemAction", ptr %6, i32 0, i32 14
  %32 = load ptr, ptr %31, align 8, !tbaa !22
  call void @_ZN3vox10NodeEditor6Detail16CreateItemAction9DragStartEPNS1_3PinE(ptr noundef nonnull align 8 dereferenceable(88) %6, ptr noundef %32)
  %33 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::EditorAction", ptr %6, i32 0, i32 1
  %34 = load ptr, ptr %33, align 8, !tbaa !23
  call void @_ZN3vox10NodeEditor6Detail13EditorContext14ClearSelectionEv(ptr noundef nonnull align 8 dereferenceable(2040) %34)
  br label %42

35:                                               ; preds = %24, %19
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::Control", ptr %36, i32 0, i32 8
  %38 = load ptr, ptr %37, align 8, !tbaa !24
  %39 = icmp ne ptr %38, null
  br i1 %39, label %40, label %41

40:                                               ; preds = %35
  store i32 2, ptr %3, align 4
  br label %44

41:                                               ; preds = %35
  store i32 0, ptr %3, align 4
  br label %44

42:                                               ; preds = %26
  %43 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::CreateItemAction", ptr %6, i32 0, i32 12
  store i8 1, ptr %43, align 8, !tbaa !9
  store i32 1, ptr %3, align 4
  br label %44

44:                                               ; preds = %42, %41, %40, %18
  %45 = load i32, ptr %3, align 4
  ret i32 %45
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3vox10NodeEditor6Detail16CreateItemAction9DragStartEPNS1_3PinE(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef) #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 = { 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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, !12, i64 64}
!10 = !{!"_ZTSN3vox10NodeEditor6Detail16CreateItemActionE", !11, i64 0, !12, i64 16, !13, i64 20, !13, i64 24, !14, i64 28, !15, i64 32, !16, i64 36, !17, i64 40, !6, i64 48, !6, i64 56, !12, i64 64, !6, i64 72, !16, i64 80, !12, i64 84}
!11 = !{!"_ZTSN3vox10NodeEditor6Detail12EditorActionE", !6, i64 8}
!12 = !{!"bool", !7, i64 0}
!13 = !{!"_ZTSN3vox10NodeEditor6Detail16CreateItemAction5StageE", !7, i64 0}
!14 = !{!"_ZTSN3vox10NodeEditor6Detail16CreateItemAction4TypeE", !7, i64 0}
!15 = !{!"_ZTSN3vox10NodeEditor6Detail16CreateItemAction6ActionE", !7, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!"float", !7, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!21, !6, i64 72}
!21 = !{!"_ZTSN3vox10NodeEditor6Detail7ControlE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !12, i64 128, !12, i64 129, !12, i64 130, !12, i64 131}
!22 = !{!10, !6, i64 72}
!23 = !{!11, !6, i64 8}
!24 = !{!21, !6, i64 64}


; 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 [86 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [12 x i8], align 1
@__PRETTY_FUNCTION__._ZN3vox10NodeEditor6Detail16CreateItemAction6AcceptERKNS1_7ControlE = external hidden unnamed_addr constant [106 x i8], align 1

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

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

declare noundef zeroext i1 @_ZN5ImGui15IsMouseDraggingEif(i32 noundef, float noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 3) i32 @_ZN3vox10NodeEditor6Detail16CreateItemAction6AcceptERKNS1_7ControlE(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr nocapture noundef nonnull readonly align 8 dereferenceable(132) %1) unnamed_addr #3 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 64
  %4 = load i8, ptr %3, align 8, !tbaa !5, !range !17, !noundef !18
  %5 = trunc nuw i8 %4 to i1
  br i1 %5, label %6, label %7

6:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.30, ptr noundef nonnull @.str.1, i32 noundef 3687, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3vox10NodeEditor6Detail16CreateItemAction6AcceptERKNS1_7ControlE) #4
  unreachable

7:                                                ; preds = %2
  %8 = getelementptr inbounds i8, ptr %1, i64 72
  %9 = load ptr, ptr %8, align 8, !tbaa !19
  %.not = icmp eq ptr %9, null
  br i1 %.not, label %17, label %10

10:                                               ; preds = %7
  %11 = tail call noundef zeroext i1 @_ZN5ImGui15IsMouseDraggingEif(i32 noundef 0, float noundef -1.000000e+00)
  br i1 %11, label %12, label %17

12:                                               ; preds = %10
  %13 = load ptr, ptr %8, align 8, !tbaa !19
  %14 = getelementptr inbounds i8, ptr %0, i64 72
  store ptr %13, ptr %14, align 8, !tbaa !21
  tail call void @_ZN3vox10NodeEditor6Detail16CreateItemAction9DragStartEPNS1_3PinE(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef %13)
  %15 = getelementptr inbounds i8, ptr %0, i64 8
  %16 = load ptr, ptr %15, align 8, !tbaa !22
  tail call void @_ZN3vox10NodeEditor6Detail13EditorContext14ClearSelectionEv(ptr noundef nonnull align 8 dereferenceable(2040) %16)
  store i8 1, ptr %3, align 8, !tbaa !5
  br label %20

17:                                               ; preds = %10, %7
  %18 = getelementptr inbounds i8, ptr %1, i64 64
  %19 = load ptr, ptr %18, align 8, !tbaa !23
  %.not4 = icmp eq ptr %19, null
  %. = select i1 %.not4, i32 0, i32 2
  br label %20

20:                                               ; preds = %17, %12
  %.0 = phi i32 [ 1, %12 ], [ %., %17 ]
  ret i32 %.0
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3vox10NodeEditor6Detail16CreateItemAction9DragStartEPNS1_3PinE(ptr noundef nonnull align 8 dereferenceable(88), ptr 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 = { 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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, !11, i64 64}
!6 = !{!"_ZTSN3vox10NodeEditor6Detail16CreateItemActionE", !7, i64 0, !11, i64 16, !12, i64 20, !12, i64 24, !13, i64 28, !14, i64 32, !15, i64 36, !16, i64 40, !8, i64 48, !8, i64 56, !11, i64 64, !8, i64 72, !15, i64 80, !11, i64 84}
!7 = !{!"_ZTSN3vox10NodeEditor6Detail12EditorActionE", !8, i64 8}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"bool", !9, i64 0}
!12 = !{!"_ZTSN3vox10NodeEditor6Detail16CreateItemAction5StageE", !9, i64 0}
!13 = !{!"_ZTSN3vox10NodeEditor6Detail16CreateItemAction4TypeE", !9, i64 0}
!14 = !{!"_ZTSN3vox10NodeEditor6Detail16CreateItemAction6ActionE", !9, i64 0}
!15 = !{!"int", !9, i64 0}
!16 = !{!"float", !9, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!20, !8, i64 72}
!20 = !{!"_ZTSN3vox10NodeEditor6Detail7ControlE", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24, !8, i64 32, !8, i64 40, !8, i64 48, !8, i64 56, !8, i64 64, !8, i64 72, !8, i64 80, !8, i64 88, !8, i64 96, !8, i64 104, !8, i64 112, !8, i64 120, !11, i64 128, !11, i64 129, !11, i64 130, !11, i64 131}
!21 = !{!6, !8, i64 72}
!22 = !{!7, !8, i64 8}
!23 = !{!20, !8, i64 64}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass