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

; 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.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 }

@xspeed = external dso_local global [8 x i32], align 16
@yspeed = external dso_local global [8 x i32], align 16
@viletryx = external dso_local global i32, align 4
@viletryy = external dso_local global i32, align 4
@corpsehit = external dso_local global ptr, align 8
@bmaporgx = external global i32, align 4
@bmaporgy = external global i32, align 4
@vileobj = external dso_local 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 @S_StartSound(ptr noundef, i32 noundef) #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @A_Chase(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @A_FaceTarget(ptr noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local void @A_VileChase(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 4, 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
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.mobj_s, ptr %12, i32 0, i32 26
  %14 = load i32, ptr %13, align 8, !tbaa !9
  %15 = icmp ne i32 %14, 8
  br i1 %15, label %16, label %133

16:                                               ; preds = %1
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.mobj_s, ptr %17, i32 0, i32 1
  %19 = load i32, ptr %18, align 8, !tbaa !15
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.mobj_s, ptr %20, i32 0, i32 21
  %22 = load ptr, ptr %21, align 8, !tbaa !16
  %23 = getelementptr inbounds %struct.mobjinfo_t, ptr %22, i32 0, i32 15
  %24 = load i32, ptr %23, align 4, !tbaa !17
  %25 = load ptr, ptr %2, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.mobj_s, ptr %25, i32 0, i32 26
  %27 = load i32, ptr %26, align 8, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [8 x i32], ptr @xspeed, i64 0, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !19
  %31 = mul nsw i32 %24, %30
  %32 = add nsw i32 %19, %31
  store i32 %32, ptr @viletryx, align 4, !tbaa !19
  %33 = load ptr, ptr %2, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.mobj_s, ptr %33, i32 0, i32 2
  %35 = load i32, ptr %34, align 4, !tbaa !20
  %36 = load ptr, ptr %2, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.mobj_s, ptr %36, i32 0, i32 21
  %38 = load ptr, ptr %37, align 8, !tbaa !16
  %39 = getelementptr inbounds %struct.mobjinfo_t, ptr %38, i32 0, i32 15
  %40 = load i32, ptr %39, align 4, !tbaa !17
  %41 = load ptr, ptr %2, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.mobj_s, ptr %41, i32 0, i32 26
  %43 = load i32, ptr %42, align 8, !tbaa !9
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [8 x i32], ptr @yspeed, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !19
  %47 = mul nsw i32 %40, %46
  %48 = add nsw i32 %35, %47
  store i32 %48, ptr @viletryy, align 4, !tbaa !19
  %49 = load i32, ptr @viletryx, align 4, !tbaa !19
  %50 = load i32, ptr @bmaporgx, align 4, !tbaa !19
  %51 = sub nsw i32 %49, %50
  %52 = sub nsw i32 %51, 4194304
  %53 = ashr i32 %52, 23
  store i32 %53, ptr %3, align 4, !tbaa !19
  %54 = load i32, ptr @viletryx, align 4, !tbaa !19
  %55 = load i32, ptr @bmaporgx, align 4, !tbaa !19
  %56 = sub nsw i32 %54, %55
  %57 = add nsw i32 %56, 4194304
  %58 = ashr i32 %57, 23
  store i32 %58, ptr %4, align 4, !tbaa !19
  %59 = load i32, ptr @viletryy, align 4, !tbaa !19
  %60 = load i32, ptr @bmaporgy, align 4, !tbaa !19
  %61 = sub nsw i32 %59, %60
  %62 = sub nsw i32 %61, 4194304
  %63 = ashr i32 %62, 23
  store i32 %63, ptr %5, align 4, !tbaa !19
  %64 = load i32, ptr @viletryy, align 4, !tbaa !19
  %65 = load i32, ptr @bmaporgy, align 4, !tbaa !19
  %66 = sub nsw i32 %64, %65
  %67 = add nsw i32 %66, 4194304
  %68 = ashr i32 %67, 23
  store i32 %68, ptr %6, align 4, !tbaa !19
  %69 = load ptr, ptr %2, align 8, !tbaa !5
  store ptr %69, ptr @vileobj, align 8, !tbaa !5
  %70 = load i32, ptr %3, align 4, !tbaa !19
  store i32 %70, ptr %7, align 4, !tbaa !19
  br label %71

71:                                               ; preds = %129, %16
  %72 = load i32, ptr %7, align 4, !tbaa !19
  %73 = load i32, ptr %4, align 4, !tbaa !19
  %74 = icmp sle i32 %72, %73
  br i1 %74, label %75, label %132

75:                                               ; preds = %71
  %76 = load i32, ptr %5, align 4, !tbaa !19
  store i32 %76, ptr %8, align 4, !tbaa !19
  br label %77

77:                                               ; preds = %125, %75
  %78 = load i32, ptr %8, align 4, !tbaa !19
  %79 = load i32, ptr %6, align 4, !tbaa !19
  %80 = icmp sle i32 %78, %79
  br i1 %80, label %81, label %128

81:                                               ; preds = %77
  %82 = load i32, ptr %7, align 4, !tbaa !19
  %83 = load i32, ptr %8, align 4, !tbaa !19
  %84 = call i32 @P_BlockThingsIterator(i32 noundef %82, i32 noundef %83, ptr noundef @PIT_VileCheck)
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %124, label %86

86:                                               ; preds = %81
  %87 = load ptr, ptr %2, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.mobj_s, ptr %87, i32 0, i32 28
  %89 = load ptr, ptr %88, align 8, !tbaa !21
  store ptr %89, ptr %10, align 8, !tbaa !5
  %90 = load ptr, ptr @corpsehit, align 8, !tbaa !5
  %91 = load ptr, ptr %2, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.mobj_s, ptr %91, i32 0, i32 28
  store ptr %90, ptr %92, align 8, !tbaa !21
  %93 = load ptr, ptr %2, align 8, !tbaa !5
  call void @A_FaceTarget(ptr noundef %93)
  %94 = load ptr, ptr %10, align 8, !tbaa !5
  %95 = load ptr, ptr %2, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.mobj_s, ptr %95, i32 0, i32 28
  store ptr %94, ptr %96, align 8, !tbaa !21
  %97 = load ptr, ptr %2, align 8, !tbaa !5
  %98 = call i32 @P_SetMobjState(ptr noundef %97, i32 noundef 266)
  %99 = load ptr, ptr @corpsehit, align 8, !tbaa !5
  call void @S_StartSound(ptr noundef %99, i32 noundef 31)
  %100 = load ptr, ptr @corpsehit, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.mobj_s, ptr %100, i32 0, i32 21
  %102 = load ptr, ptr %101, align 8, !tbaa !16
  store ptr %102, ptr %9, align 8, !tbaa !5
  %103 = load ptr, ptr @corpsehit, align 8, !tbaa !5
  %104 = load ptr, ptr %9, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.mobjinfo_t, ptr %104, i32 0, i32 22
  %106 = load i32, ptr %105, align 4, !tbaa !22
  %107 = call i32 @P_SetMobjState(ptr noundef %103, i32 noundef %106)
  %108 = load ptr, ptr @corpsehit, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.mobj_s, ptr %108, i32 0, i32 15
  %110 = load i32, ptr %109, align 4, !tbaa !23
  %111 = shl i32 %110, 2
  store i32 %111, ptr %109, align 4, !tbaa !23
  %112 = load ptr, ptr %9, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.mobjinfo_t, ptr %112, i32 0, i32 21
  %114 = load i32, ptr %113, align 4, !tbaa !24
  %115 = load ptr, ptr @corpsehit, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.mobj_s, ptr %115, i32 0, i32 24
  store i32 %114, ptr %116, align 8, !tbaa !25
  %117 = load ptr, ptr %9, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.mobjinfo_t, ptr %117, i32 0, i32 2
  %119 = load i32, ptr %118, align 4, !tbaa !26
  %120 = load ptr, ptr @corpsehit, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.mobj_s, ptr %120, i32 0, i32 25
  store i32 %119, ptr %121, align 4, !tbaa !27
  %122 = load ptr, ptr @corpsehit, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.mobj_s, ptr %122, i32 0, i32 28
  store ptr null, ptr %123, align 8, !tbaa !21
  store i32 1, ptr %11, align 4
  br label %135

124:                                              ; preds = %81
  br label %125

125:                                              ; preds = %124
  %126 = load i32, ptr %8, align 4, !tbaa !19
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %8, align 4, !tbaa !19
  br label %77, !llvm.loop !28

128:                                              ; preds = %77
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %7, align 4, !tbaa !19
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %7, align 4, !tbaa !19
  br label %71, !llvm.loop !30

132:                                              ; preds = %71
  br label %133

133:                                              ; preds = %132, %1
  %134 = load ptr, ptr %2, align 8, !tbaa !5
  call void @A_Chase(ptr noundef %134)
  store i32 0, ptr %11, align 4
  br label %135

135:                                              ; preds = %133, %86
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  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 4, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  %136 = load i32, ptr %11, align 4
  switch i32 %136, label %138 [
    i32 0, label %137
    i32 1, label %137
  ]

137:                                              ; preds = %135, %135
  ret void

138:                                              ; preds = %135
  unreachable
}

declare i32 @P_BlockThingsIterator(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, !12, i64 168}
!10 = !{!"mobj_s", !11, i64 0, !12, i64 24, !12, i64 28, !12, i64 32, !6, i64 40, !6, i64 48, !12, i64 56, !12, i64 60, !12, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !12, i64 96, !12, i64 100, !12, i64 104, !12, i64 108, !12, i64 112, !12, i64 116, !12, i64 120, !12, i64 124, !12, i64 128, !6, i64 136, !12, i64 144, !6, i64 152, !12, i64 160, !12, i64 164, !12, i64 168, !12, i64 172, !6, i64 176, !12, i64 184, !12, i64 188, !6, i64 192, !12, i64 200, !13, i64 204, !6, i64 216}
!11 = !{!"thinker_s", !6, i64 0, !6, i64 8, !7, i64 16}
!12 = !{!"int", !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, !12, i64 24}
!16 = !{!10, !6, i64 136}
!17 = !{!18, !12, i64 60}
!18 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !12, i64 56, !12, i64 60, !12, i64 64, !12, i64 68, !12, i64 72, !12, i64 76, !12, i64 80, !12, i64 84, !12, i64 88}
!19 = !{!12, !12, i64 0}
!20 = !{!10, !12, i64 28}
!21 = !{!10, !6, i64 176}
!22 = !{!18, !12, i64 88}
!23 = !{!10, !12, i64 108}
!24 = !{!18, !12, i64 84}
!25 = !{!10, !12, i64 160}
!26 = !{!18, !12, i64 8}
!27 = !{!10, !12, i64 164}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = distinct !{!30, !29}


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

@xspeed = external dso_local local_unnamed_addr global [8 x i32], align 16
@yspeed = external dso_local local_unnamed_addr global [8 x i32], align 16
@viletryx = external dso_local local_unnamed_addr global i32, align 4
@viletryy = external dso_local local_unnamed_addr global i32, align 4
@corpsehit = external dso_local local_unnamed_addr global ptr, align 8
@bmaporgx = external local_unnamed_addr global i32, align 4
@bmaporgy = external local_unnamed_addr global i32, align 4
@vileobj = external dso_local local_unnamed_addr global ptr, align 8

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @A_Chase(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @A_FaceTarget(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local void @A_VileChase(ptr noundef %0) local_unnamed_addr #1 {
  %2 = getelementptr inbounds i8, ptr %0, i64 168
  %3 = load i32, ptr %2, align 8, !tbaa !5
  %.not = icmp eq i32 %3, 8
  br i1 %.not, label %.loopexit, label %4

4:                                                ; preds = %1
  %5 = getelementptr inbounds i8, ptr %0, i64 24
  %6 = load i32, ptr %5, align 8, !tbaa !14
  %7 = getelementptr inbounds i8, ptr %0, i64 136
  %8 = load ptr, ptr %7, align 8, !tbaa !15
  %9 = getelementptr inbounds i8, ptr %8, i64 60
  %10 = load i32, ptr %9, align 4, !tbaa !16
  %11 = sext i32 %3 to i64
  %12 = getelementptr inbounds [8 x i32], ptr @xspeed, i64 0, i64 %11
  %13 = load i32, ptr %12, align 4, !tbaa !18
  %14 = mul nsw i32 %13, %10
  %15 = add nsw i32 %14, %6
  store i32 %15, ptr @viletryx, align 4, !tbaa !18
  %16 = getelementptr inbounds i8, ptr %0, i64 28
  %17 = load i32, ptr %16, align 4, !tbaa !19
  %18 = getelementptr inbounds [8 x i32], ptr @yspeed, i64 0, i64 %11
  %19 = load i32, ptr %18, align 4, !tbaa !18
  %20 = mul nsw i32 %19, %10
  %21 = add nsw i32 %20, %17
  store i32 %21, ptr @viletryy, align 4, !tbaa !18
  %22 = load i32, ptr @bmaporgx, align 4, !tbaa !18
  %23 = sub nsw i32 %15, %22
  %24 = add nsw i32 %23, -4194304
  %25 = ashr i32 %24, 23
  %26 = add nsw i32 %23, 4194304
  %27 = ashr i32 %26, 23
  %28 = load i32, ptr @bmaporgy, align 4, !tbaa !18
  %29 = sub nsw i32 %21, %28
  %30 = add nsw i32 %29, -4194304
  %31 = ashr i32 %30, 23
  %32 = add nsw i32 %29, 4194304
  %33 = ashr i32 %32, 23
  store ptr %0, ptr @vileobj, align 8, !tbaa !20
  %.not2934 = icmp sgt i32 %25, %27
  %.not3032 = icmp sgt i32 %31, %33
  %or.cond = select i1 %.not2934, i1 true, i1 %.not3032
  br i1 %or.cond, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %4, %._crit_edge
  %.035 = phi i32 [ %61, %._crit_edge ], [ %25, %4 ]
  br label %36

34:                                               ; preds = %36
  %35 = add nsw i32 %.02733, 1
  %exitcond.not = icmp eq i32 %.02733, %33
  br i1 %exitcond.not, label %._crit_edge, label %36, !llvm.loop !21

36:                                               ; preds = %.preheader, %34
  %.02733 = phi i32 [ %31, %.preheader ], [ %35, %34 ]
  %37 = tail call i32 @P_BlockThingsIterator(i32 noundef %.035, i32 noundef %.02733, ptr noundef nonnull @PIT_VileCheck) #2
  %.not31 = icmp eq i32 %37, 0
  br i1 %.not31, label %38, label %34

38:                                               ; preds = %36
  %39 = getelementptr inbounds i8, ptr %0, i64 176
  %40 = load ptr, ptr %39, align 8, !tbaa !23
  %41 = load ptr, ptr @corpsehit, align 8, !tbaa !20
  store ptr %41, ptr %39, align 8, !tbaa !23
  tail call void @A_FaceTarget(ptr noundef %0)
  store ptr %40, ptr %39, align 8, !tbaa !23
  %42 = tail call i32 @P_SetMobjState(ptr noundef %0, i32 noundef 266) #2
  %43 = load ptr, ptr @corpsehit, align 8, !tbaa !20
  tail call void @S_StartSound(ptr noundef %43, i32 noundef 31) #2
  %44 = load ptr, ptr @corpsehit, align 8, !tbaa !20
  %45 = getelementptr inbounds i8, ptr %44, i64 136
  %46 = load ptr, ptr %45, align 8, !tbaa !15
  %47 = getelementptr inbounds i8, ptr %46, i64 88
  %48 = load i32, ptr %47, align 4, !tbaa !24
  %49 = tail call i32 @P_SetMobjState(ptr noundef %44, i32 noundef %48) #2
  %50 = load ptr, ptr @corpsehit, align 8, !tbaa !20
  %51 = getelementptr inbounds i8, ptr %50, i64 108
  %52 = load i32, ptr %51, align 4, !tbaa !25
  %53 = shl i32 %52, 2
  store i32 %53, ptr %51, align 4, !tbaa !25
  %54 = getelementptr inbounds i8, ptr %46, i64 84
  %55 = load i32, ptr %54, align 4, !tbaa !26
  %56 = getelementptr inbounds i8, ptr %50, i64 160
  store i32 %55, ptr %56, align 8, !tbaa !27
  %57 = getelementptr inbounds i8, ptr %46, i64 8
  %58 = load i32, ptr %57, align 4, !tbaa !28
  %59 = getelementptr inbounds i8, ptr %50, i64 164
  store i32 %58, ptr %59, align 4, !tbaa !29
  %60 = getelementptr inbounds i8, ptr %50, i64 176
  store ptr null, ptr %60, align 8, !tbaa !23
  br label %62

._crit_edge:                                      ; preds = %34
  %61 = add nsw i32 %.035, 1
  %exitcond38.not = icmp eq i32 %.035, %27
  br i1 %exitcond38.not, label %.loopexit, label %.preheader, !llvm.loop !30

.loopexit:                                        ; preds = %._crit_edge, %4, %1
  tail call void @A_Chase(ptr noundef %0)
  br label %62

62:                                               ; preds = %.loopexit, %38
  ret void
}

declare i32 @P_BlockThingsIterator(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, !11, i64 168}
!6 = !{!"mobj_s", !7, i64 0, !11, i64 24, !11, i64 28, !11, i64 32, !8, i64 40, !8, i64 48, !11, i64 56, !11, i64 60, !11, i64 64, !8, i64 72, !8, i64 80, !8, i64 88, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !8, i64 136, !11, i64 144, !8, i64 152, !11, i64 160, !11, i64 164, !11, i64 168, !11, i64 172, !8, i64 176, !11, i64 184, !11, i64 188, !8, i64 192, !11, i64 200, !12, i64 204, !8, i64 216}
!7 = !{!"thinker_s", !8, i64 0, !8, i64 8, !9, i64 16}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"", !13, i64 0, !13, i64 2, !13, i64 4, !13, i64 6, !13, i64 8}
!13 = !{!"short", !9, i64 0}
!14 = !{!6, !11, i64 24}
!15 = !{!6, !8, i64 136}
!16 = !{!17, !11, i64 60}
!17 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !11, i64 88}
!18 = !{!11, !11, i64 0}
!19 = !{!6, !11, i64 28}
!20 = !{!8, !8, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!6, !8, i64 176}
!24 = !{!17, !11, i64 88}
!25 = !{!6, !11, i64 108}
!26 = !{!17, !11, i64 84}
!27 = !{!6, !11, i64 160}
!28 = !{!17, !11, i64 8}
!29 = !{!6, !11, i64 164}
!30 = distinct !{!30, !22}


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