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

@.str.51 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.115 = external hidden unnamed_addr constant [13 x i8], align 1
@grelevant_fluents_lnf = external global [1000 x ptr], align 16
@.str.116 = external hidden unnamed_addr constant [11 x i8], align 1
@grelevant_fluents_name = external global [1000 x ptr], align 16
@.str.117 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.118 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.119 = external hidden unnamed_addr constant [4 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 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
define dso_local void @print_fl_name(i32 noundef %0) #2 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  %5 = load i32, ptr %2, align 4, !tbaa !5
  %6 = icmp slt i32 %5, 0
  br i1 %6, label %7, label %15

7:                                                ; preds = %1
  %8 = load i32, ptr %2, align 4, !tbaa !5
  %9 = icmp ne i32 %8, -2
  br i1 %9, label %10, label %12

10:                                               ; preds = %7
  %11 = call i32 (ptr, ...) @printf(ptr noundef @.str.51)
  br label %14

12:                                               ; preds = %7
  %13 = call i32 (ptr, ...) @printf(ptr noundef @.str.115)
  br label %14

14:                                               ; preds = %12, %10
  store i32 1, ptr %4, align 4
  br label %78

15:                                               ; preds = %1
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [1000 x ptr], ptr @grelevant_fluents_lnf, i64 0, i64 %17
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  %20 = icmp eq ptr %19, null
  br i1 %20, label %21, label %28

21:                                               ; preds = %15
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [1000 x ptr], ptr @grelevant_fluents_name, i64 0, i64 %24
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  %27 = call i32 (ptr, ...) @printf(ptr noundef @.str.116, i32 noundef %22, ptr noundef %26)
  br label %77

28:                                               ; preds = %15
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = call i32 (ptr, ...) @printf(ptr noundef @.str.117, i32 noundef %29)
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %73, %28
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [1000 x ptr], ptr @grelevant_fluents_lnf, i64 0, i64 %34
  %36 = load ptr, ptr %35, align 8, !tbaa !9
  %37 = getelementptr inbounds %struct._LnfExpNode, ptr %36, i32 0, i32 2
  %38 = load i32, ptr %37, align 4, !tbaa !11
  %39 = icmp slt i32 %32, %38
  br i1 %39, label %40, label %76

40:                                               ; preds = %31
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [1000 x ptr], ptr @grelevant_fluents_lnf, i64 0, i64 %42
  %44 = load ptr, ptr %43, align 8, !tbaa !9
  %45 = getelementptr inbounds %struct._LnfExpNode, ptr %44, i32 0, i32 1
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [25 x float], ptr %45, i64 0, i64 %47
  %49 = load float, ptr %48, align 4, !tbaa !14
  %50 = fpext float %49 to double
  %51 = call i32 (ptr, ...) @printf(ptr noundef @.str.118, double noundef %50)
  %52 = load i32, ptr %2, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [1000 x ptr], ptr @grelevant_fluents_lnf, i64 0, i64 %53
  %55 = load ptr, ptr %54, align 8, !tbaa !9
  %56 = getelementptr inbounds %struct._LnfExpNode, ptr %55, i32 0, i32 0
  %57 = load i32, ptr %3, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [25 x i32], ptr %56, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  call void @print_fl_name(i32 noundef %60)
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [1000 x ptr], ptr @grelevant_fluents_lnf, i64 0, i64 %63
  %65 = load ptr, ptr %64, align 8, !tbaa !9
  %66 = getelementptr inbounds %struct._LnfExpNode, ptr %65, i32 0, i32 2
  %67 = load i32, ptr %66, align 4, !tbaa !11
  %68 = sub nsw i32 %67, 1
  %69 = icmp slt i32 %61, %68
  br i1 %69, label %70, label %72

70:                                               ; preds = %40
  %71 = call i32 (ptr, ...) @printf(ptr noundef @.str.119)
  br label %72

72:                                               ; preds = %70, %40
  br label %73

73:                                               ; preds = %72
  %74 = load i32, ptr %3, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %3, align 4, !tbaa !5
  br label %31, !llvm.loop !15

76:                                               ; preds = %31
  br label %77

77:                                               ; preds = %76, %21
  store i32 0, ptr %4, align 4
  br label %78

78:                                               ; preds = %77, %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  %79 = load i32, ptr %4, align 4
  switch i32 %79, label %81 [
    i32 0, label %80
    i32 1, label %80
  ]

80:                                               ; preds = %78, %78
  ret void

81:                                               ; preds = %78
  unreachable
}

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 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 200}
!12 = !{!"_LnfExpNode", !7, i64 0, !7, i64 100, !6, i64 200, !7, i64 204, !7, i64 304, !6, i64 404, !13, i64 408}
!13 = !{!"float", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"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"

@.str.51 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.115 = external hidden unnamed_addr constant [13 x i8], align 1
@grelevant_fluents_lnf = external local_unnamed_addr global [1000 x ptr], align 16
@.str.116 = external hidden unnamed_addr constant [11 x i8], align 1
@grelevant_fluents_name = external local_unnamed_addr global [1000 x ptr], align 16
@.str.117 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.118 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.119 = external hidden unnamed_addr constant [4 x i8], align 1

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

; Function Attrs: nofree nounwind uwtable
define dso_local void @print_fl_name(i32 noundef %0) local_unnamed_addr #1 {
  %2 = icmp slt i32 %0, 0
  br i1 %2, label %3, label %8

3:                                                ; preds = %1
  %.not = icmp eq i32 %0, -2
  br i1 %.not, label %6, label %4

4:                                                ; preds = %3
  %5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.51)
  br label %.loopexit

6:                                                ; preds = %3
  %7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.115)
  br label %.loopexit

8:                                                ; preds = %1
  %9 = zext nneg i32 %0 to i64
  %10 = getelementptr inbounds [1000 x ptr], ptr @grelevant_fluents_lnf, i64 0, i64 %9
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  %12 = icmp eq ptr %11, null
  br i1 %12, label %13, label %17

13:                                               ; preds = %8
  %14 = getelementptr inbounds [1000 x ptr], ptr @grelevant_fluents_name, i64 0, i64 %9
  %15 = load ptr, ptr %14, align 8, !tbaa !5
  %16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.116, i32 noundef %0, ptr noundef %15)
  br label %.loopexit

17:                                               ; preds = %8
  %18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.117, i32 noundef %0)
  %19 = load ptr, ptr %10, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %19, i64 200
  %21 = load i32, ptr %20, align 4, !tbaa !9
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %17, %40
  %indvars.iv = phi i64 [ %indvars.iv.next, %40 ], [ 0, %17 ]
  %23 = phi ptr [ %42, %40 ], [ %19, %17 ]
  %24 = getelementptr inbounds i8, ptr %23, i64 100
  %25 = getelementptr inbounds [25 x float], ptr %24, i64 0, i64 %indvars.iv
  %26 = load float, ptr %25, align 4, !tbaa !13
  %27 = fpext float %26 to double
  %28 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.118, double noundef %27)
  %29 = load ptr, ptr %10, align 8, !tbaa !5
  %30 = getelementptr inbounds [25 x i32], ptr %29, i64 0, i64 %indvars.iv
  %31 = load i32, ptr %30, align 4, !tbaa !14
  tail call void @print_fl_name(i32 noundef %31)
  %32 = load ptr, ptr %10, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %32, i64 200
  %34 = load i32, ptr %33, align 4, !tbaa !9
  %35 = add nsw i32 %34, -1
  %36 = sext i32 %35 to i64
  %37 = icmp slt i64 %indvars.iv, %36
  br i1 %37, label %38, label %40

38:                                               ; preds = %.lr.ph
  %39 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.119)
  %.pre = load ptr, ptr %10, align 8, !tbaa !5
  %.phi.trans.insert = getelementptr inbounds i8, ptr %.pre, i64 200
  %.pre18 = load i32, ptr %.phi.trans.insert, align 4, !tbaa !9
  br label %40

40:                                               ; preds = %.lr.ph, %38
  %41 = phi i32 [ %34, %.lr.ph ], [ %.pre18, %38 ]
  %42 = phi ptr [ %32, %.lr.ph ], [ %.pre, %38 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %43 = sext i32 %41 to i64
  %44 = icmp slt i64 %indvars.iv.next, %43
  br i1 %44, label %.lr.ph, label %.loopexit, !llvm.loop !15

.loopexit:                                        ; preds = %40, %17, %13, %4, %6
  ret void
}

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

!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 200}
!10 = !{!"_LnfExpNode", !7, i64 0, !7, i64 100, !11, i64 200, !7, i64 204, !7, i64 304, !11, i64 404, !12, i64 408}
!11 = !{!"int", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!12, !12, i64 0}
!14 = !{!11, !11, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


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