; LLVM IR from NVIDIA/tensorflow :: tensorflow/lite/experimental/micro/examples/micro_speech (audio_provider_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"

%"class.tflite::MicroErrorReporter" = type { %"class.tflite::ErrorReporter" }
%"class.tflite::ErrorReporter" = type { ptr }

@_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 [18 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [131 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [81 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.11 = 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 i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = 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) #5
  call void @_ZN6tflite18MicroErrorReporterC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  store ptr %6, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %20 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %21 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef @.str, ptr noundef @.str.1)
          to label %22 unwind label %39

22:                                               ; 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 %23

23:                                               ; preds = %88, %22
  %24 = load i8, ptr @_ZN10micro_test16is_test_completeE, align 1, !tbaa !11, !range !13, !noundef !14
  %25 = trunc i8 %24 to i1
  %26 = xor i1 %25, true
  br i1 %26, label %27, label %101

27:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @_ZN6tflite18MicroErrorReporterC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store ptr %9, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store ptr null, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %28 = load ptr, ptr %10, align 8, !tbaa !9
  %29 = invoke noundef i32 @_Z15GetAudioSamplesPN6tflite13ErrorReporterEiiPiPPs(ptr noundef %28, i32 noundef 0, i32 noundef 30, ptr noundef %11, ptr noundef %12)
          to label %30 unwind label %43

30:                                               ; preds = %27
  store i32 %29, ptr %13, align 4, !tbaa !15
  br label %31

31:                                               ; preds = %30
  %32 = load i32, ptr %13, align 4, !tbaa !15
  %33 = icmp ne i32 0, %32
  br i1 %33, label %34, label %47

34:                                               ; preds = %31
  %35 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %36 = load i32, ptr %13, align 4, !tbaa !15
  %37 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef @.str.2, ptr noundef @.str.3, i32 noundef 36, i32 noundef 0, i32 noundef %36)
          to label %38 unwind label %43

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

39:                                               ; preds = %189, %185, %175, %101, %2
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %7, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %8, align 4
  br label %195

43:                                               ; preds = %63, %53, %34, %27
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %7, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @_ZN6tflite13ErrorReporterD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %195

47:                                               ; preds = %38, %31
  br label %48

48:                                               ; preds = %47
  br label %49

49:                                               ; preds = %48
  br label %50

50:                                               ; preds = %49
  %51 = load i32, ptr %11, align 4, !tbaa !5
  %52 = icmp sgt i32 %51, 512
  br i1 %52, label %53, label %57

53:                                               ; preds = %50
  %54 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %55 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %54, ptr noundef @.str.4, ptr noundef @.str.3, i32 noundef 37)
          to label %56 unwind label %43

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

57:                                               ; preds = %56, %50
  br label %58

58:                                               ; preds = %57
  br label %59

59:                                               ; preds = %58
  br label %60

60:                                               ; preds = %59
  %61 = load ptr, ptr %12, align 8, !tbaa !9
  %62 = icmp eq ptr %61, null
  br i1 %62, label %63, label %67

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

66:                                               ; preds = %63
  store i8 1, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11
  br label %67

67:                                               ; preds = %66, %60
  br label %68

68:                                               ; preds = %67
  br label %69

69:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %84, %69
  %71 = load i32, ptr %15, align 4, !tbaa !5
  %72 = load i32, ptr %11, align 4, !tbaa !5
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %87

75:                                               ; preds = %70
  %76 = load ptr, ptr %12, align 8, !tbaa !9
  %77 = load i32, ptr %15, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds i16, ptr %76, i64 %78
  %80 = load i16, ptr %79, align 2, !tbaa !17
  %81 = sext i16 %80 to i32
  %82 = load i32, ptr %14, align 4, !tbaa !5
  %83 = add nsw i32 %82, %81
  store i32 %83, ptr %14, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %75
  %85 = load i32, ptr %15, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %15, align 4, !tbaa !5
  br label %70, !llvm.loop !19

87:                                               ; preds = %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @_ZN6tflite13ErrorReporterD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %88

88:                                               ; preds = %87
  store i8 1, ptr @_ZN10micro_test16is_test_completeE, align 1, !tbaa !11
  %89 = load i8, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11, !range !13, !noundef !14
  %90 = trunc i8 %89 to i1
  %91 = zext i1 %90 to i64
  %92 = select i1 %90, i32 0, i32 1
  %93 = load i32, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %94 = add nsw i32 %93, %92
  store i32 %94, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %95 = load i8, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11, !range !13, !noundef !14
  %96 = trunc i8 %95 to i1
  %97 = zext i1 %96 to i64
  %98 = select i1 %96, i32 1, i32 0
  %99 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %100 = add nsw i32 %99, %98
  store i32 %100, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  br label %23, !llvm.loop !21

101:                                              ; preds = %23
  %102 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %103 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %102, ptr noundef @.str, ptr noundef @.str.6)
          to label %104 unwind label %39

104:                                              ; preds = %101
  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 %105

105:                                              ; preds = %159, %104
  %106 = load i8, ptr @_ZN10micro_test16is_test_completeE, align 1, !tbaa !11, !range !13, !noundef !14
  %107 = trunc i8 %106 to i1
  %108 = xor i1 %107, true
  br i1 %108, label %109, label %175

109:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %110 = call noundef i32 @_ZNSt14numeric_limitsIiE3maxEv() #5
  store i32 %110, ptr %16, align 4, !tbaa !5
  %111 = load i32, ptr %16, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %16, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %109
  %114 = call noundef i32 @_ZNSt14numeric_limitsIiE3minEv() #5
  %115 = load i32, ptr %16, align 4, !tbaa !5
  %116 = icmp ne i32 %114, %115
  br i1 %116, label %117, label %127

117:                                              ; preds = %113
  %118 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %119 = call noundef i32 @_ZNSt14numeric_limitsIiE3minEv() #5
  %120 = load i32, ptr %16, align 4, !tbaa !5
  %121 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %118, ptr noundef @.str.7, ptr noundef @.str.3, i32 noundef 55, i32 noundef %119, i32 noundef %120)
          to label %122 unwind label %123

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

123:                                              ; preds = %117
  %124 = landingpad { ptr, i32 }
          cleanup
  %125 = extractvalue { ptr, i32 } %124, 0
  store ptr %125, ptr %7, align 8
  %126 = extractvalue { ptr, i32 } %124, 1
  store i32 %126, ptr %8, align 4
  br label %174

127:                                              ; preds = %122, %113
  br label %128

128:                                              ; preds = %127
  br label %129

129:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %130 = invoke noundef i32 @_Z20LatestAudioTimestampv()
          to label %131 unwind label %144

131:                                              ; preds = %129
  store i32 %130, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %132 = invoke noundef i32 @_Z20LatestAudioTimestampv()
          to label %133 unwind label %148

133:                                              ; preds = %131
  store i32 %132, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %134 = load i32, ptr %18, align 4, !tbaa !5
  %135 = load i32, ptr %17, align 4, !tbaa !5
  %136 = sub nsw i32 %134, %135
  store i32 %136, ptr %19, align 4, !tbaa !5
  br label %137

137:                                              ; preds = %133
  %138 = load i32, ptr %19, align 4, !tbaa !5
  %139 = icmp sgt i32 0, %138
  br i1 %139, label %140, label %156

140:                                              ; preds = %137
  %141 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %142 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %141, ptr noundef @.str.8, ptr noundef @.str.3, i32 noundef 67)
          to label %143 unwind label %152

143:                                              ; preds = %140
  store i8 1, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11
  br label %156

144:                                              ; preds = %129
  %145 = landingpad { ptr, i32 }
          cleanup
  %146 = extractvalue { ptr, i32 } %145, 0
  store ptr %146, ptr %7, align 8
  %147 = extractvalue { ptr, i32 } %145, 1
  store i32 %147, ptr %8, align 4
  br label %173

148:                                              ; preds = %131
  %149 = landingpad { ptr, i32 }
          cleanup
  %150 = extractvalue { ptr, i32 } %149, 0
  store ptr %150, ptr %7, align 8
  %151 = extractvalue { ptr, i32 } %149, 1
  store i32 %151, ptr %8, align 4
  br label %172

152:                                              ; preds = %140
  %153 = landingpad { ptr, i32 }
          cleanup
  %154 = extractvalue { ptr, i32 } %153, 0
  store ptr %154, ptr %7, align 8
  %155 = extractvalue { ptr, i32 } %153, 1
  store i32 %155, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %172

156:                                              ; preds = %143, %137
  br label %157

157:                                              ; preds = %156
  br label %158

158:                                              ; preds = %157
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %159

159:                                              ; preds = %158
  store i8 1, ptr @_ZN10micro_test16is_test_completeE, align 1, !tbaa !11
  %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 0, i32 1
  %164 = load i32, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %165 = add nsw i32 %164, %163
  store i32 %165, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %166 = load i8, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11, !range !13, !noundef !14
  %167 = trunc i8 %166 to i1
  %168 = zext i1 %167 to i64
  %169 = select i1 %167, i32 1, i32 0
  %170 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %171 = add nsw i32 %170, %169
  store i32 %171, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  br label %105, !llvm.loop !22

172:                                              ; preds = %152, %148
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %173

173:                                              ; preds = %172, %144
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %174

174:                                              ; preds = %173, %123
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %195

175:                                              ; preds = %105
  %176 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %177 = load i32, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %178 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %179 = load i32, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %180 = add nsw i32 %178, %179
  %181 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %176, ptr noundef @.str.9, i32 noundef %177, i32 noundef %180)
          to label %182 unwind label %39

182:                                              ; preds = %175
  %183 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %184 = icmp eq i32 %183, 0
  br i1 %184, label %185, label %189

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

188:                                              ; preds = %185
  br label %193

189:                                              ; preds = %182
  %190 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %191 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %190, ptr noundef @.str.11)
          to label %192 unwind label %39

192:                                              ; preds = %189
  br label %193

193:                                              ; preds = %192, %188
  call void @_ZN6tflite13ErrorReporterD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %194 = load i32, ptr %3, align 4
  ret i32 %194

195:                                              ; preds = %174, %43, %39
  call void @_ZN6tflite13ErrorReporterD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %196

196:                                              ; preds = %195
  %197 = load ptr, ptr %7, align 8
  %198 = load i32, ptr %8, align 4
  %199 = insertvalue { ptr, i32 } poison, ptr %197, 0
  %200 = insertvalue { ptr, i32 } %199, i32 %198, 1
  resume { ptr, i32 } %200
}

; 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 @_Z15GetAudioSamplesPN6tflite13ErrorReporterEiiPiPPs(ptr noundef, i32 noundef, i32 noundef, ptr noundef, 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 #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNSt14numeric_limitsIiE3maxEv() #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNSt14numeric_limitsIiE3minEv() #4 align 2

declare noundef i32 @_Z20LatestAudioTimestampv() #3

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 = { 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 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !16, i64 0}
!16 = !{!"_ZTS12TfLiteStatus", !7, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"short", !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}
!22 = distinct !{!22, !20}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.tflite::MicroErrorReporter" = type { %"class.tflite::ErrorReporter" }
%"class.tflite::ErrorReporter" = type { ptr }

@_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 [18 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [131 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [81 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.11 = 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 i32, align 4
  %6 = alloca ptr, 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
  %7 = 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 %.lr.ph unwind label %14

.lr.ph:                                           ; 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
  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 4, ptr nonnull %5) #5
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  store ptr null, ptr %6, align 8, !tbaa !9
  %8 = invoke noundef i32 @_Z15GetAudioSamplesPN6tflite13ErrorReporterEiiPiPPs(ptr noundef nonnull %4, i32 noundef 0, i32 noundef 30, ptr noundef nonnull %5, ptr noundef nonnull %6)
          to label %9 unwind label %16

9:                                                ; preds = %.lr.ph
  %.not26 = icmp eq i32 %8, 0
  br i1 %.not26, label %18, label %10

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

13:                                               ; preds = %10
  store i8 1, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11
  br label %18

14:                                               ; preds = %.invoke, %._crit_edge32, %._crit_edge, %2
  %15 = landingpad { ptr, i32 }
          cleanup
  br label %82

16:                                               ; preds = %28, %21, %10, %.lr.ph
  %17 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 4, 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 %82

18:                                               ; preds = %9, %13
  %19 = load i32, ptr %5, align 4, !tbaa !5
  %20 = icmp sgt i32 %19, 512
  br i1 %20, label %21, label %25

21:                                               ; preds = %18
  %22 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %23 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.3, i32 noundef 37)
          to label %24 unwind label %16

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

25:                                               ; preds = %18, %24
  %26 = load ptr, ptr %6, align 8, !tbaa !9
  %27 = icmp eq ptr %26, null
  br i1 %27, label %28, label %._crit_edge

28:                                               ; preds = %25
  %29 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %30 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3, i32 noundef 38)
          to label %31 unwind label %16

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

._crit_edge:                                      ; preds = %31, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 4, 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
  %32 = load i8, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11, !range !13, !noundef !14
  %33 = xor i8 %32, 1
  %not.29 = zext nneg i8 %33 to i32
  %34 = load i32, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %35 = add nsw i32 %34, %not.29
  store i32 %35, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %36 = zext nneg i8 %32 to i32
  %37 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %38 = add nsw i32 %37, %36
  store i32 %38, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %39 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %40 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %39, ptr noundef nonnull @.str, ptr noundef nonnull @.str.6)
          to label %.lr.ph31 unwind label %14

.lr.ph31:                                         ; preds = %._crit_edge
  store i8 0, ptr @_ZN10micro_test16is_test_completeE, align 1, !tbaa !11
  store i8 0, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11
  %41 = call noundef i32 @_ZNSt14numeric_limitsIiE3maxEv() #5
  %42 = add nsw i32 %41, 1
  %43 = call noundef i32 @_ZNSt14numeric_limitsIiE3minEv() #5
  %.not = icmp eq i32 %43, %42
  br i1 %.not, label %51, label %44

44:                                               ; preds = %.lr.ph31
  %45 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %46 = call noundef i32 @_ZNSt14numeric_limitsIiE3minEv() #5
  %47 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %45, ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.3, i32 noundef 55, i32 noundef %46, i32 noundef %42)
          to label %48 unwind label %49

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

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

51:                                               ; preds = %48, %.lr.ph31
  %52 = invoke noundef i32 @_Z20LatestAudioTimestampv()
          to label %53 unwind label %61

53:                                               ; preds = %51
  %54 = invoke noundef i32 @_Z20LatestAudioTimestampv()
          to label %55 unwind label %63

55:                                               ; preds = %53
  %56 = icmp slt i32 %54, %52
  br i1 %56, label %57, label %._crit_edge33

._crit_edge33:                                    ; preds = %55
  %.pre = load i8, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11, !range !13
  br label %._crit_edge32

57:                                               ; preds = %55
  %58 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %59 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %58, ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.3, i32 noundef 67)
          to label %60 unwind label %65

60:                                               ; preds = %57
  store i8 1, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11
  br label %._crit_edge32

61:                                               ; preds = %51
  %62 = landingpad { ptr, i32 }
          cleanup
  br label %82

63:                                               ; preds = %53
  %64 = landingpad { ptr, i32 }
          cleanup
  br label %82

65:                                               ; preds = %57
  %66 = landingpad { ptr, i32 }
          cleanup
  br label %82

._crit_edge32:                                    ; preds = %._crit_edge33, %60
  %67 = phi i8 [ %.pre, %._crit_edge33 ], [ 1, %60 ]
  store i8 1, ptr @_ZN10micro_test16is_test_completeE, align 1, !tbaa !11
  %68 = xor i8 %67, 1
  %not. = zext nneg i8 %68 to i32
  %69 = load i32, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %70 = add nsw i32 %69, %not.
  store i32 %70, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %71 = zext nneg i8 %67 to i32
  %72 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %73 = add nsw i32 %72, %71
  store i32 %73, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %74 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %75 = add nsw i32 %73, %70
  %76 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %74, ptr noundef nonnull @.str.9, i32 noundef %70, i32 noundef %75)
          to label %.invoke unwind label %14

.invoke:                                          ; preds = %._crit_edge32
  %77 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %78 = icmp eq i32 %77, 0
  %79 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %.str.10..str.11 = select i1 %78, ptr @.str.10, ptr @.str.11
  %80 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %79, ptr noundef nonnull %.str.10..str.11)
          to label %81 unwind label %14

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

82:                                               ; preds = %49, %63, %65, %61, %16, %14
  %.pn27 = phi { ptr, i32 } [ %17, %16 ], [ %15, %14 ], [ %50, %49 ], [ %62, %61 ], [ %66, %65 ], [ %64, %63 ]
  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 } %.pn27
}

; 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 @_Z15GetAudioSamplesPN6tflite13ErrorReporterEiiPiPPs(ptr noundef, i32 noundef, i32 noundef, ptr noundef, 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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNSt14numeric_limitsIiE3maxEv() local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNSt14numeric_limitsIiE3minEv() local_unnamed_addr #4 align 2

declare noundef i32 @_Z20LatestAudioTimestampv() local_unnamed_addr #3

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 = !{i8 0, i8 2}
!14 = !{}


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