; 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.ImageContent = type { i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

; 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK12ImageContent1yEv(ptr noundef nonnull align 8 dereferenceable(80)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK12ImageContent1xEv(ptr noundef nonnull align 8 dereferenceable(80)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z7putVoteP12ImageContentfff(ptr noundef %0, float noundef %1, float noundef %2, float noundef %3) #3 {
  %5 = alloca ptr, align 8
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store float %1, ptr %6, align 4, !tbaa !9
  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) #4
  %13 = load float, ptr %6, align 4, !tbaa !9
  %14 = call noundef float @_ZSt5floorf(float noundef %13)
  %15 = fptosi float %14 to i32
  store i32 %15, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %16 = load float, ptr %7, align 4, !tbaa !9
  %17 = call noundef float @_ZSt5floorf(float noundef %16)
  %18 = fptosi float %17 to i32
  store i32 %18, ptr %10, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %19 = load float, ptr %6, align 4, !tbaa !9
  %20 = load i32, ptr %9, align 4, !tbaa !11
  %21 = sitofp i32 %20 to float
  %22 = fsub float %19, %21
  store float %22, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %23 = load float, ptr %7, align 4, !tbaa !9
  %24 = load i32, ptr %10, align 4, !tbaa !11
  %25 = sitofp i32 %24 to float
  %26 = fsub float %23, %25
  store float %26, ptr %12, align 4, !tbaa !9
  %27 = load i32, ptr %10, align 4, !tbaa !11
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = call noundef i32 @_ZNK12ImageContent1yEv(ptr noundef nonnull align 8 dereferenceable(80) %28)
  %30 = sub i32 %29, 1
  %31 = icmp ult i32 %27, %30
  br i1 %31, label %32, label %121

32:                                               ; preds = %4
  %33 = load i32, ptr %9, align 4, !tbaa !11
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = call noundef i32 @_ZNK12ImageContent1xEv(ptr noundef nonnull align 8 dereferenceable(80) %34)
  %36 = sub i32 %35, 1
  %37 = icmp ult i32 %33, %36
  br i1 %37, label %38, label %121

38:                                               ; preds = %32
  %39 = load float, ptr %12, align 4, !tbaa !9
  %40 = fpext float %39 to double
  %41 = fsub double 1.000000e+00, %40
  %42 = load float, ptr %11, align 4, !tbaa !9
  %43 = fpext float %42 to double
  %44 = fsub double 1.000000e+00, %43
  %45 = fmul double %41, %44
  %46 = load float, ptr %8, align 4, !tbaa !9
  %47 = fpext float %46 to double
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = getelementptr inbounds %class.ImageContent, ptr %48, i32 0, i32 4
  %50 = load ptr, ptr %49, align 8, !tbaa !13
  %51 = load i32, ptr %10, align 4, !tbaa !11
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds ptr, ptr %50, i64 %52
  %54 = load ptr, ptr %53, align 8, !tbaa !5
  %55 = load i32, ptr %9, align 4, !tbaa !11
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds float, ptr %54, i64 %56
  %58 = load float, ptr %57, align 4, !tbaa !9
  %59 = fpext float %58 to double
  %60 = call double @llvm.fmuladd.f64(double %45, double %47, double %59)
  %61 = fptrunc double %60 to float
  store float %61, ptr %57, align 4, !tbaa !9
  %62 = load float, ptr %12, align 4, !tbaa !9
  %63 = fpext float %62 to double
  %64 = load float, ptr %11, align 4, !tbaa !9
  %65 = fpext float %64 to double
  %66 = fsub double 1.000000e+00, %65
  %67 = fmul double %63, %66
  %68 = load float, ptr %8, align 4, !tbaa !9
  %69 = fpext float %68 to double
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %class.ImageContent, ptr %70, i32 0, i32 4
  %72 = load ptr, ptr %71, align 8, !tbaa !13
  %73 = load i32, ptr %10, align 4, !tbaa !11
  %74 = add nsw i32 %73, 1
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds ptr, ptr %72, i64 %75
  %77 = load ptr, ptr %76, align 8, !tbaa !5
  %78 = load i32, ptr %9, align 4, !tbaa !11
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds float, ptr %77, i64 %79
  %81 = load float, ptr %80, align 4, !tbaa !9
  %82 = fpext float %81 to double
  %83 = call double @llvm.fmuladd.f64(double %67, double %69, double %82)
  %84 = fptrunc double %83 to float
  store float %84, ptr %80, align 4, !tbaa !9
  %85 = load float, ptr %12, align 4, !tbaa !9
  %86 = fsub float 1.000000e+00, %85
  %87 = load float, ptr %11, align 4, !tbaa !9
  %88 = fmul float %86, %87
  %89 = load float, ptr %8, align 4, !tbaa !9
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = getelementptr inbounds %class.ImageContent, ptr %90, i32 0, i32 4
  %92 = load ptr, ptr %91, align 8, !tbaa !13
  %93 = load i32, ptr %10, align 4, !tbaa !11
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds ptr, ptr %92, i64 %94
  %96 = load ptr, ptr %95, align 8, !tbaa !5
  %97 = load i32, ptr %9, align 4, !tbaa !11
  %98 = add nsw i32 %97, 1
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds float, ptr %96, i64 %99
  %101 = load float, ptr %100, align 4, !tbaa !9
  %102 = call float @llvm.fmuladd.f32(float %88, float %89, float %101)
  store float %102, ptr %100, align 4, !tbaa !9
  %103 = load float, ptr %12, align 4, !tbaa !9
  %104 = load float, ptr %11, align 4, !tbaa !9
  %105 = fmul float %103, %104
  %106 = load float, ptr %8, align 4, !tbaa !9
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = getelementptr inbounds %class.ImageContent, ptr %107, i32 0, i32 4
  %109 = load ptr, ptr %108, align 8, !tbaa !13
  %110 = load i32, ptr %10, align 4, !tbaa !11
  %111 = add nsw i32 %110, 1
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds ptr, ptr %109, i64 %112
  %114 = load ptr, ptr %113, align 8, !tbaa !5
  %115 = load i32, ptr %9, align 4, !tbaa !11
  %116 = add nsw i32 %115, 1
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds float, ptr %114, i64 %117
  %119 = load float, ptr %118, align 4, !tbaa !9
  %120 = call float @llvm.fmuladd.f32(float %105, float %106, float %119)
  store float %120, ptr %118, align 4, !tbaa !9
  br label %121

121:                                              ; preds = %38, %32, %4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  ret void
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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"="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 #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 = !{!"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}
!13 = !{!14, !6, i64 16}
!14 = !{!"_ZTS12ImageContent", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72}


; 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 speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #0

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK12ImageContent1yEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK12ImageContent1xEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z7putVoteP12ImageContentfff(ptr noundef %0, float noundef %1, float noundef %2, float noundef %3) local_unnamed_addr #2 {
  %5 = tail call noundef float @_ZSt5floorf(float noundef %1)
  %6 = fptosi float %5 to i32
  %7 = tail call noundef float @_ZSt5floorf(float noundef %2)
  %8 = fptosi float %7 to i32
  %9 = sitofp i32 %6 to float
  %10 = fsub float %1, %9
  %11 = sitofp i32 %8 to float
  %12 = fsub float %2, %11
  %13 = tail call noundef i32 @_ZNK12ImageContent1yEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  %14 = add i32 %13, -1
  %15 = icmp ugt i32 %14, %8
  br i1 %15, label %16, label %57

16:                                               ; preds = %4
  %17 = tail call noundef i32 @_ZNK12ImageContent1xEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  %18 = add i32 %17, -1
  %19 = icmp ugt i32 %18, %6
  br i1 %19, label %20, label %57

20:                                               ; preds = %16
  %21 = fpext float %12 to double
  %22 = fsub double 1.000000e+00, %21
  %23 = fpext float %10 to double
  %24 = fsub double 1.000000e+00, %23
  %25 = fmul double %24, %22
  %26 = fpext float %3 to double
  %27 = getelementptr inbounds i8, ptr %0, i64 16
  %28 = load ptr, ptr %27, align 8, !tbaa !5
  %29 = sext i32 %8 to i64
  %30 = getelementptr ptr, ptr %28, i64 %29
  %31 = load ptr, ptr %30, align 8, !tbaa !11
  %32 = sext i32 %6 to i64
  %33 = getelementptr inbounds float, ptr %31, i64 %32
  %34 = load float, ptr %33, align 4, !tbaa !12
  %35 = fpext float %34 to double
  %36 = tail call double @llvm.fmuladd.f64(double %25, double %26, double %35)
  %37 = fptrunc double %36 to float
  store float %37, ptr %33, align 4, !tbaa !12
  %38 = fmul double %24, %21
  %39 = getelementptr i8, ptr %30, i64 8
  %40 = load ptr, ptr %39, align 8, !tbaa !11
  %41 = getelementptr inbounds float, ptr %40, i64 %32
  %42 = load float, ptr %41, align 4, !tbaa !12
  %43 = fpext float %42 to double
  %44 = tail call double @llvm.fmuladd.f64(double %38, double %26, double %43)
  %45 = fptrunc double %44 to float
  store float %45, ptr %41, align 4, !tbaa !12
  %46 = fsub float 1.000000e+00, %12
  %47 = fmul float %10, %46
  %48 = add nuw nsw i32 %6, 1
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds float, ptr %31, i64 %49
  %51 = load float, ptr %50, align 4, !tbaa !12
  %52 = tail call float @llvm.fmuladd.f32(float %47, float %3, float %51)
  store float %52, ptr %50, align 4, !tbaa !12
  %53 = fmul float %10, %12
  %54 = getelementptr inbounds float, ptr %40, i64 %49
  %55 = load float, ptr %54, align 4, !tbaa !12
  %56 = tail call float @llvm.fmuladd.f32(float %53, float %3, float %55)
  store float %56, ptr %54, align 4, !tbaa !12
  br label %57

57:                                               ; preds = %20, %16, %4
  ret void
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 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)"}
!5 = !{!6, !10, i64 16}
!6 = !{!"_ZTS12ImageContent", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!10, !10, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"float", !8, i64 0}


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