; LLVM IR from ARM-software/Arm-2D :: Helper/Source (console_box)

; 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.arm_2d_margin_t = type { i8, i8, i8, i8 }
%struct.arm_2d_tile_t = type { %union.anon.3, %union.anon.14, %union.anon.15 }
%union.anon.3 = type { %struct.anon.4 }
%struct.anon.4 = type { i8, %union.arm_2d_color_info_t, %union.anon.7 }
%union.arm_2d_color_info_t = type { %struct.anon.5 }
%struct.anon.5 = type { i8 }
%union.anon.7 = type { i16 }
%union.anon.14 = type { %struct.arm_2d_region_t }
%struct.arm_2d_region_t = type { %union.anon, %union.anon.1 }
%union.anon = type { %struct.arm_2d_location_t }
%struct.arm_2d_location_t = type { i16, i16 }
%union.anon.1 = type { %struct.arm_2d_size_t }
%struct.arm_2d_size_t = type { i16, i16 }
%union.anon.15 = type { ptr }
%struct.console_box_t = type { %struct.anon }
%struct.anon = type { ptr, %struct.arm_2d_size_t, [4 x i8], %struct.arm_2d_byte_fifo_t, %struct.arm_2d_byte_fifo_t, %struct.anon.0, ptr, %struct.arm_2d_region_t, %struct.arm_2d_region_list_item_t, ptr, i16, i8 }
%struct.arm_2d_byte_fifo_t = type { [24 x i8] }
%struct.anon.0 = type { i16, i16, i16, i16, i16, i16, i16, i16, i16 }
%struct.arm_2d_region_list_item_t = type { ptr, [8 x i8], %struct.arm_2d_region_t, [4 x i8] }
%struct.arm_2d_font_t = type { %struct.arm_2d_tile_t, %struct.arm_2d_size_t, i32, ptr, ptr }

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [81 x i8], align 1
@__PRETTY_FUNCTION__.console_box_show = external hidden unnamed_addr constant [103 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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) #2

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

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

; Function Attrs: nounwind uwtable
define dso_local void @console_box_show(ptr noundef nonnull %0, ptr noundef %1, ptr noundef %2, i1 noundef zeroext %3, i8 noundef zeroext %4) #4 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca i8, align 1
  %11 = alloca %struct.arm_2d_margin_t, align 1
  %12 = alloca ptr, align 8
  %13 = alloca %struct.arm_2d_margin_t, align 1
  %14 = alloca i32, align 4
  %15 = alloca %struct.arm_2d_tile_t, align 8
  %16 = alloca ptr, align 8
  %17 = alloca %struct.arm_2d_region_t, align 2
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca %struct.arm_2d_region_t, align 2
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca %struct.arm_2d_region_t, align 2
  %25 = alloca ptr, align 8
  %26 = alloca %struct.arm_2d_region_t, align 2
  %27 = alloca ptr, align 8
  %28 = alloca %struct.arm_2d_size_t, align 2
  %29 = alloca i16, align 2
  %30 = alloca %struct.arm_2d_size_t, align 2
  %31 = alloca i64, align 8
  %32 = alloca i8, align 1
  %33 = alloca i16, align 2
  %34 = alloca i8, align 1
  %35 = alloca ptr, align 8
  %36 = alloca i32, align 4
  %37 = alloca i8, align 1
  %38 = alloca i8, align 1
  %39 = alloca i8, align 1
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  %40 = zext i1 %3 to i8
  store i8 %40, ptr %9, align 1, !tbaa !9
  store i8 %4, ptr %10, align 1, !tbaa !11
  %41 = load i8, ptr %9, align 1, !tbaa !9, !range !12, !noundef !13
  %42 = trunc i8 %41 to i1
  %43 = load i8, ptr %10, align 1, !tbaa !11
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = icmp ne ptr null, %44
  br i1 %45, label %46, label %47

46:                                               ; preds = %5
  br label %48

47:                                               ; preds = %5
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 559, ptr noundef @__PRETTY_FUNCTION__.console_box_show) #7
  unreachable

48:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  store ptr null, ptr %12, align 8, !tbaa !5
  br label %49

49:                                               ; preds = %552, %48
  %50 = load ptr, ptr %12, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %50, i32 1
  store ptr %51, ptr %12, align 8, !tbaa !5
  %52 = icmp eq ptr %50, null
  br i1 %52, label %53, label %58

53:                                               ; preds = %49
  %54 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %13, i32 0, i32 0
  store i8 0, ptr %54, align 1, !tbaa !14
  %55 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %13, i32 0, i32 1
  store i8 0, ptr %55, align 1, !tbaa !16
  %56 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %13, i32 0, i32 2
  store i8 0, ptr %56, align 1, !tbaa !17
  %57 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %13, i32 0, i32 3
  store i8 0, ptr %57, align 1, !tbaa !18
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %11, ptr align 1 %13, i64 4, i1 false), !tbaa.struct !19
  br label %59

58:                                               ; preds = %49
  br label %59

59:                                               ; preds = %58, %53
  %60 = phi i32 [ 1, %53 ], [ 0, %58 ]
  %61 = icmp ne i32 %60, 0
  br i1 %61, label %63, label %62

62:                                               ; preds = %59
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %553

63:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #8
  call void @llvm.memset.p0.i64(ptr align 8 %15, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  store ptr null, ptr %16, align 8, !tbaa !5
  br label %64

64:                                               ; preds = %550, %63
  %65 = load ptr, ptr %16, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %65, i32 1
  store ptr %66, ptr %16, align 8, !tbaa !5
  %67 = icmp eq ptr %65, null
  br i1 %67, label %68, label %139

68:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  call void @llvm.memset.p0.i64(ptr align 2 %17, i8 0, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %69, ptr %18, align 8, !tbaa !5
  %70 = load ptr, ptr %18, align 8, !tbaa !5
  %71 = icmp eq ptr null, %70
  br i1 %71, label %72, label %78

72:                                               ; preds = %68
  %73 = call ptr @arm_2d_get_default_frame_buffer()
  store ptr %73, ptr %18, align 8, !tbaa !5
  %74 = load ptr, ptr %18, align 8, !tbaa !5
  %75 = icmp eq ptr null, %74
  br i1 %75, label %76, label %77

76:                                               ; preds = %72
  store i32 4, ptr %14, align 4
  br label %135

77:                                               ; preds = %72
  br label %78

78:                                               ; preds = %77, %68
  %79 = load ptr, ptr %8, align 8, !tbaa !5
  %80 = icmp eq ptr null, %79
  br i1 %80, label %81, label %86

81:                                               ; preds = %78
  %82 = getelementptr inbounds %struct.arm_2d_region_t, ptr %17, i32 0, i32 1
  %83 = load ptr, ptr %18, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %83, i32 0, i32 1
  %85 = getelementptr inbounds %struct.arm_2d_region_t, ptr %84, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %82, ptr align 4 %85, i64 4, i1 false), !tbaa.struct !20
  br label %88

86:                                               ; preds = %78
  %87 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %17, ptr align 2 %87, i64 8, i1 false), !tbaa.struct !23
  br label %88

88:                                               ; preds = %86, %81
  %89 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %11, i32 0, i32 0
  %90 = load i8, ptr %89, align 1, !tbaa !14
  %91 = zext i8 %90 to i32
  %92 = getelementptr inbounds %struct.arm_2d_region_t, ptr %17, i32 0, i32 0
  %93 = getelementptr inbounds %struct.arm_2d_location_t, ptr %92, i32 0, i32 0
  %94 = load i16, ptr %93, align 2, !tbaa !11
  %95 = sext i16 %94 to i32
  %96 = add nsw i32 %95, %91
  %97 = trunc i32 %96 to i16
  store i16 %97, ptr %93, align 2, !tbaa !11
  %98 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %11, i32 0, i32 2
  %99 = load i8, ptr %98, align 1, !tbaa !17
  %100 = zext i8 %99 to i32
  %101 = getelementptr inbounds %struct.arm_2d_region_t, ptr %17, i32 0, i32 0
  %102 = getelementptr inbounds %struct.arm_2d_location_t, ptr %101, i32 0, i32 1
  %103 = load i16, ptr %102, align 2, !tbaa !11
  %104 = sext i16 %103 to i32
  %105 = add nsw i32 %104, %100
  %106 = trunc i32 %105 to i16
  store i16 %106, ptr %102, align 2, !tbaa !11
  %107 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %11, i32 0, i32 0
  %108 = load i8, ptr %107, align 1, !tbaa !14
  %109 = zext i8 %108 to i32
  %110 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %11, i32 0, i32 1
  %111 = load i8, ptr %110, align 1, !tbaa !16
  %112 = zext i8 %111 to i32
  %113 = add nsw i32 %109, %112
  %114 = getelementptr inbounds %struct.arm_2d_region_t, ptr %17, i32 0, i32 1
  %115 = getelementptr inbounds %struct.arm_2d_size_t, ptr %114, i32 0, i32 0
  %116 = load i16, ptr %115, align 2, !tbaa !11
  %117 = sext i16 %116 to i32
  %118 = sub nsw i32 %117, %113
  %119 = trunc i32 %118 to i16
  store i16 %119, ptr %115, align 2, !tbaa !11
  %120 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %11, i32 0, i32 2
  %121 = load i8, ptr %120, align 1, !tbaa !17
  %122 = zext i8 %121 to i32
  %123 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %11, i32 0, i32 3
  %124 = load i8, ptr %123, align 1, !tbaa !18
  %125 = zext i8 %124 to i32
  %126 = add nsw i32 %122, %125
  %127 = getelementptr inbounds %struct.arm_2d_region_t, ptr %17, i32 0, i32 1
  %128 = getelementptr inbounds %struct.arm_2d_size_t, ptr %127, i32 0, i32 1
  %129 = load i16, ptr %128, align 2, !tbaa !11
  %130 = sext i16 %129 to i32
  %131 = sub nsw i32 %130, %126
  %132 = trunc i32 %131 to i16
  store i16 %132, ptr %128, align 2, !tbaa !11
  %133 = load ptr, ptr %18, align 8, !tbaa !5
  %134 = call ptr @arm_2d_tile_generate_child(ptr noundef %133, ptr noundef %17, ptr noundef %15, i1 noundef zeroext false)
  store ptr %134, ptr %19, align 8, !tbaa !5
  store i32 0, ptr %14, align 4
  br label %135

135:                                              ; preds = %88, %76
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  %136 = load i32, ptr %14, align 4
  switch i32 %136, label %551 [
    i32 0, label %137
  ]

137:                                              ; preds = %135
  %138 = load ptr, ptr %19, align 8, !tbaa !5
  br label %140

139:                                              ; preds = %64
  br label %140

140:                                              ; preds = %139, %137
  %141 = phi i32 [ 1, %137 ], [ 0, %139 ]
  %142 = icmp ne i32 %141, 0
  br i1 %142, label %144, label %143

143:                                              ; preds = %140
  store i32 4, ptr %14, align 4
  br label %551

144:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  call void @llvm.memset.p0.i64(ptr align 2 %20, i8 0, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  store ptr null, ptr %21, align 8, !tbaa !5
  br label %145

145:                                              ; preds = %544, %144
  %146 = load ptr, ptr %21, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.arm_2d_region_t, ptr %146, i32 1
  store ptr %147, ptr %21, align 8, !tbaa !5
  %148 = icmp eq ptr %146, null
  br i1 %148, label %149, label %153

149:                                              ; preds = %145
  %150 = getelementptr inbounds %struct.arm_2d_region_t, ptr %20, i32 0, i32 1
  %151 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %15, i32 0, i32 1
  %152 = getelementptr inbounds %struct.arm_2d_region_t, ptr %151, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %150, ptr align 4 %152, i64 4, i1 false), !tbaa.struct !20
  br label %154

153:                                              ; preds = %145
  br label %154

154:                                              ; preds = %153, %149
  %155 = phi i32 [ 1, %149 ], [ 0, %153 ]
  %156 = icmp ne i32 %155, 0
  br i1 %156, label %158, label %157

157:                                              ; preds = %154
  store i32 7, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  br label %549

158:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  store ptr %15, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  store ptr null, ptr %23, align 8, !tbaa !5
  br label %159

159:                                              ; preds = %541, %158
  %160 = load ptr, ptr %23, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %160, i32 1
  store ptr %161, ptr %23, align 8, !tbaa !5
  %162 = icmp eq ptr %160, null
  br i1 %162, label %164, label %163

163:                                              ; preds = %159
  store i32 10, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  br label %543

164:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %24, ptr align 2 %20, i64 8, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  store ptr null, ptr %25, align 8, !tbaa !5
  br label %165

165:                                              ; preds = %539, %164
  %166 = load ptr, ptr %25, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.arm_2d_region_t, ptr %166, i32 1
  store ptr %167, ptr %25, align 8, !tbaa !5
  %168 = icmp eq ptr %166, null
  br i1 %168, label %170, label %169

169:                                              ; preds = %165
  store i32 13, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  br label %540

170:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  store ptr null, ptr %27, align 8, !tbaa !5
  br label %171

171:                                              ; preds = %533, %170
  %172 = load ptr, ptr %27, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.arm_2d_region_t, ptr %172, i32 1
  store ptr %173, ptr %27, align 8, !tbaa !5
  %174 = icmp eq ptr %172, null
  br i1 %174, label %175, label %220

175:                                              ; preds = %171
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #8
  %176 = load ptr, ptr %6, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.console_box_t, ptr %176, i32 0, i32 0
  %178 = getelementptr inbounds %struct.anon, ptr %177, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %28, ptr align 8 %178, i64 4, i1 false), !tbaa.struct !20
  %179 = getelementptr inbounds %struct.arm_2d_size_t, ptr %28, i32 0, i32 0
  %180 = load i16, ptr %179, align 2, !tbaa !24
  %181 = getelementptr inbounds %struct.arm_2d_region_t, ptr %26, i32 0, i32 1
  %182 = getelementptr inbounds %struct.arm_2d_size_t, ptr %181, i32 0, i32 0
  store i16 %180, ptr %182, align 2, !tbaa !11
  %183 = getelementptr inbounds %struct.arm_2d_size_t, ptr %28, i32 0, i32 1
  %184 = load i16, ptr %183, align 2, !tbaa !26
  %185 = getelementptr inbounds %struct.arm_2d_region_t, ptr %26, i32 0, i32 1
  %186 = getelementptr inbounds %struct.arm_2d_size_t, ptr %185, i32 0, i32 1
  store i16 %184, ptr %186, align 2, !tbaa !11
  %187 = getelementptr inbounds %struct.arm_2d_region_t, ptr %26, i32 0, i32 0
  %188 = getelementptr inbounds %struct.arm_2d_region_t, ptr %24, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %187, ptr align 2 %188, i64 4, i1 false), !tbaa.struct !20
  %189 = getelementptr inbounds %struct.arm_2d_region_t, ptr %24, i32 0, i32 1
  %190 = getelementptr inbounds %struct.arm_2d_size_t, ptr %189, i32 0, i32 0
  %191 = load i16, ptr %190, align 2, !tbaa !11
  %192 = sext i16 %191 to i32
  %193 = getelementptr inbounds %struct.arm_2d_size_t, ptr %28, i32 0, i32 0
  %194 = load i16, ptr %193, align 2, !tbaa !24
  %195 = sext i16 %194 to i32
  %196 = sub nsw i32 %192, %195
  %197 = ashr i32 %196, 1
  %198 = getelementptr inbounds %struct.arm_2d_region_t, ptr %26, i32 0, i32 0
  %199 = getelementptr inbounds %struct.arm_2d_location_t, ptr %198, i32 0, i32 0
  %200 = load i16, ptr %199, align 2, !tbaa !11
  %201 = sext i16 %200 to i32
  %202 = add nsw i32 %201, %197
  %203 = trunc i32 %202 to i16
  store i16 %203, ptr %199, align 2, !tbaa !11
  %204 = getelementptr inbounds %struct.arm_2d_region_t, ptr %24, i32 0, i32 1
  %205 = getelementptr inbounds %struct.arm_2d_size_t, ptr %204, i32 0, i32 1
  %206 = load i16, ptr %205, align 2, !tbaa !11
  %207 = sext i16 %206 to i32
  %208 = getelementptr inbounds %struct.arm_2d_size_t, ptr %28, i32 0, i32 1
  %209 = load i16, ptr %208, align 2, !tbaa !26
  %210 = sext i16 %209 to i32
  %211 = sub nsw i32 %207, %210
  %212 = ashr i32 %211, 1
  %213 = getelementptr inbounds %struct.arm_2d_region_t, ptr %26, i32 0, i32 0
  %214 = getelementptr inbounds %struct.arm_2d_location_t, ptr %213, i32 0, i32 1
  %215 = load i16, ptr %214, align 2, !tbaa !11
  %216 = sext i16 %215 to i32
  %217 = add nsw i32 %216, %212
  %218 = trunc i32 %217 to i16
  store i16 %218, ptr %214, align 2, !tbaa !11
  store i16 %218, ptr %29, align 2, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #8
  %219 = load i16, ptr %29, align 2, !tbaa !21
  br label %221

220:                                              ; preds = %171
  br label %221

221:                                              ; preds = %220, %175
  %222 = phi i32 [ 1, %175 ], [ 0, %220 ]
  %223 = icmp ne i32 %222, 0
  br i1 %223, label %225, label %224

224:                                              ; preds = %221
  store i32 15, ptr %14, align 4
  br label %538

225:                                              ; preds = %221
  %226 = load ptr, ptr %6, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.console_box_t, ptr %226, i32 0, i32 0
  %228 = getelementptr inbounds %struct.anon, ptr %227, i32 0, i32 11
  %229 = load i8, ptr %228, align 2
  %230 = lshr i8 %229, 1
  %231 = and i8 %230, 1
  %232 = icmp ne i8 %231, 0
  br i1 %232, label %233, label %484

233:                                              ; preds = %225
  %234 = load ptr, ptr %6, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.console_box_t, ptr %234, i32 0, i32 0
  %236 = getelementptr inbounds %struct.anon, ptr %235, i32 0, i32 8
  %237 = call zeroext i8 @arm_2d_dynamic_dirty_region_wait_next(ptr noundef %236)
  %238 = zext i8 %237 to i32
  switch i32 %238, label %482 [
    i32 0, label %239
    i32 1, label %239
    i32 2, label %483
  ]

239:                                              ; preds = %233, %233
  %240 = load ptr, ptr %6, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.console_box_t, ptr %240, i32 0, i32 0
  %242 = getelementptr inbounds %struct.anon, ptr %241, i32 0, i32 11
  %243 = load i8, ptr %242, align 2
  %244 = lshr i8 %243, 4
  %245 = and i8 %244, 3
  %246 = zext i8 %245 to i32
  %247 = icmp ne i32 %246, 0
  br i1 %247, label %248, label %477

248:                                              ; preds = %239
  %249 = load ptr, ptr %6, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct.console_box_t, ptr %249, i32 0, i32 0
  %251 = getelementptr inbounds %struct.anon, ptr %250, i32 0, i32 11
  %252 = load i8, ptr %251, align 2
  %253 = lshr i8 %252, 4
  %254 = and i8 %253, 3
  %255 = zext i8 %254 to i32
  %256 = icmp eq i32 2, %255
  br i1 %256, label %257, label %290

257:                                              ; preds = %248
  %258 = getelementptr inbounds %struct.arm_2d_region_t, ptr %26, i32 0, i32 0
  %259 = getelementptr inbounds %struct.arm_2d_location_t, ptr %258, i32 0, i32 0
  %260 = load i16, ptr %259, align 2, !tbaa !11
  %261 = sext i16 %260 to i32
  %262 = load ptr, ptr %6, align 8, !tbaa !5
  %263 = getelementptr inbounds %struct.console_box_t, ptr %262, i32 0, i32 0
  %264 = getelementptr inbounds %struct.anon, ptr %263, i32 0, i32 7
  %265 = getelementptr inbounds %struct.arm_2d_region_t, ptr %264, i32 0, i32 0
  %266 = getelementptr inbounds %struct.arm_2d_location_t, ptr %265, i32 0, i32 0
  %267 = load i16, ptr %266, align 8, !tbaa !11
  %268 = sext i16 %267 to i32
  %269 = add nsw i32 %268, %261
  %270 = trunc i32 %269 to i16
  store i16 %270, ptr %266, align 8, !tbaa !11
  %271 = getelementptr inbounds %struct.arm_2d_region_t, ptr %26, i32 0, i32 0
  %272 = getelementptr inbounds %struct.arm_2d_location_t, ptr %271, i32 0, i32 1
  %273 = load i16, ptr %272, align 2, !tbaa !11
  %274 = sext i16 %273 to i32
  %275 = load ptr, ptr %6, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct.console_box_t, ptr %275, i32 0, i32 0
  %277 = getelementptr inbounds %struct.anon, ptr %276, i32 0, i32 7
  %278 = getelementptr inbounds %struct.arm_2d_region_t, ptr %277, i32 0, i32 0
  %279 = getelementptr inbounds %struct.arm_2d_location_t, ptr %278, i32 0, i32 1
  %280 = load i16, ptr %279, align 2, !tbaa !11
  %281 = sext i16 %280 to i32
  %282 = add nsw i32 %281, %274
  %283 = trunc i32 %282 to i16
  store i16 %283, ptr %279, align 2, !tbaa !11
  %284 = load ptr, ptr %6, align 8, !tbaa !5
  %285 = getelementptr inbounds %struct.console_box_t, ptr %284, i32 0, i32 0
  %286 = getelementptr inbounds %struct.anon, ptr %285, i32 0, i32 8
  %287 = load ptr, ptr %6, align 8, !tbaa !5
  %288 = getelementptr inbounds %struct.console_box_t, ptr %287, i32 0, i32 0
  %289 = getelementptr inbounds %struct.anon, ptr %288, i32 0, i32 7
  call void @arm_2d_dynamic_dirty_region_update(ptr noundef %286, ptr noundef %15, ptr noundef %289, i8 noundef zeroext 2)
  br label %476

290:                                              ; preds = %248
  %291 = load ptr, ptr %6, align 8, !tbaa !5
  %292 = getelementptr inbounds %struct.console_box_t, ptr %291, i32 0, i32 0
  %293 = getelementptr inbounds %struct.anon, ptr %292, i32 0, i32 11
  %294 = load i8, ptr %293, align 2
  %295 = and i8 %294, 1
  %296 = zext i8 %295 to i32
  %297 = icmp ne i32 %296, 0
  br i1 %297, label %306, label %298

298:                                              ; preds = %290
  %299 = load ptr, ptr %6, align 8, !tbaa !5
  %300 = getelementptr inbounds %struct.console_box_t, ptr %299, i32 0, i32 0
  %301 = getelementptr inbounds %struct.anon, ptr %300, i32 0, i32 5
  %302 = getelementptr inbounds %struct.anon.0, ptr %301, i32 0, i32 8
  %303 = load i16, ptr %302, align 8, !tbaa !27
  %304 = zext i16 %303 to i32
  %305 = icmp sgt i32 %304, 4
  br i1 %305, label %306, label %313

306:                                              ; preds = %298, %290
  %307 = load ptr, ptr %6, align 8, !tbaa !5
  %308 = getelementptr inbounds %struct.console_box_t, ptr %307, i32 0, i32 0
  %309 = getelementptr inbounds %struct.anon, ptr %308, i32 0, i32 8
  %310 = load ptr, ptr %6, align 8, !tbaa !5
  %311 = getelementptr inbounds %struct.console_box_t, ptr %310, i32 0, i32 0
  %312 = getelementptr inbounds %struct.anon, ptr %311, i32 0, i32 7
  call void @arm_2d_dynamic_dirty_region_update(ptr noundef %309, ptr noundef %15, ptr noundef %312, i8 noundef zeroext 2)
  br label %475

313:                                              ; preds = %298
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #8
  %314 = load ptr, ptr %6, align 8, !tbaa !5
  %315 = getelementptr inbounds %struct.console_box_t, ptr %314, i32 0, i32 0
  %316 = getelementptr inbounds %struct.anon, ptr %315, i32 0, i32 0
  %317 = load ptr, ptr %316, align 8, !tbaa !34
  %318 = getelementptr inbounds %struct.arm_2d_font_t, ptr %317, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %30, ptr align 8 %318, i64 4, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #8
  %319 = load ptr, ptr %6, align 8, !tbaa !5
  %320 = getelementptr inbounds %struct.console_box_t, ptr %319, i32 0, i32 0
  %321 = getelementptr inbounds %struct.anon, ptr %320, i32 0, i32 5
  %322 = getelementptr inbounds %struct.anon.0, ptr %321, i32 0, i32 6
  %323 = load i16, ptr %322, align 4, !tbaa !35
  %324 = zext i16 %323 to i64
  store i64 %324, ptr %31, align 8, !tbaa !36
  call void @llvm.lifetime.start.p0(i64 1, ptr %32) #8
  store i8 0, ptr %32, align 1, !tbaa !9
  %325 = load ptr, ptr %6, align 8, !tbaa !5
  %326 = getelementptr inbounds %struct.console_box_t, ptr %325, i32 0, i32 0
  %327 = getelementptr inbounds %struct.anon, ptr %326, i32 0, i32 4
  call void @arm_2d_byte_fifo_reset_peeked(ptr noundef %327)
  br label %328

328:                                              ; preds = %340, %313
  %329 = load i64, ptr %31, align 8, !tbaa !36
  %330 = add i64 %329, -1
  store i64 %330, ptr %31, align 8, !tbaa !36
  %331 = icmp ne i64 %329, 0
  br i1 %331, label %332, label %341

332:                                              ; preds = %328
  %333 = load ptr, ptr %6, align 8, !tbaa !5
  %334 = load ptr, ptr %6, align 8, !tbaa !5
  %335 = getelementptr inbounds %struct.console_box_t, ptr %334, i32 0, i32 0
  %336 = getelementptr inbounds %struct.anon, ptr %335, i32 0, i32 4
  %337 = call i64 @__console_box_peek_line(ptr noundef %333, ptr noundef %336)
  %338 = icmp slt i64 %337, 0
  br i1 %338, label %339, label %340

339:                                              ; preds = %332
  store i8 1, ptr %32, align 1, !tbaa !9
  br label %341

340:                                              ; preds = %332
  br label %328, !llvm.loop !38

341:                                              ; preds = %339, %328
  %342 = load i8, ptr %32, align 1, !tbaa !9, !range !12, !noundef !13
  %343 = trunc i8 %342 to i1
  br i1 %343, label %344, label %348

344:                                              ; preds = %341
  %345 = load ptr, ptr %6, align 8, !tbaa !5
  %346 = getelementptr inbounds %struct.console_box_t, ptr %345, i32 0, i32 0
  %347 = getelementptr inbounds %struct.anon, ptr %346, i32 0, i32 8
  call void @arm_2d_dynamic_dirty_region_change_user_region_index_only(ptr noundef %347, i8 noundef zeroext 2)
  br label %474

348:                                              ; preds = %341
  %349 = load ptr, ptr %6, align 8, !tbaa !5
  %350 = getelementptr inbounds %struct.console_box_t, ptr %349, i32 0, i32 0
  %351 = getelementptr inbounds %struct.anon, ptr %350, i32 0, i32 7
  %352 = getelementptr inbounds %struct.arm_2d_region_t, ptr %351, i32 0, i32 0
  %353 = getelementptr inbounds %struct.arm_2d_region_t, ptr %26, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %352, ptr align 2 %353, i64 4, i1 false), !tbaa.struct !20
  %354 = load ptr, ptr %6, align 8, !tbaa !5
  %355 = getelementptr inbounds %struct.console_box_t, ptr %354, i32 0, i32 0
  %356 = getelementptr inbounds %struct.anon, ptr %355, i32 0, i32 5
  %357 = getelementptr inbounds %struct.anon.0, ptr %356, i32 0, i32 6
  %358 = load i16, ptr %357, align 4, !tbaa !35
  %359 = add i16 %358, 1
  store i16 %359, ptr %357, align 4, !tbaa !35
  %360 = zext i16 %358 to i32
  %361 = getelementptr inbounds %struct.arm_2d_size_t, ptr %30, i32 0, i32 1
  %362 = load i16, ptr %361, align 2, !tbaa !26
  %363 = sext i16 %362 to i32
  %364 = mul nsw i32 %360, %363
  %365 = load ptr, ptr %6, align 8, !tbaa !5
  %366 = getelementptr inbounds %struct.console_box_t, ptr %365, i32 0, i32 0
  %367 = getelementptr inbounds %struct.anon, ptr %366, i32 0, i32 7
  %368 = getelementptr inbounds %struct.arm_2d_region_t, ptr %367, i32 0, i32 0
  %369 = getelementptr inbounds %struct.arm_2d_location_t, ptr %368, i32 0, i32 1
  %370 = load i16, ptr %369, align 2, !tbaa !11
  %371 = sext i16 %370 to i32
  %372 = add nsw i32 %371, %364
  %373 = trunc i32 %372 to i16
  store i16 %373, ptr %369, align 2, !tbaa !11
  %374 = load ptr, ptr %6, align 8, !tbaa !5
  %375 = load ptr, ptr %6, align 8, !tbaa !5
  %376 = getelementptr inbounds %struct.console_box_t, ptr %375, i32 0, i32 0
  %377 = getelementptr inbounds %struct.anon, ptr %376, i32 0, i32 4
  %378 = call i64 @__console_box_peek_line(ptr noundef %374, ptr noundef %377)
  %379 = getelementptr inbounds %struct.arm_2d_size_t, ptr %30, i32 0, i32 0
  %380 = load i16, ptr %379, align 2, !tbaa !24
  %381 = sext i16 %380 to i64
  %382 = mul nsw i64 %378, %381
  %383 = trunc i64 %382 to i16
  %384 = load ptr, ptr %6, align 8, !tbaa !5
  %385 = getelementptr inbounds %struct.console_box_t, ptr %384, i32 0, i32 0
  %386 = getelementptr inbounds %struct.anon, ptr %385, i32 0, i32 7
  %387 = getelementptr inbounds %struct.arm_2d_region_t, ptr %386, i32 0, i32 1
  %388 = getelementptr inbounds %struct.arm_2d_size_t, ptr %387, i32 0, i32 0
  store i16 %383, ptr %388, align 4, !tbaa !11
  %389 = load ptr, ptr %6, align 8, !tbaa !5
  %390 = getelementptr inbounds %struct.console_box_t, ptr %389, i32 0, i32 0
  %391 = getelementptr inbounds %struct.anon, ptr %390, i32 0, i32 5
  %392 = getelementptr inbounds %struct.anon.0, ptr %391, i32 0, i32 7
  %393 = load i16, ptr %392, align 2, !tbaa !40
  %394 = sext i16 %393 to i32
  %395 = load ptr, ptr %6, align 8, !tbaa !5
  %396 = getelementptr inbounds %struct.console_box_t, ptr %395, i32 0, i32 0
  %397 = getelementptr inbounds %struct.anon, ptr %396, i32 0, i32 7
  %398 = getelementptr inbounds %struct.arm_2d_region_t, ptr %397, i32 0, i32 1
  %399 = getelementptr inbounds %struct.arm_2d_size_t, ptr %398, i32 0, i32 0
  %400 = load i16, ptr %399, align 4, !tbaa !11
  %401 = sext i16 %400 to i32
  %402 = icmp sgt i32 %394, %401
  br i1 %402, label %403, label %442

403:                                              ; preds = %348
  call void @llvm.lifetime.start.p0(i64 2, ptr %33) #8
  %404 = load ptr, ptr %6, align 8, !tbaa !5
  %405 = getelementptr inbounds %struct.console_box_t, ptr %404, i32 0, i32 0
  %406 = getelementptr inbounds %struct.anon, ptr %405, i32 0, i32 7
  %407 = getelementptr inbounds %struct.arm_2d_region_t, ptr %406, i32 0, i32 1
  %408 = getelementptr inbounds %struct.arm_2d_size_t, ptr %407, i32 0, i32 0
  %409 = load i16, ptr %408, align 4, !tbaa !11
  store i16 %409, ptr %33, align 2, !tbaa !21
  %410 = load ptr, ptr %6, align 8, !tbaa !5
  %411 = getelementptr inbounds %struct.console_box_t, ptr %410, i32 0, i32 0
  %412 = getelementptr inbounds %struct.anon, ptr %411, i32 0, i32 5
  %413 = getelementptr inbounds %struct.anon.0, ptr %412, i32 0, i32 7
  %414 = load i16, ptr %413, align 2, !tbaa !40
  %415 = load ptr, ptr %6, align 8, !tbaa !5
  %416 = getelementptr inbounds %struct.console_box_t, ptr %415, i32 0, i32 0
  %417 = getelementptr inbounds %struct.anon, ptr %416, i32 0, i32 7
  %418 = getelementptr inbounds %struct.arm_2d_region_t, ptr %417, i32 0, i32 1
  %419 = getelementptr inbounds %struct.arm_2d_size_t, ptr %418, i32 0, i32 0
  store i16 %414, ptr %419, align 4, !tbaa !11
  %420 = getelementptr inbounds %struct.arm_2d_size_t, ptr %30, i32 0, i32 1
  %421 = load i16, ptr %420, align 2, !tbaa !26
  %422 = sext i16 %421 to i32
  %423 = load ptr, ptr %6, align 8, !tbaa !5
  %424 = getelementptr inbounds %struct.console_box_t, ptr %423, i32 0, i32 0
  %425 = getelementptr inbounds %struct.anon, ptr %424, i32 0, i32 5
  %426 = getelementptr inbounds %struct.anon.0, ptr %425, i32 0, i32 8
  %427 = load i16, ptr %426, align 8, !tbaa !27
  %428 = zext i16 %427 to i32
  %429 = add nsw i32 1, %428
  %430 = mul nsw i32 %422, %429
  %431 = trunc i32 %430 to i16
  %432 = load ptr, ptr %6, align 8, !tbaa !5
  %433 = getelementptr inbounds %struct.console_box_t, ptr %432, i32 0, i32 0
  %434 = getelementptr inbounds %struct.anon, ptr %433, i32 0, i32 7
  %435 = getelementptr inbounds %struct.arm_2d_region_t, ptr %434, i32 0, i32 1
  %436 = getelementptr inbounds %struct.arm_2d_size_t, ptr %435, i32 0, i32 1
  store i16 %431, ptr %436, align 2, !tbaa !11
  %437 = load i16, ptr %33, align 2, !tbaa !21
  %438 = load ptr, ptr %6, align 8, !tbaa !5
  %439 = getelementptr inbounds %struct.console_box_t, ptr %438, i32 0, i32 0
  %440 = getelementptr inbounds %struct.anon, ptr %439, i32 0, i32 5
  %441 = getelementptr inbounds %struct.anon.0, ptr %440, i32 0, i32 7
  store i16 %437, ptr %441, align 2, !tbaa !40
  call void @llvm.lifetime.end.p0(i64 2, ptr %33) #8
  br label %460

442:                                              ; preds = %348
  %443 = getelementptr inbounds %struct.arm_2d_size_t, ptr %30, i32 0, i32 1
  %444 = load i16, ptr %443, align 2, !tbaa !26
  %445 = load ptr, ptr %6, align 8, !tbaa !5
  %446 = getelementptr inbounds %struct.console_box_t, ptr %445, i32 0, i32 0
  %447 = getelementptr inbounds %struct.anon, ptr %446, i32 0, i32 7
  %448 = getelementptr inbounds %struct.arm_2d_region_t, ptr %447, i32 0, i32 1
  %449 = getelementptr inbounds %struct.arm_2d_size_t, ptr %448, i32 0, i32 1
  store i16 %444, ptr %449, align 2, !tbaa !11
  %450 = load ptr, ptr %6, align 8, !tbaa !5
  %451 = getelementptr inbounds %struct.console_box_t, ptr %450, i32 0, i32 0
  %452 = getelementptr inbounds %struct.anon, ptr %451, i32 0, i32 7
  %453 = getelementptr inbounds %struct.arm_2d_region_t, ptr %452, i32 0, i32 1
  %454 = getelementptr inbounds %struct.arm_2d_size_t, ptr %453, i32 0, i32 0
  %455 = load i16, ptr %454, align 4, !tbaa !11
  %456 = load ptr, ptr %6, align 8, !tbaa !5
  %457 = getelementptr inbounds %struct.console_box_t, ptr %456, i32 0, i32 0
  %458 = getelementptr inbounds %struct.anon, ptr %457, i32 0, i32 5
  %459 = getelementptr inbounds %struct.anon.0, ptr %458, i32 0, i32 7
  store i16 %455, ptr %459, align 2, !tbaa !40
  br label %460

460:                                              ; preds = %442, %403
  %461 = load ptr, ptr %6, align 8, !tbaa !5
  %462 = getelementptr inbounds %struct.console_box_t, ptr %461, i32 0, i32 0
  %463 = getelementptr inbounds %struct.anon, ptr %462, i32 0, i32 7
  %464 = load ptr, ptr %6, align 8, !tbaa !5
  %465 = getelementptr inbounds %struct.console_box_t, ptr %464, i32 0, i32 0
  %466 = getelementptr inbounds %struct.anon, ptr %465, i32 0, i32 7
  %467 = call zeroext i1 @arm_2d_region_intersect(ptr noundef %26, ptr noundef %463, ptr noundef %466)
  %468 = load ptr, ptr %6, align 8, !tbaa !5
  %469 = getelementptr inbounds %struct.console_box_t, ptr %468, i32 0, i32 0
  %470 = getelementptr inbounds %struct.anon, ptr %469, i32 0, i32 8
  %471 = load ptr, ptr %6, align 8, !tbaa !5
  %472 = getelementptr inbounds %struct.console_box_t, ptr %471, i32 0, i32 0
  %473 = getelementptr inbounds %struct.anon, ptr %472, i32 0, i32 7
  call void @arm_2d_dynamic_dirty_region_update(ptr noundef %470, ptr noundef %15, ptr noundef %473, i8 noundef zeroext 1)
  br label %474

474:                                              ; preds = %460, %344
  call void @llvm.lifetime.end.p0(i64 1, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #8
  br label %475

475:                                              ; preds = %474, %306
  br label %476

476:                                              ; preds = %475, %257
  br label %481

477:                                              ; preds = %239
  %478 = load ptr, ptr %6, align 8, !tbaa !5
  %479 = getelementptr inbounds %struct.console_box_t, ptr %478, i32 0, i32 0
  %480 = getelementptr inbounds %struct.anon, ptr %479, i32 0, i32 8
  call void @arm_2d_dynamic_dirty_region_change_user_region_index_only(ptr noundef %480, i8 noundef zeroext 2)
  br label %481

481:                                              ; preds = %477, %476
  br label %483

482:                                              ; preds = %233
  br label %483

483:                                              ; preds = %482, %481, %233
  br label %484

484:                                              ; preds = %483, %225
  %485 = call zeroext i1 @arm_2d_helper_pfb_is_region_being_drawing(ptr noundef %15, ptr noundef %26, ptr noundef null)
  br i1 %485, label %487, label %486

486:                                              ; preds = %484
  store i32 15, ptr %14, align 4
  br label %538

487:                                              ; preds = %484
  call void @arm_lcd_text_set_target_framebuffer(ptr noundef %15)
  %488 = load ptr, ptr %6, align 8, !tbaa !5
  %489 = getelementptr inbounds %struct.console_box_t, ptr %488, i32 0, i32 0
  %490 = getelementptr inbounds %struct.anon, ptr %489, i32 0, i32 0
  %491 = load ptr, ptr %490, align 8, !tbaa !34
  %492 = call i32 @arm_lcd_text_set_font(ptr noundef %491)
  call void @arm_lcd_text_set_draw_region(ptr noundef %26)
  call void @arm_lcd_text_set_scale(float noundef 0.000000e+00)
  %493 = call signext i8 @arm_lcd_text_set_line_spacing(i8 noundef signext 0)
  %494 = call signext i8 @arm_lcd_text_set_char_spacing(i8 noundef signext 0)
  %495 = load ptr, ptr %6, align 8, !tbaa !5
  %496 = getelementptr inbounds %struct.console_box_t, ptr %495, i32 0, i32 0
  %497 = getelementptr inbounds %struct.anon, ptr %496, i32 0, i32 10
  %498 = load i16, ptr %497, align 8, !tbaa !41
  call void @arm_lcd_text_set_colour(i16 noundef zeroext %498, i16 noundef zeroext 0)
  %499 = load i8, ptr %10, align 1, !tbaa !11
  call void @arm_lcd_text_set_opacity(i8 noundef zeroext %499)
  call void @llvm.lifetime.start.p0(i64 1, ptr %34) #8
  %500 = call zeroext i1 @arm_lcd_text_force_char_use_same_width(i1 noundef zeroext true)
  %501 = zext i1 %500 to i8
  store i8 %501, ptr %34, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #8
  store ptr null, ptr %35, align 8, !tbaa !5
  br label %502

502:                                              ; preds = %527, %487
  %503 = load ptr, ptr %35, align 8, !tbaa !5
  %504 = getelementptr inbounds i8, ptr %503, i32 1
  store ptr %504, ptr %35, align 8, !tbaa !5
  %505 = icmp eq ptr %503, null
  br i1 %505, label %507, label %506

506:                                              ; preds = %502
  store i32 21, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %34) #8
  br label %531

507:                                              ; preds = %502
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #8
  %508 = load ptr, ptr %6, align 8, !tbaa !5
  %509 = getelementptr inbounds %struct.console_box_t, ptr %508, i32 0, i32 0
  %510 = getelementptr inbounds %struct.anon, ptr %509, i32 0, i32 4
  call void @arm_2d_byte_fifo_reset_peeked(ptr noundef %510)
  br label %511

511:                                              ; preds = %525, %507
  %512 = load ptr, ptr %6, align 8, !tbaa !5
  %513 = getelementptr inbounds %struct.console_box_t, ptr %512, i32 0, i32 0
  %514 = getelementptr inbounds %struct.anon, ptr %513, i32 0, i32 4
  %515 = call zeroext i1 @__console_box_peek_utf8(ptr noundef %514, ptr noundef %36)
  br i1 %515, label %517, label %516

516:                                              ; preds = %511
  br label %526

517:                                              ; preds = %511
  call void @llvm.lifetime.start.p0(i64 1, ptr %37) #8
  %518 = call signext i8 @arm_2d_helper_get_utf8_byte_length(ptr noundef %36)
  store i8 %518, ptr %37, align 1, !tbaa !11
  %519 = load i8, ptr %37, align 1, !tbaa !11
  %520 = call zeroext i1 @arm_lcd_putchar_to_buffer(ptr noundef %36, i8 noundef zeroext %519)
  br i1 %520, label %524, label %521

521:                                              ; preds = %517
  call void @arm_lcd_printf_buffer(i16 noundef signext 0)
  %522 = load i8, ptr %37, align 1, !tbaa !11
  %523 = call zeroext i1 @arm_lcd_putchar_to_buffer(ptr noundef %36, i8 noundef zeroext %522)
  br label %524

524:                                              ; preds = %521, %517
  call void @llvm.lifetime.end.p0(i64 1, ptr %37) #8
  br label %525

525:                                              ; preds = %524
  br i1 true, label %511, label %526

526:                                              ; preds = %525, %516
  call void @arm_lcd_printf_buffer(i16 noundef signext 0)
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #8
  br label %527

527:                                              ; preds = %526
  %528 = load i8, ptr %34, align 1, !tbaa !9, !range !12, !noundef !13
  %529 = trunc i8 %528 to i1
  %530 = call zeroext i1 @arm_lcd_text_force_char_use_same_width(i1 noundef zeroext %529)
  br label %502, !llvm.loop !42

531:                                              ; preds = %506
  %532 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  br label %533

533:                                              ; preds = %531
  %534 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %535 = zext i1 %534 to i8
  store i8 %535, ptr %38, align 1, !tbaa !9
  %536 = load i8, ptr %38, align 1, !tbaa !9, !range !12, !noundef !13
  %537 = trunc i8 %536 to i1
  br label %171, !llvm.loop !43

538:                                              ; preds = %486, %224
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  br label %539

539:                                              ; preds = %538
  br label %165, !llvm.loop !44

540:                                              ; preds = %169
  br label %541

541:                                              ; preds = %540
  %542 = load ptr, ptr %22, align 8, !tbaa !5
  br label %159, !llvm.loop !45

543:                                              ; preds = %163
  br label %544

544:                                              ; preds = %543
  %545 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %546 = zext i1 %545 to i8
  store i8 %546, ptr %39, align 1, !tbaa !9
  %547 = load i8, ptr %39, align 1, !tbaa !9, !range !12, !noundef !13
  %548 = trunc i8 %547 to i1
  br label %145, !llvm.loop !46

549:                                              ; preds = %157
  br label %550

550:                                              ; preds = %549
  br label %64, !llvm.loop !47

551:                                              ; preds = %143, %135
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #8
  br label %552

552:                                              ; preds = %551
  br label %49, !llvm.loop !48

553:                                              ; preds = %62
  ret void
}

declare ptr @arm_2d_get_default_frame_buffer() #5

declare ptr @arm_2d_tile_generate_child(ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) #5

declare zeroext i8 @arm_2d_dynamic_dirty_region_wait_next(ptr noundef) #5

declare void @arm_2d_dynamic_dirty_region_update(ptr noundef, ptr noundef, ptr noundef, i8 noundef zeroext) #5

declare void @arm_2d_byte_fifo_reset_peeked(ptr noundef) #5

; Function Attrs: nounwind uwtable
declare hidden i64 @__console_box_peek_line(ptr noundef, ptr noundef) #4

declare void @arm_2d_dynamic_dirty_region_change_user_region_index_only(ptr noundef, i8 noundef zeroext) #5

declare zeroext i1 @arm_2d_region_intersect(ptr noundef, ptr noundef, ptr noundef) #5

declare zeroext i1 @arm_2d_helper_pfb_is_region_being_drawing(ptr noundef, ptr noundef, ptr noundef) #5

declare void @arm_lcd_text_set_target_framebuffer(ptr noundef) #5

declare i32 @arm_lcd_text_set_font(ptr noundef) #5

declare void @arm_lcd_text_set_draw_region(ptr noundef) #5

declare void @arm_lcd_text_set_scale(float noundef) #5

declare signext i8 @arm_lcd_text_set_line_spacing(i8 noundef signext) #5

declare signext i8 @arm_lcd_text_set_char_spacing(i8 noundef signext) #5

declare void @arm_lcd_text_set_colour(i16 noundef zeroext, i16 noundef zeroext) #5

declare void @arm_lcd_text_set_opacity(i8 noundef zeroext) #5

declare zeroext i1 @arm_lcd_text_force_char_use_same_width(i1 noundef zeroext) #5

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @__console_box_peek_utf8(ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden signext i8 @arm_2d_helper_get_utf8_byte_length(ptr noundef nonnull) #6

declare zeroext i1 @arm_lcd_putchar_to_buffer(ptr noundef, i8 noundef zeroext) #5

declare void @arm_lcd_printf_buffer(i16 noundef signext) #5

declare zeroext i1 @arm_2d_op_wait_async(ptr noundef) #5

attributes #0 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = { 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 #7 = { noreturn nounwind }
attributes #8 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"_Bool", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{i8 0, i8 2}
!13 = !{}
!14 = !{!15, !7, i64 0}
!15 = !{!"arm_2d_margin_t", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3}
!16 = !{!15, !7, i64 1}
!17 = !{!15, !7, i64 2}
!18 = !{!15, !7, i64 3}
!19 = !{i64 0, i64 1, !11, i64 1, i64 1, !11, i64 2, i64 1, !11, i64 3, i64 1, !11}
!20 = !{i64 0, i64 2, !21, i64 2, i64 2, !21}
!21 = !{!22, !22, i64 0}
!22 = !{!"short", !7, i64 0}
!23 = !{i64 0, i64 4, !11, i64 4, i64 4, !11}
!24 = !{!25, !22, i64 0}
!25 = !{!"arm_2d_size_t", !22, i64 0, !22, i64 2}
!26 = !{!25, !22, i64 2}
!27 = !{!28, !22, i64 80}
!28 = !{!"console_box_t", !29, i64 0}
!29 = !{!"", !6, i64 0, !25, i64 8, !30, i64 16, !30, i64 40, !31, i64 64, !6, i64 88, !32, i64 96, !33, i64 104, !6, i64 136, !22, i64 144, !7, i64 146, !7, i64 146, !7, i64 146, !7, i64 146, !7, i64 146}
!30 = !{!"arm_2d_byte_fifo_t", !7, i64 0}
!31 = !{!"", !22, i64 0, !22, i64 2, !22, i64 4, !22, i64 6, !22, i64 8, !22, i64 10, !22, i64 12, !22, i64 14, !22, i64 16}
!32 = !{!"arm_2d_region_t", !7, i64 0, !7, i64 4}
!33 = !{!"arm_2d_region_list_item_t", !6, i64 0, !7, i64 8, !32, i64 16, !7, i64 24}
!34 = !{!28, !6, i64 0}
!35 = !{!28, !22, i64 76}
!36 = !{!37, !37, i64 0}
!37 = !{!"long", !7, i64 0}
!38 = distinct !{!38, !39}
!39 = !{!"llvm.loop.mustprogress"}
!40 = !{!28, !22, i64 78}
!41 = !{!28, !22, i64 144}
!42 = distinct !{!42, !39}
!43 = distinct !{!43, !39}
!44 = distinct !{!44, !39}
!45 = distinct !{!45, !39}
!46 = distinct !{!46, !39}
!47 = distinct !{!47, !39}
!48 = distinct !{!48, !39}


; 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.arm_2d_tile_t = type { %union.anon.3, %union.anon.14, %union.anon.15 }
%union.anon.3 = type { %struct.anon.4 }
%struct.anon.4 = type { i8, %union.arm_2d_color_info_t, %union.anon.7 }
%union.arm_2d_color_info_t = type { %struct.anon.5 }
%struct.anon.5 = type { i8 }
%union.anon.7 = type { i16 }
%union.anon.14 = type { %struct.arm_2d_region_t }
%struct.arm_2d_region_t = type { %union.anon, %union.anon.1 }
%union.anon = type { %struct.arm_2d_location_t }
%struct.arm_2d_location_t = type { i16, i16 }
%union.anon.1 = type { %struct.arm_2d_size_t }
%struct.arm_2d_size_t = type { i16, i16 }
%union.anon.15 = type { ptr }

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @console_box_show(ptr noundef nonnull %0, ptr noundef %1, ptr noundef readonly %2, i1 noundef zeroext %3, i8 noundef zeroext %4) local_unnamed_addr #2 {
  %6 = alloca %struct.arm_2d_tile_t, align 8
  %7 = alloca %struct.arm_2d_region_t, align 8
  %8 = alloca %struct.arm_2d_region_t, align 4
  %9 = alloca i32, align 4
  %10 = icmp eq ptr %1, null
  %11 = icmp eq ptr %2, null
  %12 = getelementptr inbounds i8, ptr %7, i64 4
  %13 = getelementptr inbounds i8, ptr %6, i64 8
  %.sroa.6.4..sroa_idx = getelementptr inbounds i8, ptr %6, i64 10
  %14 = getelementptr inbounds i8, ptr %0, i64 8
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 10
  %15 = getelementptr inbounds i8, ptr %8, i64 4
  %16 = getelementptr inbounds i8, ptr %8, i64 6
  %17 = getelementptr inbounds i8, ptr %8, i64 2
  %18 = getelementptr inbounds i8, ptr %0, i64 146
  %19 = getelementptr inbounds i8, ptr %0, i64 104
  %20 = getelementptr inbounds i8, ptr %0, i64 96
  %21 = getelementptr inbounds i8, ptr %0, i64 98
  %22 = getelementptr inbounds i8, ptr %0, i64 80
  %23 = getelementptr inbounds i8, ptr %0, i64 76
  %24 = getelementptr inbounds i8, ptr %0, i64 40
  %25 = getelementptr inbounds i8, ptr %0, i64 100
  %26 = getelementptr inbounds i8, ptr %0, i64 78
  %27 = getelementptr inbounds i8, ptr %0, i64 102
  %28 = getelementptr inbounds i8, ptr %0, i64 144
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %6, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  store i64 0, ptr %7, align 8
  br i1 %10, label %29, label %32

29:                                               ; preds = %5
  %30 = tail call ptr @arm_2d_get_default_frame_buffer() #5
  %31 = icmp eq ptr %30, null
  br i1 %31, label %38, label %32

32:                                               ; preds = %29, %5
  %.095 = phi ptr [ %30, %29 ], [ %1, %5 ]
  br i1 %11, label %33, label %36

33:                                               ; preds = %32
  %34 = getelementptr inbounds i8, ptr %.095, i64 8
  %35 = load i32, ptr %34, align 4
  store i32 %35, ptr %12, align 4
  br label %.preheader122

36:                                               ; preds = %32
  %37 = load i64, ptr %2, align 2
  store i64 %37, ptr %7, align 8
  br label %.preheader122

38:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  br label %118

.preheader122:                                    ; preds = %33, %36
  %39 = call ptr @arm_2d_tile_generate_child(ptr noundef nonnull %.095, ptr noundef nonnull %7, ptr noundef nonnull %6, i1 noundef zeroext false) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  %.sroa.423.4.copyload125 = load i16, ptr %13, align 8
  %.sroa.6.4.copyload126 = load i16, ptr %.sroa.6.4..sroa_idx, align 2
  %40 = sext i16 %.sroa.423.4.copyload125 to i32
  %41 = sext i16 %.sroa.6.4.copyload126 to i32
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %.sroa.011.0.copyload = load i16, ptr %14, align 8, !tbaa !5
  %.sroa.5.0.copyload = load i16, ptr %.sroa.5.0..sroa_idx, align 2, !tbaa !5
  store i16 %.sroa.011.0.copyload, ptr %15, align 4, !tbaa !9
  store i16 %.sroa.5.0.copyload, ptr %16, align 2, !tbaa !9
  %42 = sext i16 %.sroa.011.0.copyload to i32
  %43 = sub nsw i32 %40, %42
  %44 = lshr i32 %43, 1
  %45 = trunc i32 %44 to i16
  store i16 %45, ptr %8, align 4, !tbaa !9
  %46 = sext i16 %.sroa.5.0.copyload to i32
  %47 = sub nsw i32 %41, %46
  %48 = lshr i32 %47, 1
  %49 = trunc i32 %48 to i16
  store i16 %49, ptr %17, align 2, !tbaa !9
  %50 = load i8, ptr %18, align 2
  %51 = and i8 %50, 2
  %.not111 = icmp eq i8 %51, 0
  br i1 %.not111, label %98, label %52

52:                                               ; preds = %.preheader122
  %53 = call zeroext i8 @arm_2d_dynamic_dirty_region_wait_next(ptr noundef nonnull %19) #5
  %switch = icmp ult i8 %53, 2
  br i1 %switch, label %54, label %98

54:                                               ; preds = %52
  %55 = load i8, ptr %18, align 2
  %56 = lshr i8 %55, 4
  %57 = and i8 %56, 3
  switch i8 %57, label %62 [
    i8 0, label %97
    i8 2, label %58
  ]

58:                                               ; preds = %54
  %59 = load <2 x i16>, ptr %8, align 4, !tbaa !9
  %60 = load <2 x i16>, ptr %20, align 8, !tbaa !9
  %61 = add <2 x i16> %60, %59
  store <2 x i16> %61, ptr %20, align 8, !tbaa !9
  call void @arm_2d_dynamic_dirty_region_update(ptr noundef nonnull %19, ptr noundef nonnull %6, ptr noundef nonnull %20, i8 noundef zeroext 2) #5
  br label %98

62:                                               ; preds = %54
  %63 = and i8 %55, 1
  %.not113 = icmp eq i8 %63, 0
  br i1 %.not113, label %64, label %67

64:                                               ; preds = %62
  %65 = load i16, ptr %22, align 8, !tbaa !10
  %66 = icmp ugt i16 %65, 4
  br i1 %66, label %67, label %68

67:                                               ; preds = %64, %62
  call void @arm_2d_dynamic_dirty_region_update(ptr noundef nonnull %19, ptr noundef nonnull %6, ptr noundef nonnull %20, i8 noundef zeroext 2) #5
  br label %98

68:                                               ; preds = %64
  %69 = load ptr, ptr %0, align 8, !tbaa !19
  %70 = getelementptr inbounds i8, ptr %69, i64 24
  %.sroa.0.0.copyload = load i16, ptr %70, align 8, !tbaa !5
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %69, i64 26
  %.sroa.4.0.copyload = load i16, ptr %.sroa.4.0..sroa_idx, align 2, !tbaa !5
  %71 = load i16, ptr %23, align 4, !tbaa !20
  %72 = zext i16 %71 to i64
  call void @arm_2d_byte_fifo_reset_peeked(ptr noundef nonnull %24) #5
  br label %73

73:                                               ; preds = %74, %68
  %.092 = phi i64 [ %72, %68 ], [ %75, %74 ]
  %.not114.not = icmp eq i64 %.092, 0
  br i1 %.not114.not, label %.critedge116, label %74

74:                                               ; preds = %73
  %75 = add nsw i64 %.092, -1
  %76 = call i64 @__console_box_peek_line(ptr noundef nonnull %0, ptr noundef nonnull %24)
  %77 = icmp slt i64 %76, 0
  br i1 %77, label %78, label %73, !llvm.loop !21

78:                                               ; preds = %74
  call void @arm_2d_dynamic_dirty_region_change_user_region_index_only(ptr noundef nonnull %19, i8 noundef zeroext 2) #5
  br label %98

.critedge116:                                     ; preds = %73
  %79 = load i32, ptr %8, align 4
  store i32 %79, ptr %20, align 8
  %80 = load i16, ptr %23, align 4, !tbaa !20
  %81 = add i16 %80, 1
  store i16 %81, ptr %23, align 4, !tbaa !20
  %82 = mul i16 %80, %.sroa.4.0.copyload
  %83 = lshr i32 %79, 16
  %84 = trunc nuw i32 %83 to i16
  %85 = add i16 %82, %84
  store i16 %85, ptr %21, align 2, !tbaa !9
  %86 = call i64 @__console_box_peek_line(ptr noundef nonnull %0, ptr noundef nonnull %24)
  %87 = trunc i64 %86 to i16
  %88 = mul i16 %.sroa.0.0.copyload, %87
  store i16 %88, ptr %25, align 4, !tbaa !9
  %89 = load i16, ptr %26, align 2, !tbaa !23
  %90 = icmp sgt i16 %89, %88
  br i1 %90, label %91, label %95

91:                                               ; preds = %.critedge116
  store i16 %89, ptr %25, align 4, !tbaa !9
  %92 = load i16, ptr %22, align 8, !tbaa !10
  %93 = add i16 %92, 1
  %94 = mul i16 %93, %.sroa.4.0.copyload
  br label %95

95:                                               ; preds = %.critedge116, %91
  %storemerge = phi i16 [ %94, %91 ], [ %.sroa.4.0.copyload, %.critedge116 ]
  store i16 %storemerge, ptr %27, align 2, !tbaa !9
  store i16 %88, ptr %26, align 2, !tbaa !23
  %96 = call zeroext i1 @arm_2d_region_intersect(ptr noundef nonnull %8, ptr noundef nonnull %20, ptr noundef nonnull %20) #5
  call void @arm_2d_dynamic_dirty_region_update(ptr noundef nonnull %19, ptr noundef nonnull %6, ptr noundef nonnull %20, i8 noundef zeroext 1) #5
  br label %98

97:                                               ; preds = %54
  call void @arm_2d_dynamic_dirty_region_change_user_region_index_only(ptr noundef nonnull %19, i8 noundef zeroext 2) #5
  br label %98

98:                                               ; preds = %78, %95, %52, %58, %67, %97, %.preheader122
  %99 = call zeroext i1 @arm_2d_helper_pfb_is_region_being_drawing(ptr noundef nonnull %6, ptr noundef nonnull %8, ptr noundef null) #5
  br i1 %99, label %100, label %.critedge

100:                                              ; preds = %98
  call void @arm_lcd_text_set_target_framebuffer(ptr noundef nonnull %6) #5
  %101 = load ptr, ptr %0, align 8, !tbaa !19
  %102 = call i32 @arm_lcd_text_set_font(ptr noundef %101) #5
  call void @arm_lcd_text_set_draw_region(ptr noundef nonnull %8) #5
  call void @arm_lcd_text_set_scale(float noundef 0.000000e+00) #5
  %103 = call signext i8 @arm_lcd_text_set_line_spacing(i8 noundef signext 0) #5
  %104 = call signext i8 @arm_lcd_text_set_char_spacing(i8 noundef signext 0) #5
  %105 = load i16, ptr %28, align 8, !tbaa !24
  call void @arm_lcd_text_set_colour(i16 noundef zeroext %105, i16 noundef zeroext 0) #5
  call void @arm_lcd_text_set_opacity(i8 noundef zeroext %4) #5
  %106 = call zeroext i1 @arm_lcd_text_force_char_use_same_width(i1 noundef zeroext true) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #5
  call void @arm_2d_byte_fifo_reset_peeked(ptr noundef nonnull %24) #5
  %107 = call zeroext i1 @__console_box_peek_utf8(ptr noundef nonnull %24, ptr noundef nonnull %9)
  br i1 %107, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %100, %112
  %108 = call signext i8 @arm_2d_helper_get_utf8_byte_length(ptr noundef %9)
  %109 = call zeroext i1 @arm_lcd_putchar_to_buffer(ptr noundef nonnull %9, i8 noundef zeroext %108) #5
  br i1 %109, label %112, label %110

110:                                              ; preds = %.lr.ph
  call void @arm_lcd_printf_buffer(i16 noundef signext 0) #5
  %111 = call zeroext i1 @arm_lcd_putchar_to_buffer(ptr noundef nonnull %9, i8 noundef zeroext %108) #5
  br label %112

112:                                              ; preds = %110, %.lr.ph
  %113 = call zeroext i1 @__console_box_peek_utf8(ptr noundef nonnull %24, ptr noundef nonnull %9)
  br i1 %113, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %112, %100
  call void @arm_lcd_printf_buffer(i16 noundef signext 0) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #5
  %114 = call zeroext i1 @arm_lcd_text_force_char_use_same_width(i1 noundef zeroext %106) #5
  %115 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #5
  %116 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #5
  br label %.critedge, !llvm.loop !25

.critedge:                                        ; preds = %._crit_edge, %98
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  %117 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #5
  br label %118

118:                                              ; preds = %.critedge, %38
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  ret void
}

declare ptr @arm_2d_get_default_frame_buffer() local_unnamed_addr #3

declare ptr @arm_2d_tile_generate_child(ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #3

declare zeroext i8 @arm_2d_dynamic_dirty_region_wait_next(ptr noundef) local_unnamed_addr #3

declare void @arm_2d_dynamic_dirty_region_update(ptr noundef, ptr noundef, ptr noundef, i8 noundef zeroext) local_unnamed_addr #3

declare void @arm_2d_byte_fifo_reset_peeked(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden i64 @__console_box_peek_line(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @arm_2d_dynamic_dirty_region_change_user_region_index_only(ptr noundef, i8 noundef zeroext) local_unnamed_addr #3

declare zeroext i1 @arm_2d_region_intersect(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare zeroext i1 @arm_2d_helper_pfb_is_region_being_drawing(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @arm_lcd_text_set_target_framebuffer(ptr noundef) local_unnamed_addr #3

declare i32 @arm_lcd_text_set_font(ptr noundef) local_unnamed_addr #3

declare void @arm_lcd_text_set_draw_region(ptr noundef) local_unnamed_addr #3

declare void @arm_lcd_text_set_scale(float noundef) local_unnamed_addr #3

declare signext i8 @arm_lcd_text_set_line_spacing(i8 noundef signext) local_unnamed_addr #3

declare signext i8 @arm_lcd_text_set_char_spacing(i8 noundef signext) local_unnamed_addr #3

declare void @arm_lcd_text_set_colour(i16 noundef zeroext, i16 noundef zeroext) local_unnamed_addr #3

declare void @arm_lcd_text_set_opacity(i8 noundef zeroext) local_unnamed_addr #3

declare zeroext i1 @arm_lcd_text_force_char_use_same_width(i1 noundef zeroext) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @__console_box_peek_utf8(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden signext i8 @arm_2d_helper_get_utf8_byte_length(ptr noundef nonnull) local_unnamed_addr #4

declare zeroext i1 @arm_lcd_putchar_to_buffer(ptr noundef, i8 noundef zeroext) local_unnamed_addr #3

declare void @arm_lcd_printf_buffer(i16 noundef signext) local_unnamed_addr #3

declare zeroext i1 @arm_2d_op_wait_async(ptr noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 = { 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 = { 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 = !{!"short", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !6, i64 80}
!11 = !{!"console_box_t", !12, i64 0}
!12 = !{!"", !13, i64 0, !14, i64 8, !15, i64 16, !15, i64 40, !16, i64 64, !13, i64 88, !17, i64 96, !18, i64 104, !13, i64 136, !6, i64 144, !7, i64 146, !7, i64 146, !7, i64 146, !7, i64 146, !7, i64 146}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"arm_2d_size_t", !6, i64 0, !6, i64 2}
!15 = !{!"arm_2d_byte_fifo_t", !7, i64 0}
!16 = !{!"", !6, i64 0, !6, i64 2, !6, i64 4, !6, i64 6, !6, i64 8, !6, i64 10, !6, i64 12, !6, i64 14, !6, i64 16}
!17 = !{!"arm_2d_region_t", !7, i64 0, !7, i64 4}
!18 = !{!"arm_2d_region_list_item_t", !13, i64 0, !7, i64 8, !17, i64 16, !7, i64 24}
!19 = !{!11, !13, i64 0}
!20 = !{!11, !6, i64 76}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!11, !6, i64 78}
!24 = !{!11, !6, i64 144}
!25 = distinct !{!25, !22}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass