; LLVM IR from sp-nitech/SPTK :: src/analysis (adaptive_generalized_cepstral_analysis)

; 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::AdaptiveGeneralizedCepstralAnalysis" = type <{ ptr, i32, [4 x i8], double, double, double, double, i8, [7 x i8], %"class.sptk::GeneralizedCepstrumInverseGainNormalization", i8, [7 x i8] }>
%"class.sptk::GeneralizedCepstrumInverseGainNormalization" = type <{ ptr, i32, [4 x i8], double, i8, [7 x i8] }>

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4sptk35AdaptiveGeneralizedCepstralAnalysisC2Eiiddddb(ptr noundef nonnull align 8 dereferenceable(89) %0, i32 noundef %1, i32 noundef %2, double noundef %3, double noundef %4, double noundef %5, double noundef %6, i1 noundef zeroext %7) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca i8, align 1
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store i32 %1, ptr %10, align 4, !tbaa !9
  store i32 %2, ptr %11, align 4, !tbaa !9
  store double %3, ptr %12, align 8, !tbaa !11
  store double %4, ptr %13, align 8, !tbaa !11
  store double %5, ptr %14, align 8, !tbaa !11
  store double %6, ptr %15, align 8, !tbaa !11
  %19 = zext i1 %7 to i8
  store i8 %19, ptr %16, align 1, !tbaa !13
  %20 = load ptr, ptr %9, align 8
  store ptr getelementptr inbounds inrange(-16, 16) ({ [4 x ptr] }, ptr @_ZTVN4sptk35AdaptiveGeneralizedCepstralAnalysisE, i32 0, i32 0, i32 2), ptr %20, align 8, !tbaa !15
  %21 = getelementptr inbounds %"class.sptk::AdaptiveGeneralizedCepstralAnalysis", ptr %20, i32 0, i32 1
  %22 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %22, ptr %21, align 8, !tbaa !17
  %23 = getelementptr inbounds %"class.sptk::AdaptiveGeneralizedCepstralAnalysis", ptr %20, i32 0, i32 3
  %24 = load double, ptr %12, align 8, !tbaa !11
  store double %24, ptr %23, align 8, !tbaa !20
  %25 = getelementptr inbounds %"class.sptk::AdaptiveGeneralizedCepstralAnalysis", ptr %20, i32 0, i32 4
  %26 = load double, ptr %13, align 8, !tbaa !11
  store double %26, ptr %25, align 8, !tbaa !21
  %27 = getelementptr inbounds %"class.sptk::AdaptiveGeneralizedCepstralAnalysis", ptr %20, i32 0, i32 5
  %28 = load double, ptr %14, align 8, !tbaa !11
  store double %28, ptr %27, align 8, !tbaa !22
  %29 = getelementptr inbounds %"class.sptk::AdaptiveGeneralizedCepstralAnalysis", ptr %20, i32 0, i32 6
  %30 = load double, ptr %15, align 8, !tbaa !11
  store double %30, ptr %29, align 8, !tbaa !23
  %31 = getelementptr inbounds %"class.sptk::AdaptiveGeneralizedCepstralAnalysis", ptr %20, i32 0, i32 7
  %32 = load i8, ptr %16, align 1, !tbaa !13, !range !24, !noundef !25
  %33 = trunc i8 %32 to i1
  %34 = zext i1 %33 to i8
  store i8 %34, ptr %31, align 8, !tbaa !26
  %35 = getelementptr inbounds %"class.sptk::AdaptiveGeneralizedCepstralAnalysis", ptr %20, i32 0, i32 9
  %36 = load i32, ptr %10, align 4, !tbaa !9
  %37 = getelementptr inbounds %"class.sptk::AdaptiveGeneralizedCepstralAnalysis", ptr %20, i32 0, i32 1
  %38 = load i32, ptr %37, align 8, !tbaa !17
  %39 = sitofp i32 %38 to double
  %40 = fdiv double -1.000000e+00, %39
  call void @_ZN4sptk43GeneralizedCepstrumInverseGainNormalizationC1Eid(ptr noundef nonnull align 8 dereferenceable(25) %35, i32 noundef %36, double noundef %40)
  %41 = getelementptr inbounds %"class.sptk::AdaptiveGeneralizedCepstralAnalysis", ptr %20, i32 0, i32 10
  store i8 1, ptr %41, align 8, !tbaa !27
  %42 = getelementptr inbounds %"class.sptk::AdaptiveGeneralizedCepstralAnalysis", ptr %20, i32 0, i32 1
  %43 = load i32, ptr %42, align 8, !tbaa !17
  %44 = icmp sle i32 %43, 0
  br i1 %44, label %77, label %45

45:                                               ; preds = %8
  %46 = getelementptr inbounds %"class.sptk::AdaptiveGeneralizedCepstralAnalysis", ptr %20, i32 0, i32 3
  %47 = load double, ptr %46, align 8, !tbaa !20
  %48 = fcmp ole double %47, 0.000000e+00
  br i1 %48, label %77, label %49

49:                                               ; preds = %45
  %50 = getelementptr inbounds %"class.sptk::AdaptiveGeneralizedCepstralAnalysis", ptr %20, i32 0, i32 4
  %51 = load double, ptr %50, align 8, !tbaa !21
  %52 = fcmp olt double %51, 0.000000e+00
  br i1 %52, label %77, label %53

53:                                               ; preds = %49
  %54 = getelementptr inbounds %"class.sptk::AdaptiveGeneralizedCepstralAnalysis", ptr %20, i32 0, i32 4
  %55 = load double, ptr %54, align 8, !tbaa !21
  %56 = fcmp ole double 1.000000e+00, %55
  br i1 %56, label %77, label %57

57:                                               ; preds = %53
  %58 = getelementptr inbounds %"class.sptk::AdaptiveGeneralizedCepstralAnalysis", ptr %20, i32 0, i32 5
  %59 = load double, ptr %58, align 8, !tbaa !22
  %60 = fcmp olt double %59, 0.000000e+00
  br i1 %60, label %77, label %61

61:                                               ; preds = %57
  %62 = getelementptr inbounds %"class.sptk::AdaptiveGeneralizedCepstralAnalysis", ptr %20, i32 0, i32 5
  %63 = load double, ptr %62, align 8, !tbaa !22
  %64 = fcmp ole double 1.000000e+00, %63
  br i1 %64, label %77, label %65

65:                                               ; preds = %61
  %66 = getelementptr inbounds %"class.sptk::AdaptiveGeneralizedCepstralAnalysis", ptr %20, i32 0, i32 6
  %67 = load double, ptr %66, align 8, !tbaa !23
  %68 = fcmp ole double %67, 0.000000e+00
  br i1 %68, label %77, label %69

69:                                               ; preds = %65
  %70 = getelementptr inbounds %"class.sptk::AdaptiveGeneralizedCepstralAnalysis", ptr %20, i32 0, i32 6
  %71 = load double, ptr %70, align 8, !tbaa !23
  %72 = fcmp ole double 1.000000e+00, %71
  br i1 %72, label %77, label %73

73:                                               ; preds = %69
  %74 = getelementptr inbounds %"class.sptk::AdaptiveGeneralizedCepstralAnalysis", ptr %20, i32 0, i32 9
  %75 = invoke noundef zeroext i1 @_ZNK4sptk43GeneralizedCepstrumInverseGainNormalization7IsValidEv(ptr noundef nonnull align 8 dereferenceable(25) %74)
          to label %76 unwind label %79

76:                                               ; preds = %73
  br i1 %75, label %83, label %77

77:                                               ; preds = %76, %69, %65, %61, %57, %53, %49, %45, %8
  %78 = getelementptr inbounds %"class.sptk::AdaptiveGeneralizedCepstralAnalysis", ptr %20, i32 0, i32 10
  store i8 0, ptr %78, align 8, !tbaa !27
  br label %83

79:                                               ; preds = %73
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %17, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %18, align 4
  call void @_ZN4sptk43GeneralizedCepstrumInverseGainNormalizationD2Ev(ptr noundef nonnull align 8 dereferenceable(25) %35) #3
  br label %84

83:                                               ; preds = %77, %76
  ret void

84:                                               ; preds = %79
  %85 = load ptr, ptr %17, align 8
  %86 = load i32, ptr %18, align 4
  %87 = insertvalue { ptr, i32 } poison, ptr %85, 0
  %88 = insertvalue { ptr, i32 } %87, i32 %86, 1
  resume { ptr, i32 } %88
}

declare void @_ZN4sptk43GeneralizedCepstrumInverseGainNormalizationC1Eid(ptr noundef nonnull align 8 dereferenceable(25), i32 noundef, double noundef) unnamed_addr #1

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4sptk43GeneralizedCepstrumInverseGainNormalizationD2Ev(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #2 align 2

attributes #0 = { 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 #1 = { "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 = { 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 #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 = !{!"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 = !{!"bool", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"vtable pointer", !8, i64 0}
!17 = !{!18, !10, i64 8}
!18 = !{!"_ZTSN4sptk35AdaptiveGeneralizedCepstralAnalysisE", !10, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !14, i64 48, !19, i64 56, !14, i64 88}
!19 = !{!"_ZTSN4sptk43GeneralizedCepstrumInverseGainNormalizationE", !10, i64 8, !12, i64 16, !14, i64 24}
!20 = !{!18, !12, i64 16}
!21 = !{!18, !12, i64 24}
!22 = !{!18, !12, i64 32}
!23 = !{!18, !12, i64 40}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = !{!18, !14, i64 48}
!27 = !{!18, !14, i64 88}


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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4sptk35AdaptiveGeneralizedCepstralAnalysisC2Eiiddddb(ptr noundef nonnull align 8 dereferenceable(89) %0, i32 noundef %1, i32 noundef %2, double noundef %3, double noundef %4, double noundef %5, double noundef %6, i1 noundef zeroext %7) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %9 = zext i1 %7 to i8
  store ptr getelementptr inbounds inrange(-16, 16) (i8, ptr @_ZTVN4sptk35AdaptiveGeneralizedCepstralAnalysisE, i64 16), ptr %0, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 %2, ptr %10, align 8, !tbaa !8
  %11 = getelementptr inbounds i8, ptr %0, i64 16
  store double %3, ptr %11, align 8, !tbaa !15
  %12 = getelementptr inbounds i8, ptr %0, i64 24
  store double %4, ptr %12, align 8, !tbaa !16
  %13 = getelementptr inbounds i8, ptr %0, i64 32
  store double %5, ptr %13, align 8, !tbaa !17
  %14 = getelementptr inbounds i8, ptr %0, i64 40
  store double %6, ptr %14, align 8, !tbaa !18
  %15 = getelementptr inbounds i8, ptr %0, i64 48
  store i8 %9, ptr %15, align 8, !tbaa !19
  %16 = getelementptr inbounds i8, ptr %0, i64 56
  %17 = sitofp i32 %2 to double
  %18 = fdiv double -1.000000e+00, %17
  tail call void @_ZN4sptk43GeneralizedCepstrumInverseGainNormalizationC1Eid(ptr noundef nonnull align 8 dereferenceable(25) %16, i32 noundef %1, double noundef %18)
  %19 = getelementptr inbounds i8, ptr %0, i64 88
  store i8 1, ptr %19, align 8, !tbaa !20
  %20 = load i32, ptr %10, align 8, !tbaa !8
  %21 = icmp sgt i32 %20, 0
  %22 = load double, ptr %11, align 8
  %23 = fcmp ugt double %22, 0.000000e+00
  %or.cond = select i1 %21, i1 %23, i1 false
  br i1 %or.cond, label %24, label %38

24:                                               ; preds = %8
  %25 = load double, ptr %12, align 8, !tbaa !16
  %26 = fcmp uge double %25, 0.000000e+00
  %27 = fcmp ult double %25, 1.000000e+00
  %or.cond10 = and i1 %26, %27
  br i1 %or.cond10, label %28, label %38

28:                                               ; preds = %24
  %29 = load double, ptr %13, align 8, !tbaa !17
  %30 = fcmp uge double %29, 0.000000e+00
  %31 = fcmp ult double %29, 1.000000e+00
  %or.cond11 = and i1 %30, %31
  br i1 %or.cond11, label %32, label %38

32:                                               ; preds = %28
  %33 = load double, ptr %14, align 8, !tbaa !18
  %34 = fcmp ugt double %33, 0.000000e+00
  %35 = fcmp ult double %33, 1.000000e+00
  %or.cond12 = and i1 %34, %35
  br i1 %or.cond12, label %36, label %38

36:                                               ; preds = %32
  %37 = tail call noundef zeroext i1 @_ZNK4sptk43GeneralizedCepstrumInverseGainNormalization7IsValidEv(ptr noundef nonnull align 8 dereferenceable(25) %16)
  br i1 %37, label %39, label %38

38:                                               ; preds = %36, %32, %28, %24, %8
  store i8 0, ptr %19, align 8, !tbaa !20
  br label %39

39:                                               ; preds = %38, %36
  ret void
}

declare void @_ZN4sptk43GeneralizedCepstrumInverseGainNormalizationC1Eid(ptr noundef nonnull align 8 dereferenceable(25), i32 noundef, double noundef) unnamed_addr #1

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

declare i32 @__gxx_personality_v0(...)

attributes #0 = { 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 #1 = { "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 = { 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" }

!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 = !{!"_ZTSN4sptk35AdaptiveGeneralizedCepstralAnalysisE", !10, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !13, i64 48, !14, i64 56, !13, i64 88}
!10 = !{!"int", !11, i64 0}
!11 = !{!"omnipotent char", !7, i64 0}
!12 = !{!"double", !11, i64 0}
!13 = !{!"bool", !11, i64 0}
!14 = !{!"_ZTSN4sptk43GeneralizedCepstrumInverseGainNormalizationE", !10, i64 8, !12, i64 16, !13, i64 24}
!15 = !{!9, !12, i64 16}
!16 = !{!9, !12, i64 24}
!17 = !{!9, !12, i64 32}
!18 = !{!9, !12, i64 40}
!19 = !{!9, !13, i64 48}
!20 = !{!9, !13, i64 88}


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