; LLVM IR from litespeedtech/ls-qpack :: bin (interop-encode)

; 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.lsqpack_enc = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.lsqpack_enc_head, ptr, %struct.anon, %struct.anon.0, %struct.anon.1, %struct.anon.2, %struct.anon.3, i32, i32, ptr, float, float, ptr, i32, i32, i32 }
%struct.lsqpack_enc_head = type { ptr, ptr }
%struct.anon = type { ptr, ptr }
%struct.anon.0 = type { ptr, ptr }
%struct.anon.1 = type { ptr, ptr }
%struct.anon.2 = type { ptr, ptr, i32, i32, i32, i32 }
%struct.anon.3 = type { %struct.lsqpack_dec_int_state, ptr }
%struct.lsqpack_dec_int_state = type { i32, i32, i32, i64 }
%struct.lsxpack_header = type { ptr, i32, i32, i32, i32, i16, i16, i16, i8, i8, i8, i8, i8, i8 }

@stdin = external global ptr, align 8
@stdout = external global ptr, align 8
@.str = external hidden unnamed_addr constant [19 x i8], align 1
@optarg = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@stderr = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [34 x i8], align 1
@s_verbose = external hidden global i32, align 4
@.str.6 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [77 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [23 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [22 x i8], align 1
@s_saved_ins_count = external hidden global i32, align 4
@.str.12 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [12 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 ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %struct.lsqpack_enc, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca [4096 x i8], align 16
  %30 = alloca [6 x i8], align 1
  %31 = alloca i64, align 8
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca %struct.lsxpack_header, align 8
  %35 = alloca [4096 x i8], align 16
  %36 = alloca [4096 x i8], align 16
  %37 = alloca [32 x i8], align 16
  %38 = alloca i64, align 8
  %39 = alloca i64, 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 8, ptr %6) #9
  %40 = load ptr, ptr @stdin, align 8, !tbaa !9
  store ptr %40, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #9
  %41 = load ptr, ptr @stdout, align 8, !tbaa !9
  store ptr %41, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #9
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #9
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #9
  call void @llvm.lifetime.start.p0(i64 240, ptr %13) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #9
  store i32 0, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #9
  store i32 0, ptr %27, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #9
  store i32 0, ptr %28, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4096, ptr %29) #9
  call void @llvm.lifetime.start.p0(i64 6, ptr %30) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #9
  store i32 0, ptr %33, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 40, ptr %34) #9
  call void @llvm.lifetime.start.p0(i64 4096, ptr %35) #9
  call void @llvm.lifetime.start.p0(i64 4096, ptr %36) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr %37) #9
  br label %42

42:                                               ; preds = %121, %2
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = load ptr, ptr %5, align 8, !tbaa !9
  %45 = call i32 @getopt(i32 noundef %43, ptr noundef %44, ptr noundef @.str) #9
  store i32 %45, ptr %8, align 4, !tbaa !5
  %46 = icmp ne i32 -1, %45
  br i1 %46, label %47, label %122

47:                                               ; preds = %42
  %48 = load i32, ptr %8, align 4, !tbaa !5
  switch i32 %48, label %120 [
    i32 83, label %49
    i32 68, label %52
    i32 65, label %55
    i32 77, label %58
    i32 110, label %61
    i32 97, label %64
    i32 105, label %70
    i32 111, label %88
    i32 115, label %106
    i32 116, label %109
    i32 104, label %112
    i32 102, label %116
    i32 118, label %117
  ]

49:                                               ; preds = %47
  %50 = load i32, ptr %19, align 4, !tbaa !5
  %51 = or i32 %50, 1
  store i32 %51, ptr %19, align 4, !tbaa !5
  br label %121

52:                                               ; preds = %47
  %53 = load i32, ptr %19, align 4, !tbaa !5
  %54 = or i32 %53, 4
  store i32 %54, ptr %19, align 4, !tbaa !5
  br label %121

55:                                               ; preds = %47
  %56 = load i32, ptr %19, align 4, !tbaa !5
  %57 = or i32 %56, 8
  store i32 %57, ptr %19, align 4, !tbaa !5
  br label %121

58:                                               ; preds = %47
  %59 = load i32, ptr %19, align 4, !tbaa !5
  %60 = or i32 %59, 16
  store i32 %60, ptr %19, align 4, !tbaa !5
  br label %121

61:                                               ; preds = %47
  %62 = load i32, ptr %28, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %28, align 4, !tbaa !5
  br label %121

64:                                               ; preds = %47
  %65 = load ptr, ptr @optarg, align 8, !tbaa !9
  %66 = call i32 @atoi(ptr noundef %65) #10
  %67 = icmp ne i32 %66, 0
  %68 = zext i1 %67 to i64
  %69 = select i1 %67, i32 1, i32 0
  store i32 %69, ptr %27, align 4, !tbaa !5
  br label %121

70:                                               ; preds = %47
  %71 = load ptr, ptr @optarg, align 8, !tbaa !9
  %72 = call i32 @strcmp(ptr noundef %71, ptr noundef @.str.1) #10
  %73 = icmp ne i32 0, %72
  br i1 %73, label %74, label %87

74:                                               ; preds = %70
  %75 = load ptr, ptr @optarg, align 8, !tbaa !9
  %76 = call noalias ptr @fopen(ptr noundef %75, ptr noundef @.str.2)
  store ptr %76, ptr %6, align 8, !tbaa !9
  %77 = load ptr, ptr %6, align 8, !tbaa !9
  %78 = icmp ne ptr %77, null
  br i1 %78, label %86, label %79

79:                                               ; preds = %74
  %80 = load ptr, ptr @stderr, align 8, !tbaa !9
  %81 = load ptr, ptr @optarg, align 8, !tbaa !9
  %82 = call ptr @__errno_location() #11
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = call ptr @strerror(i32 noundef %83) #9
  %85 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %80, ptr noundef @.str.3, ptr noundef %81, ptr noundef %84) #9
  call void @exit(i32 noundef 1) #12
  unreachable

86:                                               ; preds = %74
  br label %87

87:                                               ; preds = %86, %70
  br label %121

88:                                               ; preds = %47
  %89 = load ptr, ptr @optarg, align 8, !tbaa !9
  %90 = call i32 @strcmp(ptr noundef %89, ptr noundef @.str.1) #10
  %91 = icmp ne i32 0, %90
  br i1 %91, label %92, label %105

92:                                               ; preds = %88
  %93 = load ptr, ptr @optarg, align 8, !tbaa !9
  %94 = call noalias ptr @fopen(ptr noundef %93, ptr noundef @.str.4)
  store ptr %94, ptr %7, align 8, !tbaa !9
  %95 = load ptr, ptr %7, align 8, !tbaa !9
  %96 = icmp ne ptr %95, null
  br i1 %96, label %104, label %97

97:                                               ; preds = %92
  %98 = load ptr, ptr @stderr, align 8, !tbaa !9
  %99 = load ptr, ptr @optarg, align 8, !tbaa !9
  %100 = call ptr @__errno_location() #11
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = call ptr @strerror(i32 noundef %101) #9
  %103 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %98, ptr noundef @.str.5, ptr noundef %99, ptr noundef %102) #9
  call void @exit(i32 noundef 1) #12
  unreachable

104:                                              ; preds = %92
  br label %105

105:                                              ; preds = %104, %88
  br label %121

106:                                              ; preds = %47
  %107 = load ptr, ptr @optarg, align 8, !tbaa !9
  %108 = call i32 @atoi(ptr noundef %107) #10
  store i32 %108, ptr %10, align 4, !tbaa !5
  br label %121

109:                                              ; preds = %47
  %110 = load ptr, ptr @optarg, align 8, !tbaa !9
  %111 = call i32 @atoi(ptr noundef %110) #10
  store i32 %111, ptr %9, align 4, !tbaa !5
  br label %121

112:                                              ; preds = %47
  %113 = load ptr, ptr %5, align 8, !tbaa !9
  %114 = getelementptr inbounds ptr, ptr %113, i64 0
  %115 = load ptr, ptr %114, align 8, !tbaa !9
  call void @usage(ptr noundef %115)
  call void @exit(i32 noundef 0) #12
  unreachable

116:                                              ; preds = %47
  store i32 1, ptr %33, align 4, !tbaa !5
  br label %121

117:                                              ; preds = %47
  %118 = load i32, ptr @s_verbose, align 4, !tbaa !5
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr @s_verbose, align 4, !tbaa !5
  br label %121

120:                                              ; preds = %47
  call void @exit(i32 noundef 1) #12
  unreachable

121:                                              ; preds = %117, %116, %109, %106, %105, %87, %64, %61, %58, %55, %52, %49
  br label %42, !llvm.loop !11

122:                                              ; preds = %42
  store i64 6, ptr %31, align 8, !tbaa !13
  %123 = load i32, ptr @s_verbose, align 4, !tbaa !5
  %124 = icmp ne i32 %123, 0
  br i1 %124, label %125, label %127

125:                                              ; preds = %122
  %126 = load ptr, ptr @stderr, align 8, !tbaa !9
  br label %128

127:                                              ; preds = %122
  br label %128

128:                                              ; preds = %127, %125
  %129 = phi ptr [ %126, %125 ], [ null, %127 ]
  %130 = load i32, ptr %9, align 4, !tbaa !5
  %131 = load i32, ptr %9, align 4, !tbaa !5
  %132 = load i32, ptr %10, align 4, !tbaa !5
  %133 = load i32, ptr %19, align 4, !tbaa !5
  %134 = getelementptr inbounds [6 x i8], ptr %30, i64 0, i64 0
  %135 = call i32 @lsqpack_enc_init(ptr noundef %13, ptr noundef %129, i32 noundef %130, i32 noundef %131, i32 noundef %132, i32 noundef %133, ptr noundef %134, ptr noundef %31)
  %136 = icmp ne i32 0, %135
  br i1 %136, label %137, label %138

137:                                              ; preds = %128
  call void @perror(ptr noundef @.str.6)
  call void @exit(i32 noundef 1) #12
  unreachable

138:                                              ; preds = %128
  store i32 0, ptr %11, align 4, !tbaa !5
  store i32 0, ptr %12, align 4, !tbaa !5
  store i64 0, ptr %22, align 8, !tbaa !13
  store i64 0, ptr %23, align 8, !tbaa !13
  store i32 0, ptr %24, align 4, !tbaa !5
  br label %139

139:                                              ; preds = %430, %338, %281, %272, %138
  %140 = getelementptr inbounds [4096 x i8], ptr %29, i64 0, i64 0
  %141 = load ptr, ptr %6, align 8, !tbaa !9
  %142 = call ptr @fgets(ptr noundef %140, i32 noundef 4096, ptr noundef %141)
  store ptr %142, ptr %14, align 8, !tbaa !9
  %143 = load ptr, ptr %14, align 8, !tbaa !9
  %144 = icmp ne ptr %143, null
  br i1 %144, label %145, label %437

145:                                              ; preds = %139
  %146 = load i32, ptr %11, align 4, !tbaa !5
  %147 = add i32 %146, 1
  store i32 %147, ptr %11, align 4, !tbaa !5
  %148 = load ptr, ptr %14, align 8, !tbaa !9
  %149 = call ptr @strchr(ptr noundef %148, i32 noundef 10) #10
  store ptr %149, ptr %15, align 8, !tbaa !9
  %150 = load ptr, ptr %15, align 8, !tbaa !9
  %151 = icmp ne ptr %150, null
  br i1 %151, label %156, label %152

152:                                              ; preds = %145
  %153 = load ptr, ptr @stderr, align 8, !tbaa !9
  %154 = load i32, ptr %11, align 4, !tbaa !5
  %155 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %153, ptr noundef @.str.7, i32 noundef %154) #9
  call void @exit(i32 noundef 1) #12
  unreachable

156:                                              ; preds = %145
  %157 = load ptr, ptr %15, align 8, !tbaa !9
  store i8 0, ptr %157, align 1, !tbaa !15
  %158 = load ptr, ptr %15, align 8, !tbaa !9
  %159 = load ptr, ptr %14, align 8, !tbaa !9
  %160 = icmp eq ptr %158, %159
  br i1 %160, label %161, label %273

161:                                              ; preds = %156
  %162 = load i32, ptr %24, align 4, !tbaa !5
  %163 = icmp ne i32 %162, 0
  br i1 %163, label %164, label %272

164:                                              ; preds = %161
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #9
  store i64 32, ptr %39, align 8, !tbaa !13
  %165 = load i32, ptr %33, align 4, !tbaa !5
  %166 = icmp ne i32 %165, 0
  br i1 %166, label %167, label %169

167:                                              ; preds = %164
  %168 = load i64, ptr %39, align 8, !tbaa !13
  br label %170

169:                                              ; preds = %164
  br label %170

170:                                              ; preds = %169, %167
  %171 = phi i64 [ %168, %167 ], [ 0, %169 ]
  store i64 %171, ptr %38, align 8, !tbaa !13
  br label %172

172:                                              ; preds = %194, %170
  %173 = load i64, ptr %38, align 8, !tbaa !13
  %174 = load i64, ptr %39, align 8, !tbaa !13
  %175 = icmp ule i64 %173, %174
  br i1 %175, label %176, label %197

176:                                              ; preds = %172
  %177 = getelementptr inbounds [32 x i8], ptr %37, i64 0, i64 0
  %178 = load i64, ptr %38, align 8, !tbaa !13
  %179 = call i64 @lsqpack_enc_end_header(ptr noundef %13, ptr noundef %177, i64 noundef %178, ptr noundef %32)
  store i64 %179, ptr %17, align 8, !tbaa !13
  %180 = load i64, ptr %17, align 8, !tbaa !13
  %181 = icmp sgt i64 %180, 0
  br i1 %181, label %182, label %193

182:                                              ; preds = %176
  %183 = load i32, ptr %10, align 4, !tbaa !5
  %184 = icmp eq i32 %183, 0
  br i1 %184, label %185, label %192

185:                                              ; preds = %182
  %186 = load i32, ptr %32, align 4, !tbaa !5
  %187 = and i32 %186, 1
  %188 = icmp ne i32 %187, 0
  br i1 %188, label %190, label %189

189:                                              ; preds = %185
  br label %191

190:                                              ; preds = %185
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.9, i32 noundef 375, ptr noundef @__PRETTY_FUNCTION__.main) #12
  unreachable

191:                                              ; preds = %189
  br label %192

192:                                              ; preds = %191, %182
  br label %197

193:                                              ; preds = %176
  br label %194

194:                                              ; preds = %193
  %195 = load i64, ptr %38, align 8, !tbaa !13
  %196 = add i64 %195, 1
  store i64 %196, ptr %38, align 8, !tbaa !13
  br label %172, !llvm.loop !16

197:                                              ; preds = %192, %172
  %198 = load i64, ptr %17, align 8, !tbaa !13
  %199 = call i64 @lsqpack_enc_header_block_prefix_size(ptr noundef %13)
  %200 = icmp ule i64 %198, %199
  br i1 %200, label %201, label %202

201:                                              ; preds = %197
  br label %203

202:                                              ; preds = %197
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.9, i32 noundef 379, ptr noundef @__PRETTY_FUNCTION__.main) #12
  unreachable

203:                                              ; preds = %201
  %204 = load i64, ptr %17, align 8, !tbaa !13
  %205 = icmp slt i64 %204, 0
  br i1 %205, label %206, label %212

206:                                              ; preds = %203
  %207 = load ptr, ptr @stderr, align 8, !tbaa !9
  %208 = call ptr @__errno_location() #11
  %209 = load i32, ptr %208, align 4, !tbaa !5
  %210 = call ptr @strerror(i32 noundef %209) #9
  %211 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %207, ptr noundef @.str.11, ptr noundef %210) #9
  call void @exit(i32 noundef 1) #12
  unreachable

212:                                              ; preds = %203
  %213 = load i32, ptr %27, align 4, !tbaa !5
  %214 = icmp eq i32 %213, 1
  br i1 %214, label %215, label %255

215:                                              ; preds = %212
  %216 = load i64, ptr %17, align 8, !tbaa !13
  %217 = icmp eq i64 2, %216
  br i1 %217, label %218, label %228

218:                                              ; preds = %215
  %219 = getelementptr inbounds [32 x i8], ptr %37, i64 0, i64 0
  %220 = load i8, ptr %219, align 16, !tbaa !15
  %221 = zext i8 %220 to i32
  %222 = icmp eq i32 %221, 0
  br i1 %222, label %223, label %228

223:                                              ; preds = %218
  %224 = getelementptr inbounds [32 x i8], ptr %37, i64 0, i64 1
  %225 = load i8, ptr %224, align 1, !tbaa !15
  %226 = zext i8 %225 to i32
  %227 = icmp eq i32 %226, 0
  br i1 %227, label %232, label %228

228:                                              ; preds = %223, %218, %215
  %229 = load i32, ptr %12, align 4, !tbaa !5
  %230 = zext i32 %229 to i64
  %231 = call i32 @ack_stream(ptr noundef %13, i64 noundef %230)
  store i32 %231, ptr %25, align 4, !tbaa !5
  br label %233

232:                                              ; preds = %223
  store i32 0, ptr %25, align 4, !tbaa !5
  br label %233

233:                                              ; preds = %232, %228
  %234 = load i32, ptr %25, align 4, !tbaa !5
  %235 = icmp eq i32 %234, 0
  br i1 %235, label %236, label %243

236:                                              ; preds = %233
  %237 = getelementptr inbounds %struct.lsqpack_enc, ptr %13, i32 0, i32 0
  %238 = load i32, ptr %237, align 8, !tbaa !17
  %239 = load i32, ptr @s_saved_ins_count, align 4, !tbaa !5
  %240 = icmp ugt i32 %238, %239
  br i1 %240, label %241, label %243

241:                                              ; preds = %236
  %242 = call i32 @ack_last_entry_id(ptr noundef %13)
  store i32 %242, ptr %25, align 4, !tbaa !5
  br label %244

243:                                              ; preds = %236, %233
  store i32 0, ptr %25, align 4, !tbaa !5
  br label %244

244:                                              ; preds = %243, %241
  %245 = load i32, ptr %25, align 4, !tbaa !5
  %246 = icmp ne i32 %245, 0
  br i1 %246, label %247, label %254

247:                                              ; preds = %244
  %248 = load ptr, ptr @stderr, align 8, !tbaa !9
  %249 = load i32, ptr %12, align 4, !tbaa !5
  %250 = call ptr @__errno_location() #11
  %251 = load i32, ptr %250, align 4, !tbaa !5
  %252 = call ptr @strerror(i32 noundef %251) #9
  %253 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %248, ptr noundef @.str.12, i32 noundef %249, ptr noundef %252) #9
  call void @exit(i32 noundef 1) #12
  unreachable

254:                                              ; preds = %244
  br label %255

255:                                              ; preds = %254, %212
  %256 = load i32, ptr @s_verbose, align 4, !tbaa !5
  %257 = icmp ne i32 %256, 0
  br i1 %257, label %258, label %263

258:                                              ; preds = %255
  %259 = load ptr, ptr @stderr, align 8, !tbaa !9
  %260 = call float @lsqpack_enc_ratio(ptr noundef %13)
  %261 = fpext float %260 to double
  %262 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %259, ptr noundef @.str.13, double noundef %261) #9
  br label %263

263:                                              ; preds = %258, %255
  %264 = load ptr, ptr %7, align 8, !tbaa !9
  %265 = load i32, ptr %12, align 4, !tbaa !5
  %266 = getelementptr inbounds [4096 x i8], ptr %35, i64 0, i64 0
  %267 = load i64, ptr %22, align 8, !tbaa !13
  %268 = getelementptr inbounds [32 x i8], ptr %37, i64 0, i64 0
  %269 = load i64, ptr %17, align 8, !tbaa !13
  %270 = getelementptr inbounds [4096 x i8], ptr %36, i64 0, i64 0
  %271 = load i64, ptr %23, align 8, !tbaa !13
  call void @write_enc_and_header_streams(ptr noundef %264, i32 noundef %265, ptr noundef %266, i64 noundef %267, ptr noundef %268, i64 noundef %269, ptr noundef %270, i64 noundef %271)
  store i64 0, ptr %22, align 8, !tbaa !13
  store i64 0, ptr %23, align 8, !tbaa !13
  store i32 0, ptr %24, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #9
  br label %272

272:                                              ; preds = %263, %161
  br label %139, !llvm.loop !25

273:                                              ; preds = %156
  %274 = load ptr, ptr %14, align 8, !tbaa !9
  %275 = load i8, ptr %274, align 1, !tbaa !15
  %276 = sext i8 %275 to i32
  %277 = icmp eq i32 %276, 35
  br i1 %277, label %278, label %339

278:                                              ; preds = %273
  %279 = load i32, ptr %28, align 4, !tbaa !5
  %280 = icmp ne i32 %279, 0
  br i1 %280, label %282, label %281

281:                                              ; preds = %278
  br label %139, !llvm.loop !25

282:                                              ; preds = %278
  %283 = load i32, ptr %27, align 4, !tbaa !5
  %284 = icmp ne i32 %283, 1
  br i1 %284, label %285, label %299

285:                                              ; preds = %282
  %286 = load ptr, ptr %14, align 8, !tbaa !9
  %287 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %286, ptr noundef @.str.14, ptr noundef %26) #9
  %288 = icmp eq i32 1, %287
  br i1 %288, label %289, label %299

289:                                              ; preds = %285
  %290 = load i32, ptr %26, align 4, !tbaa !5
  %291 = zext i32 %290 to i64
  %292 = call i32 @ack_stream(ptr noundef %13, i64 noundef %291)
  %293 = icmp ne i32 0, %292
  br i1 %293, label %294, label %298

294:                                              ; preds = %289
  %295 = load ptr, ptr @stderr, align 8, !tbaa !9
  %296 = load i32, ptr %26, align 4, !tbaa !5
  %297 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %295, ptr noundef @.str.15, i32 noundef %296) #9
  call void @exit(i32 noundef 1) #12
  unreachable

298:                                              ; preds = %289
  br label %338

299:                                              ; preds = %285, %282
  %300 = load ptr, ptr %14, align 8, !tbaa !9
  %301 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %300, ptr noundef @.str.16, ptr noundef %26) #9
  %302 = icmp eq i32 1, %301
  br i1 %302, label %303, label %307

303:                                              ; preds = %299
  %304 = load i32, ptr %26, align 4, !tbaa !5
  %305 = zext i32 %304 to i64
  %306 = call i32 @sync_table(ptr noundef %13, i64 noundef %305)
  br label %337

307:                                              ; preds = %299
  %308 = load ptr, ptr %14, align 8, !tbaa !9
  %309 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %308, ptr noundef @.str.17, ptr noundef %26) #9
  %310 = icmp eq i32 1, %309
  br i1 %310, label %311, label %315

311:                                              ; preds = %307
  %312 = load i32, ptr %26, align 4, !tbaa !5
  %313 = zext i32 %312 to i64
  %314 = call i32 @cancel_stream(ptr noundef %13, i64 noundef %313)
  br label %336

315:                                              ; preds = %307
  %316 = load ptr, ptr %14, align 8, !tbaa !9
  %317 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %316, ptr noundef @.str.18, ptr noundef %26) #9
  %318 = icmp eq i32 1, %317
  br i1 %318, label %319, label %335

319:                                              ; preds = %315
  store i64 6, ptr %31, align 8, !tbaa !13
  %320 = load i32, ptr %26, align 4, !tbaa !5
  %321 = getelementptr inbounds [6 x i8], ptr %30, i64 0, i64 0
  %322 = call i32 @lsqpack_enc_set_max_capacity(ptr noundef %13, i32 noundef %320, ptr noundef %321, ptr noundef %31)
  %323 = icmp ne i32 0, %322
  br i1 %323, label %324, label %331

324:                                              ; preds = %319
  %325 = load ptr, ptr @stderr, align 8, !tbaa !9
  %326 = load i32, ptr %26, align 4, !tbaa !5
  %327 = call ptr @__errno_location() #11
  %328 = load i32, ptr %327, align 4, !tbaa !5
  %329 = call ptr @strerror(i32 noundef %328) #9
  %330 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %325, ptr noundef @.str.19, i32 noundef %326, ptr noundef %329) #9
  call void @exit(i32 noundef 1) #12
  unreachable

331:                                              ; preds = %319
  %332 = load ptr, ptr %7, align 8, !tbaa !9
  %333 = getelementptr inbounds [6 x i8], ptr %30, i64 0, i64 0
  %334 = load i64, ptr %31, align 8, !tbaa !13
  call void @write_enc_stream(ptr noundef %332, ptr noundef %333, i64 noundef %334)
  br label %335

335:                                              ; preds = %331, %315
  br label %336

336:                                              ; preds = %335, %311
  br label %337

337:                                              ; preds = %336, %303
  br label %338

338:                                              ; preds = %337, %298
  br label %139, !llvm.loop !25

339:                                              ; preds = %273
  %340 = load ptr, ptr %14, align 8, !tbaa !9
  %341 = call ptr @strchr(ptr noundef %340, i32 noundef 9) #10
  store ptr %341, ptr %16, align 8, !tbaa !9
  %342 = load ptr, ptr %16, align 8, !tbaa !9
  %343 = icmp ne ptr %342, null
  br i1 %343, label %348, label %344

344:                                              ; preds = %339
  %345 = load ptr, ptr @stderr, align 8, !tbaa !9
  %346 = load i32, ptr %11, align 4, !tbaa !5
  %347 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %345, ptr noundef @.str.20, i32 noundef %346) #9
  call void @exit(i32 noundef 1) #12
  unreachable

348:                                              ; preds = %339
  %349 = load i32, ptr %24, align 4, !tbaa !5
  %350 = icmp ne i32 %349, 0
  br i1 %350, label %365, label %351

351:                                              ; preds = %348
  %352 = load i32, ptr %12, align 4, !tbaa !5
  %353 = add i32 %352, 1
  store i32 %353, ptr %12, align 4, !tbaa !5
  %354 = load i32, ptr %12, align 4, !tbaa !5
  %355 = zext i32 %354 to i64
  %356 = call i32 @lsqpack_enc_start_header(ptr noundef %13, i64 noundef %355, i32 noundef 0)
  %357 = icmp ne i32 0, %356
  br i1 %357, label %358, label %364

358:                                              ; preds = %351
  %359 = load ptr, ptr @stderr, align 8, !tbaa !9
  %360 = call ptr @__errno_location() #11
  %361 = load i32, ptr %360, align 4, !tbaa !5
  %362 = call ptr @strerror(i32 noundef %361) #9
  %363 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %359, ptr noundef @.str.21, ptr noundef %362) #9
  call void @exit(i32 noundef 1) #12
  unreachable

364:                                              ; preds = %351
  store i32 1, ptr %24, align 4, !tbaa !5
  br label %365

365:                                              ; preds = %364, %348
  %366 = load i32, ptr %33, align 4, !tbaa !5
  %367 = icmp ne i32 %366, 0
  br i1 %367, label %368, label %373

368:                                              ; preds = %365
  %369 = load i64, ptr %22, align 8, !tbaa !13
  %370 = sub i64 4096, %369
  store i64 %370, ptr %20, align 8, !tbaa !13
  %371 = load i64, ptr %23, align 8, !tbaa !13
  %372 = sub i64 4096, %371
  store i64 %372, ptr %21, align 8, !tbaa !13
  br label %374

373:                                              ; preds = %365
  store i64 0, ptr %20, align 8, !tbaa !13
  store i64 0, ptr %21, align 8, !tbaa !13
  br label %374

374:                                              ; preds = %373, %368
  br label %375

375:                                              ; preds = %429, %374
  br label %376

376:                                              ; preds = %375
  %377 = load ptr, ptr %14, align 8, !tbaa !9
  %378 = load ptr, ptr %16, align 8, !tbaa !9
  %379 = load ptr, ptr %14, align 8, !tbaa !9
  %380 = ptrtoint ptr %378 to i64
  %381 = ptrtoint ptr %379 to i64
  %382 = sub i64 %380, %381
  %383 = load ptr, ptr %16, align 8, !tbaa !9
  %384 = getelementptr inbounds i8, ptr %383, i64 1
  %385 = load ptr, ptr %14, align 8, !tbaa !9
  %386 = ptrtoint ptr %384 to i64
  %387 = ptrtoint ptr %385 to i64
  %388 = sub i64 %386, %387
  %389 = load ptr, ptr %15, align 8, !tbaa !9
  %390 = load ptr, ptr %16, align 8, !tbaa !9
  %391 = ptrtoint ptr %389 to i64
  %392 = ptrtoint ptr %390 to i64
  %393 = sub i64 %391, %392
  %394 = sub nsw i64 %393, 1
  call void @lsxpack_header_set_offset2(ptr noundef %34, ptr noundef %377, i64 noundef 0, i64 noundef %382, i64 noundef %388, i64 noundef %394)
  %395 = getelementptr inbounds [4096 x i8], ptr %35, i64 0, i64 0
  %396 = load i64, ptr %22, align 8, !tbaa !13
  %397 = getelementptr inbounds i8, ptr %395, i64 %396
  %398 = getelementptr inbounds [4096 x i8], ptr %36, i64 0, i64 0
  %399 = load i64, ptr %23, align 8, !tbaa !13
  %400 = getelementptr inbounds i8, ptr %398, i64 %399
  %401 = call i32 @lsqpack_enc_encode(ptr noundef %13, ptr noundef %397, ptr noundef %20, ptr noundef %400, ptr noundef %21, ptr noundef %34, i32 noundef 0)
  store i32 %401, ptr %18, align 4, !tbaa !5
  %402 = load i32, ptr %18, align 4, !tbaa !5
  switch i32 %402, label %423 [
    i32 1, label %403
    i32 2, label %413
  ]

403:                                              ; preds = %376
  %404 = load i64, ptr %20, align 8, !tbaa !13
  %405 = load i64, ptr %22, align 8, !tbaa !13
  %406 = sub i64 4096, %405
  %407 = icmp ult i64 %404, %406
  br i1 %407, label %408, label %411

408:                                              ; preds = %403
  %409 = load i64, ptr %20, align 8, !tbaa !13
  %410 = add i64 %409, 1
  store i64 %410, ptr %20, align 8, !tbaa !13
  br label %412

411:                                              ; preds = %403
  call void @__assert_fail(ptr noundef @.str.22, ptr noundef @.str.9, i32 noundef 491, ptr noundef @__PRETTY_FUNCTION__.main) #12
  unreachable

412:                                              ; preds = %408
  br label %429

413:                                              ; preds = %376
  %414 = load i64, ptr %21, align 8, !tbaa !13
  %415 = load i64, ptr %23, align 8, !tbaa !13
  %416 = sub i64 4096, %415
  %417 = icmp ult i64 %414, %416
  br i1 %417, label %418, label %421

418:                                              ; preds = %413
  %419 = load i64, ptr %21, align 8, !tbaa !13
  %420 = add i64 %419, 1
  store i64 %420, ptr %21, align 8, !tbaa !13
  br label %422

421:                                              ; preds = %413
  call void @__assert_fail(ptr noundef @.str.22, ptr noundef @.str.9, i32 noundef 497, ptr noundef @__PRETTY_FUNCTION__.main) #12
  unreachable

422:                                              ; preds = %418
  br label %429

423:                                              ; preds = %376
  %424 = load i32, ptr %18, align 4, !tbaa !5
  %425 = icmp eq i32 %424, 0
  br i1 %425, label %426, label %427

426:                                              ; preds = %423
  br label %428

427:                                              ; preds = %423
  call void @__assert_fail(ptr noundef @.str.23, ptr noundef @.str.9, i32 noundef 500, ptr noundef @__PRETTY_FUNCTION__.main) #12
  unreachable

428:                                              ; preds = %426
  br label %430

429:                                              ; preds = %422, %412
  br label %375

430:                                              ; preds = %428
  %431 = load i64, ptr %20, align 8, !tbaa !13
  %432 = load i64, ptr %22, align 8, !tbaa !13
  %433 = add i64 %432, %431
  store i64 %433, ptr %22, align 8, !tbaa !13
  %434 = load i64, ptr %21, align 8, !tbaa !13
  %435 = load i64, ptr %23, align 8, !tbaa !13
  %436 = add i64 %435, %434
  store i64 %436, ptr %23, align 8, !tbaa !13
  br label %139, !llvm.loop !25

437:                                              ; preds = %139
  %438 = load i32, ptr @s_verbose, align 4, !tbaa !5
  %439 = icmp ne i32 %438, 0
  br i1 %439, label %440, label %443

440:                                              ; preds = %437
  %441 = load ptr, ptr @stderr, align 8, !tbaa !9
  %442 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %441, ptr noundef @.str.24) #9
  br label %443

443:                                              ; preds = %440, %437
  %444 = load ptr, ptr %6, align 8, !tbaa !9
  %445 = call i32 @fclose(ptr noundef %444)
  %446 = load i32, ptr %24, align 4, !tbaa !5
  %447 = icmp ne i32 %446, 0
  br i1 %447, label %448, label %520

448:                                              ; preds = %443
  %449 = load i32, ptr @s_verbose, align 4, !tbaa !5
  %450 = icmp ne i32 %449, 0
  br i1 %450, label %451, label %454

451:                                              ; preds = %448
  %452 = load ptr, ptr @stderr, align 8, !tbaa !9
  %453 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %452, ptr noundef @.str.25) #9
  br label %454

454:                                              ; preds = %451, %448
  %455 = getelementptr inbounds [32 x i8], ptr %37, i64 0, i64 0
  %456 = call i64 @lsqpack_enc_end_header(ptr noundef %13, ptr noundef %455, i64 noundef 32, ptr noundef %32)
  store i64 %456, ptr %17, align 8, !tbaa !13
  %457 = load i64, ptr %17, align 8, !tbaa !13
  %458 = icmp slt i64 %457, 0
  br i1 %458, label %459, label %465

459:                                              ; preds = %454
  %460 = load ptr, ptr @stderr, align 8, !tbaa !9
  %461 = call ptr @__errno_location() #11
  %462 = load i32, ptr %461, align 4, !tbaa !5
  %463 = call ptr @strerror(i32 noundef %462) #9
  %464 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %460, ptr noundef @.str.11, ptr noundef %463) #9
  call void @exit(i32 noundef 1) #12
  unreachable

465:                                              ; preds = %454
  %466 = load i32, ptr %10, align 4, !tbaa !5
  %467 = icmp eq i32 %466, 0
  br i1 %467, label %468, label %475

468:                                              ; preds = %465
  %469 = load i32, ptr %32, align 4, !tbaa !5
  %470 = and i32 %469, 1
  %471 = icmp ne i32 %470, 0
  br i1 %471, label %473, label %472

472:                                              ; preds = %468
  br label %474

473:                                              ; preds = %468
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.9, i32 noundef 536, ptr noundef @__PRETTY_FUNCTION__.main) #12
  unreachable

474:                                              ; preds = %472
  br label %475

475:                                              ; preds = %474, %465
  %476 = load i32, ptr %27, align 4, !tbaa !5
  %477 = icmp eq i32 %476, 1
  br i1 %477, label %478, label %503

478:                                              ; preds = %475
  %479 = load i64, ptr %17, align 8, !tbaa !13
  %480 = icmp eq i64 2, %479
  br i1 %480, label %481, label %491

481:                                              ; preds = %478
  %482 = getelementptr inbounds [32 x i8], ptr %37, i64 0, i64 0
  %483 = load i8, ptr %482, align 16, !tbaa !15
  %484 = zext i8 %483 to i32
  %485 = icmp eq i32 %484, 0
  br i1 %485, label %486, label %491

486:                                              ; preds = %481
  %487 = getelementptr inbounds [32 x i8], ptr %37, i64 0, i64 1
  %488 = load i8, ptr %487, align 1, !tbaa !15
  %489 = zext i8 %488 to i32
  %490 = icmp eq i32 %489, 0
  br i1 %490, label %503, label %491

491:                                              ; preds = %486, %481, %478
  %492 = load i32, ptr %12, align 4, !tbaa !5
  %493 = zext i32 %492 to i64
  %494 = call i32 @ack_stream(ptr noundef %13, i64 noundef %493)
  %495 = icmp ne i32 0, %494
  br i1 %495, label %496, label %503

496:                                              ; preds = %491
  %497 = load ptr, ptr @stderr, align 8, !tbaa !9
  %498 = load i32, ptr %12, align 4, !tbaa !5
  %499 = call ptr @__errno_location() #11
  %500 = load i32, ptr %499, align 4, !tbaa !5
  %501 = call ptr @strerror(i32 noundef %500) #9
  %502 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %497, ptr noundef @.str.12, i32 noundef %498, ptr noundef %501) #9
  call void @exit(i32 noundef 1) #12
  unreachable

503:                                              ; preds = %491, %486, %475
  %504 = load i32, ptr @s_verbose, align 4, !tbaa !5
  %505 = icmp ne i32 %504, 0
  br i1 %505, label %506, label %511

506:                                              ; preds = %503
  %507 = load ptr, ptr @stderr, align 8, !tbaa !9
  %508 = call float @lsqpack_enc_ratio(ptr noundef %13)
  %509 = fpext float %508 to double
  %510 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %507, ptr noundef @.str.13, double noundef %509) #9
  br label %511

511:                                              ; preds = %506, %503
  %512 = load ptr, ptr %7, align 8, !tbaa !9
  %513 = load i32, ptr %12, align 4, !tbaa !5
  %514 = getelementptr inbounds [4096 x i8], ptr %35, i64 0, i64 0
  %515 = load i64, ptr %22, align 8, !tbaa !13
  %516 = getelementptr inbounds [32 x i8], ptr %37, i64 0, i64 0
  %517 = load i64, ptr %17, align 8, !tbaa !13
  %518 = getelementptr inbounds [4096 x i8], ptr %36, i64 0, i64 0
  %519 = load i64, ptr %23, align 8, !tbaa !13
  call void @write_enc_and_header_streams(ptr noundef %512, i32 noundef %513, ptr noundef %514, i64 noundef %515, ptr noundef %516, i64 noundef %517, ptr noundef %518, i64 noundef %519)
  br label %520

520:                                              ; preds = %511, %443
  call void @lsqpack_enc_cleanup(ptr noundef %13)
  %521 = load ptr, ptr %7, align 8, !tbaa !9
  %522 = call i32 @fclose(ptr noundef %521)
  %523 = icmp ne i32 0, %522
  br i1 %523, label %524, label %525

524:                                              ; preds = %520
  call void @perror(ptr noundef @.str.26)
  call void @exit(i32 noundef 1) #12
  unreachable

525:                                              ; preds = %520
  call void @exit(i32 noundef 0) #12
  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

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #4

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

; 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() #6

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

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

declare i32 @lsqpack_enc_init(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) #5

declare void @perror(ptr noundef) #5

declare ptr @fgets(ptr noundef, i32 noundef, ptr noundef) #5

; Function Attrs: nounwind willreturn memory(read)
declare ptr @strchr(ptr noundef, i32 noundef) #4

declare i64 @lsqpack_enc_end_header(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #5

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #7

declare i64 @lsqpack_enc_header_block_prefix_size(ptr noundef) #5

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

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

declare float @lsqpack_enc_ratio(ptr noundef) #5

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

; 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 @__isoc99_sscanf(ptr noundef, ptr noundef, ...) #2

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

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

declare i32 @lsqpack_enc_set_max_capacity(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #5

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

declare i32 @lsqpack_enc_start_header(ptr noundef, i64 noundef, i32 noundef) #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @lsxpack_header_set_offset2(ptr noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef) #8

declare i32 @lsqpack_enc_encode(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #5

declare i32 @fclose(ptr noundef) #5

declare void @lsqpack_enc_cleanup(ptr noundef) #5

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !12}
!17 = !{!18, !6, i64 0}
!18 = !{!"lsqpack_enc", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52, !19, i64 56, !10, i64 72, !20, i64 80, !20, i64 96, !20, i64 112, !21, i64 128, !22, i64 160, !6, i64 192, !6, i64 196, !10, i64 200, !24, i64 208, !24, i64 212, !10, i64 216, !6, i64 224, !6, i64 228, !6, i64 232}
!19 = !{!"lsqpack_enc_head", !10, i64 0, !10, i64 8}
!20 = !{!"", !10, i64 0, !10, i64 8}
!21 = !{!"", !10, i64 0, !10, i64 8, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28}
!22 = !{!"", !23, i64 0, !10, i64 24}
!23 = !{!"lsqpack_dec_int_state", !6, i64 0, !6, i64 4, !6, i64 8, !14, i64 16}
!24 = !{!"float", !7, i64 0}
!25 = distinct !{!25, !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.lsqpack_enc = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.lsqpack_enc_head, ptr, %struct.anon, %struct.anon.0, %struct.anon.1, %struct.anon.2, %struct.anon.3, i32, i32, ptr, float, float, ptr, i32, i32, i32 }
%struct.lsqpack_enc_head = type { ptr, ptr }
%struct.anon = type { ptr, ptr }
%struct.anon.0 = type { ptr, ptr }
%struct.anon.1 = type { ptr, ptr }
%struct.anon.2 = type { ptr, ptr, i32, i32, i32, i32 }
%struct.anon.3 = type { %struct.lsqpack_dec_int_state, ptr }
%struct.lsqpack_dec_int_state = type { i32, i32, i32, i64 }
%struct.lsxpack_header = type { ptr, i32, i32, i32, i32, i16, i16, i16, i8, i8, i8, i8, i8, i8 }

@stdin = external local_unnamed_addr global ptr, align 8
@stdout = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [19 x i8], align 1
@optarg = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [34 x i8], align 1
@s_verbose = external hidden local_unnamed_addr global i32, align 4
@.str.6 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [77 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [23 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [22 x i8], align 1
@s_saved_ins_count = external hidden local_unnamed_addr global i32, align 4
@.str.12 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [12 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_enc, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca [4096 x i8], align 16
  %8 = alloca [6 x i8], align 1
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca %struct.lsxpack_header, align 8
  %12 = alloca [4096 x i8], align 16
  %13 = alloca [4096 x i8], align 16
  %14 = alloca [32 x i8], align 16
  %15 = load ptr, ptr @stdin, align 8, !tbaa !5
  %16 = load ptr, ptr @stdout, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 240, ptr nonnull %3) #11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #11
  call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %7) #11
  call void @llvm.lifetime.start.p0(i64 6, ptr nonnull %8) #11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #11
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %11) #11
  call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %12) #11
  call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %13) #11
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %14) #11
  br label %17

17:                                               ; preds = %.backedge846, %2
  %.0130 = phi i32 [ 0, %2 ], [ %.0130.be, %.backedge846 ]
  %.0128 = phi i32 [ 0, %2 ], [ %.0128.be, %.backedge846 ]
  %.0123 = phi ptr [ %16, %2 ], [ %.0123.be, %.backedge846 ]
  %.0121 = phi i32 [ 0, %2 ], [ %.0121.be, %.backedge846 ]
  %.0111 = phi i32 [ 0, %2 ], [ %.0111.be, %.backedge846 ]
  %.0109 = phi i32 [ 0, %2 ], [ %.0109.be, %.backedge846 ]
  %.0107 = phi i32 [ 0, %2 ], [ %.0107.be, %.backedge846 ]
  %.0 = phi ptr [ %15, %2 ], [ %.0.be, %.backedge846 ]
  %18 = tail call i32 @getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str) #11
  switch i32 %18, label %68 [
    i32 -1, label %69
    i32 83, label %19
    i32 68, label %21
    i32 65, label %23
    i32 77, label %25
    i32 110, label %27
    i32 97, label %29
    i32 105, label %33
    i32 111, label %45
    i32 115, label %57
    i32 116, label %60
    i32 104, label %63
    i32 102, label %.backedge846
    i32 118, label %65
  ]

.backedge846:                                     ; preds = %17, %45, %48, %33, %36, %65, %60, %57, %29, %27, %25, %23, %21, %19
  %.0130.be = phi i32 [ %.0130, %65 ], [ %.0130, %60 ], [ %59, %57 ], [ %.0130, %48 ], [ %.0130, %45 ], [ %.0130, %36 ], [ %.0130, %33 ], [ %.0130, %29 ], [ %.0130, %27 ], [ %.0130, %25 ], [ %.0130, %23 ], [ %.0130, %21 ], [ %.0130, %19 ], [ %.0130, %17 ]
  %.0128.be = phi i32 [ %.0128, %65 ], [ %62, %60 ], [ %.0128, %57 ], [ %.0128, %48 ], [ %.0128, %45 ], [ %.0128, %36 ], [ %.0128, %33 ], [ %.0128, %29 ], [ %.0128, %27 ], [ %.0128, %25 ], [ %.0128, %23 ], [ %.0128, %21 ], [ %.0128, %19 ], [ %.0128, %17 ]
  %.0123.be = phi ptr [ %.0123, %65 ], [ %.0123, %60 ], [ %.0123, %57 ], [ %49, %48 ], [ %.0123, %45 ], [ %.0123, %36 ], [ %.0123, %33 ], [ %.0123, %29 ], [ %.0123, %27 ], [ %.0123, %25 ], [ %.0123, %23 ], [ %.0123, %21 ], [ %.0123, %19 ], [ %.0123, %17 ]
  %.0121.be = phi i32 [ %.0121, %65 ], [ %.0121, %60 ], [ %.0121, %57 ], [ %.0121, %48 ], [ %.0121, %45 ], [ %.0121, %36 ], [ %.0121, %33 ], [ %.0121, %29 ], [ %.0121, %27 ], [ %26, %25 ], [ %24, %23 ], [ %22, %21 ], [ %20, %19 ], [ %.0121, %17 ]
  %.0111.be = phi i32 [ %.0111, %65 ], [ %.0111, %60 ], [ %.0111, %57 ], [ %.0111, %48 ], [ %.0111, %45 ], [ %.0111, %36 ], [ %.0111, %33 ], [ %32, %29 ], [ %.0111, %27 ], [ %.0111, %25 ], [ %.0111, %23 ], [ %.0111, %21 ], [ %.0111, %19 ], [ %.0111, %17 ]
  %.0109.be = phi i32 [ %.0109, %65 ], [ %.0109, %60 ], [ %.0109, %57 ], [ %.0109, %48 ], [ %.0109, %45 ], [ %.0109, %36 ], [ %.0109, %33 ], [ %.0109, %29 ], [ %28, %27 ], [ %.0109, %25 ], [ %.0109, %23 ], [ %.0109, %21 ], [ %.0109, %19 ], [ %.0109, %17 ]
  %.0107.be = phi i32 [ %.0107, %65 ], [ %.0107, %60 ], [ %.0107, %57 ], [ %.0107, %48 ], [ %.0107, %45 ], [ %.0107, %36 ], [ %.0107, %33 ], [ %.0107, %29 ], [ %.0107, %27 ], [ %.0107, %25 ], [ %.0107, %23 ], [ %.0107, %21 ], [ %.0107, %19 ], [ 1, %17 ]
  %.0.be = phi ptr [ %.0, %65 ], [ %.0, %60 ], [ %.0, %57 ], [ %.0, %48 ], [ %.0, %45 ], [ %37, %36 ], [ %.0, %33 ], [ %.0, %29 ], [ %.0, %27 ], [ %.0, %25 ], [ %.0, %23 ], [ %.0, %21 ], [ %.0, %19 ], [ %.0, %17 ]
  br label %17, !llvm.loop !9

19:                                               ; preds = %17
  %20 = or i32 %.0121, 1
  br label %.backedge846

21:                                               ; preds = %17
  %22 = or i32 %.0121, 4
  br label %.backedge846

23:                                               ; preds = %17
  %24 = or i32 %.0121, 8
  br label %.backedge846

25:                                               ; preds = %17
  %26 = or i32 %.0121, 16
  br label %.backedge846

27:                                               ; preds = %17
  %28 = add i32 %.0109, 1
  br label %.backedge846

29:                                               ; preds = %17
  %30 = load ptr, ptr @optarg, align 8, !tbaa !5
  %31 = tail call i32 @atoi(ptr nocapture noundef %30) #12
  %.not175 = icmp ne i32 %31, 0
  %32 = zext i1 %.not175 to i32
  br label %.backedge846

33:                                               ; preds = %17
  %34 = load ptr, ptr @optarg, align 8, !tbaa !5
  %35 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %34, ptr noundef nonnull dereferenceable(1) @.str.1) #12
  %.not173 = icmp eq i32 %35, 0
  br i1 %.not173, label %.backedge846, label %36

36:                                               ; preds = %33
  %37 = tail call noalias ptr @fopen(ptr noundef %34, ptr noundef nonnull @.str.2)
  %.not174 = icmp eq ptr %37, null
  br i1 %.not174, label %38, label %.backedge846

38:                                               ; preds = %36
  %39 = load ptr, ptr @stderr, align 8, !tbaa !5
  %40 = load ptr, ptr @optarg, align 8, !tbaa !5
  %41 = tail call ptr @__errno_location() #13
  %42 = load i32, ptr %41, align 4, !tbaa !11
  %43 = tail call ptr @strerror(i32 noundef %42) #11
  %44 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef nonnull @.str.3, ptr noundef %40, ptr noundef %43) #14
  tail call void @exit(i32 noundef 1) #15
  unreachable

45:                                               ; preds = %17
  %46 = load ptr, ptr @optarg, align 8, !tbaa !5
  %47 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %46, ptr noundef nonnull dereferenceable(1) @.str.1) #12
  %.not171 = icmp eq i32 %47, 0
  br i1 %.not171, label %.backedge846, label %48

48:                                               ; preds = %45
  %49 = tail call noalias ptr @fopen(ptr noundef %46, ptr noundef nonnull @.str.4)
  %.not172 = icmp eq ptr %49, null
  br i1 %.not172, label %50, label %.backedge846

50:                                               ; preds = %48
  %51 = load ptr, ptr @stderr, align 8, !tbaa !5
  %52 = load ptr, ptr @optarg, align 8, !tbaa !5
  %53 = tail call ptr @__errno_location() #13
  %54 = load i32, ptr %53, align 4, !tbaa !11
  %55 = tail call ptr @strerror(i32 noundef %54) #11
  %56 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %51, ptr noundef nonnull @.str.5, ptr noundef %52, ptr noundef %55) #14
  tail call void @exit(i32 noundef 1) #15
  unreachable

57:                                               ; preds = %17
  %58 = load ptr, ptr @optarg, align 8, !tbaa !5
  %59 = tail call i32 @atoi(ptr nocapture noundef %58) #12
  br label %.backedge846

60:                                               ; preds = %17
  %61 = load ptr, ptr @optarg, align 8, !tbaa !5
  %62 = tail call i32 @atoi(ptr nocapture noundef %61) #12
  br label %.backedge846

63:                                               ; preds = %17
  %64 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @usage(ptr noundef %64)
  tail call void @exit(i32 noundef 0) #15
  unreachable

65:                                               ; preds = %17
  %66 = load i32, ptr @s_verbose, align 4, !tbaa !11
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr @s_verbose, align 4, !tbaa !11
  br label %.backedge846

68:                                               ; preds = %17
  tail call void @exit(i32 noundef 1) #15
  unreachable

69:                                               ; preds = %17
  store i64 6, ptr %9, align 8, !tbaa !13
  %70 = load i32, ptr @s_verbose, align 4, !tbaa !11
  %.not146 = icmp eq i32 %70, 0
  %71 = load ptr, ptr @stderr, align 8
  %72 = select i1 %.not146, ptr null, ptr %71
  %73 = call i32 @lsqpack_enc_init(ptr noundef nonnull %3, ptr noundef %72, i32 noundef %.0128, i32 noundef %.0128, i32 noundef %.0130, i32 noundef %.0121, ptr noundef nonnull %8, ptr noundef nonnull %9) #11
  %.not147 = icmp eq i32 %73, 0
  br i1 %.not147, label %.preheader, label %78

.preheader:                                       ; preds = %69
  %74 = call ptr @fgets(ptr noundef nonnull %7, i32 noundef 4096, ptr noundef %.0)
  %.not148282308322 = icmp eq ptr %74, null
  br i1 %.not148282308322, label %.outer180._crit_edge, label %.lr.ph.lr.ph.lr.ph

.lr.ph.lr.ph.lr.ph:                               ; preds = %.preheader
  %.not161 = icmp eq i32 %.0109, 0
  %.not162.not = icmp eq i32 %.0111, 0
  %.not166 = icmp eq i32 %.0107, 0
  %75 = select i1 %.not166, i64 0, i64 32
  %76 = icmp eq i32 %.0130, 0
  %77 = getelementptr inbounds i8, ptr %14, i64 1
  br label %.lr.ph.lr.ph

78:                                               ; preds = %69
  call void @perror(ptr noundef nonnull @.str.6) #16
  call void @exit(i32 noundef 1) #15
  unreachable

.lr.ph.split:                                     ; preds = %.lr.ph, %.backedge
  %79 = phi ptr [ %188, %.backedge ], [ %134, %.lr.ph ]
  %.0132283 = phi i32 [ %80, %.backedge ], [ %.0132.ph181309, %.lr.ph ]
  %80 = add i32 %.0132283, 1
  %81 = call ptr @strchr(ptr noundef nonnull dereferenceable(1) %79, i32 noundef 10) #12
  %.not156 = icmp eq ptr %81, null
  br i1 %.not156, label %.split, label %84

.split:                                           ; preds = %.lr.ph.split, %.lr.ph.split.us
  %.us-phi = phi i32 [ %136, %.lr.ph.split.us ], [ %80, %.lr.ph.split ]
  %82 = load ptr, ptr @stderr, align 8, !tbaa !5
  %83 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %82, ptr noundef nonnull @.str.7, i32 noundef %.us-phi) #14
  call void @exit(i32 noundef 1) #15
  unreachable

84:                                               ; preds = %.lr.ph.split
  store i8 0, ptr %81, align 1, !tbaa !15
  %85 = icmp eq ptr %81, %79
  br i1 %85, label %.split292, label %144

.split292:                                        ; preds = %84, %138
  %.us-phi293 = phi i32 [ %136, %138 ], [ %80, %84 ]
  %.not165 = icmp eq i32 %.0115.ph185313, 0
  br i1 %.not165, label %.outer180, label %.preheader333

86:                                               ; preds = %.preheader333
  %87 = add nuw nsw i64 %.0106307, 1
  %exitcond.not = icmp eq i64 %87, 33
  br i1 %exitcond.not, label %.loopexit, label %.preheader333, !llvm.loop !16

.preheader333:                                    ; preds = %.split292, %86
  %.0106307 = phi i64 [ %87, %86 ], [ %75, %.split292 ]
  %88 = call i64 @lsqpack_enc_end_header(ptr noundef nonnull %3, ptr noundef nonnull %14, i64 noundef %.0106307, ptr noundef nonnull %10) #11
  %89 = icmp sgt i64 %88, 0
  br i1 %89, label %90, label %86

90:                                               ; preds = %.preheader333
  br i1 %76, label %91, label %.loopexit

91:                                               ; preds = %90
  %92 = load i32, ptr %10, align 4, !tbaa !11
  %93 = and i32 %92, 1
  %.not167 = icmp eq i32 %93, 0
  br i1 %.not167, label %.loopexit, label %94

94:                                               ; preds = %91
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.9, i32 noundef 375, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #15
  unreachable

.loopexit:                                        ; preds = %86, %90, %91
  %95 = call i64 @lsqpack_enc_header_block_prefix_size(ptr noundef nonnull %3) #11
  %.not168 = icmp ugt i64 %88, %95
  br i1 %.not168, label %96, label %97

96:                                               ; preds = %.loopexit
  call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.9, i32 noundef 379, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #15
  unreachable

97:                                               ; preds = %.loopexit
  %98 = icmp slt i64 %88, 0
  br i1 %98, label %99, label %105

99:                                               ; preds = %97
  %100 = load ptr, ptr @stderr, align 8, !tbaa !5
  %101 = tail call ptr @__errno_location() #13
  %102 = load i32, ptr %101, align 4, !tbaa !11
  %103 = call ptr @strerror(i32 noundef %102) #11
  %104 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %100, ptr noundef nonnull @.str.11, ptr noundef %103) #14
  call void @exit(i32 noundef 1) #15
  unreachable

105:                                              ; preds = %97
  br i1 %.not162.not, label %.thread177, label %106

106:                                              ; preds = %105
  %107 = icmp eq i64 %88, 2
  %108 = load i8, ptr %14, align 16
  %109 = icmp eq i8 %108, 0
  %or.cond = select i1 %107, i1 %109, i1 false
  %110 = load i8, ptr %77, align 1
  %111 = icmp eq i8 %110, 0
  %or.cond7 = select i1 %or.cond, i1 %111, i1 false
  br i1 %or.cond7, label %.thread, label %112

112:                                              ; preds = %106
  %113 = call i32 @ack_stream(ptr noundef nonnull %3, i64 noundef %242)
  %114 = icmp eq i32 %113, 0
  br i1 %114, label %.thread, label %.thread177

.thread:                                          ; preds = %106, %112
  %115 = load i32, ptr %3, align 8, !tbaa !17
  %116 = load i32, ptr @s_saved_ins_count, align 4, !tbaa !11
  %117 = icmp ugt i32 %115, %116
  br i1 %117, label %118, label %.thread177

118:                                              ; preds = %.thread
  %119 = call i32 @ack_last_entry_id(ptr noundef nonnull %3)
  %.not169 = icmp eq i32 %119, 0
  br i1 %.not169, label %.thread177, label %120

120:                                              ; preds = %118
  %121 = load ptr, ptr @stderr, align 8, !tbaa !5
  %122 = tail call ptr @__errno_location() #13
  %123 = load i32, ptr %122, align 4, !tbaa !11
  %124 = call ptr @strerror(i32 noundef %123) #11
  %125 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %121, ptr noundef nonnull @.str.12, i32 noundef %.0133.ph323, ptr noundef %124) #14
  call void @exit(i32 noundef 1) #15
  unreachable

.thread177:                                       ; preds = %112, %.thread, %118, %105
  %126 = load i32, ptr @s_verbose, align 4, !tbaa !11
  %.not170 = icmp eq i32 %126, 0
  br i1 %.not170, label %132, label %127

127:                                              ; preds = %.thread177
  %128 = load ptr, ptr @stderr, align 8, !tbaa !5
  %129 = call float @lsqpack_enc_ratio(ptr noundef nonnull %3) #11
  %130 = fpext float %129 to double
  %131 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %128, ptr noundef nonnull @.str.13, double noundef %130) #14
  br label %132

132:                                              ; preds = %127, %.thread177
  call void @write_enc_and_header_streams(ptr noundef %.0123, i32 noundef %.0133.ph323, ptr noundef nonnull %12, i64 noundef %.0119.ph183311, ptr noundef nonnull %14, i64 noundef %88, ptr noundef nonnull %13, i64 noundef %.0117.ph184312)
  br label %.outer180

.outer180:                                        ; preds = %132, %.split292
  %.1120 = phi i64 [ 0, %132 ], [ %.0119.ph183311, %.split292 ]
  %.1118 = phi i64 [ 0, %132 ], [ %.0117.ph184312, %.split292 ]
  %133 = call ptr @fgets(ptr noundef nonnull %7, i32 noundef 4096, ptr noundef %.0)
  %.not148282 = icmp eq ptr %133, null
  br i1 %.not148282, label %.outer180._crit_edge, label %.lr.ph, !llvm.loop !25

.lr.ph:                                           ; preds = %.lr.ph.lr.ph, %.outer180
  %134 = phi ptr [ %241, %.lr.ph.lr.ph ], [ %133, %.outer180 ]
  %.0115.ph185313 = phi i32 [ %.0115.ph328, %.lr.ph.lr.ph ], [ 0, %.outer180 ]
  %.0117.ph184312 = phi i64 [ %.0117.ph327, %.lr.ph.lr.ph ], [ %.1118, %.outer180 ]
  %.0119.ph183311 = phi i64 [ %.0119.ph326, %.lr.ph.lr.ph ], [ %.1120, %.outer180 ]
  %.0132.ph181309 = phi i32 [ %.0132.ph324, %.lr.ph.lr.ph ], [ %.us-phi293, %.outer180 ]
  br i1 %.not161, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %.backedge.us
  %135 = phi ptr [ %143, %.backedge.us ], [ %134, %.lr.ph ]
  %.0132283.us = phi i32 [ %136, %.backedge.us ], [ %.0132.ph181309, %.lr.ph ]
  %136 = add i32 %.0132283.us, 1
  %137 = call ptr @strchr(ptr noundef nonnull dereferenceable(1) %135, i32 noundef 10) #12
  %.not156.us = icmp eq ptr %137, null
  br i1 %.not156.us, label %.split, label %138

138:                                              ; preds = %.lr.ph.split.us
  store i8 0, ptr %137, align 1, !tbaa !15
  %139 = icmp eq ptr %137, %135
  br i1 %139, label %.split292, label %140

140:                                              ; preds = %138
  %141 = load i8, ptr %135, align 1, !tbaa !15
  %142 = icmp eq i8 %141, 35
  br i1 %142, label %.backedge.us, label %.split295.us

.backedge.us:                                     ; preds = %140
  %143 = call ptr @fgets(ptr noundef nonnull %7, i32 noundef 4096, ptr noundef %.0)
  %.not148.us = icmp eq ptr %143, null
  br i1 %.not148.us, label %.outer180._crit_edge, label %.lr.ph.split.us, !llvm.loop !25

144:                                              ; preds = %84
  %145 = load i8, ptr %79, align 1, !tbaa !15
  %146 = icmp eq i8 %145, 35
  br i1 %146, label %147, label %.split295.us

147:                                              ; preds = %144
  br i1 %.not162.not, label %148, label %159

148:                                              ; preds = %147
  %149 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %79, ptr noundef nonnull @.str.14, ptr noundef nonnull %6) #11
  %150 = icmp eq i32 %149, 1
  br i1 %150, label %151, label %159

151:                                              ; preds = %148
  %152 = load i32, ptr %6, align 4, !tbaa !11
  %153 = zext i32 %152 to i64
  %154 = call i32 @ack_stream(ptr noundef nonnull %3, i64 noundef %153)
  %.not164 = icmp eq i32 %154, 0
  br i1 %.not164, label %.backedge, label %155

155:                                              ; preds = %151
  %156 = load ptr, ptr @stderr, align 8, !tbaa !5
  %157 = load i32, ptr %6, align 4, !tbaa !11
  %158 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %156, ptr noundef nonnull @.str.15, i32 noundef %157) #14
  call void @exit(i32 noundef 1) #15
  unreachable

159:                                              ; preds = %148, %147
  %160 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %79, ptr noundef nonnull @.str.16, ptr noundef nonnull %6) #11
  %161 = icmp eq i32 %160, 1
  br i1 %161, label %162, label %166

162:                                              ; preds = %159
  %163 = load i32, ptr %6, align 4, !tbaa !11
  %164 = zext i32 %163 to i64
  %165 = call i32 @sync_table(ptr noundef nonnull %3, i64 noundef %164)
  br label %.backedge

166:                                              ; preds = %159
  %167 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %79, ptr noundef nonnull @.str.17, ptr noundef nonnull %6) #11
  %168 = icmp eq i32 %167, 1
  br i1 %168, label %169, label %173

169:                                              ; preds = %166
  %170 = load i32, ptr %6, align 4, !tbaa !11
  %171 = zext i32 %170 to i64
  %172 = call i32 @cancel_stream(ptr noundef nonnull %3, i64 noundef %171)
  br label %.backedge

173:                                              ; preds = %166
  %174 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %79, ptr noundef nonnull @.str.18, ptr noundef nonnull %6) #11
  %175 = icmp eq i32 %174, 1
  br i1 %175, label %176, label %.backedge

176:                                              ; preds = %173
  store i64 6, ptr %9, align 8, !tbaa !13
  %177 = load i32, ptr %6, align 4, !tbaa !11
  %178 = call i32 @lsqpack_enc_set_max_capacity(ptr noundef nonnull %3, i32 noundef %177, ptr noundef nonnull %8, ptr noundef nonnull %9) #11
  %.not163 = icmp eq i32 %178, 0
  br i1 %.not163, label %186, label %179

179:                                              ; preds = %176
  %180 = load ptr, ptr @stderr, align 8, !tbaa !5
  %181 = load i32, ptr %6, align 4, !tbaa !11
  %182 = tail call ptr @__errno_location() #13
  %183 = load i32, ptr %182, align 4, !tbaa !11
  %184 = call ptr @strerror(i32 noundef %183) #11
  %185 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %180, ptr noundef nonnull @.str.19, i32 noundef %181, ptr noundef %184) #14
  call void @exit(i32 noundef 1) #15
  unreachable

186:                                              ; preds = %176
  %187 = load i64, ptr %9, align 8, !tbaa !13
  call void @write_enc_stream(ptr noundef %.0123, ptr noundef nonnull %8, i64 noundef %187)
  br label %.backedge

.backedge:                                        ; preds = %162, %173, %186, %169, %151
  %188 = call ptr @fgets(ptr noundef nonnull %7, i32 noundef 4096, ptr noundef %.0)
  %.not148 = icmp eq ptr %188, null
  br i1 %.not148, label %.outer180._crit_edge, label %.lr.ph.split, !llvm.loop !25

.split295.us:                                     ; preds = %144, %140
  %.us-phi300 = phi i32 [ %136, %140 ], [ %80, %144 ]
  %.us-phi301 = phi ptr [ %137, %140 ], [ %81, %144 ]
  %.us-phi302 = phi ptr [ %135, %140 ], [ %79, %144 ]
  %189 = call ptr @strchr(ptr noundef nonnull dereferenceable(1) %.us-phi302, i32 noundef 9) #12
  %.not157 = icmp eq ptr %189, null
  br i1 %.not157, label %190, label %193

190:                                              ; preds = %.split295.us
  %191 = load ptr, ptr @stderr, align 8, !tbaa !5
  %192 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %191, ptr noundef nonnull @.str.20, i32 noundef %.us-phi300) #14
  call void @exit(i32 noundef 1) #15
  unreachable

193:                                              ; preds = %.split295.us
  %.not158 = icmp eq i32 %.0115.ph185313, 0
  br i1 %.not158, label %194, label %204

194:                                              ; preds = %193
  %195 = add i32 %.0133.ph323, 1
  %196 = zext i32 %195 to i64
  %197 = call i32 @lsqpack_enc_start_header(ptr noundef nonnull %3, i64 noundef %196, i32 noundef 0) #11
  %.not159 = icmp eq i32 %197, 0
  br i1 %.not159, label %204, label %198

198:                                              ; preds = %194
  %199 = load ptr, ptr @stderr, align 8, !tbaa !5
  %200 = tail call ptr @__errno_location() #13
  %201 = load i32, ptr %200, align 4, !tbaa !11
  %202 = call ptr @strerror(i32 noundef %201) #11
  %203 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %199, ptr noundef nonnull @.str.21, ptr noundef %202) #14
  call void @exit(i32 noundef 1) #15
  unreachable

204:                                              ; preds = %194, %193
  %.1134 = phi i32 [ %.0133.ph323, %193 ], [ %195, %194 ]
  br i1 %.not166, label %208, label %205

205:                                              ; preds = %204
  %206 = sub i64 4096, %.0119.ph183311
  %207 = sub i64 4096, %.0117.ph184312
  br label %209

208:                                              ; preds = %204
  %.pre = sub i64 4096, %.0117.ph184312
  %.pre479 = sub i64 4096, %.0119.ph183311
  br label %209

209:                                              ; preds = %208, %205
  %.pre-phi480 = phi i64 [ %.pre479, %208 ], [ %206, %205 ]
  %.pre-phi = phi i64 [ %.pre, %208 ], [ %207, %205 ]
  %.sink = phi i64 [ 0, %208 ], [ %206, %205 ]
  %storemerge = phi i64 [ 0, %208 ], [ %207, %205 ]
  store i64 %.sink, ptr %4, align 8
  store i64 %storemerge, ptr %5, align 8, !tbaa !13
  %210 = ptrtoint ptr %189 to i64
  %211 = ptrtoint ptr %.us-phi302 to i64
  %212 = sub i64 %210, %211
  %213 = getelementptr inbounds i8, ptr %189, i64 1
  %214 = ptrtoint ptr %213 to i64
  %215 = sub i64 %214, %211
  %216 = ptrtoint ptr %.us-phi301 to i64
  %217 = xor i64 %210, -1
  %218 = add i64 %217, %216
  %219 = getelementptr inbounds i8, ptr %12, i64 %.0119.ph183311
  %220 = getelementptr inbounds i8, ptr %13, i64 %.0117.ph184312
  br label %221

221:                                              ; preds = %.backedge749, %209
  call void @lsxpack_header_set_offset2(ptr noundef nonnull %11, ptr noundef nonnull %.us-phi302, i64 noundef 0, i64 noundef %212, i64 noundef %215, i64 noundef %218)
  %222 = call i32 @lsqpack_enc_encode(ptr noundef nonnull %3, ptr noundef nonnull %219, ptr noundef nonnull %4, ptr noundef nonnull %220, ptr noundef nonnull %5, ptr noundef nonnull %11, i32 noundef 0) #11
  switch i32 %222, label %235 [
    i32 1, label %223
    i32 2, label %229
    i32 0, label %.outer
  ]

223:                                              ; preds = %221
  %224 = load i64, ptr %4, align 8, !tbaa !13
  %225 = icmp ult i64 %224, %.pre-phi480
  br i1 %225, label %226, label %228

226:                                              ; preds = %223
  %227 = add nuw i64 %224, 1
  store i64 %227, ptr %4, align 8, !tbaa !13
  br label %.backedge749

228:                                              ; preds = %223
  call void @__assert_fail(ptr noundef nonnull @.str.22, ptr noundef nonnull @.str.9, i32 noundef 491, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #15
  unreachable

229:                                              ; preds = %221
  %230 = load i64, ptr %5, align 8, !tbaa !13
  %231 = icmp ult i64 %230, %.pre-phi
  br i1 %231, label %232, label %234

232:                                              ; preds = %229
  %233 = add nuw i64 %230, 1
  store i64 %233, ptr %5, align 8, !tbaa !13
  br label %.backedge749

.backedge749:                                     ; preds = %232, %226
  br label %221

234:                                              ; preds = %229
  call void @__assert_fail(ptr noundef nonnull @.str.22, ptr noundef nonnull @.str.9, i32 noundef 497, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #15
  unreachable

235:                                              ; preds = %221
  call void @__assert_fail(ptr noundef nonnull @.str.23, ptr noundef nonnull @.str.9, i32 noundef 500, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #15
  unreachable

.outer:                                           ; preds = %221
  %236 = load i64, ptr %4, align 8, !tbaa !13
  %237 = add i64 %236, %.0119.ph183311
  %238 = load i64, ptr %5, align 8, !tbaa !13
  %239 = add i64 %238, %.0117.ph184312
  %240 = call ptr @fgets(ptr noundef nonnull %7, i32 noundef 4096, ptr noundef %.0)
  %.not148282308 = icmp eq ptr %240, null
  br i1 %.not148282308, label %.outer180._crit_edge, label %.lr.ph.lr.ph, !llvm.loop !25

.lr.ph.lr.ph:                                     ; preds = %.lr.ph.lr.ph.lr.ph, %.outer
  %241 = phi ptr [ %74, %.lr.ph.lr.ph.lr.ph ], [ %240, %.outer ]
  %.0115.ph328 = phi i32 [ 0, %.lr.ph.lr.ph.lr.ph ], [ 1, %.outer ]
  %.0117.ph327 = phi i64 [ 0, %.lr.ph.lr.ph.lr.ph ], [ %239, %.outer ]
  %.0119.ph326 = phi i64 [ 0, %.lr.ph.lr.ph.lr.ph ], [ %237, %.outer ]
  %.0132.ph324 = phi i32 [ 0, %.lr.ph.lr.ph.lr.ph ], [ %.us-phi300, %.outer ]
  %.0133.ph323 = phi i32 [ 0, %.lr.ph.lr.ph.lr.ph ], [ %.1134, %.outer ]
  %242 = zext i32 %.0133.ph323 to i64
  br label %.lr.ph

.outer180._crit_edge:                             ; preds = %.outer, %.outer180, %.backedge, %.backedge.us, %.preheader
  %.0133.ph.lcssa249 = phi i32 [ 0, %.preheader ], [ %.0133.ph323, %.backedge.us ], [ %.0133.ph323, %.backedge ], [ %.0133.ph323, %.outer180 ], [ %.1134, %.outer ]
  %.0119.ph183.lcssa229 = phi i64 [ 0, %.preheader ], [ %.0119.ph183311, %.backedge.us ], [ %.0119.ph183311, %.backedge ], [ %.1120, %.outer180 ], [ %237, %.outer ]
  %.0117.ph184.lcssa221 = phi i64 [ 0, %.preheader ], [ %.0117.ph184312, %.backedge.us ], [ %.0117.ph184312, %.backedge ], [ %.1118, %.outer180 ], [ %239, %.outer ]
  %.0115.ph185.lcssa213 = phi i32 [ 0, %.preheader ], [ %.0115.ph185313, %.backedge.us ], [ %.0115.ph185313, %.backedge ], [ 0, %.outer180 ], [ 1, %.outer ]
  %243 = load i32, ptr @s_verbose, align 4, !tbaa !11
  %.not149 = icmp eq i32 %243, 0
  br i1 %.not149, label %247, label %244

244:                                              ; preds = %.outer180._crit_edge
  %245 = load ptr, ptr @stderr, align 8, !tbaa !5
  %246 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %245, ptr noundef nonnull @.str.24) #14
  br label %247

247:                                              ; preds = %244, %.outer180._crit_edge
  %248 = call i32 @fclose(ptr noundef %.0)
  %.not150 = icmp eq i32 %.0115.ph185.lcssa213, 0
  br i1 %.not150, label %294, label %249

249:                                              ; preds = %247
  %250 = load i32, ptr @s_verbose, align 4, !tbaa !11
  %.not151 = icmp eq i32 %250, 0
  br i1 %.not151, label %254, label %251

251:                                              ; preds = %249
  %252 = load ptr, ptr @stderr, align 8, !tbaa !5
  %253 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %252, ptr noundef nonnull @.str.25) #14
  br label %254

254:                                              ; preds = %251, %249
  %255 = call i64 @lsqpack_enc_end_header(ptr noundef nonnull %3, ptr noundef nonnull %14, i64 noundef 32, ptr noundef nonnull %10) #11
  %256 = icmp slt i64 %255, 0
  br i1 %256, label %257, label %263

257:                                              ; preds = %254
  %258 = load ptr, ptr @stderr, align 8, !tbaa !5
  %259 = tail call ptr @__errno_location() #13
  %260 = load i32, ptr %259, align 4, !tbaa !11
  %261 = call ptr @strerror(i32 noundef %260) #11
  %262 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %258, ptr noundef nonnull @.str.11, ptr noundef %261) #14
  call void @exit(i32 noundef 1) #15
  unreachable

263:                                              ; preds = %254
  %264 = icmp eq i32 %.0130, 0
  br i1 %264, label %265, label %269

265:                                              ; preds = %263
  %266 = load i32, ptr %10, align 4, !tbaa !11
  %267 = and i32 %266, 1
  %.not152 = icmp eq i32 %267, 0
  br i1 %.not152, label %269, label %268

268:                                              ; preds = %265
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.9, i32 noundef 536, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #15
  unreachable

269:                                              ; preds = %265, %263
  %.not = icmp eq i32 %.0111, 0
  br i1 %.not, label %286, label %270

270:                                              ; preds = %269
  %271 = icmp eq i64 %255, 2
  %272 = load i8, ptr %14, align 16
  %273 = icmp eq i8 %272, 0
  %or.cond11 = select i1 %271, i1 %273, i1 false
  %274 = getelementptr inbounds i8, ptr %14, i64 1
  %275 = load i8, ptr %274, align 1
  %276 = icmp eq i8 %275, 0
  %or.cond15 = select i1 %or.cond11, i1 %276, i1 false
  br i1 %or.cond15, label %286, label %277

277:                                              ; preds = %270
  %278 = zext i32 %.0133.ph.lcssa249 to i64
  %279 = call i32 @ack_stream(ptr noundef nonnull %3, i64 noundef %278)
  %.not153 = icmp eq i32 %279, 0
  br i1 %.not153, label %286, label %280

280:                                              ; preds = %277
  %281 = load ptr, ptr @stderr, align 8, !tbaa !5
  %282 = tail call ptr @__errno_location() #13
  %283 = load i32, ptr %282, align 4, !tbaa !11
  %284 = call ptr @strerror(i32 noundef %283) #11
  %285 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %281, ptr noundef nonnull @.str.12, i32 noundef %.0133.ph.lcssa249, ptr noundef %284) #14
  call void @exit(i32 noundef 1) #15
  unreachable

286:                                              ; preds = %270, %277, %269
  %287 = load i32, ptr @s_verbose, align 4, !tbaa !11
  %.not154 = icmp eq i32 %287, 0
  br i1 %.not154, label %293, label %288

288:                                              ; preds = %286
  %289 = load ptr, ptr @stderr, align 8, !tbaa !5
  %290 = call float @lsqpack_enc_ratio(ptr noundef nonnull %3) #11
  %291 = fpext float %290 to double
  %292 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %289, ptr noundef nonnull @.str.13, double noundef %291) #14
  br label %293

293:                                              ; preds = %288, %286
  call void @write_enc_and_header_streams(ptr noundef %.0123, i32 noundef %.0133.ph.lcssa249, ptr noundef nonnull %12, i64 noundef %.0119.ph183.lcssa229, ptr noundef nonnull %14, i64 noundef %255, ptr noundef nonnull %13, i64 noundef %.0117.ph184.lcssa221)
  br label %294

294:                                              ; preds = %293, %247
  call void @lsqpack_enc_cleanup(ptr noundef nonnull %3) #11
  %295 = call i32 @fclose(ptr noundef %.0123)
  %.not155 = icmp eq i32 %295, 0
  br i1 %.not155, label %297, label %296

296:                                              ; preds = %294
  call void @perror(ptr noundef nonnull @.str.26) #16
  call void @exit(i32 noundef 1) #15
  unreachable

297:                                              ; preds = %294
  call void @exit(i32 noundef 0) #15
  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: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #4

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

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

; 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 #6

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

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

declare i32 @lsqpack_enc_init(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #9

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare ptr @strchr(ptr noundef, i32 noundef) local_unnamed_addr #4

declare i64 @lsqpack_enc_end_header(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #9

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #7

declare i64 @lsqpack_enc_header_block_prefix_size(ptr noundef) local_unnamed_addr #9

; Function Attrs: nounwind uwtable
declare hidden i32 @ack_stream(ptr noundef, i64 noundef) local_unnamed_addr #8

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

declare float @lsqpack_enc_ratio(ptr noundef) local_unnamed_addr #9

; Function Attrs: nounwind uwtable
declare hidden void @write_enc_and_header_streams(ptr noundef, i32 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef) local_unnamed_addr #8

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

; Function Attrs: nounwind uwtable
declare hidden i32 @sync_table(ptr noundef, i64 noundef) local_unnamed_addr #8

; Function Attrs: nounwind uwtable
declare hidden i32 @cancel_stream(ptr noundef, i64 noundef) local_unnamed_addr #8

declare i32 @lsqpack_enc_set_max_capacity(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #9

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @lsxpack_header_set_offset2(ptr noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #10

declare i32 @lsqpack_enc_encode(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #9

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

declare void @lsqpack_enc_cleanup(ptr noundef) local_unnamed_addr #9

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 = { 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 #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 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 #7 = { 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 #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 = { nounwind }
attributes #12 = { nounwind willreturn memory(read) }
attributes #13 = { nounwind willreturn memory(none) }
attributes #14 = { cold nounwind }
attributes #15 = { noreturn nounwind }
attributes #16 = { 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, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !10}
!17 = !{!18, !12, i64 0}
!18 = !{!"lsqpack_enc", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !19, i64 56, !6, i64 72, !20, i64 80, !20, i64 96, !20, i64 112, !21, i64 128, !22, i64 160, !12, i64 192, !12, i64 196, !6, i64 200, !24, i64 208, !24, i64 212, !6, i64 216, !12, i64 224, !12, i64 228, !12, i64 232}
!19 = !{!"lsqpack_enc_head", !6, i64 0, !6, i64 8}
!20 = !{!"", !6, i64 0, !6, i64 8}
!21 = !{!"", !6, i64 0, !6, i64 8, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28}
!22 = !{!"", !23, i64 0, !6, i64 24}
!23 = !{!"lsqpack_dec_int_state", !12, i64 0, !12, i64 4, !12, i64 8, !14, i64 16}
!24 = !{!"float", !7, i64 0}
!25 = distinct !{!25, !10}


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