; LLVM IR from sp-nitech/SPTK :: third_party/REAPER/wave (codec_riff)

; 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.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@stderr = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [31 x i8], align 1

; 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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK4sptk6reaper12WavRiffCodec9ReadChunkEPNS0_12FileResourceEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef, ptr noundef) #1 align 2

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK4sptk6reaper12WavRiffCodec10CheckChunkEPNS0_12FileResourceEPKc(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef, ptr noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4sptk6reaper12WavRiffCodec10ReadHeaderEPNS0_12FileResourceEPiS4_(ptr noundef nonnull align 4 dereferenceable(4) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #1 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %"class.std::__cxx11::basic_string", align 8
  %17 = alloca i16, align 2
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  %20 = load ptr, ptr %6, align 8
  %21 = load ptr, ptr %7, align 8, !tbaa !5
  %22 = call noundef zeroext i1 @_ZNK4sptk6reaper12WavRiffCodec10CheckChunkEPNS0_12FileResourceEPKc(ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef %21, ptr noundef @.str)
  br i1 %22, label %26, label %23

23:                                               ; preds = %4
  %24 = load ptr, ptr @stderr, align 8, !tbaa !5
  %25 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef @.str.1) #6
  store i1 false, ptr %5, align 1
  br label %238

26:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !9
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %27)
  %29 = call i64 @fread(ptr noundef %10, i64 noundef 4, i64 noundef 1, ptr noundef %28)
  %30 = icmp ne i64 %29, 1
  br i1 %30, label %31, label %34

31:                                               ; preds = %26
  %32 = load ptr, ptr @stderr, align 8, !tbaa !5
  %33 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef @.str.2) #6
  store i1 false, ptr %5, align 1
  store i32 1, ptr %11, align 4
  br label %237

34:                                               ; preds = %26
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = call noundef zeroext i1 @_ZNK4sptk6reaper12WavRiffCodec10CheckChunkEPNS0_12FileResourceEPKc(ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef %35, ptr noundef @.str.3)
  br i1 %36, label %40, label %37

37:                                               ; preds = %34
  %38 = load ptr, ptr @stderr, align 8, !tbaa !5
  %39 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %38, ptr noundef @.str.4) #6
  store i1 false, ptr %5, align 1
  store i32 1, ptr %11, align 4
  br label %237

40:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #6
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = invoke noundef zeroext i1 @_ZNK4sptk6reaper12WavRiffCodec9ReadChunkEPNS0_12FileResourceEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef %41, ptr noundef %12)
          to label %43 unwind label %47

43:                                               ; preds = %40
  br i1 %42, label %51, label %44

44:                                               ; preds = %43
  %45 = load ptr, ptr @stderr, align 8, !tbaa !5
  %46 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef @.str.5) #6
  store i1 false, ptr %5, align 1
  store i32 1, ptr %11, align 4
  br label %235

47:                                               ; preds = %101, %98, %60, %54, %51, %40
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %13, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %14, align 4
  br label %236

51:                                               ; preds = %43
  %52 = invoke noundef zeroext i1 @_ZStneIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef @.str.6)
          to label %53 unwind label %47

53:                                               ; preds = %51
  br i1 %52, label %54, label %60

54:                                               ; preds = %53
  %55 = invoke noundef zeroext i1 @_ZStneIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef @.str.7)
          to label %56 unwind label %47

56:                                               ; preds = %54
  br i1 %55, label %57, label %60

57:                                               ; preds = %56
  %58 = load ptr, ptr @stderr, align 8, !tbaa !5
  %59 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef @.str.8) #6
  store i1 false, ptr %5, align 1
  store i32 1, ptr %11, align 4
  br label %235

60:                                               ; preds = %56, %53
  %61 = invoke noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef @.str.7)
          to label %62 unwind label %47

62:                                               ; preds = %60
  br i1 %61, label %63, label %98

63:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = invoke noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %64)
          to label %66 unwind label %71

66:                                               ; preds = %63
  %67 = invoke i64 @fread(ptr noundef %15, i64 noundef 4, i64 noundef 1, ptr noundef %65)
          to label %68 unwind label %71

68:                                               ; preds = %66
  %69 = icmp ne i64 %67, 0
  br i1 %69, label %70, label %75

70:                                               ; preds = %68
  br label %75

71:                                               ; preds = %78, %75, %66, %63
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %13, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %14, align 4
  br label %97

75:                                               ; preds = %70, %68
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = invoke noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %76)
          to label %78 unwind label %71

78:                                               ; preds = %75
  %79 = load i32, ptr %15, align 4, !tbaa !9
  %80 = sext i32 %79 to i64
  %81 = invoke i32 @fseek(ptr noundef %77, i64 noundef %80, i32 noundef 1)
          to label %82 unwind label %71

82:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #6
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = invoke noundef zeroext i1 @_ZNK4sptk6reaper12WavRiffCodec10CheckChunkEPNS0_12FileResourceEPKc(ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef %83, ptr noundef @.str.6)
          to label %85 unwind label %89

85:                                               ; preds = %82
  br i1 %84, label %93, label %86

86:                                               ; preds = %85
  %87 = load ptr, ptr @stderr, align 8, !tbaa !5
  %88 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %87, ptr noundef @.str.9) #6
  store i1 false, ptr %5, align 1
  store i32 1, ptr %11, align 4
  br label %94

89:                                               ; preds = %82
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %13, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %14, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #6
  br label %97

93:                                               ; preds = %85
  store i32 0, ptr %11, align 4
  br label %94

94:                                               ; preds = %93, %86
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  %95 = load i32, ptr %11, align 4
  switch i32 %95, label %235 [
    i32 0, label %96
  ]

96:                                               ; preds = %94
  br label %98

97:                                               ; preds = %89, %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %236

98:                                               ; preds = %96, %62
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = invoke noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %99)
          to label %101 unwind label %47

101:                                              ; preds = %98
  %102 = invoke i64 @fread(ptr noundef %10, i64 noundef 4, i64 noundef 1, ptr noundef %100)
          to label %103 unwind label %47

103:                                              ; preds = %101
  %104 = icmp ne i64 %102, 1
  br i1 %104, label %105, label %108

105:                                              ; preds = %103
  %106 = load ptr, ptr @stderr, align 8, !tbaa !5
  %107 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %106, ptr noundef @.str.10) #6
  store i1 false, ptr %5, align 1
  store i32 1, ptr %11, align 4
  br label %235

108:                                              ; preds = %103
  %109 = load i32, ptr %10, align 4, !tbaa !9
  %110 = icmp slt i32 %109, 16
  br i1 %110, label %111, label %114

111:                                              ; preds = %108
  %112 = load ptr, ptr @stderr, align 8, !tbaa !5
  %113 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %112, ptr noundef @.str.11) #6
  store i1 false, ptr %5, align 1
  store i32 1, ptr %11, align 4
  br label %235

114:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 2, ptr %17) #6
  store i16 0, ptr %17, align 2, !tbaa !11
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  %116 = invoke noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %115)
          to label %117 unwind label %129

117:                                              ; preds = %114
  %118 = invoke i32 @fseek(ptr noundef %116, i64 noundef 2, i32 noundef 1)
          to label %119 unwind label %129

119:                                              ; preds = %117
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  %121 = invoke noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %120)
          to label %122 unwind label %129

122:                                              ; preds = %119
  %123 = invoke i64 @fread(ptr noundef %17, i64 noundef 2, i64 noundef 1, ptr noundef %121)
          to label %124 unwind label %129

124:                                              ; preds = %122
  %125 = icmp ne i64 %123, 1
  br i1 %125, label %126, label %133

126:                                              ; preds = %124
  %127 = load ptr, ptr @stderr, align 8, !tbaa !5
  %128 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %127, ptr noundef @.str.12) #6
  store i1 false, ptr %5, align 1
  store i32 1, ptr %11, align 4
  br label %233

129:                                              ; preds = %122, %119, %117, %114
  %130 = landingpad { ptr, i32 }
          cleanup
  %131 = extractvalue { ptr, i32 } %130, 0
  store ptr %131, ptr %13, align 8
  %132 = extractvalue { ptr, i32 } %130, 1
  store i32 %132, ptr %14, align 4
  br label %234

133:                                              ; preds = %124
  %134 = load i16, ptr %17, align 2, !tbaa !11
  %135 = sext i16 %134 to i32
  %136 = icmp ne i32 %135, 1
  br i1 %136, label %137, label %140

137:                                              ; preds = %133
  %138 = load ptr, ptr @stderr, align 8, !tbaa !5
  %139 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %138, ptr noundef @.str.13) #6
  store i1 false, ptr %5, align 1
  store i32 1, ptr %11, align 4
  br label %233

140:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %141 = load ptr, ptr %7, align 8, !tbaa !5
  %142 = invoke noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %141)
          to label %143 unwind label %150

143:                                              ; preds = %140
  %144 = invoke i64 @fread(ptr noundef %18, i64 noundef 4, i64 noundef 1, ptr noundef %142)
          to label %145 unwind label %150

145:                                              ; preds = %143
  %146 = icmp ne i64 %144, 1
  br i1 %146, label %147, label %154

147:                                              ; preds = %145
  %148 = load ptr, ptr @stderr, align 8, !tbaa !5
  %149 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %148, ptr noundef @.str.14) #6
  store i1 false, ptr %5, align 1
  store i32 1, ptr %11, align 4
  br label %231

150:                                              ; preds = %203, %197, %194, %190, %187, %183, %180, %176, %173, %168, %162, %159, %157, %154, %143, %140
  %151 = landingpad { ptr, i32 }
          cleanup
  %152 = extractvalue { ptr, i32 } %151, 0
  store ptr %152, ptr %13, align 8
  %153 = extractvalue { ptr, i32 } %151, 1
  store i32 %153, ptr %14, align 4
  br label %232

154:                                              ; preds = %145
  %155 = load ptr, ptr %7, align 8, !tbaa !5
  %156 = invoke noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %155)
          to label %157 unwind label %150

157:                                              ; preds = %154
  %158 = invoke i32 @fseek(ptr noundef %156, i64 noundef 8, i32 noundef 1)
          to label %159 unwind label %150

159:                                              ; preds = %157
  %160 = load ptr, ptr %7, align 8, !tbaa !5
  %161 = invoke noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %160)
          to label %162 unwind label %150

162:                                              ; preds = %159
  %163 = load i32, ptr %10, align 4, !tbaa !9
  %164 = sub nsw i32 %163, 16
  %165 = sext i32 %164 to i64
  %166 = invoke i32 @fseek(ptr noundef %161, i64 noundef %165, i32 noundef 1)
          to label %167 unwind label %150

167:                                              ; preds = %162
  br label %168

168:                                              ; preds = %202, %167
  %169 = load ptr, ptr %7, align 8, !tbaa !5
  %170 = invoke noundef zeroext i1 @_ZNK4sptk6reaper12FileResource3eofEv(ptr noundef nonnull align 8 dereferenceable(72) %169)
          to label %171 unwind label %150

171:                                              ; preds = %168
  %172 = xor i1 %170, true
  br i1 %172, label %173, label %203

173:                                              ; preds = %171
  %174 = load ptr, ptr %7, align 8, !tbaa !5
  %175 = invoke noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %174)
          to label %176 unwind label %150

176:                                              ; preds = %173
  %177 = invoke i32 @fgetc(ptr noundef %175)
          to label %178 unwind label %150

178:                                              ; preds = %176
  %179 = icmp eq i32 %177, 100
  br i1 %179, label %180, label %202

180:                                              ; preds = %178
  %181 = load ptr, ptr %7, align 8, !tbaa !5
  %182 = invoke noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %181)
          to label %183 unwind label %150

183:                                              ; preds = %180
  %184 = invoke i32 @fgetc(ptr noundef %182)
          to label %185 unwind label %150

185:                                              ; preds = %183
  %186 = icmp eq i32 %184, 97
  br i1 %186, label %187, label %202

187:                                              ; preds = %185
  %188 = load ptr, ptr %7, align 8, !tbaa !5
  %189 = invoke noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %188)
          to label %190 unwind label %150

190:                                              ; preds = %187
  %191 = invoke i32 @fgetc(ptr noundef %189)
          to label %192 unwind label %150

192:                                              ; preds = %190
  %193 = icmp eq i32 %191, 116
  br i1 %193, label %194, label %202

194:                                              ; preds = %192
  %195 = load ptr, ptr %7, align 8, !tbaa !5
  %196 = invoke noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %195)
          to label %197 unwind label %150

197:                                              ; preds = %194
  %198 = invoke i32 @fgetc(ptr noundef %196)
          to label %199 unwind label %150

199:                                              ; preds = %197
  %200 = icmp eq i32 %198, 97
  br i1 %200, label %201, label %202

201:                                              ; preds = %199
  br label %203

202:                                              ; preds = %199, %192, %185, %178
  br label %168, !llvm.loop !13

203:                                              ; preds = %201, %171
  %204 = load ptr, ptr %7, align 8, !tbaa !5
  %205 = invoke noundef zeroext i1 @_ZNK4sptk6reaper12FileResource3eofEv(ptr noundef nonnull align 8 dereferenceable(72) %204)
          to label %206 unwind label %150

206:                                              ; preds = %203
  br i1 %205, label %207, label %210

207:                                              ; preds = %206
  %208 = load ptr, ptr @stderr, align 8, !tbaa !5
  %209 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %208, ptr noundef @.str.15) #6
  store i1 false, ptr %5, align 1
  store i32 1, ptr %11, align 4
  br label %231

210:                                              ; preds = %206
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !9
  %211 = load ptr, ptr %7, align 8, !tbaa !5
  %212 = invoke noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %211)
          to label %213 unwind label %220

213:                                              ; preds = %210
  %214 = invoke i64 @fread(ptr noundef %19, i64 noundef 4, i64 noundef 1, ptr noundef %212)
          to label %215 unwind label %220

215:                                              ; preds = %213
  %216 = icmp ne i64 %214, 1
  br i1 %216, label %217, label %224

217:                                              ; preds = %215
  %218 = load ptr, ptr @stderr, align 8, !tbaa !5
  %219 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %218, ptr noundef @.str.16) #6
  store i1 false, ptr %5, align 1
  store i32 1, ptr %11, align 4
  br label %230

220:                                              ; preds = %213, %210
  %221 = landingpad { ptr, i32 }
          cleanup
  %222 = extractvalue { ptr, i32 } %221, 0
  store ptr %222, ptr %13, align 8
  %223 = extractvalue { ptr, i32 } %221, 1
  store i32 %223, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %232

224:                                              ; preds = %215
  %225 = load i32, ptr %18, align 4, !tbaa !9
  %226 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 %225, ptr %226, align 4, !tbaa !9
  %227 = load i32, ptr %19, align 4, !tbaa !9
  %228 = sdiv i32 %227, 2
  %229 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 %228, ptr %229, align 4, !tbaa !9
  store i1 true, ptr %5, align 1
  store i32 1, ptr %11, align 4
  br label %230

230:                                              ; preds = %224, %217
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %231

231:                                              ; preds = %230, %207, %147
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %233

232:                                              ; preds = %220, %150
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %234

233:                                              ; preds = %231, %137, %126
  call void @llvm.lifetime.end.p0(i64 2, ptr %17) #6
  br label %235

234:                                              ; preds = %232, %129
  call void @llvm.lifetime.end.p0(i64 2, ptr %17) #6
  br label %236

235:                                              ; preds = %233, %111, %105, %94, %57, %44
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #6
  br label %237

236:                                              ; preds = %234, %97, %47
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %240

237:                                              ; preds = %235, %37, %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %238

238:                                              ; preds = %237, %23
  %239 = load i1, ptr %5, align 1
  ret i1 %239

240:                                              ; preds = %236
  %241 = load ptr, ptr %13, align 8
  %242 = load i32, ptr %14, align 4
  %243 = insertvalue { ptr, i32 } poison, ptr %241, 0
  %244 = insertvalue { ptr, i32 } %243, i32 %242, 1
  resume { ptr, i32 } %244
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #4

declare i32 @fseek(ptr noundef, i64 noundef, i32 noundef) #2

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

declare i32 @fgetc(ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 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 = { 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 #5 = { 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 = { 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 = !{!"short", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"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"

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [31 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK4sptk6reaper12WavRiffCodec9ReadChunkEPNS0_12FileResourceEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK4sptk6reaper12WavRiffCodec10CheckChunkEPNS0_12FileResourceEPKc(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4sptk6reaper12WavRiffCodec10ReadHeaderEPNS0_12FileResourceEPiS4_(ptr noundef nonnull align 4 dereferenceable(4) %0, ptr noundef %1, ptr nocapture noundef writeonly %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca i16, align 2
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = tail call noundef zeroext i1 @_ZNK4sptk6reaper12WavRiffCodec10CheckChunkEPNS0_12FileResourceEPKc(ptr noundef nonnull align 4 dereferenceable(4) %0, ptr noundef %1, ptr noundef nonnull @.str)
  br i1 %12, label %16, label %13

13:                                               ; preds = %4
  %14 = load ptr, ptr @stderr, align 8, !tbaa !5
  %15 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %14, ptr noundef nonnull @.str.1) #5
  br label %134

16:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  store i32 0, ptr %5, align 4, !tbaa !9
  %17 = tail call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %1)
  %18 = call i64 @fread(ptr noundef nonnull %5, i64 noundef 4, i64 noundef 1, ptr noundef %17)
  %.not = icmp eq i64 %18, 1
  br i1 %.not, label %22, label %19

19:                                               ; preds = %16
  %20 = load ptr, ptr @stderr, align 8, !tbaa !5
  %21 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %20, ptr noundef nonnull @.str.2) #5
  br label %133

22:                                               ; preds = %16
  %23 = tail call noundef zeroext i1 @_ZNK4sptk6reaper12WavRiffCodec10CheckChunkEPNS0_12FileResourceEPKc(ptr noundef nonnull align 4 dereferenceable(4) %0, ptr noundef nonnull %1, ptr noundef nonnull @.str.3)
  br i1 %23, label %27, label %24

24:                                               ; preds = %22
  %25 = load ptr, ptr @stderr, align 8, !tbaa !5
  %26 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef nonnull @.str.4) #5
  br label %133

27:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  %28 = invoke noundef zeroext i1 @_ZNK4sptk6reaper12WavRiffCodec9ReadChunkEPNS0_12FileResourceEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 4 dereferenceable(4) %0, ptr noundef nonnull %1, ptr noundef nonnull %6)
          to label %29 unwind label %33

29:                                               ; preds = %27
  br i1 %28, label %35, label %30

30:                                               ; preds = %29
  %31 = load ptr, ptr @stderr, align 8, !tbaa !5
  %32 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef nonnull @.str.5) #5
  br label %131

33:                                               ; preds = %27
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %132

35:                                               ; preds = %29
  %36 = call noundef zeroext i1 @_ZStneIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull @.str.6)
  br i1 %36, label %37, label %42

37:                                               ; preds = %35
  %38 = call noundef zeroext i1 @_ZStneIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull @.str.7)
  br i1 %38, label %39, label %42

39:                                               ; preds = %37
  %40 = load ptr, ptr @stderr, align 8, !tbaa !5
  %41 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %40, ptr noundef nonnull @.str.8) #5
  br label %131

42:                                               ; preds = %37, %35
  %43 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull @.str.7)
  br i1 %43, label %44, label %58

44:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  %45 = call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %1)
  %46 = call i64 @fread(ptr noundef nonnull %7, i64 noundef 4, i64 noundef 1, ptr noundef %45)
  %47 = call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %1)
  %48 = load i32, ptr %7, align 4, !tbaa !9
  %49 = sext i32 %48 to i64
  %50 = call i32 @fseek(ptr noundef %47, i64 noundef %49, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  %51 = invoke noundef zeroext i1 @_ZNK4sptk6reaper12WavRiffCodec10CheckChunkEPNS0_12FileResourceEPKc(ptr noundef nonnull align 4 dereferenceable(4) %0, ptr noundef nonnull %1, ptr noundef nonnull @.str.6)
          to label %52 unwind label %56

52:                                               ; preds = %44
  br i1 %51, label %.critedge, label %53

53:                                               ; preds = %52
  %54 = load ptr, ptr @stderr, align 8, !tbaa !5
  %55 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %54, ptr noundef nonnull @.str.9) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  br label %131

56:                                               ; preds = %44
  %57 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  br label %132

.critedge:                                        ; preds = %52
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  br label %58

58:                                               ; preds = %.critedge, %42
  %59 = call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %1)
  %60 = call i64 @fread(ptr noundef nonnull %5, i64 noundef 4, i64 noundef 1, ptr noundef %59)
  %.not30 = icmp eq i64 %60, 1
  br i1 %.not30, label %64, label %61

61:                                               ; preds = %58
  %62 = load ptr, ptr @stderr, align 8, !tbaa !5
  %63 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %62, ptr noundef nonnull @.str.10) #5
  br label %131

64:                                               ; preds = %58
  %65 = load i32, ptr %5, align 4, !tbaa !9
  %66 = icmp slt i32 %65, 16
  br i1 %66, label %67, label %70

67:                                               ; preds = %64
  %68 = load ptr, ptr @stderr, align 8, !tbaa !5
  %69 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %68, ptr noundef nonnull @.str.11) #5
  br label %131

70:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %9) #6
  store i16 0, ptr %9, align 2, !tbaa !11
  %71 = call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %1)
  %72 = call i32 @fseek(ptr noundef %71, i64 noundef 2, i32 noundef 1)
  %73 = call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %1)
  %74 = call i64 @fread(ptr noundef nonnull %9, i64 noundef 2, i64 noundef 1, ptr noundef %73)
  %.not31 = icmp eq i64 %74, 1
  br i1 %.not31, label %78, label %75

75:                                               ; preds = %70
  %76 = load ptr, ptr @stderr, align 8, !tbaa !5
  %77 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %76, ptr noundef nonnull @.str.12) #5
  br label %130

78:                                               ; preds = %70
  %79 = load i16, ptr %9, align 2, !tbaa !11
  %.not32 = icmp eq i16 %79, 1
  br i1 %.not32, label %83, label %80

80:                                               ; preds = %78
  %81 = load ptr, ptr @stderr, align 8, !tbaa !5
  %82 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %81, ptr noundef nonnull @.str.13) #5
  br label %130

83:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #6
  %84 = call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %1)
  %85 = call i64 @fread(ptr noundef nonnull %10, i64 noundef 4, i64 noundef 1, ptr noundef %84)
  %.not33 = icmp eq i64 %85, 1
  br i1 %.not33, label %89, label %86

86:                                               ; preds = %83
  %87 = load ptr, ptr @stderr, align 8, !tbaa !5
  %88 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %87, ptr noundef nonnull @.str.14) #5
  br label %129

89:                                               ; preds = %83
  %90 = call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %1)
  %91 = call i32 @fseek(ptr noundef %90, i64 noundef 8, i32 noundef 1)
  %92 = call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %1)
  %93 = add nsw i32 %65, -16
  %94 = zext nneg i32 %93 to i64
  %95 = call i32 @fseek(ptr noundef %92, i64 noundef %94, i32 noundef 1)
  %96 = call noundef zeroext i1 @_ZNK4sptk6reaper12FileResource3eofEv(ptr noundef nonnull align 8 dereferenceable(72) %1)
  br i1 %96, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %89, %112
  %97 = call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %1)
  %98 = call i32 @fgetc(ptr noundef %97)
  %99 = icmp eq i32 %98, 100
  br i1 %99, label %100, label %112

100:                                              ; preds = %.lr.ph
  %101 = call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %1)
  %102 = call i32 @fgetc(ptr noundef %101)
  %103 = icmp eq i32 %102, 97
  br i1 %103, label %104, label %112

104:                                              ; preds = %100
  %105 = call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %1)
  %106 = call i32 @fgetc(ptr noundef %105)
  %107 = icmp eq i32 %106, 116
  br i1 %107, label %108, label %112

108:                                              ; preds = %104
  %109 = call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %1)
  %110 = call i32 @fgetc(ptr noundef %109)
  %111 = icmp eq i32 %110, 97
  br i1 %111, label %._crit_edge, label %112

112:                                              ; preds = %108, %104, %100, %.lr.ph
  %113 = call noundef zeroext i1 @_ZNK4sptk6reaper12FileResource3eofEv(ptr noundef nonnull align 8 dereferenceable(72) %1)
  br i1 %113, label %._crit_edge, label %.lr.ph, !llvm.loop !13

._crit_edge:                                      ; preds = %112, %108, %89
  %114 = call noundef zeroext i1 @_ZNK4sptk6reaper12FileResource3eofEv(ptr noundef nonnull align 8 dereferenceable(72) %1)
  br i1 %114, label %115, label %118

115:                                              ; preds = %._crit_edge
  %116 = load ptr, ptr @stderr, align 8, !tbaa !5
  %117 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %116, ptr noundef nonnull @.str.15) #5
  br label %129

118:                                              ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #6
  store i32 0, ptr %11, align 4, !tbaa !9
  %119 = call noundef ptr @_ZN4sptk6reaper12FileResource2fpEv(ptr noundef nonnull align 8 dereferenceable(72) %1)
  %120 = call i64 @fread(ptr noundef nonnull %11, i64 noundef 4, i64 noundef 1, ptr noundef %119)
  %.not34 = icmp eq i64 %120, 1
  br i1 %.not34, label %124, label %121

121:                                              ; preds = %118
  %122 = load ptr, ptr @stderr, align 8, !tbaa !5
  %123 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %122, ptr noundef nonnull @.str.16) #5
  br label %128

124:                                              ; preds = %118
  %125 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %125, ptr %3, align 4, !tbaa !9
  %126 = load i32, ptr %11, align 4, !tbaa !9
  %127 = sdiv i32 %126, 2
  store i32 %127, ptr %2, align 4, !tbaa !9
  br label %128

128:                                              ; preds = %124, %121
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #6
  br label %129

129:                                              ; preds = %128, %115, %86
  %.2 = phi i1 [ false, %86 ], [ false, %115 ], [ %.not34, %128 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  br label %130

130:                                              ; preds = %129, %80, %75
  %.3 = phi i1 [ false, %75 ], [ false, %80 ], [ %.2, %129 ]
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %9) #6
  br label %131

131:                                              ; preds = %53, %130, %67, %61, %39, %30
  %.4 = phi i1 [ false, %39 ], [ false, %61 ], [ false, %67 ], [ %.3, %130 ], [ false, %53 ], [ false, %30 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #6
  br label %133

132:                                              ; preds = %56, %33
  %.pn = phi { ptr, i32 } [ %57, %56 ], [ %34, %33 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  resume { ptr, i32 } %.pn

133:                                              ; preds = %131, %24, %19
  %.5 = phi i1 [ false, %19 ], [ %.4, %131 ], [ false, %24 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  br label %134

134:                                              ; preds = %133, %13
  %.6 = phi i1 [ %.5, %133 ], [ false, %13 ]
  ret i1 %.6
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @fseek(ptr nocapture noundef, i64 noundef, i32 noundef) local_unnamed_addr #2

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

; Function Attrs: nofree nounwind
declare noundef i32 @fgetc(ptr nocapture noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 = { 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 #5 = { cold nounwind }
attributes #6 = { 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 = !{!"short", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


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