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

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

@.str.1 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [12 x i8], align 1
@__PRETTY_FUNCTION__._ZN3vox10NodeEditor6Detail16CreateItemAction7DragEndEv = external hidden unnamed_addr constant [58 x i8], align 1

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

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

8:                                                ; preds = %1
  br label %11

9:                                                ; preds = %1
  call void @__assert_fail(ptr noundef @.str.53, ptr noundef @.str.1, i32 noundef 3850, ptr noundef @__PRETTY_FUNCTION__._ZN3vox10NodeEditor6Detail16CreateItemAction7DragEndEv) #2
  unreachable

10:                                               ; No predecessors!
  br label %11

11:                                               ; preds = %10, %8
  %12 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::CreateItemAction", ptr %3, i32 0, i32 4
  %13 = load i32, ptr %12, align 8, !tbaa !20
  %14 = icmp eq i32 %13, 1
  br i1 %14, label %15, label %21

15:                                               ; preds = %11
  %16 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::CreateItemAction", ptr %3, i32 0, i32 6
  %17 = load i32, ptr %16, align 8, !tbaa !21
  %18 = icmp eq i32 %17, 2
  br i1 %18, label %19, label %21

19:                                               ; preds = %15
  %20 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::CreateItemAction", ptr %3, i32 0, i32 3
  store i32 2, ptr %20, align 4, !tbaa !22
  br label %26

21:                                               ; preds = %15, %11
  %22 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::CreateItemAction", ptr %3, i32 0, i32 3
  store i32 0, ptr %22, align 4, !tbaa !22
  %23 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::CreateItemAction", ptr %3, i32 0, i32 5
  store i32 0, ptr %23, align 4, !tbaa !23
  %24 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::CreateItemAction", ptr %3, i32 0, i32 10
  store ptr null, ptr %24, align 8, !tbaa !24
  %25 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::CreateItemAction", ptr %3, i32 0, i32 11
  store ptr null, ptr %25, align 8, !tbaa !25
  br label %26

26:                                               ; preds = %21, %19
  ret void
}

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 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 = { 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 16}
!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 = !{!10, !13, i64 24}
!21 = !{!10, !15, i64 32}
!22 = !{!10, !13, i64 20}
!23 = !{!10, !14, i64 28}
!24 = !{!10, !6, i64 48}
!25 = !{!10, !6, i64 56}


; 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.53 = external hidden unnamed_addr constant [12 x i8], align 1
@__PRETTY_FUNCTION__._ZN3vox10NodeEditor6Detail16CreateItemAction7DragEndEv = external hidden unnamed_addr constant [58 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 nounwind uwtable
define dso_local void @_ZN3vox10NodeEditor6Detail16CreateItemAction7DragEndEv(ptr nocapture noundef nonnull align 8 dereferenceable(88) %0) local_unnamed_addr #1 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 16
  %3 = load i8, ptr %2, align 8, !tbaa !5, !range !17, !noundef !18
  %4 = trunc nuw i8 %3 to i1
  br i1 %4, label %5, label %6

5:                                                ; preds = %1
  tail call void @__assert_fail(ptr noundef nonnull @.str.53, ptr noundef nonnull @.str.1, i32 noundef 3850, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3vox10NodeEditor6Detail16CreateItemAction7DragEndEv) #3
  unreachable

6:                                                ; preds = %1
  %7 = getelementptr inbounds i8, ptr %0, i64 24
  %8 = load i32, ptr %7, align 8, !tbaa !19
  %9 = icmp eq i32 %8, 1
  %10 = getelementptr inbounds i8, ptr %0, i64 32
  %11 = load i32, ptr %10, align 8
  %12 = icmp eq i32 %11, 2
  %or.cond = select i1 %9, i1 %12, i1 false
  br i1 %or.cond, label %16, label %13

13:                                               ; preds = %6
  %14 = getelementptr inbounds i8, ptr %0, i64 28
  store i32 0, ptr %14, align 4, !tbaa !20
  %15 = getelementptr inbounds i8, ptr %0, i64 48
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %15, i8 0, i64 16, i1 false)
  br label %16

16:                                               ; preds = %6, %13
  %.sink = phi i32 [ 0, %13 ], [ 2, %6 ]
  %17 = getelementptr inbounds i8, ptr %0, i64 20
  store i32 %.sink, ptr %17, align 4
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !11, i64 16}
!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 = !{!6, !12, i64 24}
!20 = !{!6, !13, i64 28}


; Effective O3 passes: GlobalOptPass,IPSCCPPass,InstCombinePass,JumpThreadingPass,MemCpyOptPass,MergedLoadStoreMotionPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass