; LLVM IR from askforalfred/alfred :: gen/ff_planner (search)

; 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._State = type { ptr, i32, ptr, ptr }
%struct._command_line = type { [256 x i8], [256 x i8], [256 x i8], i32, i32, i32, i8, i32, float }
%struct._BfsNode = type { %struct._State, i32, i32, i32, float, float, float, ptr, i32, ptr, ptr, ptr }

@gnum_ft_conn = external global i32, align 4
@gnum_fl_conn = external global i32, align 4
@ginitial_state = external global %struct._State, align 8
@gcmd_line = external global %struct._command_line, align 4
@stdout = external global ptr, align 8
@lbfs_space_head = external dso_local global ptr, align 8
@lbfs_space_had = external dso_local global ptr, align 8
@lbfs_hash_entry = external dso_local global [65536 x ptr], align 16
@.str.9 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [33 x i8], align 1

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

declare void @make_state(ptr noundef, i32 noundef, i32 noundef) #1

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

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @result_to_dest(ptr noundef, ptr noundef, i32 noundef) #2

declare i32 @fflush(ptr noundef) #1

declare zeroext i8 @LESS(i32 noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @do_best_first_search() #2 {
  %1 = alloca ptr, align 8
  %2 = alloca %struct._State, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i8, align 1
  %6 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr %2) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 -1, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #3
  store i8 1, ptr %5, align 1, !tbaa !9
  %7 = load i32, ptr @gnum_ft_conn, align 4, !tbaa !5
  %8 = load i32, ptr @gnum_fl_conn, align 4, !tbaa !5
  call void @make_state(ptr noundef %2, i32 noundef %7, i32 noundef %8)
  %9 = call ptr @new_BfsNode()
  store ptr %9, ptr @lbfs_space_head, align 8, !tbaa !10
  store ptr null, ptr @lbfs_space_had, align 8, !tbaa !10
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %10

10:                                               ; preds = %17, %0
  %11 = load i32, ptr %3, align 4, !tbaa !5
  %12 = icmp slt i32 %11, 65536
  br i1 %12, label %13, label %20

13:                                               ; preds = %10
  %14 = load i32, ptr %3, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [65536 x ptr], ptr @lbfs_hash_entry, i64 0, i64 %15
  store ptr null, ptr %16, align 8, !tbaa !10
  br label %17

17:                                               ; preds = %13
  %18 = load i32, ptr %3, align 4, !tbaa !5
  %19 = add nsw i32 %18, 1
  store i32 %19, ptr %3, align 4, !tbaa !5
  br label %10, !llvm.loop !12

20:                                               ; preds = %10
  call void @add_to_bfs_space(ptr noundef @ginitial_state, i32 noundef -1, ptr noundef null)
  br label %21

21:                                               ; preds = %122, %20
  br label %22

22:                                               ; preds = %21
  %23 = load ptr, ptr @lbfs_space_head, align 8, !tbaa !10
  %24 = getelementptr inbounds %struct._BfsNode, ptr %23, i32 0, i32 10
  %25 = load ptr, ptr %24, align 8, !tbaa !14
  %26 = icmp eq ptr %25, null
  br i1 %26, label %27, label %33

27:                                               ; preds = %22
  %28 = load i32, ptr getelementptr inbounds (%struct._command_line, ptr @gcmd_line, i32 0, i32 3), align 4, !tbaa !18
  %29 = icmp ne i32 %28, 0
  br i1 %29, label %30, label %32

30:                                               ; preds = %27
  %31 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  br label %32

32:                                               ; preds = %30, %27
  store i32 1, ptr %6, align 4
  br label %130

33:                                               ; preds = %22
  %34 = load ptr, ptr @lbfs_space_head, align 8, !tbaa !10
  %35 = getelementptr inbounds %struct._BfsNode, ptr %34, i32 0, i32 10
  %36 = load ptr, ptr %35, align 8, !tbaa !14
  store ptr %36, ptr %1, align 8, !tbaa !10
  %37 = load ptr, ptr %1, align 8, !tbaa !10
  %38 = getelementptr inbounds %struct._BfsNode, ptr %37, i32 0, i32 10
  %39 = load ptr, ptr %38, align 8, !tbaa !14
  %40 = load ptr, ptr @lbfs_space_head, align 8, !tbaa !10
  %41 = getelementptr inbounds %struct._BfsNode, ptr %40, i32 0, i32 10
  store ptr %39, ptr %41, align 8, !tbaa !14
  %42 = load ptr, ptr %1, align 8, !tbaa !10
  %43 = getelementptr inbounds %struct._BfsNode, ptr %42, i32 0, i32 10
  %44 = load ptr, ptr %43, align 8, !tbaa !14
  %45 = icmp ne ptr %44, null
  br i1 %45, label %46, label %52

46:                                               ; preds = %33
  %47 = load ptr, ptr @lbfs_space_head, align 8, !tbaa !10
  %48 = load ptr, ptr %1, align 8, !tbaa !10
  %49 = getelementptr inbounds %struct._BfsNode, ptr %48, i32 0, i32 10
  %50 = load ptr, ptr %49, align 8, !tbaa !14
  %51 = getelementptr inbounds %struct._BfsNode, ptr %50, i32 0, i32 11
  store ptr %47, ptr %51, align 8, !tbaa !20
  br label %52

52:                                               ; preds = %46, %33
  %53 = load ptr, ptr %1, align 8, !tbaa !10
  %54 = getelementptr inbounds %struct._BfsNode, ptr %53, i32 0, i32 3
  %55 = load i32, ptr %54, align 8, !tbaa !21
  %56 = load i32, ptr %4, align 4, !tbaa !5
  %57 = call zeroext i8 @LESS(i32 noundef %55, i32 noundef %56)
  %58 = icmp ne i8 %57, 0
  br i1 %58, label %59, label %84

59:                                               ; preds = %52
  %60 = load ptr, ptr %1, align 8, !tbaa !10
  %61 = getelementptr inbounds %struct._BfsNode, ptr %60, i32 0, i32 3
  %62 = load i32, ptr %61, align 8, !tbaa !21
  store i32 %62, ptr %4, align 4, !tbaa !5
  %63 = load i8, ptr %5, align 1, !tbaa !9
  %64 = icmp ne i8 %63, 0
  br i1 %64, label %65, label %74

65:                                               ; preds = %59
  %66 = load i32, ptr getelementptr inbounds (%struct._command_line, ptr @gcmd_line, i32 0, i32 3), align 4, !tbaa !18
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %68, label %73

68:                                               ; preds = %65
  %69 = load i32, ptr %4, align 4, !tbaa !5
  %70 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, i32 noundef %69)
  %71 = load ptr, ptr @stdout, align 8, !tbaa !10
  %72 = call i32 @fflush(ptr noundef %71)
  br label %73

73:                                               ; preds = %68, %65
  store i8 0, ptr %5, align 1, !tbaa !9
  br label %83

74:                                               ; preds = %59
  %75 = load i32, ptr getelementptr inbounds (%struct._command_line, ptr @gcmd_line, i32 0, i32 3), align 4, !tbaa !18
  %76 = icmp ne i32 %75, 0
  br i1 %76, label %77, label %82

77:                                               ; preds = %74
  %78 = load i32, ptr %4, align 4, !tbaa !5
  %79 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, i32 noundef %78)
  %80 = load ptr, ptr @stdout, align 8, !tbaa !10
  %81 = call i32 @fflush(ptr noundef %80)
  br label %82

82:                                               ; preds = %77, %74
  br label %83

83:                                               ; preds = %82, %73
  br label %84

84:                                               ; preds = %83, %52
  %85 = load ptr, ptr %1, align 8, !tbaa !10
  %86 = getelementptr inbounds %struct._BfsNode, ptr %85, i32 0, i32 3
  %87 = load i32, ptr %86, align 8, !tbaa !21
  %88 = icmp eq i32 %87, 0
  br i1 %88, label %89, label %90

89:                                               ; preds = %84
  br label %127

90:                                               ; preds = %84
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %119, %90
  %92 = load i32, ptr %3, align 4, !tbaa !5
  %93 = load ptr, ptr %1, align 8, !tbaa !10
  %94 = getelementptr inbounds %struct._BfsNode, ptr %93, i32 0, i32 8
  %95 = load i32, ptr %94, align 8, !tbaa !22
  %96 = icmp slt i32 %92, %95
  br i1 %96, label %97, label %122

97:                                               ; preds = %91
  %98 = load ptr, ptr %1, align 8, !tbaa !10
  %99 = getelementptr inbounds %struct._BfsNode, ptr %98, i32 0, i32 0
  %100 = load ptr, ptr %1, align 8, !tbaa !10
  %101 = getelementptr inbounds %struct._BfsNode, ptr %100, i32 0, i32 7
  %102 = load ptr, ptr %101, align 8, !tbaa !23
  %103 = load i32, ptr %3, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds i32, ptr %102, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = call zeroext i8 @result_to_dest(ptr noundef %2, ptr noundef %99, i32 noundef %106)
  %108 = icmp ne i8 %107, 0
  br i1 %108, label %109, label %118

109:                                              ; preds = %97
  %110 = load ptr, ptr %1, align 8, !tbaa !10
  %111 = getelementptr inbounds %struct._BfsNode, ptr %110, i32 0, i32 7
  %112 = load ptr, ptr %111, align 8, !tbaa !23
  %113 = load i32, ptr %3, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds i32, ptr %112, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = load ptr, ptr %1, align 8, !tbaa !10
  call void @add_to_bfs_space(ptr noundef %2, i32 noundef %116, ptr noundef %117)
  br label %118

118:                                              ; preds = %109, %97
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %3, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %3, align 4, !tbaa !5
  br label %91, !llvm.loop !24

122:                                              ; preds = %91
  %123 = load ptr, ptr @lbfs_space_had, align 8, !tbaa !10
  %124 = load ptr, ptr %1, align 8, !tbaa !10
  %125 = getelementptr inbounds %struct._BfsNode, ptr %124, i32 0, i32 10
  store ptr %123, ptr %125, align 8, !tbaa !14
  %126 = load ptr, ptr %1, align 8, !tbaa !10
  store ptr %126, ptr @lbfs_space_had, align 8, !tbaa !10
  br label %21

127:                                              ; preds = %89
  %128 = load ptr, ptr %1, align 8, !tbaa !10
  %129 = call zeroext i8 @extract_plan(ptr noundef %128)
  store i32 0, ptr %6, align 4
  br label %130

130:                                              ; preds = %127, %32
  call void @llvm.lifetime.end.p0(i64 1, 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 32, ptr %2) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #3
  %131 = load i32, ptr %6, align 4
  switch i32 %131, label %133 [
    i32 0, label %132
    i32 1, label %132
  ]

132:                                              ; preds = %130, %130
  ret void

133:                                              ; preds = %130
  unreachable
}

declare ptr @new_BfsNode() #1

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @extract_plan(ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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" }
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 = { 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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !11, i64 80}
!15 = !{!"_BfsNode", !16, i64 0, !6, i64 32, !6, i64 36, !6, i64 40, !17, i64 44, !17, i64 48, !17, i64 52, !11, i64 56, !6, i64 64, !11, i64 72, !11, i64 80, !11, i64 88}
!16 = !{!"_State", !11, i64 0, !6, i64 8, !11, i64 16, !11, i64 24}
!17 = !{!"float", !7, i64 0}
!18 = !{!19, !6, i64 768}
!19 = !{!"_command_line", !7, i64 0, !7, i64 256, !7, i64 512, !6, i64 768, !6, i64 772, !6, i64 776, !7, i64 780, !6, i64 784, !17, i64 788}
!20 = !{!15, !11, i64 88}
!21 = !{!15, !6, i64 40}
!22 = !{!15, !6, i64 64}
!23 = !{!15, !11, i64 56}
!24 = distinct !{!24, !13}


; 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._State = type { ptr, i32, ptr, ptr }
%struct._command_line = type { [256 x i8], [256 x i8], [256 x i8], i32, i32, i32, i8, i32, float }

@gnum_ft_conn = external local_unnamed_addr global i32, align 4
@gnum_fl_conn = external local_unnamed_addr global i32, align 4
@ginitial_state = external global %struct._State, align 8
@gcmd_line = external local_unnamed_addr global %struct._command_line, align 4
@stdout = external local_unnamed_addr global ptr, align 8
@lbfs_space_head = external dso_local local_unnamed_addr global ptr, align 8
@lbfs_space_had = external dso_local local_unnamed_addr global ptr, align 8
@lbfs_hash_entry = external dso_local local_unnamed_addr global [65536 x ptr], align 16
@.str.9 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [33 x i8], align 1

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

declare void @make_state(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

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

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @result_to_dest(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #2

declare zeroext i8 @LESS(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @do_best_first_search() local_unnamed_addr #3 {
  %1 = alloca %struct._State, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #5
  %2 = load i32, ptr @gnum_ft_conn, align 4, !tbaa !5
  %3 = load i32, ptr @gnum_fl_conn, align 4, !tbaa !5
  call void @make_state(ptr noundef nonnull %1, i32 noundef %2, i32 noundef %3) #5
  %4 = call ptr @new_BfsNode() #5
  store ptr %4, ptr @lbfs_space_head, align 8, !tbaa !9
  store ptr null, ptr @lbfs_space_had, align 8, !tbaa !9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(524288) @lbfs_hash_entry, i8 0, i64 524288, i1 false), !tbaa !9
  call void @add_to_bfs_space(ptr noundef nonnull @ginitial_state, i32 noundef -1, ptr noundef null)
  %5 = load ptr, ptr @lbfs_space_head, align 8, !tbaa !9
  %6 = getelementptr inbounds i8, ptr %5, i64 80
  %7 = load ptr, ptr %6, align 8, !tbaa !11
  %8 = icmp eq ptr %7, null
  br i1 %8, label %._crit_edge43, label %.lr.ph42

._crit_edge43:                                    ; preds = %._crit_edge, %0
  %9 = load i32, ptr getelementptr inbounds (i8, ptr @gcmd_line, i64 768), align 4, !tbaa !15
  %.not35 = icmp eq i32 %9, 0
  br i1 %.not35, label %56, label %10

10:                                               ; preds = %._crit_edge43
  %11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  br label %56

.lr.ph42:                                         ; preds = %0, %._crit_edge
  %12 = phi ptr [ %52, %._crit_edge ], [ %7, %0 ]
  %13 = phi ptr [ %51, %._crit_edge ], [ %6, %0 ]
  %14 = phi ptr [ %50, %._crit_edge ], [ %5, %0 ]
  %.040 = phi i8 [ %.1, %._crit_edge ], [ 1, %0 ]
  %.02439 = phi i32 [ %.125, %._crit_edge ], [ -1, %0 ]
  %15 = getelementptr inbounds i8, ptr %12, i64 80
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  store ptr %16, ptr %13, align 8, !tbaa !11
  %.not = icmp eq ptr %16, null
  br i1 %.not, label %19, label %17

17:                                               ; preds = %.lr.ph42
  %18 = getelementptr inbounds i8, ptr %16, i64 88
  store ptr %14, ptr %18, align 8, !tbaa !17
  br label %19

19:                                               ; preds = %17, %.lr.ph42
  %20 = getelementptr inbounds i8, ptr %12, i64 40
  %21 = load i32, ptr %20, align 8, !tbaa !18
  %22 = call zeroext i8 @LESS(i32 noundef %21, i32 noundef %.02439) #5
  %.not30 = icmp eq i8 %22, 0
  br i1 %.not30, label %thread-pre-split, label %23

23:                                               ; preds = %19
  %24 = load i32, ptr %20, align 8, !tbaa !18
  %25 = load i32, ptr getelementptr inbounds (i8, ptr @gcmd_line, i64 768), align 4, !tbaa !15
  %.not32 = icmp eq i32 %25, 0
  br i1 %.not32, label %29, label %thread-pre-split.sink.split

thread-pre-split.sink.split:                      ; preds = %23
  %.not31 = icmp eq i8 %.040, 0
  %.str.11..str.10 = select i1 %.not31, ptr @.str.11, ptr @.str.10
  %26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.11..str.10, i32 noundef %24)
  %27 = load ptr, ptr @stdout, align 8, !tbaa !9
  %28 = call i32 @fflush(ptr noundef %27)
  br label %thread-pre-split

thread-pre-split:                                 ; preds = %thread-pre-split.sink.split, %19
  %.125.ph = phi i32 [ %.02439, %19 ], [ %24, %thread-pre-split.sink.split ]
  %.1.ph = phi i8 [ %.040, %19 ], [ 0, %thread-pre-split.sink.split ]
  %.pr = load i32, ptr %20, align 8, !tbaa !18
  br label %29

29:                                               ; preds = %23, %thread-pre-split
  %30 = phi i32 [ %.pr, %thread-pre-split ], [ %24, %23 ]
  %.125 = phi i32 [ %.125.ph, %thread-pre-split ], [ %24, %23 ]
  %.1 = phi i8 [ %.1.ph, %thread-pre-split ], [ 0, %23 ]
  %31 = icmp eq i32 %30, 0
  br i1 %31, label %54, label %.preheader

.preheader:                                       ; preds = %29
  %32 = getelementptr inbounds i8, ptr %12, i64 64
  %33 = load i32, ptr %32, align 8, !tbaa !19
  %34 = icmp sgt i32 %33, 0
  br i1 %34, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %35 = getelementptr inbounds i8, ptr %12, i64 56
  br label %36

36:                                               ; preds = %.lr.ph, %45
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %45 ]
  %37 = load ptr, ptr %35, align 8, !tbaa !20
  %38 = getelementptr inbounds i32, ptr %37, i64 %indvars.iv
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = call zeroext i8 @result_to_dest(ptr noundef nonnull %1, ptr noundef nonnull %12, i32 noundef %39)
  %.not34 = icmp eq i8 %40, 0
  br i1 %.not34, label %45, label %41

41:                                               ; preds = %36
  %42 = load ptr, ptr %35, align 8, !tbaa !20
  %43 = getelementptr inbounds i32, ptr %42, i64 %indvars.iv
  %44 = load i32, ptr %43, align 4, !tbaa !5
  call void @add_to_bfs_space(ptr noundef nonnull %1, i32 noundef %44, ptr noundef nonnull %12)
  br label %45

45:                                               ; preds = %36, %41
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %46 = load i32, ptr %32, align 8, !tbaa !19
  %47 = sext i32 %46 to i64
  %48 = icmp slt i64 %indvars.iv.next, %47
  br i1 %48, label %36, label %._crit_edge, !llvm.loop !21

._crit_edge:                                      ; preds = %45, %.preheader
  %49 = load ptr, ptr @lbfs_space_had, align 8, !tbaa !9
  store ptr %49, ptr %15, align 8, !tbaa !11
  store ptr %12, ptr @lbfs_space_had, align 8, !tbaa !9
  %50 = load ptr, ptr @lbfs_space_head, align 8, !tbaa !9
  %51 = getelementptr inbounds i8, ptr %50, i64 80
  %52 = load ptr, ptr %51, align 8, !tbaa !11
  %53 = icmp eq ptr %52, null
  br i1 %53, label %._crit_edge43, label %.lr.ph42

54:                                               ; preds = %29
  %55 = call zeroext i8 @extract_plan(ptr noundef nonnull %12)
  br label %56

56:                                               ; preds = %._crit_edge43, %10, %54
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #5
  ret void
}

declare ptr @new_BfsNode() local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @extract_plan(ptr noundef) local_unnamed_addr #3

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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" }
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 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!12, !10, i64 80}
!12 = !{!"_BfsNode", !13, i64 0, !6, i64 32, !6, i64 36, !6, i64 40, !14, i64 44, !14, i64 48, !14, i64 52, !10, i64 56, !6, i64 64, !10, i64 72, !10, i64 80, !10, i64 88}
!13 = !{!"_State", !10, i64 0, !6, i64 8, !10, i64 16, !10, i64 24}
!14 = !{!"float", !7, i64 0}
!15 = !{!16, !6, i64 768}
!16 = !{!"_command_line", !7, i64 0, !7, i64 256, !7, i64 512, !6, i64 768, !6, i64 772, !6, i64 776, !7, i64 780, !6, i64 784, !14, i64 788}
!17 = !{!12, !10, i64 88}
!18 = !{!12, !6, i64 40}
!19 = !{!12, !6, i64 64}
!20 = !{!12, !10, i64 56}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass