; LLVM IR from merpheus-dev/LavaEngine :: src/Utils/soloud/src/audiosource/wav (dr_impl)

; 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.drmp3_seek_point = type { i64, i64, i16, i16 }
%struct.drmp3 = type { %struct.drmp3dec, %struct.drmp3dec_frame_info, i32, i32, ptr, ptr, ptr, %struct.drmp3_allocation_callbacks, i32, i32, i32, i32, [9216 x i8], i64, i64, %struct.drmp3_src, ptr, i32, i64, i64, ptr, i8, %struct.anon.0 }
%struct.drmp3dec = type { [2 x [288 x float]], [960 x float], i32, i32, [4 x i8], [511 x i8] }
%struct.drmp3dec_frame_info = type { i32, i32, i32, i32, i32 }
%struct.drmp3_allocation_callbacks = type { ptr, ptr, ptr, ptr }
%struct.drmp3_src = type { %struct.drmp3_src_config, ptr, ptr, [256 x float], %struct.drmp3_src_cache, %union.anon }
%struct.drmp3_src_config = type { i32, i32, i32, i32, i32 }
%struct.drmp3_src_cache = type { ptr, [1024 x float], i32, i32 }
%union.anon = type { %struct.anon }
%struct.anon = type { double, i8 }
%struct.anon.0 = type { ptr, i64, i64 }

@.str.1 = external hidden unnamed_addr constant [103 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [15 x i8], align 1
@__PRETTY_FUNCTION__._Z35drmp3_seek_to_pcm_frame__seek_tableP5drmp3m = external hidden unnamed_addr constant [72 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [25 x i8], align 1

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z11drmp3_resetP5drmp3(ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z45drmp3_seek_forward_by_pcm_frames__brute_forceP5drmp3m(ptr noundef, i64 noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z29drmp3_find_closest_seek_pointP5drmp3mPj(ptr noundef, i64 noundef, ptr noundef) #3

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

15:                                               ; preds = %2
  br label %18

16:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.1, i32 noundef 3432, ptr noundef @__PRETTY_FUNCTION__._Z35drmp3_seek_to_pcm_frame__seek_tableP5drmp3m) #6
  unreachable

17:                                               ; No predecessors!
  br label %18

18:                                               ; preds = %17, %15
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.drmp3, ptr %19, i32 0, i32 16
  %21 = load ptr, ptr %20, align 8, !tbaa !11
  %22 = icmp ne ptr %21, null
  br i1 %22, label %23, label %24

23:                                               ; preds = %18
  br label %26

24:                                               ; preds = %18
  call void @__assert_fail(ptr noundef @.str.12, ptr noundef @.str.1, i32 noundef 3433, ptr noundef @__PRETTY_FUNCTION__._Z35drmp3_seek_to_pcm_frame__seek_tableP5drmp3m) #6
  unreachable

25:                                               ; No predecessors!
  br label %26

26:                                               ; preds = %25, %23
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.drmp3, ptr %27, i32 0, i32 17
  %29 = load i32, ptr %28, align 8, !tbaa !22
  %30 = icmp ugt i32 %29, 0
  br i1 %30, label %31, label %32

31:                                               ; preds = %26
  br label %34

32:                                               ; preds = %26
  call void @__assert_fail(ptr noundef @.str.13, ptr noundef @.str.1, i32 noundef 3434, ptr noundef @__PRETTY_FUNCTION__._Z35drmp3_seek_to_pcm_frame__seek_tableP5drmp3m) #6
  unreachable

33:                                               ; No predecessors!
  br label %34

34:                                               ; preds = %33, %31
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = load i64, ptr %5, align 8, !tbaa !9
  %37 = call noundef i32 @_Z29drmp3_find_closest_seek_pointP5drmp3mPj(ptr noundef %35, i64 noundef %36, ptr noundef %7)
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %39, label %46

39:                                               ; preds = %34
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.drmp3, ptr %40, i32 0, i32 16
  %42 = load ptr, ptr %41, align 8, !tbaa !11
  %43 = load i32, ptr %7, align 4, !tbaa !23
  %44 = zext i32 %43 to i64
  %45 = getelementptr inbounds %struct.drmp3_seek_point, ptr %42, i64 %44
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %6, ptr align 8 %45, i64 24, i1 false), !tbaa.struct !24
  br label %51

46:                                               ; preds = %34
  %47 = getelementptr inbounds %struct.drmp3_seek_point, ptr %6, i32 0, i32 0
  store i64 0, ptr %47, align 8, !tbaa !27
  %48 = getelementptr inbounds %struct.drmp3_seek_point, ptr %6, i32 0, i32 1
  store i64 0, ptr %48, align 8, !tbaa !29
  %49 = getelementptr inbounds %struct.drmp3_seek_point, ptr %6, i32 0, i32 2
  store i16 0, ptr %49, align 8, !tbaa !30
  %50 = getelementptr inbounds %struct.drmp3_seek_point, ptr %6, i32 0, i32 3
  store i16 0, ptr %50, align 2, !tbaa !31
  br label %51

51:                                               ; preds = %46, %39
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.drmp3_seek_point, ptr %6, i32 0, i32 0
  %54 = load i64, ptr %53, align 8, !tbaa !27
  %55 = call noundef i32 @_ZL17drmp3__on_seek_64P5drmp3m17drmp3_seek_origin(ptr noundef %52, i64 noundef %54, i32 noundef 0)
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %58, label %57

57:                                               ; preds = %51
  store i32 0, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %164

58:                                               ; preds = %51
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_Z11drmp3_resetP5drmp3(ptr noundef %59)
  store i16 0, ptr %8, align 2, !tbaa !25
  br label %60

60:                                               ; preds = %90, %58
  %61 = load i16, ptr %8, align 2, !tbaa !25
  %62 = zext i16 %61 to i32
  %63 = getelementptr inbounds %struct.drmp3_seek_point, ptr %6, i32 0, i32 2
  %64 = load i16, ptr %63, align 8, !tbaa !30
  %65 = zext i16 %64 to i32
  %66 = icmp slt i32 %62, %65
  br i1 %66, label %67, label %93

67:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store ptr null, ptr %12, align 8, !tbaa !5
  %68 = load i16, ptr %8, align 2, !tbaa !25
  %69 = zext i16 %68 to i32
  %70 = getelementptr inbounds %struct.drmp3_seek_point, ptr %6, i32 0, i32 2
  %71 = load i16, ptr %70, align 8, !tbaa !30
  %72 = zext i16 %71 to i32
  %73 = sub nsw i32 %72, 1
  %74 = icmp eq i32 %69, %73
  br i1 %74, label %75, label %79

75:                                               ; preds = %67
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.drmp3, ptr %76, i32 0, i32 12
  %78 = getelementptr inbounds [9216 x i8], ptr %77, i64 0, i64 0
  store ptr %78, ptr %12, align 8, !tbaa !5
  br label %79

79:                                               ; preds = %75, %67
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = load ptr, ptr %12, align 8, !tbaa !5
  %82 = call noundef i32 @_ZL26drmp3_decode_next_frame_exP5drmp3Pfj(ptr noundef %80, ptr noundef %81, i32 noundef 1)
  store i32 %82, ptr %11, align 4, !tbaa !23
  %83 = load i32, ptr %11, align 4, !tbaa !23
  %84 = icmp eq i32 %83, 0
  br i1 %84, label %85, label %86

85:                                               ; preds = %79
  store i32 0, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %87

86:                                               ; preds = %79
  store i32 0, ptr %10, align 4
  br label %87

87:                                               ; preds = %86, %85
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  %88 = load i32, ptr %10, align 4
  switch i32 %88, label %164 [
    i32 0, label %89
  ]

89:                                               ; preds = %87
  br label %90

90:                                               ; preds = %89
  %91 = load i16, ptr %8, align 2, !tbaa !25
  %92 = add i16 %91, 1
  store i16 %92, ptr %8, align 2, !tbaa !25
  br label %60, !llvm.loop !32

93:                                               ; preds = %60
  %94 = getelementptr inbounds %struct.drmp3_seek_point, ptr %6, i32 0, i32 1
  %95 = load i64, ptr %94, align 8, !tbaa !29
  %96 = getelementptr inbounds %struct.drmp3_seek_point, ptr %6, i32 0, i32 3
  %97 = load i16, ptr %96, align 2, !tbaa !31
  %98 = zext i16 %97 to i64
  %99 = sub i64 %95, %98
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.drmp3, ptr %100, i32 0, i32 13
  store i64 %99, ptr %101, align 8, !tbaa !34
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.drmp3, ptr %102, i32 0, i32 13
  %104 = load i64, ptr %103, align 8, !tbaa !34
  %105 = sitofp i64 %104 to double
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.drmp3, ptr %106, i32 0, i32 15
  %108 = getelementptr inbounds %struct.drmp3_src, ptr %107, i32 0, i32 0
  %109 = getelementptr inbounds %struct.drmp3_src_config, ptr %108, i32 0, i32 0
  %110 = load i32, ptr %109, align 8, !tbaa !35
  %111 = uitofp i32 %110 to double
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.drmp3, ptr %112, i32 0, i32 15
  %114 = getelementptr inbounds %struct.drmp3_src, ptr %113, i32 0, i32 0
  %115 = getelementptr inbounds %struct.drmp3_src_config, ptr %114, i32 0, i32 1
  %116 = load i32, ptr %115, align 4, !tbaa !36
  %117 = uitofp i32 %116 to double
  %118 = fdiv double %111, %117
  %119 = fmul double %105, %118
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.drmp3, ptr %120, i32 0, i32 15
  %122 = getelementptr inbounds %struct.drmp3_src, ptr %121, i32 0, i32 5
  %123 = getelementptr inbounds %struct.anon, ptr %122, i32 0, i32 0
  store double %119, ptr %123, align 8, !tbaa !37
  %124 = load ptr, ptr %4, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.drmp3, ptr %124, i32 0, i32 15
  %126 = getelementptr inbounds %struct.drmp3_src, ptr %125, i32 0, i32 5
  %127 = getelementptr inbounds %struct.anon, ptr %126, i32 0, i32 0
  %128 = load double, ptr %127, align 8, !tbaa !37
  %129 = load ptr, ptr %4, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.drmp3, ptr %129, i32 0, i32 15
  %131 = getelementptr inbounds %struct.drmp3_src, ptr %130, i32 0, i32 5
  %132 = getelementptr inbounds %struct.anon, ptr %131, i32 0, i32 0
  %133 = load double, ptr %132, align 8, !tbaa !37
  %134 = fptoui double %133 to i32
  %135 = uitofp i32 %134 to double
  %136 = fsub double %128, %135
  %137 = load ptr, ptr %4, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.drmp3, ptr %137, i32 0, i32 15
  %139 = getelementptr inbounds %struct.drmp3_src, ptr %138, i32 0, i32 5
  %140 = getelementptr inbounds %struct.anon, ptr %139, i32 0, i32 0
  store double %136, ptr %140, align 8, !tbaa !37
  %141 = load ptr, ptr %4, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.drmp3, ptr %141, i32 0, i32 15
  %143 = getelementptr inbounds %struct.drmp3_src, ptr %142, i32 0, i32 5
  %144 = getelementptr inbounds %struct.anon, ptr %143, i32 0, i32 0
  %145 = load double, ptr %144, align 8, !tbaa !37
  %146 = fcmp ogt double %145, 0.000000e+00
  br i1 %146, label %147, label %155

147:                                              ; preds = %93
  %148 = load ptr, ptr %4, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.drmp3, ptr %148, i32 0, i32 15
  %150 = getelementptr inbounds %struct.drmp3_src, ptr %149, i32 0, i32 5
  %151 = getelementptr inbounds %struct.anon, ptr %150, i32 0, i32 1
  %152 = load i8, ptr %151, align 8
  %153 = and i8 %152, -2
  %154 = or i8 %153, 1
  store i8 %154, ptr %151, align 8
  br label %155

155:                                              ; preds = %147, %93
  %156 = load i64, ptr %5, align 8, !tbaa !9
  %157 = load ptr, ptr %4, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.drmp3, ptr %157, i32 0, i32 13
  %159 = load i64, ptr %158, align 8, !tbaa !34
  %160 = sub i64 %156, %159
  store i64 %160, ptr %9, align 8, !tbaa !9
  %161 = load ptr, ptr %4, align 8, !tbaa !5
  %162 = load i64, ptr %9, align 8, !tbaa !9
  %163 = call noundef i32 @_Z45drmp3_seek_forward_by_pcm_frames__brute_forceP5drmp3m(ptr noundef %161, i64 noundef %162)
  store i32 %163, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %164

164:                                              ; preds = %155, %87, %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #5
  %165 = load i32, ptr %3, align 4
  ret i32 %165
}

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL17drmp3__on_seek_64P5drmp3m17drmp3_seek_origin(ptr noundef, i64 noundef, i32 noundef) #4

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL26drmp3_decode_next_frame_exP5drmp3Pfj(ptr noundef, ptr noundef, i32 noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 #4 = { 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 #5 = { nounwind }
attributes #6 = { noreturn 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 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 21192}
!12 = !{!"_ZTS5drmp3", !13, i64 0, !15, i64 6668, !14, i64 6688, !14, i64 6692, !6, i64 6696, !6, i64 6704, !6, i64 6712, !16, i64 6720, !14, i64 6752, !14, i64 6756, !14, i64 6760, !14, i64 6764, !7, i64 6768, !10, i64 15984, !10, i64 15992, !17, i64 16000, !6, i64 21192, !14, i64 21200, !10, i64 21208, !10, i64 21216, !6, i64 21224, !14, i64 21232, !21, i64 21240}
!13 = !{!"_ZTS8drmp3dec", !7, i64 0, !7, i64 2304, !14, i64 6144, !14, i64 6148, !7, i64 6152, !7, i64 6156}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTS19drmp3dec_frame_info", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16}
!16 = !{!"_ZTS26drmp3_allocation_callbacks", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!17 = !{!"_ZTS9drmp3_src", !18, i64 0, !6, i64 24, !6, i64 32, !7, i64 40, !20, i64 1064, !7, i64 5176}
!18 = !{!"_ZTS16drmp3_src_config", !14, i64 0, !14, i64 4, !14, i64 8, !19, i64 12, !14, i64 16}
!19 = !{!"_ZTS19drmp3_src_algorithm", !7, i64 0}
!20 = !{!"_ZTS15drmp3_src_cache", !6, i64 0, !7, i64 8, !14, i64 4104, !14, i64 4108}
!21 = !{!"_ZTSN5drmp3Ut_E", !6, i64 0, !10, i64 8, !10, i64 16}
!22 = !{!12, !14, i64 21200}
!23 = !{!14, !14, i64 0}
!24 = !{i64 0, i64 8, !9, i64 8, i64 8, !9, i64 16, i64 2, !25, i64 18, i64 2, !25}
!25 = !{!26, !26, i64 0}
!26 = !{!"short", !7, i64 0}
!27 = !{!28, !10, i64 0}
!28 = !{!"_ZTS16drmp3_seek_point", !10, i64 0, !10, i64 8, !26, i64 16, !26, i64 18}
!29 = !{!28, !10, i64 8}
!30 = !{!28, !26, i64 16}
!31 = !{!28, !26, i64 18}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!12, !10, i64 15984}
!35 = !{!12, !14, i64 16000}
!36 = !{!12, !14, i64 16004}
!37 = !{!7, !7, i64 0}


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

%struct.drmp3_seek_point = type { i64, i64, i16, i16 }

@.str.1 = external hidden unnamed_addr constant [103 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [15 x i8], align 1
@__PRETTY_FUNCTION__._Z35drmp3_seek_to_pcm_frame__seek_tableP5drmp3m = external hidden unnamed_addr constant [72 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [25 x i8], align 1

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z11drmp3_resetP5drmp3(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z45drmp3_seek_forward_by_pcm_frames__brute_forceP5drmp3m(ptr noundef, i64 noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z35drmp3_seek_to_pcm_frame__seek_tableP5drmp3m(ptr noundef %0, i64 noundef %1) local_unnamed_addr #3 {
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %4, label %5

4:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.1, i32 noundef 3432, ptr noundef nonnull @__PRETTY_FUNCTION__._Z35drmp3_seek_to_pcm_frame__seek_tableP5drmp3m) #5
  unreachable

5:                                                ; preds = %2
  %6 = getelementptr inbounds i8, ptr %0, i64 21192
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %.not37 = icmp eq ptr %7, null
  br i1 %.not37, label %8, label %9

8:                                                ; preds = %5
  tail call void @__assert_fail(ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.1, i32 noundef 3433, ptr noundef nonnull @__PRETTY_FUNCTION__._Z35drmp3_seek_to_pcm_frame__seek_tableP5drmp3m) #5
  unreachable

9:                                                ; preds = %5
  %10 = getelementptr inbounds i8, ptr %0, i64 21200
  %11 = load i32, ptr %10, align 8, !tbaa !20
  %.not38 = icmp eq i32 %11, 0
  br i1 %.not38, label %12, label %13

12:                                               ; preds = %9
  tail call void @__assert_fail(ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.1, i32 noundef 3434, ptr noundef nonnull @__PRETTY_FUNCTION__._Z35drmp3_seek_to_pcm_frame__seek_tableP5drmp3m) #5
  unreachable

13:                                               ; preds = %9
  %14 = call noundef i32 @_Z29drmp3_find_closest_seek_pointP5drmp3mPj(ptr noundef nonnull %0, i64 noundef %1, ptr noundef nonnull %3)
  %.not39 = icmp eq i32 %14, 0
  br i1 %.not39, label %22, label %15

15:                                               ; preds = %13
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = load i32, ptr %3, align 4, !tbaa !21
  %18 = zext i32 %17 to i64
  %19 = getelementptr inbounds %struct.drmp3_seek_point, ptr %16, i64 %18
  %.sroa.0.0.copyload = load i64, ptr %19, align 8, !tbaa !22
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %19, i64 8
  %.sroa.5.0.copyload = load i64, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !22
  %.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %19, i64 16
  %.sroa.7.0.copyload = load i16, ptr %.sroa.7.0..sroa_idx, align 8, !tbaa !23
  %.sroa.10.0..sroa_idx = getelementptr inbounds i8, ptr %19, i64 18
  %.sroa.10.0.copyload = load i16, ptr %.sroa.10.0..sroa_idx, align 2, !tbaa !23
  %20 = zext i16 %.sroa.7.0.copyload to i32
  %21 = zext i16 %.sroa.10.0.copyload to i64
  br label %22

22:                                               ; preds = %13, %15
  %.sroa.7.0 = phi i32 [ %20, %15 ], [ 0, %13 ]
  %.sroa.5.0 = phi i64 [ %.sroa.5.0.copyload, %15 ], [ 0, %13 ]
  %.sroa.0.0 = phi i64 [ %.sroa.0.0.copyload, %15 ], [ 0, %13 ]
  %.sroa.10.0 = phi i64 [ %21, %15 ], [ 0, %13 ]
  %23 = call noundef i32 @_ZL17drmp3__on_seek_64P5drmp3m17drmp3_seek_origin(ptr noundef nonnull %0, i64 noundef %.sroa.0.0, i32 noundef 0)
  %.not40 = icmp eq i32 %23, 0
  br i1 %.not40, label %.loopexit, label %24

24:                                               ; preds = %22
  call void @_Z11drmp3_resetP5drmp3(ptr noundef nonnull %0)
  %.not43 = icmp eq i32 %.sroa.7.0, 0
  br i1 %.not43, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %24
  %25 = add nsw i32 %.sroa.7.0, -1
  %26 = getelementptr inbounds i8, ptr %0, i64 6768
  %27 = trunc nuw i32 %.sroa.7.0 to i16
  br label %32

28:                                               ; preds = %32
  %29 = add nuw i16 %.03342, 1
  %30 = zext i16 %29 to i32
  %31 = icmp ult i16 %29, %27
  br i1 %31, label %32, label %._crit_edge, !llvm.loop !25

32:                                               ; preds = %.lr.ph, %28
  %33 = phi i32 [ 0, %.lr.ph ], [ %30, %28 ]
  %.03342 = phi i16 [ 0, %.lr.ph ], [ %29, %28 ]
  %34 = icmp eq i32 %25, %33
  %spec.select = select i1 %34, ptr %26, ptr null
  %35 = call noundef i32 @_ZL26drmp3_decode_next_frame_exP5drmp3Pfj(ptr noundef nonnull %0, ptr noundef %spec.select, i32 noundef 1)
  %.not41 = icmp eq i32 %35, 0
  br i1 %.not41, label %.loopexit, label %28

._crit_edge:                                      ; preds = %28, %24
  %36 = sub i64 %.sroa.5.0, %.sroa.10.0
  %37 = getelementptr inbounds i8, ptr %0, i64 15984
  store i64 %36, ptr %37, align 8, !tbaa !27
  %38 = sitofp i64 %36 to double
  %39 = getelementptr inbounds i8, ptr %0, i64 16000
  %40 = load i32, ptr %39, align 8, !tbaa !28
  %41 = uitofp i32 %40 to double
  %42 = getelementptr inbounds i8, ptr %0, i64 16004
  %43 = load i32, ptr %42, align 4, !tbaa !29
  %44 = uitofp i32 %43 to double
  %45 = fdiv double %41, %44
  %46 = fmul double %45, %38
  %47 = getelementptr inbounds i8, ptr %0, i64 21176
  %48 = fptoui double %46 to i32
  %49 = uitofp i32 %48 to double
  %50 = fsub double %46, %49
  store double %50, ptr %47, align 8, !tbaa !30
  %51 = fcmp ogt double %50, 0.000000e+00
  br i1 %51, label %52, label %56

52:                                               ; preds = %._crit_edge
  %53 = getelementptr inbounds i8, ptr %0, i64 21184
  %54 = load i8, ptr %53, align 8
  %55 = or i8 %54, 1
  store i8 %55, ptr %53, align 8
  br label %56

56:                                               ; preds = %52, %._crit_edge
  %57 = sub i64 %1, %36
  %58 = call noundef i32 @_Z45drmp3_seek_forward_by_pcm_frames__brute_forceP5drmp3m(ptr noundef nonnull %0, i64 noundef %57)
  br label %.loopexit

.loopexit:                                        ; preds = %32, %22, %56
  %.2 = phi i32 [ %58, %56 ], [ 0, %22 ], [ 0, %32 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  ret i32 %.2
}

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL17drmp3__on_seek_64P5drmp3m17drmp3_seek_origin(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL26drmp3_decode_next_frame_exP5drmp3Pfj(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { noreturn 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, !12, i64 21192}
!6 = !{!"_ZTS5drmp3", !7, i64 0, !11, i64 6668, !10, i64 6688, !10, i64 6692, !12, i64 6696, !12, i64 6704, !12, i64 6712, !13, i64 6720, !10, i64 6752, !10, i64 6756, !10, i64 6760, !10, i64 6764, !8, i64 6768, !14, i64 15984, !14, i64 15992, !15, i64 16000, !12, i64 21192, !10, i64 21200, !14, i64 21208, !14, i64 21216, !12, i64 21224, !10, i64 21232, !19, i64 21240}
!7 = !{!"_ZTS8drmp3dec", !8, i64 0, !8, i64 2304, !10, i64 6144, !10, i64 6148, !8, i64 6152, !8, i64 6156}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_ZTS19drmp3dec_frame_info", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!"_ZTS26drmp3_allocation_callbacks", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}
!14 = !{!"long", !8, i64 0}
!15 = !{!"_ZTS9drmp3_src", !16, i64 0, !12, i64 24, !12, i64 32, !8, i64 40, !18, i64 1064, !8, i64 5176}
!16 = !{!"_ZTS16drmp3_src_config", !10, i64 0, !10, i64 4, !10, i64 8, !17, i64 12, !10, i64 16}
!17 = !{!"_ZTS19drmp3_src_algorithm", !8, i64 0}
!18 = !{!"_ZTS15drmp3_src_cache", !12, i64 0, !8, i64 8, !10, i64 4104, !10, i64 4108}
!19 = !{!"_ZTSN5drmp3Ut_E", !12, i64 0, !14, i64 8, !14, i64 16}
!20 = !{!6, !10, i64 21200}
!21 = !{!10, !10, i64 0}
!22 = !{!14, !14, i64 0}
!23 = !{!24, !24, i64 0}
!24 = !{!"short", !8, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!6, !14, i64 15984}
!28 = !{!6, !10, i64 16000}
!29 = !{!6, !10, i64 16004}
!30 = !{!8, !8, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass