; LLVM IR from ARM-software/Arm-2D :: examples/common/controls (battery_gasgauge)

; 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_tile_t = type { %union.anon, %union.anon.10, %union.anon.13 }
%union.anon = type { %struct.anon.0 }
%struct.anon.0 = type { i8, %union.arm_2d_color_info_t, %union.anon.3 }
%union.arm_2d_color_info_t = type { %struct.anon.1 }
%struct.anon.1 = type { i8 }
%union.anon.3 = type { i16 }
%union.anon.10 = type { %struct.arm_2d_region_t }
%struct.arm_2d_region_t = type { %union.anon.11, %union.anon.12 }
%union.anon.11 = type { %struct.arm_2d_location_t }
%struct.arm_2d_location_t = type { i16, i16 }
%union.anon.12 = type { %struct.arm_2d_size_t }
%struct.arm_2d_size_t = type { i16, i16 }
%union.anon.13 = type { ptr }
%struct.__arm_2d_layout_t = type { ptr, %struct.arm_2d_region_t, %struct.arm_2d_region_t, i8, i8, %struct.__arm_2d_layout_align_tab_t }
%struct.__arm_2d_layout_align_tab_t = type { %union.anon.14, %union.anon.16 }
%union.anon.14 = type { %struct.anon.15 }
%struct.anon.15 = type { i8 }
%union.anon.16 = type { %struct.anon.17 }
%struct.anon.17 = type { i8 }
%union.__arm_2d_color_fast_rgb_t = type { [4 x i16] }
%struct.arm_2d_margin_t = type { i8, i8, i8, i8 }
%union.arm_2d_color_rgb565_t = type { i16 }
%struct.battery_liquid_t = type { %struct.anon.19 }
%struct.anon.19 = type { [2 x i64], i16, i8, i8, i16, i8, i32 }

@c_tileBatteryBoarderTopMask = external constant %struct.arm_2d_tile_t, align 8
@c_tileBatteryBoarderBottomMask = external constant %struct.arm_2d_tile_t, align 8
@c_tileBatteryBoarderLineMask = external constant %struct.arm_2d_tile_t, align 8
@c_tileSinWaveMask = external constant %struct.arm_2d_tile_t, align 8
@__const.battery_gasgauge_liquid_show.__layout_assistant__ = external hidden unnamed_addr constant %struct.__arm_2d_layout_t, align 8
@c_tileLightingA4Mask = external constant %struct.arm_2d_tile_t, align 8
@c_tileGlassReflectionNLineMask = external constant %struct.arm_2d_tile_t, align 8
@c_tileGlassReflectionWLineMask = external constant %struct.arm_2d_tile_t, align 8

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

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

declare zeroext i1 @__arm_2d_helper_time_cos_slider(i32 noundef, i32 noundef, i64 noundef, float noundef, ptr noundef, ptr noundef) #2

declare i64 @arm_2d_helper_convert_ms_to_ticks(i32 noundef) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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) #3

declare ptr @arm_2d_get_default_frame_buffer() #2

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

declare i32 @arm_2dp_rgb565_fill_colour_with_mask_and_opacity(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i16, i8 noundef zeroext) #2

declare zeroext i1 @arm_2d_op_wait_async(ptr noundef) #2

declare i32 @arm_2dp_rgb565_fill_colour_with_horizontal_line_mask_and_opacity(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i16, i8 noundef zeroext) #2

; Function Attrs: nounwind uwtable
declare dso_local void @draw_liquid_wave(ptr noundef nonnull, ptr noundef, i16 noundef zeroext, i16 noundef signext, i32, i16 noundef zeroext, ptr noundef) #4

; Function Attrs: nounwind uwtable
define dso_local void @battery_gasgauge_liquid_show(ptr noundef nonnull %0, ptr noundef %1, ptr noundef %2, i16 noundef zeroext %3, i32 noundef %4, i1 noundef zeroext %5) #4 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i16, align 2
  %11 = alloca i32, align 4
  %12 = alloca i8, align 1
  %13 = alloca i8, align 1
  %14 = alloca i16, align 2
  %15 = alloca %union.__arm_2d_color_fast_rgb_t, align 2
  %16 = alloca i16, align 2
  %17 = alloca %union.__arm_2d_color_fast_rgb_t, align 2
  %18 = alloca i16, align 2
  %19 = alloca i32, align 4
  %20 = alloca i8, align 1
  %21 = alloca i32, align 4
  %22 = alloca i8, align 1
  %23 = alloca %struct.arm_2d_margin_t, align 1
  %24 = alloca ptr, align 8
  %25 = alloca %struct.arm_2d_margin_t, align 1
  %26 = alloca i32, align 4
  %27 = alloca %struct.arm_2d_tile_t, align 8
  %28 = alloca ptr, align 8
  %29 = alloca %struct.arm_2d_region_t, align 2
  %30 = alloca ptr, align 8
  %31 = alloca ptr, align 8
  %32 = alloca %struct.arm_2d_region_t, align 2
  %33 = alloca ptr, align 8
  %34 = alloca ptr, align 8
  %35 = alloca ptr, align 8
  %36 = alloca %struct.arm_2d_size_t, align 2
  %37 = alloca %struct.arm_2d_region_t, align 2
  %38 = alloca ptr, align 8
  %39 = alloca %struct.arm_2d_region_t, align 2
  %40 = alloca ptr, align 8
  %41 = alloca %struct.arm_2d_size_t, align 2
  %42 = alloca i16, align 2
  %43 = alloca %struct.__arm_2d_layout_t, align 8
  %44 = alloca ptr, align 8
  %45 = alloca %struct.arm_2d_region_t, align 2
  %46 = alloca ptr, align 8
  %47 = alloca i16, align 2
  %48 = alloca %union.arm_2d_color_rgb565_t, align 2
  %49 = alloca i16, align 2
  %50 = alloca i8, align 1
  %51 = alloca %struct.arm_2d_region_t, align 2
  %52 = alloca ptr, align 8
  %53 = alloca i16, align 2
  %54 = alloca %union.arm_2d_color_rgb565_t, align 2
  %55 = alloca %union.arm_2d_color_rgb565_t, align 2
  %56 = alloca i16, align 2
  %57 = alloca i8, align 1
  %58 = alloca %struct.arm_2d_region_t, align 2
  %59 = alloca ptr, align 8
  %60 = alloca i16, align 2
  %61 = alloca %union.arm_2d_color_rgb565_t, align 2
  %62 = alloca i16, align 2
  %63 = alloca i8, align 1
  %64 = alloca i8, align 1
  %65 = alloca %struct.arm_2d_margin_t, align 1
  %66 = alloca %struct.arm_2d_margin_t, align 1
  %67 = alloca ptr, align 8
  %68 = alloca %struct.arm_2d_margin_t, align 1
  %69 = alloca %struct.arm_2d_tile_t, align 8
  %70 = alloca ptr, align 8
  %71 = alloca %struct.arm_2d_region_t, align 2
  %72 = alloca ptr, align 8
  %73 = alloca ptr, align 8
  %74 = alloca %struct.arm_2d_region_t, align 2
  %75 = alloca ptr, align 8
  %76 = alloca ptr, align 8
  %77 = alloca ptr, align 8
  %78 = alloca %struct.arm_2d_region_t, align 2
  %79 = alloca ptr, align 8
  %80 = alloca %struct.arm_2d_region_t, align 2
  %81 = alloca ptr, align 8
  %82 = alloca %struct.arm_2d_size_t, align 2
  %83 = alloca i16, align 2
  %84 = alloca %union.arm_2d_color_rgb565_t, align 2
  %85 = alloca i8, align 1
  %86 = alloca i8, align 1
  %87 = alloca %struct.arm_2d_margin_t, align 1
  %88 = alloca ptr, align 8
  %89 = alloca %struct.arm_2d_margin_t, align 1
  %90 = alloca %struct.arm_2d_tile_t, align 8
  %91 = alloca ptr, align 8
  %92 = alloca %struct.arm_2d_region_t, align 2
  %93 = alloca ptr, align 8
  %94 = alloca ptr, align 8
  %95 = alloca %struct.arm_2d_region_t, align 2
  %96 = alloca ptr, align 8
  %97 = alloca ptr, align 8
  %98 = alloca ptr, align 8
  %99 = alloca %struct.arm_2d_region_t, align 2
  %100 = alloca ptr, align 8
  %101 = alloca %struct.arm_2d_region_t, align 2
  %102 = alloca ptr, align 8
  %103 = alloca i16, align 2
  %104 = alloca %union.arm_2d_color_rgb565_t, align 2
  %105 = alloca %union.arm_2d_color_rgb565_t, align 2
  %106 = alloca i8, align 1
  %107 = alloca %struct.arm_2d_region_t, align 2
  %108 = alloca ptr, align 8
  %109 = alloca %struct.arm_2d_region_t, align 2
  %110 = alloca ptr, align 8
  %111 = alloca i16, align 2
  %112 = alloca %union.arm_2d_color_rgb565_t, align 2
  %113 = alloca %union.arm_2d_color_rgb565_t, align 2
  %114 = alloca i8, align 1
  %115 = alloca i8, align 1
  %116 = alloca i8, align 1
  %117 = alloca i8, align 1
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store i16 %3, ptr %10, align 2, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !11
  %118 = zext i1 %5 to i8
  store i8 %118, ptr %12, align 1, !tbaa !13
  %119 = load i16, ptr %10, align 2, !tbaa !9
  %120 = zext i16 %119 to i32
  %121 = icmp slt i32 1000, %120
  br i1 %121, label %122, label %123

122:                                              ; preds = %6
  br label %126

123:                                              ; preds = %6
  %124 = load i16, ptr %10, align 2, !tbaa !9
  %125 = zext i16 %124 to i32
  br label %126

126:                                              ; preds = %123, %122
  %127 = phi i32 [ 1000, %122 ], [ %125, %123 ]
  %128 = trunc i32 %127 to i16
  store i16 %128, ptr %10, align 2, !tbaa !9
  %129 = load i8, ptr %12, align 1, !tbaa !13, !range !15, !noundef !16
  %130 = trunc i8 %129 to i1
  br i1 %130, label %131, label %165

131:                                              ; preds = %126
  %132 = load i16, ptr %10, align 2, !tbaa !9
  %133 = load ptr, ptr %7, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.battery_liquid_t, ptr %133, i32 0, i32 0
  %135 = getelementptr inbounds %struct.anon.19, ptr %134, i32 0, i32 1
  store i16 %132, ptr %135, align 8, !tbaa !17
  %136 = load i32, ptr %11, align 4, !tbaa !11
  %137 = load ptr, ptr %7, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.battery_liquid_t, ptr %137, i32 0, i32 0
  %139 = getelementptr inbounds %struct.anon.19, ptr %138, i32 0, i32 6
  store i32 %136, ptr %139, align 8, !tbaa !20
  %140 = call i64 @arm_2d_helper_convert_ms_to_ticks(i32 noundef 10)
  %141 = load ptr, ptr %7, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.battery_liquid_t, ptr %141, i32 0, i32 0
  %143 = getelementptr inbounds %struct.anon.19, ptr %142, i32 0, i32 0
  %144 = getelementptr inbounds [2 x i64], ptr %143, i64 0, i64 1
  %145 = call zeroext i1 @__arm_2d_helper_is_time_out(i64 noundef %140, ptr noundef %144)
  %146 = zext i1 %145 to i8
  store i8 %146, ptr %13, align 1, !tbaa !13
  %147 = load i8, ptr %13, align 1, !tbaa !13, !range !15, !noundef !16
  %148 = trunc i8 %147 to i1
  br i1 %148, label %149, label %164

149:                                              ; preds = %131
  %150 = load ptr, ptr %7, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.battery_liquid_t, ptr %150, i32 0, i32 0
  %152 = getelementptr inbounds %struct.anon.19, ptr %151, i32 0, i32 4
  %153 = load i16, ptr %152, align 4, !tbaa !21
  %154 = add i16 %153, 1
  store i16 %154, ptr %152, align 4, !tbaa !21
  %155 = sext i16 %153 to i32
  %156 = load i16, ptr getelementptr inbounds (%struct.arm_2d_region_t, ptr getelementptr inbounds (%struct.arm_2d_tile_t, ptr @c_tileSinWaveMask, i32 0, i32 1), i32 0, i32 1), align 4, !tbaa !22
  %157 = sext i16 %156 to i32
  %158 = icmp sge i32 %155, %157
  br i1 %158, label %159, label %163

159:                                              ; preds = %149
  %160 = load ptr, ptr %7, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.battery_liquid_t, ptr %160, i32 0, i32 0
  %162 = getelementptr inbounds %struct.anon.19, ptr %161, i32 0, i32 4
  store i16 0, ptr %162, align 4, !tbaa !21
  br label %163

163:                                              ; preds = %159, %149
  br label %164

164:                                              ; preds = %163, %131
  br label %165

165:                                              ; preds = %164, %126
  call void @llvm.lifetime.start.p0(i64 2, ptr %14) #6
  %166 = load ptr, ptr %7, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.battery_liquid_t, ptr %166, i32 0, i32 0
  %168 = getelementptr inbounds %struct.anon.19, ptr %167, i32 0, i32 6
  %169 = load i32, ptr %168, align 8, !tbaa !20
  switch i32 %169, label %199 [
    i32 1, label %170
    i32 0, label %189
    i32 -1, label %190
  ]

170:                                              ; preds = %165
  %171 = load ptr, ptr %7, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.battery_liquid_t, ptr %171, i32 0, i32 0
  %173 = getelementptr inbounds %struct.anon.19, ptr %172, i32 0, i32 1
  %174 = load i16, ptr %173, align 8, !tbaa !17
  %175 = zext i16 %174 to i32
  %176 = icmp sgt i32 %175, 800
  br i1 %176, label %177, label %187

177:                                              ; preds = %170
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %178 = load ptr, ptr %7, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.battery_liquid_t, ptr %178, i32 0, i32 0
  %180 = getelementptr inbounds %struct.anon.19, ptr %179, i32 0, i32 1
  %181 = load i16, ptr %180, align 8, !tbaa !17
  %182 = zext i16 %181 to i32
  %183 = sub nsw i32 %182, 800
  %184 = call i32 @__arm_2d_helper_colour_slider(i32 noundef -23296, i32 noundef -16711936, i32 noundef 200, i32 noundef %183)
  call void @__arm_2d_ccca8888_unpack(i32 noundef %184, ptr noundef %15)
  %185 = call zeroext i16 @__arm_2d_rgb565_pack(ptr noundef %15)
  store i16 %185, ptr %16, align 2, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  %186 = load i16, ptr %16, align 2, !tbaa !9
  store i16 %186, ptr %14, align 2, !tbaa !9
  br label %188

187:                                              ; preds = %170
  store i16 -736, ptr %14, align 2, !tbaa !9
  br label %188

188:                                              ; preds = %187, %177
  br label %199

189:                                              ; preds = %165
  store i16 -14824, ptr %14, align 2, !tbaa !9
  br label %199

190:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %191 = load ptr, ptr %7, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.battery_liquid_t, ptr %191, i32 0, i32 0
  %193 = getelementptr inbounds %struct.anon.19, ptr %192, i32 0, i32 1
  %194 = load i16, ptr %193, align 8, !tbaa !17
  %195 = zext i16 %194 to i32
  %196 = call i32 @__arm_2d_helper_colour_slider(i32 noundef -65536, i32 noundef -16711936, i32 noundef 1000, i32 noundef %195)
  call void @__arm_2d_ccca8888_unpack(i32 noundef %196, ptr noundef %17)
  %197 = call zeroext i16 @__arm_2d_rgb565_pack(ptr noundef %17)
  store i16 %197, ptr %18, align 2, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  %198 = load i16, ptr %18, align 2, !tbaa !9
  store i16 %198, ptr %14, align 2, !tbaa !9
  br label %199

199:                                              ; preds = %190, %189, %188, %165
  %200 = load i8, ptr %12, align 1, !tbaa !13, !range !15, !noundef !16
  %201 = trunc i8 %200 to i1
  br i1 %201, label %202, label %273

202:                                              ; preds = %199
  %203 = load ptr, ptr %7, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.battery_liquid_t, ptr %203, i32 0, i32 0
  %205 = getelementptr inbounds %struct.anon.19, ptr %204, i32 0, i32 6
  %206 = load i32, ptr %205, align 8, !tbaa !20
  %207 = icmp eq i32 1, %206
  br i1 %207, label %208, label %229

208:                                              ; preds = %202
  %209 = load ptr, ptr %7, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.battery_liquid_t, ptr %209, i32 0, i32 0
  %211 = getelementptr inbounds %struct.anon.19, ptr %210, i32 0, i32 2
  store i8 -128, ptr %211, align 2, !tbaa !23
  %212 = load ptr, ptr %7, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.battery_liquid_t, ptr %212, i32 0, i32 0
  %214 = getelementptr inbounds %struct.anon.19, ptr %213, i32 0, i32 5
  store i8 0, ptr %214, align 2, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %215 = call i64 @arm_2d_helper_convert_ms_to_ticks(i32 noundef 2000)
  %216 = load ptr, ptr %7, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.battery_liquid_t, ptr %216, i32 0, i32 0
  %218 = getelementptr inbounds %struct.anon.19, ptr %217, i32 0, i32 0
  %219 = getelementptr inbounds [2 x i64], ptr %218, i64 0, i64 0
  %220 = call zeroext i1 @__arm_2d_helper_time_cos_slider(i32 noundef 0, i32 noundef 191, i64 noundef %215, float noundef 0.000000e+00, ptr noundef %19, ptr noundef %219)
  %221 = zext i1 %220 to i8
  store i8 %221, ptr %20, align 1, !tbaa !13
  %222 = load i8, ptr %20, align 1, !tbaa !13, !range !15, !noundef !16
  %223 = trunc i8 %222 to i1
  %224 = load i32, ptr %19, align 4, !tbaa !11
  %225 = trunc i32 %224 to i8
  %226 = load ptr, ptr %7, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.battery_liquid_t, ptr %226, i32 0, i32 0
  %228 = getelementptr inbounds %struct.anon.19, ptr %227, i32 0, i32 3
  store i8 %225, ptr %228, align 1, !tbaa !25
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %272

229:                                              ; preds = %202
  %230 = load ptr, ptr %7, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.battery_liquid_t, ptr %230, i32 0, i32 0
  %232 = getelementptr inbounds %struct.anon.19, ptr %231, i32 0, i32 1
  %233 = load i16, ptr %232, align 8, !tbaa !17
  %234 = zext i16 %233 to i32
  %235 = icmp slt i32 %234, 100
  br i1 %235, label %236, label %260

236:                                              ; preds = %229
  %237 = load ptr, ptr %7, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.battery_liquid_t, ptr %237, i32 0, i32 0
  %239 = getelementptr inbounds %struct.anon.19, ptr %238, i32 0, i32 6
  %240 = load i32, ptr %239, align 8, !tbaa !20
  %241 = icmp eq i32 %240, -1
  br i1 %241, label %242, label %260

242:                                              ; preds = %236
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %243 = call i64 @arm_2d_helper_convert_ms_to_ticks(i32 noundef 2000)
  %244 = load ptr, ptr %7, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.battery_liquid_t, ptr %244, i32 0, i32 0
  %246 = getelementptr inbounds %struct.anon.19, ptr %245, i32 0, i32 0
  %247 = getelementptr inbounds [2 x i64], ptr %246, i64 0, i64 0
  %248 = call zeroext i1 @__arm_2d_helper_time_cos_slider(i32 noundef 128, i32 noundef 0, i64 noundef %243, float noundef 0.000000e+00, ptr noundef %21, ptr noundef %247)
  %249 = zext i1 %248 to i8
  store i8 %249, ptr %22, align 1, !tbaa !13
  %250 = load i8, ptr %22, align 1, !tbaa !13, !range !15, !noundef !16
  %251 = trunc i8 %250 to i1
  %252 = load i32, ptr %21, align 4, !tbaa !11
  %253 = trunc i32 %252 to i8
  %254 = load ptr, ptr %7, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct.battery_liquid_t, ptr %254, i32 0, i32 0
  %256 = getelementptr inbounds %struct.anon.19, ptr %255, i32 0, i32 2
  store i8 %253, ptr %256, align 2, !tbaa !23
  %257 = load ptr, ptr %7, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.battery_liquid_t, ptr %257, i32 0, i32 0
  %259 = getelementptr inbounds %struct.anon.19, ptr %258, i32 0, i32 5
  store i8 1, ptr %259, align 2, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %271

260:                                              ; preds = %236, %229
  %261 = load ptr, ptr %7, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct.battery_liquid_t, ptr %261, i32 0, i32 0
  %263 = getelementptr inbounds %struct.anon.19, ptr %262, i32 0, i32 0
  %264 = getelementptr inbounds [2 x i64], ptr %263, i64 0, i64 0
  store i64 0, ptr %264, align 8, !tbaa !26
  %265 = load ptr, ptr %7, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct.battery_liquid_t, ptr %265, i32 0, i32 0
  %267 = getelementptr inbounds %struct.anon.19, ptr %266, i32 0, i32 2
  store i8 -128, ptr %267, align 2, !tbaa !23
  %268 = load ptr, ptr %7, align 8, !tbaa !5
  %269 = getelementptr inbounds %struct.battery_liquid_t, ptr %268, i32 0, i32 0
  %270 = getelementptr inbounds %struct.anon.19, ptr %269, i32 0, i32 5
  store i8 0, ptr %270, align 2, !tbaa !24
  br label %271

271:                                              ; preds = %260, %242
  br label %272

272:                                              ; preds = %271, %208
  br label %273

273:                                              ; preds = %272, %199
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  store ptr null, ptr %24, align 8, !tbaa !5
  br label %274

274:                                              ; preds = %1746, %273
  %275 = load ptr, ptr %24, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %275, i32 1
  store ptr %276, ptr %24, align 8, !tbaa !5
  %277 = icmp eq ptr %275, null
  br i1 %277, label %278, label %283

278:                                              ; preds = %274
  %279 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %25, i32 0, i32 0
  store i8 0, ptr %279, align 1, !tbaa !28
  %280 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %25, i32 0, i32 1
  store i8 0, ptr %280, align 1, !tbaa !30
  %281 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %25, i32 0, i32 2
  store i8 0, ptr %281, align 1, !tbaa !31
  %282 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %25, i32 0, i32 3
  store i8 0, ptr %282, align 1, !tbaa !32
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %23, ptr align 1 %25, i64 4, i1 false), !tbaa.struct !33
  br label %284

283:                                              ; preds = %274
  br label %284

284:                                              ; preds = %283, %278
  %285 = phi i32 [ 1, %278 ], [ 0, %283 ]
  %286 = icmp ne i32 %285, 0
  br i1 %286, label %288, label %287

287:                                              ; preds = %284
  store i32 3, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %1747

288:                                              ; preds = %284
  call void @llvm.lifetime.start.p0(i64 24, ptr %27) #6
  call void @llvm.memset.p0.i64(ptr align 8 %27, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  store ptr null, ptr %28, align 8, !tbaa !5
  br label %289

289:                                              ; preds = %1744, %288
  %290 = load ptr, ptr %28, align 8, !tbaa !5
  %291 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %290, i32 1
  store ptr %291, ptr %28, align 8, !tbaa !5
  %292 = icmp eq ptr %290, null
  br i1 %292, label %293, label %364

293:                                              ; preds = %289
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #6
  call void @llvm.memset.p0.i64(ptr align 2 %29, i8 0, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #6
  %294 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %294, ptr %30, align 8, !tbaa !5
  %295 = load ptr, ptr %30, align 8, !tbaa !5
  %296 = icmp eq ptr null, %295
  br i1 %296, label %297, label %303

297:                                              ; preds = %293
  %298 = call ptr @arm_2d_get_default_frame_buffer()
  store ptr %298, ptr %30, align 8, !tbaa !5
  %299 = load ptr, ptr %30, align 8, !tbaa !5
  %300 = icmp eq ptr null, %299
  br i1 %300, label %301, label %302

301:                                              ; preds = %297
  store i32 5, ptr %26, align 4
  br label %360

302:                                              ; preds = %297
  br label %303

303:                                              ; preds = %302, %293
  %304 = load ptr, ptr %9, align 8, !tbaa !5
  %305 = icmp eq ptr null, %304
  br i1 %305, label %306, label %311

306:                                              ; preds = %303
  %307 = getelementptr inbounds %struct.arm_2d_region_t, ptr %29, i32 0, i32 1
  %308 = load ptr, ptr %30, align 8, !tbaa !5
  %309 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %308, i32 0, i32 1
  %310 = getelementptr inbounds %struct.arm_2d_region_t, ptr %309, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %307, ptr align 4 %310, i64 4, i1 false), !tbaa.struct !34
  br label %313

311:                                              ; preds = %303
  %312 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %29, ptr align 2 %312, i64 8, i1 false), !tbaa.struct !35
  br label %313

313:                                              ; preds = %311, %306
  %314 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %23, i32 0, i32 0
  %315 = load i8, ptr %314, align 1, !tbaa !28
  %316 = zext i8 %315 to i32
  %317 = getelementptr inbounds %struct.arm_2d_region_t, ptr %29, i32 0, i32 0
  %318 = getelementptr inbounds %struct.arm_2d_location_t, ptr %317, i32 0, i32 0
  %319 = load i16, ptr %318, align 2, !tbaa !22
  %320 = sext i16 %319 to i32
  %321 = add nsw i32 %320, %316
  %322 = trunc i32 %321 to i16
  store i16 %322, ptr %318, align 2, !tbaa !22
  %323 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %23, i32 0, i32 2
  %324 = load i8, ptr %323, align 1, !tbaa !31
  %325 = zext i8 %324 to i32
  %326 = getelementptr inbounds %struct.arm_2d_region_t, ptr %29, i32 0, i32 0
  %327 = getelementptr inbounds %struct.arm_2d_location_t, ptr %326, i32 0, i32 1
  %328 = load i16, ptr %327, align 2, !tbaa !22
  %329 = sext i16 %328 to i32
  %330 = add nsw i32 %329, %325
  %331 = trunc i32 %330 to i16
  store i16 %331, ptr %327, align 2, !tbaa !22
  %332 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %23, i32 0, i32 0
  %333 = load i8, ptr %332, align 1, !tbaa !28
  %334 = zext i8 %333 to i32
  %335 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %23, i32 0, i32 1
  %336 = load i8, ptr %335, align 1, !tbaa !30
  %337 = zext i8 %336 to i32
  %338 = add nsw i32 %334, %337
  %339 = getelementptr inbounds %struct.arm_2d_region_t, ptr %29, i32 0, i32 1
  %340 = getelementptr inbounds %struct.arm_2d_size_t, ptr %339, i32 0, i32 0
  %341 = load i16, ptr %340, align 2, !tbaa !22
  %342 = sext i16 %341 to i32
  %343 = sub nsw i32 %342, %338
  %344 = trunc i32 %343 to i16
  store i16 %344, ptr %340, align 2, !tbaa !22
  %345 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %23, i32 0, i32 2
  %346 = load i8, ptr %345, align 1, !tbaa !31
  %347 = zext i8 %346 to i32
  %348 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %23, i32 0, i32 3
  %349 = load i8, ptr %348, align 1, !tbaa !32
  %350 = zext i8 %349 to i32
  %351 = add nsw i32 %347, %350
  %352 = getelementptr inbounds %struct.arm_2d_region_t, ptr %29, i32 0, i32 1
  %353 = getelementptr inbounds %struct.arm_2d_size_t, ptr %352, i32 0, i32 1
  %354 = load i16, ptr %353, align 2, !tbaa !22
  %355 = sext i16 %354 to i32
  %356 = sub nsw i32 %355, %351
  %357 = trunc i32 %356 to i16
  store i16 %357, ptr %353, align 2, !tbaa !22
  %358 = load ptr, ptr %30, align 8, !tbaa !5
  %359 = call ptr @arm_2d_tile_generate_child(ptr noundef %358, ptr noundef %29, ptr noundef %27, i1 noundef zeroext false)
  store ptr %359, ptr %31, align 8, !tbaa !5
  store i32 0, ptr %26, align 4
  br label %360

360:                                              ; preds = %313, %301
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  %361 = load i32, ptr %26, align 4
  switch i32 %361, label %1745 [
    i32 0, label %362
  ]

362:                                              ; preds = %360
  %363 = load ptr, ptr %31, align 8, !tbaa !5
  br label %365

364:                                              ; preds = %289
  br label %365

365:                                              ; preds = %364, %362
  %366 = phi i32 [ 1, %362 ], [ 0, %364 ]
  %367 = icmp ne i32 %366, 0
  br i1 %367, label %369, label %368

368:                                              ; preds = %365
  store i32 5, ptr %26, align 4
  br label %1745

369:                                              ; preds = %365
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #6
  call void @llvm.memset.p0.i64(ptr align 2 %32, i8 0, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #6
  store ptr null, ptr %33, align 8, !tbaa !5
  br label %370

370:                                              ; preds = %1738, %369
  %371 = load ptr, ptr %33, align 8, !tbaa !5
  %372 = getelementptr inbounds %struct.arm_2d_region_t, ptr %371, i32 1
  store ptr %372, ptr %33, align 8, !tbaa !5
  %373 = icmp eq ptr %371, null
  br i1 %373, label %374, label %378

374:                                              ; preds = %370
  %375 = getelementptr inbounds %struct.arm_2d_region_t, ptr %32, i32 0, i32 1
  %376 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %27, i32 0, i32 1
  %377 = getelementptr inbounds %struct.arm_2d_region_t, ptr %376, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %375, ptr align 4 %377, i64 4, i1 false), !tbaa.struct !34
  br label %379

378:                                              ; preds = %370
  br label %379

379:                                              ; preds = %378, %374
  %380 = phi i32 [ 1, %374 ], [ 0, %378 ]
  %381 = icmp ne i32 %380, 0
  br i1 %381, label %383, label %382

382:                                              ; preds = %379
  store i32 8, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #6
  br label %1743

383:                                              ; preds = %379
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #6
  store ptr %27, ptr %34, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #6
  store ptr null, ptr %35, align 8, !tbaa !5
  br label %384

384:                                              ; preds = %1735, %383
  %385 = load ptr, ptr %35, align 8, !tbaa !5
  %386 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %385, i32 1
  store ptr %386, ptr %35, align 8, !tbaa !5
  %387 = icmp eq ptr %385, null
  br i1 %387, label %389, label %388

388:                                              ; preds = %384
  store i32 11, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #6
  br label %1737

389:                                              ; preds = %384
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %36, ptr align 4 getelementptr inbounds (%struct.arm_2d_region_t, ptr getelementptr inbounds (%struct.arm_2d_tile_t, ptr @c_tileBatteryBoarderTopMask, i32 0, i32 1), i32 0, i32 1), i64 4, i1 false), !tbaa.struct !34
  %390 = load i16, ptr getelementptr inbounds (%struct.arm_2d_size_t, ptr getelementptr inbounds (%struct.arm_2d_region_t, ptr getelementptr inbounds (%struct.arm_2d_tile_t, ptr @c_tileBatteryBoarderBottomMask, i32 0, i32 1), i32 0, i32 1), i32 0, i32 1), align 2, !tbaa !22
  %391 = sext i16 %390 to i32
  %392 = getelementptr inbounds %struct.arm_2d_size_t, ptr %36, i32 0, i32 1
  %393 = load i16, ptr %392, align 2, !tbaa !36
  %394 = sext i16 %393 to i32
  %395 = add nsw i32 %394, %391
  %396 = trunc i32 %395 to i16
  store i16 %396, ptr %392, align 2, !tbaa !36
  %397 = getelementptr inbounds %struct.arm_2d_size_t, ptr %36, i32 0, i32 1
  %398 = load i16, ptr %397, align 2, !tbaa !36
  %399 = sext i16 %398 to i32
  %400 = add nsw i32 %399, 72
  %401 = trunc i32 %400 to i16
  store i16 %401, ptr %397, align 2, !tbaa !36
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %37, ptr align 2 %32, i64 8, i1 false), !tbaa.struct !35
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #6
  store ptr null, ptr %38, align 8, !tbaa !5
  br label %402

402:                                              ; preds = %1733, %389
  %403 = load ptr, ptr %38, align 8, !tbaa !5
  %404 = getelementptr inbounds %struct.arm_2d_region_t, ptr %403, i32 1
  store ptr %404, ptr %38, align 8, !tbaa !5
  %405 = icmp eq ptr %403, null
  br i1 %405, label %407, label %406

406:                                              ; preds = %402
  store i32 14, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #6
  br label %1734

407:                                              ; preds = %402
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #6
  store ptr null, ptr %40, align 8, !tbaa !5
  br label %408

408:                                              ; preds = %1728, %407
  %409 = load ptr, ptr %40, align 8, !tbaa !5
  %410 = getelementptr inbounds %struct.arm_2d_region_t, ptr %409, i32 1
  store ptr %410, ptr %40, align 8, !tbaa !5
  %411 = icmp eq ptr %409, null
  br i1 %411, label %412, label %454

412:                                              ; preds = %408
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %41, ptr align 2 %36, i64 4, i1 false), !tbaa.struct !34
  %413 = getelementptr inbounds %struct.arm_2d_size_t, ptr %41, i32 0, i32 0
  %414 = load i16, ptr %413, align 2, !tbaa !38
  %415 = getelementptr inbounds %struct.arm_2d_region_t, ptr %39, i32 0, i32 1
  %416 = getelementptr inbounds %struct.arm_2d_size_t, ptr %415, i32 0, i32 0
  store i16 %414, ptr %416, align 2, !tbaa !22
  %417 = getelementptr inbounds %struct.arm_2d_size_t, ptr %41, i32 0, i32 1
  %418 = load i16, ptr %417, align 2, !tbaa !36
  %419 = getelementptr inbounds %struct.arm_2d_region_t, ptr %39, i32 0, i32 1
  %420 = getelementptr inbounds %struct.arm_2d_size_t, ptr %419, i32 0, i32 1
  store i16 %418, ptr %420, align 2, !tbaa !22
  %421 = getelementptr inbounds %struct.arm_2d_region_t, ptr %39, i32 0, i32 0
  %422 = getelementptr inbounds %struct.arm_2d_region_t, ptr %37, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %421, ptr align 2 %422, i64 4, i1 false), !tbaa.struct !34
  %423 = getelementptr inbounds %struct.arm_2d_region_t, ptr %37, i32 0, i32 1
  %424 = getelementptr inbounds %struct.arm_2d_size_t, ptr %423, i32 0, i32 0
  %425 = load i16, ptr %424, align 2, !tbaa !22
  %426 = sext i16 %425 to i32
  %427 = getelementptr inbounds %struct.arm_2d_size_t, ptr %41, i32 0, i32 0
  %428 = load i16, ptr %427, align 2, !tbaa !38
  %429 = sext i16 %428 to i32
  %430 = sub nsw i32 %426, %429
  %431 = ashr i32 %430, 1
  %432 = getelementptr inbounds %struct.arm_2d_region_t, ptr %39, i32 0, i32 0
  %433 = getelementptr inbounds %struct.arm_2d_location_t, ptr %432, i32 0, i32 0
  %434 = load i16, ptr %433, align 2, !tbaa !22
  %435 = sext i16 %434 to i32
  %436 = add nsw i32 %435, %431
  %437 = trunc i32 %436 to i16
  store i16 %437, ptr %433, align 2, !tbaa !22
  %438 = getelementptr inbounds %struct.arm_2d_region_t, ptr %37, i32 0, i32 1
  %439 = getelementptr inbounds %struct.arm_2d_size_t, ptr %438, i32 0, i32 1
  %440 = load i16, ptr %439, align 2, !tbaa !22
  %441 = sext i16 %440 to i32
  %442 = getelementptr inbounds %struct.arm_2d_size_t, ptr %41, i32 0, i32 1
  %443 = load i16, ptr %442, align 2, !tbaa !36
  %444 = sext i16 %443 to i32
  %445 = sub nsw i32 %441, %444
  %446 = ashr i32 %445, 1
  %447 = getelementptr inbounds %struct.arm_2d_region_t, ptr %39, i32 0, i32 0
  %448 = getelementptr inbounds %struct.arm_2d_location_t, ptr %447, i32 0, i32 1
  %449 = load i16, ptr %448, align 2, !tbaa !22
  %450 = sext i16 %449 to i32
  %451 = add nsw i32 %450, %446
  %452 = trunc i32 %451 to i16
  store i16 %452, ptr %448, align 2, !tbaa !22
  store i16 %452, ptr %42, align 2, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #6
  %453 = load i16, ptr %42, align 2, !tbaa !9
  br label %455

454:                                              ; preds = %408
  br label %455

455:                                              ; preds = %454, %412
  %456 = phi i32 [ 1, %412 ], [ 0, %454 ]
  %457 = icmp ne i32 %456, 0
  br i1 %457, label %459, label %458

458:                                              ; preds = %455
  store i32 16, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #6
  br label %1733

459:                                              ; preds = %455
  call void @llvm.lifetime.start.p0(i64 32, ptr %43) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %43, ptr align 8 @__const.battery_gasgauge_liquid_show.__layout_assistant__, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %44) #6
  store ptr null, ptr %44, align 8, !tbaa !5
  br label %460

460:                                              ; preds = %1315, %459
  %461 = load ptr, ptr %44, align 8, !tbaa !5
  %462 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %461, i32 1
  store ptr %462, ptr %44, align 8, !tbaa !5
  %463 = icmp eq ptr %461, null
  br i1 %463, label %464, label %469

464:                                              ; preds = %460
  %465 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %466 = getelementptr inbounds %struct.arm_2d_region_t, ptr %465, i32 0, i32 0
  %467 = getelementptr inbounds %struct.arm_2d_region_t, ptr %39, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %466, ptr align 2 %467, i64 4, i1 false), !tbaa.struct !34
  %468 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %468, ptr align 2 %39, i64 8, i1 false), !tbaa.struct !35
  br label %470

469:                                              ; preds = %460
  br label %470

470:                                              ; preds = %469, %464
  %471 = phi i32 [ 1, %464 ], [ 0, %469 ]
  %472 = icmp ne i32 %471, 0
  br i1 %472, label %474, label %473

473:                                              ; preds = %470
  store i32 19, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %43) #6
  br label %1320

474:                                              ; preds = %470
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #6
  store ptr null, ptr %46, align 8, !tbaa !5
  br label %475

475:                                              ; preds = %696, %474
  %476 = load ptr, ptr %46, align 8, !tbaa !5
  %477 = getelementptr inbounds %struct.arm_2d_region_t, ptr %476, i32 1
  store ptr %477, ptr %46, align 8, !tbaa !5
  %478 = icmp eq ptr %476, null
  br i1 %478, label %479, label %608

479:                                              ; preds = %475
  %480 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 2
  %481 = getelementptr inbounds %struct.arm_2d_region_t, ptr %480, i32 0, i32 1
  %482 = getelementptr inbounds %struct.arm_2d_size_t, ptr %481, i32 0, i32 0
  %483 = load i16, ptr %482, align 4, !tbaa !22
  %484 = sext i16 %483 to i32
  %485 = sub nsw i32 %484, 0
  %486 = sub nsw i32 %485, 0
  %487 = trunc i32 %486 to i16
  %488 = getelementptr inbounds %struct.arm_2d_region_t, ptr %45, i32 0, i32 1
  %489 = getelementptr inbounds %struct.arm_2d_size_t, ptr %488, i32 0, i32 0
  store i16 %487, ptr %489, align 2, !tbaa !22
  %490 = getelementptr inbounds %struct.arm_2d_region_t, ptr %45, i32 0, i32 1
  %491 = getelementptr inbounds %struct.arm_2d_size_t, ptr %490, i32 0, i32 0
  %492 = load i16, ptr %491, align 2, !tbaa !22
  %493 = sext i16 %492 to i32
  %494 = icmp sgt i32 0, %493
  br i1 %494, label %495, label %496

495:                                              ; preds = %479
  br label %501

496:                                              ; preds = %479
  %497 = getelementptr inbounds %struct.arm_2d_region_t, ptr %45, i32 0, i32 1
  %498 = getelementptr inbounds %struct.arm_2d_size_t, ptr %497, i32 0, i32 0
  %499 = load i16, ptr %498, align 2, !tbaa !22
  %500 = sext i16 %499 to i32
  br label %501

501:                                              ; preds = %496, %495
  %502 = phi i32 [ 0, %495 ], [ %500, %496 ]
  %503 = trunc i32 %502 to i16
  %504 = getelementptr inbounds %struct.arm_2d_region_t, ptr %45, i32 0, i32 1
  %505 = getelementptr inbounds %struct.arm_2d_size_t, ptr %504, i32 0, i32 0
  store i16 %503, ptr %505, align 2, !tbaa !22
  %506 = load i16, ptr getelementptr inbounds (%struct.arm_2d_size_t, ptr getelementptr inbounds (%struct.arm_2d_region_t, ptr getelementptr inbounds (%struct.arm_2d_tile_t, ptr @c_tileBatteryBoarderTopMask, i32 0, i32 1), i32 0, i32 1), i32 0, i32 1), align 2, !tbaa !22
  %507 = sext i16 %506 to i32
  %508 = icmp sgt i32 %507, 0
  br i1 %508, label %509, label %512

509:                                              ; preds = %501
  %510 = load i16, ptr getelementptr inbounds (%struct.arm_2d_size_t, ptr getelementptr inbounds (%struct.arm_2d_region_t, ptr getelementptr inbounds (%struct.arm_2d_tile_t, ptr @c_tileBatteryBoarderTopMask, i32 0, i32 1), i32 0, i32 1), i32 0, i32 1), align 2, !tbaa !22
  %511 = sext i16 %510 to i32
  br label %513

512:                                              ; preds = %501
  br label %513

513:                                              ; preds = %512, %509
  %514 = phi i32 [ %511, %509 ], [ 0, %512 ]
  %515 = trunc i32 %514 to i16
  %516 = getelementptr inbounds %struct.arm_2d_region_t, ptr %45, i32 0, i32 1
  %517 = getelementptr inbounds %struct.arm_2d_size_t, ptr %516, i32 0, i32 1
  store i16 %515, ptr %517, align 2, !tbaa !22
  %518 = getelementptr inbounds %struct.arm_2d_region_t, ptr %45, i32 0, i32 0
  %519 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %520 = getelementptr inbounds %struct.arm_2d_region_t, ptr %519, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %518, ptr align 8 %520, i64 4, i1 false), !tbaa.struct !34
  %521 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %522 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %521, i32 0, i32 0
  %523 = load i8, ptr %522, align 2
  %524 = shl i8 %523, 4
  %525 = ashr i8 %524, 6
  %526 = sext i8 %525 to i32
  %527 = mul nsw i32 0, %526
  %528 = getelementptr inbounds %struct.arm_2d_region_t, ptr %45, i32 0, i32 0
  %529 = getelementptr inbounds %struct.arm_2d_location_t, ptr %528, i32 0, i32 0
  %530 = load i16, ptr %529, align 2, !tbaa !22
  %531 = sext i16 %530 to i32
  %532 = add nsw i32 %531, %527
  %533 = trunc i32 %532 to i16
  store i16 %533, ptr %529, align 2, !tbaa !22
  %534 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %535 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %534, i32 0, i32 0
  %536 = load i8, ptr %535, align 2
  %537 = shl i8 %536, 2
  %538 = ashr i8 %537, 6
  %539 = sext i8 %538 to i32
  %540 = mul nsw i32 0, %539
  %541 = getelementptr inbounds %struct.arm_2d_region_t, ptr %45, i32 0, i32 0
  %542 = getelementptr inbounds %struct.arm_2d_location_t, ptr %541, i32 0, i32 0
  %543 = load i16, ptr %542, align 2, !tbaa !22
  %544 = sext i16 %543 to i32
  %545 = add nsw i32 %544, %540
  %546 = trunc i32 %545 to i16
  store i16 %546, ptr %542, align 2, !tbaa !22
  %547 = getelementptr inbounds %struct.arm_2d_region_t, ptr %45, i32 0, i32 1
  %548 = getelementptr inbounds %struct.arm_2d_size_t, ptr %547, i32 0, i32 0
  %549 = load i16, ptr %548, align 2, !tbaa !22
  %550 = sext i16 %549 to i32
  %551 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %552 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %551, i32 0, i32 0
  %553 = load i8, ptr %552, align 2
  %554 = shl i8 %553, 6
  %555 = ashr i8 %554, 6
  %556 = sext i8 %555 to i32
  %557 = mul nsw i32 %550, %556
  %558 = getelementptr inbounds %struct.arm_2d_region_t, ptr %45, i32 0, i32 0
  %559 = getelementptr inbounds %struct.arm_2d_location_t, ptr %558, i32 0, i32 0
  %560 = load i16, ptr %559, align 2, !tbaa !22
  %561 = sext i16 %560 to i32
  %562 = add nsw i32 %561, %557
  %563 = trunc i32 %562 to i16
  store i16 %563, ptr %559, align 2, !tbaa !22
  %564 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %565 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %564, i32 0, i32 1
  %566 = load i8, ptr %565, align 1
  %567 = shl i8 %566, 4
  %568 = ashr i8 %567, 6
  %569 = sext i8 %568 to i32
  %570 = mul nsw i32 0, %569
  %571 = getelementptr inbounds %struct.arm_2d_region_t, ptr %45, i32 0, i32 0
  %572 = getelementptr inbounds %struct.arm_2d_location_t, ptr %571, i32 0, i32 1
  %573 = load i16, ptr %572, align 2, !tbaa !22
  %574 = sext i16 %573 to i32
  %575 = add nsw i32 %574, %570
  %576 = trunc i32 %575 to i16
  store i16 %576, ptr %572, align 2, !tbaa !22
  %577 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %578 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %577, i32 0, i32 1
  %579 = load i8, ptr %578, align 1
  %580 = shl i8 %579, 2
  %581 = ashr i8 %580, 6
  %582 = sext i8 %581 to i32
  %583 = mul nsw i32 0, %582
  %584 = getelementptr inbounds %struct.arm_2d_region_t, ptr %45, i32 0, i32 0
  %585 = getelementptr inbounds %struct.arm_2d_location_t, ptr %584, i32 0, i32 1
  %586 = load i16, ptr %585, align 2, !tbaa !22
  %587 = sext i16 %586 to i32
  %588 = add nsw i32 %587, %583
  %589 = trunc i32 %588 to i16
  store i16 %589, ptr %585, align 2, !tbaa !22
  %590 = getelementptr inbounds %struct.arm_2d_region_t, ptr %45, i32 0, i32 1
  %591 = getelementptr inbounds %struct.arm_2d_size_t, ptr %590, i32 0, i32 1
  %592 = load i16, ptr %591, align 2, !tbaa !22
  %593 = sext i16 %592 to i32
  %594 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %595 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %594, i32 0, i32 1
  %596 = load i8, ptr %595, align 1
  %597 = shl i8 %596, 6
  %598 = ashr i8 %597, 6
  %599 = sext i8 %598 to i32
  %600 = mul nsw i32 %593, %599
  %601 = getelementptr inbounds %struct.arm_2d_region_t, ptr %45, i32 0, i32 0
  %602 = getelementptr inbounds %struct.arm_2d_location_t, ptr %601, i32 0, i32 1
  %603 = load i16, ptr %602, align 2, !tbaa !22
  %604 = sext i16 %603 to i32
  %605 = add nsw i32 %604, %600
  %606 = trunc i32 %605 to i16
  store i16 %606, ptr %602, align 2, !tbaa !22
  store i16 %606, ptr %47, align 2, !tbaa !9
  %607 = load i16, ptr %47, align 2, !tbaa !9
  br label %609

608:                                              ; preds = %475
  br label %609

609:                                              ; preds = %608, %513
  %610 = phi i32 [ 1, %513 ], [ 0, %608 ]
  %611 = icmp ne i32 %610, 0
  br i1 %611, label %613, label %612

612:                                              ; preds = %609
  store i32 22, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #6
  br label %706

613:                                              ; preds = %609
  store i16 -1, ptr %48, align 2, !tbaa !22
  %614 = load ptr, ptr %7, align 8, !tbaa !5
  %615 = getelementptr inbounds %struct.battery_liquid_t, ptr %614, i32 0, i32 0
  %616 = getelementptr inbounds %struct.anon.19, ptr %615, i32 0, i32 2
  %617 = load i8, ptr %616, align 2, !tbaa !23
  %618 = getelementptr inbounds %union.arm_2d_color_rgb565_t, ptr %48, i32 0, i32 0
  %619 = load i16, ptr %618, align 2
  %620 = call i32 @arm_2dp_rgb565_fill_colour_with_mask_and_opacity(ptr noundef null, ptr noundef %27, ptr noundef %45, ptr noundef @c_tileBatteryBoarderTopMask, i16 %619, i8 noundef zeroext %617)
  %621 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  br label %622

622:                                              ; preds = %613
  call void @llvm.lifetime.start.p0(i64 2, ptr %49) #6
  %623 = load i16, ptr getelementptr inbounds (%struct.arm_2d_size_t, ptr getelementptr inbounds (%struct.arm_2d_region_t, ptr getelementptr inbounds (%struct.arm_2d_tile_t, ptr @c_tileBatteryBoarderTopMask, i32 0, i32 1), i32 0, i32 1), i32 0, i32 1), align 2, !tbaa !22
  %624 = sext i16 %623 to i32
  %625 = icmp sgt i32 %624, 0
  br i1 %625, label %626, label %629

626:                                              ; preds = %622
  %627 = load i16, ptr getelementptr inbounds (%struct.arm_2d_size_t, ptr getelementptr inbounds (%struct.arm_2d_region_t, ptr getelementptr inbounds (%struct.arm_2d_tile_t, ptr @c_tileBatteryBoarderTopMask, i32 0, i32 1), i32 0, i32 1), i32 0, i32 1), align 2, !tbaa !22
  %628 = sext i16 %627 to i32
  br label %630

629:                                              ; preds = %622
  br label %630

630:                                              ; preds = %629, %626
  %631 = phi i32 [ %628, %626 ], [ 0, %629 ]
  %632 = add nsw i32 %631, 0
  %633 = add nsw i32 %632, 0
  %634 = trunc i32 %633 to i16
  store i16 %634, ptr %49, align 2, !tbaa !9
  %635 = load i16, ptr %49, align 2, !tbaa !9
  %636 = sext i16 %635 to i32
  %637 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %638 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %637, i32 0, i32 1
  %639 = load i8, ptr %638, align 1
  %640 = ashr i8 %639, 6
  %641 = sext i8 %640 to i32
  %642 = mul nsw i32 %636, %641
  %643 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %644 = getelementptr inbounds %struct.arm_2d_region_t, ptr %643, i32 0, i32 0
  %645 = getelementptr inbounds %struct.arm_2d_location_t, ptr %644, i32 0, i32 1
  %646 = load i16, ptr %645, align 2, !tbaa !22
  %647 = sext i16 %646 to i32
  %648 = add nsw i32 %647, %642
  %649 = trunc i32 %648 to i16
  store i16 %649, ptr %645, align 2, !tbaa !22
  %650 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %651 = getelementptr inbounds %struct.arm_2d_region_t, ptr %650, i32 0, i32 1
  %652 = getelementptr inbounds %struct.arm_2d_size_t, ptr %651, i32 0, i32 1
  %653 = load i16, ptr %652, align 2, !tbaa !22
  %654 = sext i16 %653 to i32
  %655 = load i16, ptr %49, align 2, !tbaa !9
  %656 = sext i16 %655 to i32
  %657 = icmp sgt i32 %654, %656
  br i1 %657, label %658, label %664

658:                                              ; preds = %630
  %659 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %660 = getelementptr inbounds %struct.arm_2d_region_t, ptr %659, i32 0, i32 1
  %661 = getelementptr inbounds %struct.arm_2d_size_t, ptr %660, i32 0, i32 1
  %662 = load i16, ptr %661, align 2, !tbaa !22
  %663 = sext i16 %662 to i32
  br label %667

664:                                              ; preds = %630
  %665 = load i16, ptr %49, align 2, !tbaa !9
  %666 = sext i16 %665 to i32
  br label %667

667:                                              ; preds = %664, %658
  %668 = phi i32 [ %663, %658 ], [ %666, %664 ]
  %669 = trunc i32 %668 to i16
  %670 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %671 = getelementptr inbounds %struct.arm_2d_region_t, ptr %670, i32 0, i32 1
  %672 = getelementptr inbounds %struct.arm_2d_size_t, ptr %671, i32 0, i32 1
  store i16 %669, ptr %672, align 2, !tbaa !22
  %673 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 2
  %674 = getelementptr inbounds %struct.arm_2d_region_t, ptr %673, i32 0, i32 1
  %675 = getelementptr inbounds %struct.arm_2d_size_t, ptr %674, i32 0, i32 0
  %676 = load i16, ptr %675, align 4, !tbaa !22
  %677 = sext i16 %676 to i32
  %678 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %679 = getelementptr inbounds %struct.arm_2d_region_t, ptr %678, i32 0, i32 1
  %680 = getelementptr inbounds %struct.arm_2d_size_t, ptr %679, i32 0, i32 0
  %681 = load i16, ptr %680, align 4, !tbaa !22
  %682 = sext i16 %681 to i32
  %683 = icmp sgt i32 %677, %682
  br i1 %683, label %684, label %690

684:                                              ; preds = %667
  %685 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 2
  %686 = getelementptr inbounds %struct.arm_2d_region_t, ptr %685, i32 0, i32 1
  %687 = getelementptr inbounds %struct.arm_2d_size_t, ptr %686, i32 0, i32 0
  %688 = load i16, ptr %687, align 4, !tbaa !22
  %689 = sext i16 %688 to i32
  br label %696

690:                                              ; preds = %667
  %691 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %692 = getelementptr inbounds %struct.arm_2d_region_t, ptr %691, i32 0, i32 1
  %693 = getelementptr inbounds %struct.arm_2d_size_t, ptr %692, i32 0, i32 0
  %694 = load i16, ptr %693, align 4, !tbaa !22
  %695 = sext i16 %694 to i32
  br label %696

696:                                              ; preds = %690, %684
  %697 = phi i32 [ %689, %684 ], [ %695, %690 ]
  %698 = trunc i32 %697 to i16
  %699 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %700 = getelementptr inbounds %struct.arm_2d_region_t, ptr %699, i32 0, i32 1
  %701 = getelementptr inbounds %struct.arm_2d_size_t, ptr %700, i32 0, i32 0
  store i16 %698, ptr %701, align 4, !tbaa !22
  %702 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %703 = zext i1 %702 to i8
  store i8 %703, ptr %50, align 1, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 2, ptr %49) #6
  %704 = load i8, ptr %50, align 1, !tbaa !13, !range !15, !noundef !16
  %705 = trunc i8 %704 to i1
  br label %475, !llvm.loop !39

706:                                              ; preds = %612
  call void @llvm.lifetime.start.p0(i64 8, ptr %51) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %52) #6
  store ptr null, ptr %52, align 8, !tbaa !5
  br label %707

707:                                              ; preds = %956, %706
  %708 = load ptr, ptr %52, align 8, !tbaa !5
  %709 = getelementptr inbounds %struct.arm_2d_region_t, ptr %708, i32 1
  store ptr %709, ptr %52, align 8, !tbaa !5
  %710 = icmp eq ptr %708, null
  br i1 %710, label %711, label %854

711:                                              ; preds = %707
  %712 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 2
  %713 = getelementptr inbounds %struct.arm_2d_region_t, ptr %712, i32 0, i32 1
  %714 = getelementptr inbounds %struct.arm_2d_size_t, ptr %713, i32 0, i32 0
  %715 = load i16, ptr %714, align 4, !tbaa !22
  %716 = sext i16 %715 to i32
  %717 = sub nsw i32 %716, 0
  %718 = sub nsw i32 %717, 0
  %719 = trunc i32 %718 to i16
  %720 = getelementptr inbounds %struct.arm_2d_region_t, ptr %51, i32 0, i32 1
  %721 = getelementptr inbounds %struct.arm_2d_size_t, ptr %720, i32 0, i32 0
  store i16 %719, ptr %721, align 2, !tbaa !22
  %722 = getelementptr inbounds %struct.arm_2d_region_t, ptr %51, i32 0, i32 1
  %723 = getelementptr inbounds %struct.arm_2d_size_t, ptr %722, i32 0, i32 0
  %724 = load i16, ptr %723, align 2, !tbaa !22
  %725 = sext i16 %724 to i32
  %726 = icmp sgt i32 0, %725
  br i1 %726, label %727, label %728

727:                                              ; preds = %711
  br label %733

728:                                              ; preds = %711
  %729 = getelementptr inbounds %struct.arm_2d_region_t, ptr %51, i32 0, i32 1
  %730 = getelementptr inbounds %struct.arm_2d_size_t, ptr %729, i32 0, i32 0
  %731 = load i16, ptr %730, align 2, !tbaa !22
  %732 = sext i16 %731 to i32
  br label %733

733:                                              ; preds = %728, %727
  %734 = phi i32 [ 0, %727 ], [ %732, %728 ]
  %735 = trunc i32 %734 to i16
  %736 = getelementptr inbounds %struct.arm_2d_region_t, ptr %51, i32 0, i32 1
  %737 = getelementptr inbounds %struct.arm_2d_size_t, ptr %736, i32 0, i32 0
  store i16 %735, ptr %737, align 2, !tbaa !22
  %738 = getelementptr inbounds %struct.arm_2d_size_t, ptr %36, i32 0, i32 1
  %739 = load i16, ptr %738, align 2, !tbaa !36
  %740 = sext i16 %739 to i32
  %741 = load i16, ptr getelementptr inbounds (%struct.arm_2d_size_t, ptr getelementptr inbounds (%struct.arm_2d_region_t, ptr getelementptr inbounds (%struct.arm_2d_tile_t, ptr @c_tileBatteryBoarderBottomMask, i32 0, i32 1), i32 0, i32 1), i32 0, i32 1), align 2, !tbaa !22
  %742 = sext i16 %741 to i32
  %743 = sub nsw i32 %740, %742
  %744 = load i16, ptr getelementptr inbounds (%struct.arm_2d_size_t, ptr getelementptr inbounds (%struct.arm_2d_region_t, ptr getelementptr inbounds (%struct.arm_2d_tile_t, ptr @c_tileBatteryBoarderTopMask, i32 0, i32 1), i32 0, i32 1), i32 0, i32 1), align 2, !tbaa !22
  %745 = sext i16 %744 to i32
  %746 = sub nsw i32 %743, %745
  %747 = icmp sgt i32 %746, 0
  br i1 %747, label %748, label %758

748:                                              ; preds = %733
  %749 = getelementptr inbounds %struct.arm_2d_size_t, ptr %36, i32 0, i32 1
  %750 = load i16, ptr %749, align 2, !tbaa !36
  %751 = sext i16 %750 to i32
  %752 = load i16, ptr getelementptr inbounds (%struct.arm_2d_size_t, ptr getelementptr inbounds (%struct.arm_2d_region_t, ptr getelementptr inbounds (%struct.arm_2d_tile_t, ptr @c_tileBatteryBoarderBottomMask, i32 0, i32 1), i32 0, i32 1), i32 0, i32 1), align 2, !tbaa !22
  %753 = sext i16 %752 to i32
  %754 = sub nsw i32 %751, %753
  %755 = load i16, ptr getelementptr inbounds (%struct.arm_2d_size_t, ptr getelementptr inbounds (%struct.arm_2d_region_t, ptr getelementptr inbounds (%struct.arm_2d_tile_t, ptr @c_tileBatteryBoarderTopMask, i32 0, i32 1), i32 0, i32 1), i32 0, i32 1), align 2, !tbaa !22
  %756 = sext i16 %755 to i32
  %757 = sub nsw i32 %754, %756
  br label %759

758:                                              ; preds = %733
  br label %759

759:                                              ; preds = %758, %748
  %760 = phi i32 [ %757, %748 ], [ 0, %758 ]
  %761 = trunc i32 %760 to i16
  %762 = getelementptr inbounds %struct.arm_2d_region_t, ptr %51, i32 0, i32 1
  %763 = getelementptr inbounds %struct.arm_2d_size_t, ptr %762, i32 0, i32 1
  store i16 %761, ptr %763, align 2, !tbaa !22
  %764 = getelementptr inbounds %struct.arm_2d_region_t, ptr %51, i32 0, i32 0
  %765 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %766 = getelementptr inbounds %struct.arm_2d_region_t, ptr %765, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %764, ptr align 8 %766, i64 4, i1 false), !tbaa.struct !34
  %767 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %768 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %767, i32 0, i32 0
  %769 = load i8, ptr %768, align 2
  %770 = shl i8 %769, 4
  %771 = ashr i8 %770, 6
  %772 = sext i8 %771 to i32
  %773 = mul nsw i32 0, %772
  %774 = getelementptr inbounds %struct.arm_2d_region_t, ptr %51, i32 0, i32 0
  %775 = getelementptr inbounds %struct.arm_2d_location_t, ptr %774, i32 0, i32 0
  %776 = load i16, ptr %775, align 2, !tbaa !22
  %777 = sext i16 %776 to i32
  %778 = add nsw i32 %777, %773
  %779 = trunc i32 %778 to i16
  store i16 %779, ptr %775, align 2, !tbaa !22
  %780 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %781 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %780, i32 0, i32 0
  %782 = load i8, ptr %781, align 2
  %783 = shl i8 %782, 2
  %784 = ashr i8 %783, 6
  %785 = sext i8 %784 to i32
  %786 = mul nsw i32 0, %785
  %787 = getelementptr inbounds %struct.arm_2d_region_t, ptr %51, i32 0, i32 0
  %788 = getelementptr inbounds %struct.arm_2d_location_t, ptr %787, i32 0, i32 0
  %789 = load i16, ptr %788, align 2, !tbaa !22
  %790 = sext i16 %789 to i32
  %791 = add nsw i32 %790, %786
  %792 = trunc i32 %791 to i16
  store i16 %792, ptr %788, align 2, !tbaa !22
  %793 = getelementptr inbounds %struct.arm_2d_region_t, ptr %51, i32 0, i32 1
  %794 = getelementptr inbounds %struct.arm_2d_size_t, ptr %793, i32 0, i32 0
  %795 = load i16, ptr %794, align 2, !tbaa !22
  %796 = sext i16 %795 to i32
  %797 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %798 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %797, i32 0, i32 0
  %799 = load i8, ptr %798, align 2
  %800 = shl i8 %799, 6
  %801 = ashr i8 %800, 6
  %802 = sext i8 %801 to i32
  %803 = mul nsw i32 %796, %802
  %804 = getelementptr inbounds %struct.arm_2d_region_t, ptr %51, i32 0, i32 0
  %805 = getelementptr inbounds %struct.arm_2d_location_t, ptr %804, i32 0, i32 0
  %806 = load i16, ptr %805, align 2, !tbaa !22
  %807 = sext i16 %806 to i32
  %808 = add nsw i32 %807, %803
  %809 = trunc i32 %808 to i16
  store i16 %809, ptr %805, align 2, !tbaa !22
  %810 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %811 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %810, i32 0, i32 1
  %812 = load i8, ptr %811, align 1
  %813 = shl i8 %812, 4
  %814 = ashr i8 %813, 6
  %815 = sext i8 %814 to i32
  %816 = mul nsw i32 0, %815
  %817 = getelementptr inbounds %struct.arm_2d_region_t, ptr %51, i32 0, i32 0
  %818 = getelementptr inbounds %struct.arm_2d_location_t, ptr %817, i32 0, i32 1
  %819 = load i16, ptr %818, align 2, !tbaa !22
  %820 = sext i16 %819 to i32
  %821 = add nsw i32 %820, %816
  %822 = trunc i32 %821 to i16
  store i16 %822, ptr %818, align 2, !tbaa !22
  %823 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %824 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %823, i32 0, i32 1
  %825 = load i8, ptr %824, align 1
  %826 = shl i8 %825, 2
  %827 = ashr i8 %826, 6
  %828 = sext i8 %827 to i32
  %829 = mul nsw i32 0, %828
  %830 = getelementptr inbounds %struct.arm_2d_region_t, ptr %51, i32 0, i32 0
  %831 = getelementptr inbounds %struct.arm_2d_location_t, ptr %830, i32 0, i32 1
  %832 = load i16, ptr %831, align 2, !tbaa !22
  %833 = sext i16 %832 to i32
  %834 = add nsw i32 %833, %829
  %835 = trunc i32 %834 to i16
  store i16 %835, ptr %831, align 2, !tbaa !22
  %836 = getelementptr inbounds %struct.arm_2d_region_t, ptr %51, i32 0, i32 1
  %837 = getelementptr inbounds %struct.arm_2d_size_t, ptr %836, i32 0, i32 1
  %838 = load i16, ptr %837, align 2, !tbaa !22
  %839 = sext i16 %838 to i32
  %840 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %841 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %840, i32 0, i32 1
  %842 = load i8, ptr %841, align 1
  %843 = shl i8 %842, 6
  %844 = ashr i8 %843, 6
  %845 = sext i8 %844 to i32
  %846 = mul nsw i32 %839, %845
  %847 = getelementptr inbounds %struct.arm_2d_region_t, ptr %51, i32 0, i32 0
  %848 = getelementptr inbounds %struct.arm_2d_location_t, ptr %847, i32 0, i32 1
  %849 = load i16, ptr %848, align 2, !tbaa !22
  %850 = sext i16 %849 to i32
  %851 = add nsw i32 %850, %846
  %852 = trunc i32 %851 to i16
  store i16 %852, ptr %848, align 2, !tbaa !22
  store i16 %852, ptr %53, align 2, !tbaa !9
  %853 = load i16, ptr %53, align 2, !tbaa !9
  br label %855

854:                                              ; preds = %707
  br label %855

855:                                              ; preds = %854, %759
  %856 = phi i32 [ 1, %759 ], [ 0, %854 ]
  %857 = icmp ne i32 %856, 0
  br i1 %857, label %859, label %858

858:                                              ; preds = %855
  store i32 25, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %52) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %51) #6
  br label %966

859:                                              ; preds = %855
  store i16 -1, ptr %55, align 2, !tbaa !22
  store i16 -1, ptr %54, align 2, !tbaa !22
  %860 = load ptr, ptr %7, align 8, !tbaa !5
  %861 = getelementptr inbounds %struct.battery_liquid_t, ptr %860, i32 0, i32 0
  %862 = getelementptr inbounds %struct.anon.19, ptr %861, i32 0, i32 2
  %863 = load i8, ptr %862, align 2, !tbaa !23
  %864 = getelementptr inbounds %union.arm_2d_color_rgb565_t, ptr %54, i32 0, i32 0
  %865 = load i16, ptr %864, align 2
  %866 = call i32 @arm_2dp_rgb565_fill_colour_with_horizontal_line_mask_and_opacity(ptr noundef null, ptr noundef %27, ptr noundef %51, ptr noundef @c_tileBatteryBoarderLineMask, i16 %865, i8 noundef zeroext %863)
  %867 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  br label %868

868:                                              ; preds = %859
  call void @llvm.lifetime.start.p0(i64 2, ptr %56) #6
  %869 = getelementptr inbounds %struct.arm_2d_size_t, ptr %36, i32 0, i32 1
  %870 = load i16, ptr %869, align 2, !tbaa !36
  %871 = sext i16 %870 to i32
  %872 = load i16, ptr getelementptr inbounds (%struct.arm_2d_size_t, ptr getelementptr inbounds (%struct.arm_2d_region_t, ptr getelementptr inbounds (%struct.arm_2d_tile_t, ptr @c_tileBatteryBoarderBottomMask, i32 0, i32 1), i32 0, i32 1), i32 0, i32 1), align 2, !tbaa !22
  %873 = sext i16 %872 to i32
  %874 = sub nsw i32 %871, %873
  %875 = load i16, ptr getelementptr inbounds (%struct.arm_2d_size_t, ptr getelementptr inbounds (%struct.arm_2d_region_t, ptr getelementptr inbounds (%struct.arm_2d_tile_t, ptr @c_tileBatteryBoarderTopMask, i32 0, i32 1), i32 0, i32 1), i32 0, i32 1), align 2, !tbaa !22
  %876 = sext i16 %875 to i32
  %877 = sub nsw i32 %874, %876
  %878 = icmp sgt i32 %877, 0
  br i1 %878, label %879, label %889

879:                                              ; preds = %868
  %880 = getelementptr inbounds %struct.arm_2d_size_t, ptr %36, i32 0, i32 1
  %881 = load i16, ptr %880, align 2, !tbaa !36
  %882 = sext i16 %881 to i32
  %883 = load i16, ptr getelementptr inbounds (%struct.arm_2d_size_t, ptr getelementptr inbounds (%struct.arm_2d_region_t, ptr getelementptr inbounds (%struct.arm_2d_tile_t, ptr @c_tileBatteryBoarderBottomMask, i32 0, i32 1), i32 0, i32 1), i32 0, i32 1), align 2, !tbaa !22
  %884 = sext i16 %883 to i32
  %885 = sub nsw i32 %882, %884
  %886 = load i16, ptr getelementptr inbounds (%struct.arm_2d_size_t, ptr getelementptr inbounds (%struct.arm_2d_region_t, ptr getelementptr inbounds (%struct.arm_2d_tile_t, ptr @c_tileBatteryBoarderTopMask, i32 0, i32 1), i32 0, i32 1), i32 0, i32 1), align 2, !tbaa !22
  %887 = sext i16 %886 to i32
  %888 = sub nsw i32 %885, %887
  br label %890

889:                                              ; preds = %868
  br label %890

890:                                              ; preds = %889, %879
  %891 = phi i32 [ %888, %879 ], [ 0, %889 ]
  %892 = add nsw i32 %891, 0
  %893 = add nsw i32 %892, 0
  %894 = trunc i32 %893 to i16
  store i16 %894, ptr %56, align 2, !tbaa !9
  %895 = load i16, ptr %56, align 2, !tbaa !9
  %896 = sext i16 %895 to i32
  %897 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %898 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %897, i32 0, i32 1
  %899 = load i8, ptr %898, align 1
  %900 = ashr i8 %899, 6
  %901 = sext i8 %900 to i32
  %902 = mul nsw i32 %896, %901
  %903 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %904 = getelementptr inbounds %struct.arm_2d_region_t, ptr %903, i32 0, i32 0
  %905 = getelementptr inbounds %struct.arm_2d_location_t, ptr %904, i32 0, i32 1
  %906 = load i16, ptr %905, align 2, !tbaa !22
  %907 = sext i16 %906 to i32
  %908 = add nsw i32 %907, %902
  %909 = trunc i32 %908 to i16
  store i16 %909, ptr %905, align 2, !tbaa !22
  %910 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %911 = getelementptr inbounds %struct.arm_2d_region_t, ptr %910, i32 0, i32 1
  %912 = getelementptr inbounds %struct.arm_2d_size_t, ptr %911, i32 0, i32 1
  %913 = load i16, ptr %912, align 2, !tbaa !22
  %914 = sext i16 %913 to i32
  %915 = load i16, ptr %56, align 2, !tbaa !9
  %916 = sext i16 %915 to i32
  %917 = icmp sgt i32 %914, %916
  br i1 %917, label %918, label %924

918:                                              ; preds = %890
  %919 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %920 = getelementptr inbounds %struct.arm_2d_region_t, ptr %919, i32 0, i32 1
  %921 = getelementptr inbounds %struct.arm_2d_size_t, ptr %920, i32 0, i32 1
  %922 = load i16, ptr %921, align 2, !tbaa !22
  %923 = sext i16 %922 to i32
  br label %927

924:                                              ; preds = %890
  %925 = load i16, ptr %56, align 2, !tbaa !9
  %926 = sext i16 %925 to i32
  br label %927

927:                                              ; preds = %924, %918
  %928 = phi i32 [ %923, %918 ], [ %926, %924 ]
  %929 = trunc i32 %928 to i16
  %930 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %931 = getelementptr inbounds %struct.arm_2d_region_t, ptr %930, i32 0, i32 1
  %932 = getelementptr inbounds %struct.arm_2d_size_t, ptr %931, i32 0, i32 1
  store i16 %929, ptr %932, align 2, !tbaa !22
  %933 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 2
  %934 = getelementptr inbounds %struct.arm_2d_region_t, ptr %933, i32 0, i32 1
  %935 = getelementptr inbounds %struct.arm_2d_size_t, ptr %934, i32 0, i32 0
  %936 = load i16, ptr %935, align 4, !tbaa !22
  %937 = sext i16 %936 to i32
  %938 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %939 = getelementptr inbounds %struct.arm_2d_region_t, ptr %938, i32 0, i32 1
  %940 = getelementptr inbounds %struct.arm_2d_size_t, ptr %939, i32 0, i32 0
  %941 = load i16, ptr %940, align 4, !tbaa !22
  %942 = sext i16 %941 to i32
  %943 = icmp sgt i32 %937, %942
  br i1 %943, label %944, label %950

944:                                              ; preds = %927
  %945 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 2
  %946 = getelementptr inbounds %struct.arm_2d_region_t, ptr %945, i32 0, i32 1
  %947 = getelementptr inbounds %struct.arm_2d_size_t, ptr %946, i32 0, i32 0
  %948 = load i16, ptr %947, align 4, !tbaa !22
  %949 = sext i16 %948 to i32
  br label %956

950:                                              ; preds = %927
  %951 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %952 = getelementptr inbounds %struct.arm_2d_region_t, ptr %951, i32 0, i32 1
  %953 = getelementptr inbounds %struct.arm_2d_size_t, ptr %952, i32 0, i32 0
  %954 = load i16, ptr %953, align 4, !tbaa !22
  %955 = sext i16 %954 to i32
  br label %956

956:                                              ; preds = %950, %944
  %957 = phi i32 [ %949, %944 ], [ %955, %950 ]
  %958 = trunc i32 %957 to i16
  %959 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %960 = getelementptr inbounds %struct.arm_2d_region_t, ptr %959, i32 0, i32 1
  %961 = getelementptr inbounds %struct.arm_2d_size_t, ptr %960, i32 0, i32 0
  store i16 %958, ptr %961, align 4, !tbaa !22
  %962 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %963 = zext i1 %962 to i8
  store i8 %963, ptr %57, align 1, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 2, ptr %56) #6
  %964 = load i8, ptr %57, align 1, !tbaa !13, !range !15, !noundef !16
  %965 = trunc i8 %964 to i1
  br label %707, !llvm.loop !41

966:                                              ; preds = %858
  call void @llvm.lifetime.start.p0(i64 8, ptr %58) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %59) #6
  store ptr null, ptr %59, align 8, !tbaa !5
  br label %967

967:                                              ; preds = %1304, %966
  %968 = load ptr, ptr %59, align 8, !tbaa !5
  %969 = getelementptr inbounds %struct.arm_2d_region_t, ptr %968, i32 1
  store ptr %969, ptr %59, align 8, !tbaa !5
  %970 = icmp eq ptr %968, null
  br i1 %970, label %971, label %1158

971:                                              ; preds = %967
  %972 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 2
  %973 = getelementptr inbounds %struct.arm_2d_region_t, ptr %972, i32 0, i32 1
  %974 = getelementptr inbounds %struct.arm_2d_size_t, ptr %973, i32 0, i32 0
  %975 = load i16, ptr %974, align 4, !tbaa !22
  %976 = sext i16 %975 to i32
  %977 = sub nsw i32 %976, 0
  %978 = sub nsw i32 %977, 0
  %979 = trunc i32 %978 to i16
  %980 = getelementptr inbounds %struct.arm_2d_region_t, ptr %58, i32 0, i32 1
  %981 = getelementptr inbounds %struct.arm_2d_size_t, ptr %980, i32 0, i32 0
  store i16 %979, ptr %981, align 2, !tbaa !22
  %982 = getelementptr inbounds %struct.arm_2d_region_t, ptr %58, i32 0, i32 1
  %983 = getelementptr inbounds %struct.arm_2d_size_t, ptr %982, i32 0, i32 0
  %984 = load i16, ptr %983, align 2, !tbaa !22
  %985 = sext i16 %984 to i32
  %986 = icmp sgt i32 0, %985
  br i1 %986, label %987, label %988

987:                                              ; preds = %971
  br label %993

988:                                              ; preds = %971
  %989 = getelementptr inbounds %struct.arm_2d_region_t, ptr %58, i32 0, i32 1
  %990 = getelementptr inbounds %struct.arm_2d_size_t, ptr %989, i32 0, i32 0
  %991 = load i16, ptr %990, align 2, !tbaa !22
  %992 = sext i16 %991 to i32
  br label %993

993:                                              ; preds = %988, %987
  %994 = phi i32 [ 0, %987 ], [ %992, %988 ]
  %995 = trunc i32 %994 to i16
  %996 = getelementptr inbounds %struct.arm_2d_region_t, ptr %58, i32 0, i32 1
  %997 = getelementptr inbounds %struct.arm_2d_size_t, ptr %996, i32 0, i32 0
  store i16 %995, ptr %997, align 2, !tbaa !22
  %998 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 2
  %999 = getelementptr inbounds %struct.arm_2d_region_t, ptr %998, i32 0, i32 0
  %1000 = getelementptr inbounds %struct.arm_2d_location_t, ptr %999, i32 0, i32 1
  %1001 = load i16, ptr %1000, align 2, !tbaa !22
  %1002 = sext i16 %1001 to i32
  %1003 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 2
  %1004 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1003, i32 0, i32 1
  %1005 = getelementptr inbounds %struct.arm_2d_size_t, ptr %1004, i32 0, i32 1
  %1006 = load i16, ptr %1005, align 2, !tbaa !22
  %1007 = sext i16 %1006 to i32
  %1008 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %1009 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %1008, i32 0, i32 1
  %1010 = load i8, ptr %1009, align 1
  %1011 = shl i8 %1010, 6
  %1012 = ashr i8 %1011, 6
  %1013 = sext i8 %1012 to i32
  %1014 = add nsw i32 %1013, 1
  %1015 = mul nsw i32 %1007, %1014
  %1016 = add nsw i32 %1002, %1015
  %1017 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %1018 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1017, i32 0, i32 0
  %1019 = getelementptr inbounds %struct.arm_2d_location_t, ptr %1018, i32 0, i32 1
  %1020 = load i16, ptr %1019, align 2, !tbaa !22
  %1021 = sext i16 %1020 to i32
  %1022 = sub nsw i32 %1016, %1021
  %1023 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %1024 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %1023, i32 0, i32 1
  %1025 = load i8, ptr %1024, align 1
  %1026 = ashr i8 %1025, 6
  %1027 = sext i8 %1026 to i32
  %1028 = mul nsw i32 %1022, %1027
  %1029 = icmp sgt i32 %1028, 0
  br i1 %1029, label %1030, label %1062

1030:                                             ; preds = %993
  %1031 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 2
  %1032 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1031, i32 0, i32 0
  %1033 = getelementptr inbounds %struct.arm_2d_location_t, ptr %1032, i32 0, i32 1
  %1034 = load i16, ptr %1033, align 2, !tbaa !22
  %1035 = sext i16 %1034 to i32
  %1036 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 2
  %1037 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1036, i32 0, i32 1
  %1038 = getelementptr inbounds %struct.arm_2d_size_t, ptr %1037, i32 0, i32 1
  %1039 = load i16, ptr %1038, align 2, !tbaa !22
  %1040 = sext i16 %1039 to i32
  %1041 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %1042 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %1041, i32 0, i32 1
  %1043 = load i8, ptr %1042, align 1
  %1044 = shl i8 %1043, 6
  %1045 = ashr i8 %1044, 6
  %1046 = sext i8 %1045 to i32
  %1047 = add nsw i32 %1046, 1
  %1048 = mul nsw i32 %1040, %1047
  %1049 = add nsw i32 %1035, %1048
  %1050 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %1051 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1050, i32 0, i32 0
  %1052 = getelementptr inbounds %struct.arm_2d_location_t, ptr %1051, i32 0, i32 1
  %1053 = load i16, ptr %1052, align 2, !tbaa !22
  %1054 = sext i16 %1053 to i32
  %1055 = sub nsw i32 %1049, %1054
  %1056 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %1057 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %1056, i32 0, i32 1
  %1058 = load i8, ptr %1057, align 1
  %1059 = ashr i8 %1058, 6
  %1060 = sext i8 %1059 to i32
  %1061 = mul nsw i32 %1055, %1060
  br label %1063

1062:                                             ; preds = %993
  br label %1063

