; LLVM IR from theolundqvist/parallax-voxel-ray-marcher :: src/external/Dear ImGui/imgui.ll (ZN5ImGui19GetNavInputAmount2dEi18ImGuiInputReadModeff)

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef nonnull align 4 dereferenceable(8) ptr @_ZpLR6ImVec2RKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZN5ImGui17GetNavInputAmountEi18ImGuiInputReadMode(i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local <2 x float> @_ZN5ImGui19GetNavInputAmount2dEi18ImGuiInputReadModeff(i32 noundef %0, i32 noundef %1, float noundef %2, float noundef %3) #3 {
  %5 = alloca %struct.ImVec2, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca %struct.ImVec2, align 4
  %11 = alloca %struct.ImVec2, align 4
  %12 = alloca %struct.ImVec2, align 4
  store i32 %0, ptr %6, align 4, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store float %2, ptr %8, align 4, !tbaa !11
  store float %3, ptr %9, align 4, !tbaa !11
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %5, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %13 = load i32, ptr %6, align 4, !tbaa !5
  %14 = and i32 %13, 1
  %15 = icmp ne i32 %14, 0
  br i1 %15, label %16, label %28

16:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %17 = load i32, ptr %7, align 4, !tbaa !9
  %18 = call noundef float @_ZN5ImGui17GetNavInputAmountEi18ImGuiInputReadMode(i32 noundef 17, i32 noundef %17)
  %19 = load i32, ptr %7, align 4, !tbaa !9
  %20 = call noundef float @_ZN5ImGui17GetNavInputAmountEi18ImGuiInputReadMode(i32 noundef 16, i32 noundef %19)
  %21 = fsub float %18, %20
  %22 = load i32, ptr %7, align 4, !tbaa !9
  %23 = call noundef float @_ZN5ImGui17GetNavInputAmountEi18ImGuiInputReadMode(i32 noundef 19, i32 noundef %22)
  %24 = load i32, ptr %7, align 4, !tbaa !9
  %25 = call noundef float @_ZN5ImGui17GetNavInputAmountEi18ImGuiInputReadMode(i32 noundef 18, i32 noundef %24)
  %26 = fsub float %23, %25
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %10, float noundef %21, float noundef %26)
  %27 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZpLR6ImVec2RKS_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(8) %10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %28

28:                                               ; preds = %16, %4
  %29 = load i32, ptr %6, align 4, !tbaa !5
  %30 = and i32 %29, 2
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %32, label %44

32:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %33 = load i32, ptr %7, align 4, !tbaa !9
  %34 = call noundef float @_ZN5ImGui17GetNavInputAmountEi18ImGuiInputReadMode(i32 noundef 5, i32 noundef %33)
  %35 = load i32, ptr %7, align 4, !tbaa !9
  %36 = call noundef float @_ZN5ImGui17GetNavInputAmountEi18ImGuiInputReadMode(i32 noundef 4, i32 noundef %35)
  %37 = fsub float %34, %36
  %38 = load i32, ptr %7, align 4, !tbaa !9
  %39 = call noundef float @_ZN5ImGui17GetNavInputAmountEi18ImGuiInputReadMode(i32 noundef 7, i32 noundef %38)
  %40 = load i32, ptr %7, align 4, !tbaa !9
  %41 = call noundef float @_ZN5ImGui17GetNavInputAmountEi18ImGuiInputReadMode(i32 noundef 6, i32 noundef %40)
  %42 = fsub float %39, %41
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %11, float noundef %37, float noundef %42)
  %43 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZpLR6ImVec2RKS_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(8) %11)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %44

44:                                               ; preds = %32, %28
  %45 = load i32, ptr %6, align 4, !tbaa !5
  %46 = and i32 %45, 4
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %48, label %60

48:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %49 = load i32, ptr %7, align 4, !tbaa !9
  %50 = call noundef float @_ZN5ImGui17GetNavInputAmountEi18ImGuiInputReadMode(i32 noundef 9, i32 noundef %49)
  %51 = load i32, ptr %7, align 4, !tbaa !9
  %52 = call noundef float @_ZN5ImGui17GetNavInputAmountEi18ImGuiInputReadMode(i32 noundef 8, i32 noundef %51)
  %53 = fsub float %50, %52
  %54 = load i32, ptr %7, align 4, !tbaa !9
  %55 = call noundef float @_ZN5ImGui17GetNavInputAmountEi18ImGuiInputReadMode(i32 noundef 11, i32 noundef %54)
  %56 = load i32, ptr %7, align 4, !tbaa !9
  %57 = call noundef float @_ZN5ImGui17GetNavInputAmountEi18ImGuiInputReadMode(i32 noundef 10, i32 noundef %56)
  %58 = fsub float %55, %57
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %12, float noundef %53, float noundef %58)
  %59 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZpLR6ImVec2RKS_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(8) %12)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %60

60:                                               ; preds = %48, %44
  %61 = load float, ptr %8, align 4, !tbaa !11
  %62 = fcmp une float %61, 0.000000e+00
  br i1 %62, label %63, label %68

63:                                               ; preds = %60
  %64 = call noundef zeroext i1 @_ZN5ImGui14IsNavInputDownEi(i32 noundef 14)
  br i1 %64, label %65, label %68

65:                                               ; preds = %63
  %66 = load float, ptr %8, align 4, !tbaa !11
  %67 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZmLR6ImVec2f(ptr noundef nonnull align 4 dereferenceable(8) %5, float noundef %66)
  br label %68

68:                                               ; preds = %65, %63, %60
  %69 = load float, ptr %9, align 4, !tbaa !11
  %70 = fcmp une float %69, 0.000000e+00
  br i1 %70, label %71, label %76

71:                                               ; preds = %68
  %72 = call noundef zeroext i1 @_ZN5ImGui14IsNavInputDownEi(i32 noundef 15)
  br i1 %72, label %73, label %76

73:                                               ; preds = %71
  %74 = load float, ptr %9, align 4, !tbaa !11
  %75 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZmLR6ImVec2f(ptr noundef nonnull align 4 dereferenceable(8) %5, float noundef %74)
  br label %76

76:                                               ; preds = %73, %71, %68
  %77 = load <2 x float>, ptr %5, align 4
  ret <2 x float> %77
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN5ImGui14IsNavInputDownEi(i32 noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef nonnull align 4 dereferenceable(8) ptr @_ZmLR6ImVec2f(ptr noundef nonnull align 4 dereferenceable(8), float noundef) #2

attributes #0 = { 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 = { inlinehint 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"="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, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"_ZTS18ImGuiInputReadMode", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, 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 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef nonnull align 4 dereferenceable(8) ptr @_ZpLR6ImVec2RKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZN5ImGui17GetNavInputAmountEi18ImGuiInputReadMode(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
define dso_local <2 x float> @_ZN5ImGui19GetNavInputAmount2dEi18ImGuiInputReadModeff(i32 noundef %0, i32 noundef %1, float noundef %2, float noundef %3) local_unnamed_addr #3 {
  %5 = alloca %struct.ImVec2, align 8
  %6 = alloca %struct.ImVec2, align 4
  %7 = alloca %struct.ImVec2, align 4
  %8 = alloca %struct.ImVec2, align 4
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %5, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %9 = and i32 %0, 1
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %18, label %10

10:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %11 = call noundef float @_ZN5ImGui17GetNavInputAmountEi18ImGuiInputReadMode(i32 noundef 17, i32 noundef %1)
  %12 = call noundef float @_ZN5ImGui17GetNavInputAmountEi18ImGuiInputReadMode(i32 noundef 16, i32 noundef %1)
  %13 = fsub float %11, %12
  %14 = call noundef float @_ZN5ImGui17GetNavInputAmountEi18ImGuiInputReadMode(i32 noundef 19, i32 noundef %1)
  %15 = call noundef float @_ZN5ImGui17GetNavInputAmountEi18ImGuiInputReadMode(i32 noundef 18, i32 noundef %1)
  %16 = fsub float %14, %15
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %6, float noundef %13, float noundef %16)
  %17 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZpLR6ImVec2RKS_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  br label %18

18:                                               ; preds = %10, %4
  %19 = and i32 %0, 2
  %.not19 = icmp eq i32 %19, 0
  br i1 %.not19, label %28, label %20

20:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %21 = call noundef float @_ZN5ImGui17GetNavInputAmountEi18ImGuiInputReadMode(i32 noundef 5, i32 noundef %1)
  %22 = call noundef float @_ZN5ImGui17GetNavInputAmountEi18ImGuiInputReadMode(i32 noundef 4, i32 noundef %1)
  %23 = fsub float %21, %22
  %24 = call noundef float @_ZN5ImGui17GetNavInputAmountEi18ImGuiInputReadMode(i32 noundef 7, i32 noundef %1)
  %25 = call noundef float @_ZN5ImGui17GetNavInputAmountEi18ImGuiInputReadMode(i32 noundef 6, i32 noundef %1)
  %26 = fsub float %24, %25
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %7, float noundef %23, float noundef %26)
  %27 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZpLR6ImVec2RKS_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(8) %7)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  br label %28

28:                                               ; preds = %20, %18
  %29 = and i32 %0, 4
  %.not20 = icmp eq i32 %29, 0
  br i1 %.not20, label %38, label %30

30:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  %31 = call noundef float @_ZN5ImGui17GetNavInputAmountEi18ImGuiInputReadMode(i32 noundef 9, i32 noundef %1)
  %32 = call noundef float @_ZN5ImGui17GetNavInputAmountEi18ImGuiInputReadMode(i32 noundef 8, i32 noundef %1)
  %33 = fsub float %31, %32
  %34 = call noundef float @_ZN5ImGui17GetNavInputAmountEi18ImGuiInputReadMode(i32 noundef 11, i32 noundef %1)
  %35 = call noundef float @_ZN5ImGui17GetNavInputAmountEi18ImGuiInputReadMode(i32 noundef 10, i32 noundef %1)
  %36 = fsub float %34, %35
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %8, float noundef %33, float noundef %36)
  %37 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZpLR6ImVec2RKS_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(8) %8)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  br label %38

38:                                               ; preds = %30, %28
  %39 = fcmp une float %2, 0.000000e+00
  br i1 %39, label %40, label %44

40:                                               ; preds = %38
  %41 = call noundef zeroext i1 @_ZN5ImGui14IsNavInputDownEi(i32 noundef 14)
  br i1 %41, label %42, label %44

42:                                               ; preds = %40
  %43 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZmLR6ImVec2f(ptr noundef nonnull align 4 dereferenceable(8) %5, float noundef %2)
  br label %44

44:                                               ; preds = %42, %40, %38
  %45 = fcmp une float %3, 0.000000e+00
  br i1 %45, label %46, label %50

46:                                               ; preds = %44
  %47 = call noundef zeroext i1 @_ZN5ImGui14IsNavInputDownEi(i32 noundef 15)
  br i1 %47, label %48, label %50

48:                                               ; preds = %46
  %49 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZmLR6ImVec2f(ptr noundef nonnull align 4 dereferenceable(8) %5, float noundef %3)
  br label %50

50:                                               ; preds = %48, %46, %44
  %51 = load <2 x float>, ptr %5, align 8
  ret <2 x float> %51
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN5ImGui14IsNavInputDownEi(i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef nonnull align 4 dereferenceable(8) ptr @_ZmLR6ImVec2f(ptr noundef nonnull align 4 dereferenceable(8), float noundef) local_unnamed_addr #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 = { inlinehint 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 nounwind 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)"}


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