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

; 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.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 }

; 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

declare void @_ZN9resonator13initResonatorEiii(ptr noundef nonnull align 4 dereferenceable(20), i32 noundef, i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5klatt4initEiffi(ptr noundef nonnull align 8 dereferenceable(564) %0, i32 noundef %1, float noundef %2, float noundef %3, i32 noundef %4) #2 align 2 {
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store float %2, ptr %8, align 4, !tbaa !11
  store float %3, ptr %9, align 4, !tbaa !11
  store i32 %4, ptr %10, align 4, !tbaa !9
  %13 = load ptr, ptr %6, align 8
  %14 = load i32, ptr %7, align 4, !tbaa !9
  %15 = getelementptr inbounds %class.klatt, ptr %13, i32 0, i32 12
  store i32 %14, ptr %15, align 8, !tbaa !13
  %16 = load float, ptr %8, align 4, !tbaa !11
  %17 = getelementptr inbounds %class.klatt, ptr %13, i32 0, i32 13
  store float %16, ptr %17, align 4, !tbaa !18
  %18 = load float, ptr %9, align 4, !tbaa !11
  %19 = getelementptr inbounds %class.klatt, ptr %13, i32 0, i32 14
  store float %18, ptr %19, align 8, !tbaa !19
  %20 = load i32, ptr %10, align 4, !tbaa !9
  %21 = getelementptr inbounds %class.klatt, ptr %13, i32 0, i32 15
  store i32 %20, ptr %21, align 4, !tbaa !20
  %22 = getelementptr inbounds %class.klatt, ptr %13, i32 0, i32 17
  store i32 11025, ptr %22, align 4, !tbaa !21
  %23 = getelementptr inbounds %class.klatt, ptr %13, i32 0, i32 16
  store i32 0, ptr %23, align 8, !tbaa !22
  %24 = getelementptr inbounds %class.klatt, ptr %13, i32 0, i32 12
  %25 = load i32, ptr %24, align 8, !tbaa !13
  %26 = getelementptr inbounds %class.klatt, ptr %13, i32 0, i32 19
  store i32 %25, ptr %26, align 4, !tbaa !23
  %27 = getelementptr inbounds %class.klatt, ptr %13, i32 0, i32 12
  %28 = load i32, ptr %27, align 8, !tbaa !13
  %29 = getelementptr inbounds %class.klatt, ptr %13, i32 0, i32 42
  %30 = getelementptr inbounds %class.klatt_frame, ptr %29, i32 0, i32 0
  store i32 %28, ptr %30, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %31 = getelementptr inbounds %class.klatt, ptr %13, i32 0, i32 17
  %32 = load i32, ptr %31, align 4, !tbaa !21
  %33 = mul nsw i32 950, %32
  %34 = sdiv i32 %33, 10000
  store i32 %34, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %35 = getelementptr inbounds %class.klatt, ptr %13, i32 0, i32 17
  %36 = load i32, ptr %35, align 4, !tbaa !21
  %37 = mul nsw i32 630, %36
  %38 = sdiv i32 %37, 10000
  store i32 %38, ptr %12, align 4, !tbaa !9
  %39 = getelementptr inbounds %class.klatt, ptr %13, i32 0, i32 17
  %40 = load i32, ptr %39, align 4, !tbaa !21
  %41 = sitofp i32 %40 to float
  %42 = getelementptr inbounds %class.klatt, ptr %13, i32 0, i32 13
  %43 = load float, ptr %42, align 4, !tbaa !18
  %44 = fmul float %41, %43
  %45 = fptosi float %44 to i32
  %46 = sdiv i32 %45, 1000
  %47 = getelementptr inbounds %class.klatt, ptr %13, i32 0, i32 18
  store i32 %46, ptr %47, align 8, !tbaa !25
  %48 = getelementptr inbounds %class.klatt, ptr %13, i32 0, i32 10
  %49 = load i32, ptr %11, align 4, !tbaa !9
  %50 = load i32, ptr %12, align 4, !tbaa !9
  %51 = getelementptr inbounds %class.klatt, ptr %13, i32 0, i32 17
  %52 = load i32, ptr %51, align 4, !tbaa !21
  call void @_ZN9resonator13initResonatorEiii(ptr noundef nonnull align 4 dereferenceable(20) %48, i32 noundef %49, i32 noundef %50, i32 noundef %52)
  %53 = getelementptr inbounds %class.klatt, ptr %13, i32 0, i32 23
  store i32 0, ptr %53, align 4, !tbaa !26
  %54 = getelementptr inbounds %class.klatt, ptr %13, i32 0, i32 24
  store i32 0, ptr %54, align 8, !tbaa !27
  %55 = getelementptr inbounds %class.klatt, ptr %13, i32 0, i32 33
  store float 0.000000e+00, ptr %55, align 4, !tbaa !28
  %56 = getelementptr inbounds %class.klatt, ptr %13, i32 0, i32 34
  store float 0.000000e+00, ptr %56, align 8, !tbaa !29
  %57 = getelementptr inbounds %class.klatt, ptr %13, i32 0, i32 35
  store float 0.000000e+00, ptr %57, align 4, !tbaa !30
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !10, i64 240}
!14 = !{!"_ZTS5klatt", !15, i64 0, !15, i64 20, !15, i64 40, !15, i64 60, !15, i64 80, !15, i64 100, !15, i64 120, !15, i64 140, !15, i64 160, !15, i64 180, !15, i64 200, !15, i64 220, !10, i64 240, !12, i64 244, !12, 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, !12, i64 300, !12, i64 304, !12, i64 308, !12, i64 312, !12, i64 316, !10, i64 320, !12, i64 324, !12, i64 328, !12, i64 332, !12, i64 336, !12, i64 340, !10, i64 344, !10, i64 348, !6, i64 352, !10, i64 360, !16, i64 364, !6, i64 528, !10, i64 536, !10, i64 540, !17, i64 544, !17, i64 552, !12, i64 560}
!15 = !{!"_ZTS9resonator", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16}
!16 = !{!"_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}
!17 = !{!"_ZTS5Slope", !12, i64 0, !10, i64 4}
!18 = !{!14, !12, i64 244}
!19 = !{!14, !12, i64 248}
!20 = !{!14, !10, i64 252}
!21 = !{!14, !10, i64 260}
!22 = !{!14, !10, i64 256}
!23 = !{!14, !10, i64 268}
!24 = !{!14, !10, i64 364}
!25 = !{!14, !10, i64 264}
!26 = !{!14, !10, i64 284}
!27 = !{!14, !10, i64 288}
!28 = !{!14, !12, i64 324}
!29 = !{!14, !12, i64 328}
!30 = !{!14, !12, i64 332}


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

declare void @_ZN9resonator13initResonatorEiii(ptr noundef nonnull align 4 dereferenceable(20), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5klatt4initEiffi(ptr noundef nonnull align 8 dereferenceable(564) %0, i32 noundef %1, float noundef %2, float noundef %3, i32 noundef %4) local_unnamed_addr #1 align 2 {
  %6 = getelementptr inbounds i8, ptr %0, i64 240
  store i32 %1, ptr %6, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 244
  store float %2, ptr %7, align 4, !tbaa !15
  %8 = getelementptr inbounds i8, ptr %0, i64 248
  store float %3, ptr %8, align 8, !tbaa !16
  %9 = getelementptr inbounds i8, ptr %0, i64 252
  store i32 %4, ptr %9, align 4, !tbaa !17
  %10 = getelementptr inbounds i8, ptr %0, i64 260
  store i32 11025, ptr %10, align 4, !tbaa !18
  %11 = getelementptr inbounds i8, ptr %0, i64 256
  store i32 0, ptr %11, align 8, !tbaa !19
  %12 = getelementptr inbounds i8, ptr %0, i64 268
  store i32 %1, ptr %12, align 4, !tbaa !20
  %13 = getelementptr inbounds i8, ptr %0, i64 364
  store i32 %1, ptr %13, align 4, !tbaa !21
  %14 = fmul float %2, 1.102500e+04
  %15 = fptosi float %14 to i32
  %16 = sdiv i32 %15, 1000
  %17 = getelementptr inbounds i8, ptr %0, i64 264
  store i32 %16, ptr %17, align 8, !tbaa !22
  %18 = getelementptr inbounds i8, ptr %0, i64 200
  tail call void @_ZN9resonator13initResonatorEiii(ptr noundef nonnull align 4 dereferenceable(20) %18, i32 noundef 1047, i32 noundef 694, i32 noundef 11025)
  %19 = getelementptr inbounds i8, ptr %0, i64 284
  store i32 0, ptr %19, align 4, !tbaa !23
  %20 = getelementptr inbounds i8, ptr %0, i64 288
  store i32 0, ptr %20, align 8, !tbaa !24
  %21 = getelementptr inbounds i8, ptr %0, i64 324
  store <2 x float> zeroinitializer, ptr %21, align 4, !tbaa !25
  %22 = getelementptr inbounds i8, ptr %0, i64 332
  store float 0.000000e+00, ptr %22, align 4, !tbaa !26
  ret void
}

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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, !11, i64 240}
!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, !8, i64 244}
!16 = !{!6, !8, i64 248}
!17 = !{!6, !11, i64 252}
!18 = !{!6, !11, i64 260}
!19 = !{!6, !11, i64 256}
!20 = !{!6, !11, i64 268}
!21 = !{!6, !11, i64 364}
!22 = !{!6, !11, i64 264}
!23 = !{!6, !11, i64 284}
!24 = !{!6, !11, i64 288}
!25 = !{!8, !8, i64 0}
!26 = !{!6, !8, i64 332}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SLPVectorizerPass,SROAPass,TailCallElimPass