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

; 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::DynamicPluginTensorDesc" = type { %"struct.nvinfer1::PluginTensorDesc", %"class.nvinfer1::Dims64", %"class.nvinfer1::Dims64", %"class.nvinfer1::Dims64" }
%"struct.nvinfer1::PluginTensorDesc" = type { %"class.nvinfer1::Dims64", i32, i32, float }
%"class.nvinfer1::Dims64" = type { i32, [8 x i64] }
%"class.nvinfer1::plugin::CropAndResizeDynamicPlugin" = type { %"class.nvinfer1::IPluginV2DynamicExt", i32, 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] }

@.str.2 = external hidden unnamed_addr constant [100 x i8], align 1
@_ZTISt9exception = external constant ptr
@.str.11 = external hidden unnamed_addr constant [14 x i8], align 1
@__func__._ZN8nvinfer16plugin19CropAndResizePlugin15configurePluginEPKNS_6Dims64EiS4_iPKNS_8DataTypeES7_PKbS9_NS_12TensorFormatEi = external hidden unnamed_addr constant [16 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [15 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: noreturn
declare void @_ZN8nvinfer16plugin16throwPluginErrorEPKcS2_iiS2_(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef) #1

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

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

declare ptr @__cxa_begin_catch(ptr)

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

declare void @__cxa_end_catch()

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN8nvinfer16plugin26CropAndResizeDynamicPlugin15configurePluginEPKNS_23DynamicPluginTensorDescEiS4_i(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, i32 noundef %4) unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  store i32 %4, ptr %10, align 4, !tbaa !9
  %14 = load ptr, ptr %6, align 8
  %15 = load i32, ptr %8, align 4, !tbaa !9
  %16 = icmp eq i32 %15, 2
  br i1 %16, label %34, label %17

17:                                               ; preds = %5
  invoke void @_ZN8nvinfer16plugin16throwPluginErrorEPKcS2_iiS2_(ptr noundef @.str.2, ptr noundef @__func__._ZN8nvinfer16plugin19CropAndResizePlugin15configurePluginEPKNS_6Dims64EiS4_iPKNS_8DataTypeES7_PKbS9_NS_12TensorFormatEi, i32 noundef 482, i32 noundef 0, ptr noundef @.str.11) #6
          to label %18 unwind label %19

18:                                               ; preds = %17
  unreachable

19:                                               ; preds = %37, %17
  %20 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
          catch ptr null
  %21 = extractvalue { ptr, i32 } %20, 0
  store ptr %21, ptr %11, align 8
  %22 = extractvalue { ptr, i32 } %20, 1
  store i32 %22, ptr %12, align 4
  br label %23

23:                                               ; preds = %19
  %24 = load i32, ptr %12, align 4
  %25 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTISt9exception) #7
  %26 = icmp eq i32 %24, %25
  br i1 %26, label %27, label %79

27:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %28 = load ptr, ptr %11, align 8
  %29 = call ptr @__cxa_begin_catch(ptr %28) #7
  store ptr %29, ptr %13, align 8
  %30 = load ptr, ptr %13, align 8, !tbaa !5
  invoke void @_ZN8nvinfer16plugin11caughtErrorERKSt9exception(ptr noundef nonnull align 8 dereferenceable(8) %30)
          to label %31 unwind label %76

31:                                               ; preds = %27
  invoke void @__cxa_end_catch()
          to label %32 unwind label %76

32:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %33

33:                                               ; preds = %39, %32
  ret void

34:                                               ; preds = %5
  %35 = load i32, ptr %10, align 4, !tbaa !9
  %36 = icmp eq i32 %35, 1
  br i1 %36, label %39, label %37

37:                                               ; preds = %34
  invoke void @_ZN8nvinfer16plugin16throwPluginErrorEPKcS2_iiS2_(ptr noundef @.str.2, ptr noundef @__func__._ZN8nvinfer16plugin19CropAndResizePlugin15configurePluginEPKNS_6Dims64EiS4_iPKNS_8DataTypeES7_PKbS9_NS_12TensorFormatEi, i32 noundef 483, i32 noundef 0, ptr noundef @.str.20) #6
          to label %38 unwind label %19

38:                                               ; preds = %37
  unreachable

39:                                               ; preds = %34
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = getelementptr inbounds %"struct.nvinfer1::DynamicPluginTensorDesc", ptr %40, i64 0
  %42 = getelementptr inbounds %"struct.nvinfer1::DynamicPluginTensorDesc", ptr %41, i32 0, i32 0
  %43 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %42, i32 0, i32 0
  %44 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %43, i32 0, i32 1
  %45 = getelementptr inbounds [8 x i64], ptr %44, i64 0, i64 1
  %46 = load i64, ptr %45, align 8, !tbaa !11
  %47 = trunc i64 %46 to i32
  %48 = getelementptr inbounds %"class.nvinfer1::plugin::CropAndResizeDynamicPlugin", ptr %14, i32 0, i32 3
  store i32 %47, ptr %48, align 8, !tbaa !13
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = getelementptr inbounds %"struct.nvinfer1::DynamicPluginTensorDesc", ptr %49, i64 0
  %51 = getelementptr inbounds %"struct.nvinfer1::DynamicPluginTensorDesc", ptr %50, i32 0, i32 0
  %52 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %51, i32 0, i32 0
  %53 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %52, i32 0, i32 1
  %54 = getelementptr inbounds [8 x i64], ptr %53, i64 0, i64 2
  %55 = load i64, ptr %54, align 8, !tbaa !11
  %56 = trunc i64 %55 to i32
  %57 = getelementptr inbounds %"class.nvinfer1::plugin::CropAndResizeDynamicPlugin", ptr %14, i32 0, i32 5
  store i32 %56, ptr %57, align 8, !tbaa !20
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  %59 = getelementptr inbounds %"struct.nvinfer1::DynamicPluginTensorDesc", ptr %58, i64 0
  %60 = getelementptr inbounds %"struct.nvinfer1::DynamicPluginTensorDesc", ptr %59, i32 0, i32 0
  %61 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %60, i32 0, i32 0
  %62 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %61, i32 0, i32 1
  %63 = getelementptr inbounds [8 x i64], ptr %62, i64 0, i64 3
  %64 = load i64, ptr %63, align 8, !tbaa !11
  %65 = trunc i64 %64 to i32
  %66 = getelementptr inbounds %"class.nvinfer1::plugin::CropAndResizeDynamicPlugin", ptr %14, i32 0, i32 4
  store i32 %65, ptr %66, align 4, !tbaa !21
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = getelementptr inbounds %"struct.nvinfer1::DynamicPluginTensorDesc", ptr %67, i64 1
  %69 = getelementptr inbounds %"struct.nvinfer1::DynamicPluginTensorDesc", ptr %68, i32 0, i32 0
  %70 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %69, i32 0, i32 0
  %71 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %70, i32 0, i32 1
  %72 = getelementptr inbounds [8 x i64], ptr %71, i64 0, i64 1
  %73 = load i64, ptr %72, align 8, !tbaa !11
  %74 = trunc i64 %73 to i32
  %75 = getelementptr inbounds %"class.nvinfer1::plugin::CropAndResizeDynamicPlugin", ptr %14, i32 0, i32 6
  store i32 %74, ptr %75, align 4, !tbaa !22
  br label %33

76:                                               ; preds = %31, %27
  %77 = landingpad { ptr, i32 }
          catch ptr null
  %78 = extractvalue { ptr, i32 } %77, 0
  call void @__clang_call_terminate(ptr %78) #8
  unreachable

79:                                               ; preds = %23
  %80 = load ptr, ptr %11, align 8
  call void @__clang_call_terminate(ptr %80) #8
  unreachable
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn "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 = { nounwind memory(none) }
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 = { 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 #5 = { 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 #6 = { noreturn }
attributes #7 = { nounwind }
attributes #8 = { 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 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !10, i64 16}
!14 = !{!"_ZTSN8nvinfer16plugin26CropAndResizeDynamicPluginE", !15, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !18, i64 32}
!15 = !{!"_ZTSN8nvinfer119IPluginV2DynamicExtE", !16, i64 0}
!16 = !{!"_ZTSN8nvinfer112IPluginV2ExtE", !17, i64 0}
!17 = !{!"_ZTSN8nvinfer19IPluginV2E"}
!18 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !19, i64 0, !12, i64 8, !7, i64 16}
!19 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!20 = !{!14, !10, i64 24}
!21 = !{!14, !10, i64 20}
!22 = !{!14, !10, i64 28}


; 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.2 = external hidden unnamed_addr constant [100 x i8], align 1
@_ZTISt9exception = external constant ptr
@.str.11 = external hidden unnamed_addr constant [14 x i8], align 1
@__func__._ZN8nvinfer16plugin19CropAndResizePlugin15configurePluginEPKNS_6Dims64EiS4_iPKNS_8DataTypeES7_PKbS9_NS_12TensorFormatEi = external hidden unnamed_addr constant [16 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [15 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: noreturn
declare void @_ZN8nvinfer16plugin16throwPluginErrorEPKcS2_iiS2_(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

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

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

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

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

declare void @__cxa_end_catch() local_unnamed_addr

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN8nvinfer16plugin26CropAndResizeDynamicPlugin15configurePluginEPKNS_23DynamicPluginTensorDescEiS4_i(ptr nocapture noundef nonnull writeonly align 8 dereferenceable(64) %0, ptr nocapture noundef readonly %1, i32 noundef %2, ptr nocapture noundef readnone %3, i32 noundef %4) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %6 = icmp eq i32 %2, 2
  br i1 %6, label %17, label %.invoke

7:                                                ; preds = %.invoke
  %8 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
          catch ptr null
  %9 = extractvalue { ptr, i32 } %8, 0
  %10 = extractvalue { ptr, i32 } %8, 1
  %11 = tail call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTISt9exception) #5
  %12 = icmp eq i32 %10, %11
  br i1 %12, label %13, label %41

13:                                               ; preds = %7
  %14 = tail call ptr @__cxa_begin_catch(ptr %9) #5
  invoke void @_ZN8nvinfer16plugin11caughtErrorERKSt9exception(ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %15 unwind label %38

15:                                               ; preds = %13
  invoke void @__cxa_end_catch()
          to label %16 unwind label %38

16:                                               ; preds = %15, %21
  ret void

17:                                               ; preds = %5
  %18 = icmp eq i32 %4, 1
  br i1 %18, label %21, label %.invoke

.invoke:                                          ; preds = %5, %17
  %19 = phi i32 [ 483, %17 ], [ 482, %5 ]
  %20 = phi ptr [ @.str.20, %17 ], [ @.str.11, %5 ]
  invoke void @_ZN8nvinfer16plugin16throwPluginErrorEPKcS2_iiS2_(ptr noundef nonnull @.str.2, ptr noundef nonnull @__func__._ZN8nvinfer16plugin19CropAndResizePlugin15configurePluginEPKNS_6Dims64EiS4_iPKNS_8DataTypeES7_PKbS9_NS_12TensorFormatEi, i32 noundef %19, i32 noundef 0, ptr noundef nonnull %20) #6
          to label %.cont unwind label %7

.cont:                                            ; preds = %.invoke
  unreachable

21:                                               ; preds = %17
  %22 = getelementptr inbounds i8, ptr %1, i64 16
  %23 = load i64, ptr %22, align 8, !tbaa !5
  %24 = trunc i64 %23 to i32
  %25 = getelementptr inbounds i8, ptr %0, i64 16
  store i32 %24, ptr %25, align 8, !tbaa !9
  %26 = getelementptr inbounds i8, ptr %1, i64 24
  %27 = load i64, ptr %26, align 8, !tbaa !5
  %28 = trunc i64 %27 to i32
  %29 = getelementptr inbounds i8, ptr %0, i64 24
  store i32 %28, ptr %29, align 8, !tbaa !18
  %30 = getelementptr inbounds i8, ptr %1, i64 32
  %31 = load i64, ptr %30, align 8, !tbaa !5
  %32 = trunc i64 %31 to i32
  %33 = getelementptr inbounds i8, ptr %0, i64 20
  store i32 %32, ptr %33, align 4, !tbaa !19
  %34 = getelementptr inbounds i8, ptr %1, i64 320
  %35 = load i64, ptr %34, align 8, !tbaa !5
  %36 = trunc i64 %35 to i32
  %37 = getelementptr inbounds i8, ptr %0, i64 28
  store i32 %36, ptr %37, align 4, !tbaa !20
  br label %16

38:                                               ; preds = %15, %13
  %39 = landingpad { ptr, i32 }
          catch ptr null
  %40 = extractvalue { ptr, i32 } %39, 0
  tail call void @__clang_call_terminate(ptr %40) #7
  unreachable

41:                                               ; preds = %7
  tail call void @__clang_call_terminate(ptr %9) #7
  unreachable
}

attributes #0 = { noreturn "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 = { nofree nosync nounwind memory(none) }
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 = { 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 #4 = { 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 #5 = { nounwind }
attributes #6 = { noreturn }
attributes #7 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !14, i64 16}
!10 = !{!"_ZTSN8nvinfer16plugin26CropAndResizeDynamicPluginE", !11, i64 0, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !15, i64 32}
!11 = !{!"_ZTSN8nvinfer119IPluginV2DynamicExtE", !12, i64 0}
!12 = !{!"_ZTSN8nvinfer112IPluginV2ExtE", !13, i64 0}
!13 = !{!"_ZTSN8nvinfer19IPluginV2E"}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !16, i64 0, !6, i64 8, !7, i64 16}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !17, i64 0}
!17 = !{!"any pointer", !7, i64 0}
!18 = !{!10, !14, i64 24}
!19 = !{!10, !14, i64 20}
!20 = !{!10, !14, i64 28}


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