; LLVM IR from NVIDIA/TensorRT :: plugin/multilevelProposeROI (multilevelProposeROIPlugin)

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

%struct.MultilevelProposeROIWorkSpace = type { %"class.nvinfer1::DimsHW", %"class.nvinfer1::DimsHW", %"class.nvinfer1::DimsHW", %"class.nvinfer1::DimsHW", %"class.nvinfer1::DimsHW", %"class.nvinfer1::DimsHW", %"class.nvinfer1::DimsHW", %"class.nvinfer1::DimsHW", %"class.nvinfer1::Dims64", %"class.nvinfer1::DimsHW", %"class.nvinfer1::DimsHW", i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64 }
%"class.nvinfer1::Dims64" = type { i32, [8 x i64] }
%"class.nvinfer1::DimsHW" = type { %"class.nvinfer1::Dims2" }
%"class.nvinfer1::Dims2" = type { %"class.nvinfer1::Dims64" }
%struct.ConcatTopKWorkSpace = type { %"class.nvinfer1::DimsHW", %"class.nvinfer1::DimsHW", %"class.nvinfer1::DimsHW", %"class.nvinfer1::DimsHW", i64, i64, i64, i64, i64, i64 }
%"class.nvinfer1::plugin::MultilevelProposeROI" = type { %"class.nvinfer1::IPluginV2Ext", i32, i32, i32, i32, float, float, i32, %"class.std::vector.17", %"class.std::shared_ptr", %"class.std::vector.22", %"class.std::vector.27", %"class.std::vector.22", %"class.std::vector.22", %"class.std::vector.32", %"class.std::vector.32", ptr, ptr, %"class.std::shared_ptr.37", %"class.nvinfer1::Dims64", i32, %struct.RefineNMSParameters, %"class.std::__cxx11::basic_string" }
%"class.nvinfer1::IPluginV2Ext" = type { %"class.nvinfer1::IPluginV2" }
%"class.nvinfer1::IPluginV2" = type { ptr }
%"class.std::vector.17" = type { %"struct.std::_Vector_base.18" }
%"struct.std::_Vector_base.18" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::vector.27" = type { %"struct.std::_Vector_base.28" }
%"struct.std::_Vector_base.28" = type { %"struct.std::_Vector_base<std::vector<float>, std::allocator<std::vector<float>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<float>, std::allocator<std::vector<float>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<float>, std::allocator<std::vector<float>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<float>, std::allocator<std::vector<float>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.22" = type { %"struct.std::_Vector_base.23" }
%"struct.std::_Vector_base.23" = type { %"struct.std::_Vector_base<std::shared_ptr<nvinfer1::plugin::CudaBind<float>>, std::allocator<std::shared_ptr<nvinfer1::plugin::CudaBind<float>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<nvinfer1::plugin::CudaBind<float>>, std::allocator<std::shared_ptr<nvinfer1::plugin::CudaBind<float>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<nvinfer1::plugin::CudaBind<float>>, std::allocator<std::shared_ptr<nvinfer1::plugin::CudaBind<float>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<nvinfer1::plugin::CudaBind<float>>, std::allocator<std::shared_ptr<nvinfer1::plugin::CudaBind<float>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.32" = type { %"struct.std::_Vector_base.33" }
%"struct.std::_Vector_base.33" = type { %"struct.std::_Vector_base<std::shared_ptr<nvinfer1::plugin::CudaBind<unsigned short>>, std::allocator<std::shared_ptr<nvinfer1::plugin::CudaBind<unsigned short>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<nvinfer1::plugin::CudaBind<unsigned short>>, std::allocator<std::shared_ptr<nvinfer1::plugin::CudaBind<unsigned short>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<nvinfer1::plugin::CudaBind<unsigned short>>, std::allocator<std::shared_ptr<nvinfer1::plugin::CudaBind<unsigned short>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<nvinfer1::plugin::CudaBind<unsigned short>>, std::allocator<std::shared_ptr<nvinfer1::plugin::CudaBind<unsigned short>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::shared_ptr.37" = type { %"class.std::__shared_ptr.38" }
%"class.std::__shared_ptr.38" = type { ptr, %"class.std::__shared_count" }
%struct.RefineNMSParameters = type { i32, i32, i32, float, float }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@.str.101 = external hidden unnamed_addr constant [108 x i8], align 1
@.str.117 = external hidden unnamed_addr constant [55 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

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) #0

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #1

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

declare void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef, ptr noundef, i32 noundef) #3

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i64 @_ZNK8nvinfer16plugin20MultilevelProposeROI16getWorkspaceSizeEi(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef %1) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca %struct.MultilevelProposeROIWorkSpace, align 8
  %8 = alloca %struct.ConcatTopKWorkSpace, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %9 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  store i64 0, ptr %5, align 8, !tbaa !11
  %10 = getelementptr inbounds %"class.nvinfer1::plugin::MultilevelProposeROI", ptr %9, i32 0, i32 8
  %11 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  %12 = getelementptr inbounds %"class.nvinfer1::plugin::MultilevelProposeROI", ptr %9, i32 0, i32 4
  %13 = load i32, ptr %12, align 4, !tbaa !13
  %14 = sext i32 %13 to i64
  %15 = icmp eq i64 %11, %14
  br i1 %15, label %18, label %16

16:                                               ; preds = %2
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef @.str.117, ptr noundef @.str.101, i32 noundef 354)
          to label %17 unwind label %59

17:                                               ; preds = %16
  br label %18

18:                                               ; preds = %17, %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %19

19:                                               ; preds = %42, %18
  %20 = load i32, ptr %6, align 4, !tbaa !9
  %21 = getelementptr inbounds %"class.nvinfer1::plugin::MultilevelProposeROI", ptr %9, i32 0, i32 4
  %22 = load i32, ptr %21, align 4, !tbaa !13
  %23 = icmp slt i32 %20, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %45

25:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 896, ptr %7) #4
  %26 = load i32, ptr %4, align 4, !tbaa !9
  %27 = getelementptr inbounds %"class.nvinfer1::plugin::MultilevelProposeROI", ptr %9, i32 0, i32 8
  %28 = load i32, ptr %6, align 4, !tbaa !9
  %29 = sext i32 %28 to i64
  %30 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %27, i64 noundef %29) #4
  %31 = load i32, ptr %30, align 4, !tbaa !9
  %32 = getelementptr inbounds %"class.nvinfer1::plugin::MultilevelProposeROI", ptr %9, i32 0, i32 2
  %33 = load i32, ptr %32, align 4, !tbaa !44
  %34 = getelementptr inbounds %"class.nvinfer1::plugin::MultilevelProposeROI", ptr %9, i32 0, i32 21
  %35 = getelementptr inbounds %"class.nvinfer1::plugin::MultilevelProposeROI", ptr %9, i32 0, i32 20
  %36 = load i32, ptr %35, align 8, !tbaa !45
  invoke void @_ZN29MultilevelProposeROIWorkSpaceC1EiiiRK19RefineNMSParametersN8nvinfer18DataTypeE(ptr noundef nonnull align 8 dereferenceable(896) %7, i32 noundef %26, i32 noundef %31, i32 noundef %33, ptr noundef nonnull align 4 dereferenceable(20) %34, i32 noundef %36)
          to label %37 unwind label %59

37:                                               ; preds = %25
  %38 = getelementptr inbounds %struct.MultilevelProposeROIWorkSpace, ptr %7, i32 0, i32 23
  %39 = load i64, ptr %38, align 8, !tbaa !46
  %40 = load i64, ptr %5, align 8, !tbaa !11
  %41 = add i64 %40, %39
  store i64 %41, ptr %5, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 896, ptr %7) #4
  br label %42

42:                                               ; preds = %37
  %43 = load i32, ptr %6, align 4, !tbaa !9
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %6, align 4, !tbaa !9
  br label %19, !llvm.loop !50

45:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 336, ptr %8) #4
  %46 = load i32, ptr %4, align 4, !tbaa !9
  %47 = getelementptr inbounds %"class.nvinfer1::plugin::MultilevelProposeROI", ptr %9, i32 0, i32 4
  %48 = load i32, ptr %47, align 4, !tbaa !13
  %49 = getelementptr inbounds %"class.nvinfer1::plugin::MultilevelProposeROI", ptr %9, i32 0, i32 3
  %50 = load i32, ptr %49, align 8, !tbaa !52
  %51 = getelementptr inbounds %"class.nvinfer1::plugin::MultilevelProposeROI", ptr %9, i32 0, i32 20
  %52 = load i32, ptr %51, align 8, !tbaa !45
  invoke void @_ZN19ConcatTopKWorkSpaceC1EiiiN8nvinfer18DataTypeE(ptr noundef nonnull align 8 dereferenceable(336) %8, i32 noundef %46, i32 noundef %48, i32 noundef %50, i32 noundef %52)
          to label %53 unwind label %59

53:                                               ; preds = %45
  %54 = getelementptr inbounds %struct.ConcatTopKWorkSpace, ptr %8, i32 0, i32 9
  %55 = load i64, ptr %54, align 8, !tbaa !53
  %56 = load i64, ptr %5, align 8, !tbaa !11
  %57 = add i64 %56, %55
  store i64 %57, ptr %5, align 8, !tbaa !11
  %58 = load i64, ptr %5, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 336, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret i64 %58

59:                                               ; preds = %45, %25, %16
  %60 = landingpad { ptr, i32 }
          catch ptr null
  %61 = extractvalue { ptr, i32 } %60, 0
  call void @__clang_call_terminate(ptr %61) #5
  unreachable
}

declare void @_ZN29MultilevelProposeROIWorkSpaceC1EiiiRK19RefineNMSParametersN8nvinfer18DataTypeE(ptr noundef nonnull align 8 dereferenceable(896), i32 noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(20), i32 noundef) unnamed_addr #3

declare void @_ZN19ConcatTopKWorkSpaceC1EiiiN8nvinfer18DataTypeE(ptr noundef nonnull align 8 dereferenceable(336), i32 noundef, i32 noundef, i32 noundef, i32 noundef) unnamed_addr #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noinline noreturn nounwind uwtable "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" }
attributes #3 = { "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 }
attributes #5 = { noreturn 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 = !{!"long", !7, i64 0}
!13 = !{!14, !10, i64 20}
!14 = !{!"_ZTSN8nvinfer16plugin20MultilevelProposeROIE", !15, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !17, i64 24, !17, i64 28, !10, i64 32, !18, i64 40, !22, i64 64, !25, i64 80, !29, i64 104, !25, i64 128, !25, i64 152, !33, i64 176, !33, i64 200, !6, i64 224, !6, i64 232, !37, i64 240, !39, i64 256, !40, i64 328, !41, i64 332, !42, i64 352}
!15 = !{!"_ZTSN8nvinfer112IPluginV2ExtE", !16, i64 0}
!16 = !{!"_ZTSN8nvinfer19IPluginV2E"}
!17 = !{!"float", !7, i64 0}
!18 = !{!"_ZTSSt6vectorIiSaIiEE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!22 = !{!"_ZTSSt10shared_ptrIN8nvinfer16plugin8CudaBindIiEEE", !23, i64 0}
!23 = !{!"_ZTSSt12__shared_ptrIN8nvinfer16plugin8CudaBindIiEELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !24, i64 8}
!24 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!25 = !{!"_ZTSSt6vectorISt10shared_ptrIN8nvinfer16plugin8CudaBindIfEEESaIS5_EE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseISt10shared_ptrIN8nvinfer16plugin8CudaBindIfEEESaIS5_EE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN8nvinfer16plugin8CudaBindIfEEESaIS5_EE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN8nvinfer16plugin8CudaBindIfEEESaIS5_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!29 = !{!"_ZTSSt6vectorIS_IfSaIfEESaIS1_EE", !30, i64 0}
!30 = !{!"_ZTSSt12_Vector_baseISt6vectorIfSaIfEESaIS2_EE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseISt6vectorIfSaIfEESaIS2_EE12_Vector_implE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseISt6vectorIfSaIfEESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!33 = !{!"_ZTSSt6vectorISt10shared_ptrIN8nvinfer16plugin8CudaBindItEEESaIS5_EE", !34, i64 0}
!34 = !{!"_ZTSSt12_Vector_baseISt10shared_ptrIN8nvinfer16plugin8CudaBindItEEESaIS5_EE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN8nvinfer16plugin8CudaBindItEEESaIS5_EE12_Vector_implE", !36, i64 0}
!36 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN8nvinfer16plugin8CudaBindItEEESaIS5_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!37 = !{!"_ZTSSt10shared_ptrIN8nvinfer16plugin8CudaBindIfEEE", !38, i64 0}
!38 = !{!"_ZTSSt12__shared_ptrIN8nvinfer16plugin8CudaBindIfEELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !24, i64 8}
!39 = !{!"_ZTSN8nvinfer16Dims64E", !10, i64 0, !7, i64 8}
!40 = !{!"_ZTSN8nvinfer18DataTypeE", !7, i64 0}
!41 = !{!"_ZTS19RefineNMSParameters", !10, i64 0, !10, i64 4, !10, i64 8, !17, i64 12, !17, i64 16}
!42 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !43, i64 0, !12, i64 8, !7, i64 16}
!43 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!44 = !{!14, !10, i64 12}
!45 = !{!14, !40, i64 328}
!46 = !{!47, !12, i64 888}
!47 = !{!"_ZTS29MultilevelProposeROIWorkSpace", !48, i64 0, !48, i64 72, !48, i64 144, !48, i64 216, !48, i64 288, !48, i64 360, !48, i64 432, !48, i64 504, !39, i64 576, !48, i64 648, !48, i64 720, !12, i64 792, !12, i64 800, !12, i64 808, !12, i64 816, !12, i64 824, !12, i64 832, !12, i64 840, !12, i64 848, !12, i64 856, !12, i64 864, !12, i64 872, !12, i64 880, !12, i64 888}
!48 = !{!"_ZTSN8nvinfer16DimsHWE", !49, i64 0}
!49 = !{!"_ZTSN8nvinfer15Dims2E", !39, i64 0}
!50 = distinct !{!50, !51}
!51 = !{!"llvm.loop.mustprogress"}
!52 = !{!14, !10, i64 16}
!53 = !{!54, !12, i64 328}
!54 = !{!"_ZTS19ConcatTopKWorkSpace", !48, i64 0, !48, i64 72, !48, i64 144, !48, i64 216, !12, i64 288, !12, i64 296, !12, i64 304, !12, i64 312, !12, i64 320, !12, i64 328}


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

%struct.MultilevelProposeROIWorkSpace = type { %"class.nvinfer1::DimsHW", %"class.nvinfer1::DimsHW", %"class.nvinfer1::DimsHW", %"class.nvinfer1::DimsHW", %"class.nvinfer1::DimsHW", %"class.nvinfer1::DimsHW", %"class.nvinfer1::DimsHW", %"class.nvinfer1::DimsHW", %"class.nvinfer1::Dims64", %"class.nvinfer1::DimsHW", %"class.nvinfer1::DimsHW", i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64 }
%"class.nvinfer1::Dims64" = type { i32, [8 x i64] }
%"class.nvinfer1::DimsHW" = type { %"class.nvinfer1::Dims2" }
%"class.nvinfer1::Dims2" = type { %"class.nvinfer1::Dims64" }
%struct.ConcatTopKWorkSpace = type { %"class.nvinfer1::DimsHW", %"class.nvinfer1::DimsHW", %"class.nvinfer1::DimsHW", %"class.nvinfer1::DimsHW", i64, i64, i64, i64, i64, i64 }

@.str.101 = external hidden unnamed_addr constant [108 x i8], align 1
@.str.117 = external hidden unnamed_addr constant [55 x i8], align 1

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

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) #0

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #1

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

declare void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i64 @_ZNK8nvinfer16plugin20MultilevelProposeROI16getWorkspaceSizeEi(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef %1) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %struct.MultilevelProposeROIWorkSpace, align 8
  %4 = alloca %struct.ConcatTopKWorkSpace, align 8
  %5 = getelementptr inbounds i8, ptr %0, i64 40
  %6 = tail call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  %7 = getelementptr inbounds i8, ptr %0, i64 20
  %8 = load i32, ptr %7, align 4, !tbaa !5
  %9 = sext i32 %8 to i64
  %10 = icmp eq i64 %6, %9
  br i1 %10, label %12, label %11

11:                                               ; preds = %2
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef nonnull @.str.117, ptr noundef nonnull @.str.101, i32 noundef 354)
          to label %._crit_edge17 unwind label %.loopexit.split-lp

._crit_edge17:                                    ; preds = %11
  %.pre = load i32, ptr %7, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %._crit_edge17, %2
  %13 = phi i32 [ %.pre, %._crit_edge17 ], [ %8, %2 ]
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %12
  %15 = getelementptr inbounds i8, ptr %0, i64 12
  %16 = getelementptr inbounds i8, ptr %0, i64 332
  %17 = getelementptr inbounds i8, ptr %0, i64 328
  %18 = getelementptr inbounds i8, ptr %3, i64 888
  br label %23

._crit_edge:                                      ; preds = %28, %12
  %.08.lcssa = phi i64 [ 0, %12 ], [ %30, %28 ]
  %.lcssa = phi i32 [ %13, %12 ], [ %31, %28 ]
  call void @llvm.lifetime.start.p0(i64 336, ptr nonnull %4) #4
  %19 = getelementptr inbounds i8, ptr %0, i64 16
  %20 = load i32, ptr %19, align 8, !tbaa !41
  %21 = getelementptr inbounds i8, ptr %0, i64 328
  %22 = load i32, ptr %21, align 8, !tbaa !42
  invoke void @_ZN19ConcatTopKWorkSpaceC1EiiiN8nvinfer18DataTypeE(ptr noundef nonnull align 8 dereferenceable(336) %4, i32 noundef %1, i32 noundef %.lcssa, i32 noundef %20, i32 noundef %22)
          to label %34 unwind label %.loopexit.split-lp

23:                                               ; preds = %.lr.ph, %28
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %28 ]
  %.0811 = phi i64 [ 0, %.lr.ph ], [ %30, %28 ]
  call void @llvm.lifetime.start.p0(i64 896, ptr nonnull %3) #4
  %24 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv) #4
  %25 = load i32, ptr %24, align 4, !tbaa !43
  %26 = load i32, ptr %15, align 4, !tbaa !44
  %27 = load i32, ptr %17, align 8, !tbaa !42
  invoke void @_ZN29MultilevelProposeROIWorkSpaceC1EiiiRK19RefineNMSParametersN8nvinfer18DataTypeE(ptr noundef nonnull align 8 dereferenceable(896) %3, i32 noundef %1, i32 noundef %25, i32 noundef %26, ptr noundef nonnull align 4 dereferenceable(20) %16, i32 noundef %27)
          to label %28 unwind label %.loopexit

28:                                               ; preds = %23
  %29 = load i64, ptr %18, align 8, !tbaa !45
  %30 = add i64 %29, %.0811
  call void @llvm.lifetime.end.p0(i64 896, ptr nonnull %3) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %31 = load i32, ptr %7, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = icmp slt i64 %indvars.iv.next, %32
  br i1 %33, label %23, label %._crit_edge, !llvm.loop !49

34:                                               ; preds = %._crit_edge
  %35 = getelementptr inbounds i8, ptr %4, i64 328
  %36 = load i64, ptr %35, align 8, !tbaa !51
  %37 = add i64 %36, %.08.lcssa
  call void @llvm.lifetime.end.p0(i64 336, ptr nonnull %4) #4
  ret i64 %37

.loopexit:                                        ; preds = %23
  %lpad.loopexit = landingpad { ptr, i32 }
          catch ptr null
  br label %38

.loopexit.split-lp:                               ; preds = %11, %._crit_edge
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          catch ptr null
  br label %38

38:                                               ; preds = %.loopexit.split-lp, %.loopexit
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  %39 = extractvalue { ptr, i32 } %lpad.phi, 0
  call void @__clang_call_terminate(ptr %39) #5
  unreachable
}

declare void @_ZN29MultilevelProposeROIWorkSpaceC1EiiiRK19RefineNMSParametersN8nvinfer18DataTypeE(ptr noundef nonnull align 8 dereferenceable(896), i32 noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(20), i32 noundef) unnamed_addr #3

declare void @_ZN19ConcatTopKWorkSpaceC1EiiiN8nvinfer18DataTypeE(ptr noundef nonnull align 8 dereferenceable(336), i32 noundef, i32 noundef, i32 noundef, i32 noundef) unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noinline noreturn nounwind uwtable "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" }
attributes #3 = { "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 }
attributes #5 = { noreturn 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, !9, i64 20}
!6 = !{!"_ZTSN8nvinfer16plugin20MultilevelProposeROIE", !7, i64 0, !9, i64 8, !9, i64 12, !9, i64 16, !9, i64 20, !12, i64 24, !12, i64 28, !9, i64 32, !13, i64 40, !18, i64 64, !21, i64 80, !25, i64 104, !21, i64 128, !21, i64 152, !29, i64 176, !29, i64 200, !17, i64 224, !17, i64 232, !33, i64 240, !35, i64 256, !36, i64 328, !37, i64 332, !38, i64 352}
!7 = !{!"_ZTSN8nvinfer112IPluginV2ExtE", !8, i64 0}
!8 = !{!"_ZTSN8nvinfer19IPluginV2E"}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"float", !10, i64 0}
!13 = !{!"_ZTSSt6vectorIiSaIiEE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !17, i64 0, !17, i64 8, !17, i64 16}
!17 = !{!"any pointer", !10, i64 0}
!18 = !{!"_ZTSSt10shared_ptrIN8nvinfer16plugin8CudaBindIiEEE", !19, i64 0}
!19 = !{!"_ZTSSt12__shared_ptrIN8nvinfer16plugin8CudaBindIiEELN9__gnu_cxx12_Lock_policyE2EE", !17, i64 0, !20, i64 8}
!20 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !17, i64 0}
!21 = !{!"_ZTSSt6vectorISt10shared_ptrIN8nvinfer16plugin8CudaBindIfEEESaIS5_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseISt10shared_ptrIN8nvinfer16plugin8CudaBindIfEEESaIS5_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN8nvinfer16plugin8CudaBindIfEEESaIS5_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN8nvinfer16plugin8CudaBindIfEEESaIS5_EE17_Vector_impl_dataE", !17, i64 0, !17, i64 8, !17, i64 16}
!25 = !{!"_ZTSSt6vectorIS_IfSaIfEESaIS1_EE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseISt6vectorIfSaIfEESaIS2_EE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseISt6vectorIfSaIfEESaIS2_EE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseISt6vectorIfSaIfEESaIS2_EE17_Vector_impl_dataE", !17, i64 0, !17, i64 8, !17, i64 16}
!29 = !{!"_ZTSSt6vectorISt10shared_ptrIN8nvinfer16plugin8CudaBindItEEESaIS5_EE", !30, i64 0}
!30 = !{!"_ZTSSt12_Vector_baseISt10shared_ptrIN8nvinfer16plugin8CudaBindItEEESaIS5_EE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN8nvinfer16plugin8CudaBindItEEESaIS5_EE12_Vector_implE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN8nvinfer16plugin8CudaBindItEEESaIS5_EE17_Vector_impl_dataE", !17, i64 0, !17, i64 8, !17, i64 16}
!33 = !{!"_ZTSSt10shared_ptrIN8nvinfer16plugin8CudaBindIfEEE", !34, i64 0}
!34 = !{!"_ZTSSt12__shared_ptrIN8nvinfer16plugin8CudaBindIfEELN9__gnu_cxx12_Lock_policyE2EE", !17, i64 0, !20, i64 8}
!35 = !{!"_ZTSN8nvinfer16Dims64E", !9, i64 0, !10, i64 8}
!36 = !{!"_ZTSN8nvinfer18DataTypeE", !10, i64 0}
!37 = !{!"_ZTS19RefineNMSParameters", !9, i64 0, !9, i64 4, !9, i64 8, !12, i64 12, !12, i64 16}
!38 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !39, i64 0, !40, i64 8, !10, i64 16}
!39 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !17, i64 0}
!40 = !{!"long", !10, i64 0}
!41 = !{!6, !9, i64 16}
!42 = !{!6, !36, i64 328}
!43 = !{!9, !9, i64 0}
!44 = !{!6, !9, i64 12}
!45 = !{!46, !40, i64 888}
!46 = !{!"_ZTS29MultilevelProposeROIWorkSpace", !47, i64 0, !47, i64 72, !47, i64 144, !47, i64 216, !47, i64 288, !47, i64 360, !47, i64 432, !47, i64 504, !35, i64 576, !47, i64 648, !47, i64 720, !40, i64 792, !40, i64 800, !40, i64 808, !40, i64 816, !40, i64 824, !40, i64 832, !40, i64 840, !40, i64 848, !40, i64 856, !40, i64 864, !40, i64 872, !40, i64 880, !40, i64 888}
!47 = !{!"_ZTSN8nvinfer16DimsHWE", !48, i64 0}
!48 = !{!"_ZTSN8nvinfer15Dims2E", !35, i64 0}
!49 = distinct !{!49, !50}
!50 = !{!"llvm.loop.mustprogress"}
!51 = !{!52, !40, i64 328}
!52 = !{!"_ZTS19ConcatTopKWorkSpace", !47, i64 0, !47, i64 72, !47, i64 144, !47, i64 216, !40, i64 288, !40, i64 296, !40, i64 304, !40, i64 312, !40, i64 320, !40, i64 328}


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