; LLVM IR from jgaeddert/liquid-dsp :: src/dotprod/tests (dotprod_rrrf_autotest)

; 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"

@.str = external hidden unnamed_addr constant [96 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [16 x i8], align 1
@__const.autotest_dotprod_rrrf_rand01.h = external hidden unnamed_addr constant [16 x float], align 16
@__const.autotest_dotprod_rrrf_rand01.x = external hidden unnamed_addr constant [16 x float], align 16

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: nounwind
declare double @sqrt(double noundef) #3

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i1 @llvm.is.fpclass.f32(float, i32 immarg) #4

declare void @liquid_autotest_failed_expr(ptr noundef, i32 noundef, ptr noundef, double noundef, ptr noundef, ptr noundef, double noundef) #2

declare void @liquid_autotest_passed(...) #2

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

; Function Attrs: nounwind uwtable
define dso_local void @autotest_dotprod_rrrf_rand01() #5 {
  %1 = alloca [16 x float], align 16
  %2 = alloca [16 x float], align 16
  %3 = alloca float, align 4
  %4 = alloca float, align 4
  %5 = alloca float, align 4
  call void @llvm.lifetime.start.p0(i64 64, ptr %1) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %1, ptr align 16 @__const.autotest_dotprod_rrrf_rand01.h, i64 64, i1 false)
  call void @llvm.lifetime.start.p0(i64 64, ptr %2) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %2, ptr align 16 @__const.autotest_dotprod_rrrf_rand01.x, i64 64, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store float 0x400D501BA0000000, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store float 0x3F50624DE0000000, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %6 = getelementptr inbounds [16 x float], ptr %1, i64 0, i64 0
  %7 = getelementptr inbounds [16 x float], ptr %2, i64 0, i64 0
  %8 = call i32 @dotprod_rrrf_run(ptr noundef %6, ptr noundef %7, i32 noundef 16, ptr noundef %5)
  %9 = load float, ptr %5, align 4, !tbaa !5
  %10 = load float, ptr %3, align 4, !tbaa !5
  %11 = fsub float %9, %10
  %12 = fpext float %11 to double
  %13 = load float, ptr %5, align 4, !tbaa !5
  %14 = load float, ptr %3, align 4, !tbaa !5
  %15 = fsub float %13, %14
  %16 = fpext float %15 to double
  %17 = load float, ptr %5, align 4, !tbaa !5
  %18 = load float, ptr %3, align 4, !tbaa !5
  %19 = fsub float %17, %18
  %20 = fpext float %19 to double
  %21 = load float, ptr %5, align 4, !tbaa !5
  %22 = load float, ptr %3, align 4, !tbaa !5
  %23 = fsub float %21, %22
  %24 = fpext float %23 to double
  %25 = call double @llvm.fmuladd.f64(double %12, double %16, double 0.000000e+00)
  %26 = call double @sqrt(double noundef %25) #6
  %27 = load float, ptr %4, align 4, !tbaa !5
  %28 = fpext float %27 to double
  %29 = fcmp ogt double %26, %28
  br i1 %29, label %42, label %30

30:                                               ; preds = %0
  %31 = load float, ptr %5, align 4, !tbaa !5
  %32 = call i1 @llvm.is.fpclass.f32(float %31, i32 3)
  br i1 %32, label %42, label %33

33:                                               ; preds = %30
  %34 = load float, ptr %5, align 4, !tbaa !5
  %35 = call i1 @llvm.is.fpclass.f32(float 0.000000e+00, i32 3)
  br i1 %35, label %42, label %36

36:                                               ; preds = %33
  %37 = load float, ptr %3, align 4, !tbaa !5
  %38 = call i1 @llvm.is.fpclass.f32(float %37, i32 3)
  br i1 %38, label %42, label %39

39:                                               ; preds = %36
  %40 = load float, ptr %3, align 4, !tbaa !5
  %41 = call i1 @llvm.is.fpclass.f32(float 0.000000e+00, i32 3)
  br i1 %41, label %42, label %63

42:                                               ; preds = %39, %36, %33, %30, %0
  %43 = load float, ptr %5, align 4, !tbaa !5
  %44 = load float, ptr %3, align 4, !tbaa !5
  %45 = fsub float %43, %44
  %46 = fpext float %45 to double
  %47 = load float, ptr %5, align 4, !tbaa !5
  %48 = load float, ptr %3, align 4, !tbaa !5
  %49 = fsub float %47, %48
  %50 = fpext float %49 to double
  %51 = load float, ptr %5, align 4, !tbaa !5
  %52 = load float, ptr %3, align 4, !tbaa !5
  %53 = fsub float %51, %52
  %54 = fpext float %53 to double
  %55 = load float, ptr %5, align 4, !tbaa !5
  %56 = load float, ptr %3, align 4, !tbaa !5
  %57 = fsub float %55, %56
  %58 = fpext float %57 to double
  %59 = call double @llvm.fmuladd.f64(double %46, double %50, double 0.000000e+00)
  %60 = call double @sqrt(double noundef %59) #6
  %61 = load float, ptr %4, align 4, !tbaa !5
  %62 = fpext float %61 to double
  call void @liquid_autotest_failed_expr(ptr noundef @.str, i32 noundef 226, ptr noundef @.str.11, double noundef %60, ptr noundef @.str.2, ptr noundef @.str.3, double noundef %62)
  br label %64

63:                                               ; preds = %39
  call void (...) @liquid_autotest_passed()
  br label %64

64:                                               ; preds = %63, %42
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr %1) #6
  ret void
}

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


; 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"

@.str = external hidden unnamed_addr constant [96 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [16 x i8], align 1
@__const.autotest_dotprod_rrrf_rand01.h = external hidden unnamed_addr constant [16 x float], align 16
@__const.autotest_dotprod_rrrf_rand01.x = external hidden unnamed_addr constant [16 x float], align 16

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

declare void @liquid_autotest_failed_expr(ptr noundef, i32 noundef, ptr noundef, double noundef, ptr noundef, ptr noundef, double noundef) local_unnamed_addr #2

declare void @liquid_autotest_passed(...) 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) #0

; Function Attrs: nounwind uwtable
define dso_local void @autotest_dotprod_rrrf_rand01() local_unnamed_addr #4 {
  %1 = alloca [16 x float], align 16
  %2 = alloca [16 x float], align 16
  %3 = alloca float, align 4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %1) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %1, ptr noundef nonnull align 16 dereferenceable(64) @__const.autotest_dotprod_rrrf_rand01.h, i64 64, i1 false)
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %2) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %2, ptr noundef nonnull align 16 dereferenceable(64) @__const.autotest_dotprod_rrrf_rand01.x, i64 64, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %4 = call i32 @dotprod_rrrf_run(ptr noundef nonnull %1, ptr noundef nonnull %2, i32 noundef 16, ptr noundef nonnull %3) #6
  %5 = load float, ptr %3, align 4
  %6 = fadd float %5, 0xC00D501BA0000000
  %7 = fpext float %6 to double
  %8 = call double @llvm.fmuladd.f64(double %7, double %7, double 0.000000e+00)
  %sqrt = call double @llvm.sqrt.f64(double %8)
  %9 = fcmp ogt double %sqrt, 0x3F50624DE0000000
  %10 = fcmp uno float %5, 0.000000e+00
  %or.cond = select i1 %9, i1 true, i1 %10
  br i1 %or.cond, label %11, label %12

11:                                               ; preds = %0
  call void @liquid_autotest_failed_expr(ptr noundef nonnull @.str, i32 noundef 226, ptr noundef nonnull @.str.11, double noundef %sqrt, ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, double noundef 0x3F50624DE0000000) #6
  br label %13

12:                                               ; preds = %0
  call void (...) @liquid_autotest_passed() #6
  br label %13

13:                                               ; preds = %12, %11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %1) #6
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.sqrt.f64(double) #5

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


; Effective O3 passes: AggressiveInstCombinePass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass