; LLVM IR from sp-nitech/SPTK :: third_party/REAPER/core/track.ll (ZNK4sptk6reaper5Track11GetSubTrackEffii)

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

@stderr = external global ptr, align 8
@.str.21 = external hidden unnamed_addr constant [43 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4sptk6reaper5Track10num_framesEv(ptr noundef nonnull align 8 dereferenceable(72)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4sptk6reaper5Track12num_channelsEv(ptr noundef nonnull align 8 dereferenceable(72)) #1 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef float @_ZNK4sptk6reaper5Track1tEi(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK4sptk6reaper5Track1aEii(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef, i32 noundef) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN4sptk6reaper5Track1aEii(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef, i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZNK4sptk6reaper5Track11GetSubTrackEffii(ptr noundef nonnull align 8 dereferenceable(72) %0, float noundef %1, float noundef %2, i32 noundef %3, i32 noundef %4) #4 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %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
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store float %1, ptr %8, align 4, !tbaa !9
  store float %2, ptr %9, align 4, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !11
  store i32 %4, ptr %11, align 4, !tbaa !11
  %21 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 -1, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 -1, ptr %13, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %15, align 4, !tbaa !11
  br label %22

22:                                               ; preds = %48, %5
  %23 = load i32, ptr %15, align 4, !tbaa !11
  %24 = call noundef i32 @_ZNK4sptk6reaper5Track10num_framesEv(ptr noundef nonnull align 8 dereferenceable(72) %21)
  %25 = icmp slt i32 %23, %24
  br i1 %25, label %26, label %51

26:                                               ; preds = %22
  %27 = load i32, ptr %12, align 4, !tbaa !11
  %28 = icmp eq i32 %27, -1
  br i1 %28, label %29, label %37

29:                                               ; preds = %26
  %30 = load i32, ptr %15, align 4, !tbaa !11
  %31 = call noundef float @_ZNK4sptk6reaper5Track1tEi(ptr noundef nonnull align 8 dereferenceable(72) %21, i32 noundef %30)
  %32 = load float, ptr %8, align 4, !tbaa !9
  %33 = fcmp ogt float %31, %32
  br i1 %33, label %34, label %37

34:                                               ; preds = %29
  %35 = load i32, ptr %15, align 4, !tbaa !11
  %36 = sub nsw i32 %35, 1
  store i32 %36, ptr %12, align 4, !tbaa !11
  br label %37

37:                                               ; preds = %34, %29, %26
  %38 = load i32, ptr %13, align 4, !tbaa !11
  %39 = icmp eq i32 %38, -1
  br i1 %39, label %40, label %47

40:                                               ; preds = %37
  %41 = load i32, ptr %15, align 4, !tbaa !11
  %42 = call noundef float @_ZNK4sptk6reaper5Track1tEi(ptr noundef nonnull align 8 dereferenceable(72) %21, i32 noundef %41)
  %43 = load float, ptr %9, align 4, !tbaa !9
  %44 = fcmp ogt float %42, %43
  br i1 %44, label %45, label %47

45:                                               ; preds = %40
  %46 = load i32, ptr %15, align 4, !tbaa !11
  store i32 %46, ptr %13, align 4, !tbaa !11
  br label %47

47:                                               ; preds = %45, %40, %37
  br label %48

48:                                               ; preds = %47
  %49 = load i32, ptr %15, align 4, !tbaa !11
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %15, align 4, !tbaa !11
  br label %22, !llvm.loop !13

51:                                               ; preds = %22
  %52 = load i32, ptr %12, align 4, !tbaa !11
  %53 = icmp eq i32 %52, -1
  br i1 %53, label %54, label %57

54:                                               ; preds = %51
  %55 = call noundef i32 @_ZNK4sptk6reaper5Track10num_framesEv(ptr noundef nonnull align 8 dereferenceable(72) %21)
  %56 = sub nsw i32 %55, 1
  store i32 %56, ptr %12, align 4, !tbaa !11
  br label %57

57:                                               ; preds = %54, %51
  %58 = load i32, ptr %13, align 4, !tbaa !11
  %59 = icmp eq i32 %58, -1
  br i1 %59, label %60, label %63

60:                                               ; preds = %57
  %61 = call noundef i32 @_ZNK4sptk6reaper5Track10num_framesEv(ptr noundef nonnull align 8 dereferenceable(72) %21)
  %62 = sub nsw i32 %61, 1
  store i32 %62, ptr %13, align 4, !tbaa !11
  br label %63

63:                                               ; preds = %60, %57
  %64 = load i32, ptr %13, align 4, !tbaa !11
  %65 = load i32, ptr %12, align 4, !tbaa !11
  %66 = sub nsw i32 %64, %65
  store i32 %66, ptr %14, align 4, !tbaa !11
  %67 = load i32, ptr %14, align 4, !tbaa !11
  %68 = icmp slt i32 %67, 1
  br i1 %68, label %69, label %70

69:                                               ; preds = %63
  store i32 1, ptr %14, align 4, !tbaa !11
  br label %70

70:                                               ; preds = %69, %63
  %71 = load i32, ptr %11, align 4, !tbaa !11
  %72 = icmp eq i32 %71, -1
  br i1 %72, label %73, label %78

73:                                               ; preds = %70
  %74 = load i32, ptr %10, align 4, !tbaa !11
  %75 = icmp eq i32 %74, -1
  br i1 %75, label %76, label %78

76:                                               ; preds = %73
  store i32 0, ptr %10, align 4, !tbaa !11
  %77 = call noundef i32 @_ZNK4sptk6reaper5Track12num_channelsEv(ptr noundef nonnull align 8 dereferenceable(72) %21)
  store i32 %77, ptr %11, align 4, !tbaa !11
  br label %86

78:                                               ; preds = %73, %70
  %79 = load i32, ptr %11, align 4, !tbaa !11
  %80 = call noundef i32 @_ZNK4sptk6reaper5Track12num_channelsEv(ptr noundef nonnull align 8 dereferenceable(72) %21)
  %81 = icmp sgt i32 %79, %80
  br i1 %81, label %82, label %85

82:                                               ; preds = %78
  %83 = load ptr, ptr @stderr, align 8, !tbaa !5
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %83, ptr noundef @.str.21) #7
  store ptr null, ptr %6, align 8
  store i32 1, ptr %17, align 4
  br label %132

85:                                               ; preds = %78
  br label %86

86:                                               ; preds = %85, %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %87 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 72) #8
  invoke void @_ZN4sptk6reaper5TrackC1Ev(ptr noundef nonnull align 8 dereferenceable(72) %87)
          to label %88 unwind label %122

88:                                               ; preds = %86
  store ptr %87, ptr %18, align 8, !tbaa !5
  %89 = load ptr, ptr %18, align 8, !tbaa !5
  %90 = load i32, ptr %14, align 4, !tbaa !11
  %91 = load i32, ptr %11, align 4, !tbaa !11
  call void @_ZN4sptk6reaper5Track6resizeEii(ptr noundef nonnull align 8 dereferenceable(72) %89, i32 noundef %90, i32 noundef %91)
  store i32 0, ptr %15, align 4, !tbaa !11
  br label %92

92:                                               ; preds = %127, %88
  %93 = load i32, ptr %15, align 4, !tbaa !11
  %94 = load i32, ptr %14, align 4, !tbaa !11
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %96, label %130

96:                                               ; preds = %92
  %97 = load i32, ptr %15, align 4, !tbaa !11
  %98 = load i32, ptr %12, align 4, !tbaa !11
  %99 = add nsw i32 %97, %98
  %100 = call noundef float @_ZNK4sptk6reaper5Track1tEi(ptr noundef nonnull align 8 dereferenceable(72) %21, i32 noundef %99)
  %101 = load ptr, ptr %18, align 8, !tbaa !5
  %102 = load i32, ptr %15, align 4, !tbaa !11
  %103 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4sptk6reaper5Track1tEi(ptr noundef nonnull align 8 dereferenceable(72) %101, i32 noundef %102)
  store float %100, ptr %103, align 4, !tbaa !9
  %104 = load i32, ptr %10, align 4, !tbaa !11
  store i32 %104, ptr %16, align 4, !tbaa !11
  br label %105

105:                                              ; preds = %119, %96
  %106 = load i32, ptr %16, align 4, !tbaa !11
  %107 = load i32, ptr %11, align 4, !tbaa !11
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %109, label %126

109:                                              ; preds = %105
  %110 = load i32, ptr %15, align 4, !tbaa !11
  %111 = load i32, ptr %12, align 4, !tbaa !11
  %112 = add nsw i32 %110, %111
  %113 = load i32, ptr %16, align 4, !tbaa !11
  %114 = call noundef float @_ZNK4sptk6reaper5Track1aEii(ptr noundef nonnull align 8 dereferenceable(72) %21, i32 noundef %112, i32 noundef %113)
  %115 = load ptr, ptr %18, align 8, !tbaa !5
  %116 = load i32, ptr %15, align 4, !tbaa !11
  %117 = load i32, ptr %16, align 4, !tbaa !11
  %118 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4sptk6reaper5Track1aEii(ptr noundef nonnull align 8 dereferenceable(72) %115, i32 noundef %116, i32 noundef %117)
  store float %114, ptr %118, align 4, !tbaa !9
  br label %119

119:                                              ; preds = %109
  %120 = load i32, ptr %16, align 4, !tbaa !11
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %16, align 4, !tbaa !11
  br label %105, !llvm.loop !15

122:                                              ; preds = %86
  %123 = landingpad { ptr, i32 }
          cleanup
  %124 = extractvalue { ptr, i32 } %123, 0
  store ptr %124, ptr %19, align 8
  %125 = extractvalue { ptr, i32 } %123, 1
  store i32 %125, ptr %20, align 4
  call void @_ZdlPvm(ptr noundef %87, i64 noundef 72) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %134

126:                                              ; preds = %105
  br label %127

127:                                              ; preds = %126
  %128 = load i32, ptr %15, align 4, !tbaa !11
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %15, align 4, !tbaa !11
  br label %92, !llvm.loop !16

130:                                              ; preds = %92
  %131 = load ptr, ptr %18, align 8, !tbaa !5
  store ptr %131, ptr %6, align 8
  store i32 1, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %132

132:                                              ; preds = %130, %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  %133 = load ptr, ptr %6, align 8
  ret ptr %133

134:                                              ; preds = %122
  %135 = load ptr, ptr %19, align 8
  %136 = load i32, ptr %20, align 4
  %137 = insertvalue { ptr, i32 } poison, ptr %135, 0
  %138 = insertvalue { ptr, i32 } %137, i32 %136, 1
  resume { ptr, i32 } %138
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #5

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4sptk6reaper5Track6resizeEii(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef, i32 noundef) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN4sptk6reaper5Track1tEi(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) #1 align 2

declare void @_ZN4sptk6reaper5TrackC1Ev(ptr)

attributes #0 = { 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 #1 = { inlinehint 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint 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 #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 = { nobuiltin allocsize(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 = { nobuiltin 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 #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin 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 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str.21 = external hidden unnamed_addr constant [43 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4sptk6reaper5Track10num_framesEv(ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4sptk6reaper5Track12num_channelsEv(ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef float @_ZNK4sptk6reaper5Track1tEi(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK4sptk6reaper5Track1aEii(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef, i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN4sptk6reaper5Track1aEii(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZNK4sptk6reaper5Track11GetSubTrackEffii(ptr noundef nonnull align 8 dereferenceable(72) %0, float noundef %1, float noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %6 = tail call noundef i32 @_ZNK4sptk6reaper5Track10num_framesEv(ptr noundef nonnull align 8 dereferenceable(72) %0)
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph, label %._crit_edge.thread

.lr.ph:                                           ; preds = %5, %20
  %.04655 = phi i32 [ %21, %20 ], [ 0, %5 ]
  %.04754 = phi i32 [ %.148, %20 ], [ -1, %5 ]
  %.04953 = phi i32 [ %.150, %20 ], [ -1, %5 ]
  %8 = icmp eq i32 %.04953, -1
  br i1 %8, label %9, label %14

9:                                                ; preds = %.lr.ph
  %10 = tail call noundef float @_ZNK4sptk6reaper5Track1tEi(ptr noundef nonnull align 8 dereferenceable(72) %0, i32 noundef %.04655)
  %11 = fcmp ogt float %10, %1
  br i1 %11, label %12, label %14

12:                                               ; preds = %9
  %13 = add nsw i32 %.04655, -1
  br label %14

14:                                               ; preds = %12, %9, %.lr.ph
  %.150 = phi i32 [ %13, %12 ], [ -1, %9 ], [ %.04953, %.lr.ph ]
  %15 = icmp eq i32 %.04754, -1
  br i1 %15, label %16, label %20

16:                                               ; preds = %14
  %17 = tail call noundef float @_ZNK4sptk6reaper5Track1tEi(ptr noundef nonnull align 8 dereferenceable(72) %0, i32 noundef %.04655)
  %18 = fcmp ogt float %17, %2
  br i1 %18, label %19, label %20

19:                                               ; preds = %16
  br label %20

20:                                               ; preds = %14, %16, %19
  %.148 = phi i32 [ %.04655, %19 ], [ -1, %16 ], [ %.04754, %14 ]
  %21 = add nuw nsw i32 %.04655, 1
  %22 = tail call noundef i32 @_ZNK4sptk6reaper5Track10num_framesEv(ptr noundef nonnull align 8 dereferenceable(72) %0)
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %.lr.ph, label %._crit_edge, !llvm.loop !5

._crit_edge:                                      ; preds = %20
  %24 = icmp eq i32 %.150, -1
  br i1 %24, label %._crit_edge.thread, label %27

._crit_edge.thread:                               ; preds = %5, %._crit_edge
  %.047.lcssa69 = phi i32 [ %.148, %._crit_edge ], [ -1, %5 ]
  %25 = tail call noundef i32 @_ZNK4sptk6reaper5Track10num_framesEv(ptr noundef nonnull align 8 dereferenceable(72) %0)
  %26 = add nsw i32 %25, -1
  br label %27

27:                                               ; preds = %._crit_edge.thread, %._crit_edge
  %.047.lcssa68 = phi i32 [ %.047.lcssa69, %._crit_edge.thread ], [ %.148, %._crit_edge ]
  %.251 = phi i32 [ %26, %._crit_edge.thread ], [ %.150, %._crit_edge ]
  %28 = icmp eq i32 %.047.lcssa68, -1
  br i1 %28, label %29, label %32

29:                                               ; preds = %27
  %30 = tail call noundef i32 @_ZNK4sptk6reaper5Track10num_framesEv(ptr noundef nonnull align 8 dereferenceable(72) %0)
  %31 = add nsw i32 %30, -1
  br label %32

32:                                               ; preds = %29, %27
  %.2 = phi i32 [ %31, %29 ], [ %.047.lcssa68, %27 ]
  %33 = sub i32 %.2, %.251
  %spec.store.select = tail call i32 @llvm.smax.i32(i32 %33, i32 1)
  %34 = and i32 %4, %3
  %or.cond = icmp eq i32 %34, -1
  %35 = tail call noundef i32 @_ZNK4sptk6reaper5Track12num_channelsEv(ptr noundef nonnull align 8 dereferenceable(72) %0)
  br i1 %or.cond, label %41, label %36

36:                                               ; preds = %32
  %37 = icmp slt i32 %35, %4
  br i1 %37, label %38, label %41

38:                                               ; preds = %36
  %39 = load ptr, ptr @stderr, align 8, !tbaa !7
  %40 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef nonnull @.str.21) #7
  br label %.loopexit

41:                                               ; preds = %32, %36
  %.044 = phi i32 [ %4, %36 ], [ %35, %32 ]
  %.043 = phi i32 [ %3, %36 ], [ 0, %32 ]
  %42 = tail call noalias noundef nonnull dereferenceable(72) ptr @_Znwm(i64 noundef 72) #8
  invoke void @_ZN4sptk6reaper5TrackC1Ev(ptr noundef nonnull align 8 dereferenceable(72) %42)
          to label %43 unwind label %57

43:                                               ; preds = %41
  tail call void @_ZN4sptk6reaper5Track6resizeEii(ptr noundef nonnull align 8 dereferenceable(72) %42, i32 noundef %spec.store.select, i32 noundef %.044)
  %44 = icmp slt i32 %.043, %.044
  br i1 %44, label %.lr.ph59.us, label %.split

.lr.ph59.us:                                      ; preds = %43, %._crit_edge60.us
  %.161.us = phi i32 [ %52, %._crit_edge60.us ], [ 0, %43 ]
  %45 = add nsw i32 %.161.us, %.251
  %46 = tail call noundef float @_ZNK4sptk6reaper5Track1tEi(ptr noundef nonnull align 8 dereferenceable(72) %0, i32 noundef %45)
  %47 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4sptk6reaper5Track1tEi(ptr noundef nonnull align 8 dereferenceable(72) %42, i32 noundef %.161.us)
  store float %46, ptr %47, align 4, !tbaa !11
  br label %48

48:                                               ; preds = %.lr.ph59.us, %48
  %.04557.us = phi i32 [ %.043, %.lr.ph59.us ], [ %51, %48 ]
  %49 = tail call noundef float @_ZNK4sptk6reaper5Track1aEii(ptr noundef nonnull align 8 dereferenceable(72) %0, i32 noundef %45, i32 noundef %.04557.us)
  %50 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4sptk6reaper5Track1aEii(ptr noundef nonnull align 8 dereferenceable(72) %42, i32 noundef %.161.us, i32 noundef %.04557.us)
  store float %49, ptr %50, align 4, !tbaa !11
  %51 = add i32 %.04557.us, 1
  %exitcond63.not = icmp eq i32 %51, %.044
  br i1 %exitcond63.not, label %._crit_edge60.us, label %48, !llvm.loop !13

._crit_edge60.us:                                 ; preds = %48
  %52 = add nuw nsw i32 %.161.us, 1
  %exitcond65.not = icmp eq i32 %52, %spec.store.select
  br i1 %exitcond65.not, label %.loopexit, label %.lr.ph59.us, !llvm.loop !14

.split:                                           ; preds = %43, %.split
  %.161 = phi i32 [ %56, %.split ], [ 0, %43 ]
  %53 = add nsw i32 %.161, %.251
  %54 = tail call noundef float @_ZNK4sptk6reaper5Track1tEi(ptr noundef nonnull align 8 dereferenceable(72) %0, i32 noundef %53)
  %55 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4sptk6reaper5Track1tEi(ptr noundef nonnull align 8 dereferenceable(72) %42, i32 noundef %.161)
  store float %54, ptr %55, align 4, !tbaa !11
  %56 = add nuw nsw i32 %.161, 1
  %exitcond.not = icmp eq i32 %56, %spec.store.select
  br i1 %exitcond.not, label %.loopexit, label %.split, !llvm.loop !14

57:                                               ; preds = %41
  %58 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %42, i64 noundef 72) #9
  resume { ptr, i32 } %58

.loopexit:                                        ; preds = %.split, %._crit_edge60.us, %38
  %.0 = phi ptr [ null, %38 ], [ %42, %._crit_edge60.us ], [ %42, %.split ]
  ret ptr %.0
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #4

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4sptk6reaper5Track6resizeEii(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN4sptk6reaper5Track1tEi(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) local_unnamed_addr #1 align 2

declare void @_ZN4sptk6reaper5TrackC1Ev(ptr) local_unnamed_addr

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

attributes #0 = { nofree 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 #1 = { inlinehint 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 #2 = { inlinehint 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 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 = { nobuiltin allocsize(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 = { nobuiltin 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { cold nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !9, i64 0}
!13 = distinct !{!13, !6}
!14 = distinct !{!14, !6}


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