; 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
@playeringame = external global [4 x i32], align 16
@plrs = external hidden global ptr, align 8
@cnt_pause = external hidden global i32, align 4
@ng_state = external hidden global i32, align 4
@cnt_frags = external hidden global [4 x i32], align 16
@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
@dofrags = external hidden global i32, align 4

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @WI_fragSum(i32 noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local void @WI_updateNetgameStats() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = 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 @WI_updateAnimatedBack()
  %4 = load i32, ptr @acceleratestage, align 4, !tbaa !5
  %5 = icmp ne i32 %4, 0
  br i1 %5, label %6, label %76

6:                                                ; preds = %0
  %7 = load i32, ptr @ng_state, align 4, !tbaa !5
  %8 = icmp ne i32 %7, 10
  br i1 %8, label %9, label %76

9:                                                ; preds = %6
  store i32 0, ptr @acceleratestage, align 4, !tbaa !5
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %10

10:                                               ; preds = %72, %9
  %11 = load i32, ptr %1, align 4, !tbaa !5
  %12 = icmp slt i32 %11, 4
  br i1 %12, label %13, label %75

13:                                               ; preds = %10
  %14 = load i32, ptr %1, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [4 x i32], ptr @playeringame, i64 0, i64 %15
  %17 = load i32, ptr %16, align 4, !tbaa !5
  %18 = icmp ne i32 %17, 0
  br i1 %18, label %20, label %19

19:                                               ; preds = %13
  br label %72

20:                                               ; preds = %13
  %21 = load ptr, ptr @plrs, align 8, !tbaa !9
  %22 = load i32, ptr %1, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %21, i64 %23
  %25 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %24, i32 0, i32 1
  %26 = load i32, ptr %25, align 4, !tbaa !11
  %27 = mul nsw i32 %26, 100
  %28 = load ptr, ptr @wbs, align 8, !tbaa !9
  %29 = getelementptr inbounds %struct.wbstartstruct_t, ptr %28, i32 0, i32 4
  %30 = load i32, ptr %29, align 4, !tbaa !13
  %31 = sdiv i32 %27, %30
  %32 = load i32, ptr %1, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [4 x i32], ptr @cnt_kills, i64 0, i64 %33
  store i32 %31, ptr %34, align 4, !tbaa !5
  %35 = load ptr, ptr @plrs, align 8, !tbaa !9
  %36 = load i32, ptr %1, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %35, i64 %37
  %39 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %38, i32 0, i32 2
  %40 = load i32, ptr %39, align 4, !tbaa !15
  %41 = mul nsw i32 %40, 100
  %42 = load ptr, ptr @wbs, align 8, !tbaa !9
  %43 = getelementptr inbounds %struct.wbstartstruct_t, ptr %42, i32 0, i32 5
  %44 = load i32, ptr %43, align 4, !tbaa !16
  %45 = sdiv i32 %41, %44
  %46 = load i32, ptr %1, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [4 x i32], ptr @cnt_items, i64 0, i64 %47
  store i32 %45, ptr %48, align 4, !tbaa !5
  %49 = load ptr, ptr @plrs, align 8, !tbaa !9
  %50 = load i32, ptr %1, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %49, i64 %51
  %53 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %52, i32 0, i32 3
  %54 = load i32, ptr %53, align 4, !tbaa !17
  %55 = mul nsw i32 %54, 100
  %56 = load ptr, ptr @wbs, align 8, !tbaa !9
  %57 = getelementptr inbounds %struct.wbstartstruct_t, ptr %56, i32 0, i32 6
  %58 = load i32, ptr %57, align 4, !tbaa !18
  %59 = sdiv i32 %55, %58
  %60 = load i32, ptr %1, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [4 x i32], ptr @cnt_secret, i64 0, i64 %61
  store i32 %59, ptr %62, align 4, !tbaa !5
  %63 = load i32, ptr @dofrags, align 4, !tbaa !5
  %64 = icmp ne i32 %63, 0
  br i1 %64, label %65, label %71

65:                                               ; preds = %20
  %66 = load i32, ptr %1, align 4, !tbaa !5
  %67 = call i32 @WI_fragSum(i32 noundef %66)
  %68 = load i32, ptr %1, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [4 x i32], ptr @cnt_frags, i64 0, i64 %69
  store i32 %67, ptr %70, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %65, %20
  br label %72

72:                                               ; preds = %71, %19
  %73 = load i32, ptr %1, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %1, align 4, !tbaa !5
  br label %10, !llvm.loop !19

75:                                               ; preds = %10
  call void @S_StartSound(ptr noundef null, i32 noundef 82)
  store i32 10, ptr @ng_state, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %75, %6, %0
  %77 = load i32, ptr @ng_state, align 4, !tbaa !5
  %78 = icmp eq i32 %77, 2
  br i1 %78, label %79, label %144

79:                                               ; preds = %76
  %80 = load i32, ptr @bcnt, align 4, !tbaa !5
  %81 = and i32 %80, 3
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %84, label %83

83:                                               ; preds = %79
  call void @S_StartSound(ptr noundef null, i32 noundef 1)
  br label %84

84:                                               ; preds = %83, %79
  store i32 0, ptr %3, align 4, !tbaa !5
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %134, %84
  %86 = load i32, ptr %1, align 4, !tbaa !5
  %87 = icmp slt i32 %86, 4
  br i1 %87, label %88, label %137

88:                                               ; preds = %85
  %89 = load i32, ptr %1, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [4 x i32], ptr @playeringame, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = icmp ne i32 %92, 0
  br i1 %93, label %95, label %94

94:                                               ; preds = %88
  br label %134

95:                                               ; preds = %88
  %96 = load i32, ptr %1, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [4 x i32], ptr @cnt_kills, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = add nsw i32 %99, 2
  store i32 %100, ptr %98, align 4, !tbaa !5
  %101 = load i32, ptr %1, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [4 x i32], ptr @cnt_kills, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = load ptr, ptr @plrs, align 8, !tbaa !9
  %106 = load i32, ptr %1, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %105, i64 %107
  %109 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %108, i32 0, i32 1
  %110 = load i32, ptr %109, align 4, !tbaa !11
  %111 = mul nsw i32 %110, 100
  %112 = load ptr, ptr @wbs, align 8, !tbaa !9
  %113 = getelementptr inbounds %struct.wbstartstruct_t, ptr %112, i32 0, i32 4
  %114 = load i32, ptr %113, align 4, !tbaa !13
  %115 = sdiv i32 %111, %114
  %116 = icmp sge i32 %104, %115
  br i1 %116, label %117, label %132

117:                                              ; preds = %95
  %118 = load ptr, ptr @plrs, align 8, !tbaa !9
  %119 = load i32, ptr %1, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %118, i64 %120
  %122 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %121, i32 0, i32 1
  %123 = load i32, ptr %122, align 4, !tbaa !11
  %124 = mul nsw i32 %123, 100
  %125 = load ptr, ptr @wbs, align 8, !tbaa !9
  %126 = getelementptr inbounds %struct.wbstartstruct_t, ptr %125, i32 0, i32 4
  %127 = load i32, ptr %126, align 4, !tbaa !13
  %128 = sdiv i32 %124, %127
  %129 = load i32, ptr %1, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [4 x i32], ptr @cnt_kills, i64 0, i64 %130
  store i32 %128, ptr %131, align 4, !tbaa !5
  br label %133

132:                                              ; preds = %95
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %132, %117
  br label %134

134:                                              ; preds = %133, %94
  %135 = load i32, ptr %1, align 4, !tbaa !5
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %1, align 4, !tbaa !5
  br label %85, !llvm.loop !21

137:                                              ; preds = %85
  %138 = load i32, ptr %3, align 4, !tbaa !5
  %139 = icmp ne i32 %138, 0
  br i1 %139, label %143, label %140

140:                                              ; preds = %137
  call void @S_StartSound(ptr noundef null, i32 noundef 82)
  %141 = load i32, ptr @ng_state, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr @ng_state, align 4, !tbaa !5
  br label %143

143:                                              ; preds = %140, %137
  br label %365

144:                                              ; preds = %76
  %145 = load i32, ptr @ng_state, align 4, !tbaa !5
  %146 = icmp eq i32 %145, 4
  br i1 %146, label %147, label %212

147:                                              ; preds = %144
  %148 = load i32, ptr @bcnt, align 4, !tbaa !5
  %149 = and i32 %148, 3
  %150 = icmp ne i32 %149, 0
  br i1 %150, label %152, label %151

151:                                              ; preds = %147
  call void @S_StartSound(ptr noundef null, i32 noundef 1)
  br label %152

152:                                              ; preds = %151, %147
  store i32 0, ptr %3, align 4, !tbaa !5
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %153

153:                                              ; preds = %202, %152
  %154 = load i32, ptr %1, align 4, !tbaa !5
  %155 = icmp slt i32 %154, 4
  br i1 %155, label %156, label %205

156:                                              ; preds = %153
  %157 = load i32, ptr %1, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [4 x i32], ptr @playeringame, i64 0, i64 %158
  %160 = load i32, ptr %159, align 4, !tbaa !5
  %161 = icmp ne i32 %160, 0
  br i1 %161, label %163, label %162

162:                                              ; preds = %156
  br label %202

163:                                              ; preds = %156
  %164 = load i32, ptr %1, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [4 x i32], ptr @cnt_items, i64 0, i64 %165
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %168 = add nsw i32 %167, 2
  store i32 %168, ptr %166, align 4, !tbaa !5
  %169 = load i32, ptr %1, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [4 x i32], ptr @cnt_items, i64 0, i64 %170
  %172 = load i32, ptr %171, align 4, !tbaa !5
  %173 = load ptr, ptr @plrs, align 8, !tbaa !9
  %174 = load i32, ptr %1, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %173, i64 %175
  %177 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %176, i32 0, i32 2
  %178 = load i32, ptr %177, align 4, !tbaa !15
  %179 = mul nsw i32 %178, 100
  %180 = load ptr, ptr @wbs, align 8, !tbaa !9
  %181 = getelementptr inbounds %struct.wbstartstruct_t, ptr %180, i32 0, i32 5
  %182 = load i32, ptr %181, align 4, !tbaa !16
  %183 = sdiv i32 %179, %182
  %184 = icmp sge i32 %172, %183
  br i1 %184, label %185, label %200

185:                                              ; preds = %163
  %186 = load ptr, ptr @plrs, align 8, !tbaa !9
  %187 = load i32, ptr %1, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %186, i64 %188
  %190 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %189, i32 0, i32 2
  %191 = load i32, ptr %190, align 4, !tbaa !15
  %192 = mul nsw i32 %191, 100
  %193 = load ptr, ptr @wbs, align 8, !tbaa !9
  %194 = getelementptr inbounds %struct.wbstartstruct_t, ptr %193, i32 0, i32 5
  %195 = load i32, ptr %194, align 4, !tbaa !16
  %196 = sdiv i32 %192, %195
  %197 = load i32, ptr %1, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [4 x i32], ptr @cnt_items, i64 0, i64 %198
  store i32 %196, ptr %199, align 4, !tbaa !5
  br label %201

200:                                              ; preds = %163
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %201

201:                                              ; preds = %200, %185
  br label %202

202:                                              ; preds = %201, %162
  %203 = load i32, ptr %1, align 4, !tbaa !5
  %204 = add nsw i32 %203, 1
  store i32 %204, ptr %1, align 4, !tbaa !5
  br label %153, !llvm.loop !22

205:                                              ; preds = %153
  %206 = load i32, ptr %3, align 4, !tbaa !5
  %207 = icmp ne i32 %206, 0
  br i1 %207, label %211, label %208

208:                                              ; preds = %205
  call void @S_StartSound(ptr noundef null, i32 noundef 82)
  %209 = load i32, ptr @ng_state, align 4, !tbaa !5
  %210 = add nsw i32 %209, 1
  store i32 %210, ptr @ng_state, align 4, !tbaa !5
  br label %211

211:                                              ; preds = %208, %205
  br label %364

212:                                              ; preds = %144
  %213 = load i32, ptr @ng_state, align 4, !tbaa !5
  %214 = icmp eq i32 %213, 6
  br i1 %214, label %215, label %286

215:                                              ; preds = %212
  %216 = load i32, ptr @bcnt, align 4, !tbaa !5
  %217 = and i32 %216, 3
  %218 = icmp ne i32 %217, 0
  br i1 %218, label %220, label %219

219:                                              ; preds = %215
  call void @S_StartSound(ptr noundef null, i32 noundef 1)
  br label %220

220:                                              ; preds = %219, %215
  store i32 0, ptr %3, align 4, !tbaa !5
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %221

221:                                              ; preds = %270, %220
  %222 = load i32, ptr %1, align 4, !tbaa !5
  %223 = icmp slt i32 %222, 4
  br i1 %223, label %224, label %273

224:                                              ; preds = %221
  %225 = load i32, ptr %1, align 4, !tbaa !5
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds [4 x i32], ptr @playeringame, i64 0, i64 %226
  %228 = load i32, ptr %227, align 4, !tbaa !5
  %229 = icmp ne i32 %228, 0
  br i1 %229, label %231, label %230

230:                                              ; preds = %224
  br label %270

231:                                              ; preds = %224
  %232 = load i32, ptr %1, align 4, !tbaa !5
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds [4 x i32], ptr @cnt_secret, i64 0, i64 %233
  %235 = load i32, ptr %234, align 4, !tbaa !5
  %236 = add nsw i32 %235, 2
  store i32 %236, ptr %234, align 4, !tbaa !5
  %237 = load i32, ptr %1, align 4, !tbaa !5
  %238 = sext i32 %237 to i64
  %239 = getelementptr inbounds [4 x i32], ptr @cnt_secret, i64 0, i64 %238
  %240 = load i32, ptr %239, align 4, !tbaa !5
  %241 = load ptr, ptr @plrs, align 8, !tbaa !9
  %242 = load i32, ptr %1, align 4, !tbaa !5
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %241, i64 %243
  %245 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %244, i32 0, i32 3
  %246 = load i32, ptr %245, align 4, !tbaa !17
  %247 = mul nsw i32 %246, 100
  %248 = load ptr, ptr @wbs, align 8, !tbaa !9
  %249 = getelementptr inbounds %struct.wbstartstruct_t, ptr %248, i32 0, i32 6
  %250 = load i32, ptr %249, align 4, !tbaa !18
  %251 = sdiv i32 %247, %250
  %252 = icmp sge i32 %240, %251
  br i1 %252, label %253, label %268

253:                                              ; preds = %231
  %254 = load ptr, ptr @plrs, align 8, !tbaa !9
  %255 = load i32, ptr %1, align 4, !tbaa !5
  %256 = sext i32 %255 to i64
  %257 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %254, i64 %256
  %258 = getelementptr inbounds %struct.wbplayerstruct_t, ptr %257, i32 0, i32 3
  %259 = load i32, ptr %258, align 4, !tbaa !17
  %260 = mul nsw i32 %259, 100
  %261 = load ptr, ptr @wbs, align 8, !tbaa !9
  %262 = getelementptr inbounds %struct.wbstartstruct_t, ptr %261, i32 0, i32 6
  %263 = load i32, ptr %262, align 4, !tbaa !18
  %264 = sdiv i32 %260, %263
  %265 = load i32, ptr %1, align 4, !tbaa !5
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds [4 x i32], ptr @cnt_secret, i64 0, i64 %266
  store i32 %264, ptr %267, align 4, !tbaa !5
  br label %269

268:                                              ; preds = %231
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %269

269:                                              ; preds = %268, %253
  br label %270

270:                                              ; preds = %269, %230
  %271 = load i32, ptr %1, align 4, !tbaa !5
  %272 = add nsw i32 %271, 1
  store i32 %272, ptr %1, align 4, !tbaa !5
  br label %221, !llvm.loop !23

273:                                              ; preds = %221
  %274 = load i32, ptr %3, align 4, !tbaa !5
  %275 = icmp ne i32 %274, 0
  br i1 %275, label %285, label %276

276:                                              ; preds = %273
  call void @S_StartSound(ptr noundef null, i32 noundef 82)
  %277 = load i32, ptr @dofrags, align 4, !tbaa !5
  %278 = icmp ne i32 %277, 0
  %279 = xor i1 %278, true
  %280 = zext i1 %279 to i32
  %281 = mul nsw i32 2, %280
  %282 = add nsw i32 1, %281
  %283 = load i32, ptr @ng_state, align 4, !tbaa !5
  %284 = add nsw i32 %283, %282
  store i32 %284, ptr @ng_state, align 4, !tbaa !5
  br label %285

285:                                              ; preds = %276, %273
  br label %363

286:                                              ; preds = %212
  %287 = load i32, ptr @ng_state, align 4, !tbaa !5
  %288 = icmp eq i32 %287, 8
  br i1 %288, label %289, label %335

289:                                              ; preds = %286
  %290 = load i32, ptr @bcnt, align 4, !tbaa !5
  %291 = and i32 %290, 3
  %292 = icmp ne i32 %291, 0
  br i1 %292, label %294, label %293

293:                                              ; preds = %289
  call void @S_StartSound(ptr noundef null, i32 noundef 1)
  br label %294

294:                                              ; preds = %293, %289
  store i32 0, ptr %3, align 4, !tbaa !5
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %295

295:                                              ; preds = %325, %294
  %296 = load i32, ptr %1, align 4, !tbaa !5
  %297 = icmp slt i32 %296, 4
  br i1 %297, label %298, label %328

298:                                              ; preds = %295
  %299 = load i32, ptr %1, align 4, !tbaa !5
  %300 = sext i32 %299 to i64
  %301 = getelementptr inbounds [4 x i32], ptr @playeringame, i64 0, i64 %300
  %302 = load i32, ptr %301, align 4, !tbaa !5
  %303 = icmp ne i32 %302, 0
  br i1 %303, label %305, label %304

304:                                              ; preds = %298
  br label %325

305:                                              ; preds = %298
  %306 = load i32, ptr %1, align 4, !tbaa !5
  %307 = sext i32 %306 to i64
  %308 = getelementptr inbounds [4 x i32], ptr @cnt_frags, i64 0, i64 %307
  %309 = load i32, ptr %308, align 4, !tbaa !5
  %310 = add nsw i32 %309, 1
  store i32 %310, ptr %308, align 4, !tbaa !5
  %311 = load i32, ptr %1, align 4, !tbaa !5
  %312 = sext i32 %311 to i64
  %313 = getelementptr inbounds [4 x i32], ptr @cnt_frags, i64 0, i64 %312
  %314 = load i32, ptr %313, align 4, !tbaa !5
  %315 = load i32, ptr %1, align 4, !tbaa !5
  %316 = call i32 @WI_fragSum(i32 noundef %315)
  store i32 %316, ptr %2, align 4, !tbaa !5
  %317 = icmp sge i32 %314, %316
  br i1 %317, label %318, label %323

318:                                              ; preds = %305
  %319 = load i32, ptr %2, align 4, !tbaa !5
  %320 = load i32, ptr %1, align 4, !tbaa !5
  %321 = sext i32 %320 to i64
  %322 = getelementptr inbounds [4 x i32], ptr @cnt_frags, i64 0, i64 %321
  store i32 %319, ptr %322, align 4, !tbaa !5
  br label %324

323:                                              ; preds = %305
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %324

324:                                              ; preds = %323, %318
  br label %325

325:                                              ; preds = %324, %304
  %326 = load i32, ptr %1, align 4, !tbaa !5
  %327 = add nsw i32 %326, 1
  store i32 %327, ptr %1, align 4, !tbaa !5
  br label %295, !llvm.loop !24

328:                                              ; preds = %295
  %329 = load i32, ptr %3, align 4, !tbaa !5
  %330 = icmp ne i32 %329, 0
  br i1 %330, label %334, label %331

331:                                              ; preds = %328
  call void @S_StartSound(ptr noundef null, i32 noundef 57)
  %332 = load i32, ptr @ng_state, align 4, !tbaa !5
  %333 = add nsw i32 %332, 1
  store i32 %333, ptr @ng_state, align 4, !tbaa !5
  br label %334

334:                                              ; preds = %331, %328
  br label %362

335:                                              ; preds = %286
  %336 = load i32, ptr @ng_state, align 4, !tbaa !5
  %337 = icmp eq i32 %336, 10
  br i1 %337, label %338, label %348

338:                                              ; preds = %335
  %339 = load i32, ptr @acceleratestage, align 4, !tbaa !5
  %340 = icmp ne i32 %339, 0
  br i1 %340, label %341, label %347

341:                                              ; preds = %338
  call void @S_StartSound(ptr noundef null, i32 noundef 3)
  %342 = load i32, ptr @gamemode, align 4, !tbaa !5
  %343 = icmp eq i32 %342, 2
  br i1 %343, label %344, label %345

344:                                              ; preds = %341
  call void @WI_initNoState()
  br label %346

345:                                              ; preds = %341
  call void @WI_initShowNextLoc()
  br label %346

346:                                              ; preds = %345, %344
  br label %347

347:                                              ; preds = %346, %338
  br label %361

348:                                              ; preds = %335
  %349 = load i32, ptr @ng_state, align 4, !tbaa !5
  %350 = and i32 %349, 1
  %351 = icmp ne i32 %350, 0
  br i1 %351, label %352, label %360

352:                                              ; preds = %348
  %353 = load i32, ptr @cnt_pause, align 4, !tbaa !5
  %354 = add nsw i32 %353, -1
  store i32 %354, ptr @cnt_pause, align 4, !tbaa !5
  %355 = icmp ne i32 %354, 0
  br i1 %355, label %359, label %356

356:                                              ; preds = %352
  %357 = load i32, ptr @ng_state, align 4, !tbaa !5
  %358 = add nsw i32 %357, 1
  store i32 %358, ptr @ng_state, align 4, !tbaa !5
  store i32 35, ptr @cnt_pause, align 4, !tbaa !5
  br label %359

359:                                              ; preds = %356, %352
  br label %360

360:                                              ; preds = %359, %348
  br label %361

361:                                              ; preds = %360, %347
  br label %362

362:                                              ; preds = %361, %334
  br label %363

363:                                              ; preds = %362, %285
  br label %364

364:                                              ; preds = %363, %211
  br label %365

365:                                              ; preds = %364, %143
  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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = !{!"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 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}
!22 = distinct !{!22, !20}
!23 = distinct !{!23, !20}
!24 = distinct !{!24, !20}


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

@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
@playeringame = external local_unnamed_addr global [4 x i32], align 16
@plrs = external hidden local_unnamed_addr global ptr, align 8
@cnt_pause = external hidden local_unnamed_addr global i32, align 4
@ng_state = external hidden local_unnamed_addr global i32, align 4
@cnt_frags = external hidden local_unnamed_addr global [4 x i32], align 16
@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
@dofrags = 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

; Function Attrs: nounwind uwtable
declare dso_local i32 @WI_fragSum(i32 noundef) 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_updateNetgameStats() 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 @ng_state, align 4
  %4 = icmp ne i32 %3, 10
  %or.cond = select i1 %2, i1 %4, i1 false
  br i1 %or.cond, label %5, label %109

5:                                                ; preds = %0
  store i32 0, ptr @acceleratestage, align 4, !tbaa !5
  %6 = load i32, ptr @playeringame, align 16, !tbaa !5
  %.not77 = icmp eq i32 %6, 0
  br i1 %.not77, label %31, label %7

7:                                                ; preds = %5
  %8 = load ptr, ptr @plrs, align 8, !tbaa !9
  %9 = getelementptr inbounds i8, ptr %8, i64 4
  %10 = load i32, ptr %9, align 4, !tbaa !11
  %11 = mul nsw i32 %10, 100
  %12 = load ptr, ptr @wbs, align 8, !tbaa !9
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  %14 = load i32, ptr %13, align 4, !tbaa !13
  %15 = sdiv i32 %11, %14
  store i32 %15, ptr @cnt_kills, align 16, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %8, i64 8
  %17 = load i32, ptr %16, align 4, !tbaa !15
  %18 = mul nsw i32 %17, 100
  %19 = getelementptr inbounds i8, ptr %12, i64 20
  %20 = load i32, ptr %19, align 4, !tbaa !16
  %21 = sdiv i32 %18, %20
  store i32 %21, ptr @cnt_items, align 16, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %8, i64 12
  %23 = load i32, ptr %22, align 4, !tbaa !17
  %24 = mul nsw i32 %23, 100
  %25 = getelementptr inbounds i8, ptr %12, i64 24
  %26 = load i32, ptr %25, align 4, !tbaa !18
  %27 = sdiv i32 %24, %26
  store i32 %27, ptr @cnt_secret, align 16, !tbaa !5
  %28 = load i32, ptr @dofrags, align 4, !tbaa !5
  %.not78 = icmp eq i32 %28, 0
  br i1 %.not78, label %31, label %29

29:                                               ; preds = %7
  %30 = tail call i32 @WI_fragSum(i32 noundef 0)
  store i32 %30, ptr @cnt_frags, align 16, !tbaa !5
  br label %31

31:                                               ; preds = %7, %29, %5
  %32 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 4), align 4, !tbaa !5
  %.not77.1 = icmp eq i32 %32, 0
  br i1 %.not77.1, label %57, label %33

33:                                               ; preds = %31
  %34 = load ptr, ptr @plrs, align 8, !tbaa !9
  %35 = getelementptr inbounds i8, ptr %34, i64 44
  %36 = load i32, ptr %35, align 4, !tbaa !11
  %37 = mul nsw i32 %36, 100
  %38 = load ptr, ptr @wbs, align 8, !tbaa !9
  %39 = getelementptr inbounds i8, ptr %38, i64 16
  %40 = load i32, ptr %39, align 4, !tbaa !13
  %41 = sdiv i32 %37, %40
  store i32 %41, ptr getelementptr inbounds (i8, ptr @cnt_kills, i64 4), align 4, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %34, i64 48
  %43 = load i32, ptr %42, align 4, !tbaa !15
  %44 = mul nsw i32 %43, 100
  %45 = getelementptr inbounds i8, ptr %38, i64 20
  %46 = load i32, ptr %45, align 4, !tbaa !16
  %47 = sdiv i32 %44, %46
  store i32 %47, ptr getelementptr inbounds (i8, ptr @cnt_items, i64 4), align 4, !tbaa !5
  %48 = getelementptr inbounds i8, ptr %34, i64 52
  %49 = load i32, ptr %48, align 4, !tbaa !17
  %50 = mul nsw i32 %49, 100
  %51 = getelementptr inbounds i8, ptr %38, i64 24
  %52 = load i32, ptr %51, align 4, !tbaa !18
  %53 = sdiv i32 %50, %52
  store i32 %53, ptr getelementptr inbounds (i8, ptr @cnt_secret, i64 4), align 4, !tbaa !5
  %54 = load i32, ptr @dofrags, align 4, !tbaa !5
  %.not78.1 = icmp eq i32 %54, 0
  br i1 %.not78.1, label %57, label %55

55:                                               ; preds = %33
  %56 = tail call i32 @WI_fragSum(i32 noundef 1)
  store i32 %56, ptr getelementptr inbounds (i8, ptr @cnt_frags, i64 4), align 4, !tbaa !5
  br label %57

57:                                               ; preds = %55, %33, %31
  %58 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 8), align 8, !tbaa !5
  %.not77.2 = icmp eq i32 %58, 0
  br i1 %.not77.2, label %83, label %59

59:                                               ; preds = %57
  %60 = load ptr, ptr @plrs, align 8, !tbaa !9
  %61 = getelementptr inbounds i8, ptr %60, i64 84
  %62 = load i32, ptr %61, align 4, !tbaa !11
  %63 = mul nsw i32 %62, 100
  %64 = load ptr, ptr @wbs, align 8, !tbaa !9
  %65 = getelementptr inbounds i8, ptr %64, i64 16
  %66 = load i32, ptr %65, align 4, !tbaa !13
  %67 = sdiv i32 %63, %66
  store i32 %67, ptr getelementptr inbounds (i8, ptr @cnt_kills, i64 8), align 8, !tbaa !5
  %68 = getelementptr inbounds i8, ptr %60, i64 88
  %69 = load i32, ptr %68, align 4, !tbaa !15
  %70 = mul nsw i32 %69, 100
  %71 = getelementptr inbounds i8, ptr %64, i64 20
  %72 = load i32, ptr %71, align 4, !tbaa !16
  %73 = sdiv i32 %70, %72
  store i32 %73, ptr getelementptr inbounds (i8, ptr @cnt_items, i64 8), align 8, !tbaa !5
  %74 = getelementptr inbounds i8, ptr %60, i64 92
  %75 = load i32, ptr %74, align 4, !tbaa !17
  %76 = mul nsw i32 %75, 100
  %77 = getelementptr inbounds i8, ptr %64, i64 24
  %78 = load i32, ptr %77, align 4, !tbaa !18
  %79 = sdiv i32 %76, %78
  store i32 %79, ptr getelementptr inbounds (i8, ptr @cnt_secret, i64 8), align 8, !tbaa !5
  %80 = load i32, ptr @dofrags, align 4, !tbaa !5
  %.not78.2 = icmp eq i32 %80, 0
  br i1 %.not78.2, label %83, label %81

81:                                               ; preds = %59
  %82 = tail call i32 @WI_fragSum(i32 noundef 2)
  store i32 %82, ptr getelementptr inbounds (i8, ptr @cnt_frags, i64 8), align 8, !tbaa !5
  br label %83

83:                                               ; preds = %81, %59, %57
  %84 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 12), align 4, !tbaa !5
  %.not77.3 = icmp eq i32 %84, 0
  br i1 %.not77.3, label %.thread, label %85

85:                                               ; preds = %83
  %86 = load ptr, ptr @plrs, align 8, !tbaa !9
  %87 = getelementptr inbounds i8, ptr %86, i64 124
  %88 = load i32, ptr %87, align 4, !tbaa !11
  %89 = mul nsw i32 %88, 100
  %90 = load ptr, ptr @wbs, align 8, !tbaa !9
  %91 = getelementptr inbounds i8, ptr %90, i64 16
  %92 = load i32, ptr %91, align 4, !tbaa !13
  %93 = sdiv i32 %89, %92
  store i32 %93, ptr getelementptr inbounds (i8, ptr @cnt_kills, i64 12), align 4, !tbaa !5
  %94 = getelementptr inbounds i8, ptr %86, i64 128
  %95 = load i32, ptr %94, align 4, !tbaa !15
  %96 = mul nsw i32 %95, 100
  %97 = getelementptr inbounds i8, ptr %90, i64 20
  %98 = load i32, ptr %97, align 4, !tbaa !16
  %99 = sdiv i32 %96, %98
  store i32 %99, ptr getelementptr inbounds (i8, ptr @cnt_items, i64 12), align 4, !tbaa !5
  %100 = getelementptr inbounds i8, ptr %86, i64 132
  %101 = load i32, ptr %100, align 4, !tbaa !17
  %102 = mul nsw i32 %101, 100
  %103 = getelementptr inbounds i8, ptr %90, i64 24
  %104 = load i32, ptr %103, align 4, !tbaa !18
  %105 = sdiv i32 %102, %104
  store i32 %105, ptr getelementptr inbounds (i8, ptr @cnt_secret, i64 12), align 4, !tbaa !5
  %106 = load i32, ptr @dofrags, align 4, !tbaa !5
  %.not78.3 = icmp eq i32 %106, 0
  br i1 %.not78.3, label %.thread, label %107

107:                                              ; preds = %85
  %108 = tail call i32 @WI_fragSum(i32 noundef 3)
  store i32 %108, ptr getelementptr inbounds (i8, ptr @cnt_frags, i64 12), align 4, !tbaa !5
  br label %.thread

.thread:                                          ; preds = %107, %85, %83
  tail call void @S_StartSound(ptr noundef null, i32 noundef 82) #3
  store i32 10, ptr @ng_state, align 4, !tbaa !5
  %.pre = load i32, ptr @acceleratestage, align 4, !tbaa !5
  br label %301

109:                                              ; preds = %0
  switch i32 %3, label %308 [
    i32 2, label %110
    i32 4, label %161
    i32 6, label %212
    i32 8, label %265
    i32 10, label %301
  ]

110:                                              ; preds = %109
  %111 = load i32, ptr @bcnt, align 4, !tbaa !5
  %112 = and i32 %111, 3
  %.not73 = icmp eq i32 %112, 0
  br i1 %.not73, label %113, label %114

113:                                              ; preds = %110
  tail call void @S_StartSound(ptr noundef null, i32 noundef 1) #3
  br label %114

114:                                              ; preds = %113, %110
  %115 = load ptr, ptr @plrs, align 8
  %116 = load ptr, ptr @wbs, align 8
  %117 = getelementptr inbounds i8, ptr %116, i64 16
  %118 = load i32, ptr @playeringame, align 16, !tbaa !5
  %.not75 = icmp eq i32 %118, 0
  br i1 %.not75, label %127, label %119

119:                                              ; preds = %114
  %120 = load i32, ptr @cnt_kills, align 16, !tbaa !5
  %121 = add nsw i32 %120, 2
  %122 = getelementptr inbounds i8, ptr %115, i64 4
  %123 = load i32, ptr %122, align 4, !tbaa !11
  %124 = mul nsw i32 %123, 100
  %125 = load i32, ptr %117, align 4, !tbaa !13
  %126 = sdiv i32 %124, %125
  %.not76 = icmp slt i32 %121, %126
  %spec.store.select = tail call i32 @llvm.smin.i32(i32 %121, i32 %126)
  store i32 %spec.store.select, ptr @cnt_kills, align 16
  %spec.select = zext i1 %.not76 to i32
  br label %127

127:                                              ; preds = %119, %114
  %.1 = phi i32 [ 0, %114 ], [ %spec.select, %119 ]
  %128 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 4), align 4, !tbaa !5
  %.not75.1 = icmp eq i32 %128, 0
  br i1 %.not75.1, label %137, label %129

129:                                              ; preds = %127
  %130 = load i32, ptr getelementptr inbounds (i8, ptr @cnt_kills, i64 4), align 4, !tbaa !5
  %131 = add nsw i32 %130, 2
  %132 = getelementptr inbounds i8, ptr %115, i64 44
  %133 = load i32, ptr %132, align 4, !tbaa !11
  %134 = mul nsw i32 %133, 100
  %135 = load i32, ptr %117, align 4, !tbaa !13
  %136 = sdiv i32 %134, %135
  %.not76.1 = icmp slt i32 %131, %136
  %spec.store.select.1 = tail call i32 @llvm.smin.i32(i32 %131, i32 %136)
  store i32 %spec.store.select.1, ptr getelementptr inbounds (i8, ptr @cnt_kills, i64 4), align 4
  %spec.select.1 = select i1 %.not76.1, i32 1, i32 %.1
  br label %137

137:                                              ; preds = %129, %127
  %.1.1 = phi i32 [ %.1, %127 ], [ %spec.select.1, %129 ]
  %138 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 8), align 8, !tbaa !5
  %.not75.2 = icmp eq i32 %138, 0
  br i1 %.not75.2, label %147, label %139

139:                                              ; preds = %137
  %140 = load i32, ptr getelementptr inbounds (i8, ptr @cnt_kills, i64 8), align 8, !tbaa !5
  %141 = add nsw i32 %140, 2
  %142 = getelementptr inbounds i8, ptr %115, i64 84
  %143 = load i32, ptr %142, align 4, !tbaa !11
  %144 = mul nsw i32 %143, 100
  %145 = load i32, ptr %117, align 4, !tbaa !13
  %146 = sdiv i32 %144, %145
  %.not76.2 = icmp slt i32 %141, %146
  %spec.store.select.2 = tail call i32 @llvm.smin.i32(i32 %141, i32 %146)
  store i32 %spec.store.select.2, ptr getelementptr inbounds (i8, ptr @cnt_kills, i64 8), align 8
  %spec.select.2 = select i1 %.not76.2, i32 1, i32 %.1.1
  br label %147

147:                                              ; preds = %139, %137
  %.1.2 = phi i32 [ %.1.1, %137 ], [ %spec.select.2, %139 ]
  %148 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 12), align 4, !tbaa !5
  %.not75.3 = icmp eq i32 %148, 0
  br i1 %.not75.3, label %157, label %149

149:                                              ; preds = %147
  %150 = load i32, ptr getelementptr inbounds (i8, ptr @cnt_kills, i64 12), align 4, !tbaa !5
  %151 = add nsw i32 %150, 2
  %152 = getelementptr inbounds i8, ptr %115, i64 124
  %153 = load i32, ptr %152, align 4, !tbaa !11
  %154 = mul nsw i32 %153, 100
  %155 = load i32, ptr %117, align 4, !tbaa !13
  %156 = sdiv i32 %154, %155
  %.not76.3 = icmp sge i32 %151, %156
  %spec.store.select.3 = tail call i32 @llvm.smin.i32(i32 %151, i32 %156)
  store i32 %spec.store.select.3, ptr getelementptr inbounds (i8, ptr @cnt_kills, i64 12), align 4
  %.not74 = icmp eq i32 %.1.2, 0
  %or.cond111 = select i1 %.not76.3, i1 %.not74, i1 false
  br i1 %or.cond111, label %158, label %.thread97

157:                                              ; preds = %147
  %.not74.old = icmp eq i32 %.1.2, 0
  br i1 %.not74.old, label %158, label %.thread97

158:                                              ; preds = %149, %157
  tail call void @S_StartSound(ptr noundef null, i32 noundef 82) #3
  %159 = load i32, ptr @ng_state, align 4, !tbaa !5
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr @ng_state, align 4, !tbaa !5
  br label %.thread97

161:                                              ; preds = %109
  %162 = load i32, ptr @bcnt, align 4, !tbaa !5
  %163 = and i32 %162, 3
  %.not69 = icmp eq i32 %163, 0
  br i1 %.not69, label %164, label %165

164:                                              ; preds = %161
  tail call void @S_StartSound(ptr noundef null, i32 noundef 1) #3
  br label %165

165:                                              ; preds = %164, %161
  %166 = load ptr, ptr @plrs, align 8
  %167 = load ptr, ptr @wbs, align 8
  %168 = getelementptr inbounds i8, ptr %167, i64 20
  %169 = load i32, ptr @playeringame, align 16, !tbaa !5
  %.not71 = icmp eq i32 %169, 0
  br i1 %.not71, label %178, label %170

170:                                              ; preds = %165
  %171 = load i32, ptr @cnt_items, align 16, !tbaa !5
  %172 = add nsw i32 %171, 2
  %173 = getelementptr inbounds i8, ptr %166, i64 8
  %174 = load i32, ptr %173, align 4, !tbaa !15
  %175 = mul nsw i32 %174, 100
  %176 = load i32, ptr %168, align 4, !tbaa !16
  %177 = sdiv i32 %175, %176
  %.not72 = icmp slt i32 %172, %177
  %spec.store.select88 = tail call i32 @llvm.smin.i32(i32 %172, i32 %177)
  store i32 %spec.store.select88, ptr @cnt_items, align 16
  %spec.select89 = zext i1 %.not72 to i32
  br label %178

178:                                              ; preds = %170, %165
  %.3 = phi i32 [ 0, %165 ], [ %spec.select89, %170 ]
  %179 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 4), align 4, !tbaa !5
  %.not71.1 = icmp eq i32 %179, 0
  br i1 %.not71.1, label %188, label %180

180:                                              ; preds = %178
  %181 = load i32, ptr getelementptr inbounds (i8, ptr @cnt_items, i64 4), align 4, !tbaa !5
  %182 = add nsw i32 %181, 2
  %183 = getelementptr inbounds i8, ptr %166, i64 48
  %184 = load i32, ptr %183, align 4, !tbaa !15
  %185 = mul nsw i32 %184, 100
  %186 = load i32, ptr %168, align 4, !tbaa !16
  %187 = sdiv i32 %185, %186
  %.not72.1 = icmp slt i32 %182, %187
  %spec.store.select88.1 = tail call i32 @llvm.smin.i32(i32 %182, i32 %187)
  store i32 %spec.store.select88.1, ptr getelementptr inbounds (i8, ptr @cnt_items, i64 4), align 4
  %spec.select89.1 = select i1 %.not72.1, i32 1, i32 %.3
  br label %188

188:                                              ; preds = %180, %178
  %.3.1 = phi i32 [ %.3, %178 ], [ %spec.select89.1, %180 ]
  %189 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 8), align 8, !tbaa !5
  %.not71.2 = icmp eq i32 %189, 0
  br i1 %.not71.2, label %198, label %190

190:                                              ; preds = %188
  %191 = load i32, ptr getelementptr inbounds (i8, ptr @cnt_items, i64 8), align 8, !tbaa !5
  %192 = add nsw i32 %191, 2
  %193 = getelementptr inbounds i8, ptr %166, i64 88
  %194 = load i32, ptr %193, align 4, !tbaa !15
  %195 = mul nsw i32 %194, 100
  %196 = load i32, ptr %168, align 4, !tbaa !16
  %197 = sdiv i32 %195, %196
  %.not72.2 = icmp slt i32 %192, %197
  %spec.store.select88.2 = tail call i32 @llvm.smin.i32(i32 %192, i32 %197)
  store i32 %spec.store.select88.2, ptr getelementptr inbounds (i8, ptr @cnt_items, i64 8), align 8
  %spec.select89.2 = select i1 %.not72.2, i32 1, i32 %.3.1
  br label %198

198:                                              ; preds = %190, %188
  %.3.2 = phi i32 [ %.3.1, %188 ], [ %spec.select89.2, %190 ]
  %199 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 12), align 4, !tbaa !5
  %.not71.3 = icmp eq i32 %199, 0
  br i1 %.not71.3, label %208, label %200

200:                                              ; preds = %198
  %201 = load i32, ptr getelementptr inbounds (i8, ptr @cnt_items, i64 12), align 4, !tbaa !5
  %202 = add nsw i32 %201, 2
  %203 = getelementptr inbounds i8, ptr %166, i64 128
  %204 = load i32, ptr %203, align 4, !tbaa !15
  %205 = mul nsw i32 %204, 100
  %206 = load i32, ptr %168, align 4, !tbaa !16
  %207 = sdiv i32 %205, %206
  %.not72.3 = icmp sge i32 %202, %207
  %spec.store.select88.3 = tail call i32 @llvm.smin.i32(i32 %202, i32 %207)
  store i32 %spec.store.select88.3, ptr getelementptr inbounds (i8, ptr @cnt_items, i64 12), align 4
  %.not70 = icmp eq i32 %.3.2, 0
  %or.cond112 = select i1 %.not72.3, i1 %.not70, i1 false
  br i1 %or.cond112, label %209, label %.thread97

208:                                              ; preds = %198
  %.not70.old = icmp eq i32 %.3.2, 0
  br i1 %.not70.old, label %209, label %.thread97

209:                                              ; preds = %200, %208
  tail call void @S_StartSound(ptr noundef null, i32 noundef 82) #3
  %210 = load i32, ptr @ng_state, align 4, !tbaa !5
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr @ng_state, align 4, !tbaa !5
  br label %.thread97

212:                                              ; preds = %109
  %213 = load i32, ptr @bcnt, align 4, !tbaa !5
  %214 = and i32 %213, 3
  %.not64 = icmp eq i32 %214, 0
  br i1 %.not64, label %215, label %216

215:                                              ; preds = %212
  tail call void @S_StartSound(ptr noundef null, i32 noundef 1) #3
  br label %216

216:                                              ; preds = %215, %212
  %217 = load ptr, ptr @plrs, align 8
  %218 = load ptr, ptr @wbs, align 8
  %219 = getelementptr inbounds i8, ptr %218, i64 24
  %220 = load i32, ptr @playeringame, align 16, !tbaa !5
  %.not67 = icmp eq i32 %220, 0
  br i1 %.not67, label %229, label %221

221:                                              ; preds = %216
  %222 = load i32, ptr @cnt_secret, align 16, !tbaa !5
  %223 = add nsw i32 %222, 2
  %224 = getelementptr inbounds i8, ptr %217, i64 12
  %225 = load i32, ptr %224, align 4, !tbaa !17
  %226 = mul nsw i32 %225, 100
  %227 = load i32, ptr %219, align 4, !tbaa !18
  %228 = sdiv i32 %226, %227
  %.not68 = icmp slt i32 %223, %228
  %spec.store.select90 = tail call i32 @llvm.smin.i32(i32 %223, i32 %228)
  store i32 %spec.store.select90, ptr @cnt_secret, align 16
  %spec.select91 = zext i1 %.not68 to i32
  br label %229

229:                                              ; preds = %221, %216
  %.5 = phi i32 [ 0, %216 ], [ %spec.select91, %221 ]
  %230 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 4), align 4, !tbaa !5
  %.not67.1 = icmp eq i32 %230, 0
  br i1 %.not67.1, label %239, label %231

231:                                              ; preds = %229
  %232 = load i32, ptr getelementptr inbounds (i8, ptr @cnt_secret, i64 4), align 4, !tbaa !5
  %233 = add nsw i32 %232, 2
  %234 = getelementptr inbounds i8, ptr %217, i64 52
  %235 = load i32, ptr %234, align 4, !tbaa !17
  %236 = mul nsw i32 %235, 100
  %237 = load i32, ptr %219, align 4, !tbaa !18
  %238 = sdiv i32 %236, %237
  %.not68.1 = icmp slt i32 %233, %238
  %spec.store.select90.1 = tail call i32 @llvm.smin.i32(i32 %233, i32 %238)
  store i32 %spec.store.select90.1, ptr getelementptr inbounds (i8, ptr @cnt_secret, i64 4), align 4
  %spec.select91.1 = select i1 %.not68.1, i32 1, i32 %.5
  br label %239

239:                                              ; preds = %231, %229
  %.5.1 = phi i32 [ %.5, %229 ], [ %spec.select91.1, %231 ]
  %240 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 8), align 8, !tbaa !5
  %.not67.2 = icmp eq i32 %240, 0
  br i1 %.not67.2, label %249, label %241

241:                                              ; preds = %239
  %242 = load i32, ptr getelementptr inbounds (i8, ptr @cnt_secret, i64 8), align 8, !tbaa !5
  %243 = add nsw i32 %242, 2
  %244 = getelementptr inbounds i8, ptr %217, i64 92
  %245 = load i32, ptr %244, align 4, !tbaa !17
  %246 = mul nsw i32 %245, 100
  %247 = load i32, ptr %219, align 4, !tbaa !18
  %248 = sdiv i32 %246, %247
  %.not68.2 = icmp slt i32 %243, %248
  %spec.store.select90.2 = tail call i32 @llvm.smin.i32(i32 %243, i32 %248)
  store i32 %spec.store.select90.2, ptr getelementptr inbounds (i8, ptr @cnt_secret, i64 8), align 8
  %spec.select91.2 = select i1 %.not68.2, i32 1, i32 %.5.1
  br label %249

249:                                              ; preds = %241, %239
  %.5.2 = phi i32 [ %.5.1, %239 ], [ %spec.select91.2, %241 ]
  %250 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 12), align 4, !tbaa !5
  %.not67.3 = icmp eq i32 %250, 0
  br i1 %.not67.3, label %259, label %251

251:                                              ; preds = %249
  %252 = load i32, ptr getelementptr inbounds (i8, ptr @cnt_secret, i64 12), align 4, !tbaa !5
  %253 = add nsw i32 %252, 2
  %254 = getelementptr inbounds i8, ptr %217, i64 132
  %255 = load i32, ptr %254, align 4, !tbaa !17
  %256 = mul nsw i32 %255, 100
  %257 = load i32, ptr %219, align 4, !tbaa !18
  %258 = sdiv i32 %256, %257
  %.not68.3 = icmp sge i32 %253, %258
  %spec.store.select90.3 = tail call i32 @llvm.smin.i32(i32 %253, i32 %258)
  store i32 %spec.store.select90.3, ptr getelementptr inbounds (i8, ptr @cnt_secret, i64 12), align 4
  %.not65 = icmp eq i32 %.5.2, 0
  %or.cond113 = select i1 %.not68.3, i1 %.not65, i1 false
  br i1 %or.cond113, label %260, label %.thread97

259:                                              ; preds = %249
  %.not65.old = icmp eq i32 %.5.2, 0
  br i1 %.not65.old, label %260, label %.thread97

260:                                              ; preds = %251, %259
  tail call void @S_StartSound(ptr noundef null, i32 noundef 82) #3
  %261 = load i32, ptr @dofrags, align 4, !tbaa !5
  %.not66 = icmp eq i32 %261, 0
  %262 = select i1 %.not66, i32 3, i32 1
  %263 = load i32, ptr @ng_state, align 4, !tbaa !5
  %264 = add nsw i32 %262, %263
  store i32 %264, ptr @ng_state, align 4, !tbaa !5
  br label %.thread97

265:                                              ; preds = %109
  %266 = load i32, ptr @bcnt, align 4, !tbaa !5
  %267 = and i32 %266, 3
  %.not60 = icmp eq i32 %267, 0
  br i1 %.not60, label %268, label %269

268:                                              ; preds = %265
  tail call void @S_StartSound(ptr noundef null, i32 noundef 1) #3
  br label %269

269:                                              ; preds = %268, %265
  %270 = load i32, ptr @playeringame, align 16, !tbaa !5
  %.not62 = icmp eq i32 %270, 0
  br i1 %.not62, label %276, label %271

271:                                              ; preds = %269
  %272 = load i32, ptr @cnt_frags, align 16, !tbaa !5
  %273 = add nsw i32 %272, 1
  store i32 %273, ptr @cnt_frags, align 16, !tbaa !5
  %274 = tail call i32 @WI_fragSum(i32 noundef 0)
  %.not63 = icmp slt i32 %273, %274
  br i1 %.not63, label %276, label %275

275:                                              ; preds = %271
  store i32 %274, ptr @cnt_frags, align 16, !tbaa !5
  br label %276

276:                                              ; preds = %271, %275, %269
  %.7 = phi i32 [ 0, %275 ], [ 0, %269 ], [ 1, %271 ]
  %277 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 4), align 4, !tbaa !5
  %.not62.1 = icmp eq i32 %277, 0
  br i1 %.not62.1, label %283, label %278

278:                                              ; preds = %276
  %279 = load i32, ptr getelementptr inbounds (i8, ptr @cnt_frags, i64 4), align 4, !tbaa !5
  %280 = add nsw i32 %279, 1
  store i32 %280, ptr getelementptr inbounds (i8, ptr @cnt_frags, i64 4), align 4, !tbaa !5
  %281 = tail call i32 @WI_fragSum(i32 noundef 1)
  %.not63.1 = icmp slt i32 %280, %281
  br i1 %.not63.1, label %283, label %282

282:                                              ; preds = %278
  store i32 %281, ptr getelementptr inbounds (i8, ptr @cnt_frags, i64 4), align 4, !tbaa !5
  br label %283

283:                                              ; preds = %282, %278, %276
  %.7.1 = phi i32 [ %.7, %282 ], [ %.7, %276 ], [ 1, %278 ]
  %284 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 8), align 8, !tbaa !5
  %.not62.2 = icmp eq i32 %284, 0
  br i1 %.not62.2, label %290, label %285

285:                                              ; preds = %283
  %286 = load i32, ptr getelementptr inbounds (i8, ptr @cnt_frags, i64 8), align 8, !tbaa !5
  %287 = add nsw i32 %286, 1
  store i32 %287, ptr getelementptr inbounds (i8, ptr @cnt_frags, i64 8), align 8, !tbaa !5
  %288 = tail call i32 @WI_fragSum(i32 noundef 2)
  %.not63.2 = icmp slt i32 %287, %288
  br i1 %.not63.2, label %290, label %289

289:                                              ; preds = %285
  store i32 %288, ptr getelementptr inbounds (i8, ptr @cnt_frags, i64 8), align 8, !tbaa !5
  br label %290

290:                                              ; preds = %289, %285, %283
  %.7.2 = phi i32 [ %.7.1, %289 ], [ %.7.1, %283 ], [ 1, %285 ]
  %291 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 12), align 4, !tbaa !5
  %.not62.3 = icmp eq i32 %291, 0
  br i1 %.not62.3, label %297, label %292

292:                                              ; preds = %290
  %293 = load i32, ptr getelementptr inbounds (i8, ptr @cnt_frags, i64 12), align 4, !tbaa !5
  %294 = add nsw i32 %293, 1
  store i32 %294, ptr getelementptr inbounds (i8, ptr @cnt_frags, i64 12), align 4, !tbaa !5
  %295 = tail call i32 @WI_fragSum(i32 noundef 3)
  %.not63.3 = icmp slt i32 %294, %295
  br i1 %.not63.3, label %.thread97, label %296

296:                                              ; preds = %292
  store i32 %295, ptr getelementptr inbounds (i8, ptr @cnt_frags, i64 12), align 4, !tbaa !5
  br label %297

297:                                              ; preds = %296, %290
  %.not61 = icmp eq i32 %.7.2, 0
  br i1 %.not61, label %298, label %.thread97

298:                                              ; preds = %297
  tail call void @S_StartSound(ptr noundef null, i32 noundef 57) #3
  %299 = load i32, ptr @ng_state, align 4, !tbaa !5
  %300 = add nsw i32 %299, 1
  store i32 %300, ptr @ng_state, align 4, !tbaa !5
  br label %.thread97

301:                                              ; preds = %.thread, %109
  %302 = phi i32 [ %.pre, %.thread ], [ %1, %109 ]
  %.not59 = icmp eq i32 %302, 0
  br i1 %.not59, label %.thread97, label %303

303:                                              ; preds = %301
  tail call void @S_StartSound(ptr noundef null, i32 noundef 3) #3
  %304 = load i32, ptr @gamemode, align 4, !tbaa !5
  %305 = icmp eq i32 %304, 2
  br i1 %305, label %306, label %307

306:                                              ; preds = %303
  tail call void @WI_initNoState()
  br label %.thread97

307:                                              ; preds = %303
  tail call void @WI_initShowNextLoc()
  br label %.thread97

308:                                              ; preds = %109
  %309 = and i32 %3, 1
  %.not = icmp eq i32 %309, 0
  br i1 %.not, label %.thread97, label %310

310:                                              ; preds = %308
  %311 = load i32, ptr @cnt_pause, align 4, !tbaa !5
  %312 = add nsw i32 %311, -1
  store i32 %312, ptr @cnt_pause, align 4, !tbaa !5
  %.not58 = icmp eq i32 %312, 0
  br i1 %.not58, label %313, label %.thread97

313:                                              ; preds = %310
  %314 = add nsw i32 %3, 1
  store i32 %314, ptr @ng_state, align 4, !tbaa !5
  store i32 35, ptr @cnt_pause, align 4, !tbaa !5
  br label %.thread97

.thread97:                                        ; preds = %292, %251, %200, %149, %209, %208, %298, %297, %308, %313, %310, %301, %307, %306, %259, %260, %157, %158
  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}


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