; 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: nounwind uwtable
define dso_local zeroext i8 @is_eff_literal(ptr noundef %0) #0 {
  %2 = alloca i8, align 1
  %3 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = icmp ne ptr %4, null
  br i1 %5, label %7, label %6

6:                                                ; preds = %1
  store i8 0, ptr %2, align 1
  br label %68

7:                                                ; preds = %1
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct._PlNode, ptr %8, i32 0, i32 0
  %10 = load i32, ptr %9, align 8, !tbaa !9
  %11 = icmp eq i32 %10, 2005
  br i1 %11, label %12, label %33

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

17:                                               ; preds = %12
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct._PlNode, ptr %18, i32 0, i32 7
  %20 = load ptr, ptr %19, align 8, !tbaa !12
  %21 = getelementptr inbounds %struct._PlNode, ptr %20, i32 0, i32 0
  %22 = load i32, ptr %21, align 8, !tbaa !9
  %23 = icmp ne i32 %22, 2002
  br i1 %23, label %31, label %24

24:                                               ; preds = %17
  %25 = load ptr, ptr %3, 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 = getelementptr inbounds %struct._PlNode, ptr %27, i32 0, i32 2
  %29 = load ptr, ptr %28, align 8, !tbaa !13
  %30 = icmp ne ptr %29, null
  br i1 %30, label %32, label %31

31:                                               ; preds = %24, %17, %12
  store i8 0, ptr %2, align 1
  br label %68

32:                                               ; preds = %24
  store i8 1, ptr %2, align 1
  br label %68

33:                                               ; preds = %7
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct._PlNode, ptr %34, i32 0, i32 0
  %36 = load i32, ptr %35, align 8, !tbaa !9
  %37 = icmp eq i32 %36, 2002
  br i1 %37, label %38, label %45

38:                                               ; preds = %33
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct._PlNode, ptr %39, i32 0, i32 2
  %41 = load ptr, ptr %40, align 8, !tbaa !13
  %42 = icmp ne ptr %41, null
  br i1 %42, label %44, label %43

43:                                               ; preds = %38
  store i8 0, ptr %2, align 1
  br label %68

44:                                               ; preds = %38
  store i8 1, ptr %2, align 1
  br label %68

45:                                               ; preds = %33
  %46 = load ptr, ptr %3, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct._PlNode, ptr %46, i32 0, i32 0
  %48 = load i32, ptr %47, align 8, !tbaa !9
  %49 = icmp eq i32 %48, 2004
  br i1 %49, label %50, label %67

50:                                               ; preds = %45
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct._PlNode, ptr %51, i32 0, i32 5
  %53 = load ptr, ptr %52, align 8, !tbaa !14
  %54 = icmp ne ptr %53, null
  br i1 %54, label %55, label %65

55:                                               ; preds = %50
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct._PlNode, ptr %56, i32 0, i32 6
  %58 = load ptr, ptr %57, align 8, !tbaa !15
  %59 = icmp ne ptr %58, null
  br i1 %59, label %60, label %65

60:                                               ; preds = %55
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct._PlNode, ptr %61, i32 0, i32 4
  %63 = load i32, ptr %62, align 4, !tbaa !16
  %64 = icmp ult i32 %63, 0
  br i1 %64, label %65, label %66

65:                                               ; preds = %60, %55, %50
  store i8 0, ptr %2, align 1
  br label %68

66:                                               ; preds = %60
  store i8 1, ptr %2, align 1
  br label %68

67:                                               ; preds = %45
  store i8 0, ptr %2, align 1
  br label %68

68:                                               ; preds = %67, %66, %65, %44, %43, %32, %31, %6
  %69 = load i8, ptr %2, align 1
  ret i8 %69
}

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

!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, !6, i64 16}
!14 = !{!10, !6, i64 32}
!15 = !{!10, !6, i64 40}
!16 = !{!10, !11, i64 28}


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

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local zeroext range(i8 0, 2) i8 @is_eff_literal(ptr noundef readonly %0) local_unnamed_addr #0 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %20, label %2

2:                                                ; preds = %1
  %3 = load i32, ptr %0, align 8, !tbaa !5
  switch i32 %3, label %20 [
    i32 2005, label %4
    i32 2002, label %11
    i32 2004, label %13
  ]

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %0, i64 48
  %6 = load ptr, ptr %5, align 8, !tbaa !11
  %.not17 = icmp eq ptr %6, null
  br i1 %.not17, label %20, label %7

7:                                                ; preds = %4
  %8 = load i32, ptr %6, align 8, !tbaa !5
  %.not18 = icmp eq i32 %8, 2002
  br i1 %.not18, label %9, label %20

9:                                                ; preds = %7
  %10 = getelementptr inbounds i8, ptr %6, i64 16
  br label %.sink.split

11:                                               ; preds = %2
  %12 = getelementptr inbounds i8, ptr %0, i64 16
  br label %.sink.split

13:                                               ; preds = %2
  %14 = getelementptr inbounds i8, ptr %0, i64 32
  %15 = load ptr, ptr %14, align 8, !tbaa !12
  %.not14 = icmp eq ptr %15, null
  br i1 %.not14, label %20, label %16

16:                                               ; preds = %13
  %17 = getelementptr inbounds i8, ptr %0, i64 40
  br label %.sink.split

.sink.split:                                      ; preds = %11, %9, %16
  %.sink21 = phi ptr [ %17, %16 ], [ %10, %9 ], [ %12, %11 ]
  %18 = load ptr, ptr %.sink21, align 8, !tbaa !13
  %.not15 = icmp ne ptr %18, null
  %19 = zext i1 %.not15 to i8
  br label %20

20:                                               ; preds = %.sink.split, %2, %13, %4, %7, %1
  %.0.shrunk = phi i8 [ 0, %1 ], [ 0, %7 ], [ 0, %4 ], [ 0, %13 ], [ 0, %2 ], [ %19, %.sink.split ]
  ret i8 %.0.shrunk
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) 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" }

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass