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

; 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::plugin::GridAnchorGenerator" = type { %"class.nvinfer1::IPluginV2Ext", %"class.std::__cxx11::basic_string", i32, %"class.std::vector.3", ptr, ptr, ptr, %"class.std::__cxx11::basic_string" }
%"class.nvinfer1::IPluginV2Ext" = type { %"class.nvinfer1::IPluginV2" }
%"class.nvinfer1::IPluginV2" = type { ptr }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<nvinfer1::plugin::GridAnchorParameters, std::allocator<nvinfer1::plugin::GridAnchorParameters>>::_Vector_impl" }
%"struct.std::_Vector_base<nvinfer1::plugin::GridAnchorParameters, std::allocator<nvinfer1::plugin::GridAnchorParameters>>::_Vector_impl" = type { %"struct.std::_Vector_base<nvinfer1::plugin::GridAnchorParameters, std::allocator<nvinfer1::plugin::GridAnchorParameters>>::_Vector_impl_data" }
%"struct.std::_Vector_base<nvinfer1::plugin::GridAnchorParameters, std::allocator<nvinfer1::plugin::GridAnchorParameters>>::_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] }

@_ZTISt9exception = external constant ptr

; 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

declare ptr @__cxa_begin_catch(ptr)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef ptr @_ZNK8nvinfer16plugin19GridAnchorGenerator5cloneEv(ptr noundef nonnull align 8 dereferenceable(128) %0) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %8 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  %9 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 128) #8
          to label %10 unwind label %25

10:                                               ; preds = %1
  %11 = getelementptr inbounds %"class.nvinfer1::plugin::GridAnchorGenerator", ptr %8, i32 0, i32 3
  %12 = call noundef ptr @_ZNKSt6vectorIN8nvinfer16plugin20GridAnchorParametersESaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #7
  %13 = getelementptr inbounds %"class.nvinfer1::plugin::GridAnchorGenerator", ptr %8, i32 0, i32 2
  %14 = load i32, ptr %13, align 8, !tbaa !9
  %15 = getelementptr inbounds %"class.nvinfer1::plugin::GridAnchorGenerator", ptr %8, i32 0, i32 1
  %16 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %15) #7
  invoke void @_ZN8nvinfer16plugin19GridAnchorGeneratorC1EPKNS0_20GridAnchorParametersEiPKc(ptr noundef nonnull align 8 dereferenceable(128) %9, ptr noundef %12, i32 noundef %14, ptr noundef %16)
          to label %17 unwind label %29

17:                                               ; preds = %10
  store ptr %9, ptr %4, align 8, !tbaa !5
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %"class.nvinfer1::plugin::GridAnchorGenerator", ptr %8, i32 0, i32 7
  %20 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %19) #7
  %21 = load ptr, ptr %18, align 8, !tbaa !21
  %22 = getelementptr inbounds ptr, ptr %21, i64 15
  %23 = load ptr, ptr %22, align 8
  call void %23(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef %20) #7
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %24, ptr %2, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  br label %45

25:                                               ; preds = %1
  %26 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
          catch ptr null
  %27 = extractvalue { ptr, i32 } %26, 0
  store ptr %27, ptr %5, align 8
  %28 = extractvalue { ptr, i32 } %26, 1
  store i32 %28, ptr %6, align 4
  br label %33

29:                                               ; preds = %10
  %30 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
          catch ptr null
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %5, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %6, align 4
  call void @_ZdlPvm(ptr noundef %9, i64 noundef 128) #9
  br label %33

33:                                               ; preds = %29, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  br label %34

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

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

42:                                               ; preds = %38
  invoke void @__cxa_end_catch()
          to label %43 unwind label %47

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

44:                                               ; preds = %43
  store ptr null, ptr %2, align 8
  br label %45

45:                                               ; preds = %44, %17
  %46 = load ptr, ptr %2, align 8
  ret ptr %46

47:                                               ; preds = %42, %38
  %48 = landingpad { ptr, i32 }
          catch ptr null
  %49 = extractvalue { ptr, i32 } %48, 0
  call void @__clang_call_terminate(ptr %49) #10
  unreachable

50:                                               ; preds = %34
  %51 = load ptr, ptr %5, align 8
  call void @__clang_call_terminate(ptr %51) #10
  unreachable
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #4

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

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

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

declare void @__cxa_end_catch()

declare void @_ZN8nvinfer16plugin19GridAnchorGeneratorC1EPKNS0_20GridAnchorParametersEiPKc(ptr, ptr, i32, ptr)

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 = { nobuiltin nounwind "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 = { nobuiltin allocsize(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 memory(none) }
attributes #6 = { 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 #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin nounwind }
attributes #10 = { 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, !16, i64 40}
!10 = !{!"_ZTSN8nvinfer16plugin19GridAnchorGeneratorE", !11, i64 0, !13, i64 8, !16, i64 40, !17, i64 48, !6, i64 72, !6, i64 80, !6, i64 88, !13, i64 96}
!11 = !{!"_ZTSN8nvinfer112IPluginV2ExtE", !12, i64 0}
!12 = !{!"_ZTSN8nvinfer19IPluginV2E"}
!13 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !14, i64 0, !15, i64 8, !7, i64 16}
!14 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!"_ZTSSt6vectorIN8nvinfer16plugin20GridAnchorParametersESaIS2_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIN8nvinfer16plugin20GridAnchorParametersESaIS2_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIN8nvinfer16plugin20GridAnchorParametersESaIS2_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIN8nvinfer16plugin20GridAnchorParametersESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!22, !22, i64 0}
!22 = !{!"vtable pointer", !8, 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"

@_ZTISt9exception = external constant ptr

declare i32 @__gxx_personality_v0(...)

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

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef ptr @_ZNK8nvinfer16plugin19GridAnchorGenerator5cloneEv(ptr noundef nonnull align 8 dereferenceable(128) %0) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = invoke noalias noundef nonnull dereferenceable(128) ptr @_Znwm(i64 noundef 128) #6
          to label %3 unwind label %16

3:                                                ; preds = %1
  %4 = getelementptr inbounds i8, ptr %0, i64 48
  %5 = tail call noundef ptr @_ZNKSt6vectorIN8nvinfer16plugin20GridAnchorParametersESaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %6 = getelementptr inbounds i8, ptr %0, i64 40
  %7 = load i32, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = tail call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  invoke void @_ZN8nvinfer16plugin19GridAnchorGeneratorC1EPKNS0_20GridAnchorParametersEiPKc(ptr noundef nonnull align 8 dereferenceable(128) %2, ptr noundef %5, i32 noundef %7, ptr noundef %9)
          to label %10 unwind label %18

10:                                               ; preds = %3
  %11 = getelementptr inbounds i8, ptr %0, i64 96
  %12 = tail call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  %13 = load ptr, ptr %2, align 8, !tbaa !20
  %14 = getelementptr inbounds i8, ptr %13, i64 120
  %15 = load ptr, ptr %14, align 8
  tail call void %15(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef %12) #7
  br label %26

16:                                               ; preds = %1
  %17 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
          catch ptr null
  br label %20

18:                                               ; preds = %3
  %19 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
          catch ptr null
  tail call void @_ZdlPvm(ptr noundef nonnull %2, i64 noundef 128) #8
  br label %20

20:                                               ; preds = %18, %16
  %.pn = phi { ptr, i32 } [ %19, %18 ], [ %17, %16 ]
  %.07 = extractvalue { ptr, i32 } %.pn, 1
  %.08 = extractvalue { ptr, i32 } %.pn, 0
  %21 = tail call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTISt9exception) #7
  %22 = icmp eq i32 %.07, %21
  br i1 %22, label %23, label %30

23:                                               ; preds = %20
  %24 = tail call ptr @__cxa_begin_catch(ptr %.08) #7
  invoke void @_ZN8nvinfer16plugin11caughtErrorERKSt9exception(ptr noundef nonnull align 8 dereferenceable(8) %24)
          to label %25 unwind label %27

25:                                               ; preds = %23
  invoke void @__cxa_end_catch()
          to label %26 unwind label %27

26:                                               ; preds = %25, %10
  %.0 = phi ptr [ %2, %10 ], [ null, %25 ]
  ret ptr %.0

27:                                               ; preds = %25, %23
  %28 = landingpad { ptr, i32 }
          catch ptr null
  %29 = extractvalue { ptr, i32 } %28, 0
  tail call void @__clang_call_terminate(ptr %29) #9
  unreachable

30:                                               ; preds = %20
  tail call void @__clang_call_terminate(ptr %.08) #9
  unreachable
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #3

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

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

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

declare void @__cxa_end_catch() local_unnamed_addr

declare void @_ZN8nvinfer16plugin19GridAnchorGeneratorC1EPKNS0_20GridAnchorParametersEiPKc(ptr, ptr, i32, ptr) local_unnamed_addr

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 = { nobuiltin nounwind "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 = { nobuiltin allocsize(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 = { nofree nosync nounwind memory(none) }
attributes #5 = { 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 #6 = { builtin allocsize(0) }
attributes #7 = { nounwind }
attributes #8 = { builtin nounwind }
attributes #9 = { 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, !15, i64 40}
!6 = !{!"_ZTSN8nvinfer16plugin19GridAnchorGeneratorE", !7, i64 0, !9, i64 8, !15, i64 40, !16, i64 48, !11, i64 72, !11, i64 80, !11, i64 88, !9, i64 96}
!7 = !{!"_ZTSN8nvinfer112IPluginV2ExtE", !8, i64 0}
!8 = !{!"_ZTSN8nvinfer19IPluginV2E"}
!9 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !10, i64 0, !14, i64 8, !12, i64 16}
!10 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !11, i64 0}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"long", !12, i64 0}
!15 = !{!"int", !12, i64 0}
!16 = !{!"_ZTSSt6vectorIN8nvinfer16plugin20GridAnchorParametersESaIS2_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseIN8nvinfer16plugin20GridAnchorParametersESaIS2_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIN8nvinfer16plugin20GridAnchorParametersESaIS2_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIN8nvinfer16plugin20GridAnchorParametersESaIS2_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!20 = !{!21, !21, i64 0}
!21 = !{!"vtable pointer", !13, i64 0}


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