; LLVM IR from NVIDIA/TensorRT :: plugin/roiAlignPlugin/roiAlignPluginLegacy.ll (ZN8nvinfer16plugin8ROIAlignC2Eiiiifi)

; 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::ROIAlign" = type { %"class.nvinfer1::IPluginV2DynamicExt", i32, i32, i32, float, i32, 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] }

@_ZTVN8nvinfer16plugin8ROIAlignE = external dso_local unnamed_addr constant { [32 x ptr] }, align 8

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8nvinfer16plugin8ROIAlign18validateAttributesEiiiifi(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef, i32 noundef, i32 noundef, i32 noundef, float noundef, i32 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8nvinfer16plugin8ROIAlignC2Eiiiifi(ptr noundef nonnull align 8 dereferenceable(88) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, float noundef %5, i32 noundef %6) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca float, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i32 %1, ptr %9, align 4, !tbaa !9
  store i32 %2, ptr %10, align 4, !tbaa !9
  store i32 %3, ptr %11, align 4, !tbaa !9
  store i32 %4, ptr %12, align 4, !tbaa !9
  store float %5, ptr %13, align 4, !tbaa !11
  store i32 %6, ptr %14, align 4, !tbaa !9
  %17 = load ptr, ptr %8, align 8
  call void @_ZN8nvinfer119IPluginV2DynamicExtC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #3
  store ptr getelementptr inbounds inrange(-16, 240) ({ [32 x ptr] }, ptr @_ZTVN8nvinfer16plugin8ROIAlignE, i32 0, i32 0, i32 2), ptr %17, align 8, !tbaa !13
  %18 = getelementptr inbounds %"class.nvinfer1::plugin::ROIAlign", ptr %17, i32 0, i32 1
  %19 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %19, ptr %18, align 8, !tbaa !15
  %20 = getelementptr inbounds %"class.nvinfer1::plugin::ROIAlign", ptr %17, i32 0, i32 2
  %21 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %21, ptr %20, align 4, !tbaa !23
  %22 = getelementptr inbounds %"class.nvinfer1::plugin::ROIAlign", ptr %17, i32 0, i32 3
  %23 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %23, ptr %22, align 8, !tbaa !24
  %24 = getelementptr inbounds %"class.nvinfer1::plugin::ROIAlign", ptr %17, i32 0, i32 4
  %25 = load float, ptr %13, align 4, !tbaa !11
  store float %25, ptr %24, align 4, !tbaa !25
  %26 = getelementptr inbounds %"class.nvinfer1::plugin::ROIAlign", ptr %17, i32 0, i32 5
  %27 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %27, ptr %26, align 8, !tbaa !26
  %28 = getelementptr inbounds %"class.nvinfer1::plugin::ROIAlign", ptr %17, i32 0, i32 6
  %29 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %29, ptr %28, align 4, !tbaa !27
  %30 = getelementptr inbounds %"class.nvinfer1::plugin::ROIAlign", ptr %17, i32 0, i32 7
  store i32 0, ptr %30, align 8, !tbaa !28
  %31 = getelementptr inbounds %"class.nvinfer1::plugin::ROIAlign", ptr %17, i32 0, i32 8
  store i32 0, ptr %31, align 4, !tbaa !29
  %32 = getelementptr inbounds %"class.nvinfer1::plugin::ROIAlign", ptr %17, i32 0, i32 9
  store i32 0, ptr %32, align 8, !tbaa !30
  %33 = getelementptr inbounds %"class.nvinfer1::plugin::ROIAlign", ptr %17, i32 0, i32 10
  store i32 0, ptr %33, align 4, !tbaa !31
  %34 = getelementptr inbounds %"class.nvinfer1::plugin::ROIAlign", ptr %17, i32 0, i32 11
  store i32 0, ptr %34, align 8, !tbaa !32
  %35 = getelementptr inbounds %"class.nvinfer1::plugin::ROIAlign", ptr %17, i32 0, i32 12
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %35) #3
  %36 = getelementptr inbounds %"class.nvinfer1::plugin::ROIAlign", ptr %17, i32 0, i32 1
  %37 = load i32, ptr %36, align 8, !tbaa !15
  %38 = getelementptr inbounds %"class.nvinfer1::plugin::ROIAlign", ptr %17, i32 0, i32 2
  %39 = load i32, ptr %38, align 4, !tbaa !23
  %40 = getelementptr inbounds %"class.nvinfer1::plugin::ROIAlign", ptr %17, i32 0, i32 3
  %41 = load i32, ptr %40, align 8, !tbaa !24
  %42 = getelementptr inbounds %"class.nvinfer1::plugin::ROIAlign", ptr %17, i32 0, i32 5
  %43 = load i32, ptr %42, align 8, !tbaa !26
  %44 = getelementptr inbounds %"class.nvinfer1::plugin::ROIAlign", ptr %17, i32 0, i32 4
  %45 = load float, ptr %44, align 4, !tbaa !25
  %46 = getelementptr inbounds %"class.nvinfer1::plugin::ROIAlign", ptr %17, i32 0, i32 6
  %47 = load i32, ptr %46, align 4, !tbaa !27
  invoke void @_ZN8nvinfer16plugin8ROIAlign18validateAttributesEiiiifi(ptr noundef nonnull align 8 dereferenceable(88) %17, i32 noundef %37, i32 noundef %39, i32 noundef %41, i32 noundef %43, float noundef %45, i32 noundef %47)
          to label %48 unwind label %49

48:                                               ; preds = %7
  ret void

49:                                               ; preds = %7
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %15, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %16, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %35) #3
  call void @_ZN8nvinfer19IPluginV2D2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #3
  br label %53

53:                                               ; preds = %49
  %54 = load ptr, ptr %15, align 8
  %55 = load i32, ptr %16, align 4
  %56 = insertvalue { ptr, i32 } poison, ptr %54, 0
  %57 = insertvalue { ptr, i32 } %56, i32 %55, 1
  resume { ptr, i32 } %57
}

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

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

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

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

attributes #0 = { 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 #1 = { inlinehint 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 = { 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 = { 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 = !{!"float", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = !{!16, !10, i64 8}
!16 = !{!"_ZTSN8nvinfer16plugin8ROIAlignE", !17, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !12, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !20, i64 56}
!17 = !{!"_ZTSN8nvinfer119IPluginV2DynamicExtE", !18, i64 0}
!18 = !{!"_ZTSN8nvinfer112IPluginV2ExtE", !19, i64 0}
!19 = !{!"_ZTSN8nvinfer19IPluginV2E"}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !21, i64 0, !22, i64 8, !7, i64 16}
!21 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!22 = !{!"long", !7, i64 0}
!23 = !{!16, !10, i64 12}
!24 = !{!16, !10, i64 16}
!25 = !{!16, !12, i64 20}
!26 = !{!16, !10, i64 24}
!27 = !{!16, !10, i64 28}
!28 = !{!16, !10, i64 32}
!29 = !{!16, !10, i64 36}
!30 = !{!16, !10, i64 40}
!31 = !{!16, !10, i64 44}
!32 = !{!16, !10, i64 48}


; 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"

@_ZTVN8nvinfer16plugin8ROIAlignE = external dso_local unnamed_addr constant { [32 x ptr] }, align 8

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8nvinfer16plugin8ROIAlign18validateAttributesEiiiifi(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef, i32 noundef, i32 noundef, i32 noundef, float noundef, i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8nvinfer16plugin8ROIAlignC2Eiiiifi(ptr noundef nonnull align 8 dereferenceable(88) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, float noundef %5, i32 noundef %6) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  tail call void @_ZN8nvinfer119IPluginV2DynamicExtC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #4
  store ptr getelementptr inbounds inrange(-16, 240) (i8, ptr @_ZTVN8nvinfer16plugin8ROIAlignE, i64 16), ptr %0, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 %1, ptr %8, align 8, !tbaa !8
  %9 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 %2, ptr %9, align 4, !tbaa !20
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  store i32 %3, ptr %10, align 8, !tbaa !21
  %11 = getelementptr inbounds i8, ptr %0, i64 20
  store float %5, ptr %11, align 4, !tbaa !22
  %12 = getelementptr inbounds i8, ptr %0, i64 24
  store i32 %4, ptr %12, align 8, !tbaa !23
  %13 = getelementptr inbounds i8, ptr %0, i64 28
  store i32 %6, ptr %13, align 4, !tbaa !24
  %14 = getelementptr inbounds i8, ptr %0, i64 32
  %15 = getelementptr inbounds i8, ptr %0, i64 56
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(20) %14, i8 0, i64 20, i1 false)
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #4
  %16 = load i32, ptr %8, align 8, !tbaa !8
  %17 = load i32, ptr %9, align 4, !tbaa !20
  %18 = load i32, ptr %10, align 8, !tbaa !21
  %19 = load i32, ptr %12, align 8, !tbaa !23
  %20 = load float, ptr %11, align 4, !tbaa !22
  %21 = load i32, ptr %13, align 4, !tbaa !24
  invoke void @_ZN8nvinfer16plugin8ROIAlign18validateAttributesEiiiifi(ptr noundef nonnull align 8 dereferenceable(88) %0, i32 noundef %16, i32 noundef %17, i32 noundef %18, i32 noundef %19, float noundef %20, i32 noundef %21)
          to label %22 unwind label %23

22:                                               ; preds = %7
  ret void

23:                                               ; preds = %7
  %24 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #4
  tail call void @_ZN8nvinfer19IPluginV2D2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #4
  resume { ptr, i32 } %24
}

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

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

attributes #0 = { 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 #1 = { inlinehint 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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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, !13, i64 8}
!9 = !{!"_ZTSN8nvinfer16plugin8ROIAlignE", !10, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !15, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !13, i64 48, !16, i64 56}
!10 = !{!"_ZTSN8nvinfer119IPluginV2DynamicExtE", !11, i64 0}
!11 = !{!"_ZTSN8nvinfer112IPluginV2ExtE", !12, i64 0}
!12 = !{!"_ZTSN8nvinfer19IPluginV2E"}
!13 = !{!"int", !14, i64 0}
!14 = !{!"omnipotent char", !7, i64 0}
!15 = !{!"float", !14, i64 0}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !17, i64 0, !19, i64 8, !14, i64 16}
!17 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !18, i64 0}
!18 = !{!"any pointer", !14, i64 0}
!19 = !{!"long", !14, i64 0}
!20 = !{!9, !13, i64 12}
!21 = !{!9, !13, i64 16}
!22 = !{!9, !15, i64 20}
!23 = !{!9, !13, i64 24}
!24 = !{!9, !13, i64 28}


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