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

; 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
declare dso_local noundef i32 @_Z13CheckDipPointfP12ImageContentff(float noundef, ptr noundef, float noundef, float noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z8CheckDipfP12ImageContentii(float noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) #1 {
  %5 = alloca i32, align 4
  %6 = alloca float, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca i32, align 4
  %17 = alloca float, align 4
  %18 = alloca i32, align 4
  store float %0, ptr %6, align 4, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !11
  store i32 %3, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store float 0x3FEE666660000000, ptr %17, align 4, !tbaa !5
  store float 3.000000e+00, ptr %10, align 4, !tbaa !5
  store float 0.000000e+00, ptr %11, align 4, !tbaa !5
  %19 = call double @sin(double noundef 0x3FC41B2F769CF0E0) #4
  %20 = fptrunc double %19 to float
  store float %20, ptr %15, align 4, !tbaa !5
  %21 = call double @cos(double noundef 0x3FC41B2F769CF0E0) #4
  %22 = fptrunc double %21 to float
  store float %22, ptr %14, align 4, !tbaa !5
  store i32 0, ptr %16, align 4, !tbaa !11
  br label %23

23:                                               ; preds = %64, %4
  %24 = load i32, ptr %16, align 4, !tbaa !11
  %25 = icmp slt i32 %24, 40
  br i1 %25, label %26, label %67

26:                                               ; preds = %23
  %27 = load float, ptr %17, align 4, !tbaa !5
  %28 = load float, ptr %6, align 4, !tbaa !5
  %29 = fmul float %27, %28
  %30 = load ptr, ptr %7, align 8, !tbaa !9
  %31 = load i32, ptr %8, align 4, !tbaa !11
  %32 = sitofp i32 %31 to double
  %33 = fadd double %32, 5.000000e-01
  %34 = load float, ptr %11, align 4, !tbaa !5
  %35 = fpext float %34 to double
  %36 = fadd double %33, %35
  %37 = fptrunc double %36 to float
  %38 = load i32, ptr %9, align 4, !tbaa !11
  %39 = sitofp i32 %38 to double
  %40 = fadd double %39, 5.000000e-01
  %41 = load float, ptr %10, align 4, !tbaa !5
  %42 = fpext float %41 to double
  %43 = fadd double %40, %42
  %44 = fptrunc double %43 to float
  %45 = call noundef i32 @_Z13CheckDipPointfP12ImageContentff(float noundef %29, ptr noundef %30, float noundef %37, float noundef %44)
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %48, label %47

47:                                               ; preds = %26
  store i32 0, ptr %5, align 4
  store i32 1, ptr %18, align 4
  br label %68

48:                                               ; preds = %26
  %49 = load float, ptr %14, align 4, !tbaa !5
  %50 = load float, ptr %10, align 4, !tbaa !5
  %51 = load float, ptr %15, align 4, !tbaa !5
  %52 = load float, ptr %11, align 4, !tbaa !5
  %53 = fmul float %51, %52
  %54 = fneg float %53
  %55 = call float @llvm.fmuladd.f32(float %49, float %50, float %54)
  store float %55, ptr %12, align 4, !tbaa !5
  %56 = load float, ptr %15, align 4, !tbaa !5
  %57 = load float, ptr %10, align 4, !tbaa !5
  %58 = load float, ptr %14, align 4, !tbaa !5
  %59 = load float, ptr %11, align 4, !tbaa !5
  %60 = fmul float %58, %59
  %61 = call float @llvm.fmuladd.f32(float %56, float %57, float %60)
  store float %61, ptr %13, align 4, !tbaa !5
  %62 = load float, ptr %12, align 4, !tbaa !5
  store float %62, ptr %10, align 4, !tbaa !5
  %63 = load float, ptr %13, align 4, !tbaa !5
  store float %63, ptr %11, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %48
  %65 = load i32, ptr %16, align 4, !tbaa !11
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %16, align 4, !tbaa !11
  br label %23, !llvm.loop !13

67:                                               ; preds = %23
  store i32 1, ptr %5, align 4
  store i32 1, ptr %18, align 4
  br label %68

68:                                               ; preds = %67, %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #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
  %69 = load i32, ptr %5, align 4
  ret i32 %69
}

; Function Attrs: nounwind
declare double @sin(double noundef) #2

; Function Attrs: nounwind
declare double @cos(double noundef) #2

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

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 = { nounwind "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}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !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"

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z13CheckDipPointfP12ImageContentff(float noundef, ptr noundef, float noundef, float noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 2) i32 @_Z8CheckDipfP12ImageContentii(float noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #0 {
  %5 = fmul float %0, 0x3FEE666660000000
  %6 = sitofp i32 %2 to double
  %7 = fadd double %6, 5.000000e-01
  %8 = sitofp i32 %3 to double
  %9 = fadd double %8, 5.000000e-01
  br label %10

10:                                               ; preds = %4, %21
  %.01924 = phi i32 [ 0, %4 ], [ %26, %21 ]
  %11 = phi <2 x float> [ <float 3.000000e+00, float 0.000000e+00>, %4 ], [ %25, %21 ]
  %12 = extractelement <2 x float> %11, i64 1
  %13 = fpext float %12 to double
  %14 = fadd double %7, %13
  %15 = fptrunc double %14 to float
  %16 = extractelement <2 x float> %11, i64 0
  %17 = fpext float %16 to double
  %18 = fadd double %9, %17
  %19 = fptrunc double %18 to float
  %20 = tail call noundef i32 @_Z13CheckDipPointfP12ImageContentff(float noundef %5, ptr noundef %1, float noundef %15, float noundef %19)
  %.not = icmp eq i32 %20, 0
  br i1 %.not, label %27, label %21

21:                                               ; preds = %10
  %22 = shufflevector <2 x float> %11, <2 x float> poison, <2 x i32> <i32 1, i32 1>
  %23 = fmul <2 x float> %22, <float 0xBFC4060B60000000, float 0x3FEF9B24A0000000>
  %24 = shufflevector <2 x float> %11, <2 x float> poison, <2 x i32> zeroinitializer
  %25 = tail call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %24, <2 x float> <float 0x3FEF9B24A0000000, float 0x3FC4060B60000000>, <2 x float> %23)
  %26 = add nuw nsw i32 %.01924, 1
  %exitcond.not = icmp eq i32 %26, 40
  br i1 %exitcond.not, label %27, label %10, !llvm.loop !5

27:                                               ; preds = %21, %10
  %.0 = phi i32 [ 0, %10 ], [ 1, %21 ]
  ret i32 %.0
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x float> @llvm.fmuladd.v2f32(<2 x float>, <2 x float>, <2 x float>) #1

attributes #0 = { 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 #1 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalDCEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,LoopSimplifyPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass