; 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._OpConn = type { ptr, i8, ptr, i32, i8, i8, i32, i8, float }
%struct._Action = type { ptr, ptr, i8, ptr, i32, [15 x i32], [15 x i32], ptr, i32, ptr, ptr, ptr, i32, ptr, ptr, ptr, i32, ptr, i32, ptr }

@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@gconstants = external global [2000 x ptr], align 16
@.str.96 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.100 = external hidden unnamed_addr constant [11 x i8], align 1
@gop_conn = external global ptr, align 8

; 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_op_name(i32 noundef %0) #2 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  %5 = load ptr, ptr @gop_conn, align 8, !tbaa !9
  %6 = load i32, ptr %2, align 4, !tbaa !5
  %7 = sext i32 %6 to i64
  %8 = getelementptr inbounds %struct._OpConn, ptr %5, i64 %7
  %9 = getelementptr inbounds %struct._OpConn, ptr %8, i32 0, i32 0
  %10 = load ptr, ptr %9, align 8, !tbaa !11
  store ptr %10, ptr %4, align 8, !tbaa !9
  %11 = load ptr, ptr %4, align 8, !tbaa !9
  %12 = getelementptr inbounds %struct._Action, ptr %11, i32 0, i32 0
  %13 = load ptr, ptr %12, align 8, !tbaa !14
  %14 = icmp ne ptr %13, null
  br i1 %14, label %22, label %15

15:                                               ; preds = %1
  %16 = load ptr, ptr %4, align 8, !tbaa !9
  %17 = getelementptr inbounds %struct._Action, ptr %16, i32 0, i32 1
  %18 = load ptr, ptr %17, align 8, !tbaa !16
  %19 = icmp ne ptr %18, null
  br i1 %19, label %22, label %20

20:                                               ; preds = %15
  %21 = call i32 (ptr, ...) @printf(ptr noundef @.str.100)
  br label %48

22:                                               ; preds = %15, %1
  %23 = load ptr, ptr %4, align 8, !tbaa !9
  %24 = getelementptr inbounds %struct._Action, ptr %23, i32 0, i32 3
  %25 = load ptr, ptr %24, align 8, !tbaa !17
  %26 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %25)
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %44, %22
  %28 = load i32, ptr %3, align 4, !tbaa !5
  %29 = load ptr, ptr %4, align 8, !tbaa !9
  %30 = getelementptr inbounds %struct._Action, ptr %29, i32 0, i32 4
  %31 = load i32, ptr %30, align 8, !tbaa !18
  %32 = icmp slt i32 %28, %31
  br i1 %32, label %33, label %47

33:                                               ; preds = %27
  %34 = load ptr, ptr %4, align 8, !tbaa !9
  %35 = getelementptr inbounds %struct._Action, ptr %34, i32 0, i32 5
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [15 x i32], ptr %35, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [2000 x ptr], ptr @gconstants, i64 0, i64 %40
  %42 = load ptr, ptr %41, align 8, !tbaa !9
  %43 = call i32 (ptr, ...) @printf(ptr noundef @.str.96, ptr noundef %42)
  br label %44

44:                                               ; preds = %33
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %3, align 4, !tbaa !5
  br label %27, !llvm.loop !19

47:                                               ; preds = %27
  br label %48

48:                                               ; preds = %47, %20
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  ret void
}

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, !10, i64 0}
!12 = !{!"_OpConn", !10, i64 0, !7, i64 8, !10, i64 16, !6, i64 24, !7, i64 28, !7, i64 29, !6, i64 32, !7, i64 36, !13, i64 40}
!13 = !{!"float", !7, i64 0}
!14 = !{!15, !10, i64 0}
!15 = !{!"_Action", !10, i64 0, !10, i64 8, !7, i64 16, !10, i64 24, !6, i64 32, !7, i64 36, !7, i64 96, !10, i64 160, !6, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !6, i64 200, !10, i64 208, !10, i64 216, !10, i64 224, !6, i64 232, !10, i64 240, !6, i64 248, !10, i64 256}
!16 = !{!15, !10, i64 8}
!17 = !{!15, !10, i64 24}
!18 = !{!15, !6, i64 32}
!19 = distinct !{!19, !20}
!20 = !{!"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"

%struct._OpConn = type { ptr, i8, ptr, i32, i8, i8, i32, i8, float }

@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@gconstants = external local_unnamed_addr global [2000 x ptr], align 16
@.str.96 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.100 = external hidden unnamed_addr constant [11 x i8], align 1
@gop_conn = external local_unnamed_addr global ptr, align 8

; 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_op_name(i32 noundef %0) local_unnamed_addr #1 {
  %2 = load ptr, ptr @gop_conn, align 8, !tbaa !5
  %3 = sext i32 %0 to i64
  %4 = getelementptr inbounds %struct._OpConn, ptr %2, i64 %3
  %5 = load ptr, ptr %4, align 8, !tbaa !9
  %6 = load ptr, ptr %5, align 8, !tbaa !13
  %.not = icmp eq ptr %6, null
  br i1 %.not, label %7, label %12

7:                                                ; preds = %1
  %8 = getelementptr inbounds i8, ptr %5, i64 8
  %9 = load ptr, ptr %8, align 8, !tbaa !15
  %.not8 = icmp eq ptr %9, null
  br i1 %.not8, label %10, label %12

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

12:                                               ; preds = %7, %1
  %13 = getelementptr inbounds i8, ptr %5, i64 24
  %14 = load ptr, ptr %13, align 8, !tbaa !16
  %15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef %14)
  %16 = getelementptr inbounds i8, ptr %5, i64 32
  %17 = load i32, ptr %16, align 8, !tbaa !17
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %12
  %19 = getelementptr inbounds i8, ptr %5, i64 36
  br label %20

20:                                               ; preds = %.lr.ph, %20
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %20 ]
  %21 = getelementptr inbounds [15 x i32], ptr %19, i64 0, i64 %indvars.iv
  %22 = load i32, ptr %21, align 4, !tbaa !18
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [2000 x ptr], ptr @gconstants, i64 0, i64 %23
  %25 = load ptr, ptr %24, align 8, !tbaa !5
  %26 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.96, ptr noundef %25)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %27 = load i32, ptr %16, align 8, !tbaa !17
  %28 = sext i32 %27 to i64
  %29 = icmp slt i64 %indvars.iv.next, %28
  br i1 %29, label %20, label %.loopexit, !llvm.loop !19

.loopexit:                                        ; preds = %20, %12, %10
  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, !6, i64 0}
!10 = !{!"_OpConn", !6, i64 0, !7, i64 8, !6, i64 16, !11, i64 24, !7, i64 28, !7, i64 29, !11, i64 32, !7, i64 36, !12, i64 40}
!11 = !{!"int", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"_Action", !6, i64 0, !6, i64 8, !7, i64 16, !6, i64 24, !11, i64 32, !7, i64 36, !7, i64 96, !6, i64 160, !11, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !11, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !11, i64 232, !6, i64 240, !11, i64 248, !6, i64 256}
!15 = !{!14, !6, i64 8}
!16 = !{!14, !6, i64 24}
!17 = !{!14, !11, i64 32}
!18 = !{!11, !11, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}


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