; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4fabsf(float noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z10checkAngleP16CornerDescriptorS0_ff(ptr noundef %0, ptr noundef %1, float noundef %2, float noundef %3) #2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca i32, align 4
  %10 = alloca float, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store float %2, ptr %7, align 4, !tbaa !9
  store float %3, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 0, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %11 = load ptr, ptr %6, align 8, !tbaa !5
  %12 = call noundef float @_ZNK6Corner8getAngleEv(ptr noundef nonnull align 4 dereferenceable(88) %11)
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = call noundef float @_ZNK6Corner8getAngleEv(ptr noundef nonnull align 4 dereferenceable(88) %13)
  %15 = fsub float %12, %14
  store float %15, ptr %10, align 4, !tbaa !9
  %16 = load float, ptr %10, align 4, !tbaa !9
  %17 = fpext float %16 to double
  %18 = fcmp olt double %17, 0xC00921FB54442D18
  br i1 %18, label %19, label %24

19:                                               ; preds = %4
  %20 = load float, ptr %10, align 4, !tbaa !9
  %21 = fpext float %20 to double
  %22 = fadd double %21, 0x401921FB544486E0
  %23 = fptrunc double %22 to float
  store float %23, ptr %10, align 4, !tbaa !9
  br label %24

24:                                               ; preds = %19, %4
  %25 = load float, ptr %10, align 4, !tbaa !9
  %26 = fpext float %25 to double
  %27 = fcmp ogt double %26, 0x400921FB54442D18
  br i1 %27, label %28, label %33

28:                                               ; preds = %24
  %29 = load float, ptr %10, align 4, !tbaa !9
  %30 = fpext float %29 to double
  %31 = fsub double %30, 0x401921FB544486E0
  %32 = fptrunc double %31 to float
  store float %32, ptr %10, align 4, !tbaa !9
  br label %33

33:                                               ; preds = %28, %24
  %34 = load float, ptr %10, align 4, !tbaa !9
  %35 = load float, ptr %7, align 4, !tbaa !9
  %36 = fsub float %34, %35
  %37 = call noundef float @_ZSt4fabsf(float noundef %36)
  %38 = load float, ptr %8, align 4, !tbaa !9
  %39 = fcmp olt float %37, %38
  br i1 %39, label %40, label %41

40:                                               ; preds = %33
  store i32 1, ptr %9, align 4, !tbaa !11
  br label %41

41:                                               ; preds = %40, %33
  %42 = load i32, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  ret i32 %42
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { 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, !12, i64 0}
!12 = !{!"int", !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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4fabsf(float noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef range(i32 0, 2) i32 @_Z10checkAngleP16CornerDescriptorS0_ff(ptr noundef %0, ptr noundef nonnull %1, float noundef %2, float noundef %3) local_unnamed_addr #1 {
  %5 = tail call noundef float @_ZNK6Corner8getAngleEv(ptr noundef nonnull align 4 dereferenceable(88) %1)
  %6 = tail call noundef float @_ZNK6Corner8getAngleEv(ptr noundef nonnull align 4 dereferenceable(88) %0)
  %7 = fsub float %5, %6
  %8 = fpext float %7 to double
  %9 = fcmp olt double %8, 0xC00921FB54442D18
  %10 = fadd double %8, 0x401921FB544486E0
  %11 = fptrunc double %10 to float
  %.0 = select i1 %9, float %11, float %7
  %12 = fpext float %.0 to double
  %13 = fcmp ogt double %12, 0x400921FB54442D18
  %14 = fadd double %12, 0xC01921FB544486E0
  %15 = fptrunc double %14 to float
  %.1 = select i1 %13, float %15, float %.0
  %16 = fsub float %.1, %2
  %17 = tail call noundef float @_ZSt4fabsf(float noundef %16)
  %18 = fcmp olt float %17, %3
  %.09 = zext i1 %18 to i32
  ret i32 %.09
}

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

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

!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: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass