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

; 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.nvinfer1::plugin::DetectionOutputParameters" = type <{ i8, i8, [2 x i8], i32, i32, i32, i32, float, float, i32, [3 x i32], i8, i8, i8, i8 }>
%"class.nvinfer1::plugin::DetectionOutputDynamic" = type { %"class.nvinfer1::IPluginV2DynamicExt", %"struct.nvinfer1::plugin::DetectionOutputParameters", i32, i32, i32, i32, i32, %"class.std::__cxx11::basic_string" }
%"class.nvinfer1::IPluginV2DynamicExt" = type { %"class.nvinfer1::IPluginV2Ext" }
%"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] }

@_ZTVN8nvinfer16plugin22DetectionOutputDynamicE = external dso_local unnamed_addr constant { [32 x ptr] }, align 8

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN8nvinfer16plugin22DetectionOutputDynamicC2ENS0_25DetectionOutputParametersE(ptr noundef nonnull align 8 dereferenceable(112) %0, ptr noundef byval(%"struct.nvinfer1::plugin::DetectionOutputParameters") align 8 %1) unnamed_addr #1 align 2 {
  %3 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %4 = load ptr, ptr %3, align 8
  call void @_ZN8nvinfer119IPluginV2DynamicExtC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  store ptr getelementptr inbounds inrange(-16, 240) ({ [32 x ptr] }, ptr @_ZTVN8nvinfer16plugin22DetectionOutputDynamicE, i32 0, i32 0, i32 2), ptr %4, align 8, !tbaa !9
  %5 = getelementptr inbounds %"class.nvinfer1::plugin::DetectionOutputDynamic", ptr %4, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %5, ptr align 8 %1, i64 48, i1 false), !tbaa.struct !11
  %6 = getelementptr inbounds %"class.nvinfer1::plugin::DetectionOutputDynamic", ptr %4, i32 0, i32 2
  store i32 0, ptr %6, align 8, !tbaa !21
  %7 = getelementptr inbounds %"class.nvinfer1::plugin::DetectionOutputDynamic", ptr %4, i32 0, i32 3
  store i32 0, ptr %7, align 4, !tbaa !31
  %8 = getelementptr inbounds %"class.nvinfer1::plugin::DetectionOutputDynamic", ptr %4, i32 0, i32 4
  store i32 0, ptr %8, align 8, !tbaa !32
  %9 = getelementptr inbounds %"class.nvinfer1::plugin::DetectionOutputDynamic", ptr %4, i32 0, i32 5
  store i32 0, ptr %9, align 4, !tbaa !33
  %10 = getelementptr inbounds %"class.nvinfer1::plugin::DetectionOutputDynamic", ptr %4, i32 0, i32 6
  store i32 16, ptr %10, align 8, !tbaa !34
  %11 = getelementptr inbounds %"class.nvinfer1::plugin::DetectionOutputDynamic", ptr %4, i32 0, i32 7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #3
  ret void
}

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

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { inlinehint 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 = { 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 = !{!"vtable pointer", !8, i64 0}
!11 = !{i64 0, i64 1, !12, i64 1, i64 1, !12, i64 4, i64 4, !14, i64 8, i64 4, !14, i64 12, i64 4, !14, i64 16, i64 4, !14, i64 20, i64 4, !16, i64 24, i64 4, !16, i64 28, i64 4, !18, i64 32, i64 12, !20, i64 44, i64 1, !12, i64 45, i64 1, !12, i64 46, i64 1, !12}
!12 = !{!13, !13, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"float", !7, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"_ZTSN8nvinfer16plugin11CodeTypeSSDE", !7, i64 0}
!20 = !{!7, !7, i64 0}
!21 = !{!22, !15, i64 56}
!22 = !{!"_ZTSN8nvinfer16plugin22DetectionOutputDynamicE", !23, i64 0, !26, i64 8, !15, i64 56, !15, i64 60, !15, i64 64, !27, i64 68, !15, i64 72, !28, i64 80}
!23 = !{!"_ZTSN8nvinfer119IPluginV2DynamicExtE", !24, i64 0}
!24 = !{!"_ZTSN8nvinfer112IPluginV2ExtE", !25, i64 0}
!25 = !{!"_ZTSN8nvinfer19IPluginV2E"}
!26 = !{!"_ZTSN8nvinfer16plugin25DetectionOutputParametersE", !13, i64 0, !13, i64 1, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16, !17, i64 20, !17, i64 24, !19, i64 28, !7, i64 32, !13, i64 44, !13, i64 45, !13, i64 46}
!27 = !{!"_ZTSN8nvinfer18DataTypeE", !7, i64 0}
!28 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !29, i64 0, !30, i64 8, !7, i64 16}
!29 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!30 = !{!"long", !7, i64 0}
!31 = !{!22, !15, i64 60}
!32 = !{!22, !15, i64 64}
!33 = !{!22, !27, i64 68}
!34 = !{!22, !15, i64 72}


; 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.nvinfer1::plugin::DetectionOutputParameters" = type <{ i8, i8, [2 x i8], i32, i32, i32, i32, float, float, i32, [3 x i32], i8, i8, i8, i8 }>

@_ZTVN8nvinfer16plugin22DetectionOutputDynamicE = external dso_local unnamed_addr constant { [32 x ptr] }, align 8

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN8nvinfer16plugin22DetectionOutputDynamicC2ENS0_25DetectionOutputParametersE(ptr noundef nonnull align 8 dereferenceable(112) %0, ptr nocapture noundef readonly byval(%"struct.nvinfer1::plugin::DetectionOutputParameters") align 8 %1) unnamed_addr #1 align 2 {
  tail call void @_ZN8nvinfer119IPluginV2DynamicExtC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #4
  store ptr getelementptr inbounds inrange(-16, 240) (i8, ptr @_ZTVN8nvinfer16plugin22DetectionOutputDynamicE, i64 16), ptr %0, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(48) %1, i64 48, i1 false), !tbaa.struct !8
  %4 = getelementptr inbounds i8, ptr %0, i64 56
  %5 = getelementptr inbounds i8, ptr %0, i64 72
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %4, i8 0, i64 16, i1 false)
  store i32 16, ptr %5, align 8, !tbaa !19
  %6 = getelementptr inbounds i8, ptr %0, i64 80
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #4
  ret void
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { inlinehint 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{i64 0, i64 1, !9, i64 1, i64 1, !9, i64 4, i64 4, !12, i64 8, i64 4, !12, i64 12, i64 4, !12, i64 16, i64 4, !12, i64 20, i64 4, !14, i64 24, i64 4, !14, i64 28, i64 4, !16, i64 32, i64 12, !18, i64 44, i64 1, !9, i64 45, i64 1, !9, i64 46, i64 1, !9}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !11, i64 0}
!11 = !{!"omnipotent char", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !11, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"float", !11, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"_ZTSN8nvinfer16plugin11CodeTypeSSDE", !11, i64 0}
!18 = !{!11, !11, i64 0}
!19 = !{!20, !13, i64 72}
!20 = !{!"_ZTSN8nvinfer16plugin22DetectionOutputDynamicE", !21, i64 0, !24, i64 8, !13, i64 56, !13, i64 60, !13, i64 64, !25, i64 68, !13, i64 72, !26, i64 80}
!21 = !{!"_ZTSN8nvinfer119IPluginV2DynamicExtE", !22, i64 0}
!22 = !{!"_ZTSN8nvinfer112IPluginV2ExtE", !23, i64 0}
!23 = !{!"_ZTSN8nvinfer19IPluginV2E"}
!24 = !{!"_ZTSN8nvinfer16plugin25DetectionOutputParametersE", !10, i64 0, !10, i64 1, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !15, i64 20, !15, i64 24, !17, i64 28, !11, i64 32, !10, i64 44, !10, i64 45, !10, i64 46}
!25 = !{!"_ZTSN8nvinfer18DataTypeE", !11, i64 0}
!26 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !27, i64 0, !29, i64 8, !11, i64 16}
!27 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !28, i64 0}
!28 = !{!"any pointer", !11, i64 0}
!29 = !{!"long", !11, i64 0}


; Effective O3 passes: InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,TailCallElimPass