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

; 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.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.mobj_s = type { %struct.thinker_s, i32, i32, i32, ptr, ptr, i32, i32, i32, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, i32, ptr, i32, i32, i32, i32, ptr, i32, i32, ptr, i32, %struct.mapthing_t, ptr }
%struct.thinker_s = type { ptr, ptr, %union.actionf_t }
%union.actionf_t = type { ptr }
%struct.mapthing_t = type { i16, i16, i16, i16, i16 }
%struct.subsector_s = type { ptr, i16, i16 }
%struct.sector_t = type { i32, i32, i16, i16, i16, i16, i16, i32, ptr, [4 x i32], %struct.degenmobj_t, i32, ptr, ptr, i32, ptr }
%struct.degenmobj_t = type { %struct.thinker_s, i32, i32, i32 }

@consoleplayer = external dso_local global i32, align 4
@players = external dso_local global [4 x %struct.player_s], align 16
@bodyqueslot = external dso_local global i32, align 4
@bodyque = external dso_local global [32 x ptr], align 16
@finecosine = external global ptr, align 8
@finesine = external global [10240 x i32], align 16

; 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
define dso_local i32 @G_CheckSpot(i32 noundef %0, ptr noundef %1) #1 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %13 = load i32, ptr %4, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [4 x %struct.player_s], ptr @players, i64 0, i64 %14
  %16 = getelementptr inbounds %struct.player_s, ptr %15, i32 0, i32 0
  %17 = load ptr, ptr %16, align 16, !tbaa !11
  %18 = icmp ne ptr %17, null
  br i1 %18, label %58, label %19

19:                                               ; preds = %2
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %54, %19
  %21 = load i32, ptr %11, align 4, !tbaa !5
  %22 = load i32, ptr %4, align 4, !tbaa !5
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %24, label %57

24:                                               ; preds = %20
  %25 = load i32, ptr %11, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [4 x %struct.player_s], ptr @players, i64 0, i64 %26
  %28 = getelementptr inbounds %struct.player_s, ptr %27, i32 0, i32 0
  %29 = load ptr, ptr %28, align 16, !tbaa !11
  %30 = getelementptr inbounds %struct.mobj_s, ptr %29, i32 0, i32 1
  %31 = load i32, ptr %30, align 8, !tbaa !15
  %32 = load ptr, ptr %5, align 8, !tbaa !9
  %33 = getelementptr inbounds %struct.mapthing_t, ptr %32, i32 0, i32 0
  %34 = load i16, ptr %33, align 2, !tbaa !19
  %35 = sext i16 %34 to i32
  %36 = shl i32 %35, 16
  %37 = icmp eq i32 %31, %36
  br i1 %37, label %38, label %53

38:                                               ; preds = %24
  %39 = load i32, ptr %11, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [4 x %struct.player_s], ptr @players, i64 0, i64 %40
  %42 = getelementptr inbounds %struct.player_s, ptr %41, i32 0, i32 0
  %43 = load ptr, ptr %42, align 16, !tbaa !11
  %44 = getelementptr inbounds %struct.mobj_s, ptr %43, i32 0, i32 2
  %45 = load i32, ptr %44, align 4, !tbaa !20
  %46 = load ptr, ptr %5, align 8, !tbaa !9
  %47 = getelementptr inbounds %struct.mapthing_t, ptr %46, i32 0, i32 1
  %48 = load i16, ptr %47, align 2, !tbaa !21
  %49 = sext i16 %48 to i32
  %50 = shl i32 %49, 16
  %51 = icmp eq i32 %45, %50
  br i1 %51, label %52, label %53

52:                                               ; preds = %38
  store i32 0, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %140

53:                                               ; preds = %38, %24
  br label %54

54:                                               ; preds = %53
  %55 = load i32, ptr %11, align 4, !tbaa !5
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %11, align 4, !tbaa !5
  br label %20, !llvm.loop !22

57:                                               ; preds = %20
  store i32 1, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %140

58:                                               ; preds = %2
  %59 = load ptr, ptr %5, align 8, !tbaa !9
  %60 = getelementptr inbounds %struct.mapthing_t, ptr %59, i32 0, i32 0
  %61 = load i16, ptr %60, align 2, !tbaa !19
  %62 = sext i16 %61 to i32
  %63 = shl i32 %62, 16
  store i32 %63, ptr %6, align 4, !tbaa !5
  %64 = load ptr, ptr %5, align 8, !tbaa !9
  %65 = getelementptr inbounds %struct.mapthing_t, ptr %64, i32 0, i32 1
  %66 = load i16, ptr %65, align 2, !tbaa !21
  %67 = sext i16 %66 to i32
  %68 = shl i32 %67, 16
  store i32 %68, ptr %7, align 4, !tbaa !5
  %69 = load i32, ptr %4, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [4 x %struct.player_s], ptr @players, i64 0, i64 %70
  %72 = getelementptr inbounds %struct.player_s, ptr %71, i32 0, i32 0
  %73 = load ptr, ptr %72, align 16, !tbaa !11
  %74 = load i32, ptr %6, align 4, !tbaa !5
  %75 = load i32, ptr %7, align 4, !tbaa !5
  %76 = call i32 @P_CheckPosition(ptr noundef %73, i32 noundef %74, i32 noundef %75)
  %77 = icmp ne i32 %76, 0
  br i1 %77, label %79, label %78

78:                                               ; preds = %58
  store i32 0, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %140

79:                                               ; preds = %58
  %80 = load i32, ptr @bodyqueslot, align 4, !tbaa !5
  %81 = icmp sge i32 %80, 32
  br i1 %81, label %82, label %88

82:                                               ; preds = %79
  %83 = load i32, ptr @bodyqueslot, align 4, !tbaa !5
  %84 = srem i32 %83, 32
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [32 x ptr], ptr @bodyque, i64 0, i64 %85
  %87 = load ptr, ptr %86, align 8, !tbaa !9
  call void @P_RemoveMobj(ptr noundef %87)
  br label %88

88:                                               ; preds = %82, %79
  %89 = load i32, ptr %4, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [4 x %struct.player_s], ptr @players, i64 0, i64 %90
  %92 = getelementptr inbounds %struct.player_s, ptr %91, i32 0, i32 0
  %93 = load ptr, ptr %92, align 16, !tbaa !11
  %94 = load i32, ptr @bodyqueslot, align 4, !tbaa !5
  %95 = srem i32 %94, 32
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [32 x ptr], ptr @bodyque, i64 0, i64 %96
  store ptr %93, ptr %97, align 8, !tbaa !9
  %98 = load i32, ptr @bodyqueslot, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr @bodyqueslot, align 4, !tbaa !5
  %100 = load i32, ptr %6, align 4, !tbaa !5
  %101 = load i32, ptr %7, align 4, !tbaa !5
  %102 = call ptr @R_PointInSubsector(i32 noundef %100, i32 noundef %101)
  store ptr %102, ptr %8, align 8, !tbaa !9
  %103 = load ptr, ptr %5, align 8, !tbaa !9
  %104 = getelementptr inbounds %struct.mapthing_t, ptr %103, i32 0, i32 2
  %105 = load i16, ptr %104, align 2, !tbaa !24
  %106 = sext i16 %105 to i32
  %107 = sdiv i32 %106, 45
  %108 = mul nsw i32 536870912, %107
  %109 = ashr i32 %108, 19
  store i32 %109, ptr %9, align 4, !tbaa !5
  %110 = load i32, ptr %6, align 4, !tbaa !5
  %111 = load ptr, ptr @finecosine, align 8, !tbaa !9
  %112 = load i32, ptr %9, align 4, !tbaa !5
  %113 = zext i32 %112 to i64
  %114 = getelementptr inbounds i32, ptr %111, i64 %113
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = mul nsw i32 20, %115
  %117 = add nsw i32 %110, %116
  %118 = load i32, ptr %7, align 4, !tbaa !5
  %119 = load i32, ptr %9, align 4, !tbaa !5
  %120 = zext i32 %119 to i64
  %121 = getelementptr inbounds [10240 x i32], ptr @finesine, i64 0, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = mul nsw i32 20, %122
  %124 = add nsw i32 %118, %123
  %125 = load ptr, ptr %8, align 8, !tbaa !9
  %126 = getelementptr inbounds %struct.subsector_s, ptr %125, i32 0, i32 0
  %127 = load ptr, ptr %126, align 8, !tbaa !25
  %128 = getelementptr inbounds %struct.sector_t, ptr %127, i32 0, i32 0
  %129 = load i32, ptr %128, align 8, !tbaa !27
  %130 = call ptr @P_SpawnMobj(i32 noundef %117, i32 noundef %124, i32 noundef %129, i32 noundef 39)
  store ptr %130, ptr %10, align 8, !tbaa !9
  %131 = load i32, ptr @consoleplayer, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [4 x %struct.player_s], ptr @players, i64 0, i64 %132
  %134 = getelementptr inbounds %struct.player_s, ptr %133, i32 0, i32 3
  %135 = load i32, ptr %134, align 4, !tbaa !30
  %136 = icmp ne i32 %135, 1
  br i1 %136, label %137, label %139

137:                                              ; preds = %88
  %138 = load ptr, ptr %10, align 8, !tbaa !9
  call void @S_StartSound(ptr noundef %138, i32 noundef 35)
  br label %139

139:                                              ; preds = %137, %88
  store i32 1, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %140

140:                                              ; preds = %139, %78, %57, %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  %141 = load i32, ptr %3, align 4
  ret i32 %141
}

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

declare void @P_RemoveMobj(ptr noundef) #2

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

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

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

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, !10, i64 0}
!12 = !{!"player_s", !10, i64 0, !6, i64 8, !13, 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, !10, i64 224, !6, i64 232, !6, i64 236, !10, i64 240, !6, i64 248, !6, i64 252, !6, i64 256, !7, i64 264, !6, i64 312}
!13 = !{!"", !7, i64 0, !7, i64 1, !14, i64 2, !14, i64 4, !7, i64 6, !7, i64 7}
!14 = !{!"short", !7, i64 0}
!15 = !{!16, !6, i64 24}
!16 = !{!"mobj_s", !17, i64 0, !6, i64 24, !6, i64 28, !6, i64 32, !10, i64 40, !10, i64 48, !6, i64 56, !6, i64 60, !6, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !6, i64 96, !6, i64 100, !6, i64 104, !6, i64 108, !6, i64 112, !6, i64 116, !6, i64 120, !6, i64 124, !6, i64 128, !10, i64 136, !6, i64 144, !10, i64 152, !6, i64 160, !6, i64 164, !6, i64 168, !6, i64 172, !10, i64 176, !6, i64 184, !6, i64 188, !10, i64 192, !6, i64 200, !18, i64 204, !10, i64 216}
!17 = !{!"thinker_s", !10, i64 0, !10, i64 8, !7, i64 16}
!18 = !{!"", !14, i64 0, !14, i64 2, !14, i64 4, !14, i64 6, !14, i64 8}
!19 = !{!18, !14, i64 0}
!20 = !{!16, !6, i64 28}
!21 = !{!18, !14, i64 2}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!18, !14, i64 4}
!25 = !{!26, !10, i64 0}
!26 = !{!"subsector_s", !10, i64 0, !14, i64 8, !14, i64 10}
!27 = !{!28, !6, i64 0}
!28 = !{!"", !6, i64 0, !6, i64 4, !14, i64 8, !14, i64 10, !14, i64 12, !14, i64 14, !14, i64 16, !6, i64 20, !10, i64 24, !7, i64 32, !29, i64 48, !6, i64 88, !10, i64 96, !10, i64 104, !6, i64 112, !10, i64 120}
!29 = !{!"", !17, i64 0, !6, i64 24, !6, i64 28, !6, i64 32}
!30 = !{!12, !6, i64 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.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 }

@consoleplayer = external dso_local local_unnamed_addr global i32, align 4
@players = external dso_local local_unnamed_addr global [4 x %struct.player_s], align 16
@bodyqueslot = external dso_local local_unnamed_addr global i32, align 4
@bodyque = external dso_local local_unnamed_addr global [32 x ptr], align 16
@finecosine = external local_unnamed_addr global ptr, align 8
@finesine = external local_unnamed_addr global [10240 x i32], align 16

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @G_CheckSpot(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = sext i32 %0 to i64
  %4 = getelementptr inbounds [4 x %struct.player_s], ptr @players, i64 0, i64 %3
  %5 = load ptr, ptr %4, align 16, !tbaa !5
  %.not = icmp eq ptr %5, null
  br i1 %.not, label %.preheader, label %25

.preheader:                                       ; preds = %2
  %6 = icmp sgt i32 %0, 0
  br i1 %6, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.preheader
  %7 = load i16, ptr %1, align 2, !tbaa !13
  %8 = sext i16 %7 to i32
  %9 = shl nsw i32 %8, 16
  %10 = getelementptr inbounds i8, ptr %1, i64 2
  %wide.trip.count = zext nneg i32 %0 to i64
  br label %11

11:                                               ; preds = %.lr.ph, %24
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %24 ]
  %12 = getelementptr inbounds [4 x %struct.player_s], ptr @players, i64 0, i64 %indvars.iv
  %13 = load ptr, ptr %12, align 16, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %13, i64 24
  %15 = load i32, ptr %14, align 8, !tbaa !15
  %16 = icmp eq i32 %15, %9
  br i1 %16, label %17, label %24

17:                                               ; preds = %11
  %18 = getelementptr inbounds i8, ptr %13, i64 28
  %19 = load i32, ptr %18, align 4, !tbaa !18
  %20 = load i16, ptr %10, align 2, !tbaa !19
  %21 = sext i16 %20 to i32
  %22 = shl nsw i32 %21, 16
  %23 = icmp eq i32 %19, %22
  br i1 %23, label %.loopexit, label %24

24:                                               ; preds = %11, %17
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit, label %11, !llvm.loop !20

25:                                               ; preds = %2
  %26 = load i16, ptr %1, align 2, !tbaa !13
  %27 = sext i16 %26 to i32
  %28 = shl nsw i32 %27, 16
  %29 = getelementptr inbounds i8, ptr %1, i64 2
  %30 = load i16, ptr %29, align 2, !tbaa !19
  %31 = sext i16 %30 to i32
  %32 = shl nsw i32 %31, 16
  %33 = tail call i32 @P_CheckPosition(ptr noundef nonnull %5, i32 noundef %28, i32 noundef %32) #2
  %.not26 = icmp eq i32 %33, 0
  br i1 %.not26, label %.loopexit, label %34

34:                                               ; preds = %25
  %35 = load i32, ptr @bodyqueslot, align 4, !tbaa !22
  %36 = icmp sgt i32 %35, 31
  br i1 %36, label %37, label %42

37:                                               ; preds = %34
  %38 = and i32 %35, 31
  %39 = zext nneg i32 %38 to i64
  %40 = getelementptr inbounds [32 x ptr], ptr @bodyque, i64 0, i64 %39
  %41 = load ptr, ptr %40, align 8, !tbaa !23
  tail call void @P_RemoveMobj(ptr noundef %41) #2
  %.pre = load i32, ptr @bodyqueslot, align 4, !tbaa !22
  br label %42

42:                                               ; preds = %37, %34
  %43 = phi i32 [ %.pre, %37 ], [ %35, %34 ]
  %44 = load ptr, ptr %4, align 16, !tbaa !5
  %45 = srem i32 %43, 32
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [32 x ptr], ptr @bodyque, i64 0, i64 %46
  store ptr %44, ptr %47, align 8, !tbaa !23
  %48 = add nsw i32 %43, 1
  store i32 %48, ptr @bodyqueslot, align 4, !tbaa !22
  %49 = tail call ptr @R_PointInSubsector(i32 noundef %28, i32 noundef %32) #2
  %50 = getelementptr inbounds i8, ptr %1, i64 4
  %51 = load i16, ptr %50, align 2, !tbaa !24
  %52 = sdiv i16 %51, 45
  %53 = sext i16 %52 to i64
  %54 = shl nsw i64 %53, 10
  %55 = load ptr, ptr @finecosine, align 8, !tbaa !23
  %56 = and i64 %54, 4294966272
  %57 = getelementptr inbounds i32, ptr %55, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !22
  %59 = mul nsw i32 %58, 20
  %60 = add nsw i32 %59, %28
  %61 = getelementptr inbounds [10240 x i32], ptr @finesine, i64 0, i64 %56
  %62 = load i32, ptr %61, align 16, !tbaa !22
  %63 = mul nsw i32 %62, 20
  %64 = add nsw i32 %63, %32
  %65 = load ptr, ptr %49, align 8, !tbaa !25
  %66 = load i32, ptr %65, align 8, !tbaa !27
  %67 = tail call ptr @P_SpawnMobj(i32 noundef %60, i32 noundef %64, i32 noundef %66, i32 noundef 39) #2
  %68 = load i32, ptr @consoleplayer, align 4, !tbaa !22
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [4 x %struct.player_s], ptr @players, i64 0, i64 %69, i32 3
  %71 = load i32, ptr %70, align 4, !tbaa !30
  %.not27 = icmp eq i32 %71, 1
  br i1 %.not27, label %.loopexit, label %72

72:                                               ; preds = %42
  tail call void @S_StartSound(ptr noundef %67, i32 noundef 35) #2
  br label %.loopexit

.loopexit:                                        ; preds = %17, %24, %.preheader, %42, %72, %25
  %.023 = phi i32 [ 0, %25 ], [ 1, %72 ], [ 1, %42 ], [ 1, %.preheader ], [ 0, %17 ], [ 1, %24 ]
  ret i32 %.023
}

declare i32 @P_CheckPosition(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @P_RemoveMobj(ptr noundef) local_unnamed_addr #1

declare ptr @R_PointInSubsector(i32 noundef, i32 noundef) local_unnamed_addr #1

declare ptr @P_SpawnMobj(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"player_s", !7, i64 0, !10, i64 8, !11, i64 12, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !8, i64 48, !8, i64 72, !10, i64 96, !8, i64 100, !10, i64 116, !10, i64 120, !8, i64 124, !8, i64 160, !8, i64 176, !10, i64 192, !10, i64 196, !10, i64 200, !10, i64 204, !10, i64 208, !10, i64 212, !10, i64 216, !7, i64 224, !10, i64 232, !10, i64 236, !7, i64 240, !10, i64 248, !10, i64 252, !10, i64 256, !8, i64 264, !10, i64 312}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"", !8, i64 0, !8, i64 1, !12, i64 2, !12, i64 4, !8, i64 6, !8, i64 7}
!12 = !{!"short", !8, i64 0}
!13 = !{!14, !12, i64 0}
!14 = !{!"", !12, i64 0, !12, i64 2, !12, i64 4, !12, i64 6, !12, i64 8}
!15 = !{!16, !10, i64 24}
!16 = !{!"mobj_s", !17, i64 0, !10, i64 24, !10, i64 28, !10, i64 32, !7, i64 40, !7, i64 48, !10, i64 56, !10, i64 60, !10, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !10, i64 112, !10, i64 116, !10, i64 120, !10, i64 124, !10, i64 128, !7, i64 136, !10, i64 144, !7, i64 152, !10, i64 160, !10, i64 164, !10, i64 168, !10, i64 172, !7, i64 176, !10, i64 184, !10, i64 188, !7, i64 192, !10, i64 200, !14, i64 204, !7, i64 216}
!17 = !{!"thinker_s", !7, i64 0, !7, i64 8, !8, i64 16}
!18 = !{!16, !10, i64 28}
!19 = !{!14, !12, i64 2}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!10, !10, i64 0}
!23 = !{!7, !7, i64 0}
!24 = !{!14, !12, i64 4}
!25 = !{!26, !7, i64 0}
!26 = !{!"subsector_s", !7, i64 0, !12, i64 8, !12, i64 10}
!27 = !{!28, !10, i64 0}
!28 = !{!"", !10, i64 0, !10, i64 4, !12, i64 8, !12, i64 10, !12, i64 12, !12, i64 14, !12, i64 16, !10, i64 20, !7, i64 24, !8, i64 32, !29, i64 48, !10, i64 88, !7, i64 96, !7, i64 104, !10, i64 112, !7, i64 120}
!29 = !{!"", !17, i64 0, !10, i64 24, !10, i64 28, !10, i64 32}
!30 = !{!6, !10, i64 20}


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