; LLVM IR from Seeed-Studio/Seeed_Arduino_edgeimpulse :: src/edge-impulse-sdk/tensorflow/lite/kernels (kernel_util)

; 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.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.0", %"struct.std::_Head_base.1" }
%"struct.std::_Tuple_impl.0" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { ptr }
%"struct.std::_Head_base.1" = type { ptr }
%struct.TfLiteTensor = type { i32, %union.TfLitePtrUnion, ptr, %struct.TfLiteQuantizationParams, i32, i64, ptr, ptr, ptr, i32, i8, i8, %struct.TfLiteQuantization, ptr, ptr }
%union.TfLitePtrUnion = type { ptr }
%struct.TfLiteQuantizationParams = type { float, i32 }
%struct.TfLiteQuantization = type { i32, ptr }
%struct.TfLiteContext = type { i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.TfLiteIntArray = type { i32, [0 x i32] }

@.str.1 = external hidden unnamed_addr constant [133 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [31 x i8], align 1

; 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: mustprogress uwtable
define dso_local noundef i32 @_ZN6tflite26CalculateShapeForBroadcastEP13TfLiteContextPK12TfLiteTensorS4_PP14TfLiteIntArray(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #1 personality ptr @__gxx_personality_v0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %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
  %14 = alloca %"class.std::unique_ptr", align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %21 = load ptr, ptr %7, align 8, !tbaa !5
  %22 = call noundef i32 @_ZN6tflite13NumDimensionsEPK12TfLiteTensor(ptr noundef %21)
  store i32 %22, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  %24 = call noundef i32 @_ZN6tflite13NumDimensionsEPK12TfLiteTensor(ptr noundef %23)
  store i32 %24, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %25 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %26 = load i32, ptr %25, align 4, !tbaa !9
  store i32 %26, ptr %12, align 4, !tbaa !9
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = call noundef i64 @_ZN6tflite11NumElementsEPK12TfLiteTensor(ptr noundef %27)
  %29 = icmp eq i64 %28, 0
  br i1 %29, label %30, label %36

30:                                               ; preds = %4
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.TfLiteTensor, ptr %31, i32 0, i32 2
  %33 = load ptr, ptr %32, align 8, !tbaa !11
  %34 = call ptr @TfLiteIntArrayCopy(ptr noundef %33)
  %35 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %34, ptr %35, align 8, !tbaa !5
  store i32 0, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %127

36:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  %37 = load i32, ptr %12, align 4, !tbaa !9
  %38 = call ptr @TfLiteIntArrayCreate(i32 noundef %37)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store ptr @TfLiteIntArrayFree, ptr %15, align 8, !tbaa !5
  call void @_ZNSt10unique_ptrI14TfLiteIntArrayPFvPS0_EEC2IS3_vEES1_NSt9enable_ifIXntsr19is_lvalue_referenceIT_EE5valueEOS7_E4typeE(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef %38, ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %39

39:                                               ; preds = %117, %36
  %40 = load i32, ptr %16, align 4, !tbaa !9
  %41 = load i32, ptr %12, align 4, !tbaa !9
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %39
  store i32 2, ptr %13, align 4
  br label %121

44:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %45 = load i32, ptr %16, align 4, !tbaa !9
  %46 = load i32, ptr %10, align 4, !tbaa !9
  %47 = icmp sge i32 %45, %46
  br i1 %47, label %48, label %49

48:                                               ; preds = %44
  br label %57

49:                                               ; preds = %44
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = load i32, ptr %10, align 4, !tbaa !9
  %52 = load i32, ptr %16, align 4, !tbaa !9
  %53 = sub nsw i32 %51, %52
  %54 = sub nsw i32 %53, 1
  %55 = invoke noundef i32 @_ZN6tflite15SizeOfDimensionEPK12TfLiteTensori(ptr noundef %50, i32 noundef %54)
          to label %56 unwind label %92

56:                                               ; preds = %49
  br label %57

57:                                               ; preds = %56, %48
  %58 = phi i32 [ 1, %48 ], [ %55, %56 ]
  store i32 %58, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %59 = load i32, ptr %16, align 4, !tbaa !9
  %60 = load i32, ptr %11, align 4, !tbaa !9
  %61 = icmp sge i32 %59, %60
  br i1 %61, label %62, label %63

62:                                               ; preds = %57
  br label %71

63:                                               ; preds = %57
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = load i32, ptr %11, align 4, !tbaa !9
  %66 = load i32, ptr %16, align 4, !tbaa !9
  %67 = sub nsw i32 %65, %66
  %68 = sub nsw i32 %67, 1
  %69 = invoke noundef i32 @_ZN6tflite15SizeOfDimensionEPK12TfLiteTensori(ptr noundef %64, i32 noundef %68)
          to label %70 unwind label %96

70:                                               ; preds = %63
  br label %71

71:                                               ; preds = %70, %62
  %72 = phi i32 [ 1, %62 ], [ %69, %70 ]
  store i32 %72, ptr %20, align 4, !tbaa !9
  br label %73

73:                                               ; preds = %71
  %74 = load i32, ptr %17, align 4, !tbaa !9
  %75 = load i32, ptr %20, align 4, !tbaa !9
  %76 = icmp eq i32 %74, %75
  br i1 %76, label %100, label %77

77:                                               ; preds = %73
  %78 = load i32, ptr %17, align 4, !tbaa !9
  %79 = icmp eq i32 %78, 1
  br i1 %79, label %100, label %80

80:                                               ; preds = %77
  %81 = load i32, ptr %20, align 4, !tbaa !9
  %82 = icmp eq i32 %81, 1
  br i1 %82, label %100, label %83

83:                                               ; preds = %80
  br label %84

84:                                               ; preds = %83
  %85 = load ptr, ptr %6, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.TfLiteContext, ptr %85, i32 0, i32 5
  %87 = load ptr, ptr %86, align 8, !tbaa !21
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void (ptr, ptr, ...) %87(ptr noundef %88, ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 249, ptr noundef @.str.17)
          to label %89 unwind label %96

89:                                               ; preds = %84
  br label %90

90:                                               ; preds = %89
  br label %91

91:                                               ; preds = %90
  store i32 1, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %114

92:                                               ; preds = %49
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %18, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %19, align 4
  br label %120

96:                                               ; preds = %102, %84, %63
  %97 = landingpad { ptr, i32 }
          cleanup
  %98 = extractvalue { ptr, i32 } %97, 0
  store ptr %98, ptr %18, align 8
  %99 = extractvalue { ptr, i32 } %97, 1
  store i32 %99, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %120

100:                                              ; preds = %80, %77, %73
  br label %101

101:                                              ; preds = %100
  br label %102

102:                                              ; preds = %101
  %103 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %20)
          to label %104 unwind label %96

104:                                              ; preds = %102
  %105 = load i32, ptr %103, align 4, !tbaa !9
  %106 = call noundef ptr @_ZNKSt10unique_ptrI14TfLiteIntArrayPFvPS0_EEptEv(ptr noundef nonnull align 8 dereferenceable(16) %14) #6
  %107 = getelementptr inbounds %struct.TfLiteIntArray, ptr %106, i32 0, i32 1
  %108 = load i32, ptr %12, align 4, !tbaa !9
  %109 = load i32, ptr %16, align 4, !tbaa !9
  %110 = sub nsw i32 %108, %109
  %111 = sub nsw i32 %110, 1
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [0 x i32], ptr %107, i64 0, i64 %112
  store i32 %105, ptr %113, align 4, !tbaa !9
  store i32 0, ptr %13, align 4
  br label %114

114:                                              ; preds = %104, %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  %115 = load i32, ptr %13, align 4
  switch i32 %115, label %121 [
    i32 0, label %116
  ]

116:                                              ; preds = %114
  br label %117

117:                                              ; preds = %116
  %118 = load i32, ptr %16, align 4, !tbaa !9
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %16, align 4, !tbaa !9
  br label %39, !llvm.loop !23

120:                                              ; preds = %96, %92
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @_ZNSt10unique_ptrI14TfLiteIntArrayPFvPS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %129

121:                                              ; preds = %114, %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  %122 = load i32, ptr %13, align 4
  switch i32 %122, label %126 [
    i32 2, label %123
  ]

123:                                              ; preds = %121
  %124 = call noundef ptr @_ZNSt10unique_ptrI14TfLiteIntArrayPFvPS0_EE7releaseEv(ptr noundef nonnull align 8 dereferenceable(16) %14) #6
  %125 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %124, ptr %125, align 8, !tbaa !5
  store i32 0, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %126

126:                                              ; preds = %123, %121
  call void @_ZNSt10unique_ptrI14TfLiteIntArrayPFvPS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  br label %127

127:                                              ; preds = %126, %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  %128 = load i32, ptr %5, align 4
  ret i32 %128

129:                                              ; preds = %120
  %130 = load ptr, ptr %18, align 8
  %131 = load i32, ptr %19, align 4
  %132 = insertvalue { ptr, i32 } poison, ptr %130, 0
  %133 = insertvalue { ptr, i32 } %132, i32 %131, 1
  resume { ptr, i32 } %133
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6tflite13NumDimensionsEPK12TfLiteTensor(ptr noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZN6tflite11NumElementsEPK12TfLiteTensor(ptr noundef) #3

declare ptr @TfLiteIntArrayCopy(ptr noundef) #4

declare ptr @TfLiteIntArrayCreate(i32 noundef) #4

declare void @TfLiteIntArrayFree(ptr noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10unique_ptrI14TfLiteIntArrayPFvPS0_EEC2IS3_vEES1_NSt9enable_ifIXntsr19is_lvalue_referenceIT_EE5valueEOS7_E4typeE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6tflite15SizeOfDimensionEPK12TfLiteTensori(ptr noundef, i32 noundef) #2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt10unique_ptrI14TfLiteIntArrayPFvPS0_EEptEv(ptr noundef nonnull align 8 dereferenceable(16)) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNSt10unique_ptrI14TfLiteIntArrayPFvPS0_EE7releaseEv(ptr noundef nonnull align 8 dereferenceable(16)) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10unique_ptrI14TfLiteIntArrayPFvPS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #5 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { inlinehint 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 = { inlinehint mustprogress 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 = { "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 = { 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 #6 = { 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, !6, i64 16}
!12 = !{!"_ZTS12TfLiteTensor", !13, i64 0, !7, i64 8, !6, i64 16, !14, i64 24, !16, i64 32, !17, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !10, i64 72, !18, i64 76, !18, i64 77, !19, i64 80, !6, i64 96, !6, i64 104}
!13 = !{!"_ZTS10TfLiteType", !7, i64 0}
!14 = !{!"_ZTS24TfLiteQuantizationParams", !15, i64 0, !10, i64 4}
!15 = !{!"float", !7, i64 0}
!16 = !{!"_ZTS20TfLiteAllocationType", !7, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{!"_ZTS18TfLiteQuantization", !20, i64 0, !6, i64 8}
!20 = !{!"_ZTS22TfLiteQuantizationType", !7, i64 0}
!21 = !{!22, !6, i64 40}
!22 = !{!"_ZTS13TfLiteContext", !17, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !10, i64 72, !6, i64 80, !6, i64 88, !18, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152}
!23 = distinct !{!23, !24}
!24 = !{!"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.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.0", %"struct.std::_Head_base.1" }
%"struct.std::_Tuple_impl.0" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { ptr }
%"struct.std::_Head_base.1" = type { ptr }

@.str.1 = external hidden unnamed_addr constant [133 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [31 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6tflite26CalculateShapeForBroadcastEP13TfLiteContextPK12TfLiteTensorS4_PP14TfLiteIntArray(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::unique_ptr", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %11 = tail call noundef i32 @_ZN6tflite13NumDimensionsEPK12TfLiteTensor(ptr noundef %1)
  store i32 %11, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %12 = tail call noundef i32 @_ZN6tflite13NumDimensionsEPK12TfLiteTensor(ptr noundef %2)
  store i32 %12, ptr %6, align 4, !tbaa !5
  %13 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %14 = load i32, ptr %13, align 4, !tbaa !5
  %15 = call noundef i64 @_ZN6tflite11NumElementsEPK12TfLiteTensor(ptr noundef %1)
  %16 = icmp eq i64 %15, 0
  br i1 %16, label %17, label %21

17:                                               ; preds = %4
  %18 = getelementptr inbounds i8, ptr %1, i64 16
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  %20 = call ptr @TfLiteIntArrayCopy(ptr noundef %19)
  store ptr %20, ptr %3, align 8, !tbaa !20
  br label %59

21:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #6
  %22 = call ptr @TfLiteIntArrayCreate(i32 noundef %14)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  store ptr @TfLiteIntArrayFree, ptr %8, align 8, !tbaa !20
  call void @_ZNSt10unique_ptrI14TfLiteIntArrayPFvPS0_EEC2IS3_vEES1_NSt9enable_ifIXntsr19is_lvalue_referenceIT_EE5valueEOS7_E4typeE(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef %22, ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  %.not3536 = icmp sgt i32 %14, 0
  br i1 %.not3536, label %.lr.ph.preheader, label %.critedge

.lr.ph.preheader:                                 ; preds = %21
  %23 = zext nneg i32 %14 to i64
  %wide.trip.count = zext nneg i32 %14 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %48
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %48 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #6
  %24 = load i32, ptr %5, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %.not = icmp slt i64 %indvars.iv, %25
  br i1 %.not, label %26, label %31

26:                                               ; preds = %.lr.ph
  %27 = trunc i64 %indvars.iv to i32
  %28 = xor i32 %27, -1
  %29 = add i32 %24, %28
  %30 = call noundef i32 @_ZN6tflite15SizeOfDimensionEPK12TfLiteTensori(ptr noundef %1, i32 noundef %29)
  br label %31

31:                                               ; preds = %.lr.ph, %26
  %32 = phi i32 [ %30, %26 ], [ 1, %.lr.ph ]
  store i32 %32, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #6
  %33 = load i32, ptr %6, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %.not34 = icmp slt i64 %indvars.iv, %34
  br i1 %.not34, label %35, label %.thread

.thread:                                          ; preds = %31
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %48

35:                                               ; preds = %31
  %36 = trunc i64 %indvars.iv to i32
  %37 = xor i32 %36, -1
  %38 = add i32 %33, %37
  %39 = call noundef i32 @_ZN6tflite15SizeOfDimensionEPK12TfLiteTensori(ptr noundef %2, i32 noundef %38)
  %.pre = load i32, ptr %9, align 4
  store i32 %39, ptr %10, align 4, !tbaa !5
  %40 = icmp eq i32 %.pre, %39
  %41 = icmp eq i32 %.pre, 1
  %or.cond = or i1 %40, %41
  %42 = icmp eq i32 %39, 1
  %or.cond4 = or i1 %42, %or.cond
  br i1 %or.cond4, label %48, label %43

43:                                               ; preds = %35
  %44 = getelementptr inbounds i8, ptr %0, i64 40
  %45 = load ptr, ptr %44, align 8, !tbaa !21
  invoke void (ptr, ptr, ...) %45(ptr noundef nonnull %0, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 249, ptr noundef nonnull @.str.17)
          to label %56 unwind label %46

46:                                               ; preds = %43
  %47 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  call void @_ZNSt10unique_ptrI14TfLiteIntArrayPFvPS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  resume { ptr, i32 } %47

48:                                               ; preds = %.thread, %35
  %49 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = call noundef ptr @_ZNKSt10unique_ptrI14TfLiteIntArrayPFvPS0_EEptEv(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  %52 = getelementptr inbounds i8, ptr %51, i64 4
  %53 = xor i64 %indvars.iv, -1
  %54 = add nsw i64 %23, %53
  %55 = getelementptr inbounds [0 x i32], ptr %52, i64 0, i64 %54
  store i32 %50, ptr %55, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.critedge, label %.lr.ph, !llvm.loop !23

56:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  br label %58

.critedge:                                        ; preds = %48, %21
  %57 = call noundef ptr @_ZNSt10unique_ptrI14TfLiteIntArrayPFvPS0_EE7releaseEv(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  store ptr %57, ptr %3, align 8, !tbaa !20
  br label %58

58:                                               ; preds = %56, %.critedge
  %.3 = phi i32 [ 0, %.critedge ], [ 1, %56 ]
  call void @_ZNSt10unique_ptrI14TfLiteIntArrayPFvPS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  br label %59

59:                                               ; preds = %58, %17
  %.4 = phi i32 [ 0, %17 ], [ %.3, %58 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  ret i32 %.4
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6tflite13NumDimensionsEPK12TfLiteTensor(ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZN6tflite11NumElementsEPK12TfLiteTensor(ptr noundef) local_unnamed_addr #3

declare ptr @TfLiteIntArrayCopy(ptr noundef) local_unnamed_addr #4

declare ptr @TfLiteIntArrayCreate(i32 noundef) local_unnamed_addr #4

declare void @TfLiteIntArrayFree(ptr noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10unique_ptrI14TfLiteIntArrayPFvPS0_EEC2IS3_vEES1_NSt9enable_ifIXntsr19is_lvalue_referenceIT_EE5valueEOS7_E4typeE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6tflite15SizeOfDimensionEPK12TfLiteTensori(ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt10unique_ptrI14TfLiteIntArrayPFvPS0_EEptEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNSt10unique_ptrI14TfLiteIntArrayPFvPS0_EE7releaseEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10unique_ptrI14TfLiteIntArrayPFvPS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #5 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { inlinehint 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 = { inlinehint mustprogress 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 = { "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 = { 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 #6 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !12, i64 16}
!10 = !{!"_ZTS12TfLiteTensor", !11, i64 0, !7, i64 8, !12, i64 16, !13, i64 24, !15, i64 32, !16, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !6, i64 72, !17, i64 76, !17, i64 77, !18, i64 80, !12, i64 96, !12, i64 104}
!11 = !{!"_ZTS10TfLiteType", !7, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"_ZTS24TfLiteQuantizationParams", !14, i64 0, !6, i64 4}
!14 = !{!"float", !7, i64 0}
!15 = !{!"_ZTS20TfLiteAllocationType", !7, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!"bool", !7, i64 0}
!18 = !{!"_ZTS18TfLiteQuantization", !19, i64 0, !12, i64 8}
!19 = !{!"_ZTS22TfLiteQuantizationType", !7, i64 0}
!20 = !{!12, !12, i64 0}
!21 = !{!22, !12, i64 40}
!22 = !{!"_ZTS13TfLiteContext", !16, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !6, i64 72, !12, i64 80, !12, i64 88, !17, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !12, i64 152}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass