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

; 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 = 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: inlinehint nounwind uwtable
declare hidden ptr @TCOD_console_validate_(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: nounwind uwtable
declare dso_local void @TCOD_console_double_hline(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #3

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

; Function Attrs: nounwind uwtable
declare dso_local void @TCOD_console_double_vline(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #3

; Function Attrs: nounwind uwtable
define dso_local void @TCOD_console_print_double_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, ...) #3 {
  %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 ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca [1 x %struct.__va_list_tag], align 16
  %20 = alloca i32, align 4
  %21 = alloca %struct.TCOD_ColorRGB, align 1
  %22 = alloca ptr, align 8
  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
  %23 = zext i1 %5 to i8
  store i8 %23, ptr %14, align 1, !tbaa !11
  store i32 %6, ptr %15, align 4, !tbaa !9
  store ptr %7, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %24 = load ptr, ptr %9, align 8, !tbaa !5
  %25 = call ptr @TCOD_console_validate_(ptr noundef %24)
  store ptr %25, ptr %17, align 8, !tbaa !5
  %26 = load ptr, ptr %17, align 8, !tbaa !5
  %27 = icmp ne ptr %26, null
  br i1 %27, label %29, label %28

28:                                               ; preds = %8
  store i32 1, ptr %18, align 4
  br label %170

29:                                               ; preds = %8
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = load i32, ptr %10, align 4, !tbaa !9
  %32 = load i32, ptr %11, align 4, !tbaa !9
  %33 = load i32, ptr %15, align 4, !tbaa !9
  call void @TCOD_console_put_char(ptr noundef %30, i32 noundef %31, i32 noundef %32, i32 noundef 9556, i32 noundef %33)
  %34 = load ptr, ptr %9, align 8, !tbaa !5
  %35 = load i32, ptr %10, align 4, !tbaa !9
  %36 = load i32, ptr %12, align 4, !tbaa !9
  %37 = add nsw i32 %35, %36
  %38 = sub nsw i32 %37, 1
  %39 = load i32, ptr %11, align 4, !tbaa !9
  %40 = load i32, ptr %15, align 4, !tbaa !9
  call void @TCOD_console_put_char(ptr noundef %34, i32 noundef %38, i32 noundef %39, i32 noundef 9559, i32 noundef %40)
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  %42 = load i32, ptr %10, align 4, !tbaa !9
  %43 = load i32, ptr %11, align 4, !tbaa !9
  %44 = load i32, ptr %13, align 4, !tbaa !9
  %45 = add nsw i32 %43, %44
  %46 = sub nsw i32 %45, 1
  %47 = load i32, ptr %15, align 4, !tbaa !9
  call void @TCOD_console_put_char(ptr noundef %41, i32 noundef %42, i32 noundef %46, i32 noundef 9562, i32 noundef %47)
  %48 = load ptr, ptr %9, align 8, !tbaa !5
  %49 = load i32, ptr %10, align 4, !tbaa !9
  %50 = load i32, ptr %12, align 4, !tbaa !9
  %51 = add nsw i32 %49, %50
  %52 = sub nsw i32 %51, 1
  %53 = load i32, ptr %11, align 4, !tbaa !9
  %54 = load i32, ptr %13, align 4, !tbaa !9
  %55 = add nsw i32 %53, %54
  %56 = sub nsw i32 %55, 1
  %57 = load i32, ptr %15, align 4, !tbaa !9
  call void @TCOD_console_put_char(ptr noundef %48, i32 noundef %52, i32 noundef %56, i32 noundef 9565, i32 noundef %57)
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = load i32, ptr %10, align 4, !tbaa !9
  %60 = add nsw i32 %59, 1
  %61 = load i32, ptr %11, align 4, !tbaa !9
  %62 = load i32, ptr %12, align 4, !tbaa !9
  %63 = sub nsw i32 %62, 2
  %64 = load i32, ptr %15, align 4, !tbaa !9
  call void @TCOD_console_double_hline(ptr noundef %58, i32 noundef %60, i32 noundef %61, i32 noundef %63, i32 noundef %64)
  %65 = load ptr, ptr %9, align 8, !tbaa !5
  %66 = load i32, ptr %10, align 4, !tbaa !9
  %67 = add nsw i32 %66, 1
  %68 = load i32, ptr %11, align 4, !tbaa !9
  %69 = load i32, ptr %13, align 4, !tbaa !9
  %70 = add nsw i32 %68, %69
  %71 = sub nsw i32 %70, 1
  %72 = load i32, ptr %12, align 4, !tbaa !9
  %73 = sub nsw i32 %72, 2
  %74 = load i32, ptr %15, align 4, !tbaa !9
  call void @TCOD_console_double_hline(ptr noundef %65, i32 noundef %67, i32 noundef %71, i32 noundef %73, i32 noundef %74)
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  %76 = load i32, ptr %10, align 4, !tbaa !9
  %77 = load i32, ptr %11, align 4, !tbaa !9
  %78 = add nsw i32 %77, 1
  %79 = load i32, ptr %13, align 4, !tbaa !9
  %80 = sub nsw i32 %79, 2
  %81 = load i32, ptr %15, align 4, !tbaa !9
  call void @TCOD_console_double_vline(ptr noundef %75, i32 noundef %76, i32 noundef %78, i32 noundef %80, i32 noundef %81)
  %82 = load ptr, ptr %9, align 8, !tbaa !5
  %83 = load i32, ptr %10, align 4, !tbaa !9
  %84 = load i32, ptr %12, align 4, !tbaa !9
  %85 = add nsw i32 %83, %84
  %86 = sub nsw i32 %85, 1
  %87 = load i32, ptr %11, align 4, !tbaa !9
  %88 = add nsw i32 %87, 1
  %89 = load i32, ptr %13, align 4, !tbaa !9
  %90 = sub nsw i32 %89, 2
  %91 = load i32, ptr %15, align 4, !tbaa !9
  call void @TCOD_console_double_vline(ptr noundef %82, i32 noundef %86, i32 noundef %88, i32 noundef %90, i32 noundef %91)
  %92 = load i32, ptr %13, align 4, !tbaa !9
  %93 = icmp sgt i32 %92, 2
  br i1 %93, label %94, label %126

94:                                               ; preds = %29
  %95 = load ptr, ptr %9, align 8, !tbaa !5
  %96 = load i32, ptr %10, align 4, !tbaa !9
  %97 = load i32, ptr %11, align 4, !tbaa !9
  %98 = add nsw i32 %97, 1
  %99 = load i32, ptr %13, align 4, !tbaa !9
  %100 = sub nsw i32 %99, 2
  %101 = load i32, ptr %15, align 4, !tbaa !9
  call void @TCOD_console_vline(ptr noundef %95, i32 noundef %96, i32 noundef %98, i32 noundef %100, i32 noundef %101)
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = load i32, ptr %10, align 4, !tbaa !9
  %104 = load i32, ptr %12, align 4, !tbaa !9
  %105 = add nsw i32 %103, %104
  %106 = sub nsw i32 %105, 1
  %107 = load i32, ptr %11, align 4, !tbaa !9
  %108 = add nsw i32 %107, 1
  %109 = load i32, ptr %13, align 4, !tbaa !9
  %110 = sub nsw i32 %109, 2
  %111 = load i32, ptr %15, align 4, !tbaa !9
  call void @TCOD_console_vline(ptr noundef %102, i32 noundef %106, i32 noundef %108, i32 noundef %110, i32 noundef %111)
  %112 = load i8, ptr %14, align 1, !tbaa !11, !range !13, !noundef !14
  %113 = trunc i8 %112 to i1
  br i1 %113, label %114, label %125

114:                                              ; preds = %94
  %115 = load ptr, ptr %9, align 8, !tbaa !5
  %116 = load i32, ptr %10, align 4, !tbaa !9
  %117 = add nsw i32 %116, 1
  %118 = load i32, ptr %11, align 4, !tbaa !9
  %119 = add nsw i32 %118, 1
  %120 = load i32, ptr %12, align 4, !tbaa !9
  %121 = sub nsw i32 %120, 2
  %122 = load i32, ptr %13, align 4, !tbaa !9
  %123 = sub nsw i32 %122, 2
  %124 = load i32, ptr %15, align 4, !tbaa !9
  call void @TCOD_console_rect(ptr noundef %115, i32 noundef %117, i32 noundef %119, i32 noundef %121, i32 noundef %123, i1 noundef zeroext true, i32 noundef %124)
  br label %125

125:                                              ; preds = %114, %94
  br label %126

126:                                              ; preds = %125, %29
  %127 = load ptr, ptr %16, align 8, !tbaa !5
  %128 = icmp ne ptr %127, null
  br i1 %128, label %129, label %169

129:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 3, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %130 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %19, i64 0, i64 0
  call void @llvm.va_start.p0(ptr %130)
  %131 = load ptr, ptr %16, align 8, !tbaa !5
  %132 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %19, i64 0, i64 0
  %133 = call ptr @TCOD_console_vsprint(ptr noundef %131, ptr noundef %132)
  store ptr %133, ptr %22, align 8, !tbaa !5
  %134 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %19, i64 0, i64 0
  call void @llvm.va_end.p0(ptr %134)
  %135 = load ptr, ptr %22, align 8, !tbaa !5
  %136 = load i32, ptr %12, align 4, !tbaa !9
  %137 = sub nsw i32 %136, 3
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds i8, ptr %135, i64 %138
  store i8 0, ptr %139, align 1, !tbaa !15
  %140 = load i32, ptr %10, align 4, !tbaa !9
  %141 = load i32, ptr %12, align 4, !tbaa !9
  %142 = load ptr, ptr %22, align 8, !tbaa !5
  %143 = call i64 @strlen(ptr noundef %142) #8
  %144 = trunc i64 %143 to i32
  %145 = sub nsw i32 %141, %144
  %146 = sub nsw i32 %145, 2
  %147 = sdiv i32 %146, 2
  %148 = add nsw i32 %140, %147
  store i32 %148, ptr %20, align 4, !tbaa !9
  %149 = load ptr, ptr %17, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.TCOD_Console, ptr %149, i32 0, i32 6
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %21, ptr align 1 %150, i64 3, i1 false), !tbaa.struct !16
  %151 = load ptr, ptr %17, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.TCOD_Console, ptr %151, i32 0, i32 6
  %153 = load ptr, ptr %17, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.TCOD_Console, ptr %153, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %152, ptr align 8 %154, i64 3, i1 false), !tbaa.struct !16
  %155 = load ptr, ptr %17, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.TCOD_Console, ptr %155, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %156, ptr align 1 %21, i64 3, i1 false), !tbaa.struct !16
  %157 = load ptr, ptr %9, align 8, !tbaa !5
  %158 = load i32, ptr %20, align 4, !tbaa !9
  %159 = load i32, ptr %11, align 4, !tbaa !9
  %160 = load ptr, ptr %22, align 8, !tbaa !5
  call void (ptr, i32, i32, i32, i32, ptr, ...) @TCOD_console_print_ex(ptr noundef %157, i32 noundef %158, i32 noundef %159, i32 noundef 1, i32 noundef 0, ptr noundef @.str, ptr noundef %160)
  %161 = load ptr, ptr %17, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.TCOD_Console, ptr %161, i32 0, i32 6
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %21, ptr align 1 %162, i64 3, i1 false), !tbaa.struct !16
  %163 = load ptr, ptr %17, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.TCOD_Console, ptr %163, i32 0, i32 6
  %165 = load ptr, ptr %17, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.TCOD_Console, ptr %165, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %164, ptr align 8 %166, i64 3, i1 false), !tbaa.struct !16
  %167 = load ptr, ptr %17, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.TCOD_Console, ptr %167, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %168, ptr align 1 %21, i64 3, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 3, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #7
  br label %169

169:                                              ; preds = %129, %126
  store i32 0, ptr %18, align 4
  br label %170

170:                                              ; preds = %169, %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  %171 = load i32, ptr %18, align 4
  switch i32 %171, label %173 [
    i32 0, label %172
    i32 1, label %172
  ]

172:                                              ; preds = %170, %170
  ret void

173:                                              ; preds = %170
  unreachable
}

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

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

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

declare ptr @TCOD_console_vsprint(ptr noundef, ptr noundef) #4

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

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

declare void @TCOD_console_print_ex(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ...) #4

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { "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 = { nocallback nofree nosync nounwind willreturn }
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 = 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: inlinehint nounwind uwtable
declare hidden ptr @TCOD_console_validate_(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: nounwind uwtable
declare dso_local void @TCOD_console_double_hline(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

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

; Function Attrs: nounwind uwtable
declare dso_local void @TCOD_console_double_vline(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local void @TCOD_console_print_double_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 #3 {
  %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 %0, i32 noundef %1, i32 noundef %2, i32 noundef 9556, i32 noundef %6) #7
  %13 = add i32 %1, -1
  %14 = add i32 %13, %3
  tail call void @TCOD_console_put_char(ptr noundef %0, i32 noundef %14, i32 noundef %2, i32 noundef 9559, i32 noundef %6) #7
  %15 = add i32 %2, -1
  %16 = add i32 %15, %4
  tail call void @TCOD_console_put_char(ptr noundef %0, i32 noundef %1, i32 noundef %16, i32 noundef 9562, i32 noundef %6) #7
  tail call void @TCOD_console_put_char(ptr noundef %0, i32 noundef %14, i32 noundef %16, i32 noundef 9565, i32 noundef %6) #7
  %17 = add nsw i32 %1, 1
  %18 = add i32 %3, -2
  tail call void @TCOD_console_double_hline(ptr noundef %0, i32 noundef %17, i32 noundef %2, i32 noundef %18, i32 noundef %6)
  tail call void @TCOD_console_double_hline(ptr noundef %0, i32 noundef %17, i32 noundef %16, i32 noundef %18, i32 noundef %6)
  %19 = add nsw i32 %2, 1
  %20 = add nsw i32 %4, -2
  tail call void @TCOD_console_double_vline(ptr noundef %0, i32 noundef %1, i32 noundef %19, i32 noundef %20, i32 noundef %6)
  tail call void @TCOD_console_double_vline(ptr noundef %0, i32 noundef %14, i32 noundef %19, i32 noundef %20, i32 noundef %6)
  %21 = icmp sgt i32 %4, 2
  br i1 %21, label %22, label %24

22:                                               ; preds = %12
  tail call void @TCOD_console_vline(ptr noundef %0, i32 noundef %1, i32 noundef %19, i32 noundef %20, i32 noundef %6) #7
  tail call void @TCOD_console_vline(ptr noundef %0, i32 noundef %14, i32 noundef %19, i32 noundef %20, i32 noundef %6) #7
  br i1 %5, label %23, label %24

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

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

25:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %10)
  call void @llvm.va_start.p0(ptr nonnull %9)
  %26 = call ptr @TCOD_console_vsprint(ptr noundef nonnull %7, ptr noundef nonnull %9) #7
  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
  %35 = getelementptr inbounds i8, ptr %11, i64 27
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %10, ptr noundef nonnull align 1 dereferenceable(3) %35, i64 3, i1 false), !tbaa.struct !8
  %36 = getelementptr inbounds i8, ptr %11, i64 24
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %35, ptr noundef nonnull align 8 dereferenceable(3) %36, i64 3, i1 false), !tbaa.struct !8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 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 %0, i32 noundef %34, i32 noundef %2, i32 noundef 1, i32 noundef 0, ptr noundef nonnull @.str, ptr noundef %26) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %10, ptr noundef nonnull align 1 dereferenceable(3) %35, i64 3, i1 false), !tbaa.struct !8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %35, ptr noundef nonnull align 8 dereferenceable(3) %36, i64 3, i1 false), !tbaa.struct !8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 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 = %24, %25, %8
  ret void
}

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

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

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

declare ptr @TCOD_console_vsprint(ptr noundef, ptr noundef) local_unnamed_addr #4

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

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

declare void @TCOD_console_print_ex(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { "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 = { mustprogress nocallback nofree nosync nounwind willreturn }
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,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass