; LLVM IR from modlfo/AudioEngine :: AudioEngine/JuceLibraryCode (juce_gui_basics)

; 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.juce::StretchableObjectResizer" = type { %"class.juce::Array.374" }
%"class.juce::Array.374" = type { %"class.juce::ArrayAllocationBase.375", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.375" = type <{ %"class.juce::HeapBlock.376", i32, [4 x i8] }>
%"class.juce::HeapBlock.376" = type { ptr }
%"struct.juce::StretchableObjectResizer::Item" = type { double, double, double, i32 }

; 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4juce4jminIiEET_S1_S1_(i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN4juce4jmaxIdEET_S1_S1_(double noundef, double noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNSt14numeric_limitsIiE3maxEv() #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce5ArrayINS_24StretchableObjectResizer4ItemENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNK4juce5ArrayINS_24StretchableObjectResizer4ItemENS_20DummyCriticalSectionELi0EE12getReferenceEi(ptr noundef nonnull align 8 dereferenceable(20), i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce24StretchableObjectResizer11resizeToFitEd(ptr noundef nonnull align 8 dereferenceable(24) %0, double noundef %1) #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca double, align 8
  %5 = alloca i32, align 4
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store double %1, ptr %4, align 8, !tbaa !9
  %24 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !11
  br label %25

25:                                               ; preds = %203, %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store double 0.000000e+00, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store double 0.000000e+00, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store double 0.000000e+00, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %26 = call noundef i32 @_ZNSt14numeric_limitsIiE3maxEv() #5
  store i32 %26, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !11
  br label %27

27:                                               ; preds = %75, %25
  %28 = load i32, ptr %10, align 4, !tbaa !11
  %29 = getelementptr inbounds %"class.juce::StretchableObjectResizer", ptr %24, i32 0, i32 0
  %30 = call noundef i32 @_ZNK4juce5ArrayINS_24StretchableObjectResizer4ItemENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %29) #5
  %31 = icmp slt i32 %28, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %78

33:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %34 = getelementptr inbounds %"class.juce::StretchableObjectResizer", ptr %24, i32 0, i32 0
  %35 = load i32, ptr %10, align 4, !tbaa !11
  %36 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK4juce5ArrayINS_24StretchableObjectResizer4ItemENS_20DummyCriticalSectionELi0EE12getReferenceEi(ptr noundef nonnull align 8 dereferenceable(20) %34, i32 noundef %35) #5
  store ptr %36, ptr %11, align 8, !tbaa !5
  %37 = load ptr, ptr %11, align 8, !tbaa !5
  %38 = getelementptr inbounds %"struct.juce::StretchableObjectResizer::Item", ptr %37, i32 0, i32 0
  %39 = load double, ptr %38, align 8, !tbaa !13
  %40 = load double, ptr %6, align 8, !tbaa !9
  %41 = fadd double %40, %39
  store double %41, ptr %6, align 8, !tbaa !9
  %42 = load ptr, ptr %11, align 8, !tbaa !5
  %43 = getelementptr inbounds %"struct.juce::StretchableObjectResizer::Item", ptr %42, i32 0, i32 3
  %44 = load i32, ptr %43, align 8, !tbaa !15
  %45 = load i32, ptr %5, align 4, !tbaa !11
  %46 = icmp sle i32 %44, %45
  br i1 %46, label %47, label %58

47:                                               ; preds = %33
  %48 = load ptr, ptr %11, align 8, !tbaa !5
  %49 = getelementptr inbounds %"struct.juce::StretchableObjectResizer::Item", ptr %48, i32 0, i32 1
  %50 = load double, ptr %49, align 8, !tbaa !16
  %51 = load double, ptr %7, align 8, !tbaa !9
  %52 = fadd double %51, %50
  store double %52, ptr %7, align 8, !tbaa !9
  %53 = load ptr, ptr %11, align 8, !tbaa !5
  %54 = getelementptr inbounds %"struct.juce::StretchableObjectResizer::Item", ptr %53, i32 0, i32 2
  %55 = load double, ptr %54, align 8, !tbaa !17
  %56 = load double, ptr %8, align 8, !tbaa !9
  %57 = fadd double %56, %55
  store double %57, ptr %8, align 8, !tbaa !9
  br label %74

58:                                               ; preds = %33
  %59 = load ptr, ptr %11, align 8, !tbaa !5
  %60 = getelementptr inbounds %"struct.juce::StretchableObjectResizer::Item", ptr %59, i32 0, i32 0
  %61 = load double, ptr %60, align 8, !tbaa !13
  %62 = load double, ptr %7, align 8, !tbaa !9
  %63 = fadd double %62, %61
  store double %63, ptr %7, align 8, !tbaa !9
  %64 = load ptr, ptr %11, align 8, !tbaa !5
  %65 = getelementptr inbounds %"struct.juce::StretchableObjectResizer::Item", ptr %64, i32 0, i32 0
  %66 = load double, ptr %65, align 8, !tbaa !13
  %67 = load double, ptr %8, align 8, !tbaa !9
  %68 = fadd double %67, %66
  store double %68, ptr %8, align 8, !tbaa !9
  %69 = load i32, ptr %9, align 4, !tbaa !11
  %70 = load ptr, ptr %11, align 8, !tbaa !5
  %71 = getelementptr inbounds %"struct.juce::StretchableObjectResizer::Item", ptr %70, i32 0, i32 3
  %72 = load i32, ptr %71, align 8, !tbaa !15
  %73 = call noundef i32 @_ZN4juce4jminIiEET_S1_S1_(i32 noundef %69, i32 noundef %72)
  store i32 %73, ptr %9, align 4, !tbaa !11
  br label %74

74:                                               ; preds = %58, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %75

75:                                               ; preds = %74
  %76 = load i32, ptr %10, align 4, !tbaa !11
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %10, align 4, !tbaa !11
  br label %27, !llvm.loop !18

78:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %79 = load double, ptr %7, align 8, !tbaa !9
  %80 = load double, ptr %8, align 8, !tbaa !9
  %81 = load double, ptr %4, align 8, !tbaa !9
  %82 = call noundef double @_ZN4juce6jlimitIdEET_S1_S1_S1_(double noundef %79, double noundef %80, double noundef %81) #5
  store double %82, ptr %12, align 8, !tbaa !9
  %83 = load double, ptr %12, align 8, !tbaa !9
  %84 = load double, ptr %6, align 8, !tbaa !9
  %85 = fcmp oge double %83, %84
  br i1 %85, label %86, label %144

86:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %87 = load double, ptr %8, align 8, !tbaa !9
  %88 = load double, ptr %6, align 8, !tbaa !9
  %89 = fsub double %87, %88
  store double %89, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %90 = load double, ptr %12, align 8, !tbaa !9
  %91 = load double, ptr %6, align 8, !tbaa !9
  %92 = fsub double %90, %91
  store double %92, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %93 = load double, ptr %13, align 8, !tbaa !9
  %94 = fcmp ogt double %93, 0.000000e+00
  br i1 %94, label %95, label %99

95:                                               ; preds = %86
  %96 = load double, ptr %14, align 8, !tbaa !9
  %97 = load double, ptr %13, align 8, !tbaa !9
  %98 = fdiv double %96, %97
  br label %100

99:                                               ; preds = %86
  br label %100

100:                                              ; preds = %99, %95
  %101 = phi double [ %98, %95 ], [ 1.000000e+00, %99 ]
  store double %101, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !11
  br label %102

102:                                              ; preds = %140, %100
  %103 = load i32, ptr %16, align 4, !tbaa !11
  %104 = getelementptr inbounds %"class.juce::StretchableObjectResizer", ptr %24, i32 0, i32 0
  %105 = call noundef i32 @_ZNK4juce5ArrayINS_24StretchableObjectResizer4ItemENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %104) #5
  %106 = icmp slt i32 %103, %105
  br i1 %106, label %108, label %107

107:                                              ; preds = %102
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %143

108:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %109 = getelementptr inbounds %"class.juce::StretchableObjectResizer", ptr %24, i32 0, i32 0
  %110 = load i32, ptr %16, align 4, !tbaa !11
  %111 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK4juce5ArrayINS_24StretchableObjectResizer4ItemENS_20DummyCriticalSectionELi0EE12getReferenceEi(ptr noundef nonnull align 8 dereferenceable(20) %109, i32 noundef %110) #5
  store ptr %111, ptr %17, align 8, !tbaa !5
  %112 = load ptr, ptr %17, align 8, !tbaa !5
  %113 = getelementptr inbounds %"struct.juce::StretchableObjectResizer::Item", ptr %112, i32 0, i32 3
  %114 = load i32, ptr %113, align 8, !tbaa !15
  %115 = load i32, ptr %5, align 4, !tbaa !11
  %116 = icmp sle i32 %114, %115
  br i1 %116, label %117, label %139

117:                                              ; preds = %108
  %118 = load ptr, ptr %17, align 8, !tbaa !5
  %119 = getelementptr inbounds %"struct.juce::StretchableObjectResizer::Item", ptr %118, i32 0, i32 1
  %120 = load double, ptr %119, align 8, !tbaa !16
  %121 = load ptr, ptr %17, align 8, !tbaa !5
  %122 = getelementptr inbounds %"struct.juce::StretchableObjectResizer::Item", ptr %121, i32 0, i32 2
  %123 = load double, ptr %122, align 8, !tbaa !17
  %124 = load ptr, ptr %17, align 8, !tbaa !5
  %125 = getelementptr inbounds %"struct.juce::StretchableObjectResizer::Item", ptr %124, i32 0, i32 0
  %126 = load double, ptr %125, align 8, !tbaa !13
  %127 = load ptr, ptr %17, align 8, !tbaa !5
  %128 = getelementptr inbounds %"struct.juce::StretchableObjectResizer::Item", ptr %127, i32 0, i32 2
  %129 = load double, ptr %128, align 8, !tbaa !17
  %130 = load ptr, ptr %17, align 8, !tbaa !5
  %131 = getelementptr inbounds %"struct.juce::StretchableObjectResizer::Item", ptr %130, i32 0, i32 0
  %132 = load double, ptr %131, align 8, !tbaa !13
  %133 = fsub double %129, %132
  %134 = load double, ptr %15, align 8, !tbaa !9
  %135 = call double @llvm.fmuladd.f64(double %133, double %134, double %126)
  %136 = call noundef double @_ZN4juce6jlimitIdEET_S1_S1_S1_(double noundef %120, double noundef %123, double noundef %135) #5
  %137 = load ptr, ptr %17, align 8, !tbaa !5
  %138 = getelementptr inbounds %"struct.juce::StretchableObjectResizer::Item", ptr %137, i32 0, i32 0
  store double %136, ptr %138, align 8, !tbaa !13
  br label %139

139:                                              ; preds = %117, %108
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %140

140:                                              ; preds = %139
  %141 = load i32, ptr %16, align 4, !tbaa !11
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %16, align 4, !tbaa !11
  br label %102, !llvm.loop !20

143:                                              ; preds = %107
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %193

144:                                              ; preds = %78
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %145 = load double, ptr %6, align 8, !tbaa !9
  %146 = load double, ptr %7, align 8, !tbaa !9
  %147 = fsub double %145, %146
  store double %147, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %148 = load double, ptr %12, align 8, !tbaa !9
  %149 = load double, ptr %7, align 8, !tbaa !9
  %150 = fsub double %148, %149
  store double %150, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %151 = load double, ptr %19, align 8, !tbaa !9
  %152 = load double, ptr %18, align 8, !tbaa !9
  %153 = fdiv double %151, %152
  store double %153, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store i32 0, ptr %21, align 4, !tbaa !11
  br label %154

154:                                              ; preds = %189, %144
  %155 = load i32, ptr %21, align 4, !tbaa !11
  %156 = getelementptr inbounds %"class.juce::StretchableObjectResizer", ptr %24, i32 0, i32 0
  %157 = call noundef i32 @_ZNK4juce5ArrayINS_24StretchableObjectResizer4ItemENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %156) #5
  %158 = icmp slt i32 %155, %157
  br i1 %158, label %160, label %159

159:                                              ; preds = %154
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  br label %192

160:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %161 = getelementptr inbounds %"class.juce::StretchableObjectResizer", ptr %24, i32 0, i32 0
  %162 = load i32, ptr %21, align 4, !tbaa !11
  %163 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK4juce5ArrayINS_24StretchableObjectResizer4ItemENS_20DummyCriticalSectionELi0EE12getReferenceEi(ptr noundef nonnull align 8 dereferenceable(20) %161, i32 noundef %162) #5
  store ptr %163, ptr %22, align 8, !tbaa !5
  %164 = load ptr, ptr %22, align 8, !tbaa !5
  %165 = getelementptr inbounds %"struct.juce::StretchableObjectResizer::Item", ptr %164, i32 0, i32 3
  %166 = load i32, ptr %165, align 8, !tbaa !15
  %167 = load i32, ptr %5, align 4, !tbaa !11
  %168 = icmp sle i32 %166, %167
  br i1 %168, label %169, label %188

169:                                              ; preds = %160
  %170 = load ptr, ptr %22, align 8, !tbaa !5
  %171 = getelementptr inbounds %"struct.juce::StretchableObjectResizer::Item", ptr %170, i32 0, i32 1
  %172 = load double, ptr %171, align 8, !tbaa !16
  %173 = load ptr, ptr %22, align 8, !tbaa !5
  %174 = getelementptr inbounds %"struct.juce::StretchableObjectResizer::Item", ptr %173, i32 0, i32 1
  %175 = load double, ptr %174, align 8, !tbaa !16
  %176 = load ptr, ptr %22, align 8, !tbaa !5
  %177 = getelementptr inbounds %"struct.juce::StretchableObjectResizer::Item", ptr %176, i32 0, i32 0
  %178 = load double, ptr %177, align 8, !tbaa !13
  %179 = load ptr, ptr %22, align 8, !tbaa !5
  %180 = getelementptr inbounds %"struct.juce::StretchableObjectResizer::Item", ptr %179, i32 0, i32 1
  %181 = load double, ptr %180, align 8, !tbaa !16
  %182 = fsub double %178, %181
  %183 = load double, ptr %20, align 8, !tbaa !9
  %184 = call double @llvm.fmuladd.f64(double %182, double %183, double %175)
  %185 = call noundef double @_ZN4juce4jmaxIdEET_S1_S1_(double noundef %172, double noundef %184)
  %186 = load ptr, ptr %22, align 8, !tbaa !5
  %187 = getelementptr inbounds %"struct.juce::StretchableObjectResizer::Item", ptr %186, i32 0, i32 0
  store double %185, ptr %187, align 8, !tbaa !13
  br label %188

188:                                              ; preds = %169, %160
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  br label %189

189:                                              ; preds = %188
  %190 = load i32, ptr %21, align 4, !tbaa !11
  %191 = add nsw i32 %190, 1
  store i32 %191, ptr %21, align 4, !tbaa !11
  br label %154, !llvm.loop !21

192:                                              ; preds = %159
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %193

193:                                              ; preds = %192, %143
  %194 = load i32, ptr %9, align 4, !tbaa !11
  %195 = call noundef i32 @_ZNSt14numeric_limitsIiE3maxEv() #5
  %196 = icmp slt i32 %194, %195
  br i1 %196, label %197, label %199

197:                                              ; preds = %193
  %198 = load i32, ptr %9, align 4, !tbaa !11
  store i32 %198, ptr %5, align 4, !tbaa !11
  br label %200

199:                                              ; preds = %193
  store i32 2, ptr %23, align 4
  br label %201

200:                                              ; preds = %197
  store i32 0, ptr %23, align 4
  br label %201

201:                                              ; preds = %200, %199
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %202 = load i32, ptr %23, align 4
  switch i32 %202, label %205 [
    i32 0, label %203
    i32 2, label %204
  ]

203:                                              ; preds = %201
  br label %25, !llvm.loop !22

204:                                              ; preds = %201
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  ret void

205:                                              ; preds = %201
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN4juce6jlimitIdEET_S1_S1_S1_(double noundef, double noundef, double noundef) #1

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"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, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !10, i64 0}
!14 = !{!"_ZTSN4juce24StretchableObjectResizer4ItemE", !10, i64 0, !10, i64 8, !10, i64 16, !12, i64 24}
!15 = !{!14, !12, i64 24}
!16 = !{!14, !10, i64 8}
!17 = !{!14, !10, i64 16}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = distinct !{!21, !19}
!22 = distinct !{!22, !19}


; 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 nounwind uwtable
declare dso_local noundef i32 @_ZN4juce4jminIiEET_S1_S1_(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN4juce4jmaxIdEET_S1_S1_(double noundef, double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNSt14numeric_limitsIiE3maxEv() local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce5ArrayINS_24StretchableObjectResizer4ItemENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNK4juce5ArrayINS_24StretchableObjectResizer4ItemENS_20DummyCriticalSectionELi0EE12getReferenceEi(ptr noundef nonnull align 8 dereferenceable(20), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4juce24StretchableObjectResizer11resizeToFitEd(ptr noundef nonnull align 8 dereferenceable(24) %0, double noundef %1) local_unnamed_addr #0 align 2 {
  br label %3

3:                                                ; preds = %.loopexit, %2
  %.061 = phi i32 [ 0, %2 ], [ %.068.lcssa, %.loopexit ]
  %4 = tail call noundef i32 @_ZNSt14numeric_limitsIiE3maxEv() #3
  %5 = tail call noundef i32 @_ZNK4juce5ArrayINS_24StretchableObjectResizer4ItemENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %0) #3
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %25, %3
  %.068.lcssa = phi i32 [ %4, %3 ], [ %.169, %25 ]
  %.063.lcssa = phi double [ 0.000000e+00, %3 ], [ %15, %25 ]
  %7 = phi <2 x double> [ zeroinitializer, %3 ], [ %27, %25 ]
  %8 = extractelement <2 x double> %7, i64 0
  %9 = extractelement <2 x double> %7, i64 1
  %10 = tail call noundef double @_ZN4juce6jlimitIdEET_S1_S1_S1_(double noundef %8, double noundef %9, double noundef %1) #3
  %11 = fcmp ult double %10, %.063.lcssa
  br i1 %11, label %55, label %31

.lr.ph:                                           ; preds = %3, %25
  %.06383 = phi double [ %15, %25 ], [ 0.000000e+00, %3 ]
  %.06880 = phi i32 [ %.169, %25 ], [ %4, %3 ]
  %.07179 = phi i32 [ %28, %25 ], [ 0, %3 ]
  %12 = phi <2 x double> [ %27, %25 ], [ zeroinitializer, %3 ]
  %13 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK4juce5ArrayINS_24StretchableObjectResizer4ItemENS_20DummyCriticalSectionELi0EE12getReferenceEi(ptr noundef nonnull align 8 dereferenceable(20) %0, i32 noundef %.07179) #3
  %14 = load double, ptr %13, align 8, !tbaa !5
  %15 = fadd double %.06383, %14
  %16 = getelementptr inbounds i8, ptr %13, i64 24
  %17 = load i32, ptr %16, align 8, !tbaa !11
  %.not76 = icmp sgt i32 %17, %.061
  br i1 %.not76, label %21, label %18

18:                                               ; preds = %.lr.ph
  %19 = getelementptr inbounds i8, ptr %13, i64 8
  %20 = load <2 x double>, ptr %19, align 8, !tbaa !12
  br label %25

21:                                               ; preds = %.lr.ph
  %22 = tail call noundef i32 @_ZN4juce4jminIiEET_S1_S1_(i32 noundef %.06880, i32 noundef %17)
  %23 = insertelement <2 x double> poison, double %14, i64 0
  %24 = shufflevector <2 x double> %23, <2 x double> poison, <2 x i32> zeroinitializer
  br label %25

25:                                               ; preds = %21, %18
  %.169 = phi i32 [ %.06880, %18 ], [ %22, %21 ]
  %26 = phi <2 x double> [ %20, %18 ], [ %24, %21 ]
  %27 = fadd <2 x double> %12, %26
  %28 = add nuw nsw i32 %.07179, 1
  %29 = tail call noundef i32 @_ZNK4juce5ArrayINS_24StretchableObjectResizer4ItemENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %0) #3
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %.lr.ph, label %._crit_edge, !llvm.loop !13

31:                                               ; preds = %._crit_edge
  %32 = fsub double %9, %.063.lcssa
  %33 = fsub double %10, %.063.lcssa
  %34 = fcmp ogt double %32, 0.000000e+00
  %35 = fdiv double %33, %32
  %36 = select i1 %34, double %35, double 1.000000e+00
  %37 = tail call noundef i32 @_ZNK4juce5ArrayINS_24StretchableObjectResizer4ItemENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %0) #3
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %.lr.ph89, label %.loopexit

.lr.ph89:                                         ; preds = %31, %51
  %.07087 = phi i32 [ %52, %51 ], [ 0, %31 ]
  %39 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK4juce5ArrayINS_24StretchableObjectResizer4ItemENS_20DummyCriticalSectionELi0EE12getReferenceEi(ptr noundef nonnull align 8 dereferenceable(20) %0, i32 noundef %.07087) #3
  %40 = getelementptr inbounds i8, ptr %39, i64 24
  %41 = load i32, ptr %40, align 8, !tbaa !11
  %.not75 = icmp sgt i32 %41, %.061
  br i1 %.not75, label %51, label %42

42:                                               ; preds = %.lr.ph89
  %43 = getelementptr inbounds i8, ptr %39, i64 8
  %44 = load double, ptr %43, align 8, !tbaa !15
  %45 = getelementptr inbounds i8, ptr %39, i64 16
  %46 = load double, ptr %45, align 8, !tbaa !16
  %47 = load double, ptr %39, align 8, !tbaa !5
  %48 = fsub double %46, %47
  %49 = tail call double @llvm.fmuladd.f64(double %48, double %36, double %47)
  %50 = tail call noundef double @_ZN4juce6jlimitIdEET_S1_S1_S1_(double noundef %44, double noundef %46, double noundef %49) #3
  store double %50, ptr %39, align 8, !tbaa !5
  br label %51

51:                                               ; preds = %42, %.lr.ph89
  %52 = add nuw nsw i32 %.07087, 1
  %53 = tail call noundef i32 @_ZNK4juce5ArrayINS_24StretchableObjectResizer4ItemENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %0) #3
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %.lr.ph89, label %.loopexit, !llvm.loop !17

55:                                               ; preds = %._crit_edge
  %56 = fsub double %.063.lcssa, %8
  %57 = fsub double %10, %8
  %58 = fdiv double %57, %56
  %59 = tail call noundef i32 @_ZNK4juce5ArrayINS_24StretchableObjectResizer4ItemENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %0) #3
  %60 = icmp sgt i32 %59, 0
  br i1 %60, label %.lr.ph92, label %.loopexit

.lr.ph92:                                         ; preds = %55, %71
  %.06290 = phi i32 [ %72, %71 ], [ 0, %55 ]
  %61 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK4juce5ArrayINS_24StretchableObjectResizer4ItemENS_20DummyCriticalSectionELi0EE12getReferenceEi(ptr noundef nonnull align 8 dereferenceable(20) %0, i32 noundef %.06290) #3
  %62 = getelementptr inbounds i8, ptr %61, i64 24
  %63 = load i32, ptr %62, align 8, !tbaa !11
  %.not = icmp sgt i32 %63, %.061
  br i1 %.not, label %71, label %64

64:                                               ; preds = %.lr.ph92
  %65 = getelementptr inbounds i8, ptr %61, i64 8
  %66 = load double, ptr %65, align 8, !tbaa !15
  %67 = load double, ptr %61, align 8, !tbaa !5
  %68 = fsub double %67, %66
  %69 = tail call double @llvm.fmuladd.f64(double %68, double %58, double %66)
  %70 = tail call noundef double @_ZN4juce4jmaxIdEET_S1_S1_(double noundef %66, double noundef %69)
  store double %70, ptr %61, align 8, !tbaa !5
  br label %71

71:                                               ; preds = %64, %.lr.ph92
  %72 = add nuw nsw i32 %.06290, 1
  %73 = tail call noundef i32 @_ZNK4juce5ArrayINS_24StretchableObjectResizer4ItemENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %0) #3
  %74 = icmp slt i32 %72, %73
  br i1 %74, label %.lr.ph92, label %.loopexit, !llvm.loop !18

.loopexit:                                        ; preds = %51, %71, %31, %55
  %75 = tail call noundef i32 @_ZNSt14numeric_limitsIiE3maxEv() #3
  %76 = icmp slt i32 %.068.lcssa, %75
  br i1 %76, label %3, label %77

77:                                               ; preds = %.loopexit
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN4juce6jlimitIdEET_S1_S1_S1_(double noundef, double noundef, 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) #2

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !7, i64 0}
!6 = !{!"_ZTSN4juce24StretchableObjectResizer4ItemE", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !10, i64 24}
!12 = !{!7, !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!6, !7, i64 8}
!16 = !{!6, !7, i64 16}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass