; LLVM IR from Seeed-Studio/Seeed_Arduino_edgeimpulse :: src/edge-impulse-sdk/tensorflow/lite/micro (micro_utils)

; 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.TfLiteIntArray = type { i32, [0 x i32] }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6tflite12ElementCountERK14TfLiteIntArray(ptr noundef nonnull align 4 dereferenceable(4)) #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6tflite33SignedSymmetricPerChannelQuantizeEPKfP14TfLiteIntArrayiPaPf(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4) #2 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %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 float, align 4
  %19 = alloca float, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = call noundef i32 @_ZN6tflite12ElementCountERK14TfLiteIntArray(ptr noundef nonnull align 4 dereferenceable(4) %25)
  store i32 %26, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.TfLiteIntArray, ptr %27, i32 0, i32 1
  %29 = load i32, ptr %8, align 4, !tbaa !9
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [0 x i32], ptr %28, i64 0, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !9
  store i32 %32, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %33 = load i32, ptr %11, align 4, !tbaa !9
  %34 = load i32, ptr %12, align 4, !tbaa !9
  %35 = sdiv i32 %33, %34
  store i32 %35, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %36 = load i32, ptr %8, align 4, !tbaa !9
  %37 = icmp eq i32 %36, 0
  br i1 %37, label %38, label %40

38:                                               ; preds = %5
  store i32 1, ptr %14, align 4, !tbaa !9
  %39 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %39, ptr %15, align 4, !tbaa !9
  br label %60

40:                                               ; preds = %5
  %41 = load i32, ptr %8, align 4, !tbaa !9
  %42 = icmp eq i32 %41, 3
  br i1 %42, label %43, label %45

43:                                               ; preds = %40
  %44 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %44, ptr %14, align 4, !tbaa !9
  store i32 1, ptr %15, align 4, !tbaa !9
  br label %59

45:                                               ; preds = %40
  br label %46

46:                                               ; preds = %45
  br label %47

47:                                               ; preds = %46
  %48 = load ptr, ptr @stderr, align 8, !tbaa !5
  %49 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef @.str, ptr noundef @.str.1) #7
  br label %50

50:                                               ; preds = %47
  br label %51

51:                                               ; preds = %50
  br label %52

52:                                               ; preds = %51
  %53 = load ptr, ptr @stderr, align 8, !tbaa !5
  %54 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef @.str, ptr noundef @.str.2) #7
  br label %55

55:                                               ; preds = %52
  br label %56

56:                                               ; preds = %55
  call void @abort() #8
  unreachable

57:                                               ; No predecessors!
  br label %58

58:                                               ; preds = %57
  br label %59

59:                                               ; preds = %58, %43
  br label %60

60:                                               ; preds = %59, %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %147, %60
  %62 = load i32, ptr %16, align 4, !tbaa !9
  %63 = load i32, ptr %12, align 4, !tbaa !9
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %61
  store i32 8, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %150

66:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store float 0.000000e+00, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store float 0.000000e+00, ptr %19, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %67

67:                                               ; preds = %94, %66
  %68 = load i32, ptr %20, align 4, !tbaa !9
  %69 = load i32, ptr %13, align 4, !tbaa !9
  %70 = icmp slt i32 %68, %69
  br i1 %70, label %72, label %71

71:                                               ; preds = %67
  store i32 11, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %97

72:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  %73 = load i32, ptr %16, align 4, !tbaa !9
  %74 = load i32, ptr %15, align 4, !tbaa !9
  %75 = mul nsw i32 %73, %74
  %76 = load i32, ptr %20, align 4, !tbaa !9
  %77 = load i32, ptr %14, align 4, !tbaa !9
  %78 = mul nsw i32 %76, %77
  %79 = add nsw i32 %75, %78
  store i32 %79, ptr %21, align 4, !tbaa !9
  %80 = load float, ptr %18, align 4, !tbaa !11
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = load i32, ptr %21, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds float, ptr %81, i64 %83
  %85 = load float, ptr %84, align 4, !tbaa !11
  %86 = call float @llvm.minnum.f32(float %80, float %85)
  store float %86, ptr %18, align 4, !tbaa !11
  %87 = load float, ptr %19, align 4, !tbaa !11
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = load i32, ptr %21, align 4, !tbaa !9
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds float, ptr %88, i64 %90
  %92 = load float, ptr %91, align 4, !tbaa !11
  %93 = call float @llvm.maxnum.f32(float %87, float %92)
  store float %93, ptr %19, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %94

94:                                               ; preds = %72
  %95 = load i32, ptr %20, align 4, !tbaa !9
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %20, align 4, !tbaa !9
  br label %67, !llvm.loop !13

97:                                               ; preds = %71
  %98 = load float, ptr %18, align 4, !tbaa !11
  %99 = call noundef float @_ZSt4fabsf(float noundef %98)
  %100 = load float, ptr %19, align 4, !tbaa !11
  %101 = call noundef float @_ZSt4fabsf(float noundef %100)
  %102 = call float @llvm.maxnum.f32(float %99, float %101)
  %103 = fdiv float %102, 1.270000e+02
  %104 = load ptr, ptr %10, align 8, !tbaa !5
  %105 = load i32, ptr %16, align 4, !tbaa !9
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds float, ptr %104, i64 %106
  store float %103, ptr %107, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %108

108:                                              ; preds = %143, %97
  %109 = load i32, ptr %22, align 4, !tbaa !9
  %110 = load i32, ptr %13, align 4, !tbaa !9
  %111 = icmp slt i32 %109, %110
  br i1 %111, label %113, label %112

112:                                              ; preds = %108
  store i32 14, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %146

113:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  %114 = load i32, ptr %16, align 4, !tbaa !9
  %115 = load i32, ptr %15, align 4, !tbaa !9
  %116 = mul nsw i32 %114, %115
  %117 = load i32, ptr %22, align 4, !tbaa !9
  %118 = load i32, ptr %14, align 4, !tbaa !9
  %119 = mul nsw i32 %117, %118
  %120 = add nsw i32 %116, %119
  store i32 %120, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  %121 = load ptr, ptr %6, align 8, !tbaa !5
  %122 = load i32, ptr %23, align 4, !tbaa !9
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds float, ptr %121, i64 %123
  %125 = load float, ptr %124, align 4, !tbaa !11
  %126 = load ptr, ptr %10, align 8, !tbaa !5
  %127 = load i32, ptr %16, align 4, !tbaa !9
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds float, ptr %126, i64 %128
  %130 = load float, ptr %129, align 4, !tbaa !11
  %131 = fdiv float %125, %130
  %132 = call float @llvm.round.f32(float %131)
  %133 = fptosi float %132 to i32
  store i32 %133, ptr %24, align 4, !tbaa !9
  %134 = load i32, ptr %24, align 4, !tbaa !9
  %135 = sitofp i32 %134 to float
  %136 = call float @llvm.maxnum.f32(float -1.270000e+02, float %135)
  %137 = call float @llvm.minnum.f32(float 1.270000e+02, float %136)
  %138 = fptosi float %137 to i8
  %139 = load ptr, ptr %9, align 8, !tbaa !5
  %140 = load i32, ptr %23, align 4, !tbaa !9
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds i8, ptr %139, i64 %141
  store i8 %138, ptr %142, align 1, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  br label %143

143:                                              ; preds = %113
  %144 = load i32, ptr %22, align 4, !tbaa !9
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr %22, align 4, !tbaa !9
  br label %108, !llvm.loop !16

146:                                              ; preds = %112
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %147

147:                                              ; preds = %146
  %148 = load i32, ptr %16, align 4, !tbaa !9
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %16, align 4, !tbaa !9
  br label %61, !llvm.loop !17

150:                                              ; preds = %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  ret void
}

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

; Function Attrs: noreturn nounwind
declare void @abort() #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.minnum.f32(float, float) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.maxnum.f32(float, float) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4fabsf(float noundef) #6

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.round.f32(float) #5

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nounwind "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 = { noreturn nounwind "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 #7 = { nounwind }
attributes #8 = { noreturn 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6tflite12ElementCountERK14TfLiteIntArray(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN6tflite33SignedSymmetricPerChannelQuantizeEPKfP14TfLiteIntArrayiPaPf(ptr nocapture noundef readonly %0, ptr noundef nonnull %1, i32 noundef %2, ptr nocapture noundef writeonly %3, ptr nocapture noundef %4) local_unnamed_addr #0 {
  %6 = tail call noundef i32 @_ZN6tflite12ElementCountERK14TfLiteIntArray(ptr noundef nonnull align 4 dereferenceable(4) %1)
  %7 = getelementptr inbounds i8, ptr %1, i64 4
  %8 = sext i32 %2 to i64
  %9 = getelementptr inbounds [0 x i32], ptr %7, i64 0, i64 %8
  %10 = load i32, ptr %9, align 4, !tbaa !5
  %.fr = freeze i32 %10
  %11 = sdiv i32 %6, %.fr
  switch i32 %2, label %14 [
    i32 0, label %19
    i32 3, label %12
  ]

12:                                               ; preds = %5
  %13 = sext i32 %.fr to i64
  br label %19

14:                                               ; preds = %5
  %15 = load ptr, ptr @stderr, align 8, !tbaa !9
  %16 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1) #6
  %17 = load ptr, ptr @stderr, align 8, !tbaa !9
  %18 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef nonnull @.str, ptr noundef nonnull @.str.2) #6
  tail call void @abort() #7
  unreachable

19:                                               ; preds = %5, %12
  %.042 = phi i32 [ 1, %12 ], [ %11, %5 ]
  %.0 = phi i64 [ %13, %12 ], [ 1, %5 ]
  %20 = icmp sgt i32 %.fr, 0
  br i1 %20, label %.preheader.lr.ph, label %._crit_edge59

.preheader.lr.ph:                                 ; preds = %19
  %21 = icmp sgt i32 %11, 0
  br i1 %21, label %.preheader.us.preheader, label %.preheader.preheader

.preheader.us.preheader:                          ; preds = %.preheader.lr.ph
  %22 = sext i32 %.042 to i64
  %wide.trip.count101 = zext nneg i32 %.fr to i64
  %wide.trip.count91 = zext nneg i32 %11 to i64
  %23 = add nsw i64 %wide.trip.count101, -1
  %24 = mul nsw i64 %23, %22
  %25 = getelementptr i8, ptr %3, i64 %24
  %scevgep = getelementptr i8, ptr %25, i64 %wide.trip.count91
  %26 = add i64 %24, %wide.trip.count91
  %27 = shl i64 %26, 2
  %scevgep108 = getelementptr i8, ptr %0, i64 %27
  %28 = shl nuw nsw i64 %wide.trip.count101, 2
  %scevgep109 = getelementptr i8, ptr %4, i64 %28
  %min.iters.check = icmp ugt i32 %11, 3
  %ident.check.not = icmp eq i64 %.0, 1
  %or.cond = and i1 %min.iters.check, %ident.check.not
  %bound0 = icmp ugt ptr %scevgep108, %3
  %bound1 = icmp ugt ptr %scevgep, %0
  %found.conflict = and i1 %bound0, %bound1
  %bound0111 = icmp ugt ptr %scevgep109, %3
  %bound1112 = icmp ugt ptr %scevgep, %4
  %found.conflict113 = and i1 %bound0111, %bound1112
  %stride.check114 = icmp slt i32 %.042, 0
  %29 = or i1 %found.conflict113, %stride.check114
  %conflict.rdx = or i1 %found.conflict, %29
  %n.vec = and i64 %wide.trip.count91, 2147483644
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count91
  br label %.lr.ph.us

.lr.ph56.us:                                      ; preds = %60
  %30 = tail call noundef float @_ZSt4fabsf(float noundef %63)
  %31 = tail call noundef float @_ZSt4fabsf(float noundef %64)
  %32 = tail call float @llvm.maxnum.f32(float %30, float %31)
  %33 = fdiv float %32, 1.270000e+02
  %34 = getelementptr inbounds float, ptr %4, i64 %indvars.iv98
  store float %33, ptr %34, align 4, !tbaa !11
  %or.cond.not = xor i1 %or.cond, true
  %brmerge = select i1 %or.cond.not, i1 true, i1 %conflict.rdx
  br i1 %brmerge, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph56.us
  %35 = load float, ptr %34, align 4, !tbaa !11, !alias.scope !13
  %broadcast.splatinsert = insertelement <4 x float> poison, float %35, i64 0
  %broadcast.splat = shufflevector <4 x float> %broadcast.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %36 = add nsw i64 %index, %65
  %37 = getelementptr inbounds float, ptr %0, i64 %36
  %wide.load = load <4 x float>, ptr %37, align 4, !tbaa !11, !alias.scope !16
  %38 = fdiv <4 x float> %wide.load, %broadcast.splat
  %39 = tail call <4 x float> @llvm.round.v4f32(<4 x float> %38)
  %40 = fptosi <4 x float> %39 to <4 x i32>
  %41 = sitofp <4 x i32> %40 to <4 x float>
  %42 = tail call <4 x float> @llvm.maxnum.v4f32(<4 x float> %41, <4 x float> <float -1.270000e+02, float -1.270000e+02, float -1.270000e+02, float -1.270000e+02>)
  %43 = tail call <4 x float> @llvm.minnum.v4f32(<4 x float> %42, <4 x float> <float 1.270000e+02, float 1.270000e+02, float 1.270000e+02, float 1.270000e+02>)
  %44 = fptosi <4 x float> %43 to <4 x i8>
  %45 = getelementptr inbounds i8, ptr %3, i64 %36
  store <4 x i8> %44, ptr %45, align 1, !tbaa !18, !alias.scope !19, !noalias !21
  %index.next = add nuw i64 %index, 4
  %46 = icmp eq i64 %index.next, %n.vec
  br i1 %46, label %middle.block, label %vector.body, !llvm.loop !22

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge57.us, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %.lr.ph56.us, %middle.block
  %indvars.iv93.ph = phi i64 [ 0, %.lr.ph56.us ], [ %n.vec, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv93 = phi i64 [ %indvars.iv.next94, %scalar.ph ], [ %indvars.iv93.ph, %scalar.ph.preheader ]
  %47 = mul nsw i64 %indvars.iv93, %.0
  %48 = add nsw i64 %47, %65
  %49 = getelementptr inbounds float, ptr %0, i64 %48
  %50 = load float, ptr %49, align 4, !tbaa !11
  %51 = load float, ptr %34, align 4, !tbaa !11
  %52 = fdiv float %50, %51
  %53 = tail call float @llvm.round.f32(float %52)
  %54 = fptosi float %53 to i32
  %55 = sitofp i32 %54 to float
  %56 = tail call float @llvm.maxnum.f32(float %55, float -1.270000e+02)
  %57 = tail call float @llvm.minnum.f32(float %56, float 1.270000e+02)
  %58 = fptosi float %57 to i8
  %59 = getelementptr inbounds i8, ptr %3, i64 %48
  store i8 %58, ptr %59, align 1, !tbaa !18
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %exitcond97.not = icmp eq i64 %indvars.iv.next94, %wide.trip.count91
  br i1 %exitcond97.not, label %._crit_edge57.us, label %scalar.ph, !llvm.loop !26

60:                                               ; preds = %.lr.ph.us, %60
  %indvars.iv88 = phi i64 [ 0, %.lr.ph.us ], [ %indvars.iv.next89, %60 ]
  %.04651.us = phi float [ 0.000000e+00, %.lr.ph.us ], [ %64, %60 ]
  %.04750.us = phi float [ 0.000000e+00, %.lr.ph.us ], [ %63, %60 ]
  %61 = mul nsw i64 %indvars.iv88, %.0
  %gep = getelementptr float, ptr %invariant.gep, i64 %61
  %62 = load float, ptr %gep, align 4, !tbaa !11
  %63 = tail call float @llvm.minnum.f32(float %.04750.us, float %62)
  %64 = tail call float @llvm.maxnum.f32(float %.04651.us, float %62)
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %exitcond92.not = icmp eq i64 %indvars.iv.next89, %wide.trip.count91
  br i1 %exitcond92.not, label %.lr.ph56.us, label %60, !llvm.loop !27

.lr.ph.us:                                        ; preds = %._crit_edge57.us, %.preheader.us.preheader
  %indvars.iv98 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next99, %._crit_edge57.us ]
  %65 = mul nsw i64 %indvars.iv98, %22
  %invariant.gep = getelementptr float, ptr %0, i64 %65
  br label %60

._crit_edge57.us:                                 ; preds = %scalar.ph, %middle.block
  %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
  %exitcond102.not = icmp eq i64 %indvars.iv.next99, %wide.trip.count101
  br i1 %exitcond102.not, label %._crit_edge59, label %.lr.ph.us, !llvm.loop !28

.preheader.preheader:                             ; preds = %.preheader.lr.ph
  %wide.trip.count = zext nneg i32 %.fr to i64
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %indvars.iv = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next, %.preheader ]
  %66 = tail call noundef float @_ZSt4fabsf(float noundef 0.000000e+00)
  %67 = tail call noundef float @_ZSt4fabsf(float noundef 0.000000e+00)
  %68 = tail call float @llvm.maxnum.f32(float %66, float %67)
  %69 = fdiv float %68, 1.270000e+02
  %70 = getelementptr inbounds float, ptr %4, i64 %indvars.iv
  store float %69, ptr %70, align 4, !tbaa !11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge59, label %.preheader, !llvm.loop !28

._crit_edge59:                                    ; preds = %.preheader, %._crit_edge57.us, %19
  ret void
}

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.minnum.f32(float, float) #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.maxnum.f32(float, float) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4fabsf(float noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.round.f32(float) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x float> @llvm.round.v4f32(<4 x float>) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x float> @llvm.maxnum.v4f32(<4 x float>, <4 x float>) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x float> @llvm.minnum.v4f32(<4 x float>, <4 x float>) #5

attributes #0 = { 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 #1 = { nofree nounwind "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 = { noreturn nounwind "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 speculatable willreturn memory(none) }
attributes #4 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { cold nounwind }
attributes #7 = { noreturn 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 = !{!"float", !7, i64 0}
!13 = !{!14}
!14 = distinct !{!14, !15}
!15 = distinct !{!15, !"LVerDomain"}
!16 = !{!17}
!17 = distinct !{!17, !15}
!18 = !{!7, !7, i64 0}
!19 = !{!20}
!20 = distinct !{!20, !15}
!21 = !{!17, !14}
!22 = distinct !{!22, !23, !24, !25}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!"llvm.loop.isvectorized", i32 1}
!25 = !{!"llvm.loop.unroll.runtime.disable"}
!26 = distinct !{!26, !23, !24}
!27 = distinct !{!27, !23}
!28 = distinct !{!28, !23}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass