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

; 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.ImRect = type { %struct.ImVec2, %struct.ImVec2 }
%struct.ImVec2 = type { float, float }
%"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 }>

; 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 uwtable
declare dso_local void @_ZN6ImRectC2Ev(ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden <2 x float> @_ZmiRK6ImVec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3vox10NodeEditor6Detail17NavigateAnimation8OnUpdateEf(ptr noundef nonnull align 8 dereferenceable(72) %0, float noundef %1) unnamed_addr #4 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca float, align 4
  %5 = alloca %struct.ImRect, align 4
  %6 = alloca %struct.ImVec2, align 4
  %7 = alloca %struct.ImVec2, align 4
  %8 = alloca %struct.ImVec2, align 4
  %9 = alloca %struct.ImVec2, align 4
  %10 = alloca %struct.ImVec2, align 4
  %11 = alloca %struct.ImVec2, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store float %1, ptr %4, align 4, !tbaa !9
  %12 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #5
  call void @_ZN6ImRectC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %5)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %13 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::NavigateAnimation", ptr %12, i32 0, i32 2
  %14 = getelementptr inbounds %struct.ImRect, ptr %13, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 8 %14, i64 8, i1 false), !tbaa.struct !11
  %15 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::NavigateAnimation", ptr %12, i32 0, i32 3
  %16 = getelementptr inbounds %struct.ImRect, ptr %15, i32 0, i32 0
  %17 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::NavigateAnimation", ptr %12, i32 0, i32 2
  %18 = getelementptr inbounds %struct.ImRect, ptr %17, i32 0, i32 0
  %19 = call <2 x float> @_ZmiRK6ImVec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %16, ptr noundef nonnull align 4 dereferenceable(8) %18)
  store <2 x float> %19, ptr %8, align 4
  %20 = load float, ptr %4, align 4, !tbaa !9
  %21 = load <2 x float>, ptr %7, align 4
  %22 = load <2 x float>, ptr %8, align 4
  %23 = call <2 x float> @_ZN8ImEasing11EaseOutQuadI6ImVec2fEET_S2_S2_T0_(<2 x float> %21, <2 x float> %22, float noundef %20)
  store <2 x float> %23, ptr %6, align 4
  %24 = getelementptr inbounds %struct.ImRect, ptr %5, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %24, ptr align 4 %6, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %25 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::NavigateAnimation", ptr %12, i32 0, i32 2
  %26 = getelementptr inbounds %struct.ImRect, ptr %25, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 8 %26, i64 8, i1 false), !tbaa.struct !11
  %27 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::NavigateAnimation", ptr %12, i32 0, i32 3
  %28 = getelementptr inbounds %struct.ImRect, ptr %27, i32 0, i32 1
  %29 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::NavigateAnimation", ptr %12, i32 0, i32 2
  %30 = getelementptr inbounds %struct.ImRect, ptr %29, i32 0, i32 1
  %31 = call <2 x float> @_ZmiRK6ImVec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %28, ptr noundef nonnull align 4 dereferenceable(8) %30)
  store <2 x float> %31, ptr %11, align 4
  %32 = load float, ptr %4, align 4, !tbaa !9
  %33 = load <2 x float>, ptr %10, align 4
  %34 = load <2 x float>, ptr %11, align 4
  %35 = call <2 x float> @_ZN8ImEasing11EaseOutQuadI6ImVec2fEET_S2_S2_T0_(<2 x float> %33, <2 x float> %34, float noundef %32)
  store <2 x float> %35, ptr %9, align 4
  %36 = getelementptr inbounds %struct.ImRect, ptr %5, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %36, ptr align 4 %9, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  %37 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::NavigateAnimation", ptr %12, i32 0, i32 1
  %38 = load ptr, ptr %37, align 8, !tbaa !12
  call void @_ZN3vox10NodeEditor6Detail14NavigateAction11SetViewRectERK6ImRect(ptr noundef nonnull align 8 dereferenceable(184) %38, ptr noundef nonnull align 4 dereferenceable(16) %5)
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #5
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_ZN8ImEasing11EaseOutQuadI6ImVec2fEET_S2_S2_T0_(<2 x float>, <2 x float>, float noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3vox10NodeEditor6Detail14NavigateAction11SetViewRectERK6ImRect(ptr noundef nonnull align 8 dereferenceable(184), ptr noundef nonnull align 4 dereferenceable(16)) #4 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="64" "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 = { mustprogress uwtable "min-legal-vector-width"="64" "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 #5 = { 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 = !{!"float", !7, i64 0}
!11 = !{i64 0, i64 4, !9, i64 4, i64 4, !9}
!12 = !{!13, !6, i64 32}
!13 = !{!"_ZTSN3vox10NodeEditor6Detail17NavigateAnimationE", !14, i64 0, !6, i64 32, !16, i64 40, !16, i64 56}
!14 = !{!"_ZTSN3vox10NodeEditor6Detail9AnimationE", !6, i64 8, !15, i64 16, !10, i64 20, !10, i64 24}
!15 = !{!"_ZTSN3vox10NodeEditor6Detail9Animation5StateE", !7, i64 0}
!16 = !{!"_ZTS6ImRect", !17, i64 0, !17, i64 8}
!17 = !{!"_ZTS6ImVec2", !10, i64 0, !10, i64 4}


; 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.ImRect = type { %struct.ImVec2, %struct.ImVec2 }
%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 uwtable
declare dso_local void @_ZN6ImRectC2Ev(ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden <2 x float> @_ZmiRK6ImVec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3vox10NodeEditor6Detail17NavigateAnimation8OnUpdateEf(ptr noundef nonnull align 8 dereferenceable(72) %0, float noundef %1) unnamed_addr #3 align 2 {
  %3 = alloca %struct.ImRect, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #4
  call void @_ZN6ImRectC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %3)
  %4 = getelementptr inbounds i8, ptr %0, i64 40
  %.sroa.04.0.copyload = load <2 x float>, ptr %4, align 8
  %5 = getelementptr inbounds i8, ptr %0, i64 56
  %6 = call <2 x float> @_ZmiRK6ImVec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(8) %4)
  %7 = call <2 x float> @_ZN8ImEasing11EaseOutQuadI6ImVec2fEET_S2_S2_T0_(<2 x float> %.sroa.04.0.copyload, <2 x float> %6, float noundef %1)
  store <2 x float> %7, ptr %3, align 8
  %8 = getelementptr inbounds i8, ptr %0, i64 48
  %.sroa.01.0.copyload = load <2 x float>, ptr %8, align 8
  %9 = getelementptr inbounds i8, ptr %0, i64 64
  %10 = call <2 x float> @_ZmiRK6ImVec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(8) %8)
  %11 = call <2 x float> @_ZN8ImEasing11EaseOutQuadI6ImVec2fEET_S2_S2_T0_(<2 x float> %.sroa.01.0.copyload, <2 x float> %10, float noundef %1)
  %12 = getelementptr inbounds i8, ptr %3, i64 8
  store <2 x float> %11, ptr %12, align 8
  %13 = getelementptr inbounds i8, ptr %0, i64 32
  %14 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZN3vox10NodeEditor6Detail14NavigateAction11SetViewRectERK6ImRect(ptr noundef nonnull align 8 dereferenceable(184) %14, ptr noundef nonnull align 4 dereferenceable(16) %3)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #4
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_ZN8ImEasing11EaseOutQuadI6ImVec2fEET_S2_S2_T0_(<2 x float>, <2 x float>, float noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3vox10NodeEditor6Detail14NavigateAction11SetViewRectERK6ImRect(ptr noundef nonnull align 8 dereferenceable(184), ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #3 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="64" "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"="64" "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, !8, i64 32}
!6 = !{!"_ZTSN3vox10NodeEditor6Detail17NavigateAnimationE", !7, i64 0, !8, i64 32, !13, i64 40, !13, i64 56}
!7 = !{!"_ZTSN3vox10NodeEditor6Detail9AnimationE", !8, i64 8, !11, i64 16, !12, i64 20, !12, i64 24}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSN3vox10NodeEditor6Detail9Animation5StateE", !9, i64 0}
!12 = !{!"float", !9, i64 0}
!13 = !{!"_ZTS6ImRect", !14, i64 0, !14, i64 8}
!14 = !{!"_ZTS6ImVec2", !12, i64 0, !12, i64 4}


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