; LLVM IR from thepowersgang/mrustc :: src/hir/serialise_lowlevel.ll (ZN3HIR9serialise11WriterInnerD2Ev)

; 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.HIR::serialise::WriterInner" = type { %"class.std::basic_ofstream", %struct.z_stream_s, %"class.std::vector", i32, i32 }
%"class.std::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%struct.z_stream_s = type { ptr, i32, i64, ptr, i32, i64, ptr, ptr, ptr, ptr, ptr, i32, i64, i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str.4 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [24 x i8], align 1
@__PRETTY_FUNCTION__._ZN3HIR9serialise11WriterInnerD2Ev = external hidden unnamed_addr constant [44 x i8], align 1
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.10 = external hidden unnamed_addr constant [43 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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNSt6vectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN3HIR9serialise11WriterInnerD2Ev(ptr noundef nonnull align 8 dereferenceable(656) %0) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8
  %6 = getelementptr inbounds %"class.HIR::serialise::WriterInner", ptr %5, i32 0, i32 1
  %7 = getelementptr inbounds %struct.z_stream_s, ptr %6, i32 0, i32 1
  %8 = load i32, ptr %7, align 8, !tbaa !9
  %9 = icmp eq i32 %8, 0
  br i1 %9, label %10, label %11

10:                                               ; preds = %1
  br label %13

11:                                               ; preds = %1
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.4, i32 noundef 112, ptr noundef @__PRETTY_FUNCTION__._ZN3HIR9serialise11WriterInnerD2Ev) #6
  unreachable

12:                                               ; No predecessors!
  br label %13

13:                                               ; preds = %12, %10
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  br label %14

14:                                               ; preds = %61, %13
  %15 = getelementptr inbounds %"class.HIR::serialise::WriterInner", ptr %5, i32 0, i32 1
  %16 = invoke i32 @deflate(ptr noundef %15, i32 noundef 4)
          to label %17 unwind label %70

17:                                               ; preds = %14
  store i32 %16, ptr %3, align 4, !tbaa !27
  %18 = load i32, ptr %3, align 4, !tbaa !27
  %19 = icmp eq i32 %18, -2
  br i1 %19, label %20, label %23

20:                                               ; preds = %17
  %21 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.10)
          to label %22 unwind label %70

22:                                               ; preds = %20
  call void @abort() #6
  unreachable

23:                                               ; preds = %17
  %24 = getelementptr inbounds %"class.HIR::serialise::WriterInner", ptr %5, i32 0, i32 1
  %25 = getelementptr inbounds %struct.z_stream_s, ptr %24, i32 0, i32 4
  %26 = load i32, ptr %25, align 8, !tbaa !28
  %27 = zext i32 %26 to i64
  %28 = getelementptr inbounds %"class.HIR::serialise::WriterInner", ptr %5, i32 0, i32 2
  %29 = call noundef i64 @_ZNKSt6vectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #7
  %30 = icmp ne i64 %27, %29
  br i1 %30, label %31, label %60

31:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  %32 = getelementptr inbounds %"class.HIR::serialise::WriterInner", ptr %5, i32 0, i32 2
  %33 = call noundef i64 @_ZNKSt6vectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %32) #7
  %34 = getelementptr inbounds %"class.HIR::serialise::WriterInner", ptr %5, i32 0, i32 1
  %35 = getelementptr inbounds %struct.z_stream_s, ptr %34, i32 0, i32 4
  %36 = load i32, ptr %35, align 8, !tbaa !28
  %37 = zext i32 %36 to i64
  %38 = sub i64 %33, %37
  store i64 %38, ptr %4, align 8, !tbaa !29
  %39 = load i64, ptr %4, align 8, !tbaa !29
  %40 = getelementptr inbounds %"class.HIR::serialise::WriterInner", ptr %5, i32 0, i32 3
  %41 = load i32, ptr %40, align 8, !tbaa !30
  %42 = zext i32 %41 to i64
  %43 = add i64 %42, %39
  %44 = trunc i64 %43 to i32
  store i32 %44, ptr %40, align 8, !tbaa !30
  %45 = getelementptr inbounds %"class.HIR::serialise::WriterInner", ptr %5, i32 0, i32 0
  %46 = getelementptr inbounds %"class.HIR::serialise::WriterInner", ptr %5, i32 0, i32 2
  %47 = call noundef ptr @_ZNSt6vectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %46) #7
  %48 = load i64, ptr %4, align 8, !tbaa !29
  %49 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5writeEPKcl(ptr noundef nonnull align 8 dereferenceable(8) %45, ptr noundef %47, i64 noundef %48)
          to label %50 unwind label %70

50:                                               ; preds = %31
  %51 = getelementptr inbounds %"class.HIR::serialise::WriterInner", ptr %5, i32 0, i32 2
  %52 = call noundef i64 @_ZNKSt6vectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %51) #7
  %53 = trunc i64 %52 to i32
  %54 = getelementptr inbounds %"class.HIR::serialise::WriterInner", ptr %5, i32 0, i32 1
  %55 = getelementptr inbounds %struct.z_stream_s, ptr %54, i32 0, i32 4
  store i32 %53, ptr %55, align 8, !tbaa !28
  %56 = getelementptr inbounds %"class.HIR::serialise::WriterInner", ptr %5, i32 0, i32 2
  %57 = call noundef ptr @_ZNSt6vectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %56) #7
  %58 = getelementptr inbounds %"class.HIR::serialise::WriterInner", ptr %5, i32 0, i32 1
  %59 = getelementptr inbounds %struct.z_stream_s, ptr %58, i32 0, i32 3
  store ptr %57, ptr %59, align 8, !tbaa !31
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  br label %60

60:                                               ; preds = %50, %23
  br label %61

61:                                               ; preds = %60
  %62 = load i32, ptr %3, align 4, !tbaa !27
  %63 = icmp eq i32 %62, 0
  br i1 %63, label %14, label %64, !llvm.loop !32

64:                                               ; preds = %61
  %65 = getelementptr inbounds %"class.HIR::serialise::WriterInner", ptr %5, i32 0, i32 1
  %66 = invoke i32 @deflateEnd(ptr noundef %65)
          to label %67 unwind label %70

67:                                               ; preds = %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  %68 = getelementptr inbounds %"class.HIR::serialise::WriterInner", ptr %5, i32 0, i32 2
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %68) #7
  %69 = getelementptr inbounds %"class.HIR::serialise::WriterInner", ptr %5, i32 0, i32 0
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %69) #7
  ret void

70:                                               ; preds = %64, %31, %20, %14
  %71 = landingpad { ptr, i32 }
          catch ptr null
  %72 = extractvalue { ptr, i32 } %71, 0
  call void @__clang_call_terminate(ptr %72) #6
  unreachable
}

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

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #5

; Function Attrs: noreturn nounwind
declare void @abort() #2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5writeEPKcl(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, i64 noundef) #4

declare i32 @deflateEnd(ptr noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { noreturn 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 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 #4 = { "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 = { noinline noreturn nounwind uwtable "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 = { noreturn nounwind }
attributes #7 = { 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++ TBAA"}
!9 = !{!10, !20, i64 520}
!10 = !{!"_ZTSN3HIR9serialise11WriterInnerE", !11, i64 0, !22, i64 512, !23, i64 624, !20, i64 648, !20, i64 652}
!11 = !{!"_ZTSSt14basic_ofstreamIcSt11char_traitsIcEE", !12, i64 0, !13, i64 8}
!12 = !{!"_ZTSSo"}
!13 = !{!"_ZTSSt13basic_filebufIcSt11char_traitsIcEE", !14, i64 0, !7, i64 64, !16, i64 104, !18, i64 120, !19, i64 124, !19, i64 132, !19, i64 140, !6, i64 152, !21, i64 160, !17, i64 168, !17, i64 169, !17, i64 170, !7, i64 171, !6, i64 176, !6, i64 184, !17, i64 192, !6, i64 200, !6, i64 208, !21, i64 216, !6, i64 224, !6, i64 232}
!14 = !{!"_ZTSSt15basic_streambufIcSt11char_traitsIcEE", !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !15, i64 56}
!15 = !{!"_ZTSSt6locale", !6, i64 0}
!16 = !{!"_ZTSSt12__basic_fileIcE", !6, i64 0, !17, i64 8}
!17 = !{!"bool", !7, i64 0}
!18 = !{!"_ZTSSt13_Ios_Openmode", !7, i64 0}
!19 = !{!"_ZTS11__mbstate_t", !20, i64 0, !7, i64 4}
!20 = !{!"int", !7, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{!"_ZTS10z_stream_s", !6, i64 0, !20, i64 8, !21, i64 16, !6, i64 24, !20, i64 32, !21, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !20, i64 88, !21, i64 96, !21, i64 104}
!23 = !{!"_ZTSSt6vectorIhSaIhEE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIhSaIhEE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!27 = !{!20, !20, i64 0}
!28 = !{!10, !20, i64 544}
!29 = !{!21, !21, i64 0}
!30 = !{!10, !20, i64 648}
!31 = !{!10, !6, i64 536}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}


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

@.str.4 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [24 x i8], align 1
@__PRETTY_FUNCTION__._ZN3HIR9serialise11WriterInnerD2Ev = external hidden unnamed_addr constant [44 x i8], align 1
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.10 = external hidden unnamed_addr constant [43 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNSt6vectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN3HIR9serialise11WriterInnerD2Ev(ptr noundef nonnull align 8 dereferenceable(656) %0) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 512
  %3 = getelementptr inbounds i8, ptr %0, i64 520
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %5 = icmp eq i32 %4, 0
  br i1 %5, label %.preheader, label %10

.preheader:                                       ; preds = %1
  %6 = getelementptr inbounds i8, ptr %0, i64 544
  %7 = getelementptr inbounds i8, ptr %0, i64 624
  %8 = getelementptr inbounds i8, ptr %0, i64 648
  %9 = getelementptr inbounds i8, ptr %0, i64 536
  br label %11

10:                                               ; preds = %1
  tail call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.4, i32 noundef 112, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3HIR9serialise11WriterInnerD2Ev) #5
  unreachable

11:                                               ; preds = %.preheader, %36
  %12 = invoke i32 @deflate(ptr noundef nonnull %2, i32 noundef 4)
          to label %13 unwind label %.loopexit

13:                                               ; preds = %11
  %14 = icmp eq i32 %12, -2
  br i1 %14, label %15, label %18

15:                                               ; preds = %13
  %16 = 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.10)
          to label %17 unwind label %.loopexit.split-lp

17:                                               ; preds = %15
  tail call void @abort() #5
  unreachable

18:                                               ; preds = %13
  %19 = load i32, ptr %6, align 8, !tbaa !26
  %20 = zext i32 %19 to i64
  %21 = tail call noundef i64 @_ZNKSt6vectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  %.not = icmp eq i64 %21, %20
  br i1 %.not, label %36, label %22

22:                                               ; preds = %18
  %23 = tail call noundef i64 @_ZNKSt6vectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  %24 = load i32, ptr %6, align 8, !tbaa !26
  %25 = zext i32 %24 to i64
  %26 = sub i64 %23, %25
  %27 = load i32, ptr %8, align 8, !tbaa !27
  %28 = trunc i64 %26 to i32
  %29 = add i32 %27, %28
  store i32 %29, ptr %8, align 8, !tbaa !27
  %30 = tail call noundef ptr @_ZNSt6vectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  %31 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5writeEPKcl(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef %30, i64 noundef %26)
          to label %32 unwind label %.loopexit

32:                                               ; preds = %22
  %33 = tail call noundef i64 @_ZNKSt6vectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  %34 = trunc i64 %33 to i32
  store i32 %34, ptr %6, align 8, !tbaa !26
  %35 = tail call noundef ptr @_ZNSt6vectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  store ptr %35, ptr %9, align 8, !tbaa !28
  br label %36

36:                                               ; preds = %18, %32
  %37 = icmp eq i32 %12, 0
  br i1 %37, label %11, label %38, !llvm.loop !29

38:                                               ; preds = %36
  %39 = invoke i32 @deflateEnd(ptr noundef nonnull %2)
          to label %40 unwind label %.loopexit.split-lp

40:                                               ; preds = %38
  tail call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  tail call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %0) #6
  ret void

.loopexit:                                        ; preds = %11, %22
  %lpad.loopexit = landingpad { ptr, i32 }
          catch ptr null
  br label %41

.loopexit.split-lp:                               ; preds = %15, %38
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          catch ptr null
  br label %41

41:                                               ; preds = %.loopexit.split-lp, %.loopexit
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  %42 = extractvalue { ptr, i32 } %lpad.phi, 0
  tail call void @__clang_call_terminate(ptr %42) #5
  unreachable
}

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

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #4

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #1

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5writeEPKcl(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, i64 noundef) local_unnamed_addr #3

declare i32 @deflateEnd(ptr noundef) local_unnamed_addr #3

attributes #0 = { 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 #1 = { noreturn 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 #2 = { 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 #3 = { "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 = { noinline noreturn nounwind uwtable "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 = { noreturn nounwind }
attributes #6 = { 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, !19, i64 520}
!6 = !{!"_ZTSN3HIR9serialise11WriterInnerE", !7, i64 0, !21, i64 512, !22, i64 624, !19, i64 648, !19, i64 652}
!7 = !{!"_ZTSSt14basic_ofstreamIcSt11char_traitsIcEE", !8, i64 0, !9, i64 8}
!8 = !{!"_ZTSSo"}
!9 = !{!"_ZTSSt13basic_filebufIcSt11char_traitsIcEE", !10, i64 0, !12, i64 64, !15, i64 104, !17, i64 120, !18, i64 124, !18, i64 132, !18, i64 140, !11, i64 152, !20, i64 160, !16, i64 168, !16, i64 169, !16, i64 170, !12, i64 171, !11, i64 176, !11, i64 184, !16, i64 192, !11, i64 200, !11, i64 208, !20, i64 216, !11, i64 224, !11, i64 232}
!10 = !{!"_ZTSSt15basic_streambufIcSt11char_traitsIcEE", !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !14, i64 56}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"_ZTSSt6locale", !11, i64 0}
!15 = !{!"_ZTSSt12__basic_fileIcE", !11, i64 0, !16, i64 8}
!16 = !{!"bool", !12, i64 0}
!17 = !{!"_ZTSSt13_Ios_Openmode", !12, i64 0}
!18 = !{!"_ZTS11__mbstate_t", !19, i64 0, !12, i64 4}
!19 = !{!"int", !12, i64 0}
!20 = !{!"long", !12, i64 0}
!21 = !{!"_ZTS10z_stream_s", !11, i64 0, !19, i64 8, !20, i64 16, !11, i64 24, !19, i64 32, !20, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !19, i64 88, !20, i64 96, !20, i64 104}
!22 = !{!"_ZTSSt6vectorIhSaIhEE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseIhSaIhEE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!26 = !{!6, !19, i64 544}
!27 = !{!6, !19, i64 648}
!28 = !{!6, !11, i64 536}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LICMPass,LoopSimplifyPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass