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

; 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 void @_Z13GradOriImagesP12ImageContentS0_S0_(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #3

; Function Attrs: nounwind
declare void @_ZN12ImageContentD1Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6Corner15normalizeAffineEP12ImageContentS1_(ptr noundef nonnull align 4 dereferenceable(88), ptr noundef, ptr noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12ImageContentC2Eii(ptr noundef nonnull align 8 dereferenceable(80), i32 noundef, i32 noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Corner16computeHistAngleEP12ImageContentS1_(ptr noundef nonnull align 4 dereferenceable(88), ptr noundef, ptr noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Corner16computeHistAngleEP12ImageContent(ptr noundef nonnull align 4 dereferenceable(88) %0, ptr noundef %1) #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %11 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 41, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %12 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 80) #6
  %13 = load i32, ptr %5, align 4, !tbaa !9
  %14 = load i32, ptr %5, align 4, !tbaa !9
  invoke void @_ZN12ImageContentC2Eii(ptr noundef nonnull align 8 dereferenceable(80) %12, i32 noundef %13, i32 noundef %14)
          to label %15 unwind label %44

15:                                               ; preds = %2
  store ptr %12, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %16 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 80) #6
  %17 = load i32, ptr %5, align 4, !tbaa !9
  %18 = load i32, ptr %5, align 4, !tbaa !9
  invoke void @_ZN12ImageContentC2Eii(ptr noundef nonnull align 8 dereferenceable(80) %16, i32 noundef %17, i32 noundef %18)
          to label %19 unwind label %48

19:                                               ; preds = %15
  store ptr %16, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %20 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 80) #6
  %21 = load i32, ptr %5, align 4, !tbaa !9
  %22 = load i32, ptr %5, align 4, !tbaa !9
  invoke void @_ZN12ImageContentC2Eii(ptr noundef nonnull align 8 dereferenceable(80) %20, i32 noundef %21, i32 noundef %22)
          to label %23 unwind label %52

23:                                               ; preds = %19
  store ptr %20, ptr %10, align 8, !tbaa !5
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = call noundef zeroext i1 @_ZN6Corner15normalizeAffineEP12ImageContentS1_(ptr noundef nonnull align 4 dereferenceable(88) %11, ptr noundef %24, ptr noundef %25)
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = load ptr, ptr %9, align 8, !tbaa !5
  %29 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_Z13GradOriImagesP12ImageContentS0_S0_(ptr noundef %27, ptr noundef %28, ptr noundef %29)
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN6Corner16computeHistAngleEP12ImageContentS1_(ptr noundef nonnull align 4 dereferenceable(88) %11, ptr noundef %30, ptr noundef %31)
  %32 = load ptr, ptr %9, align 8, !tbaa !5
  %33 = icmp eq ptr %32, null
  br i1 %33, label %35, label %34

34:                                               ; preds = %23
  call void @_ZN12ImageContentD1Ev(ptr noundef nonnull align 8 dereferenceable(80) %32) #5
  call void @_ZdlPvm(ptr noundef %32, i64 noundef 80) #7
  br label %35

35:                                               ; preds = %34, %23
  %36 = load ptr, ptr %10, align 8, !tbaa !5
  %37 = icmp eq ptr %36, null
  br i1 %37, label %39, label %38

38:                                               ; preds = %35
  call void @_ZN12ImageContentD1Ev(ptr noundef nonnull align 8 dereferenceable(80) %36) #5
  call void @_ZdlPvm(ptr noundef %36, i64 noundef 80) #7
  br label %39

39:                                               ; preds = %38, %35
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = icmp eq ptr %40, null
  br i1 %41, label %43, label %42

42:                                               ; preds = %39
  call void @_ZN12ImageContentD1Ev(ptr noundef nonnull align 8 dereferenceable(80) %40) #5
  call void @_ZdlPvm(ptr noundef %40, i64 noundef 80) #7
  br label %43

43:                                               ; preds = %42, %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  ret void

44:                                               ; preds = %2
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %7, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %8, align 4
  call void @_ZdlPvm(ptr noundef %12, i64 noundef 80) #7
  br label %57

48:                                               ; preds = %15
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %7, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %8, align 4
  call void @_ZdlPvm(ptr noundef %16, i64 noundef 80) #7
  br label %56

52:                                               ; preds = %19
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %7, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %8, align 4
  call void @_ZdlPvm(ptr noundef %20, i64 noundef 80) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %56

56:                                               ; preds = %52, %48
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %57

57:                                               ; preds = %56, %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %58

58:                                               ; preds = %57
  %59 = load ptr, ptr %7, align 8
  %60 = load i32, ptr %8, align 4
  %61 = insertvalue { ptr, i32 } poison, ptr %59, 0
  %62 = insertvalue { ptr, i32 } %61, i32 %60, 1
  resume { ptr, i32 } %62
}

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 = { nobuiltin allocsize(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 = { nobuiltin 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 #4 = { 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 #5 = { nounwind }
attributes #6 = { builtin allocsize(0) }
attributes #7 = { builtin 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}


; 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 void @_Z13GradOriImagesP12ImageContentS0_S0_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZN12ImageContentD1Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6Corner15normalizeAffineEP12ImageContentS1_(ptr noundef nonnull align 4 dereferenceable(88), ptr noundef, ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12ImageContentC2Eii(ptr noundef nonnull align 8 dereferenceable(80), i32 noundef, i32 noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Corner16computeHistAngleEP12ImageContentS1_(ptr noundef nonnull align 4 dereferenceable(88), ptr noundef, ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Corner16computeHistAngleEP12ImageContent(ptr noundef nonnull align 4 dereferenceable(88) %0, ptr noundef %1) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = tail call noalias noundef nonnull dereferenceable(80) ptr @_Znwm(i64 noundef 80) #4
  invoke void @_ZN12ImageContentC2Eii(ptr noundef nonnull align 8 dereferenceable(80) %3, i32 noundef 41, i32 noundef 41)
          to label %4 unwind label %10

4:                                                ; preds = %2
  %5 = tail call noalias noundef nonnull dereferenceable(80) ptr @_Znwm(i64 noundef 80) #4
  invoke void @_ZN12ImageContentC2Eii(ptr noundef nonnull align 8 dereferenceable(80) %5, i32 noundef 41, i32 noundef 41)
          to label %6 unwind label %12

6:                                                ; preds = %4
  %7 = tail call noalias noundef nonnull dereferenceable(80) ptr @_Znwm(i64 noundef 80) #4
  invoke void @_ZN12ImageContentC2Eii(ptr noundef nonnull align 8 dereferenceable(80) %7, i32 noundef 41, i32 noundef 41)
          to label %8 unwind label %14

8:                                                ; preds = %6
  %9 = tail call noundef zeroext i1 @_ZN6Corner15normalizeAffineEP12ImageContentS1_(ptr noundef nonnull align 4 dereferenceable(88) %0, ptr noundef %1, ptr noundef nonnull %3)
  tail call void @_Z13GradOriImagesP12ImageContentS0_S0_(ptr noundef nonnull %3, ptr noundef nonnull %5, ptr noundef nonnull %7)
  tail call void @_ZN6Corner16computeHistAngleEP12ImageContentS1_(ptr noundef nonnull align 4 dereferenceable(88) %0, ptr noundef nonnull %5, ptr noundef nonnull %7)
  tail call void @_ZN12ImageContentD1Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #5
  tail call void @_ZdlPvm(ptr noundef nonnull %5, i64 noundef 80) #6
  tail call void @_ZN12ImageContentD1Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #5
  tail call void @_ZdlPvm(ptr noundef nonnull %7, i64 noundef 80) #6
  tail call void @_ZN12ImageContentD1Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #5
  tail call void @_ZdlPvm(ptr noundef nonnull %3, i64 noundef 80) #6
  ret void

10:                                               ; preds = %2
  %11 = landingpad { ptr, i32 }
          cleanup
  br label %16

12:                                               ; preds = %4
  %13 = landingpad { ptr, i32 }
          cleanup
  br label %16

14:                                               ; preds = %6
  %15 = landingpad { ptr, i32 }
          cleanup
  br label %16

16:                                               ; preds = %12, %14, %10
  %.sink = phi ptr [ %5, %12 ], [ %7, %14 ], [ %3, %10 ]
  %.pn.pn = phi { ptr, i32 } [ %13, %12 ], [ %15, %14 ], [ %11, %10 ]
  tail call void @_ZdlPvm(ptr noundef nonnull %.sink, i64 noundef 80) #6
  resume { ptr, i32 } %.pn.pn
}

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 = { nobuiltin allocsize(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 = { nobuiltin 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 = { 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 #4 = { builtin allocsize(0) }
attributes #5 = { nounwind }
attributes #6 = { builtin 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)"}


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