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

; 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.52 = external hidden unnamed_addr constant [11 x i8], align 1
@__PRETTY_FUNCTION__._ZN3vox10NodeEditor6Detail16CreateItemAction10RejectItemEv = external hidden unnamed_addr constant [85 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 noundef i32 @_ZN3vox10NodeEditor6Detail16CreateItemAction10RejectItemEv(ptr noundef nonnull align 8 dereferenceable(88) %0) #1 align 2 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %4 = load ptr, ptr %3, align 8
  %5 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::CreateItemAction", ptr %4, i32 0, i32 1
  %6 = load i8, ptr %5, align 8, !tbaa !9, !range !18, !noundef !19
  %7 = trunc i8 %6 to i1
  br i1 %7, label %8, label %9

8:                                                ; preds = %1
  br label %11

9:                                                ; preds = %1
  call void @__assert_fail(ptr noundef @.str.52, ptr noundef @.str.1, i32 noundef 3884, ptr noundef @__PRETTY_FUNCTION__._ZN3vox10NodeEditor6Detail16CreateItemAction10RejectItemEv) #2
  unreachable

10:                                               ; No predecessors!
  br label %11

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

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

19:                                               ; preds = %15
  %20 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::CreateItemAction", ptr %4, i32 0, i32 5
  %21 = load i32, ptr %20, align 4, !tbaa !21
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %23, label %24

23:                                               ; preds = %19, %15, %11
  store i32 2, ptr %2, align 4
  br label %26

24:                                               ; preds = %19
  %25 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::CreateItemAction", ptr %4, i32 0, i32 6
  store i32 1, ptr %25, align 8, !tbaa !22
  store i32 0, ptr %2, align 4
  br label %26

26:                                               ; preds = %24, %23
  %27 = load i32, ptr %2, align 4
  ret i32 %27
}

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, !14, i64 28}
!22 = !{!10, !15, i64 32}


; 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.52 = external hidden unnamed_addr constant [11 x i8], align 1
@__PRETTY_FUNCTION__._ZN3vox10NodeEditor6Detail16CreateItemAction10RejectItemEv = external hidden unnamed_addr constant [85 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 noundef range(i32 0, 3) i32 @_ZN3vox10NodeEditor6Detail16CreateItemAction10RejectItemEv(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 %6, label %5

5:                                                ; preds = %1
  tail call void @__assert_fail(ptr noundef nonnull @.str.52, ptr noundef nonnull @.str.1, i32 noundef 3884, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3vox10NodeEditor6Detail16CreateItemAction10RejectItemEv) #2
  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, 0
  %10 = getelementptr inbounds i8, ptr %0, i64 28
  %11 = load i32, ptr %10, align 4
  %12 = icmp eq i32 %11, 0
  %or.cond = select i1 %9, i1 true, i1 %12
  br i1 %or.cond, label %15, label %13

13:                                               ; preds = %6
  %14 = getelementptr inbounds i8, ptr %0, i64 32
  store i32 1, ptr %14, align 8, !tbaa !20
  br label %15

15:                                               ; preds = %6, %13
  %.0 = phi i32 [ 0, %13 ], [ 2, %6 ]
  ret i32 %.0
}

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, !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, !14, i64 32}


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