; 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_data_source_vtable = type { ptr, ptr, ptr, ptr, ptr, ptr, i32 }
%struct.ma_noise_heap_layout = type { i64, %struct.anon.66, %struct.anon.67 }
%struct.anon.66 = type { i64, i64, i64 }
%struct.anon.67 = type { i64 }
%struct.ma_data_source_config = type { ptr }
%struct.ma_noise = type { %struct.ma_data_source_vtable, %struct.ma_noise_config, %struct.ma_lcg, %union.anon.68, ptr, i32 }
%struct.ma_noise_config = type { i32, i32, i32, i32, double, i32 }
%struct.ma_lcg = type { i32 }
%union.anon.68 = type { %struct.anon.69 }
%struct.anon.69 = type { ptr, ptr, ptr }
%struct.anon.70 = type { ptr }

@_ZL29g_ma_noise_data_source_vtable = external hidden global %struct.ma_data_source_vtable, align 8

; 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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

; 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) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @ma_data_source_config_init() #3

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

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

; Function Attrs: mustprogress uwtable
define dso_local i32 @ma_noise_init_preallocated(ptr noundef %0, ptr noundef %1, ptr noundef %2) #4 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %struct.ma_noise_heap_layout, align 8
  %10 = alloca %struct.ma_data_source_config, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %struct.ma_data_source_config, align 8
  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
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 40, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %14 = load ptr, ptr %7, align 8, !tbaa !5
  %15 = icmp eq ptr %14, null
  br i1 %15, label %16, label %17

16:                                               ; preds = %3
  store i32 -2, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %164

17:                                               ; preds = %3
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %18, i8 0, i64 136, i1 false)
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = call noundef i32 @_ZL24ma_noise_get_heap_layoutPK15ma_noise_configP20ma_noise_heap_layout(ptr noundef %19, ptr noundef %9)
  store i32 %20, ptr %8, align 4, !tbaa !9
  %21 = load i32, ptr %8, align 4, !tbaa !9
  %22 = icmp ne i32 %21, 0
  br i1 %22, label %23, label %25

23:                                               ; preds = %17
  %24 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %24, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %164

25:                                               ; preds = %17
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.ma_noise, ptr %27, i32 0, i32 4
  store ptr %26, ptr %28, align 8, !tbaa !11
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.ma_noise, ptr %29, i32 0, i32 4
  %31 = load ptr, ptr %30, align 8, !tbaa !11
  %32 = getelementptr inbounds %struct.ma_noise_heap_layout, ptr %9, i32 0, i32 0
  %33 = load i64, ptr %32, align 8, !tbaa !20
  call void @llvm.memset.p0.i64(ptr align 1 %31, i8 0, i64 %33, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %34 = call ptr @ma_data_source_config_init()
  %35 = getelementptr inbounds %struct.ma_data_source_config, ptr %13, i32 0, i32 0
  store ptr %34, ptr %35, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 %13, i64 8, i1 false), !tbaa.struct !25
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  %36 = getelementptr inbounds %struct.ma_data_source_config, ptr %10, i32 0, i32 0
  store ptr @_ZL29g_ma_noise_data_source_vtable, ptr %36, align 8, !tbaa !26
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.ma_noise, ptr %37, i32 0, i32 0
  %39 = call i32 @ma_data_source_init(ptr noundef %10, ptr noundef %38)
  store i32 %39, ptr %8, align 4, !tbaa !9
  %40 = load i32, ptr %8, align 4, !tbaa !9
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %42, label %44

42:                                               ; preds = %25
  %43 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %43, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %164

44:                                               ; preds = %25
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.ma_noise, ptr %46, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %47, ptr align 8 %45, i64 32, i1 false), !tbaa.struct !28
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.ma_noise, ptr %48, i32 0, i32 2
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.ma_noise_config, ptr %50, i32 0, i32 3
  %52 = load i32, ptr %51, align 4, !tbaa !33
  call void @_ZL11ma_lcg_seedP6ma_lcgi(ptr noundef %49, i32 noundef %52)
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.ma_noise, ptr %53, i32 0, i32 1
  %55 = getelementptr inbounds %struct.ma_noise_config, ptr %54, i32 0, i32 2
  %56 = load i32, ptr %55, align 8, !tbaa !34
  %57 = icmp eq i32 %56, 1
  br i1 %57, label %58, label %130

58:                                               ; preds = %44
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.ma_noise_heap_layout, ptr %9, i32 0, i32 1
  %61 = getelementptr inbounds %struct.anon.66, ptr %60, i32 0, i32 0
  %62 = load i64, ptr %61, align 8, !tbaa !35
  %63 = getelementptr inbounds i8, ptr %59, i64 %62
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.ma_noise, ptr %64, i32 0, i32 3
  %66 = getelementptr inbounds %struct.anon.69, ptr %65, i32 0, i32 0
  store ptr %63, ptr %66, align 8, !tbaa !36
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.ma_noise_heap_layout, ptr %9, i32 0, i32 1
  %69 = getelementptr inbounds %struct.anon.66, ptr %68, i32 0, i32 1
  %70 = load i64, ptr %69, align 8, !tbaa !37
  %71 = getelementptr inbounds i8, ptr %67, i64 %70
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.ma_noise, ptr %72, i32 0, i32 3
  %74 = getelementptr inbounds %struct.anon.69, ptr %73, i32 0, i32 1
  store ptr %71, ptr %74, align 8, !tbaa !36
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.ma_noise_heap_layout, ptr %9, i32 0, i32 1
  %77 = getelementptr inbounds %struct.anon.66, ptr %76, i32 0, i32 2
  %78 = load i64, ptr %77, align 8, !tbaa !38
  %79 = getelementptr inbounds i8, ptr %75, i64 %78
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.ma_noise, ptr %80, i32 0, i32 3
  %82 = getelementptr inbounds %struct.anon.69, ptr %81, i32 0, i32 2
  store ptr %79, ptr %82, align 8, !tbaa !36
  store i32 0, ptr %11, align 4, !tbaa !30
  br label %83

83:                                               ; preds = %126, %58
  %84 = load i32, ptr %11, align 4, !tbaa !30
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.ma_noise_config, ptr %85, i32 0, i32 1
  %87 = load i32, ptr %86, align 4, !tbaa !39
  %88 = icmp ult i32 %84, %87
  br i1 %88, label %89, label %129

89:                                               ; preds = %83
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.ma_noise_heap_layout, ptr %9, i32 0, i32 1
  %92 = getelementptr inbounds %struct.anon.66, ptr %91, i32 0, i32 0
  %93 = load i64, ptr %92, align 8, !tbaa !35
  %94 = load ptr, ptr %5, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.ma_noise_config, ptr %94, i32 0, i32 1
  %96 = load i32, ptr %95, align 4, !tbaa !39
  %97 = zext i32 %96 to i64
  %98 = mul i64 8, %97
  %99 = add i64 %93, %98
  %100 = load i32, ptr %11, align 4, !tbaa !30
  %101 = zext i32 %100 to i64
  %102 = mul i64 128, %101
  %103 = add i64 %99, %102
  %104 = getelementptr inbounds i8, ptr %90, i64 %103
  %105 = load ptr, ptr %7, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.ma_noise, ptr %105, i32 0, i32 3
  %107 = getelementptr inbounds %struct.anon.69, ptr %106, i32 0, i32 0
  %108 = load ptr, ptr %107, align 8, !tbaa !36
  %109 = load i32, ptr %11, align 4, !tbaa !30
  %110 = zext i32 %109 to i64
  %111 = getelementptr inbounds ptr, ptr %108, i64 %110
  store ptr %104, ptr %111, align 8, !tbaa !5
  %112 = load ptr, ptr %7, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.ma_noise, ptr %112, i32 0, i32 3
  %114 = getelementptr inbounds %struct.anon.69, ptr %113, i32 0, i32 1
  %115 = load ptr, ptr %114, align 8, !tbaa !36
  %116 = load i32, ptr %11, align 4, !tbaa !30
  %117 = zext i32 %116 to i64
  %118 = getelementptr inbounds double, ptr %115, i64 %117
  store double 0.000000e+00, ptr %118, align 8, !tbaa !32
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.ma_noise, ptr %119, i32 0, i32 3
  %121 = getelementptr inbounds %struct.anon.69, ptr %120, i32 0, i32 2
  %122 = load ptr, ptr %121, align 8, !tbaa !36
  %123 = load i32, ptr %11, align 4, !tbaa !30
  %124 = zext i32 %123 to i64
  %125 = getelementptr inbounds i32, ptr %122, i64 %124
  store i32 1, ptr %125, align 4, !tbaa !30
  br label %126

126:                                              ; preds = %89
  %127 = load i32, ptr %11, align 4, !tbaa !30
  %128 = add i32 %127, 1
  store i32 %128, ptr %11, align 4, !tbaa !30
  br label %83, !llvm.loop !40

129:                                              ; preds = %83
  br label %130

130:                                              ; preds = %129, %44
  %131 = load ptr, ptr %7, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.ma_noise, ptr %131, i32 0, i32 1
  %133 = getelementptr inbounds %struct.ma_noise_config, ptr %132, i32 0, i32 2
  %134 = load i32, ptr %133, align 8, !tbaa !34
  %135 = icmp eq i32 %134, 2
  br i1 %135, label %136, label %163

136:                                              ; preds = %130
  %137 = load ptr, ptr %6, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.ma_noise_heap_layout, ptr %9, i32 0, i32 2
  %139 = getelementptr inbounds %struct.anon.67, ptr %138, i32 0, i32 0
  %140 = load i64, ptr %139, align 8, !tbaa !42
  %141 = getelementptr inbounds i8, ptr %137, i64 %140
  %142 = load ptr, ptr %7, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.ma_noise, ptr %142, i32 0, i32 3
  %144 = getelementptr inbounds %struct.anon.70, ptr %143, i32 0, i32 0
  store ptr %141, ptr %144, align 8, !tbaa !36
  store i32 0, ptr %11, align 4, !tbaa !30
  br label %145

145:                                              ; preds = %159, %136
  %146 = load i32, ptr %11, align 4, !tbaa !30
  %147 = load ptr, ptr %5, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.ma_noise_config, ptr %147, i32 0, i32 1
  %149 = load i32, ptr %148, align 4, !tbaa !39
  %150 = icmp ult i32 %146, %149
  br i1 %150, label %151, label %162

151:                                              ; preds = %145
  %152 = load ptr, ptr %7, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.ma_noise, ptr %152, i32 0, i32 3
  %154 = getelementptr inbounds %struct.anon.70, ptr %153, i32 0, i32 0
  %155 = load ptr, ptr %154, align 8, !tbaa !36
  %156 = load i32, ptr %11, align 4, !tbaa !30
  %157 = zext i32 %156 to i64
  %158 = getelementptr inbounds double, ptr %155, i64 %157
  store double 0.000000e+00, ptr %158, align 8, !tbaa !32
  br label %159

159:                                              ; preds = %151
  %160 = load i32, ptr %11, align 4, !tbaa !30
  %161 = add i32 %160, 1
  store i32 %161, ptr %11, align 4, !tbaa !30
  br label %145, !llvm.loop !43

162:                                              ; preds = %145
  br label %163

163:                                              ; preds = %162, %130
  store i32 0, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %164

164:                                              ; preds = %163, %42, %23, %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  %165 = load i32, ptr %4, align 4
  ret i32 %165
}

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden void @_ZL11ma_lcg_seedP6ma_lcgi(ptr noundef, i32 noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { alwaysinline 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 #6 = { 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 = !{!"_ZTS9ma_result", !7, i64 0}
!11 = !{!12, !6, i64 120}
!12 = !{!"_ZTS8ma_noise", !13, i64 0, !15, i64 56, !19, i64 88, !7, i64 96, !6, i64 120, !14, i64 128}
!13 = !{!"_ZTS21ma_data_source_vtable", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !14, i64 48}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTS15ma_noise_config", !16, i64 0, !14, i64 4, !17, i64 8, !14, i64 12, !18, i64 16, !14, i64 24}
!16 = !{!"_ZTS9ma_format", !7, i64 0}
!17 = !{!"_ZTS13ma_noise_type", !7, i64 0}
!18 = !{!"double", !7, i64 0}
!19 = !{!"_ZTS6ma_lcg", !14, i64 0}
!20 = !{!21, !22, i64 0}
!21 = !{!"_ZTS20ma_noise_heap_layout", !22, i64 0, !23, i64 8, !24, i64 32}
!22 = !{!"long", !7, i64 0}
!23 = !{!"_ZTSN20ma_noise_heap_layoutUt_E", !22, i64 0, !22, i64 8, !22, i64 16}
!24 = !{!"_ZTSN20ma_noise_heap_layoutUt0_E", !22, i64 0}
!25 = !{i64 0, i64 8, !5}
!26 = !{!27, !6, i64 0}
!27 = !{!"_ZTS21ma_data_source_config", !6, i64 0}
!28 = !{i64 0, i64 4, !29, i64 4, i64 4, !30, i64 8, i64 4, !31, i64 12, i64 4, !30, i64 16, i64 8, !32, i64 24, i64 4, !30}
!29 = !{!16, !16, i64 0}
!30 = !{!14, !14, i64 0}
!31 = !{!17, !17, i64 0}
!32 = !{!18, !18, i64 0}
!33 = !{!15, !14, i64 12}
!34 = !{!12, !17, i64 64}
!35 = !{!21, !22, i64 8}
!36 = !{!7, !7, i64 0}
!37 = !{!21, !22, i64 16}
!38 = !{!21, !22, i64 24}
!39 = !{!15, !14, i64 4}
!40 = distinct !{!40, !41}
!41 = !{!"llvm.loop.mustprogress"}
!42 = !{!21, !22, i64 32}
!43 = distinct !{!43, !41}


; 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.ma_data_source_vtable = type { ptr, ptr, ptr, ptr, ptr, ptr, i32 }
%struct.ma_noise_heap_layout = type { i64, %struct.anon.66, %struct.anon.67 }
%struct.anon.66 = type { i64, i64, i64 }
%struct.anon.67 = type { i64 }
%struct.ma_data_source_config = type { ptr }

@_ZL29g_ma_noise_data_source_vtable = external hidden global %struct.ma_data_source_vtable, align 8

; 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

; Function Attrs: mustprogress 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) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @ma_data_source_config_init() local_unnamed_addr #3

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local i32 @ma_noise_init_preallocated(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #3 {
  %4 = alloca %struct.ma_noise_heap_layout, align 8
  %5 = alloca %struct.ma_data_source_config, align 8
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %6 = icmp eq ptr %2, null
  br i1 %6, label %._crit_edge, label %7

7:                                                ; preds = %3
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(136) %2, i8 0, i64 136, i1 false)
  %8 = call noundef i32 @_ZL24ma_noise_get_heap_layoutPK15ma_noise_configP20ma_noise_heap_layout(ptr noundef %0, ptr noundef nonnull %4)
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %9, label %._crit_edge

9:                                                ; preds = %7
  %10 = getelementptr inbounds i8, ptr %2, i64 120
  store ptr %1, ptr %10, align 8, !tbaa !5
  %11 = load i64, ptr %4, align 8, !tbaa !17
  call void @llvm.memset.p0.i64(ptr align 1 %1, i8 0, i64 %11, i1 false)
  %12 = call ptr @ma_data_source_config_init()
  store ptr @_ZL29g_ma_noise_data_source_vtable, ptr %5, align 8, !tbaa !22
  %13 = call i32 @ma_data_source_init(ptr noundef nonnull %5, ptr noundef nonnull %2)
  %.not47 = icmp eq i32 %13, 0
  br i1 %.not47, label %14, label %._crit_edge

14:                                               ; preds = %9
  %15 = getelementptr inbounds i8, ptr %2, i64 56
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef nonnull align 8 dereferenceable(32) %0, i64 32, i1 false), !tbaa.struct !24
  %16 = getelementptr inbounds i8, ptr %2, i64 88
  %17 = getelementptr inbounds i8, ptr %0, i64 12
  %18 = load i32, ptr %17, align 4, !tbaa !29
  call void @_ZL11ma_lcg_seedP6ma_lcgi(ptr noundef nonnull %16, i32 noundef %18)
  %19 = getelementptr inbounds i8, ptr %2, i64 64
  %20 = load i32, ptr %19, align 8, !tbaa !30
  switch i32 %20, label %._crit_edge [
    i32 1, label %21
    i32 2, label %51
  ]

21:                                               ; preds = %14
  %22 = getelementptr inbounds i8, ptr %4, i64 8
  %23 = load i64, ptr %22, align 8, !tbaa !31
  %24 = getelementptr i8, ptr %1, i64 %23
  %25 = getelementptr inbounds i8, ptr %2, i64 96
  store ptr %24, ptr %25, align 8, !tbaa !32
  %26 = getelementptr inbounds i8, ptr %4, i64 16
  %27 = load i64, ptr %26, align 8, !tbaa !33
  %28 = getelementptr inbounds i8, ptr %1, i64 %27
  %29 = getelementptr inbounds i8, ptr %2, i64 104
  store ptr %28, ptr %29, align 8, !tbaa !32
  %30 = getelementptr inbounds i8, ptr %4, i64 24
  %31 = load i64, ptr %30, align 8, !tbaa !34
  %32 = getelementptr inbounds i8, ptr %1, i64 %31
  %33 = getelementptr inbounds i8, ptr %2, i64 112
  store ptr %32, ptr %33, align 8, !tbaa !32
  %34 = getelementptr inbounds i8, ptr %0, i64 4
  %35 = load i32, ptr %34, align 4, !tbaa !35
  %.not53 = icmp eq i32 %35, 0
  br i1 %.not53, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %21, %.lr.ph
  %indvars.iv56 = phi i64 [ %indvars.iv.next57, %.lr.ph ], [ 0, %21 ]
  %36 = phi i32 [ %48, %.lr.ph ], [ %35, %21 ]
  %37 = zext i32 %36 to i64
  %38 = shl nuw nsw i64 %37, 3
  %39 = shl nuw nsw i64 %indvars.iv56, 7
  %40 = getelementptr i8, ptr %24, i64 %38
  %41 = getelementptr i8, ptr %40, i64 %39
  %42 = load ptr, ptr %25, align 8, !tbaa !32
  %43 = getelementptr inbounds ptr, ptr %42, i64 %indvars.iv56
  store ptr %41, ptr %43, align 8, !tbaa !36
  %44 = load ptr, ptr %29, align 8, !tbaa !32
  %45 = getelementptr inbounds double, ptr %44, i64 %indvars.iv56
  store double 0.000000e+00, ptr %45, align 8, !tbaa !28
  %46 = load ptr, ptr %33, align 8, !tbaa !32
  %47 = getelementptr inbounds i32, ptr %46, i64 %indvars.iv56
  store i32 1, ptr %47, align 4, !tbaa !26
  %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
  %48 = load i32, ptr %34, align 4, !tbaa !35
  %49 = zext i32 %48 to i64
  %50 = icmp ult i64 %indvars.iv.next57, %49
  br i1 %50, label %.lr.ph, label %._crit_edge, !llvm.loop !37

51:                                               ; preds = %14
  %52 = getelementptr inbounds i8, ptr %4, i64 32
  %53 = load i64, ptr %52, align 8, !tbaa !39
  %54 = getelementptr inbounds i8, ptr %1, i64 %53
  %55 = getelementptr inbounds i8, ptr %2, i64 96
  store ptr %54, ptr %55, align 8, !tbaa !32
  %56 = getelementptr inbounds i8, ptr %0, i64 4
  %57 = load i32, ptr %56, align 4, !tbaa !35
  %.not52 = icmp eq i32 %57, 0
  br i1 %.not52, label %._crit_edge, label %.lr.ph51.preheader

.lr.ph51.preheader:                               ; preds = %51
  %wide.trip.count = zext i32 %57 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %58 = icmp ult i32 %57, 4
  br i1 %58, label %._crit_edge.loopexit61.unr-lcssa, label %.lr.ph51.preheader.new

.lr.ph51.preheader.new:                           ; preds = %.lr.ph51.preheader
  %unroll_iter = and i64 %wide.trip.count, 4294967292
  br label %.lr.ph51

.lr.ph51:                                         ; preds = %.lr.ph51, %.lr.ph51.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph51.preheader.new ], [ %indvars.iv.next.3, %.lr.ph51 ]
  %niter = phi i64 [ 0, %.lr.ph51.preheader.new ], [ %niter.next.3, %.lr.ph51 ]
  %59 = load ptr, ptr %55, align 8, !tbaa !32
  %60 = getelementptr inbounds double, ptr %59, i64 %indvars.iv
  store double 0.000000e+00, ptr %60, align 8, !tbaa !28
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %61 = load ptr, ptr %55, align 8, !tbaa !32
  %62 = getelementptr inbounds double, ptr %61, i64 %indvars.iv.next
  store double 0.000000e+00, ptr %62, align 8, !tbaa !28
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %63 = load ptr, ptr %55, align 8, !tbaa !32
  %64 = getelementptr inbounds double, ptr %63, i64 %indvars.iv.next.1
  store double 0.000000e+00, ptr %64, align 8, !tbaa !28
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %65 = load ptr, ptr %55, align 8, !tbaa !32
  %66 = getelementptr inbounds double, ptr %65, i64 %indvars.iv.next.2
  store double 0.000000e+00, ptr %66, align 8, !tbaa !28
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.loopexit61.unr-lcssa, label %.lr.ph51, !llvm.loop !40

._crit_edge.loopexit61.unr-lcssa:                 ; preds = %.lr.ph51, %.lr.ph51.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph51.preheader ], [ %indvars.iv.next.3, %.lr.ph51 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph51.epil

.lr.ph51.epil:                                    ; preds = %._crit_edge.loopexit61.unr-lcssa, %.lr.ph51.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph51.epil ], [ %indvars.iv.unr, %._crit_edge.loopexit61.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph51.epil ], [ 0, %._crit_edge.loopexit61.unr-lcssa ]
  %67 = load ptr, ptr %55, align 8, !tbaa !32
  %68 = getelementptr inbounds double, ptr %67, i64 %indvars.iv.epil
  store double 0.000000e+00, ptr %68, align 8, !tbaa !28
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %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 %._crit_edge, label %.lr.ph51.epil, !llvm.loop !41

._crit_edge:                                      ; preds = %._crit_edge.loopexit61.unr-lcssa, %.lr.ph51.epil, %.lr.ph, %51, %21, %14, %9, %7, %3
  %.0 = phi i32 [ -2, %3 ], [ %8, %7 ], [ %13, %9 ], [ 0, %14 ], [ 0, %21 ], [ 0, %51 ], [ 0, %.lr.ph ], [ 0, %.lr.ph51.epil ], [ 0, %._crit_edge.loopexit61.unr-lcssa ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #5
  ret i32 %.0
}

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden void @_ZL11ma_lcg_seedP6ma_lcgi(ptr noundef, i32 noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { alwaysinline 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 #5 = { 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, !8, i64 120}
!6 = !{!"_ZTS8ma_noise", !7, i64 0, !12, i64 56, !16, i64 88, !9, i64 96, !8, i64 120, !11, i64 128}
!7 = !{!"_ZTS21ma_data_source_vtable", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24, !8, i64 32, !8, i64 40, !11, i64 48}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"_ZTS15ma_noise_config", !13, i64 0, !11, i64 4, !14, i64 8, !11, i64 12, !15, i64 16, !11, i64 24}
!13 = !{!"_ZTS9ma_format", !9, i64 0}
!14 = !{!"_ZTS13ma_noise_type", !9, i64 0}
!15 = !{!"double", !9, i64 0}
!16 = !{!"_ZTS6ma_lcg", !11, i64 0}
!17 = !{!18, !19, i64 0}
!18 = !{!"_ZTS20ma_noise_heap_layout", !19, i64 0, !20, i64 8, !21, i64 32}
!19 = !{!"long", !9, i64 0}
!20 = !{!"_ZTSN20ma_noise_heap_layoutUt_E", !19, i64 0, !19, i64 8, !19, i64 16}
!21 = !{!"_ZTSN20ma_noise_heap_layoutUt0_E", !19, i64 0}
!22 = !{!23, !8, i64 0}
!23 = !{!"_ZTS21ma_data_source_config", !8, i64 0}
!24 = !{i64 0, i64 4, !25, i64 4, i64 4, !26, i64 8, i64 4, !27, i64 12, i64 4, !26, i64 16, i64 8, !28, i64 24, i64 4, !26}
!25 = !{!13, !13, i64 0}
!26 = !{!11, !11, i64 0}
!27 = !{!14, !14, i64 0}
!28 = !{!15, !15, i64 0}
!29 = !{!12, !11, i64 12}
!30 = !{!6, !14, i64 64}
!31 = !{!18, !19, i64 8}
!32 = !{!9, !9, i64 0}
!33 = !{!18, !19, i64 16}
!34 = !{!18, !19, i64 24}
!35 = !{!12, !11, i64 4}
!36 = !{!8, !8, i64 0}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = !{!18, !19, i64 32}
!40 = distinct !{!40, !38}
!41 = distinct !{!41, !42}
!42 = !{!"llvm.loop.unroll.disable"}


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