; LLVM IR from NVIDIA/tensorflow :: tensorflow/lite/experimental/micro/examples/micro_speech/micro_features (main)

; 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.complex_int16_t = type { i16, i16 }
%"class.tflite::MicroErrorReporter" = type { %"class.tflite::ErrorReporter" }
%"class.tflite::ErrorReporter" = type { ptr }
%struct.FftState = type { [512 x i16], [514 x %struct.complex_int16_t], i64, i64, [2848 x i8], i64 }

@_ZN10micro_test12tests_passedE = external dso_local global i32, align 4
@_ZN10micro_test12tests_failedE = external dso_local global i32, align 4
@_ZN10micro_test16is_test_completeE = external dso_local global i8, align 1
@_ZN10micro_test13did_test_failE = external dso_local global i8, align 1
@_ZN10micro_test8reporterE = external dso_local global ptr, align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [104 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [135 x i8], align 1
@_ZN12_GLOBAL__N_111kFakeWindowE = external hidden constant [25 x i16], align 16
@__const.main.expected = external hidden unnamed_addr constant [17 x %struct.complex_int16_t], align 16
@.str.4 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [25 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca %"class.tflite::MicroErrorReporter", align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"class.tflite::MicroErrorReporter", align 8
  %10 = alloca ptr, align 8
  %11 = alloca %struct.FftState, align 8
  %12 = alloca [17 x %struct.complex_int16_t], align 16
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  store i32 0, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  store i32 0, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  call void @_ZN6tflite18MicroErrorReporterC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  store ptr %6, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %16 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %17 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef @.str, ptr noundef @.str.1)
          to label %18 unwind label %33

18:                                               ; preds = %2
  store i8 0, ptr @_ZN10micro_test16is_test_completeE, align 1, !tbaa !11
  store i8 0, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11
  br label %19

19:                                               ; preds = %199, %18
  %20 = load i8, ptr @_ZN10micro_test16is_test_completeE, align 1, !tbaa !11, !range !13, !noundef !14
  %21 = trunc i8 %20 to i1
  %22 = xor i1 %21, true
  br i1 %22, label %23, label %215

23:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @_ZN6tflite18MicroErrorReporterC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store ptr %9, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 5952, ptr %11) #6
  br label %24

24:                                               ; preds = %23
  %25 = load ptr, ptr %10, align 8, !tbaa !9
  %26 = invoke noundef i32 @_Z16FftPopulateStatePN6tflite13ErrorReporterEP8FftStatem(ptr noundef %25, ptr noundef %11, i64 noundef 25)
          to label %27 unwind label %37

27:                                               ; preds = %24
  %28 = icmp ne i32 %26, 0
  br i1 %28, label %41, label %29

29:                                               ; preds = %27
  %30 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %31 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef @.str.2, ptr noundef @.str.3, i32 noundef 37)
          to label %32 unwind label %37

32:                                               ; preds = %29
  store i8 1, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11
  br label %41

33:                                               ; preds = %229, %225, %215, %2
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %7, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %8, align 4
  br label %235

37:                                               ; preds = %44, %43, %29, %24
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %7, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %8, align 4
  br label %214

41:                                               ; preds = %32, %27
  br label %42

42:                                               ; preds = %41
  br label %43

43:                                               ; preds = %42
  invoke void @_Z7FftInitP8FftState(ptr noundef %11)
          to label %44 unwind label %37

44:                                               ; preds = %43
  invoke void @_Z10FftComputeP8FftStatePKsi(ptr noundef %11, ptr noundef @_ZN12_GLOBAL__N_111kFakeWindowE, i32 noundef 0)
          to label %45 unwind label %37

45:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 68, ptr %12) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %12, ptr align 16 @__const.main.expected, i64 68, i1 false)
  br label %46

46:                                               ; preds = %45
  %47 = getelementptr inbounds %struct.FftState, ptr %11, i32 0, i32 2
  %48 = load i64, ptr %47, align 8, !tbaa !15
  %49 = udiv i64 %48, 2
  %50 = add i64 %49, 1
  %51 = icmp ne i64 %50, 17
  br i1 %51, label %52, label %64

52:                                               ; preds = %46
  %53 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %54 = getelementptr inbounds %struct.FftState, ptr %11, i32 0, i32 2
  %55 = load i64, ptr %54, align 8, !tbaa !15
  %56 = udiv i64 %55, 2
  %57 = add i64 %56, 1
  %58 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %53, ptr noundef @.str.4, ptr noundef @.str.3, i32 noundef 47, i64 noundef %57, i64 noundef 17)
          to label %59 unwind label %60

59:                                               ; preds = %52
  store i8 1, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11
  br label %64

60:                                               ; preds = %52
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %7, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %8, align 4
  br label %213

64:                                               ; preds = %59, %46
  br label %65

65:                                               ; preds = %64
  br label %66

66:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %195, %66
  %68 = load i32, ptr %13, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds %struct.FftState, ptr %11, i32 0, i32 2
  %71 = load i64, ptr %70, align 8, !tbaa !15
  %72 = udiv i64 %71, 2
  %73 = icmp ule i64 %69, %72
  br i1 %73, label %74, label %198

74:                                               ; preds = %67
  br label %75

75:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %76 = getelementptr inbounds %struct.FftState, ptr %11, i32 0, i32 1
  %77 = load i32, ptr %13, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [514 x %struct.complex_int16_t], ptr %76, i64 0, i64 %78
  %80 = getelementptr inbounds %struct.complex_int16_t, ptr %79, i32 0, i32 0
  %81 = load i16, ptr %80, align 4, !tbaa !18
  %82 = sext i16 %81 to i32
  %83 = load i32, ptr %13, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [17 x %struct.complex_int16_t], ptr %12, i64 0, i64 %84
  %86 = getelementptr inbounds %struct.complex_int16_t, ptr %85, i32 0, i32 0
  %87 = load i16, ptr %86, align 4, !tbaa !18
  %88 = sext i16 %87 to i32
  %89 = icmp sgt i32 %82, %88
  br i1 %89, label %90, label %105

90:                                               ; preds = %75
  %91 = getelementptr inbounds %struct.FftState, ptr %11, i32 0, i32 1
  %92 = load i32, ptr %13, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [514 x %struct.complex_int16_t], ptr %91, i64 0, i64 %93
  %95 = getelementptr inbounds %struct.complex_int16_t, ptr %94, i32 0, i32 0
  %96 = load i16, ptr %95, align 4, !tbaa !18
  %97 = sext i16 %96 to i32
  %98 = load i32, ptr %13, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [17 x %struct.complex_int16_t], ptr %12, i64 0, i64 %99
  %101 = getelementptr inbounds %struct.complex_int16_t, ptr %100, i32 0, i32 0
  %102 = load i16, ptr %101, align 4, !tbaa !18
  %103 = sext i16 %102 to i32
  %104 = sub nsw i32 %97, %103
  br label %120

105:                                              ; preds = %75
  %106 = load i32, ptr %13, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [17 x %struct.complex_int16_t], ptr %12, i64 0, i64 %107
  %109 = getelementptr inbounds %struct.complex_int16_t, ptr %108, i32 0, i32 0
  %110 = load i16, ptr %109, align 4, !tbaa !18
  %111 = sext i16 %110 to i32
  %112 = getelementptr inbounds %struct.FftState, ptr %11, i32 0, i32 1
  %113 = load i32, ptr %13, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [514 x %struct.complex_int16_t], ptr %112, i64 0, i64 %114
  %116 = getelementptr inbounds %struct.complex_int16_t, ptr %115, i32 0, i32 0
  %117 = load i16, ptr %116, align 4, !tbaa !18
  %118 = sext i16 %117 to i32
  %119 = sub nsw i32 %111, %118
  br label %120

120:                                              ; preds = %105, %90
  %121 = phi i32 [ %104, %90 ], [ %119, %105 ]
  store i32 %121, ptr %14, align 4, !tbaa !5
  %122 = load i32, ptr %14, align 4, !tbaa !5
  %123 = icmp sgt i32 %122, 2
  br i1 %123, label %124, label %132

124:                                              ; preds = %120
  %125 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %126 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %125, ptr noundef @.str.5, ptr noundef @.str.3, i32 noundef 50)
          to label %127 unwind label %128

127:                                              ; preds = %124
  store i8 1, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11
  br label %132

128:                                              ; preds = %124
  %129 = landingpad { ptr, i32 }
          cleanup
  %130 = extractvalue { ptr, i32 } %129, 0
  store ptr %130, ptr %7, align 8
  %131 = extractvalue { ptr, i32 } %129, 1
  store i32 %131, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %212

132:                                              ; preds = %127, %120
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %133

133:                                              ; preds = %132
  br label %134

134:                                              ; preds = %133
  br label %135

135:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %136 = getelementptr inbounds %struct.FftState, ptr %11, i32 0, i32 1
  %137 = load i32, ptr %13, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [514 x %struct.complex_int16_t], ptr %136, i64 0, i64 %138
  %140 = getelementptr inbounds %struct.complex_int16_t, ptr %139, i32 0, i32 1
  %141 = load i16, ptr %140, align 2, !tbaa !21
  %142 = sext i16 %141 to i32
  %143 = load i32, ptr %13, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [17 x %struct.complex_int16_t], ptr %12, i64 0, i64 %144
  %146 = getelementptr inbounds %struct.complex_int16_t, ptr %145, i32 0, i32 1
  %147 = load i16, ptr %146, align 2, !tbaa !21
  %148 = sext i16 %147 to i32
  %149 = icmp sgt i32 %142, %148
  br i1 %149, label %150, label %165

150:                                              ; preds = %135
  %151 = getelementptr inbounds %struct.FftState, ptr %11, i32 0, i32 1
  %152 = load i32, ptr %13, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [514 x %struct.complex_int16_t], ptr %151, i64 0, i64 %153
  %155 = getelementptr inbounds %struct.complex_int16_t, ptr %154, i32 0, i32 1
  %156 = load i16, ptr %155, align 2, !tbaa !21
  %157 = sext i16 %156 to i32
  %158 = load i32, ptr %13, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [17 x %struct.complex_int16_t], ptr %12, i64 0, i64 %159
  %161 = getelementptr inbounds %struct.complex_int16_t, ptr %160, i32 0, i32 1
  %162 = load i16, ptr %161, align 2, !tbaa !21
  %163 = sext i16 %162 to i32
  %164 = sub nsw i32 %157, %163
  br label %180

165:                                              ; preds = %135
  %166 = load i32, ptr %13, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [17 x %struct.complex_int16_t], ptr %12, i64 0, i64 %167
  %169 = getelementptr inbounds %struct.complex_int16_t, ptr %168, i32 0, i32 1
  %170 = load i16, ptr %169, align 2, !tbaa !21
  %171 = sext i16 %170 to i32
  %172 = getelementptr inbounds %struct.FftState, ptr %11, i32 0, i32 1
  %173 = load i32, ptr %13, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [514 x %struct.complex_int16_t], ptr %172, i64 0, i64 %174
  %176 = getelementptr inbounds %struct.complex_int16_t, ptr %175, i32 0, i32 1
  %177 = load i16, ptr %176, align 2, !tbaa !21
  %178 = sext i16 %177 to i32
  %179 = sub nsw i32 %171, %178
  br label %180

180:                                              ; preds = %165, %150
  %181 = phi i32 [ %164, %150 ], [ %179, %165 ]
  store i32 %181, ptr %15, align 4, !tbaa !5
  %182 = load i32, ptr %15, align 4, !tbaa !5
  %183 = icmp sgt i32 %182, 2
  br i1 %183, label %184, label %192

184:                                              ; preds = %180
  %185 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %186 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %185, ptr noundef @.str.6, ptr noundef @.str.3, i32 noundef 51)
          to label %187 unwind label %188

187:                                              ; preds = %184
  store i8 1, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11
  br label %192

188:                                              ; preds = %184
  %189 = landingpad { ptr, i32 }
          cleanup
  %190 = extractvalue { ptr, i32 } %189, 0
  store ptr %190, ptr %7, align 8
  %191 = extractvalue { ptr, i32 } %189, 1
  store i32 %191, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %212

192:                                              ; preds = %187, %180
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %193

193:                                              ; preds = %192
  br label %194

194:                                              ; preds = %193
  br label %195

195:                                              ; preds = %194
  %196 = load i32, ptr %13, align 4, !tbaa !5
  %197 = add nsw i32 %196, 1
  store i32 %197, ptr %13, align 4, !tbaa !5
  br label %67, !llvm.loop !22

198:                                              ; preds = %67
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 68, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 5952, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @_ZN6tflite13ErrorReporterD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %199

199:                                              ; preds = %198
  store i8 1, ptr @_ZN10micro_test16is_test_completeE, align 1, !tbaa !11
  %200 = load i8, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11, !range !13, !noundef !14
  %201 = trunc i8 %200 to i1
  %202 = zext i1 %201 to i64
  %203 = select i1 %201, i32 0, i32 1
  %204 = load i32, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %205 = add nsw i32 %204, %203
  store i32 %205, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %206 = load i8, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11, !range !13, !noundef !14
  %207 = trunc i8 %206 to i1
  %208 = zext i1 %207 to i64
  %209 = select i1 %207, i32 1, i32 0
  %210 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %211 = add nsw i32 %210, %209
  store i32 %211, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  br label %19, !llvm.loop !24

212:                                              ; preds = %188, %128
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %213

213:                                              ; preds = %212, %60
  call void @llvm.lifetime.end.p0(i64 68, ptr %12) #6
  br label %214

214:                                              ; preds = %213, %37
  call void @llvm.lifetime.end.p0(i64 5952, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @_ZN6tflite13ErrorReporterD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %235

215:                                              ; preds = %19
  %216 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %217 = load i32, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %218 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %219 = load i32, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %220 = add nsw i32 %218, %219
  %221 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %216, ptr noundef @.str.7, i32 noundef %217, i32 noundef %220)
          to label %222 unwind label %33

222:                                              ; preds = %215
  %223 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %224 = icmp eq i32 %223, 0
  br i1 %224, label %225, label %229

225:                                              ; preds = %222
  %226 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %227 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %226, ptr noundef @.str.8)
          to label %228 unwind label %33

228:                                              ; preds = %225
  br label %233

229:                                              ; preds = %222
  %230 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %231 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %230, ptr noundef @.str.9)
          to label %232 unwind label %33

232:                                              ; preds = %229
  br label %233

233:                                              ; preds = %232, %228
  call void @_ZN6tflite13ErrorReporterD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %234 = load i32, ptr %3, align 4
  ret i32 %234

235:                                              ; preds = %214, %33
  call void @_ZN6tflite13ErrorReporterD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %236

236:                                              ; preds = %235
  %237 = load ptr, ptr %7, align 8
  %238 = load i32, ptr %8, align 4
  %239 = insertvalue { ptr, i32 } poison, ptr %237, 0
  %240 = insertvalue { ptr, i32 } %239, i32 %238, 1
  resume { ptr, i32 } %240
}

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

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

declare noundef i32 @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, ...) #3

declare i32 @__gxx_personality_v0(...)

declare noundef i32 @_Z16FftPopulateStatePN6tflite13ErrorReporterEP8FftStatem(ptr noundef, ptr noundef, i64 noundef) #3

declare void @_Z7FftInitP8FftState(ptr noundef) #3

declare void @_Z10FftComputeP8FftStatePKsi(ptr noundef, ptr noundef, i32 noundef) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

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

attributes #0 = { mustprogress norecurse 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !17, i64 3080}
!16 = !{!"_ZTS8FftState", !7, i64 0, !7, i64 1024, !17, i64 3080, !17, i64 3088, !7, i64 3096, !17, i64 5944}
!17 = !{!"long", !7, i64 0}
!18 = !{!19, !20, i64 0}
!19 = !{!"_ZTS15complex_int16_t", !20, i64 0, !20, i64 2}
!20 = !{!"short", !7, i64 0}
!21 = !{!19, !20, i64 2}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}


; 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.complex_int16_t = type { i16, i16 }
%"class.tflite::MicroErrorReporter" = type { %"class.tflite::ErrorReporter" }
%"class.tflite::ErrorReporter" = type { ptr }
%struct.FftState = type { [512 x i16], [514 x %struct.complex_int16_t], i64, i64, [2848 x i8], i64 }

@_ZN10micro_test12tests_passedE = external dso_local local_unnamed_addr global i32, align 4
@_ZN10micro_test12tests_failedE = external dso_local local_unnamed_addr global i32, align 4
@_ZN10micro_test16is_test_completeE = external dso_local local_unnamed_addr global i8, align 1
@_ZN10micro_test13did_test_failE = external dso_local local_unnamed_addr global i8, align 1
@_ZN10micro_test8reporterE = external dso_local local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [104 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [135 x i8], align 1
@_ZN12_GLOBAL__N_111kFakeWindowE = external hidden constant [25 x i16], align 16
@__const.main.expected = external hidden unnamed_addr constant [17 x %struct.complex_int16_t], align 16
@.str.4 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [25 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.tflite::MicroErrorReporter", align 8
  %4 = alloca %"class.tflite::MicroErrorReporter", align 8
  %5 = alloca %struct.FftState, align 8
  store i32 0, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  store i32 0, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  call void @_ZN6tflite18MicroErrorReporterC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  store ptr %3, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %6 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1)
          to label %7 unwind label %16

7:                                                ; preds = %2
  store i8 0, ptr @_ZN10micro_test16is_test_completeE, align 1, !tbaa !11
  store i8 0, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11
  %8 = getelementptr inbounds i8, ptr %5, i64 3080
  %9 = getelementptr inbounds i8, ptr %5, i64 1024
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  call void @_ZN6tflite18MicroErrorReporterC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.start.p0(i64 5952, ptr nonnull %5) #5
  %10 = invoke noundef i32 @_Z16FftPopulateStatePN6tflite13ErrorReporterEP8FftStatem(ptr noundef nonnull %4, ptr noundef nonnull %5, i64 noundef 25)
          to label %11 unwind label %18

11:                                               ; preds = %7
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %12, label %20

12:                                               ; preds = %11
  %13 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %14 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, i32 noundef 37)
          to label %15 unwind label %18

15:                                               ; preds = %12
  store i8 1, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11
  br label %20

16:                                               ; preds = %.invoke, %._crit_edge, %2
  %17 = landingpad { ptr, i32 }
          cleanup
  br label %87

18:                                               ; preds = %21, %20, %12, %7
  %19 = landingpad { ptr, i32 }
          cleanup
  br label %71

20:                                               ; preds = %15, %11
  invoke void @_Z7FftInitP8FftState(ptr noundef nonnull %5)
          to label %21 unwind label %18

21:                                               ; preds = %20
  invoke void @_Z10FftComputeP8FftStatePKsi(ptr noundef nonnull %5, ptr noundef nonnull @_ZN12_GLOBAL__N_111kFakeWindowE, i32 noundef 0)
          to label %22 unwind label %18

22:                                               ; preds = %21
  %23 = load i64, ptr %8, align 8, !tbaa !13
  %24 = lshr i64 %23, 1
  %25 = add nuw i64 %24, 1
  %.not34 = icmp eq i64 %25, 17
  br i1 %.not34, label %.preheader, label %26

.preheader:                                       ; preds = %29, %22
  br label %32

26:                                               ; preds = %22
  %27 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %28 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.3, i32 noundef 47, i64 noundef %25, i64 noundef 17)
          to label %29 unwind label %30

29:                                               ; preds = %26
  store i8 1, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11
  br label %.preheader

30:                                               ; preds = %26
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %71

32:                                               ; preds = %.preheader, %68
  %indvars.iv = phi i64 [ %indvars.iv.next, %68 ], [ 0, %.preheader ]
  %33 = getelementptr inbounds [514 x %struct.complex_int16_t], ptr %9, i64 0, i64 %indvars.iv
  %34 = load i16, ptr %33, align 4, !tbaa !16
  %35 = sext i16 %34 to i32
  %36 = getelementptr inbounds [17 x %struct.complex_int16_t], ptr @__const.main.expected, i64 0, i64 %indvars.iv
  %37 = load i16, ptr %36, align 4, !tbaa !16
  %38 = sext i16 %37 to i32
  %39 = icmp sgt i16 %34, %37
  %40 = sub nsw i32 %35, %38
  %41 = sub nsw i32 %38, %35
  %42 = select i1 %39, i32 %40, i32 %41
  %43 = icmp sgt i32 %42, 2
  br i1 %43, label %44, label %50

44:                                               ; preds = %32
  %45 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %46 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %45, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3, i32 noundef 50)
          to label %47 unwind label %48

47:                                               ; preds = %44
  store i8 1, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11
  br label %50

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

50:                                               ; preds = %47, %32
  %51 = getelementptr inbounds i8, ptr %33, i64 2
  %52 = load i16, ptr %51, align 2, !tbaa !19
  %53 = sext i16 %52 to i32
  %54 = getelementptr inbounds i8, ptr %36, i64 2
  %55 = load i16, ptr %54, align 2, !tbaa !19
  %56 = sext i16 %55 to i32
  %57 = icmp sgt i16 %52, %55
  %58 = sub nsw i32 %53, %56
  %59 = sub nsw i32 %56, %53
  %60 = select i1 %57, i32 %58, i32 %59
  %61 = icmp sgt i32 %60, 2
  br i1 %61, label %62, label %68

62:                                               ; preds = %50
  %63 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %64 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.3, i32 noundef 51)
          to label %65 unwind label %66

65:                                               ; preds = %62
  store i8 1, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11
  br label %68

66:                                               ; preds = %62
  %67 = landingpad { ptr, i32 }
          cleanup
  br label %71

68:                                               ; preds = %65, %50
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %69 = load i64, ptr %8, align 8, !tbaa !13
  %70 = lshr i64 %69, 1
  %.not35.not = icmp ugt i64 %70, %indvars.iv
  br i1 %.not35.not, label %32, label %._crit_edge, !llvm.loop !20

71:                                               ; preds = %30, %66, %48, %18
  %.pn.pn.pn = phi { ptr, i32 } [ %19, %18 ], [ %31, %30 ], [ %67, %66 ], [ %49, %48 ]
  call void @llvm.lifetime.end.p0(i64 5952, ptr nonnull %5) #5
  call void @_ZN6tflite13ErrorReporterD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %87

._crit_edge:                                      ; preds = %68
  call void @llvm.lifetime.end.p0(i64 5952, ptr nonnull %5) #5
  call void @_ZN6tflite13ErrorReporterD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  store i8 1, ptr @_ZN10micro_test16is_test_completeE, align 1, !tbaa !11
  %72 = load i8, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11, !range !22, !noundef !23
  %73 = xor i8 %72, 1
  %not. = zext nneg i8 %73 to i32
  %74 = load i32, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %75 = add nsw i32 %74, %not.
  store i32 %75, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %76 = zext nneg i8 %72 to i32
  %77 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %78 = add nsw i32 %77, %76
  store i32 %78, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %79 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %80 = add nsw i32 %78, %75
  %81 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %79, ptr noundef nonnull @.str.7, i32 noundef %75, i32 noundef %80)
          to label %.invoke unwind label %16

.invoke:                                          ; preds = %._crit_edge
  %82 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %83 = icmp eq i32 %82, 0
  %84 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %.str.8..str.9 = select i1 %83, ptr @.str.8, ptr @.str.9
  %85 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %84, ptr noundef nonnull %.str.8..str.9)
          to label %86 unwind label %16

86:                                               ; preds = %.invoke
  call void @_ZN6tflite13ErrorReporterD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  ret i32 0

87:                                               ; preds = %71, %16
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %71 ], [ %17, %16 ]
  call void @_ZN6tflite13ErrorReporterD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  resume { ptr, i32 } %.pn.pn.pn.pn
}

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

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

declare noundef i32 @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, ...) local_unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

declare noundef i32 @_Z16FftPopulateStatePN6tflite13ErrorReporterEP8FftStatem(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #3

declare void @_Z7FftInitP8FftState(ptr noundef) local_unnamed_addr #3

declare void @_Z10FftComputeP8FftStatePKsi(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

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

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

attributes #0 = { mustprogress norecurse 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 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 #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, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !15, i64 3080}
!14 = !{!"_ZTS8FftState", !7, i64 0, !7, i64 1024, !15, i64 3080, !15, i64 3088, !7, i64 3096, !15, i64 5944}
!15 = !{!"long", !7, i64 0}
!16 = !{!17, !18, i64 0}
!17 = !{!"_ZTS15complex_int16_t", !18, i64 0, !18, i64 2}
!18 = !{!"short", !7, i64 0}
!19 = !{!17, !18, i64 2}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{i8 0, i8 2}
!23 = !{}


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