; LLVM IR from hadryansalles/Luz :: deps/imgui/ImGuizmo.ll (ZN8ImGuizmo6LookAtEPKfS1_S1_Pf)

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

; 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: mustprogress nounwind uwtable
declare dso_local void @_ZN8ImGuizmo5CrossEPKfS1_Pf(ptr noundef, ptr noundef, ptr noundef) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8ImGuizmo9NormalizeEPKfPf(ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN8ImGuizmo6LookAtEPKfS1_S1_Pf(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #1 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca [3 x float], align 4
  %10 = alloca [3 x float], align 4
  %11 = alloca [3 x float], align 4
  %12 = alloca [3 x float], align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #2
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #2
  call void @llvm.lifetime.start.p0(i64 12, ptr %11) #2
  call void @llvm.lifetime.start.p0(i64 12, ptr %12) #2
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = getelementptr inbounds float, ptr %13, i64 0
  %15 = load float, ptr %14, align 4, !tbaa !9
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = getelementptr inbounds float, ptr %16, i64 0
  %18 = load float, ptr %17, align 4, !tbaa !9
  %19 = fsub float %15, %18
  %20 = getelementptr inbounds [3 x float], ptr %12, i64 0, i64 0
  store float %19, ptr %20, align 4, !tbaa !9
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = getelementptr inbounds float, ptr %21, i64 1
  %23 = load float, ptr %22, align 4, !tbaa !9
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = getelementptr inbounds float, ptr %24, i64 1
  %26 = load float, ptr %25, align 4, !tbaa !9
  %27 = fsub float %23, %26
  %28 = getelementptr inbounds [3 x float], ptr %12, i64 0, i64 1
  store float %27, ptr %28, align 4, !tbaa !9
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds float, ptr %29, i64 2
  %31 = load float, ptr %30, align 4, !tbaa !9
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds float, ptr %32, i64 2
  %34 = load float, ptr %33, align 4, !tbaa !9
  %35 = fsub float %31, %34
  %36 = getelementptr inbounds [3 x float], ptr %12, i64 0, i64 2
  store float %35, ptr %36, align 4, !tbaa !9
  %37 = getelementptr inbounds [3 x float], ptr %12, i64 0, i64 0
  %38 = getelementptr inbounds [3 x float], ptr %11, i64 0, i64 0
  call void @_ZN8ImGuizmo9NormalizeEPKfPf(ptr noundef %37, ptr noundef %38)
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = getelementptr inbounds [3 x float], ptr %10, i64 0, i64 0
  call void @_ZN8ImGuizmo9NormalizeEPKfPf(ptr noundef %39, ptr noundef %40)
  %41 = getelementptr inbounds [3 x float], ptr %10, i64 0, i64 0
  %42 = getelementptr inbounds [3 x float], ptr %11, i64 0, i64 0
  %43 = getelementptr inbounds [3 x float], ptr %12, i64 0, i64 0
  call void @_ZN8ImGuizmo5CrossEPKfS1_Pf(ptr noundef %41, ptr noundef %42, ptr noundef %43)
  %44 = getelementptr inbounds [3 x float], ptr %12, i64 0, i64 0
  %45 = getelementptr inbounds [3 x float], ptr %9, i64 0, i64 0
  call void @_ZN8ImGuizmo9NormalizeEPKfPf(ptr noundef %44, ptr noundef %45)
  %46 = getelementptr inbounds [3 x float], ptr %11, i64 0, i64 0
  %47 = getelementptr inbounds [3 x float], ptr %9, i64 0, i64 0
  %48 = getelementptr inbounds [3 x float], ptr %12, i64 0, i64 0
  call void @_ZN8ImGuizmo5CrossEPKfS1_Pf(ptr noundef %46, ptr noundef %47, ptr noundef %48)
  %49 = getelementptr inbounds [3 x float], ptr %12, i64 0, i64 0
  %50 = getelementptr inbounds [3 x float], ptr %10, i64 0, i64 0
  call void @_ZN8ImGuizmo9NormalizeEPKfPf(ptr noundef %49, ptr noundef %50)
  %51 = getelementptr inbounds [3 x float], ptr %9, i64 0, i64 0
  %52 = load float, ptr %51, align 4, !tbaa !9
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  %54 = getelementptr inbounds float, ptr %53, i64 0
  store float %52, ptr %54, align 4, !tbaa !9
  %55 = getelementptr inbounds [3 x float], ptr %10, i64 0, i64 0
  %56 = load float, ptr %55, align 4, !tbaa !9
  %57 = load ptr, ptr %8, align 8, !tbaa !5
  %58 = getelementptr inbounds float, ptr %57, i64 1
  store float %56, ptr %58, align 4, !tbaa !9
  %59 = getelementptr inbounds [3 x float], ptr %11, i64 0, i64 0
  %60 = load float, ptr %59, align 4, !tbaa !9
  %61 = load ptr, ptr %8, align 8, !tbaa !5
  %62 = getelementptr inbounds float, ptr %61, i64 2
  store float %60, ptr %62, align 4, !tbaa !9
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  %64 = getelementptr inbounds float, ptr %63, i64 3
  store float 0.000000e+00, ptr %64, align 4, !tbaa !9
  %65 = getelementptr inbounds [3 x float], ptr %9, i64 0, i64 1
  %66 = load float, ptr %65, align 4, !tbaa !9
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  %68 = getelementptr inbounds float, ptr %67, i64 4
  store float %66, ptr %68, align 4, !tbaa !9
  %69 = getelementptr inbounds [3 x float], ptr %10, i64 0, i64 1
  %70 = load float, ptr %69, align 4, !tbaa !9
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = getelementptr inbounds float, ptr %71, i64 5
  store float %70, ptr %72, align 4, !tbaa !9
  %73 = getelementptr inbounds [3 x float], ptr %11, i64 0, i64 1
  %74 = load float, ptr %73, align 4, !tbaa !9
  %75 = load ptr, ptr %8, align 8, !tbaa !5
  %76 = getelementptr inbounds float, ptr %75, i64 6
  store float %74, ptr %76, align 4, !tbaa !9
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  %78 = getelementptr inbounds float, ptr %77, i64 7
  store float 0.000000e+00, ptr %78, align 4, !tbaa !9
  %79 = getelementptr inbounds [3 x float], ptr %9, i64 0, i64 2
  %80 = load float, ptr %79, align 4, !tbaa !9
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = getelementptr inbounds float, ptr %81, i64 8
  store float %80, ptr %82, align 4, !tbaa !9
  %83 = getelementptr inbounds [3 x float], ptr %10, i64 0, i64 2
  %84 = load float, ptr %83, align 4, !tbaa !9
  %85 = load ptr, ptr %8, align 8, !tbaa !5
  %86 = getelementptr inbounds float, ptr %85, i64 9
  store float %84, ptr %86, align 4, !tbaa !9
  %87 = getelementptr inbounds [3 x float], ptr %11, i64 0, i64 2
  %88 = load float, ptr %87, align 4, !tbaa !9
  %89 = load ptr, ptr %8, align 8, !tbaa !5
  %90 = getelementptr inbounds float, ptr %89, i64 10
  store float %88, ptr %90, align 4, !tbaa !9
  %91 = load ptr, ptr %8, align 8, !tbaa !5
  %92 = getelementptr inbounds float, ptr %91, i64 11
  store float 0.000000e+00, ptr %92, align 4, !tbaa !9
  %93 = getelementptr inbounds [3 x float], ptr %9, i64 0, i64 0
  %94 = load ptr, ptr %5, align 8, !tbaa !5
  %95 = call noundef float @_ZN8ImGuizmo3DotEPKfS1_(ptr noundef %93, ptr noundef %94)
  %96 = fneg float %95
  %97 = load ptr, ptr %8, align 8, !tbaa !5
  %98 = getelementptr inbounds float, ptr %97, i64 12
  store float %96, ptr %98, align 4, !tbaa !9
  %99 = getelementptr inbounds [3 x float], ptr %10, i64 0, i64 0
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = call noundef float @_ZN8ImGuizmo3DotEPKfS1_(ptr noundef %99, ptr noundef %100)
  %102 = fneg float %101
  %103 = load ptr, ptr %8, align 8, !tbaa !5
  %104 = getelementptr inbounds float, ptr %103, i64 13
  store float %102, ptr %104, align 4, !tbaa !9
  %105 = getelementptr inbounds [3 x float], ptr %11, i64 0, i64 0
  %106 = load ptr, ptr %5, align 8, !tbaa !5
  %107 = call noundef float @_ZN8ImGuizmo3DotEPKfS1_(ptr noundef %105, ptr noundef %106)
  %108 = fneg float %107
  %109 = load ptr, ptr %8, align 8, !tbaa !5
  %110 = getelementptr inbounds float, ptr %109, i64 14
  store float %108, ptr %110, align 4, !tbaa !9
  %111 = load ptr, ptr %8, align 8, !tbaa !5
  %112 = getelementptr inbounds float, ptr %111, i64 15
  store float 1.000000e+00, ptr %112, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #2
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #2
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #2
  ret void
}

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 = { 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}


; 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 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 @_ZN8ImGuizmo5CrossEPKfS1_Pf(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8ImGuizmo9NormalizeEPKfPf(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN8ImGuizmo6LookAtEPKfS1_S1_Pf(ptr noundef %0, ptr nocapture noundef readonly %1, ptr noundef %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #1 {
  %5 = alloca [3 x float], align 4
  %6 = alloca [3 x float], align 4
  %7 = alloca [3 x float], align 4
  %8 = alloca [3 x float], align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #2
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #2
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #2
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #2
  %9 = load <2 x float>, ptr %0, align 4, !tbaa !5
  %10 = load <2 x float>, ptr %1, align 4, !tbaa !5
  %11 = fsub <2 x float> %9, %10
  store <2 x float> %11, ptr %8, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  %13 = load float, ptr %12, align 4, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %1, i64 8
  %15 = load float, ptr %14, align 4, !tbaa !5
  %16 = fsub float %13, %15
  %17 = getelementptr inbounds i8, ptr %8, i64 8
  store float %16, ptr %17, align 8, !tbaa !5
  call void @_ZN8ImGuizmo9NormalizeEPKfPf(ptr noundef nonnull %8, ptr noundef nonnull %7)
  call void @_ZN8ImGuizmo9NormalizeEPKfPf(ptr noundef %2, ptr noundef nonnull %6)
  call void @_ZN8ImGuizmo5CrossEPKfS1_Pf(ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8)
  call void @_ZN8ImGuizmo9NormalizeEPKfPf(ptr noundef nonnull %8, ptr noundef nonnull %5)
  call void @_ZN8ImGuizmo5CrossEPKfS1_Pf(ptr noundef nonnull %7, ptr noundef nonnull %5, ptr noundef nonnull %8)
  call void @_ZN8ImGuizmo9NormalizeEPKfPf(ptr noundef nonnull %8, ptr noundef nonnull %6)
  %18 = load float, ptr %5, align 4, !tbaa !5
  store float %18, ptr %3, align 4, !tbaa !5
  %19 = load float, ptr %6, align 4, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %3, i64 4
  store float %19, ptr %20, align 4, !tbaa !5
  %21 = load float, ptr %7, align 4, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %3, i64 8
  store float %21, ptr %22, align 4, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %3, i64 12
  store float 0.000000e+00, ptr %23, align 4, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %5, i64 4
  %25 = load float, ptr %24, align 4, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %3, i64 16
  store float %25, ptr %26, align 4, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %6, i64 4
  %28 = load float, ptr %27, align 4, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %3, i64 20
  store float %28, ptr %29, align 4, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %7, i64 4
  %31 = load float, ptr %30, align 4, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %3, i64 24
  store float %31, ptr %32, align 4, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %3, i64 28
  store float 0.000000e+00, ptr %33, align 4, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %5, i64 8
  %35 = load float, ptr %34, align 4, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %3, i64 32
  store float %35, ptr %36, align 4, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %6, i64 8
  %38 = load float, ptr %37, align 4, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %3, i64 36
  store float %38, ptr %39, align 4, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %7, i64 8
  %41 = load float, ptr %40, align 4, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %3, i64 40
  store float %41, ptr %42, align 4, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %3, i64 44
  store float 0.000000e+00, ptr %43, align 4, !tbaa !5
  %44 = call noundef float @_ZN8ImGuizmo3DotEPKfS1_(ptr noundef nonnull %5, ptr noundef nonnull %0)
  %45 = fneg float %44
  %46 = getelementptr inbounds i8, ptr %3, i64 48
  store float %45, ptr %46, align 4, !tbaa !5
  %47 = call noundef float @_ZN8ImGuizmo3DotEPKfS1_(ptr noundef nonnull %6, ptr noundef nonnull %0)
  %48 = fneg float %47
  %49 = getelementptr inbounds i8, ptr %3, i64 52
  store float %48, ptr %49, align 4, !tbaa !5
  %50 = call noundef float @_ZN8ImGuizmo3DotEPKfS1_(ptr noundef nonnull %7, ptr noundef nonnull %0)
  %51 = fneg float %50
  %52 = getelementptr inbounds i8, ptr %3, i64 56
  store float %51, ptr %52, align 4, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %3, i64 60
  store float 1.000000e+00, ptr %53, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #2
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #2
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #2
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #2
  ret void
}

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 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


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