; LLVM IR from jgaeddert/liquid-dsp :: src/filter/bench (fftfilt_crcf_benchmark)

; 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 void @fftfilt_crcf_bench(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store i32 %3, ptr %8, align 4, !tbaa !9
  %16 = load ptr, ptr %7, align 8, !tbaa !5
  %17 = load i64, ptr %16, align 8, !tbaa !11
  %18 = mul i64 %17, 5
  %19 = uitofp i64 %18 to float
  %20 = load i32, ptr %8, align 4, !tbaa !9
  %21 = uitofp i32 %20 to float
  %22 = load i32, ptr %8, align 4, !tbaa !9
  %23 = uitofp i32 %22 to float
  %24 = call float @logf(float noundef %23) #5
  %25 = fmul float %21, %24
  %26 = fdiv float %19, %25
  %27 = fptoui float %26 to i64
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  store i64 %27, ptr %28, align 8, !tbaa !11
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = load i64, ptr %29, align 8, !tbaa !11
  %31 = icmp ult i64 %30, 1
  br i1 %31, label %32, label %34

32:                                               ; preds = %4
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  store i64 1, ptr %33, align 8, !tbaa !11
  br label %34

34:                                               ; preds = %32, %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %35 = load i32, ptr %8, align 4, !tbaa !9
  %36 = add i32 %35, 1
  store i32 %36, ptr %9, align 4, !tbaa !9
  %37 = load i32, ptr %9, align 4, !tbaa !9
  %38 = zext i32 %37 to i64
  %39 = call ptr @llvm.stacksave.p0()
  store ptr %39, ptr %10, align 8
  %40 = alloca float, i64 %38, align 16
  store i64 %38, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store i64 0, ptr %12, align 8, !tbaa !11
  br label %41

41:                                               ; preds = %50, %34
  %42 = load i64, ptr %12, align 8, !tbaa !11
  %43 = load i32, ptr %9, align 4, !tbaa !9
  %44 = zext i32 %43 to i64
  %45 = icmp ult i64 %42, %44
  br i1 %45, label %46, label %53

46:                                               ; preds = %41
  %47 = call float (...) @randnf()
  %48 = load i64, ptr %12, align 8, !tbaa !11
  %49 = getelementptr inbounds float, ptr %40, i64 %48
  store float %47, ptr %49, align 4, !tbaa !13
  br label %50

50:                                               ; preds = %46
  %51 = load i64, ptr %12, align 8, !tbaa !11
  %52 = add i64 %51, 1
  store i64 %52, ptr %12, align 8, !tbaa !11
  br label %41, !llvm.loop !15

53:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %54 = load i32, ptr %9, align 4, !tbaa !9
  %55 = load i32, ptr %8, align 4, !tbaa !9
  %56 = call ptr @fftfilt_crcf_create(ptr noundef %40, i32 noundef %54, i32 noundef %55)
  store ptr %56, ptr %13, align 8, !tbaa !5
  %57 = load i32, ptr %8, align 4, !tbaa !9
  %58 = add i32 %57, 4
  %59 = zext i32 %58 to i64
  %60 = alloca { float, float }, i64 %59, align 16
  store i64 %59, ptr %14, align 8
  store i64 0, ptr %12, align 8, !tbaa !11
  br label %61

61:                                               ; preds = %77, %53
  %62 = load i64, ptr %12, align 8, !tbaa !11
  %63 = load i32, ptr %8, align 4, !tbaa !9
  %64 = add i32 %63, 4
  %65 = zext i32 %64 to i64
  %66 = icmp ult i64 %62, %65
  br i1 %66, label %67, label %80

67:                                               ; preds = %61
  %68 = call float (...) @randnf()
  %69 = call float (...) @randnf()
  %70 = fmul float 0.000000e+00, %69
  %71 = fmul float 1.000000e+00, %69
  %72 = fadd float %68, %70
  %73 = load i64, ptr %12, align 8, !tbaa !11
  %74 = getelementptr inbounds { float, float }, ptr %60, i64 %73
  %75 = getelementptr inbounds { float, float }, ptr %74, i32 0, i32 0
  %76 = getelementptr inbounds { float, float }, ptr %74, i32 0, i32 1
  store float %72, ptr %75, align 8
  store float %71, ptr %76, align 4
  br label %77

77:                                               ; preds = %67
  %78 = load i64, ptr %12, align 8, !tbaa !11
  %79 = add i64 %78, 1
  store i64 %79, ptr %12, align 8, !tbaa !11
  br label %61, !llvm.loop !17

80:                                               ; preds = %61
  %81 = load i32, ptr %8, align 4, !tbaa !9
  %82 = zext i32 %81 to i64
  %83 = alloca { float, float }, i64 %82, align 16
  store i64 %82, ptr %15, align 8
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = call i32 @getrusage(i32 noundef 0, ptr noundef %84) #5
  store i64 0, ptr %12, align 8, !tbaa !11
  br label %86

86:                                               ; preds = %104, %80
  %87 = load i64, ptr %12, align 8, !tbaa !11
  %88 = load ptr, ptr %7, align 8, !tbaa !5
  %89 = load i64, ptr %88, align 8, !tbaa !11
  %90 = icmp ult i64 %87, %89
  br i1 %90, label %91, label %107

91:                                               ; preds = %86
  %92 = load ptr, ptr %13, align 8, !tbaa !5
  %93 = getelementptr inbounds { float, float }, ptr %60, i64 0
  %94 = call i32 @fftfilt_crcf_execute(ptr noundef %92, ptr noundef %93, ptr noundef %83)
  %95 = load ptr, ptr %13, align 8, !tbaa !5
  %96 = getelementptr inbounds { float, float }, ptr %60, i64 1
  %97 = call i32 @fftfilt_crcf_execute(ptr noundef %95, ptr noundef %96, ptr noundef %83)
  %98 = load ptr, ptr %13, align 8, !tbaa !5
  %99 = getelementptr inbounds { float, float }, ptr %60, i64 2
  %100 = call i32 @fftfilt_crcf_execute(ptr noundef %98, ptr noundef %99, ptr noundef %83)
  %101 = load ptr, ptr %13, align 8, !tbaa !5
  %102 = getelementptr inbounds { float, float }, ptr %60, i64 3
  %103 = call i32 @fftfilt_crcf_execute(ptr noundef %101, ptr noundef %102, ptr noundef %83)
  br label %104

104:                                              ; preds = %91
  %105 = load i64, ptr %12, align 8, !tbaa !11
  %106 = add i64 %105, 1
  store i64 %106, ptr %12, align 8, !tbaa !11
  br label %86, !llvm.loop !18

107:                                              ; preds = %86
  %108 = load ptr, ptr %6, align 8, !tbaa !5
  %109 = call i32 @getrusage(i32 noundef 0, ptr noundef %108) #5
  %110 = load i32, ptr %8, align 4, !tbaa !9
  %111 = mul i32 4, %110
  %112 = zext i32 %111 to i64
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = load i64, ptr %113, align 8, !tbaa !11
  %115 = mul i64 %114, %112
  store i64 %115, ptr %113, align 8, !tbaa !11
  %116 = load ptr, ptr %13, align 8, !tbaa !5
  %117 = call i32 @fftfilt_crcf_destroy(ptr noundef %116)
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  %118 = load ptr, ptr %10, align 8
  call void @llvm.stackrestore.p0(ptr %118)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  ret void
}

; Function Attrs: nounwind
declare float @logf(float noundef) #1

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

declare float @randnf(...) #4

declare ptr @fftfilt_crcf_create(ptr noundef, i32 noundef, i32 noundef) #4

; Function Attrs: nounwind
declare i32 @getrusage(i32 noundef, ptr noundef) #1

declare i32 @fftfilt_crcf_execute(ptr noundef, ptr noundef, ptr noundef) #4

declare i32 @fftfilt_crcf_destroy(ptr noundef) #4

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3

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 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nosync nounwind willreturn }
attributes #4 = { "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 = { 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 = !{!"long", !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}
!18 = distinct !{!18, !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: nounwind uwtable
define dso_local void @fftfilt_crcf_bench(ptr noundef %0, ptr noundef %1, ptr nocapture noundef %2, i32 noundef %3) local_unnamed_addr #0 {
  %5 = load i64, ptr %2, align 8, !tbaa !5
  %6 = mul i64 %5, 5
  %7 = uitofp i64 %6 to float
  %8 = uitofp i32 %3 to float
  %9 = tail call float @logf(float noundef %8) #5
  %10 = fmul float %9, %8
  %11 = fdiv float %7, %10
  %12 = fptoui float %11 to i64
  %spec.select = tail call i64 @llvm.umax.i64(i64 %12, i64 1)
  store i64 %spec.select, ptr %2, align 8, !tbaa !5
  %13 = add i32 %3, 1
  %14 = zext i32 %13 to i64
  %15 = alloca float, i64 %14, align 16
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %4, %.lr.ph
  %.032 = phi i64 [ %18, %.lr.ph ], [ 0, %4 ]
  %16 = tail call float (...) @randnf() #5
  %17 = getelementptr inbounds float, ptr %15, i64 %.032
  store float %16, ptr %17, align 4, !tbaa !9
  %18 = add nuw nsw i64 %.032, 1
  %exitcond.not = icmp eq i64 %18, %14
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph, %4
  %19 = call ptr @fftfilt_crcf_create(ptr noundef nonnull %15, i32 noundef %13, i32 noundef %3) #5
  %20 = add i32 %3, 4
  %21 = zext i32 %20 to i64
  %22 = alloca { float, float }, i64 %21, align 16
  %.not41 = icmp eq i32 %20, 0
  br i1 %.not41, label %._crit_edge36, label %.lr.ph35

.lr.ph35:                                         ; preds = %._crit_edge, %.lr.ph35
  %.133 = phi i64 [ %29, %.lr.ph35 ], [ 0, %._crit_edge ]
  %23 = call float (...) @randnf() #5
  %24 = call float (...) @randnf() #5
  %25 = fmul float %24, 0.000000e+00
  %26 = fadd float %23, %25
  %27 = getelementptr inbounds { float, float }, ptr %22, i64 %.133
  %28 = getelementptr inbounds i8, ptr %27, i64 4
  store float %26, ptr %27, align 8
  store float %24, ptr %28, align 4
  %29 = add nuw nsw i64 %.133, 1
  %exitcond43.not = icmp eq i64 %29, %21
  br i1 %exitcond43.not, label %._crit_edge36, label %.lr.ph35, !llvm.loop !13

._crit_edge36:                                    ; preds = %.lr.ph35, %._crit_edge
  %30 = zext i32 %3 to i64
  %31 = alloca { float, float }, i64 %30, align 16
  %32 = call i32 @getrusage(i32 noundef 0, ptr noundef %0) #5
  %33 = load i64, ptr %2, align 8, !tbaa !5
  %.not42 = icmp eq i64 %33, 0
  br i1 %.not42, label %._crit_edge40, label %.lr.ph39

.lr.ph39:                                         ; preds = %._crit_edge36
  %34 = getelementptr inbounds i8, ptr %22, i64 8
  %35 = getelementptr inbounds i8, ptr %22, i64 16
  %36 = getelementptr inbounds i8, ptr %22, i64 24
  br label %37

37:                                               ; preds = %.lr.ph39, %37
  %.237 = phi i64 [ 0, %.lr.ph39 ], [ %42, %37 ]
  %38 = call i32 @fftfilt_crcf_execute(ptr noundef %19, ptr noundef nonnull %22, ptr noundef nonnull %31) #5
  %39 = call i32 @fftfilt_crcf_execute(ptr noundef %19, ptr noundef nonnull %34, ptr noundef nonnull %31) #5
  %40 = call i32 @fftfilt_crcf_execute(ptr noundef %19, ptr noundef nonnull %35, ptr noundef nonnull %31) #5
  %41 = call i32 @fftfilt_crcf_execute(ptr noundef %19, ptr noundef nonnull %36, ptr noundef nonnull %31) #5
  %42 = add nuw i64 %.237, 1
  %43 = load i64, ptr %2, align 8, !tbaa !5
  %44 = icmp ult i64 %42, %43
  br i1 %44, label %37, label %._crit_edge40, !llvm.loop !14

._crit_edge40:                                    ; preds = %37, %._crit_edge36
  %45 = call i32 @getrusage(i32 noundef 0, ptr noundef %1) #5
  %46 = shl i32 %3, 2
  %47 = zext i32 %46 to i64
  %48 = load i64, ptr %2, align 8, !tbaa !5
  %49 = mul i64 %48, %47
  store i64 %49, ptr %2, align 8, !tbaa !5
  %50 = call i32 @fftfilt_crcf_destroy(ptr noundef %19) #5
  ret void
}

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

declare float @randnf(...) local_unnamed_addr #2

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

; Function Attrs: nounwind
declare i32 @getrusage(i32 noundef, ptr noundef) local_unnamed_addr #3

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

declare i32 @fftfilt_crcf_destroy(ptr noundef) local_unnamed_addr #2

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

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 = { 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 = { "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 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}


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