; LLVM IR from tyoma/agge :: src/agge.text (richtext)

; 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.agge::font_style_annotation" = type { %"struct.agge::font_descriptor", %"struct.agge::color", [4 x i8] }
%"struct.agge::font_descriptor" = type <{ %"class.std::__cxx11::basic_string", i32, [4 x i8] }>
%"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] }
%"struct.agge::color" = type { i8, i8, i8, i8 }
%"class.agge::annotated_string<char, agge::style_modifier>::const_iterator" = type { %"class.agge::annotated_string<char, agge::style_modifier>::range", ptr, %"class.__gnu_cxx::__normal_iterator", %"class.__gnu_cxx::__normal_iterator" }
%"class.agge::annotated_string<char, agge::style_modifier>::range" = type { %"class.agge::range", ptr }
%"class.agge::range" = type { i64, i64, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.9" = type { ptr }

; 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(44) ptr @_ZNK4agge16annotated_stringIcNS_21font_style_annotationEE18current_annotationEv(ptr noundef nonnull align 8 dereferenceable(104)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4agge21font_style_annotationC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(44), ptr noundef nonnull align 8 dereferenceable(44)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN4agge12_GLOBAL__N_15applyERNS_21font_style_annotationERKNS_14style_modifierERKS1_(ptr noundef nonnull align 8 dereferenceable(44), ptr noundef nonnull align 8 dereferenceable(46), ptr noundef nonnull align 8 dereferenceable(44)) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(44) ptr @_ZNK4agge16annotated_stringIcNS_21font_style_annotationEE15base_annotationEv(ptr noundef nonnull align 8 dereferenceable(104)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4agge16annotated_stringIcNS_21font_style_annotationEE8annotateERKS1_(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 8 dereferenceable(44)) #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(104) ptr @_ZN4aggelsERNS_16annotated_stringIcNS_21font_style_annotationEEERKNS0_IcNS_14style_modifierEEE(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull align 8 dereferenceable(104) %1) #3 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"struct.agge::font_style_annotation", align 8
  %6 = alloca %"class.agge::annotated_string<char, agge::style_modifier>::const_iterator", align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"class.agge::annotated_string<char, agge::style_modifier>::const_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator.9", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator.9", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr %5) #4
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = call noundef nonnull align 8 dereferenceable(44) ptr @_ZNK4agge16annotated_stringIcNS_21font_style_annotationEE18current_annotationEv(ptr noundef nonnull align 8 dereferenceable(104) %12)
  call void @_ZN4agge21font_style_annotationC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(44) %5, ptr noundef nonnull align 8 dereferenceable(44) %13)
  call void @llvm.lifetime.start.p0(i64 56, ptr %6) #4
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZNK4agge16annotated_stringIcNS_14style_modifierEE12ranges_beginEv(ptr dead_on_unwind writable sret(%"class.agge::annotated_string<char, agge::style_modifier>::const_iterator") align 8 %6, ptr noundef nonnull align 8 dereferenceable(104) %14)
          to label %15 unwind label %22

15:                                               ; preds = %2
  br label %16

16:                                               ; preds = %59, %15
  call void @llvm.lifetime.start.p0(i64 56, ptr %9) #4
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZNK4agge16annotated_stringIcNS_14style_modifierEE10ranges_endEv(ptr dead_on_unwind writable sret(%"class.agge::annotated_string<char, agge::style_modifier>::const_iterator") align 8 %9, ptr noundef nonnull align 8 dereferenceable(104) %17)
          to label %18 unwind label %26

18:                                               ; preds = %16
  %19 = invoke noundef zeroext i1 @_ZNK4agge16annotated_stringIcNS_14style_modifierEE14const_iteratorneERKS3_(ptr noundef nonnull align 8 dereferenceable(56) %6, ptr noundef nonnull align 8 dereferenceable(56) %9)
          to label %20 unwind label %26

20:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 56, ptr %9) #4
  br i1 %19, label %30, label %21

21:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 56, ptr %6) #4
  br label %61

22:                                               ; preds = %57, %50, %48, %45, %43, %40, %38, %37, %34, %32, %30, %2
  %23 = landingpad { ptr, i32 }
          cleanup
  %24 = extractvalue { ptr, i32 } %23, 0
  store ptr %24, ptr %7, align 8
  %25 = extractvalue { ptr, i32 } %23, 1
  store i32 %25, ptr %8, align 4
  br label %60

26:                                               ; preds = %18, %16
  %27 = landingpad { ptr, i32 }
          cleanup
  %28 = extractvalue { ptr, i32 } %27, 0
  store ptr %28, ptr %7, align 8
  %29 = extractvalue { ptr, i32 } %27, 1
  store i32 %29, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 56, ptr %9) #4
  br label %60

30:                                               ; preds = %20
  %31 = invoke noundef ptr @_ZNK4agge16annotated_stringIcNS_14style_modifierEE14const_iteratorptEv(ptr noundef nonnull align 8 dereferenceable(56) %6)
          to label %32 unwind label %22

32:                                               ; preds = %30
  %33 = invoke noundef nonnull align 8 dereferenceable(46) ptr @_ZNK4agge16annotated_stringIcNS_14style_modifierEE5range14get_annotationEv(ptr noundef nonnull align 8 dereferenceable(32) %31)
          to label %34 unwind label %22

34:                                               ; preds = %32
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = invoke noundef nonnull align 8 dereferenceable(44) ptr @_ZNK4agge16annotated_stringIcNS_21font_style_annotationEE15base_annotationEv(ptr noundef nonnull align 8 dereferenceable(104) %35)
          to label %37 unwind label %22

37:                                               ; preds = %34
  invoke void @_ZN4agge12_GLOBAL__N_15applyERNS_21font_style_annotationERKNS_14style_modifierERKS1_(ptr noundef nonnull align 8 dereferenceable(44) %5, ptr noundef nonnull align 8 dereferenceable(46) %33, ptr noundef nonnull align 8 dereferenceable(44) %36)
          to label %38 unwind label %22

38:                                               ; preds = %37
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  invoke void @_ZN4agge16annotated_stringIcNS_21font_style_annotationEE8annotateERKS1_(ptr noundef nonnull align 8 dereferenceable(104) %39, ptr noundef nonnull align 8 dereferenceable(44) %5)
          to label %40 unwind label %22

40:                                               ; preds = %38
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = invoke noundef ptr @_ZNK4agge16annotated_stringIcNS_14style_modifierEE14const_iteratorptEv(ptr noundef nonnull align 8 dereferenceable(56) %6)
          to label %43 unwind label %22

43:                                               ; preds = %40
  %44 = invoke ptr @_ZNK4agge5rangeIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %42)
          to label %45 unwind label %22

45:                                               ; preds = %43
  %46 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.9", ptr %10, i32 0, i32 0
  store ptr %44, ptr %46, align 8
  %47 = invoke noundef ptr @_ZNK4agge16annotated_stringIcNS_14style_modifierEE14const_iteratorptEv(ptr noundef nonnull align 8 dereferenceable(56) %6)
          to label %48 unwind label %22

48:                                               ; preds = %45
  %49 = invoke ptr @_ZNK4agge5rangeIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %47)
          to label %50 unwind label %22

50:                                               ; preds = %48
  %51 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.9", ptr %11, i32 0, i32 0
  store ptr %49, ptr %51, align 8
  %52 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.9", ptr %10, i32 0, i32 0
  %53 = load ptr, ptr %52, align 8
  %54 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.9", ptr %11, i32 0, i32 0
  %55 = load ptr, ptr %54, align 8
  invoke void @_ZN4agge16annotated_stringIcNS_21font_style_annotationEE6appendIN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEEvT_SF_(ptr noundef nonnull align 8 dereferenceable(104) %41, ptr %53, ptr %55)
          to label %56 unwind label %22

56:                                               ; preds = %50
  br label %57

57:                                               ; preds = %56
  %58 = invoke noundef nonnull align 8 dereferenceable(56) ptr @_ZN4agge16annotated_stringIcNS_14style_modifierEE14const_iteratorppEv(ptr noundef nonnull align 8 dereferenceable(56) %6)
          to label %59 unwind label %22

59:                                               ; preds = %57
  br label %16, !llvm.loop !9

60:                                               ; preds = %26, %22
  call void @llvm.lifetime.end.p0(i64 56, ptr %6) #4
  call void @_ZN4agge21font_style_annotationD2Ev(ptr noundef nonnull align 8 dereferenceable(44) %5) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr %5) #4
  br label %63

61:                                               ; preds = %21
  %62 = load ptr, ptr %3, align 8, !tbaa !5
  call void @_ZN4agge21font_style_annotationD2Ev(ptr noundef nonnull align 8 dereferenceable(44) %5) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr %5) #4
  ret ptr %62

63:                                               ; preds = %60
  %64 = load ptr, ptr %7, align 8
  %65 = load i32, ptr %8, align 4
  %66 = insertvalue { ptr, i32 } poison, ptr %64, 0
  %67 = insertvalue { ptr, i32 } %66, i32 %65, 1
  resume { ptr, i32 } %67
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK4agge16annotated_stringIcNS_14style_modifierEE12ranges_beginEv(ptr dead_on_unwind noalias writable sret(%"class.agge::annotated_string<char, agge::style_modifier>::const_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(104)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK4agge16annotated_stringIcNS_14style_modifierEE14const_iteratorneERKS3_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK4agge16annotated_stringIcNS_14style_modifierEE10ranges_endEv(ptr dead_on_unwind noalias writable sret(%"class.agge::annotated_string<char, agge::style_modifier>::const_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(104)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4agge16annotated_stringIcNS_14style_modifierEE14const_iteratorptEv(ptr noundef nonnull align 8 dereferenceable(56)) #1 align 2

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZN4agge16annotated_stringIcNS_14style_modifierEE14const_iteratorppEv(ptr noundef nonnull align 8 dereferenceable(56)) #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 = { 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 = distinct !{!9, !10}
!10 = !{!"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.agge::font_style_annotation" = type { %"struct.agge::font_descriptor", %"struct.agge::color", [4 x i8] }
%"struct.agge::font_descriptor" = type <{ %"class.std::__cxx11::basic_string", i32, [4 x i8] }>
%"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] }
%"struct.agge::color" = type { i8, i8, i8, i8 }
%"class.agge::annotated_string<char, agge::style_modifier>::const_iterator" = type { %"class.agge::annotated_string<char, agge::style_modifier>::range", ptr, %"class.__gnu_cxx::__normal_iterator", %"class.__gnu_cxx::__normal_iterator" }
%"class.agge::annotated_string<char, agge::style_modifier>::range" = type { %"class.agge::range", ptr }
%"class.agge::range" = type { i64, i64, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(44) ptr @_ZNK4agge16annotated_stringIcNS_21font_style_annotationEE18current_annotationEv(ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4agge21font_style_annotationC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(44), ptr noundef nonnull align 8 dereferenceable(44)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN4agge12_GLOBAL__N_15applyERNS_21font_style_annotationERKNS_14style_modifierERKS1_(ptr noundef nonnull align 8 dereferenceable(44), ptr noundef nonnull align 8 dereferenceable(46), ptr noundef nonnull align 8 dereferenceable(44)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(44) ptr @_ZNK4agge16annotated_stringIcNS_21font_style_annotationEE15base_annotationEv(ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4agge16annotated_stringIcNS_21font_style_annotationEE8annotateERKS1_(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 8 dereferenceable(44)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(104) ptr @_ZN4aggelsERNS_16annotated_stringIcNS_21font_style_annotationEEERKNS0_IcNS_14style_modifierEEE(ptr noundef nonnull returned align 8 dereferenceable(104) %0, ptr noundef nonnull align 8 dereferenceable(104) %1) local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"struct.agge::font_style_annotation", align 8
  %4 = alloca %"class.agge::annotated_string<char, agge::style_modifier>::const_iterator", align 8
  %5 = alloca %"class.agge::annotated_string<char, agge::style_modifier>::const_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %3) #4
  %6 = tail call noundef nonnull align 8 dereferenceable(44) ptr @_ZNK4agge16annotated_stringIcNS_21font_style_annotationEE18current_annotationEv(ptr noundef nonnull align 8 dereferenceable(104) %0)
  call void @_ZN4agge21font_style_annotationC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(44) %3, ptr noundef nonnull align 8 dereferenceable(44) %6)
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %4) #4
  invoke void @_ZNK4agge16annotated_stringIcNS_14style_modifierEE12ranges_beginEv(ptr dead_on_unwind nonnull writable sret(%"class.agge::annotated_string<char, agge::style_modifier>::const_iterator") align 8 %4, ptr noundef nonnull align 8 dereferenceable(104) %1)
          to label %.preheader unwind label %.loopexit.split-lp

.preheader:                                       ; preds = %2, %23
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %5) #4
  invoke void @_ZNK4agge16annotated_stringIcNS_14style_modifierEE10ranges_endEv(ptr dead_on_unwind nonnull writable sret(%"class.agge::annotated_string<char, agge::style_modifier>::const_iterator") align 8 %5, ptr noundef nonnull align 8 dereferenceable(104) %1)
          to label %7 unwind label %11

7:                                                ; preds = %.preheader
  %8 = invoke noundef zeroext i1 @_ZNK4agge16annotated_stringIcNS_14style_modifierEE14const_iteratorneERKS3_(ptr noundef nonnull align 8 dereferenceable(56) %4, ptr noundef nonnull align 8 dereferenceable(56) %5)
          to label %9 unwind label %11

9:                                                ; preds = %7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %5) #4
  br i1 %8, label %13, label %10

10:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #4
  call void @_ZN4agge21font_style_annotationD2Ev(ptr noundef nonnull align 8 dereferenceable(44) %3) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #4
  ret ptr %0

.loopexit:                                        ; preds = %13, %17, %18, %23
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %25

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

11:                                               ; preds = %7, %.preheader
  %12 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %5) #4
  br label %25

13:                                               ; preds = %9
  %14 = call noundef ptr @_ZNK4agge16annotated_stringIcNS_14style_modifierEE14const_iteratorptEv(ptr noundef nonnull align 8 dereferenceable(56) %4)
  %15 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNK4agge16annotated_stringIcNS_14style_modifierEE5range14get_annotationEv(ptr noundef nonnull align 8 dereferenceable(32) %14)
  %16 = call noundef nonnull align 8 dereferenceable(44) ptr @_ZNK4agge16annotated_stringIcNS_21font_style_annotationEE15base_annotationEv(ptr noundef nonnull align 8 dereferenceable(104) %0)
  invoke void @_ZN4agge12_GLOBAL__N_15applyERNS_21font_style_annotationERKNS_14style_modifierERKS1_(ptr noundef nonnull align 8 dereferenceable(44) %3, ptr noundef nonnull align 8 dereferenceable(46) %15, ptr noundef nonnull align 8 dereferenceable(44) %16)
          to label %17 unwind label %.loopexit

17:                                               ; preds = %13
  invoke void @_ZN4agge16annotated_stringIcNS_21font_style_annotationEE8annotateERKS1_(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull align 8 dereferenceable(44) %3)
          to label %18 unwind label %.loopexit

18:                                               ; preds = %17
  %19 = call noundef ptr @_ZNK4agge16annotated_stringIcNS_14style_modifierEE14const_iteratorptEv(ptr noundef nonnull align 8 dereferenceable(56) %4)
  %20 = call ptr @_ZNK4agge5rangeIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %19)
  %21 = call noundef ptr @_ZNK4agge16annotated_stringIcNS_14style_modifierEE14const_iteratorptEv(ptr noundef nonnull align 8 dereferenceable(56) %4)
  %22 = call ptr @_ZNK4agge5rangeIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %21)
  invoke void @_ZN4agge16annotated_stringIcNS_21font_style_annotationEE6appendIN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEEvT_SF_(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr %20, ptr %22)
          to label %23 unwind label %.loopexit

23:                                               ; preds = %18
  %24 = invoke noundef nonnull align 8 dereferenceable(56) ptr @_ZN4agge16annotated_stringIcNS_14style_modifierEE14const_iteratorppEv(ptr noundef nonnull align 8 dereferenceable(56) %4)
          to label %.preheader unwind label %.loopexit, !llvm.loop !5

25:                                               ; preds = %.loopexit, %.loopexit.split-lp, %11
  %.pn = phi { ptr, i32 } [ %12, %11 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #4
  call void @_ZN4agge21font_style_annotationD2Ev(ptr noundef nonnull align 8 dereferenceable(44) %3) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #4
  resume { ptr, i32 } %.pn
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK4agge16annotated_stringIcNS_14style_modifierEE12ranges_beginEv(ptr dead_on_unwind noalias writable sret(%"class.agge::annotated_string<char, agge::style_modifier>::const_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK4agge16annotated_stringIcNS_14style_modifierEE14const_iteratorneERKS3_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK4agge16annotated_stringIcNS_14style_modifierEE10ranges_endEv(ptr dead_on_unwind noalias writable sret(%"class.agge::annotated_string<char, agge::style_modifier>::const_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4agge16annotated_stringIcNS_14style_modifierEE14const_iteratorptEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #1 align 2

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZN4agge16annotated_stringIcNS_14style_modifierEE14const_iteratorppEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #2 align 2

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


; Effective O3 passes: GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass