; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

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

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

; 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) #3

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN4chef16compress_zlib_op10decompressEPKhiPPhPi(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) #5 align 2 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %struct.z_stream_s, align 8
  %13 = alloca [8192 x i8], align 16
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = icmp eq ptr %21, null
  br i1 %22, label %29, label %23

23:                                               ; preds = %4
  %24 = load i32, ptr %7, align 4, !tbaa !9
  %25 = icmp sle i32 %24, 0
  br i1 %25, label %29, label %26

26:                                               ; preds = %23
  %27 = load ptr, ptr %9, align 8, !tbaa !5
  %28 = icmp eq ptr %27, null
  br i1 %28, label %29, label %30

29:                                               ; preds = %26, %23, %4
  store i32 -1, ptr %5, align 4
  br label %146

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

39:                                               ; preds = %30
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %145

40:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %41 = load i32, ptr %7, align 4, !tbaa !9
  %42 = shl i32 %41, 2
  store i32 %42, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %43 = load i32, ptr %15, align 4, !tbaa !9
  %44 = sext i32 %43 to i64
  %45 = call noalias ptr @malloc(i64 noundef %44) #8
  store ptr %45, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %46 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %46, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %47

47:                                               ; preds = %124, %40
  %48 = load i32, ptr %17, align 4, !tbaa !9
  %49 = icmp sgt i32 %48, 8192
  br i1 %49, label %50, label %51

50:                                               ; preds = %47
  br label %53

51:                                               ; preds = %47
  %52 = load i32, ptr %17, align 4, !tbaa !9
  br label %53

53:                                               ; preds = %51, %50
  %54 = phi i32 [ 8192, %50 ], [ %52, %51 ]
  %55 = getelementptr inbounds %struct.z_stream_s, ptr %12, i32 0, i32 1
  store i32 %54, ptr %55, align 8, !tbaa !16
  %56 = getelementptr inbounds %struct.z_stream_s, ptr %12, i32 0, i32 1
  %57 = load i32, ptr %56, align 8, !tbaa !16
  %58 = icmp ule i32 %57, 0
  br i1 %58, label %59, label %60

59:                                               ; preds = %53
  br label %127

60:                                               ; preds = %53
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = load i32, ptr %18, 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 %12, i32 0, i32 0
  store ptr %64, ptr %65, align 8, !tbaa !17
  %66 = getelementptr inbounds %struct.z_stream_s, ptr %12, i32 0, i32 1
  %67 = load i32, ptr %66, align 8, !tbaa !16
  %68 = load i32, ptr %18, align 4, !tbaa !9
  %69 = add i32 %68, %67
  store i32 %69, ptr %18, align 4, !tbaa !9
  %70 = getelementptr inbounds %struct.z_stream_s, ptr %12, i32 0, i32 1
  %71 = load i32, ptr %70, align 8, !tbaa !16
  %72 = load i32, ptr %17, align 4, !tbaa !9
  %73 = sub i32 %72, %71
  store i32 %73, ptr %17, align 4, !tbaa !9
  br label %74

74:                                               ; preds = %119, %60
  %75 = getelementptr inbounds %struct.z_stream_s, ptr %12, i32 0, i32 4
  store i32 8192, ptr %75, align 8, !tbaa !18
  %76 = getelementptr inbounds [8192 x i8], ptr %13, i64 0, i64 0
  %77 = getelementptr inbounds %struct.z_stream_s, ptr %12, i32 0, i32 3
  store ptr %76, ptr %77, align 8, !tbaa !19
  %78 = call i32 @inflate(ptr noundef %12, i32 noundef 0)
  store i32 %78, ptr %10, align 4, !tbaa !9
  %79 = load i32, ptr %10, align 4, !tbaa !9
  switch i32 %79, label %81 [
    i32 -2, label %80
    i32 2, label %80
    i32 -3, label %80
    i32 -4, label %80
  ]

80:                                               ; preds = %74, %74, %74, %74
  br label %137

81:                                               ; preds = %74
  %82 = getelementptr inbounds %struct.z_stream_s, ptr %12, i32 0, i32 4
  %83 = load i32, ptr %82, align 8, !tbaa !18
  %84 = sub i32 8192, %83
  store i32 %84, ptr %11, align 4, !tbaa !9
  %85 = load i32, ptr %19, align 4, !tbaa !9
  %86 = load i32, ptr %11, align 4, !tbaa !9
  %87 = add nsw i32 %85, %86
  %88 = load i32, ptr %15, align 4, !tbaa !9
  %89 = icmp sgt i32 %87, %88
  br i1 %89, label %90, label %108

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

102:                                              ; preds = %90
  store i32 7, ptr %14, align 4
  br label %105

103:                                              ; preds = %90
  %104 = load ptr, ptr %20, align 8, !tbaa !5
  store ptr %104, ptr %16, align 8, !tbaa !5
  store i32 0, ptr %14, align 4
  br label %105

105:                                              ; preds = %103, %102
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  %106 = load i32, ptr %14, align 4
  switch i32 %106, label %144 [
    i32 0, label %107
    i32 7, label %137
  ]

107:                                              ; preds = %105
  br label %108

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

119:                                              ; preds = %108
  %120 = getelementptr inbounds %struct.z_stream_s, ptr %12, i32 0, i32 4
  %121 = load i32, ptr %120, align 8, !tbaa !18
  %122 = icmp eq i32 %121, 0
  br i1 %122, label %74, label %123, !llvm.loop !20

123:                                              ; preds = %119
  br label %124

124:                                              ; preds = %123
  %125 = load i32, ptr %10, align 4, !tbaa !9
  %126 = icmp ne i32 %125, 1
  br i1 %126, label %47, label %127, !llvm.loop !22

127:                                              ; preds = %124, %59
  %128 = load i32, ptr %10, align 4, !tbaa !9
  %129 = icmp ne i32 %128, 1
  br i1 %129, label %130, label %131

130:                                              ; preds = %127
  br label %137

131:                                              ; preds = %127
  %132 = load i32, ptr %19, align 4, !tbaa !9
  %133 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 %132, ptr %133, align 4, !tbaa !9
  %134 = load ptr, ptr %16, align 8, !tbaa !5
  %135 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %134, ptr %135, align 8, !tbaa !5
  %136 = call i32 @inflateEnd(ptr noundef %12)
  store i32 0, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %144

137:                                              ; preds = %130, %105, %80
  %138 = call i32 @inflateEnd(ptr noundef %12)
  %139 = load ptr, ptr %16, align 8, !tbaa !5
  %140 = icmp ne ptr %139, null
  br i1 %140, label %141, label %143

141:                                              ; preds = %137
  %142 = load ptr, ptr %16, align 8, !tbaa !5
  call void @free(ptr noundef %142) #7
  br label %143

143:                                              ; preds = %141, %137
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %144

144:                                              ; preds = %143, %131, %105
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %145

145:                                              ; preds = %144, %39
  call void @llvm.lifetime.end.p0(i64 8192, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 112, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %146

146:                                              ; preds = %145, %29
  %147 = load i32, ptr %5, align 4
  ret i32 %147
}

declare i32 @inflateInit_(ptr noundef, ptr noundef, i32 noundef) #6

declare i32 @inflate(ptr noundef, i32 noundef) #6

declare i32 @inflateEnd(ptr noundef) #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #6 = { "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, !6, i64 64}
!12 = !{!"_ZTS10z_stream_s", !6, i64 0, !10, i64 8, !13, i64 16, !6, i64 24, !10, i64 32, !13, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !13, i64 96, !13, i64 104}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !6, i64 72}
!15 = !{!12, !6, i64 80}
!16 = !{!12, !10, i64 8}
!17 = !{!12, !6, i64 0}
!18 = !{!12, !10, i64 32}
!19 = !{!12, !6, i64 24}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}


; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

; 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 #2

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

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

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

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

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

14:                                               ; preds = %10
  %15 = shl i32 %1, 2
  %16 = sext i32 %15 to i64
  %17 = call noalias ptr @malloc(i64 noundef %16) #10
  %18 = getelementptr inbounds i8, ptr %5, i64 32
  %19 = getelementptr inbounds i8, ptr %5, i64 24
  br label %20

20:                                               ; preds = %46, %14
  %.049 = phi i32 [ %15, %14 ], [ %.251, %46 ]
  %.046 = phi ptr [ %17, %14 ], [ %.3, %46 ]
  %.045 = phi i32 [ %1, %14 ], [ %27, %46 ]
  %.044 = phi i32 [ 0, %14 ], [ %26, %46 ]
  %.041 = phi i32 [ 0, %14 ], [ %33, %46 ]
  %21 = call i32 @llvm.smin.i32(i32 %.045, i32 8192)
  store i32 %21, ptr %12, align 8, !tbaa !5
  %22 = icmp eq i32 %.045, 0
  br i1 %22, label %.loopexit, label %23

23:                                               ; preds = %20
  %24 = sext i32 %.044 to i64
  %25 = getelementptr inbounds i8, ptr %0, i64 %24
  store ptr %25, ptr %5, align 8, !tbaa !12
  %26 = add i32 %.044, %21
  %27 = sub i32 %.045, %21
  br label %28

28:                                               ; preds = %40, %23
  %.150 = phi i32 [ %.049, %23 ], [ %.251, %40 ]
  %.147 = phi ptr [ %.046, %23 ], [ %.3, %40 ]
  %.142 = phi i32 [ %.041, %23 ], [ %33, %40 ]
  store i32 8192, ptr %18, align 8, !tbaa !13
  store ptr %6, ptr %19, align 8, !tbaa !14
  %29 = call i32 @inflate(ptr noundef nonnull %5, i32 noundef 0)
  switch i32 %29, label %30 [
    i32 -2, label %.loopexit
    i32 2, label %.loopexit
    i32 -3, label %.loopexit
    i32 -4, label %.loopexit
  ]

30:                                               ; preds = %28
  %31 = load i32, ptr %18, align 8, !tbaa !13
  %32 = sub i32 8192, %31
  %33 = add nsw i32 %32, %.142
  %34 = icmp sgt i32 %33, %.150
  br i1 %34, label %35, label %40

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

40:                                               ; preds = %35, %30
  %.251 = phi i32 [ %36, %35 ], [ %.150, %30 ]
  %.3 = phi ptr [ %38, %35 ], [ %.147, %30 ]
  %41 = sext i32 %.142 to i64
  %42 = getelementptr inbounds i8, ptr %.3, i64 %41
  %43 = sext i32 %32 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %42, ptr nonnull align 16 %6, i64 %43, i1 false)
  %44 = load i32, ptr %18, align 8, !tbaa !13
  %45 = icmp eq i32 %44, 0
  br i1 %45, label %28, label %46, !llvm.loop !15

46:                                               ; preds = %40
  %.not63 = icmp eq i32 %29, 1
  br i1 %.not63, label %.thread, label %20, !llvm.loop !17

.thread:                                          ; preds = %46
  store i32 %33, ptr %3, align 4, !tbaa !18
  store ptr %.3, ptr %2, align 8, !tbaa !19
  %47 = call i32 @inflateEnd(ptr noundef nonnull %5)
  br label %50

.loopexit:                                        ; preds = %20, %35, %28, %28, %28, %28
  %.5 = phi ptr [ %.147, %28 ], [ %.147, %28 ], [ %.147, %28 ], [ %.147, %28 ], [ %.147, %35 ], [ %.046, %20 ]
  %48 = call i32 @inflateEnd(ptr noundef nonnull %5)
  %.not65 = icmp eq ptr %.5, null
  br i1 %.not65, label %50, label %49

49:                                               ; preds = %.loopexit
  call void @free(ptr noundef nonnull %.5) #9
  br label %50

50:                                               ; preds = %.thread, %49, %.loopexit, %10
  %.1 = phi i32 [ -1, %10 ], [ 0, %.thread ], [ -1, %49 ], [ -1, %.loopexit ]
  call void @llvm.lifetime.end.p0(i64 8192, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %5) #9
  br label %51

51:                                               ; preds = %4, %50
  %.2 = phi i32 [ %.1, %50 ], [ -1, %4 ]
  ret i32 %.2
}

declare i32 @inflateInit_(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #6

declare i32 @inflate(ptr noundef, i32 noundef) local_unnamed_addr #6

declare i32 @inflateEnd(ptr 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #6 = { "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 = !{!10, !10, i64 0}
!19 = !{!7, !7, i64 0}


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