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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4agge15font_descriptor6createERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiNS_11font_weightEbNS_12font_hintingE(ptr dead_on_unwind noalias writable sret(%"struct.agge::font_descriptor") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %2, i32 noundef %3, i1 noundef zeroext %4, i32 noundef %5) #0 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i8, align 1
  %12 = alloca i32, align 4
  %13 = alloca i1, align 1
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  store ptr %0, ptr %7, align 8
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !11
  %16 = zext i1 %4 to i8
  store i8 %16, ptr %11, align 1, !tbaa !13
  store i32 %5, ptr %12, align 4, !tbaa !15
  store i1 false, ptr %13, align 1
  %17 = getelementptr inbounds %"struct.agge::font_descriptor", ptr %0, i32 0, i32 0
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #3
  %18 = getelementptr inbounds %"struct.agge::font_descriptor", ptr %0, i32 0, i32 1
  %19 = load i32, ptr %18, align 8
  %20 = and i32 %19, -1048576
  %21 = or i32 %20, 0
  store i32 %21, ptr %18, align 8
  %22 = getelementptr inbounds %"struct.agge::font_descriptor", ptr %0, i32 0, i32 1
  %23 = load i32, ptr %22, align 8
  %24 = and i32 %23, -15728641
  %25 = or i32 %24, 0
  store i32 %25, ptr %22, align 8
  %26 = getelementptr inbounds %"struct.agge::font_descriptor", ptr %0, i32 0, i32 1
  %27 = load i32, ptr %26, align 8
  %28 = and i32 %27, -16777217
  %29 = or i32 %28, 0
  store i32 %29, ptr %26, align 8
  %30 = getelementptr inbounds %"struct.agge::font_descriptor", ptr %0, i32 0, i32 1
  %31 = load i32, ptr %30, align 8
  %32 = and i32 %31, -100663297
  %33 = or i32 %32, 0
  store i32 %33, ptr %30, align 8
  %34 = load ptr, ptr %8, align 8, !tbaa !5
  %35 = getelementptr inbounds %"struct.agge::font_descriptor", ptr %0, i32 0, i32 0
  %36 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %35, ptr noundef nonnull align 8 dereferenceable(32) %34)
          to label %37 unwind label %68

37:                                               ; preds = %6
  %38 = load i32, ptr %9, align 4, !tbaa !9
  %39 = getelementptr inbounds %"struct.agge::font_descriptor", ptr %0, i32 0, i32 1
  %40 = load i32, ptr %39, align 8
  %41 = and i32 %38, 1048575
  %42 = and i32 %40, -1048576
  %43 = or i32 %42, %41
  store i32 %43, ptr %39, align 8
  %44 = load i32, ptr %10, align 4, !tbaa !11
  %45 = getelementptr inbounds %"struct.agge::font_descriptor", ptr %0, i32 0, i32 1
  %46 = load i32, ptr %45, align 8
  %47 = and i32 %44, 15
  %48 = shl i32 %47, 20
  %49 = and i32 %46, -15728641
  %50 = or i32 %49, %48
  store i32 %50, ptr %45, align 8
  %51 = load i8, ptr %11, align 1, !tbaa !13, !range !17, !noundef !18
  %52 = trunc i8 %51 to i1
  %53 = zext i1 %52 to i32
  %54 = getelementptr inbounds %"struct.agge::font_descriptor", ptr %0, i32 0, i32 1
  %55 = load i32, ptr %54, align 8
  %56 = and i32 %53, 1
  %57 = shl i32 %56, 24
  %58 = and i32 %55, -16777217
  %59 = or i32 %58, %57
  store i32 %59, ptr %54, align 8
  %60 = load i32, ptr %12, align 4, !tbaa !15
  %61 = getelementptr inbounds %"struct.agge::font_descriptor", ptr %0, i32 0, i32 1
  %62 = load i32, ptr %61, align 8
  %63 = and i32 %60, 3
  %64 = shl i32 %63, 25
  %65 = and i32 %62, -100663297
  %66 = or i32 %65, %64
  store i32 %66, ptr %61, align 8
  store i1 true, ptr %13, align 1
  %67 = load i1, ptr %13, align 1
  br i1 %67, label %73, label %72

68:                                               ; preds = %6
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %14, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %15, align 4
  call void @_ZN4agge15font_descriptorD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %0) #3
  br label %74

72:                                               ; preds = %37
  call void @_ZN4agge15font_descriptorD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %0) #3
  br label %73

73:                                               ; preds = %72, %37
  ret void

74:                                               ; preds = %68
  %75 = load ptr, ptr %14, align 8
  %76 = load i32, ptr %15, align 4
  %77 = insertvalue { ptr, i32 } poison, ptr %75, 0
  %78 = insertvalue { ptr, i32 } %77, i32 %76, 1
  resume { ptr, i32 } %78
}

; 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: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

declare i32 @__gxx_personality_v0(...)

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

attributes #0 = { 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 = { 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 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 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTSN4agge11font_weightE", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"_ZTSN4agge12font_hintingE", !7, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}


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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4agge15font_descriptor6createERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiNS_11font_weightEbNS_12font_hintingE(ptr dead_on_unwind noalias nonnull writable sret(%"struct.agge::font_descriptor") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %2, i32 noundef %3, i1 noundef zeroext %4, i32 noundef %5) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  %7 = getelementptr inbounds i8, ptr %0, i64 32
  %8 = load i32, ptr %7, align 8
  %9 = and i32 %8, -134217728
  store i32 %9, ptr %7, align 8
  %10 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %11 unwind label %24

11:                                               ; preds = %6
  %12 = load i32, ptr %7, align 8
  %13 = and i32 %2, 1048575
  %14 = and i32 %12, -134217728
  %15 = shl i32 %3, 20
  %16 = and i32 %15, 15728640
  %17 = select i1 %4, i32 16777216, i32 0
  %18 = shl i32 %5, 25
  %19 = and i32 %18, 100663296
  %20 = or disjoint i32 %16, %13
  %21 = or disjoint i32 %20, %17
  %22 = or disjoint i32 %21, %19
  %23 = or disjoint i32 %22, %14
  store i32 %23, ptr %7, align 8
  ret void

24:                                               ; preds = %6
  %25 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN4agge15font_descriptorD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %0) #3
  resume { ptr, i32 } %25
}

; 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: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

attributes #0 = { 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 = { 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 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 = { 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)"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass