; LLVM IR from fhanau/Efficient-Compression-Tool :: src/zlib (deflate)

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @deflateEnd(ptr noundef) #1

; 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 i32 @deflateStateCheck(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @deflateCopy(ptr noundef %0, ptr noundef %1, i8 noundef zeroext %2) #1 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i8, align 1
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i8 %2, ptr %7, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  %16 = call i32 @deflateStateCheck(ptr noundef %15)
  %17 = icmp ne i32 %16, 0
  br i1 %17, label %21, label %18

18:                                               ; preds = %3
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = icmp eq ptr %19, null
  br i1 %20, label %21, label %22

21:                                               ; preds = %18, %3
  store i32 -2, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %238

22:                                               ; preds = %18
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.z_stream_s, ptr %23, i32 0, i32 7
  %25 = load ptr, ptr %24, align 8, !tbaa !10
  store ptr %25, ptr %9, align 8, !tbaa !5
  %26 = load i8, ptr %7, align 1, !tbaa !9
  %27 = icmp ne i8 %26, 0
  br i1 %27, label %28, label %47

28:                                               ; preds = %22
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %29, ptr align 1 %30, i64 112, i1 false)
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.z_stream_s, ptr %31, i32 0, i32 8
  %33 = load ptr, ptr %32, align 8, !tbaa !14
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.z_stream_s, ptr %34, i32 0, i32 10
  %36 = load ptr, ptr %35, align 8, !tbaa !15
  %37 = call ptr %33(ptr noundef %36, i32 noundef 1, i32 noundef 5944)
  store ptr %37, ptr %8, align 8, !tbaa !5
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  %39 = icmp eq ptr %38, null
  br i1 %39, label %40, label %41

40:                                               ; preds = %28
  store i32 -4, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %238

41:                                               ; preds = %28
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.z_stream_s, ptr %43, i32 0, i32 7
  store ptr %42, ptr %44, align 8, !tbaa !10
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  %46 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %45, ptr align 1 %46, i64 5944, i1 false)
  br label %82

47:                                               ; preds = %22
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.z_stream_s, ptr %48, i32 0, i32 7
  %50 = load ptr, ptr %49, align 8, !tbaa !10
  store ptr %50, ptr %8, align 8, !tbaa !5
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %51, ptr align 1 %52, i64 112, i1 false)
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.z_stream_s, ptr %54, i32 0, i32 7
  store ptr %53, ptr %55, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.internal_state, ptr %56, i32 0, i32 14
  %58 = load ptr, ptr %57, align 8, !tbaa !16
  store ptr %58, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.internal_state, ptr %59, i32 0, i32 16
  %61 = load ptr, ptr %60, align 8, !tbaa !19
  store ptr %61, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %62 = load ptr, ptr %8, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.internal_state, ptr %62, i32 0, i32 17
  %64 = load ptr, ptr %63, align 8, !tbaa !20
  store ptr %64, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.internal_state, ptr %65, i32 0, i32 2
  %67 = load ptr, ptr %66, align 8, !tbaa !21
  store ptr %67, ptr %14, align 8, !tbaa !5
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %68, ptr align 1 %69, i64 5944, i1 false)
  %70 = load ptr, ptr %11, align 8, !tbaa !5
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.internal_state, ptr %71, i32 0, i32 14
  store ptr %70, ptr %72, align 8, !tbaa !16
  %73 = load ptr, ptr %12, align 8, !tbaa !5
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.internal_state, ptr %74, i32 0, i32 16
  store ptr %73, ptr %75, align 8, !tbaa !19
  %76 = load ptr, ptr %13, align 8, !tbaa !5
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.internal_state, ptr %77, i32 0, i32 17
  store ptr %76, ptr %78, align 8, !tbaa !20
  %79 = load ptr, ptr %14, align 8, !tbaa !5
  %80 = load ptr, ptr %8, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.internal_state, ptr %80, i32 0, i32 2
  store ptr %79, ptr %81, align 8, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  br label %82

82:                                               ; preds = %47, %41
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = load ptr, ptr %8, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.internal_state, ptr %84, i32 0, i32 0
  store ptr %83, ptr %85, align 8, !tbaa !22
  %86 = load i8, ptr %7, align 1, !tbaa !9
  %87 = icmp ne i8 %86, 0
  br i1 %87, label %88, label %137

88:                                               ; preds = %82
  %89 = load ptr, ptr %5, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.z_stream_s, ptr %89, i32 0, i32 8
  %91 = load ptr, ptr %90, align 8, !tbaa !14
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.z_stream_s, ptr %92, i32 0, i32 10
  %94 = load ptr, ptr %93, align 8, !tbaa !15
  %95 = load ptr, ptr %8, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.internal_state, ptr %95, i32 0, i32 11
  %97 = load i32, ptr %96, align 4, !tbaa !23
  %98 = call ptr %91(ptr noundef %94, i32 noundef %97, i32 noundef 2)
  %99 = load ptr, ptr %8, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.internal_state, ptr %99, i32 0, i32 14
  store ptr %98, ptr %100, align 8, !tbaa !16
  %101 = load ptr, ptr %5, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.z_stream_s, ptr %101, i32 0, i32 8
  %103 = load ptr, ptr %102, align 8, !tbaa !14
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.z_stream_s, ptr %104, i32 0, i32 10
  %106 = load ptr, ptr %105, align 8, !tbaa !15
  %107 = load ptr, ptr %8, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.internal_state, ptr %107, i32 0, i32 11
  %109 = load i32, ptr %108, align 4, !tbaa !23
  %110 = call ptr %103(ptr noundef %106, i32 noundef %109, i32 noundef 2)
  %111 = load ptr, ptr %8, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.internal_state, ptr %111, i32 0, i32 16
  store ptr %110, ptr %112, align 8, !tbaa !19
  %113 = load ptr, ptr %5, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.z_stream_s, ptr %113, i32 0, i32 8
  %115 = load ptr, ptr %114, align 8, !tbaa !14
  %116 = load ptr, ptr %5, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.z_stream_s, ptr %116, i32 0, i32 10
  %118 = load ptr, ptr %117, align 8, !tbaa !15
  %119 = load ptr, ptr %8, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.internal_state, ptr %119, i32 0, i32 19
  %121 = load i32, ptr %120, align 4, !tbaa !24
  %122 = call ptr %115(ptr noundef %118, i32 noundef %121, i32 noundef 2)
  %123 = load ptr, ptr %8, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.internal_state, ptr %123, i32 0, i32 17
  store ptr %122, ptr %124, align 8, !tbaa !20
  %125 = load ptr, ptr %5, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.z_stream_s, ptr %125, i32 0, i32 8
  %127 = load ptr, ptr %126, align 8, !tbaa !14
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.z_stream_s, ptr %128, i32 0, i32 10
  %130 = load ptr, ptr %129, align 8, !tbaa !15
  %131 = load ptr, ptr %8, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.internal_state, ptr %131, i32 0, i32 49
  %133 = load i32, ptr %132, align 8, !tbaa !25
  %134 = call ptr %127(ptr noundef %130, i32 noundef %133, i32 noundef 4)
  %135 = load ptr, ptr %8, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.internal_state, ptr %135, i32 0, i32 2
  store ptr %134, ptr %136, align 8, !tbaa !21
  br label %137

137:                                              ; preds = %88, %82
  %138 = load ptr, ptr %8, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.internal_state, ptr %138, i32 0, i32 14
  %140 = load ptr, ptr %139, align 8, !tbaa !16
  %141 = icmp eq ptr %140, null
  br i1 %141, label %157, label %142

142:                                              ; preds = %137
  %143 = load ptr, ptr %8, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.internal_state, ptr %143, i32 0, i32 16
  %145 = load ptr, ptr %144, align 8, !tbaa !19
  %146 = icmp eq ptr %145, null
  br i1 %146, label %157, label %147

147:                                              ; preds = %142
  %148 = load ptr, ptr %8, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.internal_state, ptr %148, i32 0, i32 17
  %150 = load ptr, ptr %149, align 8, !tbaa !20
  %151 = icmp eq ptr %150, null
  br i1 %151, label %157, label %152

152:                                              ; preds = %147
  %153 = load ptr, ptr %8, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.internal_state, ptr %153, i32 0, i32 2
  %155 = load ptr, ptr %154, align 8, !tbaa !21
  %156 = icmp eq ptr %155, null
  br i1 %156, label %157, label %160

157:                                              ; preds = %152, %147, %142, %137
  %158 = load ptr, ptr %5, align 8, !tbaa !5
  %159 = call i32 @deflateEnd(ptr noundef %158)
  store i32 -4, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %238

160:                                              ; preds = %152
  %161 = load ptr, ptr %8, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.internal_state, ptr %161, i32 0, i32 14
  %163 = load ptr, ptr %162, align 8, !tbaa !16
  %164 = load ptr, ptr %9, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.internal_state, ptr %164, i32 0, i32 14
  %166 = load ptr, ptr %165, align 8, !tbaa !16
  %167 = load ptr, ptr %8, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.internal_state, ptr %167, i32 0, i32 11
  %169 = load i32, ptr %168, align 4, !tbaa !23
  %170 = mul i32 %169, 2
  %171 = zext i32 %170 to i64
  %172 = mul i64 %171, 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %163, ptr align 1 %166, i64 %172, i1 false)
  %173 = load ptr, ptr %8, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.internal_state, ptr %173, i32 0, i32 16
  %175 = load ptr, ptr %174, align 8, !tbaa !19
  %176 = load ptr, ptr %9, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.internal_state, ptr %176, i32 0, i32 16
  %178 = load ptr, ptr %177, align 8, !tbaa !19
  %179 = load ptr, ptr %8, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.internal_state, ptr %179, i32 0, i32 11
  %181 = load i32, ptr %180, align 4, !tbaa !23
  %182 = zext i32 %181 to i64
  %183 = mul i64 %182, 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %175, ptr align 1 %178, i64 %183, i1 false)
  %184 = load ptr, ptr %8, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.internal_state, ptr %184, i32 0, i32 17
  %186 = load ptr, ptr %185, align 8, !tbaa !20
  %187 = load ptr, ptr %9, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.internal_state, ptr %187, i32 0, i32 17
  %189 = load ptr, ptr %188, align 8, !tbaa !20
  %190 = load ptr, ptr %8, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.internal_state, ptr %190, i32 0, i32 19
  %192 = load i32, ptr %191, align 4, !tbaa !24
  %193 = zext i32 %192 to i64
  %194 = mul i64 %193, 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %186, ptr align 1 %189, i64 %194, i1 false)
  %195 = load ptr, ptr %8, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.internal_state, ptr %195, i32 0, i32 2
  %197 = load ptr, ptr %196, align 8, !tbaa !21
  %198 = load ptr, ptr %9, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.internal_state, ptr %198, i32 0, i32 4
  %200 = load ptr, ptr %199, align 8, !tbaa !26
  %201 = load ptr, ptr %9, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.internal_state, ptr %201, i32 0, i32 2
  %203 = load ptr, ptr %202, align 8, !tbaa !21
  %204 = ptrtoint ptr %200 to i64
  %205 = ptrtoint ptr %203 to i64
  %206 = sub i64 %204, %205
  %207 = getelementptr inbounds i8, ptr %197, i64 %206
  %208 = load ptr, ptr %8, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.internal_state, ptr %208, i32 0, i32 4
  store ptr %207, ptr %209, align 8, !tbaa !26
  %210 = load ptr, ptr %8, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.internal_state, ptr %210, i32 0, i32 2
  %212 = load ptr, ptr %211, align 8, !tbaa !21
  %213 = load ptr, ptr %8, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.internal_state, ptr %213, i32 0, i32 49
  %215 = load i32, ptr %214, align 8, !tbaa !25
  %216 = zext i32 %215 to i64
  %217 = getelementptr inbounds i8, ptr %212, i64 %216
  %218 = load ptr, ptr %8, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.internal_state, ptr %218, i32 0, i32 48
  store ptr %217, ptr %219, align 8, !tbaa !27
  %220 = load ptr, ptr %8, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.internal_state, ptr %220, i32 0, i32 37
  %222 = getelementptr inbounds [573 x %struct.ct_data_s], ptr %221, i64 0, i64 0
  %223 = load ptr, ptr %8, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.internal_state, ptr %223, i32 0, i32 40
  %225 = getelementptr inbounds %struct.tree_desc_s, ptr %224, i32 0, i32 0
  store ptr %222, ptr %225, align 8, !tbaa !28
  %226 = load ptr, ptr %8, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.internal_state, ptr %226, i32 0, i32 38
  %228 = getelementptr inbounds [61 x %struct.ct_data_s], ptr %227, i64 0, i64 0
  %229 = load ptr, ptr %8, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.internal_state, ptr %229, i32 0, i32 41
  %231 = getelementptr inbounds %struct.tree_desc_s, ptr %230, i32 0, i32 0
  store ptr %228, ptr %231, align 8, !tbaa !29
  %232 = load ptr, ptr %8, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct.internal_state, ptr %232, i32 0, i32 39
  %234 = getelementptr inbounds [39 x %struct.ct_data_s], ptr %233, i64 0, i64 0
  %235 = load ptr, ptr %8, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.internal_state, ptr %235, i32 0, i32 42
  %237 = getelementptr inbounds %struct.tree_desc_s, ptr %236, i32 0, i32 0
  store ptr %234, ptr %237, align 8, !tbaa !30
  store i32 0, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %238

238:                                              ; preds = %160, %157, %40, %21
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %239 = load i32, ptr %4, align 4
  ret i32 %239
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = !{!7, !7, i64 0}
!10 = !{!11, !6, i64 56}
!11 = !{!"z_stream_s", !6, i64 0, !12, i64 8, !13, i64 16, !6, i64 24, !12, i64 32, !13, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !12, i64 88, !13, i64 96, !13, i64 104}
!12 = !{!"int", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!11, !6, i64 64}
!15 = !{!11, !6, i64 80}
!16 = !{!17, !6, i64 80}
!17 = !{!"internal_state", !6, i64 0, !12, i64 8, !6, i64 16, !13, 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, !12, i64 88, !6, i64 96, !6, i64 104, !12, i64 112, !12, i64 116, !12, i64 120, !12, i64 124, !12, i64 128, !13, 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, !18, i64 2888, !18, i64 2912, !18, 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, !12, i64 5888, !13, i64 5896, !13, i64 5904, !12, i64 5912, !12, i64 5916, !13, i64 5920, !12, i64 5928, !13, i64 5936}
!18 = !{!"tree_desc_s", !6, i64 0, !12, i64 8, !6, i64 16}
!19 = !{!17, !6, i64 96}
!20 = !{!17, !6, i64 104}
!21 = !{!17, !6, i64 16}
!22 = !{!17, !6, i64 0}
!23 = !{!17, !12, i64 68}
!24 = !{!17, !12, i64 116}
!25 = !{!17, !12, i64 5880}
!26 = !{!17, !6, i64 32}
!27 = !{!17, !6, i64 5872}
!28 = !{!17, !6, i64 2888}
!29 = !{!17, !6, i64 2912}
!30 = !{!17, !6, i64 2936}


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

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -4, 1) i32 @deflateCopy(ptr noundef %0, ptr noundef %1, i8 noundef zeroext %2) local_unnamed_addr #0 {
  %4 = tail call i32 @deflateStateCheck(ptr noundef %1)
  %5 = icmp ne i32 %4, 0
  %6 = icmp eq ptr %0, null
  %or.cond = or i1 %6, %5
  br i1 %or.cond, label %107, label %7

7:                                                ; preds = %3
  %8 = getelementptr inbounds i8, ptr %1, i64 56
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %.not = icmp eq i8 %2, 0
  br i1 %.not, label %.thread, label %10

10:                                               ; preds = %7
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(112) %0, ptr noundef nonnull align 1 dereferenceable(112) %1, i64 112, i1 false)
  %11 = getelementptr inbounds i8, ptr %0, i64 64
  %12 = load ptr, ptr %11, align 8, !tbaa !12
  %13 = getelementptr inbounds i8, ptr %0, i64 80
  %14 = load ptr, ptr %13, align 8, !tbaa !13
  %15 = tail call ptr %12(ptr noundef %14, i32 noundef 1, i32 noundef 5944) #2
  %16 = icmp eq ptr %15, null
  br i1 %16, label %107, label %25

.thread:                                          ; preds = %7
  %17 = getelementptr inbounds i8, ptr %0, i64 56
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(112) %0, ptr noundef nonnull align 1 dereferenceable(112) %1, i64 112, i1 false)
  store ptr %18, ptr %17, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %18, i64 80
  %20 = load ptr, ptr %19, align 8, !tbaa !14
  %21 = getelementptr inbounds i8, ptr %18, i64 96
  %22 = getelementptr inbounds i8, ptr %18, i64 16
  %23 = load ptr, ptr %22, align 8, !tbaa !17
  %24 = load <2 x ptr>, ptr %21, align 8, !tbaa !18
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(5944) %18, ptr noundef nonnull align 1 dereferenceable(5944) %9, i64 5944, i1 false)
  store ptr %20, ptr %19, align 8, !tbaa !14
  store <2 x ptr> %24, ptr %21, align 8, !tbaa !18
  store ptr %23, ptr %22, align 8, !tbaa !17
  store ptr %0, ptr %18, align 8, !tbaa !19
  br label %50

25:                                               ; preds = %10
  %26 = getelementptr inbounds i8, ptr %0, i64 56
  store ptr %15, ptr %26, align 8, !tbaa !5
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(5944) %15, ptr noundef nonnull align 1 dereferenceable(5944) %9, i64 5944, i1 false)
  store ptr %0, ptr %15, align 8, !tbaa !19
  %27 = load ptr, ptr %11, align 8, !tbaa !12
  %28 = load ptr, ptr %13, align 8, !tbaa !13
  %29 = getelementptr inbounds i8, ptr %15, i64 68
  %30 = load i32, ptr %29, align 4, !tbaa !20
  %31 = tail call ptr %27(ptr noundef %28, i32 noundef %30, i32 noundef 2) #2
  %32 = getelementptr inbounds i8, ptr %15, i64 80
  store ptr %31, ptr %32, align 8, !tbaa !14
  %33 = load ptr, ptr %11, align 8, !tbaa !12
  %34 = load ptr, ptr %13, align 8, !tbaa !13
  %35 = load i32, ptr %29, align 4, !tbaa !20
  %36 = tail call ptr %33(ptr noundef %34, i32 noundef %35, i32 noundef 2) #2
  %37 = getelementptr inbounds i8, ptr %15, i64 96
  store ptr %36, ptr %37, align 8, !tbaa !21
  %38 = load ptr, ptr %11, align 8, !tbaa !12
  %39 = load ptr, ptr %13, align 8, !tbaa !13
  %40 = getelementptr inbounds i8, ptr %15, i64 116
  %41 = load i32, ptr %40, align 4, !tbaa !22
  %42 = tail call ptr %38(ptr noundef %39, i32 noundef %41, i32 noundef 2) #2
  %43 = getelementptr inbounds i8, ptr %15, i64 104
  store ptr %42, ptr %43, align 8, !tbaa !23
  %44 = load ptr, ptr %11, align 8, !tbaa !12
  %45 = load ptr, ptr %13, align 8, !tbaa !13
  %46 = getelementptr inbounds i8, ptr %15, i64 5880
  %47 = load i32, ptr %46, align 8, !tbaa !24
  %48 = tail call ptr %44(ptr noundef %45, i32 noundef %47, i32 noundef 4) #2
  %49 = getelementptr inbounds i8, ptr %15, i64 16
  store ptr %48, ptr %49, align 8, !tbaa !17
  %.pre = load ptr, ptr %32, align 8, !tbaa !14
  br label %50

50:                                               ; preds = %.thread, %25
  %51 = phi ptr [ %23, %.thread ], [ %48, %25 ]
  %52 = phi ptr [ %20, %.thread ], [ %.pre, %25 ]
  %.07984 = phi ptr [ %18, %.thread ], [ %15, %25 ]
  %53 = icmp eq ptr %52, null
  br i1 %53, label %63, label %54

54:                                               ; preds = %50
  %55 = getelementptr inbounds i8, ptr %.07984, i64 96
  %56 = load ptr, ptr %55, align 8, !tbaa !21
  %57 = icmp eq ptr %56, null
  br i1 %57, label %63, label %58

58:                                               ; preds = %54
  %59 = getelementptr inbounds i8, ptr %.07984, i64 104
  %60 = load ptr, ptr %59, align 8, !tbaa !23
  %61 = icmp eq ptr %60, null
  %62 = icmp eq ptr %51, null
  %or.cond85 = select i1 %61, i1 true, i1 %62
  br i1 %or.cond85, label %63, label %65

63:                                               ; preds = %58, %54, %50
  %64 = tail call i32 @deflateEnd(ptr noundef nonnull %0)
  br label %107

65:                                               ; preds = %58
  %66 = getelementptr inbounds i8, ptr %.07984, i64 16
  %67 = getelementptr inbounds i8, ptr %9, i64 80
  %68 = load ptr, ptr %67, align 8, !tbaa !14
  %69 = getelementptr inbounds i8, ptr %.07984, i64 68
  %70 = load i32, ptr %69, align 4, !tbaa !20
  %71 = shl i32 %70, 1
  %72 = zext i32 %71 to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %52, ptr align 1 %68, i64 %72, i1 false)
  %73 = load ptr, ptr %55, align 8, !tbaa !21
  %74 = getelementptr inbounds i8, ptr %9, i64 96
  %75 = load ptr, ptr %74, align 8, !tbaa !21
  %76 = load i32, ptr %69, align 4, !tbaa !20
  %77 = zext i32 %76 to i64
  %78 = shl nuw nsw i64 %77, 1
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %73, ptr align 1 %75, i64 %78, i1 false)
  %79 = load ptr, ptr %59, align 8, !tbaa !23
  %80 = getelementptr inbounds i8, ptr %9, i64 104
  %81 = load ptr, ptr %80, align 8, !tbaa !23
  %82 = getelementptr inbounds i8, ptr %.07984, i64 116
  %83 = load i32, ptr %82, align 4, !tbaa !22
  %84 = zext i32 %83 to i64
  %85 = shl nuw nsw i64 %84, 1
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %79, ptr align 1 %81, i64 %85, i1 false)
  %86 = load ptr, ptr %66, align 8, !tbaa !17
  %87 = getelementptr inbounds i8, ptr %9, i64 32
  %88 = load ptr, ptr %87, align 8, !tbaa !25
  %89 = getelementptr inbounds i8, ptr %9, i64 16
  %90 = load ptr, ptr %89, align 8, !tbaa !17
  %91 = ptrtoint ptr %88 to i64
  %92 = ptrtoint ptr %90 to i64
  %93 = sub i64 %91, %92
  %94 = getelementptr inbounds i8, ptr %86, i64 %93
  %95 = getelementptr inbounds i8, ptr %.07984, i64 32
  store ptr %94, ptr %95, align 8, !tbaa !25
  %96 = getelementptr inbounds i8, ptr %.07984, i64 5880
  %97 = load i32, ptr %96, align 8, !tbaa !24
  %98 = zext i32 %97 to i64
  %99 = getelementptr inbounds i8, ptr %86, i64 %98
  %100 = getelementptr inbounds i8, ptr %.07984, i64 5872
  store ptr %99, ptr %100, align 8, !tbaa !26
  %101 = getelementptr inbounds i8, ptr %.07984, i64 196
  %102 = getelementptr inbounds i8, ptr %.07984, i64 2888
  store ptr %101, ptr %102, align 8, !tbaa !27
  %103 = getelementptr inbounds i8, ptr %.07984, i64 2488
  %104 = getelementptr inbounds i8, ptr %.07984, i64 2912
  store ptr %103, ptr %104, align 8, !tbaa !28
  %105 = getelementptr inbounds i8, ptr %.07984, i64 2732
  %106 = getelementptr inbounds i8, ptr %.07984, i64 2936
  store ptr %105, ptr %106, align 8, !tbaa !29
  br label %107

107:                                              ; preds = %10, %3, %65, %63
  %.0 = phi i32 [ -4, %63 ], [ 0, %65 ], [ -2, %3 ], [ -4, %10 ]
  ret i32 %.0
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #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 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, !7, i64 56}
!6 = !{!"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}
!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 = !{!6, !7, i64 64}
!13 = !{!6, !7, i64 80}
!14 = !{!15, !7, i64 80}
!15 = !{!"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, !10, 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, !16, i64 2888, !16, i64 2912, !16, 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, !10, i64 5888, !11, i64 5896, !11, i64 5904, !10, i64 5912, !10, i64 5916, !11, i64 5920, !10, i64 5928, !11, i64 5936}
!16 = !{!"tree_desc_s", !7, i64 0, !10, i64 8, !7, i64 16}
!17 = !{!15, !7, i64 16}
!18 = !{!7, !7, i64 0}
!19 = !{!15, !7, i64 0}
!20 = !{!15, !10, i64 68}
!21 = !{!15, !7, i64 96}
!22 = !{!15, !10, i64 116}
!23 = !{!15, !7, i64 104}
!24 = !{!15, !10, i64 5880}
!25 = !{!15, !7, i64 32}
!26 = !{!15, !7, i64 5872}
!27 = !{!15, !7, i64 2888}
!28 = !{!15, !7, i64 2912}
!29 = !{!15, !7, i64 2936}


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