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

; 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_block = type { ptr, %struct.oggpack_buffer, i64, i64, i64, i32, i32, i32, i64, i64, ptr, ptr, i64, i64, i64, ptr, i64, i64, i64, i64, ptr }
%struct.oggpack_buffer = type { i64, i32, ptr, ptr, i64 }
%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.ogg_packet = type { ptr, i64, i64, i64, i64, i64 }
%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.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.vorbis_info_mode = type { i32, i32, i32, i32 }
%struct.vorbis_func_mapping = type { ptr, ptr, ptr, ptr, ptr }

@_mapping_P = external constant [0 x ptr], align 8

; Function Attrs: nounwind uwtable
define dso_local i32 @vorbis_synthesis(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = icmp ne ptr %15, null
  br i1 %16, label %17, label %21

17:                                               ; preds = %2
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.vorbis_block, ptr %18, i32 0, i32 10
  %20 = load ptr, ptr %19, align 8, !tbaa !9
  br label %22

21:                                               ; preds = %2
  br label %22

22:                                               ; preds = %21, %17
  %23 = phi ptr [ %20, %17 ], [ null, %21 ]
  store ptr %23, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = icmp ne ptr %24, null
  br i1 %25, label %26, label %30

26:                                               ; preds = %22
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.vorbis_dsp_state, ptr %27, i32 0, i32 19
  %29 = load ptr, ptr %28, align 8, !tbaa !14
  br label %31

30:                                               ; preds = %22
  br label %31

31:                                               ; preds = %30, %26
  %32 = phi ptr [ %29, %26 ], [ null, %30 ]
  store ptr %32, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = icmp ne ptr %33, null
  br i1 %34, label %35, label %39

35:                                               ; preds = %31
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.vorbis_dsp_state, ptr %36, i32 0, i32 1
  %38 = load ptr, ptr %37, align 8, !tbaa !16
  br label %40

39:                                               ; preds = %31
  br label %40

40:                                               ; preds = %39, %35
  %41 = phi ptr [ %38, %35 ], [ null, %39 ]
  store ptr %41, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = icmp ne ptr %42, null
  br i1 %43, label %44, label %48

44:                                               ; preds = %40
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.vorbis_info, ptr %45, i32 0, i32 7
  %47 = load ptr, ptr %46, align 8, !tbaa !17
  br label %49

48:                                               ; preds = %40
  br label %49

49:                                               ; preds = %48, %44
  %50 = phi ptr [ %47, %44 ], [ null, %48 ]
  store ptr %50, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = icmp ne ptr %51, null
  br i1 %52, label %53, label %56

53:                                               ; preds = %49
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.vorbis_block, ptr %54, i32 0, i32 1
  br label %57

56:                                               ; preds = %49
  br label %57

57:                                               ; preds = %56, %53
  %58 = phi ptr [ %55, %53 ], [ null, %56 ]
  store ptr %58, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  %60 = icmp ne ptr %59, null
  br i1 %60, label %61, label %73

61:                                               ; preds = %57
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = icmp ne ptr %62, null
  br i1 %63, label %64, label %73

64:                                               ; preds = %61
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = icmp ne ptr %65, null
  br i1 %66, label %67, label %73

67:                                               ; preds = %64
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  %69 = icmp ne ptr %68, null
  br i1 %69, label %70, label %73

70:                                               ; preds = %67
  %71 = load ptr, ptr %10, align 8, !tbaa !5
  %72 = icmp ne ptr %71, null
  br i1 %72, label %74, label %73

73:                                               ; preds = %70, %67, %64, %61, %57
  store i32 -136, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %240

74:                                               ; preds = %70
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_vorbis_block_ripcord(ptr noundef %75)
  %76 = load ptr, ptr %10, align 8, !tbaa !5
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.ogg_packet, ptr %77, i32 0, i32 0
  %79 = load ptr, ptr %78, align 8, !tbaa !19
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.ogg_packet, ptr %80, i32 0, i32 1
  %82 = load i64, ptr %81, align 8, !tbaa !21
  %83 = trunc i64 %82 to i32
  call void @oggpack_readinit(ptr noundef %76, ptr noundef %79, i32 noundef %83)
  %84 = load ptr, ptr %10, align 8, !tbaa !5
  %85 = call i64 @oggpack_read(ptr noundef %84, i32 noundef 1)
  %86 = icmp ne i64 %85, 0
  br i1 %86, label %87, label %88

87:                                               ; preds = %74
  store i32 -135, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %240

88:                                               ; preds = %74
  %89 = load ptr, ptr %10, align 8, !tbaa !5
  %90 = load ptr, ptr %7, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.private_state, ptr %90, i32 0, i32 4
  %92 = load i32, ptr %91, align 8, !tbaa !22
  %93 = call i64 @oggpack_read(ptr noundef %89, i32 noundef %92)
  %94 = trunc i64 %93 to i32
  store i32 %94, ptr %12, align 4, !tbaa !26
  %95 = load i32, ptr %12, align 4, !tbaa !26
  %96 = icmp eq i32 %95, -1
  br i1 %96, label %97, label %98

97:                                               ; preds = %88
  store i32 -136, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %240

98:                                               ; preds = %88
  %99 = load i32, ptr %12, align 4, !tbaa !26
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.vorbis_block, ptr %100, i32 0, i32 6
  store i32 %99, ptr %101, align 4, !tbaa !27
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.codec_setup_info, ptr %102, i32 0, i32 7
  %104 = load i32, ptr %12, align 4, !tbaa !26
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [64 x ptr], ptr %103, i64 0, i64 %105
  %107 = load ptr, ptr %106, align 8, !tbaa !5
  %108 = icmp ne ptr %107, null
  br i1 %108, label %110, label %109

109:                                              ; preds = %98
  store i32 -136, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %240

110:                                              ; preds = %98
  %111 = load ptr, ptr %9, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.codec_setup_info, ptr %111, i32 0, i32 7
  %113 = load i32, ptr %12, align 4, !tbaa !26
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [64 x ptr], ptr %112, i64 0, i64 %114
  %116 = load ptr, ptr %115, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.vorbis_info_mode, ptr %116, i32 0, i32 0
  %118 = load i32, ptr %117, align 4, !tbaa !28
  %119 = sext i32 %118 to i64
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.vorbis_block, ptr %120, i32 0, i32 3
  store i64 %119, ptr %121, align 8, !tbaa !30
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.vorbis_block, ptr %122, i32 0, i32 3
  %124 = load i64, ptr %123, align 8, !tbaa !30
  %125 = icmp ne i64 %124, 0
  br i1 %125, label %126, label %141

126:                                              ; preds = %110
  %127 = load ptr, ptr %10, align 8, !tbaa !5
  %128 = call i64 @oggpack_read(ptr noundef %127, i32 noundef 1)
  %129 = load ptr, ptr %4, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.vorbis_block, ptr %129, i32 0, i32 2
  store i64 %128, ptr %130, align 8, !tbaa !31
  %131 = load ptr, ptr %10, align 8, !tbaa !5
  %132 = call i64 @oggpack_read(ptr noundef %131, i32 noundef 1)
  %133 = load ptr, ptr %4, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.vorbis_block, ptr %133, i32 0, i32 4
  store i64 %132, ptr %134, align 8, !tbaa !32
  %135 = load ptr, ptr %4, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.vorbis_block, ptr %135, i32 0, i32 4
  %137 = load i64, ptr %136, align 8, !tbaa !32
  %138 = icmp eq i64 %137, -1
  br i1 %138, label %139, label %140

139:                                              ; preds = %126
  store i32 -136, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %240

140:                                              ; preds = %126
  br label %146

141:                                              ; preds = %110
  %142 = load ptr, ptr %4, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.vorbis_block, ptr %142, i32 0, i32 2
  store i64 0, ptr %143, align 8, !tbaa !31
  %144 = load ptr, ptr %4, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.vorbis_block, ptr %144, i32 0, i32 4
  store i64 0, ptr %145, align 8, !tbaa !32
  br label %146

146:                                              ; preds = %141, %140
  %147 = load ptr, ptr %5, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.ogg_packet, ptr %147, i32 0, i32 4
  %149 = load i64, ptr %148, align 8, !tbaa !33
  %150 = load ptr, ptr %4, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.vorbis_block, ptr %150, i32 0, i32 8
  store i64 %149, ptr %151, align 8, !tbaa !34
  %152 = load ptr, ptr %5, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.ogg_packet, ptr %152, i32 0, i32 5
  %154 = load i64, ptr %153, align 8, !tbaa !35
  %155 = load ptr, ptr %4, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.vorbis_block, ptr %155, i32 0, i32 9
  store i64 %154, ptr %156, align 8, !tbaa !36
  %157 = load ptr, ptr %5, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.ogg_packet, ptr %157, i32 0, i32 3
  %159 = load i64, ptr %158, align 8, !tbaa !37
  %160 = trunc i64 %159 to i32
  %161 = load ptr, ptr %4, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.vorbis_block, ptr %161, i32 0, i32 7
  store i32 %160, ptr %162, align 8, !tbaa !38
  %163 = load ptr, ptr %9, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.codec_setup_info, ptr %163, i32 0, i32 0
  %165 = load ptr, ptr %4, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.vorbis_block, ptr %165, i32 0, i32 3
  %167 = load i64, ptr %166, align 8, !tbaa !30
  %168 = getelementptr inbounds [2 x i64], ptr %164, i64 0, i64 %167
  %169 = load i64, ptr %168, align 8, !tbaa !39
  %170 = trunc i64 %169 to i32
  %171 = load ptr, ptr %4, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.vorbis_block, ptr %171, i32 0, i32 5
  store i32 %170, ptr %172, align 8, !tbaa !40
  %173 = load ptr, ptr %4, align 8, !tbaa !5
  %174 = load ptr, ptr %8, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.vorbis_info, ptr %174, i32 0, i32 1
  %176 = load i32, ptr %175, align 4, !tbaa !41
  %177 = sext i32 %176 to i64
  %178 = mul i64 8, %177
  %179 = call ptr @_vorbis_block_alloc(ptr noundef %173, i64 noundef %178)
  %180 = load ptr, ptr %4, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.vorbis_block, ptr %180, i32 0, i32 0
  store ptr %179, ptr %181, align 8, !tbaa !42
  store i32 0, ptr %13, align 4, !tbaa !26
  br label %182

182:                                              ; preds = %202, %146
  %183 = load i32, ptr %13, align 4, !tbaa !26
  %184 = load ptr, ptr %8, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.vorbis_info, ptr %184, i32 0, i32 1
  %186 = load i32, ptr %185, align 4, !tbaa !41
  %187 = icmp slt i32 %183, %186
  br i1 %187, label %188, label %205

188:                                              ; preds = %182
  %189 = load ptr, ptr %4, align 8, !tbaa !5
  %190 = load ptr, ptr %4, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.vorbis_block, ptr %190, i32 0, i32 5
  %192 = load i32, ptr %191, align 8, !tbaa !40
  %193 = sext i32 %192 to i64
  %194 = mul i64 %193, 4
  %195 = call ptr @_vorbis_block_alloc(ptr noundef %189, i64 noundef %194)
  %196 = load ptr, ptr %4, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.vorbis_block, ptr %196, i32 0, i32 0
  %198 = load ptr, ptr %197, align 8, !tbaa !42
  %199 = load i32, ptr %13, align 4, !tbaa !26
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds ptr, ptr %198, i64 %200
  store ptr %195, ptr %201, align 8, !tbaa !5
  br label %202

202:                                              ; preds = %188
  %203 = load i32, ptr %13, align 4, !tbaa !26
  %204 = add nsw i32 %203, 1
  store i32 %204, ptr %13, align 4, !tbaa !26
  br label %182, !llvm.loop !43

205:                                              ; preds = %182
  %206 = load ptr, ptr %9, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.codec_setup_info, ptr %206, i32 0, i32 8
  %208 = load ptr, ptr %9, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.codec_setup_info, ptr %208, i32 0, i32 7
  %210 = load i32, ptr %12, align 4, !tbaa !26
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [64 x ptr], ptr %209, i64 0, i64 %211
  %213 = load ptr, ptr %212, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.vorbis_info_mode, ptr %213, i32 0, i32 3
  %215 = load i32, ptr %214, align 4, !tbaa !45
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [64 x i32], ptr %207, i64 0, i64 %216
  %218 = load i32, ptr %217, align 4, !tbaa !26
  store i32 %218, ptr %11, align 4, !tbaa !26
  %219 = load i32, ptr %11, align 4, !tbaa !26
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [0 x ptr], ptr @_mapping_P, i64 0, i64 %220
  %222 = load ptr, ptr %221, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.vorbis_func_mapping, ptr %222, i32 0, i32 4
  %224 = load ptr, ptr %223, align 8, !tbaa !46
  %225 = load ptr, ptr %4, align 8, !tbaa !5
  %226 = load ptr, ptr %9, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.codec_setup_info, ptr %226, i32 0, i32 9
  %228 = load ptr, ptr %9, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.codec_setup_info, ptr %228, i32 0, i32 7
  %230 = load i32, ptr %12, align 4, !tbaa !26
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [64 x ptr], ptr %229, i64 0, i64 %231
  %233 = load ptr, ptr %232, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.vorbis_info_mode, ptr %233, i32 0, i32 3
  %235 = load i32, ptr %234, align 4, !tbaa !45
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [64 x ptr], ptr %227, i64 0, i64 %236
  %238 = load ptr, ptr %237, align 8, !tbaa !5
  %239 = call i32 %224(ptr noundef %225, ptr noundef %238)
  store i32 %239, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %240

240:                                              ; preds = %205, %139, %109, %97, %87, %73
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, 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
  %241 = load i32, ptr %3, align 4
  ret i32 %241
}

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

declare void @_vorbis_block_ripcord(ptr noundef) #2

declare void @oggpack_readinit(ptr noundef, ptr noundef, i32 noundef) #2

declare i64 @oggpack_read(ptr noundef, i32 noundef) #2

declare ptr @_vorbis_block_alloc(ptr noundef, i64 noundef) #2

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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/C++ TBAA"}
!9 = !{!10, !6, i64 104}
!10 = !{!"vorbis_block", !6, i64 0, !11, i64 8, !12, i64 48, !12, i64 56, !12, i64 64, !13, i64 72, !13, i64 76, !13, i64 80, !12, i64 88, !12, i64 96, !6, i64 104, !6, i64 112, !12, i64 120, !12, i64 128, !12, i64 136, !6, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !12, i64 176, !6, i64 184}
!11 = !{!"", !12, i64 0, !13, i64 8, !6, i64 16, !6, i64 24, !12, i64 32}
!12 = !{!"long", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !6, i64 136}
!15 = !{!"vorbis_dsp_state", !13, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !13, 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}
!16 = !{!15, !6, i64 8}
!17 = !{!18, !6, i64 48}
!18 = !{!"vorbis_info", !13, i64 0, !13, i64 4, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !6, i64 48}
!19 = !{!20, !6, i64 0}
!20 = !{!"", !6, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40}
!21 = !{!20, !12, i64 8}
!22 = !{!23, !13, i64 80}
!23 = !{!"private_state", !6, i64 0, !7, i64 8, !7, i64 16, !7, i64 32, !13, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !24, i64 144, !12, i64 224}
!24 = !{!"bitrate_manager_state", !13, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !25, i64 56, !6, i64 64, !13, i64 72}
!25 = !{!"double", !7, i64 0}
!26 = !{!13, !13, i64 0}
!27 = !{!10, !13, i64 76}
!28 = !{!29, !13, i64 0}
!29 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12}
!30 = !{!10, !12, i64 56}
!31 = !{!10, !12, i64 48}
!32 = !{!10, !12, i64 64}
!33 = !{!20, !12, i64 32}
!34 = !{!10, !12, i64 88}
!35 = !{!20, !12, i64 40}
!36 = !{!10, !12, i64 96}
!37 = !{!20, !12, i64 24}
!38 = !{!10, !13, i64 80}
!39 = !{!12, !12, i64 0}
!40 = !{!10, !13, i64 72}
!41 = !{!18, !13, i64 4}
!42 = !{!10, !6, i64 0}
!43 = distinct !{!43, !44}
!44 = !{!"llvm.loop.mustprogress"}
!45 = !{!29, !13, i64 12}
!46 = !{!47, !6, i64 32}
!47 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}


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

@_mapping_P = external local_unnamed_addr constant [0 x ptr], align 8

; Function Attrs: nounwind uwtable
define dso_local i32 @vorbis_synthesis(ptr noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = icmp ne ptr %0, null
  br i1 %3, label %4, label %.thread85.thread

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %0, i64 104
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %.not86 = icmp eq ptr %6, null
  br i1 %.not86, label %.thread85.thread, label %7

7:                                                ; preds = %4
  %8 = getelementptr inbounds i8, ptr %6, i64 136
  %9 = load ptr, ptr %8, align 8, !tbaa !13
  %10 = getelementptr inbounds i8, ptr %6, i64 8
  %11 = load ptr, ptr %10, align 8, !tbaa !15
  %.not87 = icmp eq ptr %11, null
  br i1 %.not87, label %.thread85.thread, label %.thread85

.thread85:                                        ; preds = %7
  %12 = getelementptr inbounds i8, ptr %11, i64 48
  %13 = load ptr, ptr %12, align 8, !tbaa !16
  %14 = getelementptr inbounds i8, ptr %0, i64 8
  %15 = icmp ne ptr %9, null
  %16 = icmp ne ptr %13, null
  %or.cond5 = select i1 %15, i1 %16, i1 false
  %or.cond7 = and i1 %3, %or.cond5
  br i1 %or.cond7, label %17, label %.thread85.thread

17:                                               ; preds = %.thread85
  tail call void @_vorbis_block_ripcord(ptr noundef nonnull %0) #2
  %18 = load ptr, ptr %1, align 8, !tbaa !18
  %19 = getelementptr inbounds i8, ptr %1, i64 8
  %20 = load i64, ptr %19, align 8, !tbaa !20
  %21 = trunc i64 %20 to i32
  tail call void @oggpack_readinit(ptr noundef nonnull %14, ptr noundef %18, i32 noundef %21) #2
  %22 = tail call i64 @oggpack_read(ptr noundef nonnull %14, i32 noundef 1) #2
  %.not = icmp eq i64 %22, 0
  br i1 %.not, label %23, label %.thread85.thread

23:                                               ; preds = %17
  %24 = getelementptr inbounds i8, ptr %9, i64 80
  %25 = load i32, ptr %24, align 8, !tbaa !21
  %26 = tail call i64 @oggpack_read(ptr noundef nonnull %14, i32 noundef %25) #2
  %27 = trunc i64 %26 to i32
  %28 = icmp eq i32 %27, -1
  br i1 %28, label %.thread85.thread, label %29

29:                                               ; preds = %23
  %30 = getelementptr inbounds i8, ptr %0, i64 76
  store i32 %27, ptr %30, align 4, !tbaa !25
  %31 = getelementptr inbounds i8, ptr %13, i64 40
  %sext = shl i64 %26, 32
  %32 = ashr exact i64 %sext, 32
  %33 = getelementptr inbounds [64 x ptr], ptr %31, i64 0, i64 %32
  %34 = load ptr, ptr %33, align 8, !tbaa !26
  %.not81 = icmp eq ptr %34, null
  br i1 %.not81, label %.thread85.thread, label %35

35:                                               ; preds = %29
  %36 = load i32, ptr %34, align 4, !tbaa !27
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds i8, ptr %0, i64 56
  store i64 %37, ptr %38, align 8, !tbaa !29
  %.not82 = icmp eq i32 %36, 0
  br i1 %.not82, label %45, label %39

39:                                               ; preds = %35
  %40 = tail call i64 @oggpack_read(ptr noundef nonnull %14, i32 noundef 1) #2
  %41 = getelementptr inbounds i8, ptr %0, i64 48
  store i64 %40, ptr %41, align 8, !tbaa !30
  %42 = tail call i64 @oggpack_read(ptr noundef nonnull %14, i32 noundef 1) #2
  %43 = getelementptr inbounds i8, ptr %0, i64 64
  store i64 %42, ptr %43, align 8, !tbaa !31
  %44 = icmp eq i64 %42, -1
  br i1 %44, label %.thread85.thread, label %._crit_edge90

._crit_edge90:                                    ; preds = %39
  %.pre = load i64, ptr %38, align 8, !tbaa !29
  br label %48

45:                                               ; preds = %35
  %46 = getelementptr inbounds i8, ptr %0, i64 48
  store i64 0, ptr %46, align 8, !tbaa !30
  %47 = getelementptr inbounds i8, ptr %0, i64 64
  store i64 0, ptr %47, align 8, !tbaa !31
  br label %48

48:                                               ; preds = %._crit_edge90, %45
  %49 = phi i64 [ %.pre, %._crit_edge90 ], [ 0, %45 ]
  %50 = getelementptr inbounds i8, ptr %1, i64 32
  %51 = getelementptr inbounds i8, ptr %0, i64 88
  %52 = load <2 x i64>, ptr %50, align 8, !tbaa !32
  store <2 x i64> %52, ptr %51, align 8, !tbaa !32
  %53 = getelementptr inbounds i8, ptr %1, i64 24
  %54 = load i64, ptr %53, align 8, !tbaa !33
  %55 = trunc i64 %54 to i32
  %56 = getelementptr inbounds i8, ptr %0, i64 80
  store i32 %55, ptr %56, align 8, !tbaa !34
  %57 = getelementptr inbounds [2 x i64], ptr %13, i64 0, i64 %49
  %58 = load i64, ptr %57, align 8, !tbaa !32
  %59 = trunc i64 %58 to i32
  %60 = getelementptr inbounds i8, ptr %0, i64 72
  store i32 %59, ptr %60, align 8, !tbaa !35
  %61 = getelementptr inbounds i8, ptr %11, i64 4
  %62 = load i32, ptr %61, align 4, !tbaa !36
  %63 = sext i32 %62 to i64
  %64 = shl nsw i64 %63, 3
  %65 = tail call ptr @_vorbis_block_alloc(ptr noundef nonnull %0, i64 noundef %64) #2
  store ptr %65, ptr %0, align 8, !tbaa !37
  %66 = load i32, ptr %61, align 4, !tbaa !36
  %67 = icmp sgt i32 %66, 0
  br i1 %67, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %48, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %48 ]
  %68 = load i32, ptr %60, align 8, !tbaa !35
  %69 = sext i32 %68 to i64
  %70 = shl nsw i64 %69, 2
  %71 = tail call ptr @_vorbis_block_alloc(ptr noundef nonnull %0, i64 noundef %70) #2
  %72 = load ptr, ptr %0, align 8, !tbaa !37
  %73 = getelementptr inbounds ptr, ptr %72, i64 %indvars.iv
  store ptr %71, ptr %73, align 8, !tbaa !26
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %74 = load i32, ptr %61, align 4, !tbaa !36
  %75 = sext i32 %74 to i64
  %76 = icmp slt i64 %indvars.iv.next, %75
  br i1 %76, label %.lr.ph, label %._crit_edge, !llvm.loop !38

._crit_edge:                                      ; preds = %.lr.ph, %48
  %77 = getelementptr inbounds i8, ptr %13, i64 552
  %78 = load ptr, ptr %33, align 8, !tbaa !26
  %79 = getelementptr inbounds i8, ptr %78, i64 12
  %80 = load i32, ptr %79, align 4, !tbaa !40
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [64 x i32], ptr %77, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !41
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [0 x ptr], ptr @_mapping_P, i64 0, i64 %84
  %86 = load ptr, ptr %85, align 8, !tbaa !26
  %87 = getelementptr inbounds i8, ptr %86, i64 32
  %88 = load ptr, ptr %87, align 8, !tbaa !42
  %89 = getelementptr inbounds i8, ptr %13, i64 808
  %90 = getelementptr inbounds [64 x ptr], ptr %89, i64 0, i64 %81
  %91 = load ptr, ptr %90, align 8, !tbaa !26
  %92 = tail call i32 %88(ptr noundef nonnull %0, ptr noundef %91) #2
  br label %.thread85.thread

.thread85.thread:                                 ; preds = %4, %7, %2, %39, %29, %23, %17, %.thread85, %._crit_edge
  %.072 = phi i32 [ %92, %._crit_edge ], [ -136, %.thread85 ], [ -135, %17 ], [ -136, %23 ], [ -136, %29 ], [ -136, %39 ], [ -136, %2 ], [ -136, %7 ], [ -136, %4 ]
  ret i32 %.072
}

declare void @_vorbis_block_ripcord(ptr noundef) local_unnamed_addr #1

declare void @oggpack_readinit(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

declare i64 @oggpack_read(ptr noundef, i32 noundef) local_unnamed_addr #1

declare ptr @_vorbis_block_alloc(ptr noundef, i64 noundef) local_unnamed_addr #1

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 = { "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 }

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


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