; LLVM IR from modlfo/AudioEngine :: AudioEngine/JuceLibraryCode/modules/juce_core/zip/zlib/trees.ll (tr_flush_block)

; 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.ct_data_s = type { %union.anon, %union.anon.0 }
%union.anon = type { i16 }
%union.anon.0 = type { i16 }
%struct.internal_state = type { ptr, i32, ptr, i64, ptr, i32, i32, ptr, i32, i8, i32, i32, i32, i32, ptr, i64, ptr, ptr, i32, i32, i32, i32, i32, i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [573 x %struct.ct_data_s], [61 x %struct.ct_data_s], [39 x %struct.ct_data_s], %struct.tree_desc_s, %struct.tree_desc_s, %struct.tree_desc_s, [16 x i16], [573 x i32], i32, i32, [573 x i8], ptr, i32, i32, ptr, i64, i64, i32, i32, i16, i32 }
%struct.tree_desc_s = type { ptr, i32, ptr }
%struct.z_stream_s = type { ptr, i32, i64, ptr, i32, i64, ptr, ptr, ptr, ptr, ptr, i32, i64, i64 }

@static_ltree = external hidden constant [288 x %struct.ct_data_s], align 16
@static_dtree = external hidden constant [30 x %struct.ct_data_s], align 16

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @_tr_flush_block(ptr noundef %0, ptr noundef %1, i64 noundef %2, i32 noundef %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i64 %2, ptr %7, align 8, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #2
  store i32 0, ptr %11, align 4, !tbaa !11
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.internal_state, ptr %16, i32 0, i32 33
  %18 = load i32, ptr %17, align 4, !tbaa !13
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %20, label %59

20:                                               ; preds = %4
  %21 = load i64, ptr %7, align 8, !tbaa !9
  %22 = icmp ugt i64 %21, 0
  br i1 %22, label %23, label %32

23:                                               ; preds = %20
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.internal_state, ptr %24, i32 0, i32 0
  %26 = load ptr, ptr %25, align 8, !tbaa !17
  %27 = getelementptr inbounds %struct.z_stream_s, ptr %26, i32 0, i32 11
  %28 = load i32, ptr %27, align 8, !tbaa !18
  %29 = icmp eq i32 %28, 2
  br i1 %29, label %30, label %32

30:                                               ; preds = %23
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  call void @set_data_type(ptr noundef %31)
  br label %32

32:                                               ; preds = %30, %23, %20
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.internal_state, ptr %34, i32 0, i32 40
  call void @build_tree(ptr noundef %33, ptr noundef %35)
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.internal_state, ptr %37, i32 0, i32 41
  call void @build_tree(ptr noundef %36, ptr noundef %38)
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = call i32 @build_bl_tree(ptr noundef %39)
  store i32 %40, ptr %11, align 4, !tbaa !11
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.internal_state, ptr %41, i32 0, i32 52
  %43 = load i64, ptr %42, align 8, !tbaa !20
  %44 = add i64 %43, 3
  %45 = add i64 %44, 7
  %46 = lshr i64 %45, 3
  store i64 %46, ptr %9, align 8, !tbaa !9
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.internal_state, ptr %47, i32 0, i32 53
  %49 = load i64, ptr %48, align 8, !tbaa !21
  %50 = add i64 %49, 3
  %51 = add i64 %50, 7
  %52 = lshr i64 %51, 3
  store i64 %52, ptr %10, align 8, !tbaa !9
  %53 = load i64, ptr %10, align 8, !tbaa !9
  %54 = load i64, ptr %9, align 8, !tbaa !9
  %55 = icmp ule i64 %53, %54
  br i1 %55, label %56, label %58

56:                                               ; preds = %32
  %57 = load i64, ptr %10, align 8, !tbaa !9
  store i64 %57, ptr %9, align 8, !tbaa !9
  br label %58

58:                                               ; preds = %56, %32
  br label %62

59:                                               ; preds = %4
  %60 = load i64, ptr %7, align 8, !tbaa !9
  %61 = add i64 %60, 5
  store i64 %61, ptr %10, align 8, !tbaa !9
  store i64 %61, ptr %9, align 8, !tbaa !9
  br label %62

62:                                               ; preds = %59, %58
  %63 = load i64, ptr %7, align 8, !tbaa !9
  %64 = add i64 %63, 4
  %65 = load i64, ptr %9, align 8, !tbaa !9
  %66 = icmp ule i64 %64, %65
  br i1 %66, label %67, label %75

67:                                               ; preds = %62
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = icmp ne ptr %68, null
  br i1 %69, label %70, label %75

70:                                               ; preds = %67
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = load i64, ptr %7, align 8, !tbaa !9
  %74 = load i32, ptr %8, align 4, !tbaa !11
  call void @_tr_stored_block(ptr noundef %71, ptr noundef %72, i64 noundef %73, i32 noundef %74)
  br label %290

75:                                               ; preds = %67, %62
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.internal_state, ptr %76, i32 0, i32 34
  %78 = load i32, ptr %77, align 8, !tbaa !22
  %79 = icmp eq i32 %78, 4
  br i1 %79, label %84, label %80

80:                                               ; preds = %75
  %81 = load i64, ptr %10, align 8, !tbaa !9
  %82 = load i64, ptr %9, align 8, !tbaa !9
  %83 = icmp eq i64 %81, %82
  br i1 %83, label %84, label %177

84:                                               ; preds = %80, %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #2
  store i32 3, ptr %12, align 4, !tbaa !11
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.internal_state, ptr %85, i32 0, i32 57
  %87 = load i32, ptr %86, align 4, !tbaa !23
  %88 = load i32, ptr %12, align 4, !tbaa !11
  %89 = sub nsw i32 16, %88
  %90 = icmp sgt i32 %87, %89
  br i1 %90, label %91, label %157

91:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #2
  %92 = load i32, ptr %8, align 4, !tbaa !11
  %93 = add nsw i32 2, %92
  store i32 %93, ptr %13, align 4, !tbaa !11
  %94 = load i32, ptr %13, align 4, !tbaa !11
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.internal_state, ptr %95, i32 0, i32 57
  %97 = load i32, ptr %96, align 4, !tbaa !23
  %98 = shl i32 %94, %97
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.internal_state, ptr %99, i32 0, i32 56
  %101 = load i16, ptr %100, align 8, !tbaa !24
  %102 = zext i16 %101 to i32
  %103 = or i32 %102, %98
  %104 = trunc i32 %103 to i16
  store i16 %104, ptr %100, align 8, !tbaa !24
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.internal_state, ptr %105, i32 0, i32 56
  %107 = load i16, ptr %106, align 8, !tbaa !24
  %108 = zext i16 %107 to i32
  %109 = and i32 %108, 255
  %110 = trunc i32 %109 to i8
  %111 = load ptr, ptr %5, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.internal_state, ptr %111, i32 0, i32 2
  %113 = load ptr, ptr %112, align 8, !tbaa !25
  %114 = load ptr, ptr %5, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.internal_state, ptr %114, i32 0, i32 5
  %116 = load i32, ptr %115, align 8, !tbaa !26
  %117 = add i32 %116, 1
  store i32 %117, ptr %115, align 8, !tbaa !26
  %118 = zext i32 %116 to i64
  %119 = getelementptr inbounds i8, ptr %113, i64 %118
  store i8 %110, ptr %119, align 1, !tbaa !27
  %120 = load ptr, ptr %5, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.internal_state, ptr %120, i32 0, i32 56
  %122 = load i16, ptr %121, align 8, !tbaa !24
  %123 = zext i16 %122 to i32
  %124 = ashr i32 %123, 8
  %125 = trunc i32 %124 to i8
  %126 = load ptr, ptr %5, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.internal_state, ptr %126, i32 0, i32 2
  %128 = load ptr, ptr %127, align 8, !tbaa !25
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.internal_state, ptr %129, i32 0, i32 5
  %131 = load i32, ptr %130, align 8, !tbaa !26
  %132 = add i32 %131, 1
  store i32 %132, ptr %130, align 8, !tbaa !26
  %133 = zext i32 %131 to i64
  %134 = getelementptr inbounds i8, ptr %128, i64 %133
  store i8 %125, ptr %134, align 1, !tbaa !27
  %135 = load i32, ptr %13, align 4, !tbaa !11
  %136 = trunc i32 %135 to i16
  %137 = zext i16 %136 to i32
  %138 = load ptr, ptr %5, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.internal_state, ptr %138, i32 0, i32 57
  %140 = load i32, ptr %139, align 4, !tbaa !23
  %141 = sext i32 %140 to i64
  %142 = sub i64 16, %141
  %143 = trunc i64 %142 to i32
  %144 = ashr i32 %137, %143
  %145 = trunc i32 %144 to i16
  %146 = load ptr, ptr %5, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.internal_state, ptr %146, i32 0, i32 56
  store i16 %145, ptr %147, align 8, !tbaa !24
  %148 = load i32, ptr %12, align 4, !tbaa !11
  %149 = sext i32 %148 to i64
  %150 = sub i64 %149, 16
  %151 = load ptr, ptr %5, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.internal_state, ptr %151, i32 0, i32 57
  %153 = load i32, ptr %152, align 4, !tbaa !23
  %154 = sext i32 %153 to i64
  %155 = add i64 %154, %150
  %156 = trunc i64 %155 to i32
  store i32 %156, ptr %152, align 4, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #2
  br label %175

157:                                              ; preds = %84
  %158 = load i32, ptr %8, align 4, !tbaa !11
  %159 = add nsw i32 2, %158
  %160 = load ptr, ptr %5, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.internal_state, ptr %160, i32 0, i32 57
  %162 = load i32, ptr %161, align 4, !tbaa !23
  %163 = shl i32 %159, %162
  %164 = load ptr, ptr %5, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.internal_state, ptr %164, i32 0, i32 56
  %166 = load i16, ptr %165, align 8, !tbaa !24
  %167 = zext i16 %166 to i32
  %168 = or i32 %167, %163
  %169 = trunc i32 %168 to i16
  store i16 %169, ptr %165, align 8, !tbaa !24
  %170 = load i32, ptr %12, align 4, !tbaa !11
  %171 = load ptr, ptr %5, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.internal_state, ptr %171, i32 0, i32 57
  %173 = load i32, ptr %172, align 4, !tbaa !23
  %174 = add nsw i32 %173, %170
  store i32 %174, ptr %172, align 4, !tbaa !23
  br label %175

175:                                              ; preds = %157, %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #2
  %176 = load ptr, ptr %5, align 8, !tbaa !5
  call void @compress_block(ptr noundef %176, ptr noundef @static_ltree, ptr noundef @static_dtree)
  br label %289

177:                                              ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #2
  store i32 3, ptr %14, align 4, !tbaa !11
  %178 = load ptr, ptr %5, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.internal_state, ptr %178, i32 0, i32 57
  %180 = load i32, ptr %179, align 4, !tbaa !23
  %181 = load i32, ptr %14, align 4, !tbaa !11
  %182 = sub nsw i32 16, %181
  %183 = icmp sgt i32 %180, %182
  br i1 %183, label %184, label %250

184:                                              ; preds = %177
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #2
  %185 = load i32, ptr %8, align 4, !tbaa !11
  %186 = add nsw i32 4, %185
  store i32 %186, ptr %15, align 4, !tbaa !11
  %187 = load i32, ptr %15, align 4, !tbaa !11
  %188 = load ptr, ptr %5, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.internal_state, ptr %188, i32 0, i32 57
  %190 = load i32, ptr %189, align 4, !tbaa !23
  %191 = shl i32 %187, %190
  %192 = load ptr, ptr %5, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.internal_state, ptr %192, i32 0, i32 56
  %194 = load i16, ptr %193, align 8, !tbaa !24
  %195 = zext i16 %194 to i32
  %196 = or i32 %195, %191
  %197 = trunc i32 %196 to i16
  store i16 %197, ptr %193, align 8, !tbaa !24
  %198 = load ptr, ptr %5, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.internal_state, ptr %198, i32 0, i32 56
  %200 = load i16, ptr %199, align 8, !tbaa !24
  %201 = zext i16 %200 to i32
  %202 = and i32 %201, 255
  %203 = trunc i32 %202 to i8
  %204 = load ptr, ptr %5, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.internal_state, ptr %204, i32 0, i32 2
  %206 = load ptr, ptr %205, align 8, !tbaa !25
  %207 = load ptr, ptr %5, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.internal_state, ptr %207, i32 0, i32 5
  %209 = load i32, ptr %208, align 8, !tbaa !26
  %210 = add i32 %209, 1
  store i32 %210, ptr %208, align 8, !tbaa !26
  %211 = zext i32 %209 to i64
  %212 = getelementptr inbounds i8, ptr %206, i64 %211
  store i8 %203, ptr %212, align 1, !tbaa !27
  %213 = load ptr, ptr %5, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.internal_state, ptr %213, i32 0, i32 56
  %215 = load i16, ptr %214, align 8, !tbaa !24
  %216 = zext i16 %215 to i32
  %217 = ashr i32 %216, 8
  %218 = trunc i32 %217 to i8
  %219 = load ptr, ptr %5, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.internal_state, ptr %219, i32 0, i32 2
  %221 = load ptr, ptr %220, align 8, !tbaa !25
  %222 = load ptr, ptr %5, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.internal_state, ptr %222, i32 0, i32 5
  %224 = load i32, ptr %223, align 8, !tbaa !26
  %225 = add i32 %224, 1
  store i32 %225, ptr %223, align 8, !tbaa !26
  %226 = zext i32 %224 to i64
  %227 = getelementptr inbounds i8, ptr %221, i64 %226
  store i8 %218, ptr %227, align 1, !tbaa !27
  %228 = load i32, ptr %15, align 4, !tbaa !11
  %229 = trunc i32 %228 to i16
  %230 = zext i16 %229 to i32
  %231 = load ptr, ptr %5, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.internal_state, ptr %231, i32 0, i32 57
  %233 = load i32, ptr %232, align 4, !tbaa !23
  %234 = sext i32 %233 to i64
  %235 = sub i64 16, %234
  %236 = trunc i64 %235 to i32
  %237 = ashr i32 %230, %236
  %238 = trunc i32 %237 to i16
  %239 = load ptr, ptr %5, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct.internal_state, ptr %239, i32 0, i32 56
  store i16 %238, ptr %240, align 8, !tbaa !24
  %241 = load i32, ptr %14, align 4, !tbaa !11
  %242 = sext i32 %241 to i64
  %243 = sub i64 %242, 16
  %244 = load ptr, ptr %5, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.internal_state, ptr %244, i32 0, i32 57
  %246 = load i32, ptr %245, align 4, !tbaa !23
  %247 = sext i32 %246 to i64
  %248 = add i64 %247, %243
  %249 = trunc i64 %248 to i32
  store i32 %249, ptr %245, align 4, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #2
  br label %268

250:                                              ; preds = %177
  %251 = load i32, ptr %8, align 4, !tbaa !11
  %252 = add nsw i32 4, %251
  %253 = load ptr, ptr %5, align 8, !tbaa !5
  %254 = getelementptr inbounds %struct.internal_state, ptr %253, i32 0, i32 57
  %255 = load i32, ptr %254, align 4, !tbaa !23
  %256 = shl i32 %252, %255
  %257 = load ptr, ptr %5, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.internal_state, ptr %257, i32 0, i32 56
  %259 = load i16, ptr %258, align 8, !tbaa !24
  %260 = zext i16 %259 to i32
  %261 = or i32 %260, %256
  %262 = trunc i32 %261 to i16
  store i16 %262, ptr %258, align 8, !tbaa !24
  %263 = load i32, ptr %14, align 4, !tbaa !11
  %264 = load ptr, ptr %5, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct.internal_state, ptr %264, i32 0, i32 57
  %266 = load i32, ptr %265, align 4, !tbaa !23
  %267 = add nsw i32 %266, %263
  store i32 %267, ptr %265, align 4, !tbaa !23
  br label %268

268:                                              ; preds = %250, %184
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #2
  %269 = load ptr, ptr %5, align 8, !tbaa !5
  %270 = load ptr, ptr %5, align 8, !tbaa !5
  %271 = getelementptr inbounds %struct.internal_state, ptr %270, i32 0, i32 40
  %272 = getelementptr inbounds %struct.tree_desc_s, ptr %271, i32 0, i32 1
  %273 = load i32, ptr %272, align 8, !tbaa !28
  %274 = add nsw i32 %273, 1
  %275 = load ptr, ptr %5, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct.internal_state, ptr %275, i32 0, i32 41
  %277 = getelementptr inbounds %struct.tree_desc_s, ptr %276, i32 0, i32 1
  %278 = load i32, ptr %277, align 8, !tbaa !29
  %279 = add nsw i32 %278, 1
  %280 = load i32, ptr %11, align 4, !tbaa !11
  %281 = add nsw i32 %280, 1
  call void @send_all_trees(ptr noundef %269, i32 noundef %274, i32 noundef %279, i32 noundef %281)
  %282 = load ptr, ptr %5, align 8, !tbaa !5
  %283 = load ptr, ptr %5, align 8, !tbaa !5
  %284 = getelementptr inbounds %struct.internal_state, ptr %283, i32 0, i32 37
  %285 = getelementptr inbounds [573 x %struct.ct_data_s], ptr %284, i64 0, i64 0
  %286 = load ptr, ptr %5, align 8, !tbaa !5
  %287 = getelementptr inbounds %struct.internal_state, ptr %286, i32 0, i32 38
  %288 = getelementptr inbounds [61 x %struct.ct_data_s], ptr %287, i64 0, i64 0
  call void @compress_block(ptr noundef %282, ptr noundef %285, ptr noundef %288)
  br label %289

289:                                              ; preds = %268, %175
  br label %290

290:                                              ; preds = %289, %70
  %291 = load ptr, ptr %5, align 8, !tbaa !5
  call void @init_block(ptr noundef %291)
  %292 = load i32, ptr %8, align 4, !tbaa !11
  %293 = icmp ne i32 %292, 0
  br i1 %293, label %294, label %296

294:                                              ; preds = %290
  %295 = load ptr, ptr %5, align 8, !tbaa !5
  call void @bi_windup(ptr noundef %295)
  br label %296

296:                                              ; preds = %294, %290
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #2
  ret void
}

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

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

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

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

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 180}
!14 = !{!"internal_state", !6, i64 0, !12, i64 8, !6, i64 16, !10, i64 24, !6, i64 32, !12, i64 40, !12, i64 44, !6, i64 48, !12, i64 56, !7, i64 60, !12, i64 64, !12, i64 68, !12, i64 72, !12, i64 76, !6, i64 80, !10, i64 88, !6, i64 96, !6, i64 104, !12, i64 112, !12, i64 116, !12, i64 120, !12, i64 124, !12, i64 128, !10, i64 136, !12, i64 144, !12, i64 148, !12, i64 152, !12, i64 156, !12, i64 160, !12, i64 164, !12, i64 168, !12, i64 172, !12, i64 176, !12, i64 180, !12, i64 184, !12, i64 188, !12, i64 192, !7, i64 196, !7, i64 2488, !7, i64 2732, !15, i64 2888, !15, i64 2912, !15, i64 2936, !7, i64 2960, !7, i64 2992, !12, i64 5284, !12, i64 5288, !7, i64 5292, !6, i64 5872, !12, i64 5880, !12, i64 5884, !6, i64 5888, !10, i64 5896, !10, i64 5904, !12, i64 5912, !12, i64 5916, !16, i64 5920, !12, i64 5924}
!15 = !{!"tree_desc_s", !6, i64 0, !12, i64 8, !6, i64 16}
!16 = !{!"short", !7, i64 0}
!17 = !{!14, !6, i64 0}
!18 = !{!19, !12, i64 88}
!19 = !{!"z_stream_s", !6, i64 0, !12, i64 8, !10, i64 16, !6, i64 24, !12, i64 32, !10, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !12, i64 88, !10, i64 96, !10, i64 104}
!20 = !{!14, !10, i64 5896}
!21 = !{!14, !10, i64 5904}
!22 = !{!14, !12, i64 184}
!23 = !{!14, !12, i64 5924}
!24 = !{!14, !16, i64 5920}
!25 = !{!14, !6, i64 16}
!26 = !{!14, !12, i64 40}
!27 = !{!7, !7, i64 0}
!28 = !{!14, !12, i64 2896}
!29 = !{!14, !12, i64 2920}


; 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.ct_data_s = type { %union.anon, %union.anon.0 }
%union.anon = type { i16 }
%union.anon.0 = type { i16 }

@static_ltree = external hidden constant [288 x %struct.ct_data_s], align 16
@static_dtree = external hidden constant [30 x %struct.ct_data_s], align 16

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

; Function Attrs: nounwind uwtable
declare dso_local void @_tr_stored_block(ptr noundef, ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @_tr_flush_block(ptr noundef %0, ptr noundef %1, i64 noundef %2, i32 noundef %3) local_unnamed_addr #0 {
  %5 = getelementptr inbounds i8, ptr %0, i64 180
  %6 = load i32, ptr %5, align 4, !tbaa !5
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %8, label %28

8:                                                ; preds = %4
  %.not = icmp eq i64 %2, 0
  br i1 %.not, label %15, label %9

9:                                                ; preds = %8
  %10 = load ptr, ptr %0, align 8, !tbaa !14
  %11 = getelementptr inbounds i8, ptr %10, i64 88
  %12 = load i32, ptr %11, align 8, !tbaa !15
  %13 = icmp eq i32 %12, 2
  br i1 %13, label %14, label %15

14:                                               ; preds = %9
  tail call void @set_data_type(ptr noundef nonnull %0)
  br label %15

15:                                               ; preds = %14, %9, %8
  %16 = getelementptr inbounds i8, ptr %0, i64 2888
  tail call void @build_tree(ptr noundef nonnull %0, ptr noundef nonnull %16)
  %17 = getelementptr inbounds i8, ptr %0, i64 2912
  tail call void @build_tree(ptr noundef nonnull %0, ptr noundef nonnull %17)
  %18 = tail call i32 @build_bl_tree(ptr noundef nonnull %0)
  %19 = getelementptr inbounds i8, ptr %0, i64 5896
  %20 = load i64, ptr %19, align 8, !tbaa !17
  %21 = add i64 %20, 10
  %22 = lshr i64 %21, 3
  %23 = getelementptr inbounds i8, ptr %0, i64 5904
  %24 = load i64, ptr %23, align 8, !tbaa !18
  %25 = add i64 %24, 10
  %26 = lshr i64 %25, 3
  %spec.select = tail call i64 @llvm.umin.i64(i64 %26, i64 %22)
  %27 = add nsw i32 %18, 1
  br label %30

28:                                               ; preds = %4
  %29 = add i64 %2, 5
  br label %30

30:                                               ; preds = %15, %28
  %.081 = phi i32 [ 1, %28 ], [ %27, %15 ]
  %.080 = phi i64 [ %29, %28 ], [ %26, %15 ]
  %.0 = phi i64 [ %29, %28 ], [ %spec.select, %15 ]
  %31 = add i64 %2, 4
  %32 = icmp ule i64 %31, %.0
  %33 = icmp ne ptr %1, null
  %or.cond = and i1 %33, %32
  br i1 %or.cond, label %34, label %35

34:                                               ; preds = %30
  tail call void @_tr_stored_block(ptr noundef nonnull %0, ptr noundef nonnull %1, i64 noundef %2, i32 noundef %3)
  br label %115

35:                                               ; preds = %30
  %36 = getelementptr inbounds i8, ptr %0, i64 184
  %37 = load i32, ptr %36, align 8, !tbaa !19
  %38 = icmp eq i32 %37, 4
  %39 = icmp eq i64 %.080, %.0
  %or.cond92 = or i1 %39, %38
  %40 = getelementptr inbounds i8, ptr %0, i64 5924
  %41 = load i32, ptr %40, align 4, !tbaa !20
  %42 = icmp sgt i32 %41, 13
  %43 = getelementptr inbounds i8, ptr %0, i64 5920
  %44 = load i16, ptr %43, align 8, !tbaa !21
  br i1 %or.cond92, label %45, label %76

45:                                               ; preds = %35
  %46 = add nsw i32 %3, 2
  %47 = shl i32 %46, %41
  %48 = trunc i32 %47 to i16
  %49 = or i16 %44, %48
  store i16 %49, ptr %43, align 8, !tbaa !21
  br i1 %42, label %50, label %73

50:                                               ; preds = %45
  %51 = trunc i16 %49 to i8
  %52 = getelementptr inbounds i8, ptr %0, i64 16
  %53 = load ptr, ptr %52, align 8, !tbaa !22
  %54 = getelementptr inbounds i8, ptr %0, i64 40
  %55 = load i32, ptr %54, align 8, !tbaa !23
  %56 = add i32 %55, 1
  store i32 %56, ptr %54, align 8, !tbaa !23
  %57 = zext i32 %55 to i64
  %58 = getelementptr inbounds i8, ptr %53, i64 %57
  store i8 %51, ptr %58, align 1, !tbaa !24
  %59 = load i16, ptr %43, align 8, !tbaa !21
  %60 = lshr i16 %59, 8
  %61 = trunc nuw i16 %60 to i8
  %62 = load ptr, ptr %52, align 8, !tbaa !22
  %63 = load i32, ptr %54, align 8, !tbaa !23
  %64 = add i32 %63, 1
  store i32 %64, ptr %54, align 8, !tbaa !23
  %65 = zext i32 %63 to i64
  %66 = getelementptr inbounds i8, ptr %62, i64 %65
  store i8 %61, ptr %66, align 1, !tbaa !24
  %67 = and i32 %46, 65535
  %68 = load i32, ptr %40, align 4, !tbaa !20
  %69 = sub i32 16, %68
  %70 = lshr i32 %67, %69
  %71 = trunc nuw i32 %70 to i16
  store i16 %71, ptr %43, align 8, !tbaa !21
  %72 = add i32 %68, -13
  br label %75

73:                                               ; preds = %45
  %74 = add nsw i32 %41, 3
  br label %75

75:                                               ; preds = %73, %50
  %storemerge90 = phi i32 [ %74, %73 ], [ %72, %50 ]
  store i32 %storemerge90, ptr %40, align 4, !tbaa !20
  tail call void @compress_block(ptr noundef nonnull %0, ptr noundef nonnull @static_ltree, ptr noundef nonnull @static_dtree)
  br label %115

76:                                               ; preds = %35
  %77 = add nsw i32 %3, 4
  %78 = shl i32 %77, %41
  %79 = trunc i32 %78 to i16
  %80 = or i16 %44, %79
  store i16 %80, ptr %43, align 8, !tbaa !21
  br i1 %42, label %81, label %104

81:                                               ; preds = %76
  %82 = trunc i16 %80 to i8
  %83 = getelementptr inbounds i8, ptr %0, i64 16
  %84 = load ptr, ptr %83, align 8, !tbaa !22
  %85 = getelementptr inbounds i8, ptr %0, i64 40
  %86 = load i32, ptr %85, align 8, !tbaa !23
  %87 = add i32 %86, 1
  store i32 %87, ptr %85, align 8, !tbaa !23
  %88 = zext i32 %86 to i64
  %89 = getelementptr inbounds i8, ptr %84, i64 %88
  store i8 %82, ptr %89, align 1, !tbaa !24
  %90 = load i16, ptr %43, align 8, !tbaa !21
  %91 = lshr i16 %90, 8
  %92 = trunc nuw i16 %91 to i8
  %93 = load ptr, ptr %83, align 8, !tbaa !22
  %94 = load i32, ptr %85, align 8, !tbaa !23
  %95 = add i32 %94, 1
  store i32 %95, ptr %85, align 8, !tbaa !23
  %96 = zext i32 %94 to i64
  %97 = getelementptr inbounds i8, ptr %93, i64 %96
  store i8 %92, ptr %97, align 1, !tbaa !24
  %98 = and i32 %77, 65535
  %99 = load i32, ptr %40, align 4, !tbaa !20
  %100 = sub i32 16, %99
  %101 = lshr i32 %98, %100
  %102 = trunc nuw i32 %101 to i16
  store i16 %102, ptr %43, align 8, !tbaa !21
  %103 = add i32 %99, -13
  br label %106

104:                                              ; preds = %76
  %105 = add nsw i32 %41, 3
  br label %106

106:                                              ; preds = %104, %81
  %storemerge = phi i32 [ %105, %104 ], [ %103, %81 ]
  store i32 %storemerge, ptr %40, align 4, !tbaa !20
  %107 = getelementptr inbounds i8, ptr %0, i64 2896
  %108 = load i32, ptr %107, align 8, !tbaa !25
  %109 = add nsw i32 %108, 1
  %110 = getelementptr inbounds i8, ptr %0, i64 2920
  %111 = load i32, ptr %110, align 8, !tbaa !26
  %112 = add nsw i32 %111, 1
  tail call void @send_all_trees(ptr noundef nonnull %0, i32 noundef %109, i32 noundef %112, i32 noundef %.081)
  %113 = getelementptr inbounds i8, ptr %0, i64 196
  %114 = getelementptr inbounds i8, ptr %0, i64 2488
  tail call void @compress_block(ptr noundef nonnull %0, ptr noundef nonnull %113, ptr noundef nonnull %114)
  br label %115

115:                                              ; preds = %75, %106, %34
  tail call void @init_block(ptr noundef nonnull %0)
  %.not91 = icmp eq i32 %3, 0
  br i1 %.not91, label %117, label %116

116:                                              ; preds = %115
  tail call void @bi_windup(ptr noundef nonnull %0)
  br label %117

117:                                              ; preds = %116, %115
  ret void
}

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

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #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 speculatable willreturn memory(none) }

!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, !10, i64 180}
!6 = !{!"internal_state", !7, i64 0, !10, i64 8, !7, i64 16, !11, i64 24, !7, i64 32, !10, i64 40, !10, i64 44, !7, i64 48, !10, i64 56, !8, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !7, i64 80, !11, i64 88, !7, i64 96, !7, i64 104, !10, i64 112, !10, i64 116, !10, i64 120, !10, i64 124, !10, i64 128, !11, i64 136, !10, i64 144, !10, i64 148, !10, i64 152, !10, i64 156, !10, i64 160, !10, i64 164, !10, i64 168, !10, i64 172, !10, i64 176, !10, i64 180, !10, i64 184, !10, i64 188, !10, i64 192, !8, i64 196, !8, i64 2488, !8, i64 2732, !12, i64 2888, !12, i64 2912, !12, i64 2936, !8, i64 2960, !8, i64 2992, !10, i64 5284, !10, i64 5288, !8, i64 5292, !7, i64 5872, !10, i64 5880, !10, i64 5884, !7, i64 5888, !11, i64 5896, !11, i64 5904, !10, i64 5912, !10, i64 5916, !13, i64 5920, !10, i64 5924}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!"tree_desc_s", !7, i64 0, !10, i64 8, !7, i64 16}
!13 = !{!"short", !8, i64 0}
!14 = !{!6, !7, i64 0}
!15 = !{!16, !10, i64 88}
!16 = !{!"z_stream_s", !7, i64 0, !10, i64 8, !11, i64 16, !7, i64 24, !10, i64 32, !11, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !10, i64 88, !11, i64 96, !11, i64 104}
!17 = !{!6, !11, i64 5896}
!18 = !{!6, !11, i64 5904}
!19 = !{!6, !10, i64 184}
!20 = !{!6, !10, i64 5924}
!21 = !{!6, !13, i64 5920}
!22 = !{!6, !7, i64 16}
!23 = !{!6, !10, i64 40}
!24 = !{!8, !8, i64 0}
!25 = !{!6, !10, i64 2896}
!26 = !{!6, !10, i64 2920}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass