; LLVM IR from intel/qpl :: sources/isal/igzip (igzip_base)

; 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.isal_zstream = type { ptr, i32, i32, ptr, i32, i32, ptr, i32, i32, ptr, i16, i16, i16, i16, %struct.isal_zstate }
%struct.isal_zstate = type { i32, i32, i32, i32, i32, i32, %struct.BitBuf2, i32, i8, i8, i8, i8, i16, i32, [16 x i8], i32, i32, i32, i32, [65824 x i8], [8192 x i16] }
%struct.BitBuf2 = type { i64, i32, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [75 x i8], align 1
@__PRETTY_FUNCTION__.qpl_isal_deflate_body_base = external hidden unnamed_addr constant [55 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [36 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @qpl_isal_deflate_body_base(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i16, align 2
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  store ptr null, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  store ptr null, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %7) #4
  store i16 0, ptr %7, align 2, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store i64 0, ptr %9, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  store i64 0, ptr %10, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store i64 0, ptr %11, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  store i64 0, ptr %12, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.isal_zstream, ptr %22, i32 0, i32 14
  store ptr %23, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %24 = load ptr, ptr %13, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.isal_zstate, ptr %24, i32 0, i32 20
  %26 = getelementptr inbounds [8192 x i16], ptr %25, i64 0, i64 0
  store ptr %26, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.isal_zstream, ptr %27, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8, !tbaa !15
  %30 = ptrtoint ptr %29 to i64
  %31 = load ptr, ptr %2, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.isal_zstream, ptr %31, i32 0, i32 2
  %33 = load i32, ptr %32, align 4, !tbaa !19
  %34 = zext i32 %33 to i64
  %35 = sub i64 %30, %34
  %36 = inttoptr i64 %35 to ptr
  store ptr %36, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %37 = load ptr, ptr %13, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.isal_zstate, ptr %37, i32 0, i32 3
  %39 = load i32, ptr %38, align 4, !tbaa !20
  store i32 %39, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %40 = load ptr, ptr %13, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.isal_zstate, ptr %40, i32 0, i32 4
  %42 = load i32, ptr %41, align 8, !tbaa !21
  store i32 %42, ptr %17, align 4, !tbaa !9
  %43 = load ptr, ptr %2, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.isal_zstream, ptr %43, i32 0, i32 1
  %45 = load i32, ptr %44, align 8, !tbaa !22
  %46 = icmp eq i32 %45, 0
  br i1 %46, label %47, label %63

47:                                               ; preds = %1
  %48 = load ptr, ptr %2, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.isal_zstream, ptr %48, i32 0, i32 10
  %50 = load i16, ptr %49, align 8, !tbaa !23
  %51 = zext i16 %50 to i32
  %52 = icmp ne i32 %51, 0
  br i1 %52, label %59, label %53

53:                                               ; preds = %47
  %54 = load ptr, ptr %2, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.isal_zstream, ptr %54, i32 0, i32 11
  %56 = load i16, ptr %55, align 2, !tbaa !24
  %57 = zext i16 %56 to i32
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %62

59:                                               ; preds = %53, %47
  %60 = load ptr, ptr %13, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.isal_zstate, ptr %60, i32 0, i32 5
  store i32 4, ptr %61, align 4, !tbaa !25
  br label %62

62:                                               ; preds = %59, %53
  store i32 1, ptr %18, align 4
  br label %249

63:                                               ; preds = %1
  %64 = load ptr, ptr %13, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.isal_zstate, ptr %64, i32 0, i32 6
  %66 = load ptr, ptr %2, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.isal_zstream, ptr %66, i32 0, i32 3
  %68 = load ptr, ptr %67, align 8, !tbaa !26
  %69 = load ptr, ptr %2, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.isal_zstream, ptr %69, i32 0, i32 4
  %71 = load i32, ptr %70, align 8, !tbaa !27
  call void @set_buf(ptr noundef %65, ptr noundef %68, i32 noundef %71)
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %72 = load ptr, ptr %2, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.isal_zstream, ptr %72, i32 0, i32 0
  %74 = load ptr, ptr %73, align 8, !tbaa !15
  store ptr %74, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %75 = load ptr, ptr %19, align 8, !tbaa !5
  %76 = load ptr, ptr %2, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.isal_zstream, ptr %76, i32 0, i32 1
  %78 = load i32, ptr %77, align 8, !tbaa !22
  %79 = zext i32 %78 to i64
  %80 = getelementptr inbounds i8, ptr %75, i64 %79
  store ptr %80, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %81 = load ptr, ptr %19, align 8, !tbaa !5
  store ptr %81, ptr %21, align 8, !tbaa !5
  br label %82

82:                                               ; preds = %208, %179, %63
  %83 = load ptr, ptr %21, align 8, !tbaa !5
  %84 = getelementptr inbounds i8, ptr %83, i64 288
  %85 = load ptr, ptr %20, align 8, !tbaa !5
  %86 = icmp ult ptr %84, %85
  br i1 %86, label %87, label %221

87:                                               ; preds = %82
  %88 = load ptr, ptr %13, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.isal_zstate, ptr %88, i32 0, i32 6
  %90 = call i32 @is_full(ptr noundef %89)
  %91 = icmp ne i32 %90, 0
  br i1 %91, label %92, label %97

92:                                               ; preds = %87
  %93 = load ptr, ptr %2, align 8, !tbaa !5
  %94 = load ptr, ptr %19, align 8, !tbaa !5
  %95 = load ptr, ptr %21, align 8, !tbaa !5
  %96 = load ptr, ptr %20, align 8, !tbaa !5
  call void @update_state(ptr noundef %93, ptr noundef %94, ptr noundef %95, ptr noundef %96)
  store i32 1, ptr %18, align 4
  br label %248

97:                                               ; preds = %87
  %98 = load ptr, ptr %21, align 8, !tbaa !5
  %99 = call i32 @load_u32(ptr noundef %98)
  store i32 %99, ptr %3, align 4, !tbaa !9
  %100 = load i32, ptr %3, align 4, !tbaa !9
  %101 = call i32 @compute_hash(i32 noundef %100)
  %102 = load i32, ptr %17, align 4, !tbaa !9
  %103 = and i32 %101, %102
  store i32 %103, ptr %4, align 4, !tbaa !9
  %104 = load ptr, ptr %21, align 8, !tbaa !5
  %105 = load ptr, ptr %15, align 8, !tbaa !5
  %106 = ptrtoint ptr %104 to i64
  %107 = ptrtoint ptr %105 to i64
  %108 = sub i64 %106, %107
  %109 = load ptr, ptr %14, align 8, !tbaa !5
  %110 = load i32, ptr %4, align 4, !tbaa !9
  %111 = zext i32 %110 to i64
  %112 = getelementptr inbounds i16, ptr %109, i64 %111
  %113 = load i16, ptr %112, align 2, !tbaa !11
  %114 = zext i16 %113 to i64
  %115 = sub nsw i64 %108, %114
  %116 = and i64 %115, 65535
  %117 = trunc i64 %116 to i32
  store i32 %117, ptr %8, align 4, !tbaa !9
  %118 = load ptr, ptr %21, align 8, !tbaa !5
  %119 = load ptr, ptr %15, align 8, !tbaa !5
  %120 = ptrtoint ptr %118 to i64
  %121 = ptrtoint ptr %119 to i64
  %122 = sub i64 %120, %121
  %123 = trunc i64 %122 to i16
  %124 = load ptr, ptr %14, align 8, !tbaa !5
  %125 = load i32, ptr %4, align 4, !tbaa !9
  %126 = zext i32 %125 to i64
  %127 = getelementptr inbounds i16, ptr %124, i64 %126
  store i16 %123, ptr %127, align 2, !tbaa !11
  %128 = load i32, ptr %8, align 4, !tbaa !9
  %129 = sub i32 %128, 1
  %130 = load i32, ptr %16, align 4, !tbaa !9
  %131 = icmp ult i32 %129, %130
  br i1 %131, label %132, label %208

132:                                              ; preds = %97
  %133 = load i32, ptr %8, align 4, !tbaa !9
  %134 = icmp ne i32 %133, 0
  br i1 %134, label %135, label %136

135:                                              ; preds = %132
  br label %137

136:                                              ; preds = %132
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 72, ptr noundef @__PRETTY_FUNCTION__.qpl_isal_deflate_body_base) #5
  unreachable

137:                                              ; preds = %135
  %138 = load ptr, ptr %21, align 8, !tbaa !5
  %139 = load i32, ptr %8, align 4, !tbaa !9
  %140 = zext i32 %139 to i64
  %141 = sub i64 0, %140
  %142 = getelementptr inbounds i8, ptr %138, i64 %141
  %143 = load ptr, ptr %21, align 8, !tbaa !5
  %144 = call i32 @compare258(ptr noundef %142, ptr noundef %143, i32 noundef 258)
  %145 = trunc i32 %144 to i16
  store i16 %145, ptr %7, align 2, !tbaa !11
  %146 = load i16, ptr %7, align 2, !tbaa !11
  %147 = zext i16 %146 to i32
  %148 = icmp sge i32 %147, 4
  br i1 %148, label %149, label %207

149:                                              ; preds = %137
  %150 = load ptr, ptr %21, align 8, !tbaa !5
  store ptr %150, ptr %6, align 8, !tbaa !5
  %151 = load ptr, ptr %6, align 8, !tbaa !5
  %152 = getelementptr inbounds i8, ptr %151, i64 3
  store ptr %152, ptr %5, align 8, !tbaa !5
  %153 = load ptr, ptr %6, align 8, !tbaa !5
  %154 = getelementptr inbounds i8, ptr %153, i32 1
  store ptr %154, ptr %6, align 8, !tbaa !5
  br label %155

155:                                              ; preds = %176, %149
  %156 = load ptr, ptr %6, align 8, !tbaa !5
  %157 = load ptr, ptr %5, align 8, !tbaa !5
  %158 = icmp ult ptr %156, %157
  br i1 %158, label %159, label %179

159:                                              ; preds = %155
  %160 = load ptr, ptr %6, align 8, !tbaa !5
  %161 = call i32 @load_u32(ptr noundef %160)
  store i32 %161, ptr %3, align 4, !tbaa !9
  %162 = load i32, ptr %3, align 4, !tbaa !9
  %163 = call i32 @compute_hash(i32 noundef %162)
  %164 = load i32, ptr %17, align 4, !tbaa !9
  %165 = and i32 %163, %164
  store i32 %165, ptr %4, align 4, !tbaa !9
  %166 = load ptr, ptr %6, align 8, !tbaa !5
  %167 = load ptr, ptr %15, align 8, !tbaa !5
  %168 = ptrtoint ptr %166 to i64
  %169 = ptrtoint ptr %167 to i64
  %170 = sub i64 %168, %169
  %171 = trunc i64 %170 to i16
  %172 = load ptr, ptr %14, align 8, !tbaa !5
  %173 = load i32, ptr %4, align 4, !tbaa !9
  %174 = zext i32 %173 to i64
  %175 = getelementptr inbounds i16, ptr %172, i64 %174
  store i16 %171, ptr %175, align 2, !tbaa !11
  br label %176

176:                                              ; preds = %159
  %177 = load ptr, ptr %6, align 8, !tbaa !5
  %178 = getelementptr inbounds i8, ptr %177, i32 1
  store ptr %178, ptr %6, align 8, !tbaa !5
  br label %155, !llvm.loop !28

179:                                              ; preds = %155
  %180 = load ptr, ptr %2, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.isal_zstream, ptr %180, i32 0, i32 6
  %182 = load ptr, ptr %181, align 8, !tbaa !30
  %183 = load i16, ptr %7, align 2, !tbaa !11
  %184 = zext i16 %183 to i32
  call void @get_len_code(ptr noundef %182, i32 noundef %184, ptr noundef %9, ptr noundef %10)
  %185 = load ptr, ptr %2, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.isal_zstream, ptr %185, i32 0, i32 6
  %187 = load ptr, ptr %186, align 8, !tbaa !30
  %188 = load i32, ptr %8, align 4, !tbaa !9
  call void @get_dist_code(ptr noundef %187, i32 noundef %188, ptr noundef %11, ptr noundef %12)
  %189 = load i64, ptr %11, align 8, !tbaa !13
  %190 = load i64, ptr %10, align 8, !tbaa !13
  %191 = shl i64 %189, %190
  %192 = load i64, ptr %9, align 8, !tbaa !13
  %193 = or i64 %192, %191
  store i64 %193, ptr %9, align 8, !tbaa !13
  %194 = load i64, ptr %12, align 8, !tbaa !13
  %195 = load i64, ptr %10, align 8, !tbaa !13
  %196 = add i64 %195, %194
  store i64 %196, ptr %10, align 8, !tbaa !13
  %197 = load ptr, ptr %13, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.isal_zstate, ptr %197, i32 0, i32 6
  %199 = load i64, ptr %9, align 8, !tbaa !13
  %200 = load i64, ptr %10, align 8, !tbaa !13
  %201 = trunc i64 %200 to i32
  call void @write_bits(ptr noundef %198, i64 noundef %199, i32 noundef %201)
  %202 = load i16, ptr %7, align 2, !tbaa !11
  %203 = zext i16 %202 to i32
  %204 = load ptr, ptr %21, align 8, !tbaa !5
  %205 = sext i32 %203 to i64
  %206 = getelementptr inbounds i8, ptr %204, i64 %205
  store ptr %206, ptr %21, align 8, !tbaa !5
  br label %82, !llvm.loop !31

207:                                              ; preds = %137
  br label %208

208:                                              ; preds = %207, %97
  %209 = load ptr, ptr %2, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.isal_zstream, ptr %209, i32 0, i32 6
  %211 = load ptr, ptr %210, align 8, !tbaa !30
  %212 = load i32, ptr %3, align 4, !tbaa !9
  %213 = and i32 %212, 255
  call void @get_lit_code(ptr noundef %211, i32 noundef %213, ptr noundef %9, ptr noundef %10)
  %214 = load ptr, ptr %13, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.isal_zstate, ptr %214, i32 0, i32 6
  %216 = load i64, ptr %9, align 8, !tbaa !13
  %217 = load i64, ptr %10, align 8, !tbaa !13
  %218 = trunc i64 %217 to i32
  call void @write_bits(ptr noundef %215, i64 noundef %216, i32 noundef %218)
  %219 = load ptr, ptr %21, align 8, !tbaa !5
  %220 = getelementptr inbounds i8, ptr %219, i32 1
  store ptr %220, ptr %21, align 8, !tbaa !5
  br label %82, !llvm.loop !31

221:                                              ; preds = %82
  %222 = load ptr, ptr %2, align 8, !tbaa !5
  %223 = load ptr, ptr %19, align 8, !tbaa !5
  %224 = load ptr, ptr %21, align 8, !tbaa !5
  %225 = load ptr, ptr %20, align 8, !tbaa !5
  call void @update_state(ptr noundef %222, ptr noundef %223, ptr noundef %224, ptr noundef %225)
  %226 = load ptr, ptr %2, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.isal_zstream, ptr %226, i32 0, i32 1
  %228 = load i32, ptr %227, align 8, !tbaa !22
  %229 = icmp ule i32 %228, 288
  br i1 %229, label %230, label %231

230:                                              ; preds = %221
  br label %232

231:                                              ; preds = %221
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 123, ptr noundef @__PRETTY_FUNCTION__.qpl_isal_deflate_body_base) #5
  unreachable

232:                                              ; preds = %230
  %233 = load ptr, ptr %2, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.isal_zstream, ptr %233, i32 0, i32 10
  %235 = load i16, ptr %234, align 8, !tbaa !23
  %236 = zext i16 %235 to i32
  %237 = icmp ne i32 %236, 0
  br i1 %237, label %244, label %238

238:                                              ; preds = %232
  %239 = load ptr, ptr %2, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct.isal_zstream, ptr %239, i32 0, i32 11
  %241 = load i16, ptr %240, align 2, !tbaa !24
  %242 = zext i16 %241 to i32
  %243 = icmp ne i32 %242, 0
  br i1 %243, label %244, label %247

244:                                              ; preds = %238, %232
  %245 = load ptr, ptr %13, align 8, !tbaa !5
  %246 = getelementptr inbounds %struct.isal_zstate, ptr %245, i32 0, i32 5
  store i32 4, ptr %246, align 4, !tbaa !25
  br label %247

247:                                              ; preds = %244, %238
  store i32 0, ptr %18, align 4
  br label %248

248:                                              ; preds = %247, %92
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  br label %249

249:                                              ; preds = %248, %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  %250 = load i32, ptr %18, align 4
  switch i32 %250, label %252 [
    i32 0, label %251
    i32 1, label %251
  ]

251:                                              ; preds = %249, %249
  ret void

252:                                              ; preds = %249
  unreachable
}

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @set_buf(ptr noundef, ptr noundef, i32 noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @is_full(ptr noundef) #2

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @load_u32(ptr noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @compute_hash(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 @compare258(ptr noundef, ptr noundef, i32 noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @get_len_code(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @get_dist_code(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @write_bits(ptr noundef, i64 noundef, i32 noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @get_lit_code(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #2

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

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 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!16, !6, i64 0}
!16 = !{!"isal_zstream", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16, !10, i64 24, !10, i64 28, !6, i64 32, !10, i64 40, !10, i64 44, !6, i64 48, !12, i64 56, !12, i64 58, !12, i64 60, !12, i64 62, !17, i64 64}
!17 = !{!"isal_zstate", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !18, i64 24, !10, i64 64, !7, i64 68, !7, i64 69, !7, i64 70, !7, i64 71, !12, i64 72, !10, i64 76, !7, i64 80, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !7, i64 112, !7, i64 65936}
!18 = !{!"BitBuf2", !14, i64 0, !10, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!19 = !{!16, !10, i64 12}
!20 = !{!17, !10, i64 12}
!21 = !{!17, !10, i64 16}
!22 = !{!16, !10, i64 8}
!23 = !{!16, !12, i64 56}
!24 = !{!16, !12, i64 58}
!25 = !{!17, !10, i64 20}
!26 = !{!16, !6, i64 16}
!27 = !{!16, !10, i64 24}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!16, !6, i64 32}
!31 = distinct !{!31, !29}


; 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 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [75 x i8], align 1
@__PRETTY_FUNCTION__.qpl_isal_deflate_body_base = external hidden unnamed_addr constant [55 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [36 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @qpl_isal_deflate_body_base(ptr noundef %0) local_unnamed_addr #0 {
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  store i64 0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  store i64 0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  store i64 0, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  store i64 0, ptr %5, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 66000
  %7 = load ptr, ptr %0, align 8, !tbaa !9
  %8 = ptrtoint ptr %7 to i64
  %9 = getelementptr inbounds i8, ptr %0, i64 12
  %10 = load i32, ptr %9, align 4, !tbaa !16
  %11 = zext i32 %10 to i64
  %12 = sub i64 %8, %11
  %13 = getelementptr inbounds i8, ptr %0, i64 76
  %14 = load i32, ptr %13, align 4, !tbaa !17
  %15 = getelementptr inbounds i8, ptr %0, i64 80
  %16 = load i32, ptr %15, align 8, !tbaa !18
  %17 = getelementptr inbounds i8, ptr %0, i64 8
  %18 = load i32, ptr %17, align 8, !tbaa !19
  %19 = icmp eq i32 %18, 0
  br i1 %19, label %20, label %28

20:                                               ; preds = %1
  %21 = getelementptr inbounds i8, ptr %0, i64 56
  %22 = load i16, ptr %21, align 8, !tbaa !20
  %.not81 = icmp eq i16 %22, 0
  br i1 %.not81, label %23, label %26

23:                                               ; preds = %20
  %24 = getelementptr inbounds i8, ptr %0, i64 58
  %25 = load i16, ptr %24, align 2, !tbaa !21
  %.not82 = icmp eq i16 %25, 0
  br i1 %.not82, label %111, label %26

26:                                               ; preds = %23, %20
  %27 = getelementptr inbounds i8, ptr %0, i64 84
  store i32 4, ptr %27, align 4, !tbaa !22
  br label %111

28:                                               ; preds = %1
  %29 = getelementptr inbounds i8, ptr %0, i64 88
  %30 = getelementptr inbounds i8, ptr %0, i64 16
  %31 = load ptr, ptr %30, align 8, !tbaa !23
  %32 = getelementptr inbounds i8, ptr %0, i64 24
  %33 = load i32, ptr %32, align 8, !tbaa !24
  tail call void @set_buf(ptr noundef nonnull %29, ptr noundef %31, i32 noundef %33)
  %34 = load ptr, ptr %0, align 8, !tbaa !9
  %35 = load i32, ptr %17, align 8, !tbaa !19
  %36 = zext i32 %35 to i64
  %37 = getelementptr inbounds i8, ptr %34, i64 %36
  %38 = icmp ugt i32 %35, 288
  br i1 %38, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %28
  %39 = getelementptr inbounds i8, ptr %0, i64 32
  br label %40

40:                                               ; preds = %.lr.ph, %.backedge
  %.086 = phi ptr [ %34, %.lr.ph ], [ %91, %.backedge ]
  %41 = call i32 @is_full(ptr noundef nonnull %29)
  %.not78 = icmp eq i32 %41, 0
  br i1 %.not78, label %43, label %42

42:                                               ; preds = %40
  call void @update_state(ptr noundef nonnull %0, ptr noundef %34, ptr noundef %.086, ptr noundef nonnull %37)
  br label %111

43:                                               ; preds = %40
  %44 = call i32 @load_u32(ptr noundef %.086)
  %45 = call i32 @compute_hash(i32 noundef %44)
  %46 = and i32 %45, %16
  %47 = ptrtoint ptr %.086 to i64
  %48 = sub i64 %47, %12
  %49 = zext i32 %46 to i64
  %50 = getelementptr inbounds i16, ptr %6, i64 %49
  %51 = load i16, ptr %50, align 2, !tbaa !25
  %.tr = trunc i64 %48 to i16
  %.narrow = sub i16 %.tr, %51
  %52 = zext i16 %.narrow to i32
  store i16 %.tr, ptr %50, align 2, !tbaa !25
  %53 = add nsw i32 %52, -1
  %54 = icmp ult i32 %53, %14
  br i1 %54, label %55, label %94

55:                                               ; preds = %43
  %.not79 = icmp eq i16 %51, %.tr
  br i1 %.not79, label %56, label %57

56:                                               ; preds = %55
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 72, ptr noundef nonnull @__PRETTY_FUNCTION__.qpl_isal_deflate_body_base) #5
  unreachable

57:                                               ; preds = %55
  %58 = zext i16 %.narrow to i64
  %59 = sub nsw i64 0, %58
  %60 = getelementptr inbounds i8, ptr %.086, i64 %59
  %61 = call i32 @compare258(ptr noundef %60, ptr noundef %.086, i32 noundef 258)
  %62 = and i32 %61, 65535
  %63 = icmp ugt i32 %62, 3
  br i1 %63, label %.preheader.preheader, label %94

.preheader.preheader:                             ; preds = %57
  %.073.ptr = getelementptr inbounds i8, ptr %.086, i64 1
  %64 = call i32 @load_u32(ptr noundef nonnull %.073.ptr)
  %65 = call i32 @compute_hash(i32 noundef %64)
  %66 = and i32 %65, %16
  %67 = ptrtoint ptr %.073.ptr to i64
  %68 = sub i64 %67, %12
  %69 = trunc i64 %68 to i16
  %70 = zext i32 %66 to i64
  %71 = getelementptr inbounds i16, ptr %6, i64 %70
  store i16 %69, ptr %71, align 2, !tbaa !25
  %.073.ptr.1 = getelementptr inbounds i8, ptr %.086, i64 2
  %72 = call i32 @load_u32(ptr noundef nonnull %.073.ptr.1)
  %73 = call i32 @compute_hash(i32 noundef %72)
  %74 = and i32 %73, %16
  %75 = ptrtoint ptr %.073.ptr.1 to i64
  %76 = sub i64 %75, %12
  %77 = trunc i64 %76 to i16
  %78 = zext i32 %74 to i64
  %79 = getelementptr inbounds i16, ptr %6, i64 %78
  store i16 %77, ptr %79, align 2, !tbaa !25
  %80 = load ptr, ptr %39, align 8, !tbaa !26
  call void @get_len_code(ptr noundef %80, i32 noundef %62, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %81 = load ptr, ptr %39, align 8, !tbaa !26
  call void @get_dist_code(ptr noundef %81, i32 noundef %52, ptr noundef nonnull %4, ptr noundef nonnull %5)
  %82 = load i64, ptr %4, align 8, !tbaa !5
  %83 = load i64, ptr %3, align 8, !tbaa !5
  %84 = shl i64 %82, %83
  %85 = load i64, ptr %2, align 8, !tbaa !5
  %86 = or i64 %85, %84
  store i64 %86, ptr %2, align 8, !tbaa !5
  %87 = load i64, ptr %5, align 8, !tbaa !5
  %88 = add i64 %87, %83
  store i64 %88, ptr %3, align 8, !tbaa !5
  %89 = trunc i64 %88 to i32
  call void @write_bits(ptr noundef nonnull %29, i64 noundef %86, i32 noundef %89)
  %90 = zext nneg i32 %62 to i64
  br label %.backedge

.backedge:                                        ; preds = %.preheader.preheader, %94
  %.sink = phi i64 [ %90, %.preheader.preheader ], [ 1, %94 ]
  %91 = getelementptr inbounds i8, ptr %.086, i64 %.sink
  %92 = getelementptr inbounds i8, ptr %91, i64 288
  %93 = icmp ult ptr %92, %37
  br i1 %93, label %40, label %._crit_edge, !llvm.loop !27

94:                                               ; preds = %57, %43
  %95 = load ptr, ptr %39, align 8, !tbaa !26
  %96 = and i32 %44, 255
  call void @get_lit_code(ptr noundef %95, i32 noundef %96, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %97 = load i64, ptr %2, align 8, !tbaa !5
  %98 = load i64, ptr %3, align 8, !tbaa !5
  %99 = trunc i64 %98 to i32
  call void @write_bits(ptr noundef nonnull %29, i64 noundef %97, i32 noundef %99)
  br label %.backedge

._crit_edge:                                      ; preds = %.backedge, %28
  %.0.lcssa = phi ptr [ %34, %28 ], [ %91, %.backedge ]
  call void @update_state(ptr noundef nonnull %0, ptr noundef %34, ptr noundef %.0.lcssa, ptr noundef %37)
  %100 = load i32, ptr %17, align 8, !tbaa !19
  %101 = icmp ult i32 %100, 289
  br i1 %101, label %103, label %102

102:                                              ; preds = %._crit_edge
  call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 123, ptr noundef nonnull @__PRETTY_FUNCTION__.qpl_isal_deflate_body_base) #5
  unreachable

103:                                              ; preds = %._crit_edge
  %104 = getelementptr inbounds i8, ptr %0, i64 56
  %105 = load i16, ptr %104, align 8, !tbaa !20
  %.not = icmp eq i16 %105, 0
  br i1 %.not, label %106, label %109

106:                                              ; preds = %103
  %107 = getelementptr inbounds i8, ptr %0, i64 58
  %108 = load i16, ptr %107, align 2, !tbaa !21
  %.not77 = icmp eq i16 %108, 0
  br i1 %.not77, label %111, label %109

109:                                              ; preds = %106, %103
  %110 = getelementptr inbounds i8, ptr %0, i64 84
  store i32 4, ptr %110, align 4, !tbaa !22
  br label %111

111:                                              ; preds = %42, %109, %106, %23, %26
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  ret void
}

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @set_buf(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @is_full(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @load_u32(ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @compute_hash(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 @compare258(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @get_len_code(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @get_dist_code(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @write_bits(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @get_lit_code(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"isal_zstream", !11, i64 0, !12, i64 8, !12, i64 12, !11, i64 16, !12, i64 24, !12, i64 28, !11, i64 32, !12, i64 40, !12, i64 44, !11, i64 48, !13, i64 56, !13, i64 58, !13, i64 60, !13, i64 62, !14, i64 64}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!"isal_zstate", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !15, i64 24, !12, i64 64, !7, i64 68, !7, i64 69, !7, i64 70, !7, i64 71, !13, i64 72, !12, i64 76, !7, i64 80, !12, i64 96, !12, i64 100, !12, i64 104, !12, i64 108, !7, i64 112, !7, i64 65936}
!15 = !{!"BitBuf2", !6, i64 0, !12, i64 8, !11, i64 16, !11, i64 24, !11, i64 32}
!16 = !{!10, !12, i64 12}
!17 = !{!14, !12, i64 12}
!18 = !{!14, !12, i64 16}
!19 = !{!10, !12, i64 8}
!20 = !{!10, !13, i64 56}
!21 = !{!10, !13, i64 58}
!22 = !{!14, !12, i64 20}
!23 = !{!10, !11, i64 16}
!24 = !{!10, !12, i64 24}
!25 = !{!13, !13, i64 0}
!26 = !{!10, !11, i64 32}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}


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