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

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

%struct.arm_2d_op_trans_opa_t = type { %struct.arm_2d_op_core_t, %struct.anon, %struct.anon.0, %union.anon, %struct.anon.2, %struct.__arm_2d_transform_info_t, i8 }
%struct.arm_2d_op_core_t = type { [40 x i8], i64 }
%struct.anon = type { ptr, ptr }
%struct.anon.0 = type { ptr }
%union.anon = type { %struct.anon.1 }
%struct.anon.1 = type { i32 }
%struct.anon.2 = type { ptr, %struct.arm_2d_tile_t }
%struct.arm_2d_tile_t = type { %union.anon.3, %union.anon.14, %union.anon.17 }
%union.anon.3 = type { %struct.anon.4 }
%struct.anon.4 = type { i8, %union.arm_2d_color_info_t, %union.anon.7 }
%union.arm_2d_color_info_t = type { %struct.anon.5 }
%struct.anon.5 = type { i8 }
%union.anon.7 = type { i16 }
%union.anon.14 = type { %struct.arm_2d_region_t }
%struct.arm_2d_region_t = type { %union.anon.15, %union.anon.16 }
%union.anon.15 = type { %struct.arm_2d_location_t }
%struct.arm_2d_location_t = type { i16, i16 }
%union.anon.16 = type { %struct.arm_2d_size_t }
%struct.arm_2d_size_t = type { i16, i16 }
%union.anon.17 = type { ptr }
%struct.__arm_2d_transform_info_t = type { float, float, float, %struct.arm_2d_point_float_t, %union.anon.18, [40 x i8] }
%struct.arm_2d_point_float_t = type { float, float }
%union.anon.18 = type { i32 }
%union.arm_2d_color_rgb565_t = type { i16 }

@s_tMaskRotateCB = external hidden global [2 x %struct.arm_2d_op_trans_opa_t], align 16
@.str = external hidden unnamed_addr constant [17 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [95 x i8], align 1
@__PRETTY_FUNCTION__.spinning_wheel2_show = external hidden unnamed_addr constant [66 x i8], align 1
@spinning_wheel2_show.s_fAngle = external hidden global float, align 4
@c_tileGreenCircleQuaterMask = external hidden constant %struct.arm_2d_tile_t, align 8

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

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

; 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

declare zeroext i1 @arm_2d_op_wait_async(ptr noundef) #4

; Function Attrs: nounwind
declare float @fmodf(float noundef, float noundef) #5

declare i32 @arm_2dp_rgb565_fill_colour_with_mask_opacity_and_transform_prepare(ptr noundef, ptr noundef, i32, float noundef, float noundef, i64 noundef, i8 noundef zeroext) #4

declare i32 @arm_2dp_tile_transform(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
define dso_local void @spinning_wheel2_show(ptr noundef %0, i16 noundef zeroext %1, i1 noundef zeroext %2) #6 {
  %4 = alloca ptr, align 8
  %5 = alloca i16, align 2
  %6 = alloca i8, align 1
  %7 = alloca %struct.arm_2d_region_t, align 2
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca %struct.arm_2d_region_t, align 2
  %13 = alloca ptr, align 8
  %14 = alloca %struct.arm_2d_region_t, align 2
  %15 = alloca ptr, align 8
  %16 = alloca i16, align 2
  %17 = alloca %struct.arm_2d_region_t, align 2
  %18 = alloca %union.arm_2d_color_rgb565_t, align 2
  %19 = alloca %union.arm_2d_color_rgb565_t, align 2
  %20 = alloca %union.arm_2d_color_rgb565_t, align 2
  %21 = alloca %union.arm_2d_color_rgb565_t, align 2
  %22 = alloca %struct.arm_2d_location_t, align 2
  %23 = alloca i32, align 4
  %24 = alloca i8, align 1
  %25 = alloca i8, align 1
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i16 %1, ptr %5, align 2, !tbaa !9
  %26 = zext i1 %2 to i8
  store i8 %26, ptr %6, align 1, !tbaa !11
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = icmp ne ptr null, %27
  br i1 %28, label %29, label %30

29:                                               ; preds = %3
  br label %31

30:                                               ; preds = %3
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 147, ptr noundef @__PRETTY_FUNCTION__.spinning_wheel2_show) #7
  unreachable

31:                                               ; preds = %29
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = load i8, ptr %6, align 1, !tbaa !11, !range !13, !noundef !14
  %34 = trunc i8 %33 to i1
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  call void @llvm.memset.p0.i64(ptr align 2 %7, i8 0, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  store ptr null, ptr %8, align 8, !tbaa !5
  br label %35

35:                                               ; preds = %177, %31
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.arm_2d_region_t, ptr %36, i32 1
  store ptr %37, ptr %8, align 8, !tbaa !5
  %38 = icmp eq ptr %36, null
  br i1 %38, label %39, label %44

39:                                               ; preds = %35
  %40 = getelementptr inbounds %struct.arm_2d_region_t, ptr %7, i32 0, i32 1
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %41, i32 0, i32 1
  %43 = getelementptr inbounds %struct.arm_2d_region_t, ptr %42, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %40, ptr align 4 %43, i64 4, i1 false), !tbaa.struct !15
  br label %45

44:                                               ; preds = %35
  br label %45

45:                                               ; preds = %44, %39
  %46 = phi i32 [ 1, %39 ], [ 0, %44 ]
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %49, label %48

48:                                               ; preds = %45
  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
  br label %182

49:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %50, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  store ptr null, ptr %11, align 8, !tbaa !5
  br label %51

51:                                               ; preds = %174, %49
  %52 = load ptr, ptr %11, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %52, i32 1
  store ptr %53, ptr %11, align 8, !tbaa !5
  %54 = icmp eq ptr %52, null
  br i1 %54, label %56, label %55

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

56:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %12, ptr align 2 %7, i64 8, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  store ptr null, ptr %13, align 8, !tbaa !5
  br label %57

57:                                               ; preds = %172, %56
  %58 = load ptr, ptr %13, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.arm_2d_region_t, ptr %58, i32 1
  store ptr %59, ptr %13, align 8, !tbaa !5
  %60 = icmp eq ptr %58, null
  br i1 %60, label %62, label %61

61:                                               ; preds = %57
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %173

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

63:                                               ; preds = %167, %62
  %64 = load ptr, ptr %15, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.arm_2d_region_t, ptr %64, i32 1
  store ptr %65, ptr %15, align 8, !tbaa !5
  %66 = icmp eq ptr %64, null
  br i1 %66, label %67, label %99

67:                                               ; preds = %63
  %68 = getelementptr inbounds %struct.arm_2d_region_t, ptr %14, i32 0, i32 1
  %69 = getelementptr inbounds %struct.arm_2d_size_t, ptr %68, i32 0, i32 0
  store i16 55, ptr %69, align 2, !tbaa !17
  %70 = getelementptr inbounds %struct.arm_2d_region_t, ptr %14, i32 0, i32 1
  %71 = getelementptr inbounds %struct.arm_2d_size_t, ptr %70, i32 0, i32 1
  store i16 55, ptr %71, align 2, !tbaa !17
  %72 = getelementptr inbounds %struct.arm_2d_region_t, ptr %14, i32 0, i32 0
  %73 = getelementptr inbounds %struct.arm_2d_region_t, ptr %12, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %72, ptr align 2 %73, i64 4, i1 false), !tbaa.struct !15
  %74 = getelementptr inbounds %struct.arm_2d_region_t, ptr %12, i32 0, i32 1
  %75 = getelementptr inbounds %struct.arm_2d_size_t, ptr %74, i32 0, i32 0
  %76 = load i16, ptr %75, align 2, !tbaa !17
  %77 = sext i16 %76 to i32
  %78 = sub nsw i32 %77, 55
  %79 = ashr i32 %78, 1
  %80 = getelementptr inbounds %struct.arm_2d_region_t, ptr %14, i32 0, i32 0
  %81 = getelementptr inbounds %struct.arm_2d_location_t, ptr %80, i32 0, i32 0
  %82 = load i16, ptr %81, align 2, !tbaa !17
  %83 = sext i16 %82 to i32
  %84 = add nsw i32 %83, %79
  %85 = trunc i32 %84 to i16
  store i16 %85, ptr %81, align 2, !tbaa !17
  %86 = getelementptr inbounds %struct.arm_2d_region_t, ptr %12, i32 0, i32 1
  %87 = getelementptr inbounds %struct.arm_2d_size_t, ptr %86, i32 0, i32 1
  %88 = load i16, ptr %87, align 2, !tbaa !17
  %89 = sext i16 %88 to i32
  %90 = sub nsw i32 %89, 55
  %91 = ashr i32 %90, 1
  %92 = getelementptr inbounds %struct.arm_2d_region_t, ptr %14, i32 0, i32 0
  %93 = getelementptr inbounds %struct.arm_2d_location_t, ptr %92, i32 0, i32 1
  %94 = load i16, ptr %93, align 2, !tbaa !17
  %95 = sext i16 %94 to i32
  %96 = add nsw i32 %95, %91
  %97 = trunc i32 %96 to i16
  store i16 %97, ptr %93, align 2, !tbaa !17
  store i16 %97, ptr %16, align 2, !tbaa !9
  %98 = load i16, ptr %16, align 2, !tbaa !9
  br label %100

99:                                               ; preds = %63
  br label %100

100:                                              ; preds = %99, %67
  %101 = phi i32 [ 1, %67 ], [ 0, %99 ]
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %104, label %103

103:                                              ; preds = %100
  store i32 10, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %172

104:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %105 = getelementptr inbounds %struct.arm_2d_region_t, ptr %17, i32 0, i32 0
  %106 = getelementptr inbounds %struct.arm_2d_region_t, ptr %14, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %105, ptr align 2 %106, i64 4, i1 false), !tbaa.struct !15
  %107 = getelementptr inbounds %struct.arm_2d_region_t, ptr %17, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %107, ptr align 4 getelementptr inbounds (%struct.arm_2d_region_t, ptr getelementptr inbounds (%struct.arm_2d_tile_t, ptr @c_tileGreenCircleQuaterMask, i32 0, i32 1), i32 0, i32 1), i64 4, i1 false), !tbaa.struct !15
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  store i16 -14824, ptr %18, align 2, !tbaa !17
  %109 = getelementptr inbounds %union.arm_2d_color_rgb565_t, ptr %18, i32 0, i32 0
  %110 = load i16, ptr %109, align 2
  %111 = call i32 @arm_2dp_rgb565_fill_colour_with_mask_xy_mirror_and_opacity(ptr noundef null, ptr noundef %108, ptr noundef %17, ptr noundef @c_tileGreenCircleQuaterMask, i16 %110, i8 noundef zeroext 64)
  %112 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %113 = getelementptr inbounds %struct.arm_2d_region_t, ptr %17, i32 0, i32 0
  %114 = getelementptr inbounds %struct.arm_2d_location_t, ptr %113, i32 0, i32 0
  %115 = load i16, ptr %114, align 2, !tbaa !17
  %116 = sext i16 %115 to i32
  %117 = add nsw i32 %116, 28
  %118 = trunc i32 %117 to i16
  store i16 %118, ptr %114, align 2, !tbaa !17
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  store i16 -14824, ptr %19, align 2, !tbaa !17
  %120 = getelementptr inbounds %union.arm_2d_color_rgb565_t, ptr %19, i32 0, i32 0
  %121 = load i16, ptr %120, align 2
  %122 = call i32 @arm_2dp_rgb565_fill_colour_with_mask_y_mirror_and_opacity(ptr noundef null, ptr noundef %119, ptr noundef %17, ptr noundef @c_tileGreenCircleQuaterMask, i16 %121, i8 noundef zeroext 64)
  %123 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %124 = getelementptr inbounds %struct.arm_2d_region_t, ptr %17, i32 0, i32 0
  %125 = getelementptr inbounds %struct.arm_2d_location_t, ptr %124, i32 0, i32 1
  %126 = load i16, ptr %125, align 2, !tbaa !17
  %127 = sext i16 %126 to i32
  %128 = add nsw i32 %127, 28
  %129 = trunc i32 %128 to i16
  store i16 %129, ptr %125, align 2, !tbaa !17
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  store i16 -14824, ptr %20, align 2, !tbaa !17
  %131 = getelementptr inbounds %union.arm_2d_color_rgb565_t, ptr %20, i32 0, i32 0
  %132 = load i16, ptr %131, align 2
  %133 = call i32 @arm_2dp_rgb565_fill_colour_with_mask_and_opacity(ptr noundef null, ptr noundef %130, ptr noundef %17, ptr noundef @c_tileGreenCircleQuaterMask, i16 %132, i8 noundef zeroext 64)
  %134 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %135 = getelementptr inbounds %struct.arm_2d_region_t, ptr %17, i32 0, i32 0
  %136 = getelementptr inbounds %struct.arm_2d_location_t, ptr %135, i32 0, i32 0
  %137 = load i16, ptr %136, align 2, !tbaa !17
  %138 = sext i16 %137 to i32
  %139 = sub nsw i32 %138, 28
  %140 = trunc i32 %139 to i16
  store i16 %140, ptr %136, align 2, !tbaa !17
  %141 = load ptr, ptr %4, align 8, !tbaa !5
  store i16 -14824, ptr %21, align 2, !tbaa !17
  %142 = getelementptr inbounds %union.arm_2d_color_rgb565_t, ptr %21, i32 0, i32 0
  %143 = load i16, ptr %142, align 2
  %144 = call i32 @arm_2dp_rgb565_fill_colour_with_mask_x_mirror_and_opacity(ptr noundef null, ptr noundef %141, ptr noundef %17, ptr noundef @c_tileGreenCircleQuaterMask, i16 %143, i8 noundef zeroext 64)
  %145 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  call void @llvm.memset.p0.i64(ptr align 2 %22, i8 0, i64 4, i1 false)
  %146 = load i8, ptr %6, align 1, !tbaa !11, !range !13, !noundef !14
  %147 = trunc i8 %146 to i1
  br i1 %147, label %148, label %153

148:                                              ; preds = %104
  %149 = load float, ptr @spinning_wheel2_show.s_fAngle, align 4, !tbaa !18
  %150 = fadd float %149, 0x3FBACEEA00000000
  store float %150, ptr @spinning_wheel2_show.s_fAngle, align 4, !tbaa !18
  %151 = load float, ptr @spinning_wheel2_show.s_fAngle, align 4, !tbaa !18
  %152 = call float @fmodf(float noundef %151, float noundef 0x401921FB40000000) #8
  store float %152, ptr @spinning_wheel2_show.s_fAngle, align 4, !tbaa !18
  br label %153

153:                                              ; preds = %148, %104
  %154 = load i8, ptr %6, align 1, !tbaa !11, !range !13, !noundef !14
  %155 = trunc i8 %154 to i1
  br i1 %155, label %156, label %162

156:                                              ; preds = %153
  %157 = load float, ptr @spinning_wheel2_show.s_fAngle, align 4, !tbaa !18
  %158 = load i16, ptr %5, align 2, !tbaa !9
  %159 = zext i16 %158 to i64
  %160 = load i32, ptr %22, align 2
  %161 = call i32 @arm_2dp_rgb565_fill_colour_with_mask_opacity_and_transform_prepare(ptr noundef getelementptr inbounds ([2 x %struct.arm_2d_op_trans_opa_t], ptr @s_tMaskRotateCB, i64 0, i64 1), ptr noundef @c_tileGreenCircleQuaterMask, i32 %160, float noundef %157, float noundef 0x3FF028F5C0000000, i64 noundef %159, i8 noundef zeroext -128)
  br label %162

162:                                              ; preds = %156, %153
  %163 = load ptr, ptr %4, align 8, !tbaa !5
  %164 = call i32 @arm_2dp_tile_transform(ptr noundef getelementptr inbounds ([2 x %struct.arm_2d_op_trans_opa_t], ptr @s_tMaskRotateCB, i64 0, i64 1), ptr noundef %163, ptr noundef %14, ptr noundef null)
  store i32 %164, ptr %23, align 4, !tbaa !20
  %165 = load i32, ptr %23, align 4, !tbaa !20
  %166 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef getelementptr inbounds ([2 x %struct.arm_2d_op_trans_opa_t], ptr @s_tMaskRotateCB, i64 0, i64 1))
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  br label %167

167:                                              ; preds = %162
  %168 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %169 = zext i1 %168 to i8
  store i8 %169, ptr %24, align 1, !tbaa !11
  %170 = load i8, ptr %24, align 1, !tbaa !11, !range !13, !noundef !14
  %171 = trunc i8 %170 to i1
  br label %63, !llvm.loop !22

172:                                              ; preds = %103
  br label %57, !llvm.loop !24

173:                                              ; preds = %61
  br label %174

174:                                              ; preds = %173
  %175 = load ptr, ptr %10, align 8, !tbaa !5
  br label %51, !llvm.loop !25

176:                                              ; preds = %55
  br label %177

177:                                              ; preds = %176
  %178 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %179 = zext i1 %178 to i8
  store i8 %179, ptr %25, align 1, !tbaa !11
  %180 = load i8, ptr %25, align 1, !tbaa !11, !range !13, !noundef !14
  %181 = trunc i8 %180 to i1
  br label %35, !llvm.loop !26

182:                                              ; preds = %48
  ret void
}

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"short", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{i64 0, i64 2, !9, i64 2, i64 2, !9}
!16 = !{i64 0, i64 4, !17, i64 4, i64 4, !17}
!17 = !{!7, !7, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"float", !7, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"int", !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}
!25 = distinct !{!25, !23}
!26 = distinct !{!26, !23}


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

%struct.arm_2d_op_trans_opa_t = type { %struct.arm_2d_op_core_t, %struct.anon, %struct.anon.0, %union.anon, %struct.anon.2, %struct.__arm_2d_transform_info_t, i8 }
%struct.arm_2d_op_core_t = type { [40 x i8], i64 }
%struct.anon = type { ptr, ptr }
%struct.anon.0 = type { ptr }
%union.anon = type { %struct.anon.1 }
%struct.anon.1 = type { i32 }
%struct.anon.2 = type { ptr, %struct.arm_2d_tile_t }
%struct.arm_2d_tile_t = type { %union.anon.3, %union.anon.14, %union.anon.17 }
%union.anon.3 = type { %struct.anon.4 }
%struct.anon.4 = type { i8, %union.arm_2d_color_info_t, %union.anon.7 }
%union.arm_2d_color_info_t = type { %struct.anon.5 }
%struct.anon.5 = type { i8 }
%union.anon.7 = type { i16 }
%union.anon.14 = type { %struct.arm_2d_region_t }
%struct.arm_2d_region_t = type { %union.anon.15, %union.anon.16 }
%union.anon.15 = type { %struct.arm_2d_location_t }
%struct.arm_2d_location_t = type { i16, i16 }
%union.anon.16 = type { %struct.arm_2d_size_t }
%struct.arm_2d_size_t = type { i16, i16 }
%union.anon.17 = type { ptr }
%struct.__arm_2d_transform_info_t = type { float, float, float, %struct.arm_2d_point_float_t, %union.anon.18, [40 x i8] }
%struct.arm_2d_point_float_t = type { float, float }
%union.anon.18 = type { i32 }

@s_tMaskRotateCB = external hidden global [2 x %struct.arm_2d_op_trans_opa_t], align 16
@.str = external hidden unnamed_addr constant [17 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [95 x i8], align 1
@__PRETTY_FUNCTION__.spinning_wheel2_show = external hidden unnamed_addr constant [66 x i8], align 1
@spinning_wheel2_show.s_fAngle = external hidden local_unnamed_addr global float, align 4
@c_tileGreenCircleQuaterMask = external hidden constant %struct.arm_2d_tile_t, align 8

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

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare float @fmodf(float noundef, float noundef) local_unnamed_addr #3

declare i32 @arm_2dp_rgb565_fill_colour_with_mask_opacity_and_transform_prepare(ptr noundef, ptr noundef, i32, float noundef, float noundef, i64 noundef, i8 noundef zeroext) local_unnamed_addr #2

declare i32 @arm_2dp_tile_transform(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @spinning_wheel2_show(ptr noundef %0, i16 noundef zeroext %1, i1 noundef zeroext %2) local_unnamed_addr #4 {
  %4 = alloca %struct.arm_2d_region_t, align 4
  %5 = alloca %struct.arm_2d_region_t, align 4
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %31, label %.preheader40

.preheader40:                                     ; preds = %3
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = getelementptr inbounds i8, ptr %4, i64 4
  %8 = getelementptr inbounds i8, ptr %4, i64 6
  %9 = getelementptr inbounds i8, ptr %5, i64 4
  %10 = load i32, ptr getelementptr inbounds (i8, ptr @c_tileGreenCircleQuaterMask, i64 8), align 8
  %11 = getelementptr inbounds i8, ptr %5, i64 2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  store i16 55, ptr %7, align 4, !tbaa !5
  store i16 55, ptr %8, align 2, !tbaa !5
  %12 = load <2 x i16>, ptr %6, align 4, !tbaa !8
  %13 = sext <2 x i16> %12 to <2 x i32>
  %14 = add nsw <2 x i32> %13, <i32 131017, i32 131017>
  %15 = lshr <2 x i32> %14, <i32 1, i32 1>
  %16 = trunc <2 x i32> %15 to <2 x i16>
  store <2 x i16> %16, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  store <2 x i16> %16, ptr %5, align 4
  store i32 %10, ptr %9, align 4
  %17 = call i32 @arm_2dp_rgb565_fill_colour_with_mask_xy_mirror_and_opacity(ptr noundef null, ptr noundef nonnull %0, ptr noundef nonnull %5, ptr noundef nonnull @c_tileGreenCircleQuaterMask, i16 -14824, i8 noundef zeroext 64) #5
  %18 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #5
  %19 = load i16, ptr %5, align 4, !tbaa !5
  %20 = add i16 %19, 28
  store i16 %20, ptr %5, align 4, !tbaa !5
  %21 = call i32 @arm_2dp_rgb565_fill_colour_with_mask_y_mirror_and_opacity(ptr noundef null, ptr noundef nonnull %0, ptr noundef nonnull %5, ptr noundef nonnull @c_tileGreenCircleQuaterMask, i16 -14824, i8 noundef zeroext 64) #5
  %22 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #5
  %23 = load i16, ptr %11, align 2, !tbaa !5
  %24 = add i16 %23, 28
  store i16 %24, ptr %11, align 2, !tbaa !5
  %25 = call i32 @arm_2dp_rgb565_fill_colour_with_mask_and_opacity(ptr noundef null, ptr noundef nonnull %0, ptr noundef nonnull %5, ptr noundef nonnull @c_tileGreenCircleQuaterMask, i16 -14824, i8 noundef zeroext 64) #5
  %26 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #5
  %27 = load i16, ptr %5, align 4, !tbaa !5
  %28 = add i16 %27, -28
  store i16 %28, ptr %5, align 4, !tbaa !5
  %29 = call i32 @arm_2dp_rgb565_fill_colour_with_mask_x_mirror_and_opacity(ptr noundef null, ptr noundef nonnull %0, ptr noundef nonnull %5, ptr noundef nonnull @c_tileGreenCircleQuaterMask, i16 -14824, i8 noundef zeroext 64) #5
  %30 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #5
  br i1 %2, label %32, label %.critedge37

31:                                               ; preds = %3
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 147, ptr noundef nonnull @__PRETTY_FUNCTION__.spinning_wheel2_show) #6
  unreachable

32:                                               ; preds = %.preheader40
  %33 = zext i16 %1 to i64
  %34 = load float, ptr @spinning_wheel2_show.s_fAngle, align 4, !tbaa !10
  %35 = fadd float %34, 0x3FBACEEA00000000
  %36 = call float @fmodf(float noundef %35, float noundef 0x401921FB40000000) #5
  store float %36, ptr @spinning_wheel2_show.s_fAngle, align 4, !tbaa !10
  %37 = call i32 @arm_2dp_rgb565_fill_colour_with_mask_opacity_and_transform_prepare(ptr noundef nonnull getelementptr inbounds (i8, ptr @s_tMaskRotateCB, i64 184), ptr noundef nonnull @c_tileGreenCircleQuaterMask, i32 0, float noundef %36, float noundef 0x3FF028F5C0000000, i64 noundef %33, i8 noundef zeroext -128) #5
  br label %.critedge37

.critedge37:                                      ; preds = %.preheader40, %32
  %38 = call i32 @arm_2dp_tile_transform(ptr noundef nonnull getelementptr inbounds (i8, ptr @s_tMaskRotateCB, i64 184), ptr noundef nonnull %0, ptr noundef nonnull %4, ptr noundef null) #5
  %39 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef nonnull getelementptr inbounds (i8, ptr @s_tMaskRotateCB, i64 184)) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  %40 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %41 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #5
  ret void
}

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"short", !6, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"float", !6, i64 0}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass