; LLVM IR from SelfishOlex/MiniAudioO3DE :: MiniAudio/Code/Source/Clients (MiniAudioImplementation)

; 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.ma_resource_manager_data_buffer = type { %struct.ma_data_source_base, ptr, ptr, i32, i32, i32, i64, i32, i32, i32, i32, %union.anon.71 }
%struct.ma_data_source_base = type { ptr, i64, i64, i64, i64, ptr, ptr, ptr, i32 }
%union.anon.71 = type { %struct.ma_decoder }
%struct.ma_decoder = type { %struct.ma_data_source_base, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, i32, i32, i32, %struct.ma_data_converter, ptr, i64, i64, i64, %struct.ma_allocation_callbacks, %union.anon.61 }
%struct.ma_data_converter = type { i32, i32, i32, i32, i32, i32, i32, i32, %struct.ma_channel_converter, %struct.ma_resampler, i8, i8, i8, i8, i8, i8, ptr }
%struct.ma_channel_converter = type { i32, i32, i32, i32, i32, ptr, ptr, ptr, %union.anon.27, ptr, i32 }
%union.anon.27 = type { ptr }
%struct.ma_resampler = type { ptr, ptr, ptr, i32, i32, i32, i32, %union.anon.28, ptr, i32 }
%union.anon.28 = type { %struct.ma_linear_resampler }
%struct.ma_linear_resampler = type { %struct.ma_linear_resampler_config, i32, i32, i32, i32, %union.anon.29, %union.anon.30, %struct.ma_lpf, ptr, i32 }
%struct.ma_linear_resampler_config = type { i32, i32, i32, i32, i32, double }
%union.anon.29 = type { ptr }
%union.anon.30 = type { ptr }
%struct.ma_lpf = type { i32, i32, i32, i32, i32, ptr, ptr, ptr, i32 }
%struct.ma_allocation_callbacks = type { ptr, ptr, ptr, ptr }
%union.anon.61 = type { %struct.anon.63 }
%struct.anon.63 = type { ptr, i64, i64 }

@.str.6 = external hidden unnamed_addr constant [104 x i8], align 1
@.str.157 = external hidden unnamed_addr constant [82 x i8], align 1
@__PRETTY_FUNCTION__.ma_resource_manager_data_buffer_read_pcm_frames = external hidden unnamed_addr constant [125 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 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) #1

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

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

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

17:                                               ; preds = %4
  %18 = load ptr, ptr %9, align 8, !tbaa !5
  store i64 0, ptr %18, align 8, !tbaa !9
  br label %19

19:                                               ; preds = %17, %4
  %20 = load i64, ptr %8, align 8, !tbaa !9
  %21 = icmp eq i64 %20, 0
  br i1 %21, label %22, label %23

22:                                               ; preds = %19
  store i32 -2, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %126

23:                                               ; preds = %19
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.ma_resource_manager_data_buffer, ptr %24, i32 0, i32 2
  %26 = load ptr, ptr %25, align 8, !tbaa !15
  %27 = call noundef i32 @_ZL43ma_resource_manager_data_buffer_node_resultPK36ma_resource_manager_data_buffer_node(ptr noundef %26)
  %28 = icmp ne i32 %27, -22
  br i1 %28, label %29, label %30

29:                                               ; preds = %23
  br label %32

30:                                               ; preds = %23
  call void @__assert_fail(ptr noundef @.str.157, ptr noundef @.str.6, i32 noundef 66038, ptr noundef @__PRETTY_FUNCTION__.ma_resource_manager_data_buffer_read_pcm_frames) #5
  unreachable

31:                                               ; No predecessors!
  br label %32

32:                                               ; preds = %31, %29
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.ma_resource_manager_data_buffer, ptr %33, i32 0, i32 2
  %35 = load ptr, ptr %34, align 8, !tbaa !15
  %36 = call noundef i32 @_ZL57ma_resource_manager_data_buffer_node_get_data_supply_typeP36ma_resource_manager_data_buffer_node(ptr noundef %35)
  %37 = icmp eq i32 %36, 0
  br i1 %37, label %38, label %39

38:                                               ; preds = %32
  store i32 -19, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %126

39:                                               ; preds = %32
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.ma_resource_manager_data_buffer, ptr %40, i32 0, i32 7
  %42 = load i32, ptr %41, align 8, !tbaa !18
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %58

44:                                               ; preds = %39
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.ma_resource_manager_data_buffer, ptr %45, i32 0, i32 7
  store i32 0, ptr %46, align 8, !tbaa !18
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = call noundef ptr @_ZL45ma_resource_manager_data_buffer_get_connectorP31ma_resource_manager_data_buffer(ptr noundef %47)
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.ma_resource_manager_data_buffer, ptr %49, i32 0, i32 6
  %51 = load i64, ptr %50, align 8, !tbaa !19
  %52 = call i32 @ma_data_source_seek_to_pcm_frame(ptr noundef %48, i64 noundef %51)
  store i32 %52, ptr %10, align 4, !tbaa !11
  %53 = load i32, ptr %10, align 4, !tbaa !11
  %54 = icmp ne i32 %53, 0
  br i1 %54, label %55, label %57

55:                                               ; preds = %44
  %56 = load i32, ptr %10, align 4, !tbaa !11
  store i32 %56, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %126

57:                                               ; preds = %44
  br label %58

58:                                               ; preds = %57, %39
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.ma_resource_manager_data_buffer, ptr %59, i32 0, i32 2
  %61 = load ptr, ptr %60, align 8, !tbaa !15
  %62 = call noundef i32 @_ZL57ma_resource_manager_data_buffer_node_get_data_supply_typeP36ma_resource_manager_data_buffer_node(ptr noundef %61)
  %63 = icmp eq i32 %62, 2
  br i1 %63, label %64, label %87

64:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.ma_resource_manager_data_buffer, ptr %65, i32 0, i32 2
  %67 = load ptr, ptr %66, align 8, !tbaa !15
  %68 = call noundef i32 @_ZL43ma_resource_manager_data_buffer_node_resultPK36ma_resource_manager_data_buffer_node(ptr noundef %67)
  %69 = icmp eq i32 %68, -19
  %70 = zext i1 %69 to i32
  store i32 %70, ptr %12, align 4, !tbaa !13
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = call i32 @ma_resource_manager_data_buffer_get_available_frames(ptr noundef %71, ptr noundef %14)
  %73 = icmp eq i32 %72, 0
  br i1 %73, label %74, label %86

74:                                               ; preds = %64
  %75 = load i64, ptr %8, align 8, !tbaa !9
  %76 = load i64, ptr %14, align 8, !tbaa !9
  %77 = icmp ugt i64 %75, %76
  br i1 %77, label %78, label %84

78:                                               ; preds = %74
  %79 = load i64, ptr %14, align 8, !tbaa !9
  store i64 %79, ptr %8, align 8, !tbaa !9
  %80 = load i64, ptr %8, align 8, !tbaa !9
  %81 = icmp eq i64 %80, 0
  br i1 %81, label %82, label %83

82:                                               ; preds = %78
  store i32 -17, ptr %10, align 4, !tbaa !11
  br label %83

83:                                               ; preds = %82, %78
  br label %85

84:                                               ; preds = %74
  store i32 0, ptr %12, align 4, !tbaa !13
  br label %85

85:                                               ; preds = %84, %83
  br label %86

86:                                               ; preds = %85, %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %87

87:                                               ; preds = %86, %58
  %88 = load i64, ptr %8, align 8, !tbaa !9
  %89 = icmp ugt i64 %88, 0
  br i1 %89, label %90, label %96

90:                                               ; preds = %87
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = call noundef ptr @_ZL45ma_resource_manager_data_buffer_get_connectorP31ma_resource_manager_data_buffer(ptr noundef %91)
  %93 = load ptr, ptr %7, align 8, !tbaa !5
  %94 = load i64, ptr %8, align 8, !tbaa !9
  %95 = call i32 @ma_data_source_read_pcm_frames(ptr noundef %92, ptr noundef %93, i64 noundef %94, ptr noundef %11)
  store i32 %95, ptr %10, align 4, !tbaa !11
  br label %96

96:                                               ; preds = %90, %87
  %97 = load i32, ptr %10, align 4, !tbaa !11
  %98 = icmp eq i32 %97, -17
  br i1 %98, label %99, label %107

99:                                               ; preds = %96
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.ma_resource_manager_data_buffer, ptr %100, i32 0, i32 2
  %102 = load ptr, ptr %101, align 8, !tbaa !15
  %103 = call noundef i32 @_ZL43ma_resource_manager_data_buffer_node_resultPK36ma_resource_manager_data_buffer_node(ptr noundef %102)
  %104 = icmp eq i32 %103, -19
  br i1 %104, label %105, label %106

105:                                              ; preds = %99
  store i32 -19, ptr %10, align 4, !tbaa !11
  br label %106

106:                                              ; preds = %105, %99
  br label %107

107:                                              ; preds = %106, %96
  %108 = load i32, ptr %12, align 4, !tbaa !13
  %109 = icmp ne i32 %108, 0
  br i1 %109, label %110, label %111

110:                                              ; preds = %107
  store i32 -19, ptr %10, align 4, !tbaa !11
  br label %111

111:                                              ; preds = %110, %107
  %112 = load ptr, ptr %9, align 8, !tbaa !5
  %113 = icmp ne ptr %112, null
  br i1 %113, label %114, label %117

114:                                              ; preds = %111
  %115 = load i64, ptr %11, align 8, !tbaa !9
  %116 = load ptr, ptr %9, align 8, !tbaa !5
  store i64 %115, ptr %116, align 8, !tbaa !9
  br label %117

117:                                              ; preds = %114, %111
  %118 = load i32, ptr %10, align 4, !tbaa !11
  %119 = icmp eq i32 %118, 0
  br i1 %119, label %120, label %124

120:                                              ; preds = %117
  %121 = load i64, ptr %11, align 8, !tbaa !9
  %122 = icmp eq i64 %121, 0
  br i1 %122, label %123, label %124

123:                                              ; preds = %120
  store i32 -17, ptr %10, align 4, !tbaa !11
  br label %124

124:                                              ; preds = %123, %120, %117
  %125 = load i32, ptr %10, align 4, !tbaa !11
  store i32 %125, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %126

126:                                              ; preds = %124, %55, %38, %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  %127 = load i32, ptr %5, align 4
  ret i32 %127
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL43ma_resource_manager_data_buffer_node_resultPK36ma_resource_manager_data_buffer_node(ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL57ma_resource_manager_data_buffer_node_get_data_supply_typeP36ma_resource_manager_data_buffer_node(ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZL45ma_resource_manager_data_buffer_get_connectorP31ma_resource_manager_data_buffer(ptr noundef) #2

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

attributes #0 = { 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 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 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 = { 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, !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 long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTS9ma_result", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !6, i64 80}
!16 = !{!"_ZTS31ma_resource_manager_data_buffer", !17, i64 0, !6, i64 72, !6, i64 80, !14, i64 88, !14, i64 92, !14, i64 96, !10, i64 104, !14, i64 112, !12, i64 116, !14, i64 120, !14, i64 124, !7, i64 128}
!17 = !{!"_ZTS19ma_data_source_base", !6, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !14, i64 64}
!18 = !{!16, !14, i64 112}
!19 = !{!16, !10, i64 104}


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

@.str.6 = external hidden unnamed_addr constant [104 x i8], align 1
@.str.157 = external hidden unnamed_addr constant [82 x i8], align 1
@__PRETTY_FUNCTION__.ma_resource_manager_data_buffer_read_pcm_frames = external hidden unnamed_addr constant [125 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 uwtable
declare dso_local i32 @ma_data_source_read_pcm_frames(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

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

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

7:                                                ; preds = %4
  store i64 0, ptr %3, align 8, !tbaa !5
  br label %8

8:                                                ; preds = %7, %4
  %9 = icmp eq i64 %2, 0
  br i1 %9, label %57, label %10

10:                                               ; preds = %8
  %11 = getelementptr inbounds i8, ptr %0, i64 80
  %12 = load ptr, ptr %11, align 8, !tbaa !9
  %13 = tail call noundef i32 @_ZL43ma_resource_manager_data_buffer_node_resultPK36ma_resource_manager_data_buffer_node(ptr noundef %12)
  %.not39 = icmp eq i32 %13, -22
  br i1 %.not39, label %14, label %15

14:                                               ; preds = %10
  tail call void @__assert_fail(ptr noundef nonnull @.str.157, ptr noundef nonnull @.str.6, i32 noundef 66038, ptr noundef nonnull @__PRETTY_FUNCTION__.ma_resource_manager_data_buffer_read_pcm_frames) #5
  unreachable

15:                                               ; preds = %10
  %16 = load ptr, ptr %11, align 8, !tbaa !9
  %17 = tail call noundef i32 @_ZL57ma_resource_manager_data_buffer_node_get_data_supply_typeP36ma_resource_manager_data_buffer_node(ptr noundef %16)
  %18 = icmp eq i32 %17, 0
  br i1 %18, label %57, label %19

19:                                               ; preds = %15
  %20 = getelementptr inbounds i8, ptr %0, i64 112
  %21 = load i32, ptr %20, align 8, !tbaa !15
  %.not40 = icmp eq i32 %21, 0
  br i1 %.not40, label %27, label %22

22:                                               ; preds = %19
  store i32 0, ptr %20, align 8, !tbaa !15
  %23 = tail call noundef ptr @_ZL45ma_resource_manager_data_buffer_get_connectorP31ma_resource_manager_data_buffer(ptr noundef nonnull %0)
  %24 = getelementptr inbounds i8, ptr %0, i64 104
  %25 = load i64, ptr %24, align 8, !tbaa !16
  %26 = tail call i32 @ma_data_source_seek_to_pcm_frame(ptr noundef %23, i64 noundef %25)
  %.not41 = icmp eq i32 %26, 0
  br i1 %.not41, label %27, label %57

27:                                               ; preds = %22, %19
  %28 = load ptr, ptr %11, align 8, !tbaa !9
  %29 = tail call noundef i32 @_ZL57ma_resource_manager_data_buffer_node_get_data_supply_typeP36ma_resource_manager_data_buffer_node(ptr noundef %28)
  %30 = icmp eq i32 %29, 2
  br i1 %30, label %31, label %.thread

31:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %32 = load ptr, ptr %11, align 8, !tbaa !9
  %33 = tail call noundef i32 @_ZL43ma_resource_manager_data_buffer_node_resultPK36ma_resource_manager_data_buffer_node(ptr noundef %32)
  %34 = icmp eq i32 %33, -19
  %35 = call i32 @ma_resource_manager_data_buffer_get_available_frames(ptr noundef nonnull %0, ptr noundef nonnull %6)
  %36 = icmp eq i32 %35, 0
  br i1 %36, label %37, label %.thread54

37:                                               ; preds = %31
  %38 = load i64, ptr %6, align 8, !tbaa !5
  %39 = icmp ult i64 %38, %2
  br i1 %39, label %41, label %.thread54

.thread54:                                        ; preds = %31, %37
  %.0.shrunk.ph = phi i1 [ false, %37 ], [ %34, %31 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  %40 = xor i1 %.0.shrunk.ph, true
  br label %.thread

41:                                               ; preds = %37
  %42 = icmp eq i64 %38, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  %43 = xor i1 %34, true
  br i1 %42, label %46, label %.thread

.thread:                                          ; preds = %27, %.thread54, %41
  %.152 = phi i1 [ %43, %41 ], [ %40, %.thread54 ], [ true, %27 ]
  %.13251 = phi i64 [ %38, %41 ], [ %2, %.thread54 ], [ %2, %27 ]
  %44 = call noundef ptr @_ZL45ma_resource_manager_data_buffer_get_connectorP31ma_resource_manager_data_buffer(ptr noundef nonnull %0)
  %45 = call i32 @ma_data_source_read_pcm_frames(ptr noundef %44, ptr noundef %1, i64 noundef %.13251, ptr noundef nonnull %5)
  br label %46

46:                                               ; preds = %.thread, %41
  %.153 = phi i1 [ %.152, %.thread ], [ %43, %41 ]
  %.3 = phi i32 [ %45, %.thread ], [ -17, %41 ]
  %47 = icmp eq i32 %.3, -17
  br i1 %47, label %48, label %52

48:                                               ; preds = %46
  %49 = load ptr, ptr %11, align 8, !tbaa !9
  %50 = call noundef i32 @_ZL43ma_resource_manager_data_buffer_node_resultPK36ma_resource_manager_data_buffer_node(ptr noundef %49)
  %51 = icmp eq i32 %50, -19
  %spec.select45 = select i1 %51, i32 -19, i32 -17
  br label %52

52:                                               ; preds = %48, %46
  %.4 = phi i32 [ %.3, %46 ], [ %spec.select45, %48 ]
  %spec.select46 = select i1 %.153, i32 %.4, i32 -19
  %.pre = load i64, ptr %5, align 8
  br i1 %.not, label %54, label %53

53:                                               ; preds = %52
  store i64 %.pre, ptr %3, align 8, !tbaa !5
  br label %54

54:                                               ; preds = %53, %52
  %55 = icmp eq i32 %spec.select46, 0
  %56 = icmp eq i64 %.pre, 0
  %or.cond = select i1 %55, i1 %56, i1 false
  %spec.store.select = select i1 %or.cond, i32 -17, i32 %spec.select46
  br label %57

57:                                               ; preds = %22, %15, %8, %54
  %.030 = phi i32 [ %spec.store.select, %54 ], [ -2, %8 ], [ -19, %15 ], [ %26, %22 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  ret i32 %.030
}

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

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

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZL45ma_resource_manager_data_buffer_get_connectorP31ma_resource_manager_data_buffer(ptr noundef) local_unnamed_addr #2

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

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 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 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 = { 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, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !12, i64 80}
!10 = !{!"_ZTS31ma_resource_manager_data_buffer", !11, i64 0, !12, i64 72, !12, i64 80, !13, i64 88, !13, i64 92, !13, i64 96, !6, i64 104, !13, i64 112, !14, i64 116, !13, i64 120, !13, i64 124, !7, i64 128}
!11 = !{!"_ZTS19ma_data_source_base", !12, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !13, i64 64}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTS9ma_result", !7, i64 0}
!15 = !{!10, !13, i64 112}
!16 = !{!10, !6, i64 104}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass