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

; 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.ImVec2 = type { float, float }
%"struct.vox::NodeEditor::Detail::NavigateAction" = type <{ %"struct.vox::NodeEditor::Detail::EditorAction", i8, [3 x i8], float, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, ptr, %struct.ImVec2, %struct.ImVec2, %"struct.vox::NodeEditor::Detail::NavigateAnimation", i32, [4 x i8], i64, ptr, i8, [3 x i8], %struct.ImVec2, [4 x i8] }>
%"struct.vox::NodeEditor::Detail::EditorAction" = type { ptr, ptr }
%"struct.vox::NodeEditor::Detail::NavigateAnimation" = type { %"struct.vox::NodeEditor::Detail::Animation.base", ptr, %struct.ImRect, %struct.ImRect }
%"struct.vox::NodeEditor::Detail::Animation.base" = type <{ ptr, ptr, i32, 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3vox10NodeEditor6Detail14NavigateAction16StopMoveOverEdgeEv(ptr noundef nonnull align 8 dereferenceable(184) %0) #3 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca %struct.ImVec2, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %4 = load ptr, ptr %2, align 8
  %5 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::NavigateAction", ptr %4, i32 0, i32 15
  %6 = load i8, ptr %5, align 8, !tbaa !9, !range !21, !noundef !22
  %7 = trunc i8 %6 to i1
  br i1 %7, label %8, label %13

8:                                                ; preds = %1
  %9 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::EditorAction", ptr %4, i32 0, i32 1
  %10 = load ptr, ptr %9, align 8, !tbaa !23
  call void @_ZN3vox10NodeEditor6Detail13EditorContext9MakeDirtyENS0_15SaveReasonFlagsE(ptr noundef nonnull align 8 dereferenceable(2040) %10, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %3, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %11 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::NavigateAction", ptr %4, i32 0, i32 17
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %3, i64 8, i1 false), !tbaa.struct !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  %12 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::NavigateAction", ptr %4, i32 0, i32 15
  store i8 0, ptr %12, align 8, !tbaa !9
  br label %13

13:                                               ; preds = %8, %1
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3vox10NodeEditor6Detail13EditorContext9MakeDirtyENS0_15SaveReasonFlagsE(ptr noundef nonnull align 8 dereferenceable(2040), i32 noundef) #3 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 168}
!10 = !{!"_ZTSN3vox10NodeEditor6Detail14NavigateActionE", !11, i64 0, !12, i64 16, !13, i64 20, !14, i64 24, !14, i64 32, !14, i64 40, !6, i64 48, !14, i64 56, !14, i64 64, !15, i64 72, !19, i64 144, !20, i64 152, !6, i64 160, !12, i64 168, !14, i64 172}
!11 = !{!"_ZTSN3vox10NodeEditor6Detail12EditorActionE", !6, i64 8}
!12 = !{!"bool", !7, i64 0}
!13 = !{!"float", !7, i64 0}
!14 = !{!"_ZTS6ImVec2", !13, i64 0, !13, i64 4}
!15 = !{!"_ZTSN3vox10NodeEditor6Detail17NavigateAnimationE", !16, i64 0, !6, i64 32, !18, i64 40, !18, i64 56}
!16 = !{!"_ZTSN3vox10NodeEditor6Detail9AnimationE", !6, i64 8, !17, i64 16, !13, i64 20, !13, i64 24}
!17 = !{!"_ZTSN3vox10NodeEditor6Detail9Animation5StateE", !7, i64 0}
!18 = !{!"_ZTS6ImRect", !14, i64 0, !14, i64 8}
!19 = !{!"_ZTSN3vox10NodeEditor6Detail14NavigateAction16NavigationReasonE", !7, i64 0}
!20 = !{!"long", !7, i64 0}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = !{!11, !6, i64 8}
!24 = !{i64 0, i64 4, !25, i64 4, i64 4, !25}
!25 = !{!13, !13, i64 0}


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

%struct.ImVec2 = type { float, float }

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

; Function Attrs: mustprogress 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 dso_local void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3vox10NodeEditor6Detail14NavigateAction16StopMoveOverEdgeEv(ptr nocapture noundef nonnull align 8 dereferenceable(184) %0) local_unnamed_addr #2 align 2 {
  %2 = alloca %struct.ImVec2, align 8
  %3 = getelementptr inbounds i8, ptr %0, i64 168
  %4 = load i8, ptr %3, align 8, !tbaa !5, !range !20, !noundef !21
  %5 = trunc nuw i8 %4 to i1
  br i1 %5, label %6, label %11

6:                                                ; preds = %1
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  %8 = load ptr, ptr %7, align 8, !tbaa !22
  tail call void @_ZN3vox10NodeEditor6Detail13EditorContext9MakeDirtyENS0_15SaveReasonFlagsE(ptr noundef nonnull align 8 dereferenceable(2040) %8, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %2, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %9 = getelementptr inbounds i8, ptr %0, i64 172
  %10 = load i64, ptr %2, align 8
  store i64 %10, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  store i8 0, ptr %3, align 8, !tbaa !5
  br label %11

11:                                               ; preds = %6, %1
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3vox10NodeEditor6Detail13EditorContext9MakeDirtyENS0_15SaveReasonFlagsE(ptr noundef nonnull align 8 dereferenceable(2040), i32 noundef) local_unnamed_addr #2 align 2

attributes #0 = { mustprogress 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, !11, i64 168}
!6 = !{!"_ZTSN3vox10NodeEditor6Detail14NavigateActionE", !7, i64 0, !11, i64 16, !12, i64 20, !13, i64 24, !13, i64 32, !13, i64 40, !8, i64 48, !13, i64 56, !13, i64 64, !14, i64 72, !18, i64 144, !19, i64 152, !8, i64 160, !11, i64 168, !13, i64 172}
!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 = !{!"float", !9, i64 0}
!13 = !{!"_ZTS6ImVec2", !12, i64 0, !12, i64 4}
!14 = !{!"_ZTSN3vox10NodeEditor6Detail17NavigateAnimationE", !15, i64 0, !8, i64 32, !17, i64 40, !17, i64 56}
!15 = !{!"_ZTSN3vox10NodeEditor6Detail9AnimationE", !8, i64 8, !16, i64 16, !12, i64 20, !12, i64 24}
!16 = !{!"_ZTSN3vox10NodeEditor6Detail9Animation5StateE", !9, i64 0}
!17 = !{!"_ZTS6ImRect", !13, i64 0, !13, i64 8}
!18 = !{!"_ZTSN3vox10NodeEditor6Detail14NavigateAction16NavigationReasonE", !9, i64 0}
!19 = !{!"long", !9, i64 0}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = !{!7, !8, i64 8}


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