; LLVM IR from tensorflow/tflite-micro :: tensorflow/lite/experimental/microfrontend/lib (log_scale_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.LogScaleState = type { i32, 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
@.str = external hidden unnamed_addr constant [39 x i8], align 1
@__const.main.fake_signal = external hidden unnamed_addr constant [2 x i32], align 4
@__const.main.expected = external hidden unnamed_addr constant [2 x i16], align 2
@.str.1 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [122 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [44 x i8], align 1
@__const.main.fake_signal.7 = external hidden unnamed_addr constant [2 x i32], align 4
@__const.main.expected.8 = external hidden unnamed_addr constant [2 x i16], align 2
@.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 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca %struct.LogScaleState, align 4
  %7 = alloca [2 x i32], align 4
  %8 = alloca ptr, align 8
  %9 = alloca [2 x i16], align 2
  %10 = alloca i64, align 8
  %11 = alloca i16, align 2
  %12 = alloca i16, align 2
  %13 = alloca i8, align 1
  %14 = alloca i8, align 1
  %15 = alloca i32, align 4
  %16 = alloca %struct.LogScaleState, align 4
  %17 = alloca [2 x i32], align 4
  %18 = alloca ptr, align 8
  %19 = alloca [2 x i16], align 2
  %20 = alloca i64, align 8
  %21 = alloca i16, align 2
  %22 = alloca i16, align 2
  %23 = alloca i8, align 1
  %24 = alloca i8, align 1
  %25 = 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 @_ZN6tflite14InitializeTestEv()
  call void (ptr, ...) @_Z11MicroPrintfPKcz(ptr noundef @.str)
  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 %26

26:                                               ; preds = %108, %2
  %27 = load i8, ptr @_ZN10micro_test16is_test_completeE, align 1, !tbaa !11, !range !13, !noundef !14
  %28 = trunc i8 %27 to i1
  %29 = xor i1 %28, true
  br i1 %29, label %30, label %121

30:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %31 = getelementptr inbounds %struct.LogScaleState, ptr %6, i32 0, i32 0
  store i32 1, ptr %31, align 4, !tbaa !15
  %32 = getelementptr inbounds %struct.LogScaleState, ptr %6, i32 0, i32 1
  store i32 6, ptr %32, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 4 @__const.main.fake_signal, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %33 = getelementptr inbounds [2 x i32], ptr %7, i64 0, i64 0
  %34 = call ptr @LogScaleApply(ptr noundef %6, ptr noundef %33, i32 noundef 2, i32 noundef -1)
  store ptr %34, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %9, ptr align 2 @__const.main.expected, i64 4, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store i64 0, ptr %10, align 8, !tbaa !18
  br label %35

35:                                               ; preds = %104, %30
  %36 = load i64, ptr %10, align 8, !tbaa !18
  %37 = icmp ult i64 %36, 2
  br i1 %37, label %39, label %38

38:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %107

39:                                               ; preds = %35
  br label %40

40:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 2, ptr %11) #6
  %41 = load ptr, ptr %8, align 8, !tbaa !9
  %42 = load i64, ptr %10, align 8, !tbaa !18
  %43 = getelementptr inbounds i16, ptr %41, i64 %42
  %44 = load i16, ptr %43, align 2, !tbaa !20
  store i16 %44, ptr %11, align 2, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 2, ptr %12) #6
  %45 = load i64, ptr %10, align 8, !tbaa !18
  %46 = getelementptr inbounds [2 x i16], ptr %9, i64 0, i64 %45
  %47 = load i16, ptr %46, align 2, !tbaa !20
  store i16 %47, ptr %12, align 2, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #6
  store i8 0, ptr %13, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #6
  store i8 0, ptr %14, align 1, !tbaa !11
  %48 = load i8, ptr %13, align 1, !tbaa !11, !range !13, !noundef !14
  %49 = trunc i8 %48 to i1
  br i1 %49, label %50, label %82

50:                                               ; preds = %40
  %51 = load i8, ptr %14, align 1, !tbaa !11, !range !13, !noundef !14
  %52 = trunc i8 %51 to i1
  br i1 %52, label %53, label %82

53:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %54 = load i16, ptr %11, align 2, !tbaa !20
  %55 = zext i16 %54 to i32
  %56 = load i16, ptr %12, align 2, !tbaa !20
  %57 = zext i16 %56 to i32
  %58 = icmp sgt i32 %55, %57
  br i1 %58, label %59, label %65

59:                                               ; preds = %53
  %60 = load i16, ptr %11, align 2, !tbaa !20
  %61 = zext i16 %60 to i32
  %62 = load i16, ptr %12, align 2, !tbaa !20
  %63 = zext i16 %62 to i32
  %64 = sub nsw i32 %61, %63
  br label %71

65:                                               ; preds = %53
  %66 = load i16, ptr %12, align 2, !tbaa !20
  %67 = zext i16 %66 to i32
  %68 = load i16, ptr %11, align 2, !tbaa !20
  %69 = zext i16 %68 to i32
  %70 = sub nsw i32 %67, %69
  br label %71

71:                                               ; preds = %65, %59
  %72 = phi i32 [ %64, %59 ], [ %70, %65 ]
  store i32 %72, ptr %15, align 4, !tbaa !5
  %73 = load i32, ptr %15, align 4, !tbaa !5
  %74 = call noundef i32 @_ZNSt14numeric_limitsIiE7epsilonEv() #6
  %75 = icmp sgt i32 %73, %74
  br i1 %75, label %76, label %81

76:                                               ; preds = %71
  %77 = load i16, ptr %11, align 2, !tbaa !20
  %78 = uitofp i16 %77 to double
  %79 = load i16, ptr %12, align 2, !tbaa !20
  %80 = uitofp i16 %79 to double
  call void (ptr, ...) @_Z11MicroPrintfPKcz(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 41, double noundef %78, double noundef %80)
  store i8 1, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11
  br label %81

81:                                               ; preds = %76, %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %101

82:                                               ; preds = %50, %40
  %83 = load i16, ptr %11, align 2, !tbaa !20
  %84 = zext i16 %83 to i32
  %85 = load i16, ptr %12, align 2, !tbaa !20
  %86 = zext i16 %85 to i32
  %87 = icmp ne i32 %84, %86
  br i1 %87, label %88, label %100

88:                                               ; preds = %82
  %89 = load i16, ptr %11, align 2, !tbaa !20
  %90 = zext i16 %89 to i32
  %91 = load i16, ptr %12, align 2, !tbaa !20
  %92 = zext i16 %91 to i32
  call void (ptr, ...) @_Z11MicroPrintfPKcz(ptr noundef @.str.3, ptr noundef @.str.2, i32 noundef 41, i32 noundef %90, i32 noundef %92)
  %93 = load i8, ptr %13, align 1, !tbaa !11, !range !13, !noundef !14
  %94 = trunc i8 %93 to i1
  br i1 %94, label %98, label %95

95:                                               ; preds = %88
  %96 = load i8, ptr %14, align 1, !tbaa !11, !range !13, !noundef !14
  %97 = trunc i8 %96 to i1
  br i1 %97, label %98, label %99

98:                                               ; preds = %95, %88
  call void (ptr, ...) @_Z11MicroPrintfPKcz(ptr noundef @.str.4)
  call void (ptr, ...) @_Z11MicroPrintfPKcz(ptr noundef @.str.5)
  br label %99

99:                                               ; preds = %98, %95
  store i8 1, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11
  br label %100

100:                                              ; preds = %99, %82
  br label %101

101:                                              ; preds = %100, %81
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr %11) #6
  br label %102

