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

; 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._BfsNode = type { %struct._State, i32, i32, i32, float, float, float, ptr, i32, ptr, ptr, ptr }
%struct._State = type { ptr, i32, ptr, ptr }
%struct._OpConn = type { ptr, i8, ptr, i32, i8, i8, i32, i8, float }

@gcmd_line = external global %struct._command_line, align 4
@gop_conn = external global ptr, align 8
@gnum_plan_ops = external global i32, align 4
@.str.5 = external hidden unnamed_addr constant [42 x i8], align 1
@gplan_ops = external global [500 x i32], align 16
@extract_plan.fc = external hidden global i8, align 1
@extract_plan.ops = external hidden global ptr, align 8
@.str.20 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [7 x i8], align 1
@goptimization_established = external global i8, align 1
@.str.24 = external hidden unnamed_addr constant [15 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

declare void @print_op_name(i32 noundef) #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local zeroext i8 @extract_plan(ptr noundef %0) #3 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca float, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %7 = load i8, ptr @extract_plan.fc, align 1, !tbaa !9
  %8 = icmp ne i8 %7, 0
  br i1 %8, label %9, label %11

9:                                                ; preds = %1
  %10 = call noalias ptr @calloc(i64 noundef 500, i64 noundef 4) #6
  store ptr %10, ptr @extract_plan.ops, align 8, !tbaa !5
  store i8 0, ptr @extract_plan.fc, align 1, !tbaa !9
  br label %11

11:                                               ; preds = %9, %1
  store i32 0, ptr %5, align 4, !tbaa !10
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  store ptr %12, ptr %3, align 8, !tbaa !5
  br label %13

13:                                               ; preds = %32, %11
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct._BfsNode, ptr %14, i32 0, i32 1
  %16 = load i32, ptr %15, align 8, !tbaa !12
  %17 = icmp ne i32 %16, -1
  br i1 %17, label %18, label %36

18:                                               ; preds = %13
  %19 = load i32, ptr %5, align 4, !tbaa !10
  %20 = icmp eq i32 %19, 500
  br i1 %20, label %21, label %23

21:                                               ; preds = %18
  %22 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef 500)
  call void @exit(i32 noundef 1) #7
  unreachable

23:                                               ; preds = %18
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct._BfsNode, ptr %24, i32 0, i32 1
  %26 = load i32, ptr %25, align 8, !tbaa !12
  %27 = load ptr, ptr @extract_plan.ops, align 8, !tbaa !5
  %28 = load i32, ptr %5, align 4, !tbaa !10
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %5, align 4, !tbaa !10
  %30 = sext i32 %28 to i64
  %31 = getelementptr inbounds i32, ptr %27, i64 %30
  store i32 %26, ptr %31, align 4, !tbaa !10
  br label %32

32:                                               ; preds = %23
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct._BfsNode, ptr %33, i32 0, i32 9
  %35 = load ptr, ptr %34, align 8, !tbaa !16
  store ptr %35, ptr %3, align 8, !tbaa !5
  br label %13, !llvm.loop !17

36:                                               ; preds = %13
  store i32 0, ptr @gnum_plan_ops, align 4, !tbaa !10
  %37 = load i32, ptr %5, align 4, !tbaa !10
  %38 = sub nsw i32 %37, 1
  store i32 %38, ptr %4, align 4, !tbaa !10
  br label %39

39:                                               ; preds = %52, %36
  %40 = load i32, ptr %4, align 4, !tbaa !10
  %41 = icmp sgt i32 %40, -1
  br i1 %41, label %42, label %55

42:                                               ; preds = %39
  %43 = load ptr, ptr @extract_plan.ops, align 8, !tbaa !5
  %44 = load i32, ptr %4, align 4, !tbaa !10
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds i32, ptr %43, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !10
  %48 = load i32, ptr @gnum_plan_ops, align 4, !tbaa !10
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr @gnum_plan_ops, align 4, !tbaa !10
  %50 = sext i32 %48 to i64
  %51 = getelementptr inbounds [500 x i32], ptr @gplan_ops, i64 0, i64 %50
  store i32 %47, ptr %51, align 4, !tbaa !10
  br label %52

52:                                               ; preds = %42
  %53 = load i32, ptr %4, align 4, !tbaa !10
  %54 = add nsw i32 %53, -1
  store i32 %54, ptr %4, align 4, !tbaa !10
  br label %39, !llvm.loop !19

55:                                               ; preds = %39
  %56 = load i32, ptr getelementptr inbounds (%struct._command_line, ptr @gcmd_line, i32 0, i32 3), align 4, !tbaa !20
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %58, label %105

58:                                               ; preds = %55
  %59 = call i32 (ptr, ...) @printf(ptr noundef @.str.20)
  %60 = call i32 (ptr, ...) @printf(ptr noundef @.str.21)
  store float 0.000000e+00, ptr %6, align 4, !tbaa !22
  store i32 0, ptr %4, align 4, !tbaa !10
  br label %61

61:                                               ; preds = %94, %58
  %62 = load i32, ptr %4, align 4, !tbaa !10
  %63 = load i32, ptr @gnum_plan_ops, align 4, !tbaa !10
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %65, label %97

65:                                               ; preds = %61
  %66 = load i32, ptr %4, align 4, !tbaa !10
  %67 = call i32 (ptr, ...) @printf(ptr noundef @.str.22, i32 noundef %66)
  %68 = load i32, ptr %4, align 4, !tbaa !10
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [500 x i32], ptr @gplan_ops, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !10
  call void @print_op_name(i32 noundef %71)
  %72 = load i32, ptr %4, align 4, !tbaa !10
  %73 = load i32, ptr @gnum_plan_ops, align 4, !tbaa !10
  %74 = sub nsw i32 %73, 1
  %75 = icmp slt i32 %72, %74
  br i1 %75, label %76, label %78

76:                                               ; preds = %65
  %77 = call i32 (ptr, ...) @printf(ptr noundef @.str.23)
  br label %78

78:                                               ; preds = %76, %65
  %79 = load i8, ptr @goptimization_established, align 1, !tbaa !9
  %80 = icmp ne i8 %79, 0
  br i1 %80, label %81, label %93

81:                                               ; preds = %78
  %82 = load ptr, ptr @gop_conn, align 8, !tbaa !5
  %83 = load i32, ptr %4, align 4, !tbaa !10
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [500 x i32], ptr @gplan_ops, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !10
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds %struct._OpConn, ptr %82, i64 %87
  %89 = getelementptr inbounds %struct._OpConn, ptr %88, i32 0, i32 8
  %90 = load float, ptr %89, align 8, !tbaa !23
  %91 = load float, ptr %6, align 4, !tbaa !22
  %92 = fadd float %91, %90
  store float %92, ptr %6, align 4, !tbaa !22
  br label %93

93:                                               ; preds = %81, %78
  br label %94

94:                                               ; preds = %93
  %95 = load i32, ptr %4, align 4, !tbaa !10
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %4, align 4, !tbaa !10
  br label %61, !llvm.loop !25

97:                                               ; preds = %61
  %98 = load i8, ptr @goptimization_established, align 1, !tbaa !9
  %99 = icmp ne i8 %98, 0
  br i1 %99, label %100, label %104

100:                                              ; preds = %97
  %101 = load float, ptr %6, align 4, !tbaa !22
  %102 = fpext float %101 to double
  %103 = call i32 (ptr, ...) @printf(ptr noundef @.str.24, double noundef %102)
  br label %104

104:                                              ; preds = %100, %97
  br label %105

105:                                              ; preds = %104, %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  ret i8 1
}

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #4

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 = { noreturn 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 #3 = { 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 #4 = { nounwind allocsize(0,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 #5 = { nounwind }
attributes #6 = { nounwind allocsize(0,1) }
attributes #7 = { noreturn 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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !11, i64 32}
!13 = !{!"_BfsNode", !14, i64 0, !11, i64 32, !11, i64 36, !11, i64 40, !15, i64 44, !15, i64 48, !15, i64 52, !6, i64 56, !11, i64 64, !6, i64 72, !6, i64 80, !6, i64 88}
!14 = !{!"_State", !6, i64 0, !11, i64 8, !6, i64 16, !6, i64 24}
!15 = !{!"float", !7, i64 0}
!16 = !{!13, !6, i64 72}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = !{!21, !11, i64 768}
!21 = !{!"_command_line", !7, i64 0, !7, i64 256, !7, i64 512, !11, i64 768, !11, i64 772, !11, i64 776, !7, i64 780, !11, i64 784, !15, i64 788}
!22 = !{!15, !15, i64 0}
!23 = !{!24, !15, i64 40}
!24 = !{!"_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, !15, i64 40}
!25 = distinct !{!25, !18}


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

@gcmd_line = external local_unnamed_addr global %struct._command_line, align 4
@gop_conn = external local_unnamed_addr global ptr, align 8
@gnum_plan_ops = external local_unnamed_addr global i32, align 4
@.str.5 = external hidden unnamed_addr constant [42 x i8], align 1
@gplan_ops = external local_unnamed_addr global [500 x i32], align 16
@extract_plan.fc = external hidden local_unnamed_addr global i8, align 1
@extract_plan.ops = external hidden local_unnamed_addr global ptr, align 8
@.str.20 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [7 x i8], align 1
@goptimization_established = external local_unnamed_addr global i8, align 1
@.str.24 = external hidden unnamed_addr constant [15 x i8], align 1

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

declare void @print_op_name(i32 noundef) local_unnamed_addr #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i8 @extract_plan(ptr nocapture noundef readonly %0) local_unnamed_addr #3 {
  %2 = load i8, ptr @extract_plan.fc, align 1, !tbaa !5
  %.not = icmp eq i8 %2, 0
  br i1 %.not, label %5, label %3

3:                                                ; preds = %1
  %4 = tail call noalias dereferenceable_or_null(2000) ptr @calloc(i64 noundef 500, i64 noundef 4) #5
  store ptr %4, ptr @extract_plan.ops, align 8, !tbaa !8
  store i8 0, ptr @extract_plan.fc, align 1, !tbaa !5
  br label %5

5:                                                ; preds = %3, %1
  %6 = getelementptr inbounds i8, ptr %0, i64 32
  %7 = load i32, ptr %6, align 8, !tbaa !10
  %.not2227 = icmp eq i32 %7, -1
  br i1 %.not2227, label %._crit_edge.thread, label %.lr.ph

._crit_edge.thread:                               ; preds = %5
  store i32 0, ptr @gnum_plan_ops, align 4, !tbaa !15
  br label %._crit_edge33

.lr.ph:                                           ; preds = %5
  %8 = load ptr, ptr @extract_plan.ops, align 8, !tbaa !8
  br label %9

9:                                                ; preds = %26, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next.2, %26 ]
  %10 = phi i32 [ %7, %.lr.ph ], [ %31, %26 ]
  %.02028 = phi ptr [ %0, %.lr.ph ], [ %29, %26 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %11 = getelementptr inbounds i32, ptr %8, i64 %indvars.iv
  store i32 %10, ptr %11, align 4, !tbaa !15
  %12 = getelementptr inbounds i8, ptr %.02028, i64 72
  %13 = load ptr, ptr %12, align 8, !tbaa !16
  %14 = getelementptr inbounds i8, ptr %13, i64 32
  %15 = load i32, ptr %14, align 8, !tbaa !10
  %.not22 = icmp eq i32 %15, -1
  br i1 %.not22, label %._crit_edge, label %18, !llvm.loop !17

16:                                               ; preds = %24
  %17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 500)
  tail call void @exit(i32 noundef 1) #6
  unreachable

18:                                               ; preds = %9
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %19 = getelementptr inbounds i32, ptr %8, i64 %indvars.iv.next
  store i32 %15, ptr %19, align 4, !tbaa !15
  %20 = getelementptr inbounds i8, ptr %13, i64 72
  %21 = load ptr, ptr %20, align 8, !tbaa !16
  %22 = getelementptr inbounds i8, ptr %21, i64 32
  %23 = load i32, ptr %22, align 8, !tbaa !10
  %.not22.1 = icmp eq i32 %23, -1
  br i1 %.not22.1, label %._crit_edge, label %24, !llvm.loop !17

24:                                               ; preds = %18
  %25 = icmp eq i64 %indvars.iv.next.1, 500
  br i1 %25, label %16, label %26

26:                                               ; preds = %24
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %27 = getelementptr inbounds i32, ptr %8, i64 %indvars.iv.next.1
  store i32 %23, ptr %27, align 4, !tbaa !15
  %28 = getelementptr inbounds i8, ptr %21, i64 72
  %29 = load ptr, ptr %28, align 8, !tbaa !16
  %30 = getelementptr inbounds i8, ptr %29, i64 32
  %31 = load i32, ptr %30, align 8, !tbaa !10
  %.not22.2 = icmp eq i32 %31, -1
  br i1 %.not22.2, label %._crit_edge, label %9, !llvm.loop !17

._crit_edge:                                      ; preds = %26, %18, %9
  %indvars.iv.next.lcssa = phi i64 [ %indvars.iv.next, %9 ], [ %indvars.iv.next.1, %18 ], [ %indvars.iv.next.2, %26 ]
  %indvars.iv.lcssa65 = phi i64 [ %indvars.iv, %9 ], [ %indvars.iv.next, %18 ], [ %indvars.iv.next.1, %26 ]
  store i32 0, ptr @gnum_plan_ops, align 4, !tbaa !15
  %32 = load ptr, ptr @extract_plan.ops, align 8, !tbaa !8
  %33 = and i64 %indvars.iv.next.lcssa, 4294967295
  %min.iters.check = icmp ult i64 %indvars.iv.lcssa65, 23
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %._crit_edge
  %34 = shl nuw nsw i64 %indvars.iv.lcssa65, 2
  %35 = add nuw i64 %34, 4
  %scevgep = getelementptr i8, ptr @gplan_ops, i64 %35
  %scevgep53 = getelementptr i8, ptr %32, i64 %35
  %bound0 = icmp ugt ptr %scevgep, @gnum_plan_ops
  %bound1 = icmp ult ptr @gplan_ops, getelementptr inbounds (i8, ptr @gnum_plan_ops, i64 4)
  %found.conflict = and i1 %bound0, %bound1
  %bound054 = icmp ugt ptr %scevgep53, @gnum_plan_ops
  %bound155 = icmp ult ptr %32, getelementptr inbounds (i8, ptr @gnum_plan_ops, i64 4)
  %found.conflict56 = and i1 %bound054, %bound155
  %conflict.rdx = or i1 %found.conflict, %found.conflict56
  %bound057 = icmp ugt ptr %scevgep53, @gplan_ops
  %bound158 = icmp ult ptr %32, %scevgep
  %found.conflict59 = and i1 %bound057, %bound158
  %conflict.rdx60 = or i1 %conflict.rdx, %found.conflict59
  br i1 %conflict.rdx60, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %indvars.iv.next.lcssa, 9223372036854775800
  %ind.end = sub nsw i64 %33, %n.vec
  %36 = getelementptr i32, ptr %32, i64 %33
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %37 = xor i64 %index, -1
  %38 = getelementptr i32, ptr %36, i64 %37
  %39 = getelementptr inbounds i8, ptr %38, i64 -12
  %40 = getelementptr inbounds i8, ptr %38, i64 -28
  %wide.load = load <4 x i32>, ptr %39, align 4, !tbaa !15, !alias.scope !19
  %reverse = shufflevector <4 x i32> %wide.load, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %wide.load63 = load <4 x i32>, ptr %40, align 4, !tbaa !15, !alias.scope !19
  %reverse64 = shufflevector <4 x i32> %wide.load63, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %41 = bitcast <4 x i64> %vec.ind to <8 x i32>
  %42 = extractelement <8 x i32> %41, i64 6
  %43 = add i32 %42, 5
  %44 = getelementptr inbounds [500 x i32], ptr @gplan_ops, i64 0, i64 %index
  %45 = getelementptr inbounds i8, ptr %44, i64 16
  store <4 x i32> %reverse, ptr %44, align 16, !tbaa !15, !alias.scope !22, !noalias !19
  store <4 x i32> %reverse64, ptr %45, align 16, !tbaa !15, !alias.scope !22, !noalias !19
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8>
  %46 = icmp eq i64 %index.next, %n.vec
  br i1 %46, label %middle.block, label %vector.body, !llvm.loop !24

middle.block:                                     ; preds = %vector.body
  store i32 %43, ptr @gnum_plan_ops, align 4, !tbaa !15, !alias.scope !27, !noalias !29
  %cmp.n = icmp eq i64 %indvars.iv.next.lcssa, %n.vec
  br i1 %cmp.n, label %._crit_edge33, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %._crit_edge
  %indvars.iv43.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %._crit_edge ], [ %n.vec, %middle.block ]
  %indvars.iv41.ph = phi i64 [ %33, %vector.memcheck ], [ %33, %._crit_edge ], [ %ind.end, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv43 = phi i64 [ %indvars.iv.next44, %scalar.ph ], [ %indvars.iv43.ph, %scalar.ph.preheader ]
  %indvars.iv41 = phi i64 [ %indvars.iv.next42, %scalar.ph ], [ %indvars.iv41.ph, %scalar.ph.preheader ]
  %indvars.iv.next42 = add nsw i64 %indvars.iv41, -1
  %47 = getelementptr inbounds i32, ptr %32, i64 %indvars.iv.next42
  %48 = load i32, ptr %47, align 4, !tbaa !15
  %indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1
  %49 = trunc nsw i64 %indvars.iv.next44 to i32
  store i32 %49, ptr @gnum_plan_ops, align 4, !tbaa !15
  %50 = getelementptr inbounds [500 x i32], ptr @gplan_ops, i64 0, i64 %indvars.iv43
  store i32 %48, ptr %50, align 4, !tbaa !15
  %51 = icmp ugt i64 %indvars.iv41, 1
  br i1 %51, label %scalar.ph, label %._crit_edge33, !llvm.loop !30

._crit_edge33:                                    ; preds = %scalar.ph, %middle.block, %._crit_edge.thread
  %52 = load i32, ptr getelementptr inbounds (i8, ptr @gcmd_line, i64 768), align 4, !tbaa !31
  %.not23 = icmp eq i32 %52, 0
  br i1 %.not23, label %85, label %53

53:                                               ; preds = %._crit_edge33
  %54 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20)
  %55 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.21)
  %56 = load i32, ptr @gnum_plan_ops, align 4, !tbaa !15
  %57 = icmp sgt i32 %56, 0
  br i1 %57, label %.lr.ph37, label %.._crit_edge38_crit_edge

.._crit_edge38_crit_edge:                         ; preds = %53
  %.pre = load i8, ptr @goptimization_established, align 1, !tbaa !5
  br label %._crit_edge38

.lr.ph37:                                         ; preds = %53, %77
  %indvars.iv48 = phi i64 [ %indvars.iv.next49, %77 ], [ 0, %53 ]
  %.035 = phi float [ %.1, %77 ], [ 0.000000e+00, %53 ]
  %58 = trunc nuw nsw i64 %indvars.iv48 to i32
  %59 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22, i32 noundef %58)
  %60 = getelementptr inbounds [500 x i32], ptr @gplan_ops, i64 0, i64 %indvars.iv48
  %61 = load i32, ptr %60, align 4, !tbaa !15
  tail call void @print_op_name(i32 noundef %61) #7
  %62 = load i32, ptr @gnum_plan_ops, align 4, !tbaa !15
  %63 = add nsw i32 %62, -1
  %64 = sext i32 %63 to i64
  %65 = icmp slt i64 %indvars.iv48, %64
  br i1 %65, label %66, label %68

66:                                               ; preds = %.lr.ph37
  %67 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23)
  br label %68

68:                                               ; preds = %66, %.lr.ph37
  %69 = load i8, ptr @goptimization_established, align 1, !tbaa !5
  %.not25 = icmp eq i8 %69, 0
  br i1 %.not25, label %77, label %70

70:                                               ; preds = %68
  %71 = load ptr, ptr @gop_conn, align 8, !tbaa !8
  %72 = load i32, ptr %60, align 4, !tbaa !15
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds %struct._OpConn, ptr %71, i64 %73, i32 8
  %75 = load float, ptr %74, align 8, !tbaa !33
  %76 = fadd float %.035, %75
  br label %77

77:                                               ; preds = %68, %70
  %.1 = phi float [ %76, %70 ], [ %.035, %68 ]
  %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
  %78 = load i32, ptr @gnum_plan_ops, align 4, !tbaa !15
  %79 = sext i32 %78 to i64
  %80 = icmp slt i64 %indvars.iv.next49, %79
  br i1 %80, label %.lr.ph37, label %._crit_edge38.loopexit, !llvm.loop !35

._crit_edge38.loopexit:                           ; preds = %77
  %81 = fpext float %.1 to double
  br label %._crit_edge38

._crit_edge38:                                    ; preds = %.._crit_edge38_crit_edge, %._crit_edge38.loopexit
  %82 = phi i8 [ %.pre, %.._crit_edge38_crit_edge ], [ %69, %._crit_edge38.loopexit ]
  %.0.lcssa = phi double [ 0.000000e+00, %.._crit_edge38_crit_edge ], [ %81, %._crit_edge38.loopexit ]
  %.not24 = icmp eq i8 %82, 0
  br i1 %.not24, label %85, label %83

83:                                               ; preds = %._crit_edge38
  %84 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.24, double noundef %.0.lcssa)
  br label %85

85:                                               ; preds = %._crit_edge38, %83, %._crit_edge33
  ret i8 1
}

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #4

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 = { "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 = { noreturn 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 #3 = { 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 #4 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #5 = { nounwind allocsize(0,1) }
attributes #6 = { noreturn nounwind }
attributes #7 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !6, i64 0}
!10 = !{!11, !13, i64 32}
!11 = !{!"_BfsNode", !12, i64 0, !13, i64 32, !13, i64 36, !13, i64 40, !14, i64 44, !14, i64 48, !14, i64 52, !9, i64 56, !13, i64 64, !9, i64 72, !9, i64 80, !9, i64 88}
!12 = !{!"_State", !9, i64 0, !13, i64 8, !9, i64 16, !9, i64 24}
!13 = !{!"int", !6, i64 0}
!14 = !{!"float", !6, i64 0}
!15 = !{!13, !13, i64 0}
!16 = !{!11, !9, i64 72}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!20}
!20 = distinct !{!20, !21}
!21 = distinct !{!21, !"LVerDomain"}
!22 = !{!23}
!23 = distinct !{!23, !21}
!24 = distinct !{!24, !18, !25, !26}
!25 = !{!"llvm.loop.isvectorized", i32 1}
!26 = !{!"llvm.loop.unroll.runtime.disable"}
!27 = !{!28}
!28 = distinct !{!28, !21}
!29 = !{!23, !20}
!30 = distinct !{!30, !18, !25}
!31 = !{!32, !13, i64 768}
!32 = !{!"_command_line", !6, i64 0, !6, i64 256, !6, i64 512, !13, i64 768, !13, i64 772, !13, i64 776, !6, i64 780, !13, i64 784, !14, i64 788}
!33 = !{!34, !14, i64 40}
!34 = !{!"_OpConn", !9, i64 0, !6, i64 8, !9, i64 16, !13, i64 24, !6, i64 28, !6, i64 29, !13, i64 32, !6, i64 36, !14, i64 40}
!35 = distinct !{!35, !18}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass