; LLVM IR from modlfo/AudioEngine :: AudioEngine/JuceLibraryCode/modules/juce_audio_formats/codecs/oggvorbis/libvorb_cda3c0e8 (search)

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

%struct.vorbis_dsp_state = type { i32, ptr, ptr, ptr, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, ptr }
%struct.vorbis_info = type { i32, i32, i64, i64, i64, i64, i64, ptr }
%struct.codec_setup_info = type { [2 x i64], i32, i32, i32, i32, i32, i32, [64 x ptr], [64 x i32], [64 x ptr], [64 x i32], [64 x ptr], [64 x i32], [64 x ptr], [256 x ptr], ptr, [4 x ptr], %struct.vorbis_info_psy_global, %struct.bitrate_manager_info, %struct.highlevel_encode_setup, i32 }
%struct.vorbis_info_psy_global = type { i32, [7 x float], [7 x float], float, float, float, [15 x i32], [2 x [15 x i32]], [15 x i32], [15 x i32], [2 x [15 x i32]] }
%struct.bitrate_manager_info = type { i64, i64, i64, i64, double, double }
%struct.highlevel_encode_setup = type { i32, ptr, double, double, float, i32, i64, i64, double, i64, i64, double, i32, i32, i32, double, double, i32, double, double, double, double, [4 x %struct.highlevel_byblocktype] }
%struct.highlevel_byblocktype = type { double, double, double, double }
%struct.private_state = type { ptr, [2 x i32], [2 x ptr], [2 x %struct.drft_lookup], i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.bitrate_manager_state, i64 }
%struct.drft_lookup = type { i32, ptr, ptr }
%struct.bitrate_manager_state = type { i32, i64, i64, i64, i64, i64, i64, double, ptr, i32 }
%struct.envelope_lookup = type { i32, i32, i32, float, %struct.mdct_lookup, ptr, [7 x %struct.envelope_band], ptr, i32, ptr, i64, i64, i64, i64 }
%struct.mdct_lookup = type { i32, i32, ptr, ptr, float }
%struct.envelope_band = type { i32, i32, ptr, float }
%struct.envelope_filter_state = type { [17 x float], i32, [15 x float], float, float, 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: nounwind uwtable
define dso_local i64 @_ve_envelope_search(ptr noundef %0) #1 {
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.vorbis_dsp_state, ptr %17, i32 0, i32 1
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  store ptr %19, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.vorbis_info, ptr %20, i32 0, i32 7
  %22 = load ptr, ptr %21, align 8, !tbaa !13
  store ptr %22, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.codec_setup_info, ptr %23, i32 0, i32 17
  store ptr %24, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.vorbis_dsp_state, ptr %25, i32 0, i32 19
  %27 = load ptr, ptr %26, align 8, !tbaa !15
  %28 = getelementptr inbounds %struct.private_state, ptr %27, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8, !tbaa !16
  store ptr %29, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.envelope_lookup, ptr %30, i32 0, i32 11
  %32 = load i64, ptr %31, align 8, !tbaa !20
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.envelope_lookup, ptr %33, i32 0, i32 2
  %35 = load i32, ptr %34, align 8, !tbaa !24
  %36 = sext i32 %35 to i64
  %37 = sdiv i64 %32, %36
  %38 = trunc i64 %37 to i32
  store i32 %38, ptr %10, align 4, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.vorbis_dsp_state, ptr %39, i32 0, i32 5
  %41 = load i32, ptr %40, align 4, !tbaa !26
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.envelope_lookup, ptr %42, i32 0, i32 2
  %44 = load i32, ptr %43, align 8, !tbaa !24
  %45 = sdiv i32 %41, %44
  %46 = sub nsw i32 %45, 4
  store i32 %46, ptr %11, align 4, !tbaa !25
  %47 = load i32, ptr %10, align 4, !tbaa !25
  %48 = icmp slt i32 %47, 0
  br i1 %48, label %49, label %50

49:                                               ; preds = %1
  store i32 0, ptr %10, align 4, !tbaa !25
  br label %50

50:                                               ; preds = %49, %1
  %51 = load i32, ptr %11, align 4, !tbaa !25
  %52 = add nsw i32 %51, 4
  %53 = add nsw i32 %52, 2
  %54 = sext i32 %53 to i64
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.envelope_lookup, ptr %55, i32 0, i32 10
  %57 = load i64, ptr %56, align 8, !tbaa !27
  %58 = icmp sgt i64 %54, %57
  br i1 %58, label %59, label %76

59:                                               ; preds = %50
  %60 = load i32, ptr %11, align 4, !tbaa !25
  %61 = add nsw i32 %60, 4
  %62 = add nsw i32 %61, 2
  %63 = sext i32 %62 to i64
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.envelope_lookup, ptr %64, i32 0, i32 10
  store i64 %63, ptr %65, align 8, !tbaa !27
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.envelope_lookup, ptr %66, i32 0, i32 9
  %68 = load ptr, ptr %67, align 8, !tbaa !28
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.envelope_lookup, ptr %69, i32 0, i32 10
  %71 = load i64, ptr %70, align 8, !tbaa !27
  %72 = mul i64 %71, 4
  %73 = call ptr @realloc(ptr noundef %68, i64 noundef %72) #4
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.envelope_lookup, ptr %74, i32 0, i32 9
  store ptr %73, ptr %75, align 8, !tbaa !28
  br label %76

76:                                               ; preds = %59, %50
  %77 = load i32, ptr %10, align 4, !tbaa !25
  %78 = sext i32 %77 to i64
  store i64 %78, ptr %9, align 8, !tbaa !29
  br label %79

79:                                               ; preds = %186, %76
  %80 = load i64, ptr %9, align 8, !tbaa !29
  %81 = load i32, ptr %11, align 4, !tbaa !25
  %82 = sext i32 %81 to i64
  %83 = icmp slt i64 %80, %82
  br i1 %83, label %84, label %189

84:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  store i32 0, ptr %12, align 4, !tbaa !25
  %85 = load ptr, ptr %7, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.envelope_lookup, ptr %85, i32 0, i32 8
  %87 = load i32, ptr %86, align 8, !tbaa !30
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %86, align 8, !tbaa !30
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.envelope_lookup, ptr %89, i32 0, i32 8
  %91 = load i32, ptr %90, align 8, !tbaa !30
  %92 = icmp sgt i32 %91, 24
  br i1 %92, label %93, label %96

93:                                               ; preds = %84
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.envelope_lookup, ptr %94, i32 0, i32 8
  store i32 24, ptr %95, align 8, !tbaa !30
  br label %96

96:                                               ; preds = %93, %84
  store i64 0, ptr %8, align 8, !tbaa !29
  br label %97

97:                                               ; preds = %133, %96
  %98 = load i64, ptr %8, align 8, !tbaa !29
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.envelope_lookup, ptr %99, i32 0, i32 0
  %101 = load i32, ptr %100, align 8, !tbaa !31
  %102 = sext i32 %101 to i64
  %103 = icmp slt i64 %98, %102
  br i1 %103, label %104, label %136

104:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %105 = load ptr, ptr %3, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.vorbis_dsp_state, ptr %105, i32 0, i32 2
  %107 = load ptr, ptr %106, align 8, !tbaa !32
  %108 = load i64, ptr %8, align 8, !tbaa !29
  %109 = getelementptr inbounds ptr, ptr %107, i64 %108
  %110 = load ptr, ptr %109, align 8, !tbaa !5
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.envelope_lookup, ptr %111, i32 0, i32 2
  %113 = load i32, ptr %112, align 8, !tbaa !24
  %114 = sext i32 %113 to i64
  %115 = load i64, ptr %9, align 8, !tbaa !29
  %116 = mul nsw i64 %114, %115
  %117 = getelementptr inbounds float, ptr %110, i64 %116
  store ptr %117, ptr %13, align 8, !tbaa !5
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  %120 = load ptr, ptr %13, align 8, !tbaa !5
  %121 = load ptr, ptr %7, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.envelope_lookup, ptr %121, i32 0, i32 6
  %123 = getelementptr inbounds [7 x %struct.envelope_band], ptr %122, i64 0, i64 0
  %124 = load ptr, ptr %7, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.envelope_lookup, ptr %124, i32 0, i32 7
  %126 = load ptr, ptr %125, align 8, !tbaa !33
  %127 = load i64, ptr %8, align 8, !tbaa !29
  %128 = mul nsw i64 %127, 7
  %129 = getelementptr inbounds %struct.envelope_filter_state, ptr %126, i64 %128
  %130 = call i32 @_ve_amp(ptr noundef %118, ptr noundef %119, ptr noundef %120, ptr noundef %123, ptr noundef %129)
  %131 = load i32, ptr %12, align 4, !tbaa !25
  %132 = or i32 %131, %130
  store i32 %132, ptr %12, align 4, !tbaa !25
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  br label %133

133:                                              ; preds = %104
  %134 = load i64, ptr %8, align 8, !tbaa !29
  %135 = add nsw i64 %134, 1
  store i64 %135, ptr %8, align 8, !tbaa !29
  br label %97, !llvm.loop !34

136:                                              ; preds = %97
  %137 = load ptr, ptr %7, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.envelope_lookup, ptr %137, i32 0, i32 9
  %139 = load ptr, ptr %138, align 8, !tbaa !28
  %140 = load i64, ptr %9, align 8, !tbaa !29
  %141 = add nsw i64 %140, 2
  %142 = getelementptr inbounds i32, ptr %139, i64 %141
  store i32 0, ptr %142, align 4, !tbaa !25
  %143 = load i32, ptr %12, align 4, !tbaa !25
  %144 = and i32 %143, 1
  %145 = icmp ne i32 %144, 0
  br i1 %145, label %146, label %158

146:                                              ; preds = %136
  %147 = load ptr, ptr %7, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.envelope_lookup, ptr %147, i32 0, i32 9
  %149 = load ptr, ptr %148, align 8, !tbaa !28
  %150 = load i64, ptr %9, align 8, !tbaa !29
  %151 = getelementptr inbounds i32, ptr %149, i64 %150
  store i32 1, ptr %151, align 4, !tbaa !25
  %152 = load ptr, ptr %7, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.envelope_lookup, ptr %152, i32 0, i32 9
  %154 = load ptr, ptr %153, align 8, !tbaa !28
  %155 = load i64, ptr %9, align 8, !tbaa !29
  %156 = add nsw i64 %155, 1
  %157 = getelementptr inbounds i32, ptr %154, i64 %156
  store i32 1, ptr %157, align 4, !tbaa !25
  br label %158

158:                                              ; preds = %146, %136
  %159 = load i32, ptr %12, align 4, !tbaa !25
  %160 = and i32 %159, 2
  %161 = icmp ne i32 %160, 0
  br i1 %161, label %162, label %178

162:                                              ; preds = %158
  %163 = load ptr, ptr %7, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.envelope_lookup, ptr %163, i32 0, i32 9
  %165 = load ptr, ptr %164, align 8, !tbaa !28
  %166 = load i64, ptr %9, align 8, !tbaa !29
  %167 = getelementptr inbounds i32, ptr %165, i64 %166
  store i32 1, ptr %167, align 4, !tbaa !25
  %168 = load i64, ptr %9, align 8, !tbaa !29
  %169 = icmp sgt i64 %168, 0
  br i1 %169, label %170, label %177

170:                                              ; preds = %162
  %171 = load ptr, ptr %7, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.envelope_lookup, ptr %171, i32 0, i32 9
  %173 = load ptr, ptr %172, align 8, !tbaa !28
  %174 = load i64, ptr %9, align 8, !tbaa !29
  %175 = sub nsw i64 %174, 1
  %176 = getelementptr inbounds i32, ptr %173, i64 %175
  store i32 1, ptr %176, align 4, !tbaa !25
  br label %177

177:                                              ; preds = %170, %162
  br label %178

178:                                              ; preds = %177, %158
  %179 = load i32, ptr %12, align 4, !tbaa !25
  %180 = and i32 %179, 4
  %181 = icmp ne i32 %180, 0
  br i1 %181, label %182, label %185

182:                                              ; preds = %178
  %183 = load ptr, ptr %7, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.envelope_lookup, ptr %183, i32 0, i32 8
  store i32 -1, ptr %184, align 8, !tbaa !30
  br label %185

185:                                              ; preds = %182, %178
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  br label %186

186:                                              ; preds = %185
  %187 = load i64, ptr %9, align 8, !tbaa !29
  %188 = add nsw i64 %187, 1
  store i64 %188, ptr %9, align 8, !tbaa !29
  br label %79, !llvm.loop !36

189:                                              ; preds = %79
  %190 = load i32, ptr %11, align 4, !tbaa !25
  %191 = load ptr, ptr %7, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.envelope_lookup, ptr %191, i32 0, i32 2
  %193 = load i32, ptr %192, align 8, !tbaa !24
  %194 = mul nsw i32 %190, %193
  %195 = sext i32 %194 to i64
  %196 = load ptr, ptr %7, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.envelope_lookup, ptr %196, i32 0, i32 11
  store i64 %195, ptr %197, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %198 = load ptr, ptr %3, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.vorbis_dsp_state, ptr %198, i32 0, i32 12
  %200 = load i64, ptr %199, align 8, !tbaa !37
  store i64 %200, ptr %14, align 8, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %201 = load i64, ptr %14, align 8, !tbaa !29
  %202 = load ptr, ptr %5, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.codec_setup_info, ptr %202, i32 0, i32 0
  %204 = load ptr, ptr %3, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.vorbis_dsp_state, ptr %204, i32 0, i32 10
  %206 = load i64, ptr %205, align 8, !tbaa !38
  %207 = getelementptr inbounds [2 x i64], ptr %203, i64 0, i64 %206
  %208 = load i64, ptr %207, align 8, !tbaa !29
  %209 = sdiv i64 %208, 4
  %210 = add nsw i64 %201, %209
  %211 = load ptr, ptr %5, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.codec_setup_info, ptr %211, i32 0, i32 0
  %213 = getelementptr inbounds [2 x i64], ptr %212, i64 0, i64 1
  %214 = load i64, ptr %213, align 8, !tbaa !29
  %215 = sdiv i64 %214, 2
  %216 = add nsw i64 %210, %215
  %217 = load ptr, ptr %5, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.codec_setup_info, ptr %217, i32 0, i32 0
  %219 = getelementptr inbounds [2 x i64], ptr %218, i64 0, i64 0
  %220 = load i64, ptr %219, align 8, !tbaa !29
  %221 = sdiv i64 %220, 4
  %222 = add nsw i64 %216, %221
  store i64 %222, ptr %15, align 8, !tbaa !29
  %223 = load ptr, ptr %7, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.envelope_lookup, ptr %223, i32 0, i32 13
  %225 = load i64, ptr %224, align 8, !tbaa !39
  store i64 %225, ptr %9, align 8, !tbaa !29
  br label %226

226:                                              ; preds = %272, %189
  %227 = load i64, ptr %9, align 8, !tbaa !29
  %228 = load ptr, ptr %7, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.envelope_lookup, ptr %228, i32 0, i32 11
  %230 = load i64, ptr %229, align 8, !tbaa !20
  %231 = load ptr, ptr %7, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.envelope_lookup, ptr %231, i32 0, i32 2
  %233 = load i32, ptr %232, align 8, !tbaa !24
  %234 = sext i32 %233 to i64
  %235 = sub nsw i64 %230, %234
  %236 = icmp slt i64 %227, %235
  br i1 %236, label %237, label %279

237:                                              ; preds = %226
  %238 = load i64, ptr %9, align 8, !tbaa !29
  %239 = load i64, ptr %15, align 8, !tbaa !29
  %240 = icmp sge i64 %238, %239
  br i1 %240, label %241, label %242

241:                                              ; preds = %237
  store i64 1, ptr %2, align 8
  store i32 1, ptr %16, align 4
  br label %280

242:                                              ; preds = %237
  %243 = load i64, ptr %9, align 8, !tbaa !29
  %244 = load ptr, ptr %7, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.envelope_lookup, ptr %244, i32 0, i32 13
  store i64 %243, ptr %245, align 8, !tbaa !39
  %246 = load ptr, ptr %7, align 8, !tbaa !5
  %247 = getelementptr inbounds %struct.envelope_lookup, ptr %246, i32 0, i32 9
  %248 = load ptr, ptr %247, align 8, !tbaa !28
  %249 = load i64, ptr %9, align 8, !tbaa !29
  %250 = load ptr, ptr %7, align 8, !tbaa !5
  %251 = getelementptr inbounds %struct.envelope_lookup, ptr %250, i32 0, i32 2
  %252 = load i32, ptr %251, align 8, !tbaa !24
  %253 = sext i32 %252 to i64
  %254 = sdiv i64 %249, %253
  %255 = getelementptr inbounds i32, ptr %248, i64 %254
  %256 = load i32, ptr %255, align 4, !tbaa !25
  %257 = icmp ne i32 %256, 0
  br i1 %257, label %258, label %272

258:                                              ; preds = %242
  %259 = load i64, ptr %9, align 8, !tbaa !29
  %260 = load i64, ptr %14, align 8, !tbaa !29
  %261 = icmp sgt i64 %259, %260
  br i1 %261, label %262, label %271

262:                                              ; preds = %258
  %263 = load i64, ptr %9, align 8, !tbaa !29
  %264 = load ptr, ptr %7, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct.envelope_lookup, ptr %264, i32 0, i32 12
  store i64 %263, ptr %265, align 8, !tbaa !40
  %266 = load i64, ptr %9, align 8, !tbaa !29
  %267 = load i64, ptr %15, align 8, !tbaa !29
  %268 = icmp sge i64 %266, %267
  br i1 %268, label %269, label %270

269:                                              ; preds = %262
  store i64 1, ptr %2, align 8
  store i32 1, ptr %16, align 4
  br label %280

270:                                              ; preds = %262
  store i64 0, ptr %2, align 8
  store i32 1, ptr %16, align 4
  br label %280

271:                                              ; preds = %258
  br label %272

272:                                              ; preds = %271, %242
  %273 = load ptr, ptr %7, align 8, !tbaa !5
  %274 = getelementptr inbounds %struct.envelope_lookup, ptr %273, i32 0, i32 2
  %275 = load i32, ptr %274, align 8, !tbaa !24
  %276 = sext i32 %275 to i64
  %277 = load i64, ptr %9, align 8, !tbaa !29
  %278 = add nsw i64 %277, %276
  store i64 %278, ptr %9, align 8, !tbaa !29
  br label %226, !llvm.loop !41

279:                                              ; preds = %226
  store i32 0, ptr %16, align 4
  br label %280

280:                                              ; preds = %279, %270, %269, %241
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  %281 = load i32, ptr %16, align 4
  switch i32 %281, label %283 [
    i32 0, label %282
  ]

282:                                              ; preds = %280
  store i64 -1, ptr %2, align 8
  store i32 1, ptr %16, align 4
  br label %283

283:                                              ; preds = %282, %280
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  %284 = load i64, ptr %2, align 8
  ret i64 %284
}

; Function Attrs: nounwind allocsize(1)
declare ptr @realloc(ptr noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @_ve_amp(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { nounwind allocsize(1) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
attributes #4 = { nounwind allocsize(1) }

!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/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"vorbis_dsp_state", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !12, i64 128, !6, i64 136}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !6, i64 48}
!14 = !{!"vorbis_info", !11, i64 0, !11, i64 4, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !6, i64 48}
!15 = !{!10, !6, i64 136}
!16 = !{!17, !6, i64 0}
!17 = !{!"private_state", !6, i64 0, !7, i64 8, !7, i64 16, !7, i64 32, !11, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !18, i64 144, !12, i64 224}
!18 = !{!"bitrate_manager_state", !11, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !19, i64 56, !6, i64 64, !11, i64 72}
!19 = !{!"double", !7, i64 0}
!20 = !{!21, !12, i64 256}
!21 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !22, i64 12, !23, i64 16, !6, i64 48, !7, i64 56, !6, i64 224, !11, i64 232, !6, i64 240, !12, i64 248, !12, i64 256, !12, i64 264, !12, i64 272}
!22 = !{!"float", !7, i64 0}
!23 = !{!"", !11, i64 0, !11, i64 4, !6, i64 8, !6, i64 16, !22, i64 24}
!24 = !{!21, !11, i64 8}
!25 = !{!11, !11, i64 0}
!26 = !{!10, !11, i64 36}
!27 = !{!21, !12, i64 248}
!28 = !{!21, !6, i64 240}
!29 = !{!12, !12, i64 0}
!30 = !{!21, !11, i64 232}
!31 = !{!21, !11, i64 0}
!32 = !{!10, !6, i64 16}
!33 = !{!21, !6, i64 224}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}
!36 = distinct !{!36, !35}
!37 = !{!10, !12, i64 80}
!38 = !{!10, !12, i64 64}
!39 = !{!21, !12, i64 272}
!40 = !{!21, !12, i64 264}
!41 = distinct !{!41, !35}


; 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: nounwind uwtable
define dso_local noundef i64 @_ve_envelope_search(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 8
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %3, i64 48
  %5 = load ptr, ptr %4, align 8, !tbaa !12
  %6 = getelementptr inbounds i8, ptr %5, i64 4944
  %7 = getelementptr inbounds i8, ptr %0, i64 136
  %8 = load ptr, ptr %7, align 8, !tbaa !14
  %9 = load ptr, ptr %8, align 8, !tbaa !15
  %10 = getelementptr inbounds i8, ptr %9, i64 256
  %11 = load i64, ptr %10, align 8, !tbaa !19
  %12 = getelementptr inbounds i8, ptr %9, i64 8
  %13 = load i32, ptr %12, align 8, !tbaa !23
  %14 = sext i32 %13 to i64
  %15 = sdiv i64 %11, %14
  %16 = trunc i64 %15 to i32
  %17 = getelementptr inbounds i8, ptr %0, i64 36
  %18 = load i32, ptr %17, align 4, !tbaa !24
  %19 = sdiv i32 %18, %13
  %20 = add i32 %19, -4
  %spec.store.select = tail call i32 @llvm.smax.i32(i32 %16, i32 0)
  %21 = add nsw i32 %19, 2
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds i8, ptr %9, i64 248
  %24 = load i64, ptr %23, align 8, !tbaa !25
  %25 = icmp slt i64 %24, %22
  br i1 %25, label %26, label %31

26:                                               ; preds = %1
  store i64 %22, ptr %23, align 8, !tbaa !25
  %27 = getelementptr inbounds i8, ptr %9, i64 240
  %28 = load ptr, ptr %27, align 8, !tbaa !26
  %29 = shl nsw i64 %22, 2
  %30 = tail call ptr @realloc(ptr noundef %28, i64 noundef %29) #3
  store ptr %30, ptr %27, align 8, !tbaa !26
  br label %31

31:                                               ; preds = %26, %1
  %32 = sext i32 %20 to i64
  %33 = icmp slt i32 %spec.store.select, %20
  br i1 %33, label %.lr.ph99, label %._crit_edge100

.lr.ph99:                                         ; preds = %31
  %34 = zext nneg i32 %spec.store.select to i64
  %35 = getelementptr inbounds i8, ptr %9, i64 232
  %36 = getelementptr inbounds i8, ptr %0, i64 16
  %37 = getelementptr inbounds i8, ptr %9, i64 56
  %38 = getelementptr inbounds i8, ptr %9, i64 224
  %39 = getelementptr inbounds i8, ptr %9, i64 240
  br label %40

40:                                               ; preds = %.lr.ph99, %77
  %.08397 = phi i64 [ %34, %.lr.ph99 ], [ %78, %77 ]
  %41 = load i32, ptr %35, align 8, !tbaa !27
  %42 = add nsw i32 %41, 1
  %.inv = icmp slt i32 %41, 24
  %spec.select = select i1 %.inv, i32 %42, i32 24
  store i32 %spec.select, ptr %35, align 8, !tbaa !27
  %43 = load i32, ptr %9, align 8, !tbaa !28
  %44 = icmp sgt i32 %43, 0
  br i1 %44, label %.lr.ph, label %.thread115

.thread115:                                       ; preds = %40
  %45 = load ptr, ptr %39, align 8, !tbaa !26
  %46 = getelementptr inbounds i32, ptr %45, i64 %.08397
  %47 = getelementptr inbounds i8, ptr %46, i64 8
  store i32 0, ptr %47, align 4, !tbaa !29
  br label %77

.lr.ph:                                           ; preds = %40, %.lr.ph
  %.08296 = phi i64 [ %59, %.lr.ph ], [ 0, %40 ]
  %.08595 = phi i32 [ %58, %.lr.ph ], [ 0, %40 ]
  %48 = load ptr, ptr %36, align 8, !tbaa !30
  %49 = getelementptr inbounds ptr, ptr %48, i64 %.08296
  %50 = load ptr, ptr %49, align 8, !tbaa !31
  %51 = load i32, ptr %12, align 8, !tbaa !23
  %52 = sext i32 %51 to i64
  %53 = mul nsw i64 %.08397, %52
  %54 = getelementptr inbounds float, ptr %50, i64 %53
  %55 = load ptr, ptr %38, align 8, !tbaa !32
  %.idx = mul nuw nsw i64 %.08296, 1008
  %56 = getelementptr inbounds i8, ptr %55, i64 %.idx
  %57 = tail call i32 @_ve_amp(ptr noundef nonnull %9, ptr noundef nonnull %6, ptr noundef %54, ptr noundef nonnull %37, ptr noundef %56)
  %58 = or i32 %57, %.08595
  %59 = add nuw nsw i64 %.08296, 1
  %60 = load i32, ptr %9, align 8, !tbaa !28
  %61 = sext i32 %60 to i64
  %62 = icmp slt i64 %59, %61
  br i1 %62, label %.lr.ph, label %._crit_edge, !llvm.loop !33

._crit_edge:                                      ; preds = %.lr.ph
  %63 = load ptr, ptr %39, align 8, !tbaa !26
  %64 = getelementptr inbounds i32, ptr %63, i64 %.08397
  %65 = getelementptr inbounds i8, ptr %64, i64 8
  store i32 0, ptr %65, align 4, !tbaa !29
  %66 = and i32 %58, 1
  %.not89 = icmp eq i32 %66, 0
  br i1 %.not89, label %69, label %67

67:                                               ; preds = %._crit_edge
  store i32 1, ptr %64, align 4, !tbaa !29
  %68 = getelementptr inbounds i8, ptr %64, i64 4
  store i32 1, ptr %68, align 4, !tbaa !29
  br label %69

69:                                               ; preds = %67, %._crit_edge
  %70 = and i32 %58, 2
  %.not90 = icmp eq i32 %70, 0
  br i1 %.not90, label %74, label %71

71:                                               ; preds = %69
  store i32 1, ptr %64, align 4, !tbaa !29
  %.not91 = icmp eq i64 %.08397, 0
  br i1 %.not91, label %74, label %72

72:                                               ; preds = %71
  %73 = getelementptr i8, ptr %64, i64 -4
  store i32 1, ptr %73, align 4, !tbaa !29
  br label %74

74:                                               ; preds = %71, %72, %69
  %75 = and i32 %58, 4
  %.not92 = icmp eq i32 %75, 0
  br i1 %.not92, label %77, label %76

76:                                               ; preds = %74
  store i32 -1, ptr %35, align 8, !tbaa !27
  br label %77

77:                                               ; preds = %.thread115, %76, %74
  %78 = add nuw nsw i64 %.08397, 1
  %exitcond.not = icmp eq i64 %78, %32
  br i1 %exitcond.not, label %._crit_edge100, label %40, !llvm.loop !35

._crit_edge100:                                   ; preds = %77, %31
  %79 = load i32, ptr %12, align 8, !tbaa !23
  %80 = mul nsw i32 %79, %20
  %81 = sext i32 %80 to i64
  store i64 %81, ptr %10, align 8, !tbaa !19
  %82 = getelementptr inbounds i8, ptr %0, i64 80
  %83 = load i64, ptr %82, align 8, !tbaa !36
  %84 = getelementptr inbounds i8, ptr %0, i64 64
  %85 = load i64, ptr %84, align 8, !tbaa !37
  %86 = getelementptr inbounds [2 x i64], ptr %5, i64 0, i64 %85
  %87 = load i64, ptr %86, align 8, !tbaa !38
  %88 = sdiv i64 %87, 4
  %89 = add nsw i64 %88, %83
  %90 = getelementptr inbounds i8, ptr %5, i64 8
  %91 = load i64, ptr %90, align 8, !tbaa !38
  %92 = sdiv i64 %91, 2
  %93 = add nsw i64 %89, %92
  %94 = load i64, ptr %5, align 8, !tbaa !38
  %95 = sdiv i64 %94, 4
  %96 = add nsw i64 %93, %95
  %97 = getelementptr inbounds i8, ptr %9, i64 272
  %98 = load i64, ptr %97, align 8, !tbaa !39
  %99 = sext i32 %79 to i64
  %100 = sub nsw i64 %81, %99
  %.not88101 = icmp slt i64 %98, %100
  br i1 %.not88101, label %.lr.ph104, label %.loopexit

.lr.ph104:                                        ; preds = %._crit_edge100
  %101 = getelementptr inbounds i8, ptr %9, i64 240
  br label %102

102:                                              ; preds = %.lr.ph104, %111
  %.184102 = phi i64 [ %98, %.lr.ph104 ], [ %112, %111 ]
  %.not = icmp slt i64 %.184102, %96
  br i1 %.not, label %103, label %.loopexit

103:                                              ; preds = %102
  store i64 %.184102, ptr %97, align 8, !tbaa !39
  %104 = load ptr, ptr %101, align 8, !tbaa !26
  %105 = sdiv i64 %.184102, %99
  %106 = getelementptr inbounds i32, ptr %104, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !29
  %.not87 = icmp ne i32 %107, 0
  %108 = icmp sgt i64 %.184102, %83
  %or.cond = select i1 %.not87, i1 %108, i1 false
  br i1 %or.cond, label %109, label %111

109:                                              ; preds = %103
  %110 = getelementptr inbounds i8, ptr %9, i64 264
  store i64 %.184102, ptr %110, align 8, !tbaa !40
  br label %.loopexit

111:                                              ; preds = %103
  %112 = add nsw i64 %.184102, %99
  %.not88 = icmp slt i64 %112, %100
  br i1 %.not88, label %102, label %.loopexit, !llvm.loop !41

.loopexit:                                        ; preds = %102, %111, %._crit_edge100, %109
  %spec.select93 = phi i64 [ 0, %109 ], [ -1, %._crit_edge100 ], [ 1, %102 ], [ -1, %111 ]
  ret i64 %spec.select93
}

; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @_ve_amp(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #2

attributes #0 = { 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 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nounwind allocsize(1) }

!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, !10, i64 8}
!6 = !{!"vorbis_dsp_state", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104, !11, i64 112, !11, i64 120, !11, i64 128, !10, i64 136}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!13, !10, i64 48}
!13 = !{!"vorbis_info", !7, i64 0, !7, i64 4, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !10, i64 48}
!14 = !{!6, !10, i64 136}
!15 = !{!16, !10, i64 0}
!16 = !{!"private_state", !10, i64 0, !8, i64 8, !8, i64 16, !8, i64 32, !7, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !17, i64 144, !11, i64 224}
!17 = !{!"bitrate_manager_state", !7, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !18, i64 56, !10, i64 64, !7, i64 72}
!18 = !{!"double", !8, i64 0}
!19 = !{!20, !11, i64 256}
!20 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !21, i64 12, !22, i64 16, !10, i64 48, !8, i64 56, !10, i64 224, !7, i64 232, !10, i64 240, !11, i64 248, !11, i64 256, !11, i64 264, !11, i64 272}
!21 = !{!"float", !8, i64 0}
!22 = !{!"", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16, !21, i64 24}
!23 = !{!20, !7, i64 8}
!24 = !{!6, !7, i64 36}
!25 = !{!20, !11, i64 248}
!26 = !{!20, !10, i64 240}
!27 = !{!20, !7, i64 232}
!28 = !{!20, !7, i64 0}
!29 = !{!7, !7, i64 0}
!30 = !{!6, !10, i64 16}
!31 = !{!10, !10, i64 0}
!32 = !{!20, !10, i64 224}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = distinct !{!35, !34}
!36 = !{!6, !11, i64 80}
!37 = !{!6, !11, i64 64}
!38 = !{!11, !11, i64 0}
!39 = !{!20, !11, i64 272}
!40 = !{!20, !11, i64 264}
!41 = distinct !{!41, !34}


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