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

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

@.str = external hidden unnamed_addr constant [82 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [66 x i8], align 1
@__func__._ZNK8nvinfer16plugin10ClipPlugin14supportsFormatENS_8DataTypeENS_12TensorFormatE = external hidden unnamed_addr constant [15 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

declare void @_ZN8nvinfer16plugin8logErrorEPKcS2_S2_i(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #2

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_ZNK8nvinfer16plugin10ClipPlugin14supportsFormatENS_8DataTypeENS_12TensorFormatE(ptr noundef nonnull align 8 dereferenceable(96) %0, i32 noundef %1, i32 noundef %2) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !11
  %8 = load ptr, ptr %5, align 8
  %9 = load i32, ptr %6, align 4, !tbaa !9
  %10 = icmp eq i32 %9, 2
  br i1 %10, label %11, label %12

11:                                               ; preds = %3
  store i1 false, ptr %4, align 1
  br label %43

12:                                               ; preds = %3
  %13 = load i32, ptr %7, align 4, !tbaa !11
  %14 = icmp ne i32 %13, 0
  br i1 %14, label %15, label %16

15:                                               ; preds = %12
  store i1 false, ptr %4, align 1
  br label %43

16:                                               ; preds = %12
  %17 = load i32, ptr %6, align 4, !tbaa !9
  %18 = icmp sge i32 %17, 0
  br i1 %18, label %19, label %23

19:                                               ; preds = %16
  %20 = load i32, ptr %6, align 4, !tbaa !9
  %21 = call noundef i32 @_ZN8nvinfer17EnumMaxINS_8DataTypeEEEiv() #3
  %22 = icmp slt i32 %20, %21
  br label %23

23:                                               ; preds = %19, %16
  %24 = phi i1 [ false, %16 ], [ %22, %19 ]
  %25 = zext i1 %24 to i32
  %26 = icmp eq i32 %25, 0
  br i1 %26, label %27, label %29

27:                                               ; preds = %23
  invoke void @_ZN8nvinfer16plugin8logErrorEPKcS2_S2_i(ptr noundef @.str.11, ptr noundef @.str, ptr noundef @__func__._ZNK8nvinfer16plugin10ClipPlugin14supportsFormatENS_8DataTypeENS_12TensorFormatE, i32 noundef 160)
          to label %28 unwind label %45

28:                                               ; preds = %27
  store i1 false, ptr %4, align 1
  br label %43

29:                                               ; preds = %23
  %30 = load i32, ptr %7, align 4, !tbaa !11
  %31 = icmp sge i32 %30, 0
  br i1 %31, label %32, label %36

32:                                               ; preds = %29
  %33 = load i32, ptr %7, align 4, !tbaa !11
  %34 = call noundef i32 @_ZN8nvinfer17EnumMaxINS_12TensorFormatEEEiv() #3
  %35 = icmp slt i32 %33, %34
  br label %36

36:                                               ; preds = %32, %29
  %37 = phi i1 [ false, %29 ], [ %35, %32 ]
  %38 = zext i1 %37 to i32
  %39 = icmp eq i32 %38, 0
  br i1 %39, label %40, label %42

40:                                               ; preds = %36
  invoke void @_ZN8nvinfer16plugin8logErrorEPKcS2_S2_i(ptr noundef @.str.12, ptr noundef @.str, ptr noundef @__func__._ZNK8nvinfer16plugin10ClipPlugin14supportsFormatENS_8DataTypeENS_12TensorFormatE, i32 noundef 161)
          to label %41 unwind label %45

41:                                               ; preds = %40
  store i1 false, ptr %4, align 1
  br label %43

42:                                               ; preds = %36
  store i1 true, ptr %4, align 1
  br label %43

43:                                               ; preds = %42, %41, %28, %15, %11
  %44 = load i1, ptr %4, align 1
  ret i1 %44

45:                                               ; preds = %40, %27
  %46 = landingpad { ptr, i32 }
          catch ptr null
  %47 = extractvalue { ptr, i32 } %46, 0
  call void @__clang_call_terminate(ptr %47) #4
  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 = { 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 = { nounwind }
attributes #4 = { 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 = !{!"_ZTSN8nvinfer18DataTypeE", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTSN8nvinfer112TensorFormatE", !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"

@.str = external hidden unnamed_addr constant [82 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [66 x i8], align 1
@__func__._ZNK8nvinfer16plugin10ClipPlugin14supportsFormatENS_8DataTypeENS_12TensorFormatE = external hidden unnamed_addr constant [15 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

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

declare void @_ZN8nvinfer16plugin8logErrorEPKcS2_S2_i(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_ZNK8nvinfer16plugin10ClipPlugin14supportsFormatENS_8DataTypeENS_12TensorFormatE(ptr nocapture noundef nonnull readnone align 8 dereferenceable(96) %0, i32 noundef %1, i32 noundef %2) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = icmp ne i32 %1, 2
  %.not = icmp eq i32 %2, 0
  %or.cond = and i1 %4, %.not
  br i1 %or.cond, label %5, label %14

5:                                                ; preds = %3
  %6 = icmp sgt i32 %1, -1
  br i1 %6, label %7, label %.invoke

7:                                                ; preds = %5
  %8 = tail call noundef i32 @_ZN8nvinfer17EnumMaxINS_8DataTypeEEEiv() #3
  %.not9 = icmp sgt i32 %8, %1
  br i1 %.not9, label %9, label %.invoke

9:                                                ; preds = %7
  %10 = tail call noundef i32 @_ZN8nvinfer17EnumMaxINS_12TensorFormatEEEiv() #3
  %11 = icmp slt i32 %10, 1
  br i1 %11, label %.invoke, label %14

.invoke:                                          ; preds = %9, %7, %5
  %12 = phi ptr [ @.str.11, %5 ], [ @.str.11, %7 ], [ @.str.12, %9 ]
  %13 = phi i32 [ 160, %5 ], [ 160, %7 ], [ 161, %9 ]
  invoke void @_ZN8nvinfer16plugin8logErrorEPKcS2_S2_i(ptr noundef nonnull %12, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZNK8nvinfer16plugin10ClipPlugin14supportsFormatENS_8DataTypeENS_12TensorFormatE, i32 noundef %13)
          to label %14 unwind label %15

14:                                               ; preds = %.invoke, %9, %3
  %.0 = phi i1 [ false, %3 ], [ true, %9 ], [ false, %.invoke ]
  ret i1 %.0

15:                                               ; preds = %.invoke
  %16 = landingpad { ptr, i32 }
          catch ptr null
  %17 = extractvalue { ptr, i32 } %16, 0
  tail call void @__clang_call_terminate(ptr %17) #4
  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 = { 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 = { nounwind }
attributes #4 = { 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)"}


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