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

; 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::Reorg" = type { %"class.nvinfer1::IPluginV2Ext", i32, %"class.std::__cxx11::basic_string" }
%"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] }
%"class.nvinfer1::Dims64" = type { i32, [8 x i64] }
%"class.nvinfer1::plugin::ReorgStatic" = type <{ %"class.nvinfer1::plugin::Reorg", i32, i32, i32, [4 x i8] }>

@.str.3 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [72 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN8nvinfer16plugin11ReorgStatic15configurePluginEPKNS_6Dims64EiS4_iPKNS_8DataTypeES7_PKbS9_NS_12TensorFormatEi(ptr noundef nonnull align 8 dereferenceable(60) %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, i32 noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8, i32 noundef %9, i32 noundef %10) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  store ptr %0, ptr %12, align 8, !tbaa !5
  store ptr %1, ptr %13, align 8, !tbaa !5
  store i32 %2, ptr %14, align 4, !tbaa !9
  store ptr %3, ptr %15, align 8, !tbaa !5
  store i32 %4, ptr %16, align 4, !tbaa !9
  store ptr %5, ptr %17, align 8, !tbaa !5
  store ptr %6, ptr %18, align 8, !tbaa !5
  store ptr %7, ptr %19, align 8, !tbaa !5
  store ptr %8, ptr %20, align 8, !tbaa !5
  store i32 %9, ptr %21, align 4, !tbaa !11
  store i32 %10, ptr %22, align 4, !tbaa !9
  %23 = load ptr, ptr %12, align 8
  %24 = load ptr, ptr %17, align 8, !tbaa !5
  %25 = load i32, ptr %24, align 4, !tbaa !13
  %26 = icmp eq i32 %25, 0
  br i1 %26, label %27, label %30

27:                                               ; preds = %11
  %28 = load i32, ptr %21, align 4, !tbaa !11
  %29 = icmp eq i32 %28, 0
  br i1 %29, label %32, label %30

30:                                               ; preds = %27, %11
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef @.str.25, ptr noundef @.str.3, i32 noundef 313)
          to label %31 unwind label %88

31:                                               ; preds = %30
  br label %32

32:                                               ; preds = %31, %27
  %33 = load i32, ptr %14, align 4, !tbaa !9
  %34 = icmp eq i32 %33, 1
  br i1 %34, label %37, label %35

35:                                               ; preds = %32
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef @.str.13, ptr noundef @.str.3, i32 noundef 314)
          to label %36 unwind label %88

36:                                               ; preds = %35
  br label %37

37:                                               ; preds = %36, %32
  %38 = load i32, ptr %16, align 4, !tbaa !9
  %39 = icmp eq i32 %38, 1
  br i1 %39, label %42, label %40

40:                                               ; preds = %37
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef @.str.16, ptr noundef @.str.3, i32 noundef 315)
          to label %41 unwind label %88

41:                                               ; preds = %40
  br label %42

42:                                               ; preds = %41, %37
  %43 = getelementptr inbounds %"class.nvinfer1::plugin::Reorg", ptr %23, i32 0, i32 1
  %44 = load i32, ptr %43, align 8, !tbaa !15
  %45 = icmp sgt i32 %44, 0
  br i1 %45, label %48, label %46

46:                                               ; preds = %42
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef @.str.7, ptr noundef @.str.3, i32 noundef 316)
          to label %47 unwind label %88

47:                                               ; preds = %46
  br label %48

48:                                               ; preds = %47, %42
  %49 = load ptr, ptr %13, align 8, !tbaa !5
  %50 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %49, i64 0
  %51 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %50, i32 0, i32 1
  %52 = getelementptr inbounds [8 x i64], ptr %51, i64 0, i64 0
  %53 = load i64, ptr %52, align 8, !tbaa !22
  %54 = trunc i64 %53 to i32
  %55 = getelementptr inbounds %"class.nvinfer1::plugin::ReorgStatic", ptr %23, i32 0, i32 1
  store i32 %54, ptr %55, align 8, !tbaa !23
  %56 = load ptr, ptr %13, align 8, !tbaa !5
  %57 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %56, i64 0
  %58 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %57, i32 0, i32 1
  %59 = getelementptr inbounds [8 x i64], ptr %58, i64 0, i64 1
  %60 = load i64, ptr %59, align 8, !tbaa !22
  %61 = trunc i64 %60 to i32
  %62 = getelementptr inbounds %"class.nvinfer1::plugin::ReorgStatic", ptr %23, i32 0, i32 2
  store i32 %61, ptr %62, align 4, !tbaa !25
  %63 = load ptr, ptr %13, align 8, !tbaa !5
  %64 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %63, i64 0
  %65 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %64, i32 0, i32 1
  %66 = getelementptr inbounds [8 x i64], ptr %65, i64 0, i64 2
  %67 = load i64, ptr %66, align 8, !tbaa !22
  %68 = trunc i64 %67 to i32
  %69 = getelementptr inbounds %"class.nvinfer1::plugin::ReorgStatic", ptr %23, i32 0, i32 3
  store i32 %68, ptr %69, align 8, !tbaa !26
  %70 = getelementptr inbounds %"class.nvinfer1::plugin::ReorgStatic", ptr %23, i32 0, i32 2
  %71 = load i32, ptr %70, align 4, !tbaa !25
  %72 = getelementptr inbounds %"class.nvinfer1::plugin::Reorg", ptr %23, i32 0, i32 1
  %73 = load i32, ptr %72, align 8, !tbaa !15
  %74 = srem i32 %71, %73
  %75 = icmp eq i32 %74, 0
  br i1 %75, label %78, label %76

76:                                               ; preds = %48
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef @.str.21, ptr noundef @.str.3, i32 noundef 320)
          to label %77 unwind label %88

77:                                               ; preds = %76
  br label %78

78:                                               ; preds = %77, %48
  %79 = getelementptr inbounds %"class.nvinfer1::plugin::ReorgStatic", ptr %23, i32 0, i32 3
  %80 = load i32, ptr %79, align 8, !tbaa !26
  %81 = getelementptr inbounds %"class.nvinfer1::plugin::Reorg", ptr %23, i32 0, i32 1
  %82 = load i32, ptr %81, align 8, !tbaa !15
  %83 = srem i32 %80, %82
  %84 = icmp eq i32 %83, 0
  br i1 %84, label %87, label %85

85:                                               ; preds = %78
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef @.str.22, ptr noundef @.str.3, i32 noundef 321)
          to label %86 unwind label %88

86:                                               ; preds = %85
  br label %87

87:                                               ; preds = %86, %78
  ret void

88:                                               ; preds = %85, %76, %46, %40, %35, %30
  %89 = landingpad { ptr, i32 }
          catch ptr null
  %90 = extractvalue { ptr, i32 } %89, 0
  call void @__clang_call_terminate(ptr %90) #3
  unreachable
}

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 = { "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 = { 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 = !{!"_ZTSN8nvinfer112TensorFormatE", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"_ZTSN8nvinfer18DataTypeE", !7, i64 0}
!15 = !{!16, !10, i64 8}
!16 = !{!"_ZTSN8nvinfer16plugin5ReorgINS_12IPluginV2ExtEEE", !17, i64 0, !10, i64 8, !19, i64 16}
!17 = !{!"_ZTSN8nvinfer112IPluginV2ExtE", !18, i64 0}
!18 = !{!"_ZTSN8nvinfer19IPluginV2E"}
!19 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !20, i64 0, !21, i64 8, !7, i64 16}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{!21, !21, i64 0}
!23 = !{!24, !10, i64 48}
!24 = !{!"_ZTSN8nvinfer16plugin11ReorgStaticE", !16, i64 0, !10, i64 48, !10, i64 52, !10, i64 56}
!25 = !{!24, !10, i64 52}
!26 = !{!24, !10, i64 56}


; 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.3 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [72 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN8nvinfer16plugin11ReorgStatic15configurePluginEPKNS_6Dims64EiS4_iPKNS_8DataTypeES7_PKbS9_NS_12TensorFormatEi(ptr nocapture noundef nonnull align 8 dereferenceable(60) %0, ptr nocapture noundef readonly %1, i32 noundef %2, ptr nocapture noundef readnone %3, i32 noundef %4, ptr nocapture noundef readonly %5, ptr nocapture noundef readnone %6, ptr nocapture noundef readnone %7, ptr nocapture noundef readnone %8, i32 noundef %9, i32 noundef %10) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %12 = load i32, ptr %5, align 4, !tbaa !5
  %13 = or i32 %12, %9
  %or.cond = icmp eq i32 %13, 0
  br i1 %or.cond, label %15, label %14

14:                                               ; preds = %11
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef nonnull @.str.25, ptr noundef nonnull @.str.3, i32 noundef 313)
          to label %15 unwind label %50

15:                                               ; preds = %14, %11
  %16 = icmp eq i32 %2, 1
  br i1 %16, label %18, label %17

17:                                               ; preds = %15
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.3, i32 noundef 314)
          to label %18 unwind label %50

18:                                               ; preds = %17, %15
  %19 = icmp eq i32 %4, 1
  br i1 %19, label %21, label %20

20:                                               ; preds = %18
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef nonnull @.str.16, ptr noundef nonnull @.str.3, i32 noundef 315)
          to label %21 unwind label %50

21:                                               ; preds = %20, %18
  %22 = getelementptr inbounds i8, ptr %0, i64 8
  %23 = load i32, ptr %22, align 8, !tbaa !9
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %26, label %25

25:                                               ; preds = %21
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.3, i32 noundef 316)
          to label %._crit_edge unwind label %50

._crit_edge:                                      ; preds = %25
  %.pre = load i32, ptr %22, align 8, !tbaa !9
  br label %26

26:                                               ; preds = %._crit_edge, %21
  %27 = phi i32 [ %.pre, %._crit_edge ], [ %23, %21 ]
  %28 = getelementptr inbounds i8, ptr %1, i64 8
  %29 = load i64, ptr %28, align 8, !tbaa !18
  %30 = trunc i64 %29 to i32
  %31 = getelementptr inbounds i8, ptr %0, i64 48
  store i32 %30, ptr %31, align 8, !tbaa !19
  %32 = getelementptr inbounds i8, ptr %1, i64 16
  %33 = load i64, ptr %32, align 8, !tbaa !18
  %34 = trunc i64 %33 to i32
  %35 = getelementptr inbounds i8, ptr %0, i64 52
  store i32 %34, ptr %35, align 4, !tbaa !21
  %36 = getelementptr inbounds i8, ptr %1, i64 24
  %37 = load i64, ptr %36, align 8, !tbaa !18
  %38 = trunc i64 %37 to i32
  %39 = getelementptr inbounds i8, ptr %0, i64 56
  store i32 %38, ptr %39, align 8, !tbaa !22
  %40 = srem i32 %34, %27
  %41 = icmp eq i32 %40, 0
  br i1 %41, label %43, label %42

42:                                               ; preds = %26
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef nonnull @.str.21, ptr noundef nonnull @.str.3, i32 noundef 320)
          to label %._crit_edge8 unwind label %50

._crit_edge8:                                     ; preds = %42
  %.pre9 = load i32, ptr %39, align 8, !tbaa !22
  %.pre10 = load i32, ptr %22, align 8, !tbaa !9
  br label %43

43:                                               ; preds = %._crit_edge8, %26
  %44 = phi i32 [ %.pre10, %._crit_edge8 ], [ %27, %26 ]
  %45 = phi i32 [ %.pre9, %._crit_edge8 ], [ %38, %26 ]
  %46 = srem i32 %45, %44
  %47 = icmp eq i32 %46, 0
  br i1 %47, label %49, label %48

48:                                               ; preds = %43
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef nonnull @.str.22, ptr noundef nonnull @.str.3, i32 noundef 321)
          to label %49 unwind label %50

49:                                               ; preds = %48, %43
  ret void

50:                                               ; preds = %48, %42, %25, %20, %17, %14
  %51 = landingpad { ptr, i32 }
          catch ptr null
  %52 = extractvalue { ptr, i32 } %51, 0
  tail call void @__clang_call_terminate(ptr %52) #3
  unreachable
}

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 = { "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 = { 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 = !{!"_ZTSN8nvinfer18DataTypeE", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !13, i64 8}
!10 = !{!"_ZTSN8nvinfer16plugin5ReorgINS_12IPluginV2ExtEEE", !11, i64 0, !13, i64 8, !14, i64 16}
!11 = !{!"_ZTSN8nvinfer112IPluginV2ExtE", !12, i64 0}
!12 = !{!"_ZTSN8nvinfer19IPluginV2E"}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !15, i64 0, !17, i64 8, !7, i64 16}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !16, i64 0}
!16 = !{!"any pointer", !7, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!17, !17, i64 0}
!19 = !{!20, !13, i64 48}
!20 = !{!"_ZTSN8nvinfer16plugin11ReorgStaticE", !10, i64 0, !13, i64 48, !13, i64 52, !13, i64 56}
!21 = !{!20, !13, i64 52}
!22 = !{!20, !13, i64 56}


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