; LLVM IR from HANDS-FREE/OpenRE :: 3_OS/STM32F1/GUI/STemWin/Demo (GUIDEMO_Speed)

; 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.GUI_FONT = type { ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, i8, i8, %union.anon, i8, i8, i8 }
%union.anon = type { ptr }
%struct.GUI_BITMAP = type { i16, i16, i16, i16, ptr, ptr, ptr }
%struct.LCD_RECT = type { i16, i16, i16, i16 }

@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [46 x i8], align 1
@_aColor = external hidden constant [8 x i64], align 16
@GUI_FontRounded22 = external constant %struct.GUI_FONT, align 8
@bmSTLogo70x35 = external constant %struct.GUI_BITMAP, align 8
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @GUIDEMO_Speed() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca [8 x i32], align 16
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %struct.LCD_RECT, align 2
  %9 = alloca %struct.LCD_RECT, align 2
  %10 = alloca [40 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr %10) #5
  call void @llvm.memset.p0.i64(ptr align 16 %10, i8 0, i64 40, i1 false)
  %11 = call i32 @LCD_GetXSize()
  store i32 %11, ptr %5, align 4, !tbaa !5
  %12 = call i32 @LCD_GetYSize()
  store i32 %12, ptr %6, align 4, !tbaa !5
  %13 = call i32 @LCD_GetVYSize()
  store i32 %13, ptr %7, align 4, !tbaa !5
  call void @GUI_CURSOR_Hide()
  %14 = load i32, ptr %7, align 4, !tbaa !5
  %15 = load i32, ptr %6, align 4, !tbaa !5
  %16 = icmp sgt i32 %14, %15
  br i1 %16, label %17, label %27

17:                                               ; preds = %0
  %18 = getelementptr inbounds %struct.LCD_RECT, ptr %9, i32 0, i32 0
  store i16 0, ptr %18, align 2, !tbaa !9
  %19 = getelementptr inbounds %struct.LCD_RECT, ptr %9, i32 0, i32 1
  store i16 0, ptr %19, align 2, !tbaa !12
  %20 = load i32, ptr %5, align 4, !tbaa !5
  %21 = trunc i32 %20 to i16
  %22 = getelementptr inbounds %struct.LCD_RECT, ptr %9, i32 0, i32 2
  store i16 %21, ptr %22, align 2, !tbaa !13
  %23 = load i32, ptr %6, align 4, !tbaa !5
  %24 = trunc i32 %23 to i16
  %25 = getelementptr inbounds %struct.LCD_RECT, ptr %9, i32 0, i32 3
  store i16 %24, ptr %25, align 2, !tbaa !14
  %26 = call ptr @GUI_SetClipRect(ptr noundef %9)
  br label %27

27:                                               ; preds = %17, %0
  call void @GUIDEMO_ShowIntro(ptr noundef @.str, ptr noundef @.str.1)
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %40, %27
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = icmp slt i32 %29, 8
  br i1 %30, label %31, label %43

31:                                               ; preds = %28
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [8 x i64], ptr @_aColor, i64 0, i64 %33
  %35 = load i64, ptr %34, align 8, !tbaa !15
  %36 = call i32 @GUI_Color2Index(i64 noundef %35)
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [8 x i32], ptr %4, i64 0, i64 %38
  store i32 %36, ptr %39, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %31
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %2, align 4, !tbaa !5
  br label %28, !llvm.loop !17

43:                                               ; preds = %28
  %44 = call i32 @GUIDEMO_GetTime()
  store i32 %44, ptr %1, align 4, !tbaa !5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %146, %43
  %46 = call i32 @GUIDEMO_GetTime()
  %47 = load i32, ptr %1, align 4, !tbaa !5
  %48 = sub nsw i32 %46, %47
  %49 = icmp slt i32 %48, 5000
  br i1 %49, label %50, label %53

50:                                               ; preds = %45
  %51 = call i32 @GUIDEMO_CheckCancel()
  %52 = icmp eq i32 %51, 0
  br label %53

53:                                               ; preds = %50, %45
  %54 = phi i1 [ false, %45 ], [ %52, %50 ]
  br i1 %54, label %55, label %149

55:                                               ; preds = %53
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = and i32 %56, 7
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [8 x i32], ptr %4, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  call void @GUI_SetColorIndex(i32 noundef %60)
  %61 = call i32 @rand() #5
  %62 = load i32, ptr %5, align 4, !tbaa !5
  %63 = srem i32 %61, %62
  %64 = load i32, ptr %5, align 4, !tbaa !5
  %65 = sdiv i32 %64, 2
  %66 = sub nsw i32 %63, %65
  %67 = trunc i32 %66 to i16
  %68 = getelementptr inbounds %struct.LCD_RECT, ptr %8, i32 0, i32 0
  store i16 %67, ptr %68, align 2, !tbaa !9
  %69 = call i32 @rand() #5
  %70 = load i32, ptr %6, align 4, !tbaa !5
  %71 = srem i32 %69, %70
  %72 = load i32, ptr %6, align 4, !tbaa !5
  %73 = sdiv i32 %72, 2
  %74 = sub nsw i32 %71, %73
  %75 = trunc i32 %74 to i16
  %76 = getelementptr inbounds %struct.LCD_RECT, ptr %8, i32 0, i32 1
  store i16 %75, ptr %76, align 2, !tbaa !12
  %77 = getelementptr inbounds %struct.LCD_RECT, ptr %8, i32 0, i32 0
  %78 = load i16, ptr %77, align 2, !tbaa !9
  %79 = sext i16 %78 to i32
  %80 = add nsw i32 %79, 20
  %81 = call i32 @rand() #5
  %82 = load i32, ptr %5, align 4, !tbaa !5
  %83 = srem i32 %81, %82
  %84 = add nsw i32 %80, %83
  %85 = trunc i32 %84 to i16
  %86 = getelementptr inbounds %struct.LCD_RECT, ptr %8, i32 0, i32 2
  store i16 %85, ptr %86, align 2, !tbaa !13
  %87 = getelementptr inbounds %struct.LCD_RECT, ptr %8, i32 0, i32 1
  %88 = load i16, ptr %87, align 2, !tbaa !12
  %89 = sext i16 %88 to i32
  %90 = add nsw i32 %89, 20
  %91 = call i32 @rand() #5
  %92 = load i32, ptr %6, align 4, !tbaa !5
  %93 = srem i32 %91, %92
  %94 = add nsw i32 %90, %93
  %95 = trunc i32 %94 to i16
  %96 = getelementptr inbounds %struct.LCD_RECT, ptr %8, i32 0, i32 3
  store i16 %95, ptr %96, align 2, !tbaa !14
  %97 = getelementptr inbounds %struct.LCD_RECT, ptr %8, i32 0, i32 0
  %98 = load i16, ptr %97, align 2, !tbaa !9
  %99 = sext i16 %98 to i32
  %100 = getelementptr inbounds %struct.LCD_RECT, ptr %8, i32 0, i32 1
  %101 = load i16, ptr %100, align 2, !tbaa !12
  %102 = sext i16 %101 to i32
  %103 = getelementptr inbounds %struct.LCD_RECT, ptr %8, i32 0, i32 2
  %104 = load i16, ptr %103, align 2, !tbaa !13
  %105 = sext i16 %104 to i32
  %106 = getelementptr inbounds %struct.LCD_RECT, ptr %8, i32 0, i32 3
  %107 = load i16, ptr %106, align 2, !tbaa !14
  %108 = sext i16 %107 to i32
  call void @GUI_FillRect(i32 noundef %99, i32 noundef %102, i32 noundef %105, i32 noundef %108)
  %109 = getelementptr inbounds %struct.LCD_RECT, ptr %8, i32 0, i32 2
  %110 = load i16, ptr %109, align 2, !tbaa !13
  %111 = sext i16 %110 to i32
  %112 = load i32, ptr %5, align 4, !tbaa !5
  %113 = icmp sge i32 %111, %112
  br i1 %113, label %114, label %119

114:                                              ; preds = %55
  %115 = load i32, ptr %5, align 4, !tbaa !5
  %116 = sub nsw i32 %115, 1
  %117 = trunc i32 %116 to i16
  %118 = getelementptr inbounds %struct.LCD_RECT, ptr %8, i32 0, i32 2
  store i16 %117, ptr %118, align 2, !tbaa !13
  br label %119

119:                                              ; preds = %114, %55
  %120 = getelementptr inbounds %struct.LCD_RECT, ptr %8, i32 0, i32 3
  %121 = load i16, ptr %120, align 2, !tbaa !14
  %122 = sext i16 %121 to i32
  %123 = load i32, ptr %6, align 4, !tbaa !5
  %124 = icmp sge i32 %122, %123
  br i1 %124, label %125, label %130

125:                                              ; preds = %119
  %126 = load i32, ptr %6, align 4, !tbaa !5
  %127 = sub nsw i32 %126, 1
  %128 = trunc i32 %127 to i16
  %129 = getelementptr inbounds %struct.LCD_RECT, ptr %8, i32 0, i32 3
  store i16 %128, ptr %129, align 2, !tbaa !14
  br label %130

130:                                              ; preds = %125, %119
  %131 = getelementptr inbounds %struct.LCD_RECT, ptr %8, i32 0, i32 0
  %132 = load i16, ptr %131, align 2, !tbaa !9
  %133 = sext i16 %132 to i32
  %134 = icmp slt i32 %133, 0
  br i1 %134, label %135, label %137

135:                                              ; preds = %130
  %136 = getelementptr inbounds %struct.LCD_RECT, ptr %8, i32 0, i32 0
  store i16 0, ptr %136, align 2, !tbaa !9
  br label %137

137:                                              ; preds = %135, %130
  %138 = getelementptr inbounds %struct.LCD_RECT, ptr %8, i32 0, i32 3
  %139 = load i16, ptr %138, align 2, !tbaa !14
  %140 = sext i16 %139 to i32
  %141 = icmp slt i32 %140, 0
  br i1 %141, label %142, label %144

142:                                              ; preds = %137
  %143 = getelementptr inbounds %struct.LCD_RECT, ptr %8, i32 0, i32 3
  store i16 0, ptr %143, align 2, !tbaa !14
  br label %144

144:                                              ; preds = %142, %137
  %145 = call i32 @GUI_Exec()
  br label %146

146:                                              ; preds = %144
  %147 = load i32, ptr %2, align 4, !tbaa !5
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %2, align 4, !tbaa !5
  br label %45, !llvm.loop !19

149:                                              ; preds = %53
  call void @GUIDEMO_NotifyStartNext()
  %150 = call i64 @_GetPixelsPerSecond()
  store i64 %150, ptr %3, align 8, !tbaa !15
  %151 = call ptr @GUI_SetClipRect(ptr noundef null)
  call void @GUIDEMO_DrawBk(i32 noundef 0)
  call void @GUI_SetColor(i64 noundef 16777215)
  %152 = call i32 @GUI_SetTextMode(i32 noundef 2)
  %153 = call ptr @GUI_SetFont(ptr noundef @GUI_FontRounded22)
  call void @GUI_DrawBitmap(ptr noundef @bmSTLogo70x35, i32 noundef 5, i32 noundef 5)
  %154 = getelementptr inbounds [40 x i8], ptr %10, i64 0, i64 0
  call void @GUIDEMO_AddStringToString(ptr noundef %154, ptr noundef @.str.2)
  %155 = getelementptr inbounds [40 x i8], ptr %10, i64 0, i64 0
  %156 = load i64, ptr %3, align 8, !tbaa !15
  %157 = trunc i64 %156 to i32
  call void @GUIDEMO_AddIntToString(ptr noundef %155, i32 noundef %157)
  %158 = getelementptr inbounds [40 x i8], ptr %10, i64 0, i64 0
  %159 = load i32, ptr %5, align 4, !tbaa !5
  %160 = ashr i32 %159, 1
  %161 = load i32, ptr %6, align 4, !tbaa !5
  %162 = call i32 @GUI_GetFontSizeY()
  %163 = sub nsw i32 %161, %162
  %164 = ashr i32 %163, 1
  call void @GUI_DispStringHCenterAt(ptr noundef %158, i32 noundef %160, i32 noundef %164)
  call void @GUIDEMO_Delay(i32 noundef 4000)
  call void @GUI_CURSOR_Show()
  call void @llvm.lifetime.end.p0(i64 40, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  ret void
}

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

declare i32 @LCD_GetXSize() #3

declare i32 @LCD_GetYSize() #3

declare i32 @LCD_GetVYSize() #3

declare void @GUI_CURSOR_Hide() #3

declare ptr @GUI_SetClipRect(ptr noundef) #3

declare void @GUIDEMO_ShowIntro(ptr noundef, ptr noundef) #3

declare i32 @GUI_Color2Index(i64 noundef) #3

declare i32 @GUIDEMO_GetTime() #3

declare i32 @GUIDEMO_CheckCancel() #3

declare void @GUI_SetColorIndex(i32 noundef) #3

; Function Attrs: nounwind
declare i32 @rand() #4

declare void @GUI_FillRect(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #3

declare i32 @GUI_Exec() #3

declare void @GUIDEMO_NotifyStartNext() #3

; Function Attrs: nounwind uwtable
declare hidden i64 @_GetPixelsPerSecond() #0

declare void @GUIDEMO_DrawBk(i32 noundef) #3

declare void @GUI_SetColor(i64 noundef) #3

declare i32 @GUI_SetTextMode(i32 noundef) #3

declare ptr @GUI_SetFont(ptr noundef) #3

declare void @GUI_DrawBitmap(ptr noundef, i32 noundef, i32 noundef) #3

declare void @GUIDEMO_AddStringToString(ptr noundef, ptr noundef) #3

declare void @GUIDEMO_AddIntToString(ptr noundef, i32 noundef) #3

declare void @GUI_DispStringHCenterAt(ptr noundef, i32 noundef, i32 noundef) #3

declare i32 @GUI_GetFontSizeY() #3

declare void @GUIDEMO_Delay(i32 noundef) #3

declare void @GUI_CURSOR_Show() #3

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

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


; 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.GUI_FONT = type { ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, i8, i8, %union.anon, i8, i8, i8 }
%union.anon = type { ptr }
%struct.GUI_BITMAP = type { i16, i16, i16, i16, ptr, ptr, ptr }
%struct.LCD_RECT = type { i16, i16, i16, i16 }

@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [46 x i8], align 1
@_aColor = external hidden local_unnamed_addr constant [8 x i64], align 16
@GUI_FontRounded22 = external constant %struct.GUI_FONT, align 8
@bmSTLogo70x35 = external constant %struct.GUI_BITMAP, align 8
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @GUIDEMO_Speed() local_unnamed_addr #0 {
  %1 = alloca [8 x i32], align 16
  %2 = alloca %struct.LCD_RECT, align 2
  %3 = alloca [40 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %3) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %3, i8 0, i64 40, i1 false)
  %4 = tail call i32 @LCD_GetXSize() #5
  %5 = tail call i32 @LCD_GetYSize() #5
  %6 = tail call i32 @LCD_GetVYSize() #5
  tail call void @GUI_CURSOR_Hide() #5
  %7 = icmp sgt i32 %6, %5
  br i1 %7, label %8, label %15

8:                                                ; preds = %0
  store i16 0, ptr %2, align 2, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %2, i64 2
  store i16 0, ptr %9, align 2, !tbaa !10
  %10 = trunc i32 %4 to i16
  %11 = getelementptr inbounds i8, ptr %2, i64 4
  store i16 %10, ptr %11, align 2, !tbaa !11
  %12 = trunc i32 %5 to i16
  %13 = getelementptr inbounds i8, ptr %2, i64 6
  store i16 %12, ptr %13, align 2, !tbaa !12
  %14 = call ptr @GUI_SetClipRect(ptr noundef nonnull %2) #5
  br label %15

15:                                               ; preds = %8, %0
  call void @GUIDEMO_ShowIntro(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1) #5
  %16 = load i64, ptr @_aColor, align 16, !tbaa !13
  %17 = call i32 @GUI_Color2Index(i64 noundef %16) #5
  store i32 %17, ptr %1, align 16, !tbaa !15
  %18 = load i64, ptr getelementptr inbounds (i8, ptr @_aColor, i64 8), align 8, !tbaa !13
  %19 = call i32 @GUI_Color2Index(i64 noundef %18) #5
  %20 = getelementptr inbounds i8, ptr %1, i64 4
  store i32 %19, ptr %20, align 4, !tbaa !15
  %21 = load i64, ptr getelementptr inbounds (i8, ptr @_aColor, i64 16), align 16, !tbaa !13
  %22 = call i32 @GUI_Color2Index(i64 noundef %21) #5
  %23 = getelementptr inbounds i8, ptr %1, i64 8
  store i32 %22, ptr %23, align 8, !tbaa !15
  %24 = load i64, ptr getelementptr inbounds (i8, ptr @_aColor, i64 24), align 8, !tbaa !13
  %25 = call i32 @GUI_Color2Index(i64 noundef %24) #5
  %26 = getelementptr inbounds i8, ptr %1, i64 12
  store i32 %25, ptr %26, align 4, !tbaa !15
  %27 = load i64, ptr getelementptr inbounds (i8, ptr @_aColor, i64 32), align 16, !tbaa !13
  %28 = call i32 @GUI_Color2Index(i64 noundef %27) #5
  %29 = getelementptr inbounds i8, ptr %1, i64 16
  store i32 %28, ptr %29, align 16, !tbaa !15
  %30 = load i64, ptr getelementptr inbounds (i8, ptr @_aColor, i64 40), align 8, !tbaa !13
  %31 = call i32 @GUI_Color2Index(i64 noundef %30) #5
  %32 = getelementptr inbounds i8, ptr %1, i64 20
  store i32 %31, ptr %32, align 4, !tbaa !15
  %33 = load i64, ptr getelementptr inbounds (i8, ptr @_aColor, i64 48), align 16, !tbaa !13
  %34 = call i32 @GUI_Color2Index(i64 noundef %33) #5
  %35 = getelementptr inbounds i8, ptr %1, i64 24
  store i32 %34, ptr %35, align 8, !tbaa !15
  %36 = load i64, ptr getelementptr inbounds (i8, ptr @_aColor, i64 56), align 8, !tbaa !13
  %37 = call i32 @GUI_Color2Index(i64 noundef %36) #5
  %38 = getelementptr inbounds i8, ptr %1, i64 28
  store i32 %37, ptr %38, align 4, !tbaa !15
  %39 = call i32 @GUIDEMO_GetTime() #5
  %40 = call i32 @GUIDEMO_GetTime() #5
  %41 = sub nsw i32 %40, %39
  %42 = icmp slt i32 %41, 5000
  br i1 %42, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %15
  %.neg = sdiv i32 %4, -2
  %.neg33 = sdiv i32 %5, -2
  br label %43

43:                                               ; preds = %.lr.ph, %46
  %.141 = phi i32 [ 0, %.lr.ph ], [ %70, %46 ]
  %44 = call i32 @GUIDEMO_CheckCancel() #5
  %45 = icmp eq i32 %44, 0
  br i1 %45, label %46, label %.critedge

46:                                               ; preds = %43
  %47 = and i32 %.141, 7
  %48 = zext nneg i32 %47 to i64
  %49 = getelementptr inbounds [8 x i32], ptr %1, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !15
  call void @GUI_SetColorIndex(i32 noundef %50) #5
  %51 = call i32 @rand() #5
  %52 = srem i32 %51, %4
  %53 = add i32 %52, %.neg
  %54 = call i32 @rand() #5
  %55 = srem i32 %54, %5
  %56 = add i32 %55, %.neg33
  %sext = shl i32 %53, 16
  %57 = ashr exact i32 %sext, 16
  %58 = add i32 %53, 20
  %59 = call i32 @rand() #5
  %60 = srem i32 %59, %4
  %61 = add i32 %58, %60
  %sext34 = shl i32 %56, 16
  %62 = ashr exact i32 %sext34, 16
  %63 = add i32 %56, 20
  %64 = call i32 @rand() #5
  %65 = srem i32 %64, %5
  %66 = add i32 %63, %65
  %sext35 = shl i32 %61, 16
  %67 = ashr exact i32 %sext35, 16
  %sext36 = shl i32 %66, 16
  %68 = ashr exact i32 %sext36, 16
  call void @GUI_FillRect(i32 noundef %57, i32 noundef %62, i32 noundef %67, i32 noundef %68) #5
  %69 = call i32 @GUI_Exec() #5
  %70 = add nuw nsw i32 %.141, 1
  %71 = call i32 @GUIDEMO_GetTime() #5
  %72 = sub nsw i32 %71, %39
  %73 = icmp slt i32 %72, 5000
  br i1 %73, label %43, label %.critedge, !llvm.loop !17

.critedge:                                        ; preds = %43, %46, %15
  call void @GUIDEMO_NotifyStartNext() #5
  %74 = call i64 @_GetPixelsPerSecond()
  %75 = call ptr @GUI_SetClipRect(ptr noundef null) #5
  call void @GUIDEMO_DrawBk(i32 noundef 0) #5
  call void @GUI_SetColor(i64 noundef 16777215) #5
  %76 = call i32 @GUI_SetTextMode(i32 noundef 2) #5
  %77 = call ptr @GUI_SetFont(ptr noundef nonnull @GUI_FontRounded22) #5
  call void @GUI_DrawBitmap(ptr noundef nonnull @bmSTLogo70x35, i32 noundef 5, i32 noundef 5) #5
  call void @GUIDEMO_AddStringToString(ptr noundef nonnull %3, ptr noundef nonnull @.str.2) #5
  %78 = trunc i64 %74 to i32
  call void @GUIDEMO_AddIntToString(ptr noundef nonnull %3, i32 noundef %78) #5
  %79 = ashr i32 %4, 1
  %80 = call i32 @GUI_GetFontSizeY() #5
  %81 = sub nsw i32 %5, %80
  %82 = ashr i32 %81, 1
  call void @GUI_DispStringHCenterAt(ptr noundef nonnull %3, i32 noundef %79, i32 noundef %82) #5
  call void @GUIDEMO_Delay(i32 noundef 4000) #5
  call void @GUI_CURSOR_Show() #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #5
  ret void
}

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

declare i32 @LCD_GetXSize() local_unnamed_addr #3

declare i32 @LCD_GetYSize() local_unnamed_addr #3

declare i32 @LCD_GetVYSize() local_unnamed_addr #3

declare void @GUI_CURSOR_Hide() local_unnamed_addr #3

declare ptr @GUI_SetClipRect(ptr noundef) local_unnamed_addr #3

declare void @GUIDEMO_ShowIntro(ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @GUI_Color2Index(i64 noundef) local_unnamed_addr #3

declare i32 @GUIDEMO_GetTime() local_unnamed_addr #3

declare i32 @GUIDEMO_CheckCancel() local_unnamed_addr #3

declare void @GUI_SetColorIndex(i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #4

declare void @GUI_FillRect(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

declare i32 @GUI_Exec() local_unnamed_addr #3

declare void @GUIDEMO_NotifyStartNext() local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden i64 @_GetPixelsPerSecond() local_unnamed_addr #0

declare void @GUIDEMO_DrawBk(i32 noundef) local_unnamed_addr #3

declare void @GUI_SetColor(i64 noundef) local_unnamed_addr #3

declare i32 @GUI_SetTextMode(i32 noundef) local_unnamed_addr #3

declare ptr @GUI_SetFont(ptr noundef) local_unnamed_addr #3

declare void @GUI_DrawBitmap(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

declare void @GUIDEMO_AddStringToString(ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @GUIDEMO_AddIntToString(ptr noundef, i32 noundef) local_unnamed_addr #3

declare void @GUI_DispStringHCenterAt(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

declare i32 @GUI_GetFontSizeY() local_unnamed_addr #3

declare void @GUIDEMO_Delay(i32 noundef) local_unnamed_addr #3

declare void @GUI_CURSOR_Show() local_unnamed_addr #3

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

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


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