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

; 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"

%union.arm_2d_color_info_t = type { %struct.anon.10 }
%struct.anon.10 = type { i8 }
%struct.arm_2d_helper_pfb_t = type { %struct.anon, %struct.anon.30 }
%struct.anon = type { %struct.arm_2d_helper_pfb_cfg_t, %struct.anon.4 }
%struct.arm_2d_helper_pfb_cfg_t = type { %struct.arm_2d_region_t, %struct.anon.1, %struct.anon.2, %struct.arm_2d_helper_pfb_dependency_t }
%struct.arm_2d_region_t = type { %union.anon, %union.anon.0 }
%union.anon = type { %struct.arm_2d_location_t }
%struct.arm_2d_location_t = type { i16, i16 }
%union.anon.0 = type { %struct.arm_2d_size_t }
%struct.arm_2d_size_t = type { i16, i16 }
%struct.anon.1 = type <{ ptr, %struct.arm_2d_size_t, i64, [4 x i8] }>
%struct.anon.2 = type { ptr, i8 }
%struct.arm_2d_helper_pfb_dependency_t = type { %struct.arm_2d_helper_render_evt_t, %struct.arm_2d_helper_draw_evt_t, %struct.arm_2d_evt_t, %struct.arm_2d_evt_t, %struct.anon.3, %struct.arm_2d_helper_before_flushing_evt_t }
%struct.arm_2d_helper_render_evt_t = type { ptr, ptr }
%struct.arm_2d_helper_draw_evt_t = type { ptr, ptr }
%struct.arm_2d_evt_t = type { ptr, ptr }
%struct.anon.3 = type { %struct.arm_2d_helper_draw_evt_t, ptr }
%struct.arm_2d_helper_before_flushing_evt_t = type { ptr, ptr }
%struct.anon.4 = type { %struct.arm_2d_location_t, %struct.arm_2d_region_t, ptr, %struct.anon.5, %struct.arm_2d_tile_t, %struct.arm_2d_size_t, i32, i8, i8, i16, %struct.anon.21, %union.arm_2d_colour_t, i64, ptr, ptr, ptr, %struct.anon.29, ptr }
%struct.anon.5 = type { ptr, ptr, ptr, ptr, %struct.arm_2d_region_list_item_t }
%struct.arm_2d_region_list_item_t = type { ptr, %struct.anon.6, %struct.arm_2d_region_t, %struct.anon.7 }
%struct.anon.6 = type { ptr }
%struct.anon.7 = type { i8, i8, i16 }
%struct.arm_2d_tile_t = type { %union.anon.8, %union.anon.19, %union.anon.20 }
%union.anon.8 = type { %struct.anon.9 }
%struct.anon.9 = type { i8, %union.arm_2d_color_info_t, %union.anon.12 }
%union.anon.12 = type { i16 }
%union.anon.19 = type { %struct.arm_2d_region_t }
%union.anon.20 = type { ptr }
%struct.anon.21 = type { i32 }
%union.arm_2d_colour_t = type { i32 }
%struct.anon.29 = type { ptr, ptr }
%struct.anon.30 = type { i64, i32, i32 }

@.str = external hidden unnamed_addr constant [15 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [87 x i8], align 1
@__PRETTY_FUNCTION__.arm_2d_helper_pfb_task = external hidden unnamed_addr constant [88 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [59 x i8], align 1

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @__arm_2d_helper_perf_counter_stop(ptr noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @arm_2d_helper_pfb_task(ptr noundef nonnull %0, ptr noundef %1) #2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %union.arm_2d_color_info_t, align 1
  %12 = alloca i16, align 2
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = icmp ne ptr null, %15
  br i1 %16, label %17, label %18

17:                                               ; preds = %2
  br label %19

18:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 2732, ptr noundef @__PRETTY_FUNCTION__.arm_2d_helper_pfb_task) #4
  unreachable

19:                                               ; preds = %17
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %20, i32 0, i32 0
  %22 = getelementptr inbounds %struct.anon, ptr %21, i32 0, i32 0
  %23 = getelementptr inbounds %struct.arm_2d_helper_pfb_cfg_t, ptr %22, i32 0, i32 3
  %24 = getelementptr inbounds %struct.arm_2d_helper_pfb_dependency_t, ptr %23, i32 0, i32 1
  %25 = getelementptr inbounds %struct.arm_2d_helper_draw_evt_t, ptr %24, i32 0, i32 0
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  %27 = icmp ne ptr null, %26
  br i1 %27, label %28, label %29

28:                                               ; preds = %19
  br label %30

29:                                               ; preds = %19
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.1, i32 noundef 2733, ptr noundef @__PRETTY_FUNCTION__.arm_2d_helper_pfb_task) #4
  unreachable

30:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %31, i32 0, i32 0
  %33 = getelementptr inbounds %struct.anon, ptr %32, i32 0, i32 1
  %34 = getelementptr inbounds %struct.anon.4, ptr %33, i32 0, i32 7
  store ptr %34, ptr %7, align 8, !tbaa !5
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %35, i32 0, i32 0
  %37 = getelementptr inbounds %struct.anon, ptr %36, i32 0, i32 1
  %38 = getelementptr inbounds %struct.anon.4, ptr %37, i32 0, i32 7
  %39 = load i8, ptr %38, align 8, !tbaa !36
  %40 = zext i8 %39 to i32
  switch i32 %40, label %582 [
    i32 0, label %41
    i32 1, label %186
    i32 2, label %280
    i32 3, label %377
    i32 4, label %403
    i32 5, label %464
  ]

41:                                               ; preds = %30
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %42, i32 0, i32 1
  %44 = getelementptr inbounds %struct.anon.30, ptr %43, i32 0, i32 1
  store i32 0, ptr %44, align 8, !tbaa !37
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %45, i32 0, i32 1
  %47 = getelementptr inbounds %struct.anon.30, ptr %46, i32 0, i32 2
  store i32 0, ptr %47, align 4, !tbaa !38
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %48, i32 0, i32 0
  %50 = getelementptr inbounds %struct.anon, ptr %49, i32 0, i32 1
  %51 = getelementptr inbounds %struct.anon.4, ptr %50, i32 0, i32 10
  %52 = load i32, ptr %51, align 4
  %53 = and i32 %52, -257
  %54 = or i32 %53, 256
  store i32 %54, ptr %51, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !39
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store ptr null, ptr %9, align 8, !tbaa !5
  br label %55

55:                                               ; preds = %109, %41
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = getelementptr inbounds i32, ptr %56, i32 1
  store ptr %57, ptr %9, align 8, !tbaa !5
  %58 = icmp eq ptr %56, null
  br i1 %58, label %60, label %59

59:                                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %110

60:                                               ; preds = %55
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %61, i32 0, i32 0
  %63 = getelementptr inbounds %struct.anon, ptr %62, i32 0, i32 1
  %64 = getelementptr inbounds %struct.anon.4, ptr %63, i32 0, i32 10
  %65 = load i32, ptr %64, align 4
  %66 = lshr i32 %65, 1
  %67 = and i32 %66, 1
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %69, label %84

69:                                               ; preds = %60
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %70, i32 0, i32 0
  %72 = getelementptr inbounds %struct.anon, ptr %71, i32 0, i32 1
  %73 = getelementptr inbounds %struct.anon.4, ptr %72, i32 0, i32 10
  %74 = load i32, ptr %73, align 4
  %75 = and i32 %74, -3
  %76 = or i32 %75, 0
  store i32 %76, ptr %73, align 4
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %77, i32 0, i32 0
  %79 = getelementptr inbounds %struct.anon, ptr %78, i32 0, i32 1
  %80 = getelementptr inbounds %struct.anon.4, ptr %79, i32 0, i32 10
  %81 = load i32, ptr %80, align 4
  %82 = and i32 %81, -2
  %83 = or i32 %82, 1
  store i32 %83, ptr %80, align 4
  br label %109

84:                                               ; preds = %60
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %85, i32 0, i32 0
  %87 = getelementptr inbounds %struct.anon, ptr %86, i32 0, i32 1
  %88 = getelementptr inbounds %struct.anon.4, ptr %87, i32 0, i32 10
  %89 = load i32, ptr %88, align 4
  %90 = lshr i32 %89, 2
  %91 = and i32 %90, 1
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %108

93:                                               ; preds = %84
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %94, i32 0, i32 0
  %96 = getelementptr inbounds %struct.anon, ptr %95, i32 0, i32 1
  %97 = getelementptr inbounds %struct.anon.4, ptr %96, i32 0, i32 10
  %98 = load i32, ptr %97, align 4
  %99 = and i32 %98, -5
  %100 = or i32 %99, 0
  store i32 %100, ptr %97, align 4
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %101, i32 0, i32 0
  %103 = getelementptr inbounds %struct.anon, ptr %102, i32 0, i32 1
  %104 = getelementptr inbounds %struct.anon.4, ptr %103, i32 0, i32 10
  %105 = load i32, ptr %104, align 4
  %106 = and i32 %105, -2
  %107 = or i32 %106, 0
  store i32 %107, ptr %104, align 4
  br label %108

108:                                              ; preds = %93, %84
  br label %109

109:                                              ; preds = %108, %69
  br label %55, !llvm.loop !40

110:                                              ; preds = %59
  %111 = load ptr, ptr %4, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %111, i32 0, i32 0
  %113 = getelementptr inbounds %struct.anon, ptr %112, i32 0, i32 1
  %114 = getelementptr inbounds %struct.anon.4, ptr %113, i32 0, i32 10
  %115 = load i32, ptr %114, align 4
  %116 = and i32 %115, 1
  %117 = icmp ne i32 %116, 0
  br i1 %117, label %118, label %159

118:                                              ; preds = %110
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %120, i32 0, i32 0
  %122 = getelementptr inbounds %struct.anon, ptr %121, i32 0, i32 1
  %123 = getelementptr inbounds %struct.anon.4, ptr %122, i32 0, i32 3
  %124 = getelementptr inbounds %struct.anon.5, ptr %123, i32 0, i32 1
  store ptr %119, ptr %124, align 8, !tbaa !42
  %125 = load ptr, ptr %4, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %125, i32 0, i32 0
  %127 = getelementptr inbounds %struct.anon, ptr %126, i32 0, i32 1
  %128 = getelementptr inbounds %struct.anon.4, ptr %127, i32 0, i32 10
  %129 = load i32, ptr %128, align 4
  %130 = and i32 %129, -33
  %131 = or i32 %130, 0
  store i32 %131, ptr %128, align 4
  %132 = load ptr, ptr %4, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %132, i32 0, i32 0
  %134 = getelementptr inbounds %struct.anon, ptr %133, i32 0, i32 1
  %135 = getelementptr inbounds %struct.anon.4, ptr %134, i32 0, i32 10
  %136 = load i32, ptr %135, align 4
  %137 = and i32 %136, -17
  %138 = or i32 %137, 0
  store i32 %138, ptr %135, align 4
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %139, i32 0, i32 0
  %141 = getelementptr inbounds %struct.anon, ptr %140, i32 0, i32 1
  %142 = getelementptr inbounds %struct.anon.4, ptr %141, i32 0, i32 3
  %143 = getelementptr inbounds %struct.anon.5, ptr %142, i32 0, i32 0
  %144 = load ptr, ptr %143, align 8, !tbaa !43
  %145 = icmp eq ptr null, %144
  br i1 %145, label %146, label %147

146:                                              ; preds = %118
  br label %148

147:                                              ; preds = %118
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.1, i32 noundef 2782, ptr noundef @__PRETTY_FUNCTION__.arm_2d_helper_pfb_task) #4
  unreachable

148:                                              ; preds = %146
  %149 = load ptr, ptr %4, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %149, i32 0, i32 0
  %151 = getelementptr inbounds %struct.anon, ptr %150, i32 0, i32 1
  %152 = getelementptr inbounds %struct.anon.4, ptr %151, i32 0, i32 3
  %153 = getelementptr inbounds %struct.anon.5, ptr %152, i32 0, i32 2
  %154 = load ptr, ptr %153, align 8, !tbaa !44
  %155 = icmp eq ptr null, %154
  br i1 %155, label %156, label %157

156:                                              ; preds = %148
  br label %158

157:                                              ; preds = %148
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.1, i32 noundef 2783, ptr noundef @__PRETTY_FUNCTION__.arm_2d_helper_pfb_task) #4
  unreachable

158:                                              ; preds = %156
  br label %159

159:                                              ; preds = %158, %110
  %160 = load ptr, ptr %4, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %160, i32 0, i32 0
  %162 = getelementptr inbounds %struct.anon, ptr %161, i32 0, i32 1
  %163 = getelementptr inbounds %struct.anon.4, ptr %162, i32 0, i32 10
  %164 = load i32, ptr %163, align 4
  %165 = lshr i32 %164, 7
  %166 = and i32 %165, 1
  %167 = icmp ne i32 %166, 0
  br i1 %167, label %216, label %168

168:                                              ; preds = %159
  %169 = load ptr, ptr %4, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %169, i32 0, i32 0
  %171 = getelementptr inbounds %struct.anon, ptr %170, i32 0, i32 1
  %172 = getelementptr inbounds %struct.anon.4, ptr %171, i32 0, i32 10
  %173 = load i32, ptr %172, align 4
  %174 = lshr i32 %173, 10
  %175 = and i32 %174, 1
  %176 = icmp ne i32 %175, 0
  br i1 %176, label %216, label %177

177:                                              ; preds = %168
  %178 = load ptr, ptr %4, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %178, i32 0, i32 0
  %180 = getelementptr inbounds %struct.anon, ptr %179, i32 0, i32 1
  %181 = getelementptr inbounds %struct.anon.4, ptr %180, i32 0, i32 10
  %182 = load i32, ptr %181, align 4
  %183 = and i32 %182, -129
  %184 = or i32 %183, 128
  store i32 %184, ptr %181, align 4
  %185 = load ptr, ptr %7, align 8, !tbaa !5
  store i8 1, ptr %185, align 1, !tbaa !45
  br label %186

186:                                              ; preds = %177, %30
  %187 = load ptr, ptr %7, align 8, !tbaa !5
  %188 = load i8, ptr %187, align 1, !tbaa !45
  %189 = load ptr, ptr %4, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %189, i32 0, i32 0
  %191 = getelementptr inbounds %struct.anon, ptr %190, i32 0, i32 0
  %192 = getelementptr inbounds %struct.arm_2d_helper_pfb_cfg_t, ptr %191, i32 0, i32 3
  %193 = getelementptr inbounds %struct.arm_2d_helper_pfb_dependency_t, ptr %192, i32 0, i32 2
  %194 = getelementptr inbounds %struct.arm_2d_evt_t, ptr %193, i32 0, i32 0
  %195 = load ptr, ptr %194, align 8, !tbaa !46
  %196 = icmp ne ptr null, %195
  br i1 %196, label %197, label %215

197:                                              ; preds = %186
  %198 = load ptr, ptr %4, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %198, i32 0, i32 0
  %200 = getelementptr inbounds %struct.anon, ptr %199, i32 0, i32 0
  %201 = getelementptr inbounds %struct.arm_2d_helper_pfb_cfg_t, ptr %200, i32 0, i32 3
  %202 = getelementptr inbounds %struct.arm_2d_helper_pfb_dependency_t, ptr %201, i32 0, i32 2
  %203 = getelementptr inbounds %struct.arm_2d_evt_t, ptr %202, i32 0, i32 0
  %204 = load ptr, ptr %203, align 8, !tbaa !46
  %205 = load ptr, ptr %4, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %205, i32 0, i32 0
  %207 = getelementptr inbounds %struct.anon, ptr %206, i32 0, i32 0
  %208 = getelementptr inbounds %struct.arm_2d_helper_pfb_cfg_t, ptr %207, i32 0, i32 3
  %209 = getelementptr inbounds %struct.arm_2d_helper_pfb_dependency_t, ptr %208, i32 0, i32 2
  %210 = getelementptr inbounds %struct.arm_2d_evt_t, ptr %209, i32 0, i32 1
  %211 = load ptr, ptr %210, align 8, !tbaa !47
  %212 = call zeroext i1 %204(ptr noundef %211)
  br i1 %212, label %214, label %213

213:                                              ; preds = %197
  store i32 3, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %651

214:                                              ; preds = %197
  br label %215

215:                                              ; preds = %214, %186
  br label %217

216:                                              ; preds = %168, %159
  br label %217

217:                                              ; preds = %216, %215
  %218 = load ptr, ptr %4, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %218, i32 0, i32 1
  %220 = getelementptr inbounds %struct.anon.30, ptr %219, i32 0, i32 0
  call void @__arm_2d_helper_perf_counter_start(ptr noundef %220, i32 noundef 1)
  br label %221

221:                                              ; preds = %567, %217
  br label %222

222:                                              ; preds = %262, %221
  %223 = load ptr, ptr %4, align 8, !tbaa !5
  %224 = load ptr, ptr %5, align 8, !tbaa !5
  %225 = call ptr @__arm_2d_helper_pfb_drawing_iteration_begin(ptr noundef %223, ptr noundef %224)
  %226 = load ptr, ptr %4, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %226, i32 0, i32 0
  %228 = getelementptr inbounds %struct.anon, ptr %227, i32 0, i32 1
  %229 = getelementptr inbounds %struct.anon.4, ptr %228, i32 0, i32 17
  store ptr %225, ptr %229, align 8, !tbaa !48
  %230 = load ptr, ptr %4, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %230, i32 0, i32 0
  %232 = getelementptr inbounds %struct.anon, ptr %231, i32 0, i32 1
  %233 = getelementptr inbounds %struct.anon.4, ptr %232, i32 0, i32 17
  %234 = load ptr, ptr %233, align 8, !tbaa !48
  %235 = icmp eq ptr null, %234
  br i1 %235, label %236, label %251

236:                                              ; preds = %222
  %237 = load ptr, ptr %4, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %237, i32 0, i32 0
  %239 = getelementptr inbounds %struct.anon, ptr %238, i32 0, i32 1
  %240 = getelementptr inbounds %struct.anon.4, ptr %239, i32 0, i32 12
  %241 = load i64, ptr %240, align 8, !tbaa !49
  %242 = icmp ne i64 0, %241
  br i1 %242, label %243, label %250

243:                                              ; preds = %236
  %244 = load ptr, ptr %4, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %244, i32 0, i32 0
  %246 = getelementptr inbounds %struct.anon, ptr %245, i32 0, i32 1
  %247 = getelementptr inbounds %struct.anon.4, ptr %246, i32 0, i32 12
  %248 = load i64, ptr %247, align 8, !tbaa !49
  %249 = call zeroext i1 @arm_2d_port_wait_for_semaphore(i64 noundef %248)
  br label %250

250:                                              ; preds = %243, %236
  br label %262

251:                                              ; preds = %222
  %252 = load ptr, ptr %4, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %252, i32 0, i32 0
  %254 = getelementptr inbounds %struct.anon, ptr %253, i32 0, i32 1
  %255 = getelementptr inbounds %struct.anon.4, ptr %254, i32 0, i32 17
  %256 = load ptr, ptr %255, align 8, !tbaa !48
  %257 = ptrtoint ptr %256 to i64
  %258 = icmp eq i64 -1, %257
  br i1 %258, label %259, label %260

259:                                              ; preds = %251
  br label %571

260:                                              ; preds = %251
  br label %261

261:                                              ; preds = %260
  br label %262

262:                                              ; preds = %261, %250
  %263 = load ptr, ptr %4, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %263, i32 0, i32 0
  %265 = getelementptr inbounds %struct.anon, ptr %264, i32 0, i32 1
  %266 = getelementptr inbounds %struct.anon.4, ptr %265, i32 0, i32 17
  %267 = load ptr, ptr %266, align 8, !tbaa !48
  %268 = icmp eq ptr null, %267
  br i1 %268, label %222, label %269, !llvm.loop !50

269:                                              ; preds = %262
  %270 = load ptr, ptr %4, align 8, !tbaa !5
  %271 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %270, i32 0, i32 1
  %272 = getelementptr inbounds %struct.anon.30, ptr %271, i32 0, i32 0
  %273 = call i32 @__arm_2d_helper_perf_counter_stop(ptr noundef %272, i32 noundef 1)
  %274 = load ptr, ptr %4, align 8, !tbaa !5
  %275 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %274, i32 0, i32 1
  %276 = getelementptr inbounds %struct.anon.30, ptr %275, i32 0, i32 2
  %277 = load i32, ptr %276, align 4, !tbaa !38
  %278 = add nsw i32 %277, %273
  store i32 %278, ptr %276, align 4, !tbaa !38
  %279 = load ptr, ptr %7, align 8, !tbaa !5
  store i8 2, ptr %279, align 1, !tbaa !45
  br label %280

280:                                              ; preds = %269, %30
  %281 = load ptr, ptr %7, align 8, !tbaa !5
  %282 = load i8, ptr %281, align 1, !tbaa !45
  %283 = load ptr, ptr %4, align 8, !tbaa !5
  %284 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %283, i32 0, i32 1
  %285 = getelementptr inbounds %struct.anon.30, ptr %284, i32 0, i32 0
  call void @__arm_2d_helper_perf_counter_start(ptr noundef %285, i32 noundef 0)
  %286 = load ptr, ptr %4, align 8, !tbaa !5
  %287 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %286, i32 0, i32 0
  %288 = getelementptr inbounds %struct.anon, ptr %287, i32 0, i32 1
  %289 = getelementptr inbounds %struct.anon.4, ptr %288, i32 0, i32 10
  %290 = load i32, ptr %289, align 4
  %291 = lshr i32 %290, 9
  %292 = and i32 %291, 1
  %293 = icmp ne i32 %292, 0
  br i1 %293, label %323, label %294

294:                                              ; preds = %280
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #5
  %295 = load ptr, ptr %4, align 8, !tbaa !5
  %296 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %295, i32 0, i32 0
  %297 = getelementptr inbounds %struct.anon, ptr %296, i32 0, i32 0
  %298 = getelementptr inbounds %struct.arm_2d_helper_pfb_cfg_t, ptr %297, i32 0, i32 1
  %299 = getelementptr inbounds %struct.anon.1, ptr %298, i32 0, i32 2
  %300 = load i64, ptr %299, align 4
  %301 = lshr i64 %300, 24
  %302 = and i64 %301, 127
  %303 = trunc i64 %302 to i32
  %304 = trunc i32 %303 to i8
  %305 = load i8, ptr %11, align 1
  %306 = and i8 %304, 127
  %307 = and i8 %305, -128
  %308 = or i8 %307, %306
  store i8 %308, ptr %11, align 1
  %309 = load ptr, ptr %4, align 8, !tbaa !5
  %310 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %309, i32 0, i32 0
  %311 = getelementptr inbounds %struct.anon, ptr %310, i32 0, i32 1
  %312 = getelementptr inbounds %struct.anon.4, ptr %311, i32 0, i32 17
  %313 = load ptr, ptr %312, align 8, !tbaa !48
  %314 = load ptr, ptr %4, align 8, !tbaa !5
  %315 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %314, i32 0, i32 0
  %316 = getelementptr inbounds %struct.anon, ptr %315, i32 0, i32 1
  %317 = getelementptr inbounds %struct.anon.4, ptr %316, i32 0, i32 11
  %318 = getelementptr inbounds %union.arm_2d_color_info_t, ptr %11, i32 0, i32 0
  %319 = getelementptr inbounds %struct.anon.10, ptr %318, i32 0, i32 0
  %320 = load i8, ptr %319, align 1
  %321 = getelementptr inbounds %union.arm_2d_colour_t, ptr %317, i32 0, i32 0
  %322 = load i32, ptr %321, align 8
  call void @arm_2d_helper_fill_tile_colour(ptr noundef %313, i8 %320, i32 %322)
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #5
  br label %323

323:                                              ; preds = %294, %280
  %324 = load ptr, ptr %4, align 8, !tbaa !5
  %325 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %324, i32 0, i32 0
  %326 = getelementptr inbounds %struct.anon, ptr %325, i32 0, i32 0
  %327 = getelementptr inbounds %struct.arm_2d_helper_pfb_cfg_t, ptr %326, i32 0, i32 3
  %328 = getelementptr inbounds %struct.arm_2d_helper_pfb_dependency_t, ptr %327, i32 0, i32 1
  %329 = getelementptr inbounds %struct.arm_2d_helper_draw_evt_t, ptr %328, i32 0, i32 0
  %330 = load ptr, ptr %329, align 8, !tbaa !9
  %331 = load ptr, ptr %4, align 8, !tbaa !5
  %332 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %331, i32 0, i32 0
  %333 = getelementptr inbounds %struct.anon, ptr %332, i32 0, i32 0
  %334 = getelementptr inbounds %struct.arm_2d_helper_pfb_cfg_t, ptr %333, i32 0, i32 3
  %335 = getelementptr inbounds %struct.arm_2d_helper_pfb_dependency_t, ptr %334, i32 0, i32 1
  %336 = getelementptr inbounds %struct.arm_2d_helper_draw_evt_t, ptr %335, i32 0, i32 1
  %337 = load ptr, ptr %336, align 8, !tbaa !51
  %338 = load ptr, ptr %4, align 8, !tbaa !5
  %339 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %338, i32 0, i32 0
  %340 = getelementptr inbounds %struct.anon, ptr %339, i32 0, i32 1
  %341 = getelementptr inbounds %struct.anon.4, ptr %340, i32 0, i32 17
  %342 = load ptr, ptr %341, align 8, !tbaa !48
  %343 = load ptr, ptr %4, align 8, !tbaa !5
  %344 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %343, i32 0, i32 0
  %345 = getelementptr inbounds %struct.anon, ptr %344, i32 0, i32 1
  %346 = getelementptr inbounds %struct.anon.4, ptr %345, i32 0, i32 10
  %347 = load i32, ptr %346, align 4
  %348 = lshr i32 %347, 8
  %349 = and i32 %348, 1
  %350 = icmp ne i32 %349, 0
  %351 = call i32 %330(ptr noundef %337, ptr noundef %342, i1 noundef zeroext %350)
  store i32 %351, ptr %6, align 4, !tbaa !39
  %352 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %353 = load ptr, ptr %4, align 8, !tbaa !5
  %354 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %353, i32 0, i32 1
  %355 = getelementptr inbounds %struct.anon.30, ptr %354, i32 0, i32 0
  %356 = call i32 @__arm_2d_helper_perf_counter_stop(ptr noundef %355, i32 noundef 0)
  %357 = load ptr, ptr %4, align 8, !tbaa !5
  %358 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %357, i32 0, i32 1
  %359 = getelementptr inbounds %struct.anon.30, ptr %358, i32 0, i32 1
  %360 = load i32, ptr %359, align 8, !tbaa !37
  %361 = add nsw i32 %360, %356
  store i32 %361, ptr %359, align 8, !tbaa !37
  %362 = load i32, ptr %6, align 4, !tbaa !39
  %363 = icmp eq i32 1, %362
  br i1 %363, label %364, label %365

364:                                              ; preds = %323
  store i32 1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %651

365:                                              ; preds = %323
  %366 = load i32, ptr %6, align 4, !tbaa !39
  %367 = icmp slt i32 %366, 0
  br i1 %367, label %368, label %370

368:                                              ; preds = %365
  %369 = load i32, ptr %6, align 4, !tbaa !39
  store i32 %369, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %651

370:                                              ; preds = %365
  %371 = load i32, ptr %6, align 4, !tbaa !39
  %372 = icmp eq i32 2, %371
  br i1 %372, label %373, label %375

373:                                              ; preds = %370
  %374 = load i32, ptr %6, align 4, !tbaa !39
  store i32 %374, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %651

375:                                              ; preds = %370
  %376 = load ptr, ptr %7, align 8, !tbaa !5
  store i8 3, ptr %376, align 1, !tbaa !45
  store i32 1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %651

377:                                              ; preds = %30
  %378 = load ptr, ptr %7, align 8, !tbaa !5
  %379 = load i8, ptr %378, align 1, !tbaa !45
  br label %380

380:                                              ; preds = %377
  br label %381

381:                                              ; preds = %380
  br label %382

382:                                              ; preds = %381
  %383 = load ptr, ptr %4, align 8, !tbaa !5
  %384 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %383, i32 0, i32 0
  %385 = getelementptr inbounds %struct.anon, ptr %384, i32 0, i32 0
  %386 = getelementptr inbounds %struct.arm_2d_helper_pfb_cfg_t, ptr %385, i32 0, i32 3
  %387 = getelementptr inbounds %struct.arm_2d_helper_pfb_dependency_t, ptr %386, i32 0, i32 4
  %388 = getelementptr inbounds %struct.anon.3, ptr %387, i32 0, i32 0
  %389 = getelementptr inbounds %struct.arm_2d_helper_draw_evt_t, ptr %388, i32 0, i32 0
  %390 = load ptr, ptr %389, align 8, !tbaa !52
  %391 = icmp ne ptr null, %390
  br i1 %391, label %392, label %470

392:                                              ; preds = %382
  %393 = load ptr, ptr %4, align 8, !tbaa !5
  %394 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %393, i32 0, i32 0
  %395 = getelementptr inbounds %struct.anon, ptr %394, i32 0, i32 1
  %396 = getelementptr inbounds %struct.anon.4, ptr %395, i32 0, i32 10
  %397 = load i32, ptr %396, align 4
  %398 = lshr i32 %397, 11
  %399 = and i32 %398, 1
  %400 = icmp ne i32 %399, 0
  br i1 %400, label %470, label %401

401:                                              ; preds = %392
  %402 = load ptr, ptr %7, align 8, !tbaa !5
  store i8 4, ptr %402, align 1, !tbaa !45
  br label %403

403:                                              ; preds = %401, %30
  %404 = load ptr, ptr %7, align 8, !tbaa !5
  %405 = load i8, ptr %404, align 1, !tbaa !45
  %406 = load ptr, ptr %4, align 8, !tbaa !5
  %407 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %406, i32 0, i32 1
  %408 = getelementptr inbounds %struct.anon.30, ptr %407, i32 0, i32 0
  call void @__arm_2d_helper_perf_counter_start(ptr noundef %408, i32 noundef 0)
  %409 = load ptr, ptr %4, align 8, !tbaa !5
  %410 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %409, i32 0, i32 0
  %411 = getelementptr inbounds %struct.anon, ptr %410, i32 0, i32 0
  %412 = getelementptr inbounds %struct.arm_2d_helper_pfb_cfg_t, ptr %411, i32 0, i32 3
  %413 = getelementptr inbounds %struct.arm_2d_helper_pfb_dependency_t, ptr %412, i32 0, i32 4
  %414 = getelementptr inbounds %struct.anon.3, ptr %413, i32 0, i32 0
  %415 = getelementptr inbounds %struct.arm_2d_helper_draw_evt_t, ptr %414, i32 0, i32 0
  %416 = load ptr, ptr %415, align 8, !tbaa !52
  %417 = load ptr, ptr %4, align 8, !tbaa !5
  %418 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %417, i32 0, i32 0
  %419 = getelementptr inbounds %struct.anon, ptr %418, i32 0, i32 0
  %420 = getelementptr inbounds %struct.arm_2d_helper_pfb_cfg_t, ptr %419, i32 0, i32 3
  %421 = getelementptr inbounds %struct.arm_2d_helper_pfb_dependency_t, ptr %420, i32 0, i32 4
  %422 = getelementptr inbounds %struct.anon.3, ptr %421, i32 0, i32 0
  %423 = getelementptr inbounds %struct.arm_2d_helper_draw_evt_t, ptr %422, i32 0, i32 1
  %424 = load ptr, ptr %423, align 8, !tbaa !53
  %425 = load ptr, ptr %4, align 8, !tbaa !5
  %426 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %425, i32 0, i32 0
  %427 = getelementptr inbounds %struct.anon, ptr %426, i32 0, i32 1
  %428 = getelementptr inbounds %struct.anon.4, ptr %427, i32 0, i32 17
  %429 = load ptr, ptr %428, align 8, !tbaa !48
  %430 = load ptr, ptr %4, align 8, !tbaa !5
  %431 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %430, i32 0, i32 0
  %432 = getelementptr inbounds %struct.anon, ptr %431, i32 0, i32 1
  %433 = getelementptr inbounds %struct.anon.4, ptr %432, i32 0, i32 10
  %434 = load i32, ptr %433, align 4
  %435 = lshr i32 %434, 8
  %436 = and i32 %435, 1
  %437 = icmp ne i32 %436, 0
  %438 = call i32 %416(ptr noundef %424, ptr noundef %429, i1 noundef zeroext %437)
  store i32 %438, ptr %6, align 4, !tbaa !39
  %439 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %440 = load ptr, ptr %4, align 8, !tbaa !5
  %441 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %440, i32 0, i32 1
  %442 = getelementptr inbounds %struct.anon.30, ptr %441, i32 0, i32 0
  %443 = call i32 @__arm_2d_helper_perf_counter_stop(ptr noundef %442, i32 noundef 0)
  %444 = load ptr, ptr %4, align 8, !tbaa !5
  %445 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %444, i32 0, i32 1
  %446 = getelementptr inbounds %struct.anon.30, ptr %445, i32 0, i32 1
  %447 = load i32, ptr %446, align 8, !tbaa !37
  %448 = add nsw i32 %447, %443
  store i32 %448, ptr %446, align 8, !tbaa !37
  %449 = load i32, ptr %6, align 4, !tbaa !39
  %450 = icmp eq i32 1, %449
  br i1 %450, label %451, label %452

451:                                              ; preds = %403
  store i32 1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %651

452:                                              ; preds = %403
  %453 = load i32, ptr %6, align 4, !tbaa !39
  %454 = icmp slt i32 %453, 0
  br i1 %454, label %455, label %457

455:                                              ; preds = %452
  %456 = load i32, ptr %6, align 4, !tbaa !39
  store i32 %456, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %651

457:                                              ; preds = %452
  %458 = load i32, ptr %6, align 4, !tbaa !39
  %459 = icmp eq i32 2, %458
  br i1 %459, label %460, label %462

460:                                              ; preds = %457
  %461 = load i32, ptr %6, align 4, !tbaa !39
  store i32 %461, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %651

462:                                              ; preds = %457
  %463 = load ptr, ptr %7, align 8, !tbaa !5
  store i8 5, ptr %463, align 1, !tbaa !45
  store i32 1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %651

464:                                              ; preds = %30
  %465 = load ptr, ptr %7, align 8, !tbaa !5
  %466 = load i8, ptr %465, align 1, !tbaa !45
  br label %467

467:                                              ; preds = %464
  br label %468

468:                                              ; preds = %467
  br label %469

469:                                              ; preds = %468
  br label %470

470:                                              ; preds = %469, %392, %382
  %471 = load ptr, ptr %4, align 8, !tbaa !5
  %472 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %471, i32 0, i32 0
  %473 = getelementptr inbounds %struct.anon, ptr %472, i32 0, i32 0
  %474 = getelementptr inbounds %struct.arm_2d_helper_pfb_cfg_t, ptr %473, i32 0, i32 1
  %475 = getelementptr inbounds %struct.anon.1, ptr %474, i32 0, i32 2
  %476 = load i64, ptr %475, align 4
  %477 = lshr i64 %476, 43
  %478 = and i64 %477, 1
  %479 = trunc i64 %478 to i32
  %480 = icmp ne i32 %479, 0
  br i1 %480, label %481, label %556

481:                                              ; preds = %470
  %482 = load ptr, ptr %4, align 8, !tbaa !5
  %483 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %482, i32 0, i32 0
  %484 = getelementptr inbounds %struct.anon, ptr %483, i32 0, i32 1
  %485 = getelementptr inbounds %struct.anon.4, ptr %484, i32 0, i32 10
  %486 = load i32, ptr %485, align 4
  %487 = lshr i32 %486, 12
  %488 = and i32 %487, 1
  %489 = icmp ne i32 %488, 0
  br i1 %489, label %556, label %490

490:                                              ; preds = %481
  %491 = load ptr, ptr %4, align 8, !tbaa !5
  %492 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %491, i32 0, i32 0
  %493 = getelementptr inbounds %struct.anon, ptr %492, i32 0, i32 1
  %494 = getelementptr inbounds %struct.anon.4, ptr %493, i32 0, i32 10
  %495 = load i32, ptr %494, align 4
  %496 = and i32 %495, 1
  %497 = icmp ne i32 %496, 0
  br i1 %497, label %498, label %530

498:                                              ; preds = %490
  call void @llvm.lifetime.start.p0(i64 2, ptr %12) #5
  store i16 -2048, ptr %12, align 2, !tbaa !54
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %499 = load ptr, ptr %4, align 8, !tbaa !5
  %500 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %499, i32 0, i32 0
  %501 = getelementptr inbounds %struct.anon, ptr %500, i32 0, i32 1
  %502 = getelementptr inbounds %struct.anon.4, ptr %501, i32 0, i32 3
  %503 = getelementptr inbounds %struct.anon.5, ptr %502, i32 0, i32 0
  %504 = load ptr, ptr %503, align 8, !tbaa !43
  store ptr %504, ptr %13, align 8, !tbaa !5
  br label %505

505:                                              ; preds = %524, %498
  %506 = load ptr, ptr %13, align 8, !tbaa !5
  %507 = icmp ne ptr null, %506
  br i1 %507, label %508, label %529

508:                                              ; preds = %505
  %509 = load ptr, ptr %13, align 8, !tbaa !5
  %510 = getelementptr inbounds %struct.arm_2d_region_list_item_t, ptr %509, i32 0, i32 3
  %511 = getelementptr inbounds %struct.anon.7, ptr %510, i32 0, i32 1
  %512 = load i8, ptr %511, align 1
  %513 = and i8 %512, 1
  %514 = icmp ne i8 %513, 0
  br i1 %514, label %524, label %515

515:                                              ; preds = %508
  %516 = load ptr, ptr %4, align 8, !tbaa !5
  %517 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %516, i32 0, i32 0
  %518 = getelementptr inbounds %struct.anon, ptr %517, i32 0, i32 1
  %519 = getelementptr inbounds %struct.anon.4, ptr %518, i32 0, i32 17
  %520 = load ptr, ptr %519, align 8, !tbaa !48
  %521 = load ptr, ptr %13, align 8, !tbaa !5
  %522 = getelementptr inbounds %struct.arm_2d_region_list_item_t, ptr %521, i32 0, i32 2
  %523 = load i16, ptr %12, align 2, !tbaa !54
  call void @arm_2d_helper_draw_box(ptr noundef %520, ptr noundef %522, i16 noundef signext 1, i16 noundef zeroext %523, i8 noundef zeroext -1)
  br label %524

524:                                              ; preds = %515, %508
  %525 = load ptr, ptr %13, align 8, !tbaa !5
  %526 = getelementptr inbounds %struct.arm_2d_region_list_item_t, ptr %525, i32 0, i32 1
  %527 = getelementptr inbounds %struct.anon.6, ptr %526, i32 0, i32 0
  %528 = load ptr, ptr %527, align 8, !tbaa !55
  store ptr %528, ptr %13, align 8, !tbaa !5
  br label %505, !llvm.loop !56

529:                                              ; preds = %505
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %12) #5
  br label %555

530:                                              ; preds = %490
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %531 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %531, ptr %14, align 8, !tbaa !5
  br label %532

532:                                              ; preds = %550, %530
  %533 = load ptr, ptr %14, align 8, !tbaa !5
  %534 = icmp ne ptr null, %533
  br i1 %534, label %535, label %554

535:                                              ; preds = %532
  %536 = load ptr, ptr %14, align 8, !tbaa !5
  %537 = getelementptr inbounds %struct.arm_2d_region_list_item_t, ptr %536, i32 0, i32 3
  %538 = getelementptr inbounds %struct.anon.7, ptr %537, i32 0, i32 1
  %539 = load i8, ptr %538, align 1
  %540 = and i8 %539, 1
  %541 = icmp ne i8 %540, 0
  br i1 %541, label %550, label %542

542:                                              ; preds = %535
  %543 = load ptr, ptr %4, align 8, !tbaa !5
  %544 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %543, i32 0, i32 0
  %545 = getelementptr inbounds %struct.anon, ptr %544, i32 0, i32 1
  %546 = getelementptr inbounds %struct.anon.4, ptr %545, i32 0, i32 17
  %547 = load ptr, ptr %546, align 8, !tbaa !48
  %548 = load ptr, ptr %14, align 8, !tbaa !5
  %549 = getelementptr inbounds %struct.arm_2d_region_list_item_t, ptr %548, i32 0, i32 2
  call void @arm_2d_helper_draw_box(ptr noundef %547, ptr noundef %549, i16 noundef signext 1, i16 noundef zeroext 2016, i8 noundef zeroext -1)
  br label %550

550:                                              ; preds = %542, %535
  %551 = load ptr, ptr %14, align 8, !tbaa !5
  %552 = getelementptr inbounds %struct.arm_2d_region_list_item_t, ptr %551, i32 0, i32 0
  %553 = load ptr, ptr %552, align 8, !tbaa !57
  store ptr %553, ptr %14, align 8, !tbaa !5
  br label %532, !llvm.loop !58

554:                                              ; preds = %532
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %555

555:                                              ; preds = %554, %529
  br label %556

556:                                              ; preds = %555, %481, %470
  %557 = load ptr, ptr %4, align 8, !tbaa !5
  %558 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %557, i32 0, i32 0
  %559 = getelementptr inbounds %struct.anon, ptr %558, i32 0, i32 1
  %560 = getelementptr inbounds %struct.anon.4, ptr %559, i32 0, i32 10
  %561 = load i32, ptr %560, align 4
  %562 = and i32 %561, -257
  %563 = or i32 %562, 0
  store i32 %563, ptr %560, align 4
  %564 = load ptr, ptr %4, align 8, !tbaa !5
  %565 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %564, i32 0, i32 1
  %566 = getelementptr inbounds %struct.anon.30, ptr %565, i32 0, i32 0
  call void @__arm_2d_helper_perf_counter_start(ptr noundef %566, i32 noundef 1)
  br label %567

567:                                              ; preds = %556
  %568 = load ptr, ptr %4, align 8, !tbaa !5
  %569 = call zeroext i1 @__arm_2d_helper_pfb_drawing_iteration_end(ptr noundef %568)
  br i1 %569, label %221, label %570, !llvm.loop !59

570:                                              ; preds = %567
  br label %571

571:                                              ; preds = %570, %259
  %572 = load ptr, ptr %4, align 8, !tbaa !5
  %573 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %572, i32 0, i32 1
  %574 = getelementptr inbounds %struct.anon.30, ptr %573, i32 0, i32 0
  %575 = call i32 @__arm_2d_helper_perf_counter_stop(ptr noundef %574, i32 noundef 1)
  %576 = load ptr, ptr %4, align 8, !tbaa !5
  %577 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %576, i32 0, i32 1
  %578 = getelementptr inbounds %struct.anon.30, ptr %577, i32 0, i32 2
  %579 = load i32, ptr %578, align 4, !tbaa !38
  %580 = add nsw i32 %579, %575
  store i32 %580, ptr %578, align 4, !tbaa !38
  %581 = load ptr, ptr %7, align 8, !tbaa !5
  store i8 0, ptr %581, align 1, !tbaa !45
  br label %582

582:                                              ; preds = %571, %30
  %583 = load ptr, ptr %4, align 8, !tbaa !5
  %584 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %583, i32 0, i32 0
  %585 = getelementptr inbounds %struct.anon, ptr %584, i32 0, i32 1
  %586 = getelementptr inbounds %struct.anon.4, ptr %585, i32 0, i32 10
  %587 = load i32, ptr %586, align 4
  %588 = and i32 %587, 1
  %589 = icmp ne i32 %588, 0
  br i1 %589, label %590, label %622

590:                                              ; preds = %582
  %591 = load ptr, ptr %4, align 8, !tbaa !5
  %592 = load ptr, ptr %4, align 8, !tbaa !5
  %593 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %592, i32 0, i32 0
  %594 = getelementptr inbounds %struct.anon, ptr %593, i32 0, i32 1
  %595 = getelementptr inbounds %struct.anon.4, ptr %594, i32 0, i32 3
  %596 = getelementptr inbounds %struct.anon.5, ptr %595, i32 0, i32 0
  %597 = load ptr, ptr %596, align 8, !tbaa !43
  call void @__arm_2d_helper_free_dirty_region_working_list(ptr noundef %591, ptr noundef %597)
  %598 = load ptr, ptr %4, align 8, !tbaa !5
  %599 = load ptr, ptr %4, align 8, !tbaa !5
  %600 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %599, i32 0, i32 0
  %601 = getelementptr inbounds %struct.anon, ptr %600, i32 0, i32 1
  %602 = getelementptr inbounds %struct.anon.4, ptr %601, i32 0, i32 3
  %603 = getelementptr inbounds %struct.anon.5, ptr %602, i32 0, i32 2
  %604 = load ptr, ptr %603, align 8, !tbaa !44
  call void @__arm_2d_helper_free_dirty_region_working_list(ptr noundef %598, ptr noundef %604)
  %605 = load ptr, ptr %4, align 8, !tbaa !5
  %606 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %605, i32 0, i32 0
  %607 = getelementptr inbounds %struct.anon, ptr %606, i32 0, i32 1
  %608 = getelementptr inbounds %struct.anon.4, ptr %607, i32 0, i32 10
  %609 = load i32, ptr %608, align 4
  %610 = lshr i32 %609, 4
  %611 = and i32 %610, 1
  %612 = icmp ne i32 %611, 0
  br i1 %612, label %613, label %621

613:                                              ; preds = %590
  %614 = load ptr, ptr %4, align 8, !tbaa !5
  %615 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %614, i32 0, i32 0
  %616 = getelementptr inbounds %struct.anon, ptr %615, i32 0, i32 1
  %617 = getelementptr inbounds %struct.anon.4, ptr %616, i32 0, i32 10
  %618 = load i32, ptr %617, align 4
  %619 = and i32 %618, -2
  %620 = or i32 %619, 0
  store i32 %620, ptr %617, align 4
  br label %621

621:                                              ; preds = %613, %590
  br label %622

622:                                              ; preds = %621, %582
  %623 = load ptr, ptr %4, align 8, !tbaa !5
  %624 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %623, i32 0, i32 0
  %625 = getelementptr inbounds %struct.anon, ptr %624, i32 0, i32 0
  %626 = getelementptr inbounds %struct.arm_2d_helper_pfb_cfg_t, ptr %625, i32 0, i32 3
  %627 = getelementptr inbounds %struct.arm_2d_helper_pfb_dependency_t, ptr %626, i32 0, i32 3
  %628 = getelementptr inbounds %struct.arm_2d_evt_t, ptr %627, i32 0, i32 0
  %629 = load ptr, ptr %628, align 8, !tbaa !60
  %630 = icmp eq ptr null, %629
  br i1 %630, label %631, label %632

631:                                              ; preds = %622
  br label %649

632:                                              ; preds = %622
  %633 = load ptr, ptr %4, align 8, !tbaa !5
  %634 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %633, i32 0, i32 0
  %635 = getelementptr inbounds %struct.anon, ptr %634, i32 0, i32 0
  %636 = getelementptr inbounds %struct.arm_2d_helper_pfb_cfg_t, ptr %635, i32 0, i32 3
  %637 = getelementptr inbounds %struct.arm_2d_helper_pfb_dependency_t, ptr %636, i32 0, i32 3
  %638 = getelementptr inbounds %struct.arm_2d_evt_t, ptr %637, i32 0, i32 0
  %639 = load ptr, ptr %638, align 8, !tbaa !60
  %640 = load ptr, ptr %4, align 8, !tbaa !5
  %641 = getelementptr inbounds %struct.arm_2d_helper_pfb_t, ptr %640, i32 0, i32 0
  %642 = getelementptr inbounds %struct.anon, ptr %641, i32 0, i32 0
  %643 = getelementptr inbounds %struct.arm_2d_helper_pfb_cfg_t, ptr %642, i32 0, i32 3
  %644 = getelementptr inbounds %struct.arm_2d_helper_pfb_dependency_t, ptr %643, i32 0, i32 3
  %645 = getelementptr inbounds %struct.arm_2d_evt_t, ptr %644, i32 0, i32 1
  %646 = load ptr, ptr %645, align 8, !tbaa !61
  %647 = call zeroext i1 %639(ptr noundef %646)
  %648 = zext i1 %647 to i32
  br label %649

649:                                              ; preds = %632, %631
  %650 = phi i32 [ 0, %631 ], [ %648, %632 ]
  store i32 0, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %651

651:                                              ; preds = %649, %462, %460, %455, %451, %375, %373, %368, %364, %213
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %652 = load i32, ptr %3, align 4
  ret i32 %652
}

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

declare zeroext i1 @arm_2d_port_wait_for_semaphore(i64 noundef) #3

declare void @arm_2d_helper_fill_tile_colour(ptr noundef, i8, i32) #3

declare zeroext i1 @arm_2d_op_wait_async(ptr noundef) #3

declare void @arm_2d_helper_draw_box(ptr noundef, ptr noundef, i16 noundef signext, i16 noundef zeroext, i8 noundef zeroext) #3

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

; Function Attrs: nounwind uwtable
declare hidden void @__arm_2d_helper_free_dirty_region_working_list(ptr noundef nonnull, ptr noundef) #2

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 64}
!10 = !{!"arm_2d_helper_pfb_t", !11, i64 0, !35, i64 344}
!11 = !{!"", !12, i64 0, !25, i64 152}
!12 = !{!"arm_2d_helper_pfb_cfg_t", !13, i64 0, !14, i64 8, !18, i64 32, !19, i64 48}
!13 = !{!"arm_2d_region_t", !7, i64 0, !7, i64 4}
!14 = !{!"", !6, i64 0, !15, i64 8, !17, i64 12, !17, i64 15, !17, i64 16, !17, i64 17, !17, i64 17, !17, i64 17, !17, i64 17, !17, i64 18, !17, i64 19, !17, i64 19}
!15 = !{!"arm_2d_size_t", !16, i64 0, !16, i64 2}
!16 = !{!"short", !7, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{!"", !6, i64 0, !7, i64 8}
!19 = !{!"arm_2d_helper_pfb_dependency_t", !20, i64 0, !21, i64 16, !22, i64 32, !22, i64 48, !23, i64 64, !24, i64 88}
!20 = !{!"arm_2d_helper_render_evt_t", !6, i64 0, !6, i64 8}
!21 = !{!"arm_2d_helper_draw_evt_t", !6, i64 0, !6, i64 8}
!22 = !{!"arm_2d_evt_t", !6, i64 0, !6, i64 8}
!23 = !{!"", !21, i64 0, !6, i64 16}
!24 = !{!"arm_2d_helper_before_flushing_evt_t", !6, i64 0, !6, i64 8}
!25 = !{!"", !26, i64 0, !13, i64 4, !6, i64 16, !27, i64 24, !31, i64 88, !15, i64 112, !17, i64 116, !7, i64 120, !7, i64 121, !16, i64 122, !32, i64 124, !7, i64 128, !33, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !34, i64 168, !6, i64 184}
!26 = !{!"arm_2d_location_t", !16, i64 0, !16, i64 2}
!27 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !28, i64 32}
!28 = !{!"arm_2d_region_list_item_t", !6, i64 0, !29, i64 8, !13, i64 16, !30, i64 24}
!29 = !{!"", !6, i64 0}
!30 = !{!"", !7, i64 0, !7, i64 1, !7, i64 1, !16, i64 2, !16, i64 2, !16, i64 2, !16, i64 2}
!31 = !{!"arm_2d_tile_t", !7, i64 0, !7, i64 4, !7, i64 16}
!32 = !{!"", !17, i64 0, !17, i64 0, !17, i64 0, !17, i64 0, !17, i64 0, !17, i64 0, !17, i64 0, !17, i64 0, !17, i64 1, !17, i64 1, !17, i64 1, !17, i64 1, !17, i64 1, !17, i64 1, !17, i64 1, !17, i64 1, !17, i64 2}
!33 = !{!"long", !7, i64 0}
!34 = !{!"", !6, i64 0, !6, i64 8}
!35 = !{!"", !33, i64 0, !17, i64 8, !17, i64 12}
!36 = !{!10, !7, i64 272}
!37 = !{!10, !17, i64 352}
!38 = !{!10, !17, i64 356}
!39 = !{!17, !17, i64 0}
!40 = distinct !{!40, !41}
!41 = !{!"llvm.loop.mustprogress"}
!42 = !{!10, !6, i64 184}
!43 = !{!10, !6, i64 176}
!44 = !{!10, !6, i64 192}
!45 = !{!7, !7, i64 0}
!46 = !{!10, !6, i64 80}
!47 = !{!10, !6, i64 88}
!48 = !{!10, !6, i64 336}
!49 = !{!10, !33, i64 288}
!50 = distinct !{!50, !41}
!51 = !{!10, !6, i64 72}
!52 = !{!10, !6, i64 112}
!53 = !{!10, !6, i64 120}
!54 = !{!16, !16, i64 0}
!55 = !{!28, !6, i64 8}
!56 = distinct !{!56, !41}
!57 = !{!28, !6, i64 0}
!58 = distinct !{!58, !41}
!59 = distinct !{!59, !41}
!60 = !{!10, !6, i64 96}
!61 = !{!10, !6, i64 104}


; 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"

@.str.1 = external hidden unnamed_addr constant [87 x i8], align 1
@__PRETTY_FUNCTION__.arm_2d_helper_pfb_task = external hidden unnamed_addr constant [88 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [59 x i8], align 1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -2147483648, 4) i32 @arm_2d_helper_pfb_task(ptr noundef nonnull %0, ptr noundef %1) local_unnamed_addr #1 {
  %3 = getelementptr inbounds i8, ptr %0, i64 64
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %5, label %6

5:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.1, i32 noundef 2733, ptr noundef nonnull @__PRETTY_FUNCTION__.arm_2d_helper_pfb_task) #3
  unreachable

6:                                                ; preds = %2
  %7 = getelementptr inbounds i8, ptr %0, i64 272
  %8 = load i8, ptr %7, align 8, !tbaa !35
  switch i8 %8, label %179 [
    i8 0, label %9
    i8 1, label %43
    i8 2, label %69
    i8 3, label %105
    i8 4, label %113
    i8 5, label %137
  ]

9:                                                ; preds = %6
  %10 = getelementptr inbounds i8, ptr %0, i64 352
  store i32 0, ptr %10, align 8, !tbaa !36
  %11 = getelementptr inbounds i8, ptr %0, i64 356
  store i32 0, ptr %11, align 4, !tbaa !37
  %12 = getelementptr inbounds i8, ptr %0, i64 276
  %13 = load i32, ptr %12, align 4
  %14 = or i32 %13, 256
  store i32 %14, ptr %12, align 4
  %15 = and i32 %13, 2
  %.not135 = icmp eq i32 %15, 0
  br i1 %.not135, label %19, label %16

16:                                               ; preds = %9
  %17 = and i32 %14, -4
  %18 = or disjoint i32 %17, 1
  br label %.sink.split

19:                                               ; preds = %9
  %20 = and i32 %13, 4
  %.not136 = icmp eq i32 %20, 0
  br i1 %.not136, label %23, label %21

21:                                               ; preds = %19
  %22 = and i32 %14, -8
  br label %.sink.split

.sink.split:                                      ; preds = %16, %21
  %.sink = phi i32 [ %22, %21 ], [ %18, %16 ]
  store i32 %.sink, ptr %12, align 4
  br label %23

23:                                               ; preds = %.sink.split, %19
  %24 = phi i32 [ %14, %19 ], [ %.sink, %.sink.split ]
  %25 = and i32 %24, 1
  %.not129 = icmp eq i32 %25, 0
  br i1 %.not129, label %38, label %26

26:                                               ; preds = %23
  %27 = getelementptr inbounds i8, ptr %0, i64 176
  %28 = getelementptr inbounds i8, ptr %0, i64 184
  store ptr %1, ptr %28, align 8, !tbaa !38
  %29 = and i32 %24, -49
  store i32 %29, ptr %12, align 4
  %30 = load ptr, ptr %27, align 8, !tbaa !39
  %31 = icmp eq ptr %30, null
  br i1 %31, label %33, label %32

32:                                               ; preds = %26
  tail call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.1, i32 noundef 2782, ptr noundef nonnull @__PRETTY_FUNCTION__.arm_2d_helper_pfb_task) #3
  unreachable

33:                                               ; preds = %26
  %34 = getelementptr inbounds i8, ptr %0, i64 192
  %35 = load ptr, ptr %34, align 8, !tbaa !40
  %36 = icmp eq ptr %35, null
  br i1 %36, label %38, label %37

37:                                               ; preds = %33
  tail call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.1, i32 noundef 2783, ptr noundef nonnull @__PRETTY_FUNCTION__.arm_2d_helper_pfb_task) #3
  unreachable

38:                                               ; preds = %33, %23
  %39 = phi i32 [ %29, %33 ], [ %24, %23 ]
  %40 = and i32 %39, 1152
  %or.cond = icmp eq i32 %40, 0
  br i1 %or.cond, label %41, label %50

41:                                               ; preds = %38
  %42 = or disjoint i32 %39, 128
  store i32 %42, ptr %12, align 4
  store i8 1, ptr %7, align 1, !tbaa !41
  br label %43

43:                                               ; preds = %41, %6
  %44 = getelementptr inbounds i8, ptr %0, i64 80
  %45 = load ptr, ptr %44, align 8, !tbaa !42
  %.not132 = icmp eq ptr %45, null
  br i1 %.not132, label %50, label %46

46:                                               ; preds = %43
  %47 = getelementptr inbounds i8, ptr %0, i64 88
  %48 = load ptr, ptr %47, align 8, !tbaa !43
  %49 = tail call zeroext i1 %45(ptr noundef %48) #4
  br i1 %49, label %50, label %200

50:                                               ; preds = %38, %43, %46
  %51 = getelementptr inbounds i8, ptr %0, i64 344
  tail call void @__arm_2d_helper_perf_counter_start(ptr noundef nonnull %51, i32 noundef 1)
  br label %52

52:                                               ; preds = %.loopexit139, %50
  %53 = getelementptr inbounds i8, ptr %0, i64 336
  %54 = getelementptr inbounds i8, ptr %0, i64 288
  br label %55

55:                                               ; preds = %thread-pre-split, %52
  %56 = tail call ptr @__arm_2d_helper_pfb_drawing_iteration_begin(ptr noundef nonnull %0, ptr noundef %1)
  store ptr %56, ptr %53, align 8, !tbaa !44
  %magicptr = ptrtoint ptr %56 to i64
  switch i64 %magicptr, label %thread-pre-split [
    i64 0, label %57
    i64 -1, label %.loopexit
  ]

57:                                               ; preds = %55
  %58 = load i64, ptr %54, align 8, !tbaa !45
  %.not133 = icmp eq i64 %58, 0
  br i1 %.not133, label %thread-pre-split, label %59

59:                                               ; preds = %57
  %60 = tail call zeroext i1 @arm_2d_port_wait_for_semaphore(i64 noundef %58) #4
  %.pr.pre = load ptr, ptr %53, align 8, !tbaa !44
  br label %thread-pre-split

thread-pre-split:                                 ; preds = %57, %59, %55
  %61 = phi ptr [ %56, %55 ], [ %.pr.pre, %59 ], [ %56, %57 ]
  %62 = icmp eq ptr %61, null
  br i1 %62, label %55, label %63, !llvm.loop !46

63:                                               ; preds = %thread-pre-split
  %64 = getelementptr inbounds i8, ptr %0, i64 344
  %65 = tail call i32 @__arm_2d_helper_perf_counter_stop(ptr noundef nonnull %64, i32 noundef 1)
  %66 = getelementptr inbounds i8, ptr %0, i64 356
  %67 = load i32, ptr %66, align 4, !tbaa !37
  %68 = add nsw i32 %67, %65
  store i32 %68, ptr %66, align 4, !tbaa !37
  store i8 2, ptr %7, align 1, !tbaa !41
  br label %69

69:                                               ; preds = %63, %6
  %70 = getelementptr inbounds i8, ptr %0, i64 344
  tail call void @__arm_2d_helper_perf_counter_start(ptr noundef nonnull %70, i32 noundef 0)
  %71 = getelementptr inbounds i8, ptr %0, i64 276
  %72 = load i32, ptr %71, align 4
  %73 = and i32 %72, 512
  %.not134 = icmp eq i32 %73, 0
  br i1 %.not134, label %74, label %84

74:                                               ; preds = %69
  %75 = getelementptr inbounds i8, ptr %0, i64 20
  %76 = load i64, ptr %75, align 4
  %77 = lshr i64 %76, 24
  %78 = trunc i64 %77 to i8
  %79 = and i8 %78, 127
  %80 = getelementptr inbounds i8, ptr %0, i64 336
  %81 = load ptr, ptr %80, align 8, !tbaa !44
  %82 = getelementptr inbounds i8, ptr %0, i64 280
  %83 = load i32, ptr %82, align 8
  tail call void @arm_2d_helper_fill_tile_colour(ptr noundef %81, i8 %79, i32 %83) #4
  %.pre = load i32, ptr %71, align 4
  br label %84

84:                                               ; preds = %74, %69
  %85 = phi i32 [ %.pre, %74 ], [ %72, %69 ]
  %86 = load ptr, ptr %3, align 8, !tbaa !5
  %87 = getelementptr inbounds i8, ptr %0, i64 72
  %88 = load ptr, ptr %87, align 8, !tbaa !48
  %89 = getelementptr inbounds i8, ptr %0, i64 336
  %90 = load ptr, ptr %89, align 8, !tbaa !44
  %91 = and i32 %85, 256
  %92 = icmp ne i32 %91, 0
  %93 = tail call i32 %86(ptr noundef %88, ptr noundef %90, i1 noundef zeroext %92) #4
  %94 = tail call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #4
  %95 = tail call i32 @__arm_2d_helper_perf_counter_stop(ptr noundef nonnull %70, i32 noundef 0)
  %96 = getelementptr inbounds i8, ptr %0, i64 352
  %97 = load i32, ptr %96, align 8, !tbaa !36
  %98 = add nsw i32 %97, %95
  store i32 %98, ptr %96, align 8, !tbaa !36
  %99 = icmp eq i32 %93, 1
  br i1 %99, label %200, label %100

100:                                              ; preds = %84
  %101 = icmp slt i32 %93, 0
  br i1 %101, label %200, label %102

102:                                              ; preds = %100
  %103 = icmp eq i32 %93, 2
  br i1 %103, label %200, label %104

104:                                              ; preds = %102
  store i8 3, ptr %7, align 1, !tbaa !41
  br label %200

105:                                              ; preds = %6
  %106 = getelementptr inbounds i8, ptr %0, i64 112
  %107 = load ptr, ptr %106, align 8, !tbaa !49
  %.not120 = icmp eq ptr %107, null
  br i1 %.not120, label %137, label %108

108:                                              ; preds = %105
  %109 = getelementptr inbounds i8, ptr %0, i64 276
  %110 = load i32, ptr %109, align 4
  %111 = and i32 %110, 2048
  %.not121 = icmp eq i32 %111, 0
  br i1 %.not121, label %112, label %137

112:                                              ; preds = %108
  store i8 4, ptr %7, align 1, !tbaa !41
  br label %113

113:                                              ; preds = %112, %6
  %114 = getelementptr inbounds i8, ptr %0, i64 344
  tail call void @__arm_2d_helper_perf_counter_start(ptr noundef nonnull %114, i32 noundef 0)
  %115 = getelementptr inbounds i8, ptr %0, i64 112
  %116 = load ptr, ptr %115, align 8, !tbaa !49
  %117 = getelementptr inbounds i8, ptr %0, i64 120
  %118 = load ptr, ptr %117, align 8, !tbaa !50
  %119 = getelementptr inbounds i8, ptr %0, i64 336
  %120 = load ptr, ptr %119, align 8, !tbaa !44
  %121 = getelementptr inbounds i8, ptr %0, i64 276
  %122 = load i32, ptr %121, align 4
  %123 = and i32 %122, 256
  %124 = icmp ne i32 %123, 0
  %125 = tail call i32 %116(ptr noundef %118, ptr noundef %120, i1 noundef zeroext %124) #4
  %126 = tail call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #4
  %127 = tail call i32 @__arm_2d_helper_perf_counter_stop(ptr noundef nonnull %114, i32 noundef 0)
  %128 = getelementptr inbounds i8, ptr %0, i64 352
  %129 = load i32, ptr %128, align 8, !tbaa !36
  %130 = add nsw i32 %129, %127
  store i32 %130, ptr %128, align 8, !tbaa !36
  %131 = icmp eq i32 %125, 1
  br i1 %131, label %200, label %132

132:                                              ; preds = %113
  %133 = icmp slt i32 %125, 0
  br i1 %133, label %200, label %134

134:                                              ; preds = %132
  %135 = icmp eq i32 %125, 2
  br i1 %135, label %200, label %136

136:                                              ; preds = %134
  store i8 5, ptr %7, align 1, !tbaa !41
  br label %200

137:                                              ; preds = %6, %108, %105
  %138 = getelementptr inbounds i8, ptr %0, i64 20
  %139 = load i64, ptr %138, align 4
  %140 = and i64 %139, 8796093022208
  %.not122 = icmp eq i64 %140, 0
  br i1 %.not122, label %.loopexit139, label %141

141:                                              ; preds = %137
  %142 = getelementptr inbounds i8, ptr %0, i64 276
  %143 = load i32, ptr %142, align 4
  %144 = and i32 %143, 4096
  %.not123 = icmp eq i32 %144, 0
  br i1 %.not123, label %145, label %.loopexit139

145:                                              ; preds = %141
  %146 = and i32 %143, 1
  %.not124 = icmp eq i32 %146, 0
  br i1 %.not124, label %.preheader, label %148

.preheader:                                       ; preds = %145
  %.not125144 = icmp eq ptr %1, null
  br i1 %.not125144, label %.loopexit139, label %.lr.ph146

.lr.ph146:                                        ; preds = %.preheader
  %147 = getelementptr inbounds i8, ptr %0, i64 336
  br label %160

148:                                              ; preds = %145
  %149 = getelementptr inbounds i8, ptr %0, i64 176
  %.0111141 = load ptr, ptr %149, align 8, !tbaa !51
  %.not127142 = icmp eq ptr %.0111141, null
  br i1 %.not127142, label %.loopexit139, label %.lr.ph

.lr.ph:                                           ; preds = %148
  %150 = getelementptr inbounds i8, ptr %0, i64 336
  br label %151

151:                                              ; preds = %.lr.ph, %158
  %.0111143 = phi ptr [ %.0111141, %.lr.ph ], [ %.0111, %158 ]
  %152 = getelementptr inbounds i8, ptr %.0111143, i64 25
  %153 = load i8, ptr %152, align 1
  %154 = and i8 %153, 1
  %.not128 = icmp eq i8 %154, 0
  br i1 %.not128, label %155, label %158

155:                                              ; preds = %151
  %156 = load ptr, ptr %150, align 8, !tbaa !44
  %157 = getelementptr inbounds i8, ptr %.0111143, i64 16
  tail call void @arm_2d_helper_draw_box(ptr noundef %156, ptr noundef nonnull %157, i16 noundef signext 1, i16 noundef zeroext -2048, i8 noundef zeroext -1) #4
  br label %158

158:                                              ; preds = %155, %151
  %159 = getelementptr inbounds i8, ptr %.0111143, i64 8
  %.0111 = load ptr, ptr %159, align 8, !tbaa !51
  %.not127 = icmp eq ptr %.0111, null
  br i1 %.not127, label %.loopexit139, label %151, !llvm.loop !52

160:                                              ; preds = %.lr.ph146, %167
  %.0145 = phi ptr [ %1, %.lr.ph146 ], [ %168, %167 ]
  %161 = getelementptr inbounds i8, ptr %.0145, i64 25
  %162 = load i8, ptr %161, align 1
  %163 = and i8 %162, 1
  %.not126 = icmp eq i8 %163, 0
  br i1 %.not126, label %164, label %167

164:                                              ; preds = %160
  %165 = load ptr, ptr %147, align 8, !tbaa !44
  %166 = getelementptr inbounds i8, ptr %.0145, i64 16
  tail call void @arm_2d_helper_draw_box(ptr noundef %165, ptr noundef nonnull %166, i16 noundef signext 1, i16 noundef zeroext 2016, i8 noundef zeroext -1) #4
  br label %167

167:                                              ; preds = %164, %160
  %168 = load ptr, ptr %.0145, align 8, !tbaa !53
  %.not125 = icmp eq ptr %168, null
  br i1 %.not125, label %.loopexit139, label %160, !llvm.loop !54

.loopexit139:                                     ; preds = %158, %167, %148, %.preheader, %141, %137
  %169 = getelementptr inbounds i8, ptr %0, i64 276
  %170 = load i32, ptr %169, align 4
  %171 = and i32 %170, -257
  store i32 %171, ptr %169, align 4
  %172 = getelementptr inbounds i8, ptr %0, i64 344
  tail call void @__arm_2d_helper_perf_counter_start(ptr noundef nonnull %172, i32 noundef 1)
  %173 = tail call zeroext i1 @__arm_2d_helper_pfb_drawing_iteration_end(ptr noundef nonnull %0)
  br i1 %173, label %52, label %.loopexit, !llvm.loop !55

.loopexit:                                        ; preds = %55, %.loopexit139
  %174 = getelementptr inbounds i8, ptr %0, i64 344
  %175 = tail call i32 @__arm_2d_helper_perf_counter_stop(ptr noundef nonnull %174, i32 noundef 1)
  %176 = getelementptr inbounds i8, ptr %0, i64 356
  %177 = load i32, ptr %176, align 4, !tbaa !37
  %178 = add nsw i32 %177, %175
  store i32 %178, ptr %176, align 4, !tbaa !37
  store i8 0, ptr %7, align 1, !tbaa !41
  br label %179

179:                                              ; preds = %.loopexit, %6
  %180 = getelementptr inbounds i8, ptr %0, i64 276
  %181 = load i32, ptr %180, align 4
  %182 = and i32 %181, 1
  %.not137 = icmp eq i32 %182, 0
  br i1 %.not137, label %192, label %183

183:                                              ; preds = %179
  %184 = getelementptr inbounds i8, ptr %0, i64 176
  %185 = load ptr, ptr %184, align 8, !tbaa !39
  tail call void @__arm_2d_helper_free_dirty_region_working_list(ptr noundef %0, ptr noundef %185)
  %186 = getelementptr inbounds i8, ptr %0, i64 192
  %187 = load ptr, ptr %186, align 8, !tbaa !40
  tail call void @__arm_2d_helper_free_dirty_region_working_list(ptr noundef %0, ptr noundef %187)
  %188 = load i32, ptr %180, align 4
  %189 = and i32 %188, 16
  %.not138 = icmp eq i32 %189, 0
  br i1 %.not138, label %192, label %190

190:                                              ; preds = %183
  %191 = and i32 %188, -2
  store i32 %191, ptr %180, align 4
  br label %192

192:                                              ; preds = %183, %190, %179
  %193 = getelementptr inbounds i8, ptr %0, i64 96
  %194 = load ptr, ptr %193, align 8, !tbaa !56
  %195 = icmp eq ptr %194, null
  br i1 %195, label %200, label %196

196:                                              ; preds = %192
  %197 = getelementptr inbounds i8, ptr %0, i64 104
  %198 = load ptr, ptr %197, align 8, !tbaa !57
  %199 = tail call zeroext i1 %194(ptr noundef %198) #4
  br label %200

200:                                              ; preds = %196, %192, %134, %132, %113, %102, %100, %84, %46, %136, %104
  %.0112 = phi i32 [ 1, %104 ], [ 1, %136 ], [ 3, %46 ], [ 1, %84 ], [ %93, %100 ], [ 2, %102 ], [ 1, %113 ], [ %125, %132 ], [ 2, %134 ], [ 0, %192 ], [ 0, %196 ]
  ret i32 %.0112
}

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

declare zeroext i1 @arm_2d_port_wait_for_semaphore(i64 noundef) local_unnamed_addr #2

declare void @arm_2d_helper_fill_tile_colour(ptr noundef, i8, i32) local_unnamed_addr #2

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

declare void @arm_2d_helper_draw_box(ptr noundef, ptr noundef, i16 noundef signext, i16 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @__arm_2d_helper_pfb_drawing_iteration_end(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @__arm_2d_helper_free_dirty_region_working_list(ptr noundef nonnull, ptr noundef) local_unnamed_addr #1

attributes #0 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 = { noreturn nounwind }
attributes #4 = { 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, !13, i64 64}
!6 = !{!"arm_2d_helper_pfb_t", !7, i64 0, !34, i64 344}
!7 = !{!"", !8, i64 0, !24, i64 152}
!8 = !{!"arm_2d_helper_pfb_cfg_t", !9, i64 0, !12, i64 8, !17, i64 32, !18, i64 48}
!9 = !{!"arm_2d_region_t", !10, i64 0, !10, i64 4}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C/C++ TBAA"}
!12 = !{!"", !13, i64 0, !14, i64 8, !16, i64 12, !16, i64 15, !16, i64 16, !16, i64 17, !16, i64 17, !16, i64 17, !16, i64 17, !16, i64 18, !16, i64 19, !16, i64 19}
!13 = !{!"any pointer", !10, i64 0}
!14 = !{!"arm_2d_size_t", !15, i64 0, !15, i64 2}
!15 = !{!"short", !10, i64 0}
!16 = !{!"int", !10, i64 0}
!17 = !{!"", !13, i64 0, !10, i64 8}
!18 = !{!"arm_2d_helper_pfb_dependency_t", !19, i64 0, !20, i64 16, !21, i64 32, !21, i64 48, !22, i64 64, !23, i64 88}
!19 = !{!"arm_2d_helper_render_evt_t", !13, i64 0, !13, i64 8}
!20 = !{!"arm_2d_helper_draw_evt_t", !13, i64 0, !13, i64 8}
!21 = !{!"arm_2d_evt_t", !13, i64 0, !13, i64 8}
!22 = !{!"", !20, i64 0, !13, i64 16}
!23 = !{!"arm_2d_helper_before_flushing_evt_t", !13, i64 0, !13, i64 8}
!24 = !{!"", !25, i64 0, !9, i64 4, !13, i64 16, !26, i64 24, !30, i64 88, !14, i64 112, !16, i64 116, !10, i64 120, !10, i64 121, !15, i64 122, !31, i64 124, !10, i64 128, !32, i64 136, !13, i64 144, !13, i64 152, !13, i64 160, !33, i64 168, !13, i64 184}
!25 = !{!"arm_2d_location_t", !15, i64 0, !15, i64 2}
!26 = !{!"", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !27, i64 32}
!27 = !{!"arm_2d_region_list_item_t", !13, i64 0, !28, i64 8, !9, i64 16, !29, i64 24}
!28 = !{!"", !13, i64 0}
!29 = !{!"", !10, i64 0, !10, i64 1, !10, i64 1, !15, i64 2, !15, i64 2, !15, i64 2, !15, i64 2}
!30 = !{!"arm_2d_tile_t", !10, i64 0, !10, i64 4, !10, i64 16}
!31 = !{!"", !16, i64 0, !16, i64 0, !16, i64 0, !16, i64 0, !16, i64 0, !16, i64 0, !16, i64 0, !16, i64 0, !16, i64 1, !16, i64 1, !16, i64 1, !16, i64 1, !16, i64 1, !16, i64 1, !16, i64 1, !16, i64 1, !16, i64 2}
!32 = !{!"long", !10, i64 0}
!33 = !{!"", !13, i64 0, !13, i64 8}
!34 = !{!"", !32, i64 0, !16, i64 8, !16, i64 12}
!35 = !{!6, !10, i64 272}
!36 = !{!6, !16, i64 352}
!37 = !{!6, !16, i64 356}
!38 = !{!6, !13, i64 184}
!39 = !{!6, !13, i64 176}
!40 = !{!6, !13, i64 192}
!41 = !{!10, !10, i64 0}
!42 = !{!6, !13, i64 80}
!43 = !{!6, !13, i64 88}
!44 = !{!6, !13, i64 336}
!45 = !{!6, !32, i64 288}
!46 = distinct !{!46, !47}
!47 = !{!"llvm.loop.mustprogress"}
!48 = !{!6, !13, i64 72}
!49 = !{!6, !13, i64 112}
!50 = !{!6, !13, i64 120}
!51 = !{!13, !13, i64 0}
!52 = distinct !{!52, !47}
!53 = !{!27, !13, i64 0}
!54 = distinct !{!54, !47}
!55 = distinct !{!55, !47}
!56 = !{!6, !13, i64 96}
!57 = !{!6, !13, i64 104}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass