; LLVM IR from reworks-org/galaxy :: deps/sfml_deps/flac-src/oss-fuzz (seek)

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

@alloc_check_threshold = external dso_local global i32, align 4
@alloc_check_counter = external dso_local global i32, align 4
@write_abort_check_counter = external dso_local global i32, align 4
@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [27 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local i32 @LLVMFuzzerTestOneInput(ptr noundef %0, i64 noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca [16 x i32], align 16
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i8, align 1
  %16 = alloca ptr, align 8
  %17 = alloca i8, align 1
  %18 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1, ptr %6, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %19 = load i64, ptr %5, align 8, !tbaa !9
  %20 = icmp ugt i64 %19, 2
  br i1 %20, label %21, label %32

21:                                               ; preds = %2
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %22, i64 1
  %24 = load i8, ptr %23, align 1, !tbaa !13
  %25 = zext i8 %24 to i32
  %26 = icmp slt i32 %25, 128
  br i1 %26, label %27, label %32

27:                                               ; preds = %21
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %28, i64 1
  %30 = load i8, ptr %29, align 1, !tbaa !13
  %31 = zext i8 %30 to i32
  store i32 %31, ptr @alloc_check_threshold, align 4, !tbaa !11
  br label %33

32:                                               ; preds = %21, %2
  store i32 2147483647, ptr @alloc_check_threshold, align 4, !tbaa !11
  br label %33

33:                                               ; preds = %32, %27
  store i32 0, ptr @alloc_check_counter, align 4, !tbaa !11
  store i32 -1, ptr @write_abort_check_counter, align 4, !tbaa !11
  %34 = call ptr @FLAC__stream_decoder_new()
  store ptr %34, ptr %7, align 8, !tbaa !5
  %35 = icmp eq ptr %34, null
  br i1 %35, label %36, label %39

36:                                               ; preds = %33
  %37 = load ptr, ptr @stderr, align 8, !tbaa !5
  %38 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef @.str) #5
  store i32 1, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %277

39:                                               ; preds = %33
  %40 = load i64, ptr %5, align 8, !tbaa !9
  %41 = icmp ult i64 %40, 3
  br i1 %41, label %42, label %44

42:                                               ; preds = %39
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  call void @FLAC__stream_decoder_delete(ptr noundef %43)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %277

44:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %45

45:                                               ; preds = %64, %44
  %46 = load i32, ptr %12, align 4, !tbaa !11
  %47 = icmp slt i32 %46, 4
  br i1 %47, label %49, label %48

48:                                               ; preds = %45
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %67

49:                                               ; preds = %45
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = load i32, ptr %12, align 4, !tbaa !11
  %52 = sdiv i32 %51, 8
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds i8, ptr %50, i64 %53
  %55 = load i8, ptr %54, align 1, !tbaa !13
  %56 = zext i8 %55 to i32
  %57 = load i32, ptr %12, align 4, !tbaa !11
  %58 = srem i32 %57, 8
  %59 = shl i32 1, %58
  %60 = and i32 %56, %59
  %61 = load i32, ptr %12, align 4, !tbaa !11
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [16 x i32], ptr %9, i64 0, i64 %62
  store i32 %60, ptr %63, align 4, !tbaa !11
  br label %64

64:                                               ; preds = %49
  %65 = load i32, ptr %12, align 4, !tbaa !11
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %12, align 4, !tbaa !11
  br label %45, !llvm.loop !14

67:                                               ; preds = %48
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds i8, ptr %68, i64 0
  %70 = load i8, ptr %69, align 1, !tbaa !13
  %71 = zext i8 %70 to i32
  %72 = ashr i32 %71, 4
  %73 = trunc i32 %72 to i8
  store i8 %73, ptr %8, align 1, !tbaa !13
  %74 = load i8, ptr %8, align 1, !tbaa !13
  %75 = zext i8 %74 to i64
  %76 = load i64, ptr %5, align 8, !tbaa !9
  %77 = sub i64 %76, 1
  %78 = sub i64 %77, 2
  %79 = icmp uge i64 %75, %78
  br i1 %79, label %80, label %85

80:                                               ; preds = %67
  %81 = load i64, ptr %5, align 8, !tbaa !9
  %82 = sub i64 %81, 1
  %83 = sub i64 %82, 2
  %84 = trunc i64 %83 to i8
  store i8 %84, ptr %8, align 1, !tbaa !13
  br label %85

85:                                               ; preds = %80, %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %86 = call noalias ptr @fopen(ptr noundef @.str.1, ptr noundef @.str.2)
  store ptr %86, ptr %13, align 8, !tbaa !5
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = getelementptr inbounds i8, ptr %87, i64 2
  %89 = load i8, ptr %8, align 1, !tbaa !13
  %90 = zext i8 %89 to i32
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds i8, ptr %88, i64 %91
  %93 = load i64, ptr %5, align 8, !tbaa !9
  %94 = sub i64 %93, 2
  %95 = load i8, ptr %8, align 1, !tbaa !13
  %96 = zext i8 %95 to i64
  %97 = sub i64 %94, %96
  %98 = load ptr, ptr %13, align 8, !tbaa !5
  %99 = call i64 @fwrite(ptr noundef %92, i64 noundef 1, i64 noundef %97, ptr noundef %98)
  %100 = load ptr, ptr %13, align 8, !tbaa !5
  %101 = call i32 @fclose(ptr noundef %100)
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  %102 = getelementptr inbounds [16 x i32], ptr %9, i64 0, i64 0
  %103 = load i32, ptr %102, align 16, !tbaa !11
  store i32 %103, ptr %10, align 4, !tbaa !11
  %104 = load ptr, ptr %7, align 8, !tbaa !5
  %105 = getelementptr inbounds [16 x i32], ptr %9, i64 0, i64 1
  %106 = load i32, ptr %105, align 4, !tbaa !11
  %107 = call i32 @FLAC__stream_decoder_set_md5_checking(ptr noundef %104, i32 noundef %106)
  %108 = getelementptr inbounds [16 x i32], ptr %9, i64 0, i64 2
  %109 = load i32, ptr %108, align 8, !tbaa !11
  %110 = icmp ne i32 %109, 0
  br i1 %110, label %111, label %114

111:                                              ; preds = %85
  %112 = load ptr, ptr %7, align 8, !tbaa !5
  %113 = call i32 @FLAC__stream_decoder_set_metadata_respond_all(ptr noundef %112)
  br label %114

114:                                              ; preds = %111, %85
  %115 = getelementptr inbounds [16 x i32], ptr %9, i64 0, i64 3
  %116 = load i32, ptr %115, align 4, !tbaa !11
  %117 = icmp ne i32 %116, 0
  br i1 %117, label %118, label %121

118:                                              ; preds = %114
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = call i32 @FLAC__stream_decoder_set_metadata_ignore_all(ptr noundef %119)
  br label %121

121:                                              ; preds = %118, %114
  %122 = load i32, ptr %6, align 4, !tbaa !11
  %123 = icmp ne i32 %122, 0
  br i1 %123, label %124, label %138

124:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %125 = load i32, ptr %10, align 4, !tbaa !11
  %126 = icmp ne i32 %125, 0
  br i1 %126, label %127, label %130

127:                                              ; preds = %124
  %128 = load ptr, ptr %7, align 8, !tbaa !5
  %129 = call i32 @FLAC__stream_decoder_init_ogg_file(ptr noundef %128, ptr noundef @.str.1, ptr noundef @_ZL14write_callbackPK19FLAC__StreamDecoderPK11FLAC__FramePKPKiPv, ptr noundef null, ptr noundef @_ZL14error_callbackPK19FLAC__StreamDecoder30FLAC__StreamDecoderErrorStatusPv, ptr noundef null)
  store i32 %129, ptr %14, align 4, !tbaa !16
  br label %133

130:                                              ; preds = %124
  %131 = load ptr, ptr %7, align 8, !tbaa !5
  %132 = call i32 @FLAC__stream_decoder_init_file(ptr noundef %131, ptr noundef @.str.1, ptr noundef @_ZL14write_callbackPK19FLAC__StreamDecoderPK11FLAC__FramePKPKiPv, ptr noundef null, ptr noundef @_ZL14error_callbackPK19FLAC__StreamDecoder30FLAC__StreamDecoderErrorStatusPv, ptr noundef null)
  store i32 %132, ptr %14, align 4, !tbaa !16
  br label %133

133:                                              ; preds = %130, %127
  %134 = load i32, ptr %14, align 4, !tbaa !16
  %135 = icmp ne i32 %134, 0
  br i1 %135, label %136, label %137

136:                                              ; preds = %133
  store i32 0, ptr %6, align 4, !tbaa !11
  br label %137

137:                                              ; preds = %136, %133
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %138

138:                                              ; preds = %137, %121
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #5
  store i8 0, ptr %15, align 1, !tbaa !13
  br label %139

139:                                              ; preds = %270, %138
  %140 = load i32, ptr %6, align 4, !tbaa !11
  %141 = icmp ne i32 %140, 0
  br i1 %141, label %142, label %148

142:                                              ; preds = %139
  %143 = load i8, ptr %15, align 1, !tbaa !13
  %144 = zext i8 %143 to i32
  %145 = load i8, ptr %8, align 1, !tbaa !13
  %146 = zext i8 %145 to i32
  %147 = icmp slt i32 %144, %146
  br label %148

148:                                              ; preds = %142, %139
  %149 = phi i1 [ false, %139 ], [ %147, %142 ]
  br i1 %149, label %151, label %150

150:                                              ; preds = %148
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #5
  br label %273

151:                                              ; preds = %148
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %152 = load ptr, ptr %4, align 8, !tbaa !5
  %153 = getelementptr inbounds i8, ptr %152, i64 2
  %154 = load i8, ptr %15, align 1, !tbaa !13
  %155 = zext i8 %154 to i32
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds i8, ptr %153, i64 %156
  store ptr %157, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #5
  %158 = load ptr, ptr %16, align 8, !tbaa !5
  %159 = getelementptr inbounds i8, ptr %158, i64 0
  %160 = load i8, ptr %159, align 1, !tbaa !13
  %161 = zext i8 %160 to i32
  %162 = ashr i32 %161, 3
  %163 = shl i32 1, %162
  %164 = trunc i32 %163 to i8
  store i8 %164, ptr %17, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %165 = load ptr, ptr %16, align 8, !tbaa !5
  %166 = getelementptr inbounds i8, ptr %165, i64 0
  %167 = load i8, ptr %166, align 1, !tbaa !13
  %168 = zext i8 %167 to i32
  %169 = and i32 %168, 15
  switch i32 %169, label %269 [
    i32 0, label %170
    i32 1, label %173
    i32 2, label %176
    i32 3, label %179
    i32 4, label %182
    i32 5, label %185
    i32 6, label %188
    i32 14, label %188
    i32 7, label %200
    i32 8, label %262
  ]

170:                                              ; preds = %151
  %171 = load ptr, ptr %7, align 8, !tbaa !5
  %172 = call i32 @FLAC__stream_decoder_process_until_end_of_stream(ptr noundef %171)
  store i32 %172, ptr %6, align 4, !tbaa !11
  br label %269

173:                                              ; preds = %151
  %174 = load ptr, ptr %7, align 8, !tbaa !5
  %175 = call i32 @FLAC__stream_decoder_process_until_end_of_metadata(ptr noundef %174)
  store i32 %175, ptr %6, align 4, !tbaa !11
  br label %269

176:                                              ; preds = %151
  %177 = load ptr, ptr %7, align 8, !tbaa !5
  %178 = call i32 @FLAC__stream_decoder_process_single(ptr noundef %177)
  store i32 %178, ptr %6, align 4, !tbaa !11
  br label %269

179:                                              ; preds = %151
  %180 = load ptr, ptr %7, align 8, !tbaa !5
  %181 = call i32 @FLAC__stream_decoder_skip_single_frame(ptr noundef %180)
  store i32 %181, ptr %6, align 4, !tbaa !11
  br label %269

182:                                              ; preds = %151
  %183 = load ptr, ptr %7, align 8, !tbaa !5
  %184 = call i32 @FLAC__stream_decoder_reset(ptr noundef %183)
  store i32 %184, ptr %6, align 4, !tbaa !11
  br label %269

185:                                              ; preds = %151
  %186 = load ptr, ptr %7, align 8, !tbaa !5
  %187 = call i32 @FLAC__stream_decoder_flush(ptr noundef %186)
  store i32 %187, ptr %6, align 4, !tbaa !11
  br label %269

188:                                              ; preds = %151, %151
  %189 = load ptr, ptr %16, align 8, !tbaa !5
  %190 = getelementptr inbounds i8, ptr %189, i64 0
  %191 = load i8, ptr %190, align 1, !tbaa !13
  %192 = zext i8 %191 to i32
  %193 = ashr i32 %192, 3
  %194 = shl i32 1, %193
  %195 = trunc i32 %194 to i8
  store i8 %195, ptr %17, align 1, !tbaa !13
  %196 = load ptr, ptr %7, align 8, !tbaa !5
  %197 = load i8, ptr %17, align 1, !tbaa !13
  %198 = zext i8 %197 to i64
  %199 = call i32 @FLAC__stream_decoder_seek_absolute(ptr noundef %196, i64 noundef %198)
  store i32 %199, ptr %6, align 4, !tbaa !11
  br label %269

200:                                              ; preds = %151
  %201 = load i8, ptr %15, align 1, !tbaa !13
  %202 = zext i8 %201 to i32
  %203 = add nsw i32 %202, 8
  %204 = load i8, ptr %8, align 1, !tbaa !13
  %205 = zext i8 %204 to i32
  %206 = icmp sge i32 %203, %205
  br i1 %206, label %207, label %208

207:                                              ; preds = %200
  br label %269

208:                                              ; preds = %200
  %209 = load ptr, ptr %16, align 8, !tbaa !5
  %210 = getelementptr inbounds i8, ptr %209, i64 1
  %211 = load i8, ptr %210, align 1, !tbaa !13
  %212 = zext i8 %211 to i64
  %213 = shl i64 %212, 56
  %214 = load ptr, ptr %16, align 8, !tbaa !5
  %215 = getelementptr inbounds i8, ptr %214, i64 2
  %216 = load i8, ptr %215, align 1, !tbaa !13
  %217 = zext i8 %216 to i64
  %218 = shl i64 %217, 48
  %219 = add i64 %213, %218
  %220 = load ptr, ptr %16, align 8, !tbaa !5
  %221 = getelementptr inbounds i8, ptr %220, i64 3
  %222 = load i8, ptr %221, align 1, !tbaa !13
  %223 = zext i8 %222 to i64
  %224 = shl i64 %223, 40
  %225 = add i64 %219, %224
  %226 = load ptr, ptr %16, align 8, !tbaa !5
  %227 = getelementptr inbounds i8, ptr %226, i64 4
  %228 = load i8, ptr %227, align 1, !tbaa !13
  %229 = zext i8 %228 to i64
  %230 = shl i64 %229, 32
  %231 = add i64 %225, %230
  %232 = load ptr, ptr %16, align 8, !tbaa !5
  %233 = getelementptr inbounds i8, ptr %232, i64 5
  %234 = load i8, ptr %233, align 1, !tbaa !13
  %235 = zext i8 %234 to i64
  %236 = shl i64 %235, 24
  %237 = add i64 %231, %236
  %238 = load ptr, ptr %16, align 8, !tbaa !5
  %239 = getelementptr inbounds i8, ptr %238, i64 6
  %240 = load i8, ptr %239, align 1, !tbaa !13
  %241 = zext i8 %240 to i64
  %242 = shl i64 %241, 16
  %243 = add i64 %237, %242
  %244 = load ptr, ptr %16, align 8, !tbaa !5
  %245 = getelementptr inbounds i8, ptr %244, i64 7
  %246 = load i8, ptr %245, align 1, !tbaa !13
  %247 = zext i8 %246 to i64
  %248 = shl i64 %247, 8
  %249 = add i64 %243, %248
  %250 = load ptr, ptr %16, align 8, !tbaa !5
  %251 = getelementptr inbounds i8, ptr %250, i64 8
  %252 = load i8, ptr %251, align 1, !tbaa !13
  %253 = zext i8 %252 to i64
  %254 = add i64 %249, %253
  store i64 %254, ptr %18, align 8, !tbaa !9
  %255 = load i8, ptr %15, align 1, !tbaa !13
  %256 = zext i8 %255 to i32
  %257 = add nsw i32 %256, 8
  %258 = trunc i32 %257 to i8
  store i8 %258, ptr %15, align 1, !tbaa !13
  %259 = load ptr, ptr %7, align 8, !tbaa !5
  %260 = load i64, ptr %18, align 8, !tbaa !9
  %261 = call i32 @FLAC__stream_decoder_seek_absolute(ptr noundef %259, i64 noundef %260)
  store i32 %261, ptr %6, align 4, !tbaa !11
  br label %269

262:                                              ; preds = %151
  %263 = load ptr, ptr %16, align 8, !tbaa !5
  %264 = getelementptr inbounds i8, ptr %263, i64 0
  %265 = load i8, ptr %264, align 1, !tbaa !13
  %266 = zext i8 %265 to i32
  %267 = ashr i32 %266, 4
  %268 = add nsw i32 %267, 1
  store i32 %268, ptr @write_abort_check_counter, align 4, !tbaa !11
  br label %269

269:                                              ; preds = %262, %208, %207, %188, %185, %182, %179, %176, %173, %170, %151
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %270

270:                                              ; preds = %269
  %271 = load i8, ptr %15, align 1, !tbaa !13
  %272 = add i8 %271, 1
  store i8 %272, ptr %15, align 1, !tbaa !13
  br label %139, !llvm.loop !18

273:                                              ; preds = %150
  %274 = load ptr, ptr %7, align 8, !tbaa !5
  %275 = call i32 @FLAC__stream_decoder_finish(ptr noundef %274)
  %276 = load ptr, ptr %7, align 8, !tbaa !5
  call void @FLAC__stream_decoder_delete(ptr noundef %276)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %277

277:                                              ; preds = %273, %42, %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %278 = load i32, ptr %3, align 4
  ret i32 %278
}

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

declare ptr @FLAC__stream_decoder_new() #2

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

declare void @FLAC__stream_decoder_delete(ptr noundef) #2

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

declare noalias ptr @fopen(ptr noundef, ptr noundef) #2

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

declare i32 @fclose(ptr noundef) #2

declare i32 @FLAC__stream_decoder_set_md5_checking(ptr noundef, i32 noundef) #2

declare i32 @FLAC__stream_decoder_set_metadata_respond_all(ptr noundef) #2

declare i32 @FLAC__stream_decoder_set_metadata_ignore_all(ptr noundef) #2

declare i32 @FLAC__stream_decoder_init_ogg_file(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL14write_callbackPK19FLAC__StreamDecoderPK11FLAC__FramePKPKiPv(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #4

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

declare i32 @FLAC__stream_decoder_init_file(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare i32 @FLAC__stream_decoder_process_until_end_of_stream(ptr noundef) #2

declare i32 @FLAC__stream_decoder_process_until_end_of_metadata(ptr noundef) #2

declare i32 @FLAC__stream_decoder_process_single(ptr noundef) #2

declare i32 @FLAC__stream_decoder_skip_single_frame(ptr noundef) #2

declare i32 @FLAC__stream_decoder_reset(ptr noundef) #2

declare i32 @FLAC__stream_decoder_flush(ptr noundef) #2

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

declare i32 @FLAC__stream_decoder_finish(ptr noundef) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { 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 }

!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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !17, i64 0}
!17 = !{!"_ZTS29FLAC__StreamDecoderInitStatus", !7, i64 0}
!18 = distinct !{!18, !15}


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

@alloc_check_threshold = external dso_local local_unnamed_addr global i32, align 4
@alloc_check_counter = external dso_local local_unnamed_addr global i32, align 4
@write_abort_check_counter = external dso_local local_unnamed_addr global i32, align 4
@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [27 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local range(i32 0, 2) i32 @LLVMFuzzerTestOneInput(ptr nocapture noundef %0, i64 noundef %1) local_unnamed_addr #0 {
  %3 = icmp ugt i64 %1, 2
  br i1 %3, label %4, label %9

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %0, i64 1
  %6 = load i8, ptr %5, align 1, !tbaa !5
  %7 = icmp sgt i8 %6, -1
  %8 = zext nneg i8 %6 to i32
  %spec.select81 = select i1 %7, i32 %8, i32 2147483647
  br label %9

9:                                                ; preds = %4, %2
  %storemerge = phi i32 [ 2147483647, %2 ], [ %spec.select81, %4 ]
  store i32 %storemerge, ptr @alloc_check_threshold, align 4, !tbaa !8
  store i32 0, ptr @alloc_check_counter, align 4, !tbaa !8
  store i32 -1, ptr @write_abort_check_counter, align 4, !tbaa !8
  %10 = tail call ptr @FLAC__stream_decoder_new()
  %11 = icmp eq ptr %10, null
  br i1 %11, label %12, label %15

12:                                               ; preds = %9
  %13 = load ptr, ptr @stderr, align 8, !tbaa !10
  %14 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef nonnull @.str) #4
  br label %129

15:                                               ; preds = %9
  %16 = icmp ult i64 %1, 3
  br i1 %16, label %37, label %.preheader

.preheader:                                       ; preds = %15
  %17 = load i8, ptr %0, align 1, !tbaa !5
  %18 = zext i8 %17 to i32
  %19 = and i32 %18, 1
  %20 = and i32 %18, 2
  %21 = and i32 %18, 4
  %22 = and i32 %18, 8
  %23 = lshr i8 %17, 4
  %24 = zext nneg i8 %23 to i64
  %25 = add i64 %1, -3
  %.not = icmp ugt i64 %25, %24
  %26 = trunc nuw nsw i64 %25 to i8
  %spec.select = select i1 %.not, i8 %23, i8 %26
  %27 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2)
  %28 = getelementptr inbounds i8, ptr %0, i64 2
  %29 = zext nneg i8 %spec.select to i32
  %30 = zext i8 %spec.select to i64
  %31 = getelementptr inbounds i8, ptr %28, i64 %30
  %32 = add i64 %1, -2
  %33 = sub i64 %32, %30
  %34 = tail call i64 @fwrite(ptr noundef nonnull %31, i64 noundef 1, i64 noundef %33, ptr noundef %27)
  %35 = tail call i32 @fclose(ptr noundef %27)
  %36 = tail call i32 @FLAC__stream_decoder_set_md5_checking(ptr noundef nonnull %10, i32 noundef %20)
  %.not75 = icmp eq i32 %21, 0
  br i1 %.not75, label %40, label %38

37:                                               ; preds = %15
  tail call void @FLAC__stream_decoder_delete(ptr noundef nonnull %10)
  br label %129

38:                                               ; preds = %.preheader
  %39 = tail call i32 @FLAC__stream_decoder_set_metadata_respond_all(ptr noundef nonnull %10)
  br label %40

40:                                               ; preds = %38, %.preheader
  %.not76 = icmp eq i32 %22, 0
  br i1 %.not76, label %43, label %41

41:                                               ; preds = %40
  %42 = tail call i32 @FLAC__stream_decoder_set_metadata_ignore_all(ptr noundef nonnull %10)
  br label %43

43:                                               ; preds = %40, %41
  %.not77 = icmp eq i32 %19, 0
  br i1 %.not77, label %46, label %44

44:                                               ; preds = %43
  %45 = tail call i32 @FLAC__stream_decoder_init_ogg_file(ptr noundef nonnull %10, ptr noundef nonnull @.str.1, ptr noundef nonnull @_ZL14write_callbackPK19FLAC__StreamDecoderPK11FLAC__FramePKPKiPv, ptr noundef null, ptr noundef nonnull @_ZL14error_callbackPK19FLAC__StreamDecoder30FLAC__StreamDecoderErrorStatusPv, ptr noundef null)
  br label %48

46:                                               ; preds = %43
  %47 = tail call i32 @FLAC__stream_decoder_init_file(ptr noundef nonnull %10, ptr noundef nonnull @.str.1, ptr noundef nonnull @_ZL14write_callbackPK19FLAC__StreamDecoderPK11FLAC__FramePKPKiPv, ptr noundef null, ptr noundef nonnull @_ZL14error_callbackPK19FLAC__StreamDecoder30FLAC__StreamDecoderErrorStatusPv, ptr noundef null)
  br label %48

48:                                               ; preds = %46, %44
  %.065 = phi i32 [ %45, %44 ], [ %47, %46 ]
  %.not78 = icmp eq i32 %.065, 0
  %49 = icmp ne i8 %spec.select, 0
  %50 = select i1 %.not78, i1 %49, i1 false
  br i1 %50, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %48
  %spec.select80 = zext i1 %.not78 to i32
  br label %.lr.ph

._crit_edge:                                      ; preds = %123, %48
  %51 = tail call i32 @FLAC__stream_decoder_finish(ptr noundef nonnull %10)
  tail call void @FLAC__stream_decoder_delete(ptr noundef nonnull %10)
  br label %129

.lr.ph:                                           ; preds = %.lr.ph.preheader, %123
  %52 = phi i32 [ %126, %123 ], [ 0, %.lr.ph.preheader ]
  %.284 = phi i32 [ %.3, %123 ], [ %spec.select80, %.lr.ph.preheader ]
  %.06383 = phi i8 [ %124, %123 ], [ 0, %.lr.ph.preheader ]
  %53 = zext i8 %.06383 to i64
  %54 = getelementptr inbounds i8, ptr %28, i64 %53
  %55 = load i8, ptr %54, align 1, !tbaa !5
  %56 = zext i8 %55 to i32
  %57 = and i32 %56, 15
  switch i32 %57, label %123 [
    i32 0, label %58
    i32 1, label %60
    i32 2, label %62
    i32 3, label %64
    i32 4, label %66
    i32 5, label %68
    i32 6, label %70
    i32 14, label %70
    i32 7, label %77
    i32 8, label %120
  ]

58:                                               ; preds = %.lr.ph
  %59 = tail call i32 @FLAC__stream_decoder_process_until_end_of_stream(ptr noundef nonnull %10)
  br label %123

60:                                               ; preds = %.lr.ph
  %61 = tail call i32 @FLAC__stream_decoder_process_until_end_of_metadata(ptr noundef nonnull %10)
  br label %123

62:                                               ; preds = %.lr.ph
  %63 = tail call i32 @FLAC__stream_decoder_process_single(ptr noundef nonnull %10)
  br label %123

64:                                               ; preds = %.lr.ph
  %65 = tail call i32 @FLAC__stream_decoder_skip_single_frame(ptr noundef nonnull %10)
  br label %123

66:                                               ; preds = %.lr.ph
  %67 = tail call i32 @FLAC__stream_decoder_reset(ptr noundef nonnull %10)
  br label %123

68:                                               ; preds = %.lr.ph
  %69 = tail call i32 @FLAC__stream_decoder_flush(ptr noundef nonnull %10)
  br label %123

70:                                               ; preds = %.lr.ph, %.lr.ph
  %71 = lshr i8 %55, 3
  %72 = zext nneg i8 %71 to i32
  %73 = shl nuw i32 1, %72
  %74 = and i32 %73, 255
  %75 = zext nneg i32 %74 to i64
  %76 = tail call i32 @FLAC__stream_decoder_seek_absolute(ptr noundef nonnull %10, i64 noundef %75)
  br label %123

77:                                               ; preds = %.lr.ph
  %78 = add nuw nsw i32 %52, 8
  %.not79 = icmp ult i32 %78, %29
  br i1 %.not79, label %79, label %123

79:                                               ; preds = %77
  %80 = getelementptr inbounds i8, ptr %54, i64 1
  %81 = load i8, ptr %80, align 1, !tbaa !5
  %82 = zext i8 %81 to i64
  %83 = shl nuw i64 %82, 56
  %84 = getelementptr inbounds i8, ptr %54, i64 2
  %85 = load i8, ptr %84, align 1, !tbaa !5
  %86 = zext i8 %85 to i64
  %87 = shl nuw nsw i64 %86, 48
  %88 = or disjoint i64 %87, %83
  %89 = getelementptr inbounds i8, ptr %54, i64 3
  %90 = load i8, ptr %89, align 1, !tbaa !5
  %91 = zext i8 %90 to i64
  %92 = shl nuw nsw i64 %91, 40
  %93 = or disjoint i64 %88, %92
  %94 = getelementptr inbounds i8, ptr %54, i64 4
  %95 = load i8, ptr %94, align 1, !tbaa !5
  %96 = zext i8 %95 to i64
  %97 = shl nuw nsw i64 %96, 32
  %98 = or disjoint i64 %93, %97
  %99 = getelementptr inbounds i8, ptr %54, i64 5
  %100 = load i8, ptr %99, align 1, !tbaa !5
  %101 = zext i8 %100 to i64
  %102 = shl nuw nsw i64 %101, 24
  %103 = or disjoint i64 %98, %102
  %104 = getelementptr inbounds i8, ptr %54, i64 6
  %105 = load i8, ptr %104, align 1, !tbaa !5
  %106 = zext i8 %105 to i64
  %107 = shl nuw nsw i64 %106, 16
  %108 = or disjoint i64 %103, %107
  %109 = getelementptr inbounds i8, ptr %54, i64 7
  %110 = load i8, ptr %109, align 1, !tbaa !5
  %111 = zext i8 %110 to i64
  %112 = shl nuw nsw i64 %111, 8
  %113 = or disjoint i64 %108, %112
  %114 = getelementptr inbounds i8, ptr %54, i64 8
  %115 = load i8, ptr %114, align 1, !tbaa !5
  %116 = zext i8 %115 to i64
  %117 = add nuw i64 %113, %116
  %118 = trunc nuw nsw i32 %78 to i8
  %119 = tail call i32 @FLAC__stream_decoder_seek_absolute(ptr noundef nonnull %10, i64 noundef %117)
  br label %123

120:                                              ; preds = %.lr.ph
  %121 = lshr i32 %56, 4
  %122 = add nuw nsw i32 %121, 1
  store i32 %122, ptr @write_abort_check_counter, align 4, !tbaa !8
  br label %123

123:                                              ; preds = %77, %120, %79, %70, %68, %66, %64, %62, %60, %58, %.lr.ph
  %.164 = phi i8 [ %.06383, %.lr.ph ], [ %.06383, %120 ], [ %.06383, %77 ], [ %118, %79 ], [ %.06383, %70 ], [ %.06383, %68 ], [ %.06383, %66 ], [ %.06383, %64 ], [ %.06383, %62 ], [ %.06383, %60 ], [ %.06383, %58 ]
  %.3 = phi i32 [ %.284, %.lr.ph ], [ %.284, %120 ], [ %.284, %77 ], [ %119, %79 ], [ %76, %70 ], [ %69, %68 ], [ %67, %66 ], [ %65, %64 ], [ %63, %62 ], [ %61, %60 ], [ %59, %58 ]
  %124 = add i8 %.164, 1
  %125 = icmp ne i32 %.3, 0
  %126 = zext i8 %124 to i32
  %127 = icmp ult i8 %124, %spec.select
  %128 = select i1 %125, i1 %127, i1 false
  br i1 %128, label %.lr.ph, label %._crit_edge, !llvm.loop !12

129:                                              ; preds = %._crit_edge, %37, %12
  %.0 = phi i32 [ 1, %12 ], [ 0, %37 ], [ 0, %._crit_edge ]
  ret i32 %.0
}

declare ptr @FLAC__stream_decoder_new() local_unnamed_addr #1

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

declare void @FLAC__stream_decoder_delete(ptr noundef) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #2

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

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

declare i32 @FLAC__stream_decoder_set_md5_checking(ptr noundef, i32 noundef) local_unnamed_addr #1

declare i32 @FLAC__stream_decoder_set_metadata_respond_all(ptr noundef) local_unnamed_addr #1

declare i32 @FLAC__stream_decoder_set_metadata_ignore_all(ptr noundef) local_unnamed_addr #1

declare i32 @FLAC__stream_decoder_init_ogg_file(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

declare i32 @FLAC__stream_decoder_init_file(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @FLAC__stream_decoder_process_until_end_of_stream(ptr noundef) local_unnamed_addr #1

declare i32 @FLAC__stream_decoder_process_until_end_of_metadata(ptr noundef) local_unnamed_addr #1

declare i32 @FLAC__stream_decoder_process_single(ptr noundef) local_unnamed_addr #1

declare i32 @FLAC__stream_decoder_skip_single_frame(ptr noundef) local_unnamed_addr #1

declare i32 @FLAC__stream_decoder_reset(ptr noundef) local_unnamed_addr #1

declare i32 @FLAC__stream_decoder_flush(ptr noundef) local_unnamed_addr #1

declare i32 @FLAC__stream_decoder_seek_absolute(ptr noundef, i64 noundef) local_unnamed_addr #1

declare i32 @FLAC__stream_decoder_finish(ptr noundef) local_unnamed_addr #1

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 = { "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 = { 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, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !6, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


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