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

; 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.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 }
%struct.thinker_s = type { ptr, ptr, %union.actionf_t }
%union.actionf_t = type { ptr }
%struct.line_s = type { ptr, ptr, i32, i32, i16, i16, i16, [2 x i16], [4 x i32], i32, ptr, ptr, i32, ptr }
%struct.floormove_t = type { %struct.thinker_s, i32, i32, ptr, i32, i32, i16, i32, i32 }

@sectors = external global ptr, align 8

; 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 ptr @getNextSector(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @P_FindSectorFromLineTag(ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @EV_DoDonut(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  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 4, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  store i32 -1, ptr %6, align 4, !tbaa !9
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %10

10:                                               ; preds = %135, %24, %1
  %11 = load ptr, ptr %2, align 8, !tbaa !5
  %12 = load i32, ptr %6, align 4, !tbaa !9
  %13 = call i32 @P_FindSectorFromLineTag(ptr noundef %11, i32 noundef %12)
  store i32 %13, ptr %6, align 4, !tbaa !9
  %14 = icmp sge i32 %13, 0
  br i1 %14, label %15, label %136

15:                                               ; preds = %10
  %16 = load ptr, ptr @sectors, align 8, !tbaa !5
  %17 = load i32, ptr %6, align 4, !tbaa !9
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds %struct.sector_t, ptr %16, i64 %18
  store ptr %19, ptr %3, align 8, !tbaa !5
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.sector_t, ptr %20, i32 0, i32 13
  %22 = load ptr, ptr %21, align 8, !tbaa !11
  %23 = icmp ne ptr %22, null
  br i1 %23, label %24, label %25

24:                                               ; preds = %15
  br label %10, !llvm.loop !16

25:                                               ; preds = %15
  store i32 1, ptr %7, align 4, !tbaa !9
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.sector_t, ptr %26, i32 0, i32 15
  %28 = load ptr, ptr %27, align 8, !tbaa !18
  %29 = getelementptr inbounds ptr, ptr %28, i64 0
  %30 = load ptr, ptr %29, align 8, !tbaa !5
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = call ptr @getNextSector(ptr noundef %30, ptr noundef %31)
  store ptr %32, ptr %4, align 8, !tbaa !5
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %33

33:                                               ; preds = %132, %25
  %34 = load i32, ptr %8, align 4, !tbaa !9
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.sector_t, ptr %35, i32 0, i32 14
  %37 = load i32, ptr %36, align 8, !tbaa !19
  %38 = icmp slt i32 %34, %37
  br i1 %38, label %39, label %135

39:                                               ; preds = %33
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.sector_t, ptr %40, i32 0, i32 15
  %42 = load ptr, ptr %41, align 8, !tbaa !18
  %43 = load i32, ptr %8, align 4, !tbaa !9
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds ptr, ptr %42, i64 %44
  %46 = load ptr, ptr %45, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.line_s, ptr %46, i32 0, i32 4
  %48 = load i16, ptr %47, align 8, !tbaa !20
  %49 = sext i16 %48 to i32
  %50 = and i32 %49, 4
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %52, label %64

52:                                               ; preds = %39
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.sector_t, ptr %53, i32 0, i32 15
  %55 = load ptr, ptr %54, align 8, !tbaa !18
  %56 = load i32, ptr %8, align 4, !tbaa !9
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds ptr, ptr %55, i64 %57
  %59 = load ptr, ptr %58, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.line_s, ptr %59, i32 0, i32 11
  %61 = load ptr, ptr %60, align 8, !tbaa !22
  %62 = load ptr, ptr %3, align 8, !tbaa !5
  %63 = icmp eq ptr %61, %62
  br i1 %63, label %64, label %65

64:                                               ; preds = %52, %39
  br label %132

65:                                               ; preds = %52
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.sector_t, ptr %66, i32 0, i32 15
  %68 = load ptr, ptr %67, align 8, !tbaa !18
  %69 = load i32, ptr %8, align 4, !tbaa !9
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds ptr, ptr %68, i64 %70
  %72 = load ptr, ptr %71, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.line_s, ptr %72, i32 0, i32 11
  %74 = load ptr, ptr %73, align 8, !tbaa !22
  store ptr %74, ptr %5, align 8, !tbaa !5
  %75 = call ptr @Z_Malloc(i32 noundef 64, i32 noundef 51, ptr noundef null)
  store ptr %75, ptr %9, align 8, !tbaa !5
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.floormove_t, ptr %76, i32 0, i32 0
  call void @P_AddThinker(ptr noundef %77)
  %78 = load ptr, ptr %9, align 8, !tbaa !5
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.sector_t, ptr %79, i32 0, i32 13
  store ptr %78, ptr %80, align 8, !tbaa !11
  %81 = load ptr, ptr %9, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.floormove_t, ptr %81, i32 0, i32 0
  %83 = getelementptr inbounds %struct.thinker_s, ptr %82, i32 0, i32 2
  store ptr @T_MoveFloor, ptr %83, align 8, !tbaa !23
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.floormove_t, ptr %84, i32 0, i32 1
  store i32 11, ptr %85, align 8, !tbaa !24
  %86 = load ptr, ptr %9, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.floormove_t, ptr %86, i32 0, i32 2
  store i32 0, ptr %87, align 4, !tbaa !26
  %88 = load ptr, ptr %9, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.floormove_t, ptr %88, i32 0, i32 4
  store i32 1, ptr %89, align 8, !tbaa !27
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = load ptr, ptr %9, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.floormove_t, ptr %91, i32 0, i32 3
  store ptr %90, ptr %92, align 8, !tbaa !28
  %93 = load ptr, ptr %9, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.floormove_t, ptr %93, i32 0, i32 8
  store i32 32768, ptr %94, align 8, !tbaa !29
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.sector_t, ptr %95, i32 0, i32 2
  %97 = load i16, ptr %96, align 8, !tbaa !30
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.floormove_t, ptr %98, i32 0, i32 6
  store i16 %97, ptr %99, align 8, !tbaa !31
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.floormove_t, ptr %100, i32 0, i32 5
  store i32 0, ptr %101, align 4, !tbaa !32
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.sector_t, ptr %102, i32 0, i32 0
  %104 = load i32, ptr %103, align 8, !tbaa !33
  %105 = load ptr, ptr %9, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.floormove_t, ptr %105, i32 0, i32 7
  store i32 %104, ptr %106, align 4, !tbaa !34
  %107 = call ptr @Z_Malloc(i32 noundef 64, i32 noundef 51, ptr noundef null)
  store ptr %107, ptr %9, align 8, !tbaa !5
  %108 = load ptr, ptr %9, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.floormove_t, ptr %108, i32 0, i32 0
  call void @P_AddThinker(ptr noundef %109)
  %110 = load ptr, ptr %9, align 8, !tbaa !5
  %111 = load ptr, ptr %3, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.sector_t, ptr %111, i32 0, i32 13
  store ptr %110, ptr %112, align 8, !tbaa !11
  %113 = load ptr, ptr %9, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.floormove_t, ptr %113, i32 0, i32 0
  %115 = getelementptr inbounds %struct.thinker_s, ptr %114, i32 0, i32 2
  store ptr @T_MoveFloor, ptr %115, align 8, !tbaa !23
  %116 = load ptr, ptr %9, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.floormove_t, ptr %116, i32 0, i32 1
  store i32 0, ptr %117, align 8, !tbaa !24
  %118 = load ptr, ptr %9, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.floormove_t, ptr %118, i32 0, i32 2
  store i32 0, ptr %119, align 4, !tbaa !26
  %120 = load ptr, ptr %9, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.floormove_t, ptr %120, i32 0, i32 4
  store i32 -1, ptr %121, align 8, !tbaa !27
  %122 = load ptr, ptr %3, align 8, !tbaa !5
  %123 = load ptr, ptr %9, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.floormove_t, ptr %123, i32 0, i32 3
  store ptr %122, ptr %124, align 8, !tbaa !28
  %125 = load ptr, ptr %9, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.floormove_t, ptr %125, i32 0, i32 8
  store i32 32768, ptr %126, align 8, !tbaa !29
  %127 = load ptr, ptr %5, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.sector_t, ptr %127, i32 0, i32 0
  %129 = load i32, ptr %128, align 8, !tbaa !33
  %130 = load ptr, ptr %9, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.floormove_t, ptr %130, i32 0, i32 7
  store i32 %129, ptr %131, align 4, !tbaa !34
  br label %135

132:                                              ; preds = %64
  %133 = load i32, ptr %8, align 4, !tbaa !9
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %8, align 4, !tbaa !9
  br label %33, !llvm.loop !35

135:                                              ; preds = %65, %33
  br label %10, !llvm.loop !16

136:                                              ; preds = %10
  %137 = load i32, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  ret i32 %137
}

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

declare void @P_AddThinker(ptr noundef) #2

declare void @T_MoveFloor(ptr 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 104}
!12 = !{!"", !10, i64 0, !10, i64 4, !13, i64 8, !13, i64 10, !13, i64 12, !13, i64 14, !13, i64 16, !10, i64 20, !6, i64 24, !7, i64 32, !14, i64 48, !10, i64 88, !6, i64 96, !6, i64 104, !10, i64 112, !6, i64 120}
!13 = !{!"short", !7, i64 0}
!14 = !{!"", !15, i64 0, !10, i64 24, !10, i64 28, !10, i64 32}
!15 = !{!"thinker_s", !6, i64 0, !6, i64 8, !7, i64 16}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!12, !6, i64 120}
!19 = !{!12, !10, i64 112}
!20 = !{!21, !13, i64 24}
!21 = !{!"line_s", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !13, i64 24, !13, i64 26, !13, i64 28, !7, i64 30, !7, i64 36, !10, i64 52, !6, i64 56, !6, i64 64, !10, i64 72, !6, i64 80}
!22 = !{!21, !6, i64 64}
!23 = !{!7, !7, i64 0}
!24 = !{!25, !10, i64 24}
!25 = !{!"", !15, i64 0, !10, i64 24, !10, i64 28, !6, i64 32, !10, i64 40, !10, i64 44, !13, i64 48, !10, i64 52, !10, i64 56}
!26 = !{!25, !10, i64 28}
!27 = !{!25, !10, i64 40}
!28 = !{!25, !6, i64 32}
!29 = !{!25, !10, i64 56}
!30 = !{!12, !13, i64 8}
!31 = !{!25, !13, i64 48}
!32 = !{!25, !10, i64 44}
!33 = !{!12, !10, i64 0}
!34 = !{!25, !10, i64 52}
!35 = distinct !{!35, !17}


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

@sectors = external local_unnamed_addr global ptr, align 8

; Function Attrs: nounwind uwtable
declare dso_local ptr @getNextSector(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @P_FindSectorFromLineTag(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @EV_DoDonut(ptr noundef %0) local_unnamed_addr #0 {
  br label %.outer

.outer:                                           ; preds = %.loopexit, %1
  %.044.ph = phi i32 [ 1, %.loopexit ], [ 0, %1 ]
  %.0.ph = phi i32 [ %3, %.loopexit ], [ -1, %1 ]
  br label %2

2:                                                ; preds = %.outer, %5
  %.0 = phi i32 [ %3, %5 ], [ %.0.ph, %.outer ]
  %3 = tail call i32 @P_FindSectorFromLineTag(ptr noundef %0, i32 noundef %.0)
  %4 = icmp sgt i32 %3, -1
  br i1 %4, label %5, label %57

5:                                                ; preds = %2
  %6 = load ptr, ptr @sectors, align 8, !tbaa !5
  %7 = zext nneg i32 %3 to i64
  %8 = getelementptr inbounds %struct.sector_t, ptr %6, i64 %7
  %9 = getelementptr inbounds i8, ptr %8, i64 104
  %10 = load ptr, ptr %9, align 8, !tbaa !9
  %.not = icmp eq ptr %10, null
  br i1 %.not, label %11, label %2, !llvm.loop !15

11:                                               ; preds = %5
  %12 = getelementptr inbounds i8, ptr %8, i64 104
  %13 = getelementptr inbounds i8, ptr %8, i64 120
  %14 = load ptr, ptr %13, align 8, !tbaa !17
  %15 = load ptr, ptr %14, align 8, !tbaa !5
  %16 = tail call ptr @getNextSector(ptr noundef %15, ptr noundef nonnull %8)
  %17 = getelementptr inbounds i8, ptr %16, i64 112
  %18 = load i32, ptr %17, align 8, !tbaa !18
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %11
  %20 = getelementptr inbounds i8, ptr %16, i64 120
  %21 = load ptr, ptr %20, align 8, !tbaa !17
  %wide.trip.count = zext nneg i32 %18 to i64
  br label %22

22:                                               ; preds = %.lr.ph, %56
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %56 ]
  %23 = getelementptr inbounds ptr, ptr %21, i64 %indvars.iv
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %24, i64 24
  %26 = load i16, ptr %25, align 8, !tbaa !19
  %27 = and i16 %26, 4
  %.not48 = icmp eq i16 %27, 0
  br i1 %.not48, label %56, label %28

28:                                               ; preds = %22
  %29 = getelementptr inbounds i8, ptr %24, i64 64
  %30 = load ptr, ptr %29, align 8, !tbaa !21
  %31 = icmp eq ptr %30, %8
  br i1 %31, label %56, label %32

32:                                               ; preds = %28
  %33 = tail call ptr @Z_Malloc(i32 noundef 64, i32 noundef 51, ptr noundef null) #2
  tail call void @P_AddThinker(ptr noundef %33) #2
  %34 = getelementptr inbounds i8, ptr %16, i64 104
  store ptr %33, ptr %34, align 8, !tbaa !9
  %35 = getelementptr inbounds i8, ptr %33, i64 16
  store ptr @T_MoveFloor, ptr %35, align 8, !tbaa !22
  %36 = getelementptr inbounds i8, ptr %33, i64 24
  store i32 11, ptr %36, align 8, !tbaa !23
  %37 = getelementptr inbounds i8, ptr %33, i64 28
  store i32 0, ptr %37, align 4, !tbaa !25
  %38 = getelementptr inbounds i8, ptr %33, i64 40
  store i32 1, ptr %38, align 8, !tbaa !26
  %39 = getelementptr inbounds i8, ptr %33, i64 32
  store ptr %16, ptr %39, align 8, !tbaa !27
  %40 = getelementptr inbounds i8, ptr %33, i64 56
  store i32 32768, ptr %40, align 8, !tbaa !28
  %41 = getelementptr inbounds i8, ptr %30, i64 8
  %42 = load i16, ptr %41, align 8, !tbaa !29
  %43 = getelementptr inbounds i8, ptr %33, i64 48
  store i16 %42, ptr %43, align 8, !tbaa !30
  %44 = getelementptr inbounds i8, ptr %33, i64 44
  store i32 0, ptr %44, align 4, !tbaa !31
  %45 = load i32, ptr %30, align 8, !tbaa !32
  %46 = getelementptr inbounds i8, ptr %33, i64 52
  store i32 %45, ptr %46, align 4, !tbaa !33
  %47 = tail call ptr @Z_Malloc(i32 noundef 64, i32 noundef 51, ptr noundef null) #2
  tail call void @P_AddThinker(ptr noundef %47) #2
  store ptr %47, ptr %12, align 8, !tbaa !9
  %48 = getelementptr inbounds i8, ptr %47, i64 16
  store ptr @T_MoveFloor, ptr %48, align 8, !tbaa !22
  %49 = getelementptr inbounds i8, ptr %47, i64 24
  store i32 0, ptr %49, align 8, !tbaa !23
  %50 = getelementptr inbounds i8, ptr %47, i64 28
  store i32 0, ptr %50, align 4, !tbaa !25
  %51 = getelementptr inbounds i8, ptr %47, i64 40
  store i32 -1, ptr %51, align 8, !tbaa !26
  %52 = getelementptr inbounds i8, ptr %47, i64 32
  store ptr %8, ptr %52, align 8, !tbaa !27
  %53 = getelementptr inbounds i8, ptr %47, i64 56
  store i32 32768, ptr %53, align 8, !tbaa !28
  %54 = load i32, ptr %30, align 8, !tbaa !32
  %55 = getelementptr inbounds i8, ptr %47, i64 52
  store i32 %54, ptr %55, align 4, !tbaa !33
  br label %.loopexit

56:                                               ; preds = %22, %28
  %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 %22, !llvm.loop !34

.loopexit:                                        ; preds = %56, %11, %32
  br label %.outer, !llvm.loop !15

57:                                               ; preds = %2
  ret i32 %.044.ph
}

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

declare void @P_AddThinker(ptr noundef) local_unnamed_addr #1

declare void @T_MoveFloor(ptr noundef) #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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 104}
!10 = !{!"", !11, i64 0, !11, i64 4, !12, i64 8, !12, i64 10, !12, i64 12, !12, i64 14, !12, i64 16, !11, i64 20, !6, i64 24, !7, i64 32, !13, i64 48, !11, i64 88, !6, i64 96, !6, i64 104, !11, i64 112, !6, i64 120}
!11 = !{!"int", !7, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!"", !14, i64 0, !11, i64 24, !11, i64 28, !11, i64 32}
!14 = !{!"thinker_s", !6, i64 0, !6, i64 8, !7, i64 16}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!10, !6, i64 120}
!18 = !{!10, !11, i64 112}
!19 = !{!20, !12, i64 24}
!20 = !{!"line_s", !6, i64 0, !6, i64 8, !11, i64 16, !11, i64 20, !12, i64 24, !12, i64 26, !12, i64 28, !7, i64 30, !7, i64 36, !11, i64 52, !6, i64 56, !6, i64 64, !11, i64 72, !6, i64 80}
!21 = !{!20, !6, i64 64}
!22 = !{!7, !7, i64 0}
!23 = !{!24, !11, i64 24}
!24 = !{!"", !14, i64 0, !11, i64 24, !11, i64 28, !6, i64 32, !11, i64 40, !11, i64 44, !12, i64 48, !11, i64 52, !11, i64 56}
!25 = !{!24, !11, i64 28}
!26 = !{!24, !11, i64 40}
!27 = !{!24, !6, i64 32}
!28 = !{!24, !11, i64 56}
!29 = !{!10, !12, i64 8}
!30 = !{!24, !12, i64 48}
!31 = !{!24, !11, i64 44}
!32 = !{!10, !11, i64 0}
!33 = !{!24, !11, i64 52}
!34 = distinct !{!34, !16}


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