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

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

@gcmd_line = external global %struct._command_line, align 4
@.str.1 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [47 x i8], align 1
@glnf_metric = external global %struct._LnfExpNode, align 4
@goptimization_established = external global i8, align 1
@.str.5 = external hidden unnamed_addr constant [35 x i8], align 1

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i8 @transform_to_LNF() #1 {
  %1 = alloca i8, align 1
  %2 = call zeroext i8 @is_linear_task()
  %3 = icmp ne i8 %2, 0
  br i1 %3, label %5, label %4

4:                                                ; preds = %0
  store i8 0, ptr %1, align 1
  br label %35

5:                                                ; preds = %0
  call void @normalize_expressions()
  %6 = load i32, ptr getelementptr inbounds (%struct._command_line, ptr @gcmd_line, i32 0, i32 3), align 4, !tbaa !5
  %7 = icmp eq i32 %6, 121
  br i1 %7, label %8, label %10

8:                                                ; preds = %5
  %9 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  call void @print_lnf_representation()
  br label %10

10:                                               ; preds = %8, %5
  call void @translate_subtractions()
  %11 = load i32, ptr getelementptr inbounds (%struct._command_line, ptr @gcmd_line, i32 0, i32 3), align 4, !tbaa !5
  %12 = icmp eq i32 %11, 122
  br i1 %12, label %13, label %15

13:                                               ; preds = %10
  %14 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  call void @print_lnf_representation()
  br label %15

15:                                               ; preds = %13, %10
  call void @summarize_effects()
  %16 = load i32, ptr getelementptr inbounds (%struct._command_line, ptr @gcmd_line, i32 0, i32 3), align 4, !tbaa !5
  %17 = icmp eq i32 %16, 123
  br i1 %17, label %18, label %20

18:                                               ; preds = %15
  %19 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  call void @print_lnf_representation()
  br label %20

20:                                               ; preds = %18, %15
  call void @encode_lfns_as_artificial_fluents()
  %21 = call zeroext i8 @setup_effect_costs()
  %22 = icmp ne i8 %21, 0
  br i1 %22, label %23, label %29

23:                                               ; preds = %20
  %24 = load i32, ptr getelementptr inbounds (%struct._command_line, ptr @gcmd_line, i32 0, i32 3), align 4, !tbaa !5
  %25 = icmp sgt i32 %24, 1
  br i1 %25, label %26, label %28

26:                                               ; preds = %23
  %27 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  call void @print_LnfExpNode(ptr noundef @glnf_metric)
  br label %28

28:                                               ; preds = %26, %23
  store i8 1, ptr @goptimization_established, align 1, !tbaa !11
  br label %29

29:                                               ; preds = %28, %20
  %30 = load i32, ptr getelementptr inbounds (%struct._command_line, ptr @gcmd_line, i32 0, i32 3), align 4, !tbaa !5
  %31 = icmp eq i32 %30, 124
  br i1 %31, label %32, label %34

32:                                               ; preds = %29
  %33 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  call void @print_lnf_representation()
  br label %34

34:                                               ; preds = %32, %29
  store i8 1, ptr %1, align 1
  br label %35

35:                                               ; preds = %34, %4
  %36 = load i8, ptr %1, align 1
  ret i8 %36
}

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @is_linear_task() #1

; Function Attrs: nounwind uwtable
declare dso_local void @normalize_expressions() #1

; Function Attrs: nounwind uwtable
declare dso_local void @print_lnf_representation() #1

; Function Attrs: nounwind uwtable
declare dso_local void @translate_subtractions() #1

; Function Attrs: nounwind uwtable
declare dso_local void @summarize_effects() #1

; Function Attrs: nounwind uwtable
declare dso_local void @encode_lfns_as_artificial_fluents() #1

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @setup_effect_costs() #1

declare void @print_LnfExpNode(ptr noundef) #0

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

!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, !9, i64 768}
!6 = !{!"_command_line", !7, i64 0, !7, i64 256, !7, i64 512, !9, i64 768, !9, i64 772, !9, i64 776, !7, i64 780, !9, i64 784, !10, i64 788}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!7, !7, i64 0}


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

@gcmd_line = external local_unnamed_addr global %struct._command_line, align 4
@.str.1 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [47 x i8], align 1
@glnf_metric = external global %struct._LnfExpNode, align 4
@goptimization_established = external local_unnamed_addr global i8, align 1
@.str.5 = external hidden unnamed_addr constant [35 x i8], align 1

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

; Function Attrs: nounwind uwtable
define dso_local zeroext range(i8 0, 2) i8 @transform_to_LNF() local_unnamed_addr #1 {
  %1 = tail call zeroext i8 @is_linear_task()
  %.not = icmp eq i8 %1, 0
  br i1 %.not, label %29, label %2

2:                                                ; preds = %0
  tail call void @normalize_expressions()
  %3 = load i32, ptr getelementptr inbounds (i8, ptr @gcmd_line, i64 768), align 4, !tbaa !5
  %4 = icmp eq i32 %3, 121
  br i1 %4, label %5, label %7

5:                                                ; preds = %2
  %6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  tail call void @print_lnf_representation()
  br label %7

7:                                                ; preds = %5, %2
  tail call void @translate_subtractions()
  %8 = load i32, ptr getelementptr inbounds (i8, ptr @gcmd_line, i64 768), align 4, !tbaa !5
  %9 = icmp eq i32 %8, 122
  br i1 %9, label %10, label %12

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

12:                                               ; preds = %10, %7
  tail call void @summarize_effects()
  %13 = load i32, ptr getelementptr inbounds (i8, ptr @gcmd_line, i64 768), align 4, !tbaa !5
  %14 = icmp eq i32 %13, 123
  br i1 %14, label %15, label %17

15:                                               ; preds = %12
  %16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  tail call void @print_lnf_representation()
  br label %17

17:                                               ; preds = %15, %12
  tail call void @encode_lfns_as_artificial_fluents()
  %18 = tail call zeroext i8 @setup_effect_costs()
  %.not1 = icmp eq i8 %18, 0
  %.pre2 = load i32, ptr getelementptr inbounds (i8, ptr @gcmd_line, i64 768), align 4, !tbaa !5
  br i1 %.not1, label %24, label %19

19:                                               ; preds = %17
  %20 = icmp sgt i32 %.pre2, 1
  br i1 %20, label %21, label %23

21:                                               ; preds = %19
  %22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  tail call void @print_LnfExpNode(ptr noundef nonnull @glnf_metric) #3
  %.pre.pre = load i32, ptr getelementptr inbounds (i8, ptr @gcmd_line, i64 768), align 4, !tbaa !5
  br label %23

23:                                               ; preds = %21, %19
  %.pre = phi i32 [ %.pre.pre, %21 ], [ %.pre2, %19 ]
  store i8 1, ptr @goptimization_established, align 1, !tbaa !11
  br label %24

24:                                               ; preds = %23, %17
  %25 = phi i32 [ %.pre, %23 ], [ %.pre2, %17 ]
  %26 = icmp eq i32 %25, 124
  br i1 %26, label %27, label %29

27:                                               ; preds = %24
  %28 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  tail call void @print_lnf_representation()
  br label %29

29:                                               ; preds = %24, %27, %0
  %.0 = phi i8 [ 0, %0 ], [ 1, %27 ], [ 1, %24 ]
  ret i8 %.0
}

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

; Function Attrs: nounwind uwtable
declare dso_local void @normalize_expressions() local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @print_lnf_representation() local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @translate_subtractions() local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @summarize_effects() local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @encode_lfns_as_artificial_fluents() local_unnamed_addr #1

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

declare void @print_LnfExpNode(ptr noundef) local_unnamed_addr #2

attributes #0 = { 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 #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 = { "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, !9, i64 768}
!6 = !{!"_command_line", !7, i64 0, !7, i64 256, !7, i64 512, !9, i64 768, !9, i64 772, !9, i64 776, !7, i64 780, !9, i64 784, !10, i64 788}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!7, !7, i64 0}


; Effective O3 passes: GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass