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

; 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.state_t = type { i32, i64, i64, %union.actionf_t, i32, i64, i64 }
%union.actionf_t = type { ptr }
%struct.thinker_s = type { ptr, ptr, %union.actionf_t }
%struct.mobjinfo_t = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, 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.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 }

@save_p = external dso_local global ptr, align 8
@players = external global [4 x %struct.player_s], align 16
@states = external global [967 x %struct.state_t], align 16
@thinkercap = external global %struct.thinker_s, align 8
@mobjinfo = external global [137 x %struct.mobjinfo_t], align 16
@.str = external hidden unnamed_addr constant [30 x i8], align 1

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

declare void @P_MobjThinker(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @P_UnArchiveThinkers() #3 {
  %1 = alloca i8, align 1
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %1) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %5 = load ptr, ptr getelementptr inbounds (%struct.thinker_s, ptr @thinkercap, i32 0, i32 1), align 8, !tbaa !5
  store ptr %5, ptr %2, align 8, !tbaa !10
  br label %6

6:                                                ; preds = %21, %0
  %7 = load ptr, ptr %2, align 8, !tbaa !10
  %8 = icmp ne ptr %7, @thinkercap
  br i1 %8, label %9, label %23

9:                                                ; preds = %6
  %10 = load ptr, ptr %2, align 8, !tbaa !10
  %11 = getelementptr inbounds %struct.thinker_s, ptr %10, i32 0, i32 1
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %12, ptr %3, align 8, !tbaa !10
  %13 = load ptr, ptr %2, align 8, !tbaa !10
  %14 = getelementptr inbounds %struct.thinker_s, ptr %13, i32 0, i32 2
  %15 = load ptr, ptr %14, align 8, !tbaa !11
  %16 = icmp eq ptr %15, @P_MobjThinker
  br i1 %16, label %17, label %19

17:                                               ; preds = %9
  %18 = load ptr, ptr %2, align 8, !tbaa !10
  call void @P_RemoveMobj(ptr noundef %18)
  br label %21

19:                                               ; preds = %9
  %20 = load ptr, ptr %2, align 8, !tbaa !10
  call void @Z_Free(ptr noundef %20)
  br label %21

21:                                               ; preds = %19, %17
  %22 = load ptr, ptr %3, align 8, !tbaa !10
  store ptr %22, ptr %2, align 8, !tbaa !10
  br label %6, !llvm.loop !12

23:                                               ; preds = %6
  call void @P_InitThinkers()
  br label %24

24:                                               ; preds = %107, %23
  br label %25

25:                                               ; preds = %24
  %26 = load ptr, ptr @save_p, align 8, !tbaa !10
  %27 = getelementptr inbounds i8, ptr %26, i32 1
  store ptr %27, ptr @save_p, align 8, !tbaa !10
  %28 = load i8, ptr %26, align 1, !tbaa !11
  store i8 %28, ptr %1, align 1, !tbaa !11
  %29 = load i8, ptr %1, align 1, !tbaa !11
  %30 = zext i8 %29 to i32
  switch i32 %30, label %104 [
    i32 0, label %31
    i32 1, label %32
  ]

31:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %1) #5
  ret void

32:                                               ; preds = %25
  %33 = load ptr, ptr @save_p, align 8, !tbaa !10
  %34 = ptrtoint ptr %33 to i64
  %35 = and i64 %34, 3
  %36 = sub i64 4, %35
  %37 = and i64 %36, 3
  %38 = load ptr, ptr @save_p, align 8, !tbaa !10
  %39 = getelementptr inbounds i8, ptr %38, i64 %37
  store ptr %39, ptr @save_p, align 8, !tbaa !10
  %40 = call ptr @Z_Malloc(i32 noundef 224, i32 noundef 50, ptr noundef null)
  store ptr %40, ptr %4, align 8, !tbaa !10
  %41 = load ptr, ptr %4, align 8, !tbaa !10
  %42 = load ptr, ptr @save_p, align 8, !tbaa !10
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %41, ptr align 1 %42, i64 224, i1 false)
  %43 = load ptr, ptr @save_p, align 8, !tbaa !10
  %44 = getelementptr inbounds i8, ptr %43, i64 224
  store ptr %44, ptr @save_p, align 8, !tbaa !10
  %45 = load ptr, ptr %4, align 8, !tbaa !10
  %46 = getelementptr inbounds %struct.mobj_s, ptr %45, i32 0, i32 23
  %47 = load ptr, ptr %46, align 8, !tbaa !14
  %48 = ptrtoint ptr %47 to i64
  %49 = getelementptr inbounds [967 x %struct.state_t], ptr @states, i64 0, i64 %48
  %50 = load ptr, ptr %4, align 8, !tbaa !10
  %51 = getelementptr inbounds %struct.mobj_s, ptr %50, i32 0, i32 23
  store ptr %49, ptr %51, align 8, !tbaa !14
  %52 = load ptr, ptr %4, align 8, !tbaa !10
  %53 = getelementptr inbounds %struct.mobj_s, ptr %52, i32 0, i32 28
  store ptr null, ptr %53, align 8, !tbaa !19
  %54 = load ptr, ptr %4, align 8, !tbaa !10
  %55 = getelementptr inbounds %struct.mobj_s, ptr %54, i32 0, i32 31
  %56 = load ptr, ptr %55, align 8, !tbaa !20
  %57 = icmp ne ptr %56, null
  br i1 %57, label %58, label %72

58:                                               ; preds = %32
  %59 = load ptr, ptr %4, align 8, !tbaa !10
  %60 = getelementptr inbounds %struct.mobj_s, ptr %59, i32 0, i32 31
  %61 = load ptr, ptr %60, align 8, !tbaa !20
  %62 = ptrtoint ptr %61 to i64
  %63 = sub nsw i64 %62, 1
  %64 = getelementptr inbounds [4 x %struct.player_s], ptr @players, i64 0, i64 %63
  %65 = load ptr, ptr %4, align 8, !tbaa !10
  %66 = getelementptr inbounds %struct.mobj_s, ptr %65, i32 0, i32 31
  store ptr %64, ptr %66, align 8, !tbaa !20
  %67 = load ptr, ptr %4, align 8, !tbaa !10
  %68 = load ptr, ptr %4, align 8, !tbaa !10
  %69 = getelementptr inbounds %struct.mobj_s, ptr %68, i32 0, i32 31
  %70 = load ptr, ptr %69, align 8, !tbaa !20
  %71 = getelementptr inbounds %struct.player_s, ptr %70, i32 0, i32 0
  store ptr %67, ptr %71, align 8, !tbaa !21
  br label %72

72:                                               ; preds = %58, %32
  %73 = load ptr, ptr %4, align 8, !tbaa !10
  call void @P_SetThingPosition(ptr noundef %73)
  %74 = load ptr, ptr %4, align 8, !tbaa !10
  %75 = getelementptr inbounds %struct.mobj_s, ptr %74, i32 0, i32 20
  %76 = load i32, ptr %75, align 8, !tbaa !24
  %77 = zext i32 %76 to i64
  %78 = getelementptr inbounds [137 x %struct.mobjinfo_t], ptr @mobjinfo, i64 0, i64 %77
  %79 = load ptr, ptr %4, align 8, !tbaa !10
  %80 = getelementptr inbounds %struct.mobj_s, ptr %79, i32 0, i32 21
  store ptr %78, ptr %80, align 8, !tbaa !25
  %81 = load ptr, ptr %4, align 8, !tbaa !10
  %82 = getelementptr inbounds %struct.mobj_s, ptr %81, i32 0, i32 11
  %83 = load ptr, ptr %82, align 8, !tbaa !26
  %84 = getelementptr inbounds %struct.subsector_s, ptr %83, i32 0, i32 0
  %85 = load ptr, ptr %84, align 8, !tbaa !27
  %86 = getelementptr inbounds %struct.sector_t, ptr %85, i32 0, i32 0
  %87 = load i32, ptr %86, align 8, !tbaa !29
  %88 = load ptr, ptr %4, align 8, !tbaa !10
  %89 = getelementptr inbounds %struct.mobj_s, ptr %88, i32 0, i32 12
  store i32 %87, ptr %89, align 8, !tbaa !32
  %90 = load ptr, ptr %4, align 8, !tbaa !10
  %91 = getelementptr inbounds %struct.mobj_s, ptr %90, i32 0, i32 11
  %92 = load ptr, ptr %91, align 8, !tbaa !26
  %93 = getelementptr inbounds %struct.subsector_s, ptr %92, i32 0, i32 0
  %94 = load ptr, ptr %93, align 8, !tbaa !27
  %95 = getelementptr inbounds %struct.sector_t, ptr %94, i32 0, i32 1
  %96 = load i32, ptr %95, align 4, !tbaa !33
  %97 = load ptr, ptr %4, align 8, !tbaa !10
  %98 = getelementptr inbounds %struct.mobj_s, ptr %97, i32 0, i32 13
  store i32 %96, ptr %98, align 4, !tbaa !34
  %99 = load ptr, ptr %4, align 8, !tbaa !10
  %100 = getelementptr inbounds %struct.mobj_s, ptr %99, i32 0, i32 0
  %101 = getelementptr inbounds %struct.thinker_s, ptr %100, i32 0, i32 2
  store ptr @P_MobjThinker, ptr %101, align 8, !tbaa !11
  %102 = load ptr, ptr %4, align 8, !tbaa !10
  %103 = getelementptr inbounds %struct.mobj_s, ptr %102, i32 0, i32 0
  call void @P_AddThinker(ptr noundef %103)
  br label %107

104:                                              ; preds = %25
  %105 = load i8, ptr %1, align 1, !tbaa !11
  %106 = zext i8 %105 to i32
  call void (ptr, ...) @I_Error(ptr noundef @.str, i32 noundef %106) #6
  unreachable

107:                                              ; preds = %72
  br label %24
}

declare void @P_RemoveMobj(ptr noundef) #2

declare void @Z_Free(ptr noundef) #2

declare void @P_InitThinkers() #2

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

declare void @P_SetThingPosition(ptr noundef) #2

declare void @P_AddThinker(ptr noundef) #2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree 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 = { 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 #4 = { 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 #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, !7, i64 8}
!6 = !{!"thinker_s", !7, i64 0, !7, i64 8, !8, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!7, !7, i64 0}
!11 = !{!8, !8, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !7, i64 152}
!15 = !{!"mobj_s", !6, i64 0, !16, i64 24, !16, i64 28, !16, i64 32, !7, i64 40, !7, i64 48, !16, i64 56, !16, i64 60, !16, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !16, i64 96, !16, i64 100, !16, i64 104, !16, i64 108, !16, i64 112, !16, i64 116, !16, i64 120, !16, i64 124, !16, i64 128, !7, i64 136, !16, i64 144, !7, i64 152, !16, i64 160, !16, i64 164, !16, i64 168, !16, i64 172, !7, i64 176, !16, i64 184, !16, i64 188, !7, i64 192, !16, i64 200, !17, i64 204, !7, i64 216}
!16 = !{!"int", !8, i64 0}
!17 = !{!"", !18, i64 0, !18, i64 2, !18, i64 4, !18, i64 6, !18, i64 8}
!18 = !{!"short", !8, i64 0}
!19 = !{!15, !7, i64 176}
!20 = !{!15, !7, i64 192}
!21 = !{!22, !7, i64 0}
!22 = !{!"player_s", !7, i64 0, !16, i64 8, !23, i64 12, !16, i64 20, !16, i64 24, !16, i64 28, !16, i64 32, !16, i64 36, !16, i64 40, !16, i64 44, !8, i64 48, !8, i64 72, !16, i64 96, !8, i64 100, !16, i64 116, !16, i64 120, !8, i64 124, !8, i64 160, !8, i64 176, !16, i64 192, !16, i64 196, !16, i64 200, !16, i64 204, !16, i64 208, !16, i64 212, !16, i64 216, !7, i64 224, !16, i64 232, !16, i64 236, !7, i64 240, !16, i64 248, !16, i64 252, !16, i64 256, !8, i64 264, !16, i64 312}
!23 = !{!"", !8, i64 0, !8, i64 1, !18, i64 2, !18, i64 4, !8, i64 6, !8, i64 7}
!24 = !{!15, !16, i64 128}
!25 = !{!15, !7, i64 136}
!26 = !{!15, !7, i64 88}
!27 = !{!28, !7, i64 0}
!28 = !{!"subsector_s", !7, i64 0, !18, i64 8, !18, i64 10}
!29 = !{!30, !16, i64 0}
!30 = !{!"", !16, i64 0, !16, i64 4, !18, i64 8, !18, i64 10, !18, i64 12, !18, i64 14, !18, i64 16, !16, i64 20, !7, i64 24, !8, i64 32, !31, i64 48, !16, i64 88, !7, i64 96, !7, i64 104, !16, i64 112, !7, i64 120}
!31 = !{!"", !6, i64 0, !16, i64 24, !16, i64 28, !16, i64 32}
!32 = !{!15, !16, i64 96}
!33 = !{!30, !16, i64 4}
!34 = !{!15, !16, i64 100}


; 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 }
%struct.state_t = type { i32, i64, i64, %union.actionf_t, i32, i64, i64 }
%union.actionf_t = type { ptr }
%struct.thinker_s = type { ptr, ptr, %union.actionf_t }
%struct.mobjinfo_t = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }

@save_p = external dso_local local_unnamed_addr global ptr, align 8
@players = external global [4 x %struct.player_s], align 16
@states = external global [967 x %struct.state_t], align 16
@thinkercap = external global %struct.thinker_s, align 8
@mobjinfo = external global [137 x %struct.mobjinfo_t], align 16
@.str = external hidden unnamed_addr constant [30 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

declare void @P_MobjThinker(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @P_UnArchiveThinkers() local_unnamed_addr #2 {
  %1 = load ptr, ptr getelementptr inbounds (i8, ptr @thinkercap, i64 8), align 8, !tbaa !5
  %.not28 = icmp eq ptr %1, @thinkercap
  br i1 %.not28, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0, %9
  %.029 = phi ptr [ %3, %9 ], [ %1, %0 ]
  %2 = getelementptr inbounds i8, ptr %.029, i64 8
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %.029, i64 16
  %5 = load ptr, ptr %4, align 8, !tbaa !10
  %6 = icmp eq ptr %5, @P_MobjThinker
  br i1 %6, label %7, label %8

7:                                                ; preds = %.lr.ph
  tail call void @P_RemoveMobj(ptr noundef %.029) #4
  br label %9

8:                                                ; preds = %.lr.ph
  tail call void @Z_Free(ptr noundef %.029) #4
  br label %9

9:                                                ; preds = %8, %7
  %.not = icmp eq ptr %3, @thinkercap
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %9, %0
  tail call void @P_InitThinkers() #4
  br label %10

10:                                               ; preds = %35, %._crit_edge
  %11 = load ptr, ptr @save_p, align 8, !tbaa !13
  %12 = getelementptr inbounds i8, ptr %11, i64 1
  store ptr %12, ptr @save_p, align 8, !tbaa !13
  %13 = load i8, ptr %11, align 1, !tbaa !10
  switch i8 %13, label %47 [
    i8 0, label %14
    i8 1, label %15
  ]

14:                                               ; preds = %10
  ret void

15:                                               ; preds = %10
  %16 = ptrtoint ptr %12 to i64
  %17 = sub i64 0, %16
  %18 = and i64 %17, 3
  %19 = getelementptr inbounds i8, ptr %12, i64 %18
  store ptr %19, ptr @save_p, align 8, !tbaa !13
  %20 = tail call ptr @Z_Malloc(i32 noundef 224, i32 noundef 50, ptr noundef null) #4
  %21 = load ptr, ptr @save_p, align 8, !tbaa !13
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(224) %20, ptr noundef nonnull align 1 dereferenceable(224) %21, i64 224, i1 false)
  %22 = load ptr, ptr @save_p, align 8, !tbaa !13
  %23 = getelementptr inbounds i8, ptr %22, i64 224
  store ptr %23, ptr @save_p, align 8, !tbaa !13
  %24 = getelementptr inbounds i8, ptr %20, i64 152
  %25 = load ptr, ptr %24, align 8, !tbaa !14
  %26 = ptrtoint ptr %25 to i64
  %27 = getelementptr inbounds [967 x %struct.state_t], ptr @states, i64 0, i64 %26
  store ptr %27, ptr %24, align 8, !tbaa !14
  %28 = getelementptr inbounds i8, ptr %20, i64 176
  store ptr null, ptr %28, align 8, !tbaa !19
  %29 = getelementptr inbounds i8, ptr %20, i64 192
  %30 = load ptr, ptr %29, align 8, !tbaa !20
  %.not26 = icmp eq ptr %30, null
  br i1 %.not26, label %35, label %31

31:                                               ; preds = %15
  %32 = ptrtoint ptr %30 to i64
  %33 = add nsw i64 %32, -1
  %34 = getelementptr inbounds [4 x %struct.player_s], ptr @players, i64 0, i64 %33
  store ptr %34, ptr %29, align 8, !tbaa !20
  store ptr %20, ptr %34, align 16, !tbaa !21
  br label %35

35:                                               ; preds = %31, %15
  tail call void @P_SetThingPosition(ptr noundef nonnull %20) #4
  %36 = getelementptr inbounds i8, ptr %20, i64 128
  %37 = load i32, ptr %36, align 8, !tbaa !24
  %38 = zext i32 %37 to i64
  %39 = getelementptr inbounds [137 x %struct.mobjinfo_t], ptr @mobjinfo, i64 0, i64 %38
  %40 = getelementptr inbounds i8, ptr %20, i64 136
  store ptr %39, ptr %40, align 8, !tbaa !25
  %41 = getelementptr inbounds i8, ptr %20, i64 88
  %42 = load ptr, ptr %41, align 8, !tbaa !26
  %43 = load ptr, ptr %42, align 8, !tbaa !27
  %44 = getelementptr inbounds i8, ptr %20, i64 96
  %45 = load <2 x i32>, ptr %43, align 8, !tbaa !29
  store <2 x i32> %45, ptr %44, align 8, !tbaa !29
  %46 = getelementptr inbounds i8, ptr %20, i64 16
  store ptr @P_MobjThinker, ptr %46, align 8, !tbaa !10
  tail call void @P_AddThinker(ptr noundef nonnull %20) #4
  br label %10

47:                                               ; preds = %10
  %48 = zext i8 %13 to i32
  tail call void (ptr, ...) @I_Error(ptr noundef nonnull @.str, i32 noundef %48) #5
  unreachable
}

declare void @P_RemoveMobj(ptr noundef) local_unnamed_addr #1

declare void @Z_Free(ptr noundef) local_unnamed_addr #1

declare void @P_InitThinkers() local_unnamed_addr #1

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

declare void @P_SetThingPosition(ptr noundef) local_unnamed_addr #1

declare void @P_AddThinker(ptr noundef) local_unnamed_addr #1

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

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 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 #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 }
attributes #5 = { 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 8}
!6 = !{!"thinker_s", !7, i64 0, !7, i64 8, !8, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!8, !8, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !7, i64 152}
!15 = !{!"mobj_s", !6, i64 0, !16, i64 24, !16, i64 28, !16, i64 32, !7, i64 40, !7, i64 48, !16, i64 56, !16, i64 60, !16, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !16, i64 96, !16, i64 100, !16, i64 104, !16, i64 108, !16, i64 112, !16, i64 116, !16, i64 120, !16, i64 124, !16, i64 128, !7, i64 136, !16, i64 144, !7, i64 152, !16, i64 160, !16, i64 164, !16, i64 168, !16, i64 172, !7, i64 176, !16, i64 184, !16, i64 188, !7, i64 192, !16, i64 200, !17, i64 204, !7, i64 216}
!16 = !{!"int", !8, i64 0}
!17 = !{!"", !18, i64 0, !18, i64 2, !18, i64 4, !18, i64 6, !18, i64 8}
!18 = !{!"short", !8, i64 0}
!19 = !{!15, !7, i64 176}
!20 = !{!15, !7, i64 192}
!21 = !{!22, !7, i64 0}
!22 = !{!"player_s", !7, i64 0, !16, i64 8, !23, i64 12, !16, i64 20, !16, i64 24, !16, i64 28, !16, i64 32, !16, i64 36, !16, i64 40, !16, i64 44, !8, i64 48, !8, i64 72, !16, i64 96, !8, i64 100, !16, i64 116, !16, i64 120, !8, i64 124, !8, i64 160, !8, i64 176, !16, i64 192, !16, i64 196, !16, i64 200, !16, i64 204, !16, i64 208, !16, i64 212, !16, i64 216, !7, i64 224, !16, i64 232, !16, i64 236, !7, i64 240, !16, i64 248, !16, i64 252, !16, i64 256, !8, i64 264, !16, i64 312}
!23 = !{!"", !8, i64 0, !8, i64 1, !18, i64 2, !18, i64 4, !8, i64 6, !8, i64 7}
!24 = !{!15, !16, i64 128}
!25 = !{!15, !7, i64 136}
!26 = !{!15, !7, i64 88}
!27 = !{!28, !7, i64 0}
!28 = !{!"subsector_s", !7, i64 0, !18, i64 8, !18, i64 10}
!29 = !{!16, !16, i64 0}


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