; LLVM IR from jgaeddert/liquid-dsp :: src/filter/bench (symsync_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 @symsync_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 i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca float, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca ptr, align 8
  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
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 16, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %23 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %23, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %24 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %24, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store float 0x3FD3333340000000, ptr %15, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %25 = load i32, ptr %13, align 4, !tbaa !9
  %26 = load i32, ptr %14, align 4, !tbaa !9
  %27 = load float, ptr %15, align 4, !tbaa !11
  %28 = load i32, ptr %12, align 4, !tbaa !9
  %29 = call ptr @symsync_crcf_create_rnyquist(i32 noundef 9, i32 noundef %25, i32 noundef %26, float noundef %27, i32 noundef %28)
  store ptr %29, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 64, ptr %17, align 4, !tbaa !9
  %30 = load i32, ptr %17, align 4, !tbaa !9
  %31 = zext i32 %30 to i64
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = load i64, ptr %32, align 8, !tbaa !13
  %34 = udiv i64 %33, %31
  store i64 %34, ptr %32, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %35 = load i32, ptr %17, align 4, !tbaa !9
  %36 = zext i32 %35 to i64
  %37 = call ptr @llvm.stacksave.p0()
  store ptr %37, ptr %19, align 8
  %38 = alloca { float, float }, i64 %36, align 16
  store i64 %36, ptr %20, align 8
  %39 = load i32, ptr %17, align 4, !tbaa !9
  %40 = zext i32 %39 to i64
  %41 = alloca { float, float }, i64 %40, align 16
  store i64 %40, ptr %21, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %42 = call ptr @msequence_create_default(i32 noundef 6)
  store ptr %42, ptr %22, align 8, !tbaa !5
  store i64 0, ptr %11, align 8, !tbaa !13
  br label %43

43:                                               ; preds = %60, %5
  %44 = load i64, ptr %11, align 8, !tbaa !13
  %45 = load i32, ptr %17, align 4, !tbaa !9
  %46 = zext i32 %45 to i64
  %47 = icmp ult i64 %44, %46
  br i1 %47, label %48, label %63

48:                                               ; preds = %43
  %49 = load ptr, ptr %22, align 8, !tbaa !5
  %50 = call i32 @msequence_generate_symbol(ptr noundef %49, i32 noundef 6)
  %51 = uitofp i32 %50 to float
  %52 = fpext float %51 to double
  %53 = fsub double %52, 3.150000e+01
  %54 = fdiv double %53, 2.400000e+01
  %55 = fptrunc double %54 to float
  %56 = load i64, ptr %11, align 8, !tbaa !13
  %57 = getelementptr inbounds { float, float }, ptr %38, i64 %56
  %58 = getelementptr inbounds { float, float }, ptr %57, i32 0, i32 0
  %59 = getelementptr inbounds { float, float }, ptr %57, i32 0, i32 1
  store float %55, ptr %58, align 8
  store float 0.000000e+00, ptr %59, align 4
  br label %60

60:                                               ; preds = %48
  %61 = load i64, ptr %11, align 8, !tbaa !13
  %62 = add i64 %61, 1
  store i64 %62, ptr %11, align 8, !tbaa !13
  br label %43, !llvm.loop !15

63:                                               ; preds = %43
  %64 = load ptr, ptr %22, align 8, !tbaa !5
  %65 = call i32 @msequence_destroy(ptr noundef %64)
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = call i32 @getrusage(i32 noundef 0, ptr noundef %66) #5
  store i64 0, ptr %11, align 8, !tbaa !13
  br label %68

68:                                               ; preds = %86, %63
  %69 = load i64, ptr %11, align 8, !tbaa !13
  %70 = load ptr, ptr %8, align 8, !tbaa !5
  %71 = load i64, ptr %70, align 8, !tbaa !13
  %72 = icmp ult i64 %69, %71
  br i1 %72, label %73, label %89

73:                                               ; preds = %68
  %74 = load ptr, ptr %16, align 8, !tbaa !5
  %75 = load i32, ptr %17, align 4, !tbaa !9
  %76 = call i32 @symsync_crcf_execute(ptr noundef %74, ptr noundef %38, i32 noundef %75, ptr noundef %41, ptr noundef %18)
  %77 = load ptr, ptr %16, align 8, !tbaa !5
  %78 = load i32, ptr %17, align 4, !tbaa !9
  %79 = call i32 @symsync_crcf_execute(ptr noundef %77, ptr noundef %38, i32 noundef %78, ptr noundef %41, ptr noundef %18)
  %80 = load ptr, ptr %16, align 8, !tbaa !5
  %81 = load i32, ptr %17, align 4, !tbaa !9
  %82 = call i32 @symsync_crcf_execute(ptr noundef %80, ptr noundef %38, i32 noundef %81, ptr noundef %41, ptr noundef %18)
  %83 = load ptr, ptr %16, align 8, !tbaa !5
  %84 = load i32, ptr %17, align 4, !tbaa !9
  %85 = call i32 @symsync_crcf_execute(ptr noundef %83, ptr noundef %38, i32 noundef %84, ptr noundef %41, ptr noundef %18)
  br label %86

86:                                               ; preds = %73
  %87 = load i64, ptr %11, align 8, !tbaa !13
  %88 = add i64 %87, 1
  store i64 %88, ptr %11, align 8, !tbaa !13
  br label %68, !llvm.loop !17

89:                                               ; preds = %68
  %90 = load ptr, ptr %7, align 8, !tbaa !5
  %91 = call i32 @getrusage(i32 noundef 0, ptr noundef %90) #5
  %92 = load i32, ptr %17, align 4, !tbaa !9
  %93 = mul i32 4, %92
  %94 = zext i32 %93 to i64
  %95 = load ptr, ptr %8, align 8, !tbaa !5
  %96 = load i64, ptr %95, align 8, !tbaa !13
  %97 = mul i64 %96, %94
  store i64 %97, ptr %95, align 8, !tbaa !13
  %98 = load ptr, ptr %16, align 8, !tbaa !5
  %99 = call i32 @symsync_crcf_destroy(ptr noundef %98)
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  %100 = load ptr, ptr %19, align 8
  call void @llvm.stackrestore.p0(ptr %100)
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, 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 8, 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 @symsync_crcf_create_rnyquist(i32 noundef, i32 noundef, i32 noundef, float noundef, i32 noundef) #2

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

declare ptr @msequence_create_default(i32 noundef) #2

declare i32 @msequence_generate_symbol(ptr noundef, i32 noundef) #2

declare i32 @msequence_destroy(ptr noundef) #2

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

declare i32 @symsync_crcf_execute(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) #2

declare i32 @symsync_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"="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 = { "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 = !{!"float", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !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: nounwind uwtable
define dso_local void @symsync_crcf_bench(ptr noundef %0, ptr noundef %1, ptr nocapture noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #0 {
  %6 = alloca i32, align 4
  %7 = tail call ptr @symsync_crcf_create_rnyquist(i32 noundef 9, i32 noundef %3, i32 noundef %4, float noundef 0x3FD3333340000000, i32 noundef 16) #5
  %8 = load i64, ptr %2, align 8, !tbaa !5
  %9 = lshr i64 %8, 6
  store i64 %9, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  %10 = tail call ptr @llvm.stacksave.p0()
  %11 = alloca [64 x { float, float }], align 16
  %12 = alloca [64 x { float, float }], align 16
  %13 = tail call ptr @msequence_create_default(i32 noundef 6) #5
  br label %14

14:                                               ; preds = %5, %14
  %.032 = phi i64 [ 0, %5 ], [ %23, %14 ]
  %15 = tail call i32 @msequence_generate_symbol(ptr noundef %13, i32 noundef 6) #5
  %16 = uitofp i32 %15 to float
  %17 = fpext float %16 to double
  %18 = fadd double %17, -3.150000e+01
  %19 = fdiv double %18, 2.400000e+01
  %20 = fptrunc double %19 to float
  %21 = getelementptr inbounds { float, float }, ptr %11, i64 %.032
  %22 = getelementptr inbounds i8, ptr %21, i64 4
  store float %20, ptr %21, align 8
  store float 0.000000e+00, ptr %22, align 4
  %23 = add nuw nsw i64 %.032, 1
  %exitcond.not = icmp eq i64 %23, 64
  br i1 %exitcond.not, label %24, label %14, !llvm.loop !9

24:                                               ; preds = %14
  %25 = tail call i32 @msequence_destroy(ptr noundef %13) #5
  %26 = tail call i32 @getrusage(i32 noundef 0, ptr noundef %0) #5
  %27 = load i64, ptr %2, align 8, !tbaa !5
  %.not = icmp eq i64 %27, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %24, %.lr.ph
  %.133 = phi i64 [ %32, %.lr.ph ], [ 0, %24 ]
  %28 = call i32 @symsync_crcf_execute(ptr noundef %7, ptr noundef nonnull %11, i32 noundef 64, ptr noundef nonnull %12, ptr noundef nonnull %6) #5
  %29 = call i32 @symsync_crcf_execute(ptr noundef %7, ptr noundef nonnull %11, i32 noundef 64, ptr noundef nonnull %12, ptr noundef nonnull %6) #5
  %30 = call i32 @symsync_crcf_execute(ptr noundef %7, ptr noundef nonnull %11, i32 noundef 64, ptr noundef nonnull %12, ptr noundef nonnull %6) #5
  %31 = call i32 @symsync_crcf_execute(ptr noundef %7, ptr noundef nonnull %11, i32 noundef 64, ptr noundef nonnull %12, ptr noundef nonnull %6) #5
  %32 = add nuw i64 %.133, 1
  %33 = load i64, ptr %2, align 8, !tbaa !5
  %34 = icmp ult i64 %32, %33
  br i1 %34, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph, %24
  %35 = call i32 @getrusage(i32 noundef 0, ptr noundef %1) #5
  %36 = load i64, ptr %2, align 8, !tbaa !5
  %37 = shl i64 %36, 8
  store i64 %37, ptr %2, align 8, !tbaa !5
  %38 = call i32 @symsync_crcf_destroy(ptr noundef %7) #5
  call void @llvm.stackrestore.p0(ptr %10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  ret void
}

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

declare ptr @symsync_crcf_create_rnyquist(i32 noundef, i32 noundef, i32 noundef, float noundef, i32 noundef) local_unnamed_addr #2

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

declare ptr @msequence_create_default(i32 noundef) local_unnamed_addr #2

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

declare i32 @msequence_destroy(ptr noundef) local_unnamed_addr #2

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

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

declare i32 @symsync_crcf_destroy(ptr noundef) local_unnamed_addr #2

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

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


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