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

; 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::Normalize" = type { %"class.nvinfer1::IPluginV2Ext", ptr, %"class.std::shared_ptr", %"class.nvinfer1::Weights", i32, float, i8, i8, float, i32, i32, i32, %"class.std::__cxx11::basic_string" }
%"class.nvinfer1::IPluginV2Ext" = type { %"class.nvinfer1::IPluginV2" }
%"class.nvinfer1::IPluginV2" = type { ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.nvinfer1::Weights" = type { i32, ptr, i64 }
%"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] }

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 i32 @_ZN8nvinfer16plugin9Normalize7enqueueEiPKPKvPKPvS6_P11CUstream_st(ptr noundef nonnull align 8 dereferenceable(120) %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %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 i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  %16 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %17 = load ptr, ptr %9, align 8, !tbaa !5
  %18 = getelementptr inbounds ptr, ptr %17, i64 0
  %19 = load ptr, ptr %18, align 8, !tbaa !5
  store ptr %19, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %20 = load ptr, ptr %10, align 8, !tbaa !5
  %21 = getelementptr inbounds ptr, ptr %20, i64 0
  %22 = load ptr, ptr %21, align 8, !tbaa !5
  store ptr %22, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %23 = getelementptr inbounds %"class.nvinfer1::plugin::Normalize", ptr %16, i32 0, i32 6
  %24 = load i8, ptr %23, align 8, !tbaa !11, !range !25, !noundef !26
  %25 = trunc i8 %24 to i1
  br i1 %25, label %26, label %55

26:                                               ; preds = %6
  %27 = getelementptr inbounds %"class.nvinfer1::plugin::Normalize", ptr %16, i32 0, i32 7
  %28 = load i8, ptr %27, align 1, !tbaa !27, !range !25, !noundef !26
  %29 = trunc i8 %28 to i1
  br i1 %29, label %30, label %55

30:                                               ; preds = %26
  %31 = load ptr, ptr %12, align 8, !tbaa !5
  %32 = getelementptr inbounds %"class.nvinfer1::plugin::Normalize", ptr %16, i32 0, i32 1
  %33 = load ptr, ptr %32, align 8, !tbaa !28
  %34 = getelementptr inbounds %"class.nvinfer1::plugin::Normalize", ptr %16, i32 0, i32 6
  %35 = load i8, ptr %34, align 8, !tbaa !11, !range !25, !noundef !26
  %36 = trunc i8 %35 to i1
  %37 = getelementptr inbounds %"class.nvinfer1::plugin::Normalize", ptr %16, i32 0, i32 7
  %38 = load i8, ptr %37, align 1, !tbaa !27, !range !25, !noundef !26
  %39 = trunc i8 %38 to i1
  %40 = load i32, ptr %8, align 4, !tbaa !9
  %41 = getelementptr inbounds %"class.nvinfer1::plugin::Normalize", ptr %16, i32 0, i32 9
  %42 = load i32, ptr %41, align 8, !tbaa !29
  %43 = getelementptr inbounds %"class.nvinfer1::plugin::Normalize", ptr %16, i32 0, i32 10
  %44 = load i32, ptr %43, align 4, !tbaa !30
  %45 = getelementptr inbounds %"class.nvinfer1::plugin::Normalize", ptr %16, i32 0, i32 11
  %46 = load i32, ptr %45, align 8, !tbaa !31
  %47 = getelementptr inbounds %"class.nvinfer1::plugin::Normalize", ptr %16, i32 0, i32 8
  %48 = load float, ptr %47, align 4, !tbaa !32
  %49 = getelementptr inbounds %"class.nvinfer1::plugin::Normalize", ptr %16, i32 0, i32 5
  %50 = load ptr, ptr %13, align 8, !tbaa !5
  %51 = load ptr, ptr %14, align 8, !tbaa !5
  %52 = load ptr, ptr %11, align 8, !tbaa !5
  %53 = invoke noundef i32 @_ZN8nvinfer16plugin18normalizeInferenceEP11CUstream_stP13cublasContextbbiiiifPKvS6_PvS7_(ptr noundef %31, ptr noundef %33, i1 noundef zeroext %36, i1 noundef zeroext %39, i32 noundef %40, i32 noundef %42, i32 noundef %44, i32 noundef %46, float noundef %48, ptr noundef %49, ptr noundef %50, ptr noundef %51, ptr noundef %52)
          to label %54 unwind label %84

54:                                               ; preds = %30
  store i32 %53, ptr %15, align 4, !tbaa !33
  br label %82

55:                                               ; preds = %26, %6
  %56 = load ptr, ptr %12, align 8, !tbaa !5
  %57 = getelementptr inbounds %"class.nvinfer1::plugin::Normalize", ptr %16, i32 0, i32 1
  %58 = load ptr, ptr %57, align 8, !tbaa !28
  %59 = getelementptr inbounds %"class.nvinfer1::plugin::Normalize", ptr %16, i32 0, i32 6
  %60 = load i8, ptr %59, align 8, !tbaa !11, !range !25, !noundef !26
  %61 = trunc i8 %60 to i1
  %62 = getelementptr inbounds %"class.nvinfer1::plugin::Normalize", ptr %16, i32 0, i32 7
  %63 = load i8, ptr %62, align 1, !tbaa !27, !range !25, !noundef !26
  %64 = trunc i8 %63 to i1
  %65 = load i32, ptr %8, align 4, !tbaa !9
  %66 = getelementptr inbounds %"class.nvinfer1::plugin::Normalize", ptr %16, i32 0, i32 9
  %67 = load i32, ptr %66, align 8, !tbaa !29
  %68 = getelementptr inbounds %"class.nvinfer1::plugin::Normalize", ptr %16, i32 0, i32 10
  %69 = load i32, ptr %68, align 4, !tbaa !30
  %70 = getelementptr inbounds %"class.nvinfer1::plugin::Normalize", ptr %16, i32 0, i32 11
  %71 = load i32, ptr %70, align 8, !tbaa !31
  %72 = getelementptr inbounds %"class.nvinfer1::plugin::Normalize", ptr %16, i32 0, i32 8
  %73 = load float, ptr %72, align 4, !tbaa !32
  %74 = getelementptr inbounds %"class.nvinfer1::plugin::Normalize", ptr %16, i32 0, i32 3
  %75 = getelementptr inbounds %"class.nvinfer1::Weights", ptr %74, i32 0, i32 1
  %76 = load ptr, ptr %75, align 8, !tbaa !35
  %77 = load ptr, ptr %13, align 8, !tbaa !5
  %78 = load ptr, ptr %14, align 8, !tbaa !5
  %79 = load ptr, ptr %11, align 8, !tbaa !5
  %80 = invoke noundef i32 @_ZN8nvinfer16plugin18normalizeInferenceEP11CUstream_stP13cublasContextbbiiiifPKvS6_PvS7_(ptr noundef %56, ptr noundef %58, i1 noundef zeroext %61, i1 noundef zeroext %64, i32 noundef %65, i32 noundef %67, i32 noundef %69, i32 noundef %71, float noundef %73, ptr noundef %76, ptr noundef %77, ptr noundef %78, ptr noundef %79)
          to label %81 unwind label %84

81:                                               ; preds = %55
  store i32 %80, ptr %15, align 4, !tbaa !33
  br label %82

82:                                               ; preds = %81, %54
  %83 = load i32, ptr %15, align 4, !tbaa !33
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  ret i32 %83

84:                                               ; preds = %55, %30
  %85 = landingpad { ptr, i32 }
          catch ptr null
  %86 = extractvalue { ptr, i32 } %85, 0
  call void @__clang_call_terminate(ptr %86) #5
  unreachable
}

declare noundef i32 @_ZN8nvinfer16plugin18normalizeInferenceEP11CUstream_stP13cublasContextbbiiiifPKvS6_PvS7_(ptr noundef, ptr noundef, i1 noundef zeroext, i1 noundef zeroext, i32 noundef, i32 noundef, i32 noundef, i32 noundef, float noundef, ptr noundef, ptr noundef, ptr noundef, ptr 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 = { "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, !22, i64 64}
!12 = !{!"_ZTSN8nvinfer16plugin9NormalizeE", !13, i64 0, !6, i64 8, !15, i64 16, !18, i64 32, !10, i64 56, !21, i64 60, !22, i64 64, !22, i64 65, !21, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !23, i64 88}
!13 = !{!"_ZTSN8nvinfer112IPluginV2ExtE", !14, i64 0}
!14 = !{!"_ZTSN8nvinfer19IPluginV2E"}
!15 = !{!"_ZTSSt10shared_ptrIN8nvinfer114pluginInternal13CublasWrapperEE", !16, i64 0}
!16 = !{!"_ZTSSt12__shared_ptrIN8nvinfer114pluginInternal13CublasWrapperELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !17, i64 8}
!17 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!18 = !{!"_ZTSN8nvinfer17WeightsE", !19, i64 0, !6, i64 8, !20, i64 16}
!19 = !{!"_ZTSN8nvinfer18DataTypeE", !7, i64 0}
!20 = !{!"long", !7, i64 0}
!21 = !{!"float", !7, i64 0}
!22 = !{!"bool", !7, i64 0}
!23 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !24, i64 0, !20, i64 8, !7, i64 16}
!24 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = !{!12, !22, i64 65}
!28 = !{!12, !6, i64 8}
!29 = !{!12, !10, i64 72}
!30 = !{!12, !10, i64 76}
!31 = !{!12, !10, i64 80}
!32 = !{!12, !21, i64 68}
!33 = !{!34, !34, i64 0}
!34 = !{!"_ZTS14pluginStatus_t", !7, i64 0}
!35 = !{!12, !6, i64 40}


; 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: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_ZN8nvinfer16plugin9Normalize7enqueueEiPKPKvPKPvS6_P11CUstream_st(ptr noundef nonnull align 8 dereferenceable(120) %0, i32 noundef %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3, ptr noundef %4, ptr noundef %5) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %7 = load ptr, ptr %2, align 8, !tbaa !5
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 64
  %10 = load i8, ptr %9, align 8, !tbaa !9, !range !24, !noundef !25
  %11 = trunc nuw i8 %10 to i1
  %12 = getelementptr inbounds i8, ptr %0, i64 65
  %13 = load i8, ptr %12, align 1, !tbaa !26, !range !24
  %14 = trunc nuw i8 %13 to i1
  %15 = select i1 %11, i1 %14, i1 false
  %16 = getelementptr inbounds i8, ptr %0, i64 8
  %17 = load ptr, ptr %16, align 8, !tbaa !27
  %18 = getelementptr inbounds i8, ptr %0, i64 72
  %19 = load i32, ptr %18, align 8, !tbaa !28
  %20 = getelementptr inbounds i8, ptr %0, i64 76
  %21 = load i32, ptr %20, align 4, !tbaa !29
  %22 = getelementptr inbounds i8, ptr %0, i64 80
  %23 = load i32, ptr %22, align 8, !tbaa !30
  %24 = getelementptr inbounds i8, ptr %0, i64 68
  %25 = load float, ptr %24, align 4, !tbaa !31
  br i1 %15, label %26, label %._crit_edge

26:                                               ; preds = %6
  %27 = getelementptr inbounds i8, ptr %0, i64 60
  %28 = invoke noundef i32 @_ZN8nvinfer16plugin18normalizeInferenceEP11CUstream_stP13cublasContextbbiiiifPKvS6_PvS7_(ptr noundef %5, ptr noundef %17, i1 noundef zeroext true, i1 noundef zeroext true, i32 noundef %1, i32 noundef %19, i32 noundef %21, i32 noundef %23, float noundef %25, ptr noundef nonnull %27, ptr noundef %7, ptr noundef %8, ptr noundef %4)
          to label %32 unwind label %33

._crit_edge:                                      ; preds = %6
  %.not = xor i1 %11, true
  %.mux = select i1 %.not, i1 %14, i1 false
  %29 = getelementptr inbounds i8, ptr %0, i64 40
  %30 = load ptr, ptr %29, align 8, !tbaa !32
  %31 = invoke noundef i32 @_ZN8nvinfer16plugin18normalizeInferenceEP11CUstream_stP13cublasContextbbiiiifPKvS6_PvS7_(ptr noundef %5, ptr noundef %17, i1 noundef zeroext %11, i1 noundef zeroext %.mux, i32 noundef %1, i32 noundef %19, i32 noundef %21, i32 noundef %23, float noundef %25, ptr noundef %30, ptr noundef %7, ptr noundef %8, ptr noundef %4)
          to label %32 unwind label %33

32:                                               ; preds = %._crit_edge, %26
  %.0 = phi i32 [ %28, %26 ], [ %31, %._crit_edge ]
  ret i32 %.0

33:                                               ; preds = %._crit_edge, %26
  %34 = landingpad { ptr, i32 }
          catch ptr null
  %35 = extractvalue { ptr, i32 } %34, 0
  tail call void @__clang_call_terminate(ptr %35) #3
  unreachable
}

declare noundef i32 @_ZN8nvinfer16plugin18normalizeInferenceEP11CUstream_stP13cublasContextbbiiiifPKvS6_PvS7_(ptr noundef, ptr noundef, i1 noundef zeroext, i1 noundef zeroext, i32 noundef, i32 noundef, i32 noundef, i32 noundef, float noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

attributes #0 = { 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 #1 = { 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 = { "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 = { 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, !21, i64 64}
!10 = !{!"_ZTSN8nvinfer16plugin9NormalizeE", !11, i64 0, !6, i64 8, !13, i64 16, !16, i64 32, !19, i64 56, !20, i64 60, !21, i64 64, !21, i64 65, !20, i64 68, !19, i64 72, !19, i64 76, !19, i64 80, !22, i64 88}
!11 = !{!"_ZTSN8nvinfer112IPluginV2ExtE", !12, i64 0}
!12 = !{!"_ZTSN8nvinfer19IPluginV2E"}
!13 = !{!"_ZTSSt10shared_ptrIN8nvinfer114pluginInternal13CublasWrapperEE", !14, i64 0}
!14 = !{!"_ZTSSt12__shared_ptrIN8nvinfer114pluginInternal13CublasWrapperELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !15, i64 8}
!15 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!16 = !{!"_ZTSN8nvinfer17WeightsE", !17, i64 0, !6, i64 8, !18, i64 16}
!17 = !{!"_ZTSN8nvinfer18DataTypeE", !7, i64 0}
!18 = !{!"long", !7, i64 0}
!19 = !{!"int", !7, i64 0}
!20 = !{!"float", !7, i64 0}
!21 = !{!"bool", !7, i64 0}
!22 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !23, i64 0, !18, i64 8, !7, i64 16}
!23 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = !{!10, !21, i64 65}
!27 = !{!10, !6, i64 8}
!28 = !{!10, !19, i64 72}
!29 = !{!10, !19, i64 76}
!30 = !{!10, !19, i64 80}
!31 = !{!10, !20, i64 68}
!32 = !{!10, !6, i64 40}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass