; LLVM IR from NVIDIA/tensorflow :: tensorflow/lite/experimental/microfrontend/lib (fft_test)

; 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 { ptr, ptr, i64, i64, ptr, 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 [87 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [110 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 [68 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [68 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 %struct.FftState, align 8
  %10 = alloca [17 x %struct.complex_int16_t], align 16
  %11 = 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
  %12 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %13 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef @.str, ptr noundef @.str.1)
          to label %14 unwind label %28

14:                                               ; 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 %15

15:                                               ; preds = %153, %14
  %16 = load i8, ptr @_ZN10micro_test16is_test_completeE, align 1, !tbaa !11, !range !13, !noundef !14
  %17 = trunc i8 %16 to i1
  %18 = xor i1 %17, true
  br i1 %18, label %19, label %168

19:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 48, ptr %9) #6
  br label %20

20:                                               ; preds = %19
  %21 = invoke i32 @FftPopulateState(ptr noundef %9, i64 noundef 25)
          to label %22 unwind label %32

22:                                               ; preds = %20
  %23 = icmp ne i32 %21, 0
  br i1 %23, label %36, label %24

24:                                               ; preds = %22
  %25 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %26 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef @.str.2, ptr noundef @.str.3, i32 noundef 34)
          to label %27 unwind label %32

27:                                               ; preds = %24
  store i8 1, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11
  br label %36

28:                                               ; preds = %182, %178, %168, %2
  %29 = landingpad { ptr, i32 }
          cleanup
  %30 = extractvalue { ptr, i32 } %29, 0
  store ptr %30, ptr %7, align 8
  %31 = extractvalue { ptr, i32 } %29, 1
  store i32 %31, ptr %8, align 4
  br label %188

32:                                               ; preds = %39, %38, %24, %20
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %7, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %8, align 4
  br label %167

36:                                               ; preds = %27, %22
  br label %37

37:                                               ; preds = %36
  br label %38

38:                                               ; preds = %37
  invoke void @FftInit(ptr noundef %9)
          to label %39 unwind label %32

39:                                               ; preds = %38
  invoke void @FftCompute(ptr noundef %9, ptr noundef @_ZN12_GLOBAL__N_111kFakeWindowE, i32 noundef 0)
          to label %40 unwind label %32

40:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 68, ptr %10) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %10, ptr align 16 @__const.main.expected, i64 68, i1 false)
  br label %41

41:                                               ; preds = %40
  %42 = getelementptr inbounds %struct.FftState, ptr %9, i32 0, i32 2
  %43 = load i64, ptr %42, align 8, !tbaa !15
  %44 = udiv i64 %43, 2
  %45 = add i64 %44, 1
  %46 = icmp ne i64 %45, 17
  br i1 %46, label %47, label %59

47:                                               ; preds = %41
  %48 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %49 = getelementptr inbounds %struct.FftState, ptr %9, i32 0, i32 2
  %50 = load i64, ptr %49, align 8, !tbaa !15
  %51 = udiv i64 %50, 2
  %52 = add i64 %51, 1
  %53 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef @.str.4, ptr noundef @.str.3, i32 noundef 44, i64 noundef %52, i64 noundef 17)
          to label %54 unwind label %55

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

55:                                               ; preds = %47
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %7, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %8, align 4
  br label %166

59:                                               ; preds = %54, %41
  br label %60

60:                                               ; preds = %59
  br label %61

61:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %148, %61
  %63 = load i32, ptr %11, align 4, !tbaa !5
  %64 = zext i32 %63 to i64
  %65 = getelementptr inbounds %struct.FftState, ptr %9, i32 0, i32 2
  %66 = load i64, ptr %65, align 8, !tbaa !15
  %67 = udiv i64 %66, 2
  %68 = icmp ule i64 %64, %67
  br i1 %68, label %69, label %151

69:                                               ; preds = %62
  br label %70

70:                                               ; preds = %69
  %71 = getelementptr inbounds %struct.FftState, ptr %9, i32 0, i32 1
  %72 = load ptr, ptr %71, align 8, !tbaa !18
  %73 = load i32, ptr %11, align 4, !tbaa !5
  %74 = zext i32 %73 to i64
  %75 = getelementptr inbounds %struct.complex_int16_t, ptr %72, i64 %74
  %76 = getelementptr inbounds %struct.complex_int16_t, ptr %75, i32 0, i32 0
  %77 = load i16, ptr %76, align 2, !tbaa !19
  %78 = sext i16 %77 to i32
  %79 = load i32, ptr %11, align 4, !tbaa !5
  %80 = zext i32 %79 to i64
  %81 = getelementptr inbounds [17 x %struct.complex_int16_t], ptr %10, i64 0, i64 %80
  %82 = getelementptr inbounds %struct.complex_int16_t, ptr %81, i32 0, i32 0
  %83 = load i16, ptr %82, align 4, !tbaa !19
  %84 = sext i16 %83 to i32
  %85 = icmp ne i32 %78, %84
  br i1 %85, label %86, label %108

86:                                               ; preds = %70
  %87 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %88 = getelementptr inbounds %struct.FftState, ptr %9, i32 0, i32 1
  %89 = load ptr, ptr %88, align 8, !tbaa !18
  %90 = load i32, ptr %11, align 4, !tbaa !5
  %91 = zext i32 %90 to i64
  %92 = getelementptr inbounds %struct.complex_int16_t, ptr %89, i64 %91
  %93 = getelementptr inbounds %struct.complex_int16_t, ptr %92, i32 0, i32 0
  %94 = load i16, ptr %93, align 2, !tbaa !19
  %95 = sext i16 %94 to i32
  %96 = load i32, ptr %11, align 4, !tbaa !5
  %97 = zext i32 %96 to i64
  %98 = getelementptr inbounds [17 x %struct.complex_int16_t], ptr %10, i64 0, i64 %97
  %99 = getelementptr inbounds %struct.complex_int16_t, ptr %98, i32 0, i32 0
  %100 = load i16, ptr %99, align 4, !tbaa !19
  %101 = sext i16 %100 to i32
  %102 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %87, ptr noundef @.str.5, ptr noundef @.str.3, i32 noundef 47, i32 noundef %95, i32 noundef %101)
          to label %103 unwind label %104

103:                                              ; preds = %86
  store i8 1, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11
  br label %108

104:                                              ; preds = %151, %127, %86
  %105 = landingpad { ptr, i32 }
          cleanup
  %106 = extractvalue { ptr, i32 } %105, 0
  store ptr %106, ptr %7, align 8
  %107 = extractvalue { ptr, i32 } %105, 1
  store i32 %107, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %166

108:                                              ; preds = %103, %70
  br label %109

109:                                              ; preds = %108
  br label %110

110:                                              ; preds = %109
  br label %111

111:                                              ; preds = %110
  %112 = getelementptr inbounds %struct.FftState, ptr %9, i32 0, i32 1
  %113 = load ptr, ptr %112, align 8, !tbaa !18
  %114 = load i32, ptr %11, align 4, !tbaa !5
  %115 = zext i32 %114 to i64
  %116 = getelementptr inbounds %struct.complex_int16_t, ptr %113, i64 %115
  %117 = getelementptr inbounds %struct.complex_int16_t, ptr %116, i32 0, i32 1
  %118 = load i16, ptr %117, align 2, !tbaa !22
  %119 = sext i16 %118 to i32
  %120 = load i32, ptr %11, align 4, !tbaa !5
  %121 = zext i32 %120 to i64
  %122 = getelementptr inbounds [17 x %struct.complex_int16_t], ptr %10, i64 0, i64 %121
  %123 = getelementptr inbounds %struct.complex_int16_t, ptr %122, i32 0, i32 1
  %124 = load i16, ptr %123, align 2, !tbaa !22
  %125 = sext i16 %124 to i32
  %126 = icmp ne i32 %119, %125
  br i1 %126, label %127, label %145

127:                                              ; preds = %111
  %128 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %129 = getelementptr inbounds %struct.FftState, ptr %9, i32 0, i32 1
  %130 = load ptr, ptr %129, align 8, !tbaa !18
  %131 = load i32, ptr %11, align 4, !tbaa !5
  %132 = zext i32 %131 to i64
  %133 = getelementptr inbounds %struct.complex_int16_t, ptr %130, i64 %132
  %134 = getelementptr inbounds %struct.complex_int16_t, ptr %133, i32 0, i32 1
  %135 = load i16, ptr %134, align 2, !tbaa !22
  %136 = sext i16 %135 to i32
  %137 = load i32, ptr %11, align 4, !tbaa !5
  %138 = zext i32 %137 to i64
  %139 = getelementptr inbounds [17 x %struct.complex_int16_t], ptr %10, 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 !22
  %142 = sext i16 %141 to i32
  %143 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %128, ptr noundef @.str.6, ptr noundef @.str.3, i32 noundef 48, i32 noundef %136, i32 noundef %142)
          to label %144 unwind label %104

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

145:                                              ; preds = %144, %111
  br label %146

146:                                              ; preds = %145
  br label %147

147:                                              ; preds = %146
  br label %148

148:                                              ; preds = %147
  %149 = load i32, ptr %11, align 4, !tbaa !5
  %150 = add i32 %149, 1
  store i32 %150, ptr %11, align 4, !tbaa !5
  br label %62, !llvm.loop !23

151:                                              ; preds = %62
  invoke void @FftFreeStateContents(ptr noundef %9)
          to label %152 unwind label %104

152:                                              ; preds = %151
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 68, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %9) #6
  br label %153

153:                                              ; preds = %152
  store i8 1, ptr @_ZN10micro_test16is_test_completeE, align 1, !tbaa !11
  %154 = load i8, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11, !range !13, !noundef !14
  %155 = trunc i8 %154 to i1
  %156 = zext i1 %155 to i64
  %157 = select i1 %155, i32 0, i32 1
  %158 = load i32, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %159 = add nsw i32 %158, %157
  store i32 %159, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %160 = load i8, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11, !range !13, !noundef !14
  %161 = trunc i8 %160 to i1
  %162 = zext i1 %161 to i64
  %163 = select i1 %161, i32 1, i32 0
  %164 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %165 = add nsw i32 %164, %163
  store i32 %165, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  br label %15, !llvm.loop !25

166:                                              ; preds = %104, %55
  call void @llvm.lifetime.end.p0(i64 68, ptr %10) #6
  br label %167

167:                                              ; preds = %166, %32
  call void @llvm.lifetime.end.p0(i64 48, ptr %9) #6
  br label %188

168:                                              ; preds = %15
  %169 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %170 = load i32, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %171 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %172 = load i32, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %173 = add nsw i32 %171, %172
  %174 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %169, ptr noundef @.str.7, i32 noundef %170, i32 noundef %173)
          to label %175 unwind label %28

175:                                              ; preds = %168
  %176 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %177 = icmp eq i32 %176, 0
  br i1 %177, label %178, label %182

178:                                              ; preds = %175
  %179 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %180 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %179, ptr noundef @.str.8)
          to label %181 unwind label %28

181:                                              ; preds = %178
  br label %186

182:                                              ; preds = %175
  %183 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %184 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %183, ptr noundef @.str.9)
          to label %185 unwind label %28

185:                                              ; preds = %182
  br label %186

186:                                              ; preds = %185, %181
  call void @_ZN6tflite13ErrorReporterD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %187 = load i32, ptr %3, align 4
  ret i32 %187

188:                                              ; preds = %167, %28
  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 %189

189:                                              ; preds = %188
  %190 = load ptr, ptr %7, align 8
  %191 = load i32, ptr %8, align 4
  %192 = insertvalue { ptr, i32 } poison, ptr %190, 0
  %193 = insertvalue { ptr, i32 } %192, i32 %191, 1
  resume { ptr, i32 } %193
}

; 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 i32 @FftPopulateState(ptr noundef, i64 noundef) #3

declare void @FftInit(ptr noundef) #3

declare void @FftCompute(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

declare void @FftFreeStateContents(ptr noundef) #3

; 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 16}
!16 = !{!"_ZTS8FftState", !10, i64 0, !10, i64 8, !17, i64 16, !17, i64 24, !10, i64 32, !17, i64 40}
!17 = !{!"long", !7, i64 0}
!18 = !{!16, !10, i64 8}
!19 = !{!20, !21, i64 0}
!20 = !{!"_ZTS15complex_int16_t", !21, i64 0, !21, i64 2}
!21 = !{!"short", !7, i64 0}
!22 = !{!20, !21, i64 2}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24}


