; LLVM IR from NVIDIA/TensorRT :: plugin/proposalLayerPlugin (proposalLayerPlugin)

; 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.nvinfer1::Dims64" = type { i32, [8 x i64] }
%"class.nvinfer1::plugin::ProposalLayer" = type { %"class.nvinfer1::IPluginV2Ext", i32, i32, i32, float, i32, i32, %"class.std::shared_ptr", %"class.std::shared_ptr.17", %"class.std::vector", i32, %"class.nvinfer1::Dims64", %struct.RefineNMSParameters, %"class.std::__cxx11::basic_string" }
%"class.nvinfer1::IPluginV2Ext" = type { %"class.nvinfer1::IPluginV2" }
%"class.nvinfer1::IPluginV2" = type { 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::shared_ptr.17" = type { %"class.std::__shared_ptr.18" }
%"class.std::__shared_ptr.18" = type { ptr, %"class.std::__shared_count" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%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.102 = external hidden unnamed_addr constant [100 x i8], align 1
@.str.122 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.123 = external hidden unnamed_addr constant [55 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8nvinfer16plugin13ProposalLayer18check_valid_inputsEPKNS_6Dims64Ei(ptr noundef nonnull align 8 dereferenceable(224), ptr noundef, i32 noundef) #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN8nvinfer16plugin13ProposalLayer15configurePluginEPKNS_6Dims64EiS4_iPKNS_8DataTypeES7_PKbS9_NS_12TensorFormatEi(ptr noundef nonnull align 8 dereferenceable(224) %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, i32 noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8, i32 noundef %9, i32 noundef %10) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  store ptr %0, ptr %12, align 8, !tbaa !5
  store ptr %1, ptr %13, align 8, !tbaa !5
  store i32 %2, ptr %14, align 4, !tbaa !9
  store ptr %3, ptr %15, align 8, !tbaa !5
  store i32 %4, ptr %16, align 4, !tbaa !9
  store ptr %5, ptr %17, align 8, !tbaa !5
  store ptr %6, ptr %18, align 8, !tbaa !5
  store ptr %7, ptr %19, align 8, !tbaa !5
  store ptr %8, ptr %20, align 8, !tbaa !5
  store i32 %9, ptr %21, align 4, !tbaa !11
  store i32 %10, ptr %22, align 4, !tbaa !9
  %23 = load ptr, ptr %12, align 8
  %24 = load ptr, ptr %13, align 8, !tbaa !5
  %25 = load i32, ptr %14, align 4, !tbaa !9
  invoke void @_ZN8nvinfer16plugin13ProposalLayer18check_valid_inputsEPKNS_6Dims64Ei(ptr noundef nonnull align 8 dereferenceable(224) %23, ptr noundef %24, i32 noundef %25)
          to label %26 unwind label %60

26:                                               ; preds = %11
  %27 = load ptr, ptr %13, align 8, !tbaa !5
  %28 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %27, i64 0
  %29 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %28, i32 0, i32 1
  %30 = getelementptr inbounds [8 x i64], ptr %29, i64 0, i64 0
  %31 = load i64, ptr %30, align 8, !tbaa !13
  %32 = load ptr, ptr %13, align 8, !tbaa !5
  %33 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %32, i64 1
  %34 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %33, i32 0, i32 1
  %35 = getelementptr inbounds [8 x i64], ptr %34, i64 0, i64 0
  %36 = load i64, ptr %35, align 8, !tbaa !13
  %37 = icmp eq i64 %31, %36
  br i1 %37, label %40, label %38

38:                                               ; preds = %26
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef @.str.122, ptr noundef @.str.102, i32 noundef 383)
          to label %39 unwind label %60

39:                                               ; preds = %38
  br label %40

40:                                               ; preds = %39, %26
  %41 = load ptr, ptr %13, align 8, !tbaa !5
  %42 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %41, i64 0
  %43 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %42, i32 0, i32 1
  %44 = getelementptr inbounds [8 x i64], ptr %43, i64 0, i64 0
  %45 = load i64, ptr %44, align 8, !tbaa !13
  %46 = trunc i64 %45 to i32
  %47 = getelementptr inbounds %"class.nvinfer1::plugin::ProposalLayer", ptr %23, i32 0, i32 6
  store i32 %46, ptr %47, align 4, !tbaa !15
  %48 = getelementptr inbounds %"class.nvinfer1::plugin::ProposalLayer", ptr %23, i32 0, i32 6
  %49 = load i32, ptr %48, align 4, !tbaa !15
  %50 = getelementptr inbounds %"class.nvinfer1::plugin::ProposalLayer", ptr %23, i32 0, i32 9
  %51 = call noundef i64 @_ZNKSt6vectorIfSaIfEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %50) #4
  %52 = udiv i64 %51, 4
  %53 = trunc i64 %52 to i32
  %54 = icmp eq i32 %49, %53
  br i1 %54, label %57, label %55

55:                                               ; preds = %40
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef @.str.123, ptr noundef @.str.102, i32 noundef 386)
          to label %56 unwind label %60

56:                                               ; preds = %55
  br label %57

57:                                               ; preds = %56, %40
  %58 = load i32, ptr %22, align 4, !tbaa !9
  %59 = getelementptr inbounds %"class.nvinfer1::plugin::ProposalLayer", ptr %23, i32 0, i32 5
  store i32 %58, ptr %59, align 8, !tbaa !34
  ret void

60:                                               ; preds = %55, %38, %11
  %61 = landingpad { ptr, i32 }
          catch ptr null
  %62 = extractvalue { ptr, i32 } %61, 0
  call void @__clang_call_terminate(ptr %62) #5
  unreachable
}

attributes #0 = { 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 #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #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 = !{!"_ZTSN8nvinfer112TensorFormatE", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!16, !10, i64 28}
!16 = !{!"_ZTSN8nvinfer16plugin13ProposalLayerE", !17, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !19, i64 20, !10, i64 24, !10, i64 28, !20, i64 32, !23, i64 48, !25, i64 64, !29, i64 88, !30, i64 96, !31, i64 168, !32, i64 192}
!17 = !{!"_ZTSN8nvinfer112IPluginV2ExtE", !18, i64 0}
!18 = !{!"_ZTSN8nvinfer19IPluginV2E"}
!19 = !{!"float", !7, i64 0}
!20 = !{!"_ZTSSt10shared_ptrIN8nvinfer16plugin8CudaBindIiEEE", !21, i64 0}
!21 = !{!"_ZTSSt12__shared_ptrIN8nvinfer16plugin8CudaBindIiEELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !22, i64 8}
!22 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!23 = !{!"_ZTSSt10shared_ptrIN8nvinfer16plugin8CudaBindIfEEE", !24, i64 0}
!24 = !{!"_ZTSSt12__shared_ptrIN8nvinfer16plugin8CudaBindIfEELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !22, i64 8}
!25 = !{!"_ZTSSt6vectorIfSaIfEE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!29 = !{!"_ZTSN8nvinfer18DataTypeE", !7, i64 0}
!30 = !{!"_ZTSN8nvinfer16Dims64E", !10, i64 0, !7, i64 8}
!31 = !{!"_ZTS19RefineNMSParameters", !10, i64 0, !10, i64 4, !10, i64 8, !19, i64 12, !19, i64 16}
!32 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !33, i64 0, !14, i64 8, !7, i64 16}
!33 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!34 = !{!16, !10, i64 24}


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

@.str.102 = external hidden unnamed_addr constant [100 x i8], align 1
@.str.122 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.123 = external hidden unnamed_addr constant [55 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8nvinfer16plugin13ProposalLayer18check_valid_inputsEPKNS_6Dims64Ei(ptr noundef nonnull align 8 dereferenceable(224), ptr noundef, i32 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN8nvinfer16plugin13ProposalLayer15configurePluginEPKNS_6Dims64EiS4_iPKNS_8DataTypeES7_PKbS9_NS_12TensorFormatEi(ptr noundef nonnull align 8 dereferenceable(224) %0, ptr noundef %1, i32 noundef %2, ptr nocapture noundef readnone %3, i32 noundef %4, ptr nocapture noundef readnone %5, ptr nocapture noundef readnone %6, ptr nocapture noundef readnone %7, ptr nocapture noundef readnone %8, i32 noundef %9, i32 noundef %10) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  invoke void @_ZN8nvinfer16plugin13ProposalLayer18check_valid_inputsEPKNS_6Dims64Ei(ptr noundef nonnull align 8 dereferenceable(224) %0, ptr noundef %1, i32 noundef %2)
          to label %12 unwind label %31

12:                                               ; preds = %11
  %13 = getelementptr inbounds i8, ptr %1, i64 8
  %14 = load i64, ptr %13, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %1, i64 80
  %16 = load i64, ptr %15, align 8, !tbaa !5
  %17 = icmp eq i64 %14, %16
  br i1 %17, label %19, label %18

18:                                               ; preds = %12
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef nonnull @.str.122, ptr noundef nonnull @.str.102, i32 noundef 383)
          to label %._crit_edge unwind label %31

._crit_edge:                                      ; preds = %18
  %.pre = load i64, ptr %13, align 8, !tbaa !5
  br label %19

19:                                               ; preds = %._crit_edge, %12
  %20 = phi i64 [ %.pre, %._crit_edge ], [ %14, %12 ]
  %21 = trunc i64 %20 to i32
  %22 = getelementptr inbounds i8, ptr %0, i64 28
  store i32 %21, ptr %22, align 4, !tbaa !9
  %23 = getelementptr inbounds i8, ptr %0, i64 64
  %24 = tail call noundef i64 @_ZNKSt6vectorIfSaIfEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #4
  %25 = lshr i64 %24, 2
  %26 = trunc i64 %25 to i32
  %27 = icmp eq i32 %21, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %19
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef nonnull @.str.123, ptr noundef nonnull @.str.102, i32 noundef 386)
          to label %29 unwind label %31

29:                                               ; preds = %28, %19
  %30 = getelementptr inbounds i8, ptr %0, i64 24
  store i32 %10, ptr %30, align 8, !tbaa !30
  ret void

31:                                               ; preds = %28, %18, %11
  %32 = landingpad { ptr, i32 }
          catch ptr null
  %33 = extractvalue { ptr, i32 } %32, 0
  tail call void @__clang_call_terminate(ptr %33) #5
  unreachable
}

attributes #0 = { 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 #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !13, i64 28}
!10 = !{!"_ZTSN8nvinfer16plugin13ProposalLayerE", !11, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !14, i64 20, !13, i64 24, !13, i64 28, !15, i64 32, !19, i64 48, !21, i64 64, !25, i64 88, !26, i64 96, !27, i64 168, !28, i64 192}
!11 = !{!"_ZTSN8nvinfer112IPluginV2ExtE", !12, i64 0}
!12 = !{!"_ZTSN8nvinfer19IPluginV2E"}
!13 = !{!"int", !7, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{!"_ZTSSt10shared_ptrIN8nvinfer16plugin8CudaBindIiEEE", !16, i64 0}
!16 = !{!"_ZTSSt12__shared_ptrIN8nvinfer16plugin8CudaBindIiEELN9__gnu_cxx12_Lock_policyE2EE", !17, i64 0, !18, i64 8}
!17 = !{!"any pointer", !7, i64 0}
!18 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !17, i64 0}
!19 = !{!"_ZTSSt10shared_ptrIN8nvinfer16plugin8CudaBindIfEEE", !20, i64 0}
!20 = !{!"_ZTSSt12__shared_ptrIN8nvinfer16plugin8CudaBindIfEELN9__gnu_cxx12_Lock_policyE2EE", !17, i64 0, !18, i64 8}
!21 = !{!"_ZTSSt6vectorIfSaIfEE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !17, i64 0, !17, i64 8, !17, i64 16}
!25 = !{!"_ZTSN8nvinfer18DataTypeE", !7, i64 0}
!26 = !{!"_ZTSN8nvinfer16Dims64E", !13, i64 0, !7, i64 8}
!27 = !{!"_ZTS19RefineNMSParameters", !13, i64 0, !13, i64 4, !13, i64 8, !14, i64 12, !14, i64 16}
!28 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !29, i64 0, !6, i64 8, !7, i64 16}
!29 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !17, i64 0}
!30 = !{!10, !13, i64 24}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass