; LLVM IR from modlfo/AudioEngine :: AudioEngine/JuceLibraryCode (juce_audio_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::GenericScopedLock" = type { ptr }
%"class.juce::BufferingAudioSource" = type <{ %"class.juce::PositionableAudioSource", %"class.juce::TimeSliceClient", %"class.juce::OptionalScopedPointer", ptr, i32, i32, %"class.juce::AudioBuffer", %"class.juce::CriticalSection", %"class.juce::WaitableEvent", i64, i64, i64, double, i8, i8, i8, [5 x i8] }>
%"class.juce::PositionableAudioSource" = type { %"class.juce::AudioSource" }
%"class.juce::AudioSource" = type { ptr }
%"class.juce::TimeSliceClient" = type { ptr, %"class.juce::Time" }
%"class.juce::Time" = type { i64 }
%"class.juce::OptionalScopedPointer" = type <{ %"class.juce::ScopedPointer.79", i8, [7 x i8] }>
%"class.juce::ScopedPointer.79" = type { ptr }
%"class.juce::AudioBuffer" = type <{ i32, i32, i64, ptr, %"class.juce::HeapBlock.0", [32 x ptr], i8, [7 x i8] }>
%"class.juce::HeapBlock.0" = type { ptr }
%"class.juce::CriticalSection" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.juce::WaitableEvent" = type <{ %union.pthread_cond_t, %union.pthread_mutex_t, i8, i8, [6 x i8] }>
%union.pthread_cond_t = type { %struct.__pthread_cond_s }
%struct.__pthread_cond_s = type { %union.__atomic_wide_counter, %union.__atomic_wide_counter, [2 x i32], [2 x i32], i32, i32, [2 x i32] }
%union.__atomic_wide_counter = type { i64 }
%"struct.juce::AudioSourceChannelInfo" = type { ptr, i32, i32 }

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce20BufferingAudioSource17getNextAudioBlockERKNS_22AudioSourceChannelInfoE(ptr noundef nonnull align 8 dereferenceable(523) %0, ptr noundef nonnull align 8 dereferenceable(16) %1) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.juce::GenericScopedLock", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %14 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %15 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %14, i32 0, i32 7
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(40) %15) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %16 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %14, i32 0, i32 9
  %17 = load volatile i64, ptr %16, align 8, !tbaa !9
  %18 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %14, i32 0, i32 10
  %19 = load volatile i64, ptr %18, align 8, !tbaa !26
  %20 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %14, i32 0, i32 11
  %21 = load volatile i64, ptr %20, align 8, !tbaa !27
  %22 = call noundef i64 @_ZN4juce6jlimitIxEET_S1_S1_S1_(i64 noundef %17, i64 noundef %19, i64 noundef %21) #4
  %23 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %14, i32 0, i32 11
  %24 = load volatile i64, ptr %23, align 8, !tbaa !27
  %25 = sub nsw i64 %22, %24
  %26 = trunc i64 %25 to i32
  store i32 %26, ptr %6, align 4, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %27 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %14, i32 0, i32 9
  %28 = load volatile i64, ptr %27, align 8, !tbaa !9
  %29 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %14, i32 0, i32 10
  %30 = load volatile i64, ptr %29, align 8, !tbaa !26
  %31 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %14, i32 0, i32 11
  %32 = load volatile i64, ptr %31, align 8, !tbaa !27
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %33, i32 0, i32 2
  %35 = load i32, ptr %34, align 4, !tbaa !29
  %36 = sext i32 %35 to i64
  %37 = add nsw i64 %32, %36
  %38 = call noundef i64 @_ZN4juce6jlimitIxEET_S1_S1_S1_(i64 noundef %28, i64 noundef %30, i64 noundef %37) #4
  %39 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %14, i32 0, i32 11
  %40 = load volatile i64, ptr %39, align 8, !tbaa !27
  %41 = sub nsw i64 %38, %40
  %42 = trunc i64 %41 to i32
  store i32 %42, ptr %7, align 4, !tbaa !28
  %43 = load i32, ptr %6, align 4, !tbaa !28
  %44 = load i32, ptr %7, align 4, !tbaa !28
  %45 = icmp eq i32 %43, %44
  br i1 %45, label %46, label %53

46:                                               ; preds = %2
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZNK4juce22AudioSourceChannelInfo23clearActiveBufferRegionEv(ptr noundef nonnull align 8 dereferenceable(16) %47)
          to label %48 unwind label %49

48:                                               ; preds = %46
  br label %195

49:                                               ; preds = %46
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %8, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %9, align 4
  br label %196

53:                                               ; preds = %2
  %54 = load i32, ptr %6, align 4, !tbaa !28
  %55 = icmp sgt i32 %54, 0
  br i1 %55, label %56, label %64

56:                                               ; preds = %53
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %57, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8, !tbaa !31
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %60, i32 0, i32 1
  %62 = load i32, ptr %61, align 8, !tbaa !32
  %63 = load i32, ptr %6, align 4, !tbaa !28
  call void @_ZN4juce11AudioBufferIfE5clearEii(ptr noundef nonnull align 8 dereferenceable(289) %59, i32 noundef %62, i32 noundef %63) #4
  br label %64

64:                                               ; preds = %56, %53
  %65 = load i32, ptr %7, align 4, !tbaa !28
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %66, i32 0, i32 2
  %68 = load i32, ptr %67, align 4, !tbaa !29
  %69 = icmp slt i32 %65, %68
  br i1 %69, label %70, label %84

70:                                               ; preds = %64
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %71, i32 0, i32 0
  %73 = load ptr, ptr %72, align 8, !tbaa !31
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %74, i32 0, i32 1
  %76 = load i32, ptr %75, align 8, !tbaa !32
  %77 = load i32, ptr %7, align 4, !tbaa !28
  %78 = add nsw i32 %76, %77
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %79, i32 0, i32 2
  %81 = load i32, ptr %80, align 4, !tbaa !29
  %82 = load i32, ptr %7, align 4, !tbaa !28
  %83 = sub nsw i32 %81, %82
  call void @_ZN4juce11AudioBufferIfE5clearEii(ptr noundef nonnull align 8 dereferenceable(289) %73, i32 noundef %78, i32 noundef %83) #4
  br label %84

84:                                               ; preds = %70, %64
  %85 = load i32, ptr %6, align 4, !tbaa !28
  %86 = load i32, ptr %7, align 4, !tbaa !28
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %88, label %187

88:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %89 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %14, i32 0, i32 5
  %90 = load i32, ptr %89, align 4, !tbaa !33
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  %92 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %91, i32 0, i32 0
  %93 = load ptr, ptr %92, align 8, !tbaa !31
  %94 = call noundef i32 @_ZNK4juce11AudioBufferIfE14getNumChannelsEv(ptr noundef nonnull align 8 dereferenceable(289) %93) #4
  %95 = invoke noundef i32 @_ZN4juce4jminIiEET_S1_S1_(i32 noundef %90, i32 noundef %94)
          to label %96 unwind label %102

96:                                               ; preds = %88
  store i32 %95, ptr %10, align 4, !tbaa !28
  br label %97

97:                                               ; preds = %185, %96
  %98 = load i32, ptr %10, align 4, !tbaa !28
  %99 = add nsw i32 %98, -1
  store i32 %99, ptr %10, align 4, !tbaa !28
  %100 = icmp sge i32 %99, 0
  br i1 %100, label %106, label %101

101:                                              ; preds = %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %186

102:                                              ; preds = %88
  %103 = landingpad { ptr, i32 }
          cleanup
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %8, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %196

106:                                              ; preds = %97
  br label %107

107:                                              ; preds = %106
  br label %108

108:                                              ; preds = %107
  br label %109

109:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %110 = load i32, ptr %6, align 4, !tbaa !28
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %14, i32 0, i32 11
  %113 = load volatile i64, ptr %112, align 8, !tbaa !27
  %114 = add nsw i64 %111, %113
  %115 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %14, i32 0, i32 6
  %116 = call noundef i32 @_ZNK4juce11AudioBufferIfE13getNumSamplesEv(ptr noundef nonnull align 8 dereferenceable(289) %115) #4
  %117 = sext i32 %116 to i64
  %118 = srem i64 %114, %117
  %119 = trunc i64 %118 to i32
  store i32 %119, ptr %11, align 4, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %120 = load i32, ptr %7, align 4, !tbaa !28
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %14, i32 0, i32 11
  %123 = load volatile i64, ptr %122, align 8, !tbaa !27
  %124 = add nsw i64 %121, %123
  %125 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %14, i32 0, i32 6
  %126 = call noundef i32 @_ZNK4juce11AudioBufferIfE13getNumSamplesEv(ptr noundef nonnull align 8 dereferenceable(289) %125) #4
  %127 = sext i32 %126 to i64
  %128 = srem i64 %124, %127
  %129 = trunc i64 %128 to i32
  store i32 %129, ptr %12, align 4, !tbaa !28
  %130 = load i32, ptr %11, align 4, !tbaa !28
  %131 = load i32, ptr %12, align 4, !tbaa !28
  %132 = icmp slt i32 %130, %131
  br i1 %132, label %133, label %149

133:                                              ; preds = %109
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %134, i32 0, i32 0
  %136 = load ptr, ptr %135, align 8, !tbaa !31
  %137 = load i32, ptr %10, align 4, !tbaa !28
  %138 = load ptr, ptr %4, align 8, !tbaa !5
  %139 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %138, i32 0, i32 1
  %140 = load i32, ptr %139, align 8, !tbaa !32
  %141 = load i32, ptr %6, align 4, !tbaa !28
  %142 = add nsw i32 %140, %141
  %143 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %14, i32 0, i32 6
  %144 = load i32, ptr %10, align 4, !tbaa !28
  %145 = load i32, ptr %11, align 4, !tbaa !28
  %146 = load i32, ptr %7, align 4, !tbaa !28
  %147 = load i32, ptr %6, align 4, !tbaa !28
  %148 = sub nsw i32 %146, %147
  call void @_ZN4juce11AudioBufferIfE8copyFromEiiRKS1_iii(ptr noundef nonnull align 8 dereferenceable(289) %136, i32 noundef %137, i32 noundef %142, ptr noundef nonnull align 8 dereferenceable(289) %143, i32 noundef %144, i32 noundef %145, i32 noundef %148) #4
  br label %185

149:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %150 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %14, i32 0, i32 6
  %151 = call noundef i32 @_ZNK4juce11AudioBufferIfE13getNumSamplesEv(ptr noundef nonnull align 8 dereferenceable(289) %150) #4
  %152 = load i32, ptr %11, align 4, !tbaa !28
  %153 = sub nsw i32 %151, %152
  store i32 %153, ptr %13, align 4, !tbaa !28
  %154 = load ptr, ptr %4, align 8, !tbaa !5
  %155 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %154, i32 0, i32 0
  %156 = load ptr, ptr %155, align 8, !tbaa !31
  %157 = load i32, ptr %10, align 4, !tbaa !28
  %158 = load ptr, ptr %4, align 8, !tbaa !5
  %159 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %158, i32 0, i32 1
  %160 = load i32, ptr %159, align 8, !tbaa !32
  %161 = load i32, ptr %6, align 4, !tbaa !28
  %162 = add nsw i32 %160, %161
  %163 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %14, i32 0, i32 6
  %164 = load i32, ptr %10, align 4, !tbaa !28
  %165 = load i32, ptr %11, align 4, !tbaa !28
  %166 = load i32, ptr %13, align 4, !tbaa !28
  call void @_ZN4juce11AudioBufferIfE8copyFromEiiRKS1_iii(ptr noundef nonnull align 8 dereferenceable(289) %156, i32 noundef %157, i32 noundef %162, ptr noundef nonnull align 8 dereferenceable(289) %163, i32 noundef %164, i32 noundef %165, i32 noundef %166) #4
  %167 = load ptr, ptr %4, align 8, !tbaa !5
  %168 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %167, i32 0, i32 0
  %169 = load ptr, ptr %168, align 8, !tbaa !31
  %170 = load i32, ptr %10, align 4, !tbaa !28
  %171 = load ptr, ptr %4, align 8, !tbaa !5
  %172 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %171, i32 0, i32 1
  %173 = load i32, ptr %172, align 8, !tbaa !32
  %174 = load i32, ptr %6, align 4, !tbaa !28
  %175 = add nsw i32 %173, %174
  %176 = load i32, ptr %13, align 4, !tbaa !28
  %177 = add nsw i32 %175, %176
  %178 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %14, i32 0, i32 6
  %179 = load i32, ptr %10, align 4, !tbaa !28
  %180 = load i32, ptr %7, align 4, !tbaa !28
  %181 = load i32, ptr %6, align 4, !tbaa !28
  %182 = sub nsw i32 %180, %181
  %183 = load i32, ptr %13, align 4, !tbaa !28
  %184 = sub nsw i32 %182, %183
  call void @_ZN4juce11AudioBufferIfE8copyFromEiiRKS1_iii(ptr noundef nonnull align 8 dereferenceable(289) %169, i32 noundef %170, i32 noundef %177, ptr noundef nonnull align 8 dereferenceable(289) %178, i32 noundef %179, i32 noundef 0, i32 noundef %184) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %185

185:                                              ; preds = %149, %133
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %97, !llvm.loop !34

186:                                              ; preds = %101
  br label %187

187:                                              ; preds = %186, %84
  %188 = load ptr, ptr %4, align 8, !tbaa !5
  %189 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %188, i32 0, i32 2
  %190 = load i32, ptr %189, align 4, !tbaa !29
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %14, i32 0, i32 11
  %193 = load volatile i64, ptr %192, align 8, !tbaa !27
  %194 = add nsw i64 %193, %191
  store volatile i64 %194, ptr %192, align 8, !tbaa !27
  br label %195

195:                                              ; preds = %187, %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret void

196:                                              ; preds = %102, %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  br label %197

197:                                              ; preds = %196
  %198 = load ptr, ptr %8, align 8
  %199 = load i32, ptr %9, align 4
  %200 = insertvalue { ptr, i32 } poison, ptr %198, 0
  %201 = insertvalue { ptr, i32 } %200, i32 %199, 1
  resume { ptr, i32 } %201
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN4juce6jlimitIxEET_S1_S1_S1_(i64 noundef, i64 noundef, i64 noundef) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce11AudioBufferIfE5clearEii(ptr noundef nonnull align 8 dereferenceable(289), i32 noundef, i32 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce11AudioBufferIfE8copyFromEiiRKS1_iii(ptr noundef nonnull align 8 dereferenceable(289), i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(289), i32 noundef, i32 noundef, i32 noundef) #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { 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, !15, i64 488}
!10 = !{!"_ZTSN4juce20BufferingAudioSourceE", !11, i64 0, !13, i64 8, !16, i64 24, !6, i64 40, !19, i64 48, !19, i64 52, !20, i64 56, !23, i64 352, !24, i64 392, !15, i64 488, !15, i64 496, !15, i64 504, !25, i64 512, !18, i64 520, !18, i64 521, !18, i64 522}
!11 = !{!"_ZTSN4juce23PositionableAudioSourceE", !12, i64 0}
!12 = !{!"_ZTSN4juce11AudioSourceE"}
!13 = !{!"_ZTSN4juce15TimeSliceClientE", !14, i64 8}
!14 = !{!"_ZTSN4juce4TimeE", !15, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = !{!"_ZTSN4juce21OptionalScopedPointerINS_23PositionableAudioSourceEEE", !17, i64 0, !18, i64 8}
!17 = !{!"_ZTSN4juce13ScopedPointerINS_23PositionableAudioSourceEEE", !6, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{!"int", !7, i64 0}
!20 = !{!"_ZTSN4juce11AudioBufferIfEE", !19, i64 0, !19, i64 4, !21, i64 8, !6, i64 16, !22, i64 24, !7, i64 32, !18, i64 288}
!21 = !{!"long", !7, i64 0}
!22 = !{!"_ZTSN4juce9HeapBlockIcLb1EEE", !6, i64 0}
!23 = !{!"_ZTSN4juce15CriticalSectionE", !7, i64 0}
!24 = !{!"_ZTSN4juce13WaitableEventE", !7, i64 0, !7, i64 48, !18, i64 88, !18, i64 89}
!25 = !{!"double", !7, i64 0}
!26 = !{!10, !15, i64 496}
!27 = !{!10, !15, i64 504}
!28 = !{!19, !19, i64 0}
!29 = !{!30, !19, i64 12}
!30 = !{!"_ZTSN4juce22AudioSourceChannelInfoE", !6, i64 0, !19, i64 8, !19, i64 12}
!31 = !{!30, !6, i64 0}
!32 = !{!30, !19, i64 8}
!33 = !{!10, !19, i64 52}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}


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

%"class.juce::GenericScopedLock" = type { ptr }

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce11AudioBufferIfE14getNumChannelsEv(ptr noundef nonnull align 8 dereferenceable(289)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce11AudioBufferIfE13getNumSamplesEv(ptr noundef nonnull align 8 dereferenceable(289)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4juce20BufferingAudioSource17getNextAudioBlockERKNS_22AudioSourceChannelInfoE(ptr noundef nonnull align 8 dereferenceable(523) %0, ptr noundef nonnull align 8 dereferenceable(16) %1) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.juce::GenericScopedLock", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %4 = getelementptr inbounds i8, ptr %0, i64 352
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(40) %4) #3
  %5 = getelementptr inbounds i8, ptr %0, i64 488
  %6 = load volatile i64, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 496
  %8 = load volatile i64, ptr %7, align 8, !tbaa !25
  %9 = getelementptr inbounds i8, ptr %0, i64 504
  %10 = load volatile i64, ptr %9, align 8, !tbaa !26
  %11 = call noundef i64 @_ZN4juce6jlimitIxEET_S1_S1_S1_(i64 noundef %6, i64 noundef %8, i64 noundef %10) #3
  %12 = load volatile i64, ptr %9, align 8, !tbaa !26
  %13 = sub nsw i64 %11, %12
  %14 = trunc i64 %13 to i32
  %15 = load volatile i64, ptr %5, align 8, !tbaa !5
  %16 = load volatile i64, ptr %7, align 8, !tbaa !25
  %17 = load volatile i64, ptr %9, align 8, !tbaa !26
  %18 = getelementptr inbounds i8, ptr %1, i64 12
  %19 = load i32, ptr %18, align 4, !tbaa !27
  %20 = sext i32 %19 to i64
  %21 = add nsw i64 %17, %20
  %22 = call noundef i64 @_ZN4juce6jlimitIxEET_S1_S1_S1_(i64 noundef %15, i64 noundef %16, i64 noundef %21) #3
  %23 = load volatile i64, ptr %9, align 8, !tbaa !26
  %24 = sub nsw i64 %22, %23
  %25 = trunc i64 %24 to i32
  %26 = icmp eq i32 %14, %25
  br i1 %26, label %27, label %28

27:                                               ; preds = %2
  call void @_ZNK4juce22AudioSourceChannelInfo23clearActiveBufferRegionEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  br label %92

28:                                               ; preds = %2
  %29 = icmp sgt i32 %14, 0
  br i1 %29, label %30, label %34

30:                                               ; preds = %28
  %31 = load ptr, ptr %1, align 8, !tbaa !29
  %32 = getelementptr inbounds i8, ptr %1, i64 8
  %33 = load i32, ptr %32, align 8, !tbaa !30
  call void @_ZN4juce11AudioBufferIfE5clearEii(ptr noundef nonnull align 8 dereferenceable(289) %31, i32 noundef %33, i32 noundef %14) #3
  br label %34

34:                                               ; preds = %30, %28
  %35 = load i32, ptr %18, align 4, !tbaa !27
  %36 = icmp sgt i32 %35, %25
  br i1 %36, label %37, label %43

37:                                               ; preds = %34
  %38 = load ptr, ptr %1, align 8, !tbaa !29
  %39 = getelementptr inbounds i8, ptr %1, i64 8
  %40 = load i32, ptr %39, align 8, !tbaa !30
  %41 = add nsw i32 %40, %25
  %42 = sub nsw i32 %35, %25
  call void @_ZN4juce11AudioBufferIfE5clearEii(ptr noundef nonnull align 8 dereferenceable(289) %38, i32 noundef %41, i32 noundef %42) #3
  br label %43

43:                                               ; preds = %37, %34
  %44 = icmp slt i32 %14, %25
  br i1 %44, label %45, label %.loopexit

45:                                               ; preds = %43
  %46 = getelementptr inbounds i8, ptr %0, i64 52
  %47 = load i32, ptr %46, align 4, !tbaa !31
  %48 = load ptr, ptr %1, align 8, !tbaa !29
  %49 = call noundef i32 @_ZNK4juce11AudioBufferIfE14getNumChannelsEv(ptr noundef nonnull align 8 dereferenceable(289) %48) #3
  %50 = call noundef i32 @_ZN4juce4jminIiEET_S1_S1_(i32 noundef %47, i32 noundef %49)
  %51 = icmp sgt i32 %50, 0
  br i1 %51, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %45
  %sext = shl i64 %13, 32
  %52 = ashr exact i64 %sext, 32
  %53 = getelementptr inbounds i8, ptr %0, i64 56
  %sext54 = shl i64 %24, 32
  %54 = ashr exact i64 %sext54, 32
  %55 = getelementptr inbounds i8, ptr %1, i64 8
  %56 = sub nsw i32 %25, %14
  br label %57

57:                                               ; preds = %.lr.ph, %86
  %.in = phi i32 [ %50, %.lr.ph ], [ %58, %86 ]
  %58 = add nsw i32 %.in, -1
  %59 = load volatile i64, ptr %9, align 8, !tbaa !26
  %60 = add nsw i64 %59, %52
  %61 = call noundef i32 @_ZNK4juce11AudioBufferIfE13getNumSamplesEv(ptr noundef nonnull align 8 dereferenceable(289) %53) #3
  %62 = sext i32 %61 to i64
  %63 = srem i64 %60, %62
  %64 = trunc nsw i64 %63 to i32
  %65 = load volatile i64, ptr %9, align 8, !tbaa !26
  %66 = add nsw i64 %65, %54
  %67 = call noundef i32 @_ZNK4juce11AudioBufferIfE13getNumSamplesEv(ptr noundef nonnull align 8 dereferenceable(289) %53) #3
  %68 = sext i32 %67 to i64
  %69 = srem i64 %66, %68
  %70 = icmp slt i64 %63, %69
  br i1 %70, label %71, label %75

71:                                               ; preds = %57
  %72 = load ptr, ptr %1, align 8, !tbaa !29
  %73 = load i32, ptr %55, align 8, !tbaa !30
  %74 = add nsw i32 %73, %14
  call void @_ZN4juce11AudioBufferIfE8copyFromEiiRKS1_iii(ptr noundef nonnull align 8 dereferenceable(289) %72, i32 noundef %58, i32 noundef %74, ptr noundef nonnull align 8 dereferenceable(289) %53, i32 noundef %58, i32 noundef %64, i32 noundef %56) #3
  br label %86

75:                                               ; preds = %57
  %76 = call noundef i32 @_ZNK4juce11AudioBufferIfE13getNumSamplesEv(ptr noundef nonnull align 8 dereferenceable(289) %53) #3
  %77 = sub nsw i32 %76, %64
  %78 = load ptr, ptr %1, align 8, !tbaa !29
  %79 = load i32, ptr %55, align 8, !tbaa !30
  %80 = add nsw i32 %79, %14
  call void @_ZN4juce11AudioBufferIfE8copyFromEiiRKS1_iii(ptr noundef nonnull align 8 dereferenceable(289) %78, i32 noundef %58, i32 noundef %80, ptr noundef nonnull align 8 dereferenceable(289) %53, i32 noundef %58, i32 noundef %64, i32 noundef %77) #3
  %81 = load ptr, ptr %1, align 8, !tbaa !29
  %82 = load i32, ptr %55, align 8, !tbaa !30
  %83 = add i32 %77, %14
  %84 = add i32 %83, %82
  %85 = sub i32 %25, %83
  call void @_ZN4juce11AudioBufferIfE8copyFromEiiRKS1_iii(ptr noundef nonnull align 8 dereferenceable(289) %81, i32 noundef %58, i32 noundef %84, ptr noundef nonnull align 8 dereferenceable(289) %53, i32 noundef %58, i32 noundef 0, i32 noundef %85) #3
  br label %86

86:                                               ; preds = %75, %71
  %87 = icmp ugt i32 %.in, 1
  br i1 %87, label %57, label %.loopexit, !llvm.loop !32

.loopexit:                                        ; preds = %86, %45, %43
  %88 = load i32, ptr %18, align 4, !tbaa !27
  %89 = sext i32 %88 to i64
  %90 = load volatile i64, ptr %9, align 8, !tbaa !26
  %91 = add nsw i64 %90, %89
  store volatile i64 %91, ptr %9, align 8, !tbaa !26
  br label %92

92:                                               ; preds = %.loopexit, %27
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN4juce6jlimitIxEET_S1_S1_S1_(i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK4juce22AudioSourceChannelInfo23clearActiveBufferRegionEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce11AudioBufferIfE5clearEii(ptr noundef nonnull align 8 dereferenceable(289), i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce11AudioBufferIfE8copyFromEiiRKS1_iii(ptr noundef nonnull align 8 dereferenceable(289), i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(289), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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, !11, i64 488}
!6 = !{!"_ZTSN4juce20BufferingAudioSourceE", !7, i64 0, !9, i64 8, !14, i64 24, !16, i64 40, !18, i64 48, !18, i64 52, !19, i64 56, !22, i64 352, !23, i64 392, !11, i64 488, !11, i64 496, !11, i64 504, !24, i64 512, !17, i64 520, !17, i64 521, !17, i64 522}
!7 = !{!"_ZTSN4juce23PositionableAudioSourceE", !8, i64 0}
!8 = !{!"_ZTSN4juce11AudioSourceE"}
!9 = !{!"_ZTSN4juce15TimeSliceClientE", !10, i64 8}
!10 = !{!"_ZTSN4juce4TimeE", !11, i64 0}
!11 = !{!"long long", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"_ZTSN4juce21OptionalScopedPointerINS_23PositionableAudioSourceEEE", !15, i64 0, !17, i64 8}
!15 = !{!"_ZTSN4juce13ScopedPointerINS_23PositionableAudioSourceEEE", !16, i64 0}
!16 = !{!"any pointer", !12, i64 0}
!17 = !{!"bool", !12, i64 0}
!18 = !{!"int", !12, i64 0}
!19 = !{!"_ZTSN4juce11AudioBufferIfEE", !18, i64 0, !18, i64 4, !20, i64 8, !16, i64 16, !21, i64 24, !12, i64 32, !17, i64 288}
!20 = !{!"long", !12, i64 0}
!21 = !{!"_ZTSN4juce9HeapBlockIcLb1EEE", !16, i64 0}
!22 = !{!"_ZTSN4juce15CriticalSectionE", !12, i64 0}
!23 = !{!"_ZTSN4juce13WaitableEventE", !12, i64 0, !12, i64 48, !17, i64 88, !17, i64 89}
!24 = !{!"double", !12, i64 0}
!25 = !{!6, !11, i64 496}
!26 = !{!6, !11, i64 504}
!27 = !{!28, !18, i64 12}
!28 = !{!"_ZTSN4juce22AudioSourceChannelInfoE", !16, i64 0, !18, i64 8, !18, i64 12}
!29 = !{!28, !16, i64 0}
!30 = !{!28, !18, i64 8}
!31 = !{!6, !18, i64 52}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass