; 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"

%"class.tflite::MicroErrorReporter" = type { %"class.tflite::ErrorReporter" }
%"class.tflite::ErrorReporter" = type { ptr }
%"class.(anonymous namespace)::PcanGainControlTestConfig" = type { %struct.PcanGainControlConfig }
%struct.PcanGainControlConfig = type { i32, float, float, i32 }
%struct.PcanGainControlState = type { i32, ptr, i32, [125 x i16], i32 }

@_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 [40 x i8], align 1
@__const.main.estimate = external hidden unnamed_addr constant [2 x i32], align 4
@.str.2 = external hidden unnamed_addr constant [144 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [149 x i8], align 1
@__const.main.signal = external hidden unnamed_addr constant [2 x i32], align 4
@__const.main.expected = external hidden unnamed_addr constant [2 x i32], align 4
@.str.4 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.8 = 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 [2 x i32], align 4
  %12 = alloca %"class.(anonymous namespace)::PcanGainControlTestConfig", align 4
  %13 = alloca %struct.PcanGainControlState, align 8
  %14 = alloca [2 x i32], align 4
  %15 = alloca [2 x i32], align 4
  %16 = 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
  %17 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %18 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef @.str, ptr noundef @.str.1)
          to label %19 unwind label %37

19:                                               ; 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 %20

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

24:                                               ; preds = %20
  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 8, ptr %11) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 @__const.main.estimate, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #6
  invoke void @_ZN12_GLOBAL__N_125PcanGainControlTestConfigC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %12)
          to label %25 unwind label %41

25:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 280, ptr %13) #6
  br label %26

26:                                               ; preds = %25
  %27 = load ptr, ptr %10, align 8, !tbaa !9
  %28 = getelementptr inbounds %"class.(anonymous namespace)::PcanGainControlTestConfig", ptr %12, i32 0, i32 0
  %29 = getelementptr inbounds [2 x i32], ptr %11, i64 0, i64 0
  %30 = invoke noundef i32 @_Z28PcanGainControlPopulateStatePN6tflite13ErrorReporterEPK21PcanGainControlConfigP20PcanGainControlStatePjiti(ptr noundef %27, ptr noundef %28, ptr noundef %13, ptr noundef %29, i32 noundef 2, i16 noundef zeroext 10, i32 noundef -1)
          to label %31 unwind label %45

31:                                               ; preds = %26
  %32 = icmp ne i32 %30, 0
  br i1 %32, label %49, label %33

33:                                               ; preds = %31
  %34 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %35 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef @.str.2, ptr noundef @.str.3, i32 noundef 52)
          to label %36 unwind label %45

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

37:                                               ; preds = %146, %142, %132, %2
  %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 %152

41:                                               ; preds = %24
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %7, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %8, align 4
  br label %131

45:                                               ; preds = %33, %26
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %7, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %8, align 4
  br label %130

49:                                               ; preds = %36, %31
  br label %50

50:                                               ; preds = %49
  br label %51

51:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 @__const.main.signal, i64 8, i1 false)
  %52 = getelementptr inbounds [2 x i32], ptr %14, i64 0, i64 0
  invoke void @_Z20PcanGainControlApplyP20PcanGainControlStatePj(ptr noundef %13, ptr noundef %52)
          to label %53 unwind label %65

53:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 @__const.main.expected, i64 8, i1 false)
  br label %54

54:                                               ; preds = %53
  %55 = getelementptr inbounds %struct.PcanGainControlState, ptr %13, i32 0, i32 2
  %56 = load i32, ptr %55, align 8, !tbaa !15
  %57 = sext i32 %56 to i64
  %58 = icmp ne i64 %57, 2
  br i1 %58, label %59, label %73

59:                                               ; preds = %54
  %60 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %61 = getelementptr inbounds %struct.PcanGainControlState, ptr %13, i32 0, i32 2
  %62 = load i32, ptr %61, align 8, !tbaa !15
  %63 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef @.str.4, ptr noundef @.str.3, i32 noundef 59, i32 noundef %62, i64 noundef 2)
          to label %64 unwind label %69

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

65:                                               ; preds = %51
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %7, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %8, align 4
  br label %129

69:                                               ; preds = %59
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %7, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %8, align 4
  br label %128

73:                                               ; preds = %64, %54
  br label %74

74:                                               ; preds = %73
  br label %75

75:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %111, %75
  %77 = load i32, ptr %16, align 4, !tbaa !5
  %78 = getelementptr inbounds %struct.PcanGainControlState, ptr %13, i32 0, i32 2
  %79 = load i32, ptr %78, align 8, !tbaa !15
  %80 = icmp slt i32 %77, %79
  br i1 %80, label %81, label %114

81:                                               ; preds = %76
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %16, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [2 x i32], ptr %14, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = load i32, ptr %16, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [2 x i32], ptr %15, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = icmp ne i32 %86, %90
  br i1 %91, label %92, label %108

92:                                               ; preds = %82
  %93 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %94 = load i32, ptr %16, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [2 x i32], ptr %14, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = load i32, ptr %16, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [2 x i32], ptr %15, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %93, ptr noundef @.str.5, ptr noundef @.str.3, i32 noundef 62, i32 noundef %97, i32 noundef %101)
          to label %103 unwind label %104

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

104:                                              ; preds = %92
  %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 %16) #6
  br label %128

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

109:                                              ; preds = %108
  br label %110

110:                                              ; preds = %109
  br label %111

111:                                              ; preds = %110
  %112 = load i32, ptr %16, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %16, align 4, !tbaa !5
  br label %76, !llvm.loop !17

114:                                              ; preds = %76
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 280, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, 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 %115

115:                                              ; preds = %114
  store i8 1, ptr @_ZN10micro_test16is_test_completeE, align 1, !tbaa !11
  %116 = load i8, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11, !range !13, !noundef !14
  %117 = trunc i8 %116 to i1
  %118 = zext i1 %117 to i64
  %119 = select i1 %117, i32 0, i32 1
  %120 = load i32, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %121 = add nsw i32 %120, %119
  store i32 %121, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %122 = load i8, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11, !range !13, !noundef !14
  %123 = trunc i8 %122 to i1
  %124 = zext i1 %123 to i64
  %125 = select i1 %123, i32 1, i32 0
  %126 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %127 = add nsw i32 %126, %125
  store i32 %127, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  br label %20, !llvm.loop !19

128:                                              ; preds = %104, %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %129

129:                                              ; preds = %128, %65
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %130

130:                                              ; preds = %129, %45
  call void @llvm.lifetime.end.p0(i64 280, ptr %13) #6
  br label %131

131:                                              ; preds = %130, %41
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, 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 %152

132:                                              ; preds = %20
  %133 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %134 = load i32, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %135 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %136 = load i32, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %137 = add nsw i32 %135, %136
  %138 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %133, ptr noundef @.str.6, i32 noundef %134, i32 noundef %137)
          to label %139 unwind label %37

139:                                              ; preds = %132
  %140 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %141 = icmp eq i32 %140, 0
  br i1 %141, label %142, label %146

142:                                              ; preds = %139
  %143 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %144 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %143, ptr noundef @.str.7)
          to label %145 unwind label %37

145:                                              ; preds = %142
  br label %150

146:                                              ; preds = %139
  %147 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %148 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %147, ptr noundef @.str.8)
          to label %149 unwind label %37

149:                                              ; preds = %146
  br label %150

150:                                              ; preds = %149, %145
  call void @_ZN6tflite13ErrorReporterD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %151 = load i32, ptr %3, align 4
  ret i32 %151

152:                                              ; preds = %131, %37
  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 %153

153:                                              ; preds = %152
  %154 = load ptr, ptr %7, align 8
  %155 = load i32, ptr %8, align 4
  %156 = insertvalue { ptr, i32 } poison, ptr %154, 0
  %157 = insertvalue { ptr, i32 } %156, i32 %155, 1
  resume { ptr, i32 } %157
}

; 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(...)

; 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: mustprogress nounwind uwtable
declare hidden void @_ZN12_GLOBAL__N_125PcanGainControlTestConfigC2Ev(ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #5 align 2

declare noundef i32 @_Z28PcanGainControlPopulateStatePN6tflite13ErrorReporterEPK21PcanGainControlConfigP20PcanGainControlStatePjiti(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i16 noundef zeroext, i32 noundef) #3

declare void @_Z20PcanGainControlApplyP20PcanGainControlStatePj(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 #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, !6, i64 16}
!16 = !{!"_ZTS20PcanGainControlState", !6, i64 0, !10, i64 8, !6, i64 16, !7, i64 20, !6, i64 272}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}


; 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 }
%"class.(anonymous namespace)::PcanGainControlTestConfig" = type { %struct.PcanGainControlConfig }
%struct.PcanGainControlConfig = type { i32, float, float, i32 }
%struct.PcanGainControlState = type { i32, ptr, i32, [125 x i16], i32 }

@_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 [40 x i8], align 1
@__const.main.estimate = external hidden unnamed_addr constant [2 x i32], align 4
@.str.2 = external hidden unnamed_addr constant [144 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [149 x i8], align 1
@__const.main.signal = external hidden unnamed_addr constant [2 x i32], align 4
@__const.main.expected = external hidden unnamed_addr constant [2 x i32], align 4
@.str.4 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.8 = 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 [2 x i32], align 8
  %6 = alloca %"class.(anonymous namespace)::PcanGainControlTestConfig", align 4
  %7 = alloca %struct.PcanGainControlState, align 8
  %8 = alloca [2 x i32], 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
  %9 = 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 %10 unwind label %20

10:                                               ; 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
  %11 = load i64, ptr @__const.main.signal, align 4
  %12 = getelementptr inbounds i8, ptr %7, i64 16
  %13 = load i64, ptr @__const.main.estimate, align 4
  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 8, ptr nonnull %5) #5
  store i64 %13, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  call void @_ZN12_GLOBAL__N_125PcanGainControlTestConfigC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %6)
  call void @llvm.lifetime.start.p0(i64 280, ptr nonnull %7) #5
  %14 = invoke noundef i32 @_Z28PcanGainControlPopulateStatePN6tflite13ErrorReporterEPK21PcanGainControlConfigP20PcanGainControlStatePjiti(ptr noundef nonnull %4, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %5, i32 noundef 2, i16 noundef zeroext 10, i32 noundef -1)
          to label %15 unwind label %22

15:                                               ; preds = %10
  %.not = icmp eq i32 %14, 0
  br i1 %.not, label %16, label %24

16:                                               ; preds = %15
  %17 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %18 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, i32 noundef 52)
          to label %19 unwind label %22

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

20:                                               ; preds = %.invoke, %._crit_edge25, %2
  %21 = landingpad { ptr, i32 }
          cleanup
  br label %68

22:                                               ; preds = %16, %10
  %23 = landingpad { ptr, i32 }
          cleanup
  br label %52

24:                                               ; preds = %19, %15
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  store i64 %11, ptr %8, align 8
  invoke void @_Z20PcanGainControlApplyP20PcanGainControlStatePj(ptr noundef nonnull %7, ptr noundef nonnull %8)
          to label %25 unwind label %30

25:                                               ; preds = %24
  %26 = load i32, ptr %12, align 8, !tbaa !13
  %.not16 = icmp eq i32 %26, 2
  br i1 %.not16, label %.lr.ph.preheader, label %27

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

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

32:                                               ; preds = %27
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %51

34:                                               ; preds = %27
  store i8 1, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11
  %.pre = load i32, ptr %12, align 8, !tbaa !13
  %35 = icmp sgt i32 %.pre, 0
  br i1 %35, label %.lr.ph.preheader, label %._crit_edge25

.lr.ph.preheader:                                 ; preds = %25, %34
  %.ph = phi i32 [ 2, %25 ], [ %.pre, %34 ]
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %47
  %36 = phi i32 [ %48, %47 ], [ %.ph, %.lr.ph.preheader ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %47 ], [ 0, %.lr.ph.preheader ]
  %37 = getelementptr inbounds [2 x i32], ptr %8, i64 0, i64 %indvars.iv
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = getelementptr inbounds [2 x i32], ptr @__const.main.expected, i64 0, i64 %indvars.iv
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %.not17 = icmp eq i32 %38, %40
  br i1 %.not17, label %47, label %41

41:                                               ; preds = %.lr.ph
  %42 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %43 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %42, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3, i32 noundef 62, i32 noundef %38, i32 noundef %40)
          to label %44 unwind label %45

44:                                               ; preds = %41
  store i8 1, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11
  %.pre27 = load i32, ptr %12, align 8, !tbaa !13
  br label %47

45:                                               ; preds = %41
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %51

47:                                               ; preds = %.lr.ph, %44
  %48 = phi i32 [ %36, %.lr.ph ], [ %.pre27, %44 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %49 = sext i32 %48 to i64
  %50 = icmp slt i64 %indvars.iv.next, %49
  br i1 %50, label %.lr.ph, label %._crit_edge25, !llvm.loop !15

51:                                               ; preds = %32, %45, %30
  %.pn.pn = phi { ptr, i32 } [ %31, %30 ], [ %46, %45 ], [ %33, %32 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  br label %52

52:                                               ; preds = %51, %22
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %51 ], [ %23, %22 ]
  call void @llvm.lifetime.end.p0(i64 280, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, 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 %68

._crit_edge25:                                    ; preds = %47, %34
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 280, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, 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
  %53 = load i8, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11, !range !17, !noundef !18
  %54 = xor i8 %53, 1
  %not. = zext nneg i8 %54 to i32
  %55 = load i32, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %56 = add nsw i32 %55, %not.
  store i32 %56, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %57 = zext nneg i8 %53 to i32
  %58 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %59 = add nsw i32 %58, %57
  store i32 %59, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %60 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %61 = add nsw i32 %59, %56
  %62 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef nonnull @.str.6, i32 noundef %56, i32 noundef %61)
          to label %.invoke unwind label %20

.invoke:                                          ; preds = %._crit_edge25
  %63 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %64 = icmp eq i32 %63, 0
  %65 = load ptr, ptr @_ZN10micro_test8reporterE, align 8, !tbaa !9
  %.str.7..str.8 = select i1 %64, ptr @.str.7, ptr @.str.8
  %66 = invoke noundef i32 (ptr, ptr, ...) @_ZN6tflite13ErrorReporter6ReportEPKcz(ptr noundef nonnull align 8 dereferenceable(8) %65, ptr noundef nonnull %.str.7..str.8)
          to label %67 unwind label %20

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

68:                                               ; preds = %52, %20
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %52 ], [ %21, %20 ]
  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(...)

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN12_GLOBAL__N_125PcanGainControlTestConfigC2Ev(ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #4 align 2

declare noundef i32 @_Z28PcanGainControlPopulateStatePN6tflite13ErrorReporterEPK21PcanGainControlConfigP20PcanGainControlStatePjiti(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i16 noundef zeroext, i32 noundef) local_unnamed_addr #3

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

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, !6, i64 16}
!14 = !{!"_ZTS20PcanGainControlState", !6, i64 0, !10, i64 8, !6, i64 16, !7, i64 20, !6, i64 272}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{i8 0, i8 2}
!18 = !{}


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