; LLVM IR from libtcod/libtcod :: src/libtcod/console_.ll (ZN11TCODConsole6printfEiiPKcz)

; 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.__va_list_tag = type { i32, i32, ptr, ptr }
%"struct.std::array" = type { [2 x i32] }
%"class.std::basic_string_view" = type { i64, 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::optional" = type { %"struct.std::_Optional_base" }
%"struct.std::_Optional_base" = type { %"struct.std::_Optional_payload" }
%"struct.std::_Optional_payload" = type { %"struct.std::_Optional_payload_base" }
%"struct.std::_Optional_payload_base" = type { %"union.std::_Optional_payload_base<TCOD_ColorRGB>::_Storage", i8 }
%"union.std::_Optional_payload_base<TCOD_ColorRGB>::_Storage" = type { %struct.TCOD_ColorRGB }
%struct.TCOD_ColorRGB = type { i8, i8, i8 }
%"struct.tcod::ColorRGB" = type { %struct.TCOD_ColorRGB }
%struct.TCOD_Console = type { i32, i32, ptr, i32, i32, %struct.TCOD_ColorRGB, %struct.TCOD_ColorRGB, i8, %struct.TCOD_ColorRGB, i32, ptr, ptr }

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.va_start.p0(ptr) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.va_end.p0(ptr) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4tcod5printER12TCOD_ConsoleRKSt5arrayIiLm2EESt17basic_string_viewIcSt11char_traitsIcEESt8optionalI13TCOD_ColorRGBESC_16TCOD_alignment_t17TCOD_bkgnd_flag_t(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(8), i64, ptr, i32, i32, i32 noundef, i32 noundef) #3

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11TCODConsole6printfEiiPKcz(ptr noundef nonnull align 8 dereferenceable(8) %0, i32 noundef %1, i32 noundef %2, ptr noundef %3, ...) #4 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca [1 x %struct.__va_list_tag], align 16
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::array", align 4
  %13 = alloca %"class.std::basic_string_view", align 8
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca %"class.std::optional", align 1
  %16 = alloca %"struct.tcod::ColorRGB", align 1
  %17 = alloca %"class.std::optional", align 1
  %18 = alloca %"struct.tcod::ColorRGB", align 1
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !5
  %19 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #6
  %20 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %9, i64 0, i64 0
  call void @llvm.va_start.p0(ptr %20)
  %21 = invoke noundef nonnull align 8 dereferenceable(56) ptr @_ZN11TCODConsolecvR12TCOD_ConsoleEv(ptr noundef nonnull align 8 dereferenceable(8) %19)
          to label %22 unwind label %58

22:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %23 = getelementptr inbounds %"struct.std::array", ptr %12, i32 0, i32 0
  %24 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %24, ptr %23, align 4, !tbaa !9
  %25 = getelementptr inbounds i32, ptr %23, i64 1
  %26 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %26, ptr %25, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #6
  %27 = load ptr, ptr %8, align 8, !tbaa !5
  %28 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %9, i64 0, i64 0
  invoke void @_ZL7vstringB5cxx11PKcP13__va_list_tag(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %14, ptr noundef %27, ptr noundef %28)
          to label %29 unwind label %62

29:                                               ; preds = %22
  %30 = call { i64, ptr } @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEcvSt17basic_string_viewIcS2_EEv(ptr noundef nonnull align 8 dereferenceable(32) %14) #6
  %31 = getelementptr inbounds { i64, ptr }, ptr %13, i32 0, i32 0
  %32 = extractvalue { i64, ptr } %30, 0
  store i64 %32, ptr %31, align 8
  %33 = getelementptr inbounds { i64, ptr }, ptr %13, i32 0, i32 1
  %34 = extractvalue { i64, ptr } %30, 1
  store ptr %34, ptr %33, align 8
  call void @llvm.lifetime.start.p0(i64 3, ptr %16) #6
  %35 = call noundef ptr @_ZN11TCODConsole3getEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #6
  %36 = getelementptr inbounds %struct.TCOD_Console, ptr %35, i32 0, i32 5
  call void @_ZN4tcod8ColorRGBC2ERK13TCOD_ColorRGB(ptr noundef nonnull align 1 dereferenceable(3) %16, ptr noundef nonnull align 1 dereferenceable(3) %36) #6
  call void @_ZNSt8optionalI13TCOD_ColorRGBEC2IN4tcod8ColorRGBETnNSt9enable_ifIX7__and_vISt6__not_ISt7is_sameIS1_NSt9remove_cvINSt16remove_referenceIT_E4typeEE4typeEEES6_IS7_ISt10in_place_tSE_EESt16is_constructibleIS0_JSA_EESt14is_convertibleISA_S0_EEEbE4typeELb1EEEOSA_(ptr noundef nonnull align 1 dereferenceable(4) %15, ptr noundef nonnull align 1 dereferenceable(3) %16) #6
  call void @llvm.lifetime.start.p0(i64 3, ptr %18) #6
  %37 = call noundef ptr @_ZN11TCODConsole3getEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #6
  %38 = getelementptr inbounds %struct.TCOD_Console, ptr %37, i32 0, i32 6
  call void @_ZN4tcod8ColorRGBC2ERK13TCOD_ColorRGB(ptr noundef nonnull align 1 dereferenceable(3) %18, ptr noundef nonnull align 1 dereferenceable(3) %38) #6
  call void @_ZNSt8optionalI13TCOD_ColorRGBEC2IN4tcod8ColorRGBETnNSt9enable_ifIX7__and_vISt6__not_ISt7is_sameIS1_NSt9remove_cvINSt16remove_referenceIT_E4typeEE4typeEEES6_IS7_ISt10in_place_tSE_EESt16is_constructibleIS0_JSA_EESt14is_convertibleISA_S0_EEEbE4typeELb1EEEOSA_(ptr noundef nonnull align 1 dereferenceable(4) %17, ptr noundef nonnull align 1 dereferenceable(3) %18) #6
  %39 = call noundef ptr @_ZN11TCODConsole3getEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #6
  %40 = getelementptr inbounds %struct.TCOD_Console, ptr %39, i32 0, i32 4
  %41 = load i32, ptr %40, align 4, !tbaa !11
  %42 = call noundef ptr @_ZN11TCODConsole3getEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #6
  %43 = getelementptr inbounds %struct.TCOD_Console, ptr %42, i32 0, i32 3
  %44 = load i32, ptr %43, align 8, !tbaa !17
  %45 = getelementptr inbounds { i64, ptr }, ptr %13, i32 0, i32 0
  %46 = load i64, ptr %45, align 8
  %47 = getelementptr inbounds { i64, ptr }, ptr %13, i32 0, i32 1
  %48 = load ptr, ptr %47, align 8
  %49 = getelementptr inbounds %"class.std::optional", ptr %15, i32 0, i32 0
  %50 = getelementptr inbounds %"struct.std::_Optional_base", ptr %49, i32 0, i32 0
  %51 = getelementptr inbounds %"struct.std::_Optional_payload", ptr %50, i32 0, i32 0
  %52 = load i32, ptr %51, align 1
  %53 = getelementptr inbounds %"class.std::optional", ptr %17, i32 0, i32 0
  %54 = getelementptr inbounds %"struct.std::_Optional_base", ptr %53, i32 0, i32 0
  %55 = getelementptr inbounds %"struct.std::_Optional_payload", ptr %54, i32 0, i32 0
  %56 = load i32, ptr %55, align 1
  invoke void @_ZN4tcod5printER12TCOD_ConsoleRKSt5arrayIiLm2EESt17basic_string_viewIcSt11char_traitsIcEESt8optionalI13TCOD_ColorRGBESC_16TCOD_alignment_t17TCOD_bkgnd_flag_t(ptr noundef nonnull align 8 dereferenceable(56) %21, ptr noundef nonnull align 4 dereferenceable(8) %12, i64 %46, ptr %48, i32 %52, i32 %56, i32 noundef %41, i32 noundef %44)
          to label %57 unwind label %66

57:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 3, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 3, ptr %16) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %80

58:                                               ; preds = %4
  %59 = landingpad { ptr, i32 }
          catch ptr null
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %10, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %11, align 4
  br label %71

62:                                               ; preds = %22
  %63 = landingpad { ptr, i32 }
          catch ptr null
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %10, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %11, align 4
  br label %70

66:                                               ; preds = %29
  %67 = landingpad { ptr, i32 }
          catch ptr null
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %10, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 3, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 3, ptr %16) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #6
  br label %70

70:                                               ; preds = %66, %62
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %71

71:                                               ; preds = %70, %58
  %72 = load ptr, ptr %10, align 8
  %73 = call ptr @__cxa_begin_catch(ptr %72) #6
  %74 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %9, i64 0, i64 0
  call void @llvm.va_end.p0(ptr %74)
  invoke void @__cxa_rethrow() #7
          to label %90 unwind label %75

75:                                               ; preds = %71
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %10, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %11, align 4
  invoke void @__cxa_end_catch()
          to label %79 unwind label %87

79:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #6
  br label %82

80:                                               ; preds = %57
  %81 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %9, i64 0, i64 0
  call void @llvm.va_end.p0(ptr %81)
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #6
  ret void

82:                                               ; preds = %79
  %83 = load ptr, ptr %10, align 8
  %84 = load i32, ptr %11, align 4
  %85 = insertvalue { ptr, i32 } poison, ptr %83, 0
  %86 = insertvalue { ptr, i32 } %85, i32 %84, 1
  resume { ptr, i32 } %86

87:                                               ; preds = %75
  %88 = landingpad { ptr, i32 }
          catch ptr null
  %89 = extractvalue { ptr, i32 } %88, 0
  call void @__clang_call_terminate(ptr %89) #8
  unreachable

90:                                               ; preds = %71
  unreachable
}

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL7vstringB5cxx11PKcP13__va_list_tag(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ptr noundef) #4

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

declare ptr @__cxa_begin_catch(ptr)

declare void @__cxa_rethrow()

declare void @__cxa_end_catch()

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn }
attributes #3 = { 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 #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = { nounwind }
attributes #7 = { noreturn }
attributes #8 = { noreturn 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, !14, i64 20}
!12 = !{!"_ZTS12TCOD_Console", !10, i64 0, !10, i64 4, !6, i64 8, !13, i64 16, !14, i64 20, !15, i64 24, !15, i64 27, !16, i64 30, !15, i64 31, !10, i64 36, !6, i64 40, !6, i64 48}
!13 = !{!"_ZTS17TCOD_bkgnd_flag_t", !7, i64 0}
!14 = !{!"_ZTS16TCOD_alignment_t", !7, i64 0}
!15 = !{!"_ZTS13TCOD_ColorRGB", !7, i64 0, !7, i64 1, !7, i64 2}
!16 = !{!"bool", !7, i64 0}
!17 = !{!12, !13, i64 16}


; 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.__va_list_tag = type { i32, i32, ptr, ptr }
%"struct.std::array" = type { [2 x i32] }
%"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::optional" = type { %"struct.std::_Optional_base" }
%"struct.std::_Optional_base" = type { %"struct.std::_Optional_payload" }
%"struct.std::_Optional_payload" = type { %"struct.std::_Optional_payload_base" }
%"struct.std::_Optional_payload_base" = type { %"union.std::_Optional_payload_base<TCOD_ColorRGB>::_Storage", i8 }
%"union.std::_Optional_payload_base<TCOD_ColorRGB>::_Storage" = type { %struct.TCOD_ColorRGB }
%struct.TCOD_ColorRGB = type { i8, i8, i8 }
%"struct.tcod::ColorRGB" = type { %struct.TCOD_ColorRGB }

; 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: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN11TCODConsole3getEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.va_start.p0(ptr) #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.va_end.p0(ptr) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4tcod5printER12TCOD_ConsoleRKSt5arrayIiLm2EESt17basic_string_viewIcSt11char_traitsIcEESt8optionalI13TCOD_ColorRGBESC_16TCOD_alignment_t17TCOD_bkgnd_flag_t(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(8), i64, ptr, i32, i32, i32 noundef, i32 noundef) local_unnamed_addr #3

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11TCODConsole6printfEiiPKcz(ptr noundef nonnull align 8 dereferenceable(8) %0, i32 noundef %1, i32 noundef %2, ptr noundef %3, ...) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca [1 x %struct.__va_list_tag], align 16
  %6 = alloca %"struct.std::array", align 4
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::optional", align 4
  %9 = alloca %"struct.tcod::ColorRGB", align 1
  %10 = alloca %"class.std::optional", align 4
  %11 = alloca %"struct.tcod::ColorRGB", align 1
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  call void @llvm.va_start.p0(ptr nonnull %5)
  %12 = invoke noundef nonnull align 8 dereferenceable(56) ptr @_ZN11TCODConsolecvR12TCOD_ConsoleEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
          to label %13 unwind label %32

13:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  store i32 %1, ptr %6, align 4, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %6, i64 4
  store i32 %2, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #6
  invoke void @_ZL7vstringB5cxx11PKcP13__va_list_tag(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %7, ptr noundef %3, ptr noundef nonnull %5)
          to label %15 unwind label %34

15:                                               ; preds = %13
  %16 = call { i64, ptr } @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEcvSt17basic_string_viewIcS2_EEv(ptr noundef nonnull align 8 dereferenceable(32) %7) #6
  %17 = extractvalue { i64, ptr } %16, 0
  %18 = extractvalue { i64, ptr } %16, 1
  call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %9) #6
  %19 = call noundef ptr @_ZN11TCODConsole3getEv(ptr noundef nonnull align 8 dereferenceable(8) %0) #6
  %20 = getelementptr inbounds i8, ptr %19, i64 24
  call void @_ZN4tcod8ColorRGBC2ERK13TCOD_ColorRGB(ptr noundef nonnull align 1 dereferenceable(3) %9, ptr noundef nonnull align 1 dereferenceable(3) %20) #6
  call void @_ZNSt8optionalI13TCOD_ColorRGBEC2IN4tcod8ColorRGBETnNSt9enable_ifIX7__and_vISt6__not_ISt7is_sameIS1_NSt9remove_cvINSt16remove_referenceIT_E4typeEE4typeEEES6_IS7_ISt10in_place_tSE_EESt16is_constructibleIS0_JSA_EESt14is_convertibleISA_S0_EEEbE4typeELb1EEEOSA_(ptr noundef nonnull align 1 dereferenceable(4) %8, ptr noundef nonnull align 1 dereferenceable(3) %9) #6
  call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %11) #6
  %21 = call noundef ptr @_ZN11TCODConsole3getEv(ptr noundef nonnull align 8 dereferenceable(8) %0) #6
  %22 = getelementptr inbounds i8, ptr %21, i64 27
  call void @_ZN4tcod8ColorRGBC2ERK13TCOD_ColorRGB(ptr noundef nonnull align 1 dereferenceable(3) %11, ptr noundef nonnull align 1 dereferenceable(3) %22) #6
  call void @_ZNSt8optionalI13TCOD_ColorRGBEC2IN4tcod8ColorRGBETnNSt9enable_ifIX7__and_vISt6__not_ISt7is_sameIS1_NSt9remove_cvINSt16remove_referenceIT_E4typeEE4typeEEES6_IS7_ISt10in_place_tSE_EESt16is_constructibleIS0_JSA_EESt14is_convertibleISA_S0_EEEbE4typeELb1EEEOSA_(ptr noundef nonnull align 1 dereferenceable(4) %10, ptr noundef nonnull align 1 dereferenceable(3) %11) #6
  %23 = call noundef ptr @_ZN11TCODConsole3getEv(ptr noundef nonnull align 8 dereferenceable(8) %0) #6
  %24 = getelementptr inbounds i8, ptr %23, i64 20
  %25 = load i32, ptr %24, align 4, !tbaa !9
  %26 = call noundef ptr @_ZN11TCODConsole3getEv(ptr noundef nonnull align 8 dereferenceable(8) %0) #6
  %27 = getelementptr inbounds i8, ptr %26, i64 16
  %28 = load i32, ptr %27, align 8, !tbaa !16
  %29 = load i32, ptr %8, align 4
  %30 = load i32, ptr %10, align 4
  invoke void @_ZN4tcod5printER12TCOD_ConsoleRKSt5arrayIiLm2EESt17basic_string_viewIcSt11char_traitsIcEESt8optionalI13TCOD_ColorRGBESC_16TCOD_alignment_t17TCOD_bkgnd_flag_t(ptr noundef nonnull align 8 dereferenceable(56) %12, ptr noundef nonnull align 4 dereferenceable(8) %6, i64 %17, ptr %18, i32 %29, i32 %30, i32 noundef %25, i32 noundef %28)
          to label %31 unwind label %36

31:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %9) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.va_end.p0(ptr nonnull %5)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  ret void

32:                                               ; preds = %4
  %33 = landingpad { ptr, i32 }
          catch ptr null
  br label %39

34:                                               ; preds = %13
  %35 = landingpad { ptr, i32 }
          catch ptr null
  br label %38

36:                                               ; preds = %15
  %37 = landingpad { ptr, i32 }
          catch ptr null
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %9) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #6
  br label %38

38:                                               ; preds = %36, %34
  %.pn = phi { ptr, i32 } [ %37, %36 ], [ %35, %34 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br label %39

39:                                               ; preds = %38, %32
  %.pn.pn = phi { ptr, i32 } [ %.pn, %38 ], [ %33, %32 ]
  %.1 = extractvalue { ptr, i32 } %.pn.pn, 0
  %40 = call ptr @__cxa_begin_catch(ptr %.1) #6
  call void @llvm.va_end.p0(ptr nonnull %5)
  invoke void @__cxa_rethrow() #7
          to label %47 unwind label %41

41:                                               ; preds = %39
  %42 = landingpad { ptr, i32 }
          cleanup
  invoke void @__cxa_end_catch()
          to label %43 unwind label %44

43:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  resume { ptr, i32 } %42

44:                                               ; preds = %41
  %45 = landingpad { ptr, i32 }
          catch ptr null
  %46 = extractvalue { ptr, i32 } %45, 0
  call void @__clang_call_terminate(ptr %46) #8
  unreachable

47:                                               ; preds = %39
  unreachable
}

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL7vstringB5cxx11PKcP13__va_list_tag(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ptr noundef) local_unnamed_addr #4

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

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

declare void @__cxa_rethrow() local_unnamed_addr

declare void @__cxa_end_catch() local_unnamed_addr

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #3 = { 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 #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = { nounwind }
attributes #7 = { noreturn }
attributes #8 = { noreturn 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !13, i64 20}
!10 = !{!"_ZTS12TCOD_Console", !6, i64 0, !6, i64 4, !11, i64 8, !12, i64 16, !13, i64 20, !14, i64 24, !14, i64 27, !15, i64 30, !14, i64 31, !6, i64 36, !11, i64 40, !11, i64 48}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"_ZTS17TCOD_bkgnd_flag_t", !7, i64 0}
!13 = !{!"_ZTS16TCOD_alignment_t", !7, i64 0}
!14 = !{!"_ZTS13TCOD_ColorRGB", !7, i64 0, !7, i64 1, !7, i64 2}
!15 = !{!"bool", !7, i64 0}
!16 = !{!10, !12, i64 16}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass