; LLVM IR from sp-nitech/SPTK :: src/compression (dynamic_range_compression)

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK4sptk23DynamicRangeCompression3RunEdPdPNS0_6BufferE(ptr noundef nonnull align 8 dereferenceable(97) %0, double noundef %1, ptr noundef %2, ptr noundef %3) #0 align 2 {
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca double, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca i32, align 4
  %22 = alloca double, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store double %1, ptr %7, align 8, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  %23 = load ptr, ptr %6, align 8
  %24 = getelementptr inbounds %"class.sptk::DynamicRangeCompression", ptr %23, i32 0, i32 13
  %25 = load i8, ptr %24, align 8, !tbaa !11, !range !15, !noundef !16
  %26 = trunc i8 %25 to i1
  br i1 %26, label %27, label %33

27:                                               ; preds = %4
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  %29 = icmp eq ptr null, %28
  br i1 %29, label %33, label %30

30:                                               ; preds = %27
  %31 = load ptr, ptr %9, align 8, !tbaa !5
  %32 = icmp eq ptr null, %31
  br i1 %32, label %33, label %34

33:                                               ; preds = %30, %27, %4
  store i1 false, ptr %5, align 1
  br label %199

34:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %35 = load double, ptr %7, align 8, !tbaa !9
  %36 = getelementptr inbounds %"class.sptk::DynamicRangeCompression", ptr %23, i32 0, i32 1
  %37 = load double, ptr %36, align 8, !tbaa !17
  %38 = fdiv double %35, %37
  %39 = call double @llvm.fabs.f64(double %38)
  %40 = call noundef double @_ZN4sptk10FloorLog10Ed(double noundef %39)
  %41 = fmul double 2.000000e+01, %40
  store double %41, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %42 = getelementptr inbounds %"class.sptk::DynamicRangeCompression", ptr %23, i32 0, i32 3
  %43 = load double, ptr %42, align 8, !tbaa !18
  %44 = getelementptr inbounds %"class.sptk::DynamicRangeCompression", ptr %23, i32 0, i32 5
  %45 = load double, ptr %44, align 8, !tbaa !19
  %46 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %45, double %43)
  store double %46, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %47 = load double, ptr %12, align 8, !tbaa !9
  %48 = getelementptr inbounds %"class.sptk::DynamicRangeCompression", ptr %23, i32 0, i32 5
  %49 = load double, ptr %48, align 8, !tbaa !19
  %50 = fadd double %47, %49
  store double %50, ptr %13, align 8, !tbaa !9
  %51 = load double, ptr %10, align 8, !tbaa !9
  %52 = load double, ptr %12, align 8, !tbaa !9
  %53 = fcmp ole double %51, %52
  br i1 %53, label %54, label %56

54:                                               ; preds = %34
  %55 = load double, ptr %10, align 8, !tbaa !9
  store double %55, ptr %11, align 8, !tbaa !9
  br label %90

56:                                               ; preds = %34
  %57 = load double, ptr %13, align 8, !tbaa !9
  %58 = load double, ptr %10, align 8, !tbaa !9
  %59 = fcmp ole double %57, %58
  br i1 %59, label %60, label %71

60:                                               ; preds = %56
  %61 = getelementptr inbounds %"class.sptk::DynamicRangeCompression", ptr %23, i32 0, i32 3
  %62 = load double, ptr %61, align 8, !tbaa !18
  %63 = load double, ptr %10, align 8, !tbaa !9
  %64 = getelementptr inbounds %"class.sptk::DynamicRangeCompression", ptr %23, i32 0, i32 3
  %65 = load double, ptr %64, align 8, !tbaa !18
  %66 = fsub double %63, %65
  %67 = getelementptr inbounds %"class.sptk::DynamicRangeCompression", ptr %23, i32 0, i32 4
  %68 = load double, ptr %67, align 8, !tbaa !20
  %69 = fdiv double %66, %68
  %70 = fadd double %62, %69
  store double %70, ptr %11, align 8, !tbaa !9
  br label %89

71:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %72 = load double, ptr %10, align 8, !tbaa !9
  %73 = load double, ptr %12, align 8, !tbaa !9
  %74 = fsub double %72, %73
  store double %74, ptr %14, align 8, !tbaa !9
  %75 = load double, ptr %10, align 8, !tbaa !9
  %76 = getelementptr inbounds %"class.sptk::DynamicRangeCompression", ptr %23, i32 0, i32 4
  %77 = load double, ptr %76, align 8, !tbaa !20
  %78 = fdiv double 1.000000e+00, %77
  %79 = fsub double %78, 1.000000e+00
  %80 = load double, ptr %14, align 8, !tbaa !9
  %81 = fmul double %79, %80
  %82 = load double, ptr %14, align 8, !tbaa !9
  %83 = fmul double %81, %82
  %84 = getelementptr inbounds %"class.sptk::DynamicRangeCompression", ptr %23, i32 0, i32 5
  %85 = load double, ptr %84, align 8, !tbaa !19
  %86 = fmul double 2.000000e+00, %85
  %87 = fdiv double %83, %86
  %88 = fadd double %75, %87
  store double %88, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %89

89:                                               ; preds = %71, %60
  br label %90

90:                                               ; preds = %89, %54
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %91 = load double, ptr %10, align 8, !tbaa !9
  %92 = load double, ptr %11, align 8, !tbaa !9
  %93 = fsub double %91, %92
  store double %93, ptr %16, align 8, !tbaa !9
  %94 = getelementptr inbounds %"class.sptk::DynamicRangeCompression", ptr %23, i32 0, i32 9
  %95 = load i32, ptr %94, align 8, !tbaa !21
  switch i32 %95, label %180 [
    i32 0, label %96
    i32 1, label %118
    i32 2, label %137
    i32 3, label %160
  ]

96:                                               ; preds = %90
  %97 = load ptr, ptr %9, align 8, !tbaa !5
  %98 = getelementptr inbounds %"class.sptk::DynamicRangeCompression::Buffer", ptr %97, i32 0, i32 2
  %99 = load double, ptr %98, align 8, !tbaa !22
  %100 = load double, ptr %16, align 8, !tbaa !9
  %101 = fcmp olt double %99, %100
  br i1 %101, label %102, label %110

102:                                              ; preds = %96
  %103 = getelementptr inbounds %"class.sptk::DynamicRangeCompression", ptr %23, i32 0, i32 11
  %104 = load double, ptr %103, align 8, !tbaa !24
  %105 = load ptr, ptr %9, align 8, !tbaa !5
  %106 = getelementptr inbounds %"class.sptk::DynamicRangeCompression::Buffer", ptr %105, i32 0, i32 2
  %107 = load double, ptr %106, align 8, !tbaa !22
  %108 = load double, ptr %16, align 8, !tbaa !9
  %109 = call noundef double @_ZN12_GLOBAL__N_111WeightedSumEddd(double noundef %104, double noundef %107, double noundef %108)
  store double %109, ptr %15, align 8, !tbaa !9
  br label %117

110:                                              ; preds = %96
  %111 = getelementptr inbounds %"class.sptk::DynamicRangeCompression", ptr %23, i32 0, i32 12
  %112 = load double, ptr %111, align 8, !tbaa !25
  %113 = load ptr, ptr %9, align 8, !tbaa !5
  %114 = getelementptr inbounds %"class.sptk::DynamicRangeCompression::Buffer", ptr %113, i32 0, i32 2
  %115 = load double, ptr %114, align 8, !tbaa !22
  %116 = fmul double %112, %115
  store double %116, ptr %15, align 8, !tbaa !9
  br label %117

117:                                              ; preds = %110, %102
  br label %181

118:                                              ; preds = %90
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %119 = getelementptr inbounds %"class.sptk::DynamicRangeCompression", ptr %23, i32 0, i32 12
  %120 = load double, ptr %119, align 8, !tbaa !25
  %121 = load ptr, ptr %9, align 8, !tbaa !5
  %122 = getelementptr inbounds %"class.sptk::DynamicRangeCompression::Buffer", ptr %121, i32 0, i32 1
  %123 = load double, ptr %122, align 8, !tbaa !26
  %124 = fmul double %120, %123
  store double %124, ptr %18, align 8, !tbaa !9
  %125 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %18)
  %126 = load double, ptr %125, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  store double %126, ptr %17, align 8, !tbaa !9
  %127 = getelementptr inbounds %"class.sptk::DynamicRangeCompression", ptr %23, i32 0, i32 11
  %128 = load double, ptr %127, align 8, !tbaa !24
  %129 = load ptr, ptr %9, align 8, !tbaa !5
  %130 = getelementptr inbounds %"class.sptk::DynamicRangeCompression::Buffer", ptr %129, i32 0, i32 2
  %131 = load double, ptr %130, align 8, !tbaa !22
  %132 = load double, ptr %17, align 8, !tbaa !9
  %133 = call noundef double @_ZN12_GLOBAL__N_111WeightedSumEddd(double noundef %128, double noundef %131, double noundef %132)
  store double %133, ptr %15, align 8, !tbaa !9
  %134 = load double, ptr %17, align 8, !tbaa !9
  %135 = load ptr, ptr %9, align 8, !tbaa !5
  %136 = getelementptr inbounds %"class.sptk::DynamicRangeCompression::Buffer", ptr %135, i32 0, i32 1
  store double %134, ptr %136, align 8, !tbaa !26
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %181

137:                                              ; preds = %90
  %138 = load ptr, ptr %9, align 8, !tbaa !5
  %139 = getelementptr inbounds %"class.sptk::DynamicRangeCompression::Buffer", ptr %138, i32 0, i32 2
  %140 = load double, ptr %139, align 8, !tbaa !22
  %141 = load double, ptr %16, align 8, !tbaa !9
  %142 = fcmp olt double %140, %141
  br i1 %142, label %143, label %151

143:                                              ; preds = %137
  %144 = getelementptr inbounds %"class.sptk::DynamicRangeCompression", ptr %23, i32 0, i32 11
  %145 = load double, ptr %144, align 8, !tbaa !24
  %146 = load ptr, ptr %9, align 8, !tbaa !5
  %147 = getelementptr inbounds %"class.sptk::DynamicRangeCompression::Buffer", ptr %146, i32 0, i32 2
  %148 = load double, ptr %147, align 8, !tbaa !22
  %149 = load double, ptr %16, align 8, !tbaa !9
  %150 = call noundef double @_ZN12_GLOBAL__N_111WeightedSumEddd(double noundef %145, double noundef %148, double noundef %149)
  store double %150, ptr %15, align 8, !tbaa !9
  br label %159

151:                                              ; preds = %137
  %152 = getelementptr inbounds %"class.sptk::DynamicRangeCompression", ptr %23, i32 0, i32 12
  %153 = load double, ptr %152, align 8, !tbaa !25
  %154 = load ptr, ptr %9, align 8, !tbaa !5
  %155 = getelementptr inbounds %"class.sptk::DynamicRangeCompression::Buffer", ptr %154, i32 0, i32 2
  %156 = load double, ptr %155, align 8, !tbaa !22
  %157 = load double, ptr %16, align 8, !tbaa !9
  %158 = call noundef double @_ZN12_GLOBAL__N_111WeightedSumEddd(double noundef %153, double noundef %156, double noundef %157)
  store double %158, ptr %15, align 8, !tbaa !9
  br label %159

159:                                              ; preds = %151, %143
  br label %181

160:                                              ; preds = %90
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %161 = getelementptr inbounds %"class.sptk::DynamicRangeCompression", ptr %23, i32 0, i32 12
  %162 = load double, ptr %161, align 8, !tbaa !25
  %163 = load ptr, ptr %9, align 8, !tbaa !5
  %164 = getelementptr inbounds %"class.sptk::DynamicRangeCompression::Buffer", ptr %163, i32 0, i32 1
  %165 = load double, ptr %164, align 8, !tbaa !26
  %166 = load double, ptr %16, align 8, !tbaa !9
  %167 = call noundef double @_ZN12_GLOBAL__N_111WeightedSumEddd(double noundef %162, double noundef %165, double noundef %166)
  store double %167, ptr %20, align 8, !tbaa !9
  %168 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %20)
  %169 = load double, ptr %168, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  store double %169, ptr %19, align 8, !tbaa !9
  %170 = getelementptr inbounds %"class.sptk::DynamicRangeCompression", ptr %23, i32 0, i32 11
  %171 = load double, ptr %170, align 8, !tbaa !24
  %172 = load ptr, ptr %9, align 8, !tbaa !5
  %173 = getelementptr inbounds %"class.sptk::DynamicRangeCompression::Buffer", ptr %172, i32 0, i32 2
  %174 = load double, ptr %173, align 8, !tbaa !22
  %175 = load double, ptr %19, align 8, !tbaa !9
  %176 = call noundef double @_ZN12_GLOBAL__N_111WeightedSumEddd(double noundef %171, double noundef %174, double noundef %175)
  store double %176, ptr %15, align 8, !tbaa !9
  %177 = load double, ptr %19, align 8, !tbaa !9
  %178 = load ptr, ptr %9, align 8, !tbaa !5
  %179 = getelementptr inbounds %"class.sptk::DynamicRangeCompression::Buffer", ptr %178, i32 0, i32 1
  store double %177, ptr %179, align 8, !tbaa !26
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %181

180:                                              ; preds = %90
  store i1 false, ptr %5, align 1
  store i32 1, ptr %21, align 4
  br label %185

181:                                              ; preds = %160, %159, %118, %117
  %182 = load double, ptr %15, align 8, !tbaa !9
  %183 = load ptr, ptr %9, align 8, !tbaa !5
  %184 = getelementptr inbounds %"class.sptk::DynamicRangeCompression::Buffer", ptr %183, i32 0, i32 2
  store double %182, ptr %184, align 8, !tbaa !22
  store i32 0, ptr %21, align 4
  br label %185

185:                                              ; preds = %181, %180
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  %186 = load i32, ptr %21, align 4
  switch i32 %186, label %198 [
    i32 0, label %187
  ]

187:                                              ; preds = %185
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %188 = getelementptr inbounds %"class.sptk::DynamicRangeCompression", ptr %23, i32 0, i32 8
  %189 = load double, ptr %188, align 8, !tbaa !27
  %190 = load double, ptr %15, align 8, !tbaa !9
  %191 = fsub double %189, %190
  %192 = fmul double 5.000000e-02, %191
  %193 = call double @pow(double noundef 1.000000e+01, double noundef %192) #7
  store double %193, ptr %22, align 8, !tbaa !9
  %194 = load double, ptr %7, align 8, !tbaa !9
  %195 = load double, ptr %22, align 8, !tbaa !9
  %196 = fmul double %194, %195
  %197 = load ptr, ptr %8, align 8, !tbaa !5
  store double %196, ptr %197, align 8, !tbaa !9
  store i1 true, ptr %5, align 1
  store i32 1, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %198

198:                                              ; preds = %187, %185
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %199

199:                                              ; preds = %198, %33
  %200 = load i1, ptr %5, align 1
  ret i1 %200
}

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

declare noundef double @_ZN4sptk10FloorLog10Ed(double noundef) #2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef double @_ZN12_GLOBAL__N_111WeightedSumEddd(double noundef, double noundef, double noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: nounwind
declare double @pow(double noundef, double noundef) #6

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 = { nocallback nofree nosync 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { inlinehint 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 #6 = { 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 #7 = { 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 = !{!"double", !7, i64 0}
!11 = !{!12, !14, i64 96}
!12 = !{!"_ZTSN4sptk23DynamicRangeCompressionE", !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !13, i64 72, !10, i64 80, !10, i64 88, !14, i64 96}
!13 = !{!"_ZTSN4sptk23DynamicRangeCompression12DetectorTypeE", !7, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!12, !10, i64 8}
!18 = !{!12, !10, i64 24}
!19 = !{!12, !10, i64 40}
!20 = !{!12, !10, i64 32}
!21 = !{!12, !13, i64 72}
!22 = !{!23, !10, i64 16}
!23 = !{!"_ZTSN4sptk23DynamicRangeCompression6BufferE", !10, i64 8, !10, i64 16}
!24 = !{!12, !10, i64 80}
!25 = !{!12, !10, i64 88}
!26 = !{!23, !10, i64 8}
!27 = !{!12, !10, 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"

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK4sptk23DynamicRangeCompression3RunEdPdPNS0_6BufferE(ptr nocapture noundef nonnull readonly align 8 dereferenceable(97) %0, double noundef %1, ptr noundef writeonly %2, ptr noundef %3) local_unnamed_addr #0 align 2 {
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = getelementptr inbounds i8, ptr %0, i64 96
  %9 = load i8, ptr %8, align 8, !tbaa !5, !range !12, !noundef !13
  %10 = trunc nuw i8 %9 to i1
  %.not = xor i1 %10, true
  %11 = icmp eq ptr %2, null
  %or.cond = or i1 %11, %.not
  %12 = icmp eq ptr %3, null
  %or.cond3 = or i1 %12, %or.cond
  br i1 %or.cond3, label %107, label %13

13:                                               ; preds = %4
  %14 = getelementptr inbounds i8, ptr %0, i64 8
  %15 = load double, ptr %14, align 8, !tbaa !14
  %16 = fdiv double %1, %15
  %17 = tail call double @llvm.fabs.f64(double %16)
  %18 = tail call noundef double @_ZN4sptk10FloorLog10Ed(double noundef %17)
  %19 = fmul double %18, 2.000000e+01
  %20 = getelementptr inbounds i8, ptr %0, i64 24
  %21 = load double, ptr %20, align 8, !tbaa !15
  %22 = getelementptr inbounds i8, ptr %0, i64 40
  %23 = load double, ptr %22, align 8, !tbaa !16
  %24 = tail call double @llvm.fmuladd.f64(double %23, double -5.000000e-01, double %21)
  %25 = fcmp ugt double %19, %24
  br i1 %25, label %26, label %44

26:                                               ; preds = %13
  %27 = fadd double %23, %24
  %28 = fcmp ugt double %27, %19
  %29 = getelementptr inbounds i8, ptr %0, i64 32
  %30 = load double, ptr %29, align 8, !tbaa !17
  br i1 %28, label %35, label %31

31:                                               ; preds = %26
  %32 = fsub double %19, %21
  %33 = fdiv double %32, %30
  %34 = fadd double %21, %33
  br label %44

35:                                               ; preds = %26
  %36 = fsub double %19, %24
  %37 = fdiv double 1.000000e+00, %30
  %38 = fadd double %37, -1.000000e+00
  %39 = fmul double %36, %38
  %40 = fmul double %36, %39
  %41 = fmul double %23, 2.000000e+00
  %42 = fdiv double %40, %41
  %43 = fadd double %19, %42
  br label %44

44:                                               ; preds = %13, %31, %35
  %.045 = phi double [ %34, %31 ], [ %43, %35 ], [ %19, %13 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %45 = fsub double %19, %.045
  store double %45, ptr %5, align 8, !tbaa !18
  %46 = getelementptr inbounds i8, ptr %0, i64 72
  %47 = load i32, ptr %46, align 8, !tbaa !19
  switch i32 %47, label %98 [
    i32 0, label %48
    i32 1, label %60
    i32 2, label %73
    i32 3, label %85
  ]

48:                                               ; preds = %44
  %49 = getelementptr inbounds i8, ptr %3, i64 16
  %50 = load double, ptr %49, align 8, !tbaa !20
  %51 = fcmp olt double %50, %45
  br i1 %51, label %52, label %56

52:                                               ; preds = %48
  %53 = getelementptr inbounds i8, ptr %0, i64 80
  %54 = load double, ptr %53, align 8, !tbaa !22
  %55 = tail call noundef double @_ZN12_GLOBAL__N_111WeightedSumEddd(double noundef %54, double noundef %50, double noundef %45)
  br label %99

56:                                               ; preds = %48
  %57 = getelementptr inbounds i8, ptr %0, i64 88
  %58 = load double, ptr %57, align 8, !tbaa !23
  %59 = fmul double %50, %58
  br label %99

60:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %61 = getelementptr inbounds i8, ptr %0, i64 88
  %62 = load double, ptr %61, align 8, !tbaa !23
  %63 = getelementptr inbounds i8, ptr %3, i64 8
  %64 = load double, ptr %63, align 8, !tbaa !24
  %65 = fmul double %62, %64
  store double %65, ptr %6, align 8, !tbaa !18
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %67 = load double, ptr %66, align 8, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  %68 = getelementptr inbounds i8, ptr %0, i64 80
  %69 = load double, ptr %68, align 8, !tbaa !22
  %70 = getelementptr inbounds i8, ptr %3, i64 16
  %71 = load double, ptr %70, align 8, !tbaa !20
  %72 = call noundef double @_ZN12_GLOBAL__N_111WeightedSumEddd(double noundef %69, double noundef %71, double noundef %67)
  store double %67, ptr %63, align 8, !tbaa !24
  br label %99

73:                                               ; preds = %44
  %74 = getelementptr inbounds i8, ptr %3, i64 16
  %75 = load double, ptr %74, align 8, !tbaa !20
  %76 = fcmp olt double %75, %45
  br i1 %76, label %77, label %81

77:                                               ; preds = %73
  %78 = getelementptr inbounds i8, ptr %0, i64 80
  %79 = load double, ptr %78, align 8, !tbaa !22
  %80 = tail call noundef double @_ZN12_GLOBAL__N_111WeightedSumEddd(double noundef %79, double noundef %75, double noundef %45)
  br label %99

81:                                               ; preds = %73
  %82 = getelementptr inbounds i8, ptr %0, i64 88
  %83 = load double, ptr %82, align 8, !tbaa !23
  %84 = tail call noundef double @_ZN12_GLOBAL__N_111WeightedSumEddd(double noundef %83, double noundef %75, double noundef %45)
  br label %99

85:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %86 = getelementptr inbounds i8, ptr %0, i64 88
  %87 = load double, ptr %86, align 8, !tbaa !23
  %88 = getelementptr inbounds i8, ptr %3, i64 8
  %89 = load double, ptr %88, align 8, !tbaa !24
  %90 = tail call noundef double @_ZN12_GLOBAL__N_111WeightedSumEddd(double noundef %87, double noundef %89, double noundef %45)
  store double %90, ptr %7, align 8, !tbaa !18
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %92 = load double, ptr %91, align 8, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  %93 = getelementptr inbounds i8, ptr %0, i64 80
  %94 = load double, ptr %93, align 8, !tbaa !22
  %95 = getelementptr inbounds i8, ptr %3, i64 16
  %96 = load double, ptr %95, align 8, !tbaa !20
  %97 = call noundef double @_ZN12_GLOBAL__N_111WeightedSumEddd(double noundef %94, double noundef %96, double noundef %92)
  store double %92, ptr %88, align 8, !tbaa !24
  br label %99

98:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %107

99:                                               ; preds = %60, %85, %56, %52, %81, %77
  %.046 = phi double [ %97, %85 ], [ %80, %77 ], [ %84, %81 ], [ %72, %60 ], [ %55, %52 ], [ %59, %56 ]
  %100 = getelementptr inbounds i8, ptr %3, i64 16
  store double %.046, ptr %100, align 8, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  %101 = getelementptr inbounds i8, ptr %0, i64 64
  %102 = load double, ptr %101, align 8, !tbaa !25
  %103 = fsub double %102, %.046
  %104 = fmul double %103, 5.000000e-02
  %105 = call double @pow(double noundef 1.000000e+01, double noundef %104) #7
  %106 = fmul double %105, %1
  store double %106, ptr %2, align 8, !tbaa !18
  br label %107

107:                                              ; preds = %98, %99, %4
  %.2 = phi i1 [ false, %4 ], [ false, %98 ], [ true, %99 ]
  ret i1 %.2
}

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

declare noundef double @_ZN4sptk10FloorLog10Ed(double noundef) local_unnamed_addr #2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef double @_ZN12_GLOBAL__N_111WeightedSumEddd(double noundef, double noundef, double noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #6

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 = { mustprogress nocallback nofree nosync 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 = { 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 = { inlinehint 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 #6 = { 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 #7 = { 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, !11, i64 96}
!6 = !{!"_ZTSN4sptk23DynamicRangeCompressionE", !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !10, i64 72, !7, i64 80, !7, i64 88, !11, i64 96}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN4sptk23DynamicRangeCompression12DetectorTypeE", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{i8 0, i8 2}
!13 = !{}
!14 = !{!6, !7, i64 8}
!15 = !{!6, !7, i64 24}
!16 = !{!6, !7, i64 40}
!17 = !{!6, !7, i64 32}
!18 = !{!7, !7, i64 0}
!19 = !{!6, !10, i64 72}
!20 = !{!21, !7, i64 16}
!21 = !{!"_ZTSN4sptk23DynamicRangeCompression6BufferE", !7, i64 8, !7, i64 16}
!22 = !{!6, !7, i64 80}
!23 = !{!6, !7, i64 88}
!24 = !{!21, !7, i64 8}
!25 = !{!6, !7, i64 64}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass