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

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

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

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

declare ptr @new_PlNode(i32 noundef) #1

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

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

10:                                               ; preds = %1
  store i8 0, ptr %2, align 1
  store i32 1, ptr %6, align 4
  br label %139

11:                                               ; preds = %1
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = load ptr, ptr %12, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct._PlNode, ptr %13, i32 0, i32 0
  %15 = load i32, ptr %14, align 8, !tbaa !9
  %16 = icmp ne i32 %15, 2006
  br i1 %16, label %17, label %120

17:                                               ; preds = %11
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = load ptr, ptr %18, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct._PlNode, ptr %19, i32 0, i32 0
  %21 = load i32, ptr %20, align 8, !tbaa !9
  %22 = icmp eq i32 %21, 2005
  br i1 %22, label %23, label %53

23:                                               ; preds = %17
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = load ptr, ptr %24, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct._PlNode, ptr %25, i32 0, i32 7
  %27 = load ptr, ptr %26, align 8, !tbaa !12
  %28 = icmp ne ptr %27, null
  br i1 %28, label %29, label %37

29:                                               ; preds = %23
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = load ptr, ptr %30, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct._PlNode, ptr %31, i32 0, i32 7
  %33 = load ptr, ptr %32, align 8, !tbaa !12
  %34 = getelementptr inbounds %struct._PlNode, ptr %33, i32 0, i32 0
  %35 = load i32, ptr %34, align 8, !tbaa !9
  %36 = icmp ne i32 %35, 2002
  br i1 %36, label %37, label %38

37:                                               ; preds = %29, %23
  store i8 0, ptr %2, align 1
  store i32 1, ptr %6, align 4
  br label %139

38:                                               ; preds = %29
  %39 = call ptr @new_PlNode(i32 noundef 2005)
  store ptr %39, ptr %4, align 8, !tbaa !5
  %40 = load ptr, ptr %3, align 8, !tbaa !5
  %41 = load ptr, ptr %40, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct._PlNode, ptr %41, i32 0, i32 7
  %43 = load ptr, ptr %42, align 8, !tbaa !12
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct._PlNode, ptr %44, i32 0, i32 7
  store ptr %43, ptr %45, align 8, !tbaa !12
  %46 = load ptr, ptr %3, align 8, !tbaa !5
  %47 = load ptr, ptr %46, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct._PlNode, ptr %47, i32 0, i32 0
  store i32 2006, ptr %48, align 8, !tbaa !9
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = load ptr, ptr %3, align 8, !tbaa !5
  %51 = load ptr, ptr %50, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct._PlNode, ptr %51, i32 0, i32 7
  store ptr %49, ptr %52, align 8, !tbaa !12
  store i8 1, ptr %2, align 1
  store i32 1, ptr %6, align 4
  br label %139

53:                                               ; preds = %17
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = load ptr, ptr %54, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct._PlNode, ptr %55, i32 0, i32 0
  %57 = load i32, ptr %56, align 8, !tbaa !9
  %58 = icmp eq i32 %57, 2004
  br i1 %58, label %59, label %95

59:                                               ; preds = %53
  %60 = call ptr @new_PlNode(i32 noundef 2004)
  store ptr %60, ptr %4, align 8, !tbaa !5
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = load ptr, ptr %61, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct._PlNode, ptr %62, i32 0, i32 4
  %64 = load i32, ptr %63, align 4, !tbaa !13
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct._PlNode, ptr %65, i32 0, i32 4
  store i32 %64, ptr %66, align 4, !tbaa !13
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %68 = load ptr, ptr %67, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct._PlNode, ptr %68, i32 0, i32 5
  %70 = load ptr, ptr %69, align 8, !tbaa !14
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct._PlNode, ptr %71, i32 0, i32 5
  store ptr %70, ptr %72, align 8, !tbaa !14
  %73 = load ptr, ptr %3, align 8, !tbaa !5
  %74 = load ptr, ptr %73, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct._PlNode, ptr %74, i32 0, i32 6
  %76 = load ptr, ptr %75, align 8, !tbaa !15
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct._PlNode, ptr %77, i32 0, i32 6
  store ptr %76, ptr %78, align 8, !tbaa !15
  %79 = load ptr, ptr %3, align 8, !tbaa !5
  %80 = load ptr, ptr %79, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct._PlNode, ptr %80, i32 0, i32 5
  store ptr null, ptr %81, align 8, !tbaa !14
  %82 = load ptr, ptr %3, align 8, !tbaa !5
  %83 = load ptr, ptr %82, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct._PlNode, ptr %83, i32 0, i32 6
  store ptr null, ptr %84, align 8, !tbaa !15
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = load ptr, ptr %85, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct._PlNode, ptr %86, i32 0, i32 4
  store i32 -1, ptr %87, align 4, !tbaa !13
  %88 = load ptr, ptr %3, align 8, !tbaa !5
  %89 = load ptr, ptr %88, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct._PlNode, ptr %89, i32 0, i32 0
  store i32 2006, ptr %90, align 8, !tbaa !9
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  %92 = load ptr, ptr %3, align 8, !tbaa !5
  %93 = load ptr, ptr %92, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct._PlNode, ptr %93, i32 0, i32 7
  store ptr %91, ptr %94, align 8, !tbaa !12
  store i8 1, ptr %2, align 1
  store i32 1, ptr %6, align 4
  br label %139

95:                                               ; preds = %53
  %96 = load ptr, ptr %3, align 8, !tbaa !5
  %97 = load ptr, ptr %96, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct._PlNode, ptr %97, i32 0, i32 0
  %99 = load i32, ptr %98, align 8, !tbaa !9
  %100 = icmp ne i32 %99, 2002
  br i1 %100, label %101, label %102

101:                                              ; preds = %95
  store i8 0, ptr %2, align 1
  store i32 1, ptr %6, align 4
  br label %139

102:                                              ; preds = %95
  %103 = call ptr @new_PlNode(i32 noundef 2002)
  store ptr %103, ptr %4, align 8, !tbaa !5
  %104 = load ptr, ptr %3, align 8, !tbaa !5
  %105 = load ptr, ptr %104, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct._PlNode, ptr %105, i32 0, i32 2
  %107 = load ptr, ptr %106, align 8, !tbaa !16
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct._PlNode, ptr %108, i32 0, i32 2
  store ptr %107, ptr %109, align 8, !tbaa !16
  %110 = load ptr, ptr %3, align 8, !tbaa !5
  %111 = load ptr, ptr %110, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct._PlNode, ptr %111, i32 0, i32 2
  store ptr null, ptr %112, align 8, !tbaa !16
  %113 = load ptr, ptr %3, align 8, !tbaa !5
  %114 = load ptr, ptr %113, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct._PlNode, ptr %114, i32 0, i32 0
  store i32 2006, ptr %115, align 8, !tbaa !9
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = load ptr, ptr %3, align 8, !tbaa !5
  %118 = load ptr, ptr %117, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct._PlNode, ptr %118, i32 0, i32 7
  store ptr %116, ptr %119, align 8, !tbaa !12
  store i8 1, ptr %2, align 1
  store i32 1, ptr %6, align 4
  br label %139

120:                                              ; preds = %11
  %121 = load ptr, ptr %3, align 8, !tbaa !5
  %122 = load ptr, ptr %121, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct._PlNode, ptr %122, i32 0, i32 7
  %124 = load ptr, ptr %123, align 8, !tbaa !12
  store ptr %124, ptr %5, align 8, !tbaa !5
  br label %125

125:                                              ; preds = %134, %120
  %126 = load ptr, ptr %5, align 8, !tbaa !5
  %127 = icmp ne ptr %126, null
  br i1 %127, label %128, label %138

128:                                              ; preds = %125
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = call zeroext i8 @is_eff_literal(ptr noundef %129)
  %131 = icmp ne i8 %130, 0
  br i1 %131, label %133, label %132

132:                                              ; preds = %128
  store i8 0, ptr %2, align 1
  store i32 1, ptr %6, align 4
  br label %139

133:                                              ; preds = %128
  br label %134

134:                                              ; preds = %133
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct._PlNode, ptr %135, i32 0, i32 8
  %137 = load ptr, ptr %136, align 8, !tbaa !17
  store ptr %137, ptr %5, align 8, !tbaa !5
  br label %125, !llvm.loop !18

138:                                              ; preds = %125
  store i8 1, ptr %2, align 1
  store i32 1, ptr %6, align 4
  br label %139

139:                                              ; preds = %138, %132, %102, %101, %59, %38, %37, %10
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  %140 = load i8, ptr %2, align 1
  ret i8 %140
}

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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_PlNode", !11, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !11, i64 28, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 48}
!13 = !{!10, !11, i64 28}
!14 = !{!10, !6, i64 32}
!15 = !{!10, !6, i64 40}
!16 = !{!10, !6, i64 16}
!17 = !{!10, !6, i64 56}
!18 = distinct !{!18, !19}
!19 = !{!"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"

declare ptr @new_PlNode(i32 noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local zeroext range(i8 0, 2) i8 @make_conjunction_of_literals(ptr nocapture noundef readonly %0) local_unnamed_addr #1 {
  %2 = load ptr, ptr %0, align 8, !tbaa !5
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %.loopexit, label %3

3:                                                ; preds = %1
  %4 = load i32, ptr %2, align 8, !tbaa !9
  switch i32 %4, label %.loopexit [
    i32 2006, label %45
    i32 2005, label %5
    i32 2004, label %17
    i32 2002, label %36
  ]

5:                                                ; preds = %3
  %6 = getelementptr inbounds i8, ptr %2, i64 48
  %7 = load ptr, ptr %6, align 8, !tbaa !12
  %.not42 = icmp eq ptr %7, null
  br i1 %.not42, label %.loopexit, label %8

8:                                                ; preds = %5
  %9 = load i32, ptr %7, align 8, !tbaa !9
  %.not43 = icmp eq i32 %9, 2002
  br i1 %.not43, label %10, label %.loopexit

10:                                               ; preds = %8
  %11 = tail call ptr @new_PlNode(i32 noundef 2005) #2
  %12 = load ptr, ptr %0, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %12, i64 48
  %14 = load ptr, ptr %13, align 8, !tbaa !12
  %15 = getelementptr inbounds i8, ptr %11, i64 48
  store ptr %14, ptr %15, align 8, !tbaa !12
  %16 = load ptr, ptr %0, align 8, !tbaa !5
  br label %.loopexit.sink.split

17:                                               ; preds = %3
  %18 = tail call ptr @new_PlNode(i32 noundef 2004) #2
  %19 = load ptr, ptr %0, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %19, i64 28
  %21 = load i32, ptr %20, align 4, !tbaa !13
  %22 = getelementptr inbounds i8, ptr %18, i64 28
  store i32 %21, ptr %22, align 4, !tbaa !13
  %23 = getelementptr inbounds i8, ptr %19, i64 32
  %24 = load ptr, ptr %23, align 8, !tbaa !14
  %25 = getelementptr inbounds i8, ptr %18, i64 32
  store ptr %24, ptr %25, align 8, !tbaa !14
  %26 = load ptr, ptr %0, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %26, i64 40
  %28 = load ptr, ptr %27, align 8, !tbaa !15
  %29 = getelementptr inbounds i8, ptr %18, i64 40
  store ptr %28, ptr %29, align 8, !tbaa !15
  %30 = load ptr, ptr %0, align 8, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %30, i64 32
  store ptr null, ptr %31, align 8, !tbaa !14
  %32 = load ptr, ptr %0, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %32, i64 40
  store ptr null, ptr %33, align 8, !tbaa !15
  %34 = load ptr, ptr %0, align 8, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %34, i64 28
  store i32 -1, ptr %35, align 4, !tbaa !13
  br label %.loopexit.sink.split

36:                                               ; preds = %3
  %37 = tail call ptr @new_PlNode(i32 noundef 2002) #2
  %38 = load ptr, ptr %0, align 8, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %38, i64 16
  %40 = load ptr, ptr %39, align 8, !tbaa !16
  %41 = getelementptr inbounds i8, ptr %37, i64 16
  store ptr %40, ptr %41, align 8, !tbaa !16
  %42 = load ptr, ptr %0, align 8, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %42, i64 16
  store ptr null, ptr %43, align 8, !tbaa !16
  %44 = load ptr, ptr %0, align 8, !tbaa !5
  br label %.loopexit.sink.split

45:                                               ; preds = %3
  %46 = getelementptr inbounds i8, ptr %2, i64 48
  %.044 = load ptr, ptr %46, align 8, !tbaa !5
  %.not3945 = icmp eq ptr %.044, null
  br i1 %.not3945, label %.loopexit, label %.lr.ph

47:                                               ; preds = %.lr.ph
  %48 = getelementptr inbounds i8, ptr %.046, i64 56
  %.0 = load ptr, ptr %48, align 8, !tbaa !5
  %.not39 = icmp eq ptr %.0, null
  br i1 %.not39, label %.loopexit, label %.lr.ph, !llvm.loop !17

.lr.ph:                                           ; preds = %45, %47
  %.046 = phi ptr [ %.0, %47 ], [ %.044, %45 ]
  %49 = tail call zeroext i8 @is_eff_literal(ptr noundef nonnull %.046)
  %.not40 = icmp eq i8 %49, 0
  br i1 %.not40, label %.loopexit, label %47

.loopexit.sink.split:                             ; preds = %10, %17, %36
  %.sink51 = phi ptr [ %44, %36 ], [ %34, %17 ], [ %16, %10 ]
  %.sink = phi ptr [ %37, %36 ], [ %18, %17 ], [ %11, %10 ]
  store i32 2006, ptr %.sink51, align 8, !tbaa !9
  %50 = getelementptr inbounds i8, ptr %.sink51, i64 48
  store ptr %.sink, ptr %50, align 8, !tbaa !12
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph, %47, %.loopexit.sink.split, %45, %3, %5, %8, %1
  %.034 = phi i8 [ 0, %1 ], [ 0, %8 ], [ 0, %5 ], [ 0, %3 ], [ 1, %45 ], [ 1, %.loopexit.sink.split ], [ 0, %.lr.ph ], [ 1, %47 ]
  ret i8 %.034
}

attributes #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 = { 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 = { 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 0}
!10 = !{!"_PlNode", !11, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !11, i64 28, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 48}
!13 = !{!10, !11, i64 28}
!14 = !{!10, !6, i64 32}
!15 = !{!10, !6, i64 40}
!16 = !{!10, !6, i64 16}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


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