; LLVM IR from jgaeddert/liquid-dsp :: src/math/tests (math_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 [85 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.12 = external hidden unnamed_addr constant [26 x i8], align 1

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

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

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

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

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

declare void @liquid_autotest_passed(...) #3

; 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_sincf() #4 {
  %1 = alloca float, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  store float 0x3F50624DE0000000, ptr %1, align 4, !tbaa !5
  %2 = call float @sincf(float noundef 0.000000e+00)
  %3 = fsub float %2, 1.000000e+00
  %4 = fpext float %3 to double
  %5 = call float @sincf(float noundef 0.000000e+00)
  %6 = fsub float %5, 1.000000e+00
  %7 = fpext float %6 to double
  %8 = call float @sincf(float noundef 0.000000e+00)
  %9 = fsub float %8, 1.000000e+00
  %10 = fpext float %9 to double
  %11 = call float @sincf(float noundef 0.000000e+00)
  %12 = fsub float %11, 1.000000e+00
  %13 = fpext float %12 to double
  %14 = call double @llvm.fmuladd.f64(double %4, double %7, double 0.000000e+00)
  %15 = call double @sqrt(double noundef %14) #5
  %16 = load float, ptr %1, align 4, !tbaa !5
  %17 = fpext float %16 to double
  %18 = fcmp ogt double %15, %17
  br i1 %18, label %29, label %19

19:                                               ; preds = %0
  %20 = call float @sincf(float noundef 0.000000e+00)
  %21 = call i1 @llvm.is.fpclass.f32(float %20, i32 3)
  br i1 %21, label %29, label %22

22:                                               ; preds = %19
  %23 = call float @sincf(float noundef 0.000000e+00)
  %24 = call i1 @llvm.is.fpclass.f32(float 0.000000e+00, i32 3)
  br i1 %24, label %29, label %25

25:                                               ; preds = %22
  %26 = call i1 @llvm.is.fpclass.f32(float 1.000000e+00, i32 3)
  br i1 %26, label %29, label %27

27:                                               ; preds = %25
  %28 = call i1 @llvm.is.fpclass.f32(float 0.000000e+00, i32 3)
  br i1 %28, label %29, label %46

29:                                               ; preds = %27, %25, %22, %19, %0
  %30 = call float @sincf(float noundef 0.000000e+00)
  %31 = fsub float %30, 1.000000e+00
  %32 = fpext float %31 to double
  %33 = call float @sincf(float noundef 0.000000e+00)
  %34 = fsub float %33, 1.000000e+00
  %35 = fpext float %34 to double
  %36 = call float @sincf(float noundef 0.000000e+00)
  %37 = fsub float %36, 1.000000e+00
  %38 = fpext float %37 to double
  %39 = call float @sincf(float noundef 0.000000e+00)
  %40 = fsub float %39, 1.000000e+00
  %41 = fpext float %40 to double
  %42 = call double @llvm.fmuladd.f64(double %32, double %35, double 0.000000e+00)
  %43 = call double @sqrt(double noundef %42) #5
  %44 = load float, ptr %1, align 4, !tbaa !5
  %45 = fpext float %44 to double
  call void @liquid_autotest_failed_expr(ptr noundef @.str, i32 noundef 46, ptr noundef @.str.12, double noundef %43, ptr noundef @.str.2, ptr noundef @.str.3, double noundef %45)
  br label %47

46:                                               ; preds = %27
  call void (...) @liquid_autotest_passed()
  br label %47

47:                                               ; preds = %46, %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  ret void
}

declare float @sincf(float noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 speculatable willreturn memory(none) }
attributes #3 = { "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 = { 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 = { 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 [85 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.12 = external hidden unnamed_addr constant [26 x i8], align 1

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #0

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

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: nounwind uwtable
define dso_local void @autotest_sincf() local_unnamed_addr #3 {
  %1 = tail call float @sincf(float noundef 0.000000e+00) #4
  %2 = fadd float %1, -1.000000e+00
  %3 = fpext float %2 to double
  %4 = tail call float @sincf(float noundef 0.000000e+00) #4
  %5 = fadd float %4, -1.000000e+00
  %6 = fpext float %5 to double
  %7 = tail call float @sincf(float noundef 0.000000e+00) #4
  %8 = tail call float @sincf(float noundef 0.000000e+00) #4
  %9 = tail call double @llvm.fmuladd.f64(double %3, double %6, double 0.000000e+00)
  %10 = tail call double @sqrt(double noundef %9) #4
  %11 = fcmp ogt double %10, 0x3F50624DE0000000
  br i1 %11, label %17, label %12

12:                                               ; preds = %0
  %13 = tail call float @sincf(float noundef 0.000000e+00) #4
  %14 = fcmp uno float %13, 0.000000e+00
  br i1 %14, label %17, label %15

15:                                               ; preds = %12
  %16 = tail call float @sincf(float noundef 0.000000e+00) #4
  tail call void (...) @liquid_autotest_passed() #4
  br label %28

17:                                               ; preds = %12, %0
  %18 = tail call float @sincf(float noundef 0.000000e+00) #4
  %19 = fadd float %18, -1.000000e+00
  %20 = fpext float %19 to double
  %21 = tail call float @sincf(float noundef 0.000000e+00) #4
  %22 = fadd float %21, -1.000000e+00
  %23 = fpext float %22 to double
  %24 = tail call float @sincf(float noundef 0.000000e+00) #4
  %25 = tail call float @sincf(float noundef 0.000000e+00) #4
  %26 = tail call double @llvm.fmuladd.f64(double %20, double %23, double 0.000000e+00)
  %27 = tail call double @sqrt(double noundef %26) #4
  tail call void @liquid_autotest_failed_expr(ptr noundef nonnull @.str, i32 noundef 46, ptr noundef nonnull @.str.12, double noundef %27, ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, double noundef 0x3F50624DE0000000) #4
  br label %28

28:                                               ; preds = %15, %17
  ret void
}

declare float @sincf(float noundef) local_unnamed_addr #2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 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 #4 = { 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: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass