; LLVM IR from libtcod/libtcod :: src/libtcod (path_c)

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

@.str.1 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [76 x i8], align 1
@TCOD_dijkstra_path_set.dx = external hidden global [9 x i32], align 16
@TCOD_dijkstra_path_set.dy = external hidden global [9 x i32], align 16
@__PRETTY_FUNCTION__.TCOD_dijkstra_path_set = external hidden unnamed_addr constant [56 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #0

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

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

declare void @TCOD_list_clear(ptr noundef) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

declare void @TCOD_list_push(ptr noundef, ptr noundef) #2

declare ptr @TCOD_list_pop(ptr noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @TCOD_dijkstra_path_set(ptr noundef %0, i32 noundef %1, i32 noundef %2) #4 {
  %4 = alloca i1, align 1
  %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 [8 x i32], align 16
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = 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) #5
  %18 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %18, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %19 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %19, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #5
  call void @llvm.memset.p0.i64(ptr align 16 %10, i8 0, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.TCOD_Dijkstra, ptr %20, i32 0, i32 0
  %22 = load i32, ptr %21, align 8, !tbaa !11
  %23 = icmp eq i32 %22, 0
  %24 = zext i1 %23 to i64
  %25 = select i1 %23, i32 4, i32 8
  store i32 %25, ptr %12, align 4, !tbaa !9
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = icmp ne ptr %26, null
  br i1 %27, label %28, label %29

28:                                               ; preds = %3
  br label %30

29:                                               ; preds = %3
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.1, i32 noundef 599, ptr noundef @__PRETTY_FUNCTION__.TCOD_dijkstra_path_set) #6
  unreachable

30:                                               ; preds = %28
  %31 = load i32, ptr %6, align 4, !tbaa !9
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.TCOD_Dijkstra, ptr %32, i32 0, i32 1
  %34 = load i32, ptr %33, align 4, !tbaa !13
  %35 = icmp ult i32 %31, %34
  br i1 %35, label %36, label %43

36:                                               ; preds = %30
  %37 = load i32, ptr %7, align 4, !tbaa !9
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.TCOD_Dijkstra, ptr %38, i32 0, i32 2
  %40 = load i32, ptr %39, align 8, !tbaa !14
  %41 = icmp ult i32 %37, %40
  br i1 %41, label %42, label %43

42:                                               ; preds = %36
  br label %44

43:                                               ; preds = %36, %30
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.1, i32 noundef 600, ptr noundef @__PRETTY_FUNCTION__.TCOD_dijkstra_path_set) #6
  unreachable

44:                                               ; preds = %42
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = load i32, ptr %6, align 4, !tbaa !9
  %47 = load i32, ptr %7, align 4, !tbaa !9
  %48 = call i32 @dijkstra_get_int_distance(ptr noundef %45, i32 noundef %46, i32 noundef %47)
  %49 = icmp eq i32 %48, -1
  br i1 %49, label %50, label %51

50:                                               ; preds = %44
  store i1 false, ptr %4, align 1
  store i32 1, ptr %13, align 4
  br label %159

51:                                               ; preds = %44
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.TCOD_Dijkstra, ptr %52, i32 0, i32 9
  %54 = load ptr, ptr %53, align 8, !tbaa !15
  call void @TCOD_list_clear(ptr noundef %54)
  br label %55

55:                                               ; preds = %151, %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.TCOD_Dijkstra, ptr %56, i32 0, i32 9
  %58 = load ptr, ptr %57, align 8, !tbaa !15
  %59 = load i32, ptr %9, align 4, !tbaa !9
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.TCOD_Dijkstra, ptr %60, i32 0, i32 1
  %62 = load i32, ptr %61, align 4, !tbaa !13
  %63 = mul nsw i32 %59, %62
  %64 = load i32, ptr %8, align 4, !tbaa !9
  %65 = add nsw i32 %63, %64
  %66 = sext i32 %65 to i64
  %67 = inttoptr i64 %66 to ptr
  call void @TCOD_list_push(ptr noundef %58, ptr noundef %67)
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %68

68:                                               ; preds = %109, %55
  %69 = load i32, ptr %15, align 4, !tbaa !9
  %70 = load i32, ptr %12, align 4, !tbaa !9
  %71 = icmp slt i32 %69, %70
  br i1 %71, label %72, label %112

72:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %73 = load i32, ptr %8, align 4, !tbaa !9
  %74 = load i32, ptr %15, align 4, !tbaa !9
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [9 x i32], ptr @TCOD_dijkstra_path_set.dx, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !9
  %78 = add nsw i32 %73, %77
  store i32 %78, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %79 = load i32, ptr %9, align 4, !tbaa !9
  %80 = load i32, ptr %15, align 4, !tbaa !9
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [9 x i32], ptr @TCOD_dijkstra_path_set.dy, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !9
  %84 = add nsw i32 %79, %83
  store i32 %84, ptr %17, align 4, !tbaa !9
  %85 = load i32, ptr %16, align 4, !tbaa !9
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.TCOD_Dijkstra, ptr %86, i32 0, i32 1
  %88 = load i32, ptr %87, align 4, !tbaa !13
  %89 = icmp ult i32 %85, %88
  br i1 %89, label %90, label %104

90:                                               ; preds = %72
  %91 = load i32, ptr %17, align 4, !tbaa !9
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.TCOD_Dijkstra, ptr %92, i32 0, i32 2
  %94 = load i32, ptr %93, align 8, !tbaa !14
  %95 = icmp ult i32 %91, %94
  br i1 %95, label %96, label %104

96:                                               ; preds = %90
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = load i32, ptr %16, align 4, !tbaa !9
  %99 = load i32, ptr %17, align 4, !tbaa !9
  %100 = call i32 @dijkstra_get_int_distance(ptr noundef %97, i32 noundef %98, i32 noundef %99)
  %101 = load i32, ptr %15, align 4, !tbaa !9
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [8 x i32], ptr %10, i64 0, i64 %102
  store i32 %100, ptr %103, align 4, !tbaa !9
  br label %108

104:                                              ; preds = %90, %72
  %105 = load i32, ptr %15, align 4, !tbaa !9
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [8 x i32], ptr %10, i64 0, i64 %106
  store i32 -1, ptr %107, align 4, !tbaa !9
  br label %108

108:                                              ; preds = %104, %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %15, align 4, !tbaa !9
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %15, align 4, !tbaa !9
  br label %68, !llvm.loop !16

112:                                              ; preds = %68
  %113 = load ptr, ptr %5, align 8, !tbaa !5
  %114 = load i32, ptr %8, align 4, !tbaa !9
  %115 = load i32, ptr %9, align 4, !tbaa !9
  %116 = call i32 @dijkstra_get_int_distance(ptr noundef %113, i32 noundef %114, i32 noundef %115)
  store i32 %116, ptr %14, align 4, !tbaa !9
  store i32 8, ptr %11, align 4, !tbaa !9
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %117

117:                                              ; preds = %135, %112
  %118 = load i32, ptr %15, align 4, !tbaa !9
  %119 = load i32, ptr %12, align 4, !tbaa !9
  %120 = icmp slt i32 %118, %119
  br i1 %120, label %121, label %138

121:                                              ; preds = %117
  %122 = load i32, ptr %15, align 4, !tbaa !9
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [8 x i32], ptr %10, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !9
  %126 = load i32, ptr %14, align 4, !tbaa !9
  %127 = icmp ult i32 %125, %126
  br i1 %127, label %128, label %134

128:                                              ; preds = %121
  %129 = load i32, ptr %15, align 4, !tbaa !9
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [8 x i32], ptr %10, i64 0, i64 %130
  %132 = load i32, ptr %131, align 4, !tbaa !9
  store i32 %132, ptr %14, align 4, !tbaa !9
  %133 = load i32, ptr %15, align 4, !tbaa !9
  store i32 %133, ptr %11, align 4, !tbaa !9
  br label %134

134:                                              ; preds = %128, %121
  br label %135

135:                                              ; preds = %134
  %136 = load i32, ptr %15, align 4, !tbaa !9
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %15, align 4, !tbaa !9
  br label %117, !llvm.loop !18

138:                                              ; preds = %117
  %139 = load i32, ptr %11, align 4, !tbaa !9
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [9 x i32], ptr @TCOD_dijkstra_path_set.dx, i64 0, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !9
  %143 = load i32, ptr %8, align 4, !tbaa !9
  %144 = add nsw i32 %143, %142
  store i32 %144, ptr %8, align 4, !tbaa !9
  %145 = load i32, ptr %11, align 4, !tbaa !9
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [9 x i32], ptr @TCOD_dijkstra_path_set.dy, i64 0, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !9
  %149 = load i32, ptr %9, align 4, !tbaa !9
  %150 = add nsw i32 %149, %148
  store i32 %150, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %151

151:                                              ; preds = %138
  %152 = load i32, ptr %11, align 4, !tbaa !9
  %153 = icmp ne i32 %152, 8
  br i1 %153, label %55, label %154, !llvm.loop !19

154:                                              ; preds = %151
  %155 = load ptr, ptr %5, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.TCOD_Dijkstra, ptr %155, i32 0, i32 9
  %157 = load ptr, ptr %156, align 8, !tbaa !15
  %158 = call ptr @TCOD_list_pop(ptr noundef %157)
  store i1 true, ptr %4, align 1
  store i32 1, ptr %13, align 4
  br label %159

159:                                              ; preds = %154, %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  %160 = load i1, ptr %4, align 1
  ret i1 %160
}

attributes #0 = { noreturn nounwind "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 = { nocallback nofree nosync 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 #5 = { nounwind }
attributes #6 = { 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, !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 0}
!12 = !{!"TCOD_Dijkstra", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!13 = !{!12, !10, i64 4}
!14 = !{!12, !10, i64 8}
!15 = !{!12, !6, i64 56}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = distinct !{!19, !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"

@.str.1 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [76 x i8], align 1
@TCOD_dijkstra_path_set.dx = external hidden local_unnamed_addr global [9 x i32], align 16
@TCOD_dijkstra_path_set.dy = external hidden local_unnamed_addr global [9 x i32], align 16
@__PRETTY_FUNCTION__.TCOD_dijkstra_path_set = external hidden unnamed_addr constant [56 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

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

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

declare void @TCOD_list_clear(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

declare void @TCOD_list_push(ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @TCOD_list_pop(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @TCOD_dijkstra_path_set(ptr noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #4 {
  %4 = alloca [8 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %4, i8 0, i64 32, i1 false)
  %5 = load i32, ptr %0, align 8, !tbaa !5
  %6 = icmp eq i32 %5, 0
  %wide.trip.count = select i1 %6, i64 4, i64 8
  %7 = getelementptr inbounds i8, ptr %0, i64 4
  %8 = load i32, ptr %7, align 4, !tbaa !11
  %9 = icmp ugt i32 %8, %1
  br i1 %9, label %10, label %14

10:                                               ; preds = %3
  %11 = getelementptr inbounds i8, ptr %0, i64 8
  %12 = load i32, ptr %11, align 8, !tbaa !12
  %13 = icmp ugt i32 %12, %2
  br i1 %13, label %15, label %14

14:                                               ; preds = %10, %3
  tail call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.1, i32 noundef 600, ptr noundef nonnull @__PRETTY_FUNCTION__.TCOD_dijkstra_path_set) #7
  unreachable

15:                                               ; preds = %10
  %16 = tail call i32 @dijkstra_get_int_distance(ptr noundef nonnull %0, i32 noundef %1, i32 noundef %2)
  %17 = icmp ne i32 %16, -1
  br i1 %17, label %18, label %74

18:                                               ; preds = %15
  %19 = getelementptr inbounds i8, ptr %0, i64 56
  %20 = load ptr, ptr %19, align 8, !tbaa !13
  tail call void @TCOD_list_clear(ptr noundef %20) #6
  br label %21

21:                                               ; preds = %63, %18
  %.052 = phi i32 [ %2, %18 ], [ %70, %63 ]
  %.048 = phi i32 [ %1, %18 ], [ %67, %63 ]
  %22 = load ptr, ptr %19, align 8, !tbaa !13
  %23 = load i32, ptr %7, align 4, !tbaa !11
  %24 = mul nsw i32 %23, %.052
  %25 = add nsw i32 %24, %.048
  %26 = sext i32 %25 to i64
  %27 = inttoptr i64 %26 to ptr
  tail call void @TCOD_list_push(ptr noundef %22, ptr noundef %27) #6
  br label %28

28:                                               ; preds = %21, %42
  %indvars.iv = phi i64 [ 0, %21 ], [ %indvars.iv.next, %42 ]
  %29 = getelementptr inbounds [9 x i32], ptr @TCOD_dijkstra_path_set.dx, i64 0, i64 %indvars.iv
  %30 = load i32, ptr %29, align 4, !tbaa !14
  %31 = add nsw i32 %30, %.048
  %32 = getelementptr inbounds [9 x i32], ptr @TCOD_dijkstra_path_set.dy, i64 0, i64 %indvars.iv
  %33 = load i32, ptr %32, align 4, !tbaa !14
  %34 = add nsw i32 %33, %.052
  %35 = load i32, ptr %7, align 4, !tbaa !11
  %36 = icmp ult i32 %31, %35
  br i1 %36, label %37, label %42

37:                                               ; preds = %28
  %38 = load i32, ptr %11, align 8, !tbaa !12
  %39 = icmp ult i32 %34, %38
  br i1 %39, label %40, label %42

40:                                               ; preds = %37
  %41 = tail call i32 @dijkstra_get_int_distance(ptr noundef nonnull %0, i32 noundef %31, i32 noundef %34)
  br label %42

42:                                               ; preds = %28, %37, %40
  %.sink = phi i32 [ %41, %40 ], [ -1, %37 ], [ -1, %28 ]
  %43 = getelementptr inbounds [8 x i32], ptr %4, i64 0, i64 %indvars.iv
  store i32 %.sink, ptr %43, align 4, !tbaa !14
  %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 %44, label %28, !llvm.loop !15

44:                                               ; preds = %42
  %45 = tail call i32 @dijkstra_get_int_distance(ptr noundef nonnull %0, i32 noundef %.048, i32 noundef %.052)
  br label %46

46:                                               ; preds = %46, %44
  %indvars.iv67 = phi i64 [ 0, %44 ], [ %indvars.iv.next68.3, %46 ]
  %.05064 = phi i32 [ %45, %44 ], [ %spec.select61.3, %46 ]
  %.05363 = phi i32 [ 8, %44 ], [ %spec.select.3, %46 ]
  %47 = getelementptr inbounds [8 x i32], ptr %4, i64 0, i64 %indvars.iv67
  %48 = load i32, ptr %47, align 16, !tbaa !14
  %49 = icmp ult i32 %48, %.05064
  %50 = trunc nuw nsw i64 %indvars.iv67 to i32
  %spec.select = select i1 %49, i32 %50, i32 %.05363
  %spec.select61 = tail call i32 @llvm.umin.i32(i32 %48, i32 %.05064)
  %indvars.iv.next68 = or disjoint i64 %indvars.iv67, 1
  %51 = getelementptr inbounds [8 x i32], ptr %4, i64 0, i64 %indvars.iv.next68
  %52 = load i32, ptr %51, align 4, !tbaa !14
  %53 = icmp ult i32 %52, %spec.select61
  %54 = trunc nuw nsw i64 %indvars.iv.next68 to i32
  %spec.select.1 = select i1 %53, i32 %54, i32 %spec.select
  %spec.select61.1 = tail call i32 @llvm.umin.i32(i32 %52, i32 %spec.select61)
  %indvars.iv.next68.1 = or disjoint i64 %indvars.iv67, 2
  %55 = getelementptr inbounds [8 x i32], ptr %4, i64 0, i64 %indvars.iv.next68.1
  %56 = load i32, ptr %55, align 8, !tbaa !14
  %57 = icmp ult i32 %56, %spec.select61.1
  %58 = trunc nuw nsw i64 %indvars.iv.next68.1 to i32
  %spec.select.2 = select i1 %57, i32 %58, i32 %spec.select.1
  %spec.select61.2 = tail call i32 @llvm.umin.i32(i32 %56, i32 %spec.select61.1)
  %indvars.iv.next68.2 = or disjoint i64 %indvars.iv67, 3
  %59 = getelementptr inbounds [8 x i32], ptr %4, i64 0, i64 %indvars.iv.next68.2
  %60 = load i32, ptr %59, align 4, !tbaa !14
  %61 = icmp ult i32 %60, %spec.select61.2
  %62 = trunc nuw nsw i64 %indvars.iv.next68.2 to i32
  %spec.select.3 = select i1 %61, i32 %62, i32 %spec.select.2
  %spec.select61.3 = tail call i32 @llvm.umin.i32(i32 %60, i32 %spec.select61.2)
  %indvars.iv.next68.3 = add nuw nsw i64 %indvars.iv67, 4
  %exitcond71.not.3 = icmp eq i64 %indvars.iv.next68.3, %wide.trip.count
  br i1 %exitcond71.not.3, label %63, label %46, !llvm.loop !17

63:                                               ; preds = %46
  %64 = sext i32 %spec.select.3 to i64
  %65 = getelementptr inbounds [9 x i32], ptr @TCOD_dijkstra_path_set.dx, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !14
  %67 = add nsw i32 %66, %.048
  %68 = getelementptr inbounds [9 x i32], ptr @TCOD_dijkstra_path_set.dy, i64 0, i64 %64
  %69 = load i32, ptr %68, align 4, !tbaa !14
  %70 = add nsw i32 %69, %.052
  %.not = icmp eq i32 %spec.select.3, 8
  br i1 %.not, label %71, label %21, !llvm.loop !18

71:                                               ; preds = %63
  %72 = load ptr, ptr %19, align 8, !tbaa !13
  %73 = tail call ptr @TCOD_list_pop(ptr noundef %72) #6
  br label %74

74:                                               ; preds = %15, %71
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #6
  ret i1 %17
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #5

attributes #0 = { noreturn nounwind "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 = { mustprogress nocallback nofree nosync 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { 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 0}
!6 = !{!"TCOD_Dijkstra", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{!6, !7, i64 8}
!13 = !{!6, !10, i64 56}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopRotatePass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass