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

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

@.str.1 = external hidden unnamed_addr constant [88 x i8], align 1
@__func__._ZN8nvinfer16plugin9ScatterND7enqueueEPKNS_16PluginTensorDescES4_PKPKvPKPvS9_P11CUstream_st = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [113 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK8nvinfer16plugin9ScatterND18calculateNumSlicesENS_6Dims64E(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef byval(%"class.nvinfer1::Dims64") align 8) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK8nvinfer16plugin9ScatterND23calculateTransformCoeffERKNS_6Dims64EiPi(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(72), i32 noundef, ptr noundef) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK8nvinfer16plugin9ScatterND17calculateCopySizeERKNS_6Dims64E(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(72)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_ZN8nvinfer16plugin9ScatterND7enqueueEPKNS_16PluginTensorDescES4_PKPKvPKPvS9_P11CUstream_st(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca [8 x i32], align 16
  %16 = alloca %"class.nvinfer1::Dims64", align 8
  %17 = alloca %"class.nvinfer1::Dims64", align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca %"class.nvinfer1::Dims64", align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  store ptr %6, ptr %14, align 8, !tbaa !5
  %25 = load ptr, ptr %8, align 8
  %26 = load ptr, ptr %9, align 8, !tbaa !5
  %27 = icmp ne ptr %26, null
  br i1 %27, label %28, label %40

28:                                               ; preds = %7
  %29 = load ptr, ptr %10, align 8, !tbaa !5
  %30 = icmp ne ptr %29, null
  br i1 %30, label %31, label %40

31:                                               ; preds = %28
  %32 = load ptr, ptr %11, align 8, !tbaa !5
  %33 = icmp ne ptr %32, null
  br i1 %33, label %34, label %40

34:                                               ; preds = %31
  %35 = load ptr, ptr %12, align 8, !tbaa !5
  %36 = icmp ne ptr %35, null
  br i1 %36, label %37, label %40

37:                                               ; preds = %34
  %38 = load ptr, ptr %13, align 8, !tbaa !5
  %39 = icmp ne ptr %38, null
  br i1 %39, label %42, label %40

40:                                               ; preds = %37, %34, %31, %28, %7
  invoke void @_ZN8nvinfer16plugin16throwPluginErrorEPKcS2_iiS2_(ptr noundef @.str.1, ptr noundef @__func__._ZN8nvinfer16plugin9ScatterND7enqueueEPKNS_16PluginTensorDescES4_PKPKvPKPvS9_P11CUstream_st, i32 noundef 136, i32 noundef 0, ptr noundef @.str.4) #7
          to label %41 unwind label %126

41:                                               ; preds = %40
  unreachable

42:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #8
  %43 = getelementptr inbounds [8 x i32], ptr %15, i64 0, i64 0
  %44 = load ptr, ptr %10, align 8, !tbaa !5
  %45 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %44, i64 0
  %46 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %45, i32 0, i32 0
  call void @llvm.memset.p0.i64(ptr align 16 %43, i8 0, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 72, ptr %16) #8
  %47 = load ptr, ptr %9, align 8, !tbaa !5
  %48 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %47, i64 1
  %49 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %48, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %49, i64 72, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.start.p0(i64 72, ptr %17) #8
  %50 = load ptr, ptr %9, align 8, !tbaa !5
  %51 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %50, i64 0
  %52 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %51, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %52, i64 72, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  %53 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %16, i32 0, i32 1
  %54 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %16, i32 0, i32 0
  %55 = load i32, ptr %54, align 8, !tbaa !13
  %56 = sub nsw i32 %55, 1
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [8 x i64], ptr %53, i64 0, i64 %57
  %59 = load i64, ptr %58, align 8, !tbaa !15
  %60 = trunc i64 %59 to i32
  store i32 %60, ptr %18, align 4, !tbaa !10
  %61 = load i32, ptr %18, align 4, !tbaa !10
  %62 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %17, i32 0, i32 0
  %63 = load i32, ptr %62, align 8, !tbaa !13
  %64 = icmp sle i32 %61, %63
  br i1 %64, label %67, label %65

65:                                               ; preds = %42
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 145)
          to label %66 unwind label %126

66:                                               ; preds = %65
  br label %67

67:                                               ; preds = %66, %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %16, i64 72, i1 false), !tbaa.struct !9
  %68 = call noundef i32 @_ZNK8nvinfer16plugin9ScatterND18calculateNumSlicesENS_6Dims64E(ptr noundef nonnull align 8 dereferenceable(40) %25, ptr noundef byval(%"class.nvinfer1::Dims64") align 8 %20) #8
  store i32 %68, ptr %19, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  store i32 1, ptr %21, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  %69 = call noundef i32 @_ZNK8nvinfer16plugin9ScatterND17calculateCopySizeERKNS_6Dims64E(ptr noundef nonnull align 8 dereferenceable(40) %25, ptr noundef nonnull align 8 dereferenceable(72) %17) #8
  store i32 %69, ptr %22, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  store i32 1, ptr %23, align 4, !tbaa !10
  %70 = load ptr, ptr %9, align 8, !tbaa !5
  %71 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %70, i32 0, i32 1
  %72 = load i32, ptr %71, align 8, !tbaa !17
  switch i32 %72, label %78 [
    i32 0, label %73
    i32 3, label %73
    i32 1, label %74
    i32 2, label %75
    i32 5, label %75
    i32 4, label %75
    i32 6, label %76
    i32 7, label %76
    i32 8, label %76
    i32 9, label %76
    i32 10, label %76
  ]

73:                                               ; preds = %67, %67
  store i32 4, ptr %23, align 4, !tbaa !10
  br label %78

74:                                               ; preds = %67
  store i32 2, ptr %23, align 4, !tbaa !10
  br label %78

75:                                               ; preds = %67, %67, %67
  store i32 1, ptr %23, align 4, !tbaa !10
  br label %78

76:                                               ; preds = %67, %67, %67, %67, %67
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef @.str.6, ptr noundef @.str.1, i32 noundef 164)
          to label %77 unwind label %126

77:                                               ; preds = %76
  br label %78

78:                                               ; preds = %77, %75, %74, %73, %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  %79 = load i32, ptr %18, align 4, !tbaa !10
  store i32 %79, ptr %24, align 4, !tbaa !10
  br label %80

80:                                               ; preds = %96, %78
  %81 = load i32, ptr %24, align 4, !tbaa !10
  %82 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %17, i32 0, i32 0
  %83 = load i32, ptr %82, align 8, !tbaa !13
  %84 = icmp slt i32 %81, %83
  br i1 %84, label %86, label %85

85:                                               ; preds = %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  br label %99

86:                                               ; preds = %80
  %87 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %17, i32 0, i32 1
  %88 = load i32, ptr %24, align 4, !tbaa !10
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [8 x i64], ptr %87, i64 0, i64 %89
  %91 = load i64, ptr %90, align 8, !tbaa !15
  %92 = load i32, ptr %21, align 4, !tbaa !10
  %93 = sext i32 %92 to i64
  %94 = mul nsw i64 %93, %91
  %95 = trunc i64 %94 to i32
  store i32 %95, ptr %21, align 4, !tbaa !10
  br label %96

96:                                               ; preds = %86
  %97 = load i32, ptr %24, align 4, !tbaa !10
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %24, align 4, !tbaa !10
  br label %80, !llvm.loop !22

99:                                               ; preds = %85
  %100 = load i32, ptr %18, align 4, !tbaa !10
  %101 = getelementptr inbounds [8 x i32], ptr %15, i64 0, i64 0
  call void @_ZNK8nvinfer16plugin9ScatterND23calculateTransformCoeffERKNS_6Dims64EiPi(ptr noundef nonnull align 8 dereferenceable(40) %25, ptr noundef nonnull align 8 dereferenceable(72) %17, i32 noundef %100, ptr noundef %101) #8
  %102 = load ptr, ptr %14, align 8, !tbaa !5
  %103 = getelementptr inbounds [8 x i32], ptr %15, i64 0, i64 0
  %104 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %17, i32 0, i32 0
  %105 = load i32, ptr %104, align 8, !tbaa !13
  %106 = load i32, ptr %18, align 4, !tbaa !10
  %107 = load i32, ptr %19, align 4, !tbaa !10
  %108 = load i32, ptr %21, align 4, !tbaa !10
  %109 = load i32, ptr %22, align 4, !tbaa !10
  %110 = load i32, ptr %23, align 4, !tbaa !10
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  %112 = getelementptr inbounds ptr, ptr %111, i64 1
  %113 = load ptr, ptr %112, align 8, !tbaa !5
  %114 = load ptr, ptr %11, align 8, !tbaa !5
  %115 = getelementptr inbounds ptr, ptr %114, i64 2
  %116 = load ptr, ptr %115, align 8, !tbaa !5
  %117 = load ptr, ptr %11, align 8, !tbaa !5
  %118 = getelementptr inbounds ptr, ptr %117, i64 0
  %119 = load ptr, ptr %118, align 8, !tbaa !5
  %120 = load ptr, ptr %12, align 8, !tbaa !5
  %121 = getelementptr inbounds ptr, ptr %120, i64 0
  %122 = load ptr, ptr %121, align 8, !tbaa !5
  %123 = load ptr, ptr %13, align 8, !tbaa !5
  %124 = invoke noundef i32 @_ZN8nvinfer16plugin18scatterNDInferenceEP11CUstream_stPiiiiiiiPKvS5_S5_PvS6_(ptr noundef %102, ptr noundef %103, i32 noundef %105, i32 noundef %106, i32 noundef %107, i32 noundef %108, i32 noundef %109, i32 noundef %110, ptr noundef %113, ptr noundef %116, ptr noundef %119, ptr noundef %122, ptr noundef %123)
          to label %125 unwind label %126

125:                                              ; preds = %99
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 72, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 72, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #8
  ret i32 0

126:                                              ; preds = %99, %76, %65, %40
  %127 = landingpad { ptr, i32 }
          catch ptr null
  %128 = extractvalue { ptr, i32 } %127, 0
  call void @__clang_call_terminate(ptr %128) #9
  unreachable
}

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

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

declare noundef i32 @_ZN8nvinfer16plugin18scatterNDInferenceEP11CUstream_stPiiiiiiiPKvS5_S5_PvS6_(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { noreturn }
attributes #8 = { nounwind }
attributes #9 = { 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 = !{i64 0, i64 4, !10, i64 8, i64 64, !12}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !11, i64 0}
!14 = !{!"_ZTSN8nvinfer16Dims64E", !11, i64 0, !7, i64 8}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!18, !19, i64 72}
!18 = !{!"_ZTSN8nvinfer116PluginTensorDescE", !14, i64 0, !19, i64 72, !20, i64 76, !21, i64 80}
!19 = !{!"_ZTSN8nvinfer18DataTypeE", !7, i64 0}
!20 = !{!"_ZTSN8nvinfer112TensorFormatE", !7, i64 0}
!21 = !{!"float", !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}


; 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::Dims64" = type { i32, [8 x i64] }

@.str.1 = external hidden unnamed_addr constant [88 x i8], align 1
@__func__._ZN8nvinfer16plugin9ScatterND7enqueueEPKNS_16PluginTensorDescES4_PKPKvPKPvS9_P11CUstream_st = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [113 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK8nvinfer16plugin9ScatterND18calculateNumSlicesENS_6Dims64E(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef byval(%"class.nvinfer1::Dims64") align 8) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK8nvinfer16plugin9ScatterND23calculateTransformCoeffERKNS_6Dims64EiPi(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(72), i32 noundef, ptr noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK8nvinfer16plugin9ScatterND17calculateCopySizeERKNS_6Dims64E(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_ZN8nvinfer16plugin9ScatterND7enqueueEPKNS_16PluginTensorDescES4_PKPKvPKPvS9_P11CUstream_st(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef readonly %1, ptr noundef readnone %2, ptr noundef readonly %3, ptr noundef readonly %4, ptr noundef %5, ptr noundef %6) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %8 = alloca [8 x i32], align 16
  %9 = alloca %"class.nvinfer1::Dims64", align 8
  %10 = alloca %"class.nvinfer1::Dims64", align 8
  %11 = insertelement <4 x ptr> poison, ptr %1, i64 0
  %12 = insertelement <4 x ptr> %11, ptr %2, i64 1
  %13 = insertelement <4 x ptr> %12, ptr %3, i64 2
  %14 = insertelement <4 x ptr> %13, ptr %4, i64 3
  %15 = icmp ne ptr %5, null
  %16 = icmp eq <4 x ptr> %14, zeroinitializer
  %17 = bitcast <4 x i1> %16 to i4
  %18 = icmp eq i4 %17, 0
  %op.rdx = and i1 %18, %15
  br i1 %op.rdx, label %21, label %19

19:                                               ; preds = %7
  invoke void @_ZN8nvinfer16plugin16throwPluginErrorEPKcS2_iiS2_(ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__._ZN8nvinfer16plugin9ScatterND7enqueueEPKNS_16PluginTensorDescES4_PKPKvPKPvS9_P11CUstream_st, i32 noundef 136, i32 noundef 0, ptr noundef nonnull @.str.4) #7
          to label %20 unwind label %94

20:                                               ; preds = %19
  unreachable

21:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %8, i8 0, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %9) #8
  %22 = getelementptr inbounds i8, ptr %1, i64 88
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(72) %9, ptr noundef nonnull align 8 dereferenceable(72) %22, i64 72, i1 false), !tbaa.struct !5
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %10) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(72) %10, ptr noundef nonnull align 8 dereferenceable(72) %1, i64 72, i1 false), !tbaa.struct !5
  %23 = getelementptr inbounds i8, ptr %9, i64 8
  %24 = load i32, ptr %9, align 8, !tbaa !11
  %25 = add nsw i32 %24, -1
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [8 x i64], ptr %23, i64 0, i64 %26
  %28 = load i64, ptr %27, align 8, !tbaa !13
  %29 = trunc i64 %28 to i32
  %30 = load i32, ptr %10, align 8, !tbaa !11
  %.not = icmp slt i32 %30, %29
  br i1 %.not, label %31, label %32

31:                                               ; preds = %21
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 145)
          to label %32 unwind label %94

32:                                               ; preds = %31, %21
  %33 = tail call noundef i32 @_ZNK8nvinfer16plugin9ScatterND18calculateNumSlicesENS_6Dims64E(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull byval(%"class.nvinfer1::Dims64") align 8 %9) #8
  %34 = call noundef i32 @_ZNK8nvinfer16plugin9ScatterND17calculateCopySizeERKNS_6Dims64E(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(72) %10) #8
  %35 = getelementptr inbounds i8, ptr %1, i64 72
  %36 = load i32, ptr %35, align 8, !tbaa !15
  switch i32 %36, label %40 [
    i32 0, label %37
    i32 3, label %37
    i32 1, label %38
    i32 10, label %39
    i32 9, label %39
    i32 8, label %39
    i32 6, label %39
    i32 7, label %39
  ]

37:                                               ; preds = %32, %32
  br label %40

38:                                               ; preds = %32
  br label %40

39:                                               ; preds = %32, %32, %32, %32, %32
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.1, i32 noundef 164)
          to label %40 unwind label %94

40:                                               ; preds = %39, %38, %37, %32
  %.034 = phi i32 [ 1, %39 ], [ 2, %38 ], [ 4, %37 ], [ 1, %32 ]
  %41 = load i32, ptr %10, align 8, !tbaa !11
  %42 = icmp sgt i32 %41, %29
  br i1 %42, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %40
  %43 = getelementptr inbounds i8, ptr %10, i64 8
  %sext = shl i64 %28, 32
  %44 = ashr exact i64 %sext, 32
  %wide.trip.count = sext i32 %41 to i64
  %45 = sub nsw i64 %wide.trip.count, %44
  %xtraiter = and i64 %45, 7
  %46 = sub nsw i64 %44, %wide.trip.count
  %47 = icmp ugt i64 %46, -8
  br i1 %47, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %45, -8
  br label %60

._crit_edge.loopexit.unr-lcssa:                   ; preds = %60, %.lr.ph
  %.lcssa.ph = phi i32 [ poison, %.lr.ph ], [ %92, %60 ]
  %indvars.iv.unr = phi i64 [ %44, %.lr.ph ], [ %indvars.iv.next.7, %60 ]
  %.03539.unr = phi i32 [ 1, %.lr.ph ], [ %92, %60 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.epil.preheader ], [ %indvars.iv.unr, %._crit_edge.loopexit.unr-lcssa ]
  %.03539.epil = phi i32 [ %51, %.epil.preheader ], [ %.03539.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %48 = getelementptr inbounds [8 x i64], ptr %43, i64 0, i64 %indvars.iv.epil
  %49 = load i64, ptr %48, align 8, !tbaa !13
  %50 = trunc i64 %49 to i32
  %51 = mul i32 %.03539.epil, %50
  %indvars.iv.next.epil = add nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.epil.preheader, !llvm.loop !20

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader, %40
  %.035.lcssa = phi i32 [ 1, %40 ], [ %.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %51, %.epil.preheader ]
  call void @_ZNK8nvinfer16plugin9ScatterND23calculateTransformCoeffERKNS_6Dims64EiPi(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(72) %10, i32 noundef %29, ptr noundef nonnull %8) #8
  %52 = load i32, ptr %10, align 8, !tbaa !11
  %53 = getelementptr inbounds i8, ptr %3, i64 8
  %54 = load ptr, ptr %53, align 8, !tbaa !22
  %55 = getelementptr inbounds i8, ptr %3, i64 16
  %56 = load ptr, ptr %55, align 8, !tbaa !22
  %57 = load ptr, ptr %3, align 8, !tbaa !22
  %58 = load ptr, ptr %4, align 8, !tbaa !22
  %59 = invoke noundef i32 @_ZN8nvinfer16plugin18scatterNDInferenceEP11CUstream_stPiiiiiiiPKvS5_S5_PvS6_(ptr noundef %6, ptr noundef nonnull %8, i32 noundef %52, i32 noundef %29, i32 noundef %33, i32 noundef %.035.lcssa, i32 noundef %34, i32 noundef %.034, ptr noundef %54, ptr noundef %56, ptr noundef %57, ptr noundef %58, ptr noundef nonnull %5)
          to label %93 unwind label %94

60:                                               ; preds = %60, %.lr.ph.new
  %indvars.iv = phi i64 [ %44, %.lr.ph.new ], [ %indvars.iv.next.7, %60 ]
  %.03539 = phi i32 [ 1, %.lr.ph.new ], [ %92, %60 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.7, %60 ]
  %61 = getelementptr inbounds [8 x i64], ptr %43, i64 0, i64 %indvars.iv
  %62 = load i64, ptr %61, align 8, !tbaa !13
  %63 = trunc i64 %62 to i32
  %64 = mul i32 %.03539, %63
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %65 = getelementptr inbounds [8 x i64], ptr %43, i64 0, i64 %indvars.iv.next
  %66 = load i64, ptr %65, align 8, !tbaa !13
  %67 = trunc i64 %66 to i32
  %68 = mul i32 %64, %67
  %indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
  %69 = getelementptr inbounds [8 x i64], ptr %43, i64 0, i64 %indvars.iv.next.1
  %70 = load i64, ptr %69, align 8, !tbaa !13
  %71 = trunc i64 %70 to i32
  %72 = mul i32 %68, %71
  %indvars.iv.next.2 = add nsw i64 %indvars.iv, 3
  %73 = getelementptr inbounds [8 x i64], ptr %43, i64 0, i64 %indvars.iv.next.2
  %74 = load i64, ptr %73, align 8, !tbaa !13
  %75 = trunc i64 %74 to i32
  %76 = mul i32 %72, %75
  %indvars.iv.next.3 = add nsw i64 %indvars.iv, 4
  %77 = getelementptr inbounds [8 x i64], ptr %43, i64 0, i64 %indvars.iv.next.3
  %78 = load i64, ptr %77, align 8, !tbaa !13
  %79 = trunc i64 %78 to i32
  %80 = mul i32 %76, %79
  %indvars.iv.next.4 = add nsw i64 %indvars.iv, 5
  %81 = getelementptr inbounds [8 x i64], ptr %43, i64 0, i64 %indvars.iv.next.4
  %82 = load i64, ptr %81, align 8, !tbaa !13
  %83 = trunc i64 %82 to i32
  %84 = mul i32 %80, %83
  %indvars.iv.next.5 = add nsw i64 %indvars.iv, 6
  %85 = getelementptr inbounds [8 x i64], ptr %43, i64 0, i64 %indvars.iv.next.5
  %86 = load i64, ptr %85, align 8, !tbaa !13
  %87 = trunc i64 %86 to i32
  %88 = mul i32 %84, %87
  %indvars.iv.next.6 = add nsw i64 %indvars.iv, 7
  %89 = getelementptr inbounds [8 x i64], ptr %43, i64 0, i64 %indvars.iv.next.6
  %90 = load i64, ptr %89, align 8, !tbaa !13
  %91 = trunc i64 %90 to i32
  %92 = mul i32 %88, %91
  %indvars.iv.next.7 = add nsw i64 %indvars.iv, 8
  %niter.next.7 = add i64 %niter, 8
  %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
  br i1 %niter.ncmp.7, label %._crit_edge.loopexit.unr-lcssa, label %60, !llvm.loop !24

93:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #8
  ret i32 0

94:                                               ; preds = %._crit_edge, %39, %31, %19
  %95 = landingpad { ptr, i32 }
          catch ptr null
  %96 = extractvalue { ptr, i32 } %95, 0
  call void @__clang_call_terminate(ptr %96) #9
  unreachable
}

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

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

declare noundef i32 @_ZN8nvinfer16plugin18scatterNDInferenceEP11CUstream_stPiiiiiiiPKvS5_S5_PvS6_(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { noreturn }
attributes #8 = { nounwind }
attributes #9 = { 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 = !{i64 0, i64 4, !6, i64 8, i64 64, !10}
!6 = !{!7, !7, i64 0}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!8, !8, i64 0}
!11 = !{!12, !7, i64 0}
!12 = !{!"_ZTSN8nvinfer16Dims64E", !7, i64 0, !8, i64 8}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !8, i64 0}
!15 = !{!16, !17, i64 72}
!16 = !{!"_ZTSN8nvinfer116PluginTensorDescE", !12, i64 0, !17, i64 72, !18, i64 76, !19, i64 80}
!17 = !{!"_ZTSN8nvinfer18DataTypeE", !8, i64 0}
!18 = !{!"_ZTSN8nvinfer112TensorFormatE", !8, i64 0}
!19 = !{!"float", !8, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.unroll.disable"}
!22 = !{!23, !23, i64 0}
!23 = !{!"any pointer", !8, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalDCEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass