; LLVM IR from BrunoLevy/learn-fpga :: LiteX/software/Doom/mc1-doom/src (wi_stuff)

; 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.patch_t = type { i16, i16, i16, i16, [8 x i32] }

@num = external hidden global [10 x ptr], align 16
@playeringame = external global [4 x i32], align 16
@dm_frags = external hidden global [4 x [4 x i32]], align 16
@dm_totals = external hidden global [4 x i32], align 16
@total = external hidden global ptr, align 8
@killers = external hidden global ptr, align 8
@victims = external hidden global ptr, align 8
@p = external hidden global [4 x ptr], align 16
@me = external hidden global i32, align 4
@bstar = external hidden global ptr, align 8
@star = external hidden global ptr, align 8

; Function Attrs: nounwind uwtable
declare dso_local void @WI_slamBackground() #0

; Function Attrs: nounwind uwtable
declare dso_local void @WI_drawLF() #0

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

declare void @V_DrawPatch(i32 noundef, i32 noundef, i32 noundef, ptr noundef) #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @WI_drawAnimatedBack() #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @WI_drawNum(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
define dso_local void @WI_drawDeathmatchStats() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  call void @WI_slamBackground()
  call void @WI_drawAnimatedBack()
  call void @WI_drawLF()
  %6 = load ptr, ptr @total, align 8, !tbaa !5
  %7 = getelementptr inbounds %struct.patch_t, ptr %6, i32 0, i32 0
  %8 = load i16, ptr %7, align 4, !tbaa !9
  %9 = sext i16 %8 to i32
  %10 = sdiv i32 %9, 2
  %11 = sub nsw i32 269, %10
  %12 = load ptr, ptr @total, align 8, !tbaa !5
  call void @V_DrawPatch(i32 noundef %11, i32 noundef 45, i32 noundef 0, ptr noundef %12)
  %13 = load ptr, ptr @killers, align 8, !tbaa !5
  call void @V_DrawPatch(i32 noundef 10, i32 noundef 100, i32 noundef 0, ptr noundef %13)
  %14 = load ptr, ptr @victims, align 8, !tbaa !5
  call void @V_DrawPatch(i32 noundef 5, i32 noundef 50, i32 noundef 0, ptr noundef %14)
  store i32 82, ptr %3, align 4, !tbaa !12
  store i32 68, ptr %4, align 4, !tbaa !12
  store i32 0, ptr %1, align 4, !tbaa !12
  br label %15

15:                                               ; preds = %86, %0
  %16 = load i32, ptr %1, align 4, !tbaa !12
  %17 = icmp slt i32 %16, 4
  br i1 %17, label %18, label %89

18:                                               ; preds = %15
  %19 = load i32, ptr %1, align 4, !tbaa !12
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [4 x i32], ptr @playeringame, i64 0, i64 %20
  %22 = load i32, ptr %21, align 4, !tbaa !12
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %24, label %80

24:                                               ; preds = %18
  %25 = load i32, ptr %3, align 4, !tbaa !12
  %26 = load i32, ptr %1, align 4, !tbaa !12
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [4 x ptr], ptr @p, i64 0, i64 %27
  %29 = load ptr, ptr %28, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.patch_t, ptr %29, i32 0, i32 0
  %31 = load i16, ptr %30, align 4, !tbaa !9
  %32 = sext i16 %31 to i32
  %33 = sdiv i32 %32, 2
  %34 = sub nsw i32 %25, %33
  %35 = load i32, ptr %1, align 4, !tbaa !12
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [4 x ptr], ptr @p, i64 0, i64 %36
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  call void @V_DrawPatch(i32 noundef %34, i32 noundef 35, i32 noundef 0, ptr noundef %38)
  %39 = load i32, ptr %1, align 4, !tbaa !12
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [4 x ptr], ptr @p, i64 0, i64 %40
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.patch_t, ptr %42, i32 0, i32 0
  %44 = load i16, ptr %43, align 4, !tbaa !9
  %45 = sext i16 %44 to i32
  %46 = sdiv i32 %45, 2
  %47 = sub nsw i32 42, %46
  %48 = load i32, ptr %4, align 4, !tbaa !12
  %49 = load i32, ptr %1, align 4, !tbaa !12
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [4 x ptr], ptr @p, i64 0, i64 %50
  %52 = load ptr, ptr %51, align 8, !tbaa !5
  call void @V_DrawPatch(i32 noundef %47, i32 noundef %48, i32 noundef 0, ptr noundef %52)
  %53 = load i32, ptr %1, align 4, !tbaa !12
  %54 = load i32, ptr @me, align 4, !tbaa !12
  %55 = icmp eq i32 %53, %54
  br i1 %55, label %56, label %79

56:                                               ; preds = %24
  %57 = load i32, ptr %3, align 4, !tbaa !12
  %58 = load i32, ptr %1, align 4, !tbaa !12
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [4 x ptr], ptr @p, i64 0, i64 %59
  %61 = load ptr, ptr %60, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.patch_t, ptr %61, i32 0, i32 0
  %63 = load i16, ptr %62, align 4, !tbaa !9
  %64 = sext i16 %63 to i32
  %65 = sdiv i32 %64, 2
  %66 = sub nsw i32 %57, %65
  %67 = load ptr, ptr @bstar, align 8, !tbaa !5
  call void @V_DrawPatch(i32 noundef %66, i32 noundef 35, i32 noundef 0, ptr noundef %67)
  %68 = load i32, ptr %1, align 4, !tbaa !12
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [4 x ptr], ptr @p, i64 0, i64 %69
  %71 = load ptr, ptr %70, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.patch_t, ptr %71, i32 0, i32 0
  %73 = load i16, ptr %72, align 4, !tbaa !9
  %74 = sext i16 %73 to i32
  %75 = sdiv i32 %74, 2
  %76 = sub nsw i32 42, %75
  %77 = load i32, ptr %4, align 4, !tbaa !12
  %78 = load ptr, ptr @star, align 8, !tbaa !5
  call void @V_DrawPatch(i32 noundef %76, i32 noundef %77, i32 noundef 0, ptr noundef %78)
  br label %79

79:                                               ; preds = %56, %24
  br label %81

80:                                               ; preds = %18
  br label %81

81:                                               ; preds = %80, %79
  %82 = load i32, ptr %3, align 4, !tbaa !12
  %83 = add nsw i32 %82, 40
  store i32 %83, ptr %3, align 4, !tbaa !12
  %84 = load i32, ptr %4, align 4, !tbaa !12
  %85 = add nsw i32 %84, 33
  store i32 %85, ptr %4, align 4, !tbaa !12
  br label %86

86:                                               ; preds = %81
  %87 = load i32, ptr %1, align 4, !tbaa !12
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %1, align 4, !tbaa !12
  br label %15, !llvm.loop !14

89:                                               ; preds = %15
  store i32 78, ptr %4, align 4, !tbaa !12
  %90 = load ptr, ptr @num, align 16, !tbaa !5
  %91 = getelementptr inbounds %struct.patch_t, ptr %90, i32 0, i32 0
  %92 = load i16, ptr %91, align 4, !tbaa !9
  %93 = sext i16 %92 to i32
  store i32 %93, ptr %5, align 4, !tbaa !12
  store i32 0, ptr %1, align 4, !tbaa !12
  br label %94

94:                                               ; preds = %144, %89
  %95 = load i32, ptr %1, align 4, !tbaa !12
  %96 = icmp slt i32 %95, 4
  br i1 %96, label %97, label %147

97:                                               ; preds = %94
  store i32 82, ptr %3, align 4, !tbaa !12
  %98 = load i32, ptr %1, align 4, !tbaa !12
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [4 x i32], ptr @playeringame, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !12
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %103, label %141

103:                                              ; preds = %97
  store i32 0, ptr %2, align 4, !tbaa !12
  br label %104

104:                                              ; preds = %129, %103
  %105 = load i32, ptr %2, align 4, !tbaa !12
  %106 = icmp slt i32 %105, 4
  br i1 %106, label %107, label %132

107:                                              ; preds = %104
  %108 = load i32, ptr %2, align 4, !tbaa !12
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [4 x i32], ptr @playeringame, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !12
  %112 = icmp ne i32 %111, 0
  br i1 %112, label %113, label %126

113:                                              ; preds = %107
  %114 = load i32, ptr %3, align 4, !tbaa !12
  %115 = load i32, ptr %5, align 4, !tbaa !12
  %116 = add nsw i32 %114, %115
  %117 = load i32, ptr %4, align 4, !tbaa !12
  %118 = load i32, ptr %1, align 4, !tbaa !12
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [4 x [4 x i32]], ptr @dm_frags, i64 0, i64 %119
  %121 = load i32, ptr %2, align 4, !tbaa !12
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [4 x i32], ptr %120, i64 0, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !12
  %125 = call i32 @WI_drawNum(i32 noundef %116, i32 noundef %117, i32 noundef %124, i32 noundef 2)
  br label %126

126:                                              ; preds = %113, %107
  %127 = load i32, ptr %3, align 4, !tbaa !12
  %128 = add nsw i32 %127, 40
  store i32 %128, ptr %3, align 4, !tbaa !12
  br label %129

129:                                              ; preds = %126
  %130 = load i32, ptr %2, align 4, !tbaa !12
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %2, align 4, !tbaa !12
  br label %104, !llvm.loop !16

132:                                              ; preds = %104
  %133 = load i32, ptr %5, align 4, !tbaa !12
  %134 = add nsw i32 269, %133
  %135 = load i32, ptr %4, align 4, !tbaa !12
  %136 = load i32, ptr %1, align 4, !tbaa !12
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [4 x i32], ptr @dm_totals, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !12
  %140 = call i32 @WI_drawNum(i32 noundef %134, i32 noundef %135, i32 noundef %139, i32 noundef 2)
  br label %141

141:                                              ; preds = %132, %97
  %142 = load i32, ptr %4, align 4, !tbaa !12
  %143 = add nsw i32 %142, 33
  store i32 %143, ptr %4, align 4, !tbaa !12
  br label %144

144:                                              ; preds = %141
  %145 = load i32, ptr %1, align 4, !tbaa !12
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %1, align 4, !tbaa !12
  br label %94, !llvm.loop !17

147:                                              ; preds = %94
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #3
  ret void
}

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 = { "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 = { 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, !11, i64 0}
!10 = !{!"", !11, i64 0, !11, i64 2, !11, i64 4, !11, i64 6, !7, i64 8}
!11 = !{!"short", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !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"

@num = external hidden local_unnamed_addr global [10 x ptr], align 16
@playeringame = external local_unnamed_addr global [4 x i32], align 16
@dm_frags = external hidden local_unnamed_addr global [4 x [4 x i32]], align 16
@dm_totals = external hidden local_unnamed_addr global [4 x i32], align 16
@total = external hidden local_unnamed_addr global ptr, align 8
@killers = external hidden local_unnamed_addr global ptr, align 8
@victims = external hidden local_unnamed_addr global ptr, align 8
@p = external hidden local_unnamed_addr global [4 x ptr], align 16
@me = external hidden local_unnamed_addr global i32, align 4
@bstar = external hidden local_unnamed_addr global ptr, align 8
@star = external hidden local_unnamed_addr global ptr, align 8

; Function Attrs: nounwind uwtable
declare dso_local void @WI_slamBackground() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @WI_drawLF() local_unnamed_addr #0

declare void @V_DrawPatch(i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @WI_drawAnimatedBack() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @WI_drawNum(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @WI_drawDeathmatchStats() local_unnamed_addr #0 {
  tail call void @WI_slamBackground()
  tail call void @WI_drawAnimatedBack()
  tail call void @WI_drawLF()
  %1 = load ptr, ptr @total, align 8, !tbaa !5
  %2 = load i16, ptr %1, align 4, !tbaa !9
  %.neg = sdiv i16 %2, -2
  %narrow = add nsw i16 %.neg, 269
  %3 = sext i16 %narrow to i32
  tail call void @V_DrawPatch(i32 noundef %3, i32 noundef 45, i32 noundef 0, ptr noundef nonnull %1) #2
  %4 = load ptr, ptr @killers, align 8, !tbaa !5
  tail call void @V_DrawPatch(i32 noundef 10, i32 noundef 100, i32 noundef 0, ptr noundef %4) #2
  %5 = load ptr, ptr @victims, align 8, !tbaa !5
  tail call void @V_DrawPatch(i32 noundef 5, i32 noundef 50, i32 noundef 0, ptr noundef %5) #2
  %6 = load i32, ptr @playeringame, align 16, !tbaa !12
  %.not38 = icmp eq i32 %6, 0
  br i1 %.not38, label %25, label %7

7:                                                ; preds = %0
  %8 = load ptr, ptr @p, align 16, !tbaa !5
  %9 = load i16, ptr %8, align 4, !tbaa !9
  %.neg60 = sdiv i16 %9, -2
  %narrow59 = add nsw i16 %.neg60, 82
  %10 = sext i16 %narrow59 to i32
  tail call void @V_DrawPatch(i32 noundef %10, i32 noundef 35, i32 noundef 0, ptr noundef nonnull %8) #2
  %11 = load ptr, ptr @p, align 16, !tbaa !5
  %12 = load i16, ptr %11, align 4, !tbaa !9
  %.neg40 = sdiv i16 %12, -2
  %narrow39 = add nsw i16 %.neg40, 42
  %13 = sext i16 %narrow39 to i32
  tail call void @V_DrawPatch(i32 noundef %13, i32 noundef 68, i32 noundef 0, ptr noundef nonnull %11) #2
  %14 = load i32, ptr @me, align 4, !tbaa !12
  %15 = icmp eq i32 %14, 0
  br i1 %15, label %16, label %25

16:                                               ; preds = %7
  %17 = load ptr, ptr @p, align 16, !tbaa !5
  %18 = load i16, ptr %17, align 4, !tbaa !9
  %.neg62 = sdiv i16 %18, -2
  %narrow61 = add nsw i16 %.neg62, 82
  %19 = sext i16 %narrow61 to i32
  %20 = load ptr, ptr @bstar, align 8, !tbaa !5
  tail call void @V_DrawPatch(i32 noundef %19, i32 noundef 35, i32 noundef 0, ptr noundef %20) #2
  %21 = load ptr, ptr @p, align 16, !tbaa !5
  %22 = load i16, ptr %21, align 4, !tbaa !9
  %.neg42 = sdiv i16 %22, -2
  %narrow41 = add nsw i16 %.neg42, 42
  %23 = sext i16 %narrow41 to i32
  %24 = load ptr, ptr @star, align 8, !tbaa !5
  tail call void @V_DrawPatch(i32 noundef %23, i32 noundef 68, i32 noundef 0, ptr noundef %24) #2
  br label %25

25:                                               ; preds = %0, %7, %16
  %26 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 4), align 4, !tbaa !12
  %.not38.1 = icmp eq i32 %26, 0
  br i1 %.not38.1, label %45, label %27

27:                                               ; preds = %25
  %28 = load ptr, ptr getelementptr inbounds (i8, ptr @p, i64 8), align 8, !tbaa !5
  %29 = load i16, ptr %28, align 4, !tbaa !9
  %.neg64 = sdiv i16 %29, -2
  %narrow63 = add nsw i16 %.neg64, 122
  %30 = sext i16 %narrow63 to i32
  tail call void @V_DrawPatch(i32 noundef %30, i32 noundef 35, i32 noundef 0, ptr noundef nonnull %28) #2
  %31 = load ptr, ptr getelementptr inbounds (i8, ptr @p, i64 8), align 8, !tbaa !5
  %32 = load i16, ptr %31, align 4, !tbaa !9
  %.neg40.1 = sdiv i16 %32, -2
  %narrow39.1 = add nsw i16 %.neg40.1, 42
  %33 = sext i16 %narrow39.1 to i32
  tail call void @V_DrawPatch(i32 noundef %33, i32 noundef 101, i32 noundef 0, ptr noundef nonnull %31) #2
  %34 = load i32, ptr @me, align 4, !tbaa !12
  %35 = icmp eq i32 %34, 1
  br i1 %35, label %36, label %45

36:                                               ; preds = %27
  %37 = load ptr, ptr getelementptr inbounds (i8, ptr @p, i64 8), align 8, !tbaa !5
  %38 = load i16, ptr %37, align 4, !tbaa !9
  %.neg66 = sdiv i16 %38, -2
  %narrow65 = add nsw i16 %.neg66, 122
  %39 = sext i16 %narrow65 to i32
  %40 = load ptr, ptr @bstar, align 8, !tbaa !5
  tail call void @V_DrawPatch(i32 noundef %39, i32 noundef 35, i32 noundef 0, ptr noundef %40) #2
  %41 = load ptr, ptr getelementptr inbounds (i8, ptr @p, i64 8), align 8, !tbaa !5
  %42 = load i16, ptr %41, align 4, !tbaa !9
  %.neg42.1 = sdiv i16 %42, -2
  %narrow41.1 = add nsw i16 %.neg42.1, 42
  %43 = sext i16 %narrow41.1 to i32
  %44 = load ptr, ptr @star, align 8, !tbaa !5
  tail call void @V_DrawPatch(i32 noundef %43, i32 noundef 101, i32 noundef 0, ptr noundef %44) #2
  br label %45

45:                                               ; preds = %36, %27, %25
  %46 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 8), align 8, !tbaa !12
  %.not38.2 = icmp eq i32 %46, 0
  br i1 %.not38.2, label %65, label %47

47:                                               ; preds = %45
  %48 = load ptr, ptr getelementptr inbounds (i8, ptr @p, i64 16), align 16, !tbaa !5
  %49 = load i16, ptr %48, align 4, !tbaa !9
  %.neg68 = sdiv i16 %49, -2
  %narrow67 = add nsw i16 %.neg68, 162
  %50 = sext i16 %narrow67 to i32
  tail call void @V_DrawPatch(i32 noundef %50, i32 noundef 35, i32 noundef 0, ptr noundef nonnull %48) #2
  %51 = load ptr, ptr getelementptr inbounds (i8, ptr @p, i64 16), align 16, !tbaa !5
  %52 = load i16, ptr %51, align 4, !tbaa !9
  %.neg40.2 = sdiv i16 %52, -2
  %narrow39.2 = add nsw i16 %.neg40.2, 42
  %53 = sext i16 %narrow39.2 to i32
  tail call void @V_DrawPatch(i32 noundef %53, i32 noundef 134, i32 noundef 0, ptr noundef nonnull %51) #2
  %54 = load i32, ptr @me, align 4, !tbaa !12
  %55 = icmp eq i32 %54, 2
  br i1 %55, label %56, label %65

56:                                               ; preds = %47
  %57 = load ptr, ptr getelementptr inbounds (i8, ptr @p, i64 16), align 16, !tbaa !5
  %58 = load i16, ptr %57, align 4, !tbaa !9
  %.neg70 = sdiv i16 %58, -2
  %narrow69 = add nsw i16 %.neg70, 162
  %59 = sext i16 %narrow69 to i32
  %60 = load ptr, ptr @bstar, align 8, !tbaa !5
  tail call void @V_DrawPatch(i32 noundef %59, i32 noundef 35, i32 noundef 0, ptr noundef %60) #2
  %61 = load ptr, ptr getelementptr inbounds (i8, ptr @p, i64 16), align 16, !tbaa !5
  %62 = load i16, ptr %61, align 4, !tbaa !9
  %.neg42.2 = sdiv i16 %62, -2
  %narrow41.2 = add nsw i16 %.neg42.2, 42
  %63 = sext i16 %narrow41.2 to i32
  %64 = load ptr, ptr @star, align 8, !tbaa !5
  tail call void @V_DrawPatch(i32 noundef %63, i32 noundef 134, i32 noundef 0, ptr noundef %64) #2
  br label %65

65:                                               ; preds = %56, %47, %45
  %66 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 12), align 4, !tbaa !12
  %.not38.3 = icmp eq i32 %66, 0
  br i1 %.not38.3, label %85, label %67

67:                                               ; preds = %65
  %68 = load ptr, ptr getelementptr inbounds (i8, ptr @p, i64 24), align 8, !tbaa !5
  %69 = load i16, ptr %68, align 4, !tbaa !9
  %.neg72 = sdiv i16 %69, -2
  %narrow71 = add nsw i16 %.neg72, 202
  %70 = sext i16 %narrow71 to i32
  tail call void @V_DrawPatch(i32 noundef %70, i32 noundef 35, i32 noundef 0, ptr noundef nonnull %68) #2
  %71 = load ptr, ptr getelementptr inbounds (i8, ptr @p, i64 24), align 8, !tbaa !5
  %72 = load i16, ptr %71, align 4, !tbaa !9
  %.neg40.3 = sdiv i16 %72, -2
  %narrow39.3 = add nsw i16 %.neg40.3, 42
  %73 = sext i16 %narrow39.3 to i32
  tail call void @V_DrawPatch(i32 noundef %73, i32 noundef 167, i32 noundef 0, ptr noundef nonnull %71) #2
  %74 = load i32, ptr @me, align 4, !tbaa !12
  %75 = icmp eq i32 %74, 3
  br i1 %75, label %76, label %85

76:                                               ; preds = %67
  %77 = load ptr, ptr getelementptr inbounds (i8, ptr @p, i64 24), align 8, !tbaa !5
  %78 = load i16, ptr %77, align 4, !tbaa !9
  %.neg74 = sdiv i16 %78, -2
  %narrow73 = add nsw i16 %.neg74, 202
  %79 = sext i16 %narrow73 to i32
  %80 = load ptr, ptr @bstar, align 8, !tbaa !5
  tail call void @V_DrawPatch(i32 noundef %79, i32 noundef 35, i32 noundef 0, ptr noundef %80) #2
  %81 = load ptr, ptr getelementptr inbounds (i8, ptr @p, i64 24), align 8, !tbaa !5
  %82 = load i16, ptr %81, align 4, !tbaa !9
  %.neg42.3 = sdiv i16 %82, -2
  %narrow41.3 = add nsw i16 %.neg42.3, 42
  %83 = sext i16 %narrow41.3 to i32
  %84 = load ptr, ptr @star, align 8, !tbaa !5
  tail call void @V_DrawPatch(i32 noundef %83, i32 noundef 167, i32 noundef 0, ptr noundef %84) #2
  br label %85

85:                                               ; preds = %76, %67, %65
  %86 = load ptr, ptr @num, align 16, !tbaa !5
  %87 = load i16, ptr %86, align 4, !tbaa !9
  %88 = sext i16 %87 to i32
  %89 = add nsw i32 %88, 269
  %90 = load i32, ptr @playeringame, align 16, !tbaa !12
  %.not = icmp eq i32 %90, 0
  br i1 %.not, label %112, label %.preheader.1

.preheader.1:                                     ; preds = %85
  %91 = add nsw i32 %88, 82
  %92 = load i32, ptr @dm_frags, align 16, !tbaa !12
  %93 = tail call i32 @WI_drawNum(i32 noundef %91, i32 noundef 78, i32 noundef %92, i32 noundef 2)
  %94 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 4), align 4, !tbaa !12
  %.not37.1 = icmp eq i32 %94, 0
  br i1 %.not37.1, label %.preheader.2, label %95

95:                                               ; preds = %.preheader.1
  %96 = add nsw i32 %88, 122
  %97 = load i32, ptr getelementptr inbounds (i8, ptr @dm_frags, i64 4), align 4, !tbaa !12
  %98 = tail call i32 @WI_drawNum(i32 noundef %96, i32 noundef 78, i32 noundef %97, i32 noundef 2)
  br label %.preheader.2

.preheader.2:                                     ; preds = %95, %.preheader.1
  %99 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 8), align 8, !tbaa !12
  %.not37.2 = icmp eq i32 %99, 0
  br i1 %.not37.2, label %.preheader.3, label %100

100:                                              ; preds = %.preheader.2
  %101 = add nsw i32 %88, 162
  %102 = load i32, ptr getelementptr inbounds (i8, ptr @dm_frags, i64 8), align 8, !tbaa !12
  %103 = tail call i32 @WI_drawNum(i32 noundef %101, i32 noundef 78, i32 noundef %102, i32 noundef 2)
  br label %.preheader.3

.preheader.3:                                     ; preds = %100, %.preheader.2
  %104 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 12), align 4, !tbaa !12
  %.not37.3 = icmp eq i32 %104, 0
  br i1 %.not37.3, label %109, label %105

105:                                              ; preds = %.preheader.3
  %106 = add nsw i32 %88, 202
  %107 = load i32, ptr getelementptr inbounds (i8, ptr @dm_frags, i64 12), align 4, !tbaa !12
  %108 = tail call i32 @WI_drawNum(i32 noundef %106, i32 noundef 78, i32 noundef %107, i32 noundef 2)
  br label %109

109:                                              ; preds = %105, %.preheader.3
  %110 = load i32, ptr @dm_totals, align 16, !tbaa !12
  %111 = tail call i32 @WI_drawNum(i32 noundef %89, i32 noundef 78, i32 noundef %110, i32 noundef 2)
  br label %112

112:                                              ; preds = %109, %85
  %113 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 4), align 4, !tbaa !12
  %.not.1 = icmp eq i32 %113, 0
  br i1 %.not.1, label %135, label %.preheader.preheader.1

.preheader.preheader.1:                           ; preds = %112
  %114 = load i32, ptr @playeringame, align 16, !tbaa !12
  %.not37.153 = icmp eq i32 %114, 0
  br i1 %.not37.153, label %.preheader.1.1.thread, label %.preheader.1.1

.preheader.1.1:                                   ; preds = %.preheader.preheader.1
  %115 = add nsw i32 %88, 82
  %116 = load i32, ptr getelementptr inbounds (i8, ptr @dm_frags, i64 16), align 16, !tbaa !12
  %117 = tail call i32 @WI_drawNum(i32 noundef %115, i32 noundef 111, i32 noundef %116, i32 noundef 2)
  %.pre = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 4), align 4, !tbaa !12
  %118 = icmp eq i32 %.pre, 0
  br i1 %118, label %.preheader.2.1, label %.preheader.1.1.thread

.preheader.1.1.thread:                            ; preds = %.preheader.preheader.1, %.preheader.1.1
  %119 = add nsw i32 %88, 122
  %120 = load i32, ptr getelementptr inbounds (i8, ptr @dm_frags, i64 20), align 4, !tbaa !12
  %121 = tail call i32 @WI_drawNum(i32 noundef %119, i32 noundef 111, i32 noundef %120, i32 noundef 2)
  br label %.preheader.2.1

.preheader.2.1:                                   ; preds = %.preheader.1.1.thread, %.preheader.1.1
  %122 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 8), align 8, !tbaa !12
  %.not37.2.1 = icmp eq i32 %122, 0
  br i1 %.not37.2.1, label %.preheader.3.1, label %123

123:                                              ; preds = %.preheader.2.1
  %124 = add nsw i32 %88, 162
  %125 = load i32, ptr getelementptr inbounds (i8, ptr @dm_frags, i64 24), align 8, !tbaa !12
  %126 = tail call i32 @WI_drawNum(i32 noundef %124, i32 noundef 111, i32 noundef %125, i32 noundef 2)
  br label %.preheader.3.1

.preheader.3.1:                                   ; preds = %123, %.preheader.2.1
  %127 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 12), align 4, !tbaa !12
  %.not37.3.1 = icmp eq i32 %127, 0
  br i1 %.not37.3.1, label %132, label %128

128:                                              ; preds = %.preheader.3.1
  %129 = add nsw i32 %88, 202
  %130 = load i32, ptr getelementptr inbounds (i8, ptr @dm_frags, i64 28), align 4, !tbaa !12
  %131 = tail call i32 @WI_drawNum(i32 noundef %129, i32 noundef 111, i32 noundef %130, i32 noundef 2)
  br label %132

132:                                              ; preds = %128, %.preheader.3.1
  %133 = load i32, ptr getelementptr inbounds (i8, ptr @dm_totals, i64 4), align 4, !tbaa !12
  %134 = tail call i32 @WI_drawNum(i32 noundef %89, i32 noundef 111, i32 noundef %133, i32 noundef 2)
  br label %135

135:                                              ; preds = %132, %112
  %136 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 8), align 8, !tbaa !12
  %.not.2 = icmp eq i32 %136, 0
  br i1 %.not.2, label %160, label %.preheader.preheader.2

.preheader.preheader.2:                           ; preds = %135
  %137 = load i32, ptr @playeringame, align 16, !tbaa !12
  %.not37.255 = icmp eq i32 %137, 0
  br i1 %.not37.255, label %.preheader.1.2, label %138

138:                                              ; preds = %.preheader.preheader.2
  %139 = add nsw i32 %88, 82
  %140 = load i32, ptr getelementptr inbounds (i8, ptr @dm_frags, i64 32), align 16, !tbaa !12
  %141 = tail call i32 @WI_drawNum(i32 noundef %139, i32 noundef 144, i32 noundef %140, i32 noundef 2)
  br label %.preheader.1.2

.preheader.1.2:                                   ; preds = %138, %.preheader.preheader.2
  %142 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 4), align 4, !tbaa !12
  %.not37.1.2 = icmp eq i32 %142, 0
  br i1 %.not37.1.2, label %.preheader.2.2, label %143

143:                                              ; preds = %.preheader.1.2
  %144 = add nsw i32 %88, 122
  %145 = load i32, ptr getelementptr inbounds (i8, ptr @dm_frags, i64 36), align 4, !tbaa !12
  %146 = tail call i32 @WI_drawNum(i32 noundef %144, i32 noundef 144, i32 noundef %145, i32 noundef 2)
  br label %.preheader.2.2

.preheader.2.2:                                   ; preds = %143, %.preheader.1.2
  %147 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 8), align 8, !tbaa !12
  %.not37.2.2 = icmp eq i32 %147, 0
  br i1 %.not37.2.2, label %.preheader.3.2, label %148

148:                                              ; preds = %.preheader.2.2
  %149 = add nsw i32 %88, 162
  %150 = load i32, ptr getelementptr inbounds (i8, ptr @dm_frags, i64 40), align 8, !tbaa !12
  %151 = tail call i32 @WI_drawNum(i32 noundef %149, i32 noundef 144, i32 noundef %150, i32 noundef 2)
  br label %.preheader.3.2

.preheader.3.2:                                   ; preds = %148, %.preheader.2.2
  %152 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 12), align 4, !tbaa !12
  %.not37.3.2 = icmp eq i32 %152, 0
  br i1 %.not37.3.2, label %157, label %153

153:                                              ; preds = %.preheader.3.2
  %154 = add nsw i32 %88, 202
  %155 = load i32, ptr getelementptr inbounds (i8, ptr @dm_frags, i64 44), align 4, !tbaa !12
  %156 = tail call i32 @WI_drawNum(i32 noundef %154, i32 noundef 144, i32 noundef %155, i32 noundef 2)
  br label %157

157:                                              ; preds = %153, %.preheader.3.2
  %158 = load i32, ptr getelementptr inbounds (i8, ptr @dm_totals, i64 8), align 8, !tbaa !12
  %159 = tail call i32 @WI_drawNum(i32 noundef %89, i32 noundef 144, i32 noundef %158, i32 noundef 2)
  br label %160

160:                                              ; preds = %157, %135
  %161 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 12), align 4, !tbaa !12
  %.not.3 = icmp eq i32 %161, 0
  br i1 %.not.3, label %185, label %.preheader.preheader.3

.preheader.preheader.3:                           ; preds = %160
  %162 = load i32, ptr @playeringame, align 16, !tbaa !12
  %.not37.357 = icmp eq i32 %162, 0
  br i1 %.not37.357, label %.preheader.1.3, label %163

163:                                              ; preds = %.preheader.preheader.3
  %164 = add nsw i32 %88, 82
  %165 = load i32, ptr getelementptr inbounds (i8, ptr @dm_frags, i64 48), align 16, !tbaa !12
  %166 = tail call i32 @WI_drawNum(i32 noundef %164, i32 noundef 177, i32 noundef %165, i32 noundef 2)
  br label %.preheader.1.3

.preheader.1.3:                                   ; preds = %163, %.preheader.preheader.3
  %167 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 4), align 4, !tbaa !12
  %.not37.1.3 = icmp eq i32 %167, 0
  br i1 %.not37.1.3, label %.preheader.2.3, label %168

168:                                              ; preds = %.preheader.1.3
  %169 = add nsw i32 %88, 122
  %170 = load i32, ptr getelementptr inbounds (i8, ptr @dm_frags, i64 52), align 4, !tbaa !12
  %171 = tail call i32 @WI_drawNum(i32 noundef %169, i32 noundef 177, i32 noundef %170, i32 noundef 2)
  br label %.preheader.2.3

.preheader.2.3:                                   ; preds = %168, %.preheader.1.3
  %172 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 8), align 8, !tbaa !12
  %.not37.2.3 = icmp eq i32 %172, 0
  br i1 %.not37.2.3, label %.preheader.3.3, label %173

173:                                              ; preds = %.preheader.2.3
  %174 = add nsw i32 %88, 162
  %175 = load i32, ptr getelementptr inbounds (i8, ptr @dm_frags, i64 56), align 8, !tbaa !12
  %176 = tail call i32 @WI_drawNum(i32 noundef %174, i32 noundef 177, i32 noundef %175, i32 noundef 2)
  br label %.preheader.3.3

.preheader.3.3:                                   ; preds = %173, %.preheader.2.3
  %177 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 12), align 4, !tbaa !12
  %.not37.3.3 = icmp eq i32 %177, 0
  br i1 %.not37.3.3, label %182, label %178

178:                                              ; preds = %.preheader.3.3
  %179 = add nsw i32 %88, 202
  %180 = load i32, ptr getelementptr inbounds (i8, ptr @dm_frags, i64 60), align 4, !tbaa !12
  %181 = tail call i32 @WI_drawNum(i32 noundef %179, i32 noundef 177, i32 noundef %180, i32 noundef 2)
  br label %182

182:                                              ; preds = %178, %.preheader.3.3
  %183 = load i32, ptr getelementptr inbounds (i8, ptr @dm_totals, i64 12), align 4, !tbaa !12
  %184 = tail call i32 @WI_drawNum(i32 noundef %89, i32 noundef 177, i32 noundef %183, i32 noundef 2)
  br label %185

185:                                              ; preds = %182, %160
  ret void
}

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 = { "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 = { 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, !11, i64 0}
!10 = !{!"", !11, i64 0, !11, i64 2, !11, i64 4, !11, i64 6, !7, i64 8}
!11 = !{!"short", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}


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