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

; 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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [25 x i8], align 1

; 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: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef float @_Z10distCSift1PfS_i(ptr noundef %0, ptr noundef %1, i32 noundef %2) #3 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store float 0.000000e+00, ptr %7, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store float 0.000000e+00, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store float 0.000000e+00, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %11

11:                                               ; preds = %107, %3
  %12 = load i32, ptr %10, align 4, !tbaa !9
  %13 = load i32, ptr %6, align 4, !tbaa !9
  %14 = icmp slt i32 %12, %13
  br i1 %14, label %16, label %15

15:                                               ; preds = %11
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %110

16:                                               ; preds = %11
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = load i32, ptr %10, align 4, !tbaa !9
  %19 = add nsw i32 %18, 1
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds float, ptr %17, i64 %20
  %22 = load float, ptr %21, align 4, !tbaa !11
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = load i32, ptr %10, align 4, !tbaa !9
  %25 = add nsw i32 %24, 1
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds float, ptr %23, i64 %26
  %28 = load float, ptr %27, align 4, !tbaa !11
  %29 = fsub float %22, %28
  %30 = call noundef float @_ZSt4fabsf(float noundef %29)
  store float %30, ptr %9, align 4, !tbaa !11
  %31 = load float, ptr %9, align 4, !tbaa !11
  %32 = fpext float %31 to double
  %33 = fcmp olt double %32, 0x400921FB54442D18
  br i1 %33, label %34, label %37

34:                                               ; preds = %16
  %35 = load float, ptr %9, align 4, !tbaa !11
  %36 = fpext float %35 to double
  br label %54

37:                                               ; preds = %16
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = load i32, ptr %10, align 4, !tbaa !9
  %40 = add nsw i32 %39, 1
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds float, ptr %38, i64 %41
  %43 = load float, ptr %42, align 4, !tbaa !11
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = load i32, ptr %10, align 4, !tbaa !9
  %46 = add nsw i32 %45, 1
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds float, ptr %44, i64 %47
  %49 = load float, ptr %48, align 4, !tbaa !11
  %50 = fsub float %43, %49
  %51 = call noundef float @_ZSt4fabsf(float noundef %50)
  %52 = fpext float %51 to double
  %53 = fsub double 0x401921FB544486E0, %52
  br label %54

54:                                               ; preds = %37, %34
  %55 = phi double [ %36, %34 ], [ %53, %37 ]
  %56 = fptrunc double %55 to float
  store float %56, ptr %9, align 4, !tbaa !11
  %57 = load float, ptr %9, align 4, !tbaa !11
  %58 = fpext float %57 to double
  %59 = fdiv double %58, 0x400921FB54442D18
  %60 = fptrunc double %59 to float
  store float %60, ptr %9, align 4, !tbaa !11
  %61 = load float, ptr %9, align 4, !tbaa !11
  %62 = fsub float 1.000000e+00, %61
  store float %62, ptr %9, align 4, !tbaa !11
  %63 = load float, ptr %9, align 4, !tbaa !11
  %64 = fcmp ogt float %63, 1.000000e+00
  br i1 %64, label %68, label %65

65:                                               ; preds = %54
  %66 = load float, ptr %9, align 4, !tbaa !11
  %67 = fcmp olt float %66, 0.000000e+00
  br i1 %67, label %68, label %72

68:                                               ; preds = %65, %54
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %69, ptr noundef @.str)
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %70, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %72

72:                                               ; preds = %68, %65
  %73 = load float, ptr %9, align 4, !tbaa !11
  %74 = fpext float %73 to double
  %75 = fcmp ogt double %74, 8.000000e-01
  br i1 %75, label %76, label %89

76:                                               ; preds = %72
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = load i32, ptr %10, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds float, ptr %77, i64 %79
  %81 = load float, ptr %80, align 4, !tbaa !11
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = load i32, ptr %10, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds float, ptr %82, i64 %84
  %86 = load float, ptr %85, align 4, !tbaa !11
  %87 = fsub float %81, %86
  %88 = call noundef float @_Z6squaref(float noundef %87)
  store float %88, ptr %8, align 4, !tbaa !11
  br label %103

89:                                               ; preds = %72
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = load i32, ptr %10, align 4, !tbaa !9
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds float, ptr %90, i64 %92
  %94 = load float, ptr %93, align 4, !tbaa !11
  %95 = call noundef float @_Z6squaref(float noundef %94)
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = load i32, ptr %10, align 4, !tbaa !9
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds float, ptr %96, i64 %98
  %100 = load float, ptr %99, align 4, !tbaa !11
  %101 = call noundef float @_Z6squaref(float noundef %100)
  %102 = fadd float %95, %101
  store float %102, ptr %8, align 4, !tbaa !11
  br label %103

103:                                              ; preds = %89, %76
  %104 = load float, ptr %8, align 4, !tbaa !11
  %105 = load float, ptr %7, align 4, !tbaa !11
  %106 = fadd float %105, %104
  store float %106, ptr %7, align 4, !tbaa !11
  br label %107

107:                                              ; preds = %103
  %108 = load i32, ptr %10, align 4, !tbaa !9
  %109 = add nsw i32 %108, 2
  store i32 %109, ptr %10, align 4, !tbaa !9
  br label %11, !llvm.loop !13

110:                                              ; preds = %15
  %111 = load float, ptr %7, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  ret float %111
}

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 = { inlinehint 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 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [25 x i8], align 1

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #1

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

; Function Attrs: mustprogress uwtable
define dso_local noundef float @_Z10distCSift1PfS_i(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, i32 noundef %2) local_unnamed_addr #2 {
  %4 = icmp sgt i32 %2, 0
  br i1 %4, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %50, %3
  %.030.lcssa = phi float [ 0.000000e+00, %3 ], [ %51, %50 ]
  ret float %.030.lcssa

.lr.ph:                                           ; preds = %3, %50
  %indvars.iv = phi i64 [ %indvars.iv.next, %50 ], [ 0, %3 ]
  %.03032 = phi float [ %51, %50 ], [ 0.000000e+00, %3 ]
  %5 = or disjoint i64 %indvars.iv, 1
  %6 = getelementptr inbounds float, ptr %0, i64 %5
  %7 = load float, ptr %6, align 4, !tbaa !5
  %8 = getelementptr inbounds float, ptr %1, i64 %5
  %9 = load float, ptr %8, align 4, !tbaa !5
  %10 = fsub float %7, %9
  %11 = tail call noundef float @_ZSt4fabsf(float noundef %10)
  %12 = fpext float %11 to double
  %13 = fcmp olt double %12, 0x400921FB54442D18
  br i1 %13, label %21, label %14

14:                                               ; preds = %.lr.ph
  %15 = load float, ptr %6, align 4, !tbaa !5
  %16 = load float, ptr %8, align 4, !tbaa !5
  %17 = fsub float %15, %16
  %18 = tail call noundef float @_ZSt4fabsf(float noundef %17)
  %19 = fpext float %18 to double
  %20 = fsub double 0x401921FB544486E0, %19
  br label %21

21:                                               ; preds = %.lr.ph, %14
  %22 = phi double [ %20, %14 ], [ %12, %.lr.ph ]
  %23 = fptrunc double %22 to float
  %24 = fpext float %23 to double
  %25 = fdiv double %24, 0x400921FB54442D18
  %26 = fptrunc double %25 to float
  %27 = fsub float 1.000000e+00, %26
  %28 = fcmp ogt float %27, 1.000000e+00
  %29 = fcmp olt float %27, 0.000000e+00
  %or.cond = or i1 %28, %29
  br i1 %or.cond, label %30, label %34

30:                                               ; preds = %21
  %31 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %32 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef nonnull @.str)
  %33 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %32, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %34

34:                                               ; preds = %21, %30
  %35 = fpext float %27 to double
  %36 = fcmp ogt double %35, 8.000000e-01
  %37 = getelementptr inbounds float, ptr %0, i64 %indvars.iv
  %38 = load float, ptr %37, align 4, !tbaa !5
  br i1 %36, label %39, label %44

39:                                               ; preds = %34
  %40 = getelementptr inbounds float, ptr %1, i64 %indvars.iv
  %41 = load float, ptr %40, align 4, !tbaa !5
  %42 = fsub float %38, %41
  %43 = tail call noundef float @_Z6squaref(float noundef %42)
  br label %50

44:                                               ; preds = %34
  %45 = tail call noundef float @_Z6squaref(float noundef %38)
  %46 = getelementptr inbounds float, ptr %1, i64 %indvars.iv
  %47 = load float, ptr %46, align 4, !tbaa !5
  %48 = tail call noundef float @_Z6squaref(float noundef %47)
  %49 = fadd float %45, %48
  br label %50

50:                                               ; preds = %44, %39
  %.029 = phi float [ %43, %39 ], [ %49, %44 ]
  %51 = fadd float %.03032, %.029
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 2
  %52 = trunc nuw i64 %indvars.iv.next to i32
  %53 = icmp slt i32 %52, %2
  br i1 %53, label %.lr.ph, label %._crit_edge, !llvm.loop !9
}

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

!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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass