; LLVM IR from Overload-Technologies/Overload :: Dependencies/assimp/contrib/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, i64, i32, ptr, i64, 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, i32, i64, i64, i32, i32, i16, 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 [7 x i8], align 1
@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 1, !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 %302

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 %302

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 %302

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 %81

74:                                               ; preds = %64
  %75 = load i32, ptr %13, align 4, !tbaa !9
  %76 = icmp sgt i32 %75, 15
  br i1 %76, label %77, label %80

77:                                               ; preds = %74
  store i32 2, ptr %19, align 4, !tbaa !9
  %78 = load i32, ptr %13, align 4, !tbaa !9
  %79 = sub nsw i32 %78, 16
  store i32 %79, ptr %13, align 4, !tbaa !9
  br label %80

80:                                               ; preds = %77, %74
  br label %81

81:                                               ; preds = %80, %71
  %82 = load i32, ptr %14, align 4, !tbaa !9
  %83 = icmp slt i32 %82, 1
  br i1 %83, label %114, label %84

84:                                               ; preds = %81
  %85 = load i32, ptr %14, align 4, !tbaa !9
  %86 = icmp sgt i32 %85, 9
  br i1 %86, label %114, label %87

87:                                               ; preds = %84
  %88 = load i32, ptr %12, align 4, !tbaa !9
  %89 = icmp ne i32 %88, 8
  br i1 %89, label %114, label %90

90:                                               ; preds = %87
  %91 = load i32, ptr %13, align 4, !tbaa !9
  %92 = icmp slt i32 %91, 8
  br i1 %92, label %114, label %93

93:                                               ; preds = %90
  %94 = load i32, ptr %13, align 4, !tbaa !9
  %95 = icmp sgt i32 %94, 15
  br i1 %95, label %114, label %96

96:                                               ; preds = %93
  %97 = load i32, ptr %11, align 4, !tbaa !9
  %98 = icmp slt i32 %97, 0
  br i1 %98, label %114, label %99

99:                                               ; preds = %96
  %100 = load i32, ptr %11, align 4, !tbaa !9
  %101 = icmp sgt i32 %100, 9
  br i1 %101, label %114, label %102

102:                                              ; preds = %99
  %103 = load i32, ptr %15, align 4, !tbaa !9
  %104 = icmp slt i32 %103, 0
  br i1 %104, label %114, label %105

105:                                              ; preds = %102
  %106 = load i32, ptr %15, align 4, !tbaa !9
  %107 = icmp sgt i32 %106, 4
  br i1 %107, label %114, label %108

108:                                              ; preds = %105
  %109 = load i32, ptr %13, align 4, !tbaa !9
  %110 = icmp eq i32 %109, 8
  br i1 %110, label %111, label %115

111:                                              ; preds = %108
  %112 = load i32, ptr %19, align 4, !tbaa !9
  %113 = icmp ne i32 %112, 1
  br i1 %113, label %114, label %115

114:                                              ; preds = %111, %105, %102, %99, %96, %93, %90, %87, %84, %81
  store i32 -2, ptr %9, align 4
  store i32 1, ptr %20, align 4
  br label %302

115:                                              ; preds = %111, %108
  %116 = load i32, ptr %13, align 4, !tbaa !9
  %117 = icmp eq i32 %116, 8
  br i1 %117, label %118, label %119

118:                                              ; preds = %115
  store i32 9, ptr %13, align 4, !tbaa !9
  br label %119

119:                                              ; preds = %118, %115
  %120 = load ptr, ptr %10, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.z_stream_s, ptr %120, i32 0, i32 8
  %122 = load ptr, ptr %121, align 8, !tbaa !15
  %123 = load ptr, ptr %10, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.z_stream_s, ptr %123, i32 0, i32 10
  %125 = load ptr, ptr %124, align 8, !tbaa !16
  %126 = call ptr %122(ptr noundef %125, i32 noundef 1, i32 noundef 5952)
  store ptr %126, ptr %18, align 8, !tbaa !5
  %127 = load ptr, ptr %18, align 8, !tbaa !5
  %128 = icmp eq ptr %127, null
  br i1 %128, label %129, label %130

129:                                              ; preds = %119
  store i32 -4, ptr %9, align 4
  store i32 1, ptr %20, align 4
  br label %302

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

249:                                              ; preds = %130
  %250 = load ptr, ptr %18, align 8, !tbaa !5
  %251 = getelementptr inbounds %struct.internal_state, ptr %250, i32 0, i32 16
  %252 = load ptr, ptr %251, align 8, !tbaa !34
  %253 = icmp eq ptr %252, null
  br i1 %253, label %264, label %254

254:                                              ; preds = %249
  %255 = load ptr, ptr %18, align 8, !tbaa !5
  %256 = getelementptr inbounds %struct.internal_state, ptr %255, i32 0, i32 17
  %257 = load ptr, ptr %256, align 8, !tbaa !35
  %258 = icmp eq ptr %257, null
  br i1 %258, label %264, label %259

259:                                              ; preds = %254
  %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 !38
  %263 = icmp eq ptr %262, null
  br i1 %263, label %264, label %272

264:                                              ; preds = %259, %254, %249, %130
  %265 = load ptr, ptr %18, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct.internal_state, ptr %265, i32 0, i32 1
  store i32 666, ptr %266, align 8, !tbaa !23
  %267 = load ptr, ptr getelementptr inbounds ([10 x ptr], ptr @z_errmsg, i64 0, i64 6), align 16, !tbaa !5
  %268 = load ptr, ptr %10, align 8, !tbaa !5
  %269 = getelementptr inbounds %struct.z_stream_s, ptr %268, i32 0, i32 6
  store ptr %267, ptr %269, align 8, !tbaa !12
  %270 = load ptr, ptr %10, align 8, !tbaa !5
  %271 = call i32 @deflateEnd(ptr noundef %270)
  store i32 -4, ptr %9, align 4
  store i32 1, ptr %20, align 4
  br label %302

272:                                              ; preds = %259
  %273 = load ptr, ptr %18, align 8, !tbaa !5
  %274 = getelementptr inbounds %struct.internal_state, ptr %273, i32 0, i32 2
  %275 = load ptr, ptr %274, align 8, !tbaa !38
  %276 = load ptr, ptr %18, align 8, !tbaa !5
  %277 = getelementptr inbounds %struct.internal_state, ptr %276, i32 0, i32 49
  %278 = load i32, ptr %277, align 8, !tbaa !37
  %279 = zext i32 %278 to i64
  %280 = getelementptr inbounds i8, ptr %275, i64 %279
  %281 = load ptr, ptr %18, align 8, !tbaa !5
  %282 = getelementptr inbounds %struct.internal_state, ptr %281, i32 0, i32 48
  store ptr %280, ptr %282, align 8, !tbaa !40
  %283 = load ptr, ptr %18, align 8, !tbaa !5
  %284 = getelementptr inbounds %struct.internal_state, ptr %283, i32 0, i32 49
  %285 = load i32, ptr %284, align 8, !tbaa !37
  %286 = sub i32 %285, 1
  %287 = mul i32 %286, 3
  %288 = load ptr, ptr %18, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct.internal_state, ptr %288, i32 0, i32 51
  store i32 %287, ptr %289, align 8, !tbaa !41
  %290 = load i32, ptr %11, align 4, !tbaa !9
  %291 = load ptr, ptr %18, align 8, !tbaa !5
  %292 = getelementptr inbounds %struct.internal_state, ptr %291, i32 0, i32 33
  store i32 %290, ptr %292, align 4, !tbaa !42
  %293 = load i32, ptr %15, align 4, !tbaa !9
  %294 = load ptr, ptr %18, align 8, !tbaa !5
  %295 = getelementptr inbounds %struct.internal_state, ptr %294, i32 0, i32 34
  store i32 %293, ptr %295, align 8, !tbaa !43
  %296 = load i32, ptr %12, align 4, !tbaa !9
  %297 = trunc i32 %296 to i8
  %298 = load ptr, ptr %18, align 8, !tbaa !5
  %299 = getelementptr inbounds %struct.internal_state, ptr %298, i32 0, i32 9
  store i8 %297, ptr %299, align 8, !tbaa !44
  %300 = load ptr, ptr %10, align 8, !tbaa !5
  %301 = call i32 @deflateReset(ptr noundef %300)
  store i32 %301, ptr %9, align 4
  store i32 1, ptr %20, align 4
  br label %302

302:                                              ; preds = %272, %264, %129, %114, %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
  %303 = load i32, ptr %9, align 4
  ret i32 %303
}

; 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, !14, i64 40, !10, i64 48, !6, i64 56, !14, i64 64, !7, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !6, i64 96, !14, i64 104, !6, i64 112, !6, i64 120, !10, i64 128, !10, i64 132, !10, i64 136, !10, i64 140, !10, i64 144, !14, i64 152, !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, !10, i64 196, !10, i64 200, !10, i64 204, !10, i64 208, !7, i64 212, !7, i64 2504, !7, i64 2748, !21, i64 2904, !21, i64 2928, !21, i64 2952, !7, i64 2976, !7, i64 3008, !10, i64 5300, !10, i64 5304, !7, i64 5308, !6, i64 5888, !10, i64 5896, !10, i64 5900, !10, i64 5904, !14, i64 5912, !14, i64 5920, !10, i64 5928, !10, i64 5932, !22, i64 5936, !10, i64 5940, !14, i64 5944}
!21 = !{!"tree_desc_s", !6, i64 0, !10, i64 8, !6, i64 16}
!22 = !{!"short", !7, i64 0}
!23 = !{!20, !10, i64 8}
!24 = !{!20, !10, i64 48}
!25 = !{!20, !6, i64 56}
!26 = !{!20, !10, i64 84}
!27 = !{!20, !10, i64 80}
!28 = !{!20, !10, i64 88}
!29 = !{!20, !10, i64 136}
!30 = !{!20, !10, i64 132}
!31 = !{!20, !10, i64 140}
!32 = !{!20, !10, i64 144}
!33 = !{!20, !6, i64 96}
!34 = !{!20, !6, i64 112}
!35 = !{!20, !6, i64 120}
!36 = !{!20, !14, i64 5944}
!37 = !{!20, !10, i64 5896}
!38 = !{!20, !6, i64 16}
!39 = !{!20, !14, i64 24}
!40 = !{!20, !6, i64 5888}
!41 = !{!20, !10, i64 5904}
!42 = !{!20, !10, i64 196}
!43 = !{!20, !10, i64 200}
!44 = !{!20, !7, i64 72}


; 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 [7 x i8], align 1
@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 %122, label %10

10:                                               ; preds = %8
  %11 = load i8, ptr %6, align 1, !tbaa !5
  %12 = load i8, ptr @deflateInit2_.my_version, align 1, !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 %122, label %15

15:                                               ; preds = %10
  %16 = icmp eq ptr %0, null
  br i1 %16, label %122, 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 %122, label %35

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

37:                                               ; preds = %30
  %38 = icmp ugt i32 %3, 15
  br i1 %38, label %39, label %41

39:                                               ; preds = %37
  %40 = add nsw i32 %3, -16
  br label %41

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

49:                                               ; preds = %41
  %50 = icmp eq i32 %.0115, 8
  %or.cond20 = and i1 %50, %42
  br i1 %or.cond20, label %122, label %51

51:                                               ; preds = %49
  %52 = getelementptr inbounds i8, ptr %0, i64 80
  %53 = load ptr, ptr %52, align 8, !tbaa !14
  %54 = tail call ptr %25(ptr noundef %53, i32 noundef 1, i32 noundef 5952) #2
  %55 = icmp eq ptr %54, null
  br i1 %55, label %122, label %56

56:                                               ; preds = %51
  %spec.store.select21 = select i1 %50, i32 9, i32 %.0115
  %57 = getelementptr inbounds i8, ptr %0, i64 56
  store ptr %54, ptr %57, align 8, !tbaa !16
  store ptr %0, ptr %54, align 8, !tbaa !17
  %58 = getelementptr inbounds i8, ptr %54, i64 8
  store i32 42, ptr %58, align 8, !tbaa !21
  %59 = getelementptr inbounds i8, ptr %54, i64 48
  store i32 %.0, ptr %59, align 8, !tbaa !22
  %60 = getelementptr inbounds i8, ptr %54, i64 56
  store ptr null, ptr %60, align 8, !tbaa !23
  %61 = getelementptr inbounds i8, ptr %54, i64 84
  store i32 %spec.store.select21, ptr %61, align 4, !tbaa !24
  %62 = shl nuw nsw i32 1, %spec.store.select21
  %63 = getelementptr inbounds i8, ptr %54, i64 80
  store i32 %62, ptr %63, align 8, !tbaa !25
  %64 = add nsw i32 %62, -1
  %65 = getelementptr inbounds i8, ptr %54, i64 88
  store i32 %64, ptr %65, align 8, !tbaa !26
  %66 = add nuw nsw i32 %4, 7
  %67 = getelementptr inbounds i8, ptr %54, i64 136
  store i32 %66, ptr %67, align 8, !tbaa !27
  %68 = shl nuw nsw i32 128, %4
  %69 = getelementptr inbounds i8, ptr %54, i64 132
  store i32 %68, ptr %69, align 4, !tbaa !28
  %70 = add nsw i32 %68, -1
  %71 = getelementptr inbounds i8, ptr %54, i64 140
  store i32 %70, ptr %71, align 4, !tbaa !29
  %72 = trunc nuw i32 %4 to i8
  %.lhs.trunc = add nuw nsw i8 %72, 9
  %73 = udiv i8 %.lhs.trunc, 3
  %.zext = zext nneg i8 %73 to i32
  %74 = getelementptr inbounds i8, ptr %54, i64 144
  store i32 %.zext, ptr %74, align 8, !tbaa !30
  %75 = load ptr, ptr %19, align 8, !tbaa !13
  %76 = load ptr, ptr %52, align 8, !tbaa !14
  %77 = tail call ptr %75(ptr noundef %76, i32 noundef %62, i32 noundef 2) #2
  %78 = getelementptr inbounds i8, ptr %54, i64 96
  store ptr %77, ptr %78, align 8, !tbaa !31
  %79 = load ptr, ptr %19, align 8, !tbaa !13
  %80 = load ptr, ptr %52, align 8, !tbaa !14
  %81 = load i32, ptr %63, align 8, !tbaa !25
  %82 = tail call ptr %79(ptr noundef %80, i32 noundef %81, i32 noundef 2) #2
  %83 = getelementptr inbounds i8, ptr %54, i64 112
  store ptr %82, ptr %83, align 8, !tbaa !32
  %84 = load ptr, ptr %19, align 8, !tbaa !13
  %85 = load ptr, ptr %52, align 8, !tbaa !14
  %86 = load i32, ptr %69, align 4, !tbaa !28
  %87 = tail call ptr %84(ptr noundef %85, i32 noundef %86, i32 noundef 2) #2
  %88 = getelementptr inbounds i8, ptr %54, i64 120
  store ptr %87, ptr %88, align 8, !tbaa !33
  %89 = getelementptr inbounds i8, ptr %54, i64 5944
  store i64 0, ptr %89, align 8, !tbaa !34
  %90 = shl nuw nsw i32 64, %4
  %91 = getelementptr inbounds i8, ptr %54, i64 5896
  store i32 %90, ptr %91, align 8, !tbaa !35
  %92 = load ptr, ptr %19, align 8, !tbaa !13
  %93 = load ptr, ptr %52, align 8, !tbaa !14
  %94 = tail call ptr %92(ptr noundef %93, i32 noundef %90, i32 noundef 4) #2
  %95 = getelementptr inbounds i8, ptr %54, i64 16
  store ptr %94, ptr %95, align 8, !tbaa !36
  %96 = load i32, ptr %91, align 8, !tbaa !35
  %97 = zext i32 %96 to i64
  %98 = shl nuw nsw i64 %97, 2
  %99 = getelementptr inbounds i8, ptr %54, i64 24
  store i64 %98, ptr %99, align 8, !tbaa !37
  %100 = load ptr, ptr %78, align 8, !tbaa !31
  %101 = icmp eq ptr %100, null
  br i1 %101, label %109, label %102

102:                                              ; preds = %56
  %103 = load ptr, ptr %83, align 8, !tbaa !32
  %104 = icmp eq ptr %103, null
  br i1 %104, label %109, label %105

105:                                              ; preds = %102
  %106 = load ptr, ptr %88, align 8, !tbaa !33
  %107 = icmp eq ptr %106, null
  %108 = icmp eq ptr %94, null
  %or.cond121 = select i1 %107, i1 true, i1 %108
  br i1 %or.cond121, label %109, label %112

109:                                              ; preds = %105, %102, %56
  store i32 666, ptr %58, align 8, !tbaa !21
  %110 = load ptr, ptr getelementptr inbounds (i8, ptr @z_errmsg, i64 48), align 16, !tbaa !38
  store ptr %110, ptr %18, align 8, !tbaa !8
  %111 = tail call i32 @deflateEnd(ptr noundef nonnull %0)
  br label %122

112:                                              ; preds = %105
  %113 = getelementptr inbounds i8, ptr %94, i64 %97
  %114 = getelementptr inbounds i8, ptr %54, i64 5888
  store ptr %113, ptr %114, align 8, !tbaa !39
  %115 = mul i32 %96, 3
  %116 = add i32 %115, -3
  %117 = getelementptr inbounds i8, ptr %54, i64 5904
  store i32 %116, ptr %117, align 8, !tbaa !40
  %118 = getelementptr inbounds i8, ptr %54, i64 196
  store i32 %spec.store.select, ptr %118, align 4, !tbaa !41
  %119 = getelementptr inbounds i8, ptr %54, i64 200
  store i32 %5, ptr %119, align 8, !tbaa !42
  %120 = getelementptr inbounds i8, ptr %54, i64 72
  store i8 8, ptr %120, align 8, !tbaa !43
  %121 = tail call i32 @deflateReset(ptr noundef nonnull %0)
  br label %122

122:                                              ; preds = %51, %41, %49, %33, %15, %8, %10, %112, %109
  %.0114 = phi i32 [ -4, %109 ], [ %121, %112 ], [ -6, %10 ], [ -6, %8 ], [ -2, %15 ], [ -2, %33 ], [ -2, %49 ], [ -2, %41 ], [ -4, %51 ]
  ret i32 %.0114
}

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, !12, i64 40, !11, i64 48, !10, i64 56, !12, i64 64, !6, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !11, i64 88, !10, i64 96, !12, i64 104, !10, i64 112, !10, i64 120, !11, i64 128, !11, i64 132, !11, i64 136, !11, i64 140, !11, i64 144, !12, i64 152, !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, !11, i64 196, !11, i64 200, !11, i64 204, !11, i64 208, !6, i64 212, !6, i64 2504, !6, i64 2748, !19, i64 2904, !19, i64 2928, !19, i64 2952, !6, i64 2976, !6, i64 3008, !11, i64 5300, !11, i64 5304, !6, i64 5308, !10, i64 5888, !11, i64 5896, !11, i64 5900, !11, i64 5904, !12, i64 5912, !12, i64 5920, !11, i64 5928, !11, i64 5932, !20, i64 5936, !11, i64 5940, !12, i64 5944}
!19 = !{!"tree_desc_s", !10, i64 0, !11, i64 8, !10, i64 16}
!20 = !{!"short", !6, i64 0}
!21 = !{!18, !11, i64 8}
!22 = !{!18, !11, i64 48}
!23 = !{!18, !10, i64 56}
!24 = !{!18, !11, i64 84}
!25 = !{!18, !11, i64 80}
!26 = !{!18, !11, i64 88}
!27 = !{!18, !11, i64 136}
!28 = !{!18, !11, i64 132}
!29 = !{!18, !11, i64 140}
!30 = !{!18, !11, i64 144}
!31 = !{!18, !10, i64 96}
!32 = !{!18, !10, i64 112}
!33 = !{!18, !10, i64 120}
!34 = !{!18, !12, i64 5944}
!35 = !{!18, !11, i64 5896}
!36 = !{!18, !10, i64 16}
!37 = !{!18, !12, i64 24}
!38 = !{!10, !10, i64 0}
!39 = !{!18, !10, i64 5888}
!40 = !{!18, !11, i64 5904}
!41 = !{!18, !11, i64 196}
!42 = !{!18, !11, i64 200}
!43 = !{!18, !6, i64 72}


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