1063:                                             ; preds = %1062, %1030
  %1064 = phi i32 [ %1061, %1030 ], [ 0, %1062 ]
  %1065 = trunc i32 %1064 to i16
  %1066 = getelementptr inbounds %struct.arm_2d_region_t, ptr %58, i32 0, i32 1
  %1067 = getelementptr inbounds %struct.arm_2d_size_t, ptr %1066, i32 0, i32 1
  store i16 %1065, ptr %1067, align 2, !tbaa !22
  %1068 = getelementptr inbounds %struct.arm_2d_region_t, ptr %58, i32 0, i32 0
  %1069 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %1070 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1069, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %1068, ptr align 8 %1070, i64 4, i1 false), !tbaa.struct !34
  %1071 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %1072 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %1071, i32 0, i32 0
  %1073 = load i8, ptr %1072, align 2
  %1074 = shl i8 %1073, 4
  %1075 = ashr i8 %1074, 6
  %1076 = sext i8 %1075 to i32
  %1077 = mul nsw i32 0, %1076
  %1078 = getelementptr inbounds %struct.arm_2d_region_t, ptr %58, i32 0, i32 0
  %1079 = getelementptr inbounds %struct.arm_2d_location_t, ptr %1078, i32 0, i32 0
  %1080 = load i16, ptr %1079, align 2, !tbaa !22
  %1081 = sext i16 %1080 to i32
  %1082 = add nsw i32 %1081, %1077
  %1083 = trunc i32 %1082 to i16
  store i16 %1083, ptr %1079, align 2, !tbaa !22
  %1084 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %1085 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %1084, i32 0, i32 0
  %1086 = load i8, ptr %1085, align 2
  %1087 = shl i8 %1086, 2
  %1088 = ashr i8 %1087, 6
  %1089 = sext i8 %1088 to i32
  %1090 = mul nsw i32 0, %1089
  %1091 = getelementptr inbounds %struct.arm_2d_region_t, ptr %58, i32 0, i32 0
  %1092 = getelementptr inbounds %struct.arm_2d_location_t, ptr %1091, i32 0, i32 0
  %1093 = load i16, ptr %1092, align 2, !tbaa !22
  %1094 = sext i16 %1093 to i32
  %1095 = add nsw i32 %1094, %1090
  %1096 = trunc i32 %1095 to i16
  store i16 %1096, ptr %1092, align 2, !tbaa !22
  %1097 = getelementptr inbounds %struct.arm_2d_region_t, ptr %58, i32 0, i32 1
  %1098 = getelementptr inbounds %struct.arm_2d_size_t, ptr %1097, i32 0, i32 0
  %1099 = load i16, ptr %1098, align 2, !tbaa !22
  %1100 = sext i16 %1099 to i32
  %1101 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %1102 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %1101, i32 0, i32 0
  %1103 = load i8, ptr %1102, align 2
  %1104 = shl i8 %1103, 6
  %1105 = ashr i8 %1104, 6
  %1106 = sext i8 %1105 to i32
  %1107 = mul nsw i32 %1100, %1106
  %1108 = getelementptr inbounds %struct.arm_2d_region_t, ptr %58, i32 0, i32 0
  %1109 = getelementptr inbounds %struct.arm_2d_location_t, ptr %1108, i32 0, i32 0
  %1110 = load i16, ptr %1109, align 2, !tbaa !22
  %1111 = sext i16 %1110 to i32
  %1112 = add nsw i32 %1111, %1107
  %1113 = trunc i32 %1112 to i16
  store i16 %1113, ptr %1109, align 2, !tbaa !22
  %1114 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %1115 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %1114, i32 0, i32 1
  %1116 = load i8, ptr %1115, align 1
  %1117 = shl i8 %1116, 4
  %1118 = ashr i8 %1117, 6
  %1119 = sext i8 %1118 to i32
  %1120 = mul nsw i32 0, %1119
  %1121 = getelementptr inbounds %struct.arm_2d_region_t, ptr %58, i32 0, i32 0
  %1122 = getelementptr inbounds %struct.arm_2d_location_t, ptr %1121, i32 0, i32 1
  %1123 = load i16, ptr %1122, align 2, !tbaa !22
  %1124 = sext i16 %1123 to i32
  %1125 = add nsw i32 %1124, %1120
  %1126 = trunc i32 %1125 to i16
  store i16 %1126, ptr %1122, align 2, !tbaa !22
  %1127 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %1128 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %1127, i32 0, i32 1
  %1129 = load i8, ptr %1128, align 1
  %1130 = shl i8 %1129, 2
  %1131 = ashr i8 %1130, 6
  %1132 = sext i8 %1131 to i32
  %1133 = mul nsw i32 0, %1132
  %1134 = getelementptr inbounds %struct.arm_2d_region_t, ptr %58, i32 0, i32 0
  %1135 = getelementptr inbounds %struct.arm_2d_location_t, ptr %1134, i32 0, i32 1
  %1136 = load i16, ptr %1135, align 2, !tbaa !22
  %1137 = sext i16 %1136 to i32
  %1138 = add nsw i32 %1137, %1133
  %1139 = trunc i32 %1138 to i16
  store i16 %1139, ptr %1135, align 2, !tbaa !22
  %1140 = getelementptr inbounds %struct.arm_2d_region_t, ptr %58, i32 0, i32 1
  %1141 = getelementptr inbounds %struct.arm_2d_size_t, ptr %1140, i32 0, i32 1
  %1142 = load i16, ptr %1141, align 2, !tbaa !22
  %1143 = sext i16 %1142 to i32
  %1144 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %1145 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %1144, i32 0, i32 1
  %1146 = load i8, ptr %1145, align 1
  %1147 = shl i8 %1146, 6
  %1148 = ashr i8 %1147, 6
  %1149 = sext i8 %1148 to i32
  %1150 = mul nsw i32 %1143, %1149
  %1151 = getelementptr inbounds %struct.arm_2d_region_t, ptr %58, i32 0, i32 0
  %1152 = getelementptr inbounds %struct.arm_2d_location_t, ptr %1151, i32 0, i32 1
  %1153 = load i16, ptr %1152, align 2, !tbaa !22
  %1154 = sext i16 %1153 to i32
  %1155 = add nsw i32 %1154, %1150
  %1156 = trunc i32 %1155 to i16
  store i16 %1156, ptr %1152, align 2, !tbaa !22
  store i16 %1156, ptr %60, align 2, !tbaa !9
  %1157 = load i16, ptr %60, align 2, !tbaa !9
  br label %1159

1158:                                             ; preds = %967
  br label %1159

1159:                                             ; preds = %1158, %1063
  %1160 = phi i32 [ 1, %1063 ], [ 0, %1158 ]
  %1161 = icmp ne i32 %1160, 0
  br i1 %1161, label %1163, label %1162

1162:                                             ; preds = %1159
  store i32 28, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %59) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %58) #6
  br label %1314

1163:                                             ; preds = %1159
  store i16 -1, ptr %61, align 2, !tbaa !22
  %1164 = load ptr, ptr %7, align 8, !tbaa !5
  %1165 = getelementptr inbounds %struct.battery_liquid_t, ptr %1164, i32 0, i32 0
  %1166 = getelementptr inbounds %struct.anon.19, ptr %1165, i32 0, i32 2
  %1167 = load i8, ptr %1166, align 2, !tbaa !23
  %1168 = getelementptr inbounds %union.arm_2d_color_rgb565_t, ptr %61, i32 0, i32 0
  %1169 = load i16, ptr %1168, align 2
  %1170 = call i32 @arm_2dp_rgb565_fill_colour_with_mask_and_opacity(ptr noundef null, ptr noundef %27, ptr noundef %58, ptr noundef @c_tileBatteryBoarderBottomMask, i16 %1169, i8 noundef zeroext %1167)
  %1171 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  br label %1172

1172:                                             ; preds = %1163
  call void @llvm.lifetime.start.p0(i64 2, ptr %62) #6
  %1173 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 2
  %1174 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1173, i32 0, i32 0
  %1175 = getelementptr inbounds %struct.arm_2d_location_t, ptr %1174, i32 0, i32 1
  %1176 = load i16, ptr %1175, align 2, !tbaa !22
  %1177 = sext i16 %1176 to i32
  %1178 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 2
  %1179 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1178, i32 0, i32 1
  %1180 = getelementptr inbounds %struct.arm_2d_size_t, ptr %1179, i32 0, i32 1
  %1181 = load i16, ptr %1180, align 2, !tbaa !22
  %1182 = sext i16 %1181 to i32
  %1183 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %1184 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %1183, i32 0, i32 1
  %1185 = load i8, ptr %1184, align 1
  %1186 = shl i8 %1185, 6
  %1187 = ashr i8 %1186, 6
  %1188 = sext i8 %1187 to i32
  %1189 = add nsw i32 %1188, 1
  %1190 = mul nsw i32 %1182, %1189
  %1191 = add nsw i32 %1177, %1190
  %1192 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %1193 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1192, i32 0, i32 0
  %1194 = getelementptr inbounds %struct.arm_2d_location_t, ptr %1193, i32 0, i32 1
  %1195 = load i16, ptr %1194, align 2, !tbaa !22
  %1196 = sext i16 %1195 to i32
  %1197 = sub nsw i32 %1191, %1196
  %1198 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %1199 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %1198, i32 0, i32 1
  %1200 = load i8, ptr %1199, align 1
  %1201 = ashr i8 %1200, 6
  %1202 = sext i8 %1201 to i32
  %1203 = mul nsw i32 %1197, %1202
  %1204 = icmp sgt i32 %1203, 0
  br i1 %1204, label %1205, label %1237

1205:                                             ; preds = %1172
  %1206 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 2
  %1207 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1206, i32 0, i32 0
  %1208 = getelementptr inbounds %struct.arm_2d_location_t, ptr %1207, i32 0, i32 1
  %1209 = load i16, ptr %1208, align 2, !tbaa !22
  %1210 = sext i16 %1209 to i32
  %1211 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 2
  %1212 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1211, i32 0, i32 1
  %1213 = getelementptr inbounds %struct.arm_2d_size_t, ptr %1212, i32 0, i32 1
  %1214 = load i16, ptr %1213, align 2, !tbaa !22
  %1215 = sext i16 %1214 to i32
  %1216 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %1217 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %1216, i32 0, i32 1
  %1218 = load i8, ptr %1217, align 1
  %1219 = shl i8 %1218, 6
  %1220 = ashr i8 %1219, 6
  %1221 = sext i8 %1220 to i32
  %1222 = add nsw i32 %1221, 1
  %1223 = mul nsw i32 %1215, %1222
  %1224 = add nsw i32 %1210, %1223
  %1225 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %1226 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1225, i32 0, i32 0
  %1227 = getelementptr inbounds %struct.arm_2d_location_t, ptr %1226, i32 0, i32 1
  %1228 = load i16, ptr %1227, align 2, !tbaa !22
  %1229 = sext i16 %1228 to i32
  %1230 = sub nsw i32 %1224, %1229
  %1231 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %1232 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %1231, i32 0, i32 1
  %1233 = load i8, ptr %1232, align 1
  %1234 = ashr i8 %1233, 6
  %1235 = sext i8 %1234 to i32
  %1236 = mul nsw i32 %1230, %1235
  br label %1238

1237:                                             ; preds = %1172
  br label %1238

1238:                                             ; preds = %1237, %1205
  %1239 = phi i32 [ %1236, %1205 ], [ 0, %1237 ]
  %1240 = add nsw i32 %1239, 0
  %1241 = add nsw i32 %1240, 0
  %1242 = trunc i32 %1241 to i16
  store i16 %1242, ptr %62, align 2, !tbaa !9
  %1243 = load i16, ptr %62, align 2, !tbaa !9
  %1244 = sext i16 %1243 to i32
  %1245 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 5
  %1246 = getelementptr inbounds %struct.__arm_2d_layout_align_tab_t, ptr %1245, i32 0, i32 1
  %1247 = load i8, ptr %1246, align 1
  %1248 = ashr i8 %1247, 6
  %1249 = sext i8 %1248 to i32
  %1250 = mul nsw i32 %1244, %1249
  %1251 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %1252 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1251, i32 0, i32 0
  %1253 = getelementptr inbounds %struct.arm_2d_location_t, ptr %1252, i32 0, i32 1
  %1254 = load i16, ptr %1253, align 2, !tbaa !22
  %1255 = sext i16 %1254 to i32
  %1256 = add nsw i32 %1255, %1250
  %1257 = trunc i32 %1256 to i16
  store i16 %1257, ptr %1253, align 2, !tbaa !22
  %1258 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %1259 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1258, i32 0, i32 1
  %1260 = getelementptr inbounds %struct.arm_2d_size_t, ptr %1259, i32 0, i32 1
  %1261 = load i16, ptr %1260, align 2, !tbaa !22
  %1262 = sext i16 %1261 to i32
  %1263 = load i16, ptr %62, align 2, !tbaa !9
  %1264 = sext i16 %1263 to i32
  %1265 = icmp sgt i32 %1262, %1264
  br i1 %1265, label %1266, label %1272

1266:                                             ; preds = %1238
  %1267 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %1268 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1267, i32 0, i32 1
  %1269 = getelementptr inbounds %struct.arm_2d_size_t, ptr %1268, i32 0, i32 1
  %1270 = load i16, ptr %1269, align 2, !tbaa !22
  %1271 = sext i16 %1270 to i32
  br label %1275

1272:                                             ; preds = %1238
  %1273 = load i16, ptr %62, align 2, !tbaa !9
  %1274 = sext i16 %1273 to i32
  br label %1275

1275:                                             ; preds = %1272, %1266
  %1276 = phi i32 [ %1271, %1266 ], [ %1274, %1272 ]
  %1277 = trunc i32 %1276 to i16
  %1278 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %1279 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1278, i32 0, i32 1
  %1280 = getelementptr inbounds %struct.arm_2d_size_t, ptr %1279, i32 0, i32 1
  store i16 %1277, ptr %1280, align 2, !tbaa !22
  %1281 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 2
  %1282 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1281, i32 0, i32 1
  %1283 = getelementptr inbounds %struct.arm_2d_size_t, ptr %1282, i32 0, i32 0
  %1284 = load i16, ptr %1283, align 4, !tbaa !22
  %1285 = sext i16 %1284 to i32
  %1286 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %1287 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1286, i32 0, i32 1
  %1288 = getelementptr inbounds %struct.arm_2d_size_t, ptr %1287, i32 0, i32 0
  %1289 = load i16, ptr %1288, align 4, !tbaa !22
  %1290 = sext i16 %1289 to i32
  %1291 = icmp sgt i32 %1285, %1290
  br i1 %1291, label %1292, label %1298

1292:                                             ; preds = %1275
  %1293 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 2
  %1294 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1293, i32 0, i32 1
  %1295 = getelementptr inbounds %struct.arm_2d_size_t, ptr %1294, i32 0, i32 0
  %1296 = load i16, ptr %1295, align 4, !tbaa !22
  %1297 = sext i16 %1296 to i32
  br label %1304

1298:                                             ; preds = %1275
  %1299 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %1300 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1299, i32 0, i32 1
  %1301 = getelementptr inbounds %struct.arm_2d_size_t, ptr %1300, i32 0, i32 0
  %1302 = load i16, ptr %1301, align 4, !tbaa !22
  %1303 = sext i16 %1302 to i32
  br label %1304

1304:                                             ; preds = %1298, %1292
  %1305 = phi i32 [ %1297, %1292 ], [ %1303, %1298 ]
  %1306 = trunc i32 %1305 to i16
  %1307 = getelementptr inbounds %struct.__arm_2d_layout_t, ptr %43, i32 0, i32 1
  %1308 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1307, i32 0, i32 1
  %1309 = getelementptr inbounds %struct.arm_2d_size_t, ptr %1308, i32 0, i32 0
  store i16 %1306, ptr %1309, align 4, !tbaa !22
  %1310 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %1311 = zext i1 %1310 to i8
  store i8 %1311, ptr %63, align 1, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 2, ptr %62) #6
  %1312 = load i8, ptr %63, align 1, !tbaa !13, !range !15, !noundef !16
  %1313 = trunc i8 %1312 to i1
  br label %967, !llvm.loop !42

1314:                                             ; preds = %1162
  br label %1315

1315:                                             ; preds = %1314
  %1316 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %1317 = zext i1 %1316 to i8
  store i8 %1317, ptr %64, align 1, !tbaa !13
  %1318 = load i8, ptr %64, align 1, !tbaa !13, !range !15, !noundef !16
  %1319 = trunc i8 %1318 to i1
  br label %460, !llvm.loop !43

1320:                                             ; preds = %473
  %1321 = load ptr, ptr %7, align 8, !tbaa !5
  %1322 = getelementptr inbounds %struct.battery_liquid_t, ptr %1321, i32 0, i32 0
  %1323 = getelementptr inbounds %struct.anon.19, ptr %1322, i32 0, i32 1
  %1324 = load i16, ptr %1323, align 8, !tbaa !17
  %1325 = load ptr, ptr %7, align 8, !tbaa !5
  %1326 = getelementptr inbounds %struct.battery_liquid_t, ptr %1325, i32 0, i32 0
  %1327 = getelementptr inbounds %struct.anon.19, ptr %1326, i32 0, i32 4
  %1328 = load i16, ptr %1327, align 4, !tbaa !21
  %1329 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %65, i32 0, i32 0
  store i8 9, ptr %1329, align 1, !tbaa !28
  %1330 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %65, i32 0, i32 1
  store i8 9, ptr %1330, align 1, !tbaa !30
  %1331 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %65, i32 0, i32 2
  store i8 16, ptr %1331, align 1, !tbaa !31
  %1332 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %65, i32 0, i32 3
  store i8 10, ptr %1332, align 1, !tbaa !32
  %1333 = load i16, ptr %14, align 2, !tbaa !9
  %1334 = load i32, ptr %65, align 1
  call void @draw_liquid_wave(ptr noundef %27, ptr noundef %39, i16 noundef zeroext %1324, i16 noundef signext %1328, i32 %1334, i16 noundef zeroext %1333, ptr noundef @c_tileSinWaveMask)
  call void @llvm.lifetime.start.p0(i64 4, ptr %66) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %67) #6
  store ptr null, ptr %67, align 8, !tbaa !5
  br label %1335

1335:                                             ; preds = %1531, %1320
  %1336 = load ptr, ptr %67, align 8, !tbaa !5
  %1337 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %1336, i32 1
  store ptr %1337, ptr %67, align 8, !tbaa !5
  %1338 = icmp eq ptr %1336, null
  br i1 %1338, label %1339, label %1344

1339:                                             ; preds = %1335
  %1340 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %68, i32 0, i32 0
  store i8 9, ptr %1340, align 1, !tbaa !28
  %1341 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %68, i32 0, i32 1
  store i8 9, ptr %1341, align 1, !tbaa !30
  %1342 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %68, i32 0, i32 2
  store i8 16, ptr %1342, align 1, !tbaa !31
  %1343 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %68, i32 0, i32 3
  store i8 10, ptr %1343, align 1, !tbaa !32
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %66, ptr align 1 %68, i64 4, i1 false), !tbaa.struct !33
  br label %1345

1344:                                             ; preds = %1335
  br label %1345

1345:                                             ; preds = %1344, %1339
  %1346 = phi i32 [ 1, %1339 ], [ 0, %1344 ]
  %1347 = icmp ne i32 %1346, 0
  br i1 %1347, label %1349, label %1348

1348:                                             ; preds = %1345
  store i32 31, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %67) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %66) #6
  br label %1532

1349:                                             ; preds = %1345
  call void @llvm.lifetime.start.p0(i64 24, ptr %69) #6
  call void @llvm.memset.p0.i64(ptr align 8 %69, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %70) #6
  store ptr null, ptr %70, align 8, !tbaa !5
  br label %1350

1350:                                             ; preds = %1529, %1349
  %1351 = load ptr, ptr %70, align 8, !tbaa !5
  %1352 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %1351, i32 1
  store ptr %1352, ptr %70, align 8, !tbaa !5
  %1353 = icmp eq ptr %1351, null
  br i1 %1353, label %1354, label %1414

1354:                                             ; preds = %1350
  call void @llvm.lifetime.start.p0(i64 8, ptr %71) #6
  call void @llvm.memset.p0.i64(ptr align 2 %71, i8 0, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %72) #6
  store ptr %27, ptr %72, align 8, !tbaa !5
  %1355 = load ptr, ptr %72, align 8, !tbaa !5
  %1356 = icmp eq ptr null, %1355
  br i1 %1356, label %1357, label %1363

1357:                                             ; preds = %1354
  %1358 = call ptr @arm_2d_get_default_frame_buffer()
  store ptr %1358, ptr %72, align 8, !tbaa !5
  %1359 = load ptr, ptr %72, align 8, !tbaa !5
  %1360 = icmp eq ptr null, %1359
  br i1 %1360, label %1361, label %1362

1361:                                             ; preds = %1357
  store i32 33, ptr %26, align 4
  br label %1410

1362:                                             ; preds = %1357
  br label %1363

1363:                                             ; preds = %1362, %1354
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %71, ptr align 2 %39, i64 8, i1 false), !tbaa.struct !35
  %1364 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %66, i32 0, i32 0
  %1365 = load i8, ptr %1364, align 1, !tbaa !28
  %1366 = zext i8 %1365 to i32
  %1367 = getelementptr inbounds %struct.arm_2d_region_t, ptr %71, i32 0, i32 0
  %1368 = getelementptr inbounds %struct.arm_2d_location_t, ptr %1367, i32 0, i32 0
  %1369 = load i16, ptr %1368, align 2, !tbaa !22
  %1370 = sext i16 %1369 to i32
  %1371 = add nsw i32 %1370, %1366
  %1372 = trunc i32 %1371 to i16
  store i16 %1372, ptr %1368, align 2, !tbaa !22
  %1373 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %66, i32 0, i32 2
  %1374 = load i8, ptr %1373, align 1, !tbaa !31
  %1375 = zext i8 %1374 to i32
  %1376 = getelementptr inbounds %struct.arm_2d_region_t, ptr %71, i32 0, i32 0
  %1377 = getelementptr inbounds %struct.arm_2d_location_t, ptr %1376, i32 0, i32 1
  %1378 = load i16, ptr %1377, align 2, !tbaa !22
  %1379 = sext i16 %1378 to i32
  %1380 = add nsw i32 %1379, %1375
  %1381 = trunc i32 %1380 to i16
  store i16 %1381, ptr %1377, align 2, !tbaa !22
  %1382 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %66, i32 0, i32 0
  %1383 = load i8, ptr %1382, align 1, !tbaa !28
  %1384 = zext i8 %1383 to i32
  %1385 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %66, i32 0, i32 1
  %1386 = load i8, ptr %1385, align 1, !tbaa !30
  %1387 = zext i8 %1386 to i32
  %1388 = add nsw i32 %1384, %1387
  %1389 = getelementptr inbounds %struct.arm_2d_region_t, ptr %71, i32 0, i32 1
  %1390 = getelementptr inbounds %struct.arm_2d_size_t, ptr %1389, i32 0, i32 0
  %1391 = load i16, ptr %1390, align 2, !tbaa !22
  %1392 = sext i16 %1391 to i32
  %1393 = sub nsw i32 %1392, %1388
  %1394 = trunc i32 %1393 to i16
  store i16 %1394, ptr %1390, align 2, !tbaa !22
  %1395 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %66, i32 0, i32 2
  %1396 = load i8, ptr %1395, align 1, !tbaa !31
  %1397 = zext i8 %1396 to i32
  %1398 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %66, i32 0, i32 3
  %1399 = load i8, ptr %1398, align 1, !tbaa !32
  %1400 = zext i8 %1399 to i32
  %1401 = add nsw i32 %1397, %1400
  %1402 = getelementptr inbounds %struct.arm_2d_region_t, ptr %71, i32 0, i32 1
  %1403 = getelementptr inbounds %struct.arm_2d_size_t, ptr %1402, i32 0, i32 1
  %1404 = load i16, ptr %1403, align 2, !tbaa !22
  %1405 = sext i16 %1404 to i32
  %1406 = sub nsw i32 %1405, %1401
  %1407 = trunc i32 %1406 to i16
  store i16 %1407, ptr %1403, align 2, !tbaa !22
  %1408 = load ptr, ptr %72, align 8, !tbaa !5
  %1409 = call ptr @arm_2d_tile_generate_child(ptr noundef %1408, ptr noundef %71, ptr noundef %69, i1 noundef zeroext false)
  store ptr %1409, ptr %73, align 8, !tbaa !5
  store i32 0, ptr %26, align 4
  br label %1410

1410:                                             ; preds = %1363, %1361
  call void @llvm.lifetime.end.p0(i64 8, ptr %72) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %71) #6
  %1411 = load i32, ptr %26, align 4
  switch i32 %1411, label %1530 [
    i32 0, label %1412
  ]

1412:                                             ; preds = %1410
  %1413 = load ptr, ptr %73, align 8, !tbaa !5
  br label %1415

1414:                                             ; preds = %1350
  br label %1415

1415:                                             ; preds = %1414, %1412
  %1416 = phi i32 [ 1, %1412 ], [ 0, %1414 ]
  %1417 = icmp ne i32 %1416, 0
  br i1 %1417, label %1419, label %1418

1418:                                             ; preds = %1415
  store i32 33, ptr %26, align 4
  br label %1530

1419:                                             ; preds = %1415
  call void @llvm.lifetime.start.p0(i64 8, ptr %74) #6
  call void @llvm.memset.p0.i64(ptr align 2 %74, i8 0, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %75) #6
  store ptr null, ptr %75, align 8, !tbaa !5
  br label %1420

1420:                                             ; preds = %1523, %1419
  %1421 = load ptr, ptr %75, align 8, !tbaa !5
  %1422 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1421, i32 1
  store ptr %1422, ptr %75, align 8, !tbaa !5
  %1423 = icmp eq ptr %1421, null
  br i1 %1423, label %1424, label %1428

1424:                                             ; preds = %1420
  %1425 = getelementptr inbounds %struct.arm_2d_region_t, ptr %74, i32 0, i32 1
  %1426 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %69, i32 0, i32 1
  %1427 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1426, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %1425, ptr align 4 %1427, i64 4, i1 false), !tbaa.struct !34
  br label %1429

1428:                                             ; preds = %1420
  br label %1429

1429:                                             ; preds = %1428, %1424
  %1430 = phi i32 [ 1, %1424 ], [ 0, %1428 ]
  %1431 = icmp ne i32 %1430, 0
  br i1 %1431, label %1433, label %1432

1432:                                             ; preds = %1429
  store i32 36, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %75) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %74) #6
  br label %1528

1433:                                             ; preds = %1429
  call void @llvm.lifetime.start.p0(i64 8, ptr %76) #6
  store ptr %69, ptr %76, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %77) #6
  store ptr null, ptr %77, align 8, !tbaa !5
  br label %1434

1434:                                             ; preds = %1520, %1433
  %1435 = load ptr, ptr %77, align 8, !tbaa !5
  %1436 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %1435, i32 1
  store ptr %1436, ptr %77, align 8, !tbaa !5
  %1437 = icmp eq ptr %1435, null
  br i1 %1437, label %1439, label %1438

1438:                                             ; preds = %1434
  store i32 39, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %77) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %76) #6
  br label %1522

1439:                                             ; preds = %1434
  %1440 = load ptr, ptr %7, align 8, !tbaa !5
  %1441 = getelementptr inbounds %struct.battery_liquid_t, ptr %1440, i32 0, i32 0
  %1442 = getelementptr inbounds %struct.anon.19, ptr %1441, i32 0, i32 6
  %1443 = load i32, ptr %1442, align 8, !tbaa !20
  %1444 = icmp eq i32 1, %1443
  br i1 %1444, label %1445, label %1519

1445:                                             ; preds = %1439
  call void @llvm.lifetime.start.p0(i64 8, ptr %78) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %78, ptr align 2 %74, i64 8, i1 false), !tbaa.struct !35
  call void @llvm.lifetime.start.p0(i64 8, ptr %79) #6
  store ptr null, ptr %79, align 8, !tbaa !5
  br label %1446

1446:                                             ; preds = %1517, %1445
  %1447 = load ptr, ptr %79, align 8, !tbaa !5
  %1448 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1447, i32 1
  store ptr %1448, ptr %79, align 8, !tbaa !5
  %1449 = icmp eq ptr %1447, null
  br i1 %1449, label %1451, label %1450

1450:                                             ; preds = %1446
  store i32 42, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %79) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %78) #6
  br label %1518

1451:                                             ; preds = %1446
  call void @llvm.lifetime.start.p0(i64 8, ptr %80) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %81) #6
  store ptr null, ptr %81, align 8, !tbaa !5
  br label %1452

1452:                                             ; preds = %1512, %1451
  %1453 = load ptr, ptr %81, align 8, !tbaa !5
  %1454 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1453, i32 1
  store ptr %1454, ptr %81, align 8, !tbaa !5
  %1455 = icmp eq ptr %1453, null
  br i1 %1455, label %1456, label %1498

1456:                                             ; preds = %1452
  call void @llvm.lifetime.start.p0(i64 4, ptr %82) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %82, ptr align 4 getelementptr inbounds (%struct.arm_2d_region_t, ptr getelementptr inbounds (%struct.arm_2d_tile_t, ptr @c_tileLightingA4Mask, i32 0, i32 1), i32 0, i32 1), i64 4, i1 false), !tbaa.struct !34
  %1457 = getelementptr inbounds %struct.arm_2d_size_t, ptr %82, i32 0, i32 0
  %1458 = load i16, ptr %1457, align 2, !tbaa !38
  %1459 = getelementptr inbounds %struct.arm_2d_region_t, ptr %80, i32 0, i32 1
  %1460 = getelementptr inbounds %struct.arm_2d_size_t, ptr %1459, i32 0, i32 0
  store i16 %1458, ptr %1460, align 2, !tbaa !22
  %1461 = getelementptr inbounds %struct.arm_2d_size_t, ptr %82, i32 0, i32 1
  %1462 = load i16, ptr %1461, align 2, !tbaa !36
  %1463 = getelementptr inbounds %struct.arm_2d_region_t, ptr %80, i32 0, i32 1
  %1464 = getelementptr inbounds %struct.arm_2d_size_t, ptr %1463, i32 0, i32 1
  store i16 %1462, ptr %1464, align 2, !tbaa !22
  %1465 = getelementptr inbounds %struct.arm_2d_region_t, ptr %80, i32 0, i32 0
  %1466 = getelementptr inbounds %struct.arm_2d_region_t, ptr %78, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %1465, ptr align 2 %1466, i64 4, i1 false), !tbaa.struct !34
  %1467 = getelementptr inbounds %struct.arm_2d_region_t, ptr %78, i32 0, i32 1
  %1468 = getelementptr inbounds %struct.arm_2d_size_t, ptr %1467, i32 0, i32 0
  %1469 = load i16, ptr %1468, align 2, !tbaa !22
  %1470 = sext i16 %1469 to i32
  %1471 = getelementptr inbounds %struct.arm_2d_size_t, ptr %82, i32 0, i32 0
  %1472 = load i16, ptr %1471, align 2, !tbaa !38
  %1473 = sext i16 %1472 to i32
  %1474 = sub nsw i32 %1470, %1473
  %1475 = ashr i32 %1474, 1
  %1476 = getelementptr inbounds %struct.arm_2d_region_t, ptr %80, i32 0, i32 0
  %1477 = getelementptr inbounds %struct.arm_2d_location_t, ptr %1476, i32 0, i32 0
  %1478 = load i16, ptr %1477, align 2, !tbaa !22
  %1479 = sext i16 %1478 to i32
  %1480 = add nsw i32 %1479, %1475
  %1481 = trunc i32 %1480 to i16
  store i16 %1481, ptr %1477, align 2, !tbaa !22
  %1482 = getelementptr inbounds %struct.arm_2d_region_t, ptr %78, i32 0, i32 1
  %1483 = getelementptr inbounds %struct.arm_2d_size_t, ptr %1482, i32 0, i32 1
  %1484 = load i16, ptr %1483, align 2, !tbaa !22
  %1485 = sext i16 %1484 to i32
  %1486 = getelementptr inbounds %struct.arm_2d_size_t, ptr %82, i32 0, i32 1
  %1487 = load i16, ptr %1486, align 2, !tbaa !36
  %1488 = sext i16 %1487 to i32
  %1489 = sub nsw i32 %1485, %1488
  %1490 = ashr i32 %1489, 1
  %1491 = getelementptr inbounds %struct.arm_2d_region_t, ptr %80, i32 0, i32 0
  %1492 = getelementptr inbounds %struct.arm_2d_location_t, ptr %1491, i32 0, i32 1
  %1493 = load i16, ptr %1492, align 2, !tbaa !22
  %1494 = sext i16 %1493 to i32
  %1495 = add nsw i32 %1494, %1490
  %1496 = trunc i32 %1495 to i16
  store i16 %1496, ptr %1492, align 2, !tbaa !22
  store i16 %1496, ptr %83, align 2, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %82) #6
  %1497 = load i16, ptr %83, align 2, !tbaa !9
  br label %1499

1498:                                             ; preds = %1452
  br label %1499

1499:                                             ; preds = %1498, %1456
  %1500 = phi i32 [ 1, %1456 ], [ 0, %1498 ]
  %1501 = icmp ne i32 %1500, 0
  br i1 %1501, label %1503, label %1502

1502:                                             ; preds = %1499
  store i32 44, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %81) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %80) #6
  br label %1517

1503:                                             ; preds = %1499
  store i16 -32, ptr %84, align 2, !tbaa !22
  %1504 = load ptr, ptr %7, align 8, !tbaa !5
  %1505 = getelementptr inbounds %struct.battery_liquid_t, ptr %1504, i32 0, i32 0
  %1506 = getelementptr inbounds %struct.anon.19, ptr %1505, i32 0, i32 3
  %1507 = load i8, ptr %1506, align 1, !tbaa !25
  %1508 = getelementptr inbounds %union.arm_2d_color_rgb565_t, ptr %84, i32 0, i32 0
  %1509 = load i16, ptr %1508, align 2
  %1510 = call i32 @arm_2dp_rgb565_fill_colour_with_a4_mask_and_opacity(ptr noundef null, ptr noundef %69, ptr noundef %80, ptr noundef @c_tileLightingA4Mask, i16 %1509, i8 noundef zeroext %1507)
  %1511 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  br label %1512

1512:                                             ; preds = %1503
  %1513 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %1514 = zext i1 %1513 to i8
  store i8 %1514, ptr %85, align 1, !tbaa !13
  %1515 = load i8, ptr %85, align 1, !tbaa !13, !range !15, !noundef !16
  %1516 = trunc i8 %1515 to i1
  br label %1452, !llvm.loop !44

1517:                                             ; preds = %1502
  br label %1446, !llvm.loop !45

1518:                                             ; preds = %1450
  br label %1519

1519:                                             ; preds = %1518, %1439
  br label %1520

1520:                                             ; preds = %1519
  %1521 = load ptr, ptr %76, align 8, !tbaa !5
  br label %1434, !llvm.loop !46

1522:                                             ; preds = %1438
  br label %1523

1523:                                             ; preds = %1522
  %1524 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %1525 = zext i1 %1524 to i8
  store i8 %1525, ptr %86, align 1, !tbaa !13
  %1526 = load i8, ptr %86, align 1, !tbaa !13, !range !15, !noundef !16
  %1527 = trunc i8 %1526 to i1
  br label %1420, !llvm.loop !47

1528:                                             ; preds = %1432
  br label %1529

1529:                                             ; preds = %1528
  br label %1350, !llvm.loop !48

1530:                                             ; preds = %1418, %1410
  call void @llvm.lifetime.end.p0(i64 8, ptr %70) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %69) #6
  br label %1531

1531:                                             ; preds = %1530
  br label %1335, !llvm.loop !49

1532:                                             ; preds = %1348
  call void @llvm.lifetime.start.p0(i64 4, ptr %87) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %88) #6
  store ptr null, ptr %88, align 8, !tbaa !5
  br label %1533

1533:                                             ; preds = %1726, %1532
  %1534 = load ptr, ptr %88, align 8, !tbaa !5
  %1535 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %1534, i32 1
  store ptr %1535, ptr %88, align 8, !tbaa !5
  %1536 = icmp eq ptr %1534, null
  br i1 %1536, label %1537, label %1542

1537:                                             ; preds = %1533
  %1538 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %89, i32 0, i32 0
  store i8 8, ptr %1538, align 1, !tbaa !28
  %1539 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %89, i32 0, i32 1
  store i8 8, ptr %1539, align 1, !tbaa !30
  %1540 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %89, i32 0, i32 2
  store i8 12, ptr %1540, align 1, !tbaa !31
  %1541 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %89, i32 0, i32 3
  store i8 8, ptr %1541, align 1, !tbaa !32
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %87, ptr align 1 %89, i64 4, i1 false), !tbaa.struct !33
  br label %1543

1542:                                             ; preds = %1533
  br label %1543

1543:                                             ; preds = %1542, %1537
  %1544 = phi i32 [ 1, %1537 ], [ 0, %1542 ]
  %1545 = icmp ne i32 %1544, 0
  br i1 %1545, label %1547, label %1546

1546:                                             ; preds = %1543
  store i32 47, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %88) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %87) #6
  br label %1727

1547:                                             ; preds = %1543
  call void @llvm.lifetime.start.p0(i64 24, ptr %90) #6
  call void @llvm.memset.p0.i64(ptr align 8 %90, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %91) #6
  store ptr null, ptr %91, align 8, !tbaa !5
  br label %1548

1548:                                             ; preds = %1724, %1547
  %1549 = load ptr, ptr %91, align 8, !tbaa !5
  %1550 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %1549, i32 1
  store ptr %1550, ptr %91, align 8, !tbaa !5
  %1551 = icmp eq ptr %1549, null
  br i1 %1551, label %1552, label %1612

1552:                                             ; preds = %1548
  call void @llvm.lifetime.start.p0(i64 8, ptr %92) #6
  call void @llvm.memset.p0.i64(ptr align 2 %92, i8 0, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %93) #6
  store ptr %27, ptr %93, align 8, !tbaa !5
  %1553 = load ptr, ptr %93, align 8, !tbaa !5
  %1554 = icmp eq ptr null, %1553
  br i1 %1554, label %1555, label %1561

1555:                                             ; preds = %1552
  %1556 = call ptr @arm_2d_get_default_frame_buffer()
  store ptr %1556, ptr %93, align 8, !tbaa !5
  %1557 = load ptr, ptr %93, align 8, !tbaa !5
  %1558 = icmp eq ptr null, %1557
  br i1 %1558, label %1559, label %1560

1559:                                             ; preds = %1555
  store i32 49, ptr %26, align 4
  br label %1608

1560:                                             ; preds = %1555
  br label %1561

1561:                                             ; preds = %1560, %1552
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %92, ptr align 2 %39, i64 8, i1 false), !tbaa.struct !35
  %1562 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %87, i32 0, i32 0
  %1563 = load i8, ptr %1562, align 1, !tbaa !28
  %1564 = zext i8 %1563 to i32
  %1565 = getelementptr inbounds %struct.arm_2d_region_t, ptr %92, i32 0, i32 0
  %1566 = getelementptr inbounds %struct.arm_2d_location_t, ptr %1565, i32 0, i32 0
  %1567 = load i16, ptr %1566, align 2, !tbaa !22
  %1568 = sext i16 %1567 to i32
  %1569 = add nsw i32 %1568, %1564
  %1570 = trunc i32 %1569 to i16
  store i16 %1570, ptr %1566, align 2, !tbaa !22
  %1571 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %87, i32 0, i32 2
  %1572 = load i8, ptr %1571, align 1, !tbaa !31
  %1573 = zext i8 %1572 to i32
  %1574 = getelementptr inbounds %struct.arm_2d_region_t, ptr %92, i32 0, i32 0
  %1575 = getelementptr inbounds %struct.arm_2d_location_t, ptr %1574, i32 0, i32 1
  %1576 = load i16, ptr %1575, align 2, !tbaa !22
  %1577 = sext i16 %1576 to i32
  %1578 = add nsw i32 %1577, %1573
  %1579 = trunc i32 %1578 to i16
  store i16 %1579, ptr %1575, align 2, !tbaa !22
  %1580 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %87, i32 0, i32 0
  %1581 = load i8, ptr %1580, align 1, !tbaa !28
  %1582 = zext i8 %1581 to i32
  %1583 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %87, i32 0, i32 1
  %1584 = load i8, ptr %1583, align 1, !tbaa !30
  %1585 = zext i8 %1584 to i32
  %1586 = add nsw i32 %1582, %1585
  %1587 = getelementptr inbounds %struct.arm_2d_region_t, ptr %92, i32 0, i32 1
  %1588 = getelementptr inbounds %struct.arm_2d_size_t, ptr %1587, i32 0, i32 0
  %1589 = load i16, ptr %1588, align 2, !tbaa !22
  %1590 = sext i16 %1589 to i32
  %1591 = sub nsw i32 %1590, %1586
  %1592 = trunc i32 %1591 to i16
  store i16 %1592, ptr %1588, align 2, !tbaa !22
  %1593 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %87, i32 0, i32 2
  %1594 = load i8, ptr %1593, align 1, !tbaa !31
  %1595 = zext i8 %1594 to i32
  %1596 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %87, i32 0, i32 3
  %1597 = load i8, ptr %1596, align 1, !tbaa !32
  %1598 = zext i8 %1597 to i32
  %1599 = add nsw i32 %1595, %1598
  %1600 = getelementptr inbounds %struct.arm_2d_region_t, ptr %92, i32 0, i32 1
  %1601 = getelementptr inbounds %struct.arm_2d_size_t, ptr %1600, i32 0, i32 1
  %1602 = load i16, ptr %1601, align 2, !tbaa !22
  %1603 = sext i16 %1602 to i32
  %1604 = sub nsw i32 %1603, %1599
  %1605 = trunc i32 %1604 to i16
  store i16 %1605, ptr %1601, align 2, !tbaa !22
  %1606 = load ptr, ptr %93, align 8, !tbaa !5
  %1607 = call ptr @arm_2d_tile_generate_child(ptr noundef %1606, ptr noundef %92, ptr noundef %90, i1 noundef zeroext false)
  store ptr %1607, ptr %94, align 8, !tbaa !5
  store i32 0, ptr %26, align 4
  br label %1608

1608:                                             ; preds = %1561, %1559
  call void @llvm.lifetime.end.p0(i64 8, ptr %93) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %92) #6
  %1609 = load i32, ptr %26, align 4
  switch i32 %1609, label %1725 [
    i32 0, label %1610
  ]

1610:                                             ; preds = %1608
  %1611 = load ptr, ptr %94, align 8, !tbaa !5
  br label %1613

1612:                                             ; preds = %1548
  br label %1613

1613:                                             ; preds = %1612, %1610
  %1614 = phi i32 [ 1, %1610 ], [ 0, %1612 ]
  %1615 = icmp ne i32 %1614, 0
  br i1 %1615, label %1617, label %1616

1616:                                             ; preds = %1613
  store i32 49, ptr %26, align 4
  br label %1725

1617:                                             ; preds = %1613
  call void @llvm.lifetime.start.p0(i64 8, ptr %95) #6
  call void @llvm.memset.p0.i64(ptr align 2 %95, i8 0, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %96) #6
  store ptr null, ptr %96, align 8, !tbaa !5
  br label %1618

1618:                                             ; preds = %1718, %1617
  %1619 = load ptr, ptr %96, align 8, !tbaa !5
  %1620 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1619, i32 1
  store ptr %1620, ptr %96, align 8, !tbaa !5
  %1621 = icmp eq ptr %1619, null
  br i1 %1621, label %1622, label %1626

1622:                                             ; preds = %1618
  %1623 = getelementptr inbounds %struct.arm_2d_region_t, ptr %95, i32 0, i32 1
  %1624 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %90, i32 0, i32 1
  %1625 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1624, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %1623, ptr align 4 %1625, i64 4, i1 false), !tbaa.struct !34
  br label %1627

1626:                                             ; preds = %1618
  br label %1627

1627:                                             ; preds = %1626, %1622
  %1628 = phi i32 [ 1, %1622 ], [ 0, %1626 ]
  %1629 = icmp ne i32 %1628, 0
  br i1 %1629, label %1631, label %1630

1630:                                             ; preds = %1627
  store i32 52, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %96) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %95) #6
  br label %1723

1631:                                             ; preds = %1627
  call void @llvm.lifetime.start.p0(i64 8, ptr %97) #6
  store ptr %90, ptr %97, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %98) #6
  store ptr null, ptr %98, align 8, !tbaa !5
  br label %1632

1632:                                             ; preds = %1715, %1631
  %1633 = load ptr, ptr %98, align 8, !tbaa !5
  %1634 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %1633, i32 1
  store ptr %1634, ptr %98, align 8, !tbaa !5
  %1635 = icmp eq ptr %1633, null
  br i1 %1635, label %1637, label %1636

1636:                                             ; preds = %1632
  store i32 55, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %98) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %97) #6
  br label %1717

1637:                                             ; preds = %1632
  call void @llvm.lifetime.start.p0(i64 8, ptr %99) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %99, ptr align 2 %95, i64 8, i1 false), !tbaa.struct !35
  call void @llvm.lifetime.start.p0(i64 8, ptr %100) #6
  store ptr null, ptr %100, align 8, !tbaa !5
  br label %1638

1638:                                             ; preds = %1668, %1637
  %1639 = load ptr, ptr %100, align 8, !tbaa !5
  %1640 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1639, i32 1
  store ptr %1640, ptr %100, align 8, !tbaa !5
  %1641 = icmp eq ptr %1639, null
  br i1 %1641, label %1643, label %1642

1642:                                             ; preds = %1638
  store i32 58, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %100) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %99) #6
  br label %1669

1643:                                             ; preds = %1638
  call void @llvm.lifetime.start.p0(i64 8, ptr %101) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %101, ptr align 2 %99, i64 8, i1 false), !tbaa.struct !35
  call void @llvm.lifetime.start.p0(i64 8, ptr %102) #6
  store ptr null, ptr %102, align 8, !tbaa !5
  br label %1644

1644:                                             ; preds = %1663, %1643
  %1645 = load ptr, ptr %102, align 8, !tbaa !5
  %1646 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1645, i32 1
  store ptr %1646, ptr %102, align 8, !tbaa !5
  %1647 = icmp eq ptr %1645, null
  br i1 %1647, label %1648, label %1653

1648:                                             ; preds = %1644
  %1649 = load i16, ptr getelementptr inbounds (%struct.arm_2d_region_t, ptr getelementptr inbounds (%struct.arm_2d_tile_t, ptr @c_tileGlassReflectionNLineMask, i32 0, i32 1), i32 0, i32 1), align 4, !tbaa !22
  %1650 = getelementptr inbounds %struct.arm_2d_region_t, ptr %101, i32 0, i32 1
  %1651 = getelementptr inbounds %struct.arm_2d_size_t, ptr %1650, i32 0, i32 0
  store i16 %1649, ptr %1651, align 2, !tbaa !22
  store i16 %1649, ptr %103, align 2, !tbaa !9
  %1652 = load i16, ptr %103, align 2, !tbaa !9
  br label %1654

1653:                                             ; preds = %1644
  br label %1654

1654:                                             ; preds = %1653, %1648
  %1655 = phi i32 [ 1, %1648 ], [ 0, %1653 ]
  %1656 = icmp ne i32 %1655, 0
  br i1 %1656, label %1658, label %1657

1657:                                             ; preds = %1654
  store i32 60, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %102) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %101) #6
  br label %1668

1658:                                             ; preds = %1654
  store i16 -1, ptr %105, align 2, !tbaa !22
  store i16 -1, ptr %104, align 2, !tbaa !22
  %1659 = getelementptr inbounds %union.arm_2d_color_rgb565_t, ptr %104, i32 0, i32 0
  %1660 = load i16, ptr %1659, align 2
  %1661 = call i32 @arm_2dp_rgb565_fill_colour_with_horizontal_line_mask_and_opacity(ptr noundef null, ptr noundef %90, ptr noundef %101, ptr noundef @c_tileGlassReflectionNLineMask, i16 %1660, i8 noundef zeroext -128)
  %1662 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  br label %1663

1663:                                             ; preds = %1658
  %1664 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %1665 = zext i1 %1664 to i8
  store i8 %1665, ptr %106, align 1, !tbaa !13
  %1666 = load i8, ptr %106, align 1, !tbaa !13, !range !15, !noundef !16
  %1667 = trunc i8 %1666 to i1
  br label %1644, !llvm.loop !50

1668:                                             ; preds = %1657
  br label %1638, !llvm.loop !51

1669:                                             ; preds = %1642
  call void @llvm.lifetime.start.p0(i64 8, ptr %107) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %107, ptr align 2 %95, i64 8, i1 false), !tbaa.struct !35
  call void @llvm.lifetime.start.p0(i64 8, ptr %108) #6
  store ptr null, ptr %108, align 8, !tbaa !5
  br label %1670

1670:                                             ; preds = %1713, %1669
  %1671 = load ptr, ptr %108, align 8, !tbaa !5
  %1672 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1671, i32 1
  store ptr %1672, ptr %108, align 8, !tbaa !5
  %1673 = icmp eq ptr %1671, null
  br i1 %1673, label %1675, label %1674

1674:                                             ; preds = %1670
  store i32 63, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %108) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %107) #6
  br label %1714

1675:                                             ; preds = %1670
  call void @llvm.lifetime.start.p0(i64 8, ptr %109) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %109, ptr align 2 %107, i64 8, i1 false), !tbaa.struct !35
  call void @llvm.lifetime.start.p0(i64 8, ptr %110) #6
  store ptr null, ptr %110, align 8, !tbaa !5
  br label %1676

1676:                                             ; preds = %1708, %1675
  %1677 = load ptr, ptr %110, align 8, !tbaa !5
  %1678 = getelementptr inbounds %struct.arm_2d_region_t, ptr %1677, i32 1
  store ptr %1678, ptr %110, align 8, !tbaa !5
  %1679 = icmp eq ptr %1677, null
  br i1 %1679, label %1680, label %1698

1680:                                             ; preds = %1676
  %1681 = load i16, ptr getelementptr inbounds (%struct.arm_2d_region_t, ptr getelementptr inbounds (%struct.arm_2d_tile_t, ptr @c_tileGlassReflectionWLineMask, i32 0, i32 1), i32 0, i32 1), align 4, !tbaa !22
  %1682 = getelementptr inbounds %struct.arm_2d_region_t, ptr %109, i32 0, i32 1
  %1683 = getelementptr inbounds %struct.arm_2d_size_t, ptr %1682, i32 0, i32 0
  store i16 %1681, ptr %1683, align 2, !tbaa !22
  %1684 = getelementptr inbounds %struct.arm_2d_region_t, ptr %107, i32 0, i32 1
  %1685 = getelementptr inbounds %struct.arm_2d_size_t, ptr %1684, i32 0, i32 0
  %1686 = load i16, ptr %1685, align 2, !tbaa !22
  %1687 = sext i16 %1686 to i32
  %1688 = load i16, ptr getelementptr inbounds (%struct.arm_2d_region_t, ptr getelementptr inbounds (%struct.arm_2d_tile_t, ptr @c_tileGlassReflectionWLineMask, i32 0, i32 1), i32 0, i32 1), align 4, !tbaa !22
  %1689 = sext i16 %1688 to i32
  %1690 = sub nsw i32 %1687, %1689
  %1691 = getelementptr inbounds %struct.arm_2d_region_t, ptr %109, i32 0, i32 0
  %1692 = getelementptr inbounds %struct.arm_2d_location_t, ptr %1691, i32 0, i32 0
  %1693 = load i16, ptr %1692, align 2, !tbaa !22
  %1694 = sext i16 %1693 to i32
  %1695 = add nsw i32 %1694, %1690
  %1696 = trunc i32 %1695 to i16
  store i16 %1696, ptr %1692, align 2, !tbaa !22
  store i16 %1696, ptr %111, align 2, !tbaa !9
  %1697 = load i16, ptr %111, align 2, !tbaa !9
  br label %1699

1698:                                             ; preds = %1676
  br label %1699

1699:                                             ; preds = %1698, %1680
  %1700 = phi i32 [ 1, %1680 ], [ 0, %1698 ]
  %1701 = icmp ne i32 %1700, 0
  br i1 %1701, label %1703, label %1702

1702:                                             ; preds = %1699
  store i32 65, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %110) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %109) #6
  br label %1713

1703:                                             ; preds = %1699
  store i16 -1, ptr %113, align 2, !tbaa !22
  store i16 -1, ptr %112, align 2, !tbaa !22
  %1704 = getelementptr inbounds %union.arm_2d_color_rgb565_t, ptr %112, i32 0, i32 0
  %1705 = load i16, ptr %1704, align 2
  %1706 = call i32 @arm_2dp_rgb565_fill_colour_with_horizontal_line_mask_and_opacity(ptr noundef null, ptr noundef %90, ptr noundef %109, ptr noundef @c_tileGlassReflectionWLineMask, i16 %1705, i8 noundef zeroext -96)
  %1707 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  br label %1708

1708:                                             ; preds = %1703
  %1709 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %1710 = zext i1 %1709 to i8
  store i8 %1710, ptr %114, align 1, !tbaa !13
  %1711 = load i8, ptr %114, align 1, !tbaa !13, !range !15, !noundef !16
  %1712 = trunc i8 %1711 to i1
  br label %1676, !llvm.loop !52

1713:                                             ; preds = %1702
  br label %1670, !llvm.loop !53

1714:                                             ; preds = %1674
  br label %1715

1715:                                             ; preds = %1714
  %1716 = load ptr, ptr %97, align 8, !tbaa !5
  br label %1632, !llvm.loop !54

1717:                                             ; preds = %1636
  br label %1718

1718:                                             ; preds = %1717
  %1719 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %1720 = zext i1 %1719 to i8
  store i8 %1720, ptr %115, align 1, !tbaa !13
  %1721 = load i8, ptr %115, align 1, !tbaa !13, !range !15, !noundef !16
  %1722 = trunc i8 %1721 to i1
  br label %1618, !llvm.loop !55

1723:                                             ; preds = %1630
  br label %1724

1724:                                             ; preds = %1723
  br label %1548, !llvm.loop !56

1725:                                             ; preds = %1616, %1608
  call void @llvm.lifetime.end.p0(i64 8, ptr %91) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %90) #6
  br label %1726

1726:                                             ; preds = %1725
  br label %1533, !llvm.loop !57

1727:                                             ; preds = %1546
  br label %1728

1728:                                             ; preds = %1727
  %1729 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %1730 = zext i1 %1729 to i8
  store i8 %1730, ptr %116, align 1, !tbaa !13
  %1731 = load i8, ptr %116, align 1, !tbaa !13, !range !15, !noundef !16
  %1732 = trunc i8 %1731 to i1
  br label %408, !llvm.loop !58

1733:                                             ; preds = %458
  br label %402, !llvm.loop !59

1734:                                             ; preds = %406
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #6
  br label %1735

1735:                                             ; preds = %1734
  %1736 = load ptr, ptr %34, align 8, !tbaa !5
  br label %384, !llvm.loop !60

1737:                                             ; preds = %388
  br label %1738

1738:                                             ; preds = %1737
  %1739 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %1740 = zext i1 %1739 to i8
  store i8 %1740, ptr %117, align 1, !tbaa !13
  %1741 = load i8, ptr %117, align 1, !tbaa !13, !range !15, !noundef !16
  %1742 = trunc i8 %1741 to i1
  br label %370, !llvm.loop !61

1743:                                             ; preds = %382
  br label %1744

1744:                                             ; preds = %1743
  br label %289, !llvm.loop !62

1745:                                             ; preds = %368, %360
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %27) #6
  br label %1746

1746:                                             ; preds = %1745
  br label %274, !llvm.loop !63

1747:                                             ; preds = %287
  call void @llvm.lifetime.end.p0(i64 2, ptr %14) #6
  ret void
}

declare zeroext i1 @__arm_2d_helper_is_time_out(i64 noundef, ptr noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @__arm_2d_ccca8888_unpack(i32 noundef, ptr noundef nonnull) #5

declare i32 @__arm_2d_helper_colour_slider(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i16 @__arm_2d_rgb565_pack(ptr noundef nonnull) #5

declare i32 @arm_2dp_rgb565_fill_colour_with_a4_mask_and_opacity(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i16, i8 noundef zeroext) #2

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { nocallback nofree 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 = { 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 #6 = { 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 = !{!"short", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!18, !10, i64 16}
!18 = !{!"battery_liquid_t", !19, i64 0}
!19 = !{!"", !7, i64 0, !10, i64 16, !7, i64 18, !7, i64 19, !10, i64 20, !7, i64 22, !12, i64 24}
!20 = !{!18, !12, i64 24}
!21 = !{!18, !10, i64 20}
!22 = !{!7, !7, i64 0}
!23 = !{!18, !7, i64 18}
!24 = !{!18, !7, i64 22}
!25 = !{!18, !7, i64 19}
!26 = !{!27, !27, i64 0}
!27 = !{!"long", !7, i64 0}
!28 = !{!29, !7, i64 0}
!29 = !{!"arm_2d_margin_t", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3}
!30 = !{!29, !7, i64 1}
!31 = !{!29, !7, i64 2}
!32 = !{!29, !7, i64 3}
!33 = !{i64 0, i64 1, !22, i64 1, i64 1, !22, i64 2, i64 1, !22, i64 3, i64 1, !22}
!34 = !{i64 0, i64 2, !9, i64 2, i64 2, !9}
!35 = !{i64 0, i64 4, !22, i64 4, i64 4, !22}
!36 = !{!37, !10, i64 2}
!37 = !{!"arm_2d_size_t", !10, i64 0, !10, i64 2}
!38 = !{!37, !10, i64 0}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}
!41 = distinct !{!41, !40}
!42 = distinct !{!42, !40}
!43 = distinct !{!43, !40}
!44 = distinct !{!44, !40}
!45 = distinct !{!45, !40}
!46 = distinct !{!46, !40}
!47 = distinct !{!47, !40}
!48 = distinct !{!48, !40}
!49 = distinct !{!49, !40}
!50 = distinct !{!50, !40}
!51 = distinct !{!51, !40}
!52 = distinct !{!52, !40}
!53 = distinct !{!53, !40}
!54 = distinct !{!54, !40}
!55 = distinct !{!55, !40}
!56 = distinct !{!56, !40}
!57 = distinct !{!57, !40}
!58 = distinct !{!58, !40}
!59 = distinct !{!59, !40}
!60 = distinct !{!60, !40}
!61 = distinct !{!61, !40}
!62 = distinct !{!62, !40}
!63 = distinct !{!63, !40}


; 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, %union.anon.10, %union.anon.13 }
%union.anon = type { %struct.anon.0 }
%struct.anon.0 = type { i8, %union.arm_2d_color_info_t, %union.anon.3 }
%union.arm_2d_color_info_t = type { %struct.anon.1 }
%struct.anon.1 = type { i8 }
%union.anon.3 = type { i16 }
%union.anon.10 = type { %struct.arm_2d_region_t }
%struct.arm_2d_region_t = type { %union.anon.11, %union.anon.12 }
%union.anon.11 = type { %struct.arm_2d_location_t }
%struct.arm_2d_location_t = type { i16, i16 }
%union.anon.12 = type { %struct.arm_2d_size_t }
%struct.arm_2d_size_t = type { i16, i16 }
%union.anon.13 = type { ptr }
%struct.__arm_2d_layout_t = type { ptr, %struct.arm_2d_region_t, %struct.arm_2d_region_t, i8, i8, %struct.__arm_2d_layout_align_tab_t }
%struct.__arm_2d_layout_align_tab_t = type { %union.anon.14, %union.anon.16 }
%union.anon.14 = type { %struct.anon.15 }
%struct.anon.15 = type { i8 }
%union.anon.16 = type { %struct.anon.17 }
%struct.anon.17 = type { i8 }
%union.__arm_2d_color_fast_rgb_t = type { [4 x i16] }

@c_tileBatteryBoarderTopMask = external constant %struct.arm_2d_tile_t, align 8
@c_tileBatteryBoarderBottomMask = external constant %struct.arm_2d_tile_t, align 8
@c_tileBatteryBoarderLineMask = external constant %struct.arm_2d_tile_t, align 8
@c_tileSinWaveMask = external constant %struct.arm_2d_tile_t, align 8
@__const.battery_gasgauge_liquid_show.__layout_assistant__ = external hidden unnamed_addr constant %struct.__arm_2d_layout_t, align 8
@c_tileLightingA4Mask = external constant %struct.arm_2d_tile_t, align 8
@c_tileGlassReflectionNLineMask = external constant %struct.arm_2d_tile_t, align 8
@c_tileGlassReflectionWLineMask = external constant %struct.arm_2d_tile_t, align 8

; 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

declare zeroext i1 @__arm_2d_helper_time_cos_slider(i32 noundef, i32 noundef, i64 noundef, float noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i64 @arm_2d_helper_convert_ms_to_ticks(i32 noundef) local_unnamed_addr #2

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

declare ptr @arm_2d_get_default_frame_buffer() local_unnamed_addr #2

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

declare i32 @arm_2dp_rgb565_fill_colour_with_mask_and_opacity(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i16, i8 noundef zeroext) local_unnamed_addr #2

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

declare i32 @arm_2dp_rgb565_fill_colour_with_horizontal_line_mask_and_opacity(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i16, i8 noundef zeroext) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @draw_liquid_wave(ptr noundef nonnull, ptr noundef, i16 noundef zeroext, i16 noundef signext, i32, i16 noundef zeroext, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local void @battery_gasgauge_liquid_show(ptr noundef nonnull %0, ptr noundef %1, ptr noundef readonly %2, i16 noundef zeroext %3, i32 noundef %4, i1 noundef zeroext %5) local_unnamed_addr #3 {
  %7 = alloca %union.__arm_2d_color_fast_rgb_t, align 2
  %8 = alloca %union.__arm_2d_color_fast_rgb_t, align 2
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.arm_2d_tile_t, align 8
  %12 = alloca %struct.arm_2d_region_t, align 8
  %13 = alloca %struct.arm_2d_region_t, align 8
  %14 = alloca %struct.arm_2d_region_t, align 2
  %15 = alloca %struct.arm_2d_region_t, align 2
  %16 = alloca %struct.arm_2d_region_t, align 2
  %17 = alloca %struct.arm_2d_tile_t, align 8
  %18 = alloca %struct.arm_2d_region_t, align 8
  %19 = alloca %struct.arm_2d_region_t, align 2
  %20 = alloca %struct.arm_2d_tile_t, align 8
  %21 = alloca %struct.arm_2d_region_t, align 8
  %22 = alloca %struct.arm_2d_region_t, align 4
  %23 = alloca %struct.arm_2d_region_t, align 4
  br i1 %5, label %24, label %36

24:                                               ; preds = %6
  %25 = tail call i16 @llvm.umin.i16(i16 %3, i16 1000)
  %26 = getelementptr inbounds i8, ptr %0, i64 16
  store i16 %25, ptr %26, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %0, i64 24
  store i32 %4, ptr %27, align 8, !tbaa !12
  %28 = tail call i64 @arm_2d_helper_convert_ms_to_ticks(i32 noundef 10) #6
  %29 = getelementptr inbounds i8, ptr %0, i64 8
  %30 = tail call zeroext i1 @__arm_2d_helper_is_time_out(i64 noundef %28, ptr noundef nonnull %29) #6
  br i1 %30, label %31, label %36

31:                                               ; preds = %24
  %32 = getelementptr inbounds i8, ptr %0, i64 20
  %33 = load i16, ptr %32, align 4, !tbaa !13
  %34 = add i16 %33, 1
  %35 = load i16, ptr getelementptr inbounds (i8, ptr @c_tileSinWaveMask, i64 8), align 8, !tbaa !14
  %.not = icmp slt i16 %33, %35
  %spec.store.select = select i1 %.not, i16 %34, i16 0
  store i16 %spec.store.select, ptr %32, align 4
  br label %36

36:                                               ; preds = %31, %24, %6
  %37 = getelementptr inbounds i8, ptr %0, i64 24
  %38 = load i32, ptr %37, align 8, !tbaa !12
  switch i32 %38, label %54 [
    i32 1, label %39
    i32 -1, label %48
  ]

39:                                               ; preds = %36
  %40 = getelementptr inbounds i8, ptr %0, i64 16
  %41 = load i16, ptr %40, align 8, !tbaa !5
  %42 = icmp ugt i16 %41, 800
  br i1 %42, label %43, label %54

43:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %44 = zext i16 %41 to i32
  %45 = add nsw i32 %44, -800
  %46 = tail call i32 @__arm_2d_helper_colour_slider(i32 noundef -23296, i32 noundef -16711936, i32 noundef 200, i32 noundef %45) #6
  call void @__arm_2d_ccca8888_unpack(i32 noundef %46, ptr noundef %7)
  %47 = call zeroext i16 @__arm_2d_rgb565_pack(ptr noundef %7)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %54

48:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %49 = getelementptr inbounds i8, ptr %0, i64 16
  %50 = load i16, ptr %49, align 8, !tbaa !5
  %51 = zext i16 %50 to i32
  %52 = tail call i32 @__arm_2d_helper_colour_slider(i32 noundef -65536, i32 noundef -16711936, i32 noundef 1000, i32 noundef %51) #6
  call void @__arm_2d_ccca8888_unpack(i32 noundef %52, ptr noundef %8)
  %53 = call zeroext i16 @__arm_2d_rgb565_pack(ptr noundef %8)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %54

54:                                               ; preds = %39, %43, %48, %36
  %.0 = phi i16 [ %53, %48 ], [ %47, %43 ], [ -736, %39 ], [ -14824, %36 ]
  br i1 %5, label %55, label %81

55:                                               ; preds = %54
  %56 = load i32, ptr %37, align 8, !tbaa !12
  %57 = icmp eq i32 %56, 1
  br i1 %57, label %58, label %66

58:                                               ; preds = %55
  %59 = getelementptr inbounds i8, ptr %0, i64 18
  store i8 -128, ptr %59, align 2, !tbaa !15
  %60 = getelementptr inbounds i8, ptr %0, i64 22
  store i8 0, ptr %60, align 2, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #6
  %61 = call i64 @arm_2d_helper_convert_ms_to_ticks(i32 noundef 2000) #6
  %62 = call zeroext i1 @__arm_2d_helper_time_cos_slider(i32 noundef 0, i32 noundef 191, i64 noundef %61, float noundef 0.000000e+00, ptr noundef nonnull %9, ptr noundef nonnull %0) #6
  %63 = load i32, ptr %9, align 4, !tbaa !17
  %64 = trunc i32 %63 to i8
  %65 = getelementptr inbounds i8, ptr %0, i64 19
  store i8 %64, ptr %65, align 1, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  br label %81

66:                                               ; preds = %55
  %67 = getelementptr inbounds i8, ptr %0, i64 16
  %68 = load i16, ptr %67, align 8, !tbaa !5
  %69 = icmp ult i16 %68, 100
  %70 = icmp eq i32 %56, -1
  %or.cond = and i1 %70, %69
  br i1 %or.cond, label %71, label %78

71:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #6
  %72 = call i64 @arm_2d_helper_convert_ms_to_ticks(i32 noundef 2000) #6
  %73 = call zeroext i1 @__arm_2d_helper_time_cos_slider(i32 noundef 128, i32 noundef 0, i64 noundef %72, float noundef 0.000000e+00, ptr noundef nonnull %10, ptr noundef nonnull %0) #6
  %74 = load i32, ptr %10, align 4, !tbaa !17
  %75 = trunc i32 %74 to i8
  %76 = getelementptr inbounds i8, ptr %0, i64 18
  store i8 %75, ptr %76, align 2, !tbaa !15
  %77 = getelementptr inbounds i8, ptr %0, i64 22
  store i8 1, ptr %77, align 2, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  br label %81

78:                                               ; preds = %66
  store i64 0, ptr %0, align 8, !tbaa !19
  %79 = getelementptr inbounds i8, ptr %0, i64 18
  store i8 -128, ptr %79, align 2, !tbaa !15
  %80 = getelementptr inbounds i8, ptr %0, i64 22
  store i8 0, ptr %80, align 2, !tbaa !16
  br label %81

81:                                               ; preds = %58, %78, %71, %54
  %82 = icmp eq ptr %1, null
  %83 = icmp eq ptr %2, null
  %84 = getelementptr inbounds i8, ptr %12, i64 4
  %85 = getelementptr inbounds i8, ptr %11, i64 8
  %.sroa.6196.4..sroa_idx = getelementptr inbounds i8, ptr %11, i64 10
  %.sroa.0183.0.copyload = load i16, ptr getelementptr inbounds (i8, ptr @c_tileBatteryBoarderTopMask, i64 8), align 8
  %.sroa.4184.0.copyload = load i16, ptr getelementptr inbounds (i8, ptr @c_tileBatteryBoarderTopMask, i64 10), align 2
  %86 = load i16, ptr getelementptr inbounds (i8, ptr @c_tileBatteryBoarderBottomMask, i64 10), align 2
  %87 = add i16 %.sroa.4184.0.copyload, 72
  %88 = add i16 %87, %86
  %89 = getelementptr inbounds i8, ptr %13, i64 4
  %90 = getelementptr inbounds i8, ptr %13, i64 6
  %91 = sext i16 %.sroa.0183.0.copyload to i32
  %92 = sext i16 %88 to i32
  %93 = getelementptr inbounds i8, ptr %13, i64 2
  %.sroa.53145.0.copyload = load i8, ptr getelementptr inbounds (i8, ptr @__const.battery_gasgauge_liquid_show.__layout_assistant__, i64 26), align 2
  %.sroa.62.0.copyload = load i8, ptr getelementptr inbounds (i8, ptr @__const.battery_gasgauge_liquid_show.__layout_assistant__, i64 27), align 1
  %94 = getelementptr inbounds i8, ptr %14, i64 4
  %95 = call i16 @llvm.smax.i16(i16 %.sroa.4184.0.copyload, i16 0)
  %96 = getelementptr inbounds i8, ptr %14, i64 6
  %.sroa.7108.8..sroa_idx109 = getelementptr inbounds i8, ptr %14, i64 2
  %97 = shl i8 %.sroa.53145.0.copyload, 6
  %98 = ashr exact i8 %97, 6
  %99 = sext i8 %98 to i16
  %100 = shl i8 %.sroa.62.0.copyload, 6
  %101 = ashr exact i8 %100, 6
  %102 = sext i8 %101 to i16
  %103 = mul i16 %95, %102
  %104 = getelementptr inbounds i8, ptr %0, i64 18
  %105 = ashr i8 %.sroa.62.0.copyload, 6
  %106 = sext i8 %105 to i16
  %107 = mul i16 %95, %106
  %108 = getelementptr inbounds i8, ptr %15, i64 4
  %109 = sext i16 %86 to i32
  %110 = sext i16 %.sroa.4184.0.copyload to i32
  %111 = add nsw i32 %109, %110
  %112 = sub nsw i32 %92, %111
  %spec.select = call i32 @llvm.smax.i32(i32 %112, i32 0)
  %113 = trunc i32 %spec.select to i16
  %114 = getelementptr inbounds i8, ptr %15, i64 6
  %.sroa.7108.8..sroa_idx111 = getelementptr inbounds i8, ptr %15, i64 2
  %115 = mul i16 %102, %113
  %116 = sext i8 %105 to i32
  %117 = mul nsw i32 %spec.select, %116
  %118 = trunc i32 %117 to i16
  %119 = getelementptr inbounds i8, ptr %16, i64 4
  %narrow = add nsw i8 %101, 1
  %120 = sext i8 %narrow to i32
  %121 = getelementptr inbounds i8, ptr %16, i64 6
  %.sroa.7108.8..sroa_idx113 = getelementptr inbounds i8, ptr %16, i64 2
  %122 = getelementptr inbounds i8, ptr %0, i64 16
  %123 = getelementptr inbounds i8, ptr %0, i64 20
  %124 = getelementptr inbounds i8, ptr %17, i64 8
  %.sroa.6.4..sroa_idx = getelementptr inbounds i8, ptr %17, i64 10
  %.sroa.046.0.copyload = load i16, ptr getelementptr inbounds (i8, ptr @c_tileLightingA4Mask, i64 8), align 8
  %.sroa.548.0.copyload = load i16, ptr getelementptr inbounds (i8, ptr @c_tileLightingA4Mask, i64 10), align 2
  %125 = getelementptr inbounds i8, ptr %19, i64 4
  %126 = getelementptr inbounds i8, ptr %19, i64 6
  %127 = sext i16 %.sroa.046.0.copyload to i32
  %128 = sext i16 %.sroa.548.0.copyload to i32
  %129 = getelementptr inbounds i8, ptr %19, i64 2
  %130 = getelementptr inbounds i8, ptr %0, i64 19
  %131 = getelementptr inbounds i8, ptr %20, i64 8
  %.sroa.7.4..sroa_idx = getelementptr inbounds i8, ptr %20, i64 10
  %.sroa.427.0..sroa_idx = getelementptr inbounds i8, ptr %22, i64 4
  %.sroa.528.0..sroa_idx = getelementptr inbounds i8, ptr %22, i64 6
  %132 = load i16, ptr getelementptr inbounds (i8, ptr @c_tileGlassReflectionNLineMask, i64 8), align 8
  %.sroa.4.0..sroa_idx10 = getelementptr inbounds i8, ptr %23, i64 4
  %.sroa.5.0..sroa_idx12 = getelementptr inbounds i8, ptr %23, i64 6
  %133 = load i16, ptr getelementptr inbounds (i8, ptr @c_tileGlassReflectionWLineMask, i64 8), align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %11, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #6
  store i64 0, ptr %12, align 8
  br i1 %82, label %134, label %137

134:                                              ; preds = %81
  %135 = call ptr @arm_2d_get_default_frame_buffer() #6
  %136 = icmp eq ptr %135, null
  br i1 %136, label %143, label %137

137:                                              ; preds = %134, %81
  %.0266 = phi ptr [ %135, %134 ], [ %1, %81 ]
  br i1 %83, label %138, label %141

138:                                              ; preds = %137
  %139 = getelementptr inbounds i8, ptr %.0266, i64 8
  %140 = load i32, ptr %139, align 4
  store i32 %140, ptr %84, align 4
  br label %.preheader407

141:                                              ; preds = %137
  %142 = load i64, ptr %2, align 2
  store i64 %142, ptr %12, align 8
  br label %.preheader407

143:                                              ; preds = %134
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  br label %237

.preheader407:                                    ; preds = %138, %141
  %144 = call ptr @arm_2d_tile_generate_child(ptr noundef nonnull %.0266, ptr noundef nonnull %12, ptr noundef nonnull %11, i1 noundef zeroext false) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  %.sroa.4195.4.copyload445 = load i16, ptr %85, align 8
  %.sroa.6196.4.copyload446 = load i16, ptr %.sroa.6196.4..sroa_idx, align 2
  %145 = sext i16 %.sroa.4195.4.copyload445 to i32
  %146 = sub nsw i32 %145, %91
  %147 = lshr i32 %146, 1
  %148 = trunc i32 %147 to i16
  %149 = sext i16 %.sroa.6196.4.copyload446 to i32
  %150 = sub nsw i32 %149, %92
  %151 = lshr i32 %150, 1
  %152 = trunc i32 %151 to i16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #6
  store i16 %.sroa.0183.0.copyload, ptr %89, align 4, !tbaa !14
  store i16 %88, ptr %90, align 2, !tbaa !14
  store i16 %148, ptr %13, align 8, !tbaa !14
  store i16 %152, ptr %93, align 2, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #6
  %153 = call i16 @llvm.smax.i16(i16 %.sroa.0183.0.copyload, i16 0)
  %154 = mul i16 %153, %99
  %155 = add i16 %154, %148
  store i16 %153, ptr %94, align 2, !tbaa !14
  store i16 %95, ptr %96, align 2, !tbaa !14
  store i16 %155, ptr %14, align 2, !tbaa !14
  %156 = add i16 %103, %152
  store i16 %156, ptr %.sroa.7108.8..sroa_idx109, align 2, !tbaa !14
  %157 = load i8, ptr %104, align 2, !tbaa !15
  %158 = call i32 @arm_2dp_rgb565_fill_colour_with_mask_and_opacity(ptr noundef null, ptr noundef nonnull %11, ptr noundef nonnull %14, ptr noundef nonnull @c_tileBatteryBoarderTopMask, i16 -1, i8 noundef zeroext %157) #6
  %159 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  %160 = add i16 %107, %152
  %161 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #6
  store i16 %153, ptr %108, align 2, !tbaa !14
  store i16 %113, ptr %114, align 2, !tbaa !14
  store i16 %155, ptr %15, align 2, !tbaa !14
  %162 = add i16 %160, %115
  store i16 %162, ptr %.sroa.7108.8..sroa_idx111, align 2, !tbaa !14
  %163 = load i8, ptr %104, align 2, !tbaa !15
  %164 = call i32 @arm_2dp_rgb565_fill_colour_with_horizontal_line_mask_and_opacity(ptr noundef null, ptr noundef nonnull %11, ptr noundef nonnull %15, ptr noundef nonnull @c_tileBatteryBoarderLineMask, i16 -1, i8 noundef zeroext %163) #6
  %165 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  %166 = add i16 %160, %118
  %167 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #6
  %sext = shl i32 %151, 16
  %168 = ashr exact i32 %sext, 16
  %169 = mul nsw i32 %92, %120
  %170 = add nsw i32 %169, %168
  store i16 %153, ptr %119, align 2, !tbaa !14
  %171 = sext i16 %166 to i32
  %172 = sub nsw i32 %170, %171
  %173 = mul nsw i32 %172, %116
  %spec.select359 = call i32 @llvm.smax.i32(i32 %173, i32 0)
  %174 = trunc i32 %spec.select359 to i16
  store i16 %174, ptr %121, align 2, !tbaa !14
  store i16 %155, ptr %16, align 2, !tbaa !14
  %175 = mul i16 %174, %102
  %176 = add i16 %175, %166
  store i16 %176, ptr %.sroa.7108.8..sroa_idx113, align 2, !tbaa !14
  %177 = load i8, ptr %104, align 2, !tbaa !15
  %178 = call i32 @arm_2dp_rgb565_fill_colour_with_mask_and_opacity(ptr noundef null, ptr noundef nonnull %11, ptr noundef nonnull %16, ptr noundef nonnull @c_tileBatteryBoarderBottomMask, i16 -1, i8 noundef zeroext %177) #6
  %179 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  %180 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #6
  %181 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  %182 = load i16, ptr %122, align 8, !tbaa !5
  %183 = load i16, ptr %123, align 4, !tbaa !13
  call void @draw_liquid_wave(ptr noundef %11, ptr noundef nonnull %13, i16 noundef zeroext %182, i16 noundef signext %183, i32 168823049, i16 noundef zeroext %.0, ptr noundef nonnull @c_tileSinWaveMask)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %17) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %17, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #6
  %184 = load i64, ptr %13, align 8
  %185 = lshr i64 %184, 16
  %186 = lshr i64 %184, 32
  %187 = lshr i64 %184, 48
  %188 = trunc i64 %184 to i16
  %189 = insertelement <4 x i16> poison, i16 %188, i64 0
  %190 = trunc i64 %185 to i16
  %191 = insertelement <4 x i16> %189, i16 %190, i64 1
  %192 = trunc i64 %186 to i16
  %193 = insertelement <4 x i16> %191, i16 %192, i64 2
  %194 = trunc nuw i64 %187 to i16
  %195 = insertelement <4 x i16> %193, i16 %194, i64 3
  %196 = add <4 x i16> %195, <i16 9, i16 16, i16 -18, i16 -26>
  store <4 x i16> %196, ptr %18, align 8, !tbaa !14
  %197 = call ptr @arm_2d_tile_generate_child(ptr noundef nonnull %11, ptr noundef nonnull %18, ptr noundef nonnull %17, i1 noundef zeroext false) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #6
  %198 = load i32, ptr %37, align 8, !tbaa !12
  %199 = icmp eq i32 %198, 1
  br i1 %199, label %.split, label %.loopexit404

.loopexit404:                                     ; preds = %.preheader407, %.split
  %200 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %17) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %20) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %20, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %21) #6
  %201 = load i64, ptr %13, align 8
  %202 = lshr i64 %201, 16
  %203 = lshr i64 %201, 32
  %204 = lshr i64 %201, 48
  %205 = trunc i64 %201 to i16
  %206 = insertelement <4 x i16> poison, i16 %205, i64 0
  %207 = trunc i64 %202 to i16
  %208 = insertelement <4 x i16> %206, i16 %207, i64 1
  %209 = trunc i64 %203 to i16
  %210 = insertelement <4 x i16> %208, i16 %209, i64 2
  %211 = trunc nuw i64 %204 to i16
  %212 = insertelement <4 x i16> %210, i16 %211, i64 3
  %213 = add <4 x i16> %212, <i16 8, i16 12, i16 -16, i16 -20>
  store <4 x i16> %213, ptr %21, align 8, !tbaa !14
  %214 = call ptr @arm_2d_tile_generate_child(ptr noundef nonnull %11, ptr noundef nonnull %21, ptr noundef nonnull %20, i1 noundef zeroext false) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #6
  %.sroa.524.4.copyload441 = load i16, ptr %131, align 8
  %.sroa.7.4.copyload442 = load i16, ptr %.sroa.7.4..sroa_idx, align 2
  %215 = sub i16 %.sroa.524.4.copyload441, %133
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %22) #6
  store i32 0, ptr %22, align 4, !tbaa !14
  store i16 %.sroa.7.4.copyload442, ptr %.sroa.528.0..sroa_idx, align 2, !tbaa !14
  store i16 %132, ptr %.sroa.427.0..sroa_idx, align 4, !tbaa !14
  %216 = call i32 @arm_2dp_rgb565_fill_colour_with_horizontal_line_mask_and_opacity(ptr noundef null, ptr noundef nonnull %20, ptr noundef nonnull %22, ptr noundef nonnull @c_tileGlassReflectionNLineMask, i16 -1, i8 noundef zeroext -128) #6
  %217 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  %218 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %23) #6
  store i32 0, ptr %23, align 4, !tbaa !14
  store i16 %.sroa.7.4.copyload442, ptr %.sroa.5.0..sroa_idx12, align 2, !tbaa !14
  store i16 %133, ptr %.sroa.4.0..sroa_idx10, align 4, !tbaa !14
  store i16 %215, ptr %23, align 4, !tbaa !14
  %219 = call i32 @arm_2dp_rgb565_fill_colour_with_horizontal_line_mask_and_opacity(ptr noundef null, ptr noundef nonnull %20, ptr noundef nonnull %23, ptr noundef nonnull @c_tileGlassReflectionWLineMask, i16 -1, i8 noundef zeroext -96) #6
  %220 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  %221 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %23) #6
  %222 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %20) #6
  %223 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  %224 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  br label %237

.split:                                           ; preds = %.preheader407
  %.sroa.6.4.copyload436 = load i16, ptr %.sroa.6.4..sroa_idx, align 2
  %225 = sext i16 %.sroa.6.4.copyload436 to i32
  %226 = sub nsw i32 %225, %128
  %227 = lshr i32 %226, 1
  %228 = trunc i32 %227 to i16
  %.sroa.459.4.copyload435 = load i16, ptr %124, align 8
  %229 = sext i16 %.sroa.459.4.copyload435 to i32
  %230 = sub nsw i32 %229, %127
  %231 = lshr i32 %230, 1
  %232 = trunc i32 %231 to i16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #6
  store i16 %.sroa.046.0.copyload, ptr %125, align 2, !tbaa !14
  store i16 %.sroa.548.0.copyload, ptr %126, align 2, !tbaa !14
  store i16 %232, ptr %19, align 2, !tbaa !14
  store i16 %228, ptr %129, align 2, !tbaa !14
  %233 = load i8, ptr %130, align 1, !tbaa !18
  %234 = call i32 @arm_2dp_rgb565_fill_colour_with_a4_mask_and_opacity(ptr noundef null, ptr noundef nonnull %17, ptr noundef nonnull %19, ptr noundef nonnull @c_tileLightingA4Mask, i16 -32, i8 noundef zeroext %233) #6
  %235 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  %236 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #6
  br label %.loopexit404

237:                                              ; preds = %.loopexit404, %143
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #6
  ret void
}

declare zeroext i1 @__arm_2d_helper_is_time_out(i64 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @__arm_2d_ccca8888_unpack(i32 noundef, ptr noundef nonnull) local_unnamed_addr #4

declare i32 @__arm_2d_helper_colour_slider(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i16 @__arm_2d_rgb565_pack(ptr noundef nonnull) local_unnamed_addr #4

declare i32 @arm_2dp_rgb565_fill_colour_with_a4_mask_and_opacity(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i16, i8 noundef zeroext) local_unnamed_addr #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i16 @llvm.umin.i16(i16, i16) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i16 @llvm.smax.i16(i16, i16) #5

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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, !10, i64 16}
!6 = !{!"battery_liquid_t", !7, i64 0}
!7 = !{!"", !8, i64 0, !10, i64 16, !8, i64 18, !8, i64 19, !10, i64 20, !8, i64 22, !11, i64 24}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!6, !11, i64 24}
!13 = !{!6, !10, i64 20}
!14 = !{!8, !8, i64 0}
!15 = !{!6, !8, i64 18}
!16 = !{!6, !8, i64 22}
!17 = !{!11, !11, i64 0}
!18 = !{!6, !8, i64 19}
!19 = !{!20, !20, i64 0}
!20 = !{!"long", !8, i64 0}


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