; LLVM IR from ox-vgg/vise :: src/search_engine/relja_retrival/external/KMCode_relja/homography (homography)

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

%class.Matrix = type { ptr, ptr, i32, i32 }

; 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
define dso_local void @_Z9getHPointffP6MatrixRfS1_(float noundef %0, float noundef %1, ptr noundef %2, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4) #1 {
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca float, align 4
  store float %0, ptr %6, align 4, !tbaa !5
  store float %1, ptr %7, align 4, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !9
  store ptr %4, ptr %10, align 8, !tbaa !9
  %12 = load ptr, ptr %8, align 8, !tbaa !9
  %13 = getelementptr inbounds %class.Matrix, ptr %12, i32 0, i32 1
  %14 = load ptr, ptr %13, align 8, !tbaa !11
  %15 = getelementptr inbounds ptr, ptr %14, i64 1
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  %17 = getelementptr inbounds double, ptr %16, i64 1
  %18 = load double, ptr %17, align 8, !tbaa !14
  %19 = load float, ptr %6, align 4, !tbaa !5
  %20 = fpext float %19 to double
  %21 = load ptr, ptr %8, align 8, !tbaa !9
  %22 = getelementptr inbounds %class.Matrix, ptr %21, i32 0, i32 1
  %23 = load ptr, ptr %22, align 8, !tbaa !11
  %24 = getelementptr inbounds ptr, ptr %23, i64 1
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  %26 = getelementptr inbounds double, ptr %25, i64 2
  %27 = load double, ptr %26, align 8, !tbaa !14
  %28 = load float, ptr %7, align 4, !tbaa !5
  %29 = fpext float %28 to double
  %30 = fmul double %27, %29
  %31 = call double @llvm.fmuladd.f64(double %18, double %20, double %30)
  %32 = load ptr, ptr %8, align 8, !tbaa !9
  %33 = getelementptr inbounds %class.Matrix, ptr %32, i32 0, i32 1
  %34 = load ptr, ptr %33, align 8, !tbaa !11
  %35 = getelementptr inbounds ptr, ptr %34, i64 1
  %36 = load ptr, ptr %35, align 8, !tbaa !9
  %37 = getelementptr inbounds double, ptr %36, i64 3
  %38 = load double, ptr %37, align 8, !tbaa !14
  %39 = fadd double %31, %38
  %40 = fptrunc double %39 to float
  %41 = load ptr, ptr %9, align 8, !tbaa !9
  store float %40, ptr %41, align 4, !tbaa !5
  %42 = load ptr, ptr %8, align 8, !tbaa !9
  %43 = getelementptr inbounds %class.Matrix, ptr %42, i32 0, i32 1
  %44 = load ptr, ptr %43, align 8, !tbaa !11
  %45 = getelementptr inbounds ptr, ptr %44, i64 2
  %46 = load ptr, ptr %45, align 8, !tbaa !9
  %47 = getelementptr inbounds double, ptr %46, i64 1
  %48 = load double, ptr %47, align 8, !tbaa !14
  %49 = load float, ptr %6, align 4, !tbaa !5
  %50 = fpext float %49 to double
  %51 = load ptr, ptr %8, align 8, !tbaa !9
  %52 = getelementptr inbounds %class.Matrix, ptr %51, i32 0, i32 1
  %53 = load ptr, ptr %52, align 8, !tbaa !11
  %54 = getelementptr inbounds ptr, ptr %53, i64 2
  %55 = load ptr, ptr %54, align 8, !tbaa !9
  %56 = getelementptr inbounds double, ptr %55, i64 2
  %57 = load double, ptr %56, align 8, !tbaa !14
  %58 = load float, ptr %7, align 4, !tbaa !5
  %59 = fpext float %58 to double
  %60 = fmul double %57, %59
  %61 = call double @llvm.fmuladd.f64(double %48, double %50, double %60)
  %62 = load ptr, ptr %8, align 8, !tbaa !9
  %63 = getelementptr inbounds %class.Matrix, ptr %62, i32 0, i32 1
  %64 = load ptr, ptr %63, align 8, !tbaa !11
  %65 = getelementptr inbounds ptr, ptr %64, i64 2
  %66 = load ptr, ptr %65, align 8, !tbaa !9
  %67 = getelementptr inbounds double, ptr %66, i64 3
  %68 = load double, ptr %67, align 8, !tbaa !14
  %69 = fadd double %61, %68
  %70 = fptrunc double %69 to float
  %71 = load ptr, ptr %10, align 8, !tbaa !9
  store float %70, ptr %71, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %72 = load ptr, ptr %8, align 8, !tbaa !9
  %73 = getelementptr inbounds %class.Matrix, ptr %72, i32 0, i32 1
  %74 = load ptr, ptr %73, align 8, !tbaa !11
  %75 = getelementptr inbounds ptr, ptr %74, i64 3
  %76 = load ptr, ptr %75, align 8, !tbaa !9
  %77 = getelementptr inbounds double, ptr %76, i64 1
  %78 = load double, ptr %77, align 8, !tbaa !14
  %79 = load float, ptr %6, align 4, !tbaa !5
  %80 = fpext float %79 to double
  %81 = load ptr, ptr %8, align 8, !tbaa !9
  %82 = getelementptr inbounds %class.Matrix, ptr %81, i32 0, i32 1
  %83 = load ptr, ptr %82, align 8, !tbaa !11
  %84 = getelementptr inbounds ptr, ptr %83, i64 3
  %85 = load ptr, ptr %84, align 8, !tbaa !9
  %86 = getelementptr inbounds double, ptr %85, i64 2
  %87 = load double, ptr %86, align 8, !tbaa !14
  %88 = load float, ptr %7, align 4, !tbaa !5
  %89 = fpext float %88 to double
  %90 = fmul double %87, %89
  %91 = call double @llvm.fmuladd.f64(double %78, double %80, double %90)
  %92 = load ptr, ptr %8, align 8, !tbaa !9
  %93 = getelementptr inbounds %class.Matrix, ptr %92, i32 0, i32 1
  %94 = load ptr, ptr %93, align 8, !tbaa !11
  %95 = getelementptr inbounds ptr, ptr %94, i64 3
  %96 = load ptr, ptr %95, align 8, !tbaa !9
  %97 = getelementptr inbounds double, ptr %96, i64 3
  %98 = load double, ptr %97, align 8, !tbaa !14
  %99 = fadd double %91, %98
  %100 = fptrunc double %99 to float
  store float %100, ptr %11, align 4, !tbaa !5
  %101 = load float, ptr %11, align 4, !tbaa !5
  %102 = load ptr, ptr %9, align 8, !tbaa !9
  %103 = load float, ptr %102, align 4, !tbaa !5
  %104 = fdiv float %103, %101
  store float %104, ptr %102, align 4, !tbaa !5
  %105 = load float, ptr %11, align 4, !tbaa !5
  %106 = load ptr, ptr %10, align 8, !tbaa !9
  %107 = load float, ptr %106, align 4, !tbaa !5
  %108 = fdiv float %107, %105
  store float %108, ptr %106, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !6, i64 0}
!6 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !10, i64 8}
!12 = !{!"_ZTS6Matrix", !10, i64 8, !13, i64 16, !13, i64 20}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !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 nofree norecurse nosync nounwind willreturn memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local void @_Z9getHPointffP6MatrixRfS1_(float noundef %0, float noundef %1, ptr nocapture noundef readonly %2, ptr nocapture noundef nonnull align 4 dereferenceable(4) %3, ptr nocapture noundef nonnull align 4 dereferenceable(4) %4) local_unnamed_addr #0 {
  %6 = getelementptr inbounds i8, ptr %2, i64 8
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %7, i64 8
  %9 = load ptr, ptr %8, align 8, !tbaa !11
  %10 = getelementptr inbounds i8, ptr %9, i64 8
  %11 = load double, ptr %10, align 8, !tbaa !12
  %12 = fpext float %0 to double
  %13 = getelementptr inbounds i8, ptr %9, i64 16
  %14 = load double, ptr %13, align 8, !tbaa !12
  %15 = fpext float %1 to double
  %16 = fmul double %14, %15
  %17 = tail call double @llvm.fmuladd.f64(double %11, double %12, double %16)
  %18 = getelementptr inbounds i8, ptr %9, i64 24
  %19 = load double, ptr %18, align 8, !tbaa !12
  %20 = fadd double %19, %17
  %21 = fptrunc double %20 to float
  store float %21, ptr %3, align 4, !tbaa !14
  %22 = getelementptr inbounds i8, ptr %7, i64 16
  %23 = load ptr, ptr %22, align 8, !tbaa !11
  %24 = getelementptr inbounds i8, ptr %23, i64 8
  %25 = load double, ptr %24, align 8, !tbaa !12
  %26 = getelementptr inbounds i8, ptr %23, i64 16
  %27 = load double, ptr %26, align 8, !tbaa !12
  %28 = fmul double %27, %15
  %29 = tail call double @llvm.fmuladd.f64(double %25, double %12, double %28)
  %30 = getelementptr inbounds i8, ptr %23, i64 24
  %31 = load double, ptr %30, align 8, !tbaa !12
  %32 = fadd double %31, %29
  %33 = fptrunc double %32 to float
  store float %33, ptr %4, align 4, !tbaa !14
  %34 = getelementptr inbounds i8, ptr %7, i64 24
  %35 = load ptr, ptr %34, align 8, !tbaa !11
  %36 = getelementptr inbounds i8, ptr %35, i64 8
  %37 = load double, ptr %36, align 8, !tbaa !12
  %38 = getelementptr inbounds i8, ptr %35, i64 16
  %39 = load double, ptr %38, align 8, !tbaa !12
  %40 = fmul double %39, %15
  %41 = tail call double @llvm.fmuladd.f64(double %37, double %12, double %40)
  %42 = getelementptr inbounds i8, ptr %35, i64 24
  %43 = load double, ptr %42, align 8, !tbaa !12
  %44 = fadd double %43, %41
  %45 = fptrunc double %44 to float
  %46 = load float, ptr %3, align 4, !tbaa !14
  %47 = fdiv float %46, %45
  store float %47, ptr %3, align 4, !tbaa !14
  %48 = load float, ptr %4, align 4, !tbaa !14
  %49 = fdiv float %48, %45
  store float %49, ptr %4, align 4, !tbaa !14
  ret void
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: readwrite, inaccessiblemem: none) 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 #1 = { mustprogress 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, !7, i64 8}
!6 = !{!"_ZTS6Matrix", !7, i64 8, !10, i64 16, !10, i64 20}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"double", !8, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"float", !8, i64 0}


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