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

; 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] }
%"class.nvinfer1::Weights" = type { i32, ptr, i64 }
%"struct.nvinfer1::plugin::GridAnchorParameters" = type { float, float, ptr, i32, i32, i32, [4 x float] }

@_ZTVN8nvinfer16plugin19GridAnchorGeneratorE = external dso_local unnamed_addr constant { [27 x ptr] }, align 8
@.str.4 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [63 x i8], align 1
@__func__._ZN8nvinfer16plugin19GridAnchorGeneratorD2Ev = external hidden unnamed_addr constant [21 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [38 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: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorIN8nvinfer16plugin20GridAnchorParametersESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN8nvinfer16plugin19GridAnchorGeneratorD2Ev(ptr noundef nonnull align 8 dereferenceable(128) %0) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %9 = load ptr, ptr %2, align 8
  store ptr getelementptr inbounds inrange(-16, 200) ({ [27 x ptr] }, ptr @_ZTVN8nvinfer16plugin19GridAnchorGeneratorE, i32 0, i32 0, i32 2), ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !11
  br label %10

10:                                               ; preds = %51, %1
  %11 = load i32, ptr %3, align 4, !tbaa !11
  %12 = getelementptr inbounds %"class.nvinfer1::plugin::GridAnchorGenerator", ptr %9, i32 0, i32 2
  %13 = load i32, ptr %12, align 8, !tbaa !13
  %14 = icmp slt i32 %11, %13
  br i1 %14, label %16, label %15

15:                                               ; preds = %10
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %54

16:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %17 = getelementptr inbounds %"class.nvinfer1::plugin::GridAnchorGenerator", ptr %9, i32 0, i32 5
  %18 = load ptr, ptr %17, align 8, !tbaa !24
  %19 = load i32, ptr %3, align 4, !tbaa !11
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds %"class.nvinfer1::Weights", ptr %18, i64 %20
  %22 = getelementptr inbounds %"class.nvinfer1::Weights", ptr %21, i32 0, i32 1
  %23 = load ptr, ptr %22, align 8, !tbaa !25
  %24 = invoke i32 @cudaFree(ptr noundef %23)
          to label %25 unwind label %85

25:                                               ; preds = %16
  store i32 %24, ptr %4, align 4, !tbaa !28
  %26 = load i32, ptr %4, align 4, !tbaa !28
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %28, label %30

28:                                               ; preds = %25
  invoke void @_ZN8nvinfer16plugin8logErrorEPKcS2_S2_i(ptr noundef @.str.7, ptr noundef @.str.4, ptr noundef @__func__._ZN8nvinfer16plugin19GridAnchorGeneratorD2Ev, i32 noundef 169)
          to label %29 unwind label %85

29:                                               ; preds = %28
  br label %30

30:                                               ; preds = %29, %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %31 = getelementptr inbounds %"class.nvinfer1::plugin::GridAnchorGenerator", ptr %9, i32 0, i32 6
  %32 = load ptr, ptr %31, align 8, !tbaa !30
  %33 = load i32, ptr %3, align 4, !tbaa !11
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds %"class.nvinfer1::Weights", ptr %32, i64 %34
  %36 = getelementptr inbounds %"class.nvinfer1::Weights", ptr %35, i32 0, i32 1
  %37 = load ptr, ptr %36, align 8, !tbaa !25
  %38 = invoke i32 @cudaFree(ptr noundef %37)
          to label %39 unwind label %85

39:                                               ; preds = %30
  store i32 %38, ptr %5, align 4, !tbaa !28
  %40 = load i32, ptr %5, align 4, !tbaa !28
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %42, label %44

42:                                               ; preds = %39
  invoke void @_ZN8nvinfer16plugin8logErrorEPKcS2_S2_i(ptr noundef @.str.8, ptr noundef @.str.4, ptr noundef @__func__._ZN8nvinfer16plugin19GridAnchorGeneratorD2Ev, i32 noundef 170)
          to label %43 unwind label %85

43:                                               ; preds = %42
  br label %44

44:                                               ; preds = %43, %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  %45 = getelementptr inbounds %"class.nvinfer1::plugin::GridAnchorGenerator", ptr %9, i32 0, i32 3
  %46 = load i32, ptr %3, align 4, !tbaa !11
  %47 = sext i32 %46 to i64
  %48 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorIN8nvinfer16plugin20GridAnchorParametersESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %45, i64 noundef %47) #5
  %49 = getelementptr inbounds %"struct.nvinfer1::plugin::GridAnchorParameters", ptr %48, i32 0, i32 2
  %50 = load ptr, ptr %49, align 8, !tbaa !31
  call void @free(ptr noundef %50) #5
  br label %51

51:                                               ; preds = %44
  %52 = load i32, ptr %3, align 4, !tbaa !11
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %3, align 4, !tbaa !11
  br label %10, !llvm.loop !34

54:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %55 = getelementptr inbounds %"class.nvinfer1::plugin::GridAnchorGenerator", ptr %9, i32 0, i32 4
  %56 = load ptr, ptr %55, align 8, !tbaa !36
  %57 = invoke i32 @cudaFreeHost(ptr noundef %56)
          to label %58 unwind label %85

58:                                               ; preds = %54
  store i32 %57, ptr %6, align 4, !tbaa !28
  %59 = load i32, ptr %6, align 4, !tbaa !28
  %60 = icmp ne i32 %59, 0
  br i1 %60, label %61, label %63

61:                                               ; preds = %58
  invoke void @_ZN8nvinfer16plugin8logErrorEPKcS2_S2_i(ptr noundef @.str.9, ptr noundef @.str.4, ptr noundef @__func__._ZN8nvinfer16plugin19GridAnchorGeneratorD2Ev, i32 noundef 173)
          to label %62 unwind label %85

62:                                               ; preds = %61
  br label %63

63:                                               ; preds = %62, %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %64 = getelementptr inbounds %"class.nvinfer1::plugin::GridAnchorGenerator", ptr %9, i32 0, i32 5
  %65 = load ptr, ptr %64, align 8, !tbaa !24
  %66 = invoke i32 @cudaFreeHost(ptr noundef %65)
          to label %67 unwind label %85

67:                                               ; preds = %63
  store i32 %66, ptr %7, align 4, !tbaa !28
  %68 = load i32, ptr %7, align 4, !tbaa !28
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %72

70:                                               ; preds = %67
  invoke void @_ZN8nvinfer16plugin8logErrorEPKcS2_S2_i(ptr noundef @.str.10, ptr noundef @.str.4, ptr noundef @__func__._ZN8nvinfer16plugin19GridAnchorGeneratorD2Ev, i32 noundef 174)
          to label %71 unwind label %85

71:                                               ; preds = %70
  br label %72

72:                                               ; preds = %71, %67
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %73 = getelementptr inbounds %"class.nvinfer1::plugin::GridAnchorGenerator", ptr %9, i32 0, i32 6
  %74 = load ptr, ptr %73, align 8, !tbaa !30
  %75 = invoke i32 @cudaFreeHost(ptr noundef %74)
          to label %76 unwind label %85

76:                                               ; preds = %72
  store i32 %75, ptr %8, align 4, !tbaa !28
  %77 = load i32, ptr %8, align 4, !tbaa !28
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %79, label %81

79:                                               ; preds = %76
  invoke void @_ZN8nvinfer16plugin8logErrorEPKcS2_S2_i(ptr noundef @.str.11, ptr noundef @.str.4, ptr noundef @__func__._ZN8nvinfer16plugin19GridAnchorGeneratorD2Ev, i32 noundef 175)
          to label %80 unwind label %85

80:                                               ; preds = %79
  br label %81

81:                                               ; preds = %80, %76
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  %82 = getelementptr inbounds %"class.nvinfer1::plugin::GridAnchorGenerator", ptr %9, i32 0, i32 7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %82) #5
  %83 = getelementptr inbounds %"class.nvinfer1::plugin::GridAnchorGenerator", ptr %9, i32 0, i32 3
  call void @_ZNSt6vectorIN8nvinfer16plugin20GridAnchorParametersESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %83) #5
  %84 = getelementptr inbounds %"class.nvinfer1::plugin::GridAnchorGenerator", ptr %9, i32 0, i32 1
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %84) #5
  call void @_ZN8nvinfer19IPluginV2D2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  ret void

85:                                               ; preds = %79, %72, %70, %63, %61, %54, %42, %30, %28, %16
  %86 = landingpad { ptr, i32 }
          catch ptr null
  %87 = extractvalue { ptr, i32 } %86, 0
  call void @__clang_call_terminate(ptr %87) #6
  unreachable
}

declare i32 @cudaFree(ptr noundef) #2

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

declare void @_ZN8nvinfer16plugin8logErrorEPKcS2_S2_i(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #2

; Function Attrs: nounwind
declare void @free(ptr noundef) #4

declare i32 @cudaFreeHost(ptr noundef) #2

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

attributes #0 = { nocallback nofree nosync 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 = { "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 = { 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 = { 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 #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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 40}
!14 = !{!"_ZTSN8nvinfer16plugin19GridAnchorGeneratorE", !15, i64 0, !17, i64 8, !12, i64 40, !20, i64 48, !6, i64 72, !6, i64 80, !6, i64 88, !17, i64 96}
!15 = !{!"_ZTSN8nvinfer112IPluginV2ExtE", !16, i64 0}
!16 = !{!"_ZTSN8nvinfer19IPluginV2E"}
!17 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !18, i64 0, !19, i64 8, !7, i64 16}
!18 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!19 = !{!"long", !7, i64 0}
!20 = !{!"_ZTSSt6vectorIN8nvinfer16plugin20GridAnchorParametersESaIS2_EE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseIN8nvinfer16plugin20GridAnchorParametersESaIS2_EE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIN8nvinfer16plugin20GridAnchorParametersESaIS2_EE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIN8nvinfer16plugin20GridAnchorParametersESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!24 = !{!14, !6, i64 80}
!25 = !{!26, !6, i64 8}
!26 = !{!"_ZTSN8nvinfer17WeightsE", !27, i64 0, !6, i64 8, !19, i64 16}
!27 = !{!"_ZTSN8nvinfer18DataTypeE", !7, i64 0}
!28 = !{!29, !29, i64 0}
!29 = !{!"_ZTS9cudaError", !7, i64 0}
!30 = !{!14, !6, i64 88}
!31 = !{!32, !6, i64 8}
!32 = !{!"_ZTSN8nvinfer16plugin20GridAnchorParametersE", !33, i64 0, !33, i64 4, !6, i64 8, !12, i64 16, !12, i64 20, !12, i64 24, !7, i64 28}
!33 = !{!"float", !7, i64 0}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}
!36 = !{!14, !6, 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"

%"class.nvinfer1::Weights" = type { i32, ptr, i64 }

@_ZTVN8nvinfer16plugin19GridAnchorGeneratorE = external dso_local unnamed_addr constant { [27 x ptr] }, align 8
@.str.4 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [63 x i8], align 1
@__func__._ZN8nvinfer16plugin19GridAnchorGeneratorD2Ev = external hidden unnamed_addr constant [21 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [38 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorIN8nvinfer16plugin20GridAnchorParametersESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN8nvinfer16plugin19GridAnchorGeneratorD2Ev(ptr noundef nonnull align 8 dereferenceable(128) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  store ptr getelementptr inbounds inrange(-16, 200) (i8, ptr @_ZTVN8nvinfer16plugin19GridAnchorGeneratorE, i64 16), ptr %0, align 8, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %0, i64 40
  %3 = load i32, ptr %2, align 8, !tbaa !8
  %4 = icmp sgt i32 %3, 0
  br i1 %4, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %1
  %5 = getelementptr inbounds i8, ptr %0, i64 80
  %6 = getelementptr inbounds i8, ptr %0, i64 88
  %7 = getelementptr inbounds i8, ptr %0, i64 48
  br label %11

._crit_edge:                                      ; preds = %25, %1
  %8 = getelementptr inbounds i8, ptr %0, i64 72
  %9 = load ptr, ptr %8, align 8, !tbaa !22
  %10 = invoke i32 @cudaFreeHost(ptr noundef %9)
          to label %32 unwind label %.loopexit.split-lp

11:                                               ; preds = %.lr.ph, %25
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %25 ]
  %12 = load ptr, ptr %5, align 8, !tbaa !23
  %13 = getelementptr inbounds %"class.nvinfer1::Weights", ptr %12, i64 %indvars.iv, i32 1
  %14 = load ptr, ptr %13, align 8, !tbaa !24
  %15 = invoke i32 @cudaFree(ptr noundef %14)
          to label %16 unwind label %.loopexit

16:                                               ; preds = %11
  %.not12 = icmp eq i32 %15, 0
  br i1 %.not12, label %18, label %17

17:                                               ; preds = %16
  invoke void @_ZN8nvinfer16plugin8logErrorEPKcS2_S2_i(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.4, ptr noundef nonnull @__func__._ZN8nvinfer16plugin19GridAnchorGeneratorD2Ev, i32 noundef 169)
          to label %18 unwind label %.loopexit

18:                                               ; preds = %17, %16
  %19 = load ptr, ptr %6, align 8, !tbaa !27
  %20 = getelementptr inbounds %"class.nvinfer1::Weights", ptr %19, i64 %indvars.iv, i32 1
  %21 = load ptr, ptr %20, align 8, !tbaa !24
  %22 = invoke i32 @cudaFree(ptr noundef %21)
          to label %23 unwind label %.loopexit

23:                                               ; preds = %18
  %.not13 = icmp eq i32 %22, 0
  br i1 %.not13, label %25, label %24

24:                                               ; preds = %23
  invoke void @_ZN8nvinfer16plugin8logErrorEPKcS2_S2_i(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.4, ptr noundef nonnull @__func__._ZN8nvinfer16plugin19GridAnchorGeneratorD2Ev, i32 noundef 170)
          to label %25 unwind label %.loopexit

25:                                               ; preds = %24, %23
  %26 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorIN8nvinfer16plugin20GridAnchorParametersESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %indvars.iv) #4
  %27 = getelementptr inbounds i8, ptr %26, i64 8
  %28 = load ptr, ptr %27, align 8, !tbaa !28
  tail call void @free(ptr noundef %28) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %29 = load i32, ptr %2, align 8, !tbaa !8
  %30 = sext i32 %29 to i64
  %31 = icmp slt i64 %indvars.iv.next, %30
  br i1 %31, label %11, label %._crit_edge, !llvm.loop !31

32:                                               ; preds = %._crit_edge
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %34, label %33

33:                                               ; preds = %32
  invoke void @_ZN8nvinfer16plugin8logErrorEPKcS2_S2_i(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.4, ptr noundef nonnull @__func__._ZN8nvinfer16plugin19GridAnchorGeneratorD2Ev, i32 noundef 173)
          to label %34 unwind label %.loopexit.split-lp

34:                                               ; preds = %33, %32
  %35 = getelementptr inbounds i8, ptr %0, i64 80
  %36 = load ptr, ptr %35, align 8, !tbaa !23
  %37 = invoke i32 @cudaFreeHost(ptr noundef %36)
          to label %38 unwind label %.loopexit.split-lp

38:                                               ; preds = %34
  %.not10 = icmp eq i32 %37, 0
  br i1 %.not10, label %40, label %39

39:                                               ; preds = %38
  invoke void @_ZN8nvinfer16plugin8logErrorEPKcS2_S2_i(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.4, ptr noundef nonnull @__func__._ZN8nvinfer16plugin19GridAnchorGeneratorD2Ev, i32 noundef 174)
          to label %40 unwind label %.loopexit.split-lp

40:                                               ; preds = %39, %38
  %41 = getelementptr inbounds i8, ptr %0, i64 88
  %42 = load ptr, ptr %41, align 8, !tbaa !27
  %43 = invoke i32 @cudaFreeHost(ptr noundef %42)
          to label %44 unwind label %.loopexit.split-lp

44:                                               ; preds = %40
  %.not11 = icmp eq i32 %43, 0
  br i1 %.not11, label %46, label %45

45:                                               ; preds = %44
  invoke void @_ZN8nvinfer16plugin8logErrorEPKcS2_S2_i(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.4, ptr noundef nonnull @__func__._ZN8nvinfer16plugin19GridAnchorGeneratorD2Ev, i32 noundef 175)
          to label %46 unwind label %.loopexit.split-lp

46:                                               ; preds = %45, %44
  %47 = getelementptr inbounds i8, ptr %0, i64 96
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %47) #4
  %48 = getelementptr inbounds i8, ptr %0, i64 48
  tail call void @_ZNSt6vectorIN8nvinfer16plugin20GridAnchorParametersESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %48) #4
  %49 = getelementptr inbounds i8, ptr %0, i64 8
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %49) #4
  tail call void @_ZN8nvinfer19IPluginV2D2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #4
  ret void

.loopexit:                                        ; preds = %11, %17, %18, %24
  %lpad.loopexit = landingpad { ptr, i32 }
          catch ptr null
  br label %50

.loopexit.split-lp:                               ; preds = %._crit_edge, %33, %34, %39, %40, %45
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          catch ptr null
  br label %50

50:                                               ; preds = %.loopexit.split-lp, %.loopexit
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  %51 = extractvalue { ptr, i32 } %lpad.phi, 0
  tail call void @__clang_call_terminate(ptr %51) #5
  unreachable
}

declare i32 @cudaFree(ptr noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3

declare i32 @cudaFreeHost(ptr noundef) local_unnamed_addr #1

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

attributes #0 = { 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 #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 = { 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 willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !17, i64 40}
!9 = !{!"_ZTSN8nvinfer16plugin19GridAnchorGeneratorE", !10, i64 0, !12, i64 8, !17, i64 40, !18, i64 48, !14, i64 72, !14, i64 80, !14, i64 88, !12, i64 96}
!10 = !{!"_ZTSN8nvinfer112IPluginV2ExtE", !11, i64 0}
!11 = !{!"_ZTSN8nvinfer19IPluginV2E"}
!12 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !13, i64 0, !16, i64 8, !15, i64 16}
!13 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !14, i64 0}
!14 = !{!"any pointer", !15, i64 0}
!15 = !{!"omnipotent char", !7, i64 0}
!16 = !{!"long", !15, i64 0}
!17 = !{!"int", !15, i64 0}
!18 = !{!"_ZTSSt6vectorIN8nvinfer16plugin20GridAnchorParametersESaIS2_EE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIN8nvinfer16plugin20GridAnchorParametersESaIS2_EE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIN8nvinfer16plugin20GridAnchorParametersESaIS2_EE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIN8nvinfer16plugin20GridAnchorParametersESaIS2_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!22 = !{!9, !14, i64 72}
!23 = !{!9, !14, i64 80}
!24 = !{!25, !14, i64 8}
!25 = !{!"_ZTSN8nvinfer17WeightsE", !26, i64 0, !14, i64 8, !16, i64 16}
!26 = !{!"_ZTSN8nvinfer18DataTypeE", !15, i64 0}
!27 = !{!9, !14, i64 88}
!28 = !{!29, !14, i64 8}
!29 = !{!"_ZTSN8nvinfer16plugin20GridAnchorParametersE", !30, i64 0, !30, i64 4, !14, i64 8, !17, i64 16, !17, i64 20, !17, i64 24, !15, i64 28}
!30 = !{!"float", !15, i64 0}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass