; LLVM IR from glaretechnologies/substrata :: opus/opus-1.3.1/silk/float (LPC_inv_pred_gain_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: nounwind uwtable
define dso_local float @silk_LPC_inverse_pred_gain_FLP(ptr noundef %0, i32 noundef %1) #0 {
  %3 = alloca float, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca [24 x float], align 16
  %15 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 96, ptr %14) #4
  %16 = getelementptr inbounds [24 x float], ptr %14, i64 0, i64 0
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = load i32, ptr %5, align 4, !tbaa !9
  %19 = sext i32 %18 to i64
  %20 = mul i64 %19, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %16, ptr align 4 %17, i64 %20, i1 false)
  store double 1.000000e+00, ptr %8, align 8, !tbaa !11
  %21 = load i32, ptr %5, align 4, !tbaa !9
  %22 = sub nsw i32 %21, 1
  store i32 %22, ptr %6, align 4, !tbaa !9
  br label %23

23:                                               ; preds = %96, %2
  %24 = load i32, ptr %6, align 4, !tbaa !9
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %26, label %99

26:                                               ; preds = %23
  %27 = load i32, ptr %6, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [24 x float], ptr %14, i64 0, i64 %28
  %30 = load float, ptr %29, align 4, !tbaa !13
  %31 = fneg float %30
  %32 = fpext float %31 to double
  store double %32, ptr %9, align 8, !tbaa !11
  %33 = load double, ptr %9, align 8, !tbaa !11
  %34 = load double, ptr %9, align 8, !tbaa !11
  %35 = fneg double %33
  %36 = call double @llvm.fmuladd.f64(double %35, double %34, double 1.000000e+00)
  store double %36, ptr %10, align 8, !tbaa !11
  %37 = load double, ptr %10, align 8, !tbaa !11
  %38 = load double, ptr %8, align 8, !tbaa !11
  %39 = fmul double %38, %37
  store double %39, ptr %8, align 8, !tbaa !11
  %40 = load double, ptr %8, align 8, !tbaa !11
  %41 = fmul double %40, 1.000000e+04
  %42 = fcmp olt double %41, 1.000000e+00
  br i1 %42, label %43, label %44

43:                                               ; preds = %26
  store float 0.000000e+00, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %118

44:                                               ; preds = %26
  %45 = load double, ptr %10, align 8, !tbaa !11
  %46 = fdiv double 1.000000e+00, %45
  store double %46, ptr %11, align 8, !tbaa !11
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %47

47:                                               ; preds = %92, %44
  %48 = load i32, ptr %7, align 4, !tbaa !9
  %49 = load i32, ptr %6, align 4, !tbaa !9
  %50 = add nsw i32 %49, 1
  %51 = ashr i32 %50, 1
  %52 = icmp slt i32 %48, %51
  br i1 %52, label %53, label %95

53:                                               ; preds = %47
  %54 = load i32, ptr %7, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [24 x float], ptr %14, i64 0, i64 %55
  %57 = load float, ptr %56, align 4, !tbaa !13
  %58 = fpext float %57 to double
  store double %58, ptr %12, align 8, !tbaa !11
  %59 = load i32, ptr %6, align 4, !tbaa !9
  %60 = load i32, ptr %7, align 4, !tbaa !9
  %61 = sub nsw i32 %59, %60
  %62 = sub nsw i32 %61, 1
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [24 x float], ptr %14, i64 0, i64 %63
  %65 = load float, ptr %64, align 4, !tbaa !13
  %66 = fpext float %65 to double
  store double %66, ptr %13, align 8, !tbaa !11
  %67 = load double, ptr %12, align 8, !tbaa !11
  %68 = load double, ptr %13, align 8, !tbaa !11
  %69 = load double, ptr %9, align 8, !tbaa !11
  %70 = fneg double %68
  %71 = call double @llvm.fmuladd.f64(double %70, double %69, double %67)
  %72 = load double, ptr %11, align 8, !tbaa !11
  %73 = fmul double %71, %72
  %74 = fptrunc double %73 to float
  %75 = load i32, ptr %7, align 4, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [24 x float], ptr %14, i64 0, i64 %76
  store float %74, ptr %77, align 4, !tbaa !13
  %78 = load double, ptr %13, align 8, !tbaa !11
  %79 = load double, ptr %12, align 8, !tbaa !11
  %80 = load double, ptr %9, align 8, !tbaa !11
  %81 = fneg double %79
  %82 = call double @llvm.fmuladd.f64(double %81, double %80, double %78)
  %83 = load double, ptr %11, align 8, !tbaa !11
  %84 = fmul double %82, %83
  %85 = fptrunc double %84 to float
  %86 = load i32, ptr %6, align 4, !tbaa !9
  %87 = load i32, ptr %7, align 4, !tbaa !9
  %88 = sub nsw i32 %86, %87
  %89 = sub nsw i32 %88, 1
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [24 x float], ptr %14, i64 0, i64 %90
  store float %85, ptr %91, align 4, !tbaa !13
  br label %92

92:                                               ; preds = %53
  %93 = load i32, ptr %7, align 4, !tbaa !9
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %7, align 4, !tbaa !9
  br label %47, !llvm.loop !15

95:                                               ; preds = %47
  br label %96

96:                                               ; preds = %95
  %97 = load i32, ptr %6, align 4, !tbaa !9
  %98 = add nsw i32 %97, -1
  store i32 %98, ptr %6, align 4, !tbaa !9
  br label %23, !llvm.loop !17

99:                                               ; preds = %23
  %100 = getelementptr inbounds [24 x float], ptr %14, i64 0, i64 0
  %101 = load float, ptr %100, align 16, !tbaa !13
  %102 = fneg float %101
  %103 = fpext float %102 to double
  store double %103, ptr %9, align 8, !tbaa !11
  %104 = load double, ptr %9, align 8, !tbaa !11
  %105 = load double, ptr %9, align 8, !tbaa !11
  %106 = fneg double %104
  %107 = call double @llvm.fmuladd.f64(double %106, double %105, double 1.000000e+00)
  store double %107, ptr %10, align 8, !tbaa !11
  %108 = load double, ptr %10, align 8, !tbaa !11
  %109 = load double, ptr %8, align 8, !tbaa !11
  %110 = fmul double %109, %108
  store double %110, ptr %8, align 8, !tbaa !11
  %111 = load double, ptr %8, align 8, !tbaa !11
  %112 = fmul double %111, 1.000000e+04
  %113 = fcmp olt double %112, 1.000000e+00
  br i1 %113, label %114, label %115

114:                                              ; preds = %99
  store float 0.000000e+00, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %118

115:                                              ; preds = %99
  %116 = load double, ptr %8, align 8, !tbaa !11
  %117 = fptrunc double %116 to float
  store float %117, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %118

118:                                              ; preds = %115, %114, %43
  call void @llvm.lifetime.end.p0(i64 96, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  %119 = load float, ptr %3, align 4
  ret float %119
}

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

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

attributes #0 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"double", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


; 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: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local float @silk_LPC_inverse_pred_gain_FLP(ptr nocapture noundef readonly %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = alloca [24 x float], align 16
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %3) #4
  %4 = sext i32 %1 to i64
  %5 = shl nsw i64 %4, 2
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %3, ptr align 4 %0, i64 %5, i1 false)
  %6 = icmp sgt i32 %1, 1
  br i1 %6, label %.lr.ph45.preheader, label %._crit_edge

.lr.ph45.preheader:                               ; preds = %2
  %7 = zext nneg i32 %1 to i64
  br label %.lr.ph45

.loopexit:                                        ; preds = %.lr.ph
  %8 = icmp sgt i64 %indvars.iv48, 2
  br i1 %8, label %.lr.ph45, label %._crit_edge, !llvm.loop !5

.lr.ph45:                                         ; preds = %.lr.ph45.preheader, %.loopexit
  %indvars.iv48 = phi i64 [ %7, %.lr.ph45.preheader ], [ %indvars.iv.next49, %.loopexit ]
  %.03742 = phi double [ 1.000000e+00, %.lr.ph45.preheader ], [ %15, %.loopexit ]
  %indvars.iv.next49 = add nsw i64 %indvars.iv48, -1
  %9 = getelementptr inbounds [24 x float], ptr %3, i64 0, i64 %indvars.iv.next49
  %10 = load float, ptr %9, align 4, !tbaa !7
  %11 = fneg float %10
  %12 = fpext float %11 to double
  %13 = fneg double %12
  %14 = tail call double @llvm.fmuladd.f64(double %13, double %12, double 1.000000e+00)
  %15 = fmul double %.03742, %14
  %16 = fmul double %15, 1.000000e+04
  %17 = fcmp olt double %16, 1.000000e+00
  br i1 %17, label %.loopexit38, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.lr.ph45
  %18 = fdiv double 1.000000e+00, %14
  %19 = lshr i64 %indvars.iv48, 1
  %20 = and i64 %19, 2147483647
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %21 = getelementptr inbounds [24 x float], ptr %3, i64 0, i64 %indvars.iv
  %22 = load float, ptr %21, align 4, !tbaa !7
  %23 = fpext float %22 to double
  %24 = xor i64 %indvars.iv, -1
  %25 = add i64 %indvars.iv.next49, %24
  %sext = shl i64 %25, 32
  %26 = ashr exact i64 %sext, 32
  %27 = getelementptr inbounds [24 x float], ptr %3, i64 0, i64 %26
  %28 = load float, ptr %27, align 4, !tbaa !7
  %29 = fpext float %28 to double
  %30 = fneg double %29
  %31 = tail call double @llvm.fmuladd.f64(double %30, double %12, double %23)
  %32 = fmul double %18, %31
  %33 = fptrunc double %32 to float
  store float %33, ptr %21, align 4, !tbaa !7
  %34 = fneg double %23
  %35 = tail call double @llvm.fmuladd.f64(double %34, double %12, double %29)
  %36 = fmul double %18, %35
  %37 = fptrunc double %36 to float
  store float %37, ptr %27, align 4, !tbaa !7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %38 = icmp ult i64 %indvars.iv.next, %20
  br i1 %38, label %.lr.ph, label %.loopexit, !llvm.loop !11

._crit_edge:                                      ; preds = %.loopexit, %2
  %.037.lcssa = phi double [ 1.000000e+00, %2 ], [ %15, %.loopexit ]
  %39 = load float, ptr %3, align 16, !tbaa !7
  %40 = fneg float %39
  %41 = fpext float %40 to double
  %42 = fneg double %41
  %43 = tail call double @llvm.fmuladd.f64(double %42, double %41, double 1.000000e+00)
  %44 = fmul double %.037.lcssa, %43
  %45 = fmul double %44, 1.000000e+04
  %46 = fcmp olt double %45, 1.000000e+00
  br i1 %46, label %.loopexit38, label %47

47:                                               ; preds = %._crit_edge
  %48 = fptrunc double %44 to float
  br label %.loopexit38

.loopexit38:                                      ; preds = %.lr.ph45, %._crit_edge, %47
  %.0 = phi float [ %48, %47 ], [ 0.000000e+00, %._crit_edge ], [ 0.000000e+00, %.lr.ph45 ]
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %3) #4
  ret float %.0
}

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

; Function Attrs: mustprogress 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) #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

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

attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"float", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}


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