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

; 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::MultilevelCropAndResize" = type <{ %"class.nvinfer1::IPluginV2Ext", %struct.xy_t, i32, i32, float, i32, i32, [5 x %struct.xy_t], [4 x i8], %"class.std::__cxx11::basic_string", i32, [4 x i8] }>
%"class.nvinfer1::IPluginV2Ext" = type { %"class.nvinfer1::IPluginV2" }
%"class.nvinfer1::IPluginV2" = type { ptr }
%struct.xy_t = type { i32, i32 }
%"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] }

@.str.98 = external hidden unnamed_addr constant [120 x i8], align 1
@.str.109 = external hidden unnamed_addr constant [32 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: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #1

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZNK8nvinfer16plugin23MultilevelCropAndResize9serializeEPv(ptr noundef nonnull align 8 dereferenceable(116) %0, ptr noundef %1) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %8 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %9, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %10 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %10, ptr %6, align 8, !tbaa !5
  %11 = getelementptr inbounds %"class.nvinfer1::plugin::MultilevelCropAndResize", ptr %8, i32 0, i32 1
  %12 = getelementptr inbounds %struct.xy_t, ptr %11, i32 0, i32 0
  invoke void @_ZN8nvinfer16plugin5writeIicEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %13 unwind label %61

13:                                               ; preds = %2
  %14 = getelementptr inbounds %"class.nvinfer1::plugin::MultilevelCropAndResize", ptr %8, i32 0, i32 1
  %15 = getelementptr inbounds %struct.xy_t, ptr %14, i32 0, i32 1
  invoke void @_ZN8nvinfer16plugin5writeIicEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %16 unwind label %61

16:                                               ; preds = %13
  %17 = getelementptr inbounds %"class.nvinfer1::plugin::MultilevelCropAndResize", ptr %8, i32 0, i32 2
  invoke void @_ZN8nvinfer16plugin5writeIicEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %17)
          to label %18 unwind label %61

18:                                               ; preds = %16
  %19 = getelementptr inbounds %"class.nvinfer1::plugin::MultilevelCropAndResize", ptr %8, i32 0, i32 3
  invoke void @_ZN8nvinfer16plugin5writeIicEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %19)
          to label %20 unwind label %61

20:                                               ; preds = %18
  %21 = getelementptr inbounds %"class.nvinfer1::plugin::MultilevelCropAndResize", ptr %8, i32 0, i32 5
  invoke void @_ZN8nvinfer16plugin5writeIicEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %21)
          to label %22 unwind label %61

22:                                               ; preds = %20
  %23 = getelementptr inbounds %"class.nvinfer1::plugin::MultilevelCropAndResize", ptr %8, i32 0, i32 6
  invoke void @_ZN8nvinfer16plugin5writeIicEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %23)
          to label %24 unwind label %61

24:                                               ; preds = %22
  %25 = getelementptr inbounds %"class.nvinfer1::plugin::MultilevelCropAndResize", ptr %8, i32 0, i32 4
  invoke void @_ZN8nvinfer16plugin5writeIfcEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %25)
          to label %26 unwind label %61

26:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %27

27:                                               ; preds = %44, %26
  %28 = load i32, ptr %7, align 4, !tbaa !9
  %29 = icmp slt i32 %28, 5
  br i1 %29, label %31, label %30

30:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %47

31:                                               ; preds = %27
  %32 = getelementptr inbounds %"class.nvinfer1::plugin::MultilevelCropAndResize", ptr %8, i32 0, i32 7
  %33 = load i32, ptr %7, align 4, !tbaa !9
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [5 x %struct.xy_t], ptr %32, i64 0, i64 %34
  %36 = getelementptr inbounds %struct.xy_t, ptr %35, i32 0, i32 0
  invoke void @_ZN8nvinfer16plugin5writeIicEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %36)
          to label %37 unwind label %61

37:                                               ; preds = %31
  %38 = getelementptr inbounds %"class.nvinfer1::plugin::MultilevelCropAndResize", ptr %8, i32 0, i32 7
  %39 = load i32, ptr %7, align 4, !tbaa !9
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [5 x %struct.xy_t], ptr %38, i64 0, i64 %40
  %42 = getelementptr inbounds %struct.xy_t, ptr %41, i32 0, i32 1
  invoke void @_ZN8nvinfer16plugin5writeIicEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %42)
          to label %43 unwind label %61

43:                                               ; preds = %37
  br label %44

44:                                               ; preds = %43
  %45 = load i32, ptr %7, align 4, !tbaa !9
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %7, align 4, !tbaa !9
  br label %27, !llvm.loop !11

47:                                               ; preds = %30
  %48 = getelementptr inbounds %"class.nvinfer1::plugin::MultilevelCropAndResize", ptr %8, i32 0, i32 10
  invoke void @_ZN8nvinfer16plugin5writeINS_8DataTypeEcEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %48)
          to label %49 unwind label %61

49:                                               ; preds = %47
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = load ptr, ptr %8, align 8, !tbaa !13
  %53 = getelementptr inbounds ptr, ptr %52, i64 11
  %54 = load ptr, ptr %53, align 8
  %55 = call noundef i64 %54(ptr noundef nonnull align 8 dereferenceable(116) %8) #4
  %56 = getelementptr inbounds i8, ptr %51, i64 %55
  %57 = icmp eq ptr %50, %56
  br i1 %57, label %60, label %58

58:                                               ; preds = %49
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef @.str.109, ptr noundef @.str.98, i32 noundef 264)
          to label %59 unwind label %61

59:                                               ; preds = %58
  br label %60

60:                                               ; preds = %59, %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret void

61:                                               ; preds = %58, %47, %37, %31, %24, %22, %20, %18, %16, %13, %2
  %62 = landingpad { ptr, i32 }
          catch ptr null
  %63 = extractvalue { ptr, i32 } %62, 0
  call void @__clang_call_terminate(ptr %63) #5
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8nvinfer16plugin5writeIicEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8nvinfer16plugin5writeIfcEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8nvinfer16plugin5writeINS_8DataTypeEcEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #3

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 = { "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 = { 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 = !{!"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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"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"

@.str.98 = external hidden unnamed_addr constant [120 x i8], align 1
@.str.109 = external hidden unnamed_addr constant [32 x i8], align 1

; Function Attrs: mustprogress 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: mustprogress 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) local_unnamed_addr #1

declare void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZNK8nvinfer16plugin23MultilevelCropAndResize9serializeEPv(ptr noundef nonnull align 8 dereferenceable(116) %0, ptr noundef %1) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  store ptr %1, ptr %3, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  call void @_ZN8nvinfer16plugin5writeIicEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %5 = getelementptr inbounds i8, ptr %0, i64 12
  call void @_ZN8nvinfer16plugin5writeIicEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %6 = getelementptr inbounds i8, ptr %0, i64 16
  call void @_ZN8nvinfer16plugin5writeIicEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %7 = getelementptr inbounds i8, ptr %0, i64 20
  call void @_ZN8nvinfer16plugin5writeIicEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %8 = getelementptr inbounds i8, ptr %0, i64 28
  call void @_ZN8nvinfer16plugin5writeIicEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %9 = getelementptr inbounds i8, ptr %0, i64 32
  call void @_ZN8nvinfer16plugin5writeIicEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %10 = getelementptr inbounds i8, ptr %0, i64 24
  call void @_ZN8nvinfer16plugin5writeIfcEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %11 = getelementptr inbounds i8, ptr %0, i64 36
  call void @_ZN8nvinfer16plugin5writeIicEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %12 = getelementptr inbounds i8, ptr %0, i64 40
  call void @_ZN8nvinfer16plugin5writeIicEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %13 = getelementptr inbounds i8, ptr %0, i64 44
  call void @_ZN8nvinfer16plugin5writeIicEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %14 = getelementptr inbounds i8, ptr %0, i64 48
  call void @_ZN8nvinfer16plugin5writeIicEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %15 = getelementptr inbounds i8, ptr %0, i64 52
  call void @_ZN8nvinfer16plugin5writeIicEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %16 = getelementptr inbounds i8, ptr %0, i64 56
  call void @_ZN8nvinfer16plugin5writeIicEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %16)
  %17 = getelementptr inbounds i8, ptr %0, i64 60
  call void @_ZN8nvinfer16plugin5writeIicEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %18 = getelementptr inbounds i8, ptr %0, i64 64
  call void @_ZN8nvinfer16plugin5writeIicEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %18)
  %19 = getelementptr inbounds i8, ptr %0, i64 68
  call void @_ZN8nvinfer16plugin5writeIicEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %19)
  %20 = getelementptr inbounds i8, ptr %0, i64 72
  call void @_ZN8nvinfer16plugin5writeIicEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %20)
  %21 = getelementptr inbounds i8, ptr %0, i64 112
  call void @_ZN8nvinfer16plugin5writeINS_8DataTypeEcEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %21)
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = load ptr, ptr %0, align 8, !tbaa !9
  %24 = getelementptr inbounds i8, ptr %23, i64 88
  %25 = load ptr, ptr %24, align 8
  %26 = call noundef i64 %25(ptr noundef nonnull align 8 dereferenceable(116) %0) #4
  %27 = getelementptr inbounds i8, ptr %1, i64 %26
  %28 = icmp eq ptr %22, %27
  br i1 %28, label %30, label %29

29:                                               ; preds = %2
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef nonnull @.str.109, ptr noundef nonnull @.str.98, i32 noundef 264)
          to label %30 unwind label %31

30:                                               ; preds = %29, %2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  ret void

31:                                               ; preds = %29
  %32 = landingpad { ptr, i32 }
          catch ptr null
  %33 = extractvalue { ptr, i32 } %32, 0
  call void @__clang_call_terminate(ptr %33) #5
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8nvinfer16plugin5writeIicEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8nvinfer16plugin5writeIfcEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8nvinfer16plugin5writeINS_8DataTypeEcEEvRPT0_RKT_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

attributes #0 = { mustprogress 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 = { "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 = { 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 = !{!"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}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,SROAPass,SimplifyCFGPass