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

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

@gef_conn = external global ptr, align 8
@lnum_F = external dso_local global i32, align 4
@lF = external dso_local global ptr, align 8
@lnum_0P_E = external dso_local global i32, align 4
@l0P_E = external dso_local global ptr, align 8
@gnum_fl_conn = external global i32, align 4

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

; Function Attrs: nounwind uwtable
declare dso_local void @reset_fixpoint(i32 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 @get_A(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #2
  %4 = load ptr, ptr %2, align 8, !tbaa !5
  call void @initialize_fixpoint(ptr noundef %4)
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %5

5:                                                ; preds = %15, %1
  %6 = load i32, ptr %3, align 4, !tbaa !9
  %7 = load i32, ptr @lnum_F, align 4, !tbaa !9
  %8 = icmp slt i32 %6, %7
  br i1 %8, label %9, label %18

9:                                                ; preds = %5
  %10 = load ptr, ptr @lF, align 8, !tbaa !5
  %11 = load i32, ptr %3, align 4, !tbaa !9
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds i32, ptr %10, i64 %12
  %14 = load i32, ptr %13, align 4, !tbaa !9
  call void @activate_ft(i32 noundef %14, i32 noundef 0)
  br label %15

15:                                               ; preds = %9
  %16 = load i32, ptr %3, align 4, !tbaa !9
  %17 = add nsw i32 %16, 1
  store i32 %17, ptr %3, align 4, !tbaa !9
  br label %5, !llvm.loop !11

18:                                               ; preds = %5
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %19

19:                                               ; preds = %42, %18
  %20 = load i32, ptr %3, align 4, !tbaa !9
  %21 = load i32, ptr @lnum_0P_E, align 4, !tbaa !9
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %23, label %45

23:                                               ; preds = %19
  %24 = load ptr, ptr @gef_conn, align 8, !tbaa !5
  %25 = load ptr, ptr @l0P_E, align 8, !tbaa !5
  %26 = load i32, ptr %3, align 4, !tbaa !9
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds i32, ptr %25, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !9
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds %struct._EfConn, ptr %24, i64 %30
  %32 = getelementptr inbounds %struct._EfConn, ptr %31, i32 0, i32 28
  %33 = load i8, ptr %32, align 4, !tbaa !13
  %34 = icmp ne i8 %33, 0
  br i1 %34, label %35, label %36

35:                                               ; preds = %23
  br label %42

36:                                               ; preds = %23
  %37 = load ptr, ptr @l0P_E, align 8, !tbaa !5
  %38 = load i32, ptr %3, align 4, !tbaa !9
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds i32, ptr %37, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !9
  call void @new_ef(i32 noundef %41)
  br label %42

42:                                               ; preds = %36, %35
  %43 = load i32, ptr %3, align 4, !tbaa !9
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %3, align 4, !tbaa !9
  br label %19, !llvm.loop !16

45:                                               ; preds = %19
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %46

46:                                               ; preds = %52, %45
  %47 = load i32, ptr %3, align 4, !tbaa !9
  %48 = load i32, ptr @gnum_fl_conn, align 4, !tbaa !9
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %50, label %55

50:                                               ; preds = %46
  %51 = load i32, ptr %3, align 4, !tbaa !9
  call void @activate_fl(i32 noundef %51, i32 noundef 0)
  br label %52

52:                                               ; preds = %50
  %53 = load i32, ptr %3, align 4, !tbaa !9
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %3, align 4, !tbaa !9
  br label %46, !llvm.loop !17

55:                                               ; preds = %46
  call void @collect_A_info()
  call void @reset_fixpoint(i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #2
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @initialize_fixpoint(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @activate_ft(i32 noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @new_ef(i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @activate_fl(i32 noundef, i32 noundef) #1

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !7, i64 196}
!14 = !{!"_EfConn", !10, i64 0, !7, i64 4, !7, i64 5, !15, i64 8, !6, i64 16, !10, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !10, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !6, i64 96, !10, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !10, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !10, i64 168, !6, i64 176, !10, i64 184, !10, i64 188, !15, i64 192, !7, i64 196, !10, i64 200, !7, i64 204, !10, i64 208, !10, i64 212}
!15 = !{!"float", !7, i64 0}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


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

@gef_conn = external local_unnamed_addr global ptr, align 8
@lnum_F = external dso_local local_unnamed_addr global i32, align 4
@lF = external dso_local local_unnamed_addr global ptr, align 8
@lnum_0P_E = external dso_local local_unnamed_addr global i32, align 4
@l0P_E = external dso_local local_unnamed_addr global ptr, align 8
@gnum_fl_conn = external local_unnamed_addr global i32, align 4

; Function Attrs: nounwind uwtable
declare dso_local void @reset_fixpoint(i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @get_A(ptr noundef %0) local_unnamed_addr #0 {
  tail call void @initialize_fixpoint(ptr noundef %0)
  %2 = load i32, ptr @lnum_F, align 4, !tbaa !5
  %3 = icmp sgt i32 %2, 0
  br i1 %3, label %.lr.ph, label %.preheader10

.preheader10:                                     ; preds = %.lr.ph, %1
  %4 = load i32, ptr @lnum_0P_E, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph13.preheader, label %.preheader

.lr.ph13.preheader:                               ; preds = %.preheader10
  %.pre20 = load ptr, ptr @gef_conn, align 8, !tbaa !9
  %.pre22 = load ptr, ptr @l0P_E, align 8, !tbaa !9
  br label %.lr.ph13

.lr.ph:                                           ; preds = %1, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %1 ]
  %6 = load ptr, ptr @lF, align 8, !tbaa !9
  %7 = getelementptr inbounds i32, ptr %6, i64 %indvars.iv
  %8 = load i32, ptr %7, align 4, !tbaa !5
  tail call void @activate_ft(i32 noundef %8, i32 noundef 0)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %9 = load i32, ptr @lnum_F, align 4, !tbaa !5
  %10 = sext i32 %9 to i64
  %11 = icmp slt i64 %indvars.iv.next, %10
  br i1 %11, label %.lr.ph, label %.preheader10, !llvm.loop !11

.preheader:                                       ; preds = %23, %.preheader10
  %12 = load i32, ptr @gnum_fl_conn, align 4, !tbaa !5
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph15, label %._crit_edge

.lr.ph13:                                         ; preds = %.lr.ph13.preheader, %23
  %14 = phi i32 [ %4, %.lr.ph13.preheader ], [ %24, %23 ]
  %15 = phi ptr [ %.pre22, %.lr.ph13.preheader ], [ %25, %23 ]
  %16 = phi ptr [ %.pre20, %.lr.ph13.preheader ], [ %26, %23 ]
  %indvars.iv17 = phi i64 [ 0, %.lr.ph13.preheader ], [ %indvars.iv.next18, %23 ]
  %17 = getelementptr inbounds i32, ptr %15, i64 %indvars.iv17
  %18 = load i32, ptr %17, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds %struct._EfConn, ptr %16, i64 %19, i32 28
  %21 = load i8, ptr %20, align 4, !tbaa !13
  %.not = icmp eq i8 %21, 0
  br i1 %.not, label %22, label %23

22:                                               ; preds = %.lr.ph13
  tail call void @new_ef(i32 noundef %18)
  %.pre = load ptr, ptr @gef_conn, align 8, !tbaa !9
  %.pre21 = load ptr, ptr @l0P_E, align 8, !tbaa !9
  %.pre23 = load i32, ptr @lnum_0P_E, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %.lr.ph13, %22
  %24 = phi i32 [ %14, %.lr.ph13 ], [ %.pre23, %22 ]
  %25 = phi ptr [ %15, %.lr.ph13 ], [ %.pre21, %22 ]
  %26 = phi ptr [ %16, %.lr.ph13 ], [ %.pre, %22 ]
  %indvars.iv.next18 = add nuw nsw i64 %indvars.iv17, 1
  %27 = sext i32 %24 to i64
  %28 = icmp slt i64 %indvars.iv.next18, %27
  br i1 %28, label %.lr.ph13, label %.preheader, !llvm.loop !16

.lr.ph15:                                         ; preds = %.preheader, %.lr.ph15
  %.214 = phi i32 [ %29, %.lr.ph15 ], [ 0, %.preheader ]
  tail call void @activate_fl(i32 noundef %.214, i32 noundef 0)
  %29 = add nuw nsw i32 %.214, 1
  %30 = load i32, ptr @gnum_fl_conn, align 4, !tbaa !5
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %.lr.ph15, label %._crit_edge, !llvm.loop !17

._crit_edge:                                      ; preds = %.lr.ph15, %.preheader
  tail call void @collect_A_info()
  tail call void @reset_fixpoint(i32 noundef 1)
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @initialize_fixpoint(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @activate_ft(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @new_ef(i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @activate_fl(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @collect_A_info() local_unnamed_addr #0

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 = !{!"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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !7, i64 196}
!14 = !{!"_EfConn", !6, i64 0, !7, i64 4, !7, i64 5, !15, i64 8, !10, i64 16, !6, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !6, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !6, i64 88, !10, i64 96, !6, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !6, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !6, i64 168, !10, i64 176, !6, i64 184, !6, i64 188, !15, i64 192, !7, i64 196, !6, i64 200, !7, i64 204, !6, i64 208, !6, i64 212}
!15 = !{!"float", !7, i64 0}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


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