; LLVM IR from rudi-cilibrasi/zlibcomplete :: lib (zlibtop)

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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }
%"class.zlibcomplete::ZLibBaseCompressor" = type { [16384 x i8], [16384 x i8], i8, i8, %struct.z_stream_s }
%struct.z_stream_s = type { ptr, i32, i64, ptr, i32, i64, ptr, ptr, ptr, ptr, ptr, i32, i64, i64 }

@_ZTISt9bad_alloc = external constant ptr
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.1 = external hidden unnamed_addr constant [44 x i8], align 1
@_ZTISt9exception = external constant ptr

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

declare ptr @__cxa_allocate_exception(i64)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt9bad_allocC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: nounwind
declare void @_ZNSt9bad_allocD1Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2

declare void @__cxa_throw(ptr, ptr, ptr)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12zlibcomplete18ZLibBaseCompressor12baseCompressERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32888) %1, ptr noundef nonnull align 8 dereferenceable(32) %2) #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i1, align 1
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i8, align 1
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %"class.std::__cxx11::basic_string", align 8
  %17 = alloca %"class.std::allocator", align 1
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %18 = load ptr, ptr %5, align 8
  store i1 false, ptr %7, align 1
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %19 = getelementptr inbounds %"class.zlibcomplete::ZLibBaseCompressor", ptr %18, i32 0, i32 3
  %20 = load i8, ptr %19, align 1, !tbaa !9, !range !15, !noundef !16
  %21 = trunc i8 %20 to i1
  br i1 %21, label %22, label %30

22:                                               ; preds = %3
  %23 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.1)
          to label %24 unwind label %26

24:                                               ; preds = %22
  %25 = call ptr @__cxa_allocate_exception(i64 8) #7
  call void @_ZNSt9exceptionC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %25) #7
  invoke void @__cxa_throw(ptr %25, ptr @_ZTISt9exception, ptr @_ZNSt9exceptionD1Ev) #8
          to label %140 unwind label %26

26:                                               ; preds = %24, %22
  %27 = landingpad { ptr, i32 }
          cleanup
  %28 = extractvalue { ptr, i32 } %27, 0
  store ptr %28, ptr %9, align 8
  %29 = extractvalue { ptr, i32 } %27, 1
  store i32 %29, ptr %10, align 4
  br label %132

30:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !17
  br label %31

31:                                               ; preds = %117, %30
  %32 = load i32, ptr %11, align 4, !tbaa !17
  %33 = zext i32 %32 to i64
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %34) #7
  %36 = icmp ult i64 %33, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %130

38:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %39) #7
  %41 = load i32, ptr %11, align 4, !tbaa !17
  %42 = zext i32 %41 to i64
  %43 = sub i64 %40, %42
  %44 = trunc i64 %43 to i32
  store i32 %44, ptr %12, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #7
  %45 = load i32, ptr %12, align 4, !tbaa !17
  %46 = icmp ule i32 %45, 16384
  %47 = zext i1 %46 to i8
  store i8 %47, ptr %13, align 1, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %48 = load i32, ptr %12, align 4, !tbaa !17
  %49 = icmp ugt i32 %48, 16384
  br i1 %49, label %50, label %51

50:                                               ; preds = %38
  br label %53

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

53:                                               ; preds = %51, %50
  %54 = phi i32 [ 16384, %50 ], [ %52, %51 ]
  store i32 %54, ptr %14, align 4, !tbaa !17
  %55 = getelementptr inbounds %"class.zlibcomplete::ZLibBaseCompressor", ptr %18, i32 0, i32 0
  %56 = getelementptr inbounds [16384 x i8], ptr %55, i64 0, i64 0
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4dataEv(ptr noundef nonnull align 8 dereferenceable(32) %57) #7
  %59 = load i32, ptr %11, align 4, !tbaa !17
  %60 = zext i32 %59 to i64
  %61 = getelementptr inbounds i8, ptr %58, i64 %60
  %62 = load i32, ptr %14, align 4, !tbaa !17
  %63 = zext i32 %62 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %56, ptr align 1 %61, i64 %63, i1 false)
  %64 = load i32, ptr %14, align 4, !tbaa !17
  %65 = getelementptr inbounds %"class.zlibcomplete::ZLibBaseCompressor", ptr %18, i32 0, i32 4
  %66 = getelementptr inbounds %struct.z_stream_s, ptr %65, i32 0, i32 1
  store i32 %64, ptr %66, align 8, !tbaa !19
  %67 = getelementptr inbounds %"class.zlibcomplete::ZLibBaseCompressor", ptr %18, i32 0, i32 0
  %68 = getelementptr inbounds [16384 x i8], ptr %67, i64 0, i64 0
  %69 = getelementptr inbounds %"class.zlibcomplete::ZLibBaseCompressor", ptr %18, i32 0, i32 4
  %70 = getelementptr inbounds %struct.z_stream_s, ptr %69, i32 0, i32 0
  store ptr %68, ptr %70, align 8, !tbaa !20
  br label %71

71:                                               ; preds = %111, %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %72 = getelementptr inbounds %"class.zlibcomplete::ZLibBaseCompressor", ptr %18, i32 0, i32 4
  %73 = getelementptr inbounds %struct.z_stream_s, ptr %72, i32 0, i32 4
  store i32 16384, ptr %73, align 8, !tbaa !21
  %74 = getelementptr inbounds %"class.zlibcomplete::ZLibBaseCompressor", ptr %18, i32 0, i32 1
  %75 = getelementptr inbounds [16384 x i8], ptr %74, i64 0, i64 0
  %76 = getelementptr inbounds %"class.zlibcomplete::ZLibBaseCompressor", ptr %18, i32 0, i32 4
  %77 = getelementptr inbounds %struct.z_stream_s, ptr %76, i32 0, i32 3
  store ptr %75, ptr %77, align 8, !tbaa !22
  %78 = getelementptr inbounds %"class.zlibcomplete::ZLibBaseCompressor", ptr %18, i32 0, i32 4
  %79 = getelementptr inbounds %"class.zlibcomplete::ZLibBaseCompressor", ptr %18, i32 0, i32 2
  %80 = load i8, ptr %79, align 8, !tbaa !23, !range !15, !noundef !16
  %81 = trunc i8 %80 to i1
  br i1 %81, label %82, label %85

82:                                               ; preds = %71
  %83 = load i8, ptr %13, align 1, !tbaa !18, !range !15, !noundef !16
  %84 = trunc i8 %83 to i1
  br label %85

85:                                               ; preds = %82, %71
  %86 = phi i1 [ false, %71 ], [ %84, %82 ]
  %87 = zext i1 %86 to i64
  %88 = select i1 %86, i32 2, i32 0
  %89 = invoke i32 @deflate(ptr noundef %78, i32 noundef %88)
          to label %90 unwind label %95

90:                                               ; preds = %85
  store i32 %89, ptr %8, align 4, !tbaa !17
  %91 = load i32, ptr %8, align 4, !tbaa !17
  %92 = icmp eq i32 %91, -2
  br i1 %92, label %93, label %99

93:                                               ; preds = %90
  %94 = call ptr @__cxa_allocate_exception(i64 8) #7
  call void @_ZNSt9bad_allocC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %94) #7
  invoke void @__cxa_throw(ptr %94, ptr @_ZTISt9bad_alloc, ptr @_ZNSt9bad_allocD1Ev) #8
          to label %140 unwind label %95

95:                                               ; preds = %93, %85
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %9, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %10, align 4
  br label %129

99:                                               ; preds = %90
  %100 = getelementptr inbounds %"class.zlibcomplete::ZLibBaseCompressor", ptr %18, i32 0, i32 4
  %101 = getelementptr inbounds %struct.z_stream_s, ptr %100, i32 0, i32 4
  %102 = load i32, ptr %101, align 8, !tbaa !21
  %103 = sub i32 16384, %102
  store i32 %103, ptr %15, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #7
  %104 = getelementptr inbounds %"class.zlibcomplete::ZLibBaseCompressor", ptr %18, i32 0, i32 1
  %105 = getelementptr inbounds [16384 x i8], ptr %104, i64 0, i64 0
  %106 = load i32, ptr %15, align 4, !tbaa !17
  %107 = sext i32 %106 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2EPKcmRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef %105, i64 noundef %107, ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %108 unwind label %120

108:                                              ; preds = %99
  %109 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %16)
          to label %110 unwind label %124

110:                                              ; preds = %108
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %111

111:                                              ; preds = %110
  %112 = getelementptr inbounds %"class.zlibcomplete::ZLibBaseCompressor", ptr %18, i32 0, i32 4
  %113 = getelementptr inbounds %struct.z_stream_s, ptr %112, i32 0, i32 4
  %114 = load i32, ptr %113, align 8, !tbaa !21
  %115 = icmp eq i32 %114, 0
  br i1 %115, label %71, label %116, !llvm.loop !24

116:                                              ; preds = %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %117

117:                                              ; preds = %116
  %118 = load i32, ptr %11, align 4, !tbaa !17
  %119 = add i32 %118, 16384
  store i32 %119, ptr %11, align 4, !tbaa !17
  br label %31, !llvm.loop !26

120:                                              ; preds = %99
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %9, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %10, align 4
  br label %128

124:                                              ; preds = %108
  %125 = landingpad { ptr, i32 }
          cleanup
  %126 = extractvalue { ptr, i32 } %125, 0
  store ptr %126, ptr %9, align 8
  %127 = extractvalue { ptr, i32 } %125, 1
  store i32 %127, ptr %10, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #7
  br label %128

128:                                              ; preds = %124, %120
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #7
  br label %129

129:                                              ; preds = %128, %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %132

130:                                              ; preds = %37
  store i1 true, ptr %7, align 1
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  %131 = load i1, ptr %7, align 1
  br i1 %131, label %134, label %133

132:                                              ; preds = %129, %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #7
  br label %135

133:                                              ; preds = %130
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #7
  br label %134

134:                                              ; preds = %133, %130
  ret void

135:                                              ; preds = %132
  %136 = load ptr, ptr %9, align 8
  %137 = load i32, ptr %10, align 4
  %138 = insertvalue { ptr, i32 } poison, ptr %136, 0
  %139 = insertvalue { ptr, i32 } %138, i32 %137, 1
  resume { ptr, i32 } %139

140:                                              ; preds = %93, %24
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt9exceptionC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: nounwind
declare void @_ZNSt9exceptionD1Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4dataEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

; 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 @deflate(ptr noundef, i32 noundef) #6

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2EPKcmRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { 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 #3 = { 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 #4 = { inlinehint 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { noreturn }

!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, !11, i64 32769}
!10 = !{!"_ZTSN12zlibcomplete18ZLibBaseCompressorE", !7, i64 0, !7, i64 16384, !11, i64 32768, !11, i64 32769, !12, i64 32776}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"_ZTS10z_stream_s", !6, i64 0, !13, i64 8, !14, i64 16, !6, i64 24, !13, i64 32, !14, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !13, i64 88, !14, i64 96, !14, i64 104}
!13 = !{!"int", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!13, !13, i64 0}
!18 = !{!11, !11, i64 0}
!19 = !{!10, !13, i64 32784}
!20 = !{!10, !6, i64 32776}
!21 = !{!10, !13, i64 32808}
!22 = !{!10, !6, i64 32800}
!23 = !{!10, !11, i64 32768}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = distinct !{!26, !25}


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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }

@_ZTISt9bad_alloc = external constant ptr
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.1 = external hidden unnamed_addr constant [44 x i8], align 1
@_ZTISt9exception = external constant ptr

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

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt9bad_allocC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: nounwind
declare void @_ZNSt9bad_allocD1Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

; 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 uwtable
define dso_local void @_ZN12zlibcomplete18ZLibBaseCompressor12baseCompressERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind noalias nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32888) %1, ptr noundef nonnull align 8 dereferenceable(32) %2) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %"class.std::allocator", align 1
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #8
  %6 = getelementptr inbounds i8, ptr %1, i64 32769
  %7 = load i8, ptr %6, align 1, !tbaa !5, !range !14, !noundef !15
  %8 = trunc nuw i8 %7 to i1
  br i1 %8, label %16, label %.preheader

.preheader:                                       ; preds = %3
  %9 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #8
  %.not = icmp eq i64 %9, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %10 = getelementptr inbounds i8, ptr %1, i64 32776
  %11 = getelementptr inbounds i8, ptr %1, i64 32784
  %12 = getelementptr inbounds i8, ptr %1, i64 32808
  %13 = getelementptr inbounds i8, ptr %1, i64 16384
  %14 = getelementptr inbounds i8, ptr %1, i64 32800
  %15 = getelementptr inbounds i8, ptr %1, i64 32768
  br label %22

16:                                               ; preds = %3
  %17 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.1)
          to label %18 unwind label %20

18:                                               ; preds = %16
  %19 = tail call ptr @__cxa_allocate_exception(i64 8) #8
  tail call void @_ZNSt9exceptionC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %19) #8
  invoke void @__cxa_throw(ptr nonnull %19, ptr nonnull @_ZTISt9exception, ptr nonnull @_ZNSt9exceptionD1Ev) #9
          to label %69 unwind label %20

20:                                               ; preds = %18, %16
  %21 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

22:                                               ; preds = %.lr.ph, %.split36.us
  %23 = phi i64 [ 0, %.lr.ph ], [ %62, %.split36.us ]
  %.02138 = phi i32 [ 0, %.lr.ph ], [ %61, %.split36.us ]
  %24 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #8
  %25 = trunc i64 %24 to i32
  %26 = sub i32 %25, %.02138
  %27 = icmp ult i32 %26, 16385
  %28 = call i32 @llvm.umin.i32(i32 %26, i32 16384)
  %29 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4dataEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #8
  %30 = getelementptr inbounds i8, ptr %29, i64 %23
  %31 = zext nneg i32 %28 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %1, ptr align 1 %30, i64 %31, i1 false)
  store i32 %28, ptr %11, align 8, !tbaa !16
  store ptr %1, ptr %10, align 8, !tbaa !17
  br i1 %27, label %.split, label %.split.us

.split.us:                                        ; preds = %22, %41
  store i32 16384, ptr %12, align 8, !tbaa !18
  store ptr %13, ptr %14, align 8, !tbaa !19
  %32 = invoke i32 @deflate(ptr noundef nonnull %10, i32 noundef 0)
          to label %33 unwind label %.loopexit.split.us

33:                                               ; preds = %.split.us
  %34 = icmp eq i32 %32, -2
  br i1 %34, label %.split29.us, label %35

35:                                               ; preds = %33
  %36 = load i32, ptr %12, align 8, !tbaa !18
  %37 = sub i32 16384, %36
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #8
  %38 = sext i32 %37 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2EPKcmRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull %13, i64 noundef %38, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %39 unwind label %.split31.us

39:                                               ; preds = %35
  %40 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %41 unwind label %.split33.us

41:                                               ; preds = %39
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #8
  %42 = load i32, ptr %12, align 8, !tbaa !18
  %43 = icmp eq i32 %42, 0
  br i1 %43, label %.split.us, label %.split36.us, !llvm.loop !20

.split31.us:                                      ; preds = %35
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %68

.split33.us:                                      ; preds = %39
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %67

.loopexit.split.us:                               ; preds = %.split.us
  %lpad.loopexit.us = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.split:                                           ; preds = %22, %58
  store i32 16384, ptr %12, align 8, !tbaa !18
  store ptr %13, ptr %14, align 8, !tbaa !19
  %46 = load i8, ptr %15, align 8, !tbaa !22, !range !14, !noundef !15
  %47 = trunc nuw i8 %46 to i1
  %spec.select = select i1 %47, i32 2, i32 0
  %48 = invoke i32 @deflate(ptr noundef nonnull %10, i32 noundef %spec.select)
          to label %49 unwind label %.loopexit.split

49:                                               ; preds = %.split
  %50 = icmp eq i32 %48, -2
  br i1 %50, label %.split29.us, label %52

.split29.us:                                      ; preds = %33, %49
  %51 = call ptr @__cxa_allocate_exception(i64 8) #8
  call void @_ZNSt9bad_allocC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %51) #8
  invoke void @__cxa_throw(ptr nonnull %51, ptr nonnull @_ZTISt9bad_alloc, ptr nonnull @_ZNSt9bad_allocD1Ev) #9
          to label %69 unwind label %.loopexit.split-lp

.loopexit.split:                                  ; preds = %.split
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.loopexit.split-lp:                               ; preds = %.split29.us
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

52:                                               ; preds = %49
  %53 = load i32, ptr %12, align 8, !tbaa !18
  %54 = sub i32 16384, %53
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #8
  %55 = sext i32 %54 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2EPKcmRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull %13, i64 noundef %55, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %56 unwind label %.split31

56:                                               ; preds = %52
  %57 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %58 unwind label %.split33

58:                                               ; preds = %56
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #8
  %59 = load i32, ptr %12, align 8, !tbaa !18
  %60 = icmp eq i32 %59, 0
  br i1 %60, label %.split, label %.split36.us, !llvm.loop !20

.split36.us:                                      ; preds = %41, %58
  %61 = add i32 %.02138, 16384
  %62 = zext i32 %61 to i64
  %63 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #8
  %64 = icmp ugt i64 %63, %62
  br i1 %64, label %22, label %._crit_edge, !llvm.loop !23

.split31:                                         ; preds = %52
  %65 = landingpad { ptr, i32 }
          cleanup
  br label %68

.split33:                                         ; preds = %56
  %66 = landingpad { ptr, i32 }
          cleanup
  br label %67

67:                                               ; preds = %.split33.us, %.split33
  %.us-phi34 = phi { ptr, i32 } [ %66, %.split33 ], [ %45, %.split33.us ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #8
  br label %68

68:                                               ; preds = %.split31, %.split31.us, %67
  %.pn = phi { ptr, i32 } [ %.us-phi34, %67 ], [ %65, %.split31 ], [ %44, %.split31.us ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #8
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.split-lp, %.loopexit.split.us, %.loopexit.split, %68, %20
  %.pn26 = phi { ptr, i32 } [ %21, %20 ], [ %.pn, %68 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ], [ %lpad.loopexit, %.loopexit.split ], [ %lpad.loopexit.us, %.loopexit.split.us ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #8
  resume { ptr, i32 } %.pn26

._crit_edge:                                      ; preds = %.split36.us, %.preheader
  ret void

69:                                               ; preds = %.split29.us, %18
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #4

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt9exceptionC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: nounwind
declare void @_ZNSt9exceptionD1Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4dataEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

; 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 @deflate(ptr noundef, i32 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2EPKcmRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { 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 #3 = { 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 #4 = { inlinehint 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 #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { nounwind }
attributes #9 = { noreturn }

!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, !9, i64 32769}
!6 = !{!"_ZTSN12zlibcomplete18ZLibBaseCompressorE", !7, i64 0, !7, i64 16384, !9, i64 32768, !9, i64 32769, !10, i64 32776}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!"bool", !7, i64 0}
!10 = !{!"_ZTS10z_stream_s", !11, i64 0, !12, i64 8, !13, i64 16, !11, i64 24, !12, i64 32, !13, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !12, i64 88, !13, i64 96, !13, i64 104}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = !{!6, !12, i64 32784}
!17 = !{!6, !11, i64 32776}
!18 = !{!6, !12, i64 32808}
!19 = !{!6, !11, i64 32800}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!6, !9, i64 32768}
!23 = distinct !{!23, !21}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass