; LLVM IR from reworks-org/galaxy :: deps/sfml_deps/flac-src/src/libFLAC (window)

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: nounwind
declare float @cosf(float noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @FLAC__window_blackman_harris_4term_92db_sidelobe(ptr noundef %0, i32 noundef %1) #3 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %7 = load i32, ptr %4, align 4, !tbaa !9
  %8 = sub nsw i32 %7, 1
  store i32 %8, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %9

9:                                                ; preds = %45, %2
  %10 = load i32, ptr %6, align 4, !tbaa !9
  %11 = load i32, ptr %5, align 4, !tbaa !9
  %12 = icmp sle i32 %10, %11
  br i1 %12, label %13, label %48

13:                                               ; preds = %9
  %14 = load i32, ptr %6, align 4, !tbaa !9
  %15 = sitofp i32 %14 to double
  %16 = fmul double 0x401921FB54442D18, %15
  %17 = load i32, ptr %5, align 4, !tbaa !9
  %18 = sitofp i32 %17 to double
  %19 = fdiv double %16, %18
  %20 = fptrunc double %19 to float
  %21 = call float @cosf(float noundef %20) #4
  %22 = call float @llvm.fmuladd.f32(float 0xBFDF4024C0000000, float %21, float 0x3FD6F5C280000000)
  %23 = load i32, ptr %6, align 4, !tbaa !9
  %24 = sitofp i32 %23 to double
  %25 = fmul double 0x402921FB54442D18, %24
  %26 = load i32, ptr %5, align 4, !tbaa !9
  %27 = sitofp i32 %26 to double
  %28 = fdiv double %25, %27
  %29 = fptrunc double %28 to float
  %30 = call float @cosf(float noundef %29) #4
  %31 = call float @llvm.fmuladd.f32(float 0x3FC2157680000000, float %30, float %22)
  %32 = load i32, ptr %6, align 4, !tbaa !9
  %33 = sitofp i32 %32 to double
  %34 = fmul double 0x4032D97C7F3321D2, %33
  %35 = load i32, ptr %5, align 4, !tbaa !9
  %36 = sitofp i32 %35 to double
  %37 = fdiv double %34, %36
  %38 = fptrunc double %37 to float
  %39 = call float @cosf(float noundef %38) #4
  %40 = call float @llvm.fmuladd.f32(float 0xBF87EBAF20000000, float %39, float %31)
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = load i32, ptr %6, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds float, ptr %41, i64 %43
  store float %40, ptr %44, align 4, !tbaa !11
  br label %45

45:                                               ; preds = %13
  %46 = load i32, ptr %6, align 4, !tbaa !9
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %6, align 4, !tbaa !9
  br label %9, !llvm.loop !13

48:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 = { 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 #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"}


; 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 speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare float @cosf(float noundef) local_unnamed_addr #1

; Function Attrs: nofree nounwind memory(write) uwtable
define dso_local void @FLAC__window_blackman_harris_4term_92db_sidelobe(ptr nocapture noundef writeonly %0, i32 noundef %1) local_unnamed_addr #2 {
  %.not.not12 = icmp sgt i32 %1, 0
  br i1 %.not.not12, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2
  %3 = add nsw i32 %1, -1
  %4 = uitofp nneg i32 %3 to double
  %wide.trip.count = zext nneg i32 %1 to i64
  br label %5

5:                                                ; preds = %.lr.ph, %5
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %5 ]
  %6 = trunc nuw nsw i64 %indvars.iv to i32
  %7 = uitofp nneg i32 %6 to double
  %8 = fmul double %7, 0x401921FB54442D18
  %9 = fdiv double %8, %4
  %10 = fptrunc double %9 to float
  %11 = tail call float @cosf(float noundef %10) #3
  %12 = tail call float @llvm.fmuladd.f32(float %11, float 0xBFDF4024C0000000, float 0x3FD6F5C280000000)
  %13 = fmul double %7, 0x402921FB54442D18
  %14 = fdiv double %13, %4
  %15 = fptrunc double %14 to float
  %16 = tail call float @cosf(float noundef %15) #3
  %17 = tail call float @llvm.fmuladd.f32(float %16, float 0x3FC2157680000000, float %12)
  %18 = fmul double %7, 0x4032D97C7F3321D2
  %19 = fdiv double %18, %4
  %20 = fptrunc double %19 to float
  %21 = tail call float @cosf(float noundef %20) #3
  %22 = tail call float @llvm.fmuladd.f32(float %21, float 0xBF87EBAF20000000, float %17)
  %23 = getelementptr inbounds float, ptr %0, i64 %indvars.iv
  store float %22, ptr %23, align 4, !tbaa !5
  %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_edge, label %5, !llvm.loop !9

._crit_edge:                                      ; preds = %5, %2
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { mustprogress nofree nounwind willreturn memory(write) "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 = { nofree nounwind memory(write) 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 }

!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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass