; LLVM IR from ARM-software/Arm-2D :: Helper/Source/arm_2d_helper_shape.ll_ (draw_round_corner_box)

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

%struct.arm_2d_margin_t = type { i8, i8, i8, i8 }
%struct.arm_2d_tile_t = type { %union.anon, %union.anon.9, %union.anon.12 }
%union.anon = type { %struct.anon }
%struct.anon = type { i8, %union.arm_2d_color_info_t, %union.anon.2 }
%union.arm_2d_color_info_t = type { %struct.anon.0 }
%struct.anon.0 = type { i8 }
%union.anon.2 = type { i16 }
%union.anon.9 = type { %struct.arm_2d_region_t }
%struct.arm_2d_region_t = type { %union.anon.10, %union.anon.11 }
%union.anon.10 = type { %struct.arm_2d_location_t }
%struct.arm_2d_location_t = type { i16, i16 }
%union.anon.11 = type { %struct.arm_2d_size_t }
%struct.arm_2d_size_t = type { i16, i16 }
%union.anon.12 = type { ptr }
%union.arm_2d_color_rgb565_t = type { i16 }

@.str = external hidden unnamed_addr constant [17 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [89 x i8], align 1
@__PRETTY_FUNCTION__.__draw_round_corner_box = external hidden unnamed_addr constant [119 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [63 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @__draw_round_corner_box(ptr noundef nonnull %0, ptr noundef %1, i16 noundef zeroext %2, i8 noundef zeroext %3, ptr noundef %4) #0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i16, align 2
  %9 = alloca i8, align 1
  %10 = alloca ptr, align 8
  %11 = alloca i16, align 2
  %12 = alloca i16, align 2
  %13 = alloca i16, align 2
  %14 = alloca %struct.arm_2d_margin_t, align 1
  %15 = alloca ptr, align 8
  %16 = alloca %struct.arm_2d_margin_t, align 1
  %17 = alloca i32, align 4
  %18 = alloca %struct.arm_2d_tile_t, align 8
  %19 = alloca ptr, align 8
  %20 = alloca %struct.arm_2d_region_t, align 2
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca %struct.arm_2d_region_t, align 2
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca %struct.arm_2d_tile_t, align 8
  %28 = alloca %union.arm_2d_color_rgb565_t, align 2
  %29 = alloca %struct.arm_2d_tile_t, align 8
  %30 = alloca %struct.arm_2d_region_t, align 2
  %31 = alloca ptr, align 8
  %32 = alloca %struct.arm_2d_region_t, align 2
  %33 = alloca ptr, align 8
  %34 = alloca i16, align 2
  %35 = alloca %union.arm_2d_color_rgb565_t, align 2
  %36 = alloca i8, align 1
  %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 i16, align 2
  %42 = alloca %union.arm_2d_color_rgb565_t, align 2
  %43 = alloca i8, align 1
  %44 = alloca %struct.arm_2d_region_t, align 2
  %45 = alloca ptr, align 8
  %46 = alloca %struct.arm_2d_region_t, align 2
  %47 = alloca ptr, align 8
  %48 = alloca i16, align 2
  %49 = alloca %union.arm_2d_color_rgb565_t, align 2
  %50 = alloca i8, align 1
  %51 = alloca %struct.arm_2d_tile_t, align 8
  %52 = alloca %struct.arm_2d_region_t, align 2
  %53 = alloca ptr, align 8
  %54 = alloca %struct.arm_2d_region_t, align 2
  %55 = alloca ptr, align 8
  %56 = alloca i16, align 2
  %57 = alloca %union.arm_2d_color_rgb565_t, align 2
  %58 = alloca i8, align 1
  %59 = alloca %struct.arm_2d_tile_t, align 8
  %60 = alloca %struct.arm_2d_region_t, align 2
  %61 = alloca ptr, align 8
  %62 = alloca %struct.arm_2d_region_t, align 2
  %63 = alloca ptr, align 8
  %64 = alloca i16, align 2
  %65 = alloca %union.arm_2d_color_rgb565_t, align 2
  %66 = alloca i8, align 1
  %67 = alloca %struct.arm_2d_region_t, align 2
  %68 = alloca ptr, align 8
  %69 = alloca %struct.arm_2d_region_t, align 2
  %70 = alloca ptr, align 8
  %71 = alloca i16, align 2
  %72 = alloca %union.arm_2d_color_rgb565_t, align 2
  %73 = alloca i8, align 1
  %74 = alloca i8, align 1
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i16 %2, ptr %8, align 2, !tbaa !9
  store i8 %3, ptr %9, align 1, !tbaa !11
  store ptr %4, ptr %10, align 8, !tbaa !5
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = icmp ne ptr null, %75
  br i1 %76, label %77, label %78

77:                                               ; preds = %5
  br label %79

78:                                               ; preds = %5
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 73, ptr noundef @__PRETTY_FUNCTION__.__draw_round_corner_box) #6
  unreachable

79:                                               ; preds = %77
  %80 = load ptr, ptr %10, align 8, !tbaa !5
  %81 = icmp ne ptr null, %80
  br i1 %81, label %82, label %83

82:                                               ; preds = %79
  br label %84

83:                                               ; preds = %79
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 74, ptr noundef @__PRETTY_FUNCTION__.__draw_round_corner_box) #6
  unreachable

84:                                               ; preds = %82
  %85 = load ptr, ptr %10, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %85, i32 0, i32 0
  %87 = getelementptr inbounds %struct.anon, ptr %86, i32 0, i32 1
  %88 = load i8, ptr %87, align 1, !tbaa !11
  %89 = zext i8 %88 to i32
  %90 = icmp eq i32 %89, 6
  br i1 %90, label %91, label %92

91:                                               ; preds = %84
  br label %93

92:                                               ; preds = %84
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 75, ptr noundef @__PRETTY_FUNCTION__.__draw_round_corner_box) #6
  unreachable

93:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 2, ptr %11) #7
  %94 = load ptr, ptr %10, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %94, i32 0, i32 1
  %96 = getelementptr inbounds %struct.arm_2d_region_t, ptr %95, i32 0, i32 1
  %97 = getelementptr inbounds %struct.arm_2d_size_t, ptr %96, i32 0, i32 0
  %98 = load i16, ptr %97, align 4, !tbaa !11
  %99 = sext i16 %98 to i32
  %100 = add nsw i32 %99, 1
  %101 = ashr i32 %100, 1
  %102 = trunc i32 %101 to i16
  store i16 %102, ptr %11, align 2, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 2, ptr %12) #7
  %103 = load ptr, ptr %10, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %103, i32 0, i32 1
  %105 = getelementptr inbounds %struct.arm_2d_region_t, ptr %104, i32 0, i32 1
  %106 = getelementptr inbounds %struct.arm_2d_size_t, ptr %105, i32 0, i32 1
  %107 = load i16, ptr %106, align 2, !tbaa !11
  %108 = sext i16 %107 to i32
  %109 = add nsw i32 %108, 1
  %110 = ashr i32 %109, 1
  %111 = trunc i32 %110 to i16
  store i16 %111, ptr %12, align 2, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 2, ptr %13) #7
  %112 = load i8, ptr %9, align 1, !tbaa !11
  %113 = zext i8 %112 to i32
  %114 = icmp eq i32 255, %113
  br i1 %114, label %115, label %116

115:                                              ; preds = %93
  br label %121

116:                                              ; preds = %93
  %117 = load i8, ptr %9, align 1, !tbaa !11
  %118 = zext i8 %117 to i32
  %119 = mul nsw i32 255, %118
  %120 = ashr i32 %119, 8
  br label %121

121:                                              ; preds = %116, %115
  %122 = phi i32 [ 255, %115 ], [ %120, %116 ]
  %123 = trunc i32 %122 to i16
  store i16 %123, ptr %13, align 2, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  store ptr null, ptr %15, align 8, !tbaa !5
  br label %124

124:                                              ; preds = %839, %121
  %125 = load ptr, ptr %15, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %125, i32 1
  store ptr %126, ptr %15, align 8, !tbaa !5
  %127 = icmp eq ptr %125, null
  br i1 %127, label %128, label %133

128:                                              ; preds = %124
  %129 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %16, i32 0, i32 0
  store i8 0, ptr %129, align 1, !tbaa !12
  %130 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %16, i32 0, i32 1
  store i8 0, ptr %130, align 1, !tbaa !14
  %131 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %16, i32 0, i32 2
  store i8 0, ptr %131, align 1, !tbaa !15
  %132 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %16, i32 0, i32 3
  store i8 0, ptr %132, align 1, !tbaa !16
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %14, ptr align 1 %16, i64 4, i1 false), !tbaa.struct !17
  br label %134

133:                                              ; preds = %124
  br label %134

134:                                              ; preds = %133, %128
  %135 = phi i32 [ 1, %128 ], [ 0, %133 ]
  %136 = icmp ne i32 %135, 0
  br i1 %136, label %138, label %137

137:                                              ; preds = %134
  store i32 2, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %840

138:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #7
  call void @llvm.memset.p0.i64(ptr align 8 %18, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  store ptr null, ptr %19, align 8, !tbaa !5
  br label %139

139:                                              ; preds = %837, %138
  %140 = load ptr, ptr %19, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %140, i32 1
  store ptr %141, ptr %19, align 8, !tbaa !5
  %142 = icmp eq ptr %140, null
  br i1 %142, label %143, label %214

143:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  call void @llvm.memset.p0.i64(ptr align 2 %20, i8 0, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %144 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %144, ptr %21, align 8, !tbaa !5
  %145 = load ptr, ptr %21, align 8, !tbaa !5
  %146 = icmp eq ptr null, %145
  br i1 %146, label %147, label %153

147:                                              ; preds = %143
  %148 = call ptr @arm_2d_get_default_frame_buffer()
  store ptr %148, ptr %21, align 8, !tbaa !5
  %149 = load ptr, ptr %21, align 8, !tbaa !5
  %150 = icmp eq ptr null, %149
  br i1 %150, label %151, label %152

151:                                              ; preds = %147
  store i32 4, ptr %17, align 4
  br label %210

152:                                              ; preds = %147
  br label %153

153:                                              ; preds = %152, %143
  %154 = load ptr, ptr %7, align 8, !tbaa !5
  %155 = icmp eq ptr null, %154
  br i1 %155, label %156, label %161

156:                                              ; preds = %153
  %157 = getelementptr inbounds %struct.arm_2d_region_t, ptr %20, i32 0, i32 1
  %158 = load ptr, ptr %21, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %158, i32 0, i32 1
  %160 = getelementptr inbounds %struct.arm_2d_region_t, ptr %159, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %157, ptr align 4 %160, i64 4, i1 false), !tbaa.struct !18
  br label %163

161:                                              ; preds = %153
  %162 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %20, ptr align 2 %162, i64 8, i1 false), !tbaa.struct !19
  br label %163

163:                                              ; preds = %161, %156
  %164 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %14, i32 0, i32 0
  %165 = load i8, ptr %164, align 1, !tbaa !12
  %166 = zext i8 %165 to i32
  %167 = getelementptr inbounds %struct.arm_2d_region_t, ptr %20, i32 0, i32 0
  %168 = getelementptr inbounds %struct.arm_2d_location_t, ptr %167, i32 0, i32 0
  %169 = load i16, ptr %168, align 2, !tbaa !11
  %170 = sext i16 %169 to i32
  %171 = add nsw i32 %170, %166
  %172 = trunc i32 %171 to i16
  store i16 %172, ptr %168, align 2, !tbaa !11
  %173 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %14, i32 0, i32 2
  %174 = load i8, ptr %173, align 1, !tbaa !15
  %175 = zext i8 %174 to i32
  %176 = getelementptr inbounds %struct.arm_2d_region_t, ptr %20, i32 0, i32 0
  %177 = getelementptr inbounds %struct.arm_2d_location_t, ptr %176, i32 0, i32 1
  %178 = load i16, ptr %177, align 2, !tbaa !11
  %179 = sext i16 %178 to i32
  %180 = add nsw i32 %179, %175
  %181 = trunc i32 %180 to i16
  store i16 %181, ptr %177, align 2, !tbaa !11
  %182 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %14, i32 0, i32 0
  %183 = load i8, ptr %182, align 1, !tbaa !12
  %184 = zext i8 %183 to i32
  %185 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %14, i32 0, i32 1
  %186 = load i8, ptr %185, align 1, !tbaa !14
  %187 = zext i8 %186 to i32
  %188 = add nsw i32 %184, %187
  %189 = getelementptr inbounds %struct.arm_2d_region_t, ptr %20, i32 0, i32 1
  %190 = getelementptr inbounds %struct.arm_2d_size_t, ptr %189, i32 0, i32 0
  %191 = load i16, ptr %190, align 2, !tbaa !11
  %192 = sext i16 %191 to i32
  %193 = sub nsw i32 %192, %188
  %194 = trunc i32 %193 to i16
  store i16 %194, ptr %190, align 2, !tbaa !11
  %195 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %14, i32 0, i32 2
  %196 = load i8, ptr %195, align 1, !tbaa !15
  %197 = zext i8 %196 to i32
  %198 = getelementptr inbounds %struct.arm_2d_margin_t, ptr %14, i32 0, i32 3
  %199 = load i8, ptr %198, align 1, !tbaa !16
  %200 = zext i8 %199 to i32
  %201 = add nsw i32 %197, %200
  %202 = getelementptr inbounds %struct.arm_2d_region_t, ptr %20, i32 0, i32 1
  %203 = getelementptr inbounds %struct.arm_2d_size_t, ptr %202, i32 0, i32 1
  %204 = load i16, ptr %203, align 2, !tbaa !11
  %205 = sext i16 %204 to i32
  %206 = sub nsw i32 %205, %201
  %207 = trunc i32 %206 to i16
  store i16 %207, ptr %203, align 2, !tbaa !11
  %208 = load ptr, ptr %21, align 8, !tbaa !5
  %209 = call ptr @arm_2d_tile_generate_child(ptr noundef %208, ptr noundef %20, ptr noundef %18, i1 noundef zeroext false)
  store ptr %209, ptr %22, align 8, !tbaa !5
  store i32 0, ptr %17, align 4
  br label %210

210:                                              ; preds = %163, %151
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  %211 = load i32, ptr %17, align 4
  switch i32 %211, label %838 [
    i32 0, label %212
  ]

212:                                              ; preds = %210
  %213 = load ptr, ptr %22, align 8, !tbaa !5
  br label %215

214:                                              ; preds = %139
  br label %215

215:                                              ; preds = %214, %212
  %216 = phi i32 [ 1, %212 ], [ 0, %214 ]
  %217 = icmp ne i32 %216, 0
  br i1 %217, label %219, label %218

218:                                              ; preds = %215
  store i32 4, ptr %17, align 4
  br label %838

219:                                              ; preds = %215
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  call void @llvm.memset.p0.i64(ptr align 2 %23, i8 0, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  store ptr null, ptr %24, align 8, !tbaa !5
  br label %220

220:                                              ; preds = %831, %219
  %221 = load ptr, ptr %24, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.arm_2d_region_t, ptr %221, i32 1
  store ptr %222, ptr %24, align 8, !tbaa !5
  %223 = icmp eq ptr %221, null
  br i1 %223, label %224, label %228

224:                                              ; preds = %220
  %225 = getelementptr inbounds %struct.arm_2d_region_t, ptr %23, i32 0, i32 1
  %226 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %18, i32 0, i32 1
  %227 = getelementptr inbounds %struct.arm_2d_region_t, ptr %226, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %225, ptr align 4 %227, i64 4, i1 false), !tbaa.struct !18
  br label %229

228:                                              ; preds = %220
  br label %229

229:                                              ; preds = %228, %224
  %230 = phi i32 [ 1, %224 ], [ 0, %228 ]
  %231 = icmp ne i32 %230, 0
  br i1 %231, label %233, label %232

232:                                              ; preds = %229
  store i32 7, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %836

233:                                              ; preds = %229
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  store ptr %18, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  store ptr null, ptr %26, align 8, !tbaa !5
  br label %234

234:                                              ; preds = %827, %233
  %235 = load ptr, ptr %26, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %235, i32 1
  store ptr %236, ptr %26, align 8, !tbaa !5
  %237 = icmp eq ptr %235, null
  br i1 %237, label %239, label %238

238:                                              ; preds = %234
  store i32 10, ptr %17, align 4
  br label %829

239:                                              ; preds = %234
  %240 = call zeroext i1 @arm_2d_helper_pfb_is_region_being_drawing(ptr noundef %18, ptr noundef null, ptr noundef null)
  br i1 %240, label %242, label %241

241:                                              ; preds = %239
  store i32 10, ptr %17, align 4
  br label %829

242:                                              ; preds = %239
  br label %243

243:                                              ; preds = %242
  call void @llvm.lifetime.start.p0(i64 24, ptr %27) #7
  %244 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %27, i32 0, i32 0
  %245 = load i8, ptr %244, align 8
  %246 = and i8 %245, -2
  %247 = or i8 %246, 0
  store i8 %247, ptr %244, align 8
  %248 = load i8, ptr %244, align 8
  %249 = and i8 %248, -3
  %250 = or i8 %249, 0
  store i8 %250, ptr %244, align 8
  %251 = load i8, ptr %244, align 8
  %252 = and i8 %251, -5
  %253 = or i8 %252, 4
  store i8 %253, ptr %244, align 8
  %254 = load i8, ptr %244, align 8
  %255 = and i8 %254, -9
  %256 = or i8 %255, 0
  store i8 %256, ptr %244, align 8
  %257 = load i8, ptr %244, align 8
  %258 = and i8 %257, -17
  %259 = or i8 %258, 0
  store i8 %259, ptr %244, align 8
  %260 = load i8, ptr %244, align 8
  %261 = and i8 %260, 31
  %262 = or i8 %261, 0
  store i8 %262, ptr %244, align 8
  %263 = getelementptr inbounds %struct.anon, ptr %244, i32 0, i32 1
  call void @llvm.memset.p0.i64(ptr align 1 %263, i8 0, i64 1, i1 false)
  %264 = getelementptr inbounds %struct.anon, ptr %244, i32 0, i32 2
  call void @llvm.memset.p0.i64(ptr align 2 %264, i8 0, i64 2, i1 false)
  %265 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %27, i32 0, i32 1
  %266 = getelementptr inbounds %struct.arm_2d_region_t, ptr %265, i32 0, i32 0
  %267 = getelementptr inbounds %struct.arm_2d_location_t, ptr %266, i32 0, i32 0
  store i16 0, ptr %267, align 4, !tbaa !20
  %268 = getelementptr inbounds %struct.arm_2d_location_t, ptr %266, i32 0, i32 1
  store i16 0, ptr %268, align 2, !tbaa !22
  %269 = getelementptr inbounds %struct.arm_2d_region_t, ptr %265, i32 0, i32 1
  %270 = getelementptr inbounds %struct.arm_2d_size_t, ptr %269, i32 0, i32 0
  %271 = load i16, ptr %11, align 2, !tbaa !9
  store i16 %271, ptr %270, align 4, !tbaa !23
  %272 = getelementptr inbounds %struct.arm_2d_size_t, ptr %269, i32 0, i32 1
  %273 = load i16, ptr %12, align 2, !tbaa !9
  store i16 %273, ptr %272, align 2, !tbaa !25
  %274 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %27, i32 0, i32 2
  %275 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %275, ptr %274, align 8, !tbaa !11
  %276 = load i16, ptr %8, align 2, !tbaa !9
  store i16 %276, ptr %28, align 2, !tbaa !11
  %277 = load i8, ptr %9, align 1, !tbaa !11
  %278 = getelementptr inbounds %union.arm_2d_color_rgb565_t, ptr %28, i32 0, i32 0
  %279 = load i16, ptr %278, align 2
  %280 = call i32 @arm_2dp_rgb565_fill_colour_with_mask_and_opacity(ptr noundef null, ptr noundef %18, ptr noundef %23, ptr noundef %27, i16 %279, i8 noundef zeroext %277)
  %281 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 24, ptr %27) #7
  br label %282

282:                                              ; preds = %243
  br label %283

283:                                              ; preds = %282
  br label %284

284:                                              ; preds = %283
  call void @llvm.lifetime.start.p0(i64 24, ptr %29) #7
  %285 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %29, i32 0, i32 0
  %286 = load i8, ptr %285, align 8
  %287 = and i8 %286, -2
  %288 = or i8 %287, 0
  store i8 %288, ptr %285, align 8
  %289 = load i8, ptr %285, align 8
  %290 = and i8 %289, -3
  %291 = or i8 %290, 0
  store i8 %291, ptr %285, align 8
  %292 = load i8, ptr %285, align 8
  %293 = and i8 %292, -5
  %294 = or i8 %293, 4
  store i8 %294, ptr %285, align 8
  %295 = load i8, ptr %285, align 8
  %296 = and i8 %295, -9
  %297 = or i8 %296, 0
  store i8 %297, ptr %285, align 8
  %298 = load i8, ptr %285, align 8
  %299 = and i8 %298, -17
  %300 = or i8 %299, 0
  store i8 %300, ptr %285, align 8
  %301 = load i8, ptr %285, align 8
  %302 = and i8 %301, 31
  %303 = or i8 %302, 0
  store i8 %303, ptr %285, align 8
  %304 = getelementptr inbounds %struct.anon, ptr %285, i32 0, i32 1
  call void @llvm.memset.p0.i64(ptr align 1 %304, i8 0, i64 1, i1 false)
  %305 = getelementptr inbounds %struct.anon, ptr %285, i32 0, i32 2
  call void @llvm.memset.p0.i64(ptr align 2 %305, i8 0, i64 2, i1 false)
  %306 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %29, i32 0, i32 1
  %307 = getelementptr inbounds %struct.arm_2d_region_t, ptr %306, i32 0, i32 0
  %308 = getelementptr inbounds %struct.arm_2d_location_t, ptr %307, i32 0, i32 0
  %309 = load i16, ptr %11, align 2, !tbaa !9
  store i16 %309, ptr %308, align 4, !tbaa !20
  %310 = getelementptr inbounds %struct.arm_2d_location_t, ptr %307, i32 0, i32 1
  store i16 0, ptr %310, align 2, !tbaa !22
  %311 = getelementptr inbounds %struct.arm_2d_region_t, ptr %306, i32 0, i32 1
  %312 = getelementptr inbounds %struct.arm_2d_size_t, ptr %311, i32 0, i32 0
  %313 = load i16, ptr %11, align 2, !tbaa !9
  store i16 %313, ptr %312, align 4, !tbaa !23
  %314 = getelementptr inbounds %struct.arm_2d_size_t, ptr %311, i32 0, i32 1
  %315 = load i16, ptr %12, align 2, !tbaa !9
  store i16 %315, ptr %314, align 2, !tbaa !25
  %316 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %29, i32 0, i32 2
  %317 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %317, ptr %316, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %30, ptr align 2 %23, i64 8, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #7
  store ptr null, ptr %31, align 8, !tbaa !5
  br label %318

318:                                              ; preds = %377, %284
  %319 = load ptr, ptr %31, align 8, !tbaa !5
  %320 = getelementptr inbounds %struct.arm_2d_region_t, ptr %319, i32 1
  store ptr %320, ptr %31, align 8, !tbaa !5
  %321 = icmp eq ptr %319, null
  br i1 %321, label %323, label %322

322:                                              ; preds = %318
  store i32 17, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  br label %378

323:                                              ; preds = %318
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #7
  store ptr null, ptr %33, align 8, !tbaa !5
  br label %324

324:                                              ; preds = %372, %323
  %325 = load ptr, ptr %33, align 8, !tbaa !5
  %326 = getelementptr inbounds %struct.arm_2d_region_t, ptr %325, i32 1
  store ptr %326, ptr %33, align 8, !tbaa !5
  %327 = icmp eq ptr %325, null
  br i1 %327, label %328, label %360

328:                                              ; preds = %324
  %329 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %29, i32 0, i32 1
  %330 = getelementptr inbounds %struct.arm_2d_region_t, ptr %329, i32 0, i32 1
  %331 = getelementptr inbounds %struct.arm_2d_size_t, ptr %330, i32 0, i32 0
  %332 = load i16, ptr %331, align 4, !tbaa !11
  %333 = getelementptr inbounds %struct.arm_2d_region_t, ptr %32, i32 0, i32 1
  %334 = getelementptr inbounds %struct.arm_2d_size_t, ptr %333, i32 0, i32 0
  store i16 %332, ptr %334, align 2, !tbaa !11
  %335 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %29, i32 0, i32 1
  %336 = getelementptr inbounds %struct.arm_2d_region_t, ptr %335, i32 0, i32 1
  %337 = getelementptr inbounds %struct.arm_2d_size_t, ptr %336, i32 0, i32 1
  %338 = load i16, ptr %337, align 2, !tbaa !11
  %339 = getelementptr inbounds %struct.arm_2d_region_t, ptr %32, i32 0, i32 1
  %340 = getelementptr inbounds %struct.arm_2d_size_t, ptr %339, i32 0, i32 1
  store i16 %338, ptr %340, align 2, !tbaa !11
  %341 = getelementptr inbounds %struct.arm_2d_region_t, ptr %32, i32 0, i32 0
  %342 = getelementptr inbounds %struct.arm_2d_region_t, ptr %30, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %341, ptr align 2 %342, i64 4, i1 false), !tbaa.struct !18
  %343 = getelementptr inbounds %struct.arm_2d_region_t, ptr %30, i32 0, i32 1
  %344 = getelementptr inbounds %struct.arm_2d_size_t, ptr %343, i32 0, i32 0
  %345 = load i16, ptr %344, align 2, !tbaa !11
  %346 = sext i16 %345 to i32
  %347 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %29, i32 0, i32 1
  %348 = getelementptr inbounds %struct.arm_2d_region_t, ptr %347, i32 0, i32 1
  %349 = getelementptr inbounds %struct.arm_2d_size_t, ptr %348, i32 0, i32 0
  %350 = load i16, ptr %349, align 4, !tbaa !11
  %351 = sext i16 %350 to i32
  %352 = sub nsw i32 %346, %351
  %353 = getelementptr inbounds %struct.arm_2d_region_t, ptr %32, i32 0, i32 0
  %354 = getelementptr inbounds %struct.arm_2d_location_t, ptr %353, i32 0, i32 0
  %355 = load i16, ptr %354, align 2, !tbaa !11
  %356 = sext i16 %355 to i32
  %357 = add nsw i32 %356, %352
  %358 = trunc i32 %357 to i16
  store i16 %358, ptr %354, align 2, !tbaa !11
  store i16 %358, ptr %34, align 2, !tbaa !9
  %359 = load i16, ptr %34, align 2, !tbaa !9
  br label %361

360:                                              ; preds = %324
  br label %361

361:                                              ; preds = %360, %328
  %362 = phi i32 [ 1, %328 ], [ 0, %360 ]
  %363 = icmp ne i32 %362, 0
  br i1 %363, label %365, label %364

364:                                              ; preds = %361
  store i32 19, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  br label %377

365:                                              ; preds = %361
  %366 = load i16, ptr %8, align 2, !tbaa !9
  store i16 %366, ptr %35, align 2, !tbaa !11
  %367 = load i8, ptr %9, align 1, !tbaa !11
  %368 = getelementptr inbounds %union.arm_2d_color_rgb565_t, ptr %35, i32 0, i32 0
  %369 = load i16, ptr %368, align 2
  %370 = call i32 @arm_2dp_rgb565_fill_colour_with_mask_and_opacity(ptr noundef null, ptr noundef %18, ptr noundef %32, ptr noundef %29, i16 %369, i8 noundef zeroext %367)
  %371 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  br label %372

372:                                              ; preds = %365
  %373 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %374 = zext i1 %373 to i8
  store i8 %374, ptr %36, align 1, !tbaa !26
  %375 = load i8, ptr %36, align 1, !tbaa !26, !range !28, !noundef !29
  %376 = trunc i8 %375 to i1
  br label %324, !llvm.loop !30

377:                                              ; preds = %364
  br label %318, !llvm.loop !32

378:                                              ; preds = %322
  call void @llvm.lifetime.end.p0(i64 24, ptr %29) #7
  br label %379

379:                                              ; preds = %378
  br label %380

380:                                              ; preds = %379
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %37, ptr align 2 %23, i64 8, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #7
  store ptr null, ptr %38, align 8, !tbaa !5
  br label %381

381:                                              ; preds = %447, %380
  %382 = load ptr, ptr %38, align 8, !tbaa !5
  %383 = getelementptr inbounds %struct.arm_2d_region_t, ptr %382, i32 1
  store ptr %383, ptr %38, align 8, !tbaa !5
  %384 = icmp eq ptr %382, null
  br i1 %384, label %386, label %385

385:                                              ; preds = %381
  store i32 22, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #7
  br label %448

386:                                              ; preds = %381
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #7
  store ptr null, ptr %40, align 8, !tbaa !5
  br label %387

387:                                              ; preds = %442, %386
  %388 = load ptr, ptr %40, align 8, !tbaa !5
  %389 = getelementptr inbounds %struct.arm_2d_region_t, ptr %388, i32 1
  store ptr %389, ptr %40, align 8, !tbaa !5
  %390 = icmp eq ptr %388, null
  br i1 %390, label %391, label %429

391:                                              ; preds = %387
  %392 = getelementptr inbounds %struct.arm_2d_region_t, ptr %23, i32 0, i32 1
  %393 = getelementptr inbounds %struct.arm_2d_size_t, ptr %392, i32 0, i32 0
  %394 = load i16, ptr %393, align 2, !tbaa !11
  %395 = sext i16 %394 to i32
  %396 = load i16, ptr %11, align 2, !tbaa !9
  %397 = sext i16 %396 to i32
  %398 = mul nsw i32 %397, 2
  %399 = sub nsw i32 %395, %398
  %400 = trunc i32 %399 to i16
  %401 = getelementptr inbounds %struct.arm_2d_region_t, ptr %39, i32 0, i32 1
  %402 = getelementptr inbounds %struct.arm_2d_size_t, ptr %401, i32 0, i32 0
  store i16 %400, ptr %402, align 2, !tbaa !11
  %403 = load i16, ptr %12, align 2, !tbaa !9
  %404 = getelementptr inbounds %struct.arm_2d_region_t, ptr %39, i32 0, i32 1
  %405 = getelementptr inbounds %struct.arm_2d_size_t, ptr %404, i32 0, i32 1
  store i16 %403, ptr %405, align 2, !tbaa !11
  %406 = getelementptr inbounds %struct.arm_2d_region_t, ptr %39, i32 0, i32 0
  %407 = getelementptr inbounds %struct.arm_2d_region_t, ptr %37, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %406, ptr align 2 %407, i64 4, i1 false), !tbaa.struct !18
  %408 = getelementptr inbounds %struct.arm_2d_region_t, ptr %37, i32 0, i32 1
  %409 = getelementptr inbounds %struct.arm_2d_size_t, ptr %408, i32 0, i32 0
  %410 = load i16, ptr %409, align 2, !tbaa !11
  %411 = sext i16 %410 to i32
  %412 = getelementptr inbounds %struct.arm_2d_region_t, ptr %23, i32 0, i32 1
  %413 = getelementptr inbounds %struct.arm_2d_size_t, ptr %412, i32 0, i32 0
  %414 = load i16, ptr %413, align 2, !tbaa !11
  %415 = sext i16 %414 to i32
  %416 = load i16, ptr %11, align 2, !tbaa !9
  %417 = sext i16 %416 to i32
  %418 = mul nsw i32 %417, 2
  %419 = sub nsw i32 %415, %418
  %420 = sub nsw i32 %411, %419
  %421 = ashr i32 %420, 1
  %422 = getelementptr inbounds %struct.arm_2d_region_t, ptr %39, i32 0, i32 0
  %423 = getelementptr inbounds %struct.arm_2d_location_t, ptr %422, i32 0, i32 0
  %424 = load i16, ptr %423, align 2, !tbaa !11
  %425 = sext i16 %424 to i32
  %426 = add nsw i32 %425, %421
  %427 = trunc i32 %426 to i16
  store i16 %427, ptr %423, align 2, !tbaa !11
  store i16 %427, ptr %41, align 2, !tbaa !9
  %428 = load i16, ptr %41, align 2, !tbaa !9
  br label %430

429:                                              ; preds = %387
  br label %430

430:                                              ; preds = %429, %391
  %431 = phi i32 [ 1, %391 ], [ 0, %429 ]
  %432 = icmp ne i32 %431, 0
  br i1 %432, label %434, label %433

433:                                              ; preds = %430
  store i32 24, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #7
  br label %447

434:                                              ; preds = %430
  %435 = load i16, ptr %8, align 2, !tbaa !9
  store i16 %435, ptr %42, align 2, !tbaa !11
  %436 = load i16, ptr %13, align 2, !tbaa !9
  %437 = trunc i16 %436 to i8
  %438 = getelementptr inbounds %union.arm_2d_color_rgb565_t, ptr %42, i32 0, i32 0
  %439 = load i16, ptr %438, align 2
  %440 = call i32 @arm_2dp_rgb565_fill_colour_with_opacity(ptr noundef null, ptr noundef %18, ptr noundef %39, i16 %439, i8 noundef zeroext %437)
  %441 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  br label %442

442:                                              ; preds = %434
  %443 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %444 = zext i1 %443 to i8
  store i8 %444, ptr %43, align 1, !tbaa !26
  %445 = load i8, ptr %43, align 1, !tbaa !26, !range !28, !noundef !29
  %446 = trunc i8 %445 to i1
  br label %387, !llvm.loop !33

447:                                              ; preds = %433
  br label %381, !llvm.loop !34

448:                                              ; preds = %385
  call void @llvm.lifetime.start.p0(i64 8, ptr %44) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %44, ptr align 2 %23, i64 8, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #7
  store ptr null, ptr %45, align 8, !tbaa !5
  br label %449

449:                                              ; preds = %533, %448
  %450 = load ptr, ptr %45, align 8, !tbaa !5
  %451 = getelementptr inbounds %struct.arm_2d_region_t, ptr %450, i32 1
  store ptr %451, ptr %45, align 8, !tbaa !5
  %452 = icmp eq ptr %450, null
  br i1 %452, label %454, label %453

453:                                              ; preds = %449
  store i32 27, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #7
  br label %534

454:                                              ; preds = %449
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %47) #7
  store ptr null, ptr %47, align 8, !tbaa !5
  br label %455

455:                                              ; preds = %528, %454
  %456 = load ptr, ptr %47, align 8, !tbaa !5
  %457 = getelementptr inbounds %struct.arm_2d_region_t, ptr %456, i32 1
  store ptr %457, ptr %47, align 8, !tbaa !5
  %458 = icmp eq ptr %456, null
  br i1 %458, label %459, label %515

459:                                              ; preds = %455
  %460 = getelementptr inbounds %struct.arm_2d_region_t, ptr %23, i32 0, i32 1
  %461 = getelementptr inbounds %struct.arm_2d_size_t, ptr %460, i32 0, i32 0
  %462 = load i16, ptr %461, align 2, !tbaa !11
  %463 = getelementptr inbounds %struct.arm_2d_region_t, ptr %46, i32 0, i32 1
  %464 = getelementptr inbounds %struct.arm_2d_size_t, ptr %463, i32 0, i32 0
  store i16 %462, ptr %464, align 2, !tbaa !11
  %465 = getelementptr inbounds %struct.arm_2d_region_t, ptr %23, i32 0, i32 1
  %466 = getelementptr inbounds %struct.arm_2d_size_t, ptr %465, i32 0, i32 1
  %467 = load i16, ptr %466, align 2, !tbaa !11
  %468 = sext i16 %467 to i32
  %469 = load i16, ptr %12, align 2, !tbaa !9
  %470 = sext i16 %469 to i32
  %471 = mul nsw i32 %470, 2
  %472 = sub nsw i32 %468, %471
  %473 = trunc i32 %472 to i16
  %474 = getelementptr inbounds %struct.arm_2d_region_t, ptr %46, i32 0, i32 1
  %475 = getelementptr inbounds %struct.arm_2d_size_t, ptr %474, i32 0, i32 1
  store i16 %473, ptr %475, align 2, !tbaa !11
  %476 = getelementptr inbounds %struct.arm_2d_region_t, ptr %46, i32 0, i32 0
  %477 = getelementptr inbounds %struct.arm_2d_region_t, ptr %44, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %476, ptr align 2 %477, i64 4, i1 false), !tbaa.struct !18
  %478 = getelementptr inbounds %struct.arm_2d_region_t, ptr %44, i32 0, i32 1
  %479 = getelementptr inbounds %struct.arm_2d_size_t, ptr %478, i32 0, i32 0
  %480 = load i16, ptr %479, align 2, !tbaa !11
  %481 = sext i16 %480 to i32
  %482 = getelementptr inbounds %struct.arm_2d_region_t, ptr %23, i32 0, i32 1
  %483 = getelementptr inbounds %struct.arm_2d_size_t, ptr %482, i32 0, i32 0
  %484 = load i16, ptr %483, align 2, !tbaa !11
  %485 = sext i16 %484 to i32
  %486 = sub nsw i32 %481, %485
  %487 = ashr i32 %486, 1
  %488 = getelementptr inbounds %struct.arm_2d_region_t, ptr %46, i32 0, i32 0
  %489 = getelementptr inbounds %struct.arm_2d_location_t, ptr %488, i32 0, i32 0
  %490 = load i16, ptr %489, align 2, !tbaa !11
  %491 = sext i16 %490 to i32
  %492 = add nsw i32 %491, %487
  %493 = trunc i32 %492 to i16
  store i16 %493, ptr %489, align 2, !tbaa !11
  %494 = getelementptr inbounds %struct.arm_2d_region_t, ptr %44, i32 0, i32 1
  %495 = getelementptr inbounds %struct.arm_2d_size_t, ptr %494, i32 0, i32 1
  %496 = load i16, ptr %495, align 2, !tbaa !11
  %497 = sext i16 %496 to i32
  %498 = getelementptr inbounds %struct.arm_2d_region_t, ptr %23, i32 0, i32 1
  %499 = getelementptr inbounds %struct.arm_2d_size_t, ptr %498, i32 0, i32 1
  %500 = load i16, ptr %499, align 2, !tbaa !11
  %501 = sext i16 %500 to i32
  %502 = load i16, ptr %12, align 2, !tbaa !9
  %503 = sext i16 %502 to i32
  %504 = mul nsw i32 %503, 2
  %505 = sub nsw i32 %501, %504
  %506 = sub nsw i32 %497, %505
  %507 = ashr i32 %506, 1
  %508 = getelementptr inbounds %struct.arm_2d_region_t, ptr %46, i32 0, i32 0
  %509 = getelementptr inbounds %struct.arm_2d_location_t, ptr %508, i32 0, i32 1
  %510 = load i16, ptr %509, align 2, !tbaa !11
  %511 = sext i16 %510 to i32
  %512 = add nsw i32 %511, %507
  %513 = trunc i32 %512 to i16
  store i16 %513, ptr %509, align 2, !tbaa !11
  store i16 %513, ptr %48, align 2, !tbaa !9
  %514 = load i16, ptr %48, align 2, !tbaa !9
  br label %516

515:                                              ; preds = %455
  br label %516

516:                                              ; preds = %515, %459
  %517 = phi i32 [ 1, %459 ], [ 0, %515 ]
  %518 = icmp ne i32 %517, 0
  br i1 %518, label %520, label %519

519:                                              ; preds = %516
  store i32 29, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #7
  br label %533

520:                                              ; preds = %516
  %521 = load i16, ptr %8, align 2, !tbaa !9
  store i16 %521, ptr %49, align 2, !tbaa !11
  %522 = load i16, ptr %13, align 2, !tbaa !9
  %523 = trunc i16 %522 to i8
  %524 = getelementptr inbounds %union.arm_2d_color_rgb565_t, ptr %49, i32 0, i32 0
  %525 = load i16, ptr %524, align 2
  %526 = call i32 @arm_2dp_rgb565_fill_colour_with_opacity(ptr noundef null, ptr noundef %18, ptr noundef %46, i16 %525, i8 noundef zeroext %523)
  %527 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  br label %528

528:                                              ; preds = %520
  %529 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %530 = zext i1 %529 to i8
  store i8 %530, ptr %50, align 1, !tbaa !26
  %531 = load i8, ptr %50, align 1, !tbaa !26, !range !28, !noundef !29
  %532 = trunc i8 %531 to i1
  br label %455, !llvm.loop !35

533:                                              ; preds = %519
  br label %449, !llvm.loop !36

534:                                              ; preds = %453
  br label %535

535:                                              ; preds = %534
  call void @llvm.lifetime.start.p0(i64 24, ptr %51) #7
  %536 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %51, i32 0, i32 0
  %537 = load i8, ptr %536, align 8
  %538 = and i8 %537, -2
  %539 = or i8 %538, 0
  store i8 %539, ptr %536, align 8
  %540 = load i8, ptr %536, align 8
  %541 = and i8 %540, -3
  %542 = or i8 %541, 0
  store i8 %542, ptr %536, align 8
  %543 = load i8, ptr %536, align 8
  %544 = and i8 %543, -5
  %545 = or i8 %544, 4
  store i8 %545, ptr %536, align 8
  %546 = load i8, ptr %536, align 8
  %547 = and i8 %546, -9
  %548 = or i8 %547, 0
  store i8 %548, ptr %536, align 8
  %549 = load i8, ptr %536, align 8
  %550 = and i8 %549, -17
  %551 = or i8 %550, 0
  store i8 %551, ptr %536, align 8
  %552 = load i8, ptr %536, align 8
  %553 = and i8 %552, 31
  %554 = or i8 %553, 0
  store i8 %554, ptr %536, align 8
  %555 = getelementptr inbounds %struct.anon, ptr %536, i32 0, i32 1
  call void @llvm.memset.p0.i64(ptr align 1 %555, i8 0, i64 1, i1 false)
  %556 = getelementptr inbounds %struct.anon, ptr %536, i32 0, i32 2
  call void @llvm.memset.p0.i64(ptr align 2 %556, i8 0, i64 2, i1 false)
  %557 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %51, i32 0, i32 1
  %558 = getelementptr inbounds %struct.arm_2d_region_t, ptr %557, i32 0, i32 0
  %559 = getelementptr inbounds %struct.arm_2d_location_t, ptr %558, i32 0, i32 0
  store i16 0, ptr %559, align 4, !tbaa !20
  %560 = getelementptr inbounds %struct.arm_2d_location_t, ptr %558, i32 0, i32 1
  %561 = load i16, ptr %12, align 2, !tbaa !9
  store i16 %561, ptr %560, align 2, !tbaa !22
  %562 = getelementptr inbounds %struct.arm_2d_region_t, ptr %557, i32 0, i32 1
  %563 = getelementptr inbounds %struct.arm_2d_size_t, ptr %562, i32 0, i32 0
  %564 = load i16, ptr %11, align 2, !tbaa !9
  store i16 %564, ptr %563, align 4, !tbaa !23
  %565 = getelementptr inbounds %struct.arm_2d_size_t, ptr %562, i32 0, i32 1
  %566 = load i16, ptr %12, align 2, !tbaa !9
  store i16 %566, ptr %565, align 2, !tbaa !25
  %567 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %51, i32 0, i32 2
  %568 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %568, ptr %567, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %52) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %52, ptr align 2 %23, i64 8, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %53) #7
  store ptr null, ptr %53, align 8, !tbaa !5
  br label %569

569:                                              ; preds = %628, %535
  %570 = load ptr, ptr %53, align 8, !tbaa !5
  %571 = getelementptr inbounds %struct.arm_2d_region_t, ptr %570, i32 1
  store ptr %571, ptr %53, align 8, !tbaa !5
  %572 = icmp eq ptr %570, null
  br i1 %572, label %574, label %573

573:                                              ; preds = %569
  store i32 34, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %53) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %52) #7
  br label %629

574:                                              ; preds = %569
  call void @llvm.lifetime.start.p0(i64 8, ptr %54) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %55) #7
  store ptr null, ptr %55, align 8, !tbaa !5
  br label %575

575:                                              ; preds = %623, %574
  %576 = load ptr, ptr %55, align 8, !tbaa !5
  %577 = getelementptr inbounds %struct.arm_2d_region_t, ptr %576, i32 1
  store ptr %577, ptr %55, align 8, !tbaa !5
  %578 = icmp eq ptr %576, null
  br i1 %578, label %579, label %611

579:                                              ; preds = %575
  %580 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %51, i32 0, i32 1
  %581 = getelementptr inbounds %struct.arm_2d_region_t, ptr %580, i32 0, i32 1
  %582 = getelementptr inbounds %struct.arm_2d_size_t, ptr %581, i32 0, i32 0
  %583 = load i16, ptr %582, align 4, !tbaa !11
  %584 = getelementptr inbounds %struct.arm_2d_region_t, ptr %54, i32 0, i32 1
  %585 = getelementptr inbounds %struct.arm_2d_size_t, ptr %584, i32 0, i32 0
  store i16 %583, ptr %585, align 2, !tbaa !11
  %586 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %51, i32 0, i32 1
  %587 = getelementptr inbounds %struct.arm_2d_region_t, ptr %586, i32 0, i32 1
  %588 = getelementptr inbounds %struct.arm_2d_size_t, ptr %587, i32 0, i32 1
  %589 = load i16, ptr %588, align 2, !tbaa !11
  %590 = getelementptr inbounds %struct.arm_2d_region_t, ptr %54, i32 0, i32 1
  %591 = getelementptr inbounds %struct.arm_2d_size_t, ptr %590, i32 0, i32 1
  store i16 %589, ptr %591, align 2, !tbaa !11
  %592 = getelementptr inbounds %struct.arm_2d_region_t, ptr %54, i32 0, i32 0
  %593 = getelementptr inbounds %struct.arm_2d_region_t, ptr %52, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %592, ptr align 2 %593, i64 4, i1 false), !tbaa.struct !18
  %594 = getelementptr inbounds %struct.arm_2d_region_t, ptr %52, i32 0, i32 1
  %595 = getelementptr inbounds %struct.arm_2d_size_t, ptr %594, i32 0, i32 1
  %596 = load i16, ptr %595, align 2, !tbaa !11
  %597 = sext i16 %596 to i32
  %598 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %51, i32 0, i32 1
  %599 = getelementptr inbounds %struct.arm_2d_region_t, ptr %598, i32 0, i32 1
  %600 = getelementptr inbounds %struct.arm_2d_size_t, ptr %599, i32 0, i32 1
  %601 = load i16, ptr %600, align 2, !tbaa !11
  %602 = sext i16 %601 to i32
  %603 = sub nsw i32 %597, %602
  %604 = getelementptr inbounds %struct.arm_2d_region_t, ptr %54, i32 0, i32 0
  %605 = getelementptr inbounds %struct.arm_2d_location_t, ptr %604, i32 0, i32 1
  %606 = load i16, ptr %605, align 2, !tbaa !11
  %607 = sext i16 %606 to i32
  %608 = add nsw i32 %607, %603
  %609 = trunc i32 %608 to i16
  store i16 %609, ptr %605, align 2, !tbaa !11
  store i16 %609, ptr %56, align 2, !tbaa !9
  %610 = load i16, ptr %56, align 2, !tbaa !9
  br label %612

611:                                              ; preds = %575
  br label %612

612:                                              ; preds = %611, %579
  %613 = phi i32 [ 1, %579 ], [ 0, %611 ]
  %614 = icmp ne i32 %613, 0
  br i1 %614, label %616, label %615

615:                                              ; preds = %612
  store i32 36, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %55) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %54) #7
  br label %628

616:                                              ; preds = %612
  %617 = load i16, ptr %8, align 2, !tbaa !9
  store i16 %617, ptr %57, align 2, !tbaa !11
  %618 = load i8, ptr %9, align 1, !tbaa !11
  %619 = getelementptr inbounds %union.arm_2d_color_rgb565_t, ptr %57, i32 0, i32 0
  %620 = load i16, ptr %619, align 2
  %621 = call i32 @arm_2dp_rgb565_fill_colour_with_mask_and_opacity(ptr noundef null, ptr noundef %18, ptr noundef %54, ptr noundef %51, i16 %620, i8 noundef zeroext %618)
  %622 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  br label %623

623:                                              ; preds = %616
  %624 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %625 = zext i1 %624 to i8
  store i8 %625, ptr %58, align 1, !tbaa !26
  %626 = load i8, ptr %58, align 1, !tbaa !26, !range !28, !noundef !29
  %627 = trunc i8 %626 to i1
  br label %575, !llvm.loop !37

628:                                              ; preds = %615
  br label %569, !llvm.loop !38

629:                                              ; preds = %573
  call void @llvm.lifetime.end.p0(i64 24, ptr %51) #7
  br label %630

630:                                              ; preds = %629
  br label %631

631:                                              ; preds = %630
  br label %632

632:                                              ; preds = %631
  call void @llvm.lifetime.start.p0(i64 24, ptr %59) #7
  %633 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %59, i32 0, i32 0
  %634 = load i8, ptr %633, align 8
  %635 = and i8 %634, -2
  %636 = or i8 %635, 0
  store i8 %636, ptr %633, align 8
  %637 = load i8, ptr %633, align 8
  %638 = and i8 %637, -3
  %639 = or i8 %638, 0
  store i8 %639, ptr %633, align 8
  %640 = load i8, ptr %633, align 8
  %641 = and i8 %640, -5
  %642 = or i8 %641, 4
  store i8 %642, ptr %633, align 8
  %643 = load i8, ptr %633, align 8
  %644 = and i8 %643, -9
  %645 = or i8 %644, 0
  store i8 %645, ptr %633, align 8
  %646 = load i8, ptr %633, align 8
  %647 = and i8 %646, -17
  %648 = or i8 %647, 0
  store i8 %648, ptr %633, align 8
  %649 = load i8, ptr %633, align 8
  %650 = and i8 %649, 31
  %651 = or i8 %650, 0
  store i8 %651, ptr %633, align 8
  %652 = getelementptr inbounds %struct.anon, ptr %633, i32 0, i32 1
  call void @llvm.memset.p0.i64(ptr align 1 %652, i8 0, i64 1, i1 false)
  %653 = getelementptr inbounds %struct.anon, ptr %633, i32 0, i32 2
  call void @llvm.memset.p0.i64(ptr align 2 %653, i8 0, i64 2, i1 false)
  %654 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %59, i32 0, i32 1
  %655 = getelementptr inbounds %struct.arm_2d_region_t, ptr %654, i32 0, i32 0
  %656 = getelementptr inbounds %struct.arm_2d_location_t, ptr %655, i32 0, i32 0
  %657 = load i16, ptr %11, align 2, !tbaa !9
  store i16 %657, ptr %656, align 4, !tbaa !20
  %658 = getelementptr inbounds %struct.arm_2d_location_t, ptr %655, i32 0, i32 1
  %659 = load i16, ptr %12, align 2, !tbaa !9
  store i16 %659, ptr %658, align 2, !tbaa !22
  %660 = getelementptr inbounds %struct.arm_2d_region_t, ptr %654, i32 0, i32 1
  %661 = getelementptr inbounds %struct.arm_2d_size_t, ptr %660, i32 0, i32 0
  %662 = load i16, ptr %11, align 2, !tbaa !9
  store i16 %662, ptr %661, align 4, !tbaa !23
  %663 = getelementptr inbounds %struct.arm_2d_size_t, ptr %660, i32 0, i32 1
  %664 = load i16, ptr %12, align 2, !tbaa !9
  store i16 %664, ptr %663, align 2, !tbaa !25
  %665 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %59, i32 0, i32 2
  %666 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %666, ptr %665, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %60) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %60, ptr align 2 %23, i64 8, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %61) #7
  store ptr null, ptr %61, align 8, !tbaa !5
  br label %667

667:                                              ; preds = %742, %632
  %668 = load ptr, ptr %61, align 8, !tbaa !5
  %669 = getelementptr inbounds %struct.arm_2d_region_t, ptr %668, i32 1
  store ptr %669, ptr %61, align 8, !tbaa !5
  %670 = icmp eq ptr %668, null
  br i1 %670, label %672, label %671

671:                                              ; preds = %667
  store i32 41, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %61) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %60) #7
  br label %743

672:                                              ; preds = %667
  call void @llvm.lifetime.start.p0(i64 8, ptr %62) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %63) #7
  store ptr null, ptr %63, align 8, !tbaa !5
  br label %673

673:                                              ; preds = %737, %672
  %674 = load ptr, ptr %63, align 8, !tbaa !5
  %675 = getelementptr inbounds %struct.arm_2d_region_t, ptr %674, i32 1
  store ptr %675, ptr %63, align 8, !tbaa !5
  %676 = icmp eq ptr %674, null
  br i1 %676, label %677, label %725

677:                                              ; preds = %673
  %678 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %59, 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 !11
  %682 = getelementptr inbounds %struct.arm_2d_region_t, ptr %62, i32 0, i32 1
  %683 = getelementptr inbounds %struct.arm_2d_size_t, ptr %682, i32 0, i32 0
  store i16 %681, ptr %683, align 2, !tbaa !11
  %684 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %59, i32 0, i32 1
  %685 = getelementptr inbounds %struct.arm_2d_region_t, ptr %684, i32 0, i32 1
  %686 = getelementptr inbounds %struct.arm_2d_size_t, ptr %685, i32 0, i32 1
  %687 = load i16, ptr %686, align 2, !tbaa !11
  %688 = getelementptr inbounds %struct.arm_2d_region_t, ptr %62, i32 0, i32 1
  %689 = getelementptr inbounds %struct.arm_2d_size_t, ptr %688, i32 0, i32 1
  store i16 %687, ptr %689, align 2, !tbaa !11
  %690 = getelementptr inbounds %struct.arm_2d_region_t, ptr %62, i32 0, i32 0
  %691 = getelementptr inbounds %struct.arm_2d_region_t, ptr %60, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %690, ptr align 2 %691, i64 4, i1 false), !tbaa.struct !18
  %692 = getelementptr inbounds %struct.arm_2d_region_t, ptr %60, i32 0, i32 1
  %693 = getelementptr inbounds %struct.arm_2d_size_t, ptr %692, i32 0, i32 0
  %694 = load i16, ptr %693, align 2, !tbaa !11
  %695 = sext i16 %694 to i32
  %696 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %59, i32 0, i32 1
  %697 = getelementptr inbounds %struct.arm_2d_region_t, ptr %696, i32 0, i32 1
  %698 = getelementptr inbounds %struct.arm_2d_size_t, ptr %697, i32 0, i32 0
  %699 = load i16, ptr %698, align 4, !tbaa !11
  %700 = sext i16 %699 to i32
  %701 = sub nsw i32 %695, %700
  %702 = getelementptr inbounds %struct.arm_2d_region_t, ptr %62, i32 0, i32 0
  %703 = getelementptr inbounds %struct.arm_2d_location_t, ptr %702, i32 0, i32 0
  %704 = load i16, ptr %703, align 2, !tbaa !11
  %705 = sext i16 %704 to i32
  %706 = add nsw i32 %705, %701
  %707 = trunc i32 %706 to i16
  store i16 %707, ptr %703, align 2, !tbaa !11
  %708 = getelementptr inbounds %struct.arm_2d_region_t, ptr %60, i32 0, i32 1
  %709 = getelementptr inbounds %struct.arm_2d_size_t, ptr %708, i32 0, i32 1
  %710 = load i16, ptr %709, align 2, !tbaa !11
  %711 = sext i16 %710 to i32
  %712 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %59, i32 0, i32 1
  %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 1
  %715 = load i16, ptr %714, align 2, !tbaa !11
  %716 = sext i16 %715 to i32
  %717 = sub nsw i32 %711, %716
  %718 = getelementptr inbounds %struct.arm_2d_region_t, ptr %62, i32 0, i32 0
  %719 = getelementptr inbounds %struct.arm_2d_location_t, ptr %718, i32 0, i32 1
  %720 = load i16, ptr %719, align 2, !tbaa !11
  %721 = sext i16 %720 to i32
  %722 = add nsw i32 %721, %717
  %723 = trunc i32 %722 to i16
  store i16 %723, ptr %719, align 2, !tbaa !11
  store i16 %723, ptr %64, align 2, !tbaa !9
  %724 = load i16, ptr %64, align 2, !tbaa !9
  br label %726

725:                                              ; preds = %673
  br label %726

726:                                              ; preds = %725, %677
  %727 = phi i32 [ 1, %677 ], [ 0, %725 ]
  %728 = icmp ne i32 %727, 0
  br i1 %728, label %730, label %729

729:                                              ; preds = %726
  store i32 43, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %63) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %62) #7
  br label %742

730:                                              ; preds = %726
  %731 = load i16, ptr %8, align 2, !tbaa !9
  store i16 %731, ptr %65, align 2, !tbaa !11
  %732 = load i8, ptr %9, align 1, !tbaa !11
  %733 = getelementptr inbounds %union.arm_2d_color_rgb565_t, ptr %65, i32 0, i32 0
  %734 = load i16, ptr %733, align 2
  %735 = call i32 @arm_2dp_rgb565_fill_colour_with_mask_and_opacity(ptr noundef null, ptr noundef %18, ptr noundef %62, ptr noundef %59, i16 %734, i8 noundef zeroext %732)
  %736 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  br label %737

737:                                              ; preds = %730
  %738 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %739 = zext i1 %738 to i8
  store i8 %739, ptr %66, align 1, !tbaa !26
  %740 = load i8, ptr %66, align 1, !tbaa !26, !range !28, !noundef !29
  %741 = trunc i8 %740 to i1
  br label %673, !llvm.loop !39

742:                                              ; preds = %729
  br label %667, !llvm.loop !40

743:                                              ; preds = %671
  call void @llvm.lifetime.end.p0(i64 24, ptr %59) #7
  br label %744

744:                                              ; preds = %743
  br label %745

745:                                              ; preds = %744
  call void @llvm.lifetime.start.p0(i64 8, ptr %67) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %67, ptr align 2 %23, i64 8, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %68) #7
  store ptr null, ptr %68, align 8, !tbaa !5
  br label %746

746:                                              ; preds = %825, %745
  %747 = load ptr, ptr %68, align 8, !tbaa !5
  %748 = getelementptr inbounds %struct.arm_2d_region_t, ptr %747, i32 1
  store ptr %748, ptr %68, align 8, !tbaa !5
  %749 = icmp eq ptr %747, null
  br i1 %749, label %751, label %750

750:                                              ; preds = %746
  store i32 46, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %68) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %67) #7
  br label %826

751:                                              ; preds = %746
  call void @llvm.lifetime.start.p0(i64 8, ptr %69) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %70) #7
  store ptr null, ptr %70, align 8, !tbaa !5
  br label %752

752:                                              ; preds = %820, %751
  %753 = load ptr, ptr %70, align 8, !tbaa !5
  %754 = getelementptr inbounds %struct.arm_2d_region_t, ptr %753, i32 1
  store ptr %754, ptr %70, align 8, !tbaa !5
  %755 = icmp eq ptr %753, null
  br i1 %755, label %756, label %807

756:                                              ; preds = %752
  %757 = getelementptr inbounds %struct.arm_2d_region_t, ptr %23, i32 0, i32 1
  %758 = getelementptr inbounds %struct.arm_2d_size_t, ptr %757, i32 0, i32 0
  %759 = load i16, ptr %758, align 2, !tbaa !11
  %760 = sext i16 %759 to i32
  %761 = load i16, ptr %11, align 2, !tbaa !9
  %762 = sext i16 %761 to i32
  %763 = mul nsw i32 %762, 2
  %764 = sub nsw i32 %760, %763
  %765 = trunc i32 %764 to i16
  %766 = getelementptr inbounds %struct.arm_2d_region_t, ptr %69, i32 0, i32 1
  %767 = getelementptr inbounds %struct.arm_2d_size_t, ptr %766, i32 0, i32 0
  store i16 %765, ptr %767, align 2, !tbaa !11
  %768 = load i16, ptr %12, align 2, !tbaa !9
  %769 = getelementptr inbounds %struct.arm_2d_region_t, ptr %69, i32 0, i32 1
  %770 = getelementptr inbounds %struct.arm_2d_size_t, ptr %769, i32 0, i32 1
  store i16 %768, ptr %770, align 2, !tbaa !11
  %771 = getelementptr inbounds %struct.arm_2d_region_t, ptr %69, i32 0, i32 0
  %772 = getelementptr inbounds %struct.arm_2d_region_t, ptr %67, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %771, ptr align 2 %772, i64 4, i1 false), !tbaa.struct !18
  %773 = getelementptr inbounds %struct.arm_2d_region_t, ptr %67, i32 0, i32 1
  %774 = getelementptr inbounds %struct.arm_2d_size_t, ptr %773, i32 0, i32 0
  %775 = load i16, ptr %774, align 2, !tbaa !11
  %776 = sext i16 %775 to i32
  %777 = getelementptr inbounds %struct.arm_2d_region_t, ptr %23, i32 0, i32 1
  %778 = getelementptr inbounds %struct.arm_2d_size_t, ptr %777, i32 0, i32 0
  %779 = load i16, ptr %778, align 2, !tbaa !11
  %780 = sext i16 %779 to i32
  %781 = load i16, ptr %11, align 2, !tbaa !9
  %782 = sext i16 %781 to i32
  %783 = mul nsw i32 %782, 2
  %784 = sub nsw i32 %780, %783
  %785 = sub nsw i32 %776, %784
  %786 = ashr i32 %785, 1
  %787 = getelementptr inbounds %struct.arm_2d_region_t, ptr %69, 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 !11
  %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 !11
  %793 = getelementptr inbounds %struct.arm_2d_region_t, ptr %67, i32 0, i32 1
  %794 = getelementptr inbounds %struct.arm_2d_size_t, ptr %793, i32 0, i32 1
  %795 = load i16, ptr %794, align 2, !tbaa !11
  %796 = sext i16 %795 to i32
  %797 = load i16, ptr %12, align 2, !tbaa !9
  %798 = sext i16 %797 to i32
  %799 = sub nsw i32 %796, %798
  %800 = getelementptr inbounds %struct.arm_2d_region_t, ptr %69, i32 0, i32 0
  %801 = getelementptr inbounds %struct.arm_2d_location_t, ptr %800, i32 0, i32 1
  %802 = load i16, ptr %801, align 2, !tbaa !11
  %803 = sext i16 %802 to i32
  %804 = add nsw i32 %803, %799
  %805 = trunc i32 %804 to i16
  store i16 %805, ptr %801, align 2, !tbaa !11
  store i16 %805, ptr %71, align 2, !tbaa !9
  %806 = load i16, ptr %71, align 2, !tbaa !9
  br label %808

807:                                              ; preds = %752
  br label %808

808:                                              ; preds = %807, %756
  %809 = phi i32 [ 1, %756 ], [ 0, %807 ]
  %810 = icmp ne i32 %809, 0
  br i1 %810, label %812, label %811

811:                                              ; preds = %808
  store i32 48, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %70) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %69) #7
  br label %825

812:                                              ; preds = %808
  %813 = load i16, ptr %8, align 2, !tbaa !9
  store i16 %813, ptr %72, align 2, !tbaa !11
  %814 = load i16, ptr %13, align 2, !tbaa !9
  %815 = trunc i16 %814 to i8
  %816 = getelementptr inbounds %union.arm_2d_color_rgb565_t, ptr %72, i32 0, i32 0
  %817 = load i16, ptr %816, align 2
  %818 = call i32 @arm_2dp_rgb565_fill_colour_with_opacity(ptr noundef null, ptr noundef %18, ptr noundef %69, i16 %817, i8 noundef zeroext %815)
  %819 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  br label %820

820:                                              ; preds = %812
  %821 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %822 = zext i1 %821 to i8
  store i8 %822, ptr %73, align 1, !tbaa !26
  %823 = load i8, ptr %73, align 1, !tbaa !26, !range !28, !noundef !29
  %824 = trunc i8 %823 to i1
  br label %752, !llvm.loop !41

825:                                              ; preds = %811
  br label %746, !llvm.loop !42

826:                                              ; preds = %750
  br label %827

827:                                              ; preds = %826
  %828 = load ptr, ptr %25, align 8, !tbaa !5
  br label %234, !llvm.loop !43

829:                                              ; preds = %241, %238
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  br label %830

830:                                              ; preds = %829
  br label %831

831:                                              ; preds = %830
  %832 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %833 = zext i1 %832 to i8
  store i8 %833, ptr %74, align 1, !tbaa !26
  %834 = load i8, ptr %74, align 1, !tbaa !26, !range !28, !noundef !29
  %835 = trunc i8 %834 to i1
  br label %220, !llvm.loop !44

836:                                              ; preds = %232
  br label %837

837:                                              ; preds = %836
  br label %139, !llvm.loop !45

838:                                              ; preds = %218, %210
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #7
  br label %839

839:                                              ; preds = %838
  br label %124, !llvm.loop !46

840:                                              ; preds = %137
  call void @llvm.lifetime.end.p0(i64 2, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 2, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 2, ptr %11) #7
  ret void
}

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

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

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

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

declare ptr @arm_2d_get_default_frame_buffer() #5

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

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

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

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

declare zeroext i1 @arm_2d_op_wait_async(ptr noundef) #5

declare i32 @arm_2dp_rgb565_fill_colour_with_opacity(ptr noundef, ptr noundef, ptr noundef, i16, i8 noundef zeroext) #5

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


; 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.9, %union.anon.12 }
%union.anon = type { %struct.anon }
%struct.anon = type { i8, %union.arm_2d_color_info_t, %union.anon.2 }
%union.arm_2d_color_info_t = type { %struct.anon.0 }
%struct.anon.0 = type { i8 }
%union.anon.2 = type { i16 }
%union.anon.9 = type { %struct.arm_2d_region_t }
%struct.arm_2d_region_t = type { %union.anon.10, %union.anon.11 }
%union.anon.10 = type { %struct.arm_2d_location_t }
%struct.arm_2d_location_t = type { i16, i16 }
%union.anon.11 = type { %struct.arm_2d_size_t }
%struct.arm_2d_size_t = type { i16, i16 }
%union.anon.12 = type { ptr }

@.str.1 = external hidden unnamed_addr constant [89 x i8], align 1
@__PRETTY_FUNCTION__.__draw_round_corner_box = external hidden unnamed_addr constant [119 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [63 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @__draw_round_corner_box(ptr noundef nonnull %0, ptr noundef readonly %1, i16 noundef zeroext %2, i8 noundef zeroext %3, ptr noundef %4) local_unnamed_addr #0 {
  %6 = alloca %struct.arm_2d_tile_t, align 8
  %7 = alloca %struct.arm_2d_region_t, align 8
  %8 = alloca %struct.arm_2d_region_t, align 8
  %9 = alloca %struct.arm_2d_tile_t, align 8
  %10 = alloca %struct.arm_2d_tile_t, align 8
  %11 = alloca %struct.arm_2d_region_t, align 4
  %12 = alloca %struct.arm_2d_region_t, align 4
  %13 = alloca %struct.arm_2d_region_t, align 2
  %14 = alloca %struct.arm_2d_tile_t, align 8
  %15 = alloca %struct.arm_2d_region_t, align 4
  %16 = alloca %struct.arm_2d_tile_t, align 8
  %17 = alloca %struct.arm_2d_region_t, align 2
  %18 = alloca %struct.arm_2d_region_t, align 2
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %19, label %20

19:                                               ; preds = %5
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 74, ptr noundef nonnull @__PRETTY_FUNCTION__.__draw_round_corner_box) #5
  unreachable

20:                                               ; preds = %5
  %21 = getelementptr inbounds i8, ptr %4, i64 1
  %22 = load i8, ptr %21, align 1, !tbaa !5
  %23 = icmp eq i8 %22, 6
  br i1 %23, label %25, label %24

24:                                               ; preds = %20
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 75, ptr noundef nonnull @__PRETTY_FUNCTION__.__draw_round_corner_box) #5
  unreachable

25:                                               ; preds = %20
  %26 = getelementptr inbounds i8, ptr %4, i64 8
  %27 = load i16, ptr %26, align 4, !tbaa !5
  %28 = sext i16 %27 to i32
  %29 = add nsw i32 %28, 1
  %30 = lshr i32 %29, 1
  %31 = trunc i32 %30 to i16
  %32 = getelementptr inbounds i8, ptr %4, i64 10
  %33 = load i16, ptr %32, align 2, !tbaa !5
  %34 = sext i16 %33 to i32
  %35 = add nsw i32 %34, 1
  %36 = lshr i32 %35, 1
  %37 = trunc i32 %36 to i16
  %38 = zext i8 %3 to i16
  %39 = icmp eq i8 %3, -1
  %40 = mul nuw i16 %38, 255
  %41 = lshr i16 %40, 8
  %42 = trunc nuw i16 %41 to i8
  %43 = icmp eq ptr %1, null
  %44 = getelementptr inbounds i8, ptr %8, i64 4
  %45 = getelementptr inbounds i8, ptr %6, i64 8
  %46 = getelementptr inbounds i8, ptr %9, i64 1
  %47 = getelementptr inbounds i8, ptr %9, i64 8
  %48 = getelementptr inbounds i8, ptr %9, i64 10
  %49 = getelementptr inbounds i8, ptr %9, i64 16
  %50 = getelementptr inbounds i8, ptr %10, i64 1
  %51 = getelementptr inbounds i8, ptr %10, i64 2
  %52 = getelementptr inbounds i8, ptr %10, i64 4
  %53 = getelementptr inbounds i8, ptr %10, i64 6
  %54 = getelementptr inbounds i8, ptr %10, i64 8
  %55 = getelementptr inbounds i8, ptr %10, i64 10
  %56 = getelementptr inbounds i8, ptr %10, i64 16
  %.sroa.543.0..sroa_idx = getelementptr inbounds i8, ptr %8, i64 6
  %57 = getelementptr inbounds i8, ptr %11, i64 4
  %58 = getelementptr inbounds i8, ptr %11, i64 6
  %sext149 = shl i32 %30, 16
  %59 = ashr exact i32 %sext149, 15
  %60 = trunc i32 %59 to i16
  %61 = getelementptr inbounds i8, ptr %12, i64 4
  %62 = getelementptr inbounds i8, ptr %12, i64 6
  %63 = select i1 %39, i8 -1, i8 %42
  %64 = getelementptr inbounds i8, ptr %13, i64 4
  %sext145 = shl i32 %36, 16
  %65 = ashr exact i32 %sext145, 15
  %66 = trunc i32 %65 to i16
  %67 = getelementptr inbounds i8, ptr %13, i64 6
  %68 = getelementptr inbounds i8, ptr %13, i64 2
  %69 = getelementptr inbounds i8, ptr %14, i64 1
  %70 = getelementptr inbounds i8, ptr %14, i64 2
  %71 = getelementptr inbounds i8, ptr %14, i64 4
  %72 = getelementptr inbounds i8, ptr %14, i64 6
  %73 = getelementptr inbounds i8, ptr %14, i64 8
  %74 = getelementptr inbounds i8, ptr %14, i64 10
  %75 = getelementptr inbounds i8, ptr %14, i64 16
  %76 = getelementptr inbounds i8, ptr %15, i64 4
  %77 = getelementptr inbounds i8, ptr %15, i64 6
  %78 = getelementptr inbounds i8, ptr %15, i64 2
  %79 = getelementptr inbounds i8, ptr %16, i64 1
  %80 = getelementptr inbounds i8, ptr %16, i64 2
  %81 = getelementptr inbounds i8, ptr %16, i64 4
  %82 = getelementptr inbounds i8, ptr %16, i64 6
  %83 = getelementptr inbounds i8, ptr %16, i64 8
  %84 = getelementptr inbounds i8, ptr %16, i64 10
  %85 = getelementptr inbounds i8, ptr %16, i64 16
  %86 = getelementptr inbounds i8, ptr %17, i64 4
  %87 = getelementptr inbounds i8, ptr %17, i64 6
  %88 = getelementptr inbounds i8, ptr %17, i64 2
  %89 = getelementptr inbounds i8, ptr %18, i64 4
  %90 = getelementptr inbounds i8, ptr %18, i64 6
  %91 = getelementptr inbounds i8, ptr %18, i64 2
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %6, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  store i64 0, ptr %7, align 8
  br i1 %43, label %92, label %96

92:                                               ; preds = %25
  %93 = getelementptr inbounds i8, ptr %0, i64 8
  %94 = getelementptr inbounds i8, ptr %7, i64 4
  %95 = load i32, ptr %93, align 4
  store i32 %95, ptr %94, align 4
  br label %98

96:                                               ; preds = %25
  %97 = load i64, ptr %1, align 2
  store i64 %97, ptr %7, align 8
  br label %98

98:                                               ; preds = %92, %96
  %99 = call ptr @arm_2d_tile_generate_child(ptr noundef nonnull %0, ptr noundef nonnull %7, ptr noundef nonnull %6, i1 noundef zeroext false) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  store i64 0, ptr %8, align 8
  %100 = load i32, ptr %45, align 8
  store i32 %100, ptr %44, align 4
  %101 = call zeroext i1 @arm_2d_helper_pfb_is_region_being_drawing(ptr noundef nonnull %6, ptr noundef null, ptr noundef null) #6
  br i1 %101, label %.critedge156, label %.critedge

.critedge156:                                     ; preds = %98
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #6
  store i8 4, ptr %9, align 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(7) %46, i8 0, i64 7, i1 false)
  store i16 %31, ptr %47, align 8, !tbaa !8
  store i16 %37, ptr %48, align 2, !tbaa !11
  store ptr %4, ptr %49, align 8, !tbaa !5
  %102 = call i32 @arm_2dp_rgb565_fill_colour_with_mask_and_opacity(ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %8, ptr noundef nonnull %9, i16 %2, i8 noundef zeroext %3) #6
  %103 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #6
  store i8 4, ptr %10, align 8
  store i8 0, ptr %50, align 1
  store i16 0, ptr %51, align 2
  store i16 %31, ptr %52, align 4, !tbaa !12
  store i16 0, ptr %53, align 2, !tbaa !14
  store i16 %31, ptr %54, align 8, !tbaa !8
  store i16 %37, ptr %55, align 2, !tbaa !11
  store ptr %4, ptr %56, align 8, !tbaa !5
  %104 = load i32, ptr %8, align 8, !tbaa !5
  %.sroa.442.0.copyload = load i16, ptr %44, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  store i16 %31, ptr %57, align 4, !tbaa !5
  store i16 %37, ptr %58, align 2, !tbaa !5
  store i32 %104, ptr %11, align 4
  %105 = sub i16 %.sroa.442.0.copyload, %31
  %106 = trunc i32 %104 to i16
  %107 = add i16 %105, %106
  store i16 %107, ptr %11, align 4, !tbaa !5
  %108 = call i32 @arm_2dp_rgb565_fill_colour_with_mask_and_opacity(ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %11, ptr noundef nonnull %10, i16 %2, i8 noundef zeroext %3) #6
  %109 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  %110 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #6
  %111 = load i32, ptr %8, align 8, !tbaa !5
  %.sroa.434.0.copyload = load i16, ptr %44, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #6
  %112 = sub i16 %.sroa.434.0.copyload, %60
  store i16 %112, ptr %61, align 4, !tbaa !5
  store i16 %37, ptr %62, align 2, !tbaa !5
  store i32 %111, ptr %12, align 4
  %113 = lshr exact i32 %59, 1
  %114 = trunc i32 %111 to i16
  %115 = trunc i32 %113 to i16
  %116 = add i16 %114, %115
  store i16 %116, ptr %12, align 4, !tbaa !5
  %117 = call i32 @arm_2dp_rgb565_fill_colour_with_opacity(ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %12, i16 %2, i8 noundef zeroext %63) #6
  %118 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  %119 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  %120 = load i32, ptr %8, align 8, !tbaa !5
  %.sroa.426.0.copyload = load i16, ptr %44, align 4
  %.sroa.527.0.copyload = load i16, ptr %.sroa.543.0..sroa_idx, align 2, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #6
  store i16 %.sroa.426.0.copyload, ptr %64, align 2, !tbaa !5
  %121 = sub i16 %.sroa.527.0.copyload, %66
  store i16 %121, ptr %67, align 2, !tbaa !5
  %122 = trunc i32 %120 to i16
  store i16 %122, ptr %13, align 2, !tbaa !5
  %123 = lshr exact i32 %65, 1
  %124 = lshr i32 %120, 16
  %125 = trunc nuw i32 %124 to i16
  %126 = trunc i32 %123 to i16
  %127 = add i16 %125, %126
  store i16 %127, ptr %68, align 2, !tbaa !5
  %128 = call i32 @arm_2dp_rgb565_fill_colour_with_opacity(ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %13, i16 %2, i8 noundef zeroext %63) #6
  %129 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  %130 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #6
  store i8 4, ptr %14, align 8
  store i8 0, ptr %69, align 1
  store i16 0, ptr %70, align 2
  store i16 0, ptr %71, align 4, !tbaa !12
  store i16 %37, ptr %72, align 2, !tbaa !14
  store i16 %31, ptr %73, align 8, !tbaa !8
  store i16 %37, ptr %74, align 2, !tbaa !11
  store ptr %4, ptr %75, align 8, !tbaa !5
  %.sroa.018.sroa.0.0.copyload = load i32, ptr %8, align 8, !tbaa !5
  %.sroa.419.0.copyload = load i16, ptr %.sroa.543.0..sroa_idx, align 2, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #6
  store i16 %31, ptr %76, align 4, !tbaa !5
  store i16 %37, ptr %77, align 2, !tbaa !5
  store i32 %.sroa.018.sroa.0.0.copyload, ptr %15, align 4
  %131 = sub i16 %.sroa.419.0.copyload, %37
  %132 = lshr i32 %.sroa.018.sroa.0.0.copyload, 16
  %133 = trunc nuw i32 %132 to i16
  %134 = add i16 %131, %133
  store i16 %134, ptr %78, align 2, !tbaa !5
  %135 = call i32 @arm_2dp_rgb565_fill_colour_with_mask_and_opacity(ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %15, ptr noundef nonnull %14, i16 %2, i8 noundef zeroext %3) #6
  %136 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  %137 = 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.end.p0(i64 24, ptr nonnull %14) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %16) #6
  store i8 4, ptr %16, align 8
  store i8 0, ptr %79, align 1
  store i16 0, ptr %80, align 2
  store i16 %31, ptr %81, align 4, !tbaa !12
  store i16 %37, ptr %82, align 2, !tbaa !14
  store i16 %31, ptr %83, align 8, !tbaa !8
  store i16 %37, ptr %84, align 2, !tbaa !11
  store ptr %4, ptr %85, align 8, !tbaa !5
  %138 = load i32, ptr %8, align 8, !tbaa !5
  %.sroa.411.0.copyload = load i16, ptr %44, align 4
  %.sroa.512.0.copyload = load i16, ptr %.sroa.543.0..sroa_idx, align 2, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #6
  store i16 %31, ptr %86, align 2, !tbaa !5
  store i16 %37, ptr %87, align 2, !tbaa !5
  %139 = sub i16 %.sroa.411.0.copyload, %31
  %140 = trunc i32 %138 to i16
  %141 = add i16 %139, %140
  store i16 %141, ptr %17, align 2, !tbaa !5
  %142 = sub i16 %.sroa.512.0.copyload, %37
  %143 = lshr i32 %138, 16
  %144 = trunc nuw i32 %143 to i16
  %145 = add i16 %142, %144
  store i16 %145, ptr %88, align 2, !tbaa !5
  %146 = call i32 @arm_2dp_rgb565_fill_colour_with_mask_and_opacity(ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %17, ptr noundef nonnull %16, i16 %2, i8 noundef zeroext %3) #6
  %147 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  %148 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #6
  %149 = load i32, ptr %8, align 8, !tbaa !5
  %.sroa.4.0.copyload = load i16, ptr %44, align 4
  %.sroa.5.0.copyload = load i16, ptr %.sroa.543.0..sroa_idx, align 2, !tbaa !5
  %150 = sub i16 %.sroa.5.0.copyload, %37
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #6
  %151 = sub i16 %.sroa.4.0.copyload, %60
  store i16 %151, ptr %89, align 2, !tbaa !5
  store i16 %37, ptr %90, align 2, !tbaa !5
  %152 = trunc i32 %149 to i16
  %153 = add i16 %152, %115
  store i16 %153, ptr %18, align 2, !tbaa !5
  %154 = lshr i32 %149, 16
  %155 = trunc nuw i32 %154 to i16
  %156 = add i16 %150, %155
  store i16 %156, ptr %91, align 2, !tbaa !5
  %157 = call i32 @arm_2dp_rgb565_fill_colour_with_opacity(ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %18, i16 %2, i8 noundef zeroext %63) #6
  %158 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  %159 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #6
  br label %.critedge, !llvm.loop !15

.critedge:                                        ; preds = %.critedge156, %98
  %160 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  ret void
}

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

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

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

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

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

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

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 #4

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

declare i32 @arm_2dp_rgb565_fill_colour_with_opacity(ptr noundef, ptr noundef, ptr noundef, i16, i8 noundef zeroext) local_unnamed_addr #4

attributes #0 = { 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 #1 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { noreturn nounwind }
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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !10, i64 0}
!9 = !{!"arm_2d_size_t", !10, i64 0, !10, i64 2}
!10 = !{!"short", !6, i64 0}
!11 = !{!9, !10, i64 2}
!12 = !{!13, !10, i64 0}
!13 = !{!"arm_2d_location_t", !10, i64 0, !10, i64 2}
!14 = !{!13, !10, i64 2}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


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