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

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

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca [6 x %struct.Node], align 16
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %struct.Node, align 8
  %6 = alloca %struct.Node, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 240, ptr %2) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  store i32 0, ptr %3, align 4, !tbaa !5
  %7 = getelementptr inbounds [6 x %struct.Node], ptr %2, i64 0, i64 0
  call void @initNodes(ptr noundef %7)
  %8 = getelementptr inbounds [6 x %struct.Node], ptr %2, i64 0, i64 0
  %9 = getelementptr inbounds %struct.Node, ptr %8, i32 0, i32 6
  store i32 31, ptr %9, align 4, !tbaa !9
  %10 = getelementptr inbounds [6 x %struct.Node], ptr %2, i64 0, i64 1
  %11 = getelementptr inbounds %struct.Node, ptr %10, i32 0, i32 6
  store i32 8, ptr %11, align 4, !tbaa !9
  %12 = getelementptr inbounds [6 x %struct.Node], ptr %2, i64 0, i64 2
  %13 = getelementptr inbounds %struct.Node, ptr %12, i32 0, i32 6
  store i32 1, ptr %13, align 4, !tbaa !9
  %14 = getelementptr inbounds [6 x %struct.Node], ptr %2, i64 0, i64 3
  %15 = getelementptr inbounds %struct.Node, ptr %14, i32 0, i32 6
  store i32 32, ptr %15, align 4, !tbaa !9
  %16 = getelementptr inbounds [6 x %struct.Node], ptr %2, i64 0, i64 4
  %17 = getelementptr inbounds %struct.Node, ptr %16, i32 0, i32 6
  store i32 16, ptr %17, align 4, !tbaa !9
  %18 = getelementptr inbounds [6 x %struct.Node], ptr %2, i64 0, i64 5
  %19 = getelementptr inbounds %struct.Node, ptr %18, i32 0, i32 6
  store i32 2, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %28, %0
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = icmp slt i32 %21, 6
  br i1 %22, label %23, label %31

23:                                               ; preds = %20
  %24 = getelementptr inbounds [6 x %struct.Node], ptr %2, i64 0, i64 0
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [6 x %struct.Node], ptr %2, i64 0, i64 %26
  call void @addListNode(ptr noundef %24, ptr noundef %3, ptr noundef byval(%struct.Node) align 8 %27)
  br label %28

28:                                               ; preds = %23
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = add nsw i32 %29, 1
  store i32 %30, ptr %4, align 4, !tbaa !5
  br label %20, !llvm.loop !12

31:                                               ; preds = %20
  %32 = getelementptr inbounds [6 x %struct.Node], ptr %2, i64 0, i64 1
  %33 = getelementptr inbounds [6 x %struct.Node], ptr %2, i64 0, i64 0
  call void @setParent(ptr noundef %32, ptr noundef byval(%struct.Node) align 8 %33)
  %34 = getelementptr inbounds [6 x %struct.Node], ptr %2, i64 0, i64 2
  %35 = getelementptr inbounds [6 x %struct.Node], ptr %2, i64 0, i64 1
  call void @setParent(ptr noundef %34, ptr noundef byval(%struct.Node) align 8 %35)
  %36 = getelementptr inbounds [6 x %struct.Node], ptr %2, i64 0, i64 3
  %37 = getelementptr inbounds [6 x %struct.Node], ptr %2, i64 0, i64 2
  call void @setParent(ptr noundef %36, ptr noundef byval(%struct.Node) align 8 %37)
  %38 = getelementptr inbounds [6 x %struct.Node], ptr %2, i64 0, i64 4
  %39 = getelementptr inbounds [6 x %struct.Node], ptr %2, i64 0, i64 3
  call void @setParent(ptr noundef %38, ptr noundef byval(%struct.Node) align 8 %39)
  %40 = getelementptr inbounds [6 x %struct.Node], ptr %2, i64 0, i64 5
  %41 = getelementptr inbounds [6 x %struct.Node], ptr %2, i64 0, i64 4
  call void @setParent(ptr noundef %40, ptr noundef byval(%struct.Node) align 8 %41)
  %42 = getelementptr inbounds [6 x %struct.Node], ptr %2, i64 0, i64 0
  call void @nodesInfo(ptr noundef %42)
  call void @llvm.lifetime.start.p0(i64 40, ptr %5) #3
  %43 = getelementptr inbounds [6 x %struct.Node], ptr %2, i64 0, i64 0
  call void @getNode(ptr dead_on_unwind writable sret(%struct.Node) align 8 %5, ptr noundef %43, i32 noundef 2)
  %44 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  call void @info(ptr noundef byval(%struct.Node) align 8 %5)
  %45 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  call void @llvm.lifetime.start.p0(i64 40, ptr %6) #3
  %46 = getelementptr inbounds [6 x %struct.Node], ptr %2, i64 0, i64 0
  call void @lowestF(ptr dead_on_unwind writable sret(%struct.Node) align 8 %6, ptr noundef %46, i32 noundef 6)
  %47 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  call void @info(ptr noundef byval(%struct.Node) align 8 %6)
  %48 = getelementptr inbounds [6 x %struct.Node], ptr %2, i64 0, i64 0
  call void @removeListNode(ptr noundef %48, ptr noundef %3, ptr noundef byval(%struct.Node) align 8 %6)
  %49 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  %50 = getelementptr inbounds [6 x %struct.Node], ptr %2, i64 0, i64 0
  call void @nodesInfo(ptr noundef %50)
  call void @llvm.lifetime.end.p0(i64 40, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 240, ptr %2) #3
  ret i32 0
}

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

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

; 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 @setParent(ptr noundef, ptr noundef byval(%struct.Node) align 8) #0

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

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

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

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

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

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

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

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 = { 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, !6, i64 28}
!10 = !{!"Node", !11, i64 0, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32}
!11 = !{!"any pointer", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"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"

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

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca [6 x %struct.Node], align 16
  %2 = alloca i32, align 4
  %3 = alloca %struct.Node, align 8
  %4 = alloca %struct.Node, align 8
  call void @llvm.lifetime.start.p0(i64 240, ptr nonnull %1) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #3
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @initNodes(ptr noundef nonnull %1)
  %5 = getelementptr inbounds i8, ptr %1, i64 28
  store i32 31, ptr %5, align 4, !tbaa !9
  %6 = getelementptr inbounds i8, ptr %1, i64 68
  store i32 8, ptr %6, align 4, !tbaa !9
  %7 = getelementptr inbounds i8, ptr %1, i64 108
  store i32 1, ptr %7, align 4, !tbaa !9
  %8 = getelementptr inbounds i8, ptr %1, i64 148
  store i32 32, ptr %8, align 4, !tbaa !9
  %9 = getelementptr inbounds i8, ptr %1, i64 188
  store i32 16, ptr %9, align 4, !tbaa !9
  %10 = getelementptr inbounds i8, ptr %1, i64 228
  store i32 2, ptr %10, align 4, !tbaa !9
  call void @addListNode(ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull byval(%struct.Node) align 8 %1)
  %11 = getelementptr inbounds i8, ptr %1, i64 40
  call void @addListNode(ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull byval(%struct.Node) align 8 %11)
  %12 = getelementptr inbounds i8, ptr %1, i64 80
  call void @addListNode(ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull byval(%struct.Node) align 8 %12)
  %13 = getelementptr inbounds i8, ptr %1, i64 120
  call void @addListNode(ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull byval(%struct.Node) align 8 %13)
  %14 = getelementptr inbounds i8, ptr %1, i64 160
  call void @addListNode(ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull byval(%struct.Node) align 8 %14)
  %15 = getelementptr inbounds i8, ptr %1, i64 200
  call void @addListNode(ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull byval(%struct.Node) align 8 %15)
  call void @setParent(ptr noundef nonnull %11, ptr noundef nonnull byval(%struct.Node) align 8 %1)
  call void @setParent(ptr noundef nonnull %12, ptr noundef nonnull byval(%struct.Node) align 8 %11)
  call void @setParent(ptr noundef nonnull %13, ptr noundef nonnull byval(%struct.Node) align 8 %12)
  call void @setParent(ptr noundef nonnull %14, ptr noundef nonnull byval(%struct.Node) align 8 %13)
  call void @setParent(ptr noundef nonnull %15, ptr noundef nonnull byval(%struct.Node) align 8 %14)
  call void @nodesInfo(ptr noundef nonnull %1)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %3) #3
  call void @getNode(ptr dead_on_unwind nonnull writable sret(%struct.Node) align 8 %3, ptr noundef nonnull %1, i32 noundef 2)
  %16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  call void @info(ptr noundef nonnull byval(%struct.Node) align 8 %3)
  %17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #3
  call void @lowestF(ptr dead_on_unwind nonnull writable sret(%struct.Node) align 8 %4, ptr noundef nonnull %1, i32 noundef 6)
  %18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  call void @info(ptr noundef nonnull byval(%struct.Node) align 8 %4)
  call void @removeListNode(ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull byval(%struct.Node) align 8 %4)
  %19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  call void @nodesInfo(ptr noundef nonnull %1)
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #3
  call void @llvm.lifetime.end.p0(i64 240, ptr nonnull %1) #3
  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: nounwind uwtable
declare dso_local void @initNodes(ptr noundef) local_unnamed_addr #0

; 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 @setParent(ptr noundef, ptr noundef byval(%struct.Node) align 8) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare dso_local void @getNode(ptr dead_on_unwind noalias writable sret(%struct.Node) align 8, ptr noundef, i32 noundef) 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 @info(ptr noundef byval(%struct.Node) align 8) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare dso_local void @removeListNode(ptr noundef, ptr noundef, ptr noundef byval(%struct.Node) align 8) 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

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 = { 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, !6, i64 28}
!10 = !{!"Node", !11, i64 0, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32}
!11 = !{!"any pointer", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass