; LLVM IR from jgaeddert/liquid-dsp :: src/filter/bench (iirinterp_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 @iirinterp_crcf_bench(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4) #0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i64, align 8
  %21 = alloca i32, align 4
  %22 = alloca { float, float }, align 4
  %23 = alloca { float, float }, align 4
  %24 = alloca { float, float }, align 4
  %25 = alloca { float, float }, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  store i32 %4, ptr %10, align 4, !tbaa !9
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  %27 = load i64, ptr %26, align 8, !tbaa !11
  %28 = mul i64 %27, 80
  store i64 %28, ptr %26, align 8, !tbaa !11
  %29 = load i32, ptr %9, align 4, !tbaa !9
  %30 = load i32, ptr %10, align 4, !tbaa !9
  %31 = mul i32 %29, %30
  %32 = zext i32 %31 to i64
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = load i64, ptr %33, align 8, !tbaa !11
  %35 = udiv i64 %34, %32
  store i64 %35, ptr %33, align 8, !tbaa !11
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  %37 = load i64, ptr %36, align 8, !tbaa !11
  %38 = icmp ult i64 %37, 1
  br i1 %38, label %39, label %41

39:                                               ; preds = %5
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  store i64 1, ptr %40, align 8, !tbaa !11
  br label %41

41:                                               ; preds = %39, %5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %42 = load i32, ptr %9, align 4, !tbaa !9
  %43 = uitofp i32 %42 to float
  %44 = fdiv float 5.000000e-01, %43
  store float %44, ptr %14, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store float 0.000000e+00, ptr %15, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store float 0x3FB99999A0000000, ptr %16, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store float 6.000000e+01, ptr %17, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %45 = load i32, ptr %9, align 4, !tbaa !9
  %46 = load i32, ptr %11, align 4, !tbaa !9
  %47 = load i32, ptr %12, align 4, !tbaa !9
  %48 = load i32, ptr %13, align 4, !tbaa !9
  %49 = load i32, ptr %10, align 4, !tbaa !9
  %50 = load float, ptr %14, align 4, !tbaa !13
  %51 = load float, ptr %15, align 4, !tbaa !13
  %52 = load float, ptr %16, align 4, !tbaa !13
  %53 = load float, ptr %17, align 4, !tbaa !13
  %54 = call ptr @iirinterp_crcf_create_prototype(i32 noundef %45, i32 noundef %46, i32 noundef %47, i32 noundef %48, i32 noundef %49, float noundef %50, float noundef %51, float noundef %52, float noundef %53)
  store ptr %54, ptr %18, align 8, !tbaa !5
  %55 = load i32, ptr %9, align 4, !tbaa !9
  %56 = zext i32 %55 to i64
  %57 = call ptr @llvm.stacksave.p0()
  store ptr %57, ptr %19, align 8
  %58 = alloca { float, float }, i64 %56, align 16
  store i64 %56, ptr %20, align 8
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  %60 = call i32 @getrusage(i32 noundef 0, ptr noundef %59) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %88, %41
  %62 = load i32, ptr %21, align 4, !tbaa !9
  %63 = zext i32 %62 to i64
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = load i64, ptr %64, align 8, !tbaa !11
  %66 = icmp ult i64 %63, %65
  br i1 %66, label %67, label %91

67:                                               ; preds = %61
  %68 = load ptr, ptr %18, align 8, !tbaa !5
  %69 = getelementptr inbounds { float, float }, ptr %22, i32 0, i32 0
  %70 = getelementptr inbounds { float, float }, ptr %22, i32 0, i32 1
  store float 1.000000e+00, ptr %69, align 4
  store float 0.000000e+00, ptr %70, align 4
  %71 = load <2 x float>, ptr %22, align 4
  %72 = call i32 @iirinterp_crcf_execute(ptr noundef %68, <2 x float> noundef %71, ptr noundef %58)
  %73 = load ptr, ptr %18, align 8, !tbaa !5
  %74 = getelementptr inbounds { float, float }, ptr %23, i32 0, i32 0
  %75 = getelementptr inbounds { float, float }, ptr %23, i32 0, i32 1
  store float 1.000000e+00, ptr %74, align 4
  store float 0.000000e+00, ptr %75, align 4
  %76 = load <2 x float>, ptr %23, align 4
  %77 = call i32 @iirinterp_crcf_execute(ptr noundef %73, <2 x float> noundef %76, ptr noundef %58)
  %78 = load ptr, ptr %18, align 8, !tbaa !5
  %79 = getelementptr inbounds { float, float }, ptr %24, i32 0, i32 0
  %80 = getelementptr inbounds { float, float }, ptr %24, i32 0, i32 1
  store float 1.000000e+00, ptr %79, align 4
  store float 0.000000e+00, ptr %80, align 4
  %81 = load <2 x float>, ptr %24, align 4
  %82 = call i32 @iirinterp_crcf_execute(ptr noundef %78, <2 x float> noundef %81, ptr noundef %58)
  %83 = load ptr, ptr %18, align 8, !tbaa !5
  %84 = getelementptr inbounds { float, float }, ptr %25, i32 0, i32 0
  %85 = getelementptr inbounds { float, float }, ptr %25, i32 0, i32 1
  store float 1.000000e+00, ptr %84, align 4
  store float 0.000000e+00, ptr %85, align 4
  %86 = load <2 x float>, ptr %25, align 4
  %87 = call i32 @iirinterp_crcf_execute(ptr noundef %83, <2 x float> noundef %86, ptr noundef %58)
  br label %88

88:                                               ; preds = %67
  %89 = load i32, ptr %21, align 4, !tbaa !9
  %90 = add i32 %89, 1
  store i32 %90, ptr %21, align 4, !tbaa !9
  br label %61, !llvm.loop !15

91:                                               ; preds = %61
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  %93 = call i32 @getrusage(i32 noundef 0, ptr noundef %92) #5
  %94 = load ptr, ptr %8, align 8, !tbaa !5
  %95 = load i64, ptr %94, align 8, !tbaa !11
  %96 = mul i64 %95, 4
  store i64 %96, ptr %94, align 8, !tbaa !11
  %97 = load ptr, ptr %18, align 8, !tbaa !5
  %98 = call i32 @iirinterp_crcf_destroy(ptr noundef %97)
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  %99 = load ptr, ptr %19, align 8
  call void @llvm.stackrestore.p0(ptr %99)
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  ret void
}

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

declare ptr @iirinterp_crcf_create_prototype(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, float noundef, float noundef, float noundef, float noundef) #2

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

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

declare i32 @iirinterp_crcf_execute(ptr noundef, <2 x float> noundef, ptr noundef) #2

declare i32 @iirinterp_crcf_destroy(ptr noundef) #2

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="64" "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 = { "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 = { nocallback nofree nosync nounwind willreturn }
attributes #4 = { 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 = { 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"}


; 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 @iirinterp_crcf_bench(ptr noundef %0, ptr noundef %1, ptr nocapture noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #0 {
  %6 = load i64, ptr %2, align 8, !tbaa !5
  %7 = mul i64 %6, 80
  %8 = mul i32 %4, %3
  %9 = zext i32 %8 to i64
  %10 = udiv i64 %7, %9
  %11 = icmp ult i64 %7, %9
  %spec.select = select i1 %11, i64 1, i64 %10
  store i64 %spec.select, ptr %2, align 8, !tbaa !5
  %12 = uitofp i32 %3 to float
  %13 = fdiv float 5.000000e-01, %12
  %14 = tail call ptr @iirinterp_crcf_create_prototype(i32 noundef %3, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef %4, float noundef %13, float noundef 0.000000e+00, float noundef 0x3FB99999A0000000, float noundef 6.000000e+01) #3
  %15 = zext i32 %3 to i64
  %16 = alloca { float, float }, i64 %15, align 16
  %17 = tail call i32 @getrusage(i32 noundef 0, ptr noundef %0) #3
  %18 = load i64, ptr %2, align 8, !tbaa !5
  %.not = icmp eq i64 %18, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %5, %.lr.ph
  %.035 = phi i32 [ %23, %.lr.ph ], [ 0, %5 ]
  %19 = call i32 @iirinterp_crcf_execute(ptr noundef %14, <2 x float> noundef <float 1.000000e+00, float 0.000000e+00>, ptr noundef nonnull %16) #3
  %20 = call i32 @iirinterp_crcf_execute(ptr noundef %14, <2 x float> noundef <float 1.000000e+00, float 0.000000e+00>, ptr noundef nonnull %16) #3
  %21 = call i32 @iirinterp_crcf_execute(ptr noundef %14, <2 x float> noundef <float 1.000000e+00, float 0.000000e+00>, ptr noundef nonnull %16) #3
  %22 = call i32 @iirinterp_crcf_execute(ptr noundef %14, <2 x float> noundef <float 1.000000e+00, float 0.000000e+00>, ptr noundef nonnull %16) #3
  %23 = add i32 %.035, 1
  %24 = zext i32 %23 to i64
  %25 = load i64, ptr %2, align 8, !tbaa !5
  %26 = icmp ugt i64 %25, %24
  br i1 %26, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph, %5
  %27 = call i32 @getrusage(i32 noundef 0, ptr noundef %1) #3
  %28 = load i64, ptr %2, align 8, !tbaa !5
  %29 = shl i64 %28, 2
  store i64 %29, ptr %2, align 8, !tbaa !5
  %30 = call i32 @iirinterp_crcf_destroy(ptr noundef %14) #3
  ret void
}

declare ptr @iirinterp_crcf_create_prototype(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, float noundef, float noundef, float noundef, float noundef) local_unnamed_addr #1

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

declare i32 @iirinterp_crcf_execute(ptr noundef, <2 x float> noundef, ptr noundef) local_unnamed_addr #1

declare i32 @iirinterp_crcf_destroy(ptr noundef) local_unnamed_addr #1

attributes #0 = { nounwind uwtable "min-legal-vector-width"="64" "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 = { "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 "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 = !{!"long", !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: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass