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

; 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.tflite::MeanParams" = type { i8, [4 x i16] }
%"class.tflite::RuntimeShape" = type { i32, %union.anon }
%union.anon = type { ptr, [16 x i8] }
%struct.TfLiteNode = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, 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.TfLiteReducerParams = type { i8 }
%struct.TfLiteIntArray = type { i32, [0 x i32] }

@.str.1 = external hidden unnamed_addr constant [134 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [209 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [269 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [183 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN6tflite8GetInputEPK13TfLiteContextPK10TfLiteNodei(ptr noundef, ptr noundef, i32 noundef) #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6tflite3ops5micro6reduce8EvalMeanEP13TfLiteContextP10TfLiteNode(ptr noundef %0, ptr noundef %1) #3 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %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 [4 x i32], align 16
  %12 = alloca [2 x i32], align 4
  %13 = alloca %"struct.tflite::MeanParams", align 2
  %14 = alloca i8, align 1
  %15 = alloca i32, align 4
  %16 = alloca %"class.tflite::RuntimeShape", align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca %"class.tflite::RuntimeShape", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = call noundef ptr @_ZN6tflite8GetInputEPK13TfLiteContextPK10TfLiteNodei(ptr noundef %20, ptr noundef %21, i32 noundef 0)
  store ptr %22, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = call noundef ptr @_ZN6tflite8GetInputEPK13TfLiteContextPK10TfLiteNodei(ptr noundef %23, ptr noundef %24, i32 noundef 1)
  store ptr %25, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = call noundef ptr @_ZN6tflite9GetOutputEP13TfLiteContextPK10TfLiteNodei(ptr noundef %26, ptr noundef %27, i32 noundef 0)
  store ptr %28, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.TfLiteNode, ptr %29, i32 0, i32 5
  %31 = load ptr, ptr %30, align 8, !tbaa !9
  store ptr %31, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = call noundef i64 @_ZN6tflite11NumElementsEPK12TfLiteTensor(ptr noundef %32)
  %34 = trunc i64 %33 to i32
  store i32 %34, ptr %10, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.TfLiteTensor, ptr %35, i32 0, i32 0
  %37 = load i32, ptr %36, align 8, !tbaa !13
  switch i32 %37, label %179 [
    i32 1, label %38
  ]

38:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 10, ptr %13) #5
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = call noundef ptr @_ZN6tflite13GetTensorDataIiEEPKT_PK12TfLiteTensor(ptr noundef %39)
  %41 = load i32, ptr %10, align 4, !tbaa !12
  call void @_ZN6tflite3ops5micro6reduce11ResolveAxisEPKiiPNS_10MeanParamsE(ptr noundef %40, i32 noundef %41, ptr noundef %13)
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #5
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = call noundef i32 @_ZN6tflite13NumDimensionsEPK12TfLiteTensor(ptr noundef %42)
  %44 = icmp eq i32 %43, 4
  br i1 %44, label %45, label %78

45:                                               ; preds = %38
  %46 = getelementptr inbounds %"struct.tflite::MeanParams", ptr %13, i32 0, i32 0
  %47 = load i8, ptr %46, align 2, !tbaa !23
  %48 = sext i8 %47 to i32
  %49 = icmp eq i32 %48, 2
  br i1 %49, label %50, label %78

50:                                               ; preds = %45
  %51 = getelementptr inbounds %"struct.tflite::MeanParams", ptr %13, i32 0, i32 1
  %52 = getelementptr inbounds [4 x i16], ptr %51, i64 0, i64 0
  %53 = load i16, ptr %52, align 2, !tbaa !25
  %54 = sext i16 %53 to i32
  %55 = icmp eq i32 %54, 1
  br i1 %55, label %56, label %62

56:                                               ; preds = %50
  %57 = getelementptr inbounds %"struct.tflite::MeanParams", ptr %13, i32 0, i32 1
  %58 = getelementptr inbounds [4 x i16], ptr %57, i64 0, i64 1
  %59 = load i16, ptr %58, align 2, !tbaa !25
  %60 = sext i16 %59 to i32
  %61 = icmp eq i32 %60, 2
  br i1 %61, label %76, label %62

62:                                               ; preds = %56, %50
  %63 = getelementptr inbounds %"struct.tflite::MeanParams", ptr %13, i32 0, i32 1
  %64 = getelementptr inbounds [4 x i16], ptr %63, i64 0, i64 0
  %65 = load i16, ptr %64, align 2, !tbaa !25
  %66 = sext i16 %65 to i32
  %67 = icmp eq i32 %66, 2
  br i1 %67, label %68, label %74

68:                                               ; preds = %62
  %69 = getelementptr inbounds %"struct.tflite::MeanParams", ptr %13, i32 0, i32 1
  %70 = getelementptr inbounds [4 x i16], ptr %69, i64 0, i64 1
  %71 = load i16, ptr %70, align 2, !tbaa !25
  %72 = sext i16 %71 to i32
  %73 = icmp eq i32 %72, 1
  br label %74

74:                                               ; preds = %68, %62
  %75 = phi i1 [ false, %62 ], [ %73, %68 ]
  br label %76

76:                                               ; preds = %74, %56
  %77 = phi i1 [ true, %56 ], [ %75, %74 ]
  br label %78

78:                                               ; preds = %76, %45, %38
  %79 = phi i1 [ false, %45 ], [ false, %38 ], [ %77, %76 ]
  %80 = zext i1 %79 to i8
  store i8 %80, ptr %14, align 1, !tbaa !27
  br label %81

81:                                               ; preds = %78
  %82 = load i8, ptr %14, align 1, !tbaa !27, !range !28, !noundef !29
  %83 = trunc i8 %82 to i1
  %84 = zext i1 %83 to i32
  %85 = icmp eq i32 %84, 1
  br i1 %85, label %94, label %86

86:                                               ; preds = %81
  br label %87

87:                                               ; preds = %86
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.TfLiteContext, ptr %88, i32 0, i32 5
  %90 = load ptr, ptr %89, align 8, !tbaa !30
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  call void (ptr, ptr, ...) %90(ptr noundef %91, ptr noundef @.str.9)
  br label %92

92:                                               ; preds = %87
  br label %93

93:                                               ; preds = %92
  store i32 1, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %176

94:                                               ; preds = %81
  br label %95

95:                                               ; preds = %94
  br label %96

96:                                               ; preds = %95
  %97 = load ptr, ptr %9, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.TfLiteReducerParams, ptr %97, i32 0, i32 0
  %99 = load i8, ptr %98, align 1, !tbaa !32, !range !28, !noundef !29
  %100 = trunc i8 %99 to i1
  br i1 %100, label %101, label %126

101:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #5
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN6tflite14GetTensorShapeEPK12TfLiteTensor(ptr dead_on_unwind writable sret(%"class.tflite::RuntimeShape") align 8 %16, ptr noundef %102)
  %103 = load ptr, ptr %6, align 8, !tbaa !5
  %104 = invoke noundef ptr @_ZN6tflite13GetTensorDataIfEEPKT_PK12TfLiteTensor(ptr noundef %103)
          to label %105 unwind label %112

105:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #5
  %106 = load ptr, ptr %8, align 8, !tbaa !5
  invoke void @_ZN6tflite14GetTensorShapeEPK12TfLiteTensor(ptr dead_on_unwind writable sret(%"class.tflite::RuntimeShape") align 8 %19, ptr noundef %106)
          to label %107 unwind label %116

107:                                              ; preds = %105
  %108 = load ptr, ptr %8, align 8, !tbaa !5
  %109 = invoke noundef ptr @_ZN6tflite13GetTensorDataIfEEPT_P12TfLiteTensor(ptr noundef %108)
          to label %110 unwind label %120

110:                                              ; preds = %107
  invoke void @_ZN6tflite13reference_ops4MeanIfEEvRKNS_10MeanParamsERKNS_12RuntimeShapeEPKT_S7_PS8_(ptr noundef nonnull align 2 dereferenceable(10) %13, ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef %104, ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef %109)
          to label %111 unwind label %120

111:                                              ; preds = %110
  call void @_ZN6tflite12RuntimeShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #5
  call void @_ZN6tflite12RuntimeShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #5
  br label %175

112:                                              ; preds = %101
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %17, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %18, align 4
  br label %125

116:                                              ; preds = %105
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %17, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %18, align 4
  br label %124

120:                                              ; preds = %110, %107
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %17, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %18, align 4
  call void @_ZN6tflite12RuntimeShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #5
  br label %124

124:                                              ; preds = %120, %116
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #5
  br label %125

125:                                              ; preds = %124, %112
  call void @_ZN6tflite12RuntimeShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 10, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %193

126:                                              ; preds = %96
  br label %127

127:                                              ; preds = %126
  %128 = load ptr, ptr %6, align 8, !tbaa !5
  %129 = call noundef ptr @_ZN6tflite13GetTensorDataIfEEPKT_PK12TfLiteTensor(ptr noundef %128)
  %130 = load ptr, ptr %6, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.TfLiteTensor, ptr %130, i32 0, i32 2
  %132 = load ptr, ptr %131, align 8, !tbaa !34
  %133 = getelementptr inbounds %struct.TfLiteIntArray, ptr %132, i32 0, i32 1
  %134 = getelementptr inbounds [0 x i32], ptr %133, i64 0, i64 0
  %135 = load ptr, ptr %6, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.TfLiteTensor, ptr %135, i32 0, i32 2
  %137 = load ptr, ptr %136, align 8, !tbaa !34
  %138 = getelementptr inbounds %struct.TfLiteIntArray, ptr %137, i32 0, i32 0
  %139 = load i32, ptr %138, align 4, !tbaa !12
  %140 = load ptr, ptr %8, align 8, !tbaa !5
  %141 = call noundef ptr @_ZN6tflite13GetTensorDataIfEEPT_P12TfLiteTensor(ptr noundef %140)
  %142 = load ptr, ptr %8, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.TfLiteTensor, ptr %142, i32 0, i32 2
  %144 = load ptr, ptr %143, align 8, !tbaa !34
  %145 = getelementptr inbounds %struct.TfLiteIntArray, ptr %144, i32 0, i32 1
  %146 = getelementptr inbounds [0 x i32], ptr %145, i64 0, i64 0
  %147 = load ptr, ptr %8, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.TfLiteTensor, ptr %147, i32 0, i32 2
  %149 = load ptr, ptr %148, align 8, !tbaa !34
  %150 = getelementptr inbounds %struct.TfLiteIntArray, ptr %149, i32 0, i32 0
  %151 = load i32, ptr %150, align 4, !tbaa !12
  %152 = load ptr, ptr %7, align 8, !tbaa !5
  %153 = call noundef ptr @_ZN6tflite13GetTensorDataIiEEPKT_PK12TfLiteTensor(ptr noundef %152)
  %154 = load i32, ptr %10, align 4, !tbaa !12
  %155 = load ptr, ptr %9, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.TfLiteReducerParams, ptr %155, i32 0, i32 0
  %157 = load i8, ptr %156, align 1, !tbaa !32, !range !28, !noundef !29
  %158 = trunc i8 %157 to i1
  %159 = getelementptr inbounds [4 x i32], ptr %11, i64 0, i64 0
  %160 = getelementptr inbounds [2 x i32], ptr %12, i64 0, i64 0
  %161 = load ptr, ptr %8, align 8, !tbaa !5
  %162 = call noundef ptr @_ZN6tflite13GetTensorDataIfEEPT_P12TfLiteTensor(ptr noundef %161)
  %163 = call noundef zeroext i1 @_ZN6tflite13reference_ops4MeanIffEEbPKT_PKiiPS2_S6_iS6_ibPiS8_PT0_(ptr noundef %129, ptr noundef %134, i32 noundef %139, ptr noundef %141, ptr noundef %146, i32 noundef %151, ptr noundef %153, i32 noundef %154, i1 noundef zeroext %158, ptr noundef %159, ptr noundef %160, ptr noundef %162)
  br i1 %163, label %172, label %164

164:                                              ; preds = %127
  br label %165

165:                                              ; preds = %164
  %166 = load ptr, ptr %4, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.TfLiteContext, ptr %166, i32 0, i32 5
  %168 = load ptr, ptr %167, align 8, !tbaa !30
  %169 = load ptr, ptr %4, align 8, !tbaa !5
  call void (ptr, ptr, ...) %168(ptr noundef %169, ptr noundef @.str.10, ptr noundef @.str.1, i32 noundef 109, ptr noundef @.str.11)
  br label %170

170:                                              ; preds = %165
  br label %171

171:                                              ; preds = %170
  store i32 1, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %176

172:                                              ; preds = %127
  br label %173

173:                                              ; preds = %172
  br label %174

174:                                              ; preds = %173
  br label %175

175:                                              ; preds = %174, %111
  store i32 0, ptr %15, align 4
  br label %176

176:                                              ; preds = %175, %171, %93
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 10, ptr %13) #5
  %177 = load i32, ptr %15, align 4
  switch i32 %177, label %191 [
    i32 0, label %178
  ]

178:                                              ; preds = %176
  br label %190

179:                                              ; preds = %2
  br label %180

180:                                              ; preds = %179
  br label %181

181:                                              ; preds = %180
  %182 = load ptr, ptr %4, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.TfLiteContext, ptr %182, i32 0, i32 5
  %184 = load ptr, ptr %183, align 8, !tbaa !30
  %185 = load ptr, ptr %4, align 8, !tbaa !5
  call void (ptr, ptr, ...) %184(ptr noundef %185, ptr noundef @.str.12)
  br label %186

186:                                              ; preds = %181
  br label %187

187:                                              ; preds = %186
  store i32 1, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %191

188:                                              ; No predecessors!
  br label %189

189:                                              ; preds = %188
  br label %190

190:                                              ; preds = %189, %178
  store i32 0, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %191

191:                                              ; preds = %190, %187, %176
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %192 = load i32, ptr %3, align 4
  ret i32 %192

193:                                              ; preds = %125
  %194 = load ptr, ptr %17, align 8
  %195 = load i32, ptr %18, align 4
  %196 = insertvalue { ptr, i32 } poison, ptr %194, 0
  %197 = insertvalue { ptr, i32 } %196, i32 %195, 1
  resume { ptr, i32 } %197
}

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6tflite13reference_ops4MeanIfEEvRKNS_10MeanParamsERKNS_12RuntimeShapeEPKT_S7_PS8_(ptr noundef nonnull align 2 dereferenceable(10), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6tflite14GetTensorShapeEPK12TfLiteTensor(ptr dead_on_unwind noalias writable sret(%"class.tflite::RuntimeShape") align 8, ptr noundef) #4

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6tflite13reference_ops4MeanIffEEbPKT_PKiiPS2_S6_iS6_ibPiS8_PT0_(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, i1 noundef zeroext, ptr noundef, ptr noundef, ptr noundef) #4

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 = { 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 = { 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 = { 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 #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, !6, i64 40}
!10 = !{!"_ZTS10TfLiteNode", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !11, i64 56, !6, i64 64}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"_ZTS12TfLiteTensor", !15, i64 0, !7, i64 8, !6, i64 16, !16, i64 24, !18, i64 32, !19, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !11, i64 72, !20, i64 76, !20, i64 77, !21, i64 80, !6, i64 96, !6, i64 104}
!15 = !{!"_ZTS10TfLiteType", !7, i64 0}
!16 = !{!"_ZTS24TfLiteQuantizationParams", !17, i64 0, !11, i64 4}
!17 = !{!"float", !7, i64 0}
!18 = !{!"_ZTS20TfLiteAllocationType", !7, i64 0}
!19 = !{!"long", !7, i64 0}
!20 = !{!"bool", !7, i64 0}
!21 = !{!"_ZTS18TfLiteQuantization", !22, i64 0, !6, i64 8}
!22 = !{!"_ZTS22TfLiteQuantizationType", !7, i64 0}
!23 = !{!24, !7, i64 0}
!24 = !{!"_ZTSN6tflite10MeanParamsE", !7, i64 0, !7, i64 2}
!25 = !{!26, !26, i64 0}
!26 = !{!"short", !7, i64 0}
!27 = !{!20, !20, i64 0}
!28 = !{i8 0, i8 2}
!29 = !{}
!30 = !{!31, !6, i64 40}
!31 = !{!"_ZTS13TfLiteContext", !19, 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, !11, i64 72, !6, i64 80, !6, i64 88, !20, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152}
!32 = !{!33, !20, i64 0}
!33 = !{!"_ZTS19TfLiteReducerParams", !20, i64 0}
!34 = !{!14, !6, i64 16}


; 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.tflite::MeanParams" = type { i8, [4 x i16] }
%"class.tflite::RuntimeShape" = type { i32, %union.anon }
%union.anon = type { ptr, [16 x i8] }

@.str.1 = external hidden unnamed_addr constant [134 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [209 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [269 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [183 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN6tflite8GetInputEPK13TfLiteContextPK10TfLiteNodei(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; 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 nounwind uwtable
declare dso_local void @_ZN6tflite3ops5micro6reduce11ResolveAxisEPKiiPNS_10MeanParamsE(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 2) i32 @_ZN6tflite3ops5micro6reduce8EvalMeanEP13TfLiteContextP10TfLiteNode(ptr noundef %0, ptr noundef %1) local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %3 = alloca [4 x i32], align 16
  %4 = alloca [2 x i32], align 4
  %5 = alloca %"struct.tflite::MeanParams", align 2
  %6 = alloca %"class.tflite::RuntimeShape", align 8
  %7 = alloca %"class.tflite::RuntimeShape", align 8
  %8 = tail call noundef ptr @_ZN6tflite8GetInputEPK13TfLiteContextPK10TfLiteNodei(ptr noundef %0, ptr noundef %1, i32 noundef 0)
  %9 = tail call noundef ptr @_ZN6tflite8GetInputEPK13TfLiteContextPK10TfLiteNodei(ptr noundef %0, ptr noundef %1, i32 noundef 1)
  %10 = tail call noundef ptr @_ZN6tflite9GetOutputEP13TfLiteContextPK10TfLiteNodei(ptr noundef %0, ptr noundef %1, i32 noundef 0)
  %11 = getelementptr inbounds i8, ptr %1, i64 40
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = tail call noundef i64 @_ZN6tflite11NumElementsEPK12TfLiteTensor(ptr noundef %9)
  %14 = trunc i64 %13 to i32
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %15 = load i32, ptr %8, align 8, !tbaa !11
  %cond = icmp eq i32 %15, 1
  br i1 %cond, label %16, label %68

16:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %5) #5
  %17 = tail call noundef ptr @_ZN6tflite13GetTensorDataIiEEPKT_PK12TfLiteTensor(ptr noundef %9)
  call void @_ZN6tflite3ops5micro6reduce11ResolveAxisEPKiiPNS_10MeanParamsE(ptr noundef %17, i32 noundef %14, ptr noundef nonnull %5)
  %18 = call noundef i32 @_ZN6tflite13NumDimensionsEPK12TfLiteTensor(ptr noundef nonnull %8)
  %19 = icmp eq i32 %18, 4
  %20 = load i8, ptr %5, align 2
  %21 = icmp eq i8 %20, 2
  %or.cond = select i1 %19, i1 %21, i1 false
  br i1 %or.cond, label %22, label %.critedge

22:                                               ; preds = %16
  %23 = getelementptr inbounds i8, ptr %5, i64 2
  %24 = load i16, ptr %23, align 2, !tbaa !21
  %25 = icmp eq i16 %24, 1
  %26 = getelementptr inbounds i8, ptr %5, i64 4
  %27 = load i16, ptr %26, align 2
  %28 = icmp eq i16 %27, 2
  %or.cond9 = select i1 %25, i1 %28, i1 false
  br i1 %or.cond9, label %.critedge51, label %29

29:                                               ; preds = %22
  %30 = icmp eq i16 %24, 2
  %31 = icmp eq i16 %27, 1
  %32 = select i1 %30, i1 %31, i1 false
  br i1 %32, label %.critedge51, label %.critedge

.critedge:                                        ; preds = %16, %29
  %33 = getelementptr inbounds i8, ptr %0, i64 40
  %34 = load ptr, ptr %33, align 8, !tbaa !23
  call void (ptr, ptr, ...) %34(ptr noundef %0, ptr noundef nonnull @.str.9)
  br label %66

.critedge51:                                      ; preds = %22, %29
  %35 = load i8, ptr %12, align 1, !tbaa !25, !range !27, !noundef !28
  %36 = trunc nuw i8 %35 to i1
  br i1 %36, label %37, label %47

37:                                               ; preds = %.critedge51
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #5
  call void @_ZN6tflite14GetTensorShapeEPK12TfLiteTensor(ptr dead_on_unwind nonnull writable sret(%"class.tflite::RuntimeShape") align 8 %6, ptr noundef nonnull %8)
  %38 = call noundef ptr @_ZN6tflite13GetTensorDataIfEEPKT_PK12TfLiteTensor(ptr noundef nonnull %8)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #5
  invoke void @_ZN6tflite14GetTensorShapeEPK12TfLiteTensor(ptr dead_on_unwind nonnull writable sret(%"class.tflite::RuntimeShape") align 8 %7, ptr noundef %10)
          to label %39 unwind label %42

39:                                               ; preds = %37
  %40 = call noundef ptr @_ZN6tflite13GetTensorDataIfEEPT_P12TfLiteTensor(ptr noundef %10)
  invoke void @_ZN6tflite13reference_ops4MeanIfEEvRKNS_10MeanParamsERKNS_12RuntimeShapeEPKT_S7_PS8_(ptr noundef nonnull align 2 dereferenceable(10) %5, ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef %38, ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef %40)
          to label %41 unwind label %44

41:                                               ; preds = %39
  call void @_ZN6tflite12RuntimeShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  call void @_ZN6tflite12RuntimeShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  br label %67

42:                                               ; preds = %37
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %46

44:                                               ; preds = %39
  %45 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6tflite12RuntimeShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  br label %46

46:                                               ; preds = %44, %42
  %.pn = phi { ptr, i32 } [ %45, %44 ], [ %43, %42 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  call void @_ZN6tflite12RuntimeShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  resume { ptr, i32 } %.pn

47:                                               ; preds = %.critedge51
  %48 = call noundef ptr @_ZN6tflite13GetTensorDataIfEEPKT_PK12TfLiteTensor(ptr noundef nonnull %8)
  %49 = getelementptr inbounds i8, ptr %8, i64 16
  %50 = load ptr, ptr %49, align 8, !tbaa !29
  %51 = getelementptr inbounds i8, ptr %50, i64 4
  %52 = load i32, ptr %50, align 4, !tbaa !30
  %53 = call noundef ptr @_ZN6tflite13GetTensorDataIfEEPT_P12TfLiteTensor(ptr noundef %10)
  %54 = getelementptr inbounds i8, ptr %10, i64 16
  %55 = load ptr, ptr %54, align 8, !tbaa !29
  %56 = getelementptr inbounds i8, ptr %55, i64 4
  %57 = load i32, ptr %55, align 4, !tbaa !30
  %58 = call noundef ptr @_ZN6tflite13GetTensorDataIiEEPKT_PK12TfLiteTensor(ptr noundef %9)
  %59 = load i8, ptr %12, align 1, !tbaa !25, !range !27, !noundef !28
  %60 = trunc nuw i8 %59 to i1
  %61 = call noundef ptr @_ZN6tflite13GetTensorDataIfEEPT_P12TfLiteTensor(ptr noundef %10)
  %62 = call noundef zeroext i1 @_ZN6tflite13reference_ops4MeanIffEEbPKT_PKiiPS2_S6_iS6_ibPiS8_PT0_(ptr noundef %48, ptr noundef nonnull %51, i32 noundef %52, ptr noundef %53, ptr noundef nonnull %56, i32 noundef %57, ptr noundef %58, i32 noundef %14, i1 noundef zeroext %60, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef %61)
  br i1 %62, label %67, label %63

63:                                               ; preds = %47
  %64 = getelementptr inbounds i8, ptr %0, i64 40
  %65 = load ptr, ptr %64, align 8, !tbaa !23
  call void (ptr, ptr, ...) %65(ptr noundef %0, ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.1, i32 noundef 109, ptr noundef nonnull @.str.11)
  br label %66

66:                                               ; preds = %63, %.critedge
  call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %5) #5
  br label %71

67:                                               ; preds = %47, %41
  call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %5) #5
  br label %71

68:                                               ; preds = %2
  %69 = getelementptr inbounds i8, ptr %0, i64 40
  %70 = load ptr, ptr %69, align 8, !tbaa !23
  tail call void (ptr, ptr, ...) %70(ptr noundef %0, ptr noundef nonnull @.str.12)
  br label %71

71:                                               ; preds = %67, %66, %68
  %.1 = phi i32 [ 1, %68 ], [ 0, %67 ], [ 1, %66 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  ret i32 %.1
}

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6tflite13reference_ops4MeanIfEEvRKNS_10MeanParamsERKNS_12RuntimeShapeEPKT_S7_PS8_(ptr noundef nonnull align 2 dereferenceable(10), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6tflite14GetTensorShapeEPK12TfLiteTensor(ptr dead_on_unwind noalias writable sret(%"class.tflite::RuntimeShape") align 8, ptr noundef) local_unnamed_addr #4

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6tflite13reference_ops4MeanIffEEbPKT_PKiiPS2_S6_iS6_ibPiS8_PT0_(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, i1 noundef zeroext, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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 = { 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 = { 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 = { 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 #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, !7, i64 40}
!6 = !{!"_ZTS10TfLiteNode", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !10, i64 56, !7, i64 64}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTS12TfLiteTensor", !13, i64 0, !8, i64 8, !7, i64 16, !14, i64 24, !16, i64 32, !17, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !10, i64 72, !18, i64 76, !18, i64 77, !19, i64 80, !7, i64 96, !7, i64 104}
!13 = !{!"_ZTS10TfLiteType", !8, i64 0}
!14 = !{!"_ZTS24TfLiteQuantizationParams", !15, i64 0, !10, i64 4}
!15 = !{!"float", !8, i64 0}
!16 = !{!"_ZTS20TfLiteAllocationType", !8, i64 0}
!17 = !{!"long", !8, i64 0}
!18 = !{!"bool", !8, i64 0}
!19 = !{!"_ZTS18TfLiteQuantization", !20, i64 0, !7, i64 8}
!20 = !{!"_ZTS22TfLiteQuantizationType", !8, i64 0}
!21 = !{!22, !22, i64 0}
!22 = !{!"short", !8, i64 0}
!23 = !{!24, !7, i64 40}
!24 = !{!"_ZTS13TfLiteContext", !17, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !10, i64 72, !7, i64 80, !7, i64 88, !18, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152}
!25 = !{!26, !18, i64 0}
!26 = !{!"_ZTS19TfLiteReducerParams", !18, i64 0}
!27 = !{i8 0, i8 2}
!28 = !{}
!29 = !{!12, !7, i64 16}
!30 = !{!10, !10, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass