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

; 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.anon = type { i16 }
%union.anon.11 = type { %struct.arm_2d_region_t }
%struct.arm_2d_region_t = type { %union.anon.9, %union.anon.10 }
%union.anon.9 = type { %struct.arm_2d_location_t }
%struct.arm_2d_location_t = type { i16, i16 }
%union.anon.10 = type { %struct.arm_2d_size_t }
%struct.arm_2d_size_t = type { i16, i16 }
%union.anon.12 = type { ptr }
%union.__arm_2d_color_fast_rgb_t = type { [4 x i16] }
%struct.histogram_cfg_t = type { %struct.anon.13, %struct.anon.14, ptr, %struct.histogram_on_get_bin_value_evt_t }
%struct.anon.13 = type { %struct.arm_2d_size_t, ptr, i16, i8, i8, i32, ptr }
%struct.anon.14 = type { i32, i32 }
%struct.histogram_on_get_bin_value_evt_t = type { ptr, ptr }
%struct.histogram_t = type { %struct.anon.15 }
%struct.anon.15 = type { %struct.histogram_cfg_t, %struct.arm_2d_size_t, %struct.anon.16, i8, i8, i32 }
%struct.anon.16 = type { %struct.arm_2d_region_list_item_t, i16 }
%struct.arm_2d_region_list_item_t = type { ptr, [8 x i8], %struct.arm_2d_region_t, [4 x i8] }
%struct.histogram_bin_item_t = type { %struct.anon.17 }
%struct.anon.17 = type { i16, i16, i16 }

@c_tileLineVerticalLineMask = external dso_local constant { { { i8, { i8 }, %union.anon } }, %union.anon.11, %union.anon.12 }, align 8
@.str = external hidden unnamed_addr constant [15 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [90 x i8], align 1
@__PRETTY_FUNCTION__.histogram_init = external hidden unnamed_addr constant [54 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [42 x i8], align 1

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

21:                                               ; preds = %2
  br label %23

22:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 112, ptr noundef @__PRETTY_FUNCTION__.histogram_init) #7
  unreachable

23:                                               ; preds = %21
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = icmp ne ptr null, %24
  br i1 %25, label %26, label %27

26:                                               ; preds = %23
  br label %28

27:                                               ; preds = %23
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 113, ptr noundef @__PRETTY_FUNCTION__.histogram_init) #7
  unreachable

28:                                               ; preds = %26
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.histogram_cfg_t, ptr %29, i32 0, i32 0
  %31 = getelementptr inbounds %struct.anon.13, ptr %30, i32 0, i32 1
  %32 = load ptr, ptr %31, align 8, !tbaa !9
  %33 = icmp ne ptr null, %32
  br i1 %33, label %34, label %35

34:                                               ; preds = %28
  br label %36

35:                                               ; preds = %28
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 114, ptr noundef @__PRETTY_FUNCTION__.histogram_init) #7
  unreachable

36:                                               ; preds = %34
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.histogram_cfg_t, ptr %37, i32 0, i32 0
  %39 = getelementptr inbounds %struct.anon.13, ptr %38, i32 0, i32 2
  %40 = load i16, ptr %39, align 8, !tbaa !17
  %41 = zext i16 %40 to i32
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %43, label %44

43:                                               ; preds = %36
  br label %45

44:                                               ; preds = %36
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 115, ptr noundef @__PRETTY_FUNCTION__.histogram_init) #7
  unreachable

45:                                               ; preds = %43
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.histogram_cfg_t, ptr %46, i32 0, i32 3
  %48 = getelementptr inbounds %struct.histogram_on_get_bin_value_evt_t, ptr %47, i32 0, i32 0
  %49 = load ptr, ptr %48, align 8, !tbaa !18
  %50 = icmp ne ptr null, %49
  br i1 %50, label %51, label %52

51:                                               ; preds = %45
  br label %53

52:                                               ; preds = %45
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 116, ptr noundef @__PRETTY_FUNCTION__.histogram_init) #7
  unreachable

53:                                               ; preds = %51
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %54, i8 0, i64 120, i1 false)
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.histogram_t, ptr %55, i32 0, i32 0
  %57 = getelementptr inbounds %struct.anon.15, ptr %56, i32 0, i32 0
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %57, ptr align 8 %58, i64 64, i1 false), !tbaa.struct !19
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.histogram_t, ptr %59, i32 0, i32 0
  %61 = getelementptr inbounds %struct.anon.15, ptr %60, i32 0, i32 0
  %62 = getelementptr inbounds %struct.histogram_cfg_t, ptr %61, i32 0, i32 0
  %63 = getelementptr inbounds %struct.anon.13, ptr %62, i32 0, i32 0
  %64 = getelementptr inbounds %struct.arm_2d_size_t, ptr %63, i32 0, i32 0
  %65 = load i16, ptr %64, align 8, !tbaa !23
  %66 = sext i16 %65 to i32
  %67 = icmp sle i32 %66, 0
  br i1 %67, label %68, label %75

68:                                               ; preds = %53
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.histogram_t, ptr %69, i32 0, i32 0
  %71 = getelementptr inbounds %struct.anon.15, ptr %70, i32 0, i32 0
  %72 = getelementptr inbounds %struct.histogram_cfg_t, ptr %71, i32 0, i32 0
  %73 = getelementptr inbounds %struct.anon.13, ptr %72, i32 0, i32 0
  %74 = getelementptr inbounds %struct.arm_2d_size_t, ptr %73, i32 0, i32 0
  store i16 1, ptr %74, align 8, !tbaa !23
  br label %75

75:                                               ; preds = %68, %53
  %76 = load ptr, ptr %3, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.histogram_t, ptr %76, i32 0, i32 0
  %78 = getelementptr inbounds %struct.anon.15, ptr %77, i32 0, i32 0
  %79 = getelementptr inbounds %struct.histogram_cfg_t, ptr %78, i32 0, i32 0
  %80 = getelementptr inbounds %struct.anon.13, ptr %79, i32 0, i32 0
  %81 = getelementptr inbounds %struct.arm_2d_size_t, ptr %80, i32 0, i32 1
  %82 = load i16, ptr %81, align 2, !tbaa !29
  %83 = sext i16 %82 to i32
  %84 = icmp sle i32 %83, 0
  br i1 %84, label %85, label %92

85:                                               ; preds = %75
  %86 = load ptr, ptr %3, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.histogram_t, ptr %86, i32 0, i32 0
  %88 = getelementptr inbounds %struct.anon.15, ptr %87, i32 0, i32 0
  %89 = getelementptr inbounds %struct.histogram_cfg_t, ptr %88, i32 0, i32 0
  %90 = getelementptr inbounds %struct.anon.13, ptr %89, i32 0, i32 0
  %91 = getelementptr inbounds %struct.arm_2d_size_t, ptr %90, i32 0, i32 1
  store i16 64, ptr %91, align 2, !tbaa !29
  br label %92

92:                                               ; preds = %85, %75
  %93 = load ptr, ptr %3, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.histogram_t, ptr %93, i32 0, i32 0
  %95 = getelementptr inbounds %struct.anon.15, ptr %94, i32 0, i32 0
  %96 = getelementptr inbounds %struct.histogram_cfg_t, ptr %95, i32 0, i32 0
  %97 = getelementptr inbounds %struct.anon.13, ptr %96, i32 0, i32 5
  %98 = load i32, ptr %97, align 4, !tbaa !30
  %99 = icmp sle i32 %98, 0
  br i1 %99, label %100, label %106

100:                                              ; preds = %92
  %101 = load ptr, ptr %3, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.histogram_t, ptr %101, i32 0, i32 0
  %103 = getelementptr inbounds %struct.anon.15, ptr %102, i32 0, i32 0
  %104 = getelementptr inbounds %struct.histogram_cfg_t, ptr %103, i32 0, i32 0
  %105 = getelementptr inbounds %struct.anon.13, ptr %104, i32 0, i32 5
  store i32 2147483647, ptr %105, align 4, !tbaa !30
  br label %106

106:                                              ; preds = %100, %92
  call void @llvm.lifetime.start.p0(i64 2, ptr %5) #8
  %107 = load ptr, ptr %3, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.histogram_t, ptr %107, i32 0, i32 0
  %109 = getelementptr inbounds %struct.anon.15, ptr %108, i32 0, i32 0
  %110 = getelementptr inbounds %struct.histogram_cfg_t, ptr %109, i32 0, i32 0
  %111 = getelementptr inbounds %struct.anon.13, ptr %110, i32 0, i32 0
  %112 = getelementptr inbounds %struct.arm_2d_size_t, ptr %111, i32 0, i32 0
  %113 = load i16, ptr %112, align 8, !tbaa !23
  %114 = sext i16 %113 to i32
  %115 = load ptr, ptr %3, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.histogram_t, ptr %115, i32 0, i32 0
  %117 = getelementptr inbounds %struct.anon.15, ptr %116, i32 0, i32 0
  %118 = getelementptr inbounds %struct.histogram_cfg_t, ptr %117, i32 0, i32 0
  %119 = getelementptr inbounds %struct.anon.13, ptr %118, i32 0, i32 3
  %120 = load i8, ptr %119, align 2, !tbaa !31
  %121 = sext i8 %120 to i32
  %122 = add nsw i32 %114, %121
  %123 = trunc i32 %122 to i16
  store i16 %123, ptr %5, align 2, !tbaa !20
  %124 = load i16, ptr %5, align 2, !tbaa !20
  %125 = sext i16 %124 to i32
  %126 = icmp slt i32 %125, 16
  br i1 %126, label %127, label %145

127:                                              ; preds = %106
  %128 = load i16, ptr %5, align 2, !tbaa !20
  %129 = sext i16 %128 to i32
  %130 = sub nsw i32 %129, 1
  %131 = add nsw i32 16, %130
  %132 = load i16, ptr %5, align 2, !tbaa !20
  %133 = sext i16 %132 to i32
  %134 = sdiv i32 %131, %133
  %135 = sub nsw i32 %134, 1
  %136 = trunc i32 %135 to i8
  %137 = load ptr, ptr %3, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.histogram_t, ptr %137, i32 0, i32 0
  %139 = getelementptr inbounds %struct.anon.15, ptr %138, i32 0, i32 3
  %140 = load i8, ptr %139, align 8
  %141 = and i8 %136, 31
  %142 = shl i8 %141, 3
  %143 = and i8 %140, 7
  %144 = or i8 %143, %142
  store i8 %144, ptr %139, align 8
  br label %152

145:                                              ; preds = %106
  %146 = load ptr, ptr %3, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.histogram_t, ptr %146, i32 0, i32 0
  %148 = getelementptr inbounds %struct.anon.15, ptr %147, i32 0, i32 3
  %149 = load i8, ptr %148, align 8
  %150 = and i8 %149, 7
  %151 = or i8 %150, 0
  store i8 %151, ptr %148, align 8
  br label %152

152:                                              ; preds = %145, %127
  %153 = load ptr, ptr %3, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.histogram_t, ptr %153, i32 0, i32 0
  %155 = getelementptr inbounds %struct.anon.15, ptr %154, i32 0, i32 0
  %156 = getelementptr inbounds %struct.histogram_cfg_t, ptr %155, i32 0, i32 0
  %157 = getelementptr inbounds %struct.anon.13, ptr %156, i32 0, i32 4
  %158 = load i8, ptr %157, align 1
  %159 = lshr i8 %158, 1
  %160 = and i8 %159, 1
  %161 = icmp ne i8 %160, 0
  br i1 %161, label %162, label %183

162:                                              ; preds = %152
  %163 = load ptr, ptr %3, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.histogram_t, ptr %163, i32 0, i32 0
  %165 = getelementptr inbounds %struct.anon.15, ptr %164, i32 0, i32 0
  %166 = getelementptr inbounds %struct.histogram_cfg_t, ptr %165, i32 0, i32 0
  %167 = getelementptr inbounds %struct.anon.13, ptr %166, i32 0, i32 0
  %168 = getelementptr inbounds %struct.arm_2d_size_t, ptr %167, i32 0, i32 1
  %169 = load i16, ptr %168, align 2, !tbaa !29
  %170 = sext i16 %169 to i32
  %171 = ashr i32 %170, 1
  %172 = shl i32 %171, 16
  %173 = load ptr, ptr %3, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.histogram_t, ptr %173, i32 0, i32 0
  %175 = getelementptr inbounds %struct.anon.15, ptr %174, i32 0, i32 0
  %176 = getelementptr inbounds %struct.histogram_cfg_t, ptr %175, i32 0, i32 0
  %177 = getelementptr inbounds %struct.anon.13, ptr %176, i32 0, i32 5
  %178 = load i32, ptr %177, align 4, !tbaa !30
  %179 = sdiv i32 %172, %178
  %180 = load ptr, ptr %3, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.histogram_t, ptr %180, i32 0, i32 0
  %182 = getelementptr inbounds %struct.anon.15, ptr %181, i32 0, i32 5
  store i32 %179, ptr %182, align 4, !tbaa !32
  br label %203

183:                                              ; preds = %152
  %184 = load ptr, ptr %3, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.histogram_t, ptr %184, i32 0, i32 0
  %186 = getelementptr inbounds %struct.anon.15, ptr %185, i32 0, i32 0
  %187 = getelementptr inbounds %struct.histogram_cfg_t, ptr %186, i32 0, i32 0
  %188 = getelementptr inbounds %struct.anon.13, ptr %187, i32 0, i32 0
  %189 = getelementptr inbounds %struct.arm_2d_size_t, ptr %188, i32 0, i32 1
  %190 = load i16, ptr %189, align 2, !tbaa !29
  %191 = sext i16 %190 to i32
  %192 = shl i32 %191, 16
  %193 = load ptr, ptr %3, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.histogram_t, ptr %193, i32 0, i32 0
  %195 = getelementptr inbounds %struct.anon.15, ptr %194, i32 0, i32 0
  %196 = getelementptr inbounds %struct.histogram_cfg_t, ptr %195, i32 0, i32 0
  %197 = getelementptr inbounds %struct.anon.13, ptr %196, i32 0, i32 5
  %198 = load i32, ptr %197, align 4, !tbaa !30
  %199 = sdiv i32 %192, %198
  %200 = load ptr, ptr %3, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.histogram_t, ptr %200, i32 0, i32 0
  %202 = getelementptr inbounds %struct.anon.15, ptr %201, i32 0, i32 5
  store i32 %199, ptr %202, align 4, !tbaa !32
  br label %203

203:                                              ; preds = %183, %162
  %204 = load ptr, ptr %3, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.histogram_t, ptr %204, i32 0, i32 0
  %206 = getelementptr inbounds %struct.anon.15, ptr %205, i32 0, i32 0
  %207 = getelementptr inbounds %struct.histogram_cfg_t, ptr %206, i32 0, i32 1
  %208 = getelementptr inbounds %struct.anon.14, ptr %207, i32 0, i32 0
  %209 = load i32, ptr %208, align 8, !tbaa !33
  %210 = load ptr, ptr %3, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.histogram_t, ptr %210, i32 0, i32 0
  %212 = getelementptr inbounds %struct.anon.15, ptr %211, i32 0, i32 0
  %213 = getelementptr inbounds %struct.histogram_cfg_t, ptr %212, i32 0, i32 1
  %214 = getelementptr inbounds %struct.anon.14, ptr %213, i32 0, i32 1
  %215 = load i32, ptr %214, align 4, !tbaa !34
  %216 = icmp eq i32 %209, %215
  br i1 %216, label %217, label %270

217:                                              ; preds = %203
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %218 = load ptr, ptr %3, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.histogram_t, ptr %218, i32 0, i32 0
  %220 = getelementptr inbounds %struct.anon.15, ptr %219, i32 0, i32 0
  %221 = getelementptr inbounds %struct.histogram_cfg_t, ptr %220, i32 0, i32 0
  %222 = getelementptr inbounds %struct.anon.13, ptr %221, i32 0, i32 1
  %223 = load ptr, ptr %222, align 8, !tbaa !35
  store ptr %223, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %224 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %224, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  store ptr null, ptr %8, align 8, !tbaa !5
  br label %225

225:                                              ; preds = %268, %217
  %226 = load ptr, ptr %8, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.histogram_bin_item_t, ptr %226, i32 1
  store ptr %227, ptr %8, align 8, !tbaa !5
  %228 = icmp eq ptr %226, null
  br i1 %228, label %229, label %231

229:                                              ; preds = %225
  %230 = load ptr, ptr %6, align 8, !tbaa !5
  br label %232

231:                                              ; preds = %225
  br label %232

232:                                              ; preds = %231, %229
  %233 = phi i32 [ 1, %229 ], [ 0, %231 ]
  %234 = icmp ne i32 %233, 0
  br i1 %234, label %236, label %235

235:                                              ; preds = %232
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  br label %269

236:                                              ; preds = %232
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %237 = load ptr, ptr %3, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.histogram_t, ptr %237, i32 0, i32 0
  %239 = getelementptr inbounds %struct.anon.15, ptr %238, i32 0, i32 0
  %240 = getelementptr inbounds %struct.histogram_cfg_t, ptr %239, i32 0, i32 0
  %241 = getelementptr inbounds %struct.anon.13, ptr %240, i32 0, i32 2
  %242 = load i16, ptr %241, align 8, !tbaa !36
  %243 = zext i16 %242 to i64
  store i64 %243, ptr %10, align 8, !tbaa !37
  br label %244

244:                                              ; preds = %261, %236
  %245 = load i64, ptr %10, align 8, !tbaa !37
  %246 = icmp ugt i64 %245, 0
  br i1 %246, label %248, label %247

247:                                              ; preds = %244
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  br label %267

248:                                              ; preds = %244
  %249 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 2 %249, i8 0, i64 6, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %250 = load ptr, ptr %3, align 8, !tbaa !5
  %251 = getelementptr inbounds %struct.histogram_t, ptr %250, i32 0, i32 0
  %252 = getelementptr inbounds %struct.anon.15, ptr %251, i32 0, i32 0
  %253 = getelementptr inbounds %struct.histogram_cfg_t, ptr %252, i32 0, i32 1
  %254 = getelementptr inbounds %struct.anon.14, ptr %253, i32 0, i32 0
  %255 = load i32, ptr %254, align 8, !tbaa !33
  call void @__arm_2d_ccca8888_unpack(i32 noundef %255, ptr noundef %11)
  %256 = call zeroext i16 @__arm_2d_rgb565_pack(ptr noundef %11)
  store i16 %256, ptr %12, align 2, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  %257 = load i16, ptr %12, align 2, !tbaa !20
  %258 = load ptr, ptr %7, align 8, !tbaa !5
  %259 = getelementptr inbounds %struct.histogram_bin_item_t, ptr %258, i32 0, i32 0
  %260 = getelementptr inbounds %struct.anon.17, ptr %259, i32 0, i32 2
  store i16 %257, ptr %260, align 2, !tbaa !39
  br label %261

261:                                              ; preds = %248
  %262 = load ptr, ptr %6, align 8, !tbaa !5
  %263 = getelementptr inbounds %struct.histogram_bin_item_t, ptr %262, i32 1
  store ptr %263, ptr %6, align 8, !tbaa !5
  %264 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %264, ptr %7, align 8, !tbaa !5
  %265 = load i64, ptr %10, align 8, !tbaa !37
  %266 = add i64 %265, -1
  store i64 %266, ptr %10, align 8, !tbaa !37
  br label %244, !llvm.loop !42

267:                                              ; preds = %247
  br label %268

268:                                              ; preds = %267
  br label %225, !llvm.loop !44

269:                                              ; preds = %235
  br label %324

270:                                              ; preds = %203
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %271 = load ptr, ptr %3, align 8, !tbaa !5
  %272 = getelementptr inbounds %struct.histogram_t, ptr %271, i32 0, i32 0
  %273 = getelementptr inbounds %struct.anon.15, ptr %272, i32 0, i32 0
  %274 = getelementptr inbounds %struct.histogram_cfg_t, ptr %273, i32 0, i32 1
  %275 = getelementptr inbounds %struct.anon.14, ptr %274, i32 0, i32 0
  %276 = load i32, ptr %275, align 8, !tbaa !33
  store i32 %276, ptr %13, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  %277 = load ptr, ptr %3, align 8, !tbaa !5
  %278 = getelementptr inbounds %struct.histogram_t, ptr %277, i32 0, i32 0
  %279 = getelementptr inbounds %struct.anon.15, ptr %278, i32 0, i32 0
  %280 = getelementptr inbounds %struct.histogram_cfg_t, ptr %279, i32 0, i32 1
  %281 = getelementptr inbounds %struct.anon.14, ptr %280, i32 0, i32 1
  %282 = load i32, ptr %281, align 4, !tbaa !34
  store i32 %282, ptr %14, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %283 = load ptr, ptr %3, align 8, !tbaa !5
  %284 = getelementptr inbounds %struct.histogram_t, ptr %283, i32 0, i32 0
  %285 = getelementptr inbounds %struct.anon.15, ptr %284, i32 0, i32 0
  %286 = getelementptr inbounds %struct.histogram_cfg_t, ptr %285, i32 0, i32 0
  %287 = getelementptr inbounds %struct.anon.13, ptr %286, i32 0, i32 1
  %288 = load ptr, ptr %287, align 8, !tbaa !35
  store ptr %288, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  store i64 0, ptr %16, align 8, !tbaa !37
  br label %289

289:                                              ; preds = %320, %270
  %290 = load i64, ptr %16, align 8, !tbaa !37
  %291 = load ptr, ptr %3, align 8, !tbaa !5
  %292 = getelementptr inbounds %struct.histogram_t, ptr %291, i32 0, i32 0
  %293 = getelementptr inbounds %struct.anon.15, ptr %292, i32 0, i32 0
  %294 = getelementptr inbounds %struct.histogram_cfg_t, ptr %293, i32 0, i32 0
  %295 = getelementptr inbounds %struct.anon.13, ptr %294, i32 0, i32 2
  %296 = load i16, ptr %295, align 8, !tbaa !36
  %297 = zext i16 %296 to i64
  %298 = icmp ult i64 %290, %297
  br i1 %298, label %300, label %299

299:                                              ; preds = %289
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  br label %323

300:                                              ; preds = %289
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %301 = load i32, ptr %13, align 4, !tbaa !22
  %302 = load i32, ptr %14, align 4, !tbaa !22
  %303 = load ptr, ptr %3, align 8, !tbaa !5
  %304 = getelementptr inbounds %struct.histogram_t, ptr %303, i32 0, i32 0
  %305 = getelementptr inbounds %struct.anon.15, ptr %304, i32 0, i32 0
  %306 = getelementptr inbounds %struct.histogram_cfg_t, ptr %305, i32 0, i32 0
  %307 = getelementptr inbounds %struct.anon.13, ptr %306, i32 0, i32 2
  %308 = load i16, ptr %307, align 8, !tbaa !36
  %309 = zext i16 %308 to i32
  %310 = load i64, ptr %16, align 8, !tbaa !37
  %311 = trunc i64 %310 to i32
  %312 = call i32 @__arm_2d_helper_colour_slider(i32 noundef %301, i32 noundef %302, i32 noundef %309, i32 noundef %311)
  call void @__arm_2d_ccca8888_unpack(i32 noundef %312, ptr noundef %17)
  %313 = call zeroext i16 @__arm_2d_rgb565_pack(ptr noundef %17)
  store i16 %313, ptr %18, align 2, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  %314 = load i16, ptr %18, align 2, !tbaa !20
  %315 = load ptr, ptr %15, align 8, !tbaa !5
  %316 = getelementptr inbounds %struct.histogram_bin_item_t, ptr %315, i32 0, i32 0
  %317 = getelementptr inbounds %struct.anon.17, ptr %316, i32 0, i32 2
  store i16 %314, ptr %317, align 2, !tbaa !39
  %318 = load ptr, ptr %15, align 8, !tbaa !5
  %319 = getelementptr inbounds %struct.histogram_bin_item_t, ptr %318, i32 1
  store ptr %319, ptr %15, align 8, !tbaa !5
  br label %320

320:                                              ; preds = %300
  %321 = load i64, ptr %16, align 8, !tbaa !37
  %322 = add i64 %321, 1
  store i64 %322, ptr %16, align 8, !tbaa !37
  br label %289, !llvm.loop !45

323:                                              ; preds = %299
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %324

324:                                              ; preds = %323, %269
  %325 = load ptr, ptr %3, align 8, !tbaa !5
  %326 = getelementptr inbounds %struct.histogram_t, ptr %325, i32 0, i32 0
  %327 = getelementptr inbounds %struct.anon.15, ptr %326, i32 0, i32 0
  %328 = getelementptr inbounds %struct.histogram_cfg_t, ptr %327, i32 0, i32 0
  %329 = getelementptr inbounds %struct.anon.13, ptr %328, i32 0, i32 0
  %330 = getelementptr inbounds %struct.arm_2d_size_t, ptr %329, i32 0, i32 1
  %331 = load i16, ptr %330, align 2, !tbaa !29
  %332 = load ptr, ptr %3, align 8, !tbaa !5
  %333 = getelementptr inbounds %struct.histogram_t, ptr %332, i32 0, i32 0
  %334 = getelementptr inbounds %struct.anon.15, ptr %333, i32 0, i32 1
  %335 = getelementptr inbounds %struct.arm_2d_size_t, ptr %334, i32 0, i32 1
  store i16 %331, ptr %335, align 2, !tbaa !46
  %336 = load ptr, ptr %3, align 8, !tbaa !5
  %337 = getelementptr inbounds %struct.histogram_t, ptr %336, i32 0, i32 0
  %338 = getelementptr inbounds %struct.anon.15, ptr %337, i32 0, i32 0
  %339 = getelementptr inbounds %struct.histogram_cfg_t, ptr %338, i32 0, i32 0
  %340 = getelementptr inbounds %struct.anon.13, ptr %339, i32 0, i32 0
  %341 = getelementptr inbounds %struct.arm_2d_size_t, ptr %340, i32 0, i32 0
  %342 = load i16, ptr %341, align 8, !tbaa !23
  %343 = sext i16 %342 to i32
  %344 = load ptr, ptr %3, align 8, !tbaa !5
  %345 = getelementptr inbounds %struct.histogram_t, ptr %344, i32 0, i32 0
  %346 = getelementptr inbounds %struct.anon.15, ptr %345, i32 0, i32 0
  %347 = getelementptr inbounds %struct.histogram_cfg_t, ptr %346, i32 0, i32 0
  %348 = getelementptr inbounds %struct.anon.13, ptr %347, i32 0, i32 3
  %349 = load i8, ptr %348, align 2, !tbaa !31
  %350 = sext i8 %349 to i32
  %351 = add nsw i32 %343, %350
  %352 = load ptr, ptr %3, align 8, !tbaa !5
  %353 = getelementptr inbounds %struct.histogram_t, ptr %352, i32 0, i32 0
  %354 = getelementptr inbounds %struct.anon.15, ptr %353, i32 0, i32 0
  %355 = getelementptr inbounds %struct.histogram_cfg_t, ptr %354, i32 0, i32 0
  %356 = getelementptr inbounds %struct.anon.13, ptr %355, i32 0, i32 2
  %357 = load i16, ptr %356, align 8, !tbaa !36
  %358 = zext i16 %357 to i32
  %359 = mul nsw i32 %351, %358
  %360 = trunc i32 %359 to i16
  %361 = load ptr, ptr %3, align 8, !tbaa !5
  %362 = getelementptr inbounds %struct.histogram_t, ptr %361, i32 0, i32 0
  %363 = getelementptr inbounds %struct.anon.15, ptr %362, i32 0, i32 1
  %364 = getelementptr inbounds %struct.arm_2d_size_t, ptr %363, i32 0, i32 0
  store i16 %360, ptr %364, align 8, !tbaa !47
  %365 = load ptr, ptr %3, align 8, !tbaa !5
  %366 = getelementptr inbounds %struct.histogram_t, ptr %365, i32 0, i32 0
  %367 = getelementptr inbounds %struct.anon.15, ptr %366, i32 0, i32 0
  %368 = getelementptr inbounds %struct.histogram_cfg_t, ptr %367, i32 0, i32 0
  %369 = getelementptr inbounds %struct.anon.13, ptr %368, i32 0, i32 6
  %370 = load ptr, ptr %369, align 8, !tbaa !48
  %371 = icmp eq ptr null, %370
  br i1 %371, label %372, label %378

372:                                              ; preds = %324
  %373 = load ptr, ptr %3, align 8, !tbaa !5
  %374 = getelementptr inbounds %struct.histogram_t, ptr %373, i32 0, i32 0
  %375 = getelementptr inbounds %struct.anon.15, ptr %374, i32 0, i32 0
  %376 = getelementptr inbounds %struct.histogram_cfg_t, ptr %375, i32 0, i32 0
  %377 = getelementptr inbounds %struct.anon.13, ptr %376, i32 0, i32 6
  store ptr @c_tileLineVerticalLineMask, ptr %377, align 8, !tbaa !48
  br label %378

378:                                              ; preds = %372, %324
  %379 = load ptr, ptr %3, align 8, !tbaa !5
  %380 = getelementptr inbounds %struct.histogram_t, ptr %379, i32 0, i32 0
  %381 = getelementptr inbounds %struct.anon.15, ptr %380, i32 0, i32 0
  %382 = getelementptr inbounds %struct.histogram_cfg_t, ptr %381, i32 0, i32 2
  %383 = load ptr, ptr %382, align 8, !tbaa !49
  %384 = icmp ne ptr null, %383
  br i1 %384, label %385, label %402

385:                                              ; preds = %378
  %386 = load ptr, ptr %3, align 8, !tbaa !5
  %387 = getelementptr inbounds %struct.histogram_t, ptr %386, i32 0, i32 0
  %388 = getelementptr inbounds %struct.anon.15, ptr %387, i32 0, i32 3
  %389 = load i8, ptr %388, align 8
  %390 = and i8 %389, -2
  %391 = or i8 %390, 1
  store i8 %391, ptr %388, align 8
  %392 = load ptr, ptr %3, align 8, !tbaa !5
  %393 = getelementptr inbounds %struct.histogram_t, ptr %392, i32 0, i32 0
  %394 = getelementptr inbounds %struct.anon.15, ptr %393, i32 0, i32 2
  %395 = getelementptr inbounds %struct.anon.16, ptr %394, i32 0, i32 0
  %396 = load ptr, ptr %3, align 8, !tbaa !5
  %397 = getelementptr inbounds %struct.histogram_t, ptr %396, i32 0, i32 0
  %398 = getelementptr inbounds %struct.anon.15, ptr %397, i32 0, i32 0
  %399 = getelementptr inbounds %struct.histogram_cfg_t, ptr %398, i32 0, i32 2
  %400 = load ptr, ptr %399, align 8, !tbaa !49
  %401 = call ptr @arm_2d_scene_player_dynamic_dirty_region_init(ptr noundef %395, ptr noundef %400)
  br label %402

402:                                              ; preds = %385, %378
  call void @llvm.lifetime.end.p0(i64 2, ptr %5) #8
  ret void
}

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

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

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

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

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

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

declare ptr @arm_2d_scene_player_dynamic_dirty_region_init(ptr noundef, ptr noundef) #6

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"histogram_cfg_t", !11, i64 0, !15, i64 32, !6, i64 40, !16, i64 48}
!11 = !{!"", !12, i64 0, !6, i64 8, !13, i64 16, !7, i64 18, !7, i64 19, !7, i64 19, !7, i64 19, !14, i64 20, !6, i64 24}
!12 = !{!"arm_2d_size_t", !13, i64 0, !13, i64 2}
!13 = !{!"short", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!"", !14, i64 0, !14, i64 4}
!16 = !{!"histogram_on_get_bin_value_evt_t", !6, i64 0, !6, i64 8}
!17 = !{!10, !13, i64 16}
!18 = !{!10, !6, i64 48}
!19 = !{i64 0, i64 2, !20, i64 2, i64 2, !20, i64 8, i64 8, !5, i64 16, i64 2, !20, i64 18, i64 1, !21, i64 19, i64 1, !21, i64 20, i64 4, !22, i64 24, i64 8, !5, i64 32, i64 4, !22, i64 36, i64 4, !22, i64 40, i64 8, !5, i64 48, i64 8, !5, i64 56, i64 8, !5}
!20 = !{!13, !13, i64 0}
!21 = !{!7, !7, i64 0}
!22 = !{!14, !14, i64 0}
!23 = !{!24, !13, i64 0}
!24 = !{!"histogram_t", !25, i64 0}
!25 = !{!"", !10, i64 0, !12, i64 64, !26, i64 72, !7, i64 112, !7, i64 112, !7, i64 113, !14, i64 116}
!26 = !{!"", !27, i64 0, !13, i64 32}
!27 = !{!"arm_2d_region_list_item_t", !6, i64 0, !7, i64 8, !28, i64 16, !7, i64 24}
!28 = !{!"arm_2d_region_t", !7, i64 0, !7, i64 4}
!29 = !{!24, !13, i64 2}
!30 = !{!24, !14, i64 20}
!31 = !{!24, !7, i64 18}
!32 = !{!24, !14, i64 116}
!33 = !{!24, !14, i64 32}
!34 = !{!24, !14, i64 36}
!35 = !{!24, !6, i64 8}
!36 = !{!24, !13, i64 16}
!37 = !{!38, !38, i64 0}
!38 = !{!"long", !7, i64 0}
!39 = !{!40, !13, i64 4}
!40 = !{!"histogram_bin_item_t", !41, i64 0}
!41 = !{!"", !13, i64 0, !13, i64 2, !13, i64 4}
!42 = distinct !{!42, !43}
!43 = !{!"llvm.loop.mustprogress"}
!44 = distinct !{!44, !43}
!45 = distinct !{!45, !43}
!46 = !{!24, !13, i64 66}
!47 = !{!24, !13, i64 64}
!48 = !{!24, !6, i64 24}
!49 = !{!24, !6, i64 40}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%union.anon = type { i16 }
%union.anon.11 = type { %struct.arm_2d_region_t }
%struct.arm_2d_region_t = type { %union.anon.9, %union.anon.10 }
%union.anon.9 = type { %struct.arm_2d_location_t }
%struct.arm_2d_location_t = type { i16, i16 }
%union.anon.10 = type { %struct.arm_2d_size_t }
%struct.arm_2d_size_t = type { i16, i16 }
%union.anon.12 = type { ptr }
%union.__arm_2d_color_fast_rgb_t = type { [4 x i16] }

@c_tileLineVerticalLineMask = external dso_local constant { { { i8, { i8 }, %union.anon } }, %union.anon.11, %union.anon.12 }, align 8
@.str.1 = external hidden unnamed_addr constant [90 x i8], align 1
@__PRETTY_FUNCTION__.histogram_init = external hidden unnamed_addr constant [54 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [42 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @histogram_init(ptr noundef nonnull %0, ptr nocapture noundef nonnull readonly %1) local_unnamed_addr #0 {
  %3 = alloca %union.__arm_2d_color_fast_rgb_t, align 2
  %4 = alloca %union.__arm_2d_color_fast_rgb_t, align 2
  %5 = getelementptr inbounds i8, ptr %1, i64 8
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %.not = icmp eq ptr %6, null
  br i1 %.not, label %7, label %8

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

8:                                                ; preds = %2
  %9 = getelementptr inbounds i8, ptr %1, i64 16
  %10 = load i16, ptr %9, align 8, !tbaa !16
  %.not75 = icmp eq i16 %10, 0
  br i1 %.not75, label %11, label %12

11:                                               ; preds = %8
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 115, ptr noundef nonnull @__PRETTY_FUNCTION__.histogram_init) #7
  unreachable

12:                                               ; preds = %8
  %13 = getelementptr inbounds i8, ptr %1, i64 48
  %14 = load ptr, ptr %13, align 8, !tbaa !17
  %.not76 = icmp eq ptr %14, null
  br i1 %.not76, label %15, label %16

15:                                               ; preds = %12
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 116, ptr noundef nonnull @__PRETTY_FUNCTION__.histogram_init) #7
  unreachable

16:                                               ; preds = %12
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(120) %0, i8 0, i64 120, i1 false)
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 8 dereferenceable(64) %1, i64 64, i1 false), !tbaa.struct !18
  %17 = load i16, ptr %0, align 8, !tbaa !23
  %18 = icmp slt i16 %17, 1
  br i1 %18, label %19, label %20

19:                                               ; preds = %16
  store i16 1, ptr %0, align 8, !tbaa !23
  br label %20

20:                                               ; preds = %19, %16
  %21 = phi i16 [ 1, %19 ], [ %17, %16 ]
  %22 = getelementptr inbounds i8, ptr %0, i64 2
  %23 = load i16, ptr %22, align 2, !tbaa !29
  %24 = icmp slt i16 %23, 1
  br i1 %24, label %25, label %26

25:                                               ; preds = %20
  store i16 64, ptr %22, align 2, !tbaa !29
  br label %26

26:                                               ; preds = %25, %20
  %27 = phi i16 [ 64, %25 ], [ %23, %20 ]
  %28 = getelementptr inbounds i8, ptr %0, i64 20
  %29 = load i32, ptr %28, align 4, !tbaa !30
  %30 = icmp slt i32 %29, 1
  br i1 %30, label %31, label %32

31:                                               ; preds = %26
  store i32 2147483647, ptr %28, align 4, !tbaa !30
  br label %32

32:                                               ; preds = %31, %26
  %33 = phi i32 [ 2147483647, %31 ], [ %29, %26 ]
  %34 = getelementptr inbounds i8, ptr %0, i64 18
  %35 = load i8, ptr %34, align 2, !tbaa !31
  %36 = sext i8 %35 to i16
  %37 = add i16 %21, %36
  %38 = icmp slt i16 %37, 16
  br i1 %38, label %39, label %45

39:                                               ; preds = %32
  %.lhs.trunc = add nsw i16 %37, 15
  %40 = sdiv i16 %.lhs.trunc, %37
  %41 = trunc i16 %40 to i8
  %42 = getelementptr inbounds i8, ptr %0, i64 112
  %43 = shl i8 %41, 3
  %44 = add i8 %43, -8
  store i8 %44, ptr %42, align 8
  br label %47

45:                                               ; preds = %32
  %46 = getelementptr inbounds i8, ptr %0, i64 112
  store i8 0, ptr %46, align 8
  br label %47

47:                                               ; preds = %45, %39
  %48 = getelementptr inbounds i8, ptr %0, i64 19
  %49 = load i8, ptr %48, align 1
  %50 = lshr i8 %49, 1
  %51 = and i8 %50, 1
  %52 = zext nneg i8 %51 to i16
  %spec.select = lshr i16 %27, %52
  %.pn.in = zext nneg i16 %spec.select to i32
  %.pn = shl nuw nsw i32 %.pn.in, 16
  %.sink = udiv i32 %.pn, %33
  %53 = getelementptr inbounds i8, ptr %0, i64 116
  store i32 %.sink, ptr %53, align 4
  %54 = getelementptr inbounds i8, ptr %0, i64 32
  %55 = load i32, ptr %54, align 8, !tbaa !32
  %56 = getelementptr inbounds i8, ptr %0, i64 36
  %57 = load i32, ptr %56, align 4, !tbaa !33
  %58 = icmp eq i32 %55, %57
  %59 = getelementptr inbounds i8, ptr %0, i64 16
  %60 = load i16, ptr %59, align 8, !tbaa !34
  %.not7984 = icmp eq i16 %60, 0
  br i1 %58, label %61, label %70

61:                                               ; preds = %47
  br i1 %.not7984, label %.loopexit80, label %.lr.ph88.preheader

.loopexit.loopexit:                               ; preds = %.lr.ph88
  %.pre.pre = load i16, ptr %59, align 8, !tbaa !34
  br label %.loopexit80

.lr.ph88.preheader:                               ; preds = %61
  %62 = zext i16 %60 to i64
  %63 = getelementptr inbounds i8, ptr %0, i64 8
  %64 = load ptr, ptr %63, align 8, !tbaa !35
  br label %.lr.ph88

.lr.ph88:                                         ; preds = %.lr.ph88.preheader, %.lr.ph88
  %.16986 = phi ptr [ %68, %.lr.ph88 ], [ %64, %.lr.ph88.preheader ]
  %.07185 = phi i64 [ %69, %.lr.ph88 ], [ %62, %.lr.ph88.preheader ]
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 2 dereferenceable(6) %.16986, i8 0, i64 6, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %65 = load i32, ptr %54, align 8, !tbaa !32
  call void @__arm_2d_ccca8888_unpack(i32 noundef %65, ptr noundef %3)
  %66 = call zeroext i16 @__arm_2d_rgb565_pack(ptr noundef %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  %67 = getelementptr inbounds i8, ptr %.16986, i64 4
  store i16 %66, ptr %67, align 2, !tbaa !36
  %68 = getelementptr inbounds i8, ptr %.16986, i64 6
  %69 = add nsw i64 %.07185, -1
  %.not79 = icmp eq i64 %69, 0
  br i1 %.not79, label %.loopexit.loopexit, label %.lr.ph88, !llvm.loop !39

70:                                               ; preds = %47
  br i1 %.not7984, label %.loopexit80, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %70
  %71 = getelementptr inbounds i8, ptr %0, i64 8
  %72 = load ptr, ptr %71, align 8, !tbaa !35
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %73 = phi i16 [ %81, %.lr.ph ], [ %60, %.lr.ph.preheader ]
  %.06683 = phi i64 [ %80, %.lr.ph ], [ 0, %.lr.ph.preheader ]
  %.06782 = phi ptr [ %79, %.lr.ph ], [ %72, %.lr.ph.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %74 = zext i16 %73 to i32
  %75 = trunc nuw nsw i64 %.06683 to i32
  %76 = call i32 @__arm_2d_helper_colour_slider(i32 noundef %55, i32 noundef %57, i32 noundef %74, i32 noundef %75) #8
  call void @__arm_2d_ccca8888_unpack(i32 noundef %76, ptr noundef %4)
  %77 = call zeroext i16 @__arm_2d_rgb565_pack(ptr noundef %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  %78 = getelementptr inbounds i8, ptr %.06782, i64 4
  store i16 %77, ptr %78, align 2, !tbaa !36
  %79 = getelementptr inbounds i8, ptr %.06782, i64 6
  %80 = add nuw nsw i64 %.06683, 1
  %81 = load i16, ptr %59, align 8, !tbaa !34
  %82 = zext i16 %81 to i64
  %83 = icmp ult i64 %80, %82
  br i1 %83, label %.lr.ph, label %.loopexit80, !llvm.loop !41

.loopexit80:                                      ; preds = %.lr.ph, %61, %.loopexit.loopexit, %70
  %84 = phi i16 [ 0, %70 ], [ %.pre.pre, %.loopexit.loopexit ], [ 0, %61 ], [ %81, %.lr.ph ]
  %85 = load i16, ptr %22, align 2, !tbaa !29
  %86 = getelementptr inbounds i8, ptr %0, i64 64
  %87 = getelementptr inbounds i8, ptr %0, i64 66
  store i16 %85, ptr %87, align 2, !tbaa !42
  %88 = load i16, ptr %0, align 8, !tbaa !23
  %89 = load i8, ptr %34, align 2, !tbaa !31
  %90 = sext i8 %89 to i16
  %91 = add i16 %88, %90
  %92 = mul i16 %91, %84
  store i16 %92, ptr %86, align 8, !tbaa !43
  %93 = getelementptr inbounds i8, ptr %0, i64 24
  %94 = load ptr, ptr %93, align 8, !tbaa !44
  %95 = icmp eq ptr %94, null
  br i1 %95, label %96, label %97

96:                                               ; preds = %.loopexit80
  store ptr @c_tileLineVerticalLineMask, ptr %93, align 8, !tbaa !44
  br label %97

97:                                               ; preds = %96, %.loopexit80
  %98 = getelementptr inbounds i8, ptr %0, i64 40
  %99 = load ptr, ptr %98, align 8, !tbaa !45
  %.not78 = icmp eq ptr %99, null
  br i1 %.not78, label %106, label %100

100:                                              ; preds = %97
  %101 = getelementptr inbounds i8, ptr %0, i64 112
  %102 = load i8, ptr %101, align 8
  %103 = or i8 %102, 1
  store i8 %103, ptr %101, align 8
  %104 = getelementptr inbounds i8, ptr %0, i64 72
  %105 = call ptr @arm_2d_scene_player_dynamic_dirty_region_init(ptr noundef nonnull %104, ptr noundef nonnull %99) #8
  br label %106

106:                                              ; preds = %100, %97
  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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

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

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

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

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

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

declare ptr @arm_2d_scene_player_dynamic_dirty_region_init(ptr noundef, ptr noundef) local_unnamed_addr #6

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !12, i64 8}
!6 = !{!"histogram_cfg_t", !7, i64 0, !14, i64 32, !12, i64 40, !15, i64 48}
!7 = !{!"", !8, i64 0, !12, i64 8, !9, i64 16, !10, i64 18, !10, i64 19, !10, i64 19, !10, i64 19, !13, i64 20, !12, i64 24}
!8 = !{!"arm_2d_size_t", !9, i64 0, !9, i64 2}
!9 = !{!"short", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C/C++ TBAA"}
!12 = !{!"any pointer", !10, i64 0}
!13 = !{!"int", !10, i64 0}
!14 = !{!"", !13, i64 0, !13, i64 4}
!15 = !{!"histogram_on_get_bin_value_evt_t", !12, i64 0, !12, i64 8}
!16 = !{!6, !9, i64 16}
!17 = !{!6, !12, i64 48}
!18 = !{i64 0, i64 2, !19, i64 2, i64 2, !19, i64 8, i64 8, !20, i64 16, i64 2, !19, i64 18, i64 1, !21, i64 19, i64 1, !21, i64 20, i64 4, !22, i64 24, i64 8, !20, i64 32, i64 4, !22, i64 36, i64 4, !22, i64 40, i64 8, !20, i64 48, i64 8, !20, i64 56, i64 8, !20}
!19 = !{!9, !9, i64 0}
!20 = !{!12, !12, i64 0}
!21 = !{!10, !10, i64 0}
!22 = !{!13, !13, i64 0}
!23 = !{!24, !9, i64 0}
!24 = !{!"histogram_t", !25, i64 0}
!25 = !{!"", !6, i64 0, !8, i64 64, !26, i64 72, !10, i64 112, !10, i64 112, !10, i64 113, !13, i64 116}
!26 = !{!"", !27, i64 0, !9, i64 32}
!27 = !{!"arm_2d_region_list_item_t", !12, i64 0, !10, i64 8, !28, i64 16, !10, i64 24}
!28 = !{!"arm_2d_region_t", !10, i64 0, !10, i64 4}
!29 = !{!24, !9, i64 2}
!30 = !{!24, !13, i64 20}
!31 = !{!24, !10, i64 18}
!32 = !{!24, !13, i64 32}
!33 = !{!24, !13, i64 36}
!34 = !{!24, !9, i64 16}
!35 = !{!24, !12, i64 8}
!36 = !{!37, !9, i64 4}
!37 = !{!"histogram_bin_item_t", !38, i64 0}
!38 = !{!"", !9, i64 0, !9, i64 2, !9, i64 4}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}
!41 = distinct !{!41, !40}
!42 = !{!24, !9, i64 66}
!43 = !{!24, !9, i64 64}
!44 = !{!24, !12, i64 24}
!45 = !{!24, !12, i64 40}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MergedLoadStoreMotionPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass