; LLVM IR from sp-nitech/SPTK :: src/check (mlsa_digital_filter_stability_check)

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

%"class.sptk::MlsaDigitalFilterStabilityCheck" = type <{ ptr, i32, [4 x i8], double, double, i8, [3 x i8], i32, i32, [4 x i8], ptr, ptr, i8, [7 x i8] }>

@_ZTVN4sptk31MlsaDigitalFilterStabilityCheckE = external dso_local unnamed_addr constant { [4 x ptr] }, align 8

declare noundef zeroext i1 @_ZN4sptk12IsValidAlphaEd(double noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4sptk31MlsaDigitalFilterStabilityCheckC2EiddiNS0_16ModificationTypeE(ptr noundef nonnull align 8 dereferenceable(65) %0, i32 noundef %1, double noundef %2, double noundef %3, i32 noundef %4, i32 noundef %5) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store double %2, ptr %9, align 8, !tbaa !11
  store double %3, ptr %10, align 8, !tbaa !11
  store i32 %4, ptr %11, align 4, !tbaa !9
  store i32 %5, ptr %12, align 4, !tbaa !13
  %15 = load ptr, ptr %7, align 8
  store ptr getelementptr inbounds inrange(-16, 16) ({ [4 x ptr] }, ptr @_ZTVN4sptk31MlsaDigitalFilterStabilityCheckE, i32 0, i32 0, i32 2), ptr %15, align 8, !tbaa !15
  %16 = getelementptr inbounds %"class.sptk::MlsaDigitalFilterStabilityCheck", ptr %15, i32 0, i32 1
  %17 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %17, ptr %16, align 8, !tbaa !17
  %18 = getelementptr inbounds %"class.sptk::MlsaDigitalFilterStabilityCheck", ptr %15, i32 0, i32 3
  %19 = load double, ptr %9, align 8, !tbaa !11
  store double %19, ptr %18, align 8, !tbaa !20
  %20 = getelementptr inbounds %"class.sptk::MlsaDigitalFilterStabilityCheck", ptr %15, i32 0, i32 4
  %21 = load double, ptr %10, align 8, !tbaa !11
  store double %21, ptr %20, align 8, !tbaa !21
  %22 = getelementptr inbounds %"class.sptk::MlsaDigitalFilterStabilityCheck", ptr %15, i32 0, i32 5
  store i8 0, ptr %22, align 8, !tbaa !22
  %23 = getelementptr inbounds %"class.sptk::MlsaDigitalFilterStabilityCheck", ptr %15, i32 0, i32 7
  %24 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %24, ptr %23, align 4, !tbaa !23
  %25 = getelementptr inbounds %"class.sptk::MlsaDigitalFilterStabilityCheck", ptr %15, i32 0, i32 8
  %26 = load i32, ptr %12, align 4, !tbaa !13
  store i32 %26, ptr %25, align 8, !tbaa !24
  %27 = getelementptr inbounds %"class.sptk::MlsaDigitalFilterStabilityCheck", ptr %15, i32 0, i32 10
  %28 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 104) #5
  %29 = getelementptr inbounds %"class.sptk::MlsaDigitalFilterStabilityCheck", ptr %15, i32 0, i32 7
  %30 = load i32, ptr %29, align 4, !tbaa !23
  invoke void @_ZN4sptk30RealValuedFastFourierTransformC1Ei(ptr noundef nonnull align 8 dereferenceable(104) %28, i32 noundef %30)
          to label %31 unwind label %68

31:                                               ; preds = %6
  store ptr %28, ptr %27, align 8, !tbaa !25
  %32 = getelementptr inbounds %"class.sptk::MlsaDigitalFilterStabilityCheck", ptr %15, i32 0, i32 11
  %33 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 56) #5
  %34 = getelementptr inbounds %"class.sptk::MlsaDigitalFilterStabilityCheck", ptr %15, i32 0, i32 7
  %35 = load i32, ptr %34, align 4, !tbaa !23
  invoke void @_ZN4sptk27InverseFastFourierTransformC1Ei(ptr noundef nonnull align 8 dereferenceable(56) %33, i32 noundef %35)
          to label %36 unwind label %72

36:                                               ; preds = %31
  store ptr %33, ptr %32, align 8, !tbaa !26
  %37 = getelementptr inbounds %"class.sptk::MlsaDigitalFilterStabilityCheck", ptr %15, i32 0, i32 12
  store i8 1, ptr %37, align 8, !tbaa !27
  %38 = getelementptr inbounds %"class.sptk::MlsaDigitalFilterStabilityCheck", ptr %15, i32 0, i32 1
  %39 = load i32, ptr %38, align 8, !tbaa !17
  %40 = icmp slt i32 %39, 0
  br i1 %40, label %66, label %41

41:                                               ; preds = %36
  %42 = load double, ptr %9, align 8, !tbaa !11
  %43 = call noundef zeroext i1 @_ZN4sptk12IsValidAlphaEd(double noundef %42)
  br i1 %43, label %44, label %66

44:                                               ; preds = %41
  %45 = getelementptr inbounds %"class.sptk::MlsaDigitalFilterStabilityCheck", ptr %15, i32 0, i32 4
  %46 = load double, ptr %45, align 8, !tbaa !21
  %47 = fcmp ole double %46, 0.000000e+00
  br i1 %47, label %66, label %48

48:                                               ; preds = %44
  %49 = getelementptr inbounds %"class.sptk::MlsaDigitalFilterStabilityCheck", ptr %15, i32 0, i32 7
  %50 = load i32, ptr %49, align 4, !tbaa !23
  %51 = getelementptr inbounds %"class.sptk::MlsaDigitalFilterStabilityCheck", ptr %15, i32 0, i32 1
  %52 = load i32, ptr %51, align 8, !tbaa !17
  %53 = icmp sle i32 %50, %52
  br i1 %53, label %66, label %54

54:                                               ; preds = %48
  %55 = getelementptr inbounds %"class.sptk::MlsaDigitalFilterStabilityCheck", ptr %15, i32 0, i32 8
  %56 = load i32, ptr %55, align 8, !tbaa !24
  %57 = icmp eq i32 2, %56
  br i1 %57, label %66, label %58

58:                                               ; preds = %54
  %59 = getelementptr inbounds %"class.sptk::MlsaDigitalFilterStabilityCheck", ptr %15, i32 0, i32 10
  %60 = load ptr, ptr %59, align 8, !tbaa !25
  %61 = call noundef zeroext i1 @_ZNK4sptk30RealValuedFastFourierTransform7IsValidEv(ptr noundef nonnull align 8 dereferenceable(104) %60)
  br i1 %61, label %62, label %66

62:                                               ; preds = %58
  %63 = getelementptr inbounds %"class.sptk::MlsaDigitalFilterStabilityCheck", ptr %15, i32 0, i32 11
  %64 = load ptr, ptr %63, align 8, !tbaa !26
  %65 = call noundef zeroext i1 @_ZNK4sptk27InverseFastFourierTransform7IsValidEv(ptr noundef nonnull align 8 dereferenceable(56) %64)
  br i1 %65, label %76, label %66

66:                                               ; preds = %62, %58, %54, %48, %44, %41, %36
  %67 = getelementptr inbounds %"class.sptk::MlsaDigitalFilterStabilityCheck", ptr %15, i32 0, i32 12
  store i8 0, ptr %67, align 8, !tbaa !27
  br label %76

68:                                               ; preds = %6
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %13, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %14, align 4
  call void @_ZdlPvm(ptr noundef %28, i64 noundef 104) #6
  br label %77

72:                                               ; preds = %31
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %13, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %14, align 4
  call void @_ZdlPvm(ptr noundef %33, i64 noundef 56) #6
  br label %77

76:                                               ; preds = %66, %62
  ret void

77:                                               ; preds = %72, %68
  %78 = load ptr, ptr %13, align 8
  %79 = load i32, ptr %14, align 4
  %80 = insertvalue { ptr, i32 } poison, ptr %78, 0
  %81 = insertvalue { ptr, i32 } %80, i32 %79, 1
  resume { ptr, i32 } %81
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #2

declare void @_ZN4sptk30RealValuedFastFourierTransformC1Ei(ptr noundef nonnull align 8 dereferenceable(104), i32 noundef) unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #3

declare void @_ZN4sptk27InverseFastFourierTransformC1Ei(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4sptk30RealValuedFastFourierTransform7IsValidEv(ptr noundef nonnull align 8 dereferenceable(104)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK4sptk27InverseFastFourierTransform7IsValidEv(ptr noundef nonnull align 8 dereferenceable(56)) #1 align 2

attributes #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 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 = { nobuiltin allocsize(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 #3 = { nobuiltin 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 = { mustprogress 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 = { builtin allocsize(0) }
attributes #6 = { builtin 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"_ZTSN4sptk31MlsaDigitalFilterStabilityCheck16ModificationTypeE", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"vtable pointer", !8, i64 0}
!17 = !{!18, !10, i64 8}
!18 = !{!"_ZTSN4sptk31MlsaDigitalFilterStabilityCheckE", !10, i64 8, !12, i64 16, !12, i64 24, !19, i64 32, !10, i64 36, !14, i64 40, !6, i64 48, !6, i64 56, !19, i64 64}
!19 = !{!"bool", !7, i64 0}
!20 = !{!18, !12, i64 16}
!21 = !{!18, !12, i64 24}
!22 = !{!18, !19, i64 32}
!23 = !{!18, !10, i64 36}
!24 = !{!18, !14, i64 40}
!25 = !{!18, !6, i64 48}
!26 = !{!18, !6, i64 56}
!27 = !{!18, !19, i64 64}


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

@_ZTVN4sptk31MlsaDigitalFilterStabilityCheckE = external dso_local unnamed_addr constant { [4 x ptr] }, align 8

declare noundef zeroext i1 @_ZN4sptk12IsValidAlphaEd(double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4sptk31MlsaDigitalFilterStabilityCheckC2EiddiNS0_16ModificationTypeE(ptr nocapture noundef nonnull align 8 dereferenceable(65) %0, i32 noundef %1, double noundef %2, double noundef %3, i32 noundef %4, i32 noundef %5) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  store ptr getelementptr inbounds inrange(-16, 16) (i8, ptr @_ZTVN4sptk31MlsaDigitalFilterStabilityCheckE, i64 16), ptr %0, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 %1, ptr %7, align 8, !tbaa !8
  %8 = getelementptr inbounds i8, ptr %0, i64 16
  store double %2, ptr %8, align 8, !tbaa !16
  %9 = getelementptr inbounds i8, ptr %0, i64 24
  store double %3, ptr %9, align 8, !tbaa !17
  %10 = getelementptr inbounds i8, ptr %0, i64 32
  store i8 0, ptr %10, align 8, !tbaa !18
  %11 = getelementptr inbounds i8, ptr %0, i64 36
  store i32 %4, ptr %11, align 4, !tbaa !19
  %12 = getelementptr inbounds i8, ptr %0, i64 40
  store i32 %5, ptr %12, align 8, !tbaa !20
  %13 = getelementptr inbounds i8, ptr %0, i64 48
  %14 = tail call noalias noundef nonnull dereferenceable(104) ptr @_Znwm(i64 noundef 104) #5
  invoke void @_ZN4sptk30RealValuedFastFourierTransformC1Ei(ptr noundef nonnull align 8 dereferenceable(104) %14, i32 noundef %4)
          to label %15 unwind label %39

15:                                               ; preds = %6
  store ptr %14, ptr %13, align 8, !tbaa !21
  %16 = getelementptr inbounds i8, ptr %0, i64 56
  %17 = tail call noalias noundef nonnull dereferenceable(56) ptr @_Znwm(i64 noundef 56) #5
  %18 = load i32, ptr %11, align 4, !tbaa !19
  invoke void @_ZN4sptk27InverseFastFourierTransformC1Ei(ptr noundef nonnull align 8 dereferenceable(56) %17, i32 noundef %18)
          to label %19 unwind label %41

19:                                               ; preds = %15
  store ptr %17, ptr %16, align 8, !tbaa !22
  %20 = getelementptr inbounds i8, ptr %0, i64 64
  store i8 1, ptr %20, align 8, !tbaa !23
  %21 = load i32, ptr %7, align 8, !tbaa !8
  %22 = icmp slt i32 %21, 0
  br i1 %22, label %38, label %23

23:                                               ; preds = %19
  %24 = tail call noundef zeroext i1 @_ZN4sptk12IsValidAlphaEd(double noundef %2)
  %25 = load double, ptr %9, align 8
  %26 = fcmp ugt double %25, 0.000000e+00
  %or.cond = select i1 %24, i1 %26, i1 false
  br i1 %or.cond, label %27, label %38

27:                                               ; preds = %23
  %28 = load i32, ptr %11, align 4, !tbaa !19
  %29 = load i32, ptr %7, align 8, !tbaa !8
  %.not = icmp sle i32 %28, %29
  %30 = load i32, ptr %12, align 8
  %31 = icmp eq i32 %30, 2
  %or.cond12 = select i1 %.not, i1 true, i1 %31
  br i1 %or.cond12, label %38, label %32

32:                                               ; preds = %27
  %33 = load ptr, ptr %13, align 8, !tbaa !21
  %34 = tail call noundef zeroext i1 @_ZNK4sptk30RealValuedFastFourierTransform7IsValidEv(ptr noundef nonnull align 8 dereferenceable(104) %33)
  br i1 %34, label %35, label %38

35:                                               ; preds = %32
  %36 = load ptr, ptr %16, align 8, !tbaa !22
  %37 = tail call noundef zeroext i1 @_ZNK4sptk27InverseFastFourierTransform7IsValidEv(ptr noundef nonnull align 8 dereferenceable(56) %36)
  br i1 %37, label %43, label %38

38:                                               ; preds = %35, %32, %27, %23, %19
  store i8 0, ptr %20, align 8, !tbaa !23
  br label %43

39:                                               ; preds = %6
  %40 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %14, i64 noundef 104) #6
  br label %44

41:                                               ; preds = %15
  %42 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %17, i64 noundef 56) #6
  br label %44

43:                                               ; preds = %38, %35
  ret void

44:                                               ; preds = %41, %39
  %.pn = phi { ptr, i32 } [ %42, %41 ], [ %40, %39 ]
  resume { ptr, i32 } %.pn
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #2

declare void @_ZN4sptk30RealValuedFastFourierTransformC1Ei(ptr noundef nonnull align 8 dereferenceable(104), i32 noundef) unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #3

declare void @_ZN4sptk27InverseFastFourierTransformC1Ei(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4sptk30RealValuedFastFourierTransform7IsValidEv(ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK4sptk27InverseFastFourierTransform7IsValidEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #1 align 2

attributes #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 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 = { nobuiltin allocsize(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 #3 = { nobuiltin 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 = { mustprogress 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 = { builtin allocsize(0) }
attributes #6 = { builtin 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !10, i64 8}
!9 = !{!"_ZTSN4sptk31MlsaDigitalFilterStabilityCheckE", !10, i64 8, !12, i64 16, !12, i64 24, !13, i64 32, !10, i64 36, !14, i64 40, !15, i64 48, !15, i64 56, !13, i64 64}
!10 = !{!"int", !11, i64 0}
!11 = !{!"omnipotent char", !7, i64 0}
!12 = !{!"double", !11, i64 0}
!13 = !{!"bool", !11, i64 0}
!14 = !{!"_ZTSN4sptk31MlsaDigitalFilterStabilityCheck16ModificationTypeE", !11, i64 0}
!15 = !{!"any pointer", !11, i64 0}
!16 = !{!9, !12, i64 16}
!17 = !{!9, !12, i64 24}
!18 = !{!9, !13, i64 32}
!19 = !{!9, !10, i64 36}
!20 = !{!9, !14, i64 40}
!21 = !{!9, !15, i64 48}
!22 = !{!9, !15, i64 56}
!23 = !{!9, !13, i64 64}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass