; LLVM IR from DevonCrawford/A-Pathfinding-in-C-command-line :: backups (pathfinding_copy2)

; 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.GridSize = type { i32, i32 }
%struct.Node = type { ptr, i32, i32, i32, i32, i32, i32, i32 }

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@size = external dso_local global %struct.GridSize, align 4
@.str.1 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %struct.GridSize, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca %struct.Node, align 8
  %25 = alloca %struct.Node, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %26 = load ptr, ptr %5, align 8, !tbaa !9
  %27 = getelementptr inbounds ptr, ptr %26, i64 1
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  %29 = call noalias ptr @fopen(ptr noundef %28, ptr noundef @.str)
  store ptr %29, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  %30 = load ptr, ptr %6, align 8, !tbaa !9
  %31 = icmp ne ptr %30, null
  br i1 %31, label %32, label %101

32:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %33 = load ptr, ptr %6, align 8, !tbaa !9
  %34 = call i64 @getGridSize(ptr noundef %33)
  store i64 %34, ptr %8, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @size, ptr align 4 %8, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %35 = load i32, ptr getelementptr inbounds (%struct.GridSize, ptr @size, i32 0, i32 1), align 4, !tbaa !12
  %36 = zext i32 %35 to i64
  %37 = load i32, ptr @size, align 4, !tbaa !14
  %38 = zext i32 %37 to i64
  %39 = call ptr @llvm.stacksave.p0()
  store ptr %39, ptr %9, align 8
  %40 = mul nuw i64 %36, %38
  %41 = alloca i8, i64 %40, align 16
  store i64 %36, ptr %10, align 8
  store i64 %38, ptr %11, align 8
  %42 = load i32, ptr getelementptr inbounds (%struct.GridSize, ptr @size, i32 0, i32 1), align 4, !tbaa !12
  %43 = zext i32 %42 to i64
  %44 = load i32, ptr @size, align 4, !tbaa !14
  %45 = zext i32 %44 to i64
  %46 = mul nuw i64 %43, %45
  %47 = alloca i8, i64 %46, align 16
  store i64 %43, ptr %12, align 8
  store i64 %45, ptr %13, align 8
  call void @clearGrid(ptr noundef %41)
  %48 = load ptr, ptr %6, align 8, !tbaa !9
  %49 = call i32 @readFile(ptr noundef %48, ptr noundef %41)
  store i32 %49, ptr %7, align 4, !tbaa !5
  %50 = load i32, ptr %7, align 4, !tbaa !5
  %51 = icmp eq i32 %50, 0
  br i1 %51, label %52, label %99

52:                                               ; preds = %32
  call void @copyGrid(ptr noundef %47, ptr noundef %41)
  call void @printGrid(ptr noundef %41)
  %53 = load i32, ptr getelementptr inbounds (%struct.GridSize, ptr @size, i32 0, i32 1), align 4, !tbaa !12
  %54 = zext i32 %53 to i64
  %55 = load i32, ptr @size, align 4, !tbaa !14
  %56 = zext i32 %55 to i64
  %57 = call ptr @llvm.stacksave.p0()
  store ptr %57, ptr %14, align 8
  %58 = mul nuw i64 %54, %56
  %59 = alloca %struct.Node, i64 %58, align 16
  store i64 %54, ptr %15, align 8
  store i64 %56, ptr %16, align 8
  %60 = load i32, ptr getelementptr inbounds (%struct.GridSize, ptr @size, i32 0, i32 1), align 4, !tbaa !12
  %61 = zext i32 %60 to i64
  %62 = load i32, ptr @size, align 4, !tbaa !14
  %63 = zext i32 %62 to i64
  %64 = mul nuw i64 %61, %63
  %65 = alloca %struct.Node, i64 %64, align 16
  store i64 %61, ptr %17, align 8
  store i64 %63, ptr %18, align 8
  %66 = load i32, ptr getelementptr inbounds (%struct.GridSize, ptr @size, i32 0, i32 1), align 4, !tbaa !12
  %67 = zext i32 %66 to i64
  %68 = load i32, ptr @size, align 4, !tbaa !14
  %69 = zext i32 %68 to i64
  %70 = mul nuw i64 %67, %69
  %71 = alloca %struct.Node, i64 %70, align 16
  store i64 %67, ptr %19, align 8
  store i64 %69, ptr %20, align 8
  call void @initNodes(ptr noundef %59)
  call void @initNodes(ptr noundef %65)
  call void @initNodes(ptr noundef %71)
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store i32 0, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  store i32 0, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  store i32 0, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 40, ptr %24) #5
  call void @getNodeChar(ptr dead_on_unwind writable sret(%struct.Node) align 8 %24, ptr noundef %41, i8 noundef signext 83)
  call void @llvm.lifetime.start.p0(i64 40, ptr %25) #5
  call void @getNodeChar(ptr dead_on_unwind writable sret(%struct.Node) align 8 %25, ptr noundef %41, i8 noundef signext 71)
  %72 = getelementptr inbounds %struct.Node, ptr %24, i32 0, i32 1
  %73 = load i32, ptr %72, align 8, !tbaa !15
  %74 = icmp eq i32 %73, 0
  br i1 %74, label %75, label %77

75:                                               ; preds = %52
  %76 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  br label %77

77:                                               ; preds = %75, %52
  %78 = getelementptr inbounds %struct.Node, ptr %25, i32 0, i32 1
  %79 = load i32, ptr %78, align 8, !tbaa !15
  %80 = icmp eq i32 %79, 0
  br i1 %80, label %81, label %83

81:                                               ; preds = %77
  %82 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  br label %83

83:                                               ; preds = %81, %77
  %84 = getelementptr inbounds %struct.Node, ptr %24, i32 0, i32 1
  %85 = load i32, ptr %84, align 8, !tbaa !15
  %86 = icmp eq i32 %85, 1
  br i1 %86, label %87, label %97

87:                                               ; preds = %83
  %88 = getelementptr inbounds %struct.Node, ptr %25, i32 0, i32 1
  %89 = load i32, ptr %88, align 8, !tbaa !15
  %90 = icmp eq i32 %89, 1
  br i1 %90, label %91, label %97

91:                                               ; preds = %87
  call void @addListNode(ptr noundef %65, ptr noundef %22, ptr noundef byval(%struct.Node) align 8 %24)
  call void @findPath(ptr noundef %41, ptr noundef %59, ptr noundef %65, ptr noundef %71, ptr noundef byval(%struct.Node) align 8 %24, ptr noundef byval(%struct.Node) align 8 %25, ptr noundef byval(%struct.Node) align 8 %24, ptr noundef %21, ptr noundef %22, ptr noundef %23)
  call void @insertPath(ptr noundef %47, ptr noundef %71)
  call void @nodesExistence(ptr noundef %71)
  %92 = load i32, ptr %23, align 4, !tbaa !5
  call void @info2D(ptr noundef %71, i32 noundef %92)
  %93 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  call void @printGrid(ptr noundef %47)
  %94 = load ptr, ptr %5, align 8, !tbaa !9
  %95 = getelementptr inbounds ptr, ptr %94, i64 1
  %96 = load ptr, ptr %95, align 8, !tbaa !9
  call void @writeFile(ptr noundef %47, ptr noundef %96)
  br label %97

97:                                               ; preds = %91, %87, %83
  call void @llvm.lifetime.end.p0(i64 40, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  %98 = load ptr, ptr %14, align 8
  call void @llvm.stackrestore.p0(ptr %98)
  br label %99

99:                                               ; preds = %97, %32
  %100 = load ptr, ptr %9, align 8
  call void @llvm.stackrestore.p0(ptr %100)
  br label %106

101:                                              ; preds = %2
  %102 = load ptr, ptr %5, align 8, !tbaa !9
  %103 = getelementptr inbounds ptr, ptr %102, i64 1
  %104 = load ptr, ptr %103, align 8, !tbaa !9
  %105 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef %104)
  br label %106

106:                                              ; preds = %101, %99
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  ret i32 0
}

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

declare noalias ptr @fopen(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i64 @getGridSize(ptr noundef) #0

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

; Function Attrs: nounwind uwtable
declare dso_local void @clearGrid(ptr noundef) #0

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

; Function Attrs: nounwind uwtable
declare dso_local void @copyGrid(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @printGrid(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @initNodes(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @getNodeChar(ptr dead_on_unwind noalias writable sret(%struct.Node) align 8, ptr noundef, i8 noundef signext) #0

declare i32 @printf(ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
declare dso_local void @addListNode(ptr noundef, ptr noundef, ptr noundef byval(%struct.Node) align 8) #0

; Function Attrs: nounwind uwtable
declare dso_local void @findPath(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef byval(%struct.Node) align 8, ptr noundef byval(%struct.Node) align 8, ptr noundef byval(%struct.Node) align 8, ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @insertPath(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @nodesExistence(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @info2D(ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @writeFile(ptr noundef, ptr noundef) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

attributes #0 = { 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 #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: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind willreturn }
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, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{i64 0, i64 4, !5, i64 4, i64 4, !5}
!12 = !{!13, !6, i64 4}
!13 = !{!"GridSize", !6, i64 0, !6, i64 4}
!14 = !{!13, !6, i64 0}
!15 = !{!16, !6, i64 8}
!16 = !{!"Node", !10, i64 0, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32}


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

%struct.GridSize = type { i32, i32 }
%struct.Node = type { ptr, i32, i32, i32, i32, i32, i32, i32 }

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@size = external dso_local local_unnamed_addr global %struct.GridSize, align 4
@.str.1 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %struct.Node, align 8
  %7 = alloca %struct.Node, align 8
  %8 = getelementptr inbounds i8, ptr %1, i64 8
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = tail call noalias ptr @fopen(ptr noundef %9, ptr noundef nonnull @.str)
  %.not = icmp eq ptr %10, null
  br i1 %.not, label %63, label %11

11:                                               ; preds = %2
  %12 = tail call i64 @getGridSize(ptr noundef nonnull %10)
  store i64 %12, ptr @size, align 4
  %13 = lshr i64 %12, 32
  %14 = and i64 %12, 4294967295
  %15 = tail call ptr @llvm.stacksave.p0()
  %16 = mul nuw i64 %14, %13
  %17 = alloca i8, i64 %16, align 16
  %18 = load i32, ptr getelementptr inbounds (i8, ptr @size, i64 4), align 4, !tbaa !9
  %19 = zext i32 %18 to i64
  %20 = load i32, ptr @size, align 4, !tbaa !12
  %21 = zext i32 %20 to i64
  %22 = mul nuw i64 %21, %19
  %23 = alloca i8, i64 %22, align 16
  call void @clearGrid(ptr noundef nonnull %17)
  %24 = call i32 @readFile(ptr noundef nonnull %10, ptr noundef nonnull %17)
  %25 = icmp eq i32 %24, 0
  br i1 %25, label %26, label %62

26:                                               ; preds = %11
  call void @copyGrid(ptr noundef nonnull %23, ptr noundef nonnull %17)
  call void @printGrid(ptr noundef nonnull %17)
  %27 = load i32, ptr getelementptr inbounds (i8, ptr @size, i64 4), align 4, !tbaa !9
  %28 = zext i32 %27 to i64
  %29 = load i32, ptr @size, align 4, !tbaa !12
  %30 = zext i32 %29 to i64
  %31 = call ptr @llvm.stacksave.p0()
  %32 = mul nuw i64 %30, %28
  %33 = alloca %struct.Node, i64 %32, align 16
  %34 = load i32, ptr getelementptr inbounds (i8, ptr @size, i64 4), align 4, !tbaa !9
  %35 = zext i32 %34 to i64
  %36 = load i32, ptr @size, align 4, !tbaa !12
  %37 = zext i32 %36 to i64
  %38 = mul nuw i64 %37, %35
  %39 = alloca %struct.Node, i64 %38, align 16
  %40 = alloca %struct.Node, i64 %38, align 16
  call void @initNodes(ptr noundef nonnull %33)
  call void @initNodes(ptr noundef nonnull %39)
  call void @initNodes(ptr noundef nonnull %40)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  store i32 0, ptr %3, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  store i32 0, ptr %4, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 0, ptr %5, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #4
  call void @getNodeChar(ptr dead_on_unwind nonnull writable sret(%struct.Node) align 8 %6, ptr noundef nonnull %17, i8 noundef signext 83)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %7) #4
  call void @getNodeChar(ptr dead_on_unwind nonnull writable sret(%struct.Node) align 8 %7, ptr noundef nonnull %17, i8 noundef signext 71)
  %41 = getelementptr inbounds i8, ptr %6, i64 8
  %42 = load i32, ptr %41, align 8, !tbaa !14
  %43 = icmp eq i32 %42, 0
  br i1 %43, label %44, label %46

44:                                               ; preds = %26
  %45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %46

46:                                               ; preds = %44, %26
  %47 = getelementptr inbounds i8, ptr %7, i64 8
  %48 = load i32, ptr %47, align 8
  %49 = icmp eq i32 %48, 0
  br i1 %49, label %50, label %52

50:                                               ; preds = %46
  %51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %.pre = load i32, ptr %47, align 8
  br label %52

52:                                               ; preds = %50, %46
  %53 = phi i32 [ %.pre, %50 ], [ %48, %46 ]
  %54 = load i32, ptr %41, align 8, !tbaa !14
  %55 = icmp eq i32 %54, 1
  %56 = icmp eq i32 %53, 1
  %or.cond = select i1 %55, i1 %56, i1 false
  br i1 %or.cond, label %57, label %61

57:                                               ; preds = %52
  call void @addListNode(ptr noundef nonnull %39, ptr noundef nonnull %4, ptr noundef nonnull byval(%struct.Node) align 8 %6)
  call void @findPath(ptr noundef nonnull %17, ptr noundef nonnull %33, ptr noundef nonnull %39, ptr noundef nonnull %40, ptr noundef nonnull byval(%struct.Node) align 8 %6, ptr noundef nonnull byval(%struct.Node) align 8 %7, ptr noundef nonnull byval(%struct.Node) align 8 %6, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5)
  call void @insertPath(ptr noundef nonnull %23, ptr noundef nonnull %40)
  call void @nodesExistence(ptr noundef nonnull %40)
  %58 = load i32, ptr %5, align 4, !tbaa !13
  call void @info2D(ptr noundef nonnull %40, i32 noundef %58)
  %59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  call void @printGrid(ptr noundef nonnull %23)
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  call void @writeFile(ptr noundef nonnull %23, ptr noundef %60)
  br label %61

61:                                               ; preds = %57, %52
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.stackrestore.p0(ptr %31)
  br label %62

62:                                               ; preds = %61, %11
  call void @llvm.stackrestore.p0(ptr %15)
  br label %66

63:                                               ; preds = %2
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef %64)
  br label %66

66:                                               ; preds = %63, %62
  ret i32 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: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i64 @getGridSize(ptr noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @copyGrid(ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @getNodeChar(ptr dead_on_unwind noalias writable sret(%struct.Node) align 8, ptr noundef, i8 noundef signext) local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @addListNode(ptr noundef, ptr noundef, ptr noundef byval(%struct.Node) align 8) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @findPath(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef byval(%struct.Node) align 8, ptr noundef byval(%struct.Node) align 8, ptr noundef byval(%struct.Node) align 8, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @insertPath(ptr noundef, ptr noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare dso_local void @info2D(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @writeFile(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
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/C++ TBAA"}
!9 = !{!10, !11, i64 4}
!10 = !{!"GridSize", !11, i64 0, !11, i64 4}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!15, !11, i64 8}
!15 = !{!"Node", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass