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

; 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.sptk::reaper::Track" = type { i32, i32, %"class.sptk::reaper::FloatMatrix", %"class.std::vector", i8, float }
%"class.sptk::reaper::FloatMatrix" = type { ptr, i32, i32 }
%"class.std::vector" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>

@.str = external hidden unnamed_addr constant [16 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [16 x i8], align 1
@stderr = external global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [30 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK4sptk6reaper5Track4SaveEPNS0_12FileResourceE(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef %1) #0 align 2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca float, align 4
  %9 = alloca i32, align 4
  %10 = alloca i8, align 1
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca float, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %14 = load ptr, ptr %4, align 8
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %15)
  %17 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef @.str) #7
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %18)
  %20 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef @.str.1) #7
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %21)
  %23 = call noundef i32 @_ZNK4sptk6reaper5Track10num_framesEv(ptr noundef nonnull align 8 dereferenceable(72) %14)
  %24 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %22, ptr noundef @.str.2, i32 noundef %23) #7
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %25)
  %27 = call noundef i32 @_ZNK4sptk6reaper5Track12num_channelsEv(ptr noundef nonnull align 8 dereferenceable(72) %14)
  %28 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %26, ptr noundef @.str.3, i32 noundef %27) #7
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %29)
  %31 = call noundef float @_ZNK4sptk6reaper5Track5shiftEv(ptr noundef nonnull align 8 dereferenceable(72) %14)
  %32 = fpext float %31 to double
  %33 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %30, ptr noundef @.str.4, double noundef %32) #7
  %34 = getelementptr inbounds %"class.sptk::reaper::Track", ptr %14, i32 0, i32 4
  %35 = load i8, ptr %34, align 8, !tbaa !9, !range !21, !noundef !22
  %36 = trunc i8 %35 to i1
  br i1 %36, label %37, label %41

37:                                               ; preds = %2
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %38)
  %40 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef @.str.5) #7
  br label %45

41:                                               ; preds = %2
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %42)
  %44 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %43, ptr noundef @.str.6) #7
  br label %45

45:                                               ; preds = %41, %37
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %46)
  %48 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef @.str.7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !23
  br label %49

49:                                               ; preds = %68, %45
  %50 = load i32, ptr %6, align 4, !tbaa !23
  %51 = call noundef i32 @_ZNK4sptk6reaper5Track10num_framesEv(ptr noundef nonnull align 8 dereferenceable(72) %14)
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  store i32 2, ptr %7, align 4
  br label %71

54:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %55 = load i32, ptr %6, align 4, !tbaa !23
  %56 = call noundef float @_ZNK4sptk6reaper5Track1tEi(ptr noundef nonnull align 8 dereferenceable(72) %14, i32 noundef %55)
  store float %56, ptr %8, align 4, !tbaa !24
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %57)
  %59 = call i64 @fwrite(ptr noundef %8, i64 noundef 4, i64 noundef 1, ptr noundef %58)
  %60 = icmp ne i64 %59, 1
  br i1 %60, label %61, label %64

61:                                               ; preds = %54
  %62 = load ptr, ptr @stderr, align 8, !tbaa !5
  %63 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %62, ptr noundef @.str.8) #7
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %65

64:                                               ; preds = %54
  store i32 0, ptr %7, align 4
  br label %65

65:                                               ; preds = %64, %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  %66 = load i32, ptr %7, align 4
  switch i32 %66, label %71 [
    i32 0, label %67
  ]

67:                                               ; preds = %65
  br label %68

68:                                               ; preds = %67
  %69 = load i32, ptr %6, align 4, !tbaa !23
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %6, align 4, !tbaa !23
  br label %49, !llvm.loop !25

71:                                               ; preds = %65, %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  %72 = load i32, ptr %7, align 4
  switch i32 %72, label %147 [
    i32 2, label %73
    i32 1, label %145
  ]

73:                                               ; preds = %71
  %74 = getelementptr inbounds %"class.sptk::reaper::Track", ptr %14, i32 0, i32 4
  %75 = load i8, ptr %74, align 8, !tbaa !9, !range !21, !noundef !22
  %76 = trunc i8 %75 to i1
  br i1 %76, label %77, label %106

77:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !23
  br label %78

78:                                               ; preds = %100, %77
  %79 = load i32, ptr %9, align 4, !tbaa !23
  %80 = call noundef i32 @_ZNK4sptk6reaper5Track10num_framesEv(ptr noundef nonnull align 8 dereferenceable(72) %14)
  %81 = icmp slt i32 %79, %80
  br i1 %81, label %83, label %82

82:                                               ; preds = %78
  store i32 5, ptr %7, align 4
  br label %103

83:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #7
  %84 = load i32, ptr %9, align 4, !tbaa !23
  %85 = call noundef zeroext i1 @_ZNK4sptk6reaper5Track1vEi(ptr noundef nonnull align 8 dereferenceable(72) %14, i32 noundef %84)
  %86 = zext i1 %85 to i64
  %87 = select i1 %85, i32 1, i32 0
  %88 = trunc i32 %87 to i8
  store i8 %88, ptr %10, align 1, !tbaa !27
  %89 = load ptr, ptr %5, align 8, !tbaa !5
  %90 = call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %89)
  %91 = call i64 @fwrite(ptr noundef %10, i64 noundef 1, i64 noundef 1, ptr noundef %90)
  %92 = icmp ne i64 %91, 1
  br i1 %92, label %93, label %96

93:                                               ; preds = %83
  %94 = load ptr, ptr @stderr, align 8, !tbaa !5
  %95 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %94, ptr noundef @.str.8) #7
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %97

96:                                               ; preds = %83
  store i32 0, ptr %7, align 4
  br label %97

97:                                               ; preds = %96, %93
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #7
  %98 = load i32, ptr %7, align 4
  switch i32 %98, label %103 [
    i32 0, label %99
  ]

99:                                               ; preds = %97
  br label %100

100:                                              ; preds = %99
  %101 = load i32, ptr %9, align 4, !tbaa !23
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %9, align 4, !tbaa !23
  br label %78, !llvm.loop !28

103:                                              ; preds = %97, %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  %104 = load i32, ptr %7, align 4
  switch i32 %104, label %147 [
    i32 5, label %105
    i32 1, label %145
  ]

105:                                              ; preds = %103
  br label %106

106:                                              ; preds = %105, %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !23
  br label %107

107:                                              ; preds = %139, %106
  %108 = load i32, ptr %11, align 4, !tbaa !23
  %109 = call noundef i32 @_ZNK4sptk6reaper5Track10num_framesEv(ptr noundef nonnull align 8 dereferenceable(72) %14)
  %110 = icmp slt i32 %108, %109
  br i1 %110, label %112, label %111

111:                                              ; preds = %107
  store i32 8, ptr %7, align 4
  br label %142

112:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !23
  br label %113

113:                                              ; preds = %133, %112
  %114 = load i32, ptr %12, align 4, !tbaa !23
  %115 = call noundef i32 @_ZNK4sptk6reaper5Track12num_channelsEv(ptr noundef nonnull align 8 dereferenceable(72) %14)
  %116 = icmp slt i32 %114, %115
  br i1 %116, label %118, label %117

117:                                              ; preds = %113
  store i32 11, ptr %7, align 4
  br label %136

118:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %119 = load i32, ptr %11, align 4, !tbaa !23
  %120 = load i32, ptr %12, align 4, !tbaa !23
  %121 = call noundef float @_ZNK4sptk6reaper5Track1aEii(ptr noundef nonnull align 8 dereferenceable(72) %14, i32 noundef %119, i32 noundef %120)
  store float %121, ptr %13, align 4, !tbaa !24
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %122)
  %124 = call i64 @fwrite(ptr noundef %13, i64 noundef 4, i64 noundef 1, ptr noundef %123)
  %125 = icmp ne i64 %124, 1
  br i1 %125, label %126, label %129

126:                                              ; preds = %118
  %127 = load ptr, ptr @stderr, align 8, !tbaa !5
  %128 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %127, ptr noundef @.str.8) #7
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %130

129:                                              ; preds = %118
  store i32 0, ptr %7, align 4
  br label %130

130:                                              ; preds = %129, %126
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  %131 = load i32, ptr %7, align 4
  switch i32 %131, label %136 [
    i32 0, label %132
  ]

132:                                              ; preds = %130
  br label %133

133:                                              ; preds = %132
  %134 = load i32, ptr %12, align 4, !tbaa !23
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %12, align 4, !tbaa !23
  br label %113, !llvm.loop !29

136:                                              ; preds = %130, %117
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  %137 = load i32, ptr %7, align 4
  switch i32 %137, label %142 [
    i32 11, label %138
  ]

138:                                              ; preds = %136
  br label %139

139:                                              ; preds = %138
  %140 = load i32, ptr %11, align 4, !tbaa !23
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %11, align 4, !tbaa !23
  br label %107, !llvm.loop !30

142:                                              ; preds = %136, %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  %143 = load i32, ptr %7, align 4
  switch i32 %143, label %147 [
    i32 8, label %144
    i32 1, label %145
  ]

144:                                              ; preds = %142
  store i1 true, ptr %3, align 1
  br label %145

145:                                              ; preds = %144, %142, %103, %71
  %146 = load i1, ptr %3, align 1
  ret i1 %146

147:                                              ; preds = %142, %103, %71
  unreachable
}

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK4sptk6reaper5Track5shiftEv(ptr noundef nonnull align 8 dereferenceable(72)) #2 align 2

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

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

declare i64 @fwrite(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #6

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK4sptk6reaper5Track1vEi(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) #5 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) #3 align 2

attributes #0 = { 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 #1 = { 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 #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 = { 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 #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { "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 }

!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, !19, i64 64}
!10 = !{!"_ZTSN4sptk6reaper5TrackE", !11, i64 0, !11, i64 4, !12, i64 8, !13, i64 24, !19, i64 64, !20, i64 68}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSN4sptk6reaper11FloatMatrixE", !6, i64 0, !11, i64 8, !11, i64 12}
!13 = !{!"_ZTSSt6vectorIbSaIbEE", !14, i64 0}
!14 = !{!"_ZTSSt13_Bvector_baseISaIbEE", !15, i64 0}
!15 = !{!"_ZTSNSt13_Bvector_baseISaIbEE13_Bvector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt13_Bvector_baseISaIbEE18_Bvector_impl_dataE", !17, i64 0, !17, i64 16, !6, i64 32}
!17 = !{!"_ZTSSt13_Bit_iterator", !18, i64 0}
!18 = !{!"_ZTSSt18_Bit_iterator_base", !6, i64 0, !11, i64 8}
!19 = !{!"bool", !7, i64 0}
!20 = !{!"float", !7, i64 0}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = !{!11, !11, i64 0}
!24 = !{!20, !20, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!7, !7, i64 0}
!28 = distinct !{!28, !26}
!29 = distinct !{!29, !26}
!30 = distinct !{!30, !26}


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

@.str = external hidden unnamed_addr constant [16 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [16 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [30 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK4sptk6reaper5Track4SaveEPNS0_12FileResourceE(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull %1) local_unnamed_addr #0 align 2 {
  %3 = alloca float, align 4
  %4 = alloca i8, align 1
  %5 = alloca float, align 4
  %6 = tail call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %1)
  %7 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %6, ptr noundef nonnull @.str) #6
  %8 = tail call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %1)
  %9 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.1) #6
  %10 = tail call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %1)
  %11 = tail call noundef i32 @_ZNK4sptk6reaper5Track10num_framesEv(ptr noundef nonnull align 8 dereferenceable(72) %0)
  %12 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.2, i32 noundef %11) #6
  %13 = tail call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %1)
  %14 = tail call noundef i32 @_ZNK4sptk6reaper5Track12num_channelsEv(ptr noundef nonnull align 8 dereferenceable(72) %0)
  %15 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef nonnull @.str.3, i32 noundef %14) #6
  %16 = tail call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %1)
  %17 = tail call noundef float @_ZNK4sptk6reaper5Track5shiftEv(ptr noundef nonnull align 8 dereferenceable(72) %0)
  %18 = fpext float %17 to double
  %19 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.4, double noundef %18) #6
  %20 = getelementptr inbounds i8, ptr %0, i64 64
  %21 = load i8, ptr %20, align 8, !tbaa !5, !range !20, !noundef !21
  %22 = trunc nuw i8 %21 to i1
  %23 = tail call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %1)
  %.str.5..str.6 = select i1 %22, ptr @.str.5, ptr @.str.6
  %24 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull %.str.5..str.6) #6
  %25 = tail call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %1)
  %26 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef nonnull @.str.7) #6
  %27 = tail call noundef i32 @_ZNK4sptk6reaper5Track10num_framesEv(ptr noundef nonnull align 8 dereferenceable(72) %0)
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2, %.critedge
  %.03767 = phi i32 [ %32, %.critedge ], [ 0, %2 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %29 = tail call noundef float @_ZNK4sptk6reaper5Track1tEi(ptr noundef nonnull align 8 dereferenceable(72) %0, i32 noundef %.03767)
  store float %29, ptr %3, align 4, !tbaa !22
  %30 = tail call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %1)
  %31 = call i64 @fwrite(ptr noundef nonnull %3, i64 noundef 4, i64 noundef 1, ptr noundef %30)
  %.not = icmp eq i64 %31, 1
  br i1 %.not, label %.critedge, label %35

.critedge:                                        ; preds = %.lr.ph
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %32 = add nuw nsw i32 %.03767, 1
  %33 = tail call noundef i32 @_ZNK4sptk6reaper5Track10num_framesEv(ptr noundef nonnull align 8 dereferenceable(72) %0)
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %.lr.ph, label %._crit_edge, !llvm.loop !23

35:                                               ; preds = %.lr.ph
  %36 = load ptr, ptr @stderr, align 8, !tbaa !25
  %37 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %36, ptr noundef nonnull @.str.8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  br label %.loopexit

._crit_edge:                                      ; preds = %.critedge, %2
  %38 = load i8, ptr %20, align 8, !tbaa !5, !range !20, !noundef !21
  %39 = trunc nuw i8 %38 to i1
  br i1 %39, label %.preheader65, label %.thread59

.preheader65:                                     ; preds = %._crit_edge
  %40 = tail call noundef i32 @_ZNK4sptk6reaper5Track10num_framesEv(ptr noundef nonnull align 8 dereferenceable(72) %0)
  %41 = icmp sgt i32 %40, 0
  br i1 %41, label %.lr.ph69, label %.thread59

.lr.ph69:                                         ; preds = %.preheader65, %.critedge49
  %.03568 = phi i32 [ %46, %.critedge49 ], [ 0, %.preheader65 ]
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #6
  %42 = tail call noundef zeroext i1 @_ZNK4sptk6reaper5Track1vEi(ptr noundef nonnull align 8 dereferenceable(72) %0, i32 noundef %.03568)
  %43 = zext i1 %42 to i8
  store i8 %43, ptr %4, align 1, !tbaa !26
  %44 = tail call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %1)
  %45 = call i64 @fwrite(ptr noundef nonnull %4, i64 noundef 1, i64 noundef 1, ptr noundef %44)
  %.not45 = icmp eq i64 %45, 1
  br i1 %.not45, label %.critedge49, label %49

.critedge49:                                      ; preds = %.lr.ph69
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  %46 = add nuw nsw i32 %.03568, 1
  %47 = tail call noundef i32 @_ZNK4sptk6reaper5Track10num_framesEv(ptr noundef nonnull align 8 dereferenceable(72) %0)
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %.lr.ph69, label %.thread59, !llvm.loop !27

49:                                               ; preds = %.lr.ph69
  %50 = load ptr, ptr @stderr, align 8, !tbaa !25
  %51 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef nonnull @.str.8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  br label %.loopexit

.thread59:                                        ; preds = %.critedge49, %.preheader65, %._crit_edge
  %52 = tail call noundef i32 @_ZNK4sptk6reaper5Track10num_framesEv(ptr noundef nonnull align 8 dereferenceable(72) %0)
  %53 = icmp slt i32 %52, 1
  br i1 %53, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %.thread59, %._crit_edge73
  %.03474 = phi i32 [ %62, %._crit_edge73 ], [ 0, %.thread59 ]
  %54 = tail call noundef i32 @_ZNK4sptk6reaper5Track12num_channelsEv(ptr noundef nonnull align 8 dereferenceable(72) %0)
  %.not4770 = icmp sgt i32 %54, 0
  br i1 %.not4770, label %.lr.ph72, label %._crit_edge73

.lr.ph72:                                         ; preds = %.preheader, %.critedge53
  %.071 = phi i32 [ %60, %.critedge53 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %55 = tail call noundef float @_ZNK4sptk6reaper5Track1aEii(ptr noundef nonnull align 8 dereferenceable(72) %0, i32 noundef %.03474, i32 noundef %.071)
  store float %55, ptr %5, align 4, !tbaa !22
  %56 = tail call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %1)
  %57 = call i64 @fwrite(ptr noundef nonnull %5, i64 noundef 4, i64 noundef 1, ptr noundef %56)
  %.not46 = icmp eq i64 %57, 1
  br i1 %.not46, label %.critedge53, label %.thread63

.thread63:                                        ; preds = %.lr.ph72
  %58 = load ptr, ptr @stderr, align 8, !tbaa !25
  %59 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef nonnull @.str.8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  br label %.loopexit

.critedge53:                                      ; preds = %.lr.ph72
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  %60 = add nuw nsw i32 %.071, 1
  %61 = tail call noundef i32 @_ZNK4sptk6reaper5Track12num_channelsEv(ptr noundef nonnull align 8 dereferenceable(72) %0)
  %.not47 = icmp slt i32 %60, %61
  br i1 %.not47, label %.lr.ph72, label %._crit_edge73, !llvm.loop !28

._crit_edge73:                                    ; preds = %.critedge53, %.preheader
  %62 = add nuw nsw i32 %.03474, 1
  %63 = tail call noundef i32 @_ZNK4sptk6reaper5Track10num_framesEv(ptr noundef nonnull align 8 dereferenceable(72) %0)
  %.not75 = icmp slt i32 %62, %63
  br i1 %.not75, label %.preheader, label %.loopexit, !llvm.loop !29

.loopexit:                                        ; preds = %._crit_edge73, %.thread59, %.thread63, %49, %35
  %.12 = phi i1 [ false, %35 ], [ false, %49 ], [ false, %.thread63 ], [ true, %.thread59 ], [ true, %._crit_edge73 ]
  ret i1 %.12
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4sptk6reaper5Track10num_framesEv(ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #3 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 #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK4sptk6reaper5Track5shiftEv(ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #2 align 2

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

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

; Function Attrs: nofree nounwind
declare noundef i64 @fwrite(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #1

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK4sptk6reaper5Track1vEi(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) local_unnamed_addr #5 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 #3 align 2

attributes #0 = { 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 #1 = { 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 #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 = { 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 #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { nounwind }
attributes #7 = { cold 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, !18, i64 64}
!6 = !{!"_ZTSN4sptk6reaper5TrackE", !7, i64 0, !7, i64 4, !10, i64 8, !12, i64 24, !18, i64 64, !19, i64 68}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN4sptk6reaper11FloatMatrixE", !11, i64 0, !7, i64 8, !7, i64 12}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"_ZTSSt6vectorIbSaIbEE", !13, i64 0}
!13 = !{!"_ZTSSt13_Bvector_baseISaIbEE", !14, i64 0}
!14 = !{!"_ZTSNSt13_Bvector_baseISaIbEE13_Bvector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt13_Bvector_baseISaIbEE18_Bvector_impl_dataE", !16, i64 0, !16, i64 16, !11, i64 32}
!16 = !{!"_ZTSSt13_Bit_iterator", !17, i64 0}
!17 = !{!"_ZTSSt18_Bit_iterator_base", !11, i64 0, !7, i64 8}
!18 = !{!"bool", !8, i64 0}
!19 = !{!"float", !8, i64 0}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = !{!19, !19, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!11, !11, i64 0}
!26 = !{!8, !8, i64 0}
!27 = distinct !{!27, !24}
!28 = distinct !{!28, !24}
!29 = distinct !{!29, !24}


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