; LLVM IR from litespeedtech/ls-qpack :: bin (fuzz-decode)

; 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.anon.6 = type { ptr }
%struct.lsqpack_dec_hset_if = type { ptr, ptr, ptr }
%struct.lsqpack_dec = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, %struct.lsqpack_ringbuf, %struct.anon, [8 x %struct.anon.0], i32, float, %struct.anon.1, %struct.lsqpack_dec_err }
%struct.lsqpack_ringbuf = type { i32, i32, i32, ptr }
%struct.anon = type { ptr, ptr }
%struct.anon.0 = type { ptr, ptr }
%struct.anon.1 = type { i32, %union.anon }
%union.anon = type { %struct.anon.2 }
%struct.anon.2 = type { %struct.lsqpack_dec_int_state, %struct.lsqpack_huff_decode_state, i32, i32, ptr, ptr, ptr, i32, i32, i32, i32, i8, i8 }
%struct.lsqpack_dec_int_state = type { i32, i32, i32, i64 }
%struct.lsqpack_huff_decode_state = type { i32, %struct.lsqpack_decode_status }
%struct.lsqpack_decode_status = type { i8, i8 }
%struct.lsqpack_dec_err = type { i32, i32, i64, i64 }
%struct.stat = type { i64, i64, i64, i32, i32, i32, i32, i64, i64, i64, i64, %struct.timespec, %struct.timespec, %struct.timespec, [3 x i64] }
%struct.timespec = type { i64, i64 }
%struct.header = type { %struct.anon.7, %struct.lsxpack_header, [65536 x i8] }
%struct.anon.7 = type { ptr, ptr }
%struct.lsxpack_header = type { ptr, i32, i32, i32, i32, i16, i16, i16, i8, i8, i8, i8, i8, i8 }

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@optarg = external global ptr, align 8
@stderr = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [34 x i8], align 1
@s_headers = external dso_local global %struct.anon.6, align 8
@hset_if = external hidden constant %struct.lsqpack_dec_hset_if, align 8
@.str.2 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [29 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 i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.lsqpack_dec, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca %struct.stat, align 8
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  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) #8
  store i32 -1, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 352, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.start.p0(i64 144, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  br label %24

24:                                               ; preds = %68, %2
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %26 = load ptr, ptr %5, align 8, !tbaa !9
  %27 = call i32 @getopt(i32 noundef %25, ptr noundef %26, ptr noundef @.str) #8
  store i32 %27, ptr %8, align 4, !tbaa !5
  %28 = icmp ne i32 -1, %27
  br i1 %28, label %29, label %69

29:                                               ; preds = %24
  %30 = load i32, ptr %8, align 4, !tbaa !5
  switch i32 %30, label %67 [
    i32 105, label %31
    i32 102, label %44
    i32 115, label %57
    i32 116, label %60
    i32 104, label %63
  ]

31:                                               ; preds = %29
  %32 = load ptr, ptr @optarg, align 8, !tbaa !9
  %33 = call i32 (ptr, i32, ...) @open(ptr noundef %32, i32 noundef 0)
  store i32 %33, ptr %6, align 4, !tbaa !5
  %34 = load i32, ptr %6, align 4, !tbaa !5
  %35 = icmp slt i32 %34, 0
  br i1 %35, label %36, label %43

36:                                               ; preds = %31
  %37 = load ptr, ptr @stderr, align 8, !tbaa !9
  %38 = load ptr, ptr @optarg, align 8, !tbaa !9
  %39 = call ptr @__errno_location() #9
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = call ptr @strerror(i32 noundef %40) #8
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef @.str.1, ptr noundef %38, ptr noundef %41) #8
  call void @exit(i32 noundef 1) #10
  unreachable

43:                                               ; preds = %31
  br label %68

44:                                               ; preds = %29
  %45 = load ptr, ptr @optarg, align 8, !tbaa !9
  %46 = call i32 (ptr, i32, ...) @open(ptr noundef %45, i32 noundef 0)
  store i32 %46, ptr %7, align 4, !tbaa !5
  %47 = load i32, ptr %7, align 4, !tbaa !5
  %48 = icmp slt i32 %47, 0
  br i1 %48, label %49, label %56

49:                                               ; preds = %44
  %50 = load ptr, ptr @stderr, align 8, !tbaa !9
  %51 = load ptr, ptr @optarg, align 8, !tbaa !9
  %52 = call ptr @__errno_location() #9
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = call ptr @strerror(i32 noundef %53) #8
  %55 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef @.str.1, ptr noundef %51, ptr noundef %54) #8
  call void @exit(i32 noundef 1) #10
  unreachable

56:                                               ; preds = %44
  br label %68

57:                                               ; preds = %29
  %58 = load ptr, ptr @optarg, align 8, !tbaa !9
  %59 = call i32 @atoi(ptr noundef %58) #11
  store i32 %59, ptr %10, align 4, !tbaa !5
  br label %68

60:                                               ; preds = %29
  %61 = load ptr, ptr @optarg, align 8, !tbaa !9
  %62 = call i32 @atoi(ptr noundef %61) #11
  store i32 %62, ptr %9, align 4, !tbaa !5
  br label %68

63:                                               ; preds = %29
  %64 = load ptr, ptr %5, align 8, !tbaa !9
  %65 = getelementptr inbounds ptr, ptr %64, i64 0
  %66 = load ptr, ptr %65, align 8, !tbaa !9
  call void @usage(ptr noundef %66)
  call void @exit(i32 noundef 0) #10
  unreachable

67:                                               ; preds = %29
  call void @exit(i32 noundef 1) #10
  unreachable

68:                                               ; preds = %60, %57, %56, %43
  br label %24, !llvm.loop !11

69:                                               ; preds = %24
  br label %70

70:                                               ; preds = %69
  store ptr null, ptr @s_headers, align 8, !tbaa !13
  br label %71

71:                                               ; preds = %70
  br label %72

72:                                               ; preds = %71
  %73 = load i32, ptr %9, align 4, !tbaa !5
  %74 = load i32, ptr %10, align 4, !tbaa !5
  call void @lsqpack_dec_init(ptr noundef %11, ptr noundef null, i32 noundef %73, i32 noundef %74, ptr noundef @hset_if, i32 noundef 0)
  %75 = load i32, ptr %6, align 4, !tbaa !5
  %76 = icmp slt i32 %75, 0
  br i1 %76, label %77, label %80

77:                                               ; preds = %72
  %78 = load ptr, ptr @stderr, align 8, !tbaa !9
  %79 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %78, ptr noundef @.str.2) #8
  call void @exit(i32 noundef 1) #10
  unreachable

80:                                               ; preds = %72
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = call i32 @fstat(i32 noundef %81, ptr noundef %15) #8
  %83 = icmp ne i32 0, %82
  br i1 %83, label %84, label %85

84:                                               ; preds = %80
  call void @perror(ptr noundef @.str.3)
  call void @exit(i32 noundef 1) #10
  unreachable

85:                                               ; preds = %80
  %86 = getelementptr inbounds %struct.stat, ptr %15, i32 0, i32 8
  %87 = load i64, ptr %86, align 8, !tbaa !15
  %88 = load i32, ptr %6, align 4, !tbaa !5
  %89 = call ptr @mmap(ptr noundef null, i64 noundef %87, i32 noundef 1, i32 noundef 2, i32 noundef %88, i64 noundef 0) #8
  store ptr %89, ptr %14, align 8, !tbaa !9
  %90 = load ptr, ptr %14, align 8, !tbaa !9
  %91 = icmp ne ptr %90, null
  br i1 %91, label %93, label %92

92:                                               ; preds = %85
  call void @perror(ptr noundef @.str.4)
  call void @exit(i32 noundef 1) #10
  unreachable

93:                                               ; preds = %85
  %94 = load ptr, ptr %14, align 8, !tbaa !9
  store ptr %94, ptr %12, align 8, !tbaa !9
  %95 = load ptr, ptr %14, align 8, !tbaa !9
  %96 = getelementptr inbounds %struct.stat, ptr %15, i32 0, i32 8
  %97 = load i64, ptr %96, align 8, !tbaa !15
  %98 = getelementptr inbounds i8, ptr %95, i64 %97
  store ptr %98, ptr %13, align 8, !tbaa !9
  br label %99

99:                                               ; preds = %166, %93
  %100 = load ptr, ptr %12, align 8, !tbaa !9
  %101 = getelementptr inbounds i8, ptr %100, i64 8
  %102 = getelementptr inbounds i8, ptr %101, i64 4
  %103 = load ptr, ptr %13, align 8, !tbaa !9
  %104 = icmp ult ptr %102, %103
  br i1 %104, label %105, label %171

105:                                              ; preds = %99
  %106 = load ptr, ptr %12, align 8, !tbaa !9
  %107 = load i64, ptr %106, align 8, !tbaa !19
  store i64 %107, ptr %16, align 8, !tbaa !19
  %108 = load ptr, ptr %12, align 8, !tbaa !9
  %109 = getelementptr inbounds i8, ptr %108, i64 8
  store ptr %109, ptr %12, align 8, !tbaa !9
  %110 = load ptr, ptr %12, align 8, !tbaa !9
  %111 = load i32, ptr %110, align 4, !tbaa !5
  store i32 %111, ptr %17, align 4, !tbaa !5
  %112 = load ptr, ptr %12, align 8, !tbaa !9
  %113 = getelementptr inbounds i8, ptr %112, i64 4
  store ptr %113, ptr %12, align 8, !tbaa !9
  %114 = load i64, ptr %16, align 8, !tbaa !19
  %115 = call i64 @__bswap_64(i64 noundef %114)
  store i64 %115, ptr %16, align 8, !tbaa !19
  %116 = load i32, ptr %17, align 4, !tbaa !5
  %117 = call i32 @__bswap_32(i32 noundef %116)
  store i32 %117, ptr %17, align 4, !tbaa !5
  %118 = load ptr, ptr %12, align 8, !tbaa !9
  %119 = load i32, ptr %17, align 4, !tbaa !5
  %120 = zext i32 %119 to i64
  %121 = getelementptr inbounds i8, ptr %118, i64 %120
  %122 = load ptr, ptr %13, align 8, !tbaa !9
  %123 = icmp ugt ptr %121, %122
  br i1 %123, label %124, label %133

124:                                              ; preds = %105
  %125 = load ptr, ptr @stderr, align 8, !tbaa !9
  %126 = load ptr, ptr %12, align 8, !tbaa !9
  %127 = load ptr, ptr %14, align 8, !tbaa !9
  %128 = ptrtoint ptr %126 to i64
  %129 = ptrtoint ptr %127 to i64
  %130 = sub i64 %128, %129
  %131 = trunc i64 %130 to i32
  %132 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %125, ptr noundef @.str.5, i32 noundef %131) #8
  call void @abort() #10
  unreachable

133:                                              ; preds = %105
  %134 = load i64, ptr %16, align 8, !tbaa !19
  %135 = icmp eq i64 %134, 0
  br i1 %135, label %136, label %145

136:                                              ; preds = %133
  %137 = load ptr, ptr %12, align 8, !tbaa !9
  %138 = load i32, ptr %17, align 4, !tbaa !5
  %139 = zext i32 %138 to i64
  %140 = call i32 @lsqpack_dec_enc_in(ptr noundef %11, ptr noundef %137, i64 noundef %139)
  store i32 %140, ptr %18, align 4, !tbaa !5
  %141 = load i32, ptr %18, align 4, !tbaa !5
  %142 = icmp ne i32 %141, 0
  br i1 %142, label %143, label %144

143:                                              ; preds = %136
  call void @abort() #10
  unreachable

144:                                              ; preds = %136
  br label %166

145:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %146 = load ptr, ptr %12, align 8, !tbaa !9
  store ptr %146, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  %147 = load i64, ptr %16, align 8, !tbaa !19
  %148 = load i32, ptr %17, align 4, !tbaa !5
  %149 = zext i32 %148 to i64
  %150 = load i32, ptr %17, align 4, !tbaa !5
  %151 = zext i32 %150 to i64
  %152 = call i32 @lsqpack_dec_header_in(ptr noundef %11, ptr noundef null, i64 noundef %147, i64 noundef %149, ptr noundef %20, i64 noundef %151, ptr noundef null, ptr noundef null)
  store i32 %152, ptr %21, align 4, !tbaa !5
  %153 = load i32, ptr %21, align 4, !tbaa !5
  %154 = icmp ne i32 %153, 0
  br i1 %154, label %164, label %155

155:                                              ; preds = %145
  %156 = load ptr, ptr %20, align 8, !tbaa !9
  %157 = load ptr, ptr %12, align 8, !tbaa !9
  %158 = ptrtoint ptr %156 to i64
  %159 = ptrtoint ptr %157 to i64
  %160 = sub i64 %158, %159
  %161 = trunc i64 %160 to i32
  %162 = load i32, ptr %17, align 4, !tbaa !5
  %163 = icmp ne i32 %161, %162
  br i1 %163, label %164, label %165

164:                                              ; preds = %155, %145
  call void @abort() #10
  unreachable

165:                                              ; preds = %155
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  br label %166

166:                                              ; preds = %165, %144
  %167 = load i32, ptr %17, align 4, !tbaa !5
  %168 = load ptr, ptr %12, align 8, !tbaa !9
  %169 = zext i32 %167 to i64
  %170 = getelementptr inbounds i8, ptr %168, i64 %169
  store ptr %170, ptr %12, align 8, !tbaa !9
  br label %99, !llvm.loop !20

171:                                              ; preds = %99
  %172 = load ptr, ptr %14, align 8, !tbaa !9
  %173 = getelementptr inbounds %struct.stat, ptr %15, i32 0, i32 8
  %174 = load i64, ptr %173, align 8, !tbaa !15
  %175 = call i32 @munmap(ptr noundef %172, i64 noundef %174) #8
  %176 = load i32, ptr %6, align 4, !tbaa !5
  %177 = call i32 @close(i32 noundef %176)
  %178 = load i32, ptr %7, align 4, !tbaa !5
  %179 = call i32 @fstat(i32 noundef %178, ptr noundef %15) #8
  %180 = icmp ne i32 0, %179
  br i1 %180, label %181, label %182

181:                                              ; preds = %171
  call void @perror(ptr noundef @.str.3)
  call void @exit(i32 noundef 1) #10
  unreachable

182:                                              ; preds = %171
  %183 = getelementptr inbounds %struct.stat, ptr %15, i32 0, i32 8
  %184 = load i64, ptr %183, align 8, !tbaa !15
  %185 = load i32, ptr %7, align 4, !tbaa !5
  %186 = call ptr @mmap(ptr noundef null, i64 noundef %184, i32 noundef 1, i32 noundef 2, i32 noundef %185, i64 noundef 0) #8
  store ptr %186, ptr %14, align 8, !tbaa !9
  %187 = load ptr, ptr %14, align 8, !tbaa !9
  %188 = icmp ne ptr %187, null
  br i1 %188, label %190, label %189

189:                                              ; preds = %182
  call void @perror(ptr noundef @.str.4)
  call void @exit(i32 noundef 1) #10
  unreachable

190:                                              ; preds = %182
  %191 = load ptr, ptr %14, align 8, !tbaa !9
  store ptr %191, ptr %12, align 8, !tbaa !9
  %192 = load ptr, ptr %14, align 8, !tbaa !9
  %193 = getelementptr inbounds %struct.stat, ptr %15, i32 0, i32 8
  %194 = load i64, ptr %193, align 8, !tbaa !15
  %195 = getelementptr inbounds i8, ptr %192, i64 %194
  store ptr %195, ptr %13, align 8, !tbaa !9
  br label %196

196:                                              ; preds = %190
  %197 = load ptr, ptr %12, align 8, !tbaa !9
  %198 = getelementptr inbounds i8, ptr %197, i64 8
  %199 = getelementptr inbounds i8, ptr %198, i64 4
  %200 = load ptr, ptr %13, align 8, !tbaa !9
  %201 = icmp ult ptr %199, %200
  br i1 %201, label %202, label %270

202:                                              ; preds = %196
  %203 = load ptr, ptr %12, align 8, !tbaa !9
  %204 = load i64, ptr %203, align 8, !tbaa !19
  store i64 %204, ptr %16, align 8, !tbaa !19
  %205 = load ptr, ptr %12, align 8, !tbaa !9
  %206 = getelementptr inbounds i8, ptr %205, i64 8
  store ptr %206, ptr %12, align 8, !tbaa !9
  %207 = load ptr, ptr %12, align 8, !tbaa !9
  %208 = load i32, ptr %207, align 4, !tbaa !5
  store i32 %208, ptr %17, align 4, !tbaa !5
  %209 = load ptr, ptr %12, align 8, !tbaa !9
  %210 = getelementptr inbounds i8, ptr %209, i64 4
  store ptr %210, ptr %12, align 8, !tbaa !9
  %211 = load i64, ptr %16, align 8, !tbaa !19
  %212 = call i64 @__bswap_64(i64 noundef %211)
  store i64 %212, ptr %16, align 8, !tbaa !19
  %213 = load i32, ptr %17, align 4, !tbaa !5
  %214 = call i32 @__bswap_32(i32 noundef %213)
  store i32 %214, ptr %17, align 4, !tbaa !5
  %215 = load i64, ptr %16, align 8, !tbaa !19
  %216 = icmp eq i64 %215, 0
  br i1 %216, label %217, label %241

217:                                              ; preds = %202
  %218 = load ptr, ptr %12, align 8, !tbaa !9
  %219 = load i32, ptr %17, align 4, !tbaa !5
  %220 = load ptr, ptr %13, align 8, !tbaa !9
  %221 = load ptr, ptr %12, align 8, !tbaa !9
  %222 = ptrtoint ptr %220 to i64
  %223 = ptrtoint ptr %221 to i64
  %224 = sub i64 %222, %223
  %225 = trunc i64 %224 to i32
  %226 = icmp ult i32 %219, %225
  br i1 %226, label %227, label %229

227:                                              ; preds = %217
  %228 = load i32, ptr %17, align 4, !tbaa !5
  br label %236

229:                                              ; preds = %217
  %230 = load ptr, ptr %13, align 8, !tbaa !9
  %231 = load ptr, ptr %12, align 8, !tbaa !9
  %232 = ptrtoint ptr %230 to i64
  %233 = ptrtoint ptr %231 to i64
  %234 = sub i64 %232, %233
  %235 = trunc i64 %234 to i32
  br label %236

236:                                              ; preds = %229, %227
  %237 = phi i32 [ %228, %227 ], [ %235, %229 ]
  %238 = zext i32 %237 to i64
  %239 = call i32 @lsqpack_dec_enc_in(ptr noundef %11, ptr noundef %218, i64 noundef %238)
  store i32 %239, ptr %18, align 4, !tbaa !5
  %240 = load i32, ptr %18, align 4, !tbaa !5
  br label %269

241:                                              ; preds = %202
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %242 = load ptr, ptr %12, align 8, !tbaa !9
  store ptr %242, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  %243 = load i32, ptr %17, align 4, !tbaa !5
  %244 = load ptr, ptr %13, align 8, !tbaa !9
  %245 = load ptr, ptr %12, align 8, !tbaa !9
  %246 = ptrtoint ptr %244 to i64
  %247 = ptrtoint ptr %245 to i64
  %248 = sub i64 %246, %247
  %249 = trunc i64 %248 to i32
  %250 = icmp ult i32 %243, %249
  br i1 %250, label %251, label %253

251:                                              ; preds = %241
  %252 = load i32, ptr %17, align 4, !tbaa !5
  br label %260

253:                                              ; preds = %241
  %254 = load ptr, ptr %13, align 8, !tbaa !9
  %255 = load ptr, ptr %12, align 8, !tbaa !9
  %256 = ptrtoint ptr %254 to i64
  %257 = ptrtoint ptr %255 to i64
  %258 = sub i64 %256, %257
  %259 = trunc i64 %258 to i32
  br label %260

260:                                              ; preds = %253, %251
  %261 = phi i32 [ %252, %251 ], [ %259, %253 ]
  store i32 %261, ptr %17, align 4, !tbaa !5
  %262 = load i64, ptr %16, align 8, !tbaa !19
  %263 = load i32, ptr %17, align 4, !tbaa !5
  %264 = zext i32 %263 to i64
  %265 = load i32, ptr %17, align 4, !tbaa !5
  %266 = zext i32 %265 to i64
  %267 = call i32 @lsqpack_dec_header_in(ptr noundef %11, ptr noundef null, i64 noundef %262, i64 noundef %264, ptr noundef %22, i64 noundef %266, ptr noundef null, ptr noundef null)
  store i32 %267, ptr %23, align 4, !tbaa !5
  %268 = load i32, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  br label %269

269:                                              ; preds = %260, %236
  br label %270

270:                                              ; preds = %269, %196
  %271 = load ptr, ptr %14, align 8, !tbaa !9
  %272 = getelementptr inbounds %struct.stat, ptr %15, i32 0, i32 8
  %273 = load i64, ptr %272, align 8, !tbaa !15
  %274 = call i32 @munmap(ptr noundef %271, i64 noundef %273) #8
  %275 = load i32, ptr %7, align 4, !tbaa !5
  %276 = call i32 @close(i32 noundef %275)
  call void @lsqpack_dec_cleanup(ptr noundef %11)
  br label %277

277:                                              ; preds = %310, %270
  %278 = load ptr, ptr @s_headers, align 8, !tbaa !13
  %279 = icmp eq ptr %278, null
  %280 = xor i1 %279, true
  br i1 %280, label %281, label %312

281:                                              ; preds = %277
  %282 = load ptr, ptr @s_headers, align 8, !tbaa !13
  store ptr %282, ptr %19, align 8, !tbaa !9
  br label %283

283:                                              ; preds = %281
  %284 = load ptr, ptr %19, align 8, !tbaa !9
  %285 = getelementptr inbounds %struct.header, ptr %284, i32 0, i32 0
  %286 = getelementptr inbounds %struct.anon.7, ptr %285, i32 0, i32 0
  %287 = load ptr, ptr %286, align 8, !tbaa !21
  %288 = icmp ne ptr %287, null
  br i1 %288, label %289, label %300

289:                                              ; preds = %283
  %290 = load ptr, ptr %19, align 8, !tbaa !9
  %291 = getelementptr inbounds %struct.header, ptr %290, i32 0, i32 0
  %292 = getelementptr inbounds %struct.anon.7, ptr %291, i32 0, i32 1
  %293 = load ptr, ptr %292, align 8, !tbaa !26
  %294 = load ptr, ptr %19, align 8, !tbaa !9
  %295 = getelementptr inbounds %struct.header, ptr %294, i32 0, i32 0
  %296 = getelementptr inbounds %struct.anon.7, ptr %295, i32 0, i32 0
  %297 = load ptr, ptr %296, align 8, !tbaa !21
  %298 = getelementptr inbounds %struct.header, ptr %297, i32 0, i32 0
  %299 = getelementptr inbounds %struct.anon.7, ptr %298, i32 0, i32 1
  store ptr %293, ptr %299, align 8, !tbaa !26
  br label %300

300:                                              ; preds = %289, %283
  %301 = load ptr, ptr %19, align 8, !tbaa !9
  %302 = getelementptr inbounds %struct.header, ptr %301, i32 0, i32 0
  %303 = getelementptr inbounds %struct.anon.7, ptr %302, i32 0, i32 0
  %304 = load ptr, ptr %303, align 8, !tbaa !21
  %305 = load ptr, ptr %19, align 8, !tbaa !9
  %306 = getelementptr inbounds %struct.header, ptr %305, i32 0, i32 0
  %307 = getelementptr inbounds %struct.anon.7, ptr %306, i32 0, i32 1
  %308 = load ptr, ptr %307, align 8, !tbaa !26
  store ptr %304, ptr %308, align 8, !tbaa !9
  br label %309

309:                                              ; preds = %300
  br label %310

310:                                              ; preds = %309
  %311 = load ptr, ptr %19, align 8, !tbaa !9
  call void @free(ptr noundef %311) #8
  br label %277, !llvm.loop !27

312:                                              ; preds = %277
  call void @exit(i32 noundef 0) #10
  unreachable
}

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

; Function Attrs: nounwind
declare i32 @getopt(i32 noundef, ptr noundef, ptr noundef) #2

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

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

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) #2

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #4

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

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #6

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

declare void @lsqpack_dec_init(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef) #3

; Function Attrs: nounwind
declare i32 @fstat(i32 noundef, ptr noundef) #2

declare void @perror(ptr noundef) #3

; Function Attrs: nounwind
declare ptr @mmap(ptr noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef, i64 noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @__bswap_64(i64 noundef) #7

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @__bswap_32(i32 noundef) #7

; Function Attrs: noreturn nounwind
declare void @abort() #5

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

declare i32 @lsqpack_dec_header_in(ptr noundef, ptr noundef, i64 noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, 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 i32 @munmap(ptr noundef, i64 noundef) #2

declare i32 @close(i32 noundef) #3

declare void @lsqpack_dec_cleanup(ptr noundef) #3

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

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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 willreturn memory(none) "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 = { inlinehint nounwind willreturn memory(read) 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 #7 = { inlinehint 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 #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(none) }
attributes #10 = { noreturn nounwind }
attributes #11 = { nounwind willreturn memory(read) }

!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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !10, i64 0}
!14 = !{!"", !10, i64 0}
!15 = !{!16, !17, i64 48}
!16 = !{!"stat", !17, i64 0, !17, i64 8, !17, i64 16, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !17, i64 40, !17, i64 48, !17, i64 56, !17, i64 64, !18, i64 72, !18, i64 88, !18, i64 104, !7, i64 120}
!17 = !{!"long", !7, i64 0}
!18 = !{!"timespec", !17, i64 0, !17, i64 8}
!19 = !{!17, !17, i64 0}
!20 = distinct !{!20, !12}
!21 = !{!22, !10, i64 0}
!22 = !{!"header", !23, i64 0, !24, i64 16, !7, i64 56}
!23 = !{!"", !10, i64 0, !10, i64 8}
!24 = !{!"lsxpack_header", !10, i64 0, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !25, i64 24, !25, i64 26, !25, i64 28, !7, i64 30, !7, i64 31, !7, i64 32, !6, i64 33, !7, i64 34, !7, i64 35}
!25 = !{!"short", !7, i64 0}
!26 = !{!22, !10, i64 8}
!27 = distinct !{!27, !12}


; 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.anon.6 = type { ptr }
%struct.lsqpack_dec_hset_if = type { ptr, ptr, ptr }
%struct.lsqpack_dec = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, %struct.lsqpack_ringbuf, %struct.anon, [8 x %struct.anon.0], i32, float, %struct.anon.1, %struct.lsqpack_dec_err }
%struct.lsqpack_ringbuf = type { i32, i32, i32, ptr }
%struct.anon = type { ptr, ptr }
%struct.anon.0 = type { ptr, ptr }
%struct.anon.1 = type { i32, %union.anon }
%union.anon = type { %struct.anon.2 }
%struct.anon.2 = type { %struct.lsqpack_dec_int_state, %struct.lsqpack_huff_decode_state, i32, i32, ptr, ptr, ptr, i32, i32, i32, i32, i8, i8 }
%struct.lsqpack_dec_int_state = type { i32, i32, i32, i64 }
%struct.lsqpack_huff_decode_state = type { i32, %struct.lsqpack_decode_status }
%struct.lsqpack_decode_status = type { i8, i8 }
%struct.lsqpack_dec_err = type { i32, i32, i64, i64 }
%struct.stat = type { i64, i64, i64, i32, i32, i32, i32, i64, i64, i64, i64, %struct.timespec, %struct.timespec, %struct.timespec, [3 x i64] }
%struct.timespec = type { i64, i64 }

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@optarg = external local_unnamed_addr global ptr, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [34 x i8], align 1
@s_headers = external dso_local local_unnamed_addr global %struct.anon.6, align 8
@hset_if = external hidden constant %struct.lsqpack_dec_hset_if, align 8
@.str.2 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: noreturn nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca %struct.lsqpack_dec, align 8
  %4 = alloca %struct.stat, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 352, ptr nonnull %3) #13
  call void @llvm.lifetime.start.p0(i64 144, ptr nonnull %4) #13
  br label %.outer

.outer:                                           ; preds = %31, %2
  %.087.ph = phi i32 [ %33, %31 ], [ 0, %2 ]
  %.084.ph = phi i32 [ %.084.ph196, %31 ], [ 0, %2 ]
  %.082.ph = phi i32 [ %.082.ph200, %31 ], [ 0, %2 ]
  %.0.ph = phi i32 [ %.0, %31 ], [ -1, %2 ]
  br label %.outer195

.outer195:                                        ; preds = %.outer, %34
  %.084.ph196 = phi i32 [ %.084.ph, %.outer ], [ %36, %34 ]
  %.082.ph197 = phi i32 [ %.082.ph, %.outer ], [ %.082.ph200, %34 ]
  %.0.ph198 = phi i32 [ %.0.ph, %.outer ], [ %.0, %34 ]
  br label %.outer199

.outer199:                                        ; preds = %.outer195, %20
  %.082.ph200 = phi i32 [ %.082.ph197, %.outer195 ], [ %22, %20 ]
  %.0.ph201 = phi i32 [ %.0.ph198, %.outer195 ], [ %.0, %20 ]
  br label %7

7:                                                ; preds = %.outer199, %9
  %.0 = phi i32 [ %11, %9 ], [ %.0.ph201, %.outer199 ]
  %8 = tail call i32 @getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str) #13
  switch i32 %8, label %39 [
    i32 -1, label %40
    i32 105, label %9
    i32 102, label %20
    i32 115, label %31
    i32 116, label %34
    i32 104, label %37
  ]

9:                                                ; preds = %7
  %10 = load ptr, ptr @optarg, align 8, !tbaa !5
  %11 = tail call i32 (ptr, i32, ...) @open(ptr noundef %10, i32 noundef 0) #13
  %12 = icmp slt i32 %11, 0
  br i1 %12, label %13, label %7, !llvm.loop !9

13:                                               ; preds = %9
  %14 = load ptr, ptr @stderr, align 8, !tbaa !5
  %15 = load ptr, ptr @optarg, align 8, !tbaa !5
  %16 = tail call ptr @__errno_location() #14
  %17 = load i32, ptr %16, align 4, !tbaa !11
  %18 = tail call ptr @strerror(i32 noundef %17) #13
  %19 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %14, ptr noundef nonnull @.str.1, ptr noundef %15, ptr noundef %18) #15
  tail call void @exit(i32 noundef 1) #16
  unreachable

20:                                               ; preds = %7
  %21 = load ptr, ptr @optarg, align 8, !tbaa !5
  %22 = tail call i32 (ptr, i32, ...) @open(ptr noundef %21, i32 noundef 0) #13
  %23 = icmp slt i32 %22, 0
  br i1 %23, label %24, label %.outer199, !llvm.loop !9

24:                                               ; preds = %20
  %25 = load ptr, ptr @stderr, align 8, !tbaa !5
  %26 = load ptr, ptr @optarg, align 8, !tbaa !5
  %27 = tail call ptr @__errno_location() #14
  %28 = load i32, ptr %27, align 4, !tbaa !11
  %29 = tail call ptr @strerror(i32 noundef %28) #13
  %30 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef nonnull @.str.1, ptr noundef %26, ptr noundef %29) #15
  tail call void @exit(i32 noundef 1) #16
  unreachable

31:                                               ; preds = %7
  %32 = load ptr, ptr @optarg, align 8, !tbaa !5
  %33 = tail call i32 @atoi(ptr nocapture noundef %32) #17
  br label %.outer, !llvm.loop !9

34:                                               ; preds = %7
  %35 = load ptr, ptr @optarg, align 8, !tbaa !5
  %36 = tail call i32 @atoi(ptr nocapture noundef %35) #17
  br label %.outer195, !llvm.loop !9

37:                                               ; preds = %7
  %38 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @usage(ptr noundef %38)
  tail call void @exit(i32 noundef 0) #16
  unreachable

39:                                               ; preds = %7
  tail call void @exit(i32 noundef 1) #16
  unreachable

40:                                               ; preds = %7
  store ptr null, ptr @s_headers, align 8, !tbaa !13
  call void @lsqpack_dec_init(ptr noundef nonnull %3, ptr noundef null, i32 noundef %.084.ph196, i32 noundef %.087.ph, ptr noundef nonnull @hset_if, i32 noundef 0) #13
  %41 = icmp slt i32 %.0, 0
  br i1 %41, label %42, label %45

42:                                               ; preds = %40
  %43 = load ptr, ptr @stderr, align 8, !tbaa !5
  %44 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %43, ptr noundef nonnull @.str.2) #15
  call void @exit(i32 noundef 1) #16
  unreachable

45:                                               ; preds = %40
  %46 = call i32 @fstat(i32 noundef %.0, ptr noundef nonnull %4) #13
  %.not102 = icmp eq i32 %46, 0
  br i1 %.not102, label %48, label %47

47:                                               ; preds = %45
  call void @perror(ptr noundef nonnull @.str.3) #18
  call void @exit(i32 noundef 1) #16
  unreachable

48:                                               ; preds = %45
  %49 = getelementptr inbounds i8, ptr %4, i64 48
  %50 = load i64, ptr %49, align 8, !tbaa !15
  %51 = call ptr @mmap(ptr noundef null, i64 noundef %50, i32 noundef 1, i32 noundef 2, i32 noundef %.0, i64 noundef 0) #13
  %.not103 = icmp eq ptr %51, null
  br i1 %.not103, label %52, label %53

52:                                               ; preds = %48
  call void @perror(ptr noundef nonnull @.str.4) #18
  call void @exit(i32 noundef 1) #16
  unreachable

53:                                               ; preds = %48
  %54 = getelementptr inbounds i8, ptr %51, i64 %50
  %55 = icmp sgt i64 %50, 12
  br i1 %55, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %53
  %56 = getelementptr inbounds i8, ptr %51, i64 12
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %88
  %57 = phi ptr [ %89, %88 ], [ %56, %.lr.ph.preheader ]
  %.086130 = phi ptr [ %64, %88 ], [ %51, %.lr.ph.preheader ]
  %58 = getelementptr inbounds i8, ptr %.086130, i64 8
  %59 = load i64, ptr %.086130, align 8, !tbaa !19
  %60 = load i32, ptr %58, align 4, !tbaa !11
  %61 = call i64 @__bswap_64(i64 noundef %59)
  %62 = call i32 @__bswap_32(i32 noundef %60)
  %63 = zext i32 %62 to i64
  %64 = getelementptr inbounds i8, ptr %57, i64 %63
  %65 = icmp ugt ptr %64, %54
  br i1 %65, label %66, label %73

66:                                               ; preds = %.lr.ph
  %67 = load ptr, ptr @stderr, align 8, !tbaa !5
  %68 = ptrtoint ptr %57 to i64
  %69 = ptrtoint ptr %51 to i64
  %70 = sub i64 %68, %69
  %71 = trunc i64 %70 to i32
  %72 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.5, i32 noundef %71) #15
  call void @abort() #16
  unreachable

73:                                               ; preds = %.lr.ph
  %74 = icmp eq i64 %61, 0
  br i1 %74, label %75, label %78

75:                                               ; preds = %73
  %76 = call i32 @lsqpack_dec_enc_in(ptr noundef nonnull %3, ptr noundef nonnull %57, i64 noundef %63) #13
  %.not110 = icmp eq i32 %76, 0
  br i1 %.not110, label %88, label %77

77:                                               ; preds = %75
  call void @abort() #16
  unreachable

78:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #13
  store ptr %57, ptr %5, align 8, !tbaa !5
  %79 = call i32 @lsqpack_dec_header_in(ptr noundef nonnull %3, ptr noundef null, i64 noundef %61, i64 noundef %63, ptr noundef nonnull %5, i64 noundef %63, ptr noundef null, ptr noundef null) #13
  %.not108 = icmp eq i32 %79, 0
  br i1 %.not108, label %80, label %86

80:                                               ; preds = %78
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = ptrtoint ptr %81 to i64
  %83 = ptrtoint ptr %57 to i64
  %84 = sub i64 %82, %83
  %85 = trunc i64 %84 to i32
  %.not109 = icmp eq i32 %62, %85
  br i1 %.not109, label %87, label %86

86:                                               ; preds = %80, %78
  call void @abort() #16
  unreachable

87:                                               ; preds = %80
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #13
  br label %88

88:                                               ; preds = %75, %87
  %89 = getelementptr inbounds i8, ptr %64, i64 12
  %90 = icmp ult ptr %89, %54
  br i1 %90, label %.lr.ph, label %._crit_edge, !llvm.loop !20

._crit_edge:                                      ; preds = %88, %53
  %91 = call i32 @munmap(ptr noundef nonnull %51, i64 noundef %50) #13
  %92 = call i32 @close(i32 noundef %.0) #13
  %93 = call i32 @fstat(i32 noundef %.082.ph200, ptr noundef nonnull %4) #13
  %.not104 = icmp eq i32 %93, 0
  br i1 %.not104, label %95, label %94

94:                                               ; preds = %._crit_edge
  call void @perror(ptr noundef nonnull @.str.3) #18
  call void @exit(i32 noundef 1) #16
  unreachable

95:                                               ; preds = %._crit_edge
  %96 = load i64, ptr %49, align 8, !tbaa !15
  %97 = call ptr @mmap(ptr noundef null, i64 noundef %96, i32 noundef 1, i32 noundef 2, i32 noundef %.082.ph200, i64 noundef 0) #13
  %.not105 = icmp eq ptr %97, null
  br i1 %.not105, label %98, label %99

98:                                               ; preds = %95
  call void @perror(ptr noundef nonnull @.str.4) #18
  call void @exit(i32 noundef 1) #16
  unreachable

99:                                               ; preds = %95
  %100 = getelementptr inbounds i8, ptr %97, i64 12
  %101 = icmp sgt i64 %96, 12
  br i1 %101, label %102, label %121

102:                                              ; preds = %99
  %103 = getelementptr inbounds i8, ptr %97, i64 8
  %104 = load i64, ptr %97, align 8, !tbaa !19
  %105 = load i32, ptr %103, align 4, !tbaa !11
  %106 = call i64 @__bswap_64(i64 noundef %104)
  %107 = call i32 @__bswap_32(i32 noundef %105)
  %108 = icmp eq i64 %106, 0
  br i1 %108, label %109, label %115

109:                                              ; preds = %102
  %110 = trunc i64 %96 to i32
  %111 = add i32 %110, -12
  %112 = call i32 @llvm.umin.i32(i32 %107, i32 %111)
  %113 = zext i32 %112 to i64
  %114 = call i32 @lsqpack_dec_enc_in(ptr noundef nonnull %3, ptr noundef nonnull %100, i64 noundef %113) #13
  br label %121

115:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #13
  store ptr %100, ptr %6, align 8, !tbaa !5
  %116 = trunc i64 %96 to i32
  %117 = add i32 %116, -12
  %118 = call i32 @llvm.umin.i32(i32 %107, i32 %117)
  %119 = zext i32 %118 to i64
  %120 = call i32 @lsqpack_dec_header_in(ptr noundef nonnull %3, ptr noundef null, i64 noundef %106, i64 noundef %119, ptr noundef nonnull %6, i64 noundef %119, ptr noundef null, ptr noundef null) #13
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #13
  br label %121

121:                                              ; preds = %109, %115, %99
  %122 = call i32 @munmap(ptr noundef nonnull %97, i64 noundef %96) #13
  %123 = call i32 @close(i32 noundef %.082.ph200) #13
  call void @lsqpack_dec_cleanup(ptr noundef nonnull %3) #13
  %124 = load ptr, ptr @s_headers, align 8, !tbaa !13
  %.not106131 = icmp eq ptr %124, null
  br i1 %.not106131, label %._crit_edge134, label %.lr.ph133

.lr.ph133:                                        ; preds = %121, %.lr.ph133._crit_edge
  %125 = phi ptr [ %129, %.lr.ph133._crit_edge ], [ %124, %121 ]
  %126 = load ptr, ptr %125, align 8, !tbaa !21
  %.not107 = icmp eq ptr %126, null
  %.phi.trans.insert = getelementptr inbounds i8, ptr %125, i64 8
  %.pre = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !26
  br i1 %.not107, label %.lr.ph133._crit_edge, label %127

127:                                              ; preds = %.lr.ph133
  %128 = getelementptr inbounds i8, ptr %126, i64 8
  store ptr %.pre, ptr %128, align 8, !tbaa !26
  br label %.lr.ph133._crit_edge

.lr.ph133._crit_edge:                             ; preds = %.lr.ph133, %127
  store ptr %126, ptr %.pre, align 8, !tbaa !5
  call void @free(ptr noundef nonnull %125) #13
  %129 = load ptr, ptr @s_headers, align 8, !tbaa !13
  %.not106 = icmp eq ptr %129, null
  br i1 %.not106, label %._crit_edge134, label %.lr.ph133, !llvm.loop !27

._crit_edge134:                                   ; preds = %.lr.ph133._crit_edge, %121
  call void @exit(i32 noundef 0) #16
  unreachable
}

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

; Function Attrs: nounwind
declare i32 @getopt(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree
declare noundef i32 @open(ptr nocapture noundef readonly, i32 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: nounwind
declare ptr @strerror(i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #5

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

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #7

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

declare void @lsqpack_dec_init(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #9

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

; Function Attrs: nofree nounwind
declare void @perror(ptr nocapture noundef readonly) local_unnamed_addr #4

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @__bswap_64(i64 noundef) local_unnamed_addr #10

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @__bswap_32(i32 noundef) local_unnamed_addr #10

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #6

declare i32 @lsqpack_dec_enc_in(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #9

declare i32 @lsqpack_dec_header_in(ptr noundef, ptr noundef, i64 noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #9

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

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

declare i32 @close(i32 noundef) local_unnamed_addr #9

declare void @lsqpack_dec_cleanup(ptr noundef) local_unnamed_addr #9

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #11

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #12

attributes #0 = { noreturn 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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree "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 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 = { 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 #7 = { inlinehint mustprogress nofree nounwind willreturn memory(read) 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 #8 = { 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 #9 = { "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 #10 = { inlinehint 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 #11 = { 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 #12 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #13 = { nounwind }
attributes #14 = { nounwind willreturn memory(none) }
attributes #15 = { cold nounwind }
attributes #16 = { noreturn nounwind }
attributes #17 = { nounwind willreturn memory(read) }
attributes #18 = { cold }

!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/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"", !6, i64 0}
!15 = !{!16, !17, i64 48}
!16 = !{!"stat", !17, i64 0, !17, i64 8, !17, i64 16, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !17, i64 40, !17, i64 48, !17, i64 56, !17, i64 64, !18, i64 72, !18, i64 88, !18, i64 104, !7, i64 120}
!17 = !{!"long", !7, i64 0}
!18 = !{!"timespec", !17, i64 0, !17, i64 8}
!19 = !{!17, !17, i64 0}
!20 = distinct !{!20, !10}
!21 = !{!22, !6, i64 0}
!22 = !{!"header", !23, i64 0, !24, i64 16, !7, i64 56}
!23 = !{!"", !6, i64 0, !6, i64 8}
!24 = !{!"lsxpack_header", !6, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !25, i64 24, !25, i64 26, !25, i64 28, !7, i64 30, !7, i64 31, !7, i64 32, !12, i64 33, !7, i64 34, !7, i64 35}
!25 = !{!"short", !7, i64 0}
!26 = !{!22, !6, i64 8}
!27 = distinct !{!27, !10}


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