; LLVM IR from eugenebokhan/awesome-ml :: Awesome ML/Utils/Zip/minizip (zip)

; 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.zip64_internal = type { %struct.zlib_filefunc64_32_def_s, ptr, ptr, %struct.linkedlist_data_s, i32, i32, %struct.curfile64_info, i64, i64, i64, i64, i64, i64, ptr }
%struct.zlib_filefunc64_32_def_s = type { %struct.zlib_filefunc64_def_s, ptr, ptr, ptr, ptr }
%struct.zlib_filefunc64_def_s = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.linkedlist_data_s = type { ptr, ptr }
%struct.curfile64_info = type { %struct.z_stream_s, i32, i32, i64, ptr, i64, i64, i64, i64, i64, i32, i32, i32, [65536 x i8], i64, i64, i32, i64, i64, i64, i64, [3 x i64], ptr, i32 }
%struct.z_stream_s = type { ptr, i32, i64, ptr, i32, i64, ptr, ptr, ptr, ptr, ptr, i32, i64, i64 }

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

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

16:                                               ; preds = %3
  store i32 -102, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %227

17:                                               ; preds = %3
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %18, ptr %8, align 8, !tbaa !5
  %19 = load ptr, ptr %8, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.zip64_internal, ptr %19, i32 0, i32 4
  %21 = load i32, ptr %20, align 8, !tbaa !11
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %23, label %24

23:                                               ; preds = %17
  store i32 -102, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %227

24:                                               ; preds = %17
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.zip64_internal, ptr %25, i32 0, i32 6
  %27 = getelementptr inbounds %struct.curfile64_info, ptr %26, i32 0, i32 15
  %28 = load i64, ptr %27, align 8, !tbaa !20
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = load i32, ptr %7, align 4, !tbaa !9
  %31 = call i64 @crc32(i64 noundef %28, ptr noundef %29, i32 noundef %30)
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.zip64_internal, ptr %32, i32 0, i32 6
  %34 = getelementptr inbounds %struct.curfile64_info, ptr %33, i32 0, i32 15
  store i64 %31, ptr %34, align 8, !tbaa !20
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.zip64_internal, ptr %36, i32 0, i32 6
  %38 = getelementptr inbounds %struct.curfile64_info, ptr %37, i32 0, i32 0
  %39 = getelementptr inbounds %struct.z_stream_s, ptr %38, i32 0, i32 0
  store ptr %35, ptr %39, align 8, !tbaa !21
  %40 = load i32, ptr %7, align 4, !tbaa !9
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.zip64_internal, ptr %41, i32 0, i32 6
  %43 = getelementptr inbounds %struct.curfile64_info, ptr %42, i32 0, i32 0
  %44 = getelementptr inbounds %struct.z_stream_s, ptr %43, i32 0, i32 1
  store i32 %40, ptr %44, align 8, !tbaa !22
  br label %45

45:                                               ; preds = %224, %24
  %46 = load i32, ptr %9, align 4, !tbaa !9
  %47 = icmp eq i32 %46, 0
  br i1 %47, label %48, label %55

48:                                               ; preds = %45
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.zip64_internal, ptr %49, i32 0, i32 6
  %51 = getelementptr inbounds %struct.curfile64_info, ptr %50, i32 0, i32 0
  %52 = getelementptr inbounds %struct.z_stream_s, ptr %51, i32 0, i32 1
  %53 = load i32, ptr %52, align 8, !tbaa !22
  %54 = icmp ugt i32 %53, 0
  br label %55

55:                                               ; preds = %48, %45
  %56 = phi i1 [ false, %45 ], [ %54, %48 ]
  br i1 %56, label %57, label %225

57:                                               ; preds = %55
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.zip64_internal, ptr %58, i32 0, i32 6
  %60 = getelementptr inbounds %struct.curfile64_info, ptr %59, i32 0, i32 0
  %61 = getelementptr inbounds %struct.z_stream_s, ptr %60, i32 0, i32 4
  %62 = load i32, ptr %61, align 8, !tbaa !23
  %63 = icmp eq i32 %62, 0
  br i1 %63, label %64, label %82

64:                                               ; preds = %57
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = call i32 @zip64FlushWriteBuffer(ptr noundef %65)
  %67 = icmp eq i32 %66, -1
  br i1 %67, label %68, label %69

68:                                               ; preds = %64
  store i32 -1, ptr %9, align 4, !tbaa !9
  br label %69

69:                                               ; preds = %68, %64
  %70 = load ptr, ptr %8, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.zip64_internal, ptr %70, i32 0, i32 6
  %72 = getelementptr inbounds %struct.curfile64_info, ptr %71, i32 0, i32 0
  %73 = getelementptr inbounds %struct.z_stream_s, ptr %72, i32 0, i32 4
  store i32 65536, ptr %73, align 8, !tbaa !23
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.zip64_internal, ptr %74, i32 0, i32 6
  %76 = getelementptr inbounds %struct.curfile64_info, ptr %75, i32 0, i32 13
  %77 = getelementptr inbounds [65536 x i8], ptr %76, i64 0, i64 0
  %78 = load ptr, ptr %8, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.zip64_internal, ptr %78, i32 0, i32 6
  %80 = getelementptr inbounds %struct.curfile64_info, ptr %79, i32 0, i32 0
  %81 = getelementptr inbounds %struct.z_stream_s, ptr %80, i32 0, i32 3
  store ptr %77, ptr %81, align 8, !tbaa !24
  br label %82

82:                                               ; preds = %69, %57
  %83 = load i32, ptr %9, align 4, !tbaa !9
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %86

85:                                               ; preds = %82
  br label %225

86:                                               ; preds = %82
  %87 = load ptr, ptr %8, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.zip64_internal, ptr %87, i32 0, i32 6
  %89 = getelementptr inbounds %struct.curfile64_info, ptr %88, i32 0, i32 11
  %90 = load i32, ptr %89, align 4, !tbaa !25
  %91 = icmp eq i32 %90, 8
  br i1 %91, label %92, label %121

92:                                               ; preds = %86
  %93 = load ptr, ptr %8, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.zip64_internal, ptr %93, i32 0, i32 6
  %95 = getelementptr inbounds %struct.curfile64_info, ptr %94, i32 0, i32 12
  %96 = load i32, ptr %95, align 8, !tbaa !26
  %97 = icmp ne i32 %96, 0
  br i1 %97, label %121, label %98

98:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %99 = load ptr, ptr %8, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.zip64_internal, ptr %99, i32 0, i32 6
  %101 = getelementptr inbounds %struct.curfile64_info, ptr %100, i32 0, i32 0
  %102 = getelementptr inbounds %struct.z_stream_s, ptr %101, i32 0, i32 5
  %103 = load i64, ptr %102, align 8, !tbaa !27
  store i64 %103, ptr %11, align 8, !tbaa !28
  %104 = load ptr, ptr %8, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.zip64_internal, ptr %104, i32 0, i32 6
  %106 = getelementptr inbounds %struct.curfile64_info, ptr %105, i32 0, i32 0
  %107 = call i32 @deflate(ptr noundef %106, i32 noundef 0)
  store i32 %107, ptr %9, align 4, !tbaa !9
  %108 = load ptr, ptr %8, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.zip64_internal, ptr %108, i32 0, i32 6
  %110 = getelementptr inbounds %struct.curfile64_info, ptr %109, i32 0, i32 0
  %111 = getelementptr inbounds %struct.z_stream_s, ptr %110, i32 0, i32 5
  %112 = load i64, ptr %111, align 8, !tbaa !27
  %113 = load i64, ptr %11, align 8, !tbaa !28
  %114 = sub i64 %112, %113
  %115 = trunc i64 %114 to i32
  %116 = load ptr, ptr %8, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.zip64_internal, ptr %116, i32 0, i32 6
  %118 = getelementptr inbounds %struct.curfile64_info, ptr %117, i32 0, i32 2
  %119 = load i32, ptr %118, align 4, !tbaa !29
  %120 = add i32 %119, %115
  store i32 %120, ptr %118, align 4, !tbaa !29
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  br label %224

121:                                              ; preds = %92, %86
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.zip64_internal, ptr %122, i32 0, i32 6
  %124 = getelementptr inbounds %struct.curfile64_info, ptr %123, i32 0, i32 0
  %125 = getelementptr inbounds %struct.z_stream_s, ptr %124, i32 0, i32 1
  %126 = load i32, ptr %125, align 8, !tbaa !22
  %127 = load ptr, ptr %8, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.zip64_internal, ptr %127, i32 0, i32 6
  %129 = getelementptr inbounds %struct.curfile64_info, ptr %128, i32 0, i32 0
  %130 = getelementptr inbounds %struct.z_stream_s, ptr %129, i32 0, i32 4
  %131 = load i32, ptr %130, align 8, !tbaa !23
  %132 = icmp ult i32 %126, %131
  br i1 %132, label %133, label %139

133:                                              ; preds = %121
  %134 = load ptr, ptr %8, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.zip64_internal, ptr %134, i32 0, i32 6
  %136 = getelementptr inbounds %struct.curfile64_info, ptr %135, i32 0, i32 0
  %137 = getelementptr inbounds %struct.z_stream_s, ptr %136, i32 0, i32 1
  %138 = load i32, ptr %137, align 8, !tbaa !22
  store i32 %138, ptr %12, align 4, !tbaa !9
  br label %145

139:                                              ; preds = %121
  %140 = load ptr, ptr %8, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.zip64_internal, ptr %140, i32 0, i32 6
  %142 = getelementptr inbounds %struct.curfile64_info, ptr %141, i32 0, i32 0
  %143 = getelementptr inbounds %struct.z_stream_s, ptr %142, i32 0, i32 4
  %144 = load i32, ptr %143, align 8, !tbaa !23
  store i32 %144, ptr %12, align 4, !tbaa !9
  br label %145

145:                                              ; preds = %139, %133
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %146

146:                                              ; preds = %168, %145
  %147 = load i32, ptr %13, align 4, !tbaa !9
  %148 = load i32, ptr %12, align 4, !tbaa !9
  %149 = icmp ult i32 %147, %148
  br i1 %149, label %150, label %171

150:                                              ; preds = %146
  %151 = load ptr, ptr %8, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.zip64_internal, ptr %151, i32 0, i32 6
  %153 = getelementptr inbounds %struct.curfile64_info, ptr %152, i32 0, i32 0
  %154 = getelementptr inbounds %struct.z_stream_s, ptr %153, i32 0, i32 0
  %155 = load ptr, ptr %154, align 8, !tbaa !21
  %156 = load i32, ptr %13, align 4, !tbaa !9
  %157 = zext i32 %156 to i64
  %158 = getelementptr inbounds i8, ptr %155, i64 %157
  %159 = load i8, ptr %158, align 1, !tbaa !30
  %160 = load ptr, ptr %8, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.zip64_internal, ptr %160, i32 0, i32 6
  %162 = getelementptr inbounds %struct.curfile64_info, ptr %161, i32 0, i32 0
  %163 = getelementptr inbounds %struct.z_stream_s, ptr %162, i32 0, i32 3
  %164 = load ptr, ptr %163, align 8, !tbaa !24
  %165 = load i32, ptr %13, align 4, !tbaa !9
  %166 = zext i32 %165 to i64
  %167 = getelementptr inbounds i8, ptr %164, i64 %166
  store i8 %159, ptr %167, align 1, !tbaa !30
  br label %168

168:                                              ; preds = %150
  %169 = load i32, ptr %13, align 4, !tbaa !9
  %170 = add i32 %169, 1
  store i32 %170, ptr %13, align 4, !tbaa !9
  br label %146, !llvm.loop !31

171:                                              ; preds = %146
  %172 = load i32, ptr %12, align 4, !tbaa !9
  %173 = load ptr, ptr %8, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.zip64_internal, ptr %173, i32 0, i32 6
  %175 = getelementptr inbounds %struct.curfile64_info, ptr %174, i32 0, i32 0
  %176 = getelementptr inbounds %struct.z_stream_s, ptr %175, i32 0, i32 1
  %177 = load i32, ptr %176, align 8, !tbaa !22
  %178 = sub i32 %177, %172
  store i32 %178, ptr %176, align 8, !tbaa !22
  %179 = load i32, ptr %12, align 4, !tbaa !9
  %180 = load ptr, ptr %8, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.zip64_internal, ptr %180, i32 0, i32 6
  %182 = getelementptr inbounds %struct.curfile64_info, ptr %181, i32 0, i32 0
  %183 = getelementptr inbounds %struct.z_stream_s, ptr %182, i32 0, i32 4
  %184 = load i32, ptr %183, align 8, !tbaa !23
  %185 = sub i32 %184, %179
  store i32 %185, ptr %183, align 8, !tbaa !23
  %186 = load i32, ptr %12, align 4, !tbaa !9
  %187 = load ptr, ptr %8, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.zip64_internal, ptr %187, i32 0, i32 6
  %189 = getelementptr inbounds %struct.curfile64_info, ptr %188, i32 0, i32 0
  %190 = getelementptr inbounds %struct.z_stream_s, ptr %189, i32 0, i32 0
  %191 = load ptr, ptr %190, align 8, !tbaa !21
  %192 = zext i32 %186 to i64
  %193 = getelementptr inbounds i8, ptr %191, i64 %192
  store ptr %193, ptr %190, align 8, !tbaa !21
  %194 = load i32, ptr %12, align 4, !tbaa !9
  %195 = load ptr, ptr %8, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.zip64_internal, ptr %195, i32 0, i32 6
  %197 = getelementptr inbounds %struct.curfile64_info, ptr %196, i32 0, i32 0
  %198 = getelementptr inbounds %struct.z_stream_s, ptr %197, i32 0, i32 3
  %199 = load ptr, ptr %198, align 8, !tbaa !24
  %200 = zext i32 %194 to i64
  %201 = getelementptr inbounds i8, ptr %199, i64 %200
  store ptr %201, ptr %198, align 8, !tbaa !24
  %202 = load i32, ptr %12, align 4, !tbaa !9
  %203 = zext i32 %202 to i64
  %204 = load ptr, ptr %8, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.zip64_internal, ptr %204, i32 0, i32 6
  %206 = getelementptr inbounds %struct.curfile64_info, ptr %205, i32 0, i32 0
  %207 = getelementptr inbounds %struct.z_stream_s, ptr %206, i32 0, i32 2
  %208 = load i64, ptr %207, align 8, !tbaa !33
  %209 = add i64 %208, %203
  store i64 %209, ptr %207, align 8, !tbaa !33
  %210 = load i32, ptr %12, align 4, !tbaa !9
  %211 = zext i32 %210 to i64
  %212 = load ptr, ptr %8, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.zip64_internal, ptr %212, i32 0, i32 6
  %214 = getelementptr inbounds %struct.curfile64_info, ptr %213, i32 0, i32 0
  %215 = getelementptr inbounds %struct.z_stream_s, ptr %214, i32 0, i32 5
  %216 = load i64, ptr %215, align 8, !tbaa !27
  %217 = add i64 %216, %211
  store i64 %217, ptr %215, align 8, !tbaa !27
  %218 = load i32, ptr %12, align 4, !tbaa !9
  %219 = load ptr, ptr %8, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.zip64_internal, ptr %219, i32 0, i32 6
  %221 = getelementptr inbounds %struct.curfile64_info, ptr %220, i32 0, i32 2
  %222 = load i32, ptr %221, align 4, !tbaa !29
  %223 = add i32 %222, %218
  store i32 %223, ptr %221, align 4, !tbaa !29
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  br label %224

224:                                              ; preds = %171, %98
  br label %45, !llvm.loop !34

225:                                              ; preds = %85, %55
  %226 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %226, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %227

227:                                              ; preds = %225, %23, %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %228 = load i32, ptr %4, align 4
  ret i32 %228
}

declare i64 @crc32(i64 noundef, ptr noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @zip64FlushWriteBuffer(ptr noundef) #1

declare i32 @deflate(ptr noundef, i32 noundef) #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 = { "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 = !{!12, !10, i64 136}
!12 = !{!"", !13, i64 0, !6, i64 104, !6, i64 112, !15, i64 120, !10, i64 136, !10, i64 140, !16, i64 144, !19, i64 65968, !19, i64 65976, !19, i64 65984, !19, i64 65992, !18, i64 66000, !18, i64 66008, !6, i64 66016}
!13 = !{!"zlib_filefunc64_32_def_s", !14, i64 0, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96}
!14 = !{!"zlib_filefunc64_def_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64}
!15 = !{!"linkedlist_data_s", !6, i64 0, !6, i64 8}
!16 = !{!"", !17, i64 0, !10, i64 112, !10, i64 116, !19, i64 120, !6, i64 128, !18, i64 136, !18, i64 144, !18, i64 152, !18, i64 160, !18, i64 168, !10, i64 176, !10, i64 180, !10, i64 184, !7, i64 188, !18, i64 65728, !18, i64 65736, !10, i64 65744, !18, i64 65752, !19, i64 65760, !19, i64 65768, !19, i64 65776, !7, i64 65784, !6, i64 65808, !10, i64 65816}
!17 = !{!"z_stream_s", !6, i64 0, !10, i64 8, !18, i64 16, !6, i64 24, !10, i64 32, !18, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !18, i64 96, !18, i64 104}
!18 = !{!"long", !7, i64 0}
!19 = !{!"long long", !7, i64 0}
!20 = !{!12, !18, i64 65880}
!21 = !{!12, !6, i64 144}
!22 = !{!12, !10, i64 152}
!23 = !{!12, !10, i64 176}
!24 = !{!12, !6, i64 168}
!25 = !{!12, !10, i64 324}
!26 = !{!12, !10, i64 328}
!27 = !{!12, !18, i64 184}
!28 = !{!18, !18, i64 0}
!29 = !{!12, !10, i64 260}
!30 = !{!7, !7, i64 0}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!12, !18, i64 160}
!34 = distinct !{!34, !32}


; 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
define dso_local i32 @zipWriteInFileInZip(ptr noundef %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = icmp eq ptr %0, null
  br i1 %4, label %.critedge, label %5

5:                                                ; preds = %3
  %6 = getelementptr inbounds i8, ptr %0, i64 136
  %7 = load i32, ptr %6, align 8, !tbaa !5
  %8 = icmp eq i32 %7, 0
  br i1 %8, label %.critedge, label %9

9:                                                ; preds = %5
  %10 = getelementptr inbounds i8, ptr %0, i64 144
  %11 = getelementptr inbounds i8, ptr %0, i64 65880
  %12 = load i64, ptr %11, align 8, !tbaa !18
  %13 = tail call i64 @crc32(i64 noundef %12, ptr noundef %1, i32 noundef %2) #3
  store i64 %13, ptr %11, align 8, !tbaa !18
  store ptr %1, ptr %10, align 8, !tbaa !19
  %14 = getelementptr inbounds i8, ptr %0, i64 152
  store i32 %2, ptr %14, align 8, !tbaa !20
  %15 = getelementptr inbounds i8, ptr %0, i64 176
  %16 = getelementptr inbounds i8, ptr %0, i64 332
  %17 = getelementptr inbounds i8, ptr %0, i64 168
  %18 = getelementptr inbounds i8, ptr %0, i64 324
  %19 = getelementptr inbounds i8, ptr %0, i64 328
  %20 = getelementptr inbounds i8, ptr %0, i64 160
  %21 = getelementptr inbounds i8, ptr %0, i64 184
  %22 = getelementptr inbounds i8, ptr %0, i64 260
  br label %23

23:                                               ; preds = %9, %83
  %24 = load i32, ptr %14, align 8, !tbaa !20
  %.not = icmp eq i32 %24, 0
  br i1 %.not, label %.critedge, label %25

25:                                               ; preds = %23
  %26 = load i32, ptr %15, align 8, !tbaa !21
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %28, label %31

28:                                               ; preds = %25
  %29 = tail call i32 @zip64FlushWriteBuffer(ptr noundef nonnull %0)
  %30 = icmp eq i32 %29, -1
  store i32 65536, ptr %15, align 8, !tbaa !21
  store ptr %16, ptr %17, align 8, !tbaa !22
  br i1 %30, label %.critedge, label %31

31:                                               ; preds = %28, %25
  %32 = phi i32 [ 65536, %28 ], [ %26, %25 ]
  %33 = load i32, ptr %18, align 4, !tbaa !23
  %34 = icmp eq i32 %33, 8
  br i1 %34, label %35, label %43

35:                                               ; preds = %31
  %36 = load i32, ptr %19, align 8, !tbaa !24
  %.not59 = icmp eq i32 %36, 0
  br i1 %.not59, label %37, label %43

37:                                               ; preds = %35
  %38 = load i64, ptr %21, align 8, !tbaa !25
  %39 = tail call i32 @deflate(ptr noundef nonnull %10, i32 noundef 0) #3
  %40 = load i64, ptr %21, align 8, !tbaa !25
  %41 = sub i64 %40, %38
  %42 = trunc i64 %41 to i32
  br label %83

43:                                               ; preds = %35, %31
  %44 = load i32, ptr %14, align 8, !tbaa !20
  %. = tail call i32 @llvm.umin.i32(i32 %44, i32 %32)
  %.not63 = icmp eq i32 %44, 0
  %.pre66 = zext i32 %. to i64
  br i1 %.not63, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %43
  %xtraiter = and i64 %.pre66, 3
  %45 = icmp ult i32 %., 4
  br i1 %45, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %.pre66, 4294967292
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.3, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %46 = load ptr, ptr %10, align 8, !tbaa !19
  %47 = getelementptr inbounds i8, ptr %46, i64 %indvars.iv
  %48 = load i8, ptr %47, align 1, !tbaa !26
  %49 = load ptr, ptr %17, align 8, !tbaa !22
  %50 = getelementptr inbounds i8, ptr %49, i64 %indvars.iv
  store i8 %48, ptr %50, align 1, !tbaa !26
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %51 = load ptr, ptr %10, align 8, !tbaa !19
  %52 = getelementptr inbounds i8, ptr %51, i64 %indvars.iv.next
  %53 = load i8, ptr %52, align 1, !tbaa !26
  %54 = load ptr, ptr %17, align 8, !tbaa !22
  %55 = getelementptr inbounds i8, ptr %54, i64 %indvars.iv.next
  store i8 %53, ptr %55, align 1, !tbaa !26
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %56 = load ptr, ptr %10, align 8, !tbaa !19
  %57 = getelementptr inbounds i8, ptr %56, i64 %indvars.iv.next.1
  %58 = load i8, ptr %57, align 1, !tbaa !26
  %59 = load ptr, ptr %17, align 8, !tbaa !22
  %60 = getelementptr inbounds i8, ptr %59, i64 %indvars.iv.next.1
  store i8 %58, ptr %60, align 1, !tbaa !26
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %61 = load ptr, ptr %10, align 8, !tbaa !19
  %62 = getelementptr inbounds i8, ptr %61, i64 %indvars.iv.next.2
  %63 = load i8, ptr %62, align 1, !tbaa !26
  %64 = load ptr, ptr %17, align 8, !tbaa !22
  %65 = getelementptr inbounds i8, ptr %64, i64 %indvars.iv.next.2
  store i8 %63, ptr %65, align 1, !tbaa !26
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !27

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.3, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge.loopexit, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph.epil ], [ %indvars.iv.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %66 = load ptr, ptr %10, align 8, !tbaa !19
  %67 = getelementptr inbounds i8, ptr %66, i64 %indvars.iv.epil
  %68 = load i8, ptr %67, align 1, !tbaa !26
  %69 = load ptr, ptr %17, align 8, !tbaa !22
  %70 = getelementptr inbounds i8, ptr %69, i64 %indvars.iv.epil
  store i8 %68, ptr %70, align 1, !tbaa !26
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge.loopexit, label %.lr.ph.epil, !llvm.loop !29

._crit_edge.loopexit:                             ; preds = %.lr.ph.epil, %._crit_edge.loopexit.unr-lcssa
  %.pre = load i32, ptr %14, align 8, !tbaa !20
  %.pre65 = load i32, ptr %15, align 8, !tbaa !21
  br label %._crit_edge

._crit_edge:                                      ; preds = %43, %._crit_edge.loopexit
  %71 = phi i32 [ %.pre65, %._crit_edge.loopexit ], [ %32, %43 ]
  %72 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ 0, %43 ]
  %73 = sub i32 %72, %.
  store i32 %73, ptr %14, align 8, !tbaa !20
  %74 = sub i32 %71, %.
  store i32 %74, ptr %15, align 8, !tbaa !21
  %75 = load ptr, ptr %10, align 8, !tbaa !19
  %76 = getelementptr inbounds i8, ptr %75, i64 %.pre66
  store ptr %76, ptr %10, align 8, !tbaa !19
  %77 = load ptr, ptr %17, align 8, !tbaa !22
  %78 = getelementptr inbounds i8, ptr %77, i64 %.pre66
  store ptr %78, ptr %17, align 8, !tbaa !22
  %79 = load i64, ptr %20, align 8, !tbaa !31
  %80 = add i64 %79, %.pre66
  store i64 %80, ptr %20, align 8, !tbaa !31
  %81 = load i64, ptr %21, align 8, !tbaa !25
  %82 = add i64 %81, %.pre66
  store i64 %82, ptr %21, align 8, !tbaa !25
  br label %83

83:                                               ; preds = %._crit_edge, %37
  %..sink = phi i32 [ %., %._crit_edge ], [ %42, %37 ]
  %.3 = phi i32 [ 0, %._crit_edge ], [ %39, %37 ]
  %84 = load i32, ptr %22, align 4, !tbaa !32
  %85 = add i32 %84, %..sink
  store i32 %85, ptr %22, align 4, !tbaa !32
  %86 = icmp eq i32 %.3, 0
  br i1 %86, label %23, label %.critedge, !llvm.loop !33

.critedge:                                        ; preds = %28, %23, %83, %5, %3
  %.053 = phi i32 [ -102, %3 ], [ -102, %5 ], [ -1, %28 ], [ %.3, %83 ], [ 0, %23 ]
  ret i32 %.053
}

declare i64 @crc32(i64 noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

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

declare i32 @deflate(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #2

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !13, i64 136}
!6 = !{!"", !7, i64 0, !9, i64 104, !9, i64 112, !12, i64 120, !13, i64 136, !13, i64 140, !14, i64 144, !17, i64 65968, !17, i64 65976, !17, i64 65984, !17, i64 65992, !16, i64 66000, !16, i64 66008, !9, i64 66016}
!7 = !{!"zlib_filefunc64_32_def_s", !8, i64 0, !9, i64 72, !9, i64 80, !9, i64 88, !9, i64 96}
!8 = !{!"zlib_filefunc64_def_s", !9, i64 0, !9, i64 8, !9, i64 16, !9, i64 24, !9, i64 32, !9, i64 40, !9, i64 48, !9, i64 56, !9, i64 64}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C/C++ TBAA"}
!12 = !{!"linkedlist_data_s", !9, i64 0, !9, i64 8}
!13 = !{!"int", !10, i64 0}
!14 = !{!"", !15, i64 0, !13, i64 112, !13, i64 116, !17, i64 120, !9, i64 128, !16, i64 136, !16, i64 144, !16, i64 152, !16, i64 160, !16, i64 168, !13, i64 176, !13, i64 180, !13, i64 184, !10, i64 188, !16, i64 65728, !16, i64 65736, !13, i64 65744, !16, i64 65752, !17, i64 65760, !17, i64 65768, !17, i64 65776, !10, i64 65784, !9, i64 65808, !13, i64 65816}
!15 = !{!"z_stream_s", !9, i64 0, !13, i64 8, !16, i64 16, !9, i64 24, !13, i64 32, !16, i64 40, !9, i64 48, !9, i64 56, !9, i64 64, !9, i64 72, !9, i64 80, !13, i64 88, !16, i64 96, !16, i64 104}
!16 = !{!"long", !10, i64 0}
!17 = !{!"long long", !10, i64 0}
!18 = !{!6, !16, i64 65880}
!19 = !{!6, !9, i64 144}
!20 = !{!6, !13, i64 152}
!21 = !{!6, !13, i64 176}
!22 = !{!6, !9, i64 168}
!23 = !{!6, !13, i64 324}
!24 = !{!6, !13, i64 328}
!25 = !{!6, !16, i64 184}
!26 = !{!10, !10, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.unroll.disable"}
!31 = !{!6, !16, i64 160}
!32 = !{!6, !13, i64 260}
!33 = distinct !{!33, !28}


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