; LLVM IR from eloj/lzw-eddy :: fuzzing (afl_compress_driver)

; 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.lzw_state = type { %struct.lzw_string_table, i8, i8, i64, i64, i32, i32, i64, i64 }
%struct.lzw_string_table = type { i32, i16, i16, [4096 x i32] }

@.str.6 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [19 x i8], align 1
@__PRETTY_FUNCTION__.lzw_compress = external hidden unnamed_addr constant [79 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [45 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
declare hidden void @lzw_init(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @lzw_reset(ptr noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i16 @lzw_node_prefix_len(i32 noundef) #2

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @lzw_make_node(i8 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext) #2

; Function Attrs: nounwind uwtable
define dso_local i64 @lzw_compress(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, i64 noundef %4) #1 {
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i16, align 2
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  %15 = alloca i8, align 1
  %16 = alloca i8, align 1
  %17 = alloca i8, align 1
  %18 = alloca i16, align 2
  %19 = alloca i16, align 2
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i64 %2, ptr %9, align 8, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !5
  store i64 %4, ptr %11, align 8, !tbaa !9
  %20 = load ptr, ptr %7, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.lzw_state, ptr %20, i32 0, i32 1
  %22 = load i8, ptr %21, align 8, !tbaa !11, !range !17, !noundef !18
  %23 = trunc i8 %22 to i1
  %24 = zext i1 %23 to i32
  %25 = icmp eq i32 %24, 0
  br i1 %25, label %26, label %29

26:                                               ; preds = %5
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  call void @lzw_init(ptr noundef %27)
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  call void @lzw_output_code(ptr noundef %28, i16 noundef zeroext 256)
  br label %29

29:                                               ; preds = %26, %5
  call void @llvm.lifetime.start.p0(i64 2, ptr %12) #4
  store i16 257, ptr %12, align 2, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  store i64 0, ptr %13, align 8, !tbaa !9
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.lzw_state, ptr %30, i32 0, i32 4
  store i64 0, ptr %31, align 8, !tbaa !20
  br label %32

32:                                               ; preds = %205, %29
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.lzw_state, ptr %33, i32 0, i32 3
  %35 = load i64, ptr %34, align 8, !tbaa !21
  %36 = load i64, ptr %13, align 8, !tbaa !9
  %37 = add i64 %35, %36
  %38 = load i64, ptr %9, align 8, !tbaa !9
  %39 = icmp ult i64 %37, %38
  br i1 %39, label %40, label %206

40:                                               ; preds = %32
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.lzw_state, ptr %41, i32 0, i32 4
  %43 = load i64, ptr %42, align 8, !tbaa !20
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.lzw_state, ptr %44, i32 0, i32 0
  %46 = getelementptr inbounds %struct.lzw_string_table, ptr %45, i32 0, i32 0
  %47 = load i32, ptr %46, align 8, !tbaa !22
  %48 = lshr i32 %47, 3
  %49 = zext i32 %48 to i64
  %50 = add i64 %43, %49
  %51 = add i64 %50, 1
  %52 = add i64 %51, 2
  %53 = add i64 %52, 2
  %54 = load i64, ptr %11, align 8, !tbaa !9
  %55 = icmp ugt i64 %53, %54
  br i1 %55, label %56, label %60

56:                                               ; preds = %40
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.lzw_state, ptr %57, i32 0, i32 4
  %59 = load i64, ptr %58, align 8, !tbaa !20
  store i64 %59, ptr %6, align 8
  store i32 1, ptr %14, align 4
  br label %264

60:                                               ; preds = %40
  %61 = load i64, ptr %13, align 8, !tbaa !9
  %62 = add i64 %61, 1
  store i64 %62, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #4
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.lzw_state, ptr %63, i32 0, i32 8
  %65 = load i64, ptr %64, align 8, !tbaa !23
  %66 = icmp ugt i64 %65, 0
  br i1 %66, label %67, label %73

67:                                               ; preds = %60
  %68 = load i64, ptr %13, align 8, !tbaa !9
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.lzw_state, ptr %69, i32 0, i32 8
  %71 = load i64, ptr %70, align 8, !tbaa !23
  %72 = icmp uge i64 %68, %71
  br label %73

73:                                               ; preds = %67, %60
  %74 = phi i1 [ false, %60 ], [ %72, %67 ]
  %75 = zext i1 %74 to i8
  store i8 %75, ptr %15, align 1, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #4
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  %78 = load ptr, ptr %7, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.lzw_state, ptr %78, i32 0, i32 3
  %80 = load i64, ptr %79, align 8, !tbaa !21
  %81 = getelementptr inbounds i8, ptr %77, i64 %80
  %82 = load i64, ptr %13, align 8, !tbaa !9
  %83 = call zeroext i1 @lzw_string_table_lookup(ptr noundef %76, ptr noundef %81, i64 noundef %82, ptr noundef %12)
  %84 = zext i1 %83 to i8
  store i8 %84, ptr %16, align 1, !tbaa !24
  %85 = load i8, ptr %16, align 1, !tbaa !24, !range !17, !noundef !18
  %86 = trunc i8 %85 to i1
  br i1 %86, label %87, label %90

87:                                               ; preds = %73
  %88 = load i8, ptr %15, align 1, !tbaa !24, !range !17, !noundef !18
  %89 = trunc i8 %88 to i1
  br i1 %89, label %90, label %205

90:                                               ; preds = %87, %73
  %91 = load i16, ptr %12, align 2, !tbaa !19
  %92 = zext i16 %91 to i64
  %93 = icmp ne i64 %92, 256
  br i1 %93, label %94, label %95

94:                                               ; preds = %90
  br label %96

95:                                               ; preds = %90
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.6, i32 noundef 398, ptr noundef @__PRETTY_FUNCTION__.lzw_compress) #5
  unreachable

96:                                               ; preds = %94
  %97 = load i16, ptr %12, align 2, !tbaa !19
  %98 = zext i16 %97 to i64
  %99 = icmp ne i64 %98, 257
  br i1 %99, label %100, label %101

100:                                              ; preds = %96
  br label %102

101:                                              ; preds = %96
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.6, i32 noundef 399, ptr noundef @__PRETTY_FUNCTION__.lzw_compress) #5
  unreachable

102:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #4
  %103 = load ptr, ptr %8, align 8, !tbaa !5
  %104 = load ptr, ptr %7, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.lzw_state, ptr %104, i32 0, i32 3
  %106 = load i64, ptr %105, align 8, !tbaa !21
  %107 = load i64, ptr %13, align 8, !tbaa !9
  %108 = add i64 %106, %107
  %109 = sub i64 %108, 1
  %110 = getelementptr inbounds i8, ptr %103, i64 %109
  %111 = load i8, ptr %110, align 1, !tbaa !25
  store i8 %111, ptr %17, align 1, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 2, ptr %18) #4
  %112 = load i16, ptr %12, align 2, !tbaa !19
  store i16 %112, ptr %18, align 2, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 2, ptr %19) #4
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.lzw_state, ptr %113, i32 0, i32 0
  %115 = getelementptr inbounds %struct.lzw_string_table, ptr %114, i32 0, i32 3
  %116 = load i16, ptr %18, align 2, !tbaa !19
  %117 = zext i16 %116 to i64
  %118 = getelementptr inbounds [4096 x i32], ptr %115, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !26
  %120 = call zeroext i16 @lzw_node_prefix_len(i32 noundef %119)
  %121 = zext i16 %120 to i32
  %122 = add nsw i32 1, %121
  %123 = trunc i32 %122 to i16
  store i16 %123, ptr %19, align 2, !tbaa !19
  %124 = load ptr, ptr %7, align 8, !tbaa !5
  %125 = load i16, ptr %18, align 2, !tbaa !19
  call void @lzw_output_code(ptr noundef %124, i16 noundef zeroext %125)
  %126 = load ptr, ptr %7, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.lzw_state, ptr %126, i32 0, i32 0
  %128 = getelementptr inbounds %struct.lzw_string_table, ptr %127, i32 0, i32 1
  %129 = load i16, ptr %128, align 4, !tbaa !27
  %130 = zext i16 %129 to i64
  %131 = load ptr, ptr %7, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.lzw_state, ptr %131, i32 0, i32 0
  %133 = getelementptr inbounds %struct.lzw_string_table, ptr %132, i32 0, i32 0
  %134 = load i32, ptr %133, align 8, !tbaa !22
  %135 = zext i32 %134 to i64
  %136 = shl i64 1, %135
  %137 = icmp eq i64 %130, %136
  br i1 %137, label %138, label %161

138:                                              ; preds = %102
  %139 = load ptr, ptr %7, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.lzw_state, ptr %139, i32 0, i32 0
  %141 = getelementptr inbounds %struct.lzw_string_table, ptr %140, i32 0, i32 0
  %142 = load i32, ptr %141, align 8, !tbaa !22
  %143 = icmp ult i32 %142, 12
  br i1 %143, label %144, label %150

144:                                              ; preds = %138
  %145 = load ptr, ptr %7, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.lzw_state, ptr %145, i32 0, i32 0
  %147 = getelementptr inbounds %struct.lzw_string_table, ptr %146, i32 0, i32 0
  %148 = load i32, ptr %147, align 8, !tbaa !22
  %149 = add i32 %148, 1
  store i32 %149, ptr %147, align 8, !tbaa !22
  br label %160

150:                                              ; preds = %138
  %151 = load ptr, ptr %7, align 8, !tbaa !5
  %152 = load ptr, ptr %10, align 8, !tbaa !5
  call void @lzw_flush_reservoir(ptr noundef %151, ptr noundef %152, i1 noundef zeroext false)
  %153 = load ptr, ptr %7, align 8, !tbaa !5
  call void @lzw_output_code(ptr noundef %153, i16 noundef zeroext 256)
  %154 = load ptr, ptr %7, align 8, !tbaa !5
  call void @lzw_reset(ptr noundef %154)
  %155 = load ptr, ptr %7, align 8, !tbaa !5
  %156 = load ptr, ptr %10, align 8, !tbaa !5
  call void @lzw_flush_reservoir(ptr noundef %155, ptr noundef %156, i1 noundef zeroext false)
  %157 = load ptr, ptr %7, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.lzw_state, ptr %157, i32 0, i32 0
  %159 = getelementptr inbounds %struct.lzw_string_table, ptr %158, i32 0, i32 1
  store i16 257, ptr %159, align 4, !tbaa !27
  br label %160

160:                                              ; preds = %150, %144
  br label %161

161:                                              ; preds = %160, %102
  %162 = load ptr, ptr %7, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.lzw_state, ptr %162, i32 0, i32 0
  %164 = getelementptr inbounds %struct.lzw_string_table, ptr %163, i32 0, i32 1
  %165 = load i16, ptr %164, align 4, !tbaa !27
  %166 = zext i16 %165 to i64
  %167 = icmp ult i64 %166, 4096
  br i1 %167, label %168, label %169

168:                                              ; preds = %161
  br label %170

169:                                              ; preds = %161
  call void @__assert_fail(ptr noundef @.str.11, ptr noundef @.str.6, i32 noundef 427, ptr noundef @__PRETTY_FUNCTION__.lzw_compress) #5
  unreachable

170:                                              ; preds = %168
  %171 = load i8, ptr %17, align 1, !tbaa !25
  %172 = load i16, ptr %18, align 2, !tbaa !19
  %173 = load i16, ptr %19, align 2, !tbaa !19
  %174 = call i32 @lzw_make_node(i8 noundef zeroext %171, i16 noundef zeroext %172, i16 noundef zeroext %173)
  %175 = load ptr, ptr %7, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.lzw_state, ptr %175, i32 0, i32 0
  %177 = getelementptr inbounds %struct.lzw_string_table, ptr %176, i32 0, i32 3
  %178 = load ptr, ptr %7, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.lzw_state, ptr %178, i32 0, i32 0
  %180 = getelementptr inbounds %struct.lzw_string_table, ptr %179, i32 0, i32 1
  %181 = load i16, ptr %180, align 4, !tbaa !27
  %182 = add i16 %181, 1
  store i16 %182, ptr %180, align 4, !tbaa !27
  %183 = zext i16 %181 to i64
  %184 = getelementptr inbounds [4096 x i32], ptr %177, i64 0, i64 %183
  store i32 %174, ptr %184, align 4, !tbaa !26
  %185 = load i16, ptr %19, align 2, !tbaa !19
  %186 = zext i16 %185 to i64
  %187 = load ptr, ptr %7, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.lzw_state, ptr %187, i32 0, i32 7
  %189 = load i64, ptr %188, align 8, !tbaa !28
  %190 = icmp ugt i64 %186, %189
  br i1 %190, label %191, label %196

191:                                              ; preds = %170
  %192 = load i16, ptr %19, align 2, !tbaa !19
  %193 = zext i16 %192 to i64
  %194 = load ptr, ptr %7, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.lzw_state, ptr %194, i32 0, i32 7
  store i64 %193, ptr %195, align 8, !tbaa !28
  br label %196

196:                                              ; preds = %191, %170
  %197 = load i16, ptr %19, align 2, !tbaa !19
  %198 = zext i16 %197 to i64
  %199 = load ptr, ptr %7, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.lzw_state, ptr %199, i32 0, i32 3
  %201 = load i64, ptr %200, align 8, !tbaa !21
  %202 = add i64 %201, %198
  store i64 %202, ptr %200, align 8, !tbaa !21
  store i64 0, ptr %13, align 8, !tbaa !9
  %203 = load ptr, ptr %7, align 8, !tbaa !5
  %204 = load ptr, ptr %10, align 8, !tbaa !5
  call void @lzw_flush_reservoir(ptr noundef %203, ptr noundef %204, i1 noundef zeroext false)
  call void @llvm.lifetime.end.p0(i64 2, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #4
  br label %205

205:                                              ; preds = %196, %87
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #4
  br label %32, !llvm.loop !29

206:                                              ; preds = %32
  %207 = load i64, ptr %13, align 8, !tbaa !9
  %208 = icmp ne i64 %207, 0
  br i1 %208, label %209, label %219

209:                                              ; preds = %206
  %210 = load ptr, ptr %7, align 8, !tbaa !5
  %211 = load i16, ptr %12, align 2, !tbaa !19
  call void @lzw_output_code(ptr noundef %210, i16 noundef zeroext %211)
  %212 = load ptr, ptr %7, align 8, !tbaa !5
  %213 = load ptr, ptr %10, align 8, !tbaa !5
  call void @lzw_flush_reservoir(ptr noundef %212, ptr noundef %213, i1 noundef zeroext false)
  %214 = load i64, ptr %13, align 8, !tbaa !9
  %215 = load ptr, ptr %7, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.lzw_state, ptr %215, i32 0, i32 3
  %217 = load i64, ptr %216, align 8, !tbaa !21
  %218 = add i64 %217, %214
  store i64 %218, ptr %216, align 8, !tbaa !21
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %219

219:                                              ; preds = %209, %206
  %220 = load ptr, ptr %7, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.lzw_state, ptr %220, i32 0, i32 3
  %222 = load i64, ptr %221, align 8, !tbaa !21
  %223 = load i64, ptr %13, align 8, !tbaa !9
  %224 = add i64 %222, %223
  %225 = load i64, ptr %9, align 8, !tbaa !9
  %226 = icmp eq i64 %224, %225
  br i1 %226, label %227, label %234

227:                                              ; preds = %219
  %228 = load ptr, ptr %7, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.lzw_state, ptr %228, i32 0, i32 0
  %230 = getelementptr inbounds %struct.lzw_string_table, ptr %229, i32 0, i32 2
  %231 = load i16, ptr %230, align 2, !tbaa !31
  %232 = zext i16 %231 to i64
  %233 = icmp ne i64 %232, 257
  br i1 %233, label %244, label %234

234:                                              ; preds = %227, %219
  %235 = load ptr, ptr %7, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.lzw_state, ptr %235, i32 0, i32 4
  %237 = load i64, ptr %236, align 8, !tbaa !20
  %238 = icmp eq i64 %237, 0
  br i1 %238, label %239, label %248

239:                                              ; preds = %234
  %240 = load ptr, ptr %7, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.lzw_state, ptr %240, i32 0, i32 6
  %242 = load i32, ptr %241, align 4, !tbaa !32
  %243 = icmp ugt i32 %242, 0
  br i1 %243, label %244, label %248

244:                                              ; preds = %239, %227
  %245 = load ptr, ptr %7, align 8, !tbaa !5
  call void @lzw_output_code(ptr noundef %245, i16 noundef zeroext 257)
  %246 = load ptr, ptr %7, align 8, !tbaa !5
  %247 = load ptr, ptr %10, align 8, !tbaa !5
  call void @lzw_flush_reservoir(ptr noundef %246, ptr noundef %247, i1 noundef zeroext true)
  br label %248

248:                                              ; preds = %244, %239, %234
  %249 = load ptr, ptr %7, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct.lzw_state, ptr %249, i32 0, i32 4
  %251 = load i64, ptr %250, align 8, !tbaa !20
  %252 = icmp eq i64 %251, 0
  br i1 %252, label %253, label %258

253:                                              ; preds = %248
  %254 = load ptr, ptr %7, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct.lzw_state, ptr %254, i32 0, i32 6
  %256 = load i32, ptr %255, align 4, !tbaa !32
  %257 = icmp ugt i32 %256, 0
  br i1 %257, label %259, label %258

258:                                              ; preds = %253, %248
  br label %260

259:                                              ; preds = %253
  call void @__assert_fail(ptr noundef @.str.12, ptr noundef @.str.6, i32 noundef 459, ptr noundef @__PRETTY_FUNCTION__.lzw_compress) #5
  unreachable

260:                                              ; preds = %258
  %261 = load ptr, ptr %7, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct.lzw_state, ptr %261, i32 0, i32 4
  %263 = load i64, ptr %262, align 8, !tbaa !20
  store i64 %263, ptr %6, align 8
  store i32 1, ptr %14, align 4
  br label %264

264:                                              ; preds = %260, %56
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %12) #4
  %265 = load i64, ptr %6, align 8
  ret i64 %265
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @lzw_output_code(ptr noundef, i16 noundef zeroext) #2

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @lzw_string_table_lookup(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @lzw_flush_reservoir(ptr noundef, ptr noundef, i1 noundef zeroext) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { nounwind }
attributes #5 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !16, i64 16392}
!12 = !{!"lzw_state", !13, i64 0, !16, i64 16392, !16, i64 16393, !10, i64 16400, !10, i64 16408, !14, i64 16416, !14, i64 16420, !10, i64 16424, !10, i64 16432}
!13 = !{!"lzw_string_table", !14, i64 0, !15, i64 4, !15, i64 6, !7, i64 8}
!14 = !{!"int", !7, i64 0}
!15 = !{!"short", !7, i64 0}
!16 = !{!"_Bool", !7, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!15, !15, i64 0}
!20 = !{!12, !10, i64 16408}
!21 = !{!12, !10, i64 16400}
!22 = !{!12, !14, i64 0}
!23 = !{!12, !10, i64 16432}
!24 = !{!16, !16, i64 0}
!25 = !{!7, !7, i64 0}
!26 = !{!14, !14, i64 0}
!27 = !{!12, !15, i64 4}
!28 = !{!12, !10, i64 16424}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!12, !15, i64 6}
!32 = !{!12, !14, i64 16420}


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

@.str.6 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [19 x i8], align 1
@__PRETTY_FUNCTION__.lzw_compress = external hidden unnamed_addr constant [79 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [45 x i8], align 1

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

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

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i16 @lzw_node_prefix_len(i32 noundef) local_unnamed_addr #2

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @lzw_make_node(i8 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local i64 @lzw_compress(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, i64 noundef %4) local_unnamed_addr #1 {
  %6 = alloca i16, align 2
  %7 = getelementptr inbounds i8, ptr %0, i64 16392
  %8 = load i8, ptr %7, align 8, !tbaa !5, !range !14, !noundef !15
  %9 = icmp eq i8 %8, 0
  br i1 %9, label %10, label %11

10:                                               ; preds = %5
  tail call void @lzw_init(ptr noundef nonnull %0)
  tail call void @lzw_output_code(ptr noundef nonnull %0, i16 noundef zeroext 256)
  br label %11

11:                                               ; preds = %10, %5
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %6) #4
  store i16 257, ptr %6, align 2, !tbaa !16
  %12 = getelementptr inbounds i8, ptr %0, i64 16408
  store i64 0, ptr %12, align 8, !tbaa !17
  %13 = getelementptr inbounds i8, ptr %0, i64 16400
  %14 = load i64, ptr %13, align 8, !tbaa !18
  %15 = icmp ult i64 %14, %2
  br i1 %15, label %.lr.ph, label %._crit_edge.thread

.lr.ph:                                           ; preds = %11
  %16 = getelementptr inbounds i8, ptr %0, i64 16432
  %17 = getelementptr inbounds i8, ptr %0, i64 8
  %18 = getelementptr inbounds i8, ptr %0, i64 4
  %19 = getelementptr inbounds i8, ptr %0, i64 16424
  br label %20

20:                                               ; preds = %.lr.ph, %75
  %21 = phi i64 [ %14, %.lr.ph ], [ %76, %75 ]
  %.07199 = phi i64 [ 0, %.lr.ph ], [ %.1, %75 ]
  %22 = load i64, ptr %12, align 8, !tbaa !17
  %23 = load i32, ptr %0, align 8, !tbaa !19
  %24 = lshr i32 %23, 3
  %25 = zext nneg i32 %24 to i64
  %26 = add i64 %22, 5
  %27 = add i64 %26, %25
  %28 = icmp ugt i64 %27, %4
  br i1 %28, label %.thread86, label %29

29:                                               ; preds = %20
  %30 = add i64 %.07199, 1
  %31 = load i64, ptr %16, align 8, !tbaa !20
  %32 = add i64 %31, -1
  %spec.select = icmp uge i64 %32, %30
  %33 = getelementptr inbounds i8, ptr %1, i64 %21
  %34 = call zeroext i1 @lzw_string_table_lookup(ptr noundef nonnull %0, ptr noundef %33, i64 noundef %30, ptr noundef nonnull %6)
  %brmerge.not = select i1 %34, i1 %spec.select, i1 false
  br i1 %brmerge.not, label %75, label %35

35:                                               ; preds = %29
  %36 = load i16, ptr %6, align 2, !tbaa !16
  switch i16 %36, label %39 [
    i16 256, label %37
    i16 257, label %38
  ]

37:                                               ; preds = %35
  call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.6, i32 noundef 398, ptr noundef nonnull @__PRETTY_FUNCTION__.lzw_compress) #5
  unreachable

38:                                               ; preds = %35
  call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.6, i32 noundef 399, ptr noundef nonnull @__PRETTY_FUNCTION__.lzw_compress) #5
  unreachable

39:                                               ; preds = %35
  %40 = zext i16 %36 to i64
  %41 = load i64, ptr %13, align 8, !tbaa !18
  %42 = getelementptr i8, ptr %1, i64 %41
  %43 = getelementptr i8, ptr %42, i64 %.07199
  %44 = load i8, ptr %43, align 1, !tbaa !21
  %45 = getelementptr inbounds [4096 x i32], ptr %17, i64 0, i64 %40
  %46 = load i32, ptr %45, align 4, !tbaa !22
  %47 = call zeroext i16 @lzw_node_prefix_len(i32 noundef %46)
  %48 = add i16 %47, 1
  call void @lzw_output_code(ptr noundef nonnull %0, i16 noundef zeroext %36)
  %49 = load i16, ptr %18, align 4, !tbaa !23
  %50 = zext i16 %49 to i64
  %51 = load i32, ptr %0, align 8, !tbaa !19
  %52 = zext nneg i32 %51 to i64
  %53 = shl nuw i64 1, %52
  %54 = icmp eq i64 %53, %50
  br i1 %54, label %55, label %59

55:                                               ; preds = %39
  %56 = icmp ult i32 %51, 12
  br i1 %56, label %57, label %.thread

57:                                               ; preds = %55
  %58 = add nuw nsw i32 %51, 1
  store i32 %58, ptr %0, align 8, !tbaa !19
  br label %59

.thread:                                          ; preds = %55
  call void @lzw_flush_reservoir(ptr noundef nonnull %0, ptr noundef %3, i1 noundef zeroext false)
  call void @lzw_output_code(ptr noundef nonnull %0, i16 noundef zeroext 256)
  call void @lzw_reset(ptr noundef nonnull %0)
  call void @lzw_flush_reservoir(ptr noundef nonnull %0, ptr noundef %3, i1 noundef zeroext false)
  store i16 257, ptr %18, align 4, !tbaa !23
  br label %62

59:                                               ; preds = %57, %39
  %60 = icmp ult i16 %49, 4096
  br i1 %60, label %62, label %61

61:                                               ; preds = %59
  call void @__assert_fail(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.6, i32 noundef 427, ptr noundef nonnull @__PRETTY_FUNCTION__.lzw_compress) #5
  unreachable

62:                                               ; preds = %.thread, %59
  %63 = call i32 @lzw_make_node(i8 noundef zeroext %44, i16 noundef zeroext %36, i16 noundef zeroext %48)
  %64 = load i16, ptr %18, align 4, !tbaa !23
  %65 = add i16 %64, 1
  store i16 %65, ptr %18, align 4, !tbaa !23
  %66 = zext i16 %64 to i64
  %67 = getelementptr inbounds [4096 x i32], ptr %17, i64 0, i64 %66
  store i32 %63, ptr %67, align 4, !tbaa !22
  %68 = zext i16 %48 to i64
  %69 = load i64, ptr %19, align 8, !tbaa !24
  %70 = icmp ult i64 %69, %68
  br i1 %70, label %71, label %72

71:                                               ; preds = %62
  store i64 %68, ptr %19, align 8, !tbaa !24
  br label %72

72:                                               ; preds = %71, %62
  %73 = load i64, ptr %13, align 8, !tbaa !18
  %74 = add i64 %73, %68
  store i64 %74, ptr %13, align 8, !tbaa !18
  call void @lzw_flush_reservoir(ptr noundef nonnull %0, ptr noundef %3, i1 noundef zeroext false)
  br label %75

75:                                               ; preds = %29, %72
  %.1 = phi i64 [ 0, %72 ], [ %30, %29 ]
  %76 = load i64, ptr %13, align 8, !tbaa !18
  %77 = add i64 %76, %.1
  %78 = icmp ult i64 %77, %2
  br i1 %78, label %20, label %._crit_edge, !llvm.loop !25

._crit_edge:                                      ; preds = %75
  %.not = icmp eq i64 %.1, 0
  br i1 %.not, label %._crit_edge.thread, label %79

79:                                               ; preds = %._crit_edge
  %80 = load i16, ptr %6, align 2, !tbaa !16
  call void @lzw_output_code(ptr noundef nonnull %0, i16 noundef zeroext %80)
  call void @lzw_flush_reservoir(ptr noundef nonnull %0, ptr noundef %3, i1 noundef zeroext false)
  %81 = load i64, ptr %13, align 8, !tbaa !18
  %82 = add i64 %81, %.1
  store i64 %82, ptr %13, align 8, !tbaa !18
  br label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %11, %79, %._crit_edge
  %83 = phi i64 [ %82, %79 ], [ %76, %._crit_edge ], [ %14, %11 ]
  %84 = icmp eq i64 %83, %2
  br i1 %84, label %85, label %88

85:                                               ; preds = %._crit_edge.thread
  %86 = getelementptr inbounds i8, ptr %0, i64 6
  %87 = load i16, ptr %86, align 2, !tbaa !27
  %.not77 = icmp eq i16 %87, 257
  br i1 %.not77, label %88, label %94

88:                                               ; preds = %85, %._crit_edge.thread
  %89 = load i64, ptr %12, align 8, !tbaa !17
  %90 = icmp eq i64 %89, 0
  br i1 %90, label %91, label %.thread86

91:                                               ; preds = %88
  %92 = getelementptr inbounds i8, ptr %0, i64 16420
  %93 = load i32, ptr %92, align 4, !tbaa !28
  %.not78 = icmp eq i32 %93, 0
  br i1 %.not78, label %.thread108, label %94

94:                                               ; preds = %85, %91
  call void @lzw_output_code(ptr noundef nonnull %0, i16 noundef zeroext 257)
  call void @lzw_flush_reservoir(ptr noundef nonnull %0, ptr noundef %3, i1 noundef zeroext true)
  %.pr85.pre = load i64, ptr %12, align 8, !tbaa !17
  %95 = icmp eq i64 %.pr85.pre, 0
  br i1 %95, label %.thread108, label %.thread86

.thread108:                                       ; preds = %91, %94
  %96 = getelementptr inbounds i8, ptr %0, i64 16420
  %97 = load i32, ptr %96, align 4, !tbaa !28
  %.not79 = icmp eq i32 %97, 0
  br i1 %.not79, label %.thread86, label %98

98:                                               ; preds = %.thread108
  call void @__assert_fail(ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.6, i32 noundef 459, ptr noundef nonnull @__PRETTY_FUNCTION__.lzw_compress) #5
  unreachable

.thread86:                                        ; preds = %20, %88, %.thread108, %94
  %.0 = phi i64 [ %.pr85.pre, %94 ], [ 0, %.thread108 ], [ %89, %88 ], [ %22, %20 ]
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %6) #4
  ret i64 %.0
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @lzw_output_code(ptr noundef, i16 noundef zeroext) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @lzw_string_table_lookup(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @lzw_flush_reservoir(ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { nounwind }
attributes #5 = { 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, !12, i64 16392}
!6 = !{!"lzw_state", !7, i64 0, !12, i64 16392, !12, i64 16393, !13, i64 16400, !13, i64 16408, !8, i64 16416, !8, i64 16420, !13, i64 16424, !13, i64 16432}
!7 = !{!"lzw_string_table", !8, i64 0, !11, i64 4, !11, i64 6, !9, i64 8}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"short", !9, i64 0}
!12 = !{!"_Bool", !9, i64 0}
!13 = !{!"long", !9, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = !{!11, !11, i64 0}
!17 = !{!6, !13, i64 16408}
!18 = !{!6, !13, i64 16400}
!19 = !{!6, !8, i64 0}
!20 = !{!6, !13, i64 16432}
!21 = !{!9, !9, i64 0}
!22 = !{!8, !8, i64 0}
!23 = !{!6, !11, i64 4}
!24 = !{!6, !13, i64 16424}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!6, !11, i64 6}
!28 = !{!6, !8, i64 16420}


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