; LLVM IR from Overload-Technologies/Overload :: Dependencies/soloud/src/audiosource/speech (soloud_speech)

; 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.SoLoud::SpeechInstance" = type { %"class.SoLoud::AudioSourceInstance", %class.klatt, ptr, ptr, i32, i32 }
%"class.SoLoud::AudioSourceInstance" = type { ptr, i32, i32, i32, float, [8 x float], float, float, float, float, i32, float, float, double, double, %"class.SoLoud::Fader", %"class.SoLoud::Fader", %"class.SoLoud::Fader", %"class.SoLoud::Fader", %"class.SoLoud::Fader", i32, [8 x float], i32, i32, [8 x ptr], [2 x ptr], i32, i32, i32, double }
%"class.SoLoud::Fader" = type { float, float, float, double, double, double, float, i32 }
%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 }
%"class.SoLoud::Speech" = type { %"class.SoLoud::AudioSource", i32, float, float, i32, i32, [4 x i8], %class.darray }
%"class.SoLoud::AudioSource" = type { ptr, i32, float, float, i32, i32, float, float, float, i32, float, [8 x ptr], ptr, ptr, ptr, i32, double }
%class.darray = type <{ ptr, i32, i32, i32, [4 x i8] }>

declare void @_ZN5klatt4initEiffi(ptr noundef nonnull align 8 dereferenceable(564), i32 noundef, float noundef, float noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6SoLoud14SpeechInstance8getAudioEPfjj(ptr noundef nonnull align 8 dereferenceable(1088) %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) unnamed_addr #1 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !9
  %12 = load ptr, ptr %5, align 8
  %13 = getelementptr inbounds %"class.SoLoud::SpeechInstance", ptr %12, i32 0, i32 1
  %14 = getelementptr inbounds %"class.SoLoud::SpeechInstance", ptr %12, i32 0, i32 2
  %15 = load ptr, ptr %14, align 8, !tbaa !11
  %16 = getelementptr inbounds %"class.SoLoud::Speech", ptr %15, i32 0, i32 1
  %17 = load i32, ptr %16, align 8, !tbaa !21
  %18 = getelementptr inbounds %"class.SoLoud::SpeechInstance", ptr %12, i32 0, i32 2
  %19 = load ptr, ptr %18, align 8, !tbaa !11
  %20 = getelementptr inbounds %"class.SoLoud::Speech", ptr %19, i32 0, i32 2
  %21 = load float, ptr %20, align 4, !tbaa !25
  %22 = getelementptr inbounds %"class.SoLoud::SpeechInstance", ptr %12, i32 0, i32 2
  %23 = load ptr, ptr %22, align 8, !tbaa !11
  %24 = getelementptr inbounds %"class.SoLoud::Speech", ptr %23, i32 0, i32 3
  %25 = load float, ptr %24, align 8, !tbaa !26
  %26 = getelementptr inbounds %"class.SoLoud::SpeechInstance", ptr %12, i32 0, i32 2
  %27 = load ptr, ptr %26, align 8, !tbaa !11
  %28 = getelementptr inbounds %"class.SoLoud::Speech", ptr %27, i32 0, i32 4
  %29 = load i32, ptr %28, align 4, !tbaa !27
  call void @_ZN5klatt4initEiffi(ptr noundef nonnull align 8 dereferenceable(564) %13, i32 noundef %17, float noundef %21, float noundef %25, i32 noundef %29)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !9
  %30 = getelementptr inbounds %"class.SoLoud::SpeechInstance", ptr %12, i32 0, i32 4
  %31 = load i32, ptr %30, align 8, !tbaa !28
  %32 = getelementptr inbounds %"class.SoLoud::SpeechInstance", ptr %12, i32 0, i32 5
  %33 = load i32, ptr %32, align 4, !tbaa !29
  %34 = icmp sgt i32 %31, %33
  br i1 %34, label %35, label %62

35:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %36 = getelementptr inbounds %"class.SoLoud::SpeechInstance", ptr %12, i32 0, i32 4
  %37 = load i32, ptr %36, align 8, !tbaa !28
  %38 = getelementptr inbounds %"class.SoLoud::SpeechInstance", ptr %12, i32 0, i32 5
  %39 = load i32, ptr %38, align 4, !tbaa !29
  %40 = sub nsw i32 %37, %39
  store i32 %40, ptr %10, align 4, !tbaa !9
  %41 = load i32, ptr %10, align 4, !tbaa !9
  %42 = load i32, ptr %7, align 4, !tbaa !9
  %43 = icmp ugt i32 %41, %42
  br i1 %43, label %44, label %46

44:                                               ; preds = %35
  %45 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %45, ptr %10, align 4, !tbaa !9
  br label %46

46:                                               ; preds = %44, %35
  %47 = getelementptr inbounds %"class.SoLoud::SpeechInstance", ptr %12, i32 0, i32 3
  %48 = load ptr, ptr %47, align 8, !tbaa !30
  %49 = getelementptr inbounds %"class.SoLoud::SpeechInstance", ptr %12, i32 0, i32 5
  %50 = load i32, ptr %49, align 4, !tbaa !29
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds i16, ptr %48, i64 %51
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = load i32, ptr %10, align 4, !tbaa !9
  call void @_ZN6SoLoudL12writesamplesEPsPfi(ptr noundef %52, ptr noundef %53, i32 noundef %54)
  %55 = load i32, ptr %10, align 4, !tbaa !9
  %56 = getelementptr inbounds %"class.SoLoud::SpeechInstance", ptr %12, i32 0, i32 5
  %57 = load i32, ptr %56, align 4, !tbaa !29
  %58 = add i32 %57, %55
  store i32 %58, ptr %56, align 4, !tbaa !29
  %59 = load i32, ptr %10, align 4, !tbaa !9
  %60 = load i32, ptr %9, align 4, !tbaa !9
  %61 = add i32 %60, %59
  store i32 %61, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %62

62:                                               ; preds = %46, %4
  br label %63

63:                                               ; preds = %113, %62
  %64 = getelementptr inbounds %"class.SoLoud::SpeechInstance", ptr %12, i32 0, i32 4
  %65 = load i32, ptr %64, align 8, !tbaa !28
  %66 = icmp sge i32 %65, 0
  br i1 %66, label %67, label %71

67:                                               ; preds = %63
  %68 = load i32, ptr %9, align 4, !tbaa !9
  %69 = load i32, ptr %7, align 4, !tbaa !9
  %70 = icmp ult i32 %68, %69
  br label %71

71:                                               ; preds = %67, %63
  %72 = phi i1 [ false, %63 ], [ %70, %67 ]
  br i1 %72, label %73, label %114

73:                                               ; preds = %71
  %74 = getelementptr inbounds %"class.SoLoud::SpeechInstance", ptr %12, i32 0, i32 5
  store i32 0, ptr %74, align 4, !tbaa !29
  %75 = getelementptr inbounds %"class.SoLoud::SpeechInstance", ptr %12, i32 0, i32 1
  %76 = getelementptr inbounds %"class.SoLoud::SpeechInstance", ptr %12, i32 0, i32 1
  %77 = getelementptr inbounds %class.klatt, ptr %76, i32 0, i32 18
  %78 = load i32, ptr %77, align 8, !tbaa !31
  %79 = getelementptr inbounds %"class.SoLoud::SpeechInstance", ptr %12, i32 0, i32 3
  %80 = load ptr, ptr %79, align 8, !tbaa !30
  %81 = call noundef i32 @_ZN5klatt5synthEiPs(ptr noundef nonnull align 8 dereferenceable(564) %75, i32 noundef %78, ptr noundef %80)
  %82 = getelementptr inbounds %"class.SoLoud::SpeechInstance", ptr %12, i32 0, i32 4
  store i32 %81, ptr %82, align 8, !tbaa !28
  %83 = getelementptr inbounds %"class.SoLoud::SpeechInstance", ptr %12, i32 0, i32 4
  %84 = load i32, ptr %83, align 8, !tbaa !28
  %85 = icmp sgt i32 %84, 0
  br i1 %85, label %86, label %113

86:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %87 = getelementptr inbounds %"class.SoLoud::SpeechInstance", ptr %12, i32 0, i32 4
  %88 = load i32, ptr %87, align 8, !tbaa !28
  store i32 %88, ptr %11, align 4, !tbaa !9
  %89 = load i32, ptr %11, align 4, !tbaa !9
  %90 = load i32, ptr %7, align 4, !tbaa !9
  %91 = load i32, ptr %9, align 4, !tbaa !9
  %92 = sub i32 %90, %91
  %93 = icmp ugt i32 %89, %92
  br i1 %93, label %94, label %98

94:                                               ; preds = %86
  %95 = load i32, ptr %7, align 4, !tbaa !9
  %96 = load i32, ptr %9, align 4, !tbaa !9
  %97 = sub i32 %95, %96
  store i32 %97, ptr %11, align 4, !tbaa !9
  br label %98

98:                                               ; preds = %94, %86
  %99 = getelementptr inbounds %"class.SoLoud::SpeechInstance", ptr %12, i32 0, i32 3
  %100 = load ptr, ptr %99, align 8, !tbaa !30
  %101 = load ptr, ptr %6, align 8, !tbaa !5
  %102 = load i32, ptr %9, align 4, !tbaa !9
  %103 = zext i32 %102 to i64
  %104 = getelementptr inbounds float, ptr %101, i64 %103
  %105 = load i32, ptr %11, align 4, !tbaa !9
  call void @_ZN6SoLoudL12writesamplesEPsPfi(ptr noundef %100, ptr noundef %104, i32 noundef %105)
  %106 = load i32, ptr %11, align 4, !tbaa !9
  %107 = getelementptr inbounds %"class.SoLoud::SpeechInstance", ptr %12, i32 0, i32 5
  %108 = load i32, ptr %107, align 4, !tbaa !29
  %109 = add i32 %108, %106
  store i32 %109, ptr %107, align 4, !tbaa !29
  %110 = load i32, ptr %11, align 4, !tbaa !9
  %111 = load i32, ptr %9, align 4, !tbaa !9
  %112 = add i32 %111, %110
  store i32 %112, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %113

113:                                              ; preds = %98, %73
  br label %63, !llvm.loop !32

114:                                              ; preds = %71
  %115 = load i32, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  ret i32 %115
}

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

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

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

declare noundef i32 @_ZN5klatt5synthEiPs(ptr noundef nonnull align 8 dereferenceable(564), i32 noundef, ptr noundef) #0

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" }
attributes #2 = { nocallback nofree nosync 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 = { 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, !6, i64 1064}
!12 = !{!"_ZTSN6SoLoud14SpeechInstanceE", !13, i64 0, !17, i64 496, !6, i64 1064, !6, i64 1072, !10, i64 1080, !10, i64 1084}
!13 = !{!"_ZTSN6SoLoud19AudioSourceInstanceE", !10, i64 8, !10, i64 12, !10, i64 16, !14, i64 20, !7, i64 24, !14, i64 56, !14, i64 60, !14, i64 64, !14, i64 68, !10, i64 72, !14, i64 76, !14, i64 80, !15, i64 88, !15, i64 96, !16, i64 104, !16, i64 152, !16, i64 200, !16, i64 248, !16, i64 296, !10, i64 344, !7, i64 348, !10, i64 380, !10, i64 384, !7, i64 392, !7, i64 456, !10, i64 472, !10, i64 476, !10, i64 480, !15, i64 488}
!14 = !{!"float", !7, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = !{!"_ZTSN6SoLoud5FaderE", !14, i64 0, !14, i64 4, !14, i64 8, !15, i64 16, !15, i64 24, !15, i64 32, !14, i64 40, !10, i64 44}
!17 = !{!"_ZTS5klatt", !18, i64 0, !18, i64 20, !18, i64 40, !18, i64 60, !18, i64 80, !18, i64 100, !18, i64 120, !18, i64 140, !18, i64 160, !18, i64 180, !18, i64 200, !18, 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, !19, i64 364, !6, i64 528, !10, i64 536, !10, i64 540, !20, i64 544, !20, i64 552, !14, i64 560}
!18 = !{!"_ZTS9resonator", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16}
!19 = !{!"_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}
!20 = !{!"_ZTS5Slope", !14, i64 0, !10, i64 4}
!21 = !{!22, !10, i64 152}
!22 = !{!"_ZTSN6SoLoud6SpeechE", !23, i64 0, !10, i64 152, !14, i64 156, !14, i64 160, !10, i64 164, !10, i64 168, !24, i64 176}
!23 = !{!"_ZTSN6SoLoud11AudioSourceE", !10, i64 8, !14, i64 12, !14, i64 16, !10, i64 20, !10, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !10, i64 40, !14, i64 44, !7, i64 48, !6, i64 112, !6, i64 120, !6, i64 128, !10, i64 136, !15, i64 144}
!24 = !{!"_ZTS6darray", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16}
!25 = !{!22, !14, i64 156}
!26 = !{!22, !14, i64 160}
!27 = !{!22, !10, i64 164}
!28 = !{!12, !10, i64 1080}
!29 = !{!12, !10, i64 1084}
!30 = !{!12, !6, i64 1072}
!31 = !{!12, !10, i64 760}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}


; 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 @_ZN5klatt4initEiffi(ptr noundef nonnull align 8 dereferenceable(564), i32 noundef, float noundef, float noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6SoLoud14SpeechInstance8getAudioEPfjj(ptr noundef nonnull align 8 dereferenceable(1088) %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) unnamed_addr #1 align 2 {
  %5 = getelementptr inbounds i8, ptr %0, i64 496
  %6 = getelementptr inbounds i8, ptr %0, i64 1064
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %7, i64 152
  %9 = load i32, ptr %8, align 8, !tbaa !19
  %10 = getelementptr inbounds i8, ptr %7, i64 156
  %11 = load float, ptr %10, align 4, !tbaa !23
  %12 = getelementptr inbounds i8, ptr %7, i64 160
  %13 = load float, ptr %12, align 8, !tbaa !24
  %14 = getelementptr inbounds i8, ptr %7, i64 164
  %15 = load i32, ptr %14, align 4, !tbaa !25
  tail call void @_ZN5klatt4initEiffi(ptr noundef nonnull align 8 dereferenceable(564) %5, i32 noundef %9, float noundef %11, float noundef %13, i32 noundef %15)
  %16 = getelementptr inbounds i8, ptr %0, i64 1080
  %17 = load i32, ptr %16, align 8, !tbaa !26
  %18 = getelementptr inbounds i8, ptr %0, i64 1084
  %19 = load i32, ptr %18, align 4, !tbaa !27
  %20 = icmp sgt i32 %17, %19
  br i1 %20, label %21, label %29

21:                                               ; preds = %4
  %22 = sub nsw i32 %17, %19
  %spec.select = tail call i32 @llvm.umin.i32(i32 %22, i32 %2)
  %23 = getelementptr inbounds i8, ptr %0, i64 1072
  %24 = load ptr, ptr %23, align 8, !tbaa !28
  %25 = sext i32 %19 to i64
  %26 = getelementptr inbounds i16, ptr %24, i64 %25
  tail call void @_ZN6SoLoudL12writesamplesEPsPfi(ptr noundef %26, ptr noundef %1, i32 noundef %spec.select)
  %27 = load i32, ptr %18, align 4, !tbaa !27
  %28 = add i32 %27, %spec.select
  store i32 %28, ptr %18, align 4, !tbaa !27
  %.pre = load i32, ptr %16, align 8, !tbaa !26
  br label %29

29:                                               ; preds = %21, %4
  %30 = phi i32 [ %.pre, %21 ], [ %17, %4 ]
  %.023 = phi i32 [ %spec.select, %21 ], [ 0, %4 ]
  %31 = icmp sgt i32 %30, -1
  %32 = icmp ult i32 %.023, %2
  %33 = and i1 %31, %32
  br i1 %33, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %29
  %34 = getelementptr inbounds i8, ptr %0, i64 760
  %35 = getelementptr inbounds i8, ptr %0, i64 1072
  br label %36

36:                                               ; preds = %.lr.ph, %49
  %.132 = phi i32 [ %.023, %.lr.ph ], [ %.2, %49 ]
  store i32 0, ptr %18, align 4, !tbaa !27
  %37 = load i32, ptr %34, align 8, !tbaa !29
  %38 = load ptr, ptr %35, align 8, !tbaa !28
  %39 = tail call noundef i32 @_ZN5klatt5synthEiPs(ptr noundef nonnull align 8 dereferenceable(564) %5, i32 noundef %37, ptr noundef %38)
  store i32 %39, ptr %16, align 8, !tbaa !26
  %40 = icmp sgt i32 %39, 0
  br i1 %40, label %41, label %49

41:                                               ; preds = %36
  %42 = sub i32 %2, %.132
  %spec.select31 = tail call i32 @llvm.umin.i32(i32 %39, i32 %42)
  %43 = load ptr, ptr %35, align 8, !tbaa !28
  %44 = zext i32 %.132 to i64
  %45 = getelementptr inbounds float, ptr %1, i64 %44
  tail call void @_ZN6SoLoudL12writesamplesEPsPfi(ptr noundef %43, ptr noundef %45, i32 noundef %spec.select31)
  %46 = load i32, ptr %18, align 4, !tbaa !27
  %47 = add i32 %46, %spec.select31
  store i32 %47, ptr %18, align 4, !tbaa !27
  %48 = add i32 %spec.select31, %.132
  %.pre33 = load i32, ptr %16, align 8, !tbaa !26
  br label %49

49:                                               ; preds = %41, %36
  %50 = phi i32 [ %.pre33, %41 ], [ %39, %36 ]
  %.2 = phi i32 [ %48, %41 ], [ %.132, %36 ]
  %51 = icmp sgt i32 %50, -1
  %52 = icmp ult i32 %.2, %2
  %53 = select i1 %51, i1 %52, i1 false
  br i1 %53, label %36, label %._crit_edge, !llvm.loop !30

._crit_edge:                                      ; preds = %49, %29
  %.1.lcssa = phi i32 [ %.023, %29 ], [ %.2, %49 ]
  ret i32 %.1.lcssa
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN6SoLoudL12writesamplesEPsPfi(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare noundef i32 @_ZN5klatt5synthEiPs(ptr noundef nonnull align 8 dereferenceable(564), i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #3

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" }
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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, !16, i64 1064}
!6 = !{!"_ZTSN6SoLoud14SpeechInstanceE", !7, i64 0, !14, i64 496, !16, i64 1064, !16, i64 1072, !8, i64 1080, !8, i64 1084}
!7 = !{!"_ZTSN6SoLoud19AudioSourceInstanceE", !8, i64 8, !8, i64 12, !8, i64 16, !11, i64 20, !9, i64 24, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !8, i64 72, !11, i64 76, !11, i64 80, !12, i64 88, !12, i64 96, !13, i64 104, !13, i64 152, !13, i64 200, !13, i64 248, !13, i64 296, !8, i64 344, !9, i64 348, !8, i64 380, !8, i64 384, !9, i64 392, !9, i64 456, !8, i64 472, !8, i64 476, !8, i64 480, !12, i64 488}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"float", !9, i64 0}
!12 = !{!"double", !9, i64 0}
!13 = !{!"_ZTSN6SoLoud5FaderE", !11, i64 0, !11, i64 4, !11, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !11, i64 40, !8, i64 44}
!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, !8, i64 240, !11, i64 244, !11, i64 248, !8, i64 252, !8, i64 256, !8, i64 260, !8, i64 264, !8, i64 268, !8, i64 272, !8, i64 276, !8, i64 280, !8, i64 284, !8, i64 288, !8, i64 292, !8, i64 296, !11, i64 300, !11, i64 304, !11, i64 308, !11, i64 312, !11, i64 316, !8, i64 320, !11, i64 324, !11, i64 328, !11, i64 332, !11, i64 336, !11, i64 340, !8, i64 344, !8, i64 348, !16, i64 352, !8, i64 360, !17, i64 364, !16, i64 528, !8, i64 536, !8, i64 540, !18, i64 544, !18, i64 552, !11, i64 560}
!15 = !{!"_ZTS9resonator", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16}
!16 = !{!"any pointer", !9, i64 0}
!17 = !{!"_ZTS11klatt_frame", !8, i64 0, !8, i64 4, !8, i64 8, !8, i64 12, !8, i64 16, !8, i64 20, !8, i64 24, !8, i64 28, !8, i64 32, !8, i64 36, !8, i64 40, !8, i64 44, !8, i64 48, !8, i64 52, !8, i64 56, !8, i64 60, !8, i64 64, !8, i64 68, !8, i64 72, !8, i64 76, !8, i64 80, !8, i64 84, !8, i64 88, !8, i64 92, !8, i64 96, !8, i64 100, !8, i64 104, !8, i64 108, !8, i64 112, !8, i64 116, !8, i64 120, !8, i64 124, !8, i64 128, !8, i64 132, !8, i64 136, !8, i64 140, !8, i64 144, !8, i64 148, !8, i64 152, !8, i64 156}
!18 = !{!"_ZTS5Slope", !11, i64 0, !8, i64 4}
!19 = !{!20, !8, i64 152}
!20 = !{!"_ZTSN6SoLoud6SpeechE", !21, i64 0, !8, i64 152, !11, i64 156, !11, i64 160, !8, i64 164, !8, i64 168, !22, i64 176}
!21 = !{!"_ZTSN6SoLoud11AudioSourceE", !8, i64 8, !11, i64 12, !11, i64 16, !8, i64 20, !8, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !8, i64 40, !11, i64 44, !9, i64 48, !16, i64 112, !16, i64 120, !16, i64 128, !8, i64 136, !12, i64 144}
!22 = !{!"_ZTS6darray", !16, i64 0, !8, i64 8, !8, i64 12, !8, i64 16}
!23 = !{!20, !11, i64 156}
!24 = !{!20, !11, i64 160}
!25 = !{!20, !8, i64 164}
!26 = !{!6, !8, i64 1080}
!27 = !{!6, !8, i64 1084}
!28 = !{!6, !16, i64 1072}
!29 = !{!6, !8, i64 760}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass