; LLVM IR from libtcod/libtcod :: src/libtcod (console_printing)

; 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.TCOD_ColorRGB = type { i8, i8, i8 }
%struct.TCOD_Console = type { i32, i32, ptr, i32, i32, %struct.TCOD_ColorRGB, %struct.TCOD_ColorRGB, i8, %struct.TCOD_ColorRGB, i32, ptr, ptr }

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @TCOD_console_vsprint(ptr noundef, ptr noundef) #1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @TCOD_console_print_frame(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i1 noundef zeroext %5, i32 noundef %6, ptr noundef %7, ...) #1 {
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i8, align 1
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca [1 x %struct.__va_list_tag], align 16
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca %struct.TCOD_ColorRGB, align 1
  store ptr %0, ptr %9, align 8, !tbaa !5
  store i32 %1, ptr %10, align 4, !tbaa !9
  store i32 %2, ptr %11, align 4, !tbaa !9
  store i32 %3, ptr %12, align 4, !tbaa !9
  store i32 %4, ptr %13, align 4, !tbaa !9
  %21 = zext i1 %5 to i8
  store i8 %21, ptr %14, align 1, !tbaa !11
  store i32 %6, ptr %15, align 4, !tbaa !9
  store ptr %7, ptr %16, align 8, !tbaa !5
  %22 = load ptr, ptr %9, align 8, !tbaa !5
  %23 = call ptr @TCOD_console_validate_(ptr noundef %22)
  store ptr %23, ptr %9, align 8, !tbaa !5
  %24 = load ptr, ptr %9, align 8, !tbaa !5
  %25 = icmp ne ptr %24, null
  br i1 %25, label %27, label %26

26:                                               ; preds = %8
  br label %150

27:                                               ; preds = %8
  %28 = load ptr, ptr %9, align 8, !tbaa !5
  %29 = load i32, ptr %10, align 4, !tbaa !9
  %30 = load i32, ptr %11, align 4, !tbaa !9
  %31 = load i32, ptr %15, align 4, !tbaa !9
  call void @TCOD_console_put_char(ptr noundef %28, i32 noundef %29, i32 noundef %30, i32 noundef 9484, i32 noundef %31)
  %32 = load ptr, ptr %9, align 8, !tbaa !5
  %33 = load i32, ptr %10, align 4, !tbaa !9
  %34 = load i32, ptr %12, align 4, !tbaa !9
  %35 = add nsw i32 %33, %34
  %36 = sub nsw i32 %35, 1
  %37 = load i32, ptr %11, align 4, !tbaa !9
  %38 = load i32, ptr %15, align 4, !tbaa !9
  call void @TCOD_console_put_char(ptr noundef %32, i32 noundef %36, i32 noundef %37, i32 noundef 9488, i32 noundef %38)
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  %40 = load i32, ptr %10, align 4, !tbaa !9
  %41 = load i32, ptr %11, align 4, !tbaa !9
  %42 = load i32, ptr %13, align 4, !tbaa !9
  %43 = add nsw i32 %41, %42
  %44 = sub nsw i32 %43, 1
  %45 = load i32, ptr %15, align 4, !tbaa !9
  call void @TCOD_console_put_char(ptr noundef %39, i32 noundef %40, i32 noundef %44, i32 noundef 9492, i32 noundef %45)
  %46 = load ptr, ptr %9, align 8, !tbaa !5
  %47 = load i32, ptr %10, align 4, !tbaa !9
  %48 = load i32, ptr %12, align 4, !tbaa !9
  %49 = add nsw i32 %47, %48
  %50 = sub nsw i32 %49, 1
  %51 = load i32, ptr %11, align 4, !tbaa !9
  %52 = load i32, ptr %13, align 4, !tbaa !9
  %53 = add nsw i32 %51, %52
  %54 = sub nsw i32 %53, 1
  %55 = load i32, ptr %15, align 4, !tbaa !9
  call void @TCOD_console_put_char(ptr noundef %46, i32 noundef %50, i32 noundef %54, i32 noundef 9496, i32 noundef %55)
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = load i32, ptr %10, align 4, !tbaa !9
  %58 = add nsw i32 %57, 1
  %59 = load i32, ptr %11, align 4, !tbaa !9
  %60 = load i32, ptr %12, align 4, !tbaa !9
  %61 = sub nsw i32 %60, 2
  %62 = load i32, ptr %15, align 4, !tbaa !9
  call void @TCOD_console_hline(ptr noundef %56, i32 noundef %58, i32 noundef %59, i32 noundef %61, i32 noundef %62)
  %63 = load ptr, ptr %9, align 8, !tbaa !5
  %64 = load i32, ptr %10, align 4, !tbaa !9
  %65 = add nsw i32 %64, 1
  %66 = load i32, ptr %11, align 4, !tbaa !9
  %67 = load i32, ptr %13, align 4, !tbaa !9
  %68 = add nsw i32 %66, %67
  %69 = sub nsw i32 %68, 1
  %70 = load i32, ptr %12, align 4, !tbaa !9
  %71 = sub nsw i32 %70, 2
  %72 = load i32, ptr %15, align 4, !tbaa !9
  call void @TCOD_console_hline(ptr noundef %63, i32 noundef %65, i32 noundef %69, i32 noundef %71, i32 noundef %72)
  %73 = load i32, ptr %13, align 4, !tbaa !9
  %74 = icmp sgt i32 %73, 2
  br i1 %74, label %75, label %107

75:                                               ; preds = %27
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = load i32, ptr %10, align 4, !tbaa !9
  %78 = load i32, ptr %11, align 4, !tbaa !9
  %79 = add nsw i32 %78, 1
  %80 = load i32, ptr %13, align 4, !tbaa !9
  %81 = sub nsw i32 %80, 2
  %82 = load i32, ptr %15, align 4, !tbaa !9
  call void @TCOD_console_vline(ptr noundef %76, i32 noundef %77, i32 noundef %79, i32 noundef %81, i32 noundef %82)
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  %84 = load i32, ptr %10, align 4, !tbaa !9
  %85 = load i32, ptr %12, align 4, !tbaa !9
  %86 = add nsw i32 %84, %85
  %87 = sub nsw i32 %86, 1
  %88 = load i32, ptr %11, align 4, !tbaa !9
  %89 = add nsw i32 %88, 1
  %90 = load i32, ptr %13, align 4, !tbaa !9
  %91 = sub nsw i32 %90, 2
  %92 = load i32, ptr %15, align 4, !tbaa !9
  call void @TCOD_console_vline(ptr noundef %83, i32 noundef %87, i32 noundef %89, i32 noundef %91, i32 noundef %92)
  %93 = load i8, ptr %14, align 1, !tbaa !11, !range !13, !noundef !14
  %94 = trunc i8 %93 to i1
  br i1 %94, label %95, label %106

95:                                               ; preds = %75
  %96 = load ptr, ptr %9, align 8, !tbaa !5
  %97 = load i32, ptr %10, align 4, !tbaa !9
  %98 = add nsw i32 %97, 1
  %99 = load i32, ptr %11, align 4, !tbaa !9
  %100 = add nsw i32 %99, 1
  %101 = load i32, ptr %12, align 4, !tbaa !9
  %102 = sub nsw i32 %101, 2
  %103 = load i32, ptr %13, align 4, !tbaa !9
  %104 = sub nsw i32 %103, 2
  %105 = load i32, ptr %15, align 4, !tbaa !9
  call void @TCOD_console_rect(ptr noundef %96, i32 noundef %98, i32 noundef %100, i32 noundef %102, i32 noundef %104, i1 noundef zeroext true, i32 noundef %105)
  br label %106

106:                                              ; preds = %95, %75
  br label %107

107:                                              ; preds = %106, %27
  %108 = load ptr, ptr %16, align 8, !tbaa !5
  %109 = icmp ne ptr %108, null
  br i1 %109, label %110, label %150

110:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %111 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %17, i64 0, i64 0
  call void @llvm.va_start.p0(ptr %111)
  %112 = load ptr, ptr %16, align 8, !tbaa !5
  %113 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %17, i64 0, i64 0
  %114 = call ptr @TCOD_console_vsprint(ptr noundef %112, ptr noundef %113)
  store ptr %114, ptr %19, align 8, !tbaa !5
  %115 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %17, i64 0, i64 0
  call void @llvm.va_end.p0(ptr %115)
  %116 = load ptr, ptr %19, align 8, !tbaa !5
  %117 = load i32, ptr %12, align 4, !tbaa !9
  %118 = sub nsw i32 %117, 3
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds i8, ptr %116, i64 %119
  store i8 0, ptr %120, align 1, !tbaa !15
  %121 = load i32, ptr %10, align 4, !tbaa !9
  %122 = load i32, ptr %12, align 4, !tbaa !9
  %123 = load ptr, ptr %19, align 8, !tbaa !5
  %124 = call i64 @strlen(ptr noundef %123) #8
  %125 = trunc i64 %124 to i32
  %126 = sub nsw i32 %122, %125
  %127 = sub nsw i32 %126, 2
  %128 = sdiv i32 %127, 2
  %129 = add nsw i32 %121, %128
  store i32 %129, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 3, ptr %20) #7
  %130 = load ptr, ptr %9, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.TCOD_Console, ptr %130, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %20, ptr align 8 %131, i64 3, i1 false), !tbaa.struct !16
  %132 = load ptr, ptr %9, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.TCOD_Console, ptr %132, i32 0, i32 5
  %134 = load ptr, ptr %9, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.TCOD_Console, ptr %134, i32 0, i32 6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %133, ptr align 1 %135, i64 3, i1 false), !tbaa.struct !16
  %136 = load ptr, ptr %9, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.TCOD_Console, ptr %136, i32 0, i32 6
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %137, ptr align 1 %20, i64 3, i1 false), !tbaa.struct !16
  %138 = load ptr, ptr %9, align 8, !tbaa !5
  %139 = load i32, ptr %18, align 4, !tbaa !9
  %140 = load i32, ptr %11, align 4, !tbaa !9
  %141 = load ptr, ptr %19, align 8, !tbaa !5
  call void (ptr, i32, i32, i32, i32, ptr, ...) @TCOD_console_print_ex(ptr noundef %138, i32 noundef %139, i32 noundef %140, i32 noundef 1, i32 noundef 0, ptr noundef @.str.2, ptr noundef %141)
  %142 = load ptr, ptr %9, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.TCOD_Console, ptr %142, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %20, ptr align 8 %143, i64 3, i1 false), !tbaa.struct !16
  %144 = load ptr, ptr %9, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.TCOD_Console, ptr %144, i32 0, i32 5
  %146 = load ptr, ptr %9, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.TCOD_Console, ptr %146, i32 0, i32 6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %145, ptr align 1 %147, i64 3, i1 false), !tbaa.struct !16
  %148 = load ptr, ptr %9, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.TCOD_Console, ptr %148, i32 0, i32 6
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %149, ptr align 1 %20, i64 3, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 3, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #7
  br label %150

150:                                              ; preds = %110, %107, %26
  ret void
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @TCOD_console_validate_(ptr noundef) #4

declare void @TCOD_console_put_char(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #5

declare void @TCOD_console_hline(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #5

declare void @TCOD_console_vline(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #5

declare void @TCOD_console_rect(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i1 noundef zeroext, i32 noundef) #5

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #6

; Function Attrs: nounwind uwtable
declare dso_local void @TCOD_console_print_ex(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ...) #1

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nosync nounwind willreturn }
attributes #4 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "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 willreturn memory(read) "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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }

!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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!7, !7, i64 0}
!16 = !{i64 0, i64 1, !15, i64 1, i64 1, !15, i64 2, i64 1, !15}


; 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.TCOD_ColorRGB = type { i8, i8, i8 }

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @TCOD_console_vsprint(ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @TCOD_console_print_frame(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i1 noundef zeroext %5, i32 noundef %6, ptr noundef %7, ...) local_unnamed_addr #1 {
  %9 = alloca [1 x %struct.__va_list_tag], align 16
  %10 = alloca %struct.TCOD_ColorRGB, align 1
  %11 = tail call ptr @TCOD_console_validate_(ptr noundef %0)
  %.not = icmp eq ptr %11, null
  br i1 %.not, label %37, label %12

12:                                               ; preds = %8
  tail call void @TCOD_console_put_char(ptr noundef nonnull %11, i32 noundef %1, i32 noundef %2, i32 noundef 9484, i32 noundef %6) #7
  %13 = add i32 %1, -1
  %14 = add i32 %13, %3
  tail call void @TCOD_console_put_char(ptr noundef nonnull %11, i32 noundef %14, i32 noundef %2, i32 noundef 9488, i32 noundef %6) #7
  %15 = add i32 %2, -1
  %16 = add i32 %15, %4
  tail call void @TCOD_console_put_char(ptr noundef nonnull %11, i32 noundef %1, i32 noundef %16, i32 noundef 9492, i32 noundef %6) #7
  tail call void @TCOD_console_put_char(ptr noundef nonnull %11, i32 noundef %14, i32 noundef %16, i32 noundef 9496, i32 noundef %6) #7
  %17 = add nsw i32 %1, 1
  %18 = add i32 %3, -2
  tail call void @TCOD_console_hline(ptr noundef nonnull %11, i32 noundef %17, i32 noundef %2, i32 noundef %18, i32 noundef %6) #7
  tail call void @TCOD_console_hline(ptr noundef nonnull %11, i32 noundef %17, i32 noundef %16, i32 noundef %18, i32 noundef %6) #7
  %19 = icmp sgt i32 %4, 2
  br i1 %19, label %20, label %24

20:                                               ; preds = %12
  %21 = add nsw i32 %2, 1
  %22 = add nsw i32 %4, -2
  tail call void @TCOD_console_vline(ptr noundef nonnull %11, i32 noundef %1, i32 noundef %21, i32 noundef %22, i32 noundef %6) #7
  tail call void @TCOD_console_vline(ptr noundef nonnull %11, i32 noundef %14, i32 noundef %21, i32 noundef %22, i32 noundef %6) #7
  br i1 %5, label %23, label %24

23:                                               ; preds = %20
  tail call void @TCOD_console_rect(ptr noundef nonnull %11, i32 noundef %17, i32 noundef %21, i32 noundef %18, i32 noundef %22, i1 noundef zeroext true, i32 noundef %6) #7
  br label %24

24:                                               ; preds = %20, %23, %12
  %.not72 = icmp eq ptr %7, null
  br i1 %.not72, label %37, label %25

25:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #7
  call void @llvm.va_start.p0(ptr nonnull %9)
  %26 = call ptr @TCOD_console_vsprint(ptr noundef nonnull %7, ptr noundef nonnull %9)
  call void @llvm.va_end.p0(ptr nonnull %9)
  %27 = sext i32 %3 to i64
  %28 = getelementptr i8, ptr %26, i64 %27
  %29 = getelementptr i8, ptr %28, i64 -3
  store i8 0, ptr %29, align 1, !tbaa !5
  %30 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %26) #8
  %31 = trunc i64 %30 to i32
  %32 = sub i32 %18, %31
  %33 = sdiv i32 %32, 2
  %34 = add nsw i32 %33, %1
  call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %10)
  %35 = getelementptr inbounds i8, ptr %11, i64 24
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %10, ptr noundef nonnull align 8 dereferenceable(3) %35, i64 3, i1 false), !tbaa.struct !8
  %36 = getelementptr inbounds i8, ptr %11, i64 27
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(3) %35, ptr noundef nonnull align 1 dereferenceable(3) %36, i64 3, i1 false), !tbaa.struct !8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %36, ptr noundef nonnull align 1 dereferenceable(3) %10, i64 3, i1 false), !tbaa.struct !8
  call void (ptr, i32, i32, i32, i32, ptr, ...) @TCOD_console_print_ex(ptr noundef nonnull %11, i32 noundef %34, i32 noundef %2, i32 noundef 1, i32 noundef 0, ptr noundef nonnull @.str.2, ptr noundef %26)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %10, ptr noundef nonnull align 8 dereferenceable(3) %35, i64 3, i1 false), !tbaa.struct !8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(3) %35, ptr noundef nonnull align 1 dereferenceable(3) %36, i64 3, i1 false), !tbaa.struct !8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %36, ptr noundef nonnull align 1 dereferenceable(3) %10, i64 3, i1 false), !tbaa.struct !8
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %10)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #7
  br label %37

37:                                               ; preds = %8, %25, %24
  ret void
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @TCOD_console_validate_(ptr noundef) local_unnamed_addr #4

declare void @TCOD_console_put_char(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #5

declare void @TCOD_console_hline(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #5

declare void @TCOD_console_vline(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #5

declare void @TCOD_console_rect(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i1 noundef zeroext, i32 noundef) local_unnamed_addr #5

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #6

; Function Attrs: nounwind uwtable
declare dso_local void @TCOD_console_print_ex(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{i64 0, i64 1, !5, i64 1, i64 1, !5, i64 2, i64 1, !5}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass