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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; 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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i64 @_ZNK8nvinfer16plugin36ModulatedDeformableConvPluginDynamic16getWorkspaceSizeEPKNS_16PluginTensorDescEiS4_i(ptr noundef nonnull align 8 dereferenceable(328) %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, i32 noundef %4) unnamed_addr #2 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 i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i64, 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
  %18 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %19 = load ptr, ptr %9, align 8, !tbaa !5
  %20 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %19, i64 0
  %21 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %20, i32 0, i32 1
  %22 = load i32, ptr %21, align 8, !tbaa !11
  %23 = call noundef i32 @_ZN8nvinfer16plugin4bert14getElementSizeENS_8DataTypeE(i32 noundef %22) #4
  store i32 %23, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %24, i64 0
  %26 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %25, i32 0, i32 0
  %27 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %26, i32 0, i32 1
  %28 = getelementptr inbounds [8 x i64], ptr %27, i64 0, i64 1
  %29 = load i64, ptr %28, align 8, !tbaa !17
  %30 = trunc i64 %29 to i32
  store i32 %30, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %31 = load ptr, ptr %9, align 8, !tbaa !5
  %32 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %31, i64 0
  %33 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %32, i32 0, i32 0
  %34 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %33, i32 0, i32 1
  %35 = getelementptr inbounds [8 x i64], ptr %34, i64 0, i64 2
  %36 = load i64, ptr %35, align 8, !tbaa !17
  %37 = trunc i64 %36 to i32
  store i32 %37, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %38 = load ptr, ptr %9, align 8, !tbaa !5
  %39 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %38, i64 0
  %40 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %39, i32 0, i32 0
  %41 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %40, i32 0, i32 1
  %42 = getelementptr inbounds [8 x i64], ptr %41, i64 0, i64 3
  %43 = load i64, ptr %42, align 8, !tbaa !17
  %44 = trunc i64 %43 to i32
  store i32 %44, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  %46 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %45, i64 3
  %47 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %46, i32 0, i32 0
  %48 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %47, i32 0, i32 1
  %49 = getelementptr inbounds [8 x i64], ptr %48, i64 0, i64 2
  %50 = load i64, ptr %49, align 8, !tbaa !17
  %51 = trunc i64 %50 to i32
  store i32 %51, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %52, i64 3
  %54 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %53, i32 0, i32 0
  %55 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %54, i32 0, i32 1
  %56 = getelementptr inbounds [8 x i64], ptr %55, i64 0, i64 3
  %57 = load i64, ptr %56, align 8, !tbaa !17
  %58 = trunc i64 %57 to i32
  store i32 %58, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %59 = load i32, ptr %12, align 4, !tbaa !9
  %60 = load i32, ptr %16, align 4, !tbaa !9
  %61 = mul nsw i32 %59, %60
  %62 = load i32, ptr %15, align 4, !tbaa !9
  %63 = mul nsw i32 %61, %62
  %64 = load i32, ptr %13, align 4, !tbaa !9
  %65 = mul nsw i32 %63, %64
  %66 = load i32, ptr %14, align 4, !tbaa !9
  %67 = mul nsw i32 %65, %66
  %68 = load i32, ptr %11, align 4, !tbaa !9
  %69 = mul nsw i32 %67, %68
  %70 = sext i32 %69 to i64
  %71 = invoke noundef i64 @_Z5divUpli(i64 noundef %70, i32 noundef 16)
          to label %72 unwind label %75

72:                                               ; preds = %5
  %73 = mul nsw i64 %71, 16
  store i64 %73, ptr %17, align 8, !tbaa !17
  %74 = load i64, ptr %17, align 8, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  ret i64 %74

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN8nvinfer16plugin4bert14getElementSizeENS_8DataTypeE(i32 noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z5divUpli(i64 noundef, i32 noundef) #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 = { 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 = { 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 #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 = !{!12, !14, i64 72}
!12 = !{!"_ZTSN8nvinfer116PluginTensorDescE", !13, i64 0, !14, i64 72, !15, i64 76, !16, i64 80}
!13 = !{!"_ZTSN8nvinfer16Dims64E", !10, i64 0, !7, i64 8}
!14 = !{!"_ZTSN8nvinfer18DataTypeE", !7, i64 0}
!15 = !{!"_ZTSN8nvinfer112TensorFormatE", !7, i64 0}
!16 = !{!"float", !7, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"long", !7, 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"

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i64 @_ZNK8nvinfer16plugin36ModulatedDeformableConvPluginDynamic16getWorkspaceSizeEPKNS_16PluginTensorDescEiS4_i(ptr nocapture noundef nonnull readnone align 8 dereferenceable(328) %0, ptr nocapture noundef readonly %1, i32 noundef %2, ptr nocapture noundef readonly %3, i32 noundef %4) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %6 = getelementptr inbounds i8, ptr %3, i64 72
  %7 = load i32, ptr %6, align 8, !tbaa !5
  %8 = tail call noundef i32 @_ZN8nvinfer16plugin4bert14getElementSizeENS_8DataTypeE(i32 noundef %7) #2
  %9 = getelementptr inbounds i8, ptr %1, i64 16
  %10 = load i64, ptr %9, align 8, !tbaa !14
  %11 = trunc i64 %10 to i32
  %12 = getelementptr inbounds i8, ptr %3, i64 24
  %13 = load i64, ptr %12, align 8, !tbaa !14
  %14 = trunc i64 %13 to i32
  %15 = getelementptr inbounds i8, ptr %3, i64 32
  %16 = load i64, ptr %15, align 8, !tbaa !14
  %17 = trunc i64 %16 to i32
  %18 = getelementptr inbounds i8, ptr %1, i64 288
  %19 = load i64, ptr %18, align 8, !tbaa !14
  %20 = trunc i64 %19 to i32
  %21 = getelementptr inbounds i8, ptr %1, i64 296
  %22 = load i64, ptr %21, align 8, !tbaa !14
  %23 = trunc i64 %22 to i32
  %24 = mul i32 %8, %11
  %25 = mul i32 %24, %14
  %26 = mul i32 %25, %17
  %27 = mul i32 %26, %20
  %28 = mul i32 %27, %23
  %29 = sext i32 %28 to i64
  %30 = tail call noundef i64 @_Z5divUpli(i64 noundef %29, i32 noundef 16)
  %31 = shl nsw i64 %30, 4
  ret i64 %31
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN8nvinfer16plugin4bert14getElementSizeENS_8DataTypeE(i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z5divUpli(i64 noundef, i32 noundef) local_unnamed_addr #1

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 = { 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 = { 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, !11, i64 72}
!6 = !{!"_ZTSN8nvinfer116PluginTensorDescE", !7, i64 0, !11, i64 72, !12, i64 76, !13, i64 80}
!7 = !{!"_ZTSN8nvinfer16Dims64E", !8, i64 0, !9, i64 8}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSN8nvinfer18DataTypeE", !9, i64 0}
!12 = !{!"_ZTSN8nvinfer112TensorFormatE", !9, i64 0}
!13 = !{!"float", !9, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"long", !9, i64 0}


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