102:                                              ; preds = %101
  br label %103

103:                                              ; preds = %102
  br label %104

104:                                              ; preds = %103
  %105 = load i64, ptr %10, align 8, !tbaa !18
  %106 = add i64 %105, 1
  store i64 %106, ptr %10, align 8, !tbaa !18
  br label %35, !llvm.loop !22

107:                                              ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %108

108:                                              ; preds = %107
  store i8 1, ptr @_ZN10micro_test16is_test_completeE, align 1, !tbaa !11
  %109 = load i8, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11, !range !13, !noundef !14
  %110 = trunc i8 %109 to i1
  %111 = zext i1 %110 to i64
  %112 = select i1 %110, i32 0, i32 1
  %113 = load i32, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %114 = add nsw i32 %113, %112
  store i32 %114, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %115 = load i8, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11, !range !13, !noundef !14
  %116 = trunc i8 %115 to i1
  %117 = zext i1 %116 to i64
  %118 = select i1 %116, i32 1, i32 0
  %119 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %120 = add nsw i32 %119, %118
  store i32 %120, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  br label %26, !llvm.loop !24

121:                                              ; preds = %26
  call void (ptr, ...) @_Z11MicroPrintfPKcz(ptr noundef @.str.6)
  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 %122

122:                                              ; preds = %204, %121
  %123 = load i8, ptr @_ZN10micro_test16is_test_completeE, align 1, !tbaa !11, !range !13, !noundef !14
  %124 = trunc i8 %123 to i1
  %125 = xor i1 %124, true
  br i1 %125, label %126, label %217

126:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %127 = getelementptr inbounds %struct.LogScaleState, ptr %16, i32 0, i32 0
  store i32 0, ptr %127, align 4, !tbaa !15
  %128 = getelementptr inbounds %struct.LogScaleState, ptr %16, i32 0, i32 1
  store i32 6, ptr %128, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 @__const.main.fake_signal.7, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %129 = getelementptr inbounds [2 x i32], ptr %17, i64 0, i64 0
  %130 = call ptr @LogScaleApply(ptr noundef %16, ptr noundef %129, i32 noundef 2, i32 noundef -1)
  store ptr %130, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %19, ptr align 2 @__const.main.expected.8, i64 4, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  store i64 0, ptr %20, align 8, !tbaa !18
  br label %131

131:                                              ; preds = %200, %126
  %132 = load i64, ptr %20, align 8, !tbaa !18
  %133 = icmp ult i64 %132, 2
  br i1 %133, label %135, label %134

134:                                              ; preds = %131
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %203

135:                                              ; preds = %131
  br label %136

136:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 2, ptr %21) #6
  %137 = load ptr, ptr %18, align 8, !tbaa !9
  %138 = load i64, ptr %20, align 8, !tbaa !18
  %139 = getelementptr inbounds i16, ptr %137, i64 %138
  %140 = load i16, ptr %139, align 2, !tbaa !20
  store i16 %140, ptr %21, align 2, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 2, ptr %22) #6
  %141 = load i64, ptr %20, align 8, !tbaa !18
  %142 = getelementptr inbounds [2 x i16], ptr %19, i64 0, i64 %141
  %143 = load i16, ptr %142, align 2, !tbaa !20
  store i16 %143, ptr %22, align 2, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 1, ptr %23) #6
  store i8 0, ptr %23, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %24) #6
  store i8 0, ptr %24, align 1, !tbaa !11
  %144 = load i8, ptr %23, align 1, !tbaa !11, !range !13, !noundef !14
  %145 = trunc i8 %144 to i1
  br i1 %145, label %146, label %178

146:                                              ; preds = %136
  %147 = load i8, ptr %24, align 1, !tbaa !11, !range !13, !noundef !14
  %148 = trunc i8 %147 to i1
  br i1 %148, label %149, label %178

149:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  %150 = load i16, ptr %21, align 2, !tbaa !20
  %151 = zext i16 %150 to i32
  %152 = load i16, ptr %22, align 2, !tbaa !20
  %153 = zext i16 %152 to i32
  %154 = icmp sgt i32 %151, %153
  br i1 %154, label %155, label %161

155:                                              ; preds = %149
  %156 = load i16, ptr %21, align 2, !tbaa !20
  %157 = zext i16 %156 to i32
  %158 = load i16, ptr %22, align 2, !tbaa !20
  %159 = zext i16 %158 to i32
  %160 = sub nsw i32 %157, %159
  br label %167

161:                                              ; preds = %149
  %162 = load i16, ptr %22, align 2, !tbaa !20
  %163 = zext i16 %162 to i32
  %164 = load i16, ptr %21, align 2, !tbaa !20
  %165 = zext i16 %164 to i32
  %166 = sub nsw i32 %163, %165
  br label %167

167:                                              ; preds = %161, %155
  %168 = phi i32 [ %160, %155 ], [ %166, %161 ]
  store i32 %168, ptr %25, align 4, !tbaa !5
  %169 = load i32, ptr %25, align 4, !tbaa !5
  %170 = call noundef i32 @_ZNSt14numeric_limitsIiE7epsilonEv() #6
  %171 = icmp sgt i32 %169, %170
  br i1 %171, label %172, label %177

172:                                              ; preds = %167
  %173 = load i16, ptr %21, align 2, !tbaa !20
  %174 = uitofp i16 %173 to double
  %175 = load i16, ptr %22, align 2, !tbaa !20
  %176 = uitofp i16 %175 to double
  call void (ptr, ...) @_Z11MicroPrintfPKcz(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 57, double noundef %174, double noundef %176)
  store i8 1, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11
  br label %177

177:                                              ; preds = %172, %167
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  br label %197

178:                                              ; preds = %146, %136
  %179 = load i16, ptr %21, align 2, !tbaa !20
  %180 = zext i16 %179 to i32
  %181 = load i16, ptr %22, align 2, !tbaa !20
  %182 = zext i16 %181 to i32
  %183 = icmp ne i32 %180, %182
  br i1 %183, label %184, label %196

184:                                              ; preds = %178
  %185 = load i16, ptr %21, align 2, !tbaa !20
  %186 = zext i16 %185 to i32
  %187 = load i16, ptr %22, align 2, !tbaa !20
  %188 = zext i16 %187 to i32
  call void (ptr, ...) @_Z11MicroPrintfPKcz(ptr noundef @.str.3, ptr noundef @.str.2, i32 noundef 57, i32 noundef %186, i32 noundef %188)
  %189 = load i8, ptr %23, align 1, !tbaa !11, !range !13, !noundef !14
  %190 = trunc i8 %189 to i1
  br i1 %190, label %194, label %191

191:                                              ; preds = %184
  %192 = load i8, ptr %24, align 1, !tbaa !11, !range !13, !noundef !14
  %193 = trunc i8 %192 to i1
  br i1 %193, label %194, label %195

194:                                              ; preds = %191, %184
  call void (ptr, ...) @_Z11MicroPrintfPKcz(ptr noundef @.str.4)
  call void (ptr, ...) @_Z11MicroPrintfPKcz(ptr noundef @.str.5)
  br label %195

195:                                              ; preds = %194, %191
  store i8 1, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11
  br label %196

196:                                              ; preds = %195, %178
  br label %197

197:                                              ; preds = %196, %177
  call void @llvm.lifetime.end.p0(i64 1, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr %21) #6
  br label %198

198:                                              ; preds = %197
  br label %199

199:                                              ; preds = %198
  br label %200

200:                                              ; preds = %199
  %201 = load i64, ptr %20, align 8, !tbaa !18
  %202 = add i64 %201, 1
  store i64 %202, ptr %20, align 8, !tbaa !18
  br label %131, !llvm.loop !25

203:                                              ; preds = %134
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %204

204:                                              ; preds = %203
  store i8 1, ptr @_ZN10micro_test16is_test_completeE, align 1, !tbaa !11
  %205 = load i8, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11, !range !13, !noundef !14
  %206 = trunc i8 %205 to i1
  %207 = zext i1 %206 to i64
  %208 = select i1 %206, i32 0, i32 1
  %209 = load i32, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %210 = add nsw i32 %209, %208
  store i32 %210, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %211 = load i8, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !11, !range !13, !noundef !14
  %212 = trunc i8 %211 to i1
  %213 = zext i1 %212 to i64
  %214 = select i1 %212, i32 1, i32 0
  %215 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %216 = add nsw i32 %215, %214
  store i32 %216, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  br label %122, !llvm.loop !26

217:                                              ; preds = %122
  %218 = load i32, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %219 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %220 = load i32, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %221 = add nsw i32 %219, %220
  call void (ptr, ...) @_Z11MicroPrintfPKcz(ptr noundef @.str.9, i32 noundef %218, i32 noundef %221)
  %222 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %223 = icmp eq i32 %222, 0
  br i1 %223, label %224, label %225

224:                                              ; preds = %217
  call void (ptr, ...) @_Z11MicroPrintfPKcz(ptr noundef @.str.10)
  store i32 0, ptr %3, align 4
  br label %226

225:                                              ; preds = %217
  call void (ptr, ...) @_Z11MicroPrintfPKcz(ptr noundef @.str.11)
  store i32 1, ptr %3, align 4
  br label %226

226:                                              ; preds = %225, %224
  %227 = load i32, ptr %3, align 4
  ret i32 %227
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6tflite14InitializeTestEv() #1

declare void @_Z11MicroPrintfPKcz(ptr noundef, ...) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 ptr @LogScaleApply(ptr noundef, ptr noundef, i32 noundef, i32 noundef) #2

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 0}
!16 = !{!"_ZTS13LogScaleState", !6, i64 0, !6, i64 4}
!17 = !{!16, !6, i64 4}
!18 = !{!19, !19, i64 0}
!19 = !{!"long", !7, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"short", !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}
!25 = distinct !{!25, !23}
!26 = distinct !{!26, !23}


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

%struct.LogScaleState = type { i32, 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
@.str = external hidden unnamed_addr constant [39 x i8], align 1
@__const.main.fake_signal = external hidden unnamed_addr constant [2 x i32], align 4
@__const.main.expected = external hidden unnamed_addr constant [2 x i16], align 2
@.str.2 = external hidden unnamed_addr constant [122 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [44 x i8], align 1
@__const.main.fake_signal.7 = external hidden unnamed_addr constant [2 x i32], align 4
@__const.main.expected.8 = external hidden unnamed_addr constant [2 x i16], align 2
@.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 range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = alloca %struct.LogScaleState, align 4
  %4 = alloca [2 x i32], align 8
  %5 = alloca %struct.LogScaleState, align 4
  %6 = 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
  tail call void @_ZN6tflite14InitializeTestEv()
  tail call void (ptr, ...) @_Z11MicroPrintfPKcz(ptr noundef nonnull @.str)
  store i8 0, ptr @_ZN10micro_test16is_test_completeE, align 1, !tbaa !9
  store i8 0, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !9
  %.pre = load i16, ptr @__const.main.expected, align 2, !tbaa !11
  %7 = load i64, ptr @__const.main.fake_signal, align 4
  %8 = getelementptr inbounds i8, ptr %3, i64 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  store i32 1, ptr %3, align 4, !tbaa !13
  store i32 6, ptr %8, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  store i64 %7, ptr %4, align 8
  %9 = call ptr @LogScaleApply(ptr noundef nonnull %3, ptr noundef nonnull %4, i32 noundef 2, i32 noundef -1)
  %10 = load i16, ptr %9, align 2, !tbaa !11
  %.not58 = icmp eq i16 %10, %.pre
  br i1 %.not58, label %14, label %11

11:                                               ; preds = %2
  %12 = zext i16 %.pre to i32
  %13 = zext i16 %10 to i32
  call void (ptr, ...) @_Z11MicroPrintfPKcz(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.2, i32 noundef 41, i32 noundef %13, i32 noundef %12)
  store i8 1, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !9
  br label %14

14:                                               ; preds = %2, %11
  %15 = load i16, ptr getelementptr inbounds (i8, ptr @__const.main.expected, i64 2), align 2, !tbaa !11
  %16 = getelementptr inbounds i8, ptr %9, i64 2
  %17 = load i16, ptr %16, align 2, !tbaa !11
  %.not58.1 = icmp eq i16 %17, %15
  br i1 %.not58.1, label %._crit_edge64, label %18

._crit_edge64:                                    ; preds = %14
  %.pre65 = load i8, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !9, !range !16
  br label %21

18:                                               ; preds = %14
  %19 = zext i16 %15 to i32
  %20 = zext i16 %17 to i32
  call void (ptr, ...) @_Z11MicroPrintfPKcz(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.2, i32 noundef 41, i32 noundef %20, i32 noundef %19)
  store i8 1, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !9
  br label %21

21:                                               ; preds = %._crit_edge64, %18
  %22 = phi i8 [ %.pre65, %._crit_edge64 ], [ 1, %18 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  store i8 1, ptr @_ZN10micro_test16is_test_completeE, align 1, !tbaa !9
  %23 = xor i8 %22, 1
  %not.57 = zext nneg i8 %23 to i32
  %24 = load i32, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %25 = add nsw i32 %24, %not.57
  store i32 %25, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %26 = zext nneg i8 %22 to i32
  %27 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %28 = add nsw i32 %27, %26
  store i32 %28, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  call void (ptr, ...) @_Z11MicroPrintfPKcz(ptr noundef nonnull @.str.6)
  store i8 0, ptr @_ZN10micro_test16is_test_completeE, align 1, !tbaa !9
  store i8 0, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !9
  %.pre67 = load i16, ptr @__const.main.expected.8, align 2, !tbaa !11
  %29 = load i64, ptr @__const.main.fake_signal.7, align 4
  %30 = getelementptr inbounds i8, ptr %5, i64 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  store i32 0, ptr %5, align 4, !tbaa !13
  store i32 6, ptr %30, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  store i64 %29, ptr %6, align 8
  %31 = call ptr @LogScaleApply(ptr noundef nonnull %5, ptr noundef nonnull %6, i32 noundef 2, i32 noundef -1)
  %32 = load i16, ptr %31, align 2, !tbaa !11
  %.not = icmp eq i16 %32, %.pre67
  br i1 %.not, label %36, label %33

33:                                               ; preds = %21
  %34 = zext i16 %.pre67 to i32
  %35 = zext i16 %32 to i32
  call void (ptr, ...) @_Z11MicroPrintfPKcz(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.2, i32 noundef 57, i32 noundef %35, i32 noundef %34)
  store i8 1, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !9
  br label %36

36:                                               ; preds = %21, %33
  %37 = load i16, ptr getelementptr inbounds (i8, ptr @__const.main.expected.8, i64 2), align 2, !tbaa !11
  %38 = getelementptr inbounds i8, ptr %31, i64 2
  %39 = load i16, ptr %38, align 2, !tbaa !11
  %.not.1 = icmp eq i16 %39, %37
  br i1 %.not.1, label %._crit_edge68, label %40

._crit_edge68:                                    ; preds = %36
  %.pre69 = load i8, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !9, !range !16
  br label %._crit_edge63

40:                                               ; preds = %36
  %41 = zext i16 %37 to i32
  %42 = zext i16 %39 to i32
  call void (ptr, ...) @_Z11MicroPrintfPKcz(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.2, i32 noundef 57, i32 noundef %42, i32 noundef %41)
  store i8 1, ptr @_ZN10micro_test13did_test_failE, align 1, !tbaa !9
  br label %._crit_edge63

._crit_edge63:                                    ; preds = %._crit_edge68, %40
  %43 = phi i8 [ %.pre69, %._crit_edge68 ], [ 1, %40 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  store i8 1, ptr @_ZN10micro_test16is_test_completeE, align 1, !tbaa !9
  %44 = xor i8 %43, 1
  %not. = zext nneg i8 %44 to i32
  %45 = load i32, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %46 = add nsw i32 %45, %not.
  store i32 %46, ptr @_ZN10micro_test12tests_passedE, align 4, !tbaa !5
  %47 = zext nneg i8 %43 to i32
  %48 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %49 = add nsw i32 %48, %47
  store i32 %49, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %50 = add nsw i32 %49, %46
  call void (ptr, ...) @_Z11MicroPrintfPKcz(ptr noundef nonnull @.str.9, i32 noundef %46, i32 noundef %50)
  %51 = load i32, ptr @_ZN10micro_test12tests_failedE, align 4, !tbaa !5
  %52 = icmp ne i32 %51, 0
  %.str.10..str.11 = select i1 %52, ptr @.str.11, ptr @.str.10
  %. = zext i1 %52 to i32
  call void (ptr, ...) @_Z11MicroPrintfPKcz(ptr noundef nonnull %.str.10..str.11)
  ret i32 %.
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6tflite14InitializeTestEv() local_unnamed_addr #1

declare void @_Z11MicroPrintfPKcz(ptr noundef, ...) local_unnamed_addr #2

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

declare ptr @LogScaleApply(ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTS13LogScaleState", !6, i64 0, !6, i64 4}
!15 = !{!14, !6, i64 4}
!16 = !{i8 0, i8 2}


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