; LLVM IR from CerebusOSS/CereLink :: cbhwlib/cbHwlibHi.ll (Z20cbSSSetNoiseBoundaryjPsS_S_S_j)

; 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: mustprogress uwtable
define dso_local noundef i32 @_Z20cbSSSetNoiseBoundaryjPsS_S_S_j(i32 noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5) #1 {
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca [3 x float], align 4
  %14 = alloca [3 x float], align 4
  %15 = alloca [3 x float], align 4
  %16 = alloca [3 x float], align 4
  %17 = alloca i32, align 4
  store i32 %0, ptr %7, align 4, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !9
  store ptr %2, ptr %9, align 8, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !9
  store ptr %4, ptr %11, align 8, !tbaa !9
  store i32 %5, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 12, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 12, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %59, %6
  %19 = load i32, ptr %17, align 4, !tbaa !5
  %20 = icmp slt i32 %19, 3
  br i1 %20, label %22, label %21

21:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  br label %62

22:                                               ; preds = %18
  %23 = load ptr, ptr %8, align 8, !tbaa !9
  %24 = load i32, ptr %17, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds i16, ptr %23, i64 %25
  %27 = load i16, ptr %26, align 2, !tbaa !11
  %28 = sitofp i16 %27 to float
  %29 = load i32, ptr %17, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [3 x float], ptr %13, i64 0, i64 %30
  store float %28, ptr %31, align 4, !tbaa !13
  %32 = load ptr, ptr %9, align 8, !tbaa !9
  %33 = load i32, ptr %17, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds i16, ptr %32, i64 %34
  %36 = load i16, ptr %35, align 2, !tbaa !11
  %37 = sitofp i16 %36 to float
  %38 = load i32, ptr %17, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [3 x float], ptr %14, i64 0, i64 %39
  store float %37, ptr %40, align 4, !tbaa !13
  %41 = load ptr, ptr %10, align 8, !tbaa !9
  %42 = load i32, ptr %17, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds i16, ptr %41, i64 %43
  %45 = load i16, ptr %44, align 2, !tbaa !11
  %46 = sitofp i16 %45 to float
  %47 = load i32, ptr %17, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [3 x float], ptr %15, i64 0, i64 %48
  store float %46, ptr %49, align 4, !tbaa !13
  %50 = load ptr, ptr %11, align 8, !tbaa !9
  %51 = load i32, ptr %17, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds i16, ptr %50, i64 %52
  %54 = load i16, ptr %53, align 2, !tbaa !11
  %55 = sitofp i16 %54 to float
  %56 = load i32, ptr %17, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [3 x float], ptr %16, i64 0, i64 %57
  store float %55, ptr %58, align 4, !tbaa !13
  br label %59

59:                                               ; preds = %22
  %60 = load i32, ptr %17, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %17, align 4, !tbaa !5
  br label %18, !llvm.loop !15

62:                                               ; preds = %21
  %63 = load i32, ptr %7, align 4, !tbaa !5
  %64 = getelementptr inbounds [3 x float], ptr %13, i64 0, i64 0
  %65 = getelementptr inbounds [3 x float], ptr %14, i64 0, i64 0
  %66 = getelementptr inbounds [3 x float], ptr %15, i64 0, i64 0
  %67 = getelementptr inbounds [3 x float], ptr %16, i64 0, i64 0
  %68 = load i32, ptr %12, align 4, !tbaa !5
  %69 = call noundef i32 @_Z20cbSSSetNoiseBoundaryjPfS_S_S_j(i32 noundef %63, ptr noundef %64, ptr noundef %65, ptr noundef %66, ptr noundef %67, i32 noundef %68)
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #3
  ret i32 %69
}

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

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

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"short", !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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z20cbSSSetNoiseBoundaryjPsS_S_S_j(i32 noundef %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3, ptr nocapture noundef readonly %4, i32 noundef %5) local_unnamed_addr #1 {
  %7 = alloca [3 x float], align 8
  %8 = alloca [3 x float], align 8
  %9 = alloca [3 x float], align 8
  %10 = alloca [3 x float], align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #3
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #3
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #3
  %11 = load <2 x i16>, ptr %1, align 2, !tbaa !5
  %12 = sitofp <2 x i16> %11 to <2 x float>
  store <2 x float> %12, ptr %7, align 8, !tbaa !9
  %13 = load <2 x i16>, ptr %2, align 2, !tbaa !5
  %14 = sitofp <2 x i16> %13 to <2 x float>
  store <2 x float> %14, ptr %8, align 8, !tbaa !9
  %15 = load <2 x i16>, ptr %3, align 2, !tbaa !5
  %16 = sitofp <2 x i16> %15 to <2 x float>
  store <2 x float> %16, ptr %9, align 8, !tbaa !9
  %17 = load <2 x i16>, ptr %4, align 2, !tbaa !5
  %18 = sitofp <2 x i16> %17 to <2 x float>
  store <2 x float> %18, ptr %10, align 8, !tbaa !9
  %19 = getelementptr inbounds i8, ptr %1, i64 4
  %20 = load i16, ptr %19, align 2, !tbaa !5
  %21 = sitofp i16 %20 to float
  %22 = getelementptr inbounds i8, ptr %7, i64 8
  store float %21, ptr %22, align 8, !tbaa !9
  %23 = getelementptr inbounds i8, ptr %2, i64 4
  %24 = load i16, ptr %23, align 2, !tbaa !5
  %25 = sitofp i16 %24 to float
  %26 = getelementptr inbounds i8, ptr %8, i64 8
  store float %25, ptr %26, align 8, !tbaa !9
  %27 = getelementptr inbounds i8, ptr %3, i64 4
  %28 = load i16, ptr %27, align 2, !tbaa !5
  %29 = sitofp i16 %28 to float
  %30 = getelementptr inbounds i8, ptr %9, i64 8
  store float %29, ptr %30, align 8, !tbaa !9
  %31 = getelementptr inbounds i8, ptr %4, i64 4
  %32 = load i16, ptr %31, align 2, !tbaa !5
  %33 = sitofp i16 %32 to float
  %34 = getelementptr inbounds i8, ptr %10, i64 8
  store float %33, ptr %34, align 8, !tbaa !9
  %35 = call noundef i32 @_Z20cbSSSetNoiseBoundaryjPfS_S_S_j(i32 noundef %0, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %10, i32 noundef %5)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #3
  ret i32 %35
}

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

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

!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 = !{!"short", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass