; LLVM IR from Overload-Technologies/Overload :: Dependencies/soloud/src/audiosource/speech/klatt.ll (ZN5klatt9initsynthEiPh)

; 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.Element = type { ptr, i8, i8, i8, i8, ptr, ptr, i32, [19 x %class.Interp] }
%class.Interp = type { float, float, i8, i8, i8 }
%class.klatt = type <{ %class.resonator, %class.resonator, %class.resonator, %class.resonator, %class.resonator, %class.resonator, %class.resonator, %class.resonator, %class.resonator, %class.resonator, %class.resonator, %class.resonator, i32, float, float, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, float, float, float, float, i32, float, float, float, float, float, i32, i32, ptr, i32, %class.klatt_frame, [4 x i8], ptr, i32, i32, %class.Slope, %class.Slope, float, [4 x i8] }>
%class.resonator = type { float, float, float, float, float }
%class.klatt_frame = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%class.Slope = type { float, i32 }

@_ZL8gElement = external hidden global [69 x %class.Element], align 16

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN5klatt9initsynthEiPh(ptr noundef nonnull align 8 dereferenceable(564) %0, i32 noundef %1, ptr noundef %2) #0 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  %7 = load ptr, ptr %4, align 8
  %8 = load ptr, ptr %6, align 8, !tbaa !5
  %9 = getelementptr inbounds %class.klatt, ptr %7, i32 0, i32 40
  store ptr %8, ptr %9, align 8, !tbaa !11
  %10 = load i32, ptr %5, align 4, !tbaa !9
  %11 = getelementptr inbounds %class.klatt, ptr %7, i32 0, i32 39
  store i32 %10, ptr %11, align 4, !tbaa !17
  %12 = getelementptr inbounds %class.klatt, ptr %7, i32 0, i32 41
  store i32 0, ptr %12, align 8, !tbaa !18
  %13 = getelementptr inbounds %class.klatt, ptr %7, i32 0, i32 44
  store ptr @_ZL8gElement, ptr %13, align 8, !tbaa !19
  %14 = getelementptr inbounds %class.klatt, ptr %7, i32 0, i32 38
  store i32 5, ptr %14, align 8, !tbaa !20
  %15 = getelementptr inbounds %class.klatt, ptr %7, i32 0, i32 45
  store i32 0, ptr %15, align 8, !tbaa !21
  %16 = getelementptr inbounds %class.klatt, ptr %7, i32 0, i32 46
  store i32 0, ptr %16, align 4, !tbaa !22
  %17 = getelementptr inbounds %class.klatt, ptr %7, i32 0, i32 12
  %18 = load i32, ptr %17, align 8, !tbaa !23
  %19 = getelementptr inbounds %class.klatt, ptr %7, i32 0, i32 42
  %20 = getelementptr inbounds %class.klatt_frame, ptr %19, i32 0, i32 0
  store i32 %18, ptr %20, align 4, !tbaa !24
  %21 = getelementptr inbounds %class.klatt, ptr %7, i32 0, i32 42
  %22 = getelementptr inbounds %class.klatt_frame, ptr %21, i32 0, i32 0
  %23 = load i32, ptr %22, align 4, !tbaa !24
  %24 = sitofp i32 %23 to float
  %25 = fmul float 0x3FF19999A0000000, %24
  %26 = getelementptr inbounds %class.klatt, ptr %7, i32 0, i32 49
  store float %25, ptr %26, align 8, !tbaa !25
  %27 = getelementptr inbounds %class.klatt, ptr %7, i32 0, i32 44
  %28 = load ptr, ptr %27, align 8, !tbaa !19
  %29 = getelementptr inbounds %class.Element, ptr %28, i32 0, i32 8
  %30 = getelementptr inbounds [19 x %class.Interp], ptr %29, i64 0, i64 0
  %31 = getelementptr inbounds %class.Interp, ptr %30, i32 0, i32 0
  %32 = load float, ptr %31, align 4, !tbaa !26
  %33 = fptosi float %32 to i32
  %34 = getelementptr inbounds %class.klatt, ptr %7, i32 0, i32 42
  %35 = getelementptr inbounds %class.klatt_frame, ptr %34, i32 0, i32 16
  store i32 %33, ptr %35, align 4, !tbaa !28
  %36 = getelementptr inbounds %class.klatt, ptr %7, i32 0, i32 42
  %37 = getelementptr inbounds %class.klatt_frame, ptr %36, i32 0, i32 3
  store i32 60, ptr %37, align 4, !tbaa !29
  %38 = getelementptr inbounds %class.klatt, ptr %7, i32 0, i32 42
  %39 = getelementptr inbounds %class.klatt_frame, ptr %38, i32 0, i32 25
  store i32 60, ptr %39, align 4, !tbaa !30
  %40 = getelementptr inbounds %class.klatt, ptr %7, i32 0, i32 42
  %41 = getelementptr inbounds %class.klatt_frame, ptr %40, i32 0, i32 5
  store i32 90, ptr %41, align 4, !tbaa !31
  %42 = getelementptr inbounds %class.klatt, ptr %7, i32 0, i32 42
  %43 = getelementptr inbounds %class.klatt_frame, ptr %42, i32 0, i32 27
  store i32 90, ptr %43, align 4, !tbaa !32
  %44 = getelementptr inbounds %class.klatt, ptr %7, i32 0, i32 42
  %45 = getelementptr inbounds %class.klatt_frame, ptr %44, i32 0, i32 7
  store i32 150, ptr %45, align 4, !tbaa !33
  %46 = getelementptr inbounds %class.klatt, ptr %7, i32 0, i32 42
  %47 = getelementptr inbounds %class.klatt_frame, ptr %46, i32 0, i32 29
  store i32 150, ptr %47, align 4, !tbaa !34
  %48 = getelementptr inbounds %class.klatt, ptr %7, i32 0, i32 47
  %49 = getelementptr inbounds %class.Slope, ptr %48, i32 0, i32 1
  store i32 40, ptr %49, align 4, !tbaa !35
  %50 = getelementptr inbounds %class.klatt, ptr %7, i32 0, i32 48
  %51 = getelementptr inbounds %class.Slope, ptr %50, i32 0, i32 1
  store i32 40, ptr %51, align 4, !tbaa !36
  %52 = getelementptr inbounds %class.klatt, ptr %7, i32 0, i32 48
  %53 = getelementptr inbounds %class.Slope, ptr %52, i32 0, i32 0
  store float 0.000000e+00, ptr %53, align 8, !tbaa !37
  ret void
}

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

!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 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 352}
!12 = !{!"_ZTS5klatt", !13, i64 0, !13, i64 20, !13, i64 40, !13, i64 60, !13, i64 80, !13, i64 100, !13, i64 120, !13, i64 140, !13, i64 160, !13, i64 180, !13, i64 200, !13, i64 220, !10, i64 240, !14, i64 244, !14, i64 248, !10, i64 252, !10, i64 256, !10, i64 260, !10, i64 264, !10, i64 268, !10, i64 272, !10, i64 276, !10, i64 280, !10, i64 284, !10, i64 288, !10, i64 292, !10, i64 296, !14, i64 300, !14, i64 304, !14, i64 308, !14, i64 312, !14, i64 316, !10, i64 320, !14, i64 324, !14, i64 328, !14, i64 332, !14, i64 336, !14, i64 340, !10, i64 344, !10, i64 348, !6, i64 352, !10, i64 360, !15, i64 364, !6, i64 528, !10, i64 536, !10, i64 540, !16, i64 544, !16, i64 552, !14, i64 560}
!13 = !{!"_ZTS9resonator", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16}
!14 = !{!"float", !7, i64 0}
!15 = !{!"_ZTS11klatt_frame", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !10, i64 112, !10, i64 116, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132, !10, i64 136, !10, i64 140, !10, i64 144, !10, i64 148, !10, i64 152, !10, i64 156}
!16 = !{!"_ZTS5Slope", !14, i64 0, !10, i64 4}
!17 = !{!12, !10, i64 348}
!18 = !{!12, !10, i64 360}
!19 = !{!12, !6, i64 528}
!20 = !{!12, !10, i64 344}
!21 = !{!12, !10, i64 536}
!22 = !{!12, !10, i64 540}
!23 = !{!12, !10, i64 240}
!24 = !{!12, !10, i64 364}
!25 = !{!12, !14, i64 560}
!26 = !{!27, !14, i64 0}
!27 = !{!"_ZTS6Interp", !14, i64 0, !14, i64 4, !7, i64 8, !7, i64 9, !7, i64 10}
!28 = !{!12, !10, i64 428}
!29 = !{!12, !10, i64 376}
!30 = !{!12, !10, i64 464}
!31 = !{!12, !10, i64 384}
!32 = !{!12, !10, i64 472}
!33 = !{!12, !10, i64 392}
!34 = !{!12, !10, i64 480}
!35 = !{!12, !10, i64 548}
!36 = !{!12, !10, i64 556}
!37 = !{!12, !14, i64 552}


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

%class.Element = type { ptr, i8, i8, i8, i8, ptr, ptr, i32, [19 x %class.Interp] }
%class.Interp = type { float, float, i8, i8, i8 }

@_ZL8gElement = external hidden global [69 x %class.Element], align 16

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local void @_ZN5klatt9initsynthEiPh(ptr nocapture noundef nonnull align 8 dereferenceable(564) %0, i32 noundef %1, ptr noundef %2) local_unnamed_addr #0 align 2 {
  %4 = getelementptr inbounds i8, ptr %0, i64 352
  store ptr %2, ptr %4, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 348
  store i32 %1, ptr %5, align 4, !tbaa !15
  %6 = getelementptr inbounds i8, ptr %0, i64 360
  store i32 0, ptr %6, align 8, !tbaa !16
  %7 = getelementptr inbounds i8, ptr %0, i64 528
  store ptr @_ZL8gElement, ptr %7, align 8, !tbaa !17
  %8 = getelementptr inbounds i8, ptr %0, i64 344
  store i32 5, ptr %8, align 8, !tbaa !18
  %9 = getelementptr inbounds i8, ptr %0, i64 536
  store i32 0, ptr %9, align 8, !tbaa !19
  %10 = getelementptr inbounds i8, ptr %0, i64 540
  store i32 0, ptr %10, align 4, !tbaa !20
  %11 = getelementptr inbounds i8, ptr %0, i64 240
  %12 = load i32, ptr %11, align 8, !tbaa !21
  %13 = getelementptr inbounds i8, ptr %0, i64 364
  store i32 %12, ptr %13, align 4, !tbaa !22
  %14 = sitofp i32 %12 to float
  %15 = fmul float %14, 0x3FF19999A0000000
  %16 = getelementptr inbounds i8, ptr %0, i64 560
  store float %15, ptr %16, align 8, !tbaa !23
  %17 = load float, ptr getelementptr inbounds (i8, ptr @_ZL8gElement, i64 36), align 4, !tbaa !24
  %18 = fptosi float %17 to i32
  %19 = getelementptr inbounds i8, ptr %0, i64 428
  store i32 %18, ptr %19, align 4, !tbaa !26
  %20 = getelementptr inbounds i8, ptr %0, i64 376
  store i32 60, ptr %20, align 8, !tbaa !27
  %21 = getelementptr inbounds i8, ptr %0, i64 464
  store i32 60, ptr %21, align 8, !tbaa !28
  %22 = getelementptr inbounds i8, ptr %0, i64 384
  store i32 90, ptr %22, align 8, !tbaa !29
  %23 = getelementptr inbounds i8, ptr %0, i64 472
  store i32 90, ptr %23, align 8, !tbaa !30
  %24 = getelementptr inbounds i8, ptr %0, i64 392
  store i32 150, ptr %24, align 8, !tbaa !31
  %25 = getelementptr inbounds i8, ptr %0, i64 480
  store i32 150, ptr %25, align 8, !tbaa !32
  %26 = getelementptr inbounds i8, ptr %0, i64 548
  store i32 40, ptr %26, align 4, !tbaa !33
  %27 = getelementptr inbounds i8, ptr %0, i64 552
  %28 = getelementptr inbounds i8, ptr %0, i64 556
  store i32 40, ptr %28, align 4, !tbaa !34
  store float 0.000000e+00, ptr %27, align 8, !tbaa !35
  ret void
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: readwrite, inaccessiblemem: none) 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" }

!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 352}
!6 = !{!"_ZTS5klatt", !7, i64 0, !7, i64 20, !7, i64 40, !7, i64 60, !7, i64 80, !7, i64 100, !7, i64 120, !7, i64 140, !7, i64 160, !7, i64 180, !7, i64 200, !7, i64 220, !11, i64 240, !8, i64 244, !8, i64 248, !11, i64 252, !11, i64 256, !11, i64 260, !11, i64 264, !11, i64 268, !11, i64 272, !11, i64 276, !11, i64 280, !11, i64 284, !11, i64 288, !11, i64 292, !11, i64 296, !8, i64 300, !8, i64 304, !8, i64 308, !8, i64 312, !8, i64 316, !11, i64 320, !8, i64 324, !8, i64 328, !8, i64 332, !8, i64 336, !8, i64 340, !11, i64 344, !11, i64 348, !12, i64 352, !11, i64 360, !13, i64 364, !12, i64 528, !11, i64 536, !11, i64 540, !14, i64 544, !14, i64 552, !8, i64 560}
!7 = !{!"_ZTS9resonator", !8, i64 0, !8, i64 4, !8, i64 8, !8, i64 12, !8, i64 16}
!8 = !{!"float", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"any pointer", !9, i64 0}
!13 = !{!"_ZTS11klatt_frame", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !11, i64 136, !11, i64 140, !11, i64 144, !11, i64 148, !11, i64 152, !11, i64 156}
!14 = !{!"_ZTS5Slope", !8, i64 0, !11, i64 4}
!15 = !{!6, !11, i64 348}
!16 = !{!6, !11, i64 360}
!17 = !{!6, !12, i64 528}
!18 = !{!6, !11, i64 344}
!19 = !{!6, !11, i64 536}
!20 = !{!6, !11, i64 540}
!21 = !{!6, !11, i64 240}
!22 = !{!6, !11, i64 364}
!23 = !{!6, !8, i64 560}
!24 = !{!25, !8, i64 0}
!25 = !{!"_ZTS6Interp", !8, i64 0, !8, i64 4, !9, i64 8, !9, i64 9, !9, i64 10}
!26 = !{!6, !11, i64 428}
!27 = !{!6, !11, i64 376}
!28 = !{!6, !11, i64 464}
!29 = !{!6, !11, i64 384}
!30 = !{!6, !11, i64 472}
!31 = !{!6, !11, i64 392}
!32 = !{!6, !11, i64 480}
!33 = !{!6, !11, i64 548}
!34 = !{!6, !11, i64 556}
!35 = !{!6, !8, i64 552}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass