; LLVM IR from PaddlePaddle/Paddle-Lite :: lite/backends/host/math/topk.ll (ZN6paddle4lite4host4math4topkEPKfPfPliii)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<float, int>, std::allocator<std::pair<float, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<float, int>, std::allocator<std::pair<float, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<float, int>, std::allocator<std::pair<float, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<float, int>, std::allocator<std::pair<float, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { float, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN6paddle4lite4host4math9comp_funcESt4pairIfiES4_(i64, i64) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6paddle4lite4host4math4topkEPKfPfPliii(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5) #1 personality ptr @__gxx_personality_v0 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca %"class.std::vector", align 8
  %19 = alloca i32, align 4
  %20 = alloca %"struct.std::pair", align 4
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %24 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %25 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %26 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %27 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store i32 %3, ptr %10, align 4, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !9
  store i32 %5, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %28

28:                                               ; preds = %123, %6
  %29 = load i32, ptr %13, align 4, !tbaa !9
  %30 = load i32, ptr %10, align 4, !tbaa !9
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %127

33:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = load i32, ptr %13, align 4, !tbaa !9
  %36 = load i32, ptr %11, align 4, !tbaa !9
  %37 = mul nsw i32 %35, %36
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds float, ptr %34, i64 %38
  store ptr %39, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = load i32, ptr %13, align 4, !tbaa !9
  %42 = load i32, ptr %12, align 4, !tbaa !9
  %43 = mul nsw i32 %41, %42
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds float, ptr %40, i64 %44
  store ptr %45, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %46 = load ptr, ptr %9, align 8, !tbaa !5
  %47 = load i32, ptr %13, align 4, !tbaa !9
  %48 = load i32, ptr %12, align 4, !tbaa !9
  %49 = mul nsw i32 %47, %48
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds i64, ptr %46, i64 %50
  store ptr %51, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #4
  call void @_ZNSt6vectorISt4pairIfiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %52

52:                                               ; preds = %65, %33
  %53 = load i32, ptr %19, align 4, !tbaa !9
  %54 = load i32, ptr %11, align 4, !tbaa !9
  %55 = icmp slt i32 %53, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %52
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  br label %72

57:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %58 = load ptr, ptr %15, align 8, !tbaa !5
  %59 = load i32, ptr %19, align 4, !tbaa !9
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds float, ptr %58, i64 %60
  %62 = invoke i64 @_ZSt9make_pairIRKfRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr noundef nonnull align 4 dereferenceable(4) %61, ptr noundef nonnull align 4 dereferenceable(4) %19)
          to label %63 unwind label %68

63:                                               ; preds = %57
  store i64 %62, ptr %20, align 4
  invoke void @_ZNSt6vectorISt4pairIfiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 4 dereferenceable(8) %20)
          to label %64 unwind label %68

64:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  br label %65

65:                                               ; preds = %64
  %66 = load i32, ptr %19, align 4, !tbaa !9
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %19, align 4, !tbaa !9
  br label %52, !llvm.loop !11

68:                                               ; preds = %63, %57
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %21, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  br label %126

72:                                               ; preds = %56
  %73 = call ptr @_ZNSt6vectorISt4pairIfiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #4
  %74 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %23, i32 0, i32 0
  store ptr %73, ptr %74, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  %75 = call ptr @_ZNSt6vectorISt4pairIfiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #4
  %76 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %25, i32 0, i32 0
  store ptr %75, ptr %76, align 8
  %77 = load i32, ptr %12, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIfiESt6vectorIS2_SaIS2_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %25, i64 noundef %78) #4
  %80 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %24, i32 0, i32 0
  store ptr %79, ptr %80, align 8
  %81 = call ptr @_ZNSt6vectorISt4pairIfiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #4
  %82 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %26, i32 0, i32 0
  store ptr %81, ptr %82, align 8
  %83 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %23, i32 0, i32 0
  %84 = load ptr, ptr %83, align 8
  %85 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %24, i32 0, i32 0
  %86 = load ptr, ptr %85, align 8
  %87 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %26, i32 0, i32 0
  %88 = load ptr, ptr %87, align 8
  invoke void @_ZSt12partial_sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIfiESt6vectorIS3_SaIS3_EEEEPFbS3_S3_EEvT_SB_SB_T0_(ptr %84, ptr %86, ptr %88, ptr noundef @_ZN6paddle4lite4host4math9comp_funcESt4pairIfiES4_)
          to label %89 unwind label %95

89:                                               ; preds = %72
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #4
  store i32 0, ptr %27, align 4, !tbaa !9
  br label %90

90:                                               ; preds = %119, %89
  %91 = load i32, ptr %27, align 4, !tbaa !9
  %92 = load i32, ptr %12, align 4, !tbaa !9
  %93 = icmp slt i32 %91, %92
  br i1 %93, label %99, label %94

94:                                               ; preds = %90
  store i32 8, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #4
  br label %122

95:                                               ; preds = %72
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %21, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  br label %126

99:                                               ; preds = %90
  %100 = load i32, ptr %27, align 4, !tbaa !9
  %101 = sext i32 %100 to i64
  %102 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIfiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %101) #4
  %103 = getelementptr inbounds %"struct.std::pair", ptr %102, i32 0, i32 0
  %104 = load float, ptr %103, align 4, !tbaa !13
  %105 = load ptr, ptr %16, align 8, !tbaa !5
  %106 = load i32, ptr %27, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds float, ptr %105, i64 %107
  store float %104, ptr %108, align 4, !tbaa !16
  %109 = load i32, ptr %27, align 4, !tbaa !9
  %110 = sext i32 %109 to i64
  %111 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIfiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %110) #4
  %112 = getelementptr inbounds %"struct.std::pair", ptr %111, i32 0, i32 1
  %113 = load i32, ptr %112, align 4, !tbaa !17
  %114 = sext i32 %113 to i64
  %115 = load ptr, ptr %17, align 8, !tbaa !5
  %116 = load i32, ptr %27, align 4, !tbaa !9
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds i64, ptr %115, i64 %117
  store i64 %114, ptr %118, align 8, !tbaa !18
  br label %119

119:                                              ; preds = %99
  %120 = load i32, ptr %27, align 4, !tbaa !9
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %27, align 4, !tbaa !9
  br label %90, !llvm.loop !20

122:                                              ; preds = %94
  call void @_ZNSt6vectorISt4pairIfiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %13, align 4, !tbaa !9
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %13, align 4, !tbaa !9
  br label %28, !llvm.loop !21

126:                                              ; preds = %95, %68
  call void @_ZNSt6vectorISt4pairIfiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %128

127:                                              ; preds = %32
  ret void

128:                                              ; preds = %126
  %129 = load ptr, ptr %21, align 8
  %130 = load i32, ptr %22, align 4
  %131 = insertvalue { ptr, i32 } poison, ptr %129, 0
  %132 = insertvalue { ptr, i32 } %131, i32 %130, 1
  resume { ptr, i32 } %132
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIfiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRKfRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt12partial_sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIfiESt6vectorIS3_SaIS3_EEEEPFbS3_S3_EEvT_SB_SB_T0_(ptr, ptr, ptr, ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIfiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIfiESt6vectorIS2_SaIS2_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIfiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIfiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIfiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

attributes #0 = { 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 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !15, i64 0}
!14 = !{!"_ZTSSt4pairIfiE", !15, i64 0, !10, i64 4}
!15 = !{!"float", !7, i64 0}
!16 = !{!15, !15, i64 0}
!17 = !{!14, !10, i64 4}
!18 = !{!19, !19, i64 0}
!19 = !{!"long", !7, i64 0}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}


; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<float, int>, std::allocator<std::pair<float, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<float, int>, std::allocator<std::pair<float, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<float, int>, std::allocator<std::pair<float, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<float, int>, std::allocator<std::pair<float, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { float, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN6paddle4lite4host4math9comp_funcESt4pairIfiES4_(i64, i64) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6paddle4lite4host4math4topkEPKfPfPliii(ptr noundef %0, ptr nocapture noundef writeonly %1, ptr nocapture noundef writeonly %2, i32 noundef %3, i32 noundef %4, i32 noundef %5) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::pair", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = icmp sgt i32 %3, 0
  br i1 %11, label %.lr.ph38, label %._crit_edge39

.lr.ph38:                                         ; preds = %6
  %12 = icmp sgt i32 %4, 0
  %13 = sext i32 %5 to i64
  %14 = icmp sgt i32 %5, 0
  br i1 %14, label %.lr.ph38.split.us, label %.lr.ph38.split

.lr.ph38.split.us:                                ; preds = %.lr.ph38
  br i1 %12, label %.lr.ph.us.us.preheader, label %.lr.ph38.split.us.split.preheader

.lr.ph38.split.us.split.preheader:                ; preds = %.lr.ph38.split.us
  %15 = zext nneg i32 %5 to i64
  %wide.trip.count64 = zext nneg i32 %3 to i64
  br label %.lr.ph38.split.us.split

.lr.ph.us.us.preheader:                           ; preds = %.lr.ph38.split.us
  %16 = zext nneg i32 %4 to i64
  %17 = zext nneg i32 %5 to i64
  %wide.trip.count74 = zext nneg i32 %3 to i64
  br label %.lr.ph.us.us

.lr.ph.us.us:                                     ; preds = %.lr.ph.us.us.preheader, %._crit_edge35.us.us
  %indvars.iv71 = phi i64 [ 0, %.lr.ph.us.us.preheader ], [ %indvars.iv.next72, %._crit_edge35.us.us ]
  %18 = mul nuw nsw i64 %indvars.iv71, %16
  %19 = getelementptr inbounds float, ptr %0, i64 %18
  %20 = mul nuw nsw i64 %indvars.iv71, %17
  %21 = getelementptr inbounds float, ptr %1, i64 %20
  %22 = getelementptr inbounds i64, ptr %2, i64 %20
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #4
  call void @_ZNSt6vectorISt4pairIfiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %32

.lr.ph34.us.us:                                   ; preds = %._crit_edge.us.us
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  br label %23

23:                                               ; preds = %23, %.lr.ph34.us.us
  %indvars.iv66 = phi i64 [ %indvars.iv.next67, %23 ], [ 0, %.lr.ph34.us.us ]
  %24 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIfiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %indvars.iv66) #4
  %25 = load float, ptr %24, align 4, !tbaa !9
  %26 = getelementptr inbounds float, ptr %21, i64 %indvars.iv66
  store float %25, ptr %26, align 4, !tbaa !12
  %27 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIfiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %indvars.iv66) #4
  %28 = getelementptr inbounds i8, ptr %27, i64 4
  %29 = load i32, ptr %28, align 4, !tbaa !13
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds i64, ptr %22, i64 %indvars.iv66
  store i64 %30, ptr %31, align 8, !tbaa !14
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %exitcond70.not = icmp eq i64 %indvars.iv.next67, %17
  br i1 %exitcond70.not, label %._crit_edge35.us.us, label %23, !llvm.loop !16

32:                                               ; preds = %.lr.ph.us.us, %37
  %storemerge31.us.us = phi i32 [ 0, %.lr.ph.us.us ], [ %39, %37 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  %33 = sext i32 %storemerge31.us.us to i64
  %34 = getelementptr inbounds float, ptr %19, i64 %33
  %35 = invoke i64 @_ZSt9make_pairIRKfRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr noundef nonnull align 4 dereferenceable(4) %34, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %36 unwind label %.split41.us.split.us

36:                                               ; preds = %32
  store i64 %35, ptr %9, align 8
  invoke void @_ZNSt6vectorISt4pairIfiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 4 dereferenceable(8) %9)
          to label %37 unwind label %.split41.us.split.us

37:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  %38 = load i32, ptr %8, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %8, align 4, !tbaa !5
  %40 = icmp slt i32 %39, %4
  br i1 %40, label %32, label %._crit_edge.us.us, !llvm.loop !18

._crit_edge.us.us:                                ; preds = %37
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  %41 = call ptr @_ZNSt6vectorISt4pairIfiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  %42 = call ptr @_ZNSt6vectorISt4pairIfiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  store ptr %42, ptr %10, align 8
  %43 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIfiESt6vectorIS2_SaIS2_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %10, i64 noundef %13) #4
  %44 = call ptr @_ZNSt6vectorISt4pairIfiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  invoke void @_ZSt12partial_sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIfiESt6vectorIS3_SaIS3_EEEEPFbS3_S3_EEvT_SB_SB_T0_(ptr %41, ptr %43, ptr %44, ptr noundef nonnull @_ZN6paddle4lite4host4math9comp_funcESt4pairIfiES4_)
          to label %.lr.ph34.us.us unwind label %.split.us.split.us

._crit_edge35.us.us:                              ; preds = %23
  call void @_ZNSt6vectorISt4pairIfiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #4
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %exitcond75.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count74
  br i1 %exitcond75.not, label %._crit_edge39, label %.lr.ph.us.us, !llvm.loop !19

.split.us.split.us:                               ; preds = %._crit_edge.us.us
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %.split.us

.split41.us.split.us:                             ; preds = %36, %32
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %87

.lr.ph38.split.us.split:                          ; preds = %.lr.ph38.split.us.split.preheader, %._crit_edge35.us
  %indvars.iv61 = phi i64 [ 0, %.lr.ph38.split.us.split.preheader ], [ %indvars.iv.next62, %._crit_edge35.us ]
  %47 = mul nuw nsw i64 %indvars.iv61, %15
  %48 = getelementptr inbounds float, ptr %1, i64 %47
  %49 = getelementptr inbounds i64, ptr %2, i64 %47
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #4
  call void @_ZNSt6vectorISt4pairIfiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  %50 = call ptr @_ZNSt6vectorISt4pairIfiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  %51 = call ptr @_ZNSt6vectorISt4pairIfiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  store ptr %51, ptr %10, align 8
  %52 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIfiESt6vectorIS2_SaIS2_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %10, i64 noundef %13) #4
  %53 = call ptr @_ZNSt6vectorISt4pairIfiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  invoke void @_ZSt12partial_sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIfiESt6vectorIS3_SaIS3_EEEEPFbS3_S3_EEvT_SB_SB_T0_(ptr %50, ptr %52, ptr %53, ptr noundef nonnull @_ZN6paddle4lite4host4math9comp_funcESt4pairIfiES4_)
          to label %.lr.ph34.us unwind label %.split.us.split

.lr.ph34.us:                                      ; preds = %.lr.ph38.split.us.split
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  br label %54

54:                                               ; preds = %.lr.ph34.us, %54
  %indvars.iv56 = phi i64 [ 0, %.lr.ph34.us ], [ %indvars.iv.next57, %54 ]
  %55 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIfiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %indvars.iv56) #4
  %56 = load float, ptr %55, align 4, !tbaa !9
  %57 = getelementptr inbounds float, ptr %48, i64 %indvars.iv56
  store float %56, ptr %57, align 4, !tbaa !12
  %58 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIfiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %indvars.iv56) #4
  %59 = getelementptr inbounds i8, ptr %58, i64 4
  %60 = load i32, ptr %59, align 4, !tbaa !13
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds i64, ptr %49, i64 %indvars.iv56
  store i64 %61, ptr %62, align 8, !tbaa !14
  %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
  %exitcond60.not = icmp eq i64 %indvars.iv.next57, %15
  br i1 %exitcond60.not, label %._crit_edge35.us, label %54, !llvm.loop !16

._crit_edge35.us:                                 ; preds = %54
  call void @_ZNSt6vectorISt4pairIfiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #4
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %exitcond65.not = icmp eq i64 %indvars.iv.next62, %wide.trip.count64
  br i1 %exitcond65.not, label %._crit_edge39, label %.lr.ph38.split.us.split, !llvm.loop !19

.split.us.split:                                  ; preds = %.lr.ph38.split.us.split
  %63 = landingpad { ptr, i32 }
          cleanup
  br label %.split.us

.lr.ph38.split:                                   ; preds = %.lr.ph38
  br i1 %12, label %.lr.ph.us45.preheader, label %.lr.ph38.split.split

.lr.ph.us45.preheader:                            ; preds = %.lr.ph38.split
  %64 = zext nneg i32 %4 to i64
  %wide.trip.count = zext nneg i32 %3 to i64
  br label %.lr.ph.us45

.lr.ph.us45:                                      ; preds = %.lr.ph.us45.preheader, %67
  %indvars.iv = phi i64 [ 0, %.lr.ph.us45.preheader ], [ %indvars.iv.next, %67 ]
  %65 = mul nuw nsw i64 %indvars.iv, %64
  %66 = getelementptr inbounds float, ptr %0, i64 %65
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #4
  call void @_ZNSt6vectorISt4pairIfiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %68

67:                                               ; preds = %._crit_edge.us46
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  call void @_ZNSt6vectorISt4pairIfiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond55.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond55.not, label %._crit_edge39, label %.lr.ph.us45, !llvm.loop !19

68:                                               ; preds = %.lr.ph.us45, %73
  %storemerge31.us44 = phi i32 [ 0, %.lr.ph.us45 ], [ %75, %73 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  %69 = sext i32 %storemerge31.us44 to i64
  %70 = getelementptr inbounds float, ptr %66, i64 %69
  %71 = invoke i64 @_ZSt9make_pairIRKfRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr noundef nonnull align 4 dereferenceable(4) %70, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %72 unwind label %.split41.split.us

72:                                               ; preds = %68
  store i64 %71, ptr %9, align 8
  invoke void @_ZNSt6vectorISt4pairIfiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 4 dereferenceable(8) %9)
          to label %73 unwind label %.split41.split.us

73:                                               ; preds = %72
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  %74 = load i32, ptr %8, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %8, align 4, !tbaa !5
  %76 = icmp slt i32 %75, %4
  br i1 %76, label %68, label %._crit_edge.us46, !llvm.loop !18

._crit_edge.us46:                                 ; preds = %73
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  %77 = call ptr @_ZNSt6vectorISt4pairIfiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  %78 = call ptr @_ZNSt6vectorISt4pairIfiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  store ptr %78, ptr %10, align 8
  %79 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIfiESt6vectorIS2_SaIS2_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %10, i64 noundef %13) #4
  %80 = call ptr @_ZNSt6vectorISt4pairIfiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  invoke void @_ZSt12partial_sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIfiESt6vectorIS3_SaIS3_EEEEPFbS3_S3_EEvT_SB_SB_T0_(ptr %77, ptr %79, ptr %80, ptr noundef nonnull @_ZN6paddle4lite4host4math9comp_funcESt4pairIfiES4_)
          to label %67 unwind label %.split.split.us

.split.split.us:                                  ; preds = %._crit_edge.us46
  %81 = landingpad { ptr, i32 }
          cleanup
  br label %.split.us

.split41.split.us:                                ; preds = %72, %68
  %82 = landingpad { ptr, i32 }
          cleanup
  br label %87

._crit_edge39:                                    ; preds = %88, %67, %._crit_edge35.us, %._crit_edge35.us.us, %6
  ret void

.lr.ph38.split.split:                             ; preds = %.lr.ph38.split, %88
  %.02736 = phi i32 [ %89, %88 ], [ 0, %.lr.ph38.split ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #4
  call void @_ZNSt6vectorISt4pairIfiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  %83 = call ptr @_ZNSt6vectorISt4pairIfiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  %84 = call ptr @_ZNSt6vectorISt4pairIfiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  store ptr %84, ptr %10, align 8
  %85 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIfiESt6vectorIS2_SaIS2_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %10, i64 noundef %13) #4
  %86 = call ptr @_ZNSt6vectorISt4pairIfiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  invoke void @_ZSt12partial_sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIfiESt6vectorIS3_SaIS3_EEEEPFbS3_S3_EEvT_SB_SB_T0_(ptr %83, ptr %85, ptr %86, ptr noundef nonnull @_ZN6paddle4lite4host4math9comp_funcESt4pairIfiES4_)
          to label %88 unwind label %.split.split

87:                                               ; preds = %.split41.us.split.us, %.split41.split.us
  %.us-phi42 = phi { ptr, i32 } [ %82, %.split41.split.us ], [ %46, %.split41.us.split.us ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  br label %91

88:                                               ; preds = %.lr.ph38.split.split
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  call void @_ZNSt6vectorISt4pairIfiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #4
  %89 = add nuw nsw i32 %.02736, 1
  %exitcond.not = icmp eq i32 %89, %3
  br i1 %exitcond.not, label %._crit_edge39, label %.lr.ph38.split.split, !llvm.loop !19

.split.split:                                     ; preds = %.lr.ph38.split.split
  %90 = landingpad { ptr, i32 }
          cleanup
  br label %.split.us

.split.us:                                        ; preds = %.split.split, %.split.split.us, %.split.us.split, %.split.us.split.us
  %.us-phi = phi { ptr, i32 } [ %63, %.split.us.split ], [ %45, %.split.us.split.us ], [ %90, %.split.split ], [ %81, %.split.split.us ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  br label %91

91:                                               ; preds = %.split.us, %87
  %.pn = phi { ptr, i32 } [ %.us-phi42, %87 ], [ %.us-phi, %.split.us ]
  call void @_ZNSt6vectorISt4pairIfiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #4
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIfiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIfiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRKfRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt12partial_sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIfiESt6vectorIS3_SaIS3_EEEEPFbS3_S3_EEvT_SB_SB_T0_(ptr, ptr, ptr, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIfiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIfiESt6vectorIS2_SaIS2_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIfiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIfiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIfiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

attributes #0 = { 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 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTSSt4pairIfiE", !11, i64 0, !6, i64 4}
!11 = !{!"float", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!10, !6, i64 4}
!14 = !{!15, !15, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = distinct !{!19, !17}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass