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

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

@sttminus = external dso_local global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @STlib_drawNum(ptr noundef %0, i32 noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.st_number_t, ptr %16, i32 0, i32 2
  %18 = load i32, ptr %17, align 8, !tbaa !11
  store i32 %18, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.st_number_t, ptr %19, i32 0, i32 4
  %21 = load ptr, ptr %20, align 8, !tbaa !13
  %22 = load i32, ptr %21, align 4, !tbaa !9
  store i32 %22, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.st_number_t, ptr %23, i32 0, i32 6
  %25 = load ptr, ptr %24, align 8, !tbaa !14
  %26 = getelementptr inbounds ptr, ptr %25, i64 0
  %27 = load ptr, ptr %26, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.patch_t, ptr %27, i32 0, i32 0
  %29 = load i16, ptr %28, align 4, !tbaa !15
  %30 = sext i16 %29 to i32
  store i32 %30, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.st_number_t, ptr %31, i32 0, i32 6
  %33 = load ptr, ptr %32, align 8, !tbaa !14
  %34 = getelementptr inbounds ptr, ptr %33, i64 0
  %35 = load ptr, ptr %34, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.patch_t, ptr %35, i32 0, i32 1
  %37 = load i16, ptr %36, align 2, !tbaa !18
  %38 = sext i16 %37 to i32
  store i32 %38, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %39 = load i32, ptr %4, align 4, !tbaa !9
  %40 = load ptr, ptr %3, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.st_number_t, ptr %40, i32 0, i32 4
  %42 = load ptr, ptr %41, align 8, !tbaa !13
  %43 = load i32, ptr %42, align 4, !tbaa !9
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.st_number_t, ptr %44, i32 0, i32 3
  store i32 %43, ptr %45, align 4, !tbaa !19
  %46 = load i32, ptr %6, align 4, !tbaa !9
  %47 = icmp slt i32 %46, 0
  %48 = zext i1 %47 to i32
  store i32 %48, ptr %10, align 4, !tbaa !9
  %49 = load i32, ptr %10, align 4, !tbaa !9
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %51, label %69

51:                                               ; preds = %2
  %52 = load i32, ptr %5, align 4, !tbaa !9
  %53 = icmp eq i32 %52, 2
  br i1 %53, label %54, label %58

54:                                               ; preds = %51
  %55 = load i32, ptr %6, align 4, !tbaa !9
  %56 = icmp slt i32 %55, -9
  br i1 %56, label %57, label %58

57:                                               ; preds = %54
  store i32 -9, ptr %6, align 4, !tbaa !9
  br label %66

58:                                               ; preds = %54, %51
  %59 = load i32, ptr %5, align 4, !tbaa !9
  %60 = icmp eq i32 %59, 3
  br i1 %60, label %61, label %65

61:                                               ; preds = %58
  %62 = load i32, ptr %6, align 4, !tbaa !9
  %63 = icmp slt i32 %62, -99
  br i1 %63, label %64, label %65

64:                                               ; preds = %61
  store i32 -99, ptr %6, align 4, !tbaa !9
  br label %65

65:                                               ; preds = %64, %61, %58
  br label %66

66:                                               ; preds = %65, %57
  %67 = load i32, ptr %6, align 4, !tbaa !9
  %68 = sub nsw i32 0, %67
  store i32 %68, ptr %6, align 4, !tbaa !9
  br label %69

69:                                               ; preds = %66, %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.st_number_t, ptr %70, i32 0, i32 0
  %72 = load i32, ptr %71, align 8, !tbaa !20
  %73 = load i32, ptr %5, align 4, !tbaa !9
  %74 = load i32, ptr %7, align 4, !tbaa !9
  %75 = mul nsw i32 %73, %74
  %76 = sub nsw i32 %72, %75
  store i32 %76, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.st_number_t, ptr %77, i32 0, i32 1
  %79 = load i32, ptr %78, align 4, !tbaa !21
  %80 = sub nsw i32 %79, 168
  store i32 %80, ptr %12, align 4, !tbaa !9
  %81 = load i32, ptr %12, align 4, !tbaa !9
  %82 = icmp slt i32 %81, 0
  br i1 %82, label %83, label %84

83:                                               ; preds = %69
  call void (ptr, ...) @I_Error(ptr noundef @.str.1) #5
  unreachable

84:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %85 = load i32, ptr %11, align 4, !tbaa !9
  %86 = add nsw i32 %85, 0
  store i32 %86, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.st_number_t, ptr %87, i32 0, i32 1
  %89 = load i32, ptr %88, align 4, !tbaa !21
  %90 = sub nsw i32 %89, 200
  %91 = add nsw i32 %90, 200
  store i32 %91, ptr %14, align 4, !tbaa !9
  %92 = load i32, ptr %11, align 4, !tbaa !9
  %93 = load i32, ptr %12, align 4, !tbaa !9
  %94 = load i32, ptr %7, align 4, !tbaa !9
  %95 = load i32, ptr %5, align 4, !tbaa !9
  %96 = mul nsw i32 %94, %95
  %97 = load i32, ptr %8, align 4, !tbaa !9
  %98 = load i32, ptr %13, align 4, !tbaa !9
  %99 = load i32, ptr %14, align 4, !tbaa !9
  call void @V_CopyRect(i32 noundef %92, i32 noundef %93, i32 noundef 4, i32 noundef %96, i32 noundef %97, i32 noundef %98, i32 noundef %99, i32 noundef 0)
  %100 = load i32, ptr %6, align 4, !tbaa !9
  %101 = icmp eq i32 %100, 1994
  br i1 %101, label %102, label %103

102:                                              ; preds = %84
  store i32 1, ptr %15, align 4
  br label %177

103:                                              ; preds = %84
  %104 = load i32, ptr %6, align 4, !tbaa !9
  %105 = icmp ne i32 %104, 0
  br i1 %105, label %125, label %106

106:                                              ; preds = %103
  %107 = load ptr, ptr %3, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.st_number_t, ptr %107, i32 0, i32 0
  %109 = load i32, ptr %108, align 8, !tbaa !20
  %110 = load i32, ptr %7, align 4, !tbaa !9
  %111 = sub nsw i32 %109, %110
  %112 = add nsw i32 %111, 0
  store i32 %112, ptr %13, align 4, !tbaa !9
  %113 = load ptr, ptr %3, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.st_number_t, ptr %113, i32 0, i32 1
  %115 = load i32, ptr %114, align 4, !tbaa !21
  %116 = sub nsw i32 %115, 200
  %117 = add nsw i32 %116, 200
  store i32 %117, ptr %14, align 4, !tbaa !9
  %118 = load i32, ptr %13, align 4, !tbaa !9
  %119 = load i32, ptr %14, align 4, !tbaa !9
  %120 = load ptr, ptr %3, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.st_number_t, ptr %120, i32 0, i32 6
  %122 = load ptr, ptr %121, align 8, !tbaa !14
  %123 = getelementptr inbounds ptr, ptr %122, i64 0
  %124 = load ptr, ptr %123, align 8, !tbaa !5
  call void @V_DrawPatch(i32 noundef %118, i32 noundef %119, i32 noundef 0, ptr noundef %124)
  br label %125

125:                                              ; preds = %106, %103
  %126 = load ptr, ptr %3, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.st_number_t, ptr %126, i32 0, i32 0
  %128 = load i32, ptr %127, align 8, !tbaa !20
  store i32 %128, ptr %9, align 4, !tbaa !9
  br label %129

129:                                              ; preds = %138, %125
  %130 = load i32, ptr %6, align 4, !tbaa !9
  %131 = icmp ne i32 %130, 0
  br i1 %131, label %132, label %136

132:                                              ; preds = %129
  %133 = load i32, ptr %5, align 4, !tbaa !9
  %134 = add nsw i32 %133, -1
  store i32 %134, ptr %5, align 4, !tbaa !9
  %135 = icmp ne i32 %133, 0
  br label %136

136:                                              ; preds = %132, %129
  %137 = phi i1 [ false, %129 ], [ %135, %132 ]
  br i1 %137, label %138, label %161

138:                                              ; preds = %136
  %139 = load i32, ptr %7, align 4, !tbaa !9
  %140 = load i32, ptr %9, align 4, !tbaa !9
  %141 = sub nsw i32 %140, %139
  store i32 %141, ptr %9, align 4, !tbaa !9
  %142 = load i32, ptr %9, align 4, !tbaa !9
  %143 = add nsw i32 %142, 0
  store i32 %143, ptr %13, align 4, !tbaa !9
  %144 = load ptr, ptr %3, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.st_number_t, ptr %144, i32 0, i32 1
  %146 = load i32, ptr %145, align 4, !tbaa !21
  %147 = sub nsw i32 %146, 200
  %148 = add nsw i32 %147, 200
  store i32 %148, ptr %14, align 4, !tbaa !9
  %149 = load i32, ptr %13, align 4, !tbaa !9
  %150 = load i32, ptr %14, align 4, !tbaa !9
  %151 = load ptr, ptr %3, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.st_number_t, ptr %151, i32 0, i32 6
  %153 = load ptr, ptr %152, align 8, !tbaa !14
  %154 = load i32, ptr %6, align 4, !tbaa !9
  %155 = srem i32 %154, 10
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds ptr, ptr %153, i64 %156
  %158 = load ptr, ptr %157, align 8, !tbaa !5
  call void @V_DrawPatch(i32 noundef %149, i32 noundef %150, i32 noundef 0, ptr noundef %158)
  %159 = load i32, ptr %6, align 4, !tbaa !9
  %160 = sdiv i32 %159, 10
  store i32 %160, ptr %6, align 4, !tbaa !9
  br label %129, !llvm.loop !22

161:                                              ; preds = %136
  %162 = load i32, ptr %10, align 4, !tbaa !9
  %163 = icmp ne i32 %162, 0
  br i1 %163, label %164, label %176

164:                                              ; preds = %161
  %165 = load i32, ptr %9, align 4, !tbaa !9
  %166 = sub nsw i32 %165, 8
  %167 = add nsw i32 %166, 0
  store i32 %167, ptr %13, align 4, !tbaa !9
  %168 = load ptr, ptr %3, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.st_number_t, ptr %168, i32 0, i32 1
  %170 = load i32, ptr %169, align 4, !tbaa !21
  %171 = sub nsw i32 %170, 200
  %172 = add nsw i32 %171, 200
  store i32 %172, ptr %14, align 4, !tbaa !9
  %173 = load i32, ptr %13, align 4, !tbaa !9
  %174 = load i32, ptr %14, align 4, !tbaa !9
  %175 = load ptr, ptr @sttminus, align 8, !tbaa !5
  call void @V_DrawPatch(i32 noundef %173, i32 noundef %174, i32 noundef 0, ptr noundef %175)
  br label %176

176:                                              ; preds = %164, %161
  store i32 0, ptr %15, align 4
  br label %177

177:                                              ; preds = %176, %102
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  %178 = load i32, ptr %15, align 4
  switch i32 %178, label %180 [
    i32 0, label %179
    i32 1, label %179
  ]

179:                                              ; preds = %177, %177
  ret void

180:                                              ; preds = %177
  unreachable
}

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

; Function Attrs: noreturn
declare void @I_Error(ptr noundef, ...) #2

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

declare void @V_DrawPatch(i32 noundef, i32 noundef, i32 noundef, ptr noundef) #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 = { noreturn "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 = { "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 }
attributes #5 = { noreturn }

!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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 8}
!12 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !6, i64 16, !6, i64 24, !6, i64 32, !10, i64 40}
!13 = !{!12, !6, i64 16}
!14 = !{!12, !6, i64 32}
!15 = !{!16, !17, i64 0}
!16 = !{!"", !17, i64 0, !17, i64 2, !17, i64 4, !17, i64 6, !7, i64 8}
!17 = !{!"short", !7, i64 0}
!18 = !{!16, !17, i64 2}
!19 = !{!12, !10, i64 12}
!20 = !{!12, !10, i64 0}
!21 = !{!12, !10, i64 4}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}


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

@sttminus = external dso_local local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @STlib_drawNum(ptr nocapture noundef %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %0, i64 8
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 16
  %6 = load ptr, ptr %5, align 8, !tbaa !11
  %7 = load i32, ptr %6, align 4, !tbaa !12
  %8 = getelementptr inbounds i8, ptr %0, i64 32
  %9 = load ptr, ptr %8, align 8, !tbaa !13
  %10 = load ptr, ptr %9, align 8, !tbaa !14
  %11 = load i16, ptr %10, align 4, !tbaa !15
  %12 = sext i16 %11 to i32
  %13 = getelementptr inbounds i8, ptr %10, i64 2
  %14 = load i16, ptr %13, align 2, !tbaa !18
  %15 = sext i16 %14 to i32
  %16 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 %7, ptr %16, align 4, !tbaa !19
  %17 = icmp slt i32 %7, 0
  br i1 %17, label %18, label %26

18:                                               ; preds = %2
  %19 = icmp eq i32 %4, 2
  %20 = icmp ult i32 %7, -9
  %or.cond = and i1 %19, %20
  br i1 %or.cond, label %24, label %21

21:                                               ; preds = %18
  %22 = icmp eq i32 %4, 3
  %23 = tail call i32 @llvm.umax.i32(i32 %7, i32 -99)
  %spec.store.select = select i1 %22, i32 %23, i32 %7
  br label %24

24:                                               ; preds = %18, %21
  %.055 = phi i32 [ %spec.store.select, %21 ], [ -9, %18 ]
  %25 = sub nsw i32 0, %.055
  br label %26

26:                                               ; preds = %24, %2
  %.1 = phi i32 [ %25, %24 ], [ %7, %2 ]
  %27 = getelementptr inbounds i8, ptr %0, i64 4
  %28 = load i32, ptr %27, align 4, !tbaa !20
  %29 = icmp slt i32 %28, 168
  br i1 %29, label %30, label %31

30:                                               ; preds = %26
  tail call void (ptr, ...) @I_Error(ptr noundef nonnull @.str.1) #4
  unreachable

31:                                               ; preds = %26
  %32 = add nsw i32 %28, -168
  %33 = load i32, ptr %0, align 8, !tbaa !21
  %34 = mul nsw i32 %4, %12
  %35 = sub nsw i32 %33, %34
  tail call void @V_CopyRect(i32 noundef %35, i32 noundef %32, i32 noundef 4, i32 noundef %34, i32 noundef %15, i32 noundef %35, i32 noundef %28, i32 noundef 0) #5
  switch i32 %.1, label %42 [
    i32 1994, label %57
    i32 0, label %.thread
  ]

.thread:                                          ; preds = %31
  %36 = load i32, ptr %0, align 8, !tbaa !21
  %37 = sub nsw i32 %36, %12
  %38 = load i32, ptr %27, align 4, !tbaa !20
  %39 = load ptr, ptr %8, align 8, !tbaa !13
  %40 = load ptr, ptr %39, align 8, !tbaa !14
  tail call void @V_DrawPatch(i32 noundef %37, i32 noundef %38, i32 noundef 0, ptr noundef %40) #5
  %41 = load i32, ptr %0, align 8, !tbaa !21
  br label %.critedge

42:                                               ; preds = %31
  %43 = load i32, ptr %0, align 8, !tbaa !21
  %.not6164 = icmp eq i32 %4, 0
  br i1 %.not6164, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %42, %.lr.ph
  %.068 = phi i32 [ %44, %.lr.ph ], [ %4, %42 ]
  %.267 = phi i32 [ %52, %.lr.ph ], [ %.1, %42 ]
  %.05666 = phi i32 [ %45, %.lr.ph ], [ %43, %42 ]
  %44 = add nsw i32 %.068, -1
  %45 = sub nsw i32 %.05666, %12
  %46 = load i32, ptr %27, align 4, !tbaa !20
  %47 = load ptr, ptr %8, align 8, !tbaa !13
  %48 = urem i32 %.267, 10
  %49 = zext nneg i32 %48 to i64
  %50 = getelementptr inbounds ptr, ptr %47, i64 %49
  %51 = load ptr, ptr %50, align 8, !tbaa !14
  tail call void @V_DrawPatch(i32 noundef %45, i32 noundef %46, i32 noundef 0, ptr noundef %51) #5
  %52 = udiv i32 %.267, 10
  %.not60 = icmp ult i32 %.267, 10
  %.not61 = icmp eq i32 %44, 0
  %or.cond62 = select i1 %.not60, i1 true, i1 %.not61
  br i1 %or.cond62, label %.critedge, label %.lr.ph, !llvm.loop !22

.critedge:                                        ; preds = %.lr.ph, %.thread, %42
  %.056.lcssa = phi i32 [ %43, %42 ], [ %41, %.thread ], [ %45, %.lr.ph ]
  br i1 %17, label %53, label %57

53:                                               ; preds = %.critedge
  %54 = add nsw i32 %.056.lcssa, -8
  %55 = load i32, ptr %27, align 4, !tbaa !20
  %56 = load ptr, ptr @sttminus, align 8, !tbaa !14
  tail call void @V_DrawPatch(i32 noundef %54, i32 noundef %55, i32 noundef 0, ptr noundef %56) #5
  br label %57

57:                                               ; preds = %.critedge, %53, %31
  ret void
}

; Function Attrs: noreturn
declare void @I_Error(ptr noundef, ...) local_unnamed_addr #1

declare void @V_CopyRect(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #3

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { noreturn "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { noreturn nounwind }
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 8}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16, !10, i64 24, !10, i64 32, !7, i64 40}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !10, i64 16}
!12 = !{!7, !7, i64 0}
!13 = !{!6, !10, i64 32}
!14 = !{!10, !10, i64 0}
!15 = !{!16, !17, i64 0}
!16 = !{!"", !17, i64 0, !17, i64 2, !17, i64 4, !17, i64 6, !8, i64 8}
!17 = !{!"short", !8, i64 0}
!18 = !{!16, !17, i64 2}
!19 = !{!6, !7, i64 12}
!20 = !{!6, !7, i64 4}
!21 = !{!6, !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}


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