; LLVM IR from glaretechnologies/substrata :: opus/opus-1.3.1/silk/float (wrappers_FLP)

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @silk_float2int(float noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local void @silk_quant_LTP_gains_FLP(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, i32 noundef %7, i32 noundef %8, i32 noundef %9) #2 {
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca [20 x i16], align 16
  %24 = alloca [100 x i32], align 16
  %25 = alloca [20 x i32], align 16
  store ptr %0, ptr %11, align 8, !tbaa !5
  store ptr %1, ptr %12, align 8, !tbaa !5
  store ptr %2, ptr %13, align 8, !tbaa !5
  store ptr %3, ptr %14, align 8, !tbaa !5
  store ptr %4, ptr %15, align 8, !tbaa !5
  store ptr %5, ptr %16, align 8, !tbaa !5
  store ptr %6, ptr %17, align 8, !tbaa !5
  store i32 %7, ptr %18, align 4, !tbaa !9
  store i32 %8, ptr %19, align 4, !tbaa !9
  store i32 %9, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 40, ptr %23) #4
  call void @llvm.lifetime.start.p0(i64 400, ptr %24) #4
  call void @llvm.lifetime.start.p0(i64 80, ptr %25) #4
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %26

26:                                               ; preds = %43, %10
  %27 = load i32, ptr %21, align 4, !tbaa !9
  %28 = load i32, ptr %19, align 4, !tbaa !9
  %29 = mul nsw i32 %28, 5
  %30 = mul nsw i32 %29, 5
  %31 = icmp slt i32 %27, %30
  br i1 %31, label %32, label %46

32:                                               ; preds = %26
  %33 = load ptr, ptr %16, align 8, !tbaa !5
  %34 = load i32, ptr %21, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds float, ptr %33, i64 %35
  %37 = load float, ptr %36, align 4, !tbaa !11
  %38 = fmul float %37, 1.310720e+05
  %39 = call i32 @silk_float2int(float noundef %38)
  %40 = load i32, ptr %21, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [100 x i32], ptr %24, i64 0, i64 %41
  store i32 %39, ptr %42, align 4, !tbaa !9
  br label %43

43:                                               ; preds = %32
  %44 = load i32, ptr %21, align 4, !tbaa !9
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %21, align 4, !tbaa !9
  br label %26, !llvm.loop !13

46:                                               ; preds = %26
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %47

47:                                               ; preds = %63, %46
  %48 = load i32, ptr %21, align 4, !tbaa !9
  %49 = load i32, ptr %19, align 4, !tbaa !9
  %50 = mul nsw i32 %49, 5
  %51 = icmp slt i32 %48, %50
  br i1 %51, label %52, label %66

52:                                               ; preds = %47
  %53 = load ptr, ptr %17, align 8, !tbaa !5
  %54 = load i32, ptr %21, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds float, ptr %53, i64 %55
  %57 = load float, ptr %56, align 4, !tbaa !11
  %58 = fmul float %57, 1.310720e+05
  %59 = call i32 @silk_float2int(float noundef %58)
  %60 = load i32, ptr %21, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [20 x i32], ptr %25, i64 0, i64 %61
  store i32 %59, ptr %62, align 4, !tbaa !9
  br label %63

63:                                               ; preds = %52
  %64 = load i32, ptr %21, align 4, !tbaa !9
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %21, align 4, !tbaa !9
  br label %47, !llvm.loop !15

66:                                               ; preds = %47
  %67 = getelementptr inbounds [20 x i16], ptr %23, i64 0, i64 0
  %68 = load ptr, ptr %12, align 8, !tbaa !5
  %69 = load ptr, ptr %13, align 8, !tbaa !5
  %70 = load ptr, ptr %14, align 8, !tbaa !5
  %71 = getelementptr inbounds [100 x i32], ptr %24, i64 0, i64 0
  %72 = getelementptr inbounds [20 x i32], ptr %25, i64 0, i64 0
  %73 = load i32, ptr %18, align 4, !tbaa !9
  %74 = load i32, ptr %19, align 4, !tbaa !9
  %75 = load i32, ptr %20, align 4, !tbaa !9
  call void @silk_quant_LTP_gains(ptr noundef %67, ptr noundef %68, ptr noundef %69, ptr noundef %70, ptr noundef %22, ptr noundef %71, ptr noundef %72, i32 noundef %73, i32 noundef %74, i32 noundef %75)
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %76

76:                                               ; preds = %92, %66
  %77 = load i32, ptr %21, align 4, !tbaa !9
  %78 = load i32, ptr %19, align 4, !tbaa !9
  %79 = mul nsw i32 %78, 5
  %80 = icmp slt i32 %77, %79
  br i1 %80, label %81, label %95

81:                                               ; preds = %76
  %82 = load i32, ptr %21, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [20 x i16], ptr %23, i64 0, i64 %83
  %85 = load i16, ptr %84, align 2, !tbaa !16
  %86 = sitofp i16 %85 to float
  %87 = fmul float %86, 0x3F10000000000000
  %88 = load ptr, ptr %11, 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
  store float %87, ptr %91, align 4, !tbaa !11
  br label %92

92:                                               ; preds = %81
  %93 = load i32, ptr %21, align 4, !tbaa !9
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %21, align 4, !tbaa !9
  br label %76, !llvm.loop !18

95:                                               ; preds = %76
  %96 = load i32, ptr %22, align 4, !tbaa !9
  %97 = sitofp i32 %96 to float
  %98 = fmul float %97, 7.812500e-03
  %99 = load ptr, ptr %15, align 8, !tbaa !5
  store float %98, ptr %99, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 80, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 400, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  ret void
}

declare void @silk_quant_LTP_gains(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 #2 = { 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 = { 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/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 = distinct !{!15, !14}
!16 = !{!17, !17, i64 0}
!17 = !{!"short", !7, i64 0}
!18 = distinct !{!18, !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"

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @silk_float2int(float noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local void @silk_quant_LTP_gains_FLP(ptr nocapture noundef writeonly %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr nocapture noundef writeonly %4, ptr nocapture noundef readonly %5, ptr nocapture noundef readonly %6, i32 noundef %7, i32 noundef %8, i32 noundef %9) local_unnamed_addr #2 {
  %11 = alloca i32, align 4
  %12 = alloca [20 x i16], align 16
  %13 = alloca [100 x i32], align 16
  %14 = alloca [20 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %12) #5
  call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %13) #5
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %14) #5
  %15 = mul i32 %8, 25
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph.preheader, label %.preheader

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

.preheader:                                       ; preds = %.lr.ph, %10
  %17 = mul i32 %8, 5
  %18 = icmp sgt i32 %8, 0
  br i1 %18, label %.lr.ph27.preheader, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %.preheader
  call void @silk_quant_LTP_gains(ptr noundef nonnull %12, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef nonnull %11, ptr noundef nonnull %13, ptr noundef nonnull %14, i32 noundef %7, i32 noundef %8, i32 noundef %9) #5
  br label %._crit_edge31

.lr.ph27.preheader:                               ; preds = %.preheader
  %smax = tail call i32 @llvm.smax.i32(i32 %17, i32 1)
  %wide.trip.count36 = zext nneg i32 %smax to i64
  br label %.lr.ph27

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %19 = getelementptr inbounds float, ptr %5, i64 %indvars.iv
  %20 = load float, ptr %19, align 4, !tbaa !5
  %21 = fmul float %20, 1.310720e+05
  %22 = tail call i32 @silk_float2int(float noundef %21)
  %23 = getelementptr inbounds [100 x i32], ptr %13, i64 0, i64 %indvars.iv
  store i32 %22, ptr %23, align 4, !tbaa !9
  %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 %.preheader, label %.lr.ph, !llvm.loop !11

.lr.ph27:                                         ; preds = %.lr.ph27.preheader, %.lr.ph27
  %indvars.iv33 = phi i64 [ 0, %.lr.ph27.preheader ], [ %indvars.iv.next34, %.lr.ph27 ]
  %24 = getelementptr inbounds float, ptr %6, i64 %indvars.iv33
  %25 = load float, ptr %24, align 4, !tbaa !5
  %26 = fmul float %25, 1.310720e+05
  %27 = tail call i32 @silk_float2int(float noundef %26)
  %28 = getelementptr inbounds [20 x i32], ptr %14, i64 0, i64 %indvars.iv33
  store i32 %27, ptr %28, align 4, !tbaa !9
  %indvars.iv.next34 = add nuw nsw i64 %indvars.iv33, 1
  %exitcond37.not = icmp eq i64 %indvars.iv.next34, %wide.trip.count36
  br i1 %exitcond37.not, label %._crit_edge, label %.lr.ph27, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph27
  call void @silk_quant_LTP_gains(ptr noundef nonnull %12, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef nonnull %11, ptr noundef nonnull %13, ptr noundef nonnull %14, i32 noundef %7, i32 noundef %8, i32 noundef %9) #5
  br i1 %18, label %.lr.ph30.preheader, label %._crit_edge31

.lr.ph30.preheader:                               ; preds = %._crit_edge
  %smax41 = call i32 @llvm.smax.i32(i32 %17, i32 1)
  %wide.trip.count42 = zext nneg i32 %smax41 to i64
  %min.iters.check = icmp slt i32 %17, 8
  br i1 %min.iters.check, label %.lr.ph30.preheader45, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph30.preheader
  %n.vec = and i64 %wide.trip.count36, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %29 = getelementptr inbounds [20 x i16], ptr %12, i64 0, i64 %index
  %30 = getelementptr inbounds i8, ptr %29, i64 8
  %wide.load = load <4 x i16>, ptr %29, align 16, !tbaa !14
  %wide.load44 = load <4 x i16>, ptr %30, align 8, !tbaa !14
  %31 = sitofp <4 x i16> %wide.load to <4 x float>
  %32 = sitofp <4 x i16> %wide.load44 to <4 x float>
  %33 = fmul <4 x float> %31, <float 0x3F10000000000000, float 0x3F10000000000000, float 0x3F10000000000000, float 0x3F10000000000000>
  %34 = fmul <4 x float> %32, <float 0x3F10000000000000, float 0x3F10000000000000, float 0x3F10000000000000, float 0x3F10000000000000>
  %35 = getelementptr inbounds float, ptr %0, i64 %index
  %36 = getelementptr inbounds i8, ptr %35, i64 16
  store <4 x float> %33, ptr %35, align 4, !tbaa !5
  store <4 x float> %34, ptr %36, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %37 = icmp eq i64 %index.next, %n.vec
  br i1 %37, label %middle.block, label %vector.body, !llvm.loop !16

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count36
  br i1 %cmp.n, label %._crit_edge31, label %.lr.ph30.preheader45

.lr.ph30.preheader45:                             ; preds = %middle.block, %.lr.ph30.preheader
  %indvars.iv38.ph = phi i64 [ 0, %.lr.ph30.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph30

.lr.ph30:                                         ; preds = %.lr.ph30.preheader45, %.lr.ph30
  %indvars.iv38 = phi i64 [ %indvars.iv.next39, %.lr.ph30 ], [ %indvars.iv38.ph, %.lr.ph30.preheader45 ]
  %38 = getelementptr inbounds [20 x i16], ptr %12, i64 0, i64 %indvars.iv38
  %39 = load i16, ptr %38, align 2, !tbaa !14
  %40 = sitofp i16 %39 to float
  %41 = fmul float %40, 0x3F10000000000000
  %42 = getelementptr inbounds float, ptr %0, i64 %indvars.iv38
  store float %41, ptr %42, align 4, !tbaa !5
  %indvars.iv.next39 = add nuw nsw i64 %indvars.iv38, 1
  %exitcond43.not = icmp eq i64 %indvars.iv.next39, %wide.trip.count42
  br i1 %exitcond43.not, label %._crit_edge31, label %.lr.ph30, !llvm.loop !19

._crit_edge31:                                    ; preds = %.lr.ph30, %middle.block, %._crit_edge.thread, %._crit_edge
  %43 = load i32, ptr %11, align 4, !tbaa !9
  %44 = sitofp i32 %43 to float
  %45 = fmul float %44, 7.812500e-03
  store float %45, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #5
  ret void
}

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 #2 = { 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 nosync nounwind speculatable willreturn memory(none) }
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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"short", !7, i64 0}
!16 = distinct !{!16, !12, !17, !18}
!17 = !{!"llvm.loop.isvectorized", i32 1}
!18 = !{!"llvm.loop.unroll.runtime.disable"}
!19 = distinct !{!19, !12, !18, !17}


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