; LLVM IR from jzimmerman/langcc :: gen/cc/gen.ll (ZN4lang2cc4Node6Module2_T5writeERN6langcc6rc_ptrINS4_11PrBufStream2_TEEE)

; 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.langcc::rc_ptr.22" = type { ptr, ptr }
%"struct.langcc::rc_ptr.23" = type { ptr, 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 }
%"struct.lang::cc::Node::Module::_T" = type { %"struct.lang::cc::Node::_T", %"struct.langcc::rc_ptr.151" }
%"struct.lang::cc::Node::_T" = type { ptr, %"struct.langcc::hash_obj", %"struct.langcc::enable_rc_from_this_poly", i32, i64, %"struct.langcc::TokenBounds", i8, i64, %"struct.langcc::ParserAttrMask", %"struct.langcc::ParserLookahead" }
%"struct.langcc::hash_obj" = type { %"struct.langcc::Option::_T" }
%"struct.langcc::Option::_T" = type { i32, [32 x i8] }
%"struct.langcc::enable_rc_from_this_poly" = type { ptr, ptr }
%"struct.langcc::TokenBounds" = type { i32, i32 }
%"struct.langcc::ParserAttrMask" = type { [16 x i8] }
%"struct.langcc::ParserLookahead" = type { [8 x i16] }
%"struct.langcc::rc_ptr.151" = type { ptr, ptr }

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) 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 #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6langcc24enable_rc_from_this_poly17rc_from_this_polyIN4lang2cc4Node6Module2_TEEENS_6rc_ptrIT_EEv(ptr dead_on_unwind noalias writable sret(%"struct.langcc::rc_ptr.22") align 8, ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN6langcc6rc_ptrIN4lang2cc4Node6Module2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN6langcc6rc_ptrIN4lang2cc4Node4Decl2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN6langcc6rc_ptrINS_3VecINS0_IN4lang2cc4Node4Decl2_TEEEEEEptEv(ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN6langcc3VecINS_6rc_ptrIN4lang2cc4Node4Decl2_TEEEE12at_uncheckedEl(ptr noundef nonnull align 8 dereferenceable(64), i64 noundef) #4 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4lang2cc4Node6Module2_T5writeERN6langcc6rc_ptrINS4_11PrBufStream2_TEEE(ptr noundef nonnull align 8 dereferenceable(152) %0, ptr noundef nonnull align 8 dereferenceable(16) %1) #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"struct.langcc::rc_ptr.22", align 8
  %6 = alloca i64, align 8
  %7 = alloca i8, align 1
  %8 = alloca i8, align 1
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"struct.langcc::rc_ptr.23", align 8
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca %"class.std::allocator", align 1
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %14 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #6
  %15 = getelementptr inbounds i8, ptr %14, i64 48
  call void @_ZN6langcc24enable_rc_from_this_poly17rc_from_this_polyIN4lang2cc4Node6Module2_TEEENS_6rc_ptrIT_EEv(ptr dead_on_unwind writable sret(%"struct.langcc::rc_ptr.22") align 8 %5, ptr noundef nonnull align 8 dereferenceable(16) %15)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #6
  store i8 0, ptr %7, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #6
  store i8 0, ptr %8, align 1, !tbaa !9
  store i64 0, ptr %6, align 8, !tbaa !11
  br label %16

16:                                               ; preds = %76, %2
  %17 = load i64, ptr %6, align 8, !tbaa !11
  %18 = invoke noundef ptr @_ZN6langcc6rc_ptrIN4lang2cc4Node6Module2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %19 unwind label %46

19:                                               ; preds = %16
  %20 = getelementptr inbounds %"struct.lang::cc::Node::Module::_T", ptr %18, i32 0, i32 1
  %21 = invoke noundef i64 @_ZN6langcc3lenINS_6rc_ptrIN4lang2cc4Node4Decl2_TEEEEElRKNS1_INS_3VecIT_EEEE(ptr noundef nonnull align 8 dereferenceable(16) %20)
          to label %22 unwind label %46

22:                                               ; preds = %19
  %23 = icmp slt i64 %17, %21
  br i1 %23, label %24, label %81

24:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #6
  %25 = invoke noundef ptr @_ZN6langcc6rc_ptrIN4lang2cc4Node6Module2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %26 unwind label %50

26:                                               ; preds = %24
  %27 = getelementptr inbounds %"struct.lang::cc::Node::Module::_T", ptr %25, i32 0, i32 1
  %28 = invoke noundef ptr @_ZN6langcc6rc_ptrINS_3VecINS0_IN4lang2cc4Node4Decl2_TEEEEEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %27)
          to label %29 unwind label %50

29:                                               ; preds = %26
  %30 = load i64, ptr %6, align 8, !tbaa !11
  %31 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN6langcc3VecINS_6rc_ptrIN4lang2cc4Node4Decl2_TEEEE12at_uncheckedEl(ptr noundef nonnull align 8 dereferenceable(64) %28, i64 noundef %30)
          to label %32 unwind label %50

32:                                               ; preds = %29
  invoke void @_ZN6langcc6rc_ptrIN4lang2cc4Node4Decl2_TEEC2ERKS6_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(16) %31)
          to label %33 unwind label %50

33:                                               ; preds = %32
  %34 = load i8, ptr %7, align 1, !tbaa !9, !range !13, !noundef !14
  %35 = trunc i8 %34 to i1
  br i1 %35, label %36, label %67

36:                                               ; preds = %33
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = invoke noundef ptr @_ZN6langcc6rc_ptrINS_11PrBufStream2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %37)
          to label %39 unwind label %54

39:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef @.str.264, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %40 unwind label %58

40:                                               ; preds = %39
  invoke void @_ZN6langcc11PrBufStream2_T11push_stringENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(80) %38, ptr noundef %12)
          to label %41 unwind label %62

41:                                               ; preds = %40
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = invoke noundef ptr @_ZN6langcc6rc_ptrINS_11PrBufStream2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %42)
          to label %44 unwind label %54

44:                                               ; preds = %41
  invoke void @_ZN6langcc11PrBufStream2_T13push_newlinesEl(ptr noundef nonnull align 8 dereferenceable(80) %43, i64 noundef 2)
          to label %45 unwind label %54

45:                                               ; preds = %44
  br label %67

46:                                               ; preds = %84, %81, %19, %16
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %9, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %10, align 4
  br label %86

50:                                               ; preds = %32, %29, %26, %24
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %9, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %10, align 4
  br label %80

54:                                               ; preds = %73, %71, %44, %41, %36
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %9, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %10, align 4
  br label %79

58:                                               ; preds = %39
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %9, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %10, align 4
  br label %66

62:                                               ; preds = %40
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %9, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %10, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #6
  br label %66

66:                                               ; preds = %62, %58
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  br label %79

67:                                               ; preds = %45, %33
  %68 = load i8, ptr %7, align 1, !tbaa !9, !range !13, !noundef !14
  %69 = trunc i8 %68 to i1
  br i1 %69, label %71, label %70

70:                                               ; preds = %67
  store i8 1, ptr %8, align 1, !tbaa !9
  br label %71

71:                                               ; preds = %70, %67
  store i8 1, ptr %7, align 1, !tbaa !9
  %72 = invoke noundef ptr @_ZN6langcc6rc_ptrIN4lang2cc4Node4Decl2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %11)
          to label %73 unwind label %54

73:                                               ; preds = %71
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZN4lang2cc4Node4Decl2_T5writeERN6langcc6rc_ptrINS4_11PrBufStream2_TEEE(ptr noundef nonnull align 8 dereferenceable(140) %72, ptr noundef nonnull align 8 dereferenceable(16) %74)
          to label %75 unwind label %54

75:                                               ; preds = %73
  call void @_ZN6langcc6rc_ptrIN4lang2cc4Node4Decl2_TEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #6
  br label %76

76:                                               ; preds = %75
  %77 = load i64, ptr %6, align 8, !tbaa !11
  %78 = add nsw i64 %77, 1
  store i64 %78, ptr %6, align 8, !tbaa !11
  br label %16, !llvm.loop !15

79:                                               ; preds = %66, %54
  call void @_ZN6langcc6rc_ptrIN4lang2cc4Node4Decl2_TEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #6
  br label %80

80:                                               ; preds = %79, %50
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #6
  br label %86

81:                                               ; preds = %22
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = invoke noundef ptr @_ZN6langcc6rc_ptrINS_11PrBufStream2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %82)
          to label %84 unwind label %46

84:                                               ; preds = %81
  invoke void @_ZN6langcc11PrBufStream2_T13push_newlinesEl(ptr noundef nonnull align 8 dereferenceable(80) %83, i64 noundef 1)
          to label %85 unwind label %46

85:                                               ; preds = %84
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @_ZN6langcc6rc_ptrIN4lang2cc4Node6Module2_TEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #6
  ret void

86:                                               ; preds = %80, %46
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @_ZN6langcc6rc_ptrIN4lang2cc4Node6Module2_TEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #6
  br label %87

87:                                               ; preds = %86
  %88 = load ptr, ptr %9, align 8
  %89 = load i32, ptr %10, align 4
  %90 = insertvalue { ptr, i32 } poison, ptr %88, 0
  %91 = insertvalue { ptr, i32 } %90, i32 %89, 1
  resume { ptr, i32 } %91
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN6langcc3lenINS_6rc_ptrIN4lang2cc4Node4Decl2_TEEEEElRKNS1_INS_3VecIT_EEEE(ptr noundef nonnull align 8 dereferenceable(16)) #4

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN6langcc6rc_ptrINS_11PrBufStream2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6langcc11PrBufStream2_T11push_stringENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef) #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6langcc11PrBufStream2_T13push_newlinesEl(ptr noundef nonnull align 8 dereferenceable(80), i64 noundef) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4lang2cc4Node4Decl2_T5writeERN6langcc6rc_ptrINS4_11PrBufStream2_TEEE(ptr noundef nonnull align 8 dereferenceable(140), ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { alwaysinline 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 = { 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 = { 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 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 #5 = { 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 #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, !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 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !16}
!16 = !{!"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"

%"struct.langcc::rc_ptr.22" = type { ptr, ptr }
%"struct.langcc::rc_ptr.23" = type { ptr, 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 }

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) 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 #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6langcc24enable_rc_from_this_poly17rc_from_this_polyIN4lang2cc4Node6Module2_TEEENS_6rc_ptrIT_EEv(ptr dead_on_unwind noalias writable sret(%"struct.langcc::rc_ptr.22") align 8, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN6langcc6rc_ptrIN4lang2cc4Node6Module2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN6langcc6rc_ptrIN4lang2cc4Node4Decl2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN6langcc6rc_ptrINS_3VecINS0_IN4lang2cc4Node4Decl2_TEEEEEEptEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN6langcc3VecINS_6rc_ptrIN4lang2cc4Node4Decl2_TEEEE12at_uncheckedEl(ptr noundef nonnull align 8 dereferenceable(64), i64 noundef) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4lang2cc4Node6Module2_T5writeERN6langcc6rc_ptrINS4_11PrBufStream2_TEEE(ptr noundef nonnull align 8 dereferenceable(152) %0, ptr noundef nonnull align 8 dereferenceable(16) %1) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"struct.langcc::rc_ptr.22", align 8
  %4 = alloca %"struct.langcc::rc_ptr.23", align 8
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.std::allocator", align 1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #6
  %7 = getelementptr inbounds i8, ptr %0, i64 48
  call void @_ZN6langcc24enable_rc_from_this_poly17rc_from_this_polyIN4lang2cc4Node6Module2_TEEENS_6rc_ptrIT_EEv(ptr dead_on_unwind nonnull writable sret(%"struct.langcc::rc_ptr.22") align 8 %3, ptr noundef nonnull align 8 dereferenceable(16) %7)
  %8 = call noundef ptr @_ZN6langcc6rc_ptrIN4lang2cc4Node6Module2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %9 = getelementptr inbounds i8, ptr %8, i64 136
  %10 = call noundef i64 @_ZN6langcc3lenINS_6rc_ptrIN4lang2cc4Node4Decl2_TEEEEElRKNS1_INS_3VecIT_EEEE(ptr noundef nonnull align 8 dereferenceable(16) %9)
  %11 = icmp sgt i64 %10, 0
  br i1 %11, label %.critedge.peel, label %._crit_edge

.critedge.peel:                                   ; preds = %2
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #6
  %12 = call noundef ptr @_ZN6langcc6rc_ptrIN4lang2cc4Node6Module2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %13 = getelementptr inbounds i8, ptr %12, i64 136
  %14 = call noundef ptr @_ZN6langcc6rc_ptrINS_3VecINS0_IN4lang2cc4Node4Decl2_TEEEEEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %13)
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6langcc3VecINS_6rc_ptrIN4lang2cc4Node4Decl2_TEEEE12at_uncheckedEl(ptr noundef nonnull align 8 dereferenceable(64) %14, i64 noundef 0)
  call void @_ZN6langcc6rc_ptrIN4lang2cc4Node4Decl2_TEEC2ERKS6_(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(16) %15)
  %16 = call noundef ptr @_ZN6langcc6rc_ptrIN4lang2cc4Node4Decl2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  invoke void @_ZN4lang2cc4Node4Decl2_T5writeERN6langcc6rc_ptrINS4_11PrBufStream2_TEEE(ptr noundef nonnull align 8 dereferenceable(140) %16, ptr noundef nonnull align 8 dereferenceable(16) %1)
          to label %17 unwind label %.loopexit.split-lp29

17:                                               ; preds = %.critedge.peel
  call void @_ZN6langcc6rc_ptrIN4lang2cc4Node4Decl2_TEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  %18 = call noundef ptr @_ZN6langcc6rc_ptrIN4lang2cc4Node6Module2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %19 = getelementptr inbounds i8, ptr %18, i64 136
  %20 = call noundef i64 @_ZN6langcc3lenINS_6rc_ptrIN4lang2cc4Node4Decl2_TEEEEElRKNS1_INS_3VecIT_EEEE(ptr noundef nonnull align 8 dereferenceable(16) %19)
  %21 = icmp sgt i64 %20, 1
  br i1 %21, label %.lr.ph.peel.next, label %._crit_edge

.lr.ph.peel.next:                                 ; preds = %17, %36
  %.01520 = phi i64 [ %37, %36 ], [ 1, %17 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #6
  %22 = call noundef ptr @_ZN6langcc6rc_ptrIN4lang2cc4Node6Module2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %23 = getelementptr inbounds i8, ptr %22, i64 136
  %24 = call noundef ptr @_ZN6langcc6rc_ptrINS_3VecINS0_IN4lang2cc4Node4Decl2_TEEEEEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %23)
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6langcc3VecINS_6rc_ptrIN4lang2cc4Node4Decl2_TEEEE12at_uncheckedEl(ptr noundef nonnull align 8 dereferenceable(64) %24, i64 noundef %.01520)
  call void @_ZN6langcc6rc_ptrIN4lang2cc4Node4Decl2_TEEC2ERKS6_(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(16) %25)
  %26 = call noundef ptr @_ZN6langcc6rc_ptrINS_11PrBufStream2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull @.str.264, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %27 unwind label %32

27:                                               ; preds = %.lr.ph.peel.next
  invoke void @_ZN6langcc11PrBufStream2_T11push_stringENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(80) %26, ptr noundef nonnull %5)
          to label %28 unwind label %33

28:                                               ; preds = %27
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  %29 = call noundef ptr @_ZN6langcc6rc_ptrINS_11PrBufStream2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  invoke void @_ZN6langcc11PrBufStream2_T13push_newlinesEl(ptr noundef nonnull align 8 dereferenceable(80) %29, i64 noundef 2)
          to label %.critedge unwind label %.loopexit28

30:                                               ; preds = %._crit_edge
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %45

.loopexit28:                                      ; preds = %28, %.critedge
  %lpad.loopexit30 = landingpad { ptr, i32 }
          cleanup
  br label %42

.loopexit.split-lp29:                             ; preds = %.critedge.peel
  %lpad.loopexit.split-lp31 = landingpad { ptr, i32 }
          cleanup
  br label %42

32:                                               ; preds = %.lr.ph.peel.next
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %34

33:                                               ; preds = %27
  %lpad.loopexit25 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  br label %34

34:                                               ; preds = %33, %32
  %.pn = phi { ptr, i32 } [ %lpad.loopexit25, %33 ], [ %lpad.loopexit, %32 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  br label %42

.critedge:                                        ; preds = %28
  %35 = call noundef ptr @_ZN6langcc6rc_ptrIN4lang2cc4Node4Decl2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  invoke void @_ZN4lang2cc4Node4Decl2_T5writeERN6langcc6rc_ptrINS4_11PrBufStream2_TEEE(ptr noundef nonnull align 8 dereferenceable(140) %35, ptr noundef nonnull align 8 dereferenceable(16) %1)
          to label %36 unwind label %.loopexit28

36:                                               ; preds = %.critedge
  call void @_ZN6langcc6rc_ptrIN4lang2cc4Node4Decl2_TEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  %37 = add nuw nsw i64 %.01520, 1
  %38 = call noundef ptr @_ZN6langcc6rc_ptrIN4lang2cc4Node6Module2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %39 = getelementptr inbounds i8, ptr %38, i64 136
  %40 = call noundef i64 @_ZN6langcc3lenINS_6rc_ptrIN4lang2cc4Node4Decl2_TEEEEElRKNS1_INS_3VecIT_EEEE(ptr noundef nonnull align 8 dereferenceable(16) %39)
  %41 = icmp slt i64 %37, %40
  br i1 %41, label %.lr.ph.peel.next, label %._crit_edge, !llvm.loop !5

42:                                               ; preds = %.loopexit28, %.loopexit.split-lp29, %34
  %.pn17 = phi { ptr, i32 } [ %.pn, %34 ], [ %lpad.loopexit30, %.loopexit28 ], [ %lpad.loopexit.split-lp31, %.loopexit.split-lp29 ]
  call void @_ZN6langcc6rc_ptrIN4lang2cc4Node4Decl2_TEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  br label %45

._crit_edge:                                      ; preds = %36, %17, %2
  %43 = call noundef ptr @_ZN6langcc6rc_ptrINS_11PrBufStream2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  invoke void @_ZN6langcc11PrBufStream2_T13push_newlinesEl(ptr noundef nonnull align 8 dereferenceable(80) %43, i64 noundef 1)
          to label %44 unwind label %30

44:                                               ; preds = %._crit_edge
  call void @_ZN6langcc6rc_ptrIN4lang2cc4Node6Module2_TEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #6
  ret void

45:                                               ; preds = %42, %30
  %.pn17.pn = phi { ptr, i32 } [ %.pn17, %42 ], [ %31, %30 ]
  call void @_ZN6langcc6rc_ptrIN4lang2cc4Node6Module2_TEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #6
  resume { ptr, i32 } %.pn17.pn
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN6langcc3lenINS_6rc_ptrIN4lang2cc4Node4Decl2_TEEEEElRKNS1_INS_3VecIT_EEEE(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN6langcc6rc_ptrINS_11PrBufStream2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6langcc11PrBufStream2_T11push_stringENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6langcc11PrBufStream2_T13push_newlinesEl(ptr noundef nonnull align 8 dereferenceable(80), i64 noundef) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4lang2cc4Node4Decl2_T5writeERN6langcc6rc_ptrINS4_11PrBufStream2_TEEE(ptr noundef nonnull align 8 dereferenceable(140), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { alwaysinline 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 = { 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 = { 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 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 #5 = { 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 #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 = distinct !{!5, !6, !7}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!"llvm.loop.peeled.count", i32 1}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimplifyCFGPass