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

; 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._FactList = type { ptr, ptr }
%struct._TokenList = type { ptr, ptr }

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

; Function Attrs: nounwind uwtable
define dso_local void @print_FactList(ptr noundef %0, ptr noundef %1, ptr noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = icmp ne ptr %9, null
  br i1 %10, label %11, label %106

11:                                               ; preds = %3
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct._FactList, ptr %12, i32 0, i32 0
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  store ptr %14, ptr %8, align 8, !tbaa !5
  %15 = load ptr, ptr %8, align 8, !tbaa !5
  %16 = icmp eq ptr null, %15
  br i1 %16, label %22, label %17

17:                                               ; preds = %11
  %18 = load ptr, ptr %8, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct._TokenList, ptr %18, i32 0, i32 0
  %20 = load ptr, ptr %19, align 8, !tbaa !11
  %21 = icmp eq ptr null, %20
  br i1 %21, label %22, label %24

22:                                               ; preds = %17, %11
  %23 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  br label %32

24:                                               ; preds = %17
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct._TokenList, ptr %25, i32 0, i32 0
  %27 = load ptr, ptr %26, align 8, !tbaa !11
  %28 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %27)
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct._TokenList, ptr %29, i32 0, i32 1
  %31 = load ptr, ptr %30, align 8, !tbaa !13
  store ptr %31, ptr %8, align 8, !tbaa !5
  br label %32

32:                                               ; preds = %24, %22
  br label %33

33:                                               ; preds = %47, %32
  %34 = load ptr, ptr %8, align 8, !tbaa !5
  %35 = icmp ne ptr null, %34
  br i1 %35, label %36, label %51

36:                                               ; preds = %33
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct._TokenList, ptr %37, i32 0, i32 0
  %39 = load ptr, ptr %38, align 8, !tbaa !11
  %40 = icmp ne ptr null, %39
  br i1 %40, label %41, label %47

41:                                               ; preds = %36
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct._TokenList, ptr %43, i32 0, i32 0
  %45 = load ptr, ptr %44, align 8, !tbaa !11
  %46 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, ptr noundef %42, ptr noundef %45)
  br label %47

47:                                               ; preds = %41, %36
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct._TokenList, ptr %48, i32 0, i32 1
  %50 = load ptr, ptr %49, align 8, !tbaa !13
  store ptr %50, ptr %8, align 8, !tbaa !5
  br label %33, !llvm.loop !14

51:                                               ; preds = %33
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct._FactList, ptr %52, i32 0, i32 1
  %54 = load ptr, ptr %53, align 8, !tbaa !16
  store ptr %54, ptr %7, align 8, !tbaa !5
  br label %55

55:                                               ; preds = %101, %51
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = icmp ne ptr %56, null
  br i1 %57, label %58, label %105

58:                                               ; preds = %55
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %59)
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct._FactList, ptr %61, i32 0, i32 0
  %63 = load ptr, ptr %62, align 8, !tbaa !9
  store ptr %63, ptr %8, align 8, !tbaa !5
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = icmp eq ptr null, %64
  br i1 %65, label %71, label %66

66:                                               ; preds = %58
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._TokenList, ptr %67, i32 0, i32 0
  %69 = load ptr, ptr %68, align 8, !tbaa !11
  %70 = icmp eq ptr null, %69
  br i1 %70, label %71, label %73

71:                                               ; preds = %66, %58
  %72 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  br label %81

73:                                               ; preds = %66
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct._TokenList, ptr %74, i32 0, i32 0
  %76 = load ptr, ptr %75, align 8, !tbaa !11
  %77 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %76)
  %78 = load ptr, ptr %8, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct._TokenList, ptr %78, i32 0, i32 1
  %80 = load ptr, ptr %79, align 8, !tbaa !13
  store ptr %80, ptr %8, align 8, !tbaa !5
  br label %81

81:                                               ; preds = %73, %71
  br label %82

82:                                               ; preds = %96, %81
  %83 = load ptr, ptr %8, align 8, !tbaa !5
  %84 = icmp ne ptr null, %83
  br i1 %84, label %85, label %100

85:                                               ; preds = %82
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct._TokenList, ptr %86, i32 0, i32 0
  %88 = load ptr, ptr %87, align 8, !tbaa !11
  %89 = icmp ne ptr null, %88
  br i1 %89, label %90, label %96

90:                                               ; preds = %85
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = load ptr, ptr %8, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct._TokenList, ptr %92, i32 0, i32 0
  %94 = load ptr, ptr %93, align 8, !tbaa !11
  %95 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, ptr noundef %91, ptr noundef %94)
  br label %96

96:                                               ; preds = %90, %85
  %97 = load ptr, ptr %8, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct._TokenList, ptr %97, i32 0, i32 1
  %99 = load ptr, ptr %98, align 8, !tbaa !13
  store ptr %99, ptr %8, align 8, !tbaa !5
  br label %82, !llvm.loop !17

100:                                              ; preds = %82
  br label %101

101:                                              ; preds = %100
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct._FactList, ptr %102, i32 0, i32 1
  %104 = load ptr, ptr %103, align 8, !tbaa !16
  store ptr %104, ptr %7, align 8, !tbaa !5
  br label %55, !llvm.loop !18

105:                                              ; preds = %55
  br label %106

106:                                              ; preds = %105, %3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  ret void
}

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

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

; 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_FactList", !6, i64 0, !6, i64 8}
!11 = !{!12, !6, i64 0}
!12 = !{!"_TokenList", !6, i64 0, !6, i64 8}
!13 = !{!12, !6, i64 8}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!10, !6, i64 8}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !15}


; 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 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: nofree nounwind uwtable
define dso_local void @print_FactList(ptr noundef readonly %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %.loopexit38, label %4

4:                                                ; preds = %3
  %5 = load ptr, ptr %0, align 8, !tbaa !5
  %6 = icmp eq ptr %5, null
  br i1 %6, label %10, label %7

7:                                                ; preds = %4
  %8 = load ptr, ptr %5, align 8, !tbaa !10
  %9 = icmp eq ptr %8, null
  br i1 %9, label %10, label %12

10:                                               ; preds = %7, %4
  %11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  br label %16

12:                                               ; preds = %7
  %13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %8)
  %14 = getelementptr inbounds i8, ptr %5, i64 8
  %15 = load ptr, ptr %14, align 8, !tbaa !12
  br label %16

16:                                               ; preds = %12, %10
  %.0 = phi ptr [ %5, %10 ], [ %15, %12 ]
  %.not3339 = icmp eq ptr %.0, null
  br i1 %.not3339, label %.preheader, label %.lr.ph

.preheader:                                       ; preds = %20, %16
  %.025.in44 = getelementptr inbounds i8, ptr %0, i64 8
  %.02545 = load ptr, ptr %.025.in44, align 8, !tbaa !13
  %.not3446 = icmp eq ptr %.02545, null
  br i1 %.not3446, label %.loopexit38, label %.lr.ph48

.lr.ph:                                           ; preds = %16, %20
  %.140 = phi ptr [ %22, %20 ], [ %.0, %16 ]
  %17 = load ptr, ptr %.140, align 8, !tbaa !10
  %.not37 = icmp eq ptr %17, null
  br i1 %.not37, label %20, label %18

18:                                               ; preds = %.lr.ph
  %19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef %2, ptr noundef nonnull %17)
  br label %20

20:                                               ; preds = %18, %.lr.ph
  %21 = getelementptr inbounds i8, ptr %.140, i64 8
  %22 = load ptr, ptr %21, align 8, !tbaa !12
  %.not33 = icmp eq ptr %22, null
  br i1 %.not33, label %.preheader, label %.lr.ph, !llvm.loop !14

.loopexit:                                        ; preds = %39, %35
  %.025.in = getelementptr inbounds i8, ptr %.02547, i64 8
  %.025 = load ptr, ptr %.025.in, align 8, !tbaa !13
  %.not34 = icmp eq ptr %.025, null
  br i1 %.not34, label %.loopexit38, label %.lr.ph48, !llvm.loop !16

.lr.ph48:                                         ; preds = %.preheader, %.loopexit
  %.02547 = phi ptr [ %.025, %.loopexit ], [ %.02545, %.preheader ]
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef %1)
  %24 = load ptr, ptr %.02547, align 8, !tbaa !5
  %25 = icmp eq ptr %24, null
  br i1 %25, label %29, label %26

26:                                               ; preds = %.lr.ph48
  %27 = load ptr, ptr %24, align 8, !tbaa !10
  %28 = icmp eq ptr %27, null
  br i1 %28, label %29, label %31

29:                                               ; preds = %26, %.lr.ph48
  %30 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  br label %35

31:                                               ; preds = %26
  %32 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %27)
  %33 = getelementptr inbounds i8, ptr %24, i64 8
  %34 = load ptr, ptr %33, align 8, !tbaa !12
  br label %35

35:                                               ; preds = %31, %29
  %.2 = phi ptr [ %24, %29 ], [ %34, %31 ]
  %.not3541 = icmp eq ptr %.2, null
  br i1 %.not3541, label %.loopexit, label %.lr.ph43

.lr.ph43:                                         ; preds = %35, %39
  %.342 = phi ptr [ %41, %39 ], [ %.2, %35 ]
  %36 = load ptr, ptr %.342, align 8, !tbaa !10
  %.not36 = icmp eq ptr %36, null
  br i1 %.not36, label %39, label %37

37:                                               ; preds = %.lr.ph43
  %38 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef %2, ptr noundef nonnull %36)
  br label %39

39:                                               ; preds = %37, %.lr.ph43
  %40 = getelementptr inbounds i8, ptr %.342, i64 8
  %41 = load ptr, ptr %40, align 8, !tbaa !12
  %.not35 = icmp eq ptr %41, null
  br i1 %.not35, label %.loopexit, label %.lr.ph43, !llvm.loop !17

.loopexit38:                                      ; preds = %.loopexit, %.preheader, %3
  ret void
}

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

attributes #0 = { nofree 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 = { 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" }

!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 = !{!"_FactList", !7, i64 0, !7, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !7, i64 0}
!11 = !{!"_TokenList", !7, i64 0, !7, i64 8}
!12 = !{!11, !7, i64 8}
!13 = !{!6, !7, i64 8}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}


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