; 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.wbplayerstruct_t = type { i32, i32, i32, i32, i32, [4 x i32], i32 }
%struct.wbstartstruct_t = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [4 x %struct.wbplayerstruct_t] }

@wbs = external hidden global ptr, align 8
@gamemode = external global i32, align 4
@bcnt = external hidden global i32, align 4
@acceleratestage = external hidden global i32, align 4
@plrs = external hidden global ptr, align 8
@cnt_pause = external hidden global i32, align 4
@me = external hidden global i32, align 4
@cnt_secret = external hidden global [4 x i32], align 16
@cnt_items = external hidden global [4 x i32], align 16
@cnt_kills = external hidden global [4 x i32], align 16
@sp_state = external hidden global i32, align 4
@cnt_par = external hidden global i32, align 4
@cnt_time = external hidden global i32, align 4

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

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

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

declare void @S_StartSound(ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @WI_updateStats() #0 {
  call void @WI_updateAnimatedBack()
  %1 = load i32, ptr @acceleratestage, align 4, !tbaa !5
  %2 = icmp ne i32 %1, 0
  br i1 %2, label %3, label %51

3:                                                ; preds = %0
  %4 = load i32, ptr @sp_state, align 4, !tbaa !5
  %5 = icmp ne i32 %4, 10
  br i1 %5, label %6, label %51

6:                                                ; preds = %3
  store i32 0, ptr @acceleratestage, align 4, !tbaa !5
  %7 = load ptr, ptr @plrs, align 8, !tbaa !9
  %8 = load i32, ptr @me, align 4, !tbaa !5
  %9 = sext i32 %8 to i64
  %10 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %7, i64 %9
  %11 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %10, i32 0, i32 1
  %12 = load i32, ptr %11, align 4, !tbaa !11
  %13 = mul nsw i32 %12, 100
  %14 = load ptr, ptr @wbs, align 8, !tbaa !9
  %15 = getelementptr inbounds %struct.wbstartstruct_t, ptr %14, i32 0, i32 4
  %16 = load i32, ptr %15, align 4, !tbaa !13
  %17 = sdiv i32 %13, %16
  store i32 %17, ptr @cnt_kills, align 16, !tbaa !5
  %18 = load ptr, ptr @plrs, align 8, !tbaa !9
  %19 = load i32, ptr @me, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %18, i64 %20
  %22 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %21, i32 0, i32 2
  %23 = load i32, ptr %22, align 4, !tbaa !15
  %24 = mul nsw i32 %23, 100
  %25 = load ptr, ptr @wbs, align 8, !tbaa !9
  %26 = getelementptr inbounds %struct.wbstartstruct_t, ptr %25, i32 0, i32 5
  %27 = load i32, ptr %26, align 4, !tbaa !16
  %28 = sdiv i32 %24, %27
  store i32 %28, ptr @cnt_items, align 16, !tbaa !5
  %29 = load ptr, ptr @plrs, align 8, !tbaa !9
  %30 = load i32, ptr @me, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %29, i64 %31
  %33 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %32, i32 0, i32 3
  %34 = load i32, ptr %33, align 4, !tbaa !17
  %35 = mul nsw i32 %34, 100
  %36 = load ptr, ptr @wbs, align 8, !tbaa !9
  %37 = getelementptr inbounds %struct.wbstartstruct_t, ptr %36, i32 0, i32 6
  %38 = load i32, ptr %37, align 4, !tbaa !18
  %39 = sdiv i32 %35, %38
  store i32 %39, ptr @cnt_secret, align 16, !tbaa !5
  %40 = load ptr, ptr @plrs, align 8, !tbaa !9
  %41 = load i32, ptr @me, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %40, i64 %42
  %44 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %43, i32 0, i32 4
  %45 = load i32, ptr %44, align 4, !tbaa !19
  %46 = sdiv i32 %45, 35
  store i32 %46, ptr @cnt_time, align 4, !tbaa !5
  %47 = load ptr, ptr @wbs, align 8, !tbaa !9
  %48 = getelementptr inbounds %struct.wbstartstruct_t, ptr %47, i32 0, i32 8
  %49 = load i32, ptr %48, align 4, !tbaa !20
  %50 = sdiv i32 %49, 35
  store i32 %50, ptr @cnt_par, align 4, !tbaa !5
  call void @S_StartSound(ptr noundef null, i32 noundef 82)
  store i32 10, ptr @sp_state, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %6, %3, %0
  %52 = load i32, ptr @sp_state, align 4, !tbaa !5
  %53 = icmp eq i32 %52, 2
  br i1 %53, label %54, label %90

54:                                               ; preds = %51
  %55 = load i32, ptr @cnt_kills, align 16, !tbaa !5
  %56 = add nsw i32 %55, 2
  store i32 %56, ptr @cnt_kills, align 16, !tbaa !5
  %57 = load i32, ptr @bcnt, align 4, !tbaa !5
  %58 = and i32 %57, 3
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %61, label %60

60:                                               ; preds = %54
  call void @S_StartSound(ptr noundef null, i32 noundef 1)
  br label %61

61:                                               ; preds = %60, %54
  %62 = load i32, ptr @cnt_kills, align 16, !tbaa !5
  %63 = load ptr, ptr @plrs, align 8, !tbaa !9
  %64 = load i32, ptr @me, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %63, i64 %65
  %67 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %66, i32 0, i32 1
  %68 = load i32, ptr %67, align 4, !tbaa !11
  %69 = mul nsw i32 %68, 100
  %70 = load ptr, ptr @wbs, align 8, !tbaa !9
  %71 = getelementptr inbounds %struct.wbstartstruct_t, ptr %70, i32 0, i32 4
  %72 = load i32, ptr %71, align 4, !tbaa !13
  %73 = sdiv i32 %69, %72
  %74 = icmp sge i32 %62, %73
  br i1 %74, label %75, label %89

75:                                               ; preds = %61
  %76 = load ptr, ptr @plrs, align 8, !tbaa !9
  %77 = load i32, ptr @me, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %76, i64 %78
  %80 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %79, i32 0, i32 1
  %81 = load i32, ptr %80, align 4, !tbaa !11
  %82 = mul nsw i32 %81, 100
  %83 = load ptr, ptr @wbs, align 8, !tbaa !9
  %84 = getelementptr inbounds %struct.wbstartstruct_t, ptr %83, i32 0, i32 4
  %85 = load i32, ptr %84, align 4, !tbaa !13
  %86 = sdiv i32 %82, %85
  store i32 %86, ptr @cnt_kills, align 16, !tbaa !5
  call void @S_StartSound(ptr noundef null, i32 noundef 82)
  %87 = load i32, ptr @sp_state, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr @sp_state, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %75, %61
  br label %254

90:                                               ; preds = %51
  %91 = load i32, ptr @sp_state, align 4, !tbaa !5
  %92 = icmp eq i32 %91, 4
  br i1 %92, label %93, label %129

93:                                               ; preds = %90
  %94 = load i32, ptr @cnt_items, align 16, !tbaa !5
  %95 = add nsw i32 %94, 2
  store i32 %95, ptr @cnt_items, align 16, !tbaa !5
  %96 = load i32, ptr @bcnt, align 4, !tbaa !5
  %97 = and i32 %96, 3
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %100, label %99

99:                                               ; preds = %93
  call void @S_StartSound(ptr noundef null, i32 noundef 1)
  br label %100

100:                                              ; preds = %99, %93
  %101 = load i32, ptr @cnt_items, align 16, !tbaa !5
  %102 = load ptr, ptr @plrs, align 8, !tbaa !9
  %103 = load i32, ptr @me, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %102, i64 %104
  %106 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %105, i32 0, i32 2
  %107 = load i32, ptr %106, align 4, !tbaa !15
  %108 = mul nsw i32 %107, 100
  %109 = load ptr, ptr @wbs, align 8, !tbaa !9
  %110 = getelementptr inbounds %struct.wbstartstruct_t, ptr %109, i32 0, i32 5
  %111 = load i32, ptr %110, align 4, !tbaa !16
  %112 = sdiv i32 %108, %111
  %113 = icmp sge i32 %101, %112
  br i1 %113, label %114, label %128

114:                                              ; preds = %100
  %115 = load ptr, ptr @plrs, align 8, !tbaa !9
  %116 = load i32, ptr @me, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %115, i64 %117
  %119 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %118, i32 0, i32 2
  %120 = load i32, ptr %119, align 4, !tbaa !15
  %121 = mul nsw i32 %120, 100
  %122 = load ptr, ptr @wbs, align 8, !tbaa !9
  %123 = getelementptr inbounds %struct.wbstartstruct_t, ptr %122, i32 0, i32 5
  %124 = load i32, ptr %123, align 4, !tbaa !16
  %125 = sdiv i32 %121, %124
  store i32 %125, ptr @cnt_items, align 16, !tbaa !5
  call void @S_StartSound(ptr noundef null, i32 noundef 82)
  %126 = load i32, ptr @sp_state, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr @sp_state, align 4, !tbaa !5
  br label %128

128:                                              ; preds = %114, %100
  br label %253

129:                                              ; preds = %90
  %130 = load i32, ptr @sp_state, align 4, !tbaa !5
  %131 = icmp eq i32 %130, 6
  br i1 %131, label %132, label %168

132:                                              ; preds = %129
  %133 = load i32, ptr @cnt_secret, align 16, !tbaa !5
  %134 = add nsw i32 %133, 2
  store i32 %134, ptr @cnt_secret, align 16, !tbaa !5
  %135 = load i32, ptr @bcnt, align 4, !tbaa !5
  %136 = and i32 %135, 3
  %137 = icmp ne i32 %136, 0
  br i1 %137, label %139, label %138

138:                                              ; preds = %132
  call void @S_StartSound(ptr noundef null, i32 noundef 1)
  br label %139

139:                                              ; preds = %138, %132
  %140 = load i32, ptr @cnt_secret, align 16, !tbaa !5
  %141 = load ptr, ptr @plrs, align 8, !tbaa !9
  %142 = load i32, ptr @me, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %141, i64 %143
  %145 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %144, i32 0, i32 3
  %146 = load i32, ptr %145, align 4, !tbaa !17
  %147 = mul nsw i32 %146, 100
  %148 = load ptr, ptr @wbs, align 8, !tbaa !9
  %149 = getelementptr inbounds %struct.wbstartstruct_t, ptr %148, i32 0, i32 6
  %150 = load i32, ptr %149, align 4, !tbaa !18
  %151 = sdiv i32 %147, %150
  %152 = icmp sge i32 %140, %151
  br i1 %152, label %153, label %167

153:                                              ; preds = %139
  %154 = load ptr, ptr @plrs, align 8, !tbaa !9
  %155 = load i32, ptr @me, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %154, i64 %156
  %158 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %157, i32 0, i32 3
  %159 = load i32, ptr %158, align 4, !tbaa !17
  %160 = mul nsw i32 %159, 100
  %161 = load ptr, ptr @wbs, align 8, !tbaa !9
  %162 = getelementptr inbounds %struct.wbstartstruct_t, ptr %161, i32 0, i32 6
  %163 = load i32, ptr %162, align 4, !tbaa !18
  %164 = sdiv i32 %160, %163
  store i32 %164, ptr @cnt_secret, align 16, !tbaa !5
  call void @S_StartSound(ptr noundef null, i32 noundef 82)
  %165 = load i32, ptr @sp_state, align 4, !tbaa !5
  %166 = add nsw i32 %165, 1
  store i32 %166, ptr @sp_state, align 4, !tbaa !5
  br label %167

167:                                              ; preds = %153, %139
  br label %252

168:                                              ; preds = %129
  %169 = load i32, ptr @sp_state, align 4, !tbaa !5
  %170 = icmp eq i32 %169, 8
  br i1 %170, label %171, label %224

171:                                              ; preds = %168
  %172 = load i32, ptr @bcnt, align 4, !tbaa !5
  %173 = and i32 %172, 3
  %174 = icmp ne i32 %173, 0
  br i1 %174, label %176, label %175

175:                                              ; preds = %171
  call void @S_StartSound(ptr noundef null, i32 noundef 1)
  br label %176

176:                                              ; preds = %175, %171
  %177 = load i32, ptr @cnt_time, align 4, !tbaa !5
  %178 = add nsw i32 %177, 3
  store i32 %178, ptr @cnt_time, align 4, !tbaa !5
  %179 = load i32, ptr @cnt_time, align 4, !tbaa !5
  %180 = load ptr, ptr @plrs, align 8, !tbaa !9
  %181 = load i32, ptr @me, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %180, i64 %182
  %184 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %183, i32 0, i32 4
  %185 = load i32, ptr %184, align 4, !tbaa !19
  %186 = sdiv i32 %185, 35
  %187 = icmp sge i32 %179, %186
  br i1 %187, label %188, label %196

188:                                              ; preds = %176
  %189 = load ptr, ptr @plrs, align 8, !tbaa !9
  %190 = load i32, ptr @me, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %189, i64 %191
  %193 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %192, i32 0, i32 4
  %194 = load i32, ptr %193, align 4, !tbaa !19
  %195 = sdiv i32 %194, 35
  store i32 %195, ptr @cnt_time, align 4, !tbaa !5
  br label %196

196:                                              ; preds = %188, %176
  %197 = load i32, ptr @cnt_par, align 4, !tbaa !5
  %198 = add nsw i32 %197, 3
  store i32 %198, ptr @cnt_par, align 4, !tbaa !5
  %199 = load i32, ptr @cnt_par, align 4, !tbaa !5
  %200 = load ptr, ptr @wbs, align 8, !tbaa !9
  %201 = getelementptr inbounds %struct.wbstartstruct_t, ptr %200, i32 0, i32 8
  %202 = load i32, ptr %201, align 4, !tbaa !20
  %203 = sdiv i32 %202, 35
  %204 = icmp sge i32 %199, %203
  br i1 %204, label %205, label %223

205:                                              ; preds = %196
  %206 = load ptr, ptr @wbs, align 8, !tbaa !9
  %207 = getelementptr inbounds %struct.wbstartstruct_t, ptr %206, i32 0, i32 8
  %208 = load i32, ptr %207, align 4, !tbaa !20
  %209 = sdiv i32 %208, 35
  store i32 %209, ptr @cnt_par, align 4, !tbaa !5
  %210 = load i32, ptr @cnt_time, align 4, !tbaa !5
  %211 = load ptr, ptr @plrs, align 8, !tbaa !9
  %212 = load i32, ptr @me, align 4, !tbaa !5
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %211, i64 %213
  %215 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %214, i32 0, i32 4
  %216 = load i32, ptr %215, align 4, !tbaa !19
  %217 = sdiv i32 %216, 35
  %218 = icmp sge i32 %210, %217
  br i1 %218, label %219, label %222

219:                                              ; preds = %205
  call void @S_StartSound(ptr noundef null, i32 noundef 82)
  %220 = load i32, ptr @sp_state, align 4, !tbaa !5
  %221 = add nsw i32 %220, 1
  store i32 %221, ptr @sp_state, align 4, !tbaa !5
  br label %222

222:                                              ; preds = %219, %205
  br label %223

223:                                              ; preds = %222, %196
  br label %251

224:                                              ; preds = %168
  %225 = load i32, ptr @sp_state, align 4, !tbaa !5
  %226 = icmp eq i32 %225, 10
  br i1 %226, label %227, label %237

227:                                              ; preds = %224
  %228 = load i32, ptr @acceleratestage, align 4, !tbaa !5
  %229 = icmp ne i32 %228, 0
  br i1 %229, label %230, label %236

230:                                              ; preds = %227
  call void @S_StartSound(ptr noundef null, i32 noundef 3)
  %231 = load i32, ptr @gamemode, align 4, !tbaa !5
  %232 = icmp eq i32 %231, 2
  br i1 %232, label %233, label %234

233:                                              ; preds = %230
  call void @WI_initNoState()
  br label %235

234:                                              ; preds = %230
  call void @WI_initShowNextLoc()
  br label %235

235:                                              ; preds = %234, %233
  br label %236

236:                                              ; preds = %235, %227
  br label %250

237:                                              ; preds = %224
  %238 = load i32, ptr @sp_state, align 4, !tbaa !5
  %239 = and i32 %238, 1
  %240 = icmp ne i32 %239, 0
  br i1 %240, label %241, label %249

241:                                              ; preds = %237
  %242 = load i32, ptr @cnt_pause, align 4, !tbaa !5
  %243 = add nsw i32 %242, -1
  store i32 %243, ptr @cnt_pause, align 4, !tbaa !5
  %244 = icmp ne i32 %243, 0
  br i1 %244, label %248, label %245

245:                                              ; preds = %241
  %246 = load i32, ptr @sp_state, align 4, !tbaa !5
  %247 = add nsw i32 %246, 1
  store i32 %247, ptr @sp_state, align 4, !tbaa !5
  store i32 35, ptr @cnt_pause, align 4, !tbaa !5
  br label %248

248:                                              ; preds = %245, %241
  br label %249

249:                                              ; preds = %248, %237
  br label %250

250:                                              ; preds = %249, %236
  br label %251

251:                                              ; preds = %250, %223
  br label %252

252:                                              ; preds = %251, %167
  br label %253

253:                                              ; preds = %252, %128
  br label %254

254:                                              ; preds = %253, %89
  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" }

!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, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 4}
!12 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !7, i64 20, !6, i64 36}
!13 = !{!14, !6, i64 16}
!14 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !7, i64 40}
!15 = !{!12, !6, i64 8}
!16 = !{!14, !6, i64 20}
!17 = !{!12, !6, i64 12}
!18 = !{!14, !6, i64 24}
!19 = !{!12, !6, i64 16}
!20 = !{!14, !6, i64 32}


