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

; 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.wbstartstruct_t = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [4 x %struct.wbplayerstruct_t] }
%struct.wbplayerstruct_t = type { i32, i32, i32, i32, i32, [4 x i32], i32 }
%struct.player_s = type { ptr, i32, %struct.ticcmd_t, i32, i32, i32, i32, i32, i32, i32, [6 x i32], [6 x i32], i32, [4 x i32], i32, i32, [9 x i32], [4 x i32], [4 x i32], i32, i32, i32, i32, i32, i32, i32, ptr, i32, i32, ptr, i32, i32, i32, [2 x %struct.pspdef_t], i32 }
%struct.ticcmd_t = type { i8, i8, i16, i16, i8, i8 }
%struct.pspdef_t = type { ptr, i32, i32, i32 }
%struct.mapthing_t = type { i16, i16, i16, i16, i16 }

@gamemode = external global i32, align 4
@wminfo = external global %struct.wbstartstruct_t, align 4
@totalsecret = external global i32, align 4
@totalitems = external global i32, align 4
@totalkills = external global i32, align 4
@players = external global [4 x %struct.player_s], align 16
@consoleplayer = external global i32, align 4
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [37 x i8], align 1
@leveltime = external global i32, align 4
@rejectmatrix = external dso_local global ptr, align 8
@bodyqueslot = external global i32, align 4
@deathmatchstarts = external dso_local global [10 x %struct.mapthing_t], align 16
@deathmatch_p = external dso_local global ptr, align 8
@deathmatch = external global i32, align 4
@playeringame = external global [4 x i32], align 16
@iquetail = external global i32, align 4
@iquehead = external global i32, align 4
@precache = external global i32, align 4

; Function Attrs: nounwind uwtable
declare dso_local void @P_LoadVertexes(i32 noundef) #0

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

declare ptr @W_CacheLumpNum(i32 noundef, i32 noundef) #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @P_LoadSegs(i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @P_LoadSubsectors(i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @P_LoadSectors(i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @P_LoadNodes(i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @P_LoadThings(i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @P_LoadLineDefs(i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @P_LoadSideDefs(i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @P_LoadBlockMap(i32 noundef) #0

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

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

; Function Attrs: nounwind uwtable
define dso_local void @P_SetupLevel(i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) #0 {
  %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 [9 x i8], align 1
  %11 = alloca i32, align 4
  store i32 %0, ptr %5, align 4, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !5
  store i32 %3, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 9, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %12 = load i32, ptr %7, align 4, !tbaa !5
  %13 = load i32, ptr %8, align 4, !tbaa !5
  store i32 0, ptr getelementptr inbounds (%struct.wbstartstruct_t, ptr @wminfo, i32 0, i32 7), align 4, !tbaa !9
  store i32 0, ptr @totalsecret, align 4, !tbaa !5
  store i32 0, ptr @totalitems, align 4, !tbaa !5
  store i32 0, ptr @totalkills, align 4, !tbaa !5
  store i32 180, ptr getelementptr inbounds (%struct.wbstartstruct_t, ptr @wminfo, i32 0, i32 8), align 4, !tbaa !11
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %30, %4
  %15 = load i32, ptr %9, align 4, !tbaa !5
  %16 = icmp slt i32 %15, 4
  br i1 %16, label %17, label %33

17:                                               ; preds = %14
  %18 = load i32, ptr %9, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [4 x %struct.player_s], ptr @players, i64 0, i64 %19
  %21 = getelementptr inbounds %struct.player_s, ptr %20, i32 0, i32 24
  store i32 0, ptr %21, align 4, !tbaa !12
  %22 = load i32, ptr %9, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [4 x %struct.player_s], ptr @players, i64 0, i64 %23
  %25 = getelementptr inbounds %struct.player_s, ptr %24, i32 0, i32 25
  store i32 0, ptr %25, align 8, !tbaa !17
  %26 = load i32, ptr %9, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [4 x %struct.player_s], ptr @players, i64 0, i64 %27
  %29 = getelementptr inbounds %struct.player_s, ptr %28, i32 0, i32 23
  store i32 0, ptr %29, align 16, !tbaa !18
  br label %30

30:                                               ; preds = %17
  %31 = load i32, ptr %9, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %9, align 4, !tbaa !5
  br label %14, !llvm.loop !19

33:                                               ; preds = %14
  %34 = load i32, ptr @consoleplayer, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [4 x %struct.player_s], ptr @players, i64 0, i64 %35
  %37 = getelementptr inbounds %struct.player_s, ptr %36, i32 0, i32 3
  store i32 1, ptr %37, align 4, !tbaa !21
  call void @S_Start()
  call void @Z_FreeTags(i32 noundef 50, i32 noundef 99)
  call void @P_InitThinkers()
  call void @W_Reload()
  %38 = load i32, ptr @gamemode, align 4, !tbaa !5
  %39 = icmp eq i32 %38, 2
  br i1 %39, label %40, label %64

40:                                               ; preds = %33
  %41 = load i32, ptr %6, align 4, !tbaa !5
  %42 = icmp sge i32 %41, 0
  br i1 %42, label %43, label %50

43:                                               ; preds = %40
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = icmp slt i32 %44, 10
  br i1 %45, label %46, label %50

46:                                               ; preds = %43
  %47 = getelementptr inbounds [9 x i8], ptr %10, i64 0, i64 0
  %48 = load i32, ptr %6, align 4, !tbaa !5
  %49 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %47, ptr noundef @.str.1, i32 noundef %48) #5
  br label %63

50:                                               ; preds = %43, %40
  %51 = load i32, ptr %6, align 4, !tbaa !5
  %52 = icmp sge i32 %51, 0
  br i1 %52, label %53, label %60

53:                                               ; preds = %50
  %54 = load i32, ptr %6, align 4, !tbaa !5
  %55 = icmp slt i32 %54, 100000
  br i1 %55, label %56, label %60

56:                                               ; preds = %53
  %57 = getelementptr inbounds [9 x i8], ptr %10, i64 0, i64 0
  %58 = load i32, ptr %6, align 4, !tbaa !5
  %59 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %57, ptr noundef @.str.2, i32 noundef %58) #5
  br label %62

60:                                               ; preds = %53, %50
  %61 = load i32, ptr %6, align 4, !tbaa !5
  call void (ptr, ...) @I_Error(ptr noundef @.str.3, i32 noundef %61) #6
  unreachable

62:                                               ; preds = %56
  br label %63

63:                                               ; preds = %62, %46
  br label %76

64:                                               ; preds = %33
  %65 = getelementptr inbounds [9 x i8], ptr %10, i64 0, i64 0
  store i8 69, ptr %65, align 1, !tbaa !22
  %66 = load i32, ptr %5, align 4, !tbaa !5
  %67 = add nsw i32 48, %66
  %68 = trunc i32 %67 to i8
  %69 = getelementptr inbounds [9 x i8], ptr %10, i64 0, i64 1
  store i8 %68, ptr %69, align 1, !tbaa !22
  %70 = getelementptr inbounds [9 x i8], ptr %10, i64 0, i64 2
  store i8 77, ptr %70, align 1, !tbaa !22
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = add nsw i32 48, %71
  %73 = trunc i32 %72 to i8
  %74 = getelementptr inbounds [9 x i8], ptr %10, i64 0, i64 3
  store i8 %73, ptr %74, align 1, !tbaa !22
  %75 = getelementptr inbounds [9 x i8], ptr %10, i64 0, i64 4
  store i8 0, ptr %75, align 1, !tbaa !22
  br label %76

76:                                               ; preds = %64, %63
  %77 = getelementptr inbounds [9 x i8], ptr %10, i64 0, i64 0
  %78 = call i32 @W_GetNumForName(ptr noundef %77)
  store i32 %78, ptr %11, align 4, !tbaa !5
  store i32 0, ptr @leveltime, align 4, !tbaa !5
  %79 = load i32, ptr %11, align 4, !tbaa !5
  %80 = add nsw i32 %79, 10
  call void @P_LoadBlockMap(i32 noundef %80)
  %81 = load i32, ptr %11, align 4, !tbaa !5
  %82 = add nsw i32 %81, 4
  call void @P_LoadVertexes(i32 noundef %82)
  %83 = load i32, ptr %11, align 4, !tbaa !5
  %84 = add nsw i32 %83, 8
  call void @P_LoadSectors(i32 noundef %84)
  %85 = load i32, ptr %11, align 4, !tbaa !5
  %86 = add nsw i32 %85, 3
  call void @P_LoadSideDefs(i32 noundef %86)
  %87 = load i32, ptr %11, align 4, !tbaa !5
  %88 = add nsw i32 %87, 2
  call void @P_LoadLineDefs(i32 noundef %88)
  %89 = load i32, ptr %11, align 4, !tbaa !5
  %90 = add nsw i32 %89, 6
  call void @P_LoadSubsectors(i32 noundef %90)
  %91 = load i32, ptr %11, align 4, !tbaa !5
  %92 = add nsw i32 %91, 7
  call void @P_LoadNodes(i32 noundef %92)
  %93 = load i32, ptr %11, align 4, !tbaa !5
  %94 = add nsw i32 %93, 5
  call void @P_LoadSegs(i32 noundef %94)
  %95 = load i32, ptr %11, align 4, !tbaa !5
  %96 = add nsw i32 %95, 9
  %97 = call ptr @W_CacheLumpNum(i32 noundef %96, i32 noundef 50)
  store ptr %97, ptr @rejectmatrix, align 8, !tbaa !23
  call void @P_GroupLines()
  store i32 0, ptr @bodyqueslot, align 4, !tbaa !5
  store ptr @deathmatchstarts, ptr @deathmatch_p, align 8, !tbaa !23
  %98 = load i32, ptr %11, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  call void @P_LoadThings(i32 noundef %99)
  %100 = load i32, ptr @deathmatch, align 4, !tbaa !5
  %101 = icmp ne i32 %100, 0
  br i1 %101, label %102, label %123

102:                                              ; preds = %76
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %119, %102
  %104 = load i32, ptr %9, align 4, !tbaa !5
  %105 = icmp slt i32 %104, 4
  br i1 %105, label %106, label %122

106:                                              ; preds = %103
  %107 = load i32, ptr %9, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [4 x i32], ptr @playeringame, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = icmp ne i32 %110, 0
  br i1 %111, label %112, label %118

112:                                              ; preds = %106
  %113 = load i32, ptr %9, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [4 x %struct.player_s], ptr @players, i64 0, i64 %114
  %116 = getelementptr inbounds %struct.player_s, ptr %115, i32 0, i32 0
  store ptr null, ptr %116, align 16, !tbaa !24
  %117 = load i32, ptr %9, align 4, !tbaa !5
  call void @G_DeathMatchSpawnPlayer(i32 noundef %117)
  br label %118

118:                                              ; preds = %112, %106
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %9, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %9, align 4, !tbaa !5
  br label %103, !llvm.loop !25

122:                                              ; preds = %103
  br label %123

123:                                              ; preds = %122, %76
  store i32 0, ptr @iquetail, align 4, !tbaa !5
  store i32 0, ptr @iquehead, align 4, !tbaa !5
  call void @P_SpawnSpecials()
  %124 = load i32, ptr @precache, align 4, !tbaa !5
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %126, label %127

126:                                              ; preds = %123
  call void @R_PrecacheLevel()
  br label %127

127:                                              ; preds = %126, %123
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 9, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  ret void
}

declare void @S_Start() #2

declare void @Z_FreeTags(i32 noundef, i32 noundef) #2

declare void @P_InitThinkers() #2

declare void @W_Reload() #2

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #4

declare i32 @W_GetNumForName(ptr noundef) #2

declare void @G_DeathMatchSpawnPlayer(i32 noundef) #2

declare void @P_SpawnSpecials() #2

declare void @R_PrecacheLevel() #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { nounwind "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 #5 = { nounwind }
attributes #6 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 28}
!10 = !{!"", !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}
!11 = !{!10, !6, i64 32}
!12 = !{!13, !6, i64 212}
!13 = !{!"player_s", !14, i64 0, !6, i64 8, !15, i64 12, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44, !7, i64 48, !7, i64 72, !6, i64 96, !7, i64 100, !6, i64 116, !6, i64 120, !7, i64 124, !7, i64 160, !7, i64 176, !6, i64 192, !6, i64 196, !6, i64 200, !6, i64 204, !6, i64 208, !6, i64 212, !6, i64 216, !14, i64 224, !6, i64 232, !6, i64 236, !14, i64 240, !6, i64 248, !6, i64 252, !6, i64 256, !7, i64 264, !6, i64 312}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!"", !7, i64 0, !7, i64 1, !16, i64 2, !16, i64 4, !7, i64 6, !7, i64 7}
!16 = !{!"short", !7, i64 0}
!17 = !{!13, !6, i64 216}
!18 = !{!13, !6, i64 208}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!13, !6, i64 20}
!22 = !{!7, !7, i64 0}
!23 = !{!14, !14, i64 0}
!24 = !{!13, !14, i64 0}
!25 = distinct !{!25, !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"

%struct.wbstartstruct_t = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [4 x %struct.wbplayerstruct_t] }
%struct.wbplayerstruct_t = type { i32, i32, i32, i32, i32, [4 x i32], i32 }
%struct.player_s = type { ptr, i32, %struct.ticcmd_t, i32, i32, i32, i32, i32, i32, i32, [6 x i32], [6 x i32], i32, [4 x i32], i32, i32, [9 x i32], [4 x i32], [4 x i32], i32, i32, i32, i32, i32, i32, i32, ptr, i32, i32, ptr, i32, i32, i32, [2 x %struct.pspdef_t], i32 }
%struct.ticcmd_t = type { i8, i8, i16, i16, i8, i8 }
%struct.pspdef_t = type { ptr, i32, i32, i32 }
%struct.mapthing_t = type { i16, i16, i16, i16, i16 }

@gamemode = external local_unnamed_addr global i32, align 4
@wminfo = external local_unnamed_addr global %struct.wbstartstruct_t, align 4
@totalsecret = external local_unnamed_addr global i32, align 4
@totalitems = external local_unnamed_addr global i32, align 4
@totalkills = external local_unnamed_addr global i32, align 4
@players = external local_unnamed_addr global [4 x %struct.player_s], align 16
@consoleplayer = external local_unnamed_addr global i32, align 4
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [37 x i8], align 1
@leveltime = external local_unnamed_addr global i32, align 4
@rejectmatrix = external dso_local local_unnamed_addr global ptr, align 8
@bodyqueslot = external local_unnamed_addr global i32, align 4
@deathmatchstarts = external dso_local global [10 x %struct.mapthing_t], align 16
@deathmatch_p = external dso_local local_unnamed_addr global ptr, align 8
@deathmatch = external local_unnamed_addr global i32, align 4
@playeringame = external local_unnamed_addr global [4 x i32], align 16
@iquetail = external local_unnamed_addr global i32, align 4
@iquehead = external local_unnamed_addr global i32, align 4
@precache = external local_unnamed_addr global i32, align 4

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

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

declare ptr @W_CacheLumpNum(i32 noundef, i32 noundef) local_unnamed_addr #2

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @P_SetupLevel(i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #0 {
  %5 = alloca [9 x i8], align 1
  call void @llvm.lifetime.start.p0(i64 9, ptr nonnull %5) #5
  store i32 0, ptr getelementptr inbounds (i8, ptr @wminfo, i64 28), align 4, !tbaa !5
  store i32 0, ptr @totalsecret, align 4, !tbaa !10
  store i32 0, ptr @totalitems, align 4, !tbaa !10
  store i32 0, ptr @totalkills, align 4, !tbaa !10
  store i32 180, ptr getelementptr inbounds (i8, ptr @wminfo, i64 32), align 4, !tbaa !11
  store i32 0, ptr getelementptr inbounds (i8, ptr @players, i64 212), align 4, !tbaa !12
  store i32 0, ptr getelementptr inbounds (i8, ptr @players, i64 216), align 8, !tbaa !17
  store i32 0, ptr getelementptr inbounds (i8, ptr @players, i64 208), align 16, !tbaa !18
  store i32 0, ptr getelementptr inbounds (i8, ptr @players, i64 532), align 4, !tbaa !12
  store i32 0, ptr getelementptr inbounds (i8, ptr @players, i64 536), align 8, !tbaa !17
  store i32 0, ptr getelementptr inbounds (i8, ptr @players, i64 528), align 16, !tbaa !18
  store i32 0, ptr getelementptr inbounds (i8, ptr @players, i64 852), align 4, !tbaa !12
  store i32 0, ptr getelementptr inbounds (i8, ptr @players, i64 856), align 8, !tbaa !17
  store i32 0, ptr getelementptr inbounds (i8, ptr @players, i64 848), align 16, !tbaa !18
  store i32 0, ptr getelementptr inbounds (i8, ptr @players, i64 1172), align 4, !tbaa !12
  store i32 0, ptr getelementptr inbounds (i8, ptr @players, i64 1176), align 8, !tbaa !17
  store i32 0, ptr getelementptr inbounds (i8, ptr @players, i64 1168), align 16, !tbaa !18
  %6 = load i32, ptr @consoleplayer, align 4, !tbaa !10
  %7 = sext i32 %6 to i64
  %8 = getelementptr inbounds [4 x %struct.player_s], ptr @players, i64 0, i64 %7, i32 3
  store i32 1, ptr %8, align 4, !tbaa !19
  tail call void @S_Start() #5
  tail call void @Z_FreeTags(i32 noundef 50, i32 noundef 99) #5
  tail call void @P_InitThinkers() #5
  tail call void @W_Reload() #5
  %9 = load i32, ptr @gamemode, align 4, !tbaa !10
  %10 = icmp eq i32 %9, 2
  br i1 %10, label %11, label %18

11:                                               ; preds = %4
  %or.cond = icmp ult i32 %1, 10
  br i1 %or.cond, label %12, label %14

12:                                               ; preds = %11
  %13 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1) #5
  br label %27

14:                                               ; preds = %11
  %or.cond3 = icmp ult i32 %1, 100000
  br i1 %or.cond3, label %15, label %17

15:                                               ; preds = %14
  %16 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %1) #5
  br label %27

17:                                               ; preds = %14
  tail call void (ptr, ...) @I_Error(ptr noundef nonnull @.str.3, i32 noundef %1) #6
  unreachable

18:                                               ; preds = %4
  store i8 69, ptr %5, align 1, !tbaa !20
  %19 = trunc i32 %0 to i8
  %20 = add i8 %19, 48
  %21 = getelementptr inbounds i8, ptr %5, i64 1
  store i8 %20, ptr %21, align 1, !tbaa !20
  %22 = getelementptr inbounds i8, ptr %5, i64 2
  store i8 77, ptr %22, align 1, !tbaa !20
  %23 = trunc i32 %1 to i8
  %24 = add i8 %23, 48
  %25 = getelementptr inbounds i8, ptr %5, i64 3
  store i8 %24, ptr %25, align 1, !tbaa !20
  %26 = getelementptr inbounds i8, ptr %5, i64 4
  store i8 0, ptr %26, align 1, !tbaa !20
  br label %27

27:                                               ; preds = %12, %15, %18
  %28 = call i32 @W_GetNumForName(ptr noundef nonnull %5) #5
  store i32 0, ptr @leveltime, align 4, !tbaa !10
  %29 = add nsw i32 %28, 10
  call void @P_LoadBlockMap(i32 noundef %29)
  %30 = add nsw i32 %28, 4
  call void @P_LoadVertexes(i32 noundef %30)
  %31 = add nsw i32 %28, 8
  call void @P_LoadSectors(i32 noundef %31)
  %32 = add nsw i32 %28, 3
  call void @P_LoadSideDefs(i32 noundef %32)
  %33 = add nsw i32 %28, 2
  call void @P_LoadLineDefs(i32 noundef %33)
  %34 = add nsw i32 %28, 6
  call void @P_LoadSubsectors(i32 noundef %34)
  %35 = add nsw i32 %28, 7
  call void @P_LoadNodes(i32 noundef %35)
  %36 = add nsw i32 %28, 5
  call void @P_LoadSegs(i32 noundef %36)
  %37 = add nsw i32 %28, 9
  %38 = call ptr @W_CacheLumpNum(i32 noundef %37, i32 noundef 50) #5
  store ptr %38, ptr @rejectmatrix, align 8, !tbaa !21
  call void @P_GroupLines()
  store i32 0, ptr @bodyqueslot, align 4, !tbaa !10
  store ptr @deathmatchstarts, ptr @deathmatch_p, align 8, !tbaa !21
  %39 = add nsw i32 %28, 1
  call void @P_LoadThings(i32 noundef %39)
  %40 = load i32, ptr @deathmatch, align 4, !tbaa !10
  %.not = icmp eq i32 %40, 0
  br i1 %.not, label %.loopexit, label %.preheader.preheader

.preheader.preheader:                             ; preds = %27
  %41 = load i32, ptr @playeringame, align 16, !tbaa !10
  %.not36 = icmp eq i32 %41, 0
  br i1 %.not36, label %.preheader.1, label %42

42:                                               ; preds = %.preheader.preheader
  store ptr null, ptr @players, align 16, !tbaa !22
  call void @G_DeathMatchSpawnPlayer(i32 noundef 0) #5
  br label %.preheader.1

.preheader.1:                                     ; preds = %.preheader.preheader, %42
  %43 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 4), align 4, !tbaa !10
  %.not36.1 = icmp eq i32 %43, 0
  br i1 %.not36.1, label %.preheader.2, label %44

44:                                               ; preds = %.preheader.1
  store ptr null, ptr getelementptr inbounds (i8, ptr @players, i64 320), align 16, !tbaa !22
  call void @G_DeathMatchSpawnPlayer(i32 noundef 1) #5
  br label %.preheader.2

.preheader.2:                                     ; preds = %44, %.preheader.1
  %45 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 8), align 8, !tbaa !10
  %.not36.2 = icmp eq i32 %45, 0
  br i1 %.not36.2, label %.preheader.3, label %46

46:                                               ; preds = %.preheader.2
  store ptr null, ptr getelementptr inbounds (i8, ptr @players, i64 640), align 16, !tbaa !22
  call void @G_DeathMatchSpawnPlayer(i32 noundef 2) #5
  br label %.preheader.3

.preheader.3:                                     ; preds = %46, %.preheader.2
  %47 = load i32, ptr getelementptr inbounds (i8, ptr @playeringame, i64 12), align 4, !tbaa !10
  %.not36.3 = icmp eq i32 %47, 0
  br i1 %.not36.3, label %.loopexit, label %48

48:                                               ; preds = %.preheader.3
  store ptr null, ptr getelementptr inbounds (i8, ptr @players, i64 960), align 16, !tbaa !22
  call void @G_DeathMatchSpawnPlayer(i32 noundef 3) #5
  br label %.loopexit

.loopexit:                                        ; preds = %.preheader.3, %48, %27
  store i32 0, ptr @iquetail, align 4, !tbaa !10
  store i32 0, ptr @iquehead, align 4, !tbaa !10
  call void @P_SpawnSpecials() #5
  %49 = load i32, ptr @precache, align 4, !tbaa !10
  %.not35 = icmp eq i32 %49, 0
  br i1 %.not35, label %51, label %50

50:                                               ; preds = %.loopexit
  call void @R_PrecacheLevel() #5
  br label %51

51:                                               ; preds = %50, %.loopexit
  call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %5) #5
  ret void
}

declare void @S_Start() local_unnamed_addr #2

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

declare void @P_InitThinkers() local_unnamed_addr #2

declare void @W_Reload() local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #4

declare i32 @W_GetNumForName(ptr noundef) local_unnamed_addr #2

declare void @G_DeathMatchSpawnPlayer(i32 noundef) local_unnamed_addr #2

declare void @P_SpawnSpecials() local_unnamed_addr #2

declare void @R_PrecacheLevel() local_unnamed_addr #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { nofree nounwind "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 #5 = { nounwind }
attributes #6 = { noreturn 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 28}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !8, i64 40}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!7, !7, i64 0}
!11 = !{!6, !7, i64 32}
!12 = !{!13, !7, i64 212}
!13 = !{!"player_s", !14, i64 0, !7, i64 8, !15, i64 12, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !8, i64 48, !8, i64 72, !7, i64 96, !8, i64 100, !7, i64 116, !7, i64 120, !8, i64 124, !8, i64 160, !8, i64 176, !7, i64 192, !7, i64 196, !7, i64 200, !7, i64 204, !7, i64 208, !7, i64 212, !7, i64 216, !14, i64 224, !7, i64 232, !7, i64 236, !14, i64 240, !7, i64 248, !7, i64 252, !7, i64 256, !8, i64 264, !7, i64 312}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!"", !8, i64 0, !8, i64 1, !16, i64 2, !16, i64 4, !8, i64 6, !8, i64 7}
!16 = !{!"short", !8, i64 0}
!17 = !{!13, !7, i64 216}
!18 = !{!13, !7, i64 208}
!19 = !{!13, !7, i64 20}
!20 = !{!8, !8, i64 0}
!21 = !{!14, !14, i64 0}
!22 = !{!13, !14, i64 0}


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