; LLVM IR from TharushaDinujaya/MicroMouse :: test/mms-cpp/Main.ll (Z16update_flood_mapPPiS0_P5queue)

; 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.Point = type { i32, i32 }

; 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: mustprogress uwtable
define dso_local void @_Z16update_flood_mapPPiS0_P5queue(ptr noundef %0, ptr noundef %1, ptr noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %struct.Point, align 4
  %8 = alloca %struct.Point, align 4
  %9 = alloca %struct.Point, align 4
  %10 = alloca %struct.Point, align 4
  %11 = alloca %struct.Point, align 4
  %12 = alloca i32, align 4
  %13 = alloca %struct.Point, align 4
  %14 = alloca %struct.Point, align 4
  %15 = alloca %struct.Point, align 4
  %16 = alloca %struct.Point, align 4
  %17 = alloca %struct.Point, align 4
  %18 = alloca %struct.Point, align 4
  %19 = alloca %struct.Point, align 4
  %20 = alloca %struct.Point, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_Z11queue_resetP5queue(ptr noundef %21)
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.Point, ptr %7, i32 0, i32 0
  store i32 7, ptr %23, align 4, !tbaa !9
  %24 = getelementptr inbounds %struct.Point, ptr %7, i32 0, i32 1
  store i32 7, ptr %24, align 4, !tbaa !12
  %25 = load i64, ptr %7, align 4
  call void @_Z7enqueueP5queue5Point(ptr noundef %22, i64 %25)
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.Point, ptr %8, i32 0, i32 0
  store i32 8, ptr %27, align 4, !tbaa !9
  %28 = getelementptr inbounds %struct.Point, ptr %8, i32 0, i32 1
  store i32 7, ptr %28, align 4, !tbaa !12
  %29 = load i64, ptr %8, align 4
  call void @_Z7enqueueP5queue5Point(ptr noundef %26, i64 %29)
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.Point, ptr %9, i32 0, i32 0
  store i32 7, ptr %31, align 4, !tbaa !9
  %32 = getelementptr inbounds %struct.Point, ptr %9, i32 0, i32 1
  store i32 8, ptr %32, align 4, !tbaa !12
  %33 = load i64, ptr %9, align 4
  call void @_Z7enqueueP5queue5Point(ptr noundef %30, i64 %33)
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.Point, ptr %10, i32 0, i32 0
  store i32 8, ptr %35, align 4, !tbaa !9
  %36 = getelementptr inbounds %struct.Point, ptr %10, i32 0, i32 1
  store i32 8, ptr %36, align 4, !tbaa !12
  %37 = load i64, ptr %10, align 4
  call void @_Z7enqueueP5queue5Point(ptr noundef %34, i64 %37)
  br label %38

38:                                               ; preds = %219, %3
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = call noundef zeroext i1 @_Z5emptyP5queue(ptr noundef %39)
  %41 = xor i1 %40, true
  br i1 %41, label %42, label %220

42:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = call i64 @_Z7dequeueP5queue(ptr noundef %43)
  store i64 %44, ptr %11, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 0
  %47 = load i32, ptr %46, align 4, !tbaa !9
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds ptr, ptr %45, i64 %48
  %50 = load ptr, ptr %49, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 1
  %52 = load i32, ptr %51, align 4, !tbaa !12
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds i32, ptr %50, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !13
  store i32 %55, ptr %12, align 4, !tbaa !13
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %11, i64 8, i1 false), !tbaa.struct !14
  %57 = load i64, ptr %13, align 4
  %58 = call noundef zeroext i1 @_Z10isLeftWallPPi5Point(ptr noundef %56, i64 %57)
  br i1 %58, label %96, label %59

59:                                               ; preds = %42
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 0
  %62 = load i32, ptr %61, align 4, !tbaa !9
  %63 = sub nsw i32 %62, 1
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds ptr, ptr %60, i64 %64
  %66 = load ptr, ptr %65, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 1
  %68 = load i32, ptr %67, align 4, !tbaa !12
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds i32, ptr %66, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !13
  %72 = icmp eq i32 %71, 99999
  br i1 %72, label %73, label %96

73:                                               ; preds = %59
  %74 = load i32, ptr %12, align 4, !tbaa !13
  %75 = add nsw i32 %74, 1
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 0
  %78 = load i32, ptr %77, align 4, !tbaa !9
  %79 = sub nsw i32 %78, 1
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds ptr, ptr %76, i64 %80
  %82 = load ptr, ptr %81, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 1
  %84 = load i32, ptr %83, align 4, !tbaa !12
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds i32, ptr %82, i64 %85
  store i32 %75, ptr %86, align 4, !tbaa !13
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.Point, ptr %14, i32 0, i32 0
  %89 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 0
  %90 = load i32, ptr %89, align 4, !tbaa !9
  %91 = sub nsw i32 %90, 1
  store i32 %91, ptr %88, align 4, !tbaa !9
  %92 = getelementptr inbounds %struct.Point, ptr %14, i32 0, i32 1
  %93 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 1
  %94 = load i32, ptr %93, align 4, !tbaa !12
  store i32 %94, ptr %92, align 4, !tbaa !12
  %95 = load i64, ptr %14, align 4
  call void @_Z7enqueueP5queue5Point(ptr noundef %87, i64 %95)
  br label %96

96:                                               ; preds = %73, %59, %42
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %11, i64 8, i1 false), !tbaa.struct !14
  %98 = load i64, ptr %15, align 4
  %99 = call noundef zeroext i1 @_Z11isRightWallPPi5Point(ptr noundef %97, i64 %98)
  br i1 %99, label %137, label %100

100:                                              ; preds = %96
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 0
  %103 = load i32, ptr %102, align 4, !tbaa !9
  %104 = add nsw i32 %103, 1
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds ptr, ptr %101, i64 %105
  %107 = load ptr, ptr %106, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 1
  %109 = load i32, ptr %108, align 4, !tbaa !12
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds i32, ptr %107, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !13
  %113 = icmp eq i32 %112, 99999
  br i1 %113, label %114, label %137

114:                                              ; preds = %100
  %115 = load i32, ptr %12, align 4, !tbaa !13
  %116 = add nsw i32 %115, 1
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 0
  %119 = load i32, ptr %118, align 4, !tbaa !9
  %120 = add nsw i32 %119, 1
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds ptr, ptr %117, i64 %121
  %123 = load ptr, ptr %122, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 1
  %125 = load i32, ptr %124, align 4, !tbaa !12
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds i32, ptr %123, i64 %126
  store i32 %116, ptr %127, align 4, !tbaa !13
  %128 = load ptr, ptr %6, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.Point, ptr %16, i32 0, i32 0
  %130 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 0
  %131 = load i32, ptr %130, align 4, !tbaa !9
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %129, align 4, !tbaa !9
  %133 = getelementptr inbounds %struct.Point, ptr %16, i32 0, i32 1
  %134 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 1
  %135 = load i32, ptr %134, align 4, !tbaa !12
  store i32 %135, ptr %133, align 4, !tbaa !12
  %136 = load i64, ptr %16, align 4
  call void @_Z7enqueueP5queue5Point(ptr noundef %128, i64 %136)
  br label %137

137:                                              ; preds = %114, %100, %96
  %138 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %11, i64 8, i1 false), !tbaa.struct !14
  %139 = load i64, ptr %17, align 4
  %140 = call noundef zeroext i1 @_Z11isFrontWallPPi5Point(ptr noundef %138, i64 %139)
  br i1 %140, label %178, label %141

141:                                              ; preds = %137
  %142 = load ptr, ptr %4, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 0
  %144 = load i32, ptr %143, align 4, !tbaa !9
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds ptr, ptr %142, i64 %145
  %147 = load ptr, ptr %146, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 1
  %149 = load i32, ptr %148, align 4, !tbaa !12
  %150 = add nsw i32 %149, 1
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds i32, ptr %147, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !13
  %154 = icmp eq i32 %153, 99999
  br i1 %154, label %155, label %178

155:                                              ; preds = %141
  %156 = load i32, ptr %12, align 4, !tbaa !13
  %157 = add nsw i32 %156, 1
  %158 = load ptr, ptr %4, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 0
  %160 = load i32, ptr %159, align 4, !tbaa !9
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds ptr, ptr %158, i64 %161
  %163 = load ptr, ptr %162, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 1
  %165 = load i32, ptr %164, align 4, !tbaa !12
  %166 = add nsw i32 %165, 1
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds i32, ptr %163, i64 %167
  store i32 %157, ptr %168, align 4, !tbaa !13
  %169 = load ptr, ptr %6, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.Point, ptr %18, i32 0, i32 0
  %171 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 0
  %172 = load i32, ptr %171, align 4, !tbaa !9
  store i32 %172, ptr %170, align 4, !tbaa !9
  %173 = getelementptr inbounds %struct.Point, ptr %18, i32 0, i32 1
  %174 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 1
  %175 = load i32, ptr %174, align 4, !tbaa !12
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %173, align 4, !tbaa !12
  %177 = load i64, ptr %18, align 4
  call void @_Z7enqueueP5queue5Point(ptr noundef %169, i64 %177)
  br label %178

178:                                              ; preds = %155, %141, %137
  %179 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %11, i64 8, i1 false), !tbaa.struct !14
  %180 = load i64, ptr %19, align 4
  %181 = call noundef zeroext i1 @_Z10isBackWallPPi5Point(ptr noundef %179, i64 %180)
  br i1 %181, label %219, label %182

182:                                              ; preds = %178
  %183 = load ptr, ptr %4, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 0
  %185 = load i32, ptr %184, align 4, !tbaa !9
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds ptr, ptr %183, i64 %186
  %188 = load ptr, ptr %187, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 1
  %190 = load i32, ptr %189, align 4, !tbaa !12
  %191 = sub nsw i32 %190, 1
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds i32, ptr %188, i64 %192
  %194 = load i32, ptr %193, align 4, !tbaa !13
  %195 = icmp eq i32 %194, 99999
  br i1 %195, label %196, label %219

196:                                              ; preds = %182
  %197 = load i32, ptr %12, align 4, !tbaa !13
  %198 = add nsw i32 %197, 1
  %199 = load ptr, ptr %4, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 0
  %201 = load i32, ptr %200, align 4, !tbaa !9
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds ptr, ptr %199, i64 %202
  %204 = load ptr, ptr %203, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 1
  %206 = load i32, ptr %205, align 4, !tbaa !12
  %207 = sub nsw i32 %206, 1
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds i32, ptr %204, i64 %208
  store i32 %198, ptr %209, align 4, !tbaa !13
  %210 = load ptr, ptr %6, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.Point, ptr %20, i32 0, i32 0
  %212 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 0
  %213 = load i32, ptr %212, align 4, !tbaa !9
  store i32 %213, ptr %211, align 4, !tbaa !9
  %214 = getelementptr inbounds %struct.Point, ptr %20, i32 0, i32 1
  %215 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 1
  %216 = load i32, ptr %215, align 4, !tbaa !12
  %217 = sub nsw i32 %216, 1
  store i32 %217, ptr %214, align 4, !tbaa !12
  %218 = load i64, ptr %20, align 4
  call void @_Z7enqueueP5queue5Point(ptr noundef %210, i64 %218)
  br label %219

219:                                              ; preds = %196, %182, %178
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %38, !llvm.loop !15

220:                                              ; preds = %38
  ret void
}

; 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) #2

declare void @_Z11queue_resetP5queue(ptr noundef) #3

declare void @_Z7enqueueP5queue5Point(ptr noundef, i64) #3

declare noundef zeroext i1 @_Z5emptyP5queue(ptr noundef) #3

declare i64 @_Z7dequeueP5queue(ptr noundef) #3

declare noundef zeroext i1 @_Z10isLeftWallPPi5Point(ptr noundef, i64) #3

declare noundef zeroext i1 @_Z11isRightWallPPi5Point(ptr noundef, i64) #3

declare noundef zeroext i1 @_Z11isFrontWallPPi5Point(ptr noundef, i64) #3

declare noundef zeroext i1 @_Z10isBackWallPPi5Point(ptr noundef, i64) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 }

!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++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTS5Point", !11, i64 0, !11, i64 4}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 4}
!13 = !{!11, !11, i64 0}
!14 = !{i64 0, i64 4, !13, i64 4, i64 4, !13}
!15 = distinct !{!15, !16}
!16 = !{!"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"

; Function Attrs: mustprogress uwtable
define dso_local void @_Z16update_flood_mapPPiS0_P5queue(ptr nocapture noundef readonly %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  tail call void @_Z11queue_resetP5queue(ptr noundef %2)
  tail call void @_Z7enqueueP5queue5Point(ptr noundef %2, i64 30064771079)
  tail call void @_Z7enqueueP5queue5Point(ptr noundef %2, i64 30064771080)
  tail call void @_Z7enqueueP5queue5Point(ptr noundef %2, i64 34359738375)
  tail call void @_Z7enqueueP5queue5Point(ptr noundef %2, i64 34359738376)
  %4 = tail call noundef zeroext i1 @_Z5emptyP5queue(ptr noundef %2)
  br i1 %4, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %3, %57
  %5 = tail call i64 @_Z7dequeueP5queue(ptr noundef %2)
  %.sroa.014.0.extract.trunc = trunc i64 %5 to i32
  %.sroa.20.0.extract.shift = lshr i64 %5, 32
  %.sroa.20.0.extract.trunc = trunc nuw i64 %.sroa.20.0.extract.shift to i32
  %sext = shl i64 %5, 32
  %6 = ashr exact i64 %sext, 29
  %7 = getelementptr inbounds i8, ptr %0, i64 %6
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = ashr i64 %5, 32
  %10 = getelementptr inbounds i32, ptr %8, i64 %9
  %11 = load i32, ptr %10, align 4, !tbaa !9
  %.sroa.20.0.insert.shift45 = and i64 %5, -4294967296
  %.sroa.014.0.insert.ext33 = and i64 %5, 4294967295
  %12 = tail call noundef zeroext i1 @_Z10isLeftWallPPi5Point(ptr noundef %1, i64 %5)
  br i1 %12, label %23, label %13

13:                                               ; preds = %.lr.ph
  %14 = add nsw i32 %.sroa.014.0.extract.trunc, -1
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds ptr, ptr %0, i64 %15
  %17 = load ptr, ptr %16, align 8, !tbaa !5
  %18 = getelementptr inbounds i32, ptr %17, i64 %9
  %19 = load i32, ptr %18, align 4, !tbaa !9
  %20 = icmp eq i32 %19, 99999
  br i1 %20, label %21, label %23

21:                                               ; preds = %13
  %22 = add nsw i32 %11, 1
  store i32 %22, ptr %18, align 4, !tbaa !9
  %.sroa.08.0.insert.ext = zext i32 %14 to i64
  %.sroa.08.0.insert.insert = or disjoint i64 %.sroa.20.0.insert.shift45, %.sroa.08.0.insert.ext
  tail call void @_Z7enqueueP5queue5Point(ptr noundef %2, i64 %.sroa.08.0.insert.insert)
  br label %23

23:                                               ; preds = %21, %13, %.lr.ph
  %24 = tail call noundef zeroext i1 @_Z11isRightWallPPi5Point(ptr noundef %1, i64 %5)
  br i1 %24, label %35, label %25

25:                                               ; preds = %23
  %26 = add nsw i32 %.sroa.014.0.extract.trunc, 1
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds ptr, ptr %0, i64 %27
  %29 = load ptr, ptr %28, align 8, !tbaa !5
  %30 = getelementptr inbounds i32, ptr %29, i64 %9
  %31 = load i32, ptr %30, align 4, !tbaa !9
  %32 = icmp eq i32 %31, 99999
  br i1 %32, label %33, label %35

33:                                               ; preds = %25
  %34 = add nsw i32 %11, 1
  store i32 %34, ptr %30, align 4, !tbaa !9
  %.sroa.05.0.insert.ext = zext i32 %26 to i64
  %.sroa.05.0.insert.insert = or disjoint i64 %.sroa.20.0.insert.shift45, %.sroa.05.0.insert.ext
  tail call void @_Z7enqueueP5queue5Point(ptr noundef %2, i64 %.sroa.05.0.insert.insert)
  br label %35

35:                                               ; preds = %33, %25, %23
  %36 = tail call noundef zeroext i1 @_Z11isFrontWallPPi5Point(ptr noundef %1, i64 %5)
  br i1 %36, label %46, label %37

37:                                               ; preds = %35
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = add nsw i32 %.sroa.20.0.extract.trunc, 1
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds i32, ptr %38, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !9
  %43 = icmp eq i32 %42, 99999
  br i1 %43, label %44, label %46

44:                                               ; preds = %37
  %45 = add nsw i32 %11, 1
  store i32 %45, ptr %41, align 4, !tbaa !9
  %.sroa.23.0.insert.ext = zext i32 %39 to i64
  %.sroa.23.0.insert.shift = shl nuw i64 %.sroa.23.0.insert.ext, 32
  %.sroa.02.0.insert.insert = or disjoint i64 %.sroa.23.0.insert.shift, %.sroa.014.0.insert.ext33
  tail call void @_Z7enqueueP5queue5Point(ptr noundef %2, i64 %.sroa.02.0.insert.insert)
  br label %46

46:                                               ; preds = %44, %37, %35
  %47 = tail call noundef zeroext i1 @_Z10isBackWallPPi5Point(ptr noundef %1, i64 %5)
  br i1 %47, label %57, label %48

48:                                               ; preds = %46
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = add nsw i32 %.sroa.20.0.extract.trunc, -1
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds i32, ptr %49, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !9
  %54 = icmp eq i32 %53, 99999
  br i1 %54, label %55, label %57

55:                                               ; preds = %48
  %56 = add nsw i32 %11, 1
  store i32 %56, ptr %52, align 4, !tbaa !9
  %.sroa.2.0.insert.ext = zext i32 %50 to i64
  %.sroa.2.0.insert.shift = shl nuw i64 %.sroa.2.0.insert.ext, 32
  %.sroa.0.0.insert.insert = or disjoint i64 %.sroa.2.0.insert.shift, %.sroa.014.0.insert.ext33
  tail call void @_Z7enqueueP5queue5Point(ptr noundef %2, i64 %.sroa.0.0.insert.insert)
  br label %57

57:                                               ; preds = %55, %48, %46
  %58 = tail call noundef zeroext i1 @_Z5emptyP5queue(ptr noundef %2)
  br i1 %58, label %._crit_edge, label %.lr.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %57, %3
  ret void
}

declare void @_Z11queue_resetP5queue(ptr noundef) local_unnamed_addr #1

declare void @_Z7enqueueP5queue5Point(ptr noundef, i64) local_unnamed_addr #1

declare noundef zeroext i1 @_Z5emptyP5queue(ptr noundef) local_unnamed_addr #1

declare i64 @_Z7dequeueP5queue(ptr noundef) local_unnamed_addr #1

declare noundef zeroext i1 @_Z10isLeftWallPPi5Point(ptr noundef, i64) local_unnamed_addr #1

declare noundef zeroext i1 @_Z11isRightWallPPi5Point(ptr noundef, i64) local_unnamed_addr #1

declare noundef zeroext i1 @_Z11isFrontWallPPi5Point(ptr noundef, i64) local_unnamed_addr #1

declare noundef zeroext i1 @_Z10isBackWallPPi5Point(ptr noundef, i64) local_unnamed_addr #1

attributes #0 = { mustprogress 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" }

!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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


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