; LLVM IR from tastangh/TI-RSLK-Texas-Instruments-Robotics-System-The-Maze-Edition :: tirslk_maze_1_00_00/Flash (Scoreboard)

; 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.ScoreboardElement = type { i8, i8, i8, i32 }

@RAMScoreboard = external hidden global [5 x %struct.ScoreboardElement], align 16
@scoreblock = external hidden global i32, align 4
@boardptr = external hidden global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local ptr @Scoreboard_Init(i32 noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #2
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %7

7:                                                ; preds = %27, %1
  %8 = load i32, ptr %5, align 4, !tbaa !5
  %9 = icmp slt i32 %8, 5
  br i1 %9, label %10, label %30

10:                                               ; preds = %7
  %11 = load i32, ptr %5, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds [5 x %struct.ScoreboardElement], ptr @RAMScoreboard, i64 0, i64 %12
  %14 = getelementptr inbounds %struct.ScoreboardElement, ptr %13, i32 0, i32 0
  store i8 32, ptr %14, align 8, !tbaa !9
  %15 = load i32, ptr %5, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [5 x %struct.ScoreboardElement], ptr @RAMScoreboard, i64 0, i64 %16
  %18 = getelementptr inbounds %struct.ScoreboardElement, ptr %17, i32 0, i32 1
  store i8 32, ptr %18, align 1, !tbaa !11
  %19 = load i32, ptr %5, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [5 x %struct.ScoreboardElement], ptr @RAMScoreboard, i64 0, i64 %20
  %22 = getelementptr inbounds %struct.ScoreboardElement, ptr %21, i32 0, i32 2
  store i8 32, ptr %22, align 2, !tbaa !12
  %23 = load i32, ptr %5, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [5 x %struct.ScoreboardElement], ptr @RAMScoreboard, i64 0, i64 %24
  %26 = getelementptr inbounds %struct.ScoreboardElement, ptr %25, i32 0, i32 3
  store i32 0, ptr %26, align 4, !tbaa !13
  br label %27

27:                                               ; preds = %10
  %28 = load i32, ptr %5, align 4, !tbaa !5
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %5, align 4, !tbaa !5
  br label %7, !llvm.loop !14

30:                                               ; preds = %7
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = call i32 @AddrValid(i32 noundef %31)
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %161

34:                                               ; preds = %30
  %35 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %35, ptr @scoreblock, align 4, !tbaa !5
  %36 = load i32, ptr @scoreblock, align 4, !tbaa !5
  %37 = zext i32 %36 to i64
  %38 = inttoptr i64 %37 to ptr
  store ptr %38, ptr @boardptr, align 8, !tbaa !16
  %39 = load ptr, ptr @boardptr, align 8, !tbaa !16
  %40 = load i32, ptr %39, align 4, !tbaa !5
  store i32 %40, ptr %3, align 4, !tbaa !5
  %41 = load ptr, ptr @boardptr, align 8, !tbaa !16
  %42 = getelementptr inbounds i32, ptr %41, i64 1
  %43 = load i32, ptr %42, align 4, !tbaa !5
  store i32 %43, ptr %4, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %152, %34
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = and i32 %45, 255
  %47 = icmp eq i32 %46, 0
  br i1 %47, label %48, label %55

48:                                               ; preds = %44
  %49 = load ptr, ptr @boardptr, align 8, !tbaa !16
  %50 = load i32, ptr @scoreblock, align 4, !tbaa !5
  %51 = add i32 %50, 1016
  %52 = zext i32 %51 to i64
  %53 = inttoptr i64 %52 to ptr
  %54 = icmp ule ptr %49, %53
  br label %55

55:                                               ; preds = %48, %44
  %56 = phi i1 [ false, %44 ], [ %54, %48 ]
  br i1 %56, label %57, label %160

57:                                               ; preds = %55
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %149, %57
  %59 = load i32, ptr %5, align 4, !tbaa !5
  %60 = icmp slt i32 %59, 5
  br i1 %60, label %61, label %152

61:                                               ; preds = %58
  %62 = load i32, ptr %4, align 4, !tbaa !5
  %63 = load i32, ptr %5, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [5 x %struct.ScoreboardElement], ptr @RAMScoreboard, i64 0, i64 %64
  %66 = getelementptr inbounds %struct.ScoreboardElement, ptr %65, i32 0, i32 3
  %67 = load i32, ptr %66, align 4, !tbaa !13
  %68 = icmp ugt i32 %62, %67
  br i1 %68, label %69, label %148

69:                                               ; preds = %61
  store i32 4, ptr %6, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %115, %69
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = load i32, ptr %5, align 4, !tbaa !5
  %73 = icmp sgt i32 %71, %72
  br i1 %73, label %74, label %118

74:                                               ; preds = %70
  %75 = load i32, ptr %6, align 4, !tbaa !5
  %76 = sub nsw i32 %75, 1
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [5 x %struct.ScoreboardElement], ptr @RAMScoreboard, i64 0, i64 %77
  %79 = getelementptr inbounds %struct.ScoreboardElement, ptr %78, i32 0, i32 0
  %80 = load i8, ptr %79, align 8, !tbaa !9
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [5 x %struct.ScoreboardElement], ptr @RAMScoreboard, i64 0, i64 %82
  %84 = getelementptr inbounds %struct.ScoreboardElement, ptr %83, i32 0, i32 0
  store i8 %80, ptr %84, align 8, !tbaa !9
  %85 = load i32, ptr %6, align 4, !tbaa !5
  %86 = sub nsw i32 %85, 1
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [5 x %struct.ScoreboardElement], ptr @RAMScoreboard, i64 0, i64 %87
  %89 = getelementptr inbounds %struct.ScoreboardElement, ptr %88, i32 0, i32 1
  %90 = load i8, ptr %89, align 1, !tbaa !11
  %91 = load i32, ptr %6, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [5 x %struct.ScoreboardElement], ptr @RAMScoreboard, i64 0, i64 %92
  %94 = getelementptr inbounds %struct.ScoreboardElement, ptr %93, i32 0, i32 1
  store i8 %90, ptr %94, align 1, !tbaa !11
  %95 = load i32, ptr %6, align 4, !tbaa !5
  %96 = sub nsw i32 %95, 1
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [5 x %struct.ScoreboardElement], ptr @RAMScoreboard, i64 0, i64 %97
  %99 = getelementptr inbounds %struct.ScoreboardElement, ptr %98, i32 0, i32 2
  %100 = load i8, ptr %99, align 2, !tbaa !12
  %101 = load i32, ptr %6, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [5 x %struct.ScoreboardElement], ptr @RAMScoreboard, i64 0, i64 %102
  %104 = getelementptr inbounds %struct.ScoreboardElement, ptr %103, i32 0, i32 2
  store i8 %100, ptr %104, align 2, !tbaa !12
  %105 = load i32, ptr %6, align 4, !tbaa !5
  %106 = sub nsw i32 %105, 1
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [5 x %struct.ScoreboardElement], ptr @RAMScoreboard, i64 0, i64 %107
  %109 = getelementptr inbounds %struct.ScoreboardElement, ptr %108, i32 0, i32 3
  %110 = load i32, ptr %109, align 4, !tbaa !13
  %111 = load i32, ptr %6, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [5 x %struct.ScoreboardElement], ptr @RAMScoreboard, i64 0, i64 %112
  %114 = getelementptr inbounds %struct.ScoreboardElement, ptr %113, i32 0, i32 3
  store i32 %110, ptr %114, align 4, !tbaa !13
  br label %115

115:                                              ; preds = %74
  %116 = load i32, ptr %6, align 4, !tbaa !5
  %117 = sub nsw i32 %116, 1
  store i32 %117, ptr %6, align 4, !tbaa !5
  br label %70, !llvm.loop !18

118:                                              ; preds = %70
  %119 = load i32, ptr %3, align 4, !tbaa !5
  %120 = and i32 %119, -16777216
  %121 = lshr i32 %120, 24
  %122 = trunc i32 %121 to i8
  %123 = load i32, ptr %5, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [5 x %struct.ScoreboardElement], ptr @RAMScoreboard, i64 0, i64 %124
  %126 = getelementptr inbounds %struct.ScoreboardElement, ptr %125, i32 0, i32 0
  store i8 %122, ptr %126, align 8, !tbaa !9
  %127 = load i32, ptr %3, align 4, !tbaa !5
  %128 = and i32 %127, 16711680
  %129 = lshr i32 %128, 16
  %130 = trunc i32 %129 to i8
  %131 = load i32, ptr %5, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [5 x %struct.ScoreboardElement], ptr @RAMScoreboard, i64 0, i64 %132
  %134 = getelementptr inbounds %struct.ScoreboardElement, ptr %133, i32 0, i32 1
  store i8 %130, ptr %134, align 1, !tbaa !11
  %135 = load i32, ptr %3, align 4, !tbaa !5
  %136 = and i32 %135, 65280
  %137 = lshr i32 %136, 8
  %138 = trunc i32 %137 to i8
  %139 = load i32, ptr %5, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [5 x %struct.ScoreboardElement], ptr @RAMScoreboard, i64 0, i64 %140
  %142 = getelementptr inbounds %struct.ScoreboardElement, ptr %141, i32 0, i32 2
  store i8 %138, ptr %142, align 2, !tbaa !12
  %143 = load i32, ptr %4, align 4, !tbaa !5
  %144 = load i32, ptr %5, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [5 x %struct.ScoreboardElement], ptr @RAMScoreboard, i64 0, i64 %145
  %147 = getelementptr inbounds %struct.ScoreboardElement, ptr %146, i32 0, i32 3
  store i32 %143, ptr %147, align 4, !tbaa !13
  br label %152

148:                                              ; preds = %61
  br label %149

149:                                              ; preds = %148
  %150 = load i32, ptr %5, align 4, !tbaa !5
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %5, align 4, !tbaa !5
  br label %58, !llvm.loop !19

152:                                              ; preds = %118, %58
  %153 = load ptr, ptr @boardptr, align 8, !tbaa !16
  %154 = getelementptr inbounds i32, ptr %153, i64 2
  store ptr %154, ptr @boardptr, align 8, !tbaa !16
  %155 = load ptr, ptr @boardptr, align 8, !tbaa !16
  %156 = load i32, ptr %155, align 4, !tbaa !5
  store i32 %156, ptr %3, align 4, !tbaa !5
  %157 = load ptr, ptr @boardptr, align 8, !tbaa !16
  %158 = getelementptr inbounds i32, ptr %157, i64 1
  %159 = load i32, ptr %158, align 4, !tbaa !5
  store i32 %159, ptr %4, align 4, !tbaa !5
  br label %44, !llvm.loop !20

160:                                              ; preds = %55
  br label %161

161:                                              ; preds = %160, %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #2
  ret ptr @RAMScoreboard
}

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

; Function Attrs: nounwind uwtable
declare hidden i32 @AddrValid(i32 noundef) #0

; 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 = { 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, !7, i64 0}
!10 = !{!"ScoreboardElement", !7, i64 0, !7, i64 1, !7, i64 2, !6, i64 4}
!11 = !{!10, !7, i64 1}
!12 = !{!10, !7, i64 2}
!13 = !{!10, !6, i64 4}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !17, i64 0}
!17 = !{!"any pointer", !7, i64 0}
!18 = distinct !{!18, !15}
!19 = distinct !{!19, !15}
!20 = distinct !{!20, !15}


; 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.ScoreboardElement = type { i8, i8, i8, i32 }

@RAMScoreboard = external hidden global [5 x %struct.ScoreboardElement], align 16
@scoreblock = external hidden local_unnamed_addr global i32, align 4
@boardptr = external hidden local_unnamed_addr global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local noundef nonnull ptr @Scoreboard_Init(i32 noundef %0) local_unnamed_addr #0 {
  store i8 32, ptr @RAMScoreboard, align 16, !tbaa !5
  store i8 32, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 1), align 1, !tbaa !10
  store i8 32, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 2), align 2, !tbaa !11
  store i32 0, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 4), align 4, !tbaa !12
  store i8 32, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 8), align 8, !tbaa !5
  store i8 32, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 9), align 1, !tbaa !10
  store i8 32, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 10), align 2, !tbaa !11
  store i32 0, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 12), align 4, !tbaa !12
  store i8 32, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 16), align 16, !tbaa !5
  store i8 32, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 17), align 1, !tbaa !10
  store i8 32, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 18), align 2, !tbaa !11
  store i32 0, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 20), align 4, !tbaa !12
  store i8 32, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 24), align 8, !tbaa !5
  store i8 32, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 25), align 1, !tbaa !10
  store i8 32, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 26), align 2, !tbaa !11
  store i32 0, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 28), align 4, !tbaa !12
  store i8 32, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 32), align 16, !tbaa !5
  store i8 32, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 33), align 1, !tbaa !10
  store i8 32, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 34), align 2, !tbaa !11
  store i32 0, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 36), align 4, !tbaa !12
  %2 = tail call i32 @AddrValid(i32 noundef %0)
  %.not = icmp eq i32 %2, 0
  br i1 %.not, label %.loopexit36, label %3

3:                                                ; preds = %1
  store i32 %0, ptr @scoreblock, align 4, !tbaa !13
  %4 = zext i32 %0 to i64
  %5 = inttoptr i64 %4 to ptr
  store ptr %5, ptr @boardptr, align 8, !tbaa !14
  %6 = add i32 %0, 1016
  %7 = zext i32 %6 to i64
  %8 = inttoptr i64 %7 to ptr
  %.03444 = load i32, ptr %5, align 4, !tbaa !13
  %9 = and i32 %.03444, 255
  %10 = icmp eq i32 %9, 0
  %11 = icmp ule ptr %5, %8
  %12 = and i1 %10, %11
  br i1 %12, label %.preheader35.preheader, label %.loopexit36

.preheader35.preheader:                           ; preds = %3
  %13 = getelementptr inbounds i8, ptr %5, i64 4
  %.pre53 = load i32, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 4), align 4, !tbaa !12
  br label %.preheader35

.preheader35:                                     ; preds = %.preheader35.preheader, %.loopexit
  %14 = phi i32 [ %57, %.loopexit ], [ %.pre53, %.preheader35.preheader ]
  %.03446 = phi i32 [ %.034, %.loopexit ], [ %.03444, %.preheader35.preheader ]
  %.03345.in = phi ptr [ %59, %.loopexit ], [ %13, %.preheader35.preheader ]
  %15 = phi ptr [ %58, %.loopexit ], [ %5, %.preheader35.preheader ]
  %.03345 = load i32, ptr %.03345.in, align 4, !tbaa !13
  %16 = icmp ugt i32 %.03345, %14
  br i1 %16, label %.lr.ph.preheader, label %45

.lr.ph.preheader:                                 ; preds = %.preheader35, %45, %48, %51
  %17 = phi i1 [ false, %51 ], [ true, %48 ], [ true, %45 ], [ true, %.preheader35 ]
  %18 = phi i1 [ false, %51 ], [ false, %48 ], [ true, %45 ], [ true, %.preheader35 ]
  %.lcssa.ph = phi ptr [ getelementptr inbounds (i8, ptr @RAMScoreboard, i64 24), %51 ], [ getelementptr inbounds (i8, ptr @RAMScoreboard, i64 16), %48 ], [ getelementptr inbounds (i8, ptr @RAMScoreboard, i64 8), %45 ], [ @RAMScoreboard, %.preheader35 ]
  %19 = getelementptr inbounds i8, ptr %.lcssa.ph, i64 4
  %20 = load i8, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 24), align 8, !tbaa !5
  store i8 %20, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 32), align 16, !tbaa !5
  %21 = load i8, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 25), align 1, !tbaa !10
  store i8 %21, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 33), align 1, !tbaa !10
  %22 = load i8, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 26), align 2, !tbaa !11
  store i8 %22, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 34), align 2, !tbaa !11
  %23 = load i32, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 28), align 4, !tbaa !12
  store i32 %23, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 36), align 4, !tbaa !12
  br i1 %17, label %.lr.ph.1, label %._crit_edge, !llvm.loop !16

.lr.ph.1:                                         ; preds = %.lr.ph.preheader
  %24 = load i8, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 16), align 16, !tbaa !5
  store i8 %24, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 24), align 8, !tbaa !5
  %25 = load i8, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 17), align 1, !tbaa !10
  store i8 %25, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 25), align 1, !tbaa !10
  %26 = load i8, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 18), align 2, !tbaa !11
  store i8 %26, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 26), align 2, !tbaa !11
  %27 = load i32, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 20), align 4, !tbaa !12
  store i32 %27, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 28), align 4, !tbaa !12
  br i1 %18, label %.lr.ph.2, label %._crit_edge, !llvm.loop !16

.lr.ph.2:                                         ; preds = %.lr.ph.1
  %28 = load i8, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 8), align 8, !tbaa !5
  store i8 %28, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 16), align 16, !tbaa !5
  %29 = load i8, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 9), align 1, !tbaa !10
  store i8 %29, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 17), align 1, !tbaa !10
  %30 = load i8, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 10), align 2, !tbaa !11
  store i8 %30, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 18), align 2, !tbaa !11
  %31 = load i32, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 12), align 4, !tbaa !12
  store i32 %31, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 20), align 4, !tbaa !12
  br i1 %16, label %.lr.ph.3, label %._crit_edge, !llvm.loop !16

.lr.ph.3:                                         ; preds = %.lr.ph.2
  %32 = load i8, ptr @RAMScoreboard, align 16, !tbaa !5
  store i8 %32, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 8), align 8, !tbaa !5
  %33 = load i8, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 1), align 1, !tbaa !10
  store i8 %33, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 9), align 1, !tbaa !10
  %34 = load i8, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 2), align 2, !tbaa !11
  store i8 %34, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 10), align 2, !tbaa !11
  %35 = load i32, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 4), align 4, !tbaa !12
  store i32 %35, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 12), align 4, !tbaa !12
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.preheader, %.lr.ph.1, %.lr.ph.2, %.lr.ph.3, %54
  %36 = phi ptr [ getelementptr inbounds (i8, ptr @RAMScoreboard, i64 36), %54 ], [ %19, %.lr.ph.3 ], [ %19, %.lr.ph.2 ], [ %19, %.lr.ph.1 ], [ %19, %.lr.ph.preheader ]
  %.lcssa57 = phi ptr [ getelementptr inbounds (i8, ptr @RAMScoreboard, i64 32), %54 ], [ %.lcssa.ph, %.lr.ph.3 ], [ %.lcssa.ph, %.lr.ph.2 ], [ %.lcssa.ph, %.lr.ph.1 ], [ %.lcssa.ph, %.lr.ph.preheader ]
  %37 = lshr i32 %.03446, 24
  %38 = trunc nuw i32 %37 to i8
  store i8 %38, ptr %.lcssa57, align 8, !tbaa !5
  %39 = lshr i32 %.03446, 16
  %40 = trunc i32 %39 to i8
  %41 = getelementptr inbounds i8, ptr %.lcssa57, i64 1
  store i8 %40, ptr %41, align 1, !tbaa !10
  %42 = lshr exact i32 %.03446, 8
  %43 = trunc i32 %42 to i8
  %44 = getelementptr inbounds i8, ptr %.lcssa57, i64 2
  store i8 %43, ptr %44, align 2, !tbaa !11
  store i32 %.03345, ptr %36, align 4, !tbaa !12
  %.pre = load i32, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 4), align 4, !tbaa !12
  br label %.loopexit

45:                                               ; preds = %.preheader35
  %46 = load i32, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 12), align 4, !tbaa !12
  %47 = icmp ugt i32 %.03345, %46
  br i1 %47, label %.lr.ph.preheader, label %48

48:                                               ; preds = %45
  %49 = load i32, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 20), align 4, !tbaa !12
  %50 = icmp ugt i32 %.03345, %49
  br i1 %50, label %.lr.ph.preheader, label %51

51:                                               ; preds = %48
  %52 = load i32, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 28), align 4, !tbaa !12
  %53 = icmp ugt i32 %.03345, %52
  br i1 %53, label %.lr.ph.preheader, label %54

54:                                               ; preds = %51
  %55 = load i32, ptr getelementptr inbounds (i8, ptr @RAMScoreboard, i64 36), align 4, !tbaa !12
  %56 = icmp ugt i32 %.03345, %55
  br i1 %56, label %._crit_edge, label %.loopexit

.loopexit:                                        ; preds = %54, %._crit_edge
  %57 = phi i32 [ %.pre, %._crit_edge ], [ %14, %54 ]
  %58 = getelementptr inbounds i8, ptr %15, i64 8
  %59 = getelementptr inbounds i8, ptr %15, i64 12
  %.034 = load i32, ptr %58, align 4, !tbaa !13
  %60 = and i32 %.034, 255
  %61 = icmp eq i32 %60, 0
  %62 = icmp ule ptr %58, %8
  %63 = and i1 %61, %62
  br i1 %63, label %.preheader35, label %..loopexit36_crit_edge, !llvm.loop !18

..loopexit36_crit_edge:                           ; preds = %.loopexit
  store ptr %58, ptr @boardptr, align 8, !tbaa !14
  br label %.loopexit36

.loopexit36:                                      ; preds = %3, %..loopexit36_crit_edge, %1
  ret ptr @RAMScoreboard
}

; Function Attrs: nounwind uwtable
declare hidden i32 @AddrValid(i32 noundef) local_unnamed_addr #0

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

!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 = !{!"ScoreboardElement", !7, i64 0, !7, i64 1, !7, i64 2, !9, i64 4}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = !{!6, !7, i64 1}
!11 = !{!6, !7, i64 2}
!12 = !{!6, !9, i64 4}
!13 = !{!9, !9, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}


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