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

; 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 uwtable
define dso_local noundef i32 @_Z14checkIfCorrectfffP16CornerDescriptorfff(float noundef %0, float noundef %1, float noundef %2, ptr noundef %3, float noundef %4, float noundef %5, float noundef %6) #1 {
  %8 = alloca i32, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca ptr, align 8
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca i32, align 4
  store float %0, ptr %9, align 4, !tbaa !5
  store float %1, ptr %10, align 4, !tbaa !5
  store float %2, ptr %11, align 4, !tbaa !5
  store ptr %3, ptr %12, align 8, !tbaa !9
  store float %4, ptr %13, align 4, !tbaa !5
  store float %5, ptr %14, align 4, !tbaa !5
  store float %6, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %21 = load ptr, ptr %12, align 8, !tbaa !9
  %22 = call noundef float @_ZNK6Corner4getXEv(ptr noundef nonnull align 4 dereferenceable(88) %21)
  %23 = load float, ptr %9, align 4, !tbaa !5
  %24 = fsub float %22, %23
  store float %24, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %25 = load ptr, ptr %12, align 8, !tbaa !9
  %26 = call noundef float @_ZNK6Corner4getYEv(ptr noundef nonnull align 4 dereferenceable(88) %25)
  %27 = load float, ptr %10, align 4, !tbaa !5
  %28 = fsub float %26, %27
  store float %28, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %29 = load float, ptr %16, align 4, !tbaa !5
  %30 = load float, ptr %16, align 4, !tbaa !5
  %31 = load float, ptr %17, align 4, !tbaa !5
  %32 = load float, ptr %17, align 4, !tbaa !5
  %33 = fmul float %31, %32
  %34 = call float @llvm.fmuladd.f32(float %29, float %30, float %33)
  %35 = call noundef float @_ZSt4sqrtf(float noundef %34)
  store float %35, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  %36 = load float, ptr %11, align 4, !tbaa !5
  %37 = load ptr, ptr %12, align 8, !tbaa !9
  %38 = call noundef float @_ZNK6Corner14getCornerScaleEv(ptr noundef nonnull align 4 dereferenceable(88) %37)
  %39 = fdiv float %36, %38
  store float %39, ptr %19, align 4, !tbaa !5
  %40 = load float, ptr %18, align 4, !tbaa !5
  %41 = load float, ptr %13, align 4, !tbaa !5
  %42 = fcmp olt float %40, %41
  br i1 %42, label %43, label %53

43:                                               ; preds = %7
  %44 = load float, ptr %19, align 4, !tbaa !5
  %45 = load float, ptr %14, align 4, !tbaa !5
  %46 = fsub float %44, %45
  %47 = call noundef float @_ZSt4fabsf(float noundef %46)
  %48 = load float, ptr %14, align 4, !tbaa !5
  %49 = fdiv float %47, %48
  %50 = load float, ptr %15, align 4, !tbaa !5
  %51 = fcmp olt float %49, %50
  br i1 %51, label %52, label %53

52:                                               ; preds = %43
  store i32 1, ptr %8, align 4
  store i32 1, ptr %20, align 4
  br label %54

53:                                               ; preds = %43, %7
  store i32 0, ptr %8, align 4
  store i32 1, ptr %20, align 4
  br label %54

54:                                               ; preds = %53, %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  %55 = load i32, ptr %8, align 4
  ret i32 %55
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK6Corner4getXEv(ptr noundef nonnull align 4 dereferenceable(88)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK6Corner4getYEv(ptr noundef nonnull align 4 dereferenceable(88)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4sqrtf(float noundef) #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK6Corner14getCornerScaleEv(ptr noundef nonnull align 4 dereferenceable(88)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4fabsf(float noundef) #2

attributes #0 = { 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 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"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}


; 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 nounwind uwtable
define dso_local noundef range(i32 0, 2) i32 @_Z14checkIfCorrectfffP16CornerDescriptorfff(float noundef %0, float noundef %1, float noundef %2, ptr noundef nonnull %3, float noundef %4, float noundef %5, float noundef %6) local_unnamed_addr #0 {
  %8 = tail call noundef float @_ZNK6Corner4getXEv(ptr noundef nonnull align 4 dereferenceable(88) %3)
  %9 = fsub float %8, %0
  %10 = tail call noundef float @_ZNK6Corner4getYEv(ptr noundef nonnull align 4 dereferenceable(88) %3)
  %11 = fsub float %10, %1
  %12 = fmul float %11, %11
  %13 = tail call float @llvm.fmuladd.f32(float %9, float %9, float %12)
  %14 = tail call noundef float @_ZSt4sqrtf(float noundef %13)
  %15 = tail call noundef float @_ZNK6Corner14getCornerScaleEv(ptr noundef nonnull align 4 dereferenceable(88) %3)
  %16 = fcmp olt float %14, %4
  br i1 %16, label %17, label %23

17:                                               ; preds = %7
  %18 = fdiv float %2, %15
  %19 = fsub float %18, %5
  %20 = tail call noundef float @_ZSt4fabsf(float noundef %19)
  %21 = fdiv float %20, %5
  %22 = fcmp olt float %21, %6
  br i1 %22, label %24, label %23

23:                                               ; preds = %17, %7
  br label %24

24:                                               ; preds = %17, %23
  %.0 = phi i32 [ 0, %23 ], [ 1, %17 ]
  ret i32 %.0
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK6Corner4getXEv(ptr noundef nonnull align 4 dereferenceable(88)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK6Corner4getYEv(ptr noundef nonnull align 4 dereferenceable(88)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4sqrtf(float noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK6Corner14getCornerScaleEv(ptr noundef nonnull align 4 dereferenceable(88)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4fabsf(float noundef) local_unnamed_addr #1

attributes #0 = { 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 #1 = { 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 #2 = { 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)"}


; Effective O3 passes: GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass