; LLVM IR from clangen/musikcube :: src/plugins/stockencoders (LameEncoder)

; 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.LameEncoder = type { %"class.musik::core::sdk::IStreamingEncoder", %struct.DataBuffer, %struct.DataBuffer.0, ptr }
%"class.musik::core::sdk::IStreamingEncoder" = type { %"class.musik::core::sdk::IEncoder" }
%"class.musik::core::sdk::IEncoder" = type { ptr }
%struct.DataBuffer = type { ptr, i64, i64, i64 }
%struct.DataBuffer.0 = type { ptr, i64, i64, i64 }

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN11LameEncoder6EncodeEPKN5musik4core3sdk7IBufferEPPc(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef %1, ptr noundef %2) unnamed_addr #0 align 2 {
  %4 = alloca i32, align 4
  %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 i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %17 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  %20 = getelementptr inbounds ptr, ptr %19, i64 2
  %21 = load ptr, ptr %20, align 8
  %22 = call noundef i32 %21(ptr noundef nonnull align 8 dereferenceable(8) %18)
  %23 = sext i32 %22 to i64
  store i64 %23, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  %26 = getelementptr inbounds ptr, ptr %25, i64 5
  %27 = load ptr, ptr %26, align 8
  %28 = call noundef i64 %27(ptr noundef nonnull align 8 dereferenceable(8) %24)
  %29 = load i64, ptr %8, align 8, !tbaa !11
  %30 = udiv i64 %28, %29
  store i64 %30, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %31 = load i64, ptr %9, align 8, !tbaa !11
  %32 = uitofp i64 %31 to float
  %33 = fpext float %32 to double
  %34 = call double @llvm.fmuladd.f64(double 1.250000e+00, double %33, double 7.200000e+03)
  %35 = fptoui double %34 to i64
  store i64 %35, ptr %10, align 8, !tbaa !11
  %36 = getelementptr inbounds %class.LameEncoder, ptr %17, i32 0, i32 1
  %37 = load i64, ptr %10, align 8, !tbaa !11
  call void @_ZN10DataBufferIhE5resetEm(ptr noundef nonnull align 8 dereferenceable(32) %36, i64 noundef %37)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 -1, ptr %11, align 4, !tbaa !13
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = load ptr, ptr %38, align 8, !tbaa !9
  %40 = getelementptr inbounds ptr, ptr %39, i64 2
  %41 = load ptr, ptr %40, align 8
  %42 = call noundef i32 %41(ptr noundef nonnull align 8 dereferenceable(8) %38)
  %43 = icmp eq i32 %42, 2
  br i1 %43, label %44, label %62

44:                                               ; preds = %3
  %45 = getelementptr inbounds %class.LameEncoder, ptr %17, i32 0, i32 3
  %46 = load ptr, ptr %45, align 8, !tbaa !15
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = load ptr, ptr %47, align 8, !tbaa !9
  %49 = getelementptr inbounds ptr, ptr %48, i64 4
  %50 = load ptr, ptr %49, align 8
  %51 = call noundef ptr %50(ptr noundef nonnull align 8 dereferenceable(8) %47)
  %52 = load i64, ptr %9, align 8, !tbaa !11
  %53 = trunc i64 %52 to i32
  %54 = getelementptr inbounds %class.LameEncoder, ptr %17, i32 0, i32 1
  %55 = getelementptr inbounds %struct.DataBuffer, ptr %54, i32 0, i32 0
  %56 = load ptr, ptr %55, align 8, !tbaa !21
  %57 = getelementptr inbounds %class.LameEncoder, ptr %17, i32 0, i32 1
  %58 = getelementptr inbounds %struct.DataBuffer, ptr %57, i32 0, i32 2
  %59 = load i64, ptr %58, align 8, !tbaa !22
  %60 = trunc i64 %59 to i32
  %61 = call i32 @lame_encode_buffer_interleaved_ieee_float(ptr noundef %46, ptr noundef %51, i32 noundef %53, ptr noundef %56, i32 noundef %60)
  store i32 %61, ptr %11, align 4, !tbaa !13
  br label %141

62:                                               ; preds = %3
  %63 = getelementptr inbounds %class.LameEncoder, ptr %17, i32 0, i32 2
  %64 = load i64, ptr %9, align 8, !tbaa !11
  %65 = mul i64 %64, 2
  call void @_ZN10DataBufferIfE5resetEm(ptr noundef nonnull align 8 dereferenceable(32) %63, i64 noundef %65)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = load ptr, ptr %66, align 8, !tbaa !9
  %68 = getelementptr inbounds ptr, ptr %67, i64 4
  %69 = load ptr, ptr %68, align 8
  %70 = call noundef ptr %69(ptr noundef nonnull align 8 dereferenceable(8) %66)
  store ptr %70, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %71 = getelementptr inbounds %class.LameEncoder, ptr %17, i32 0, i32 2
  %72 = getelementptr inbounds %struct.DataBuffer.0, ptr %71, i32 0, i32 0
  %73 = load ptr, ptr %72, align 8, !tbaa !23
  store ptr %73, ptr %13, align 8, !tbaa !5
  %74 = load i64, ptr %8, align 8, !tbaa !11
  %75 = icmp eq i64 %74, 1
  br i1 %75, label %76, label %99

76:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  store i64 0, ptr %14, align 8, !tbaa !11
  br label %77

77:                                               ; preds = %95, %76
  %78 = load i64, ptr %14, align 8, !tbaa !11
  %79 = load i64, ptr %9, align 8, !tbaa !11
  %80 = icmp ult i64 %78, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %77
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %98

82:                                               ; preds = %77
  %83 = load ptr, ptr %12, align 8, !tbaa !5
  %84 = load float, ptr %83, align 4, !tbaa !24
  %85 = load ptr, ptr %13, align 8, !tbaa !5
  %86 = getelementptr inbounds float, ptr %85, i64 0
  store float %84, ptr %86, align 4, !tbaa !24
  %87 = load ptr, ptr %12, align 8, !tbaa !5
  %88 = load float, ptr %87, align 4, !tbaa !24
  %89 = load ptr, ptr %13, align 8, !tbaa !5
  %90 = getelementptr inbounds float, ptr %89, i64 1
  store float %88, ptr %90, align 4, !tbaa !24
  %91 = load ptr, ptr %13, align 8, !tbaa !5
  %92 = getelementptr inbounds float, ptr %91, i64 2
  store ptr %92, ptr %13, align 8, !tbaa !5
  %93 = load ptr, ptr %12, align 8, !tbaa !5
  %94 = getelementptr inbounds float, ptr %93, i32 1
  store ptr %94, ptr %12, align 8, !tbaa !5
  br label %95

95:                                               ; preds = %82
  %96 = load i64, ptr %14, align 8, !tbaa !11
  %97 = add i64 %96, 1
  store i64 %97, ptr %14, align 8, !tbaa !11
  br label %77, !llvm.loop !26

98:                                               ; preds = %81
  br label %125

99:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  store i64 0, ptr %15, align 8, !tbaa !11
  br label %100

100:                                              ; preds = %121, %99
  %101 = load i64, ptr %15, align 8, !tbaa !11
  %102 = load i64, ptr %9, align 8, !tbaa !11
  %103 = icmp ult i64 %101, %102
  br i1 %103, label %105, label %104

104:                                              ; preds = %100
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %124

105:                                              ; preds = %100
  %106 = load ptr, ptr %12, align 8, !tbaa !5
  %107 = getelementptr inbounds float, ptr %106, i64 0
  %108 = load float, ptr %107, align 4, !tbaa !24
  %109 = load ptr, ptr %13, align 8, !tbaa !5
  %110 = getelementptr inbounds float, ptr %109, i64 0
  store float %108, ptr %110, align 4, !tbaa !24
  %111 = load ptr, ptr %12, align 8, !tbaa !5
  %112 = getelementptr inbounds float, ptr %111, i64 1
  %113 = load float, ptr %112, align 4, !tbaa !24
  %114 = load ptr, ptr %13, align 8, !tbaa !5
  %115 = getelementptr inbounds float, ptr %114, i64 1
  store float %113, ptr %115, align 4, !tbaa !24
  %116 = load ptr, ptr %13, align 8, !tbaa !5
  %117 = getelementptr inbounds float, ptr %116, i64 2
  store ptr %117, ptr %13, align 8, !tbaa !5
  %118 = load i64, ptr %8, align 8, !tbaa !11
  %119 = load ptr, ptr %12, align 8, !tbaa !5
  %120 = getelementptr inbounds float, ptr %119, i64 %118
  store ptr %120, ptr %12, align 8, !tbaa !5
  br label %121

121:                                              ; preds = %105
  %122 = load i64, ptr %15, align 8, !tbaa !11
  %123 = add i64 %122, 1
  store i64 %123, ptr %15, align 8, !tbaa !11
  br label %100, !llvm.loop !28

124:                                              ; preds = %104
  br label %125

125:                                              ; preds = %124, %98
  %126 = getelementptr inbounds %class.LameEncoder, ptr %17, i32 0, i32 3
  %127 = load ptr, ptr %126, align 8, !tbaa !15
  %128 = getelementptr inbounds %class.LameEncoder, ptr %17, i32 0, i32 2
  %129 = getelementptr inbounds %struct.DataBuffer.0, ptr %128, i32 0, i32 0
  %130 = load ptr, ptr %129, align 8, !tbaa !23
  %131 = load i64, ptr %9, align 8, !tbaa !11
  %132 = trunc i64 %131 to i32
  %133 = getelementptr inbounds %class.LameEncoder, ptr %17, i32 0, i32 1
  %134 = getelementptr inbounds %struct.DataBuffer, ptr %133, i32 0, i32 0
  %135 = load ptr, ptr %134, align 8, !tbaa !21
  %136 = getelementptr inbounds %class.LameEncoder, ptr %17, i32 0, i32 1
  %137 = getelementptr inbounds %struct.DataBuffer, ptr %136, i32 0, i32 2
  %138 = load i64, ptr %137, align 8, !tbaa !22
  %139 = trunc i64 %138 to i32
  %140 = call i32 @lame_encode_buffer_interleaved_ieee_float(ptr noundef %127, ptr noundef %130, i32 noundef %132, ptr noundef %135, i32 noundef %139)
  store i32 %140, ptr %11, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %141

141:                                              ; preds = %125, %44
  %142 = load i32, ptr %11, align 4, !tbaa !13
  %143 = icmp slt i32 %142, 0
  br i1 %143, label %144, label %145

144:                                              ; preds = %141
  store i32 0, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %158

145:                                              ; preds = %141
  %146 = load i32, ptr %11, align 4, !tbaa !13
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds %class.LameEncoder, ptr %17, i32 0, i32 1
  %149 = getelementptr inbounds %struct.DataBuffer, ptr %148, i32 0, i32 2
  store i64 %147, ptr %149, align 8, !tbaa !22
  %150 = getelementptr inbounds %class.LameEncoder, ptr %17, i32 0, i32 1
  %151 = getelementptr inbounds %struct.DataBuffer, ptr %150, i32 0, i32 0
  %152 = load ptr, ptr %151, align 8, !tbaa !21
  %153 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %152, ptr %153, align 8, !tbaa !5
  %154 = getelementptr inbounds %class.LameEncoder, ptr %17, i32 0, i32 1
  %155 = getelementptr inbounds %struct.DataBuffer, ptr %154, i32 0, i32 2
  %156 = load i64, ptr %155, align 8, !tbaa !22
  %157 = trunc i64 %156 to i32
  store i32 %157, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %158

158:                                              ; preds = %145, %144
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  %159 = load i32, ptr %4, align 4
  ret i32 %159
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10DataBufferIhE5resetEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #0 align 2

declare i32 @lame_encode_buffer_interleaved_ieee_float(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10DataBufferIfE5resetEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #0 align 2

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { "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, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !6, i64 72}
!16 = !{!"_ZTS11LameEncoder", !17, i64 0, !19, i64 8, !20, i64 40, !6, i64 72}
!17 = !{!"_ZTSN5musik4core3sdk17IStreamingEncoderE", !18, i64 0}
!18 = !{!"_ZTSN5musik4core3sdk8IEncoderE"}
!19 = !{!"_ZTS10DataBufferIhE", !6, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}
!20 = !{!"_ZTS10DataBufferIfE", !6, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}
!21 = !{!16, !6, i64 8}
!22 = !{!16, !12, i64 24}
!23 = !{!16, !6, i64 40}
!24 = !{!25, !25, i64 0}
!25 = !{!"float", !7, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = distinct !{!28, !27}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN11LameEncoder6EncodeEPKN5musik4core3sdk7IBufferEPPc(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef %1, ptr nocapture noundef writeonly %2) unnamed_addr #0 align 2 {
  %4 = load ptr, ptr %1, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %4, i64 16
  %6 = load ptr, ptr %5, align 8
  %7 = tail call noundef i32 %6(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %8 = sext i32 %7 to i64
  %9 = load ptr, ptr %1, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %9, i64 40
  %11 = load ptr, ptr %10, align 8
  %12 = tail call noundef i64 %11(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %13 = udiv i64 %12, %8
  %14 = uitofp i64 %13 to float
  %15 = fpext float %14 to double
  %16 = tail call double @llvm.fmuladd.f64(double %15, double 1.250000e+00, double 7.200000e+03)
  %17 = fptoui double %16 to i64
  %18 = getelementptr inbounds i8, ptr %0, i64 8
  tail call void @_ZN10DataBufferIhE5resetEm(ptr noundef nonnull align 8 dereferenceable(32) %18, i64 noundef %17)
  %19 = load ptr, ptr %1, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %19, i64 16
  %21 = load ptr, ptr %20, align 8
  %22 = tail call noundef i32 %21(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %23 = icmp eq i32 %22, 2
  br i1 %23, label %24, label %37

24:                                               ; preds = %3
  %25 = getelementptr inbounds i8, ptr %0, i64 72
  %26 = load ptr, ptr %25, align 8, !tbaa !8
  %27 = load ptr, ptr %1, align 8, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %27, i64 32
  %29 = load ptr, ptr %28, align 8
  %30 = tail call noundef ptr %29(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %31 = trunc i64 %13 to i32
  %32 = load ptr, ptr %18, align 8, !tbaa !17
  %33 = getelementptr inbounds i8, ptr %0, i64 24
  %34 = load i64, ptr %33, align 8, !tbaa !18
  %35 = trunc i64 %34 to i32
  %36 = tail call i32 @lame_encode_buffer_interleaved_ieee_float(ptr noundef %26, ptr noundef %30, i32 noundef %31, ptr noundef %32, i32 noundef %35)
  br label %100

37:                                               ; preds = %3
  %38 = getelementptr inbounds i8, ptr %0, i64 40
  %39 = shl i64 %13, 1
  tail call void @_ZN10DataBufferIfE5resetEm(ptr noundef nonnull align 8 dereferenceable(32) %38, i64 noundef %39)
  %40 = load ptr, ptr %1, align 8, !tbaa !5
  %41 = getelementptr inbounds i8, ptr %40, i64 32
  %42 = load ptr, ptr %41, align 8
  %43 = tail call noundef ptr %42(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %44 = load ptr, ptr %38, align 8, !tbaa !19
  %45 = icmp eq i32 %7, 1
  %.not51 = icmp ult i64 %12, %8
  br i1 %45, label %.preheader, label %.preheader42

.preheader42:                                     ; preds = %37
  br i1 %.not51, label %.loopexit, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader42
  %umax = tail call i64 @llvm.umax.i64(i64 %13, i64 1)
  %xtraiter = and i64 %umax, 3
  %46 = icmp ult i64 %13, 4
  br i1 %46, label %.loopexit.loopexit66.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %umax, -4
  br label %.lr.ph

.preheader:                                       ; preds = %37
  br i1 %.not51, label %.loopexit, label %.lr.ph50.preheader

.lr.ph50.preheader:                               ; preds = %.preheader
  %min.iters.check = icmp ult i64 %13, 10
  br i1 %min.iters.check, label %.lr.ph50.preheader65, label %vector.memcheck

vector.memcheck:                                  ; preds = %.lr.ph50.preheader
  %47 = shl i64 %13, 3
  %scevgep = getelementptr i8, ptr %44, i64 %47
  %48 = shl i64 %13, 2
  %scevgep55 = getelementptr i8, ptr %43, i64 %48
  %bound0 = icmp ult ptr %44, %scevgep55
  %bound1 = icmp ult ptr %43, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %.lr.ph50.preheader65, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %13, -4
  %49 = shl i64 %n.vec, 3
  %ind.end = getelementptr i8, ptr %44, i64 %49
  %50 = shl i64 %n.vec, 2
  %ind.end57 = getelementptr i8, ptr %43, i64 %50
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = shl i64 %index, 3
  %51 = or disjoint i64 %offset.idx, 16
  %next.gep = getelementptr i8, ptr %44, i64 %offset.idx
  %next.gep59 = getelementptr i8, ptr %44, i64 %51
  %offset.idx60 = shl i64 %index, 2
  %next.gep61 = getelementptr i8, ptr %43, i64 %offset.idx60
  %52 = getelementptr i8, ptr %next.gep61, i64 8
  %wide.load = load <2 x float>, ptr %next.gep61, align 4, !tbaa !20, !alias.scope !22
  %wide.load63 = load <2 x float>, ptr %52, align 4, !tbaa !20, !alias.scope !22
  %53 = shufflevector <2 x float> %wide.load, <2 x float> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
  %interleaved.vec = shufflevector <4 x float> %53, <4 x float> poison, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
  store <4 x float> %interleaved.vec, ptr %next.gep, align 4, !tbaa !20
  %54 = shufflevector <2 x float> %wide.load63, <2 x float> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
  %interleaved.vec64 = shufflevector <4 x float> %54, <4 x float> poison, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
  store <4 x float> %interleaved.vec64, ptr %next.gep59, align 4, !tbaa !20
  %index.next = add nuw i64 %index, 4
  %55 = icmp eq i64 %index.next, %n.vec
  br i1 %55, label %middle.block, label %vector.body, !llvm.loop !25

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %13, %n.vec
  br i1 %cmp.n, label %.loopexit, label %.lr.ph50.preheader65

.lr.ph50.preheader65:                             ; preds = %middle.block, %vector.memcheck, %.lr.ph50.preheader
  %.03549.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph50.preheader ], [ %n.vec, %middle.block ]
  %.03648.ph = phi ptr [ %44, %vector.memcheck ], [ %44, %.lr.ph50.preheader ], [ %ind.end, %middle.block ]
  %.03747.ph = phi ptr [ %43, %vector.memcheck ], [ %43, %.lr.ph50.preheader ], [ %ind.end57, %middle.block ]
  br label %.lr.ph50

.lr.ph50:                                         ; preds = %.lr.ph50.preheader65, %.lr.ph50
  %.03549 = phi i64 [ %60, %.lr.ph50 ], [ %.03549.ph, %.lr.ph50.preheader65 ]
  %.03648 = phi ptr [ %58, %.lr.ph50 ], [ %.03648.ph, %.lr.ph50.preheader65 ]
  %.03747 = phi ptr [ %59, %.lr.ph50 ], [ %.03747.ph, %.lr.ph50.preheader65 ]
  %56 = load float, ptr %.03747, align 4, !tbaa !20
  store float %56, ptr %.03648, align 4, !tbaa !20
  %57 = getelementptr inbounds i8, ptr %.03648, i64 4
  store float %56, ptr %57, align 4, !tbaa !20
  %58 = getelementptr inbounds i8, ptr %.03648, i64 8
  %59 = getelementptr inbounds i8, ptr %.03747, i64 4
  %60 = add nuw i64 %.03549, 1
  %61 = icmp ult i64 %60, %13
  br i1 %61, label %.lr.ph50, label %.loopexit, !llvm.loop !29

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %.145 = phi ptr [ %44, %.lr.ph.preheader.new ], [ %84, %.lr.ph ]
  %.13844 = phi ptr [ %43, %.lr.ph.preheader.new ], [ %85, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %62 = load float, ptr %.13844, align 4, !tbaa !20
  store float %62, ptr %.145, align 4, !tbaa !20
  %63 = getelementptr inbounds i8, ptr %.13844, i64 4
  %64 = load float, ptr %63, align 4, !tbaa !20
  %65 = getelementptr inbounds i8, ptr %.145, i64 4
  store float %64, ptr %65, align 4, !tbaa !20
  %66 = getelementptr inbounds i8, ptr %.145, i64 8
  %67 = getelementptr inbounds float, ptr %.13844, i64 %8
  %68 = load float, ptr %67, align 4, !tbaa !20
  store float %68, ptr %66, align 4, !tbaa !20
  %69 = getelementptr inbounds i8, ptr %67, i64 4
  %70 = load float, ptr %69, align 4, !tbaa !20
  %71 = getelementptr inbounds i8, ptr %.145, i64 12
  store float %70, ptr %71, align 4, !tbaa !20
  %72 = getelementptr inbounds i8, ptr %.145, i64 16
  %73 = getelementptr inbounds float, ptr %67, i64 %8
  %74 = load float, ptr %73, align 4, !tbaa !20
  store float %74, ptr %72, align 4, !tbaa !20
  %75 = getelementptr inbounds i8, ptr %73, i64 4
  %76 = load float, ptr %75, align 4, !tbaa !20
  %77 = getelementptr inbounds i8, ptr %.145, i64 20
  store float %76, ptr %77, align 4, !tbaa !20
  %78 = getelementptr inbounds i8, ptr %.145, i64 24
  %79 = getelementptr inbounds float, ptr %73, i64 %8
  %80 = load float, ptr %79, align 4, !tbaa !20
  store float %80, ptr %78, align 4, !tbaa !20
  %81 = getelementptr inbounds i8, ptr %79, i64 4
  %82 = load float, ptr %81, align 4, !tbaa !20
  %83 = getelementptr inbounds i8, ptr %.145, i64 28
  store float %82, ptr %83, align 4, !tbaa !20
  %84 = getelementptr inbounds i8, ptr %.145, i64 32
  %85 = getelementptr inbounds float, ptr %79, i64 %8
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3.not = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3.not, label %.loopexit.loopexit66.unr-lcssa, label %.lr.ph, !llvm.loop !30

.loopexit.loopexit66.unr-lcssa:                   ; preds = %.lr.ph, %.lr.ph.preheader
  %.145.unr = phi ptr [ %44, %.lr.ph.preheader ], [ %84, %.lr.ph ]
  %.13844.unr = phi ptr [ %43, %.lr.ph.preheader ], [ %85, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.loopexit, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.loopexit.loopexit66.unr-lcssa, %.lr.ph.epil
  %.145.epil = phi ptr [ %90, %.lr.ph.epil ], [ %.145.unr, %.loopexit.loopexit66.unr-lcssa ]
  %.13844.epil = phi ptr [ %91, %.lr.ph.epil ], [ %.13844.unr, %.loopexit.loopexit66.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %.loopexit.loopexit66.unr-lcssa ]
  %86 = load float, ptr %.13844.epil, align 4, !tbaa !20
  store float %86, ptr %.145.epil, align 4, !tbaa !20
  %87 = getelementptr inbounds i8, ptr %.13844.epil, i64 4
  %88 = load float, ptr %87, align 4, !tbaa !20
  %89 = getelementptr inbounds i8, ptr %.145.epil, i64 4
  store float %88, ptr %89, align 4, !tbaa !20
  %90 = getelementptr inbounds i8, ptr %.145.epil, i64 8
  %91 = getelementptr inbounds float, ptr %.13844.epil, i64 %8
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.loopexit, label %.lr.ph.epil, !llvm.loop !31

.loopexit:                                        ; preds = %.loopexit.loopexit66.unr-lcssa, %.lr.ph.epil, %.lr.ph50, %middle.block, %.preheader42, %.preheader
  %92 = getelementptr inbounds i8, ptr %0, i64 72
  %93 = load ptr, ptr %92, align 8, !tbaa !8
  %94 = trunc i64 %13 to i32
  %95 = load ptr, ptr %18, align 8, !tbaa !17
  %96 = getelementptr inbounds i8, ptr %0, i64 24
  %97 = load i64, ptr %96, align 8, !tbaa !18
  %98 = trunc i64 %97 to i32
  %99 = tail call i32 @lame_encode_buffer_interleaved_ieee_float(ptr noundef %93, ptr noundef %44, i32 noundef %94, ptr noundef %95, i32 noundef %98)
  br label %100

100:                                              ; preds = %.loopexit, %24
  %.039 = phi i32 [ %36, %24 ], [ %99, %.loopexit ]
  %101 = icmp slt i32 %.039, 0
  br i1 %101, label %106, label %102

102:                                              ; preds = %100
  %103 = zext nneg i32 %.039 to i64
  %104 = getelementptr inbounds i8, ptr %0, i64 24
  store i64 %103, ptr %104, align 8, !tbaa !18
  %105 = load ptr, ptr %18, align 8, !tbaa !17
  store ptr %105, ptr %2, align 8, !tbaa !33
  br label %106

106:                                              ; preds = %100, %102
  %.040 = phi i32 [ %.039, %102 ], [ 0, %100 ]
  ret i32 %.040
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10DataBufferIhE5resetEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #0 align 2

declare i32 @lame_encode_buffer_interleaved_ieee_float(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10DataBufferIfE5resetEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #0 align 2

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !13, i64 72}
!9 = !{!"_ZTS11LameEncoder", !10, i64 0, !12, i64 8, !16, i64 40, !13, i64 72}
!10 = !{!"_ZTSN5musik4core3sdk17IStreamingEncoderE", !11, i64 0}
!11 = !{!"_ZTSN5musik4core3sdk8IEncoderE"}
!12 = !{!"_ZTS10DataBufferIhE", !13, i64 0, !15, i64 8, !15, i64 16, !15, i64 24}
!13 = !{!"any pointer", !14, i64 0}
!14 = !{!"omnipotent char", !7, i64 0}
!15 = !{!"long", !14, i64 0}
!16 = !{!"_ZTS10DataBufferIfE", !13, i64 0, !15, i64 8, !15, i64 16, !15, i64 24}
!17 = !{!9, !13, i64 8}
!18 = !{!9, !15, i64 24}
!19 = !{!9, !13, i64 40}
!20 = !{!21, !21, i64 0}
!21 = !{!"float", !14, i64 0}
!22 = !{!23}
!23 = distinct !{!23, !24}
!24 = distinct !{!24, !"LVerDomain"}
!25 = distinct !{!25, !26, !27, !28}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!"llvm.loop.isvectorized", i32 1}
!28 = !{!"llvm.loop.unroll.runtime.disable"}
!29 = distinct !{!29, !26, !27}
!30 = distinct !{!30, !26}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.unroll.disable"}
!33 = !{!13, !13, i64 0}


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