; 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.wbplayerstruct_t = type { i32, i32, i32, i32, i32, [4 x i32], i32 }

@wbs = external hidden local_unnamed_addr global ptr, align 8
@gamemode = external local_unnamed_addr global i32, align 4
@bcnt = external hidden local_unnamed_addr global i32, align 4
@acceleratestage = external hidden local_unnamed_addr global i32, align 4
@plrs = external hidden local_unnamed_addr global ptr, align 8
@cnt_pause = external hidden local_unnamed_addr global i32, align 4
@me = external hidden local_unnamed_addr global i32, align 4
@cnt_secret = external hidden local_unnamed_addr global [4 x i32], align 16
@cnt_items = external hidden local_unnamed_addr global [4 x i32], align 16
@cnt_kills = external hidden local_unnamed_addr global [4 x i32], align 16
@sp_state = external hidden local_unnamed_addr global i32, align 4
@cnt_par = external hidden local_unnamed_addr global i32, align 4
@cnt_time = external hidden local_unnamed_addr global i32, align 4

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @WI_updateStats() local_unnamed_addr #0 {
  tail call void @WI_updateAnimatedBack()
  %1 = load i32, ptr @acceleratestage, align 4, !tbaa !5
  %2 = icmp ne i32 %1, 0
  %3 = load i32, ptr @sp_state, align 4
  %4 = icmp ne i32 %3, 10
  %or.cond = select i1 %2, i1 %4, i1 false
  br i1 %or.cond, label %.thread, label %33

.thread:                                          ; preds = %0
  store i32 0, ptr @acceleratestage, align 4, !tbaa !5
  %5 = load ptr, ptr @plrs, align 8, !tbaa !9
  %6 = load i32, ptr @me, align 4, !tbaa !5
  %7 = sext i32 %6 to i64
  %8 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %5, i64 %7, i32 1
  %9 = load i32, ptr %8, align 4, !tbaa !11
  %10 = mul nsw i32 %9, 100
  %11 = load ptr, ptr @wbs, align 8, !tbaa !9
  %12 = getelementptr inbounds i8, ptr %11, i64 16
  %13 = load i32, ptr %12, align 4, !tbaa !13
  %14 = sdiv i32 %10, %13
  store i32 %14, ptr @cnt_kills, align 16, !tbaa !5
  %15 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %5, i64 %7, i32 2
  %16 = load i32, ptr %15, align 4, !tbaa !15
  %17 = mul nsw i32 %16, 100
  %18 = getelementptr inbounds i8, ptr %11, i64 20
  %19 = load i32, ptr %18, align 4, !tbaa !16
  %20 = sdiv i32 %17, %19
  store i32 %20, ptr @cnt_items, align 16, !tbaa !5
  %21 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %5, i64 %7, i32 3
  %22 = load i32, ptr %21, align 4, !tbaa !17
  %23 = mul nsw i32 %22, 100
  %24 = getelementptr inbounds i8, ptr %11, i64 24
  %25 = load i32, ptr %24, align 4, !tbaa !18
  %26 = sdiv i32 %23, %25
  store i32 %26, ptr @cnt_secret, align 16, !tbaa !5
  %27 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %5, i64 %7, i32 4
  %28 = load i32, ptr %27, align 4, !tbaa !19
  %29 = sdiv i32 %28, 35
  store i32 %29, ptr @cnt_time, align 4, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %11, i64 32
  %31 = load i32, ptr %30, align 4, !tbaa !20
  %32 = sdiv i32 %31, 35
  store i32 %32, ptr @cnt_par, align 4, !tbaa !5
  tail call void @S_StartSound(ptr noundef null, i32 noundef 82) #3
  store i32 10, ptr @sp_state, align 4, !tbaa !5
  %.pre21 = load i32, ptr @acceleratestage, align 4, !tbaa !5
  br label %122

33:                                               ; preds = %0
  switch i32 %3, label %129 [
    i32 2, label %34
    i32 4, label %55
    i32 6, label %76
    i32 8, label %97
    i32 10, label %122
  ]

34:                                               ; preds = %33
  %35 = load i32, ptr @cnt_kills, align 16, !tbaa !5
  %36 = add nsw i32 %35, 2
  store i32 %36, ptr @cnt_kills, align 16, !tbaa !5
  %37 = load i32, ptr @bcnt, align 4, !tbaa !5
  %38 = and i32 %37, 3
  %.not17 = icmp eq i32 %38, 0
  br i1 %.not17, label %39, label %40

39:                                               ; preds = %34
  tail call void @S_StartSound(ptr noundef null, i32 noundef 1) #3
  %.pre20 = load i32, ptr @cnt_kills, align 16, !tbaa !5
  br label %40

40:                                               ; preds = %39, %34
  %41 = phi i32 [ %.pre20, %39 ], [ %36, %34 ]
  %42 = load ptr, ptr @plrs, align 8, !tbaa !9
  %43 = load i32, ptr @me, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %42, i64 %44, i32 1
  %46 = load i32, ptr %45, align 4, !tbaa !11
  %47 = mul nsw i32 %46, 100
  %48 = load ptr, ptr @wbs, align 8, !tbaa !9
  %49 = getelementptr inbounds i8, ptr %48, i64 16
  %50 = load i32, ptr %49, align 4, !tbaa !13
  %51 = sdiv i32 %47, %50
  %.not18 = icmp slt i32 %41, %51
  br i1 %.not18, label %136, label %52

52:                                               ; preds = %40
  store i32 %51, ptr @cnt_kills, align 16, !tbaa !5
  tail call void @S_StartSound(ptr noundef null, i32 noundef 82) #3
  %53 = load i32, ptr @sp_state, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr @sp_state, align 4, !tbaa !5
  br label %136

55:                                               ; preds = %33
  %56 = load i32, ptr @cnt_items, align 16, !tbaa !5
  %57 = add nsw i32 %56, 2
  store i32 %57, ptr @cnt_items, align 16, !tbaa !5
  %58 = load i32, ptr @bcnt, align 4, !tbaa !5
  %59 = and i32 %58, 3
  %.not15 = icmp eq i32 %59, 0
  br i1 %.not15, label %60, label %61

60:                                               ; preds = %55
  tail call void @S_StartSound(ptr noundef null, i32 noundef 1) #3
  %.pre19 = load i32, ptr @cnt_items, align 16, !tbaa !5
  br label %61

61:                                               ; preds = %60, %55
  %62 = phi i32 [ %.pre19, %60 ], [ %57, %55 ]
  %63 = load ptr, ptr @plrs, align 8, !tbaa !9
  %64 = load i32, ptr @me, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %63, i64 %65, i32 2
  %67 = load i32, ptr %66, align 4, !tbaa !15
  %68 = mul nsw i32 %67, 100
  %69 = load ptr, ptr @wbs, align 8, !tbaa !9
  %70 = getelementptr inbounds i8, ptr %69, i64 20
  %71 = load i32, ptr %70, align 4, !tbaa !16
  %72 = sdiv i32 %68, %71
  %.not16 = icmp slt i32 %62, %72
  br i1 %.not16, label %136, label %73

