; LLVM IR from tensorflow/tflite-micro :: 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::__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.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::_Head_base.1" }
%"struct.std::_Head_base.1" = type { ptr }
%struct.TfLiteContext = type { i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, 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.TfLiteIntArray = type { i32, [0 x i32] }

@.str.24 = external hidden unnamed_addr constant [48 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6tflite13NumDimensionsEPK12TfLiteTensor(ptr noundef) #1

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

declare ptr @TfLiteIntArrayCreate(i32 noundef) #2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6tflite19GetShapeDebugStringB5cxx11EPK14TfLiteIntArray(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef) #4

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

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

30:                                               ; preds = %145, %4
  %31 = load i32, ptr %14, align 4, !tbaa !9
  %32 = load i32, ptr %12, align 4, !tbaa !9
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  store i32 2, ptr %15, align 4
  br label %150

35:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %36 = load i32, ptr %14, align 4, !tbaa !9
  %37 = load i32, ptr %10, align 4, !tbaa !9
  %38 = icmp sge i32 %36, %37
  br i1 %38, label %39, label %40

39:                                               ; preds = %35
  br label %48

40:                                               ; preds = %35
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = load i32, ptr %10, align 4, !tbaa !9
  %43 = load i32, ptr %14, align 4, !tbaa !9
  %44 = sub nsw i32 %42, %43
  %45 = sub nsw i32 %44, 1
  %46 = invoke noundef i32 @_ZN6tflite15SizeOfDimensionEPK12TfLiteTensori(ptr noundef %41, i32 noundef %45)
          to label %47 unwind label %92

47:                                               ; preds = %40
  br label %48

48:                                               ; preds = %47, %39
  %49 = phi i32 [ 1, %39 ], [ %46, %47 ]
  store i32 %49, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %50 = load i32, ptr %14, align 4, !tbaa !9
  %51 = load i32, ptr %11, align 4, !tbaa !9
  %52 = icmp sge i32 %50, %51
  br i1 %52, label %53, label %54

53:                                               ; preds = %48
  br label %62

54:                                               ; preds = %48
  %55 = load ptr, ptr %8, align 8, !tbaa !5
  %56 = load i32, ptr %11, align 4, !tbaa !9
  %57 = load i32, ptr %14, align 4, !tbaa !9
  %58 = sub nsw i32 %56, %57
  %59 = sub nsw i32 %58, 1
  %60 = invoke noundef i32 @_ZN6tflite15SizeOfDimensionEPK12TfLiteTensori(ptr noundef %55, i32 noundef %59)
          to label %61 unwind label %96

61:                                               ; preds = %54
  br label %62

62:                                               ; preds = %61, %53
  %63 = phi i32 [ 1, %53 ], [ %60, %61 ]
  store i32 %63, ptr %19, align 4, !tbaa !9
  %64 = load i32, ptr %16, align 4, !tbaa !9
  %65 = load i32, ptr %19, align 4, !tbaa !9
  %66 = icmp eq i32 %64, %65
  br i1 %66, label %114, label %67

67:                                               ; preds = %62
  %68 = load i32, ptr %16, align 4, !tbaa !9
  %69 = icmp eq i32 %68, 1
  br i1 %69, label %114, label %70

70:                                               ; preds = %67
  %71 = load i32, ptr %19, align 4, !tbaa !9
  %72 = icmp eq i32 %71, 1
  br i1 %72, label %114, label %73

73:                                               ; preds = %70
  br label %74

74:                                               ; preds = %73
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.TfLiteContext, ptr %75, i32 0, i32 5
  %77 = load ptr, ptr %76, align 8, !tbaa !11
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %20) #5
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.TfLiteTensor, ptr %79, i32 0, i32 2
  %81 = load ptr, ptr %80, align 8, !tbaa !15
  invoke void @_ZN6tflite19GetShapeDebugStringB5cxx11EPK14TfLiteIntArray(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %20, ptr noundef %81)
          to label %82 unwind label %100

82:                                               ; preds = %74
  %83 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %20) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %21) #5
  %84 = load ptr, ptr %8, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.TfLiteTensor, ptr %84, i32 0, i32 2
  %86 = load ptr, ptr %85, align 8, !tbaa !15
  invoke void @_ZN6tflite19GetShapeDebugStringB5cxx11EPK14TfLiteIntArray(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %21, ptr noundef %86)
          to label %87 unwind label %104

87:                                               ; preds = %82
  %88 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %21) #5
  invoke void (ptr, ptr, ...) %77(ptr noundef %78, ptr noundef @.str.24, ptr noundef %83, ptr noundef %88)
          to label %89 unwind label %108

89:                                               ; preds = %87
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %21) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #5
  br label %90

90:                                               ; preds = %89
  br label %91

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

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

96:                                               ; preds = %129, %54
  %97 = landingpad { ptr, i32 }
          cleanup
  %98 = extractvalue { ptr, i32 } %97, 0
  store ptr %98, ptr %17, align 8
  %99 = extractvalue { ptr, i32 } %97, 1
  store i32 %99, ptr %18, align 4
  br label %148

100:                                              ; preds = %74
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %17, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %18, align 4
  br label %113

104:                                              ; preds = %82
  %105 = landingpad { ptr, i32 }
          cleanup
  %106 = extractvalue { ptr, i32 } %105, 0
  store ptr %106, ptr %17, align 8
  %107 = extractvalue { ptr, i32 } %105, 1
  store i32 %107, ptr %18, align 4
  br label %112

108:                                              ; preds = %87
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %17, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %18, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %21) #5
  br label %112

112:                                              ; preds = %108, %104
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #5
  br label %113

113:                                              ; preds = %112, %100
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #5
  br label %148

114:                                              ; preds = %70, %67, %62
  %115 = load i32, ptr %16, align 4, !tbaa !9
  %116 = icmp eq i32 %115, 0
  br i1 %116, label %120, label %117

117:                                              ; preds = %114
  %118 = load i32, ptr %19, align 4, !tbaa !9
  %119 = icmp eq i32 %118, 0
  br i1 %119, label %120, label %129

120:                                              ; preds = %117, %114
  %121 = call noundef ptr @_ZNKSt10unique_ptrI14TfLiteIntArrayN6tflite14array_internal18TfLiteArrayDeleterEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  %122 = getelementptr inbounds %struct.TfLiteIntArray, ptr %121, i32 0, i32 1
  %123 = load i32, ptr %12, align 4, !tbaa !9
  %124 = load i32, ptr %14, align 4, !tbaa !9
  %125 = sub nsw i32 %123, %124
  %126 = sub nsw i32 %125, 1
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [0 x i32], ptr %122, i64 0, i64 %127
  store i32 0, ptr %128, align 4, !tbaa !9
  br label %141

129:                                              ; preds = %117
  %130 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %19)
          to label %131 unwind label %96

131:                                              ; preds = %129
  %132 = load i32, ptr %130, align 4, !tbaa !9
  %133 = call noundef ptr @_ZNKSt10unique_ptrI14TfLiteIntArrayN6tflite14array_internal18TfLiteArrayDeleterEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  %134 = getelementptr inbounds %struct.TfLiteIntArray, ptr %133, i32 0, i32 1
  %135 = load i32, ptr %12, align 4, !tbaa !9
  %136 = load i32, ptr %14, align 4, !tbaa !9
  %137 = sub nsw i32 %135, %136
  %138 = sub nsw i32 %137, 1
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [0 x i32], ptr %134, i64 0, i64 %139
  store i32 %132, ptr %140, align 4, !tbaa !9
  br label %141

141:                                              ; preds = %131, %120
  store i32 0, ptr %15, align 4
  br label %142

142:                                              ; preds = %141, %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  %143 = load i32, ptr %15, align 4
  switch i32 %143, label %150 [
    i32 0, label %144
  ]

144:                                              ; preds = %142
  br label %145

145:                                              ; preds = %144
  %146 = load i32, ptr %14, align 4, !tbaa !9
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %14, align 4, !tbaa !9
  br label %30, !llvm.loop !23

148:                                              ; preds = %113, %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %149

149:                                              ; preds = %148, %92
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @_ZNSt10unique_ptrI14TfLiteIntArrayN6tflite14array_internal18TfLiteArrayDeleterEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %157

150:                                              ; preds = %142, %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  %151 = load i32, ptr %15, align 4
  switch i32 %151, label %155 [
    i32 2, label %152
  ]

152:                                              ; preds = %150
  %153 = call noundef ptr @_ZNSt10unique_ptrI14TfLiteIntArrayN6tflite14array_internal18TfLiteArrayDeleterEE7releaseEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  %154 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %153, ptr %154, align 8, !tbaa !5
  store i32 0, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %155

155:                                              ; preds = %152, %150
  call void @_ZNSt10unique_ptrI14TfLiteIntArrayN6tflite14array_internal18TfLiteArrayDeleterEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  %156 = load i32, ptr %5, align 4
  ret i32 %156

157:                                              ; preds = %149
  %158 = load ptr, ptr %17, align 8
  %159 = load i32, ptr %18, align 4
  %160 = insertvalue { ptr, i32 } poison, ptr %158, 0
  %161 = insertvalue { ptr, i32 } %160, i32 %159, 1
  resume { ptr, i32 } %161
}

; 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)) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

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

@.str.24 = external hidden unnamed_addr constant [48 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6tflite13NumDimensionsEPK12TfLiteTensor(ptr noundef) local_unnamed_addr #1

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

declare ptr @TfLiteIntArrayCreate(i32 noundef) local_unnamed_addr #2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6tflite19GetShapeDebugStringB5cxx11EPK14TfLiteIntArray(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef) local_unnamed_addr #4

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

; 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 #4 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 i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"class.std::__cxx11::basic_string", align 8
  %11 = alloca %"class.std::__cxx11::basic_string", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  %12 = tail call noundef i32 @_ZN6tflite13NumDimensionsEPK12TfLiteTensor(ptr noundef %1)
  store i32 %12, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  %13 = tail call noundef i32 @_ZN6tflite13NumDimensionsEPK12TfLiteTensor(ptr noundef %2)
  store i32 %13, ptr %6, align 4, !tbaa !5
  %14 = 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)
  %15 = load i32, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %16 = call ptr @TfLiteIntArrayCreate(i32 noundef %15)
  call void @_ZNSt10unique_ptrI14TfLiteIntArrayN6tflite14array_internal18TfLiteArrayDeleterEEC2IS3_vEEPS0_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef %16) #5
  %.not4445 = icmp sgt i32 %15, 0
  br i1 %.not4445, label %.lr.ph.preheader, label %.critedge

.lr.ph.preheader:                                 ; preds = %4
  %17 = zext nneg i32 %15 to i64
  %wide.trip.count = zext nneg i32 %15 to i64
  br label %.lr.ph

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

20:                                               ; preds = %.lr.ph
  %21 = trunc i64 %indvars.iv to i32
  %22 = xor i32 %21, -1
  %23 = add i32 %18, %22
  %24 = call noundef i32 @_ZN6tflite15SizeOfDimensionEPK12TfLiteTensori(ptr noundef %1, i32 noundef %23)
  br label %25

25:                                               ; preds = %.lr.ph, %20
  %26 = phi i32 [ %24, %20 ], [ 1, %.lr.ph ]
  store i32 %26, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #5
  %27 = load i32, ptr %6, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %.not41 = icmp slt i64 %indvars.iv, %28
  br i1 %.not41, label %29, label %.thread

.thread:                                          ; preds = %25
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %56

29:                                               ; preds = %25
  %30 = trunc i64 %indvars.iv to i32
  %31 = xor i32 %30, -1
  %32 = add i32 %27, %31
  %33 = call noundef i32 @_ZN6tflite15SizeOfDimensionEPK12TfLiteTensori(ptr noundef %2, i32 noundef %32)
  %.pre = load i32, ptr %8, align 4
  store i32 %33, ptr %9, align 4, !tbaa !5
  %34 = icmp eq i32 %.pre, %33
  %35 = icmp eq i32 %.pre, 1
  %or.cond = or i1 %34, %35
  %36 = icmp eq i32 %33, 1
  %or.cond4 = or i1 %36, %or.cond
  br i1 %or.cond4, label %56, label %37

37:                                               ; preds = %29
  %38 = getelementptr inbounds i8, ptr %0, i64 40
  %39 = load ptr, ptr %38, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #5
  %40 = getelementptr inbounds i8, ptr %1, i64 16
  %41 = load ptr, ptr %40, align 8, !tbaa !14
  invoke void @_ZN6tflite19GetShapeDebugStringB5cxx11EPK14TfLiteIntArray(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %10, ptr noundef %41)
          to label %42 unwind label %48

42:                                               ; preds = %37
  %43 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %10) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #5
  %44 = getelementptr inbounds i8, ptr %2, i64 16
  %45 = load ptr, ptr %44, align 8, !tbaa !14
  invoke void @_ZN6tflite19GetShapeDebugStringB5cxx11EPK14TfLiteIntArray(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %11, ptr noundef %45)
          to label %46 unwind label %50

46:                                               ; preds = %42
  %47 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %11) #5
  invoke void (ptr, ptr, ...) %39(ptr noundef nonnull %0, ptr noundef nonnull @.str.24, ptr noundef %43, ptr noundef %47)
          to label %70 unwind label %52

48:                                               ; preds = %37
  %49 = landingpad { ptr, i32 }
          cleanup
  br label %55

50:                                               ; preds = %42
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %54

52:                                               ; preds = %46
  %53 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #5
  br label %54

54:                                               ; preds = %52, %50
  %.pn = phi { ptr, i32 } [ %53, %52 ], [ %51, %50 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #5
  br label %55

55:                                               ; preds = %54, %48
  %.pn.pn = phi { ptr, i32 } [ %.pn, %54 ], [ %49, %48 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  call void @_ZNSt10unique_ptrI14TfLiteIntArrayN6tflite14array_internal18TfLiteArrayDeleterEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  resume { ptr, i32 } %.pn.pn

56:                                               ; preds = %.thread, %29
  %57 = phi i32 [ 1, %.thread ], [ %33, %29 ]
  %58 = phi i32 [ %26, %.thread ], [ %.pre, %29 ]
  %59 = icmp eq i32 %58, 0
  %60 = icmp eq i32 %57, 0
  %or.cond6 = or i1 %60, %59
  br i1 %or.cond6, label %64, label %61

61:                                               ; preds = %56
  %62 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %63 = load i32, ptr %62, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %56, %61
  %.sink = phi i32 [ %63, %61 ], [ 0, %56 ]
  %65 = call noundef ptr @_ZNKSt10unique_ptrI14TfLiteIntArrayN6tflite14array_internal18TfLiteArrayDeleterEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  %66 = getelementptr inbounds i8, ptr %65, i64 4
  %67 = xor i64 %indvars.iv, -1
  %68 = add nsw i64 %17, %67
  %69 = getelementptr inbounds [0 x i32], ptr %66, i64 0, i64 %68
  store i32 %.sink, ptr %69, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  %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 !22

70:                                               ; preds = %46
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  br label %72

.critedge:                                        ; preds = %64, %4
  %71 = call noundef ptr @_ZNSt10unique_ptrI14TfLiteIntArrayN6tflite14array_internal18TfLiteArrayDeleterEE7releaseEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  store ptr %71, ptr %3, align 8, !tbaa !24
  br label %72

72:                                               ; preds = %70, %.critedge
  %.3 = phi i32 [ 0, %.critedge ], [ 1, %70 ]
  call void @_ZNSt10unique_ptrI14TfLiteIntArrayN6tflite14array_internal18TfLiteArrayDeleterEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  ret i32 %.3
}

; 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 #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

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


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