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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::__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.__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::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

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

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

29:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %30 = getelementptr inbounds %"struct.std::array", ptr %17, i32 0, i32 0
  %31 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %31, ptr %30, align 4, !tbaa !9
  %32 = getelementptr inbounds i32, ptr %30, i64 1
  %33 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %33, ptr %32, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #6
  %34 = load ptr, ptr %12, align 8, !tbaa !5
  %35 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %13, i64 0, i64 0
  invoke void @_ZL7vstringB5cxx11PKcP13__va_list_tag(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %19, ptr noundef %34, ptr noundef %35)
          to label %36 unwind label %65

36:                                               ; preds = %29
  %37 = call { i64, ptr } @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEcvSt17basic_string_viewIcS2_EEv(ptr noundef nonnull align 8 dereferenceable(32) %19) #6
  %38 = getelementptr inbounds { i64, ptr }, ptr %18, i32 0, i32 0
  %39 = extractvalue { i64, ptr } %37, 0
  store i64 %39, ptr %38, align 8
  %40 = getelementptr inbounds { i64, ptr }, ptr %18, i32 0, i32 1
  %41 = extractvalue { i64, ptr } %37, 1
  store ptr %41, ptr %40, align 8
  call void @llvm.lifetime.start.p0(i64 3, ptr %21) #6
  %42 = call noundef ptr @_ZN11TCODConsole3getEv(ptr noundef nonnull align 8 dereferenceable(8) %24) #6
  %43 = getelementptr inbounds %struct.TCOD_Console, ptr %42, i32 0, i32 5
  call void @_ZN4tcod8ColorRGBC2ERK13TCOD_ColorRGB(ptr noundef nonnull align 1 dereferenceable(3) %21, ptr noundef nonnull align 1 dereferenceable(3) %43) #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) %20, ptr noundef nonnull align 1 dereferenceable(3) %21) #6
  call void @llvm.lifetime.start.p0(i64 3, ptr %23) #6
  %44 = call noundef ptr @_ZN11TCODConsole3getEv(ptr noundef nonnull align 8 dereferenceable(8) %24) #6
  %45 = getelementptr inbounds %struct.TCOD_Console, ptr %44, i32 0, i32 6
  call void @_ZN4tcod8ColorRGBC2ERK13TCOD_ColorRGB(ptr noundef nonnull align 1 dereferenceable(3) %23, ptr noundef nonnull align 1 dereferenceable(3) %45) #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) %22, ptr noundef nonnull align 1 dereferenceable(3) %23) #6
  %46 = load i32, ptr %11, align 4, !tbaa !13
  %47 = load i32, ptr %10, align 4, !tbaa !11
  %48 = getelementptr inbounds { i64, ptr }, ptr %18, i32 0, i32 0
  %49 = load i64, ptr %48, align 8
  %50 = getelementptr inbounds { i64, ptr }, ptr %18, i32 0, i32 1
  %51 = load ptr, ptr %50, align 8
  %52 = getelementptr inbounds %"class.std::optional", ptr %20, i32 0, i32 0
  %53 = getelementptr inbounds %"struct.std::_Optional_base", ptr %52, i32 0, i32 0
  %54 = getelementptr inbounds %"struct.std::_Optional_payload", ptr %53, i32 0, i32 0
  %55 = load i32, ptr %54, align 1
  %56 = getelementptr inbounds %"class.std::optional", ptr %22, i32 0, i32 0
  %57 = getelementptr inbounds %"struct.std::_Optional_base", ptr %56, i32 0, i32 0
  %58 = getelementptr inbounds %"struct.std::_Optional_payload", ptr %57, i32 0, i32 0
  %59 = load i32, ptr %58, align 1
  invoke void @_ZN4tcod5printER12TCOD_ConsoleRKSt5arrayIiLm2EESt17basic_string_viewIcSt11char_traitsIcEESt8optionalI13TCOD_ColorRGBESC_16TCOD_alignment_t17TCOD_bkgnd_flag_t(ptr noundef nonnull align 8 dereferenceable(56) %28, ptr noundef nonnull align 4 dereferenceable(8) %17, i64 %49, ptr %51, i32 %55, i32 %59, i32 noundef %46, i32 noundef %47)
          to label %60 unwind label %69

60:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 3, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 3, ptr %21) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %83

61:                                               ; preds = %6
  %62 = landingpad { ptr, i32 }
          catch ptr null
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %15, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %16, align 4
  br label %74

65:                                               ; preds = %29
  %66 = landingpad { ptr, i32 }
          catch ptr null
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %15, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %16, align 4
  br label %73

69:                                               ; preds = %36
  %70 = landingpad { ptr, i32 }
          catch ptr null
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %15, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 3, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 3, ptr %21) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #6
  br label %73

73:                                               ; preds = %69, %65
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %74

74:                                               ; preds = %73, %61
  %75 = load ptr, ptr %15, align 8
  %76 = call ptr @__cxa_begin_catch(ptr %75) #6
  %77 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %13, i64 0, i64 0
  call void @llvm.va_end.p0(ptr %77)
  invoke void @__cxa_rethrow() #7
          to label %93 unwind label %78

78:                                               ; preds = %74
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %15, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %16, align 4
  invoke void @__cxa_end_catch()
          to label %82 unwind label %90

82:                                               ; preds = %78
  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 24, ptr %13) #6
  br label %85

83:                                               ; preds = %60
  %84 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %13, i64 0, i64 0
  call void @llvm.va_end.p0(ptr %84)
  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 24, ptr %13) #6
  ret void

85:                                               ; preds = %82
  %86 = load ptr, ptr %15, align 8
  %87 = load i32, ptr %16, align 4
  %88 = insertvalue { ptr, i32 } poison, ptr %86, 0
  %89 = insertvalue { ptr, i32 } %88, i32 %87, 1
  resume { ptr, i32 } %89

90:                                               ; preds = %78
  %91 = landingpad { ptr, i32 }
          catch ptr null
  %92 = extractvalue { ptr, i32 } %91, 0
  call void @__clang_call_terminate(ptr %92) #8
  unreachable

93:                                               ; preds = %74
  unreachable
}

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, !12, i64 0}
!12 = !{!"_ZTS17TCOD_bkgnd_flag_t", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"_ZTS16TCOD_alignment_t", !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::__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.__va_list_tag = type { i32, i32, ptr, ptr }
%"struct.std::array" = type { [2 x i32] }
%"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

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

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

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

18:                                               ; preds = %16
  %19 = call { i64, ptr } @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEcvSt17basic_string_viewIcS2_EEv(ptr noundef nonnull align 8 dereferenceable(32) %10) #6
  %20 = extractvalue { i64, ptr } %19, 0
  %21 = extractvalue { i64, ptr } %19, 1
  call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %12) #6
  %22 = call noundef ptr @_ZN11TCODConsole3getEv(ptr noundef nonnull align 8 dereferenceable(8) %0) #6
  %23 = getelementptr inbounds i8, ptr %22, i64 24
  call void @_ZN4tcod8ColorRGBC2ERK13TCOD_ColorRGB(ptr noundef nonnull align 1 dereferenceable(3) %12, ptr noundef nonnull align 1 dereferenceable(3) %23) #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) %11, ptr noundef nonnull align 1 dereferenceable(3) %12) #6
  call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %14) #6
  %24 = call noundef ptr @_ZN11TCODConsole3getEv(ptr noundef nonnull align 8 dereferenceable(8) %0) #6
  %25 = getelementptr inbounds i8, ptr %24, i64 27
  call void @_ZN4tcod8ColorRGBC2ERK13TCOD_ColorRGB(ptr noundef nonnull align 1 dereferenceable(3) %14, ptr noundef nonnull align 1 dereferenceable(3) %25) #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) %13, ptr noundef nonnull align 1 dereferenceable(3) %14) #6
  %26 = load i32, ptr %11, align 4
  %27 = load i32, ptr %13, align 4
  invoke void @_ZN4tcod5printER12TCOD_ConsoleRKSt5arrayIiLm2EESt17basic_string_viewIcSt11char_traitsIcEESt8optionalI13TCOD_ColorRGBESC_16TCOD_alignment_t17TCOD_bkgnd_flag_t(ptr noundef nonnull align 8 dereferenceable(56) %15, ptr noundef nonnull align 4 dereferenceable(8) %9, i64 %20, ptr %21, i32 %26, i32 %27, i32 noundef %4, i32 noundef %3)
          to label %28 unwind label %33

28:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %12) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.va_end.p0(ptr nonnull %7)
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  ret void

29:                                               ; preds = %6
  %30 = landingpad { ptr, i32 }
          catch ptr null
  br label %36

31:                                               ; preds = %16
  %32 = landingpad { ptr, i32 }
          catch ptr null
  br label %35

33:                                               ; preds = %18
  %34 = landingpad { ptr, i32 }
          catch ptr null
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %12) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #6
  br label %35

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

36:                                               ; preds = %35, %29
  %.pn.pn = phi { ptr, i32 } [ %.pn, %35 ], [ %30, %29 ]
  %.1 = extractvalue { ptr, i32 } %.pn.pn, 0
  %37 = call ptr @__cxa_begin_catch(ptr %.1) #6
  call void @llvm.va_end.p0(ptr nonnull %7)
  invoke void @__cxa_rethrow() #7
          to label %44 unwind label %38

38:                                               ; preds = %36
  %39 = landingpad { ptr, i32 }
          cleanup
  invoke void @__cxa_end_catch()
          to label %40 unwind label %41

40:                                               ; preds = %38
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  resume { ptr, i32 } %39

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

44:                                               ; preds = %36
  unreachable
}

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


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