73:                                               ; preds = %61
  store i32 %72, ptr @cnt_items, align 16, !tbaa !5
  tail call void @S_StartSound(ptr noundef null, i32 noundef 82) #3
  %74 = load i32, ptr @sp_state, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr @sp_state, align 4, !tbaa !5
  br label %136

76:                                               ; preds = %33
  %77 = load i32, ptr @cnt_secret, align 16, !tbaa !5
  %78 = add nsw i32 %77, 2
  store i32 %78, ptr @cnt_secret, align 16, !tbaa !5
  %79 = load i32, ptr @bcnt, align 4, !tbaa !5
  %80 = and i32 %79, 3
  %.not13 = icmp eq i32 %80, 0
  br i1 %.not13, label %81, label %82

81:                                               ; preds = %76
  tail call void @S_StartSound(ptr noundef null, i32 noundef 1) #3
  %.pre = load i32, ptr @cnt_secret, align 16, !tbaa !5
  br label %82

82:                                               ; preds = %81, %76
  %83 = phi i32 [ %.pre, %81 ], [ %78, %76 ]
  %84 = load ptr, ptr @plrs, align 8, !tbaa !9
  %85 = load i32, ptr @me, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %84, i64 %86, i32 3
  %88 = load i32, ptr %87, align 4, !tbaa !17
  %89 = mul nsw i32 %88, 100
  %90 = load ptr, ptr @wbs, align 8, !tbaa !9
  %91 = getelementptr inbounds i8, ptr %90, i64 24
  %92 = load i32, ptr %91, align 4, !tbaa !18
  %93 = sdiv i32 %89, %92
  %.not14 = icmp slt i32 %83, %93
  br i1 %.not14, label %136, label %94

94:                                               ; preds = %82
  store i32 %93, ptr @cnt_secret, align 16, !tbaa !5
  tail call void @S_StartSound(ptr noundef null, i32 noundef 82) #3
  %95 = load i32, ptr @sp_state, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr @sp_state, align 4, !tbaa !5
  br label %136

97:                                               ; preds = %33
  %98 = load i32, ptr @bcnt, align 4, !tbaa !5
  %99 = and i32 %98, 3
  %.not9 = icmp eq i32 %99, 0
  br i1 %.not9, label %100, label %101

100:                                              ; preds = %97
  tail call void @S_StartSound(ptr noundef null, i32 noundef 1) #3
  br label %101

101:                                              ; preds = %100, %97
  %102 = load i32, ptr @cnt_time, align 4, !tbaa !5
  %103 = add nsw i32 %102, 3
  store i32 %103, ptr @cnt_time, align 4, !tbaa !5
  %104 = load ptr, ptr @plrs, align 8, !tbaa !9
  %105 = load i32, ptr @me, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %104, i64 %106, i32 4
  %108 = load i32, ptr %107, align 4, !tbaa !19
  %109 = sdiv i32 %108, 35
  %spec.store.select = tail call i32 @llvm.smin.i32(i32 %103, i32 %109)
  store i32 %spec.store.select, ptr @cnt_time, align 4
  %110 = load i32, ptr @cnt_par, align 4, !tbaa !5
  %111 = add nsw i32 %110, 3
  store i32 %111, ptr @cnt_par, align 4, !tbaa !5
  %112 = load ptr, ptr @wbs, align 8, !tbaa !9
  %113 = getelementptr inbounds i8, ptr %112, i64 32
  %114 = load i32, ptr %113, align 4, !tbaa !20
  %115 = sdiv i32 %114, 35
  %.not11 = icmp slt i32 %111, %115
  br i1 %.not11, label %136, label %116

116:                                              ; preds = %101
  store i32 %115, ptr @cnt_par, align 4, !tbaa !5
  %117 = load i32, ptr %107, align 4, !tbaa !19
  %118 = sdiv i32 %117, 35
  %.not12 = icmp slt i32 %spec.store.select, %118
  br i1 %.not12, label %136, label %119

119:                                              ; preds = %116
  tail call void @S_StartSound(ptr noundef null, i32 noundef 82) #3
  %120 = load i32, ptr @sp_state, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr @sp_state, align 4, !tbaa !5
  br label %136

122:                                              ; preds = %.thread, %33
  %123 = phi i32 [ %.pre21, %.thread ], [ %1, %33 ]
  %.not8 = icmp eq i32 %123, 0
  br i1 %.not8, label %136, label %124

124:                                              ; preds = %122
  tail call void @S_StartSound(ptr noundef null, i32 noundef 3) #3
  %125 = load i32, ptr @gamemode, align 4, !tbaa !5
  %126 = icmp eq i32 %125, 2
  br i1 %126, label %127, label %128

127:                                              ; preds = %124
  tail call void @WI_initNoState()
  br label %136

128:                                              ; preds = %124
  tail call void @WI_initShowNextLoc()
  br label %136

129:                                              ; preds = %33
  %130 = and i32 %3, 1
  %.not = icmp eq i32 %130, 0
  br i1 %.not, label %136, label %131

131:                                              ; preds = %129
  %132 = load i32, ptr @cnt_pause, align 4, !tbaa !5
  %133 = add nsw i32 %132, -1
  store i32 %133, ptr @cnt_pause, align 4, !tbaa !5
  %.not7 = icmp eq i32 %133, 0
  br i1 %.not7, label %134, label %136

134:                                              ; preds = %131
  %135 = add nsw i32 %3, 1
  store i32 %135, ptr @sp_state, align 4, !tbaa !5
  store i32 35, ptr @cnt_pause, align 4, !tbaa !5
  br label %136

136:                                              ; preds = %73, %61, %116, %119, %101, %129, %134, %131, %122, %128, %127, %82, %94, %40, %52
  ret void
}

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

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 4}
!12 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !7, i64 20, !6, i64 36}
!13 = !{!14, !6, i64 16}
!14 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !7, i64 40}
!15 = !{!12, !6, i64 8}
!16 = !{!14, !6, i64 20}
!17 = !{!12, !6, i64 12}
!18 = !{!14, !6, i64 24}
!19 = !{!12, !6, i64 16}
!20 = !{!14, !6, i64 32}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InstCombinePass,JumpThreadingPass,SimplifyCFGPass,TailCallElimPass