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

@deflateInit2_.my_version = external hidden constant [16 x i8], align 16
@z_errmsg = external constant [10 x ptr], align 16

; Function Attrs: nounwind uwtable
define dso_local i32 @deflateInit2_(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, ptr noundef %6, i32 noundef %7) #0 {
  %9 = alloca i32, align 4
  %10 = alloca ptr, 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
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  store ptr %0, ptr %10, align 8, !tbaa !5
  store i32 %1, ptr %11, align 4, !tbaa !9
  store i32 %2, ptr %12, align 4, !tbaa !9
  store i32 %3, ptr %13, align 4, !tbaa !9
  store i32 %4, ptr %14, align 4, !tbaa !9
  store i32 %5, ptr %15, align 4, !tbaa !9
  store ptr %6, ptr %16, align 8, !tbaa !5
  store i32 %7, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #3
  store i32 1, ptr %19, align 4, !tbaa !9
  %21 = load ptr, ptr %16, align 8, !tbaa !5
  %22 = icmp eq ptr %21, null
  br i1 %22, label %35, label %23

23:                                               ; preds = %8
  %24 = load ptr, ptr %16, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %24, i64 0
  %26 = load i8, ptr %25, align 1, !tbaa !11
  %27 = sext i8 %26 to i32
  %28 = load i8, ptr @deflateInit2_.my_version, align 16, !tbaa !11
  %29 = sext i8 %28 to i32
  %30 = icmp ne i32 %27, %29
  br i1 %30, label %35, label %31

31:                                               ; preds = %23
  %32 = load i32, ptr %17, align 4, !tbaa !9
  %33 = sext i32 %32 to i64
  %34 = icmp ne i64 %33, 112
  br i1 %34, label %35, label %36

35:                                               ; preds = %31, %23, %8
  store i32 -6, ptr %9, align 4
  store i32 1, ptr %20, align 4
  br label %289

36:                                               ; preds = %31
  %37 = load ptr, ptr %10, align 8, !tbaa !5
  %38 = icmp eq ptr %37, null
  br i1 %38, label %39, label %40

39:                                               ; preds = %36
  store i32 -2, ptr %9, align 4
  store i32 1, ptr %20, align 4
  br label %289

40:                                               ; preds = %36
  %41 = load ptr, ptr %10, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.z_stream_s, ptr %41, i32 0, i32 6
  store ptr null, ptr %42, align 8, !tbaa !12
  %43 = load ptr, ptr %10, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.z_stream_s, ptr %43, i32 0, i32 8
  %45 = load ptr, ptr %44, align 8, !tbaa !15
  %46 = icmp eq ptr %45, null
  br i1 %46, label %47, label %52

47:                                               ; preds = %40
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.z_stream_s, ptr %48, i32 0, i32 8
  store ptr @zcalloc, ptr %49, align 8, !tbaa !15
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.z_stream_s, ptr %50, i32 0, i32 10
  store ptr null, ptr %51, align 8, !tbaa !16
  br label %52

52:                                               ; preds = %47, %40
  %53 = load ptr, ptr %10, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.z_stream_s, ptr %53, i32 0, i32 9
  %55 = load ptr, ptr %54, align 8, !tbaa !17
  %56 = icmp eq ptr %55, null
  br i1 %56, label %57, label %60

57:                                               ; preds = %52
  %58 = load ptr, ptr %10, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.z_stream_s, ptr %58, i32 0, i32 9
  store ptr @zcfree, ptr %59, align 8, !tbaa !17
  br label %60

60:                                               ; preds = %57, %52
  %61 = load i32, ptr %11, align 4, !tbaa !9
  %62 = icmp eq i32 %61, -1
  br i1 %62, label %63, label %64

63:                                               ; preds = %60
  store i32 6, ptr %11, align 4, !tbaa !9
  br label %64

64:                                               ; preds = %63, %60
  %65 = load i32, ptr %13, align 4, !tbaa !9
  %66 = icmp slt i32 %65, 0
  br i1 %66, label %67, label %74

67:                                               ; preds = %64
  store i32 0, ptr %19, align 4, !tbaa !9
  %68 = load i32, ptr %13, align 4, !tbaa !9
  %69 = icmp slt i32 %68, -15
  br i1 %69, label %70, label %71

70:                                               ; preds = %67
  store i32 -2, ptr %9, align 4
  store i32 1, ptr %20, align 4
  br label %289

71:                                               ; preds = %67
  %72 = load i32, ptr %13, align 4, !tbaa !9
  %73 = sub nsw i32 0, %72
  store i32 %73, ptr %13, align 4, !tbaa !9
  br label %74

74:                                               ; preds = %71, %64
  %75 = load i32, ptr %14, align 4, !tbaa !9
  %76 = icmp slt i32 %75, 1
  br i1 %76, label %101, label %77

77:                                               ; preds = %74
  %78 = load i32, ptr %14, align 4, !tbaa !9
  %79 = icmp sgt i32 %78, 9
  br i1 %79, label %101, label %80

80:                                               ; preds = %77
  %81 = load i32, ptr %12, align 4, !tbaa !9
  %82 = icmp ne i32 %81, 8
  br i1 %82, label %101, label %83

83:                                               ; preds = %80
  %84 = load i32, ptr %13, align 4, !tbaa !9
  %85 = icmp slt i32 %84, 8
  br i1 %85, label %101, label %86

86:                                               ; preds = %83
  %87 = load i32, ptr %13, align 4, !tbaa !9
  %88 = icmp sgt i32 %87, 15
  br i1 %88, label %101, label %89

89:                                               ; preds = %86
  %90 = load i32, ptr %11, align 4, !tbaa !9
  %91 = icmp slt i32 %90, 0
  br i1 %91, label %101, label %92

92:                                               ; preds = %89
  %93 = load i32, ptr %11, align 4, !tbaa !9
  %94 = icmp sgt i32 %93, 9
  br i1 %94, label %101, label %95

95:                                               ; preds = %92
  %96 = load i32, ptr %15, align 4, !tbaa !9
  %97 = icmp slt i32 %96, 0
  br i1 %97, label %101, label %98

98:                                               ; preds = %95
  %99 = load i32, ptr %15, align 4, !tbaa !9
  %100 = icmp sgt i32 %99, 4
  br i1 %100, label %101, label %102

101:                                              ; preds = %98, %95, %92, %89, %86, %83, %80, %77, %74
  store i32 -2, ptr %9, align 4
  store i32 1, ptr %20, align 4
  br label %289

102:                                              ; preds = %98
  %103 = load i32, ptr %13, align 4, !tbaa !9
  %104 = icmp eq i32 %103, 8
  br i1 %104, label %105, label %106

105:                                              ; preds = %102
  store i32 9, ptr %13, align 4, !tbaa !9
  br label %106

106:                                              ; preds = %105, %102
  %107 = load ptr, ptr %10, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.z_stream_s, ptr %107, i32 0, i32 8
  %109 = load ptr, ptr %108, align 8, !tbaa !15
  %110 = load ptr, ptr %10, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.z_stream_s, ptr %110, i32 0, i32 10
  %112 = load ptr, ptr %111, align 8, !tbaa !16
  %113 = call ptr %109(ptr noundef %112, i32 noundef 1, i32 noundef 5944)
  store ptr %113, ptr %18, align 8, !tbaa !5
  %114 = load ptr, ptr %18, align 8, !tbaa !5
  %115 = icmp eq ptr %114, null
  br i1 %115, label %116, label %117

116:                                              ; preds = %106
  store i32 -4, ptr %9, align 4
  store i32 1, ptr %20, align 4
  br label %289

117:                                              ; preds = %106
  %118 = load ptr, ptr %18, align 8, !tbaa !5
  %119 = load ptr, ptr %10, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.z_stream_s, ptr %119, i32 0, i32 7
  store ptr %118, ptr %120, align 8, !tbaa !18
  %121 = load ptr, ptr %10, align 8, !tbaa !5
  %122 = load ptr, ptr %18, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.internal_state, ptr %122, i32 0, i32 0
  store ptr %121, ptr %123, align 8, !tbaa !19
  %124 = load ptr, ptr %18, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.internal_state, ptr %124, i32 0, i32 1
  store i32 42, ptr %125, align 8, !tbaa !22
  %126 = load i32, ptr %19, align 4, !tbaa !9
  %127 = load ptr, ptr %18, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.internal_state, ptr %127, i32 0, i32 6
  store i32 %126, ptr %128, align 4, !tbaa !23
  %129 = load ptr, ptr %18, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.internal_state, ptr %129, i32 0, i32 7
  store ptr null, ptr %130, align 8, !tbaa !24
  %131 = load i32, ptr %13, align 4, !tbaa !9
  %132 = load ptr, ptr %18, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.internal_state, ptr %132, i32 0, i32 12
  store i32 %131, ptr %133, align 8, !tbaa !25
  %134 = load ptr, ptr %18, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.internal_state, ptr %134, i32 0, i32 12
  %136 = load i32, ptr %135, align 8, !tbaa !25
  %137 = shl i32 1, %136
  %138 = load ptr, ptr %18, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.internal_state, ptr %138, i32 0, i32 11
  store i32 %137, ptr %139, align 4, !tbaa !26
  %140 = load ptr, ptr %18, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.internal_state, ptr %140, i32 0, i32 11
  %142 = load i32, ptr %141, align 4, !tbaa !26
  %143 = sub i32 %142, 1
  %144 = load ptr, ptr %18, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.internal_state, ptr %144, i32 0, i32 13
  store i32 %143, ptr %145, align 4, !tbaa !27
  %146 = load i32, ptr %14, align 4, !tbaa !9
  %147 = add nsw i32 %146, 7
  %148 = load ptr, ptr %18, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.internal_state, ptr %148, i32 0, i32 20
  store i32 %147, ptr %149, align 8, !tbaa !28
  %150 = load ptr, ptr %18, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.internal_state, ptr %150, i32 0, i32 20
  %152 = load i32, ptr %151, align 8, !tbaa !28
  %153 = shl i32 1, %152
  %154 = load ptr, ptr %18, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.internal_state, ptr %154, i32 0, i32 19
  store i32 %153, ptr %155, align 4, !tbaa !29
  %156 = load ptr, ptr %18, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.internal_state, ptr %156, i32 0, i32 19
  %158 = load i32, ptr %157, align 4, !tbaa !29
  %159 = sub i32 %158, 1
  %160 = load ptr, ptr %18, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.internal_state, ptr %160, i32 0, i32 21
  store i32 %159, ptr %161, align 4, !tbaa !30
  %162 = load ptr, ptr %18, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.internal_state, ptr %162, i32 0, i32 20
  %164 = load i32, ptr %163, align 8, !tbaa !28
  %165 = add i32 %164, 3
  %166 = sub i32 %165, 1
  %167 = udiv i32 %166, 3
  %168 = load ptr, ptr %18, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.internal_state, ptr %168, i32 0, i32 22
  store i32 %167, ptr %169, align 8, !tbaa !31
  %170 = load ptr, ptr %10, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.z_stream_s, ptr %170, i32 0, i32 8
  %172 = load ptr, ptr %171, align 8, !tbaa !15
  %173 = load ptr, ptr %10, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.z_stream_s, ptr %173, i32 0, i32 10
  %175 = load ptr, ptr %174, align 8, !tbaa !16
  %176 = load ptr, ptr %18, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.internal_state, ptr %176, i32 0, i32 11
  %178 = load i32, ptr %177, align 4, !tbaa !26
  %179 = call ptr %172(ptr noundef %175, i32 noundef %178, i32 noundef 2)
  %180 = load ptr, ptr %18, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.internal_state, ptr %180, i32 0, i32 14
  store ptr %179, ptr %181, align 8, !tbaa !32
  %182 = load ptr, ptr %10, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.z_stream_s, ptr %182, i32 0, i32 8
  %184 = load ptr, ptr %183, align 8, !tbaa !15
  %185 = load ptr, ptr %10, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.z_stream_s, ptr %185, i32 0, i32 10
  %187 = load ptr, ptr %186, align 8, !tbaa !16
  %188 = load ptr, ptr %18, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.internal_state, ptr %188, i32 0, i32 11
  %190 = load i32, ptr %189, align 4, !tbaa !26
  %191 = call ptr %184(ptr noundef %187, i32 noundef %190, i32 noundef 2)
  %192 = load ptr, ptr %18, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.internal_state, ptr %192, i32 0, i32 16
  store ptr %191, ptr %193, align 8, !tbaa !33
  %194 = load ptr, ptr %10, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.z_stream_s, ptr %194, i32 0, i32 8
  %196 = load ptr, ptr %195, align 8, !tbaa !15
  %197 = load ptr, ptr %10, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.z_stream_s, ptr %197, i32 0, i32 10
  %199 = load ptr, ptr %198, align 8, !tbaa !16
  %200 = load ptr, ptr %18, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.internal_state, ptr %200, i32 0, i32 19
  %202 = load i32, ptr %201, align 4, !tbaa !29
  %203 = call ptr %196(ptr noundef %199, i32 noundef %202, i32 noundef 2)
  %204 = load ptr, ptr %18, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.internal_state, ptr %204, i32 0, i32 17
  store ptr %203, ptr %205, align 8, !tbaa !34
  %206 = load ptr, ptr %18, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.internal_state, ptr %206, i32 0, i32 58
  store i64 0, ptr %207, align 8, !tbaa !35
  %208 = load i32, ptr %14, align 4, !tbaa !9
  %209 = add nsw i32 %208, 6
  %210 = shl i32 1, %209
  %211 = load ptr, ptr %18, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.internal_state, ptr %211, i32 0, i32 49
  store i32 %210, ptr %212, align 8, !tbaa !36
  %213 = load ptr, ptr %10, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.z_stream_s, ptr %213, i32 0, i32 8
  %215 = load ptr, ptr %214, align 8, !tbaa !15
  %216 = load ptr, ptr %10, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.z_stream_s, ptr %216, i32 0, i32 10
  %218 = load ptr, ptr %217, align 8, !tbaa !16
  %219 = load ptr, ptr %18, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.internal_state, ptr %219, i32 0, i32 49
  %221 = load i32, ptr %220, align 8, !tbaa !36
  %222 = call ptr %215(ptr noundef %218, i32 noundef %221, i32 noundef 4)
  %223 = load ptr, ptr %18, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.internal_state, ptr %223, i32 0, i32 2
  store ptr %222, ptr %224, align 8, !tbaa !37
  %225 = load ptr, ptr %18, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.internal_state, ptr %225, i32 0, i32 49
  %227 = load i32, ptr %226, align 8, !tbaa !36
  %228 = zext i32 %227 to i64
  %229 = mul i64 %228, 4
  %230 = load ptr, ptr %18, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.internal_state, ptr %230, i32 0, i32 3
  store i64 %229, ptr %231, align 8, !tbaa !38
  %232 = load ptr, ptr %18, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct.internal_state, ptr %232, i32 0, i32 14
  %234 = load ptr, ptr %233, align 8, !tbaa !32
  %235 = icmp eq ptr %234, null
  br i1 %235, label %251, label %236

236:                                              ; preds = %117
  %237 = load ptr, ptr %18, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.internal_state, ptr %237, i32 0, i32 16
  %239 = load ptr, ptr %238, align 8, !tbaa !33
  %240 = icmp eq ptr %239, null
  br i1 %240, label %251, label %241

241:                                              ; preds = %236
  %242 = load ptr, ptr %18, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct.internal_state, ptr %242, i32 0, i32 17
  %244 = load ptr, ptr %243, align 8, !tbaa !34
  %245 = icmp eq ptr %244, null
  br i1 %245, label %251, label %246

246:                                              ; preds = %241
  %247 = load ptr, ptr %18, align 8, !tbaa !5
  %248 = getelementptr inbounds %struct.internal_state, ptr %247, i32 0, i32 2
  %249 = load ptr, ptr %248, align 8, !tbaa !37
  %250 = icmp eq ptr %249, null
  br i1 %250, label %251, label %259

251:                                              ; preds = %246, %241, %236, %117
  %252 = load ptr, ptr %18, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.internal_state, ptr %252, i32 0, i32 1
  store i32 666, ptr %253, align 8, !tbaa !22
  %254 = load ptr, ptr getelementptr inbounds ([10 x ptr], ptr @z_errmsg, i64 0, i64 6), align 16, !tbaa !5
  %255 = load ptr, ptr %10, align 8, !tbaa !5
  %256 = getelementptr inbounds %struct.z_stream_s, ptr %255, i32 0, i32 6
  store ptr %254, ptr %256, align 8, !tbaa !12
  %257 = load ptr, ptr %10, align 8, !tbaa !5
  %258 = call i32 @deflateEnd(ptr noundef %257)
  store i32 -4, ptr %9, align 4
  store i32 1, ptr %20, align 4
  br label %289

259:                                              ; preds = %246
  %260 = load ptr, ptr %18, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.internal_state, ptr %260, i32 0, i32 2
  %262 = load ptr, ptr %261, align 8, !tbaa !37
  %263 = load ptr, ptr %18, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.internal_state, ptr %263, i32 0, i32 49
  %265 = load i32, ptr %264, align 8, !tbaa !36
  %266 = zext i32 %265 to i64
  %267 = getelementptr inbounds i8, ptr %262, i64 %266
  %268 = load ptr, ptr %18, align 8, !tbaa !5
  %269 = getelementptr inbounds %struct.internal_state, ptr %268, i32 0, i32 48
  store ptr %267, ptr %269, align 8, !tbaa !39
  %270 = load ptr, ptr %18, align 8, !tbaa !5
  %271 = getelementptr inbounds %struct.internal_state, ptr %270, i32 0, i32 49
  %272 = load i32, ptr %271, align 8, !tbaa !36
  %273 = sub i32 %272, 1
  %274 = mul i32 %273, 3
  %275 = load ptr, ptr %18, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct.internal_state, ptr %275, i32 0, i32 51
  store i32 %274, ptr %276, align 8, !tbaa !40
  %277 = load i32, ptr %11, align 4, !tbaa !9
  %278 = load ptr, ptr %18, align 8, !tbaa !5
  %279 = getelementptr inbounds %struct.internal_state, ptr %278, i32 0, i32 33
  store i32 %277, ptr %279, align 4, !tbaa !41
  %280 = load i32, ptr %15, align 4, !tbaa !9
  %281 = load ptr, ptr %18, align 8, !tbaa !5
  %282 = getelementptr inbounds %struct.internal_state, ptr %281, i32 0, i32 34
  store i32 %280, ptr %282, align 8, !tbaa !42
  %283 = load i32, ptr %12, align 4, !tbaa !9
  %284 = trunc i32 %283 to i8
  %285 = load ptr, ptr %18, align 8, !tbaa !5
  %286 = getelementptr inbounds %struct.internal_state, ptr %285, i32 0, i32 9
  store i8 %284, ptr %286, align 4, !tbaa !43
  %287 = load ptr, ptr %10, align 8, !tbaa !5
  %288 = call i32 @deflateReset(ptr noundef %287)
  store i32 %288, ptr %9, align 4
  store i32 1, ptr %20, align 4
  br label %289

289:                                              ; preds = %259, %251, %116, %101, %70, %39, %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  %290 = load i32, ptr %9, align 4
  ret i32 %290
}

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

declare ptr @zcalloc(ptr noundef, i32 noundef, i32 noundef) #2

declare void @zcfree(ptr noundef, ptr noundef) #2

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

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

; 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 = { "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 = { 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 = !{!7, !7, i64 0}
!12 = !{!13, !6, i64 48}
!13 = !{!"z_stream_s", !6, i64 0, !10, i64 8, !14, i64 16, !6, i64 24, !10, i64 32, !14, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !14, i64 96, !14, i64 104}
!14 = !{!"long", !7, i64 0}
!15 = !{!13, !6, i64 64}
!16 = !{!13, !6, i64 80}
!17 = !{!13, !6, i64 72}
!18 = !{!13, !6, i64 56}
!19 = !{!20, !6, i64 0}
!20 = !{!"internal_state", !6, i64 0, !10, i64 8, !6, i64 16, !14, i64 24, !6, i64 32, !10, i64 40, !10, i64 44, !6, i64 48, !10, i64 56, !7, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !6, i64 80, !10, i64 88, !6, i64 96, !6, i64 104, !10, i64 112, !10, i64 116, !10, i64 120, !10, i64 124, !10, i64 128, !14, 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, !7, i64 196, !7, i64 2488, !7, i64 2732, !21, i64 2888, !21, i64 2912, !21, i64 2936, !7, i64 2960, !7, i64 2992, !10, i64 5284, !10, i64 5288, !7, i64 5292, !6, i64 5872, !10, i64 5880, !10, i64 5884, !10, i64 5888, !14, i64 5896, !14, i64 5904, !10, i64 5912, !10, i64 5916, !14, i64 5920, !10, i64 5928, !14, i64 5936}
!21 = !{!"tree_desc_s", !6, i64 0, !10, i64 8, !6, i64 16}
!22 = !{!20, !10, i64 8}
!23 = !{!20, !10, i64 44}
!24 = !{!20, !6, i64 48}
!25 = !{!20, !10, i64 72}
!26 = !{!20, !10, i64 68}
!27 = !{!20, !10, i64 76}
!28 = !{!20, !10, i64 120}
!29 = !{!20, !10, i64 116}
!30 = !{!20, !10, i64 124}
!31 = !{!20, !10, i64 128}
!32 = !{!20, !6, i64 80}
!33 = !{!20, !6, i64 96}
!34 = !{!20, !6, i64 104}
!35 = !{!20, !14, i64 5936}
!36 = !{!20, !10, i64 5880}
!37 = !{!20, !6, i64 16}
!38 = !{!20, !14, i64 24}
!39 = !{!20, !6, i64 5872}
!40 = !{!20, !10, i64 5888}
!41 = !{!20, !10, i64 180}
!42 = !{!20, !10, i64 184}
!43 = !{!20, !7, i64 60}


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

@deflateInit2_.my_version = external hidden local_unnamed_addr constant [16 x i8], align 16
@z_errmsg = external local_unnamed_addr constant [10 x ptr], align 16

; Function Attrs: nounwind uwtable
define dso_local i32 @deflateInit2_(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, ptr noundef readonly %6, i32 noundef %7) local_unnamed_addr #0 {
  %9 = icmp eq ptr %6, null
  br i1 %9, label %116, label %10

10:                                               ; preds = %8
  %11 = load i8, ptr %6, align 1, !tbaa !5
  %12 = load i8, ptr @deflateInit2_.my_version, align 16, !tbaa !5
  %13 = icmp ne i8 %11, %12
  %14 = icmp ne i32 %7, 112
  %or.cond = or i1 %14, %13
  br i1 %or.cond, label %116, label %15

15:                                               ; preds = %10
  %16 = icmp eq ptr %0, null
  br i1 %16, label %116, label %17

17:                                               ; preds = %15
  %18 = getelementptr inbounds i8, ptr %0, i64 48
  store ptr null, ptr %18, align 8, !tbaa !8
  %19 = getelementptr inbounds i8, ptr %0, i64 64
  %20 = load ptr, ptr %19, align 8, !tbaa !13
  %21 = icmp eq ptr %20, null
  br i1 %21, label %22, label %24

22:                                               ; preds = %17
  store ptr @zcalloc, ptr %19, align 8, !tbaa !13
  %23 = getelementptr inbounds i8, ptr %0, i64 80
  store ptr null, ptr %23, align 8, !tbaa !14
  br label %24

24:                                               ; preds = %22, %17
  %25 = phi ptr [ @zcalloc, %22 ], [ %20, %17 ]
  %26 = getelementptr inbounds i8, ptr %0, i64 72
  %27 = load ptr, ptr %26, align 8, !tbaa !15
  %28 = icmp eq ptr %27, null
  br i1 %28, label %29, label %30

29:                                               ; preds = %24
  store ptr @zcfree, ptr %26, align 8, !tbaa !15
  br label %30

30:                                               ; preds = %29, %24
  %31 = icmp eq i32 %1, -1
  %spec.store.select = select i1 %31, i32 6, i32 %1
  %32 = icmp slt i32 %3, 0
  br i1 %32, label %33, label %37

33:                                               ; preds = %30
  %34 = icmp ult i32 %3, -15
  br i1 %34, label %116, label %35

35:                                               ; preds = %33
  %36 = sub nsw i32 0, %3
  br label %37

37:                                               ; preds = %35, %30
  %.0109 = phi i32 [ %36, %35 ], [ %3, %30 ]
  %.0 = phi i32 [ 0, %35 ], [ 1, %30 ]
  %38 = add i32 %4, -10
  %or.cond4 = icmp ult i32 %38, -9
  %39 = icmp ne i32 %2, 8
  %or.cond6 = or i1 %39, %or.cond4
  %40 = add nsw i32 %.0109, -16
  %41 = icmp ult i32 %40, -8
  %or.cond10 = select i1 %or.cond6, i1 true, i1 %41
  %42 = icmp ugt i32 %spec.store.select, 9
  %or.cond14 = or i1 %42, %or.cond10
  %43 = icmp ugt i32 %5, 4
  %or.cond18 = or i1 %43, %or.cond14
  br i1 %or.cond18, label %116, label %44

44:                                               ; preds = %37
  %45 = getelementptr inbounds i8, ptr %0, i64 80
  %46 = load ptr, ptr %45, align 8, !tbaa !14
  %47 = tail call ptr %25(ptr noundef %46, i32 noundef 1, i32 noundef 5944) #2
  %48 = icmp eq ptr %47, null
  br i1 %48, label %116, label %49

49:                                               ; preds = %44
  %50 = icmp eq i32 %.0109, 8
  %spec.store.select19 = select i1 %50, i32 9, i32 %.0109
  %51 = getelementptr inbounds i8, ptr %0, i64 56
  store ptr %47, ptr %51, align 8, !tbaa !16
  store ptr %0, ptr %47, align 8, !tbaa !17
  %52 = getelementptr inbounds i8, ptr %47, i64 8
  store i32 42, ptr %52, align 8, !tbaa !20
  %53 = getelementptr inbounds i8, ptr %47, i64 44
  store i32 %.0, ptr %53, align 4, !tbaa !21
  %54 = getelementptr inbounds i8, ptr %47, i64 48
  store ptr null, ptr %54, align 8, !tbaa !22
  %55 = getelementptr inbounds i8, ptr %47, i64 72
  store i32 %spec.store.select19, ptr %55, align 8, !tbaa !23
  %56 = shl nuw nsw i32 1, %spec.store.select19
  %57 = getelementptr inbounds i8, ptr %47, i64 68
  store i32 %56, ptr %57, align 4, !tbaa !24
  %58 = add nsw i32 %56, -1
  %59 = getelementptr inbounds i8, ptr %47, i64 76
  store i32 %58, ptr %59, align 4, !tbaa !25
  %60 = add nuw nsw i32 %4, 7
  %61 = getelementptr inbounds i8, ptr %47, i64 120
  store i32 %60, ptr %61, align 8, !tbaa !26
  %62 = shl nuw nsw i32 128, %4
  %63 = getelementptr inbounds i8, ptr %47, i64 116
  store i32 %62, ptr %63, align 4, !tbaa !27
  %64 = add nsw i32 %62, -1
  %65 = getelementptr inbounds i8, ptr %47, i64 124
  store i32 %64, ptr %65, align 4, !tbaa !28
  %66 = trunc nuw i32 %4 to i8
  %.lhs.trunc = add nuw nsw i8 %66, 9
  %67 = udiv i8 %.lhs.trunc, 3
  %.zext = zext nneg i8 %67 to i32
  %68 = getelementptr inbounds i8, ptr %47, i64 128
  store i32 %.zext, ptr %68, align 8, !tbaa !29
  %69 = load ptr, ptr %19, align 8, !tbaa !13
  %70 = load ptr, ptr %45, align 8, !tbaa !14
  %71 = tail call ptr %69(ptr noundef %70, i32 noundef %56, i32 noundef 2) #2
  %72 = getelementptr inbounds i8, ptr %47, i64 80
  store ptr %71, ptr %72, align 8, !tbaa !30
  %73 = load ptr, ptr %19, align 8, !tbaa !13
  %74 = load ptr, ptr %45, align 8, !tbaa !14
  %75 = load i32, ptr %57, align 4, !tbaa !24
  %76 = tail call ptr %73(ptr noundef %74, i32 noundef %75, i32 noundef 2) #2
  %77 = getelementptr inbounds i8, ptr %47, i64 96
  store ptr %76, ptr %77, align 8, !tbaa !31
  %78 = load ptr, ptr %19, align 8, !tbaa !13
  %79 = load ptr, ptr %45, align 8, !tbaa !14
  %80 = load i32, ptr %63, align 4, !tbaa !27
  %81 = tail call ptr %78(ptr noundef %79, i32 noundef %80, i32 noundef 2) #2
  %82 = getelementptr inbounds i8, ptr %47, i64 104
  store ptr %81, ptr %82, align 8, !tbaa !32
  %83 = getelementptr inbounds i8, ptr %47, i64 5936
  store i64 0, ptr %83, align 8, !tbaa !33
  %84 = shl nuw nsw i32 64, %4
  %85 = getelementptr inbounds i8, ptr %47, i64 5880
  store i32 %84, ptr %85, align 8, !tbaa !34
  %86 = load ptr, ptr %19, align 8, !tbaa !13
  %87 = load ptr, ptr %45, align 8, !tbaa !14
  %88 = tail call ptr %86(ptr noundef %87, i32 noundef %84, i32 noundef 4) #2
  %89 = getelementptr inbounds i8, ptr %47, i64 16
  store ptr %88, ptr %89, align 8, !tbaa !35
  %90 = load i32, ptr %85, align 8, !tbaa !34
  %91 = zext i32 %90 to i64
  %92 = shl nuw nsw i64 %91, 2
  %93 = getelementptr inbounds i8, ptr %47, i64 24
  store i64 %92, ptr %93, align 8, !tbaa !36
  %94 = load ptr, ptr %72, align 8, !tbaa !30
  %95 = icmp eq ptr %94, null
  br i1 %95, label %103, label %96

96:                                               ; preds = %49
  %97 = load ptr, ptr %77, align 8, !tbaa !31
  %98 = icmp eq ptr %97, null
  br i1 %98, label %103, label %99

99:                                               ; preds = %96
  %100 = load ptr, ptr %82, align 8, !tbaa !32
  %101 = icmp eq ptr %100, null
  %102 = icmp eq ptr %88, null
  %or.cond115 = select i1 %101, i1 true, i1 %102
  br i1 %or.cond115, label %103, label %106

103:                                              ; preds = %99, %96, %49
  store i32 666, ptr %52, align 8, !tbaa !20
  %104 = load ptr, ptr getelementptr inbounds (i8, ptr @z_errmsg, i64 48), align 16, !tbaa !37
  store ptr %104, ptr %18, align 8, !tbaa !8
  %105 = tail call i32 @deflateEnd(ptr noundef nonnull %0)
  br label %116

106:                                              ; preds = %99
  %107 = getelementptr inbounds i8, ptr %88, i64 %91
  %108 = getelementptr inbounds i8, ptr %47, i64 5872
  store ptr %107, ptr %108, align 8, !tbaa !38
  %109 = mul i32 %90, 3
  %110 = add i32 %109, -3
  %111 = getelementptr inbounds i8, ptr %47, i64 5888
  store i32 %110, ptr %111, align 8, !tbaa !39
  %112 = getelementptr inbounds i8, ptr %47, i64 180
  store i32 %spec.store.select, ptr %112, align 4, !tbaa !40
  %113 = getelementptr inbounds i8, ptr %47, i64 184
  store i32 %5, ptr %113, align 8, !tbaa !41
  %114 = getelementptr inbounds i8, ptr %47, i64 60
  store i8 8, ptr %114, align 4, !tbaa !42
  %115 = tail call i32 @deflateReset(ptr noundef nonnull %0)
  br label %116

116:                                              ; preds = %44, %37, %33, %15, %8, %10, %106, %103
  %.0108 = phi i32 [ -4, %103 ], [ %115, %106 ], [ -6, %10 ], [ -6, %8 ], [ -2, %15 ], [ -2, %33 ], [ -2, %37 ], [ -4, %44 ]
  ret i32 %.0108
}

declare ptr @zcalloc(ptr noundef, i32 noundef, i32 noundef) #1

declare void @zcfree(ptr noundef, ptr noundef) #1

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @deflateReset(ptr noundef) local_unnamed_addr #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 = { "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 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !10, i64 48}
!9 = !{!"z_stream_s", !10, i64 0, !11, i64 8, !12, i64 16, !10, i64 24, !11, i64 32, !12, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !11, i64 88, !12, i64 96, !12, i64 104}
!10 = !{!"any pointer", !6, i64 0}
!11 = !{!"int", !6, i64 0}
!12 = !{!"long", !6, i64 0}
!13 = !{!9, !10, i64 64}
!14 = !{!9, !10, i64 80}
!15 = !{!9, !10, i64 72}
!16 = !{!9, !10, i64 56}
!17 = !{!18, !10, i64 0}
!18 = !{!"internal_state", !10, i64 0, !11, i64 8, !10, i64 16, !12, i64 24, !10, i64 32, !11, i64 40, !11, i64 44, !10, i64 48, !11, i64 56, !6, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !10, i64 80, !11, i64 88, !10, i64 96, !10, i64 104, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !12, i64 136, !11, i64 144, !11, i64 148, !11, i64 152, !11, i64 156, !11, i64 160, !11, i64 164, !11, i64 168, !11, i64 172, !11, i64 176, !11, i64 180, !11, i64 184, !11, i64 188, !11, i64 192, !6, i64 196, !6, i64 2488, !6, i64 2732, !19, i64 2888, !19, i64 2912, !19, i64 2936, !6, i64 2960, !6, i64 2992, !11, i64 5284, !11, i64 5288, !6, i64 5292, !10, i64 5872, !11, i64 5880, !11, i64 5884, !11, i64 5888, !12, i64 5896, !12, i64 5904, !11, i64 5912, !11, i64 5916, !12, i64 5920, !11, i64 5928, !12, i64 5936}
!19 = !{!"tree_desc_s", !10, i64 0, !11, i64 8, !10, i64 16}
!20 = !{!18, !11, i64 8}
!21 = !{!18, !11, i64 44}
!22 = !{!18, !10, i64 48}
!23 = !{!18, !11, i64 72}
!24 = !{!18, !11, i64 68}
!25 = !{!18, !11, i64 76}
!26 = !{!18, !11, i64 120}
!27 = !{!18, !11, i64 116}
!28 = !{!18, !11, i64 124}
!29 = !{!18, !11, i64 128}
!30 = !{!18, !10, i64 80}
!31 = !{!18, !10, i64 96}
!32 = !{!18, !10, i64 104}
!33 = !{!18, !12, i64 5936}
!34 = !{!18, !11, i64 5880}
!35 = !{!18, !10, i64 16}
!36 = !{!18, !12, i64 24}
!37 = !{!10, !10, i64 0}
!38 = !{!18, !10, i64 5872}
!39 = !{!18, !11, i64 5888}
!40 = !{!18, !11, i64 180}
!41 = !{!18, !11, i64 184}
!42 = !{!18, !6, i64 60}


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