; LLVM IR from q191201771/libchef :: include/chef_base/.invisible/.wrapper (compress_zlib_op)

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

@.str = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN4chef16compress_zlib_op8compressEPKhiPPhPiNS0_17compression_levelE(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4) #0 align 2 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %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 %struct.z_stream_s, align 8
  %16 = alloca [8192 x i8], align 16
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store i32 %4, ptr %11, align 4, !tbaa !11
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = icmp eq ptr %24, null
  br i1 %25, label %32, label %26

26:                                               ; preds = %5
  %27 = load i32, ptr %8, align 4, !tbaa !9
  %28 = icmp sle i32 %27, 0
  br i1 %28, label %32, label %29

29:                                               ; preds = %26
  %30 = load ptr, ptr %10, align 8, !tbaa !5
  %31 = icmp eq ptr %30, null
  br i1 %31, label %32, label %33

32:                                               ; preds = %29, %26, %5
  store i32 -1, ptr %6, align 4
  br label %148

33:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 112, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 8192, ptr %16) #7
  %34 = getelementptr inbounds %struct.z_stream_s, ptr %15, i32 0, i32 8
  store ptr null, ptr %34, align 8, !tbaa !13
  %35 = getelementptr inbounds %struct.z_stream_s, ptr %15, i32 0, i32 9
  store ptr null, ptr %35, align 8, !tbaa !16
  %36 = getelementptr inbounds %struct.z_stream_s, ptr %15, i32 0, i32 10
  store ptr null, ptr %36, align 8, !tbaa !17
  %37 = load i32, ptr %11, align 4, !tbaa !11
  %38 = call i32 @deflateInit_(ptr noundef %15, i32 noundef %37, ptr noundef @.str, i32 noundef 112)
  store i32 %38, ptr %12, align 4, !tbaa !9
  %39 = load i32, ptr %12, align 4, !tbaa !9
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %42

41:                                               ; preds = %33
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %147

42:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %43 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %43, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %44 = load i32, ptr %18, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = call noalias ptr @malloc(i64 noundef %45) #8
  store ptr %46, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %47 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %47, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 0, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %126, %42
  %49 = load i32, ptr %20, align 4, !tbaa !9
  %50 = icmp sgt i32 %49, 8192
  br i1 %50, label %51, label %52

51:                                               ; preds = %48
  br label %54

52:                                               ; preds = %48
  %53 = load i32, ptr %20, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %52, %51
  %55 = phi i32 [ 8192, %51 ], [ %53, %52 ]
  %56 = getelementptr inbounds %struct.z_stream_s, ptr %15, i32 0, i32 1
  store i32 %55, ptr %56, align 8, !tbaa !18
  %57 = load i32, ptr %20, align 4, !tbaa !9
  %58 = icmp sle i32 %57, 8192
  %59 = zext i1 %58 to i64
  %60 = select i1 %58, i32 4, i32 0
  store i32 %60, ptr %13, align 4, !tbaa !9
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = load i32, ptr %21, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds i8, ptr %61, i64 %63
  %65 = getelementptr inbounds %struct.z_stream_s, ptr %15, i32 0, i32 0
  store ptr %64, ptr %65, align 8, !tbaa !19
  %66 = getelementptr inbounds %struct.z_stream_s, ptr %15, i32 0, i32 1
  %67 = load i32, ptr %66, align 8, !tbaa !18
  %68 = load i32, ptr %21, align 4, !tbaa !9
  %69 = add i32 %68, %67
  store i32 %69, ptr %21, align 4, !tbaa !9
  %70 = getelementptr inbounds %struct.z_stream_s, ptr %15, i32 0, i32 1
  %71 = load i32, ptr %70, align 8, !tbaa !18
  %72 = load i32, ptr %20, align 4, !tbaa !9
  %73 = sub i32 %72, %71
  store i32 %73, ptr %20, align 4, !tbaa !9
  br label %74

74:                                               ; preds = %121, %54
  %75 = getelementptr inbounds %struct.z_stream_s, ptr %15, i32 0, i32 4
  store i32 8192, ptr %75, align 8, !tbaa !20
  %76 = getelementptr inbounds [8192 x i8], ptr %16, i64 0, i64 0
  %77 = getelementptr inbounds %struct.z_stream_s, ptr %15, i32 0, i32 3
  store ptr %76, ptr %77, align 8, !tbaa !21
  %78 = load i32, ptr %13, align 4, !tbaa !9
  %79 = call i32 @deflate(ptr noundef %15, i32 noundef %78)
  store i32 %79, ptr %12, align 4, !tbaa !9
  %80 = load i32, ptr %12, align 4, !tbaa !9
  %81 = icmp eq i32 %80, -2
  br i1 %81, label %82, label %83

82:                                               ; preds = %74
  br label %139

83:                                               ; preds = %74
  %84 = getelementptr inbounds %struct.z_stream_s, ptr %15, i32 0, i32 4
  %85 = load i32, ptr %84, align 8, !tbaa !20
  %86 = sub i32 8192, %85
  store i32 %86, ptr %14, align 4, !tbaa !9
  %87 = load i32, ptr %22, align 4, !tbaa !9
  %88 = load i32, ptr %14, align 4, !tbaa !9
  %89 = add nsw i32 %87, %88
  %90 = load i32, ptr %18, align 4, !tbaa !9
  %91 = icmp sgt i32 %89, %90
  br i1 %91, label %92, label %110

92:                                               ; preds = %83
  %93 = load i32, ptr %22, align 4, !tbaa !9
  %94 = load i32, ptr %14, align 4, !tbaa !9
  %95 = add nsw i32 %93, %94
  store i32 %95, ptr %18, align 4, !tbaa !9
  %96 = load i32, ptr %18, align 4, !tbaa !9
  %97 = shl i32 %96, 1
  store i32 %97, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %98 = load ptr, ptr %19, align 8, !tbaa !5
  %99 = load i32, ptr %18, align 4, !tbaa !9
  %100 = sext i32 %99 to i64
  %101 = call ptr @realloc(ptr noundef %98, i64 noundef %100) #9
  store ptr %101, ptr %23, align 8, !tbaa !5
  %102 = load ptr, ptr %23, align 8, !tbaa !5
  %103 = icmp eq ptr %102, null
  br i1 %103, label %104, label %105

104:                                              ; preds = %92
  store i32 6, ptr %17, align 4
  br label %107

105:                                              ; preds = %92
  %106 = load ptr, ptr %23, align 8, !tbaa !5
  store ptr %106, ptr %19, align 8, !tbaa !5
  store i32 0, ptr %17, align 4
  br label %107

107:                                              ; preds = %105, %104
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  %108 = load i32, ptr %17, align 4
  switch i32 %108, label %146 [
    i32 0, label %109
    i32 6, label %139
  ]

109:                                              ; preds = %107
  br label %110

110:                                              ; preds = %109, %83
  %111 = load ptr, ptr %19, align 8, !tbaa !5
  %112 = load i32, ptr %22, align 4, !tbaa !9
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds i8, ptr %111, i64 %113
  %115 = getelementptr inbounds [8192 x i8], ptr %16, i64 0, i64 0
  %116 = load i32, ptr %14, align 4, !tbaa !9
  %117 = sext i32 %116 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %114, ptr align 16 %115, i64 %117, i1 false)
  %118 = load i32, ptr %14, align 4, !tbaa !9
  %119 = load i32, ptr %22, align 4, !tbaa !9
  %120 = add nsw i32 %119, %118
  store i32 %120, ptr %22, align 4, !tbaa !9
  br label %121

121:                                              ; preds = %110
  %122 = getelementptr inbounds %struct.z_stream_s, ptr %15, i32 0, i32 4
  %123 = load i32, ptr %122, align 8, !tbaa !20
  %124 = icmp eq i32 %123, 0
  br i1 %124, label %74, label %125, !llvm.loop !22

125:                                              ; preds = %121
  br label %126

126:                                              ; preds = %125
  %127 = load i32, ptr %13, align 4, !tbaa !9
  %128 = icmp ne i32 %127, 4
  br i1 %128, label %48, label %129, !llvm.loop !24

129:                                              ; preds = %126
  %130 = load i32, ptr %12, align 4, !tbaa !9
  %131 = icmp ne i32 %130, 1
  br i1 %131, label %132, label %133

132:                                              ; preds = %129
  br label %139

133:                                              ; preds = %129
  %134 = load ptr, ptr %19, align 8, !tbaa !5
  %135 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %134, ptr %135, align 8, !tbaa !5
  %136 = load i32, ptr %22, align 4, !tbaa !9
  %137 = load ptr, ptr %10, align 8, !tbaa !5
  store i32 %136, ptr %137, align 4, !tbaa !9
  %138 = call i32 @deflateEnd(ptr noundef %15)
  store i32 0, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %146

139:                                              ; preds = %132, %107, %82
  %140 = call i32 @deflateEnd(ptr noundef %15)
  %141 = load ptr, ptr %19, align 8, !tbaa !5
  %142 = icmp ne ptr %141, null
  br i1 %142, label %143, label %145

143:                                              ; preds = %139
  %144 = load ptr, ptr %19, align 8, !tbaa !5
  call void @free(ptr noundef %144) #7
  br label %145

145:                                              ; preds = %143, %139
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %146

146:                                              ; preds = %145, %133, %107
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %147

147:                                              ; preds = %146, %41
  call void @llvm.lifetime.end.p0(i64 8192, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 112, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %148

148:                                              ; preds = %147, %32
  %149 = load i32, ptr %6, align 4
  ret i32 %149
}

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

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #3

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

; Function Attrs: nounwind allocsize(1)
declare ptr @realloc(ptr noundef, i64 noundef) #4

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

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

declare i32 @deflateEnd(ptr noundef) #2

; Function Attrs: nounwind
declare void @free(ptr noundef) #6

attributes #0 = { mustprogress 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 allocsize(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 #4 = { nounwind allocsize(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 #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind "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 #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { nounwind allocsize(1) }

!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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTSN4chef16compress_zlib_op17compression_levelE", !7, i64 0}
!13 = !{!14, !6, i64 64}
!14 = !{!"_ZTS10z_stream_s", !6, i64 0, !10, i64 8, !15, i64 16, !6, i64 24, !10, i64 32, !15, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !15, i64 96, !15, i64 104}
!15 = !{!"long", !7, i64 0}
!16 = !{!14, !6, i64 72}
!17 = !{!14, !6, i64 80}
!18 = !{!14, !10, i64 8}
!19 = !{!14, !6, i64 0}
!20 = !{!14, !10, i64 32}
!21 = !{!14, !6, i64 24}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.z_stream_s = type { ptr, i32, i64, ptr, i32, i64, ptr, ptr, ptr, ptr, ptr, i32, i64, i64 }

@.str = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN4chef16compress_zlib_op8compressEPKhiPPhPiNS0_17compression_levelE(ptr noundef %0, i32 noundef %1, ptr nocapture noundef writeonly %2, ptr noundef writeonly %3, i32 noundef %4) local_unnamed_addr #0 align 2 {
  %6 = alloca %struct.z_stream_s, align 8
  %7 = alloca [8192 x i8], align 16
  %8 = icmp eq ptr %0, null
  %9 = icmp slt i32 %1, 1
  %or.cond = or i1 %8, %9
  %10 = icmp eq ptr %3, null
  %or.cond3 = or i1 %or.cond, %10
  br i1 %or.cond3, label %54, label %11

11:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 8192, ptr nonnull %7) #9
  %12 = getelementptr inbounds i8, ptr %6, i64 64
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %12, i8 0, i64 24, i1 false)
  %13 = call i32 @deflateInit_(ptr noundef nonnull %6, i32 noundef %4, ptr noundef nonnull @.str, i32 noundef 112)
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %14, label %53

14:                                               ; preds = %11
  %15 = zext nneg i32 %1 to i64
  %16 = call noalias ptr @malloc(i64 noundef %15) #10
  %17 = getelementptr inbounds i8, ptr %6, i64 8
  %18 = getelementptr inbounds i8, ptr %6, i64 32
  %19 = getelementptr inbounds i8, ptr %6, i64 24
  br label %20

20:                                               ; preds = %47, %14
  %.051 = phi i32 [ %1, %14 ], [ %.253, %47 ]
  %.048 = phi ptr [ %16, %14 ], [ %.3, %47 ]
  %.047 = phi i32 [ %1, %14 ], [ %27, %47 ]
  %.046 = phi i32 [ 0, %14 ], [ %26, %47 ]
  %.044 = phi i32 [ 0, %14 ], [ %34, %47 ]
  %21 = call i32 @llvm.smin.i32(i32 %.047, i32 8192)
  store i32 %21, ptr %17, align 8, !tbaa !5
  %22 = icmp slt i32 %.047, 8193
  %23 = select i1 %22, i32 4, i32 0
  %24 = sext i32 %.046 to i64
  %25 = getelementptr inbounds i8, ptr %0, i64 %24
  store ptr %25, ptr %6, align 8, !tbaa !12
  %26 = add i32 %.046, %21
  %27 = sub i32 %.047, %21
  br label %28

28:                                               ; preds = %41, %20
  %.152 = phi i32 [ %.051, %20 ], [ %.253, %41 ]
  %.149 = phi ptr [ %.048, %20 ], [ %.3, %41 ]
  %.145 = phi i32 [ %.044, %20 ], [ %34, %41 ]
  store i32 8192, ptr %18, align 8, !tbaa !13
  store ptr %7, ptr %19, align 8, !tbaa !14
  %29 = call i32 @deflate(ptr noundef nonnull %6, i32 noundef %23)
  %30 = icmp eq i32 %29, -2
  br i1 %30, label %.loopexit, label %31

31:                                               ; preds = %28
  %32 = load i32, ptr %18, align 8, !tbaa !13
  %33 = sub i32 8192, %32
  %34 = add nsw i32 %33, %.145
  %35 = icmp sgt i32 %34, %.152
  br i1 %35, label %36, label %41

36:                                               ; preds = %31
  %37 = shl i32 %34, 1
  %38 = sext i32 %37 to i64
  %39 = call ptr @realloc(ptr noundef %.149, i64 noundef %38) #11
  %40 = icmp eq ptr %39, null
  br i1 %40, label %.loopexit, label %41

41:                                               ; preds = %36, %31
  %.253 = phi i32 [ %37, %36 ], [ %.152, %31 ]
  %.3 = phi ptr [ %39, %36 ], [ %.149, %31 ]
  %42 = sext i32 %.145 to i64
  %43 = getelementptr inbounds i8, ptr %.3, i64 %42
  %44 = sext i32 %33 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %43, ptr nonnull align 16 %7, i64 %44, i1 false)
  %45 = load i32, ptr %18, align 8, !tbaa !13
  %46 = icmp eq i32 %45, 0
  br i1 %46, label %28, label %47, !llvm.loop !15

47:                                               ; preds = %41
  br i1 %22, label %48, label %20, !llvm.loop !17

48:                                               ; preds = %47
  %.not62 = icmp eq i32 %29, 1
  br i1 %.not62, label %49, label %.loopexit

49:                                               ; preds = %48
  store ptr %.3, ptr %2, align 8, !tbaa !18
  store i32 %34, ptr %3, align 4, !tbaa !19
  %50 = call i32 @deflateEnd(ptr noundef nonnull %6)
  br label %53

.loopexit:                                        ; preds = %36, %28, %48
  %.4 = phi ptr [ %.3, %48 ], [ %.149, %28 ], [ %.149, %36 ]
  %51 = call i32 @deflateEnd(ptr noundef nonnull %6)
  %.not63 = icmp eq ptr %.4, null
  br i1 %.not63, label %53, label %52

52:                                               ; preds = %.loopexit
  call void @free(ptr noundef nonnull %.4) #9
  br label %53

53:                                               ; preds = %49, %52, %.loopexit, %11
  %.1 = phi i32 [ -1, %11 ], [ 0, %49 ], [ -1, %52 ], [ -1, %.loopexit ]
  call void @llvm.lifetime.end.p0(i64 8192, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %6) #9
  br label %54

54:                                               ; preds = %5, %53
  %.2 = phi i32 [ %.1, %53 ], [ -1, %5 ]
  ret i32 %.2
}

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

declare i32 @deflateInit_(ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #4

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

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

declare i32 @deflateEnd(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #6

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #8

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree 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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #4 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #9 = { nounwind }
attributes #10 = { nounwind allocsize(0) }
attributes #11 = { nounwind allocsize(1) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 8}
!6 = !{!"_ZTS10z_stream_s", !7, i64 0, !10, i64 8, !11, i64 16, !7, i64 24, !10, i64 32, !11, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !10, i64 88, !11, i64 96, !11, i64 104}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!6, !7, i64 0}
!13 = !{!6, !10, i64 32}
!14 = !{!6, !7, i64 24}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = !{!7, !7, i64 0}
!19 = !{!10, !10, i64 0}


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