; LLVM IR from IlyaGrebnov/libbsc :: bsc.ll (Z15compression_ompPcP8_IO_FILERlS_S1_S2_RiS3_)

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

%struct.BSC_BLOCK_HEADER = type <{ i64, i8, i8 }>

@paramBlockSize = external dso_local global i32, align 4
@paramBlockSorter = external dso_local global i32, align 4
@paramCoder = external dso_local global i32, align 4
@paramSortingContexts = external dso_local global i32, align 4
@paramEnableSegmentation = external dso_local global i32, align 4
@paramEnableReordering = external dso_local global i32, align 4
@paramLZPHashSize = external dso_local global i32, align 4
@paramLZPMinLen = external dso_local global i32, align 4
@segmentedBlock = external dso_local global [256 x i32], align 16
@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [67 x i8], align 1
@stdout = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [72 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z13paramFeaturesv() #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z15compression_ompPcP8_IO_FILERlS_S1_S2_RiS3_(ptr noundef %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef %3, ptr noundef %4, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7) #2 {
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i64, align 8
  %19 = alloca i32, align 4
  %20 = alloca double, align 8
  %21 = alloca i32, align 4
  %22 = alloca i8, align 1
  %23 = alloca i32, align 4
  %24 = alloca i64, align 8
  %25 = alloca i32, align 4
  %26 = alloca i8, align 1
  %27 = alloca i32, align 4
  %28 = alloca i8, align 1
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i64, align 8
  %32 = alloca %struct.BSC_BLOCK_HEADER, align 1
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store ptr %3, ptr %12, align 8, !tbaa !5
  store ptr %4, ptr %13, align 8, !tbaa !5
  store ptr %5, ptr %14, align 8, !tbaa !5
  store ptr %6, ptr %15, align 8, !tbaa !5
  store ptr %7, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %33 = load i32, ptr @paramBlockSize, align 4, !tbaa !9
  %34 = add nsw i32 %33, 28
  %35 = sext i32 %34 to i64
  %36 = call ptr @bsc_malloc(i64 noundef %35)
  store ptr %36, ptr %17, align 8, !tbaa !5
  %37 = load ptr, ptr %17, align 8, !tbaa !5
  %38 = icmp eq ptr %37, null
  br i1 %38, label %39, label %42

39:                                               ; preds = %8
  %40 = load ptr, ptr @stderr, align 8, !tbaa !5
  %41 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %40, ptr noundef @.str) #6
  call void @exit(i32 noundef 2) #7
  unreachable

42:                                               ; preds = %8
  br label %43

43:                                               ; preds = %367, %42
  br label %44

44:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  store i64 0, ptr %18, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !9
  %45 = load ptr, ptr %10, align 8, !tbaa !5
  %46 = call i32 @feof(ptr noundef %45) #6
  %47 = icmp eq i32 %46, 0
  br i1 %47, label %48, label %177

48:                                               ; preds = %44
  %49 = load ptr, ptr %10, align 8, !tbaa !5
  %50 = call i64 @ftello64(ptr noundef %49)
  %51 = load ptr, ptr %11, align 8, !tbaa !5
  %52 = load i64, ptr %51, align 8, !tbaa !11
  %53 = icmp ne i64 %50, %52
  br i1 %53, label %54, label %177

54:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %55 = load ptr, ptr %10, align 8, !tbaa !5
  %56 = call i64 @ftello64(ptr noundef %55)
  %57 = sitofp i64 %56 to double
  %58 = fmul double 1.000000e+02, %57
  %59 = load ptr, ptr %11, align 8, !tbaa !5
  %60 = load i64, ptr %59, align 8, !tbaa !11
  %61 = sitofp i64 %60 to double
  %62 = fdiv double %58, %61
  store double %62, ptr %20, align 8, !tbaa !13
  %63 = load ptr, ptr @stdout, align 8, !tbaa !5
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = load double, ptr %20, align 8, !tbaa !13
  %66 = fptosi double %65 to i32
  %67 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %63, ptr noundef @.str.1, ptr noundef %64, i32 noundef %66) #6
  %68 = load ptr, ptr @stdout, align 8, !tbaa !5
  %69 = call i32 @fflush(ptr noundef %68)
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  %70 = load ptr, ptr %10, align 8, !tbaa !5
  %71 = call i64 @ftello64(ptr noundef %70)
  store i64 %71, ptr %18, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %72 = load i32, ptr @paramBlockSize, align 4, !tbaa !9
  store i32 %72, ptr %21, align 4, !tbaa !9
  %73 = load i32, ptr @paramEnableSegmentation, align 4, !tbaa !9
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %75, label %89

75:                                               ; preds = %54
  %76 = load ptr, ptr %16, align 8, !tbaa !5
  %77 = load i32, ptr %76, align 4, !tbaa !9
  %78 = load ptr, ptr %15, align 8, !tbaa !5
  %79 = load i32, ptr %78, align 4, !tbaa !9
  %80 = sub nsw i32 %77, %79
  %81 = icmp sgt i32 %80, 1
  br i1 %81, label %82, label %88

82:                                               ; preds = %75
  %83 = load ptr, ptr %15, align 8, !tbaa !5
  %84 = load i32, ptr %83, align 4, !tbaa !9
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [256 x i32], ptr @segmentedBlock, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !9
  store i32 %87, ptr %21, align 4, !tbaa !9
  br label %88

88:                                               ; preds = %82, %75
  br label %89

89:                                               ; preds = %88, %54
  %90 = load ptr, ptr %17, align 8, !tbaa !5
  %91 = load i32, ptr %21, align 4, !tbaa !9
  %92 = sext i32 %91 to i64
  %93 = load ptr, ptr %10, align 8, !tbaa !5
  %94 = call i64 @fread(ptr noundef %90, i64 noundef 1, i64 noundef %92, ptr noundef %93)
  %95 = trunc i64 %94 to i32
  store i32 %95, ptr %19, align 4, !tbaa !9
  %96 = load i32, ptr %19, align 4, !tbaa !9
  %97 = icmp sle i32 %96, 0
  br i1 %97, label %98, label %102

98:                                               ; preds = %89
  %99 = load ptr, ptr @stderr, align 8, !tbaa !5
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  %101 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %99, ptr noundef @.str.2, ptr noundef %100) #6
  call void @exit(i32 noundef 1) #7
  unreachable

102:                                              ; preds = %89
  %103 = load i32, ptr @paramEnableSegmentation, align 4, !tbaa !9
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %176

105:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 1, ptr %22) #6
  store i8 0, ptr %22, align 1, !tbaa !15
  %106 = load ptr, ptr %15, align 8, !tbaa !5
  %107 = load i32, ptr %106, align 4, !tbaa !9
  %108 = load ptr, ptr %16, align 8, !tbaa !5
  %109 = load i32, ptr %108, align 4, !tbaa !9
  %110 = icmp eq i32 %107, %109
  br i1 %110, label %111, label %112

111:                                              ; preds = %105
  store i8 1, ptr %22, align 1, !tbaa !15
  br label %112

112:                                              ; preds = %111, %105
  %113 = load ptr, ptr %16, align 8, !tbaa !5
  %114 = load i32, ptr %113, align 4, !tbaa !9
  %115 = load ptr, ptr %15, align 8, !tbaa !5
  %116 = load i32, ptr %115, align 4, !tbaa !9
  %117 = sub nsw i32 %114, %116
  %118 = icmp eq i32 %117, 1
  br i1 %118, label %119, label %128

119:                                              ; preds = %112
  %120 = load i32, ptr %19, align 4, !tbaa !9
  %121 = load ptr, ptr %15, align 8, !tbaa !5
  %122 = load i32, ptr %121, align 4, !tbaa !9
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [256 x i32], ptr @segmentedBlock, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !9
  %126 = icmp ne i32 %120, %125
  br i1 %126, label %127, label %128

127:                                              ; preds = %119
  store i8 1, ptr %22, align 1, !tbaa !15
  br label %128

128:                                              ; preds = %127, %119, %112
  %129 = load i8, ptr %22, align 1, !tbaa !15, !range !17, !noundef !18
  %130 = trunc i8 %129 to i1
  br i1 %130, label %131, label %152

131:                                              ; preds = %128
  %132 = load ptr, ptr %15, align 8, !tbaa !5
  store i32 0, ptr %132, align 4, !tbaa !9
  %133 = load ptr, ptr %17, align 8, !tbaa !5
  %134 = load i32, ptr %19, align 4, !tbaa !9
  %135 = call noundef i32 @_Z13paramFeaturesv()
  %136 = call i32 @bsc_detect_segments(ptr noundef %133, i32 noundef %134, ptr noundef @segmentedBlock, i32 noundef 256, i32 noundef %135)
  %137 = load ptr, ptr %16, align 8, !tbaa !5
  store i32 %136, ptr %137, align 4, !tbaa !9
  %138 = load ptr, ptr %16, align 8, !tbaa !5
  %139 = load i32, ptr %138, align 4, !tbaa !9
  %140 = icmp sle i32 %139, 0
  br i1 %140, label %141, label %151

141:                                              ; preds = %131
  %142 = load ptr, ptr %16, align 8, !tbaa !5
  %143 = load i32, ptr %142, align 4, !tbaa !9
  switch i32 %143, label %147 [
    i32 -2, label %144
  ]

144:                                              ; preds = %141
  %145 = load ptr, ptr @stderr, align 8, !tbaa !5
  %146 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %145, ptr noundef @.str.3) #6
  br label %150

147:                                              ; preds = %141
  %148 = load ptr, ptr @stderr, align 8, !tbaa !5
  %149 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %148, ptr noundef @.str.4) #6
  br label %150

150:                                              ; preds = %147, %144
  call void @exit(i32 noundef 2) #7
  unreachable

151:                                              ; preds = %131
  br label %152

152:                                              ; preds = %151, %128
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %153 = load ptr, ptr %15, align 8, !tbaa !5
  %154 = load i32, ptr %153, align 4, !tbaa !9
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %153, align 4, !tbaa !9
  %156 = sext i32 %154 to i64
  %157 = getelementptr inbounds [256 x i32], ptr @segmentedBlock, i64 0, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !9
  store i32 %158, ptr %23, align 4, !tbaa !9
  %159 = load i32, ptr %19, align 4, !tbaa !9
  %160 = load i32, ptr %23, align 4, !tbaa !9
  %161 = icmp ne i32 %159, %160
  br i1 %161, label %162, label %175

162:                                              ; preds = %152
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %163 = load ptr, ptr %10, align 8, !tbaa !5
  %164 = call i64 @ftello64(ptr noundef %163)
  %165 = load i32, ptr %19, align 4, !tbaa !9
  %166 = sext i32 %165 to i64
  %167 = sub nsw i64 %164, %166
  %168 = load i32, ptr %23, align 4, !tbaa !9
  %169 = sext i32 %168 to i64
  %170 = add nsw i64 %167, %169
  store i64 %170, ptr %24, align 8, !tbaa !11
  %171 = load ptr, ptr %10, align 8, !tbaa !5
  %172 = load i64, ptr %24, align 8, !tbaa !11
  %173 = call i32 @fseeko64(ptr noundef %171, i64 noundef %172, i32 noundef 0)
  %174 = load i32, ptr %23, align 4, !tbaa !9
  store i32 %174, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  br label %175

175:                                              ; preds = %162, %152
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #6
  br label %176

176:                                              ; preds = %175, %102
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %177

177:                                              ; preds = %176, %48, %44
  %178 = load i32, ptr %19, align 4, !tbaa !9
  %179 = icmp eq i32 %178, 0
  br i1 %179, label %180, label %181

180:                                              ; preds = %177
  store i32 3, ptr %25, align 4
  br label %365

181:                                              ; preds = %177
  call void @llvm.lifetime.start.p0(i64 1, ptr %26) #6
  store i8 1, ptr %26, align 1, !tbaa !19
  %182 = load i32, ptr @paramEnableReordering, align 4, !tbaa !9
  %183 = icmp ne i32 %182, 0
  br i1 %183, label %184, label %227

184:                                              ; preds = %181
  %185 = load ptr, ptr %17, align 8, !tbaa !5
  %186 = load i32, ptr %19, align 4, !tbaa !9
  %187 = call noundef i32 @_Z13paramFeaturesv()
  %188 = call i32 @bsc_detect_recordsize(ptr noundef %185, i32 noundef %186, i32 noundef %187)
  %189 = trunc i32 %188 to i8
  store i8 %189, ptr %26, align 1, !tbaa !19
  %190 = load i8, ptr %26, align 1, !tbaa !19
  %191 = sext i8 %190 to i32
  %192 = icmp slt i32 %191, 0
  br i1 %192, label %193, label %203

193:                                              ; preds = %184
  %194 = load i8, ptr %26, align 1, !tbaa !19
  %195 = sext i8 %194 to i32
  switch i32 %195, label %199 [
    i32 -2, label %196
  ]

196:                                              ; preds = %193
  %197 = load ptr, ptr @stderr, align 8, !tbaa !5
  %198 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %197, ptr noundef @.str.3) #6
  br label %202

199:                                              ; preds = %193
  %200 = load ptr, ptr @stderr, align 8, !tbaa !5
  %201 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %200, ptr noundef @.str.4) #6
  br label %202

202:                                              ; preds = %199, %196
  call void @exit(i32 noundef 2) #7
  unreachable

203:                                              ; preds = %184
  %204 = load i8, ptr %26, align 1, !tbaa !19
  %205 = sext i8 %204 to i32
  %206 = icmp sgt i32 %205, 1
  br i1 %206, label %207, label %226

207:                                              ; preds = %203
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  %208 = load ptr, ptr %17, align 8, !tbaa !5
  %209 = load i32, ptr %19, align 4, !tbaa !9
  %210 = load i8, ptr %26, align 1, !tbaa !19
  %211 = sext i8 %210 to i32
  %212 = call noundef i32 @_Z13paramFeaturesv()
  %213 = call i32 @bsc_reorder_forward(ptr noundef %208, i32 noundef %209, i32 noundef %211, i32 noundef %212)
  store i32 %213, ptr %27, align 4, !tbaa !9
  %214 = load i32, ptr %27, align 4, !tbaa !9
  %215 = icmp ne i32 %214, 0
  br i1 %215, label %216, label %225

216:                                              ; preds = %207
  %217 = load i32, ptr %27, align 4, !tbaa !9
  switch i32 %217, label %221 [
    i32 -2, label %218
  ]

218:                                              ; preds = %216
  %219 = load ptr, ptr @stderr, align 8, !tbaa !5
  %220 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %219, ptr noundef @.str.3) #6
  br label %224

221:                                              ; preds = %216
  %222 = load ptr, ptr @stderr, align 8, !tbaa !5
  %223 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %222, ptr noundef @.str.4) #6
  br label %224

224:                                              ; preds = %221, %218
  call void @exit(i32 noundef 2) #7
  unreachable

225:                                              ; preds = %207
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  br label %226

226:                                              ; preds = %225, %203
  br label %227

227:                                              ; preds = %226, %181
  call void @llvm.lifetime.start.p0(i64 1, ptr %28) #6
  %228 = load i32, ptr @paramSortingContexts, align 4, !tbaa !9
  %229 = trunc i32 %228 to i8
  store i8 %229, ptr %28, align 1, !tbaa !19
  %230 = load i32, ptr @paramSortingContexts, align 4, !tbaa !9
  %231 = icmp eq i32 %230, 3
  br i1 %231, label %232, label %252

232:                                              ; preds = %227
  %233 = load ptr, ptr %17, align 8, !tbaa !5
  %234 = load i32, ptr %19, align 4, !tbaa !9
  %235 = call noundef i32 @_Z13paramFeaturesv()
  %236 = call i32 @bsc_detect_contextsorder(ptr noundef %233, i32 noundef %234, i32 noundef %235)
  %237 = trunc i32 %236 to i8
  store i8 %237, ptr %28, align 1, !tbaa !19
  %238 = load i8, ptr %28, align 1, !tbaa !19
  %239 = sext i8 %238 to i32
  %240 = icmp slt i32 %239, 0
  br i1 %240, label %241, label %251

241:                                              ; preds = %232
  %242 = load i8, ptr %28, align 1, !tbaa !19
  %243 = sext i8 %242 to i32
  switch i32 %243, label %247 [
    i32 -2, label %244
  ]

244:                                              ; preds = %241
  %245 = load ptr, ptr @stderr, align 8, !tbaa !5
  %246 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %245, ptr noundef @.str.5) #6
  br label %250

247:                                              ; preds = %241
  %248 = load ptr, ptr @stderr, align 8, !tbaa !5
  %249 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %248, ptr noundef @.str.4) #6
  br label %250

250:                                              ; preds = %247, %244
  call void @exit(i32 noundef 2) #7
  unreachable

251:                                              ; preds = %232
  br label %252

252:                                              ; preds = %251, %227
  %253 = load i8, ptr %28, align 1, !tbaa !19
  %254 = sext i8 %253 to i32
  %255 = icmp eq i32 %254, 2
  br i1 %255, label %256, label %267

256:                                              ; preds = %252
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #6
  %257 = load ptr, ptr %17, align 8, !tbaa !5
  %258 = load i32, ptr %19, align 4, !tbaa !9
  %259 = call noundef i32 @_Z13paramFeaturesv()
  %260 = call i32 @bsc_reverse_block(ptr noundef %257, i32 noundef %258, i32 noundef %259)
  store i32 %260, ptr %29, align 4, !tbaa !9
  %261 = load i32, ptr %29, align 4, !tbaa !9
  %262 = icmp ne i32 %261, 0
  br i1 %262, label %263, label %266

263:                                              ; preds = %256
  %264 = load ptr, ptr @stderr, align 8, !tbaa !5
  %265 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %264, ptr noundef @.str.4) #6
  call void @exit(i32 noundef 2) #7
  unreachable

266:                                              ; preds = %256
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #6
  br label %267

267:                                              ; preds = %266, %252
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #6
  %268 = load ptr, ptr %17, align 8, !tbaa !5
  %269 = load ptr, ptr %17, align 8, !tbaa !5
  %270 = load i32, ptr %19, align 4, !tbaa !9
  %271 = load i32, ptr @paramLZPHashSize, align 4, !tbaa !9
  %272 = load i32, ptr @paramLZPMinLen, align 4, !tbaa !9
  %273 = load i32, ptr @paramBlockSorter, align 4, !tbaa !9
  %274 = load i32, ptr @paramCoder, align 4, !tbaa !9
  %275 = call noundef i32 @_Z13paramFeaturesv()
  %276 = call i32 @bsc_compress(ptr noundef %268, ptr noundef %269, i32 noundef %270, i32 noundef %271, i32 noundef %272, i32 noundef %273, i32 noundef %274, i32 noundef %275)
  store i32 %276, ptr %30, align 4, !tbaa !9
  %277 = load i32, ptr %30, align 4, !tbaa !9
  %278 = icmp eq i32 %277, -3
  br i1 %278, label %279, label %305

279:                                              ; preds = %267
  store i8 1, ptr %28, align 1, !tbaa !19
  store i8 1, ptr %26, align 1, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #6
  %280 = load ptr, ptr %10, align 8, !tbaa !5
  %281 = call i64 @ftello64(ptr noundef %280)
  store i64 %281, ptr %31, align 8, !tbaa !11
  %282 = load ptr, ptr %10, align 8, !tbaa !5
  %283 = load i64, ptr %18, align 8, !tbaa !11
  %284 = call i32 @fseeko64(ptr noundef %282, i64 noundef %283, i32 noundef 0)
  %285 = load i32, ptr %19, align 4, !tbaa !9
  %286 = load ptr, ptr %17, align 8, !tbaa !5
  %287 = load i32, ptr %19, align 4, !tbaa !9
  %288 = sext i32 %287 to i64
  %289 = load ptr, ptr %10, align 8, !tbaa !5
  %290 = call i64 @fread(ptr noundef %286, i64 noundef 1, i64 noundef %288, ptr noundef %289)
  %291 = trunc i64 %290 to i32
  %292 = icmp ne i32 %285, %291
  br i1 %292, label %293, label %296

293:                                              ; preds = %279
  %294 = load ptr, ptr @stderr, align 8, !tbaa !5
  %295 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %294, ptr noundef @.str.4) #6
  call void @exit(i32 noundef 2) #7
  unreachable

296:                                              ; preds = %279
  %297 = load ptr, ptr %10, align 8, !tbaa !5
  %298 = load i64, ptr %31, align 8, !tbaa !11
  %299 = call i32 @fseeko64(ptr noundef %297, i64 noundef %298, i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #6
  %300 = load ptr, ptr %17, align 8, !tbaa !5
  %301 = load ptr, ptr %17, align 8, !tbaa !5
  %302 = load i32, ptr %19, align 4, !tbaa !9
  %303 = call noundef i32 @_Z13paramFeaturesv()
  %304 = call i32 @bsc_store(ptr noundef %300, ptr noundef %301, i32 noundef %302, i32 noundef %303)
  store i32 %304, ptr %30, align 4, !tbaa !9
  br label %305

305:                                              ; preds = %296, %267
  %306 = load i32, ptr %30, align 4, !tbaa !9
  %307 = icmp slt i32 %306, 0
  br i1 %307, label %308, label %329

308:                                              ; preds = %305
  %309 = load i32, ptr %30, align 4, !tbaa !9
  switch i32 %309, label %325 [
    i32 -2, label %310
    i32 -4, label %313
    i32 -7, label %316
    i32 -8, label %319
    i32 -9, label %322
  ]

310:                                              ; preds = %308
  %311 = load ptr, ptr @stderr, align 8, !tbaa !5
  %312 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %311, ptr noundef @.str.3) #6
  br label %328

313:                                              ; preds = %308
  %314 = load ptr, ptr @stderr, align 8, !tbaa !5
  %315 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %314, ptr noundef @.str.6) #6
  br label %328

316:                                              ; preds = %308
  %317 = load ptr, ptr @stderr, align 8, !tbaa !5
  %318 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %317, ptr noundef @.str.7) #6
  br label %328

319:                                              ; preds = %308
  %320 = load ptr, ptr @stderr, align 8, !tbaa !5
  %321 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %320, ptr noundef @.str.8) #6
  br label %328

322:                                              ; preds = %308
  %323 = load ptr, ptr @stderr, align 8, !tbaa !5
  %324 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %323, ptr noundef @.str.9) #6
  br label %328

325:                                              ; preds = %308
  %326 = load ptr, ptr @stderr, align 8, !tbaa !5
  %327 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %326, ptr noundef @.str.4) #6
  br label %328

328:                                              ; preds = %325, %322, %319, %316, %313, %310
  call void @exit(i32 noundef 2) #7
  unreachable

329:                                              ; preds = %305
  call void @llvm.lifetime.start.p0(i64 10, ptr %32) #6
  %330 = getelementptr inbounds %struct.BSC_BLOCK_HEADER, ptr %32, i32 0, i32 0
  %331 = load i64, ptr %18, align 8, !tbaa !11
  store i64 %331, ptr %330, align 1, !tbaa !20
  %332 = getelementptr inbounds %struct.BSC_BLOCK_HEADER, ptr %32, i32 0, i32 1
  %333 = load i8, ptr %26, align 1, !tbaa !19
  store i8 %333, ptr %332, align 1, !tbaa !23
  %334 = getelementptr inbounds %struct.BSC_BLOCK_HEADER, ptr %32, i32 0, i32 2
  %335 = load i8, ptr %28, align 1, !tbaa !19
  store i8 %335, ptr %334, align 1, !tbaa !24
  %336 = load ptr, ptr %13, align 8, !tbaa !5
  %337 = call i64 @fwrite(ptr noundef %32, i64 noundef 10, i64 noundef 1, ptr noundef %336)
  %338 = icmp ne i64 %337, 1
  br i1 %338, label %339, label %343

339:                                              ; preds = %329
  %340 = load ptr, ptr @stderr, align 8, !tbaa !5
  %341 = load ptr, ptr %12, align 8, !tbaa !5
  %342 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %340, ptr noundef @.str.2, ptr noundef %341) #6
  call void @exit(i32 noundef 1) #7
  unreachable

343:                                              ; preds = %329
  %344 = load ptr, ptr %14, align 8, !tbaa !5
  %345 = load i64, ptr %344, align 8, !tbaa !11
  %346 = add nsw i64 %345, 10
  store i64 %346, ptr %344, align 8, !tbaa !11
  %347 = load ptr, ptr %17, align 8, !tbaa !5
  %348 = load i32, ptr %30, align 4, !tbaa !9
  %349 = sext i32 %348 to i64
  %350 = load ptr, ptr %13, align 8, !tbaa !5
  %351 = call i64 @fwrite(ptr noundef %347, i64 noundef 1, i64 noundef %349, ptr noundef %350)
  %352 = trunc i64 %351 to i32
  %353 = load i32, ptr %30, align 4, !tbaa !9
  %354 = icmp ne i32 %352, %353
  br i1 %354, label %355, label %359

355:                                              ; preds = %343
  %356 = load ptr, ptr @stderr, align 8, !tbaa !5
  %357 = load ptr, ptr %12, align 8, !tbaa !5
  %358 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %356, ptr noundef @.str.2, ptr noundef %357) #6
  call void @exit(i32 noundef 1) #7
  unreachable

359:                                              ; preds = %343
  %360 = load i32, ptr %30, align 4, !tbaa !9
  %361 = sext i32 %360 to i64
  %362 = load ptr, ptr %14, align 8, !tbaa !5
  %363 = load i64, ptr %362, align 8, !tbaa !11
  %364 = add nsw i64 %363, %361
  store i64 %364, ptr %362, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 10, ptr %32) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #6
  store i32 0, ptr %25, align 4
  br label %365

365:                                              ; preds = %359, %180
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  %366 = load i32, ptr %25, align 4
  switch i32 %366, label %370 [
    i32 0, label %367
    i32 3, label %368
  ]

367:                                              ; preds = %365
  br label %43, !llvm.loop !25

368:                                              ; preds = %365
  %369 = load ptr, ptr %17, align 8, !tbaa !5
  call void @bsc_free(ptr noundef %369)
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  ret void

370:                                              ; preds = %365
  unreachable
}

declare ptr @bsc_malloc(i64 noundef) #3

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #5

; Function Attrs: nounwind
declare i32 @feof(ptr noundef) #4

declare i64 @ftello64(ptr noundef) #3

declare i32 @fflush(ptr noundef) #3

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

declare i32 @bsc_detect_segments(ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef) #3

declare i32 @fseeko64(ptr noundef, i64 noundef, i32 noundef) #3

declare i32 @bsc_detect_recordsize(ptr noundef, i32 noundef, i32 noundef) #3

declare i32 @bsc_reorder_forward(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #3

declare i32 @bsc_detect_contextsorder(ptr noundef, i32 noundef, i32 noundef) #3

declare i32 @bsc_reverse_block(ptr noundef, i32 noundef, i32 noundef) #3

declare i32 @bsc_compress(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #3

declare i32 @bsc_store(ptr noundef, ptr noundef, i32 noundef, i32 noundef) #3

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

declare void @bsc_free(ptr noundef) #3

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind "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 = { noreturn 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 }
attributes #7 = { noreturn 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 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!7, !7, i64 0}
!20 = !{!21, !22, i64 0}
!21 = !{!"_ZTS16BSC_BLOCK_HEADER", !22, i64 0, !7, i64 8, !7, i64 9}
!22 = !{!"long long", !7, i64 0}
!23 = !{!21, !7, i64 8}
!24 = !{!21, !7, i64 9}
!25 = distinct !{!25, !26}
!26 = !{!"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"

%struct.BSC_BLOCK_HEADER = type <{ i64, i8, i8 }>

@paramBlockSize = external dso_local local_unnamed_addr global i32, align 4
@paramBlockSorter = external dso_local local_unnamed_addr global i32, align 4
@paramCoder = external dso_local local_unnamed_addr global i32, align 4
@paramSortingContexts = external dso_local local_unnamed_addr global i32, align 4
@paramEnableSegmentation = external dso_local local_unnamed_addr global i32, align 4
@paramEnableReordering = external dso_local local_unnamed_addr global i32, align 4
@paramLZPHashSize = external dso_local local_unnamed_addr global i32, align 4
@paramLZPMinLen = external dso_local local_unnamed_addr global i32, align 4
@segmentedBlock = external dso_local global [256 x i32], align 16
@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [67 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [72 x i8], align 1
@switch.table._Z15compression_ompPcP8_IO_FILERlS_S1_S2_RiS3_ = private unnamed_addr constant [8 x ptr] [ptr @.str.9, ptr @.str.8, ptr @.str.7, ptr @.str.4, ptr @.str.4, ptr @.str.6, ptr @.str.4, ptr @.str.3], align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z13paramFeaturesv() local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z15compression_ompPcP8_IO_FILERlS_S1_S2_RiS3_(ptr noundef %0, ptr nocapture noundef %1, ptr nocapture noundef nonnull readonly align 8 dereferenceable(8) %2, ptr noundef %3, ptr nocapture noundef %4, ptr nocapture noundef nonnull align 8 dereferenceable(8) %5, ptr nocapture noundef nonnull align 4 dereferenceable(4) %6, ptr nocapture noundef nonnull align 4 dereferenceable(4) %7) local_unnamed_addr #2 {
  %9 = alloca %struct.BSC_BLOCK_HEADER, align 8
  %10 = load i32, ptr @paramBlockSize, align 4, !tbaa !5
  %11 = add nsw i32 %10, 28
  %12 = sext i32 %11 to i64
  %13 = tail call ptr @bsc_malloc(i64 noundef %12)
  %14 = icmp eq ptr %13, null
  br i1 %14, label %19, label %.preheader

.preheader:                                       ; preds = %8
  %15 = tail call i32 @feof(ptr noundef %1) #6
  %16 = icmp eq i32 %15, 0
  br i1 %16, label %.lr.ph, label %.thread

.lr.ph:                                           ; preds = %.preheader
  %17 = getelementptr inbounds i8, ptr %9, i64 8
  %18 = getelementptr inbounds i8, ptr %9, i64 9
  br label %22

19:                                               ; preds = %8
  %20 = load ptr, ptr @stderr, align 8, !tbaa !9
  %21 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %20, ptr noundef nonnull @.str) #7
  tail call void @exit(i32 noundef 2) #8
  unreachable

22:                                               ; preds = %.lr.ph, %169
  %23 = tail call i64 @ftello64(ptr noundef %1)
  %24 = load i64, ptr %2, align 8, !tbaa !11
  %.not = icmp eq i64 %23, %24
  br i1 %.not, label %.thread, label %25

25:                                               ; preds = %22
  %26 = tail call i64 @ftello64(ptr noundef %1)
  %27 = sitofp i64 %26 to double
  %28 = fmul double %27, 1.000000e+02
  %29 = load i64, ptr %2, align 8, !tbaa !11
  %30 = sitofp i64 %29 to double
  %31 = fdiv double %28, %30
  %32 = load ptr, ptr @stdout, align 8, !tbaa !9
  %33 = fptosi double %31 to i32
  %34 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef nonnull @.str.1, ptr noundef %0, i32 noundef %33) #6
  %35 = load ptr, ptr @stdout, align 8, !tbaa !9
  %36 = tail call i32 @fflush(ptr noundef %35)
  %37 = tail call i64 @ftello64(ptr noundef %1)
  %38 = load i32, ptr @paramBlockSize, align 4, !tbaa !5
  %39 = load i32, ptr @paramEnableSegmentation, align 4, !tbaa !5
  %.not110 = icmp eq i32 %39, 0
  br i1 %.not110, label %49, label %40

40:                                               ; preds = %25
  %41 = load i32, ptr %7, align 4, !tbaa !5
  %42 = load i32, ptr %6, align 4, !tbaa !5
  %43 = sub nsw i32 %41, %42
  %44 = icmp sgt i32 %43, 1
  br i1 %44, label %45, label %49

45:                                               ; preds = %40
  %46 = sext i32 %42 to i64
  %47 = getelementptr inbounds [256 x i32], ptr @segmentedBlock, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %40, %45, %25
  %.097 = phi i32 [ %48, %45 ], [ %38, %40 ], [ %38, %25 ]
  %50 = sext i32 %.097 to i64
  %51 = tail call i64 @fread(ptr noundef nonnull %13, i64 noundef 1, i64 noundef %50, ptr noundef %1)
  %52 = trunc i64 %51 to i32
  %53 = icmp slt i32 %52, 1
  br i1 %53, label %54, label %57

54:                                               ; preds = %49
  %55 = load ptr, ptr @stderr, align 8, !tbaa !9
  %56 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.2, ptr noundef %0) #7
  tail call void @exit(i32 noundef 1) #8
  unreachable

57:                                               ; preds = %49
  %58 = load i32, ptr @paramEnableSegmentation, align 4, !tbaa !5
  %.not111 = icmp eq i32 %58, 0
  br i1 %.not111, label %.thread125, label %59

59:                                               ; preds = %57
  %60 = load i32, ptr %6, align 4, !tbaa !5
  %61 = load i32, ptr %7, align 4, !tbaa !5
  %62 = icmp eq i32 %60, %61
  %63 = sub nsw i32 %61, %60
  %64 = icmp eq i32 %63, 1
  br i1 %64, label %65, label %69

65:                                               ; preds = %59
  %66 = sext i32 %60 to i64
  %67 = getelementptr inbounds [256 x i32], ptr @segmentedBlock, i64 0, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %.not112 = icmp ne i32 %68, %52
  %spec.select = or i1 %62, %.not112
  br i1 %spec.select, label %70, label %77

69:                                               ; preds = %59
  br i1 %62, label %70, label %77

70:                                               ; preds = %65, %69
  store i32 0, ptr %6, align 4, !tbaa !5
  %71 = tail call noundef i32 @_Z13paramFeaturesv()
  %72 = tail call i32 @bsc_detect_segments(ptr noundef nonnull %13, i32 noundef %52, ptr noundef nonnull @segmentedBlock, i32 noundef 256, i32 noundef %71)
  store i32 %72, ptr %7, align 4, !tbaa !5
  %73 = icmp slt i32 %72, 1
  br i1 %73, label %74, label %._crit_edge

._crit_edge:                                      ; preds = %70
  %.pre = load i32, ptr %6, align 4, !tbaa !5
  br label %77

74:                                               ; preds = %70
  %cond3 = icmp eq i32 %72, -2
  %75 = load ptr, ptr @stderr, align 8, !tbaa !9
  %.str.3..str.4 = select i1 %cond3, ptr @.str.3, ptr @.str.4
  %76 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %75, ptr noundef nonnull %.str.3..str.4) #7
  tail call void @exit(i32 noundef 2) #8
  unreachable

77:                                               ; preds = %._crit_edge, %65, %69
  %78 = phi i32 [ %.pre, %._crit_edge ], [ %60, %65 ], [ %60, %69 ]
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %6, align 4, !tbaa !5
  %80 = sext i32 %78 to i64
  %81 = getelementptr inbounds [256 x i32], ptr @segmentedBlock, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %.not113 = icmp eq i32 %82, %52
  br i1 %.not113, label %.thread125, label %83

83:                                               ; preds = %77
  %84 = tail call i64 @ftello64(ptr noundef %1)
  %85 = and i64 %51, 2147483647
  %86 = sext i32 %82 to i64
  %87 = sub nsw i64 %86, %85
  %88 = add i64 %87, %84
  %89 = tail call i32 @fseeko64(ptr noundef %1, i64 noundef %88, i32 noundef 0)
  %90 = icmp eq i32 %82, 0
  br i1 %90, label %.thread, label %.thread125

.thread125:                                       ; preds = %77, %57, %83
  %.2128 = phi i32 [ %82, %83 ], [ %52, %57 ], [ %52, %77 ]
  %91 = load i32, ptr @paramEnableReordering, align 4, !tbaa !5
  %.not114 = icmp eq i32 %91, 0
  br i1 %.not114, label %108, label %92

92:                                               ; preds = %.thread125
  %93 = tail call noundef i32 @_Z13paramFeaturesv()
  %94 = tail call i32 @bsc_detect_recordsize(ptr noundef nonnull %13, i32 noundef %.2128, i32 noundef %93)
  %95 = trunc i32 %94 to i8
  %sext = shl i32 %94, 24
  %96 = ashr exact i32 %sext, 24
  %97 = icmp slt i32 %96, 0
  br i1 %97, label %98, label %101

98:                                               ; preds = %92
  %cond2 = icmp eq i32 %sext, -33554432
  %99 = load ptr, ptr @stderr, align 8, !tbaa !9
  %.str.3..str.4152 = select i1 %cond2, ptr @.str.3, ptr @.str.4
  %100 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %99, ptr noundef nonnull %.str.3..str.4152) #7
  tail call void @exit(i32 noundef 2) #8
  unreachable

101:                                              ; preds = %92
  %102 = icmp ugt i32 %96, 1
  br i1 %102, label %103, label %108

103:                                              ; preds = %101
  %104 = tail call noundef i32 @_Z13paramFeaturesv()
  %105 = tail call i32 @bsc_reorder_forward(ptr noundef nonnull %13, i32 noundef %.2128, i32 noundef %96, i32 noundef %104)
  switch i32 %105, label %.loopexit157 [
    i32 0, label %108
    i32 -2, label %.loopexit
  ]

.loopexit157:                                     ; preds = %103
  br label %.loopexit

.loopexit:                                        ; preds = %103, %.loopexit157
  %.str.4.sink149 = phi ptr [ @.str.4, %.loopexit157 ], [ @.str.3, %103 ]
  %106 = load ptr, ptr @stderr, align 8, !tbaa !9
  %107 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %106, ptr noundef nonnull %.str.4.sink149) #7
  tail call void @exit(i32 noundef 2) #8
  unreachable

108:                                              ; preds = %103, %101, %.thread125
  %.098 = phi i8 [ %95, %101 ], [ 1, %.thread125 ], [ %95, %103 ]
  %109 = load i32, ptr @paramSortingContexts, align 4, !tbaa !5
  %110 = icmp eq i32 %109, 3
  br i1 %110, label %111, label %118

111:                                              ; preds = %108
  %112 = tail call noundef i32 @_Z13paramFeaturesv()
  %113 = tail call i32 @bsc_detect_contextsorder(ptr noundef nonnull %13, i32 noundef %.2128, i32 noundef %112)
  %sext116 = shl i32 %113, 24
  %114 = icmp slt i32 %sext116, 0
  br i1 %114, label %115, label %118

115:                                              ; preds = %111
  %cond = icmp eq i32 %sext116, -33554432
  %116 = load ptr, ptr @stderr, align 8, !tbaa !9
  %.str.5..str.4 = select i1 %cond, ptr @.str.5, ptr @.str.4
  %117 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %116, ptr noundef nonnull %.str.5..str.4) #7
  tail call void @exit(i32 noundef 2) #8
  unreachable

118:                                              ; preds = %111, %108
  %.095.in = phi i32 [ %113, %111 ], [ %109, %108 ]
  %.095 = trunc i32 %.095.in to i8
  %sext117.mask = and i32 %.095.in, 255
  %119 = icmp eq i32 %sext117.mask, 2
  br i1 %119, label %120, label %126

120:                                              ; preds = %118
  %121 = tail call noundef i32 @_Z13paramFeaturesv()
  %122 = tail call i32 @bsc_reverse_block(ptr noundef nonnull %13, i32 noundef %.2128, i32 noundef %121)
  %.not118 = icmp eq i32 %122, 0
  br i1 %.not118, label %126, label %123

123:                                              ; preds = %120
  %124 = load ptr, ptr @stderr, align 8, !tbaa !9
  %125 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %124, ptr noundef nonnull @.str.4) #7
  tail call void @exit(i32 noundef 2) #8
  unreachable

126:                                              ; preds = %120, %118
  %127 = load i32, ptr @paramLZPHashSize, align 4, !tbaa !5
  %128 = load i32, ptr @paramLZPMinLen, align 4, !tbaa !5
  %129 = load i32, ptr @paramBlockSorter, align 4, !tbaa !5
  %130 = load i32, ptr @paramCoder, align 4, !tbaa !5
  %131 = tail call noundef i32 @_Z13paramFeaturesv()
  %132 = tail call i32 @bsc_compress(ptr noundef nonnull %13, ptr noundef nonnull %13, i32 noundef %.2128, i32 noundef %127, i32 noundef %128, i32 noundef %129, i32 noundef %130, i32 noundef %131)
  %133 = icmp eq i32 %132, -3
  br i1 %133, label %134, label %147

134:                                              ; preds = %126
  %135 = tail call i64 @ftello64(ptr noundef %1)
  %136 = tail call i32 @fseeko64(ptr noundef %1, i64 noundef %37, i32 noundef 0)
  %137 = sext i32 %.2128 to i64
  %138 = tail call i64 @fread(ptr noundef nonnull %13, i64 noundef 1, i64 noundef %137, ptr noundef %1)
  %139 = trunc i64 %138 to i32
  %.not119 = icmp eq i32 %.2128, %139
  br i1 %.not119, label %143, label %140

140:                                              ; preds = %134
  %141 = load ptr, ptr @stderr, align 8, !tbaa !9
  %142 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %141, ptr noundef nonnull @.str.4) #7
  tail call void @exit(i32 noundef 2) #8
  unreachable

143:                                              ; preds = %134
  %144 = tail call i32 @fseeko64(ptr noundef %1, i64 noundef %135, i32 noundef 0)
  %145 = tail call noundef i32 @_Z13paramFeaturesv()
  %146 = tail call i32 @bsc_store(ptr noundef nonnull %13, ptr noundef nonnull %13, i32 noundef %.2128, i32 noundef %145)
  br label %147

147:                                              ; preds = %143, %126
  %.199 = phi i8 [ 1, %143 ], [ %.098, %126 ]
  %.196 = phi i8 [ 1, %143 ], [ %.095, %126 ]
  %.093 = phi i32 [ %146, %143 ], [ %132, %126 ]
  %148 = icmp slt i32 %.093, 0
  br i1 %148, label %149, label %155

149:                                              ; preds = %147
  %150 = load ptr, ptr @stderr, align 8, !tbaa !9
  %switch.tableidx = add nsw i32 %.093, 9
  %151 = icmp ult i32 %switch.tableidx, 8
  br i1 %151, label %switch.lookup, label %153

switch.lookup:                                    ; preds = %149
  %152 = zext nneg i32 %switch.tableidx to i64
  %switch.gep = getelementptr inbounds [8 x ptr], ptr @switch.table._Z15compression_ompPcP8_IO_FILERlS_S1_S2_RiS3_, i64 0, i64 %152
  %switch.load = load ptr, ptr %switch.gep, align 8
  br label %153

153:                                              ; preds = %149, %switch.lookup
  %.str.4.sink151 = phi ptr [ %switch.load, %switch.lookup ], [ @.str.4, %149 ]
  %154 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %150, ptr noundef nonnull %.str.4.sink151) #7
  tail call void @exit(i32 noundef 2) #8
  unreachable

155:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %9) #6
  store i64 %37, ptr %9, align 8, !tbaa !13
  store i8 %.199, ptr %17, align 8, !tbaa !16
  store i8 %.196, ptr %18, align 1, !tbaa !17
  %156 = call i64 @fwrite(ptr noundef nonnull %9, i64 noundef 10, i64 noundef 1, ptr noundef %4)
  %.not120 = icmp eq i64 %156, 1
  br i1 %.not120, label %160, label %157

157:                                              ; preds = %155
  %158 = load ptr, ptr @stderr, align 8, !tbaa !9
  %159 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %158, ptr noundef nonnull @.str.2, ptr noundef %3) #7
  tail call void @exit(i32 noundef 1) #8
  unreachable

160:                                              ; preds = %155
  %161 = load i64, ptr %5, align 8, !tbaa !11
  %162 = add nsw i64 %161, 10
  store i64 %162, ptr %5, align 8, !tbaa !11
  %163 = zext nneg i32 %.093 to i64
  %164 = tail call i64 @fwrite(ptr noundef nonnull %13, i64 noundef 1, i64 noundef %163, ptr noundef %4)
  %165 = trunc i64 %164 to i32
  %.not121 = icmp eq i32 %.093, %165
  br i1 %.not121, label %169, label %166

166:                                              ; preds = %160
  %167 = load ptr, ptr @stderr, align 8, !tbaa !9
  %168 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %167, ptr noundef nonnull @.str.2, ptr noundef %3) #7
  tail call void @exit(i32 noundef 1) #8
  unreachable

169:                                              ; preds = %160
  %170 = load i64, ptr %5, align 8, !tbaa !11
  %171 = add nsw i64 %170, %163
  store i64 %171, ptr %5, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %9) #6
  %172 = tail call i32 @feof(ptr noundef %1) #6
  %173 = icmp eq i32 %172, 0
  br i1 %173, label %22, label %.thread

.thread:                                          ; preds = %83, %22, %169, %.preheader
  tail call void @bsc_free(ptr noundef nonnull %13)
  ret void
}

declare ptr @bsc_malloc(i64 noundef) local_unnamed_addr #3

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #5

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

; Function Attrs: nofree nounwind
declare noundef i64 @ftello64(ptr nocapture noundef) local_unnamed_addr #4

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

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

declare i32 @bsc_detect_segments(ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

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

declare i32 @bsc_detect_recordsize(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

declare i32 @bsc_reorder_forward(ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

declare i32 @bsc_detect_contextsorder(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

declare i32 @bsc_reverse_block(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

declare i32 @bsc_compress(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

declare i32 @bsc_store(ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

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

declare void @bsc_free(ptr noundef) local_unnamed_addr #3

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 = { 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 #5 = { noreturn 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 }
attributes #7 = { cold nounwind }
attributes #8 = { noreturn 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"_ZTS16BSC_BLOCK_HEADER", !15, i64 0, !7, i64 8, !7, i64 9}
!15 = !{!"long long", !7, i64 0}
!16 = !{!14, !7, i64 8}
!17 = !{!14, !7, i64 9}


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