; 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 { ptr, ptr, i64, i64, ptr, 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 [87 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [110 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 [68 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [68 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 %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
  %5 = 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 %6 unwind label %15

6:                                                ; 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
  %7 = getelementptr inbounds i8, ptr %4, i64 16
  %8 = getelementptr inbounds i8, ptr %4, i64 8
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %4) #5
  %9 = invoke i32 @FftPopulateState(ptr noundef nonnull %4, i64 noundef 25)
          to label %10 unwind label %17

10:                                               ; preds = %6
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %11, label %19

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

14:                                               ; preds = %11
  store i8 1, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11
  br label %19

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

17:                                               ; preds = %20, %19, %11, %6
  %18 = landingpad { ptr, i32 }
          cleanup
  br label %62

19:                                               ; preds = %14, %10
  invoke void @FftInit(ptr noundef nonnull %4)
          to label %20 unwind label %17

20:                                               ; preds = %19
  invoke void @FftCompute(ptr noundef nonnull %4, ptr noundef nonnull @_ZN12_GLOBAL__N_111kFakeWindowE, i32 noundef 0)
          to label %21 unwind label %17

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

.preheader:                                       ; preds = %28, %21
  br label %31

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

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

29:                                               ; preds = %25
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %62

31:                                               ; preds = %.preheader, %56
  %32 = phi i64 [ %58, %56 ], [ 0, %.preheader ]
  %.029 = phi i32 [ %57, %56 ], [ 0, %.preheader ]
  %33 = load ptr, ptr %8, align 8, !tbaa !16
  %34 = getelementptr inbounds %struct.complex_int16_t, ptr %33, i64 %32
  %35 = load i16, ptr %34, align 2, !tbaa !17
  %36 = getelementptr inbounds [17 x %struct.complex_int16_t], ptr @__const.main.expected, i64 0, i64 %32
  %37 = load i16, ptr %36, align 4, !tbaa !17
  %.not24 = icmp eq i16 %35, %37
  br i1 %.not24, label %44, label %38

38:                                               ; preds = %31
  %39 = sext i16 %37 to i32
  %40 = sext i16 %35 to i32
  %41 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %42 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %41, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3, i32 noundef 47, i32 noundef %40, i32 noundef %39)
          to label %43 unwind label %.loopexit

43:                                               ; preds = %38
  store i8 1, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11
  %.pre = load ptr, ptr %8, align 8, !tbaa !16
  br label %44

.loopexit:                                        ; preds = %38, %50
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %62

.loopexit.split-lp:                               ; preds = %61
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %62

44:                                               ; preds = %31, %43
  %45 = phi ptr [ %33, %31 ], [ %.pre, %43 ]
  %46 = getelementptr inbounds %struct.complex_int16_t, ptr %45, i64 %32, i32 1
  %47 = load i16, ptr %46, align 2, !tbaa !20
  %48 = getelementptr inbounds i8, ptr %36, i64 2
  %49 = load i16, ptr %48, align 2, !tbaa !20
  %.not25 = icmp eq i16 %47, %49
  br i1 %.not25, label %56, label %50

50:                                               ; preds = %44
  %51 = sext i16 %49 to i32
  %52 = sext i16 %47 to i32
  %53 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %54 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %53, ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.3, i32 noundef 48, i32 noundef %52, i32 noundef %51)
          to label %55 unwind label %.loopexit

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

56:                                               ; preds = %44, %55
  %57 = add i32 %.029, 1
  %58 = zext i32 %57 to i64
  %59 = load i64, ptr %7, align 8, !tbaa !13
  %60 = lshr i64 %59, 1
  %.not23 = icmp ult i64 %60, %58
  br i1 %.not23, label %61, label %31, !llvm.loop !21

61:                                               ; preds = %56
  invoke void @FftFreeStateContents(ptr noundef nonnull %4)
          to label %._crit_edge unwind label %.loopexit.split-lp

62:                                               ; preds = %.loopexit, %.loopexit.split-lp, %29, %17
  %.pn.pn = phi { ptr, i32 } [ %18, %17 ], [ %30, %29 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #5
  br label %78

._crit_edge:                                      ; preds = %61
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #5
  store i8 1, ptr @_ZN10micro_test16is_test_completeE, align 1, !tbaa !11
  %63 = load i8, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11, !range !23, !noundef !24
  %64 = xor i8 %63, 1
  %not. = zext nneg i8 %64 to i32
  %65 = load i32, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %66 = add nsw i32 %65, %not.
  store i32 %66, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %67 = zext nneg i8 %63 to i32
  %68 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %69 = add nsw i32 %68, %67
  store i32 %69, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %70 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %71 = add nsw i32 %69, %66
  %72 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %70, ptr noundef nonnull @.str.7, i32 noundef %66, i32 noundef %71)
          to label %.invoke unwind label %15

.invoke:                                          ; preds = %._crit_edge
  %73 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %74 = icmp eq i32 %73, 0
  %75 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %.str.8..str.9 = select i1 %74, ptr @.str.8, ptr @.str.9
  %76 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %75, ptr noundef nonnull %.str.8..str.9)
          to label %77 unwind label %15

77:                                               ; 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

78:                                               ; preds = %62, %15
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %62 ], [ %16, %15 ]
  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
}

; 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 i32 @FftPopulateState(ptr noundef, i64 noundef) local_unnamed_addr #3

declare void @FftInit(ptr noundef) local_unnamed_addr #3

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

declare void @FftFreeStateContents(ptr 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 16}
!14 = !{!"_ZTS8FftState", !10, i64 0, !10, i64 8, !15, i64 16, !15, i64 24, !10, i64 32, !15, i64 40}
!15 = !{!"long", !7, i64 0}
!16 = !{!14, !10, i64 8}
!17 = !{!18, !19, i64 0}
!18 = !{!"_ZTS15complex_int16_t", !19, i64 0, !19, i64 2}
!19 = !{!"short", !7, i64 0}
!20 = !{!18, !19, i64 2}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{i8 0, i8 2}
!24 = !{}


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