; LLVM IR from NVIDIA/TensorRT :: plugin/efficientNMSPlugin/tftrt (efficientNMSImplicitTFTRTPlugin)

; 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] }

@.str.1 = external hidden unnamed_addr constant [117 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [21 x i8], align 1

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_ZNK8nvinfer16plugin31EfficientNMSImplicitTFTRTPlugin25supportsFormatCombinationEiPKNS_16PluginTensorDescEii(ptr noundef nonnull align 8 dereferenceable(120) %0, i32 noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca i1, align 1
  %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
  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 i32 %3, ptr %10, align 4, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !9
  %14 = load ptr, ptr %7, align 8
  %15 = load ptr, ptr %9, align 8, !tbaa !5
  %16 = load i32, ptr %8, align 4, !tbaa !9
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %15, i64 %17
  %19 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %18, i32 0, i32 2
  %20 = load i32, ptr %19, align 4, !tbaa !11
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %22, label %23

22:                                               ; preds = %5
  store i1 false, ptr %6, align 1
  br label %103

23:                                               ; preds = %5
  %24 = load i32, ptr %10, align 4, !tbaa !9
  %25 = icmp eq i32 %24, 2
  br i1 %25, label %28, label %26

26:                                               ; preds = %23
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 238)
          to label %27 unwind label %105

27:                                               ; preds = %26
  br label %28

28:                                               ; preds = %27, %23
  %29 = load i32, ptr %11, align 4, !tbaa !9
  %30 = icmp eq i32 %29, 4
  br i1 %30, label %33, label %31

31:                                               ; preds = %28
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef @.str.6, ptr noundef @.str.1, i32 noundef 239)
          to label %32 unwind label %105

32:                                               ; preds = %31
  br label %33

33:                                               ; preds = %32, %28
  %34 = load i32, ptr %10, align 4, !tbaa !9
  %35 = icmp eq i32 %34, 2
  br i1 %35, label %36, label %45

36:                                               ; preds = %33
  %37 = load i32, ptr %8, align 4, !tbaa !9
  %38 = icmp sle i32 0, %37
  br i1 %38, label %39, label %42

39:                                               ; preds = %36
  %40 = load i32, ptr %8, align 4, !tbaa !9
  %41 = icmp sle i32 %40, 5
  br i1 %41, label %44, label %42

42:                                               ; preds = %39, %36
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef @.str.7, ptr noundef @.str.1, i32 noundef 242)
          to label %43 unwind label %105

43:                                               ; preds = %42
  br label %44

44:                                               ; preds = %43, %39
  br label %45

45:                                               ; preds = %44, %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %46 = load i32, ptr %8, align 4, !tbaa !9
  %47 = load i32, ptr %10, align 4, !tbaa !9
  %48 = sub nsw i32 %46, %47
  store i32 %48, ptr %12, align 4, !tbaa !9
  %49 = load i32, ptr %12, align 4, !tbaa !9
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %54, label %51

51:                                               ; preds = %45
  %52 = load i32, ptr %12, align 4, !tbaa !9
  %53 = icmp eq i32 %52, 3
  br i1 %53, label %54, label %72

54:                                               ; preds = %51, %45
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = load i32, ptr %8, align 4, !tbaa !9
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %55, i64 %57
  %59 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %58, i32 0, i32 1
  %60 = load i32, ptr %59, align 8, !tbaa !17
  %61 = icmp eq i32 %60, 3
  br i1 %61, label %62, label %70

62:                                               ; preds = %54
  %63 = load ptr, ptr %9, align 8, !tbaa !5
  %64 = load i32, ptr %8, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %63, i64 %65
  %67 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %66, i32 0, i32 2
  %68 = load i32, ptr %67, align 4, !tbaa !11
  %69 = icmp eq i32 %68, 0
  br label %70

70:                                               ; preds = %62, %54
  %71 = phi i1 [ false, %54 ], [ %69, %62 ]
  store i1 %71, ptr %6, align 1
  store i32 1, ptr %13, align 4
  br label %102

72:                                               ; preds = %51
  %73 = load ptr, ptr %9, align 8, !tbaa !5
  %74 = load i32, ptr %8, align 4, !tbaa !9
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %73, i64 %75
  %77 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %76, i32 0, i32 1
  %78 = load i32, ptr %77, align 8, !tbaa !17
  %79 = icmp eq i32 %78, 1
  br i1 %79, label %88, label %80

80:                                               ; preds = %72
  %81 = load ptr, ptr %9, align 8, !tbaa !5
  %82 = load i32, ptr %8, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %81, i64 %83
  %85 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %84, i32 0, i32 1
  %86 = load i32, ptr %85, align 8, !tbaa !17
  %87 = icmp eq i32 %86, 0
  br i1 %87, label %88, label %100

88:                                               ; preds = %80, %72
  %89 = load ptr, ptr %9, align 8, !tbaa !5
  %90 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %89, i64 0
  %91 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %90, i32 0, i32 1
  %92 = load i32, ptr %91, align 8, !tbaa !17
  %93 = load ptr, ptr %9, align 8, !tbaa !5
  %94 = load i32, ptr %8, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %93, i64 %95
  %97 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %96, i32 0, i32 1
  %98 = load i32, ptr %97, align 8, !tbaa !17
  %99 = icmp eq i32 %92, %98
  br label %100

100:                                              ; preds = %88, %80
  %101 = phi i1 [ false, %80 ], [ %99, %88 ]
  store i1 %101, ptr %6, align 1
  store i32 1, ptr %13, align 4
  br label %102

102:                                              ; preds = %100, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %103

103:                                              ; preds = %102, %22
  %104 = load i1, ptr %6, align 1
  ret i1 %104

105:                                              ; preds = %42, %31, %26
  %106 = landingpad { ptr, i32 }
          catch ptr null
  %107 = extractvalue { ptr, i32 } %106, 0
  call void @__clang_call_terminate(ptr %107) #5
  unreachable
}

attributes #0 = { nocallback nofree nosync 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 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, !15, i64 76}
!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 = !{!12, !14, i64 72}


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

%"struct.nvinfer1::PluginTensorDesc" = type { %"class.nvinfer1::Dims64", i32, i32, float }
%"class.nvinfer1::Dims64" = type { i32, [8 x i64] }

@.str.1 = external hidden unnamed_addr constant [117 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [21 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_ZNK8nvinfer16plugin31EfficientNMSImplicitTFTRTPlugin25supportsFormatCombinationEiPKNS_16PluginTensorDescEii(ptr nocapture noundef nonnull readnone align 8 dereferenceable(120) %0, i32 noundef %1, ptr nocapture noundef readonly %2, i32 noundef %3, i32 noundef %4) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %6 = sext i32 %1 to i64
  %7 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %2, i64 %6
  %8 = getelementptr inbounds i8, ptr %7, i64 76
  %9 = load i32, ptr %8, align 4, !tbaa !5
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %10, label %34

10:                                               ; preds = %5
  %11 = icmp ne i32 %3, 2
  br i1 %11, label %12, label %13

12:                                               ; preds = %10
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 238)
          to label %13 unwind label %35

13:                                               ; preds = %12, %10
  %14 = icmp eq i32 %4, 4
  br i1 %14, label %16, label %15

15:                                               ; preds = %13
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.1, i32 noundef 239)
          to label %16 unwind label %35

16:                                               ; preds = %15, %13
  %or.cond = icmp ult i32 %1, 6
  %or.cond28 = or i1 %or.cond, %11
  br i1 %or.cond28, label %18, label %17

17:                                               ; preds = %16
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.1, i32 noundef 242)
          to label %18 unwind label %35

18:                                               ; preds = %17, %16
  %19 = sub nsw i32 %1, %3
  %20 = icmp eq i32 %1, %3
  %21 = icmp eq i32 %19, 3
  %or.cond3 = select i1 %20, i1 true, i1 %21
  %22 = getelementptr inbounds i8, ptr %7, i64 72
  %23 = load i32, ptr %22, align 8, !tbaa !14
  br i1 %or.cond3, label %24, label %29

24:                                               ; preds = %18
  %25 = icmp eq i32 %23, 3
  br i1 %25, label %26, label %34

26:                                               ; preds = %24
  %27 = load i32, ptr %8, align 4, !tbaa !5
  %28 = icmp eq i32 %27, 0
  br label %34

29:                                               ; preds = %18
  %switch = icmp ult i32 %23, 2
  br i1 %switch, label %30, label %34

30:                                               ; preds = %29
  %31 = getelementptr inbounds i8, ptr %2, i64 72
  %32 = load i32, ptr %31, align 8, !tbaa !14
  %33 = icmp eq i32 %32, %23
  br label %34

34:                                               ; preds = %29, %26, %24, %30, %5
  %.1 = phi i1 [ false, %5 ], [ false, %24 ], [ %28, %26 ], [ %33, %30 ], [ false, %29 ]
  ret i1 %.1

35:                                               ; preds = %17, %15, %12
  %36 = landingpad { ptr, i32 }
          catch ptr null
  %37 = extractvalue { ptr, i32 } %36, 0
  tail call void @__clang_call_terminate(ptr %37) #3
  unreachable
}

attributes #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 = { 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 = { 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, !12, i64 76}
!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 = !{!6, !11, i64 72}


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