; LLVM IR from ebiggers/libdeflate :: programs (benchmark)

; 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.engine = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.compressor = type { i32, i32, ptr, ptr }
%struct.decompressor = type { i32, ptr, ptr }
%struct.file_stream = type { i32, ptr, i8, ptr, ptr, i64 }

@libdeflate_engine = external hidden constant %struct.engine, align 8
@.str = external hidden unnamed_addr constant [44 x i8], align 1
@toptarg = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [33 x i8], align 1
@stderr = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [35 x i8], align 1
@stdout = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [25 x i8], align 1
@libz_engine = external hidden constant %struct.engine, align 8
@toptind = external global i32, align 4
@.str.4 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 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 [24 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i8, align 1
  %12 = alloca %struct.compressor, align 8
  %13 = alloca %struct.decompressor, align 8
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca [1 x ptr], align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca %struct.file_stream, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1048576, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 6, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store ptr @libdeflate_engine, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store ptr @libdeflate_engine, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #5
  store i8 0, ptr %11, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #5
  call void @llvm.memset.p0.i64(ptr align 8 %12, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #5
  call void @llvm.memset.p0.i64(ptr align 8 %13, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store ptr null, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  store ptr null, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  store ptr null, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  call void @llvm.memset.p0.i64(ptr align 8 %18, i8 0, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  %24 = load ptr, ptr %5, align 8, !tbaa !9
  call void @begin_program(ptr noundef %24)
  br label %25

25:                                               ; preds = %78, %2
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = load ptr, ptr %5, align 8, !tbaa !9
  %28 = call i32 @tgetopt(i32 noundef %26, ptr noundef %27, ptr noundef @.str)
  store i32 %28, ptr %19, align 4, !tbaa !5
  %29 = icmp ne i32 %28, -1
  br i1 %29, label %30, label %79

30:                                               ; preds = %25
  %31 = load i32, ptr %19, align 4, !tbaa !5
  switch i32 %31, label %76 [
    i32 48, label %32
    i32 49, label %32
    i32 50, label %32
    i32 51, label %32
    i32 52, label %32
    i32 53, label %32
    i32 54, label %32
    i32 55, label %32
    i32 56, label %32
    i32 57, label %32
    i32 67, label %41
    i32 68, label %50
    i32 101, label %59
    i32 103, label %60
    i32 104, label %61
    i32 115, label %63
    i32 86, label %72
    i32 89, label %73
    i32 90, label %74
    i32 122, label %75
  ]

32:                                               ; preds = %30, %30, %30, %30, %30, %30, %30, %30, %30, %30
  %33 = load i32, ptr %19, align 4, !tbaa !5
  %34 = trunc i32 %33 to i8
  %35 = load ptr, ptr @toptarg, align 8, !tbaa !9
  %36 = call i32 @parse_compression_level(i8 noundef signext %34, ptr noundef %35)
  store i32 %36, ptr %7, align 4, !tbaa !5
  %37 = load i32, ptr %7, align 4, !tbaa !5
  %38 = icmp slt i32 %37, 0
  br i1 %38, label %39, label %40

39:                                               ; preds = %32
  store i32 1, ptr %3, align 4
  store i32 1, ptr %22, align 4
  br label %238

40:                                               ; preds = %32
  br label %78

41:                                               ; preds = %30
  %42 = load ptr, ptr @toptarg, align 8, !tbaa !9
  %43 = call ptr @name_to_engine(ptr noundef %42)
  store ptr %43, ptr %9, align 8, !tbaa !9
  %44 = load ptr, ptr %9, align 8, !tbaa !9
  %45 = icmp eq ptr %44, null
  br i1 %45, label %46, label %49

46:                                               ; preds = %41
  %47 = load ptr, ptr @toptarg, align 8, !tbaa !9
  call void (ptr, ...) @msg(ptr noundef @.str.1, ptr noundef %47)
  %48 = load ptr, ptr @stderr, align 8, !tbaa !9
  call void @show_available_engines(ptr noundef %48)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %22, align 4
  br label %238

49:                                               ; preds = %41
  br label %78

50:                                               ; preds = %30
  %51 = load ptr, ptr @toptarg, align 8, !tbaa !9
  %52 = call ptr @name_to_engine(ptr noundef %51)
  store ptr %52, ptr %10, align 8, !tbaa !9
  %53 = load ptr, ptr %10, align 8, !tbaa !9
  %54 = icmp eq ptr %53, null
  br i1 %54, label %55, label %58

55:                                               ; preds = %50
  %56 = load ptr, ptr @toptarg, align 8, !tbaa !9
  call void (ptr, ...) @msg(ptr noundef @.str.2, ptr noundef %56)
  %57 = load ptr, ptr @stderr, align 8, !tbaa !9
  call void @show_available_engines(ptr noundef %57)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %22, align 4
  br label %238

58:                                               ; preds = %50
  br label %78

59:                                               ; preds = %30
  store i8 1, ptr %11, align 1, !tbaa !11
  br label %78

60:                                               ; preds = %30
  store i32 2, ptr %8, align 4, !tbaa !5
  br label %78

61:                                               ; preds = %30
  %62 = load ptr, ptr @stdout, align 8, !tbaa !9
  call void @show_usage(ptr noundef %62)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %22, align 4
  br label %238

63:                                               ; preds = %30
  %64 = load ptr, ptr @toptarg, align 8, !tbaa !9
  %65 = call i64 @strtoul(ptr noundef %64, ptr noundef null, i32 noundef 10) #5
  %66 = trunc i64 %65 to i32
  store i32 %66, ptr %6, align 4, !tbaa !5
  %67 = load i32, ptr %6, align 4, !tbaa !5
  %68 = icmp eq i32 %67, 0
  br i1 %68, label %69, label %71

69:                                               ; preds = %63
  %70 = load ptr, ptr @toptarg, align 8, !tbaa !9
  call void (ptr, ...) @msg(ptr noundef @.str.3, ptr noundef %70)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %22, align 4
  br label %238

71:                                               ; preds = %63
  br label %78

72:                                               ; preds = %30
  call void @show_version()
  store i32 0, ptr %3, align 4
  store i32 1, ptr %22, align 4
  br label %238

73:                                               ; preds = %30
  store ptr @libz_engine, ptr %9, align 8, !tbaa !9
  br label %78

74:                                               ; preds = %30
  store ptr @libz_engine, ptr %10, align 8, !tbaa !9
  br label %78

75:                                               ; preds = %30
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %78

76:                                               ; preds = %30
  %77 = load ptr, ptr @stderr, align 8, !tbaa !9
  call void @show_usage(ptr noundef %77)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %22, align 4
  br label %238

78:                                               ; preds = %75, %74, %73, %71, %60, %59, %58, %49, %40
  br label %25, !llvm.loop !13

79:                                               ; preds = %25
  %80 = load i32, ptr @toptind, align 4, !tbaa !5
  %81 = load i32, ptr %4, align 4, !tbaa !5
  %82 = sub nsw i32 %81, %80
  store i32 %82, ptr %4, align 4, !tbaa !5
  %83 = load i32, ptr @toptind, align 4, !tbaa !5
  %84 = load ptr, ptr %5, align 8, !tbaa !9
  %85 = sext i32 %83 to i64
  %86 = getelementptr inbounds ptr, ptr %84, i64 %85
  store ptr %86, ptr %5, align 8, !tbaa !9
  %87 = load i32, ptr %7, align 4, !tbaa !5
  %88 = icmp eq i32 %87, 0
  br i1 %88, label %89, label %90

89:                                               ; preds = %79
  store i8 1, ptr %11, align 1, !tbaa !11
  br label %90

90:                                               ; preds = %89, %79
  store i32 -1, ptr %21, align 4, !tbaa !5
  %91 = load i32, ptr %7, align 4, !tbaa !5
  %92 = load i32, ptr %8, align 4, !tbaa !5
  %93 = load ptr, ptr %9, align 8, !tbaa !9
  %94 = call zeroext i1 @compressor_init(ptr noundef %12, i32 noundef %91, i32 noundef %92, ptr noundef %93)
  br i1 %94, label %96, label %95

95:                                               ; preds = %90
  br label %232

96:                                               ; preds = %90
  %97 = load i32, ptr %8, align 4, !tbaa !5
  %98 = load ptr, ptr %10, align 8, !tbaa !9
  %99 = call zeroext i1 @decompressor_init(ptr noundef %13, i32 noundef %97, ptr noundef %98)
  br i1 %99, label %101, label %100

100:                                              ; preds = %96
  br label %232

101:                                              ; preds = %96
  %102 = load i8, ptr %11, align 1, !tbaa !11, !range !15, !noundef !16
  %103 = trunc i8 %102 to i1
  br i1 %103, label %104, label %108

104:                                              ; preds = %101
  %105 = load i32, ptr %6, align 4, !tbaa !5
  %106 = zext i32 %105 to i64
  %107 = call i64 @compress_bound(ptr noundef %12, i64 noundef %106)
  store i64 %107, ptr %14, align 8, !tbaa !17
  br label %112

108:                                              ; preds = %101
  %109 = load i32, ptr %6, align 4, !tbaa !5
  %110 = sub i32 %109, 1
  %111 = zext i32 %110 to i64
  store i64 %111, ptr %14, align 8, !tbaa !17
  br label %112

112:                                              ; preds = %108, %104
  %113 = load i32, ptr %6, align 4, !tbaa !5
  %114 = zext i32 %113 to i64
  %115 = call ptr @xmalloc(i64 noundef %114)
  store ptr %115, ptr %15, align 8, !tbaa !9
  %116 = load i64, ptr %14, align 8, !tbaa !17
  %117 = call ptr @xmalloc(i64 noundef %116)
  store ptr %117, ptr %16, align 8, !tbaa !9
  %118 = load i32, ptr %6, align 4, !tbaa !5
  %119 = zext i32 %118 to i64
  %120 = call ptr @xmalloc(i64 noundef %119)
  store ptr %120, ptr %17, align 8, !tbaa !9
  store i32 -1, ptr %21, align 4, !tbaa !5
  %121 = load ptr, ptr %15, align 8, !tbaa !9
  %122 = icmp eq ptr %121, null
  br i1 %122, label %129, label %123

123:                                              ; preds = %112
  %124 = load ptr, ptr %16, align 8, !tbaa !9
  %125 = icmp eq ptr %124, null
  br i1 %125, label %129, label %126

126:                                              ; preds = %123
  %127 = load ptr, ptr %17, align 8, !tbaa !9
  %128 = icmp eq ptr %127, null
  br i1 %128, label %129, label %130

129:                                              ; preds = %126, %123, %112
  br label %232

130:                                              ; preds = %126
  %131 = load i32, ptr %4, align 4, !tbaa !5
  %132 = icmp eq i32 %131, 0
  br i1 %132, label %133, label %135

133:                                              ; preds = %130
  %134 = getelementptr inbounds [1 x ptr], ptr %18, i64 0, i64 0
  store ptr %134, ptr %5, align 8, !tbaa !9
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %170

135:                                              ; preds = %130
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %136

136:                                              ; preds = %166, %135
  %137 = load i32, ptr %20, align 4, !tbaa !5
  %138 = load i32, ptr %4, align 4, !tbaa !5
  %139 = icmp slt i32 %137, %138
  br i1 %139, label %140, label %169

140:                                              ; preds = %136
  %141 = load ptr, ptr %5, align 8, !tbaa !9
  %142 = load i32, ptr %20, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds ptr, ptr %141, i64 %143
  %145 = load ptr, ptr %144, align 8, !tbaa !9
  %146 = getelementptr inbounds i8, ptr %145, i64 0
  %147 = load i8, ptr %146, align 1, !tbaa !19
  %148 = sext i8 %147 to i32
  %149 = icmp eq i32 %148, 45
  br i1 %149, label %150, label %165

150:                                              ; preds = %140
  %151 = load ptr, ptr %5, align 8, !tbaa !9
  %152 = load i32, ptr %20, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds ptr, ptr %151, i64 %153
  %155 = load ptr, ptr %154, align 8, !tbaa !9
  %156 = getelementptr inbounds i8, ptr %155, i64 1
  %157 = load i8, ptr %156, align 1, !tbaa !19
  %158 = sext i8 %157 to i32
  %159 = icmp eq i32 %158, 0
  br i1 %159, label %160, label %165

160:                                              ; preds = %150
  %161 = load ptr, ptr %5, align 8, !tbaa !9
  %162 = load i32, ptr %20, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds ptr, ptr %161, i64 %163
  store ptr null, ptr %164, align 8, !tbaa !9
  br label %165

165:                                              ; preds = %160, %150, %140
  br label %166

166:                                              ; preds = %165
  %167 = load i32, ptr %20, align 4, !tbaa !5
  %168 = add nsw i32 %167, 1
  store i32 %168, ptr %20, align 4, !tbaa !5
  br label %136, !llvm.loop !20

169:                                              ; preds = %136
  br label %170

170:                                              ; preds = %169, %133
  %171 = load i32, ptr %8, align 4, !tbaa !5
  %172 = icmp eq i32 %171, 0
  br i1 %172, label %173, label %174

173:                                              ; preds = %170
  br label %179

174:                                              ; preds = %170
  %175 = load i32, ptr %8, align 4, !tbaa !5
  %176 = icmp eq i32 %175, 1
  %177 = zext i1 %176 to i64
  %178 = select i1 %176, ptr @.str.6, ptr @.str.7
  br label %179

179:                                              ; preds = %174, %173
  %180 = phi ptr [ @.str.5, %173 ], [ %178, %174 ]
  %181 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef %180)
  %182 = load i32, ptr %7, align 4, !tbaa !5
  %183 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %182)
  %184 = load i32, ptr %6, align 4, !tbaa !5
  %185 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, i32 noundef %184)
  %186 = load ptr, ptr %9, align 8, !tbaa !9
  %187 = getelementptr inbounds %struct.engine, ptr %186, i32 0, i32 0
  %188 = load ptr, ptr %187, align 8, !tbaa !21
  %189 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, ptr noundef %188)
  %190 = load ptr, ptr %10, align 8, !tbaa !9
  %191 = getelementptr inbounds %struct.engine, ptr %190, i32 0, i32 0
  %192 = load ptr, ptr %191, align 8, !tbaa !21
  %193 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, ptr noundef %192)
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %194

194:                                              ; preds = %228, %179
  %195 = load i32, ptr %20, align 4, !tbaa !5
  %196 = load i32, ptr %4, align 4, !tbaa !5
  %197 = icmp slt i32 %195, %196
  br i1 %197, label %198, label %231

198:                                              ; preds = %194
  call void @llvm.lifetime.start.p0(i64 48, ptr %23) #5
  %199 = load ptr, ptr %5, align 8, !tbaa !9
  %200 = load i32, ptr %20, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds ptr, ptr %199, i64 %201
  %203 = load ptr, ptr %202, align 8, !tbaa !9
  %204 = call i32 @xopen_for_read(ptr noundef %203, i1 noundef zeroext true, ptr noundef %23)
  store i32 %204, ptr %21, align 4, !tbaa !5
  %205 = load i32, ptr %21, align 4, !tbaa !5
  %206 = icmp ne i32 %205, 0
  br i1 %206, label %207, label %208

207:                                              ; preds = %198
  store i32 5, ptr %22, align 4
  br label %225

208:                                              ; preds = %198
  %209 = getelementptr inbounds %struct.file_stream, ptr %23, i32 0, i32 1
  %210 = load ptr, ptr %209, align 8, !tbaa !23
  %211 = call i32 (ptr, ...) @printf(ptr noundef @.str.12, ptr noundef %210)
  %212 = load ptr, ptr %15, align 8, !tbaa !9
  %213 = load ptr, ptr %16, align 8, !tbaa !9
  %214 = load ptr, ptr %17, align 8, !tbaa !9
  %215 = load i32, ptr %6, align 4, !tbaa !5
  %216 = load i8, ptr %11, align 1, !tbaa !11, !range !15, !noundef !16
  %217 = trunc i8 %216 to i1
  %218 = load i64, ptr %14, align 8, !tbaa !17
  %219 = call i32 @do_benchmark(ptr noundef %23, ptr noundef %212, ptr noundef %213, ptr noundef %214, i32 noundef %215, i1 noundef zeroext %217, i64 noundef %218, ptr noundef %12, ptr noundef %13)
  store i32 %219, ptr %21, align 4, !tbaa !5
  %220 = call i32 @xclose(ptr noundef %23)
  %221 = load i32, ptr %21, align 4, !tbaa !5
  %222 = icmp ne i32 %221, 0
  br i1 %222, label %223, label %224

223:                                              ; preds = %208
  store i32 5, ptr %22, align 4
  br label %225

224:                                              ; preds = %208
  store i32 0, ptr %22, align 4
  br label %225

225:                                              ; preds = %224, %223, %207
  call void @llvm.lifetime.end.p0(i64 48, ptr %23) #5
  %226 = load i32, ptr %22, align 4
  switch i32 %226, label %238 [
    i32 0, label %227
    i32 5, label %232
  ]

227:                                              ; preds = %225
  br label %228

228:                                              ; preds = %227
  %229 = load i32, ptr %20, align 4, !tbaa !5
  %230 = add nsw i32 %229, 1
  store i32 %230, ptr %20, align 4, !tbaa !5
  br label %194, !llvm.loop !25

231:                                              ; preds = %194
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %232

232:                                              ; preds = %231, %225, %129, %100, %95
  %233 = load ptr, ptr %17, align 8, !tbaa !9
  call void @free(ptr noundef %233) #5
  %234 = load ptr, ptr %16, align 8, !tbaa !9
  call void @free(ptr noundef %234) #5
  %235 = load ptr, ptr %15, align 8, !tbaa !9
  call void @free(ptr noundef %235) #5
  call void @decompressor_destroy(ptr noundef %13)
  call void @compressor_destroy(ptr noundef %12)
  %236 = load i32, ptr %21, align 4, !tbaa !5
  %237 = sub nsw i32 0, %236
  store i32 %237, ptr %3, align 4
  store i32 1, ptr %22, align 4
  br label %238

238:                                              ; preds = %232, %225, %76, %72, %69, %61, %55, %46, %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %239 = load i32, ptr %3, align 4
  ret i32 %239
}

; 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

declare void @begin_program(ptr noundef) #3

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

declare i32 @parse_compression_level(i8 noundef signext, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden ptr @name_to_engine(ptr noundef) #0

declare void @msg(ptr noundef, ...) #3

; Function Attrs: nounwind uwtable
declare hidden void @show_available_engines(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @show_usage(ptr noundef) #0

; Function Attrs: nounwind
declare i64 @strtoul(ptr noundef, ptr noundef, i32 noundef) #4

; Function Attrs: nounwind uwtable
declare hidden void @show_version() #0

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @compressor_init(ptr noundef, i32 noundef, i32 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @decompressor_init(ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i64 @compress_bound(ptr noundef, i64 noundef) #0

declare ptr @xmalloc(i64 noundef) #3

declare i32 @printf(ptr noundef, ...) #3

declare i32 @xopen_for_read(ptr noundef, i1 noundef zeroext, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden i32 @do_benchmark(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i1 noundef zeroext, i64 noundef, ptr noundef, ptr noundef) #0

declare i32 @xclose(ptr noundef) #3

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #4

; Function Attrs: nounwind uwtable
declare hidden void @decompressor_destroy(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @compressor_destroy(ptr noundef) #0

attributes #0 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!18, !18, i64 0}
!18 = !{!"long", !7, i64 0}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !14}
!21 = !{!22, !10, i64 0}
!22 = !{!"engine", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56}
!23 = !{!24, !10, i64 8}
!24 = !{!"file_stream", !6, i64 0, !10, i64 8, !12, i64 16, !10, i64 24, !10, i64 32, !18, i64 40}
!25 = distinct !{!25, !14}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.engine = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.compressor = type { i32, i32, ptr, ptr }
%struct.decompressor = type { i32, ptr, ptr }
%struct.file_stream = type { i32, ptr, i8, ptr, ptr, i64 }

@libdeflate_engine = external hidden constant %struct.engine, align 8
@.str = external hidden unnamed_addr constant [44 x i8], align 1
@toptarg = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [33 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [35 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [25 x i8], align 1
@libz_engine = external hidden constant %struct.engine, align 8
@toptind = external local_unnamed_addr global i32, align 4
@.str.4 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 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 [24 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -2147483647, -2147483648) i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca %struct.compressor, align 8
  %4 = alloca %struct.decompressor, align 8
  %5 = alloca [1 x ptr], align 8
  %6 = alloca %struct.file_stream, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %3, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %4, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  store i64 0, ptr %5, align 8
  tail call void @begin_program(ptr noundef %1) #7
  br label %7

7:                                                ; preds = %.backedge, %2
  %.081 = phi i32 [ 1048576, %2 ], [ %.081.be, %.backedge ]
  %.079 = phi i32 [ 6, %2 ], [ %.079.be, %.backedge ]
  %.077 = phi i32 [ 0, %2 ], [ %.077.be, %.backedge ]
  %.075 = phi ptr [ @libdeflate_engine, %2 ], [ %.075.be, %.backedge ]
  %.073 = phi ptr [ @libdeflate_engine, %2 ], [ %.073.be, %.backedge ]
  %.071 = phi i1 [ false, %2 ], [ %.071.be, %.backedge ]
  %8 = tail call i32 @tgetopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str) #7
  switch i32 %8, label %42 [
    i32 -1, label %44
    i32 48, label %9
    i32 49, label %9
    i32 50, label %9
    i32 51, label %9
    i32 52, label %9
    i32 53, label %9
    i32 54, label %9
    i32 55, label %9
    i32 56, label %9
    i32 57, label %9
    i32 67, label %14
    i32 68, label %21
    i32 101, label %.backedge
    i32 103, label %28
    i32 104, label %29
    i32 115, label %31
    i32 86, label %38
    i32 89, label %39
    i32 90, label %40
    i32 122, label %41
  ]

.backedge:                                        ; preds = %7, %31, %21, %14, %9, %41, %40, %39, %28
  %.081.be = phi i32 [ %.081, %41 ], [ %.081, %40 ], [ %.081, %39 ], [ %34, %31 ], [ %.081, %28 ], [ %.081, %21 ], [ %.081, %14 ], [ %.081, %9 ], [ %.081, %7 ]
  %.079.be = phi i32 [ %.079, %41 ], [ %.079, %40 ], [ %.079, %39 ], [ %.079, %31 ], [ %.079, %28 ], [ %.079, %21 ], [ %.079, %14 ], [ %12, %9 ], [ %.079, %7 ]
  %.077.be = phi i32 [ 1, %41 ], [ %.077, %40 ], [ %.077, %39 ], [ %.077, %31 ], [ 2, %28 ], [ %.077, %21 ], [ %.077, %14 ], [ %.077, %9 ], [ %.077, %7 ]
  %.075.be = phi ptr [ %.075, %41 ], [ %.075, %40 ], [ @libz_engine, %39 ], [ %.075, %31 ], [ %.075, %28 ], [ %.075, %21 ], [ %16, %14 ], [ %.075, %9 ], [ %.075, %7 ]
  %.073.be = phi ptr [ %.073, %41 ], [ @libz_engine, %40 ], [ %.073, %39 ], [ %.073, %31 ], [ %.073, %28 ], [ %23, %21 ], [ %.073, %14 ], [ %.073, %9 ], [ %.073, %7 ]
  %.071.be = phi i1 [ %.071, %41 ], [ %.071, %40 ], [ %.071, %39 ], [ %.071, %31 ], [ %.071, %28 ], [ %.071, %21 ], [ %.071, %14 ], [ %.071, %9 ], [ true, %7 ]
  br label %7, !llvm.loop !5

9:                                                ; preds = %7, %7, %7, %7, %7, %7, %7, %7, %7, %7
  %10 = trunc i32 %8 to i8
  %11 = load ptr, ptr @toptarg, align 8, !tbaa !7
  %12 = tail call i32 @parse_compression_level(i8 noundef signext %10, ptr noundef %11) #7
  %13 = icmp slt i32 %12, 0
  br i1 %13, label %.loopexit103, label %.backedge

14:                                               ; preds = %7
  %15 = load ptr, ptr @toptarg, align 8, !tbaa !7
  %16 = tail call ptr @name_to_engine(ptr noundef %15)
  %17 = icmp eq ptr %16, null
  br i1 %17, label %18, label %.backedge

18:                                               ; preds = %14
  %19 = load ptr, ptr @toptarg, align 8, !tbaa !7
  tail call void (ptr, ...) @msg(ptr noundef nonnull @.str.1, ptr noundef %19) #7
  %20 = load ptr, ptr @stderr, align 8, !tbaa !7
  tail call void @show_available_engines(ptr noundef %20)
  br label %.loopexit103

21:                                               ; preds = %7
  %22 = load ptr, ptr @toptarg, align 8, !tbaa !7
  %23 = tail call ptr @name_to_engine(ptr noundef %22)
  %24 = icmp eq ptr %23, null
  br i1 %24, label %25, label %.backedge

25:                                               ; preds = %21
  %26 = load ptr, ptr @toptarg, align 8, !tbaa !7
  tail call void (ptr, ...) @msg(ptr noundef nonnull @.str.2, ptr noundef %26) #7
  %27 = load ptr, ptr @stderr, align 8, !tbaa !7
  tail call void @show_available_engines(ptr noundef %27)
  br label %.loopexit103

28:                                               ; preds = %7
  br label %.backedge

29:                                               ; preds = %7
  %30 = load ptr, ptr @stdout, align 8, !tbaa !7
  tail call void @show_usage(ptr noundef %30)
  br label %.loopexit103

31:                                               ; preds = %7
  %32 = load ptr, ptr @toptarg, align 8, !tbaa !7
  %33 = tail call i64 @strtoul(ptr nocapture noundef %32, ptr noundef null, i32 noundef 10) #7
  %34 = trunc i64 %33 to i32
  %35 = icmp eq i32 %34, 0
  br i1 %35, label %36, label %.backedge

36:                                               ; preds = %31
  %37 = load ptr, ptr @toptarg, align 8, !tbaa !7
  tail call void (ptr, ...) @msg(ptr noundef nonnull @.str.3, ptr noundef %37) #7
  br label %.loopexit103

38:                                               ; preds = %7
  tail call void @show_version()
  br label %.loopexit103

39:                                               ; preds = %7
  br label %.backedge

40:                                               ; preds = %7
  br label %.backedge

41:                                               ; preds = %7
  br label %.backedge

42:                                               ; preds = %7
  %43 = load ptr, ptr @stderr, align 8, !tbaa !7
  tail call void @show_usage(ptr noundef %43)
  br label %.loopexit103

44:                                               ; preds = %7
  %45 = load i32, ptr @toptind, align 4, !tbaa !11
  %46 = sub i32 %0, %45
  %47 = sext i32 %45 to i64
  %48 = getelementptr inbounds ptr, ptr %1, i64 %47
  %49 = icmp eq i32 %.079, 0
  %50 = call zeroext i1 @compressor_init(ptr noundef nonnull %3, i32 noundef %.079, i32 noundef %.077, ptr noundef nonnull %.075)
  br i1 %50, label %51, label %.loopexit

51:                                               ; preds = %44
  %52 = call zeroext i1 @decompressor_init(ptr noundef nonnull %4, i32 noundef %.077, ptr noundef nonnull %.073)
  br i1 %52, label %53, label %.loopexit

53:                                               ; preds = %51
  %54 = select i1 %49, i1 true, i1 %.071
  br i1 %54, label %55, label %58

55:                                               ; preds = %53
  %56 = zext i32 %.081 to i64
  %57 = call i64 @compress_bound(ptr noundef nonnull %3, i64 noundef %56)
  br label %61

58:                                               ; preds = %53
  %59 = add i32 %.081, -1
  %60 = zext i32 %59 to i64
  %.pre = zext i32 %.081 to i64
  br label %61

61:                                               ; preds = %58, %55
  %.pre-phi = phi i64 [ %.pre, %58 ], [ %56, %55 ]
  %.070 = phi i64 [ %60, %58 ], [ %57, %55 ]
  %62 = call ptr @xmalloc(i64 noundef %.pre-phi) #7
  %63 = call ptr @xmalloc(i64 noundef %.070) #7
  %64 = call ptr @xmalloc(i64 noundef %.pre-phi) #7
  %65 = icmp eq ptr %62, null
  %66 = icmp eq ptr %63, null
  %or.cond = select i1 %65, i1 true, i1 %66
  %67 = icmp eq ptr %64, null
  %or.cond3 = select i1 %or.cond, i1 true, i1 %67
  br i1 %or.cond3, label %.loopexit, label %68

68:                                               ; preds = %61
  %69 = icmp eq i32 %46, 0
  br i1 %69, label %.loopexit102, label %.preheader

.preheader:                                       ; preds = %68
  %70 = icmp sgt i32 %46, 0
  br i1 %70, label %.lr.ph.preheader, label %.loopexit102

.lr.ph.preheader:                                 ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %46 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %71 = icmp eq i32 %46, 1
  br i1 %71, label %.loopexit102.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %.lr.ph

.lr.ph:                                           ; preds = %90, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.1, %90 ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %90 ]
  %72 = getelementptr inbounds ptr, ptr %48, i64 %indvars.iv
  %73 = load ptr, ptr %72, align 8, !tbaa !7
  %74 = load i8, ptr %73, align 1, !tbaa !13
  %75 = icmp eq i8 %74, 45
  br i1 %75, label %76, label %.lr.ph.1

76:                                               ; preds = %.lr.ph
  %77 = getelementptr inbounds i8, ptr %73, i64 1
  %78 = load i8, ptr %77, align 1, !tbaa !13
  %79 = icmp eq i8 %78, 0
  br i1 %79, label %80, label %.lr.ph.1

80:                                               ; preds = %76
  store ptr null, ptr %72, align 8, !tbaa !7
  br label %.lr.ph.1

.lr.ph.1:                                         ; preds = %.lr.ph, %76, %80
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %81 = getelementptr inbounds ptr, ptr %48, i64 %indvars.iv.next
  %82 = load ptr, ptr %81, align 8, !tbaa !7
  %83 = load i8, ptr %82, align 1, !tbaa !13
  %84 = icmp eq i8 %83, 45
  br i1 %84, label %85, label %90

85:                                               ; preds = %.lr.ph.1
  %86 = getelementptr inbounds i8, ptr %82, i64 1
  %87 = load i8, ptr %86, align 1, !tbaa !13
  %88 = icmp eq i8 %87, 0
  br i1 %88, label %89, label %90

89:                                               ; preds = %85
  store ptr null, ptr %81, align 8, !tbaa !7
  br label %90

90:                                               ; preds = %89, %85, %.lr.ph.1
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.loopexit102.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !14

.loopexit102.loopexit.unr-lcssa:                  ; preds = %90, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.1, %90 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.loopexit102, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.loopexit102.loopexit.unr-lcssa
  %91 = getelementptr inbounds ptr, ptr %48, i64 %indvars.iv.unr
  %92 = load ptr, ptr %91, align 8, !tbaa !7
  %93 = load i8, ptr %92, align 1, !tbaa !13
  %94 = icmp eq i8 %93, 45
  br i1 %94, label %95, label %.loopexit102

95:                                               ; preds = %.lr.ph.epil
  %96 = getelementptr inbounds i8, ptr %92, i64 1
  %97 = load i8, ptr %96, align 1, !tbaa !13
  %98 = icmp eq i8 %97, 0
  br i1 %98, label %99, label %.loopexit102

99:                                               ; preds = %95
  store ptr null, ptr %91, align 8, !tbaa !7
  br label %.loopexit102

.loopexit102:                                     ; preds = %.loopexit102.loopexit.unr-lcssa, %99, %95, %.lr.ph.epil, %.preheader, %68
  %.084 = phi i32 [ 1, %68 ], [ %46, %.preheader ], [ %46, %.lr.ph.epil ], [ %46, %95 ], [ %46, %99 ], [ %46, %.loopexit102.loopexit.unr-lcssa ]
  %.083 = phi ptr [ %5, %68 ], [ %48, %.preheader ], [ %48, %.lr.ph.epil ], [ %48, %95 ], [ %48, %99 ], [ %48, %.loopexit102.loopexit.unr-lcssa ]
  %100 = icmp eq i32 %.077, 0
  %101 = icmp eq i32 %.077, 1
  %102 = select i1 %101, ptr @.str.6, ptr @.str.7
  %103 = select i1 %100, ptr @.str.5, ptr %102
  %104 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull %103)
  %105 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %.079)
  %106 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef %.081)
  %107 = load ptr, ptr %.075, align 8, !tbaa !15
  %108 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, ptr noundef %107)
  %109 = load ptr, ptr %.073, align 8, !tbaa !15
  %110 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, ptr noundef %109)
  %111 = icmp sgt i32 %.084, 0
  br i1 %111, label %.lr.ph148, label %.loopexit

.lr.ph148:                                        ; preds = %.loopexit102
  %112 = getelementptr inbounds i8, ptr %6, i64 8
  %wide.trip.count195 = zext nneg i32 %.084 to i64
  br label %113

113:                                              ; preds = %.lr.ph148, %122
  %indvars.iv192 = phi i64 [ 0, %.lr.ph148 ], [ %indvars.iv.next193, %122 ]
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %6) #7
  %114 = getelementptr inbounds ptr, ptr %.083, i64 %indvars.iv192
  %115 = load ptr, ptr %114, align 8, !tbaa !7
  %116 = call i32 @xopen_for_read(ptr noundef %115, i1 noundef zeroext true, ptr noundef nonnull %6) #7
  %.not97 = icmp eq i32 %116, 0
  br i1 %.not97, label %117, label %.thread

117:                                              ; preds = %113
  %118 = load ptr, ptr %112, align 8, !tbaa !17
  %119 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, ptr noundef %118)
  %120 = call i32 @do_benchmark(ptr noundef nonnull %6, ptr noundef %62, ptr noundef %63, ptr noundef %64, i32 noundef %.081, i1 noundef zeroext %54, i64 noundef %.070, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %121 = call i32 @xclose(ptr noundef nonnull %6) #7
  %.not98 = icmp eq i32 %120, 0
  br i1 %.not98, label %122, label %.thread

.thread:                                          ; preds = %113, %117
  %.063.ph = phi i32 [ %120, %117 ], [ %116, %113 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #7
  br label %.loopexit

122:                                              ; preds = %117
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #7
  %indvars.iv.next193 = add nuw nsw i64 %indvars.iv192, 1
  %exitcond196.not = icmp eq i64 %indvars.iv.next193, %wide.trip.count195
  br i1 %exitcond196.not, label %.loopexit, label %113, !llvm.loop !21

.loopexit:                                        ; preds = %122, %.loopexit102, %.thread, %61, %51, %44
  %.069 = phi ptr [ %62, %61 ], [ null, %51 ], [ null, %44 ], [ %62, %.thread ], [ %62, %.loopexit102 ], [ %62, %122 ]
  %.068 = phi ptr [ %63, %61 ], [ null, %51 ], [ null, %44 ], [ %63, %.thread ], [ %63, %.loopexit102 ], [ %63, %122 ]
  %.067 = phi ptr [ %64, %61 ], [ null, %51 ], [ null, %44 ], [ %64, %.thread ], [ %64, %.loopexit102 ], [ %64, %122 ]
  %.1 = phi i32 [ -1, %61 ], [ -1, %51 ], [ -1, %44 ], [ %.063.ph, %.thread ], [ 0, %.loopexit102 ], [ 0, %122 ]
  call void @free(ptr noundef %.067) #7
  call void @free(ptr noundef %.068) #7
  call void @free(ptr noundef %.069) #7
  call void @decompressor_destroy(ptr noundef nonnull %4)
  call void @compressor_destroy(ptr noundef nonnull %3)
  %123 = sub nsw i32 0, %.1
  br label %.loopexit103

.loopexit103:                                     ; preds = %9, %.loopexit, %42, %38, %36, %29, %25, %18
  %.066 = phi i32 [ 1, %42 ], [ 0, %38 ], [ 1, %36 ], [ 0, %29 ], [ 1, %25 ], [ 1, %18 ], [ %123, %.loopexit ], [ 1, %9 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  ret i32 %.066
}

; 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

declare void @begin_program(ptr noundef) local_unnamed_addr #3

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

declare i32 @parse_compression_level(i8 noundef signext, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden ptr @name_to_engine(ptr noundef) local_unnamed_addr #0

declare void @msg(ptr noundef, ...) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @show_available_engines(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @show_usage(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtoul(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden void @show_version() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @compressor_init(ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @decompressor_init(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden i64 @compress_bound(ptr noundef, i64 noundef) local_unnamed_addr #0

declare ptr @xmalloc(i64 noundef) local_unnamed_addr #3

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

declare i32 @xopen_for_read(ptr noundef, i1 noundef zeroext, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden i32 @do_benchmark(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i1 noundef zeroext, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare i32 @xclose(ptr noundef) local_unnamed_addr #3

; 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 nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #6

; Function Attrs: nounwind uwtable
declare hidden void @decompressor_destroy(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @compressor_destroy(ptr noundef) local_unnamed_addr #0

attributes #0 = { 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 nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { mustprogress nofree nounwind willreturn "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 = { 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 #6 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !9, i64 0}
!13 = !{!9, !9, i64 0}
!14 = distinct !{!14, !6}
!15 = !{!16, !8, i64 0}
!16 = !{!"engine", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24, !8, i64 32, !8, i64 40, !8, i64 48, !8, i64 56}
!17 = !{!18, !8, i64 8}
!18 = !{!"file_stream", !12, i64 0, !8, i64 8, !19, i64 16, !8, i64 24, !8, i64 32, !20, i64 40}
!19 = !{!"_Bool", !9, i64 0}
!20 = !{!"long", !9, i64 0}
!21 = distinct !{!21, !6}


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