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

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

@tmdropoffz = external dso_local global i32, align 4
@tmfloorz = external dso_local global i32, align 4
@tmceilingz = external dso_local global i32, align 4
@numspechit = external dso_local global i32, align 4
@spechit = external dso_local global [8 x ptr], align 16
@floatok = external dso_local global i32, align 4
@lines = 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

declare void @P_UnsetThingPosition(ptr noundef) #1

declare void @P_SetThingPosition(ptr noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local i32 @P_TryMove(ptr noundef %0, i32 noundef %1, i32 noundef %2) #2 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  store i32 0, ptr @floatok, align 4, !tbaa !9
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = load i32, ptr %6, align 4, !tbaa !9
  %16 = load i32, ptr %7, align 4, !tbaa !9
  %17 = call i32 @P_CheckPosition(ptr noundef %14, i32 noundef %15, i32 noundef %16)
  %18 = icmp ne i32 %17, 0
  br i1 %18, label %20, label %19

19:                                               ; preds = %3
  store i32 0, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %149

20:                                               ; preds = %3
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.mobj_s, ptr %21, i32 0, i32 24
  %23 = load i32, ptr %22, align 8, !tbaa !11
  %24 = and i32 %23, 4096
  %25 = icmp ne i32 %24, 0
  br i1 %25, label %79, label %26

26:                                               ; preds = %20
  %27 = load i32, ptr @tmceilingz, align 4, !tbaa !9
  %28 = load i32, ptr @tmfloorz, align 4, !tbaa !9
  %29 = sub nsw i32 %27, %28
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.mobj_s, ptr %30, i32 0, i32 15
  %32 = load i32, ptr %31, align 4, !tbaa !16
  %33 = icmp slt i32 %29, %32
  br i1 %33, label %34, label %35

34:                                               ; preds = %26
  store i32 0, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %149

35:                                               ; preds = %26
  store i32 1, ptr @floatok, align 4, !tbaa !9
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.mobj_s, ptr %36, i32 0, i32 24
  %38 = load i32, ptr %37, align 8, !tbaa !11
  %39 = and i32 %38, 32768
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %52, label %41

41:                                               ; preds = %35
  %42 = load i32, ptr @tmceilingz, align 4, !tbaa !9
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.mobj_s, ptr %43, i32 0, i32 3
  %45 = load i32, ptr %44, align 8, !tbaa !17
  %46 = sub nsw i32 %42, %45
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.mobj_s, ptr %47, i32 0, i32 15
  %49 = load i32, ptr %48, align 4, !tbaa !16
  %50 = icmp slt i32 %46, %49
  br i1 %50, label %51, label %52

51:                                               ; preds = %41
  store i32 0, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %149

52:                                               ; preds = %41, %35
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.mobj_s, ptr %53, i32 0, i32 24
  %55 = load i32, ptr %54, align 8, !tbaa !11
  %56 = and i32 %55, 32768
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %66, label %58

58:                                               ; preds = %52
  %59 = load i32, ptr @tmfloorz, align 4, !tbaa !9
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.mobj_s, ptr %60, i32 0, i32 3
  %62 = load i32, ptr %61, align 8, !tbaa !17
  %63 = sub nsw i32 %59, %62
  %64 = icmp sgt i32 %63, 1572864
  br i1 %64, label %65, label %66

65:                                               ; preds = %58
  store i32 0, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %149

66:                                               ; preds = %58, %52
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.mobj_s, ptr %67, i32 0, i32 24
  %69 = load i32, ptr %68, align 8, !tbaa !11
  %70 = and i32 %69, 17408
  %71 = icmp ne i32 %70, 0
  br i1 %71, label %78, label %72

72:                                               ; preds = %66
  %73 = load i32, ptr @tmfloorz, align 4, !tbaa !9
  %74 = load i32, ptr @tmdropoffz, align 4, !tbaa !9
  %75 = sub nsw i32 %73, %74
  %76 = icmp sgt i32 %75, 1572864
  br i1 %76, label %77, label %78

77:                                               ; preds = %72
  store i32 0, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %149

78:                                               ; preds = %72, %66
  br label %79

79:                                               ; preds = %78, %20
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  call void @P_UnsetThingPosition(ptr noundef %80)
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.mobj_s, ptr %81, i32 0, i32 1
  %83 = load i32, ptr %82, align 8, !tbaa !18
  store i32 %83, ptr %8, align 4, !tbaa !9
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.mobj_s, ptr %84, i32 0, i32 2
  %86 = load i32, ptr %85, align 4, !tbaa !19
  store i32 %86, ptr %9, align 4, !tbaa !9
  %87 = load i32, ptr @tmfloorz, align 4, !tbaa !9
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.mobj_s, ptr %88, i32 0, i32 12
  store i32 %87, ptr %89, align 8, !tbaa !20
  %90 = load i32, ptr @tmceilingz, align 4, !tbaa !9
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.mobj_s, ptr %91, i32 0, i32 13
  store i32 %90, ptr %92, align 4, !tbaa !21
  %93 = load i32, ptr %6, align 4, !tbaa !9
  %94 = load ptr, ptr %5, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.mobj_s, ptr %94, i32 0, i32 1
  store i32 %93, ptr %95, align 8, !tbaa !18
  %96 = load i32, ptr %7, align 4, !tbaa !9
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.mobj_s, ptr %97, i32 0, i32 2
  store i32 %96, ptr %98, align 4, !tbaa !19
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  call void @P_SetThingPosition(ptr noundef %99)
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.mobj_s, ptr %100, i32 0, i32 24
  %102 = load i32, ptr %101, align 8, !tbaa !11
  %103 = and i32 %102, 36864
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %148, label %105

105:                                              ; preds = %79
  br label %106

106:                                              ; preds = %146, %105
  %107 = load i32, ptr @numspechit, align 4, !tbaa !9
  %108 = add nsw i32 %107, -1
  store i32 %108, ptr @numspechit, align 4, !tbaa !9
  %109 = icmp ne i32 %107, 0
  br i1 %109, label %110, label %147

110:                                              ; preds = %106
  %111 = load i32, ptr @numspechit, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [8 x ptr], ptr @spechit, i64 0, i64 %112
  %114 = load ptr, ptr %113, align 8, !tbaa !5
  store ptr %114, ptr %12, align 8, !tbaa !5
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.mobj_s, ptr %115, i32 0, i32 1
  %117 = load i32, ptr %116, align 8, !tbaa !18
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.mobj_s, ptr %118, i32 0, i32 2
  %120 = load i32, ptr %119, align 4, !tbaa !19
  %121 = load ptr, ptr %12, align 8, !tbaa !5
  %122 = call i32 @P_PointOnLineSide(i32 noundef %117, i32 noundef %120, ptr noundef %121)
  store i32 %122, ptr %10, align 4, !tbaa !9
  %123 = load i32, ptr %8, align 4, !tbaa !9
  %124 = load i32, ptr %9, align 4, !tbaa !9
  %125 = load ptr, ptr %12, align 8, !tbaa !5
  %126 = call i32 @P_PointOnLineSide(i32 noundef %123, i32 noundef %124, ptr noundef %125)
  store i32 %126, ptr %11, align 4, !tbaa !9
  %127 = load i32, ptr %10, align 4, !tbaa !9
  %128 = load i32, ptr %11, align 4, !tbaa !9
  %129 = icmp ne i32 %127, %128
  br i1 %129, label %130, label %146

130:                                              ; preds = %110
  %131 = load ptr, ptr %12, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.line_s, ptr %131, i32 0, i32 5
  %133 = load i16, ptr %132, align 2, !tbaa !22
  %134 = icmp ne i16 %133, 0
  br i1 %134, label %135, label %145

135:                                              ; preds = %130
  %136 = load ptr, ptr %12, align 8, !tbaa !5
  %137 = load ptr, ptr @lines, align 8, !tbaa !5
  %138 = ptrtoint ptr %136 to i64
  %139 = ptrtoint ptr %137 to i64
  %140 = sub i64 %138, %139
  %141 = sdiv exact i64 %140, 88
  %142 = trunc i64 %141 to i32
  %143 = load i32, ptr %11, align 4, !tbaa !9
  %144 = load ptr, ptr %5, align 8, !tbaa !5
  call void @P_CrossSpecialLine(i32 noundef %142, i32 noundef %143, ptr noundef %144)
  br label %145

145:                                              ; preds = %135, %130
  br label %146

146:                                              ; preds = %145, %110
  br label %106, !llvm.loop !24

147:                                              ; preds = %106
  br label %148

148:                                              ; preds = %147, %79
  store i32 1, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %149

149:                                              ; preds = %148, %77, %65, %51, %34, %19
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  %150 = load i32, ptr %4, align 4
  ret i32 %150
}

declare i32 @P_PointOnLineSide(i32 noundef, i32 noundef, ptr noundef) #1

declare void @P_CrossSpecialLine(i32 noundef, i32 noundef, ptr noundef) #1

attributes #0 = { nocallback nofree nosync 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 = { 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, !10, i64 160}
!12 = !{!"mobj_s", !13, i64 0, !10, i64 24, !10, i64 28, !10, i64 32, !6, i64 40, !6, i64 48, !10, i64 56, !10, i64 60, !10, i64 64, !6, i64 72, !6, i64 80, !6, 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, !6, i64 136, !10, i64 144, !6, i64 152, !10, i64 160, !10, i64 164, !10, i64 168, !10, i64 172, !6, i64 176, !10, i64 184, !10, i64 188, !6, i64 192, !10, i64 200, !14, i64 204, !6, i64 216}
!13 = !{!"thinker_s", !6, i64 0, !6, i64 8, !7, i64 16}
!14 = !{!"", !15, i64 0, !15, i64 2, !15, i64 4, !15, i64 6, !15, i64 8}
!15 = !{!"short", !7, i64 0}
!16 = !{!12, !10, i64 108}
!17 = !{!12, !10, i64 32}
!18 = !{!12, !10, i64 24}
!19 = !{!12, !10, i64 28}
!20 = !{!12, !10, i64 96}
!21 = !{!12, !10, i64 100}
!22 = !{!23, !15, i64 26}
!23 = !{!"line_s", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !15, i64 24, !15, i64 26, !15, i64 28, !7, i64 30, !7, i64 36, !10, i64 52, !6, i64 56, !6, i64 64, !10, i64 72, !6, i64 80}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}


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

@tmdropoffz = external dso_local local_unnamed_addr global i32, align 4
@tmfloorz = external dso_local local_unnamed_addr global i32, align 4
@tmceilingz = external dso_local local_unnamed_addr global i32, align 4
@numspechit = external dso_local local_unnamed_addr global i32, align 4
@spechit = external dso_local local_unnamed_addr global [8 x ptr], align 16
@floatok = external dso_local local_unnamed_addr global i32, align 4
@lines = external local_unnamed_addr global ptr, align 8

declare void @P_UnsetThingPosition(ptr noundef) local_unnamed_addr #0

declare void @P_SetThingPosition(ptr noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @P_TryMove(ptr noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #1 {
  store i32 0, ptr @floatok, align 4, !tbaa !5
  %4 = tail call i32 @P_CheckPosition(ptr noundef %0, i32 noundef %1, i32 noundef %2)
  %.not = icmp eq i32 %4, 0
  br i1 %.not, label %.loopexit, label %5

5:                                                ; preds = %3
  %6 = getelementptr inbounds i8, ptr %0, i64 160
  %7 = load i32, ptr %6, align 8, !tbaa !9
  %8 = and i32 %7, 4096
  %.not35 = icmp eq i32 %8, 0
  br i1 %.not35, label %9, label %31

9:                                                ; preds = %5
  %10 = load i32, ptr @tmceilingz, align 4, !tbaa !5
  %11 = load i32, ptr @tmfloorz, align 4, !tbaa !5
  %12 = sub nsw i32 %10, %11
  %13 = getelementptr inbounds i8, ptr %0, i64 108
  %14 = load i32, ptr %13, align 4, !tbaa !15
  %15 = icmp slt i32 %12, %14
  br i1 %15, label %.loopexit, label %16

16:                                               ; preds = %9
  store i32 1, ptr @floatok, align 4, !tbaa !5
  %17 = and i32 %7, 32768
  %.not36 = icmp eq i32 %17, 0
  br i1 %.not36, label %18, label %25

18:                                               ; preds = %16
  %19 = getelementptr inbounds i8, ptr %0, i64 32
  %20 = load i32, ptr %19, align 8, !tbaa !16
  %21 = sub nsw i32 %10, %20
  %22 = icmp slt i32 %21, %14
  %23 = sub nsw i32 %11, %20
  %24 = icmp sgt i32 %23, 1572864
  %or.cond = select i1 %22, i1 true, i1 %24
  br i1 %or.cond, label %.loopexit, label %25

25:                                               ; preds = %18, %16
  %26 = and i32 %7, 17408
  %.not38 = icmp eq i32 %26, 0
  br i1 %.not38, label %27, label %31

27:                                               ; preds = %25
  %28 = load i32, ptr @tmdropoffz, align 4, !tbaa !5
  %29 = sub nsw i32 %11, %28
  %30 = icmp sgt i32 %29, 1572864
  br i1 %30, label %.loopexit, label %31

31:                                               ; preds = %25, %27, %5
  tail call void @P_UnsetThingPosition(ptr noundef nonnull %0) #2
  %32 = getelementptr inbounds i8, ptr %0, i64 24
  %33 = load i32, ptr %32, align 8, !tbaa !17
  %34 = getelementptr inbounds i8, ptr %0, i64 28
  %35 = load i32, ptr %34, align 4, !tbaa !18
  %36 = load i32, ptr @tmfloorz, align 4, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %0, i64 96
  store i32 %36, ptr %37, align 8, !tbaa !19
  %38 = load i32, ptr @tmceilingz, align 4, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %0, i64 100
  store i32 %38, ptr %39, align 4, !tbaa !20
  store i32 %1, ptr %32, align 8, !tbaa !17
  store i32 %2, ptr %34, align 4, !tbaa !18
  tail call void @P_SetThingPosition(ptr noundef nonnull %0) #2
  %40 = load i32, ptr %6, align 8, !tbaa !9
  %41 = and i32 %40, 36864
  %.not39 = icmp eq i32 %41, 0
  br i1 %.not39, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %31
  %42 = load i32, ptr @numspechit, align 4, !tbaa !5
  %43 = add nsw i32 %42, -1
  store i32 %43, ptr @numspechit, align 4, !tbaa !5
  %.not4043 = icmp eq i32 %42, 0
  br i1 %.not4043, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader, %62
  %44 = phi i32 [ %64, %62 ], [ %43, %.preheader ]
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [8 x ptr], ptr @spechit, i64 0, i64 %45
  %47 = load ptr, ptr %46, align 8, !tbaa !21
  %48 = load i32, ptr %32, align 8, !tbaa !17
  %49 = load i32, ptr %34, align 4, !tbaa !18
  %50 = tail call i32 @P_PointOnLineSide(i32 noundef %48, i32 noundef %49, ptr noundef %47) #2
  %51 = tail call i32 @P_PointOnLineSide(i32 noundef %33, i32 noundef %35, ptr noundef %47) #2
  %.not41 = icmp eq i32 %50, %51
  br i1 %.not41, label %62, label %52

52:                                               ; preds = %.lr.ph
  %53 = getelementptr inbounds i8, ptr %47, i64 26
  %54 = load i16, ptr %53, align 2, !tbaa !22
  %.not42 = icmp eq i16 %54, 0
  br i1 %.not42, label %62, label %55

55:                                               ; preds = %52
  %56 = load ptr, ptr @lines, align 8, !tbaa !21
  %57 = ptrtoint ptr %47 to i64
  %58 = ptrtoint ptr %56 to i64
  %59 = sub i64 %57, %58
  %60 = sdiv exact i64 %59, 88
  %61 = trunc i64 %60 to i32
  tail call void @P_CrossSpecialLine(i32 noundef %61, i32 noundef %51, ptr noundef nonnull %0) #2
  br label %62

62:                                               ; preds = %52, %55, %.lr.ph
  %63 = load i32, ptr @numspechit, align 4, !tbaa !5
  %64 = add nsw i32 %63, -1
  store i32 %64, ptr @numspechit, align 4, !tbaa !5
  %.not40 = icmp eq i32 %63, 0
  br i1 %.not40, label %.loopexit, label %.lr.ph, !llvm.loop !24

.loopexit:                                        ; preds = %62, %.preheader, %31, %27, %18, %9, %3
  %.0 = phi i32 [ 0, %3 ], [ 0, %9 ], [ 0, %18 ], [ 0, %27 ], [ 1, %31 ], [ 1, %.preheader ], [ 1, %62 ]
  ret i32 %.0
}

declare i32 @P_PointOnLineSide(i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

declare void @P_CrossSpecialLine(i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

attributes #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 = { 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 = { 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, !6, i64 160}
!10 = !{!"mobj_s", !11, i64 0, !6, i64 24, !6, i64 28, !6, i64 32, !12, i64 40, !12, i64 48, !6, i64 56, !6, i64 60, !6, i64 64, !12, i64 72, !12, i64 80, !12, 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, !12, i64 136, !6, i64 144, !12, i64 152, !6, i64 160, !6, i64 164, !6, i64 168, !6, i64 172, !12, i64 176, !6, i64 184, !6, i64 188, !12, i64 192, !6, i64 200, !13, i64 204, !12, i64 216}
!11 = !{!"thinker_s", !12, i64 0, !12, i64 8, !7, i64 16}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"", !14, i64 0, !14, i64 2, !14, i64 4, !14, i64 6, !14, i64 8}
!14 = !{!"short", !7, i64 0}
!15 = !{!10, !6, i64 108}
!16 = !{!10, !6, i64 32}
!17 = !{!10, !6, i64 24}
!18 = !{!10, !6, i64 28}
!19 = !{!10, !6, i64 96}
!20 = !{!10, !6, i64 100}
!21 = !{!12, !12, i64 0}
!22 = !{!23, !14, i64 26}
!23 = !{!"line_s", !12, i64 0, !12, i64 8, !6, i64 16, !6, i64 20, !14, i64 24, !14, i64 26, !14, i64 28, !7, i64 30, !7, i64 36, !6, i64 52, !12, i64 56, !12, i64 64, !6, i64 72, !12, i64 80}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}


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