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

; 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::PriorBoxParameters" = type { ptr, ptr, ptr, i32, i32, i32, i8, i8, [4 x float], i32, i32, float, float, float }
%"class.nvinfer1::plugin::PriorBox" = type { %"class.nvinfer1::IPluginV2Ext", %"struct.nvinfer1::plugin::PriorBoxParameters", i32, i32, i32, %"class.nvinfer1::Weights", %"class.nvinfer1::Weights", %"class.nvinfer1::Weights", %"class.std::vector.0", %"class.std::vector.0", %"class.std::vector.0", %"class.std::__cxx11::basic_string" }
%"class.nvinfer1::IPluginV2Ext" = type { %"class.nvinfer1::IPluginV2" }
%"class.nvinfer1::IPluginV2" = type { ptr }
%"class.nvinfer1::Weights" = type { i32, ptr, i64 }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = 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 }
%"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] }

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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) #1

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_ZN8nvinfer16plugin8PriorBox7enqueueEiPKPKvPKPvS6_P11CUstream_st(ptr noundef nonnull align 8 dereferenceable(280) %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %"struct.nvinfer1::plugin::PriorBoxParameters", align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  %16 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %17 = load ptr, ptr %10, align 8, !tbaa !5
  %18 = getelementptr inbounds ptr, ptr %17, i64 0
  %19 = load ptr, ptr %18, align 8, !tbaa !5
  store ptr %19, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %20 = load ptr, ptr %12, align 8, !tbaa !5
  %21 = getelementptr inbounds %"class.nvinfer1::plugin::PriorBox", ptr %16, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %21, i64 80, i1 false), !tbaa.struct !11
  %22 = getelementptr inbounds %"class.nvinfer1::plugin::PriorBox", ptr %16, i32 0, i32 3
  %23 = load i32, ptr %22, align 4, !tbaa !17
  %24 = getelementptr inbounds %"class.nvinfer1::plugin::PriorBox", ptr %16, i32 0, i32 4
  %25 = load i32, ptr %24, align 8, !tbaa !31
  %26 = getelementptr inbounds %"class.nvinfer1::plugin::PriorBox", ptr %16, i32 0, i32 2
  %27 = load i32, ptr %26, align 8, !tbaa !32
  %28 = getelementptr inbounds %"class.nvinfer1::plugin::PriorBox", ptr %16, i32 0, i32 7
  %29 = getelementptr inbounds %"class.nvinfer1::Weights", ptr %28, i32 0, i32 2
  %30 = load i64, ptr %29, align 8, !tbaa !33
  %31 = trunc i64 %30 to i32
  %32 = getelementptr inbounds %"class.nvinfer1::plugin::PriorBox", ptr %16, i32 0, i32 5
  %33 = getelementptr inbounds %"class.nvinfer1::Weights", ptr %32, i32 0, i32 1
  %34 = load ptr, ptr %33, align 8, !tbaa !34
  %35 = getelementptr inbounds %"class.nvinfer1::plugin::PriorBox", ptr %16, i32 0, i32 6
  %36 = getelementptr inbounds %"class.nvinfer1::Weights", ptr %35, i32 0, i32 1
  %37 = load ptr, ptr %36, align 8, !tbaa !35
  %38 = getelementptr inbounds %"class.nvinfer1::plugin::PriorBox", ptr %16, i32 0, i32 7
  %39 = getelementptr inbounds %"class.nvinfer1::Weights", ptr %38, i32 0, i32 1
  %40 = load ptr, ptr %39, align 8, !tbaa !36
  %41 = load ptr, ptr %13, align 8, !tbaa !5
  %42 = invoke noundef i32 @_ZN8nvinfer16plugin17priorBoxInferenceEP11CUstream_stNS0_18PriorBoxParametersEiiiiPKvS5_S5_Pv(ptr noundef %20, ptr noundef byval(%"struct.nvinfer1::plugin::PriorBoxParameters") align 8 %15, i32 noundef %23, i32 noundef %25, i32 noundef %27, i32 noundef %31, ptr noundef %34, ptr noundef %37, ptr noundef %40, ptr noundef %41)
          to label %43 unwind label %45

43:                                               ; preds = %6
  store i32 %42, ptr %14, align 4, !tbaa !37
  %44 = load i32, ptr %14, align 4, !tbaa !37
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  ret i32 %44

45:                                               ; preds = %6
  %46 = landingpad { ptr, i32 }
          catch ptr null
  %47 = extractvalue { ptr, i32 } %46, 0
  call void @__clang_call_terminate(ptr %47) #6
  unreachable
}

declare noundef i32 @_ZN8nvinfer16plugin17priorBoxInferenceEP11CUstream_stNS0_18PriorBoxParametersEiiiiPKvS5_S5_Pv(ptr noundef, ptr noundef byval(%"struct.nvinfer1::plugin::PriorBoxParameters") align 8, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #4

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { "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 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 = !{i64 0, i64 8, !5, i64 8, i64 8, !5, i64 16, i64 8, !5, i64 24, i64 4, !9, i64 28, i64 4, !9, i64 32, i64 4, !9, i64 36, i64 1, !12, i64 37, i64 1, !12, i64 40, i64 16, !14, i64 56, i64 4, !9, i64 60, i64 4, !9, i64 64, i64 4, !15, i64 68, i64 4, !15, i64 72, i64 4, !15}
!12 = !{!13, !13, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!7, !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"float", !7, i64 0}
!17 = !{!18, !10, i64 92}
!18 = !{!"_ZTSN8nvinfer16plugin8PriorBoxE", !19, i64 0, !21, i64 8, !10, i64 88, !10, i64 92, !10, i64 96, !22, i64 104, !22, i64 128, !22, i64 152, !25, i64 176, !25, i64 200, !25, i64 224, !29, i64 248}
!19 = !{!"_ZTSN8nvinfer112IPluginV2ExtE", !20, i64 0}
!20 = !{!"_ZTSN8nvinfer19IPluginV2E"}
!21 = !{!"_ZTSN8nvinfer16plugin18PriorBoxParametersE", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !13, i64 36, !13, i64 37, !7, i64 40, !10, i64 56, !10, i64 60, !16, i64 64, !16, i64 68, !16, i64 72}
!22 = !{!"_ZTSN8nvinfer17WeightsE", !23, i64 0, !6, i64 8, !24, i64 16}
!23 = !{!"_ZTSN8nvinfer18DataTypeE", !7, i64 0}
!24 = !{!"long", !7, i64 0}
!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 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !30, i64 0, !24, i64 8, !7, i64 16}
!30 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!31 = !{!18, !10, i64 96}
!32 = !{!18, !10, i64 88}
!33 = !{!18, !24, i64 168}
!34 = !{!18, !6, i64 112}
!35 = !{!18, !6, i64 136}
!36 = !{!18, !6, i64 160}
!37 = !{!38, !38, i64 0}
!38 = !{!"_ZTS14pluginStatus_t", !7, i64 0}


; 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::PriorBoxParameters" = type { ptr, ptr, ptr, i32, i32, i32, i8, i8, [4 x float], i32, i32, float, float, float }

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_ZN8nvinfer16plugin8PriorBox7enqueueEiPKPKvPKPvS6_P11CUstream_st(ptr nocapture noundef nonnull readonly align 8 dereferenceable(280) %0, i32 noundef %1, ptr nocapture noundef readnone %2, ptr nocapture noundef readonly %3, ptr nocapture noundef readnone %4, ptr noundef %5) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %7 = load ptr, ptr %3, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = getelementptr inbounds i8, ptr %0, i64 92
  %10 = load i32, ptr %9, align 4, !tbaa !9
  %11 = getelementptr inbounds i8, ptr %0, i64 96
  %12 = load i32, ptr %11, align 8, !tbaa !26
  %13 = getelementptr inbounds i8, ptr %0, i64 88
  %14 = load i32, ptr %13, align 8, !tbaa !27
  %15 = getelementptr inbounds i8, ptr %0, i64 168
  %16 = load i64, ptr %15, align 8, !tbaa !28
  %17 = trunc i64 %16 to i32
  %18 = getelementptr inbounds i8, ptr %0, i64 112
  %19 = load ptr, ptr %18, align 8, !tbaa !29
  %20 = getelementptr inbounds i8, ptr %0, i64 136
  %21 = load ptr, ptr %20, align 8, !tbaa !30
  %22 = getelementptr inbounds i8, ptr %0, i64 160
  %23 = load ptr, ptr %22, align 8, !tbaa !31
  %24 = invoke noundef i32 @_ZN8nvinfer16plugin17priorBoxInferenceEP11CUstream_stNS0_18PriorBoxParametersEiiiiPKvS5_S5_Pv(ptr noundef %5, ptr noundef nonnull byval(%"struct.nvinfer1::plugin::PriorBoxParameters") align 8 %8, i32 noundef %10, i32 noundef %12, i32 noundef %14, i32 noundef %17, ptr noundef %19, ptr noundef %21, ptr noundef %23, ptr noundef %7)
          to label %25 unwind label %26

25:                                               ; preds = %6
  ret i32 %24

26:                                               ; preds = %6
  %27 = landingpad { ptr, i32 }
          catch ptr null
  %28 = extractvalue { ptr, i32 } %27, 0
  tail call void @__clang_call_terminate(ptr %28) #3
  unreachable
}

declare noundef i32 @_ZN8nvinfer16plugin17priorBoxInferenceEP11CUstream_stNS0_18PriorBoxParametersEiiiiPKvS5_S5_Pv(ptr noundef, ptr noundef byval(%"struct.nvinfer1::plugin::PriorBoxParameters") align 8, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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 = { 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 = { "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 = { 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, !14, i64 92}
!10 = !{!"_ZTSN8nvinfer16plugin8PriorBoxE", !11, i64 0, !13, i64 8, !14, i64 88, !14, i64 92, !14, i64 96, !17, i64 104, !17, i64 128, !17, i64 152, !20, i64 176, !20, i64 200, !20, i64 224, !24, i64 248}
!11 = !{!"_ZTSN8nvinfer112IPluginV2ExtE", !12, i64 0}
!12 = !{!"_ZTSN8nvinfer19IPluginV2E"}
!13 = !{!"_ZTSN8nvinfer16plugin18PriorBoxParametersE", !6, i64 0, !6, i64 8, !6, i64 16, !14, i64 24, !14, i64 28, !14, i64 32, !15, i64 36, !15, i64 37, !7, i64 40, !14, i64 56, !14, i64 60, !16, i64 64, !16, i64 68, !16, i64 72}
!14 = !{!"int", !7, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"float", !7, i64 0}
!17 = !{!"_ZTSN8nvinfer17WeightsE", !18, i64 0, !6, i64 8, !19, i64 16}
!18 = !{!"_ZTSN8nvinfer18DataTypeE", !7, i64 0}
!19 = !{!"long", !7, i64 0}
!20 = !{!"_ZTSSt6vectorIfSaIfEE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!24 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !25, i64 0, !19, i64 8, !7, i64 16}
!25 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!26 = !{!10, !14, i64 96}
!27 = !{!10, !14, i64 88}
!28 = !{!10, !19, i64 168}
!29 = !{!10, !6, i64 112}
!30 = !{!10, !6, i64 136}
!31 = !{!10, !6, i64 160}


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