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

@.str.1 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [19 x i8], align 1
@__PRETTY_FUNCTION__.TCOD_path_compute = external hidden unnamed_addr constant [57 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [69 x i8], align 1
@dir_x = external hidden constant [9 x i32], align 16
@dir_y = external hidden constant [9 x i32], align 16

; 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

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @TCOD_path_compute(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) #2 {
  %6 = alloca i1, align 1
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !9
  %13 = load ptr, ptr %7, align 8, !tbaa !5
  %14 = icmp ne ptr %13, null
  br i1 %14, label %15, label %16

15:                                               ; preds = %5
  br label %17

16:                                               ; preds = %5
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 267, ptr noundef @__PRETTY_FUNCTION__.TCOD_path_compute) #5
  unreachable

17:                                               ; preds = %15
  %18 = load i32, ptr %8, align 4, !tbaa !9
  %19 = load ptr, ptr %7, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.TCOD_Path, ptr %19, i32 0, i32 0
  store i32 %18, ptr %20, align 8, !tbaa !11
  %21 = load i32, ptr %9, align 4, !tbaa !9
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.TCOD_Path, ptr %22, i32 0, i32 1
  store i32 %21, ptr %23, align 4, !tbaa !14
  %24 = load i32, ptr %10, align 4, !tbaa !9
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.TCOD_Path, ptr %25, i32 0, i32 2
  store i32 %24, ptr %26, align 8, !tbaa !15
  %27 = load i32, ptr %11, align 4, !tbaa !9
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.TCOD_Path, ptr %28, i32 0, i32 3
  store i32 %27, ptr %29, align 4, !tbaa !16
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.TCOD_Path, ptr %30, i32 0, i32 4
  %32 = load ptr, ptr %31, align 8, !tbaa !17
  call void @TCOD_list_clear(ptr noundef %32)
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.TCOD_Path, ptr %33, i32 0, i32 11
  %35 = load ptr, ptr %34, align 8, !tbaa !18
  call void @TCOD_list_clear(ptr noundef %35)
  %36 = load i32, ptr %8, align 4, !tbaa !9
  %37 = load i32, ptr %10, align 4, !tbaa !9
  %38 = icmp eq i32 %36, %37
  br i1 %38, label %39, label %44

39:                                               ; preds = %17
  %40 = load i32, ptr %9, align 4, !tbaa !9
  %41 = load i32, ptr %11, align 4, !tbaa !9
  %42 = icmp eq i32 %40, %41
  br i1 %42, label %43, label %44

43:                                               ; preds = %39
  store i1 true, ptr %6, align 1
  br label %175

44:                                               ; preds = %39, %17
  %45 = load i32, ptr %8, align 4, !tbaa !9
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.TCOD_Path, ptr %46, i32 0, i32 5
  %48 = load i32, ptr %47, align 8, !tbaa !19
  %49 = icmp ult i32 %45, %48
  br i1 %49, label %50, label %57

50:                                               ; preds = %44
  %51 = load i32, ptr %9, align 4, !tbaa !9
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.TCOD_Path, ptr %52, i32 0, i32 6
  %54 = load i32, ptr %53, align 4, !tbaa !20
  %55 = icmp ult i32 %51, %54
  br i1 %55, label %56, label %57

56:                                               ; preds = %50
  br label %58

57:                                               ; preds = %50, %44
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 276, ptr noundef @__PRETTY_FUNCTION__.TCOD_path_compute) #5
  unreachable

58:                                               ; preds = %56
  %59 = load i32, ptr %10, align 4, !tbaa !9
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.TCOD_Path, ptr %60, i32 0, i32 5
  %62 = load i32, ptr %61, align 8, !tbaa !19
  %63 = icmp ult i32 %59, %62
  br i1 %63, label %64, label %71

64:                                               ; preds = %58
  %65 = load i32, ptr %11, align 4, !tbaa !9
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.TCOD_Path, ptr %66, i32 0, i32 6
  %68 = load i32, ptr %67, align 4, !tbaa !20
  %69 = icmp ult i32 %65, %68
  br i1 %69, label %70, label %71

70:                                               ; preds = %64
  br label %72

71:                                               ; preds = %64, %58
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 277, ptr noundef @__PRETTY_FUNCTION__.TCOD_path_compute) #5
  unreachable

72:                                               ; preds = %70
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.TCOD_Path, ptr %73, i32 0, i32 7
  %75 = load ptr, ptr %74, align 8, !tbaa !21
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.TCOD_Path, ptr %76, i32 0, i32 5
  %78 = load i32, ptr %77, align 8, !tbaa !19
  %79 = sext i32 %78 to i64
  %80 = mul i64 4, %79
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.TCOD_Path, ptr %81, i32 0, i32 6
  %83 = load i32, ptr %82, align 4, !tbaa !20
  %84 = sext i32 %83 to i64
  %85 = mul i64 %80, %84
  call void @llvm.memset.p0.i64(ptr align 4 %75, i8 0, i64 %85, i1 false)
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.TCOD_Path, ptr %86, i32 0, i32 9
  %88 = load ptr, ptr %87, align 8, !tbaa !22
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.TCOD_Path, ptr %89, i32 0, i32 5
  %91 = load i32, ptr %90, align 8, !tbaa !19
  %92 = sext i32 %91 to i64
  %93 = mul i64 1, %92
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.TCOD_Path, ptr %94, i32 0, i32 6
  %96 = load i32, ptr %95, align 4, !tbaa !20
  %97 = sext i32 %96 to i64
  %98 = mul i64 %93, %97
  call void @llvm.memset.p0.i64(ptr align 1 %88, i8 4, i64 %98, i1 false)
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.TCOD_Path, ptr %99, i32 0, i32 8
  %101 = load ptr, ptr %100, align 8, !tbaa !23
  %102 = load i32, ptr %8, align 4, !tbaa !9
  %103 = load i32, ptr %9, align 4, !tbaa !9
  %104 = load ptr, ptr %7, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.TCOD_Path, ptr %104, i32 0, i32 5
  %106 = load i32, ptr %105, align 8, !tbaa !19
  %107 = mul nsw i32 %103, %106
  %108 = add nsw i32 %102, %107
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds float, ptr %101, i64 %109
  store float 1.000000e+00, ptr %110, align 4, !tbaa !24
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = load i32, ptr %8, align 4, !tbaa !9
  %113 = load i32, ptr %9, align 4, !tbaa !9
  call void @TCOD_path_push_cell(ptr noundef %111, i32 noundef %112, i32 noundef %113)
  %114 = load ptr, ptr %7, align 8, !tbaa !5
  call void @TCOD_path_set_cells(ptr noundef %114)
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.TCOD_Path, ptr %115, i32 0, i32 7
  %117 = load ptr, ptr %116, align 8, !tbaa !21
  %118 = load i32, ptr %10, align 4, !tbaa !9
  %119 = load i32, ptr %11, align 4, !tbaa !9
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.TCOD_Path, ptr %120, i32 0, i32 5
  %122 = load i32, ptr %121, align 8, !tbaa !19
  %123 = mul nsw i32 %119, %122
  %124 = add nsw i32 %118, %123
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds float, ptr %117, i64 %125
  %127 = load float, ptr %126, align 4, !tbaa !24
  %128 = fcmp oeq float %127, 0.000000e+00
  br i1 %128, label %129, label %130

129:                                              ; preds = %72
  store i1 false, ptr %6, align 1
  br label %175

130:                                              ; preds = %72
  br label %131

131:                                              ; preds = %172, %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %132 = load ptr, ptr %7, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.TCOD_Path, ptr %132, i32 0, i32 9
  %134 = load ptr, ptr %133, align 8, !tbaa !22
  %135 = load i32, ptr %10, align 4, !tbaa !9
  %136 = load i32, ptr %11, align 4, !tbaa !9
  %137 = load ptr, ptr %7, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.TCOD_Path, ptr %137, i32 0, i32 5
  %139 = load i32, ptr %138, align 8, !tbaa !19
  %140 = mul nsw i32 %136, %139
  %141 = add nsw i32 %135, %140
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds i8, ptr %134, i64 %142
  %144 = load i8, ptr %143, align 1, !tbaa !25
  %145 = zext i8 %144 to i32
  store i32 %145, ptr %12, align 4, !tbaa !9
  %146 = load ptr, ptr %7, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.TCOD_Path, ptr %146, i32 0, i32 4
  %148 = load ptr, ptr %147, align 8, !tbaa !17
  %149 = load i32, ptr %12, align 4, !tbaa !9
  %150 = sext i32 %149 to i64
  %151 = inttoptr i64 %150 to ptr
  call void @TCOD_list_push(ptr noundef %148, ptr noundef %151)
  %152 = load i32, ptr %12, align 4, !tbaa !9
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [9 x i32], ptr @dir_x, i64 0, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !9
  %156 = load i32, ptr %10, align 4, !tbaa !9
  %157 = sub nsw i32 %156, %155
  store i32 %157, ptr %10, align 4, !tbaa !9
  %158 = load i32, ptr %12, align 4, !tbaa !9
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [9 x i32], ptr @dir_y, i64 0, i64 %159
  %161 = load i32, ptr %160, align 4, !tbaa !9
  %162 = load i32, ptr %11, align 4, !tbaa !9
  %163 = sub nsw i32 %162, %161
  store i32 %163, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %164

164:                                              ; preds = %131
  %165 = load i32, ptr %10, align 4, !tbaa !9
  %166 = load i32, ptr %8, align 4, !tbaa !9
  %167 = icmp ne i32 %165, %166
  br i1 %167, label %172, label %168

168:                                              ; preds = %164
  %169 = load i32, ptr %11, align 4, !tbaa !9
  %170 = load i32, ptr %9, align 4, !tbaa !9
  %171 = icmp ne i32 %169, %170
  br label %172

172:                                              ; preds = %168, %164
  %173 = phi i1 [ true, %164 ], [ %171, %168 ]
  br i1 %173, label %131, label %174, !llvm.loop !26

174:                                              ; preds = %172
  store i1 true, ptr %6, align 1
  br label %175

175:                                              ; preds = %174, %129, %43
  %176 = load i1, ptr %6, align 1
  ret i1 %176
}

declare void @TCOD_list_clear(ptr noundef) #3

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

; Function Attrs: nounwind uwtable
declare hidden void @TCOD_path_push_cell(ptr noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @TCOD_path_set_cells(ptr noundef) #2

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

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 = { 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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { noreturn nounwind }
attributes #6 = { 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_Path", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !6, i64 16, !10, i64 24, !10, i64 28, !6, i64 32, !6, i64 40, !6, i64 48, !13, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88}
!13 = !{!"float", !7, i64 0}
!14 = !{!12, !10, i64 4}
!15 = !{!12, !10, i64 8}
!16 = !{!12, !10, i64 12}
!17 = !{!12, !6, i64 16}
!18 = !{!12, !6, i64 64}
!19 = !{!12, !10, i64 24}
!20 = !{!12, !10, i64 28}
!21 = !{!12, !6, i64 32}
!22 = !{!12, !6, i64 48}
!23 = !{!12, !6, i64 40}
!24 = !{!13, !13, i64 0}
!25 = !{!7, !7, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"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"

@.str.1 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [19 x i8], align 1
@__PRETTY_FUNCTION__.TCOD_path_compute = external hidden unnamed_addr constant [57 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [69 x i8], align 1
@dir_x = external hidden local_unnamed_addr constant [9 x i32], align 16
@dir_y = external hidden local_unnamed_addr constant [9 x i32], align 16

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

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @TCOD_path_compute(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #1 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %6, label %7

6:                                                ; preds = %5
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 267, ptr noundef nonnull @__PRETTY_FUNCTION__.TCOD_path_compute) #4
  unreachable

7:                                                ; preds = %5
  store i32 %1, ptr %0, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 4
  store i32 %2, ptr %8, align 4, !tbaa !12
  %9 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 %3, ptr %9, align 8, !tbaa !13
  %10 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 %4, ptr %10, align 4, !tbaa !14
  %11 = getelementptr inbounds i8, ptr %0, i64 16
  %12 = load ptr, ptr %11, align 8, !tbaa !15
  tail call void @TCOD_list_clear(ptr noundef %12) #5
  %13 = getelementptr inbounds i8, ptr %0, i64 64
  %14 = load ptr, ptr %13, align 8, !tbaa !16
  tail call void @TCOD_list_clear(ptr noundef %14) #5
  %15 = icmp eq i32 %1, %3
  %16 = icmp eq i32 %2, %4
  %or.cond = and i1 %15, %16
  br i1 %or.cond, label %.loopexit, label %17

17:                                               ; preds = %7
  %18 = getelementptr inbounds i8, ptr %0, i64 24
  %19 = load i32, ptr %18, align 8, !tbaa !17
  %20 = icmp ugt i32 %19, %1
  br i1 %20, label %21, label %25

21:                                               ; preds = %17
  %22 = getelementptr inbounds i8, ptr %0, i64 28
  %23 = load i32, ptr %22, align 4, !tbaa !18
  %24 = icmp ugt i32 %23, %2
  br i1 %24, label %26, label %25

25:                                               ; preds = %21, %17
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 276, ptr noundef nonnull @__PRETTY_FUNCTION__.TCOD_path_compute) #4
  unreachable

26:                                               ; preds = %21
  %27 = icmp ugt i32 %19, %3
  %28 = icmp ugt i32 %23, %4
  %or.cond64 = and i1 %27, %28
  br i1 %or.cond64, label %30, label %29

29:                                               ; preds = %26
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 277, ptr noundef nonnull @__PRETTY_FUNCTION__.TCOD_path_compute) #4
  unreachable

30:                                               ; preds = %26
  %31 = getelementptr inbounds i8, ptr %0, i64 32
  %32 = load ptr, ptr %31, align 8, !tbaa !19
  %33 = sext i32 %19 to i64
  %34 = shl nsw i64 %33, 2
  %35 = sext i32 %23 to i64
  %36 = mul i64 %34, %35
  tail call void @llvm.memset.p0.i64(ptr align 4 %32, i8 0, i64 %36, i1 false)
  %37 = getelementptr inbounds i8, ptr %0, i64 48
  %38 = load ptr, ptr %37, align 8, !tbaa !20
  %39 = load i32, ptr %18, align 8, !tbaa !17
  %40 = sext i32 %39 to i64
  %41 = load i32, ptr %22, align 4, !tbaa !18
  %42 = sext i32 %41 to i64
  %43 = mul nsw i64 %42, %40
  tail call void @llvm.memset.p0.i64(ptr align 1 %38, i8 4, i64 %43, i1 false)
  %44 = getelementptr inbounds i8, ptr %0, i64 40
  %45 = load ptr, ptr %44, align 8, !tbaa !21
  %46 = load i32, ptr %18, align 8, !tbaa !17
  %47 = mul nsw i32 %46, %2
  %48 = add nsw i32 %47, %1
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds float, ptr %45, i64 %49
  store float 1.000000e+00, ptr %50, align 4, !tbaa !22
  tail call void @TCOD_path_push_cell(ptr noundef nonnull %0, i32 noundef %1, i32 noundef %2)
  tail call void @TCOD_path_set_cells(ptr noundef nonnull %0)
  %51 = load ptr, ptr %31, align 8, !tbaa !19
  %52 = load i32, ptr %18, align 8, !tbaa !17
  %53 = mul nsw i32 %52, %4
  %54 = add nsw i32 %53, %3
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds float, ptr %51, i64 %55
  %57 = load float, ptr %56, align 4, !tbaa !22
  %58 = fcmp oeq float %57, 0.000000e+00
  br i1 %58, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %30, %.preheader
  %.056 = phi i32 [ %71, %.preheader ], [ %3, %30 ]
  %.055 = phi i32 [ %74, %.preheader ], [ %4, %30 ]
  %59 = load ptr, ptr %37, align 8, !tbaa !20
  %60 = load i32, ptr %18, align 8, !tbaa !17
  %61 = mul nsw i32 %60, %.055
  %62 = add nsw i32 %61, %.056
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds i8, ptr %59, i64 %63
  %65 = load i8, ptr %64, align 1, !tbaa !23
  %66 = load ptr, ptr %11, align 8, !tbaa !15
  %67 = zext i8 %65 to i64
  %68 = inttoptr i64 %67 to ptr
  tail call void @TCOD_list_push(ptr noundef %66, ptr noundef %68) #5
  %69 = getelementptr inbounds [9 x i32], ptr @dir_x, i64 0, i64 %67
  %70 = load i32, ptr %69, align 4, !tbaa !24
  %71 = sub nsw i32 %.056, %70
  %72 = getelementptr inbounds [9 x i32], ptr @dir_y, i64 0, i64 %67
  %73 = load i32, ptr %72, align 4, !tbaa !24
  %74 = sub nsw i32 %.055, %73
  %75 = icmp ne i32 %71, %1
  %76 = icmp ne i32 %74, %2
  %77 = select i1 %75, i1 true, i1 %76
  br i1 %77, label %.preheader, label %.loopexit, !llvm.loop !25

.loopexit:                                        ; preds = %.preheader, %30, %7
  %.0 = phi i1 [ true, %7 ], [ false, %30 ], [ true, %.preheader ]
  ret i1 %.0
}

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

; Function Attrs: nounwind uwtable
declare hidden void @TCOD_path_push_cell(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

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

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

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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { noreturn nounwind }
attributes #5 = { 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_Path", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16, !7, i64 24, !7, i64 28, !10, i64 32, !10, i64 40, !10, i64 48, !11, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"float", !8, i64 0}
!12 = !{!6, !7, i64 4}
!13 = !{!6, !7, i64 8}
!14 = !{!6, !7, i64 12}
!15 = !{!6, !10, i64 16}
!16 = !{!6, !10, i64 64}
!17 = !{!6, !7, i64 24}
!18 = !{!6, !7, i64 28}
!19 = !{!6, !10, i64 32}
!20 = !{!6, !10, i64 48}
!21 = !{!6, !10, i64 40}
!22 = !{!11, !11, i64 0}
!23 = !{!8, !8, i64 0}
!24 = !{!7, !7, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


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