; 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.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: inlinehint mustprogress uwtable
declare hidden <2 x float> @_ZmiRK6ImVec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3vox10NodeEditor6Detail9Animation4StopEv(ptr noundef nonnull align 8 dereferenceable(28)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3vox10NodeEditor6Detail9Animation4PlayEf(ptr noundef nonnull align 8 dereferenceable(28), float noundef) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3vox10NodeEditor6Detail17NavigateAnimation10NavigateToERK6ImRectf(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 4 dereferenceable(16) %1, float noundef %2) #4 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca float, align 4
  %7 = alloca %struct.ImRect, align 4
  %8 = alloca %struct.ImVec2, align 4
  %9 = alloca %struct.ImVec2, align 4
  %10 = alloca float, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store float %2, ptr %6, align 4, !tbaa !9
  %11 = load ptr, ptr %4, align 8
  call void @_ZN3vox10NodeEditor6Detail9Animation4StopEv(ptr noundef nonnull align 8 dereferenceable(28) %11)
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #6
  %12 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::NavigateAnimation", ptr %11, i32 0, i32 1
  %13 = load ptr, ptr %12, align 8, !tbaa !11
  %14 = call { <2 x float>, <2 x float> } @_ZNK3vox10NodeEditor6Detail14NavigateAction11GetViewRectEv(ptr noundef nonnull align 8 dereferenceable(184) %13)
  %15 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %7, i32 0, i32 0
  %16 = extractvalue { <2 x float>, <2 x float> } %14, 0
  store <2 x float> %16, ptr %15, align 4
  %17 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %7, i32 0, i32 1
  %18 = extractvalue { <2 x float>, <2 x float> } %14, 1
  store <2 x float> %18, ptr %17, align 4
  %19 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::NavigateAnimation", ptr %11, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 4 %7, i64 16, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #6
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::NavigateAnimation", ptr %11, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 4 %20, i64 16, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %22 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::NavigateAnimation", ptr %11, i32 0, i32 3
  %23 = getelementptr inbounds %struct.ImRect, ptr %22, i32 0, i32 0
  %24 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::NavigateAnimation", ptr %11, i32 0, i32 2
  %25 = getelementptr inbounds %struct.ImRect, ptr %24, i32 0, i32 0
  %26 = call <2 x float> @_ZmiRK6ImVec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %23, ptr noundef nonnull align 4 dereferenceable(8) %25)
  store <2 x float> %26, ptr %8, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %27 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::NavigateAnimation", ptr %11, i32 0, i32 3
  %28 = getelementptr inbounds %struct.ImRect, ptr %27, i32 0, i32 1
  %29 = getelementptr inbounds %"struct.vox::NodeEditor::Detail::NavigateAnimation", ptr %11, 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 %9, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store float 0x3F1A36E2E0000000, ptr %10, align 4, !tbaa !9
  %32 = getelementptr inbounds %struct.ImVec2, ptr %8, i32 0, i32 0
  %33 = load float, ptr %32, align 4, !tbaa !18
  %34 = call float @llvm.fabs.f32(float %33)
  %35 = load float, ptr %10, align 4, !tbaa !9
  %36 = fcmp olt float %34, %35
  br i1 %36, label %37, label %56

37:                                               ; preds = %3
  %38 = getelementptr inbounds %struct.ImVec2, ptr %8, i32 0, i32 1
  %39 = load float, ptr %38, align 4, !tbaa !19
  %40 = call float @llvm.fabs.f32(float %39)
  %41 = load float, ptr %10, align 4, !tbaa !9
  %42 = fcmp olt float %40, %41
  br i1 %42, label %43, label %56

43:                                               ; preds = %37
  %44 = getelementptr inbounds %struct.ImVec2, ptr %9, i32 0, i32 0
  %45 = load float, ptr %44, align 4, !tbaa !18
  %46 = call float @llvm.fabs.f32(float %45)
  %47 = load float, ptr %10, align 4, !tbaa !9
  %48 = fcmp olt float %46, %47
  br i1 %48, label %49, label %56

49:                                               ; preds = %43
  %50 = getelementptr inbounds %struct.ImVec2, ptr %9, i32 0, i32 1
  %51 = load float, ptr %50, align 4, !tbaa !19
  %52 = call float @llvm.fabs.f32(float %51)
  %53 = load float, ptr %10, align 4, !tbaa !9
  %54 = fcmp olt float %52, %53
  br i1 %54, label %55, label %56

55:                                               ; preds = %49
  store float 0.000000e+00, ptr %6, align 4, !tbaa !9
  br label %56

56:                                               ; preds = %55, %49, %43, %37, %3
  %57 = load float, ptr %6, align 4, !tbaa !9
  call void @_ZN3vox10NodeEditor6Detail9Animation4PlayEf(ptr noundef nonnull align 8 dereferenceable(28) %11, float noundef %57)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local { <2 x float>, <2 x float> } @_ZNK3vox10NodeEditor6Detail14NavigateAction11GetViewRectEv(ptr noundef nonnull align 8 dereferenceable(184)) #4 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fabs.f32(float) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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"="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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 = !{!12, !6, i64 32}
!12 = !{!"_ZTSN3vox10NodeEditor6Detail17NavigateAnimationE", !13, i64 0, !6, i64 32, !15, i64 40, !15, i64 56}
!13 = !{!"_ZTSN3vox10NodeEditor6Detail9AnimationE", !6, i64 8, !14, i64 16, !10, i64 20, !10, i64 24}
!14 = !{!"_ZTSN3vox10NodeEditor6Detail9Animation5StateE", !7, i64 0}
!15 = !{!"_ZTS6ImRect", !16, i64 0, !16, i64 8}
!16 = !{!"_ZTS6ImVec2", !10, i64 0, !10, i64 4}
!17 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9, i64 12, i64 4, !9}
!18 = !{!16, !10, i64 0}
!19 = !{!16, !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"

; Function Attrs: mustprogress 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) #0

; 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 #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3vox10NodeEditor6Detail9Animation4StopEv(ptr noundef nonnull align 8 dereferenceable(28)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3vox10NodeEditor6Detail9Animation4PlayEf(ptr noundef nonnull align 8 dereferenceable(28), float noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3vox10NodeEditor6Detail17NavigateAnimation10NavigateToERK6ImRectf(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr nocapture noundef nonnull readonly align 4 dereferenceable(16) %1, float noundef %2) local_unnamed_addr #3 align 2 {
  tail call void @_ZN3vox10NodeEditor6Detail9Animation4StopEv(ptr noundef nonnull align 8 dereferenceable(28) %0)
  %4 = getelementptr inbounds i8, ptr %0, i64 32
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = tail call { <2 x float>, <2 x float> } @_ZNK3vox10NodeEditor6Detail14NavigateAction11GetViewRectEv(ptr noundef nonnull align 8 dereferenceable(184) %5)
  %7 = extractvalue { <2 x float>, <2 x float> } %6, 0
  %8 = extractvalue { <2 x float>, <2 x float> } %6, 1
  %9 = getelementptr inbounds i8, ptr %0, i64 40
  store <2 x float> %7, ptr %9, align 8
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 48
  store <2 x float> %8, ptr %.sroa.4.0..sroa_idx, align 8
  %10 = getelementptr inbounds i8, ptr %0, i64 56
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(16) %1, i64 16, i1 false), !tbaa.struct !15
  %11 = tail call <2 x float> @_ZmiRK6ImVec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(8) %9)
  %12 = getelementptr inbounds i8, ptr %0, i64 64
  %13 = tail call <2 x float> @_ZmiRK6ImVec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(8) %.sroa.4.0..sroa_idx)
  %14 = shufflevector <2 x float> %11, <2 x float> %13, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
  %.fr14 = freeze <4 x float> %14
  %15 = tail call <4 x float> @llvm.fabs.v4f32(<4 x float> %.fr14)
  %16 = fcmp uge <4 x float> %15, <float 0x3F1A36E2E0000000, float 0x3F1A36E2E0000000, float 0x3F1A36E2E0000000, float 0x3F1A36E2E0000000>
  %17 = bitcast <4 x i1> %16 to i4
  %18 = icmp eq i4 %17, 0
  %.0 = select i1 %18, float 0.000000e+00, float %2
  tail call void @_ZN3vox10NodeEditor6Detail9Animation4PlayEf(ptr noundef nonnull align 8 dereferenceable(28) %0, float noundef %.0)
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local { <2 x float>, <2 x float> } @_ZNK3vox10NodeEditor6Detail14NavigateAction11GetViewRectEv(ptr noundef nonnull align 8 dereferenceable(184)) local_unnamed_addr #3 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x float> @llvm.fabs.v4f32(<4 x float>) #4

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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}
!15 = !{i64 0, i64 4, !16, i64 4, i64 4, !16, i64 8, i64 4, !16, i64 12, i64 4, !16}
!16 = !{!12, !12, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalDCEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass