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

; 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::ProposalPlugin" = type { %"class.nvinfer1::IPluginV2Ext", %"class.std::__cxx11::basic_string", i64, i64, i64, i64, float, i64, float, float, i64, i64, %"class.std::vector.3", i64, %"class.std::vector.3", i64 }
%"class.nvinfer1::IPluginV2Ext" = type { %"class.nvinfer1::IPluginV2" }
%"class.nvinfer1::IPluginV2" = type { ptr }
%"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] }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = 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 }

@.str.2 = external hidden unnamed_addr constant [90 x i8], align 1
@_ZTISt9exception = external constant ptr
@.str.10 = external hidden unnamed_addr constant [14 x i8], align 1
@__func__._ZN8nvinfer16plugin14ProposalPlugin15configurePluginEPKNS_6Dims64EiS4_iPKNS_8DataTypeES7_PKbS9_NS_12TensorFormatEi = external hidden unnamed_addr constant [16 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [15 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: noreturn
declare void @_ZN8nvinfer16plugin16throwPluginErrorEPKcS2_iiS2_(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef) #1

; Function Attrs: nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #2

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

declare ptr @__cxa_begin_catch(ptr)

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8nvinfer16plugin11caughtErrorERKSt9exception(ptr noundef nonnull align 8 dereferenceable(8)) #4

declare void @__cxa_end_catch()

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN8nvinfer16plugin14ProposalPlugin15configurePluginEPKNS_6Dims64EiS4_iPKNS_8DataTypeES7_PKbS9_NS_12TensorFormatEi(ptr noundef nonnull align 8 dereferenceable(176) %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 #5 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
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  %25 = alloca ptr, align 8
  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
  %26 = load ptr, ptr %12, align 8
  %27 = load i32, ptr %14, align 4, !tbaa !9
  %28 = icmp eq i32 %27, 2
  br i1 %28, label %46, label %29

29:                                               ; preds = %11
  invoke void @_ZN8nvinfer16plugin16throwPluginErrorEPKcS2_iiS2_(ptr noundef @.str.2, ptr noundef @__func__._ZN8nvinfer16plugin14ProposalPlugin15configurePluginEPKNS_6Dims64EiS4_iPKNS_8DataTypeES7_PKbS9_NS_12TensorFormatEi, i32 noundef 602, i32 noundef 0, ptr noundef @.str.10) #6
          to label %30 unwind label %31

30:                                               ; preds = %29
  unreachable

31:                                               ; preds = %49, %29
  %32 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
          catch ptr null
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %23, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %24, align 4
  br label %35

35:                                               ; preds = %31
  %36 = load i32, ptr %24, align 4
  %37 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTISt9exception) #7
  %38 = icmp eq i32 %36, %37
  br i1 %38, label %39, label %65

39:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %40 = load ptr, ptr %23, align 8
  %41 = call ptr @__cxa_begin_catch(ptr %40) #7
  store ptr %41, ptr %25, align 8
  %42 = load ptr, ptr %25, align 8, !tbaa !5
  invoke void @_ZN8nvinfer16plugin11caughtErrorERKSt9exception(ptr noundef nonnull align 8 dereferenceable(8) %42)
          to label %43 unwind label %62

43:                                               ; preds = %39
  invoke void @__cxa_end_catch()
          to label %44 unwind label %62

44:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  br label %45

45:                                               ; preds = %51, %44
  ret void

46:                                               ; preds = %11
  %47 = load i32, ptr %16, align 4, !tbaa !9
  %48 = icmp eq i32 %47, 1
  br i1 %48, label %51, label %49

49:                                               ; preds = %46
  invoke void @_ZN8nvinfer16plugin16throwPluginErrorEPKcS2_iiS2_(ptr noundef @.str.2, ptr noundef @__func__._ZN8nvinfer16plugin14ProposalPlugin15configurePluginEPKNS_6Dims64EiS4_iPKNS_8DataTypeES7_PKbS9_NS_12TensorFormatEi, i32 noundef 603, i32 noundef 0, ptr noundef @.str.18) #6
          to label %50 unwind label %31

50:                                               ; preds = %49
  unreachable

51:                                               ; preds = %46
  %52 = load ptr, ptr %13, align 8, !tbaa !5
  %53 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %52, i32 0, i32 1
  %54 = getelementptr inbounds [8 x i64], ptr %53, i64 0, i64 1
  %55 = load i64, ptr %54, align 8, !tbaa !13
  %56 = getelementptr inbounds %"class.nvinfer1::plugin::ProposalPlugin", ptr %26, i32 0, i32 4
  store i64 %55, ptr %56, align 8, !tbaa !15
  %57 = load ptr, ptr %13, align 8, !tbaa !5
  %58 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %57, i32 0, i32 1
  %59 = getelementptr inbounds [8 x i64], ptr %58, i64 0, i64 2
  %60 = load i64, ptr %59, align 8, !tbaa !13
  %61 = getelementptr inbounds %"class.nvinfer1::plugin::ProposalPlugin", ptr %26, i32 0, i32 5
  store i64 %60, ptr %61, align 8, !tbaa !26
  br label %45

62:                                               ; preds = %43, %39
  %63 = landingpad { ptr, i32 }
          catch ptr null
  %64 = extractvalue { ptr, i32 } %63, 0
  call void @__clang_call_terminate(ptr %64) #8
  unreachable

65:                                               ; preds = %35
  %66 = load ptr, ptr %23, align 8
  call void @__clang_call_terminate(ptr %66) #8
  unreachable
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind memory(none) }
attributes #3 = { 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 #4 = { 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 #5 = { 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 #6 = { noreturn }
attributes #7 = { nounwind }
attributes #8 = { 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, !14, i64 56}
!16 = !{!"_ZTSN8nvinfer16plugin14ProposalPluginE", !17, i64 0, !19, i64 8, !14, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !21, i64 72, !14, i64 80, !21, i64 88, !21, i64 92, !14, i64 96, !14, i64 104, !22, i64 112, !14, i64 136, !22, i64 144, !14, i64 168}
!17 = !{!"_ZTSN8nvinfer112IPluginV2ExtE", !18, i64 0}
!18 = !{!"_ZTSN8nvinfer19IPluginV2E"}
!19 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !20, i64 0, !14, i64 8, !7, i64 16}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!21 = !{!"float", !7, i64 0}
!22 = !{!"_ZTSSt6vectorIfSaIfEE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!26 = !{!16, !14, i64 64}


; 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.2 = external hidden unnamed_addr constant [90 x i8], align 1
@_ZTISt9exception = external constant ptr
@.str.10 = external hidden unnamed_addr constant [14 x i8], align 1
@__func__._ZN8nvinfer16plugin14ProposalPlugin15configurePluginEPKNS_6Dims64EiS4_iPKNS_8DataTypeES7_PKbS9_NS_12TensorFormatEi = external hidden unnamed_addr constant [16 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [15 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: noreturn
declare void @_ZN8nvinfer16plugin16throwPluginErrorEPKcS2_iiS2_(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nofree nosync nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #1

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

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8nvinfer16plugin11caughtErrorERKSt9exception(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

declare void @__cxa_end_catch() local_unnamed_addr

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN8nvinfer16plugin14ProposalPlugin15configurePluginEPKNS_6Dims64EiS4_iPKNS_8DataTypeES7_PKbS9_NS_12TensorFormatEi(ptr nocapture noundef nonnull writeonly align 8 dereferenceable(176) %0, ptr nocapture noundef readonly %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 #4 align 2 personality ptr @__gxx_personality_v0 {
  %12 = icmp eq i32 %2, 2
  br i1 %12, label %23, label %.invoke

13:                                               ; preds = %.invoke
  %14 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
          catch ptr null
  %15 = extractvalue { ptr, i32 } %14, 0
  %16 = extractvalue { ptr, i32 } %14, 1
  %17 = tail call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTISt9exception) #5
  %18 = icmp eq i32 %16, %17
  br i1 %18, label %19, label %37

19:                                               ; preds = %13
  %20 = tail call ptr @__cxa_begin_catch(ptr %15) #5
  invoke void @_ZN8nvinfer16plugin11caughtErrorERKSt9exception(ptr noundef nonnull align 8 dereferenceable(8) %20)
          to label %21 unwind label %34

21:                                               ; preds = %19
  invoke void @__cxa_end_catch()
          to label %22 unwind label %34

22:                                               ; preds = %21, %27
  ret void

23:                                               ; preds = %11
  %24 = icmp eq i32 %4, 1
  br i1 %24, label %27, label %.invoke

.invoke:                                          ; preds = %11, %23
  %25 = phi i32 [ 603, %23 ], [ 602, %11 ]
  %26 = phi ptr [ @.str.18, %23 ], [ @.str.10, %11 ]
  invoke void @_ZN8nvinfer16plugin16throwPluginErrorEPKcS2_iiS2_(ptr noundef nonnull @.str.2, ptr noundef nonnull @__func__._ZN8nvinfer16plugin14ProposalPlugin15configurePluginEPKNS_6Dims64EiS4_iPKNS_8DataTypeES7_PKbS9_NS_12TensorFormatEi, i32 noundef %25, i32 noundef 0, ptr noundef nonnull %26) #6
          to label %.cont unwind label %13

.cont:                                            ; preds = %.invoke
  unreachable

27:                                               ; preds = %23
  %28 = getelementptr inbounds i8, ptr %1, i64 16
  %29 = load i64, ptr %28, align 8, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %0, i64 56
  store i64 %29, ptr %30, align 8, !tbaa !9
  %31 = getelementptr inbounds i8, ptr %1, i64 24
  %32 = load i64, ptr %31, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %0, i64 64
  store i64 %32, ptr %33, align 8, !tbaa !21
  br label %22

34:                                               ; preds = %21, %19
  %35 = landingpad { ptr, i32 }
          catch ptr null
  %36 = extractvalue { ptr, i32 } %35, 0
  tail call void @__clang_call_terminate(ptr %36) #7
  unreachable

37:                                               ; preds = %13
  tail call void @__clang_call_terminate(ptr %15) #7
  unreachable
}

attributes #0 = { noreturn "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 = { nofree nosync nounwind memory(none) }
attributes #2 = { 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 #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 = { 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 #5 = { nounwind }
attributes #6 = { noreturn }
attributes #7 = { 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, !6, i64 56}
!10 = !{!"_ZTSN8nvinfer16plugin14ProposalPluginE", !11, i64 0, !13, i64 8, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !16, i64 72, !6, i64 80, !16, i64 88, !16, i64 92, !6, i64 96, !6, i64 104, !17, i64 112, !6, i64 136, !17, i64 144, !6, i64 168}
!11 = !{!"_ZTSN8nvinfer112IPluginV2ExtE", !12, i64 0}
!12 = !{!"_ZTSN8nvinfer19IPluginV2E"}
!13 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !14, i64 0, !6, i64 8, !7, i64 16}
!14 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!"float", !7, i64 0}
!17 = !{!"_ZTSSt6vectorIfSaIfEE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!21 = !{!10, !6, i64 64}


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