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

; 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._State = type { ptr, i32, ptr, ptr }
%struct._Facts = type { ptr, ptr }
%struct._Fact = type { i32, [5 x i32] }
%struct._FluentValues = type { %struct._Fluent, float, ptr }
%struct._Fluent = type { i32, [5 x i32] }

@garity = external global [50 x i32], align 16
@lneg = external dso_local global [50 x ptr], align 16
@lindex = external dso_local global [50 x ptr], align 16
@lp = external dso_local global i32, align 4
@largs = external dso_local global [15 x i32], align 16
@gnum_relevant_facts = external global i32, align 4
@ginitial = external global ptr, align 8
@gf_arity = external global [50 x i32], align 16
@lf = external dso_local global i32, align 4
@lf_args = external dso_local global [15 x i32], align 16
@lf_index = external dso_local global [50 x ptr], align 16
@gf_initial = external global ptr, align 8
@ginitial_state = external global %struct._State, align 8

; 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 i32 @fact_adress() #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
declare dso_local i32 @fluent_adress() #1

; Function Attrs: nounwind uwtable
define dso_local void @create_final_initial_state() #1 {
  %1 = alloca ptr, align 8
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  store i32 0, ptr %2, align 4, !tbaa !5
  %6 = load i32, ptr @gnum_relevant_facts, align 4, !tbaa !5
  %7 = add nsw i32 %6, 1
  call void @make_state(ptr noundef @ginitial_state, i32 noundef %7, i32 noundef 1000)
  %8 = load ptr, ptr @ginitial, align 8, !tbaa !9
  store ptr %8, ptr %1, align 8, !tbaa !9
  br label %9

9:                                                ; preds = %66, %0
  %10 = load ptr, ptr %1, align 8, !tbaa !9
  %11 = icmp ne ptr %10, null
  br i1 %11, label %12, label %70

12:                                               ; preds = %9
  %13 = load ptr, ptr %1, align 8, !tbaa !9
  %14 = getelementptr inbounds %struct._Facts, ptr %13, i32 0, i32 0
  %15 = load ptr, ptr %14, align 8, !tbaa !11
  %16 = getelementptr inbounds %struct._Fact, ptr %15, i32 0, i32 0
  %17 = load i32, ptr %16, align 4, !tbaa !13
  store i32 %17, ptr @lp, align 4, !tbaa !5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %37, %12
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = load i32, ptr @lp, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [50 x i32], ptr @garity, i64 0, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = icmp slt i32 %19, %23
  br i1 %24, label %25, label %40

25:                                               ; preds = %18
  %26 = load ptr, ptr %1, align 8, !tbaa !9
  %27 = getelementptr inbounds %struct._Facts, ptr %26, i32 0, i32 0
  %28 = load ptr, ptr %27, align 8, !tbaa !11
  %29 = getelementptr inbounds %struct._Fact, ptr %28, i32 0, i32 1
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [5 x i32], ptr %29, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [15 x i32], ptr @largs, i64 0, i64 %35
  store i32 %33, ptr %36, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %25
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %2, align 4, !tbaa !5
  br label %18, !llvm.loop !15

40:                                               ; preds = %18
  %41 = call i32 @fact_adress()
  store i32 %41, ptr %3, align 4, !tbaa !5
  %42 = load i32, ptr @lp, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [50 x ptr], ptr @lneg, i64 0, i64 %43
  %45 = load ptr, ptr %44, align 8, !tbaa !9
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds i32, ptr %45, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %52, label %51

51:                                               ; preds = %40
  br label %66

52:                                               ; preds = %40
  %53 = load i32, ptr @lp, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [50 x ptr], ptr @lindex, i64 0, i64 %54
  %56 = load ptr, ptr %55, align 8, !tbaa !9
  %57 = load i32, ptr %3, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds i32, ptr %56, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = load ptr, ptr @ginitial_state, align 8, !tbaa !17
  %62 = load i32, ptr getelementptr inbounds (%struct._State, ptr @ginitial_state, i32 0, i32 1), align 8, !tbaa !19
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr getelementptr inbounds (%struct._State, ptr @ginitial_state, i32 0, i32 1), align 8, !tbaa !19
  %64 = sext i32 %62 to i64
  %65 = getelementptr inbounds i32, ptr %61, i64 %64
  store i32 %60, ptr %65, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %52, %51
  %67 = load ptr, ptr %1, align 8, !tbaa !9
  %68 = getelementptr inbounds %struct._Facts, ptr %67, i32 0, i32 1
  %69 = load ptr, ptr %68, align 8, !tbaa !20
  store ptr %69, ptr %1, align 8, !tbaa !9
  br label %9, !llvm.loop !21

70:                                               ; preds = %9
  %71 = load ptr, ptr @gf_initial, align 8, !tbaa !9
  store ptr %71, ptr %5, align 8, !tbaa !9
  br label %72

72:                                               ; preds = %122, %70
  %73 = load ptr, ptr %5, align 8, !tbaa !9
  %74 = icmp ne ptr %73, null
  br i1 %74, label %75, label %126

75:                                               ; preds = %72
  %76 = load ptr, ptr %5, align 8, !tbaa !9
  %77 = getelementptr inbounds %struct._FluentValues, ptr %76, i32 0, i32 0
  %78 = getelementptr inbounds %struct._Fluent, ptr %77, i32 0, i32 0
  %79 = load i32, ptr %78, align 8, !tbaa !22
  store i32 %79, ptr @lf, align 4, !tbaa !5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %98, %75
  %81 = load i32, ptr %2, align 4, !tbaa !5
  %82 = load i32, ptr @lf, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [50 x i32], ptr @gf_arity, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = icmp slt i32 %81, %85
  br i1 %86, label %87, label %101

87:                                               ; preds = %80
  %88 = load ptr, ptr %5, align 8, !tbaa !9
  %89 = getelementptr inbounds %struct._FluentValues, ptr %88, i32 0, i32 0
  %90 = getelementptr inbounds %struct._Fluent, ptr %89, i32 0, i32 1
  %91 = load i32, ptr %2, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [5 x i32], ptr %90, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = load i32, ptr %2, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [15 x i32], ptr @lf_args, i64 0, i64 %96
  store i32 %94, ptr %97, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %87
  %99 = load i32, ptr %2, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %2, align 4, !tbaa !5
  br label %80, !llvm.loop !26

101:                                              ; preds = %80
  %102 = call i32 @fluent_adress()
  store i32 %102, ptr %3, align 4, !tbaa !5
  %103 = load i32, ptr @lf, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [50 x ptr], ptr @lf_index, i64 0, i64 %104
  %106 = load ptr, ptr %105, align 8, !tbaa !9
  %107 = load i32, ptr %3, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds i32, ptr %106, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  store i32 %110, ptr %4, align 4, !tbaa !5
  %111 = load ptr, ptr getelementptr inbounds (%struct._State, ptr @ginitial_state, i32 0, i32 2), align 8, !tbaa !27
  %112 = load i32, ptr %4, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds i8, ptr %111, i64 %113
  store i8 1, ptr %114, align 1, !tbaa !28
  %115 = load ptr, ptr %5, align 8, !tbaa !9
  %116 = getelementptr inbounds %struct._FluentValues, ptr %115, i32 0, i32 1
  %117 = load float, ptr %116, align 8, !tbaa !29
  %118 = load ptr, ptr getelementptr inbounds (%struct._State, ptr @ginitial_state, i32 0, i32 3), align 8, !tbaa !30
  %119 = load i32, ptr %4, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds float, ptr %118, i64 %120
  store float %117, ptr %121, align 4, !tbaa !31
  br label %122

122:                                              ; preds = %101
  %123 = load ptr, ptr %5, align 8, !tbaa !9
  %124 = getelementptr inbounds %struct._FluentValues, ptr %123, i32 0, i32 2
  %125 = load ptr, ptr %124, align 8, !tbaa !32
  store ptr %125, ptr %5, align 8, !tbaa !9
  br label %72, !llvm.loop !33

126:                                              ; preds = %72
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #3
  ret void
}

declare void @make_state(ptr noundef, i32 noundef, i32 noundef) #2

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 = { "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 = !{!"_Facts", !10, i64 0, !10, i64 8}
!13 = !{!14, !6, i64 0}
!14 = !{!"_Fact", !6, i64 0, !7, i64 4}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !10, i64 0}
!18 = !{!"_State", !10, i64 0, !6, i64 8, !10, i64 16, !10, i64 24}
!19 = !{!18, !6, i64 8}
!20 = !{!12, !10, i64 8}
!21 = distinct !{!21, !16}
!22 = !{!23, !6, i64 0}
!23 = !{!"_FluentValues", !24, i64 0, !25, i64 24, !10, i64 32}
!24 = !{!"_Fluent", !6, i64 0, !7, i64 4}
!25 = !{!"float", !7, i64 0}
!26 = distinct !{!26, !16}
!27 = !{!18, !10, i64 16}
!28 = !{!7, !7, i64 0}
!29 = !{!23, !25, i64 24}
!30 = !{!18, !10, i64 24}
!31 = !{!25, !25, i64 0}
!32 = !{!23, !10, i64 32}
!33 = distinct !{!33, !16}


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

@garity = external local_unnamed_addr global [50 x i32], align 16
@lneg = external dso_local local_unnamed_addr global [50 x ptr], align 16
@lindex = external dso_local local_unnamed_addr global [50 x ptr], align 16
@lp = external dso_local local_unnamed_addr global i32, align 4
@largs = external dso_local local_unnamed_addr global [15 x i32], align 16
@gnum_relevant_facts = external local_unnamed_addr global i32, align 4
@ginitial = external local_unnamed_addr global ptr, align 8
@gf_arity = external local_unnamed_addr global [50 x i32], align 16
@lf = external dso_local local_unnamed_addr global i32, align 4
@lf_args = external dso_local local_unnamed_addr global [15 x i32], align 16
@lf_index = external dso_local local_unnamed_addr global [50 x ptr], align 16
@gf_initial = external local_unnamed_addr global ptr, align 8
@ginitial_state = external global %struct._State, align 8

; Function Attrs: nounwind uwtable
declare dso_local i32 @fact_adress() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @fluent_adress() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @create_final_initial_state() local_unnamed_addr #0 {
  %1 = load i32, ptr @gnum_relevant_facts, align 4, !tbaa !5
  %2 = add nsw i32 %1, 1
  tail call void @make_state(ptr noundef nonnull @ginitial_state, i32 noundef %2, i32 noundef 1000) #2
  %.02126 = load ptr, ptr @ginitial, align 8, !tbaa !9
  %.not27 = icmp eq ptr %.02126, null
  br i1 %.not27, label %.preheader, label %.lr.ph30

.preheader:                                       ; preds = %52, %0
  %.035 = load ptr, ptr @gf_initial, align 8, !tbaa !9
  %.not2336 = icmp eq ptr %.035, null
  br i1 %.not2336, label %._crit_edge39, label %.lr.ph38

.lr.ph30:                                         ; preds = %0, %52
  %.02128 = phi ptr [ %.021, %52 ], [ %.02126, %0 ]
  %3 = load ptr, ptr %.02128, align 8, !tbaa !11
  %4 = load i32, ptr %3, align 4, !tbaa !13
  store i32 %4, ptr @lp, align 4, !tbaa !5
  %5 = sext i32 %4 to i64
  %6 = getelementptr inbounds [50 x i32], ptr @garity, i64 0, i64 %5
  %7 = load i32, ptr %6, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph30
  %9 = ptrtoint ptr %3 to i64
  %10 = getelementptr inbounds i8, ptr %3, i64 4
  %wide.trip.count = zext nneg i32 %7 to i64
  %min.iters.check = icmp ult i32 %7, 8
  %11 = sub i64 add (i64 ptrtoint (ptr @largs to i64), i64 -4), %9
  %diff.check = icmp ult i64 %11, 32
  %or.cond = or i1 %min.iters.check, %diff.check
  br i1 %or.cond, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %wide.trip.count, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %12 = getelementptr inbounds [5 x i32], ptr %10, i64 0, i64 %index
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  %wide.load = load <4 x i32>, ptr %12, align 4, !tbaa !5
  %wide.load46 = load <4 x i32>, ptr %13, align 4, !tbaa !5
  %14 = getelementptr inbounds [15 x i32], ptr @largs, i64 0, i64 %index
  %15 = getelementptr inbounds i8, ptr %14, i64 16
  store <4 x i32> %wide.load, ptr %14, align 16, !tbaa !5
  store <4 x i32> %wide.load46, ptr %15, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %16 = icmp eq i64 %index.next, %n.vec
  br i1 %16, label %middle.block, label %vector.body, !llvm.loop !15

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  %xtraiter = and i64 %wide.trip.count, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader, %scalar.ph.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %scalar.ph.prol ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph.prol ], [ 0, %scalar.ph.preheader ]
  %17 = getelementptr inbounds [5 x i32], ptr %10, i64 0, i64 %indvars.iv.prol
  %18 = load i32, ptr %17, align 4, !tbaa !5
  %19 = getelementptr inbounds [15 x i32], ptr @largs, i64 0, i64 %indvars.iv.prol
  store i32 %18, ptr %19, align 4, !tbaa !5
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol, !llvm.loop !19

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %scalar.ph.preheader ], [ %indvars.iv.next.prol, %scalar.ph.prol ]
  %20 = sub nsw i64 %indvars.iv.ph, %wide.trip.count
  %21 = icmp ugt i64 %20, -4
  br i1 %21, label %._crit_edge, label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %scalar.ph ], [ %indvars.iv.unr, %scalar.ph.prol.loopexit ]
  %22 = getelementptr inbounds [5 x i32], ptr %10, i64 0, i64 %indvars.iv
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = getelementptr inbounds [15 x i32], ptr @largs, i64 0, i64 %indvars.iv
  store i32 %23, ptr %24, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %25 = getelementptr inbounds [5 x i32], ptr %10, i64 0, i64 %indvars.iv.next
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = getelementptr inbounds [15 x i32], ptr @largs, i64 0, i64 %indvars.iv.next
  store i32 %26, ptr %27, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %28 = getelementptr inbounds [5 x i32], ptr %10, i64 0, i64 %indvars.iv.next.1
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = getelementptr inbounds [15 x i32], ptr @largs, i64 0, i64 %indvars.iv.next.1
  store i32 %29, ptr %30, align 4, !tbaa !5
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %31 = getelementptr inbounds [5 x i32], ptr %10, i64 0, i64 %indvars.iv.next.2
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = getelementptr inbounds [15 x i32], ptr @largs, i64 0, i64 %indvars.iv.next.2
  store i32 %32, ptr %33, align 4, !tbaa !5
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
  br i1 %exitcond.not.3, label %._crit_edge, label %scalar.ph, !llvm.loop !21

._crit_edge:                                      ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block, %.lr.ph30
  %34 = tail call i32 @fact_adress()
  %35 = load i32, ptr @lp, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [50 x ptr], ptr @lneg, i64 0, i64 %36
  %38 = load ptr, ptr %37, align 8, !tbaa !9
  %39 = sext i32 %34 to i64
  %40 = getelementptr inbounds i32, ptr %38, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %.not24 = icmp eq i32 %41, 0
  br i1 %.not24, label %52, label %42

42:                                               ; preds = %._crit_edge
  %43 = getelementptr inbounds [50 x ptr], ptr @lindex, i64 0, i64 %36
  %44 = load ptr, ptr %43, align 8, !tbaa !9
  %45 = getelementptr inbounds i32, ptr %44, i64 %39
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = load ptr, ptr @ginitial_state, align 8, !tbaa !22
  %48 = load i32, ptr getelementptr inbounds (i8, ptr @ginitial_state, i64 8), align 8, !tbaa !24
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr getelementptr inbounds (i8, ptr @ginitial_state, i64 8), align 8, !tbaa !24
  %50 = sext i32 %48 to i64
  %51 = getelementptr inbounds i32, ptr %47, i64 %50
  store i32 %46, ptr %51, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %._crit_edge, %42
  %53 = getelementptr inbounds i8, ptr %.02128, i64 8
  %.021 = load ptr, ptr %53, align 8, !tbaa !9
  %.not = icmp eq ptr %.021, null
  br i1 %.not, label %.preheader, label %.lr.ph30, !llvm.loop !25

.lr.ph38:                                         ; preds = %.preheader, %._crit_edge34
  %.037 = phi ptr [ %.0, %._crit_edge34 ], [ %.035, %.preheader ]
  %54 = load i32, ptr %.037, align 8, !tbaa !26
  store i32 %54, ptr @lf, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [50 x i32], ptr @gf_arity, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = icmp sgt i32 %57, 0
  br i1 %58, label %.lr.ph33, label %._crit_edge34

.lr.ph33:                                         ; preds = %.lr.ph38
  %.03748 = ptrtoint ptr %.037 to i64
  %59 = getelementptr inbounds i8, ptr %.037, i64 4
  %wide.trip.count44 = zext nneg i32 %57 to i64
  %min.iters.check52 = icmp ult i32 %57, 8
  %60 = sub i64 add (i64 ptrtoint (ptr @lf_args to i64), i64 -4), %.03748
  %diff.check49 = icmp ult i64 %60, 32
  %or.cond63 = or i1 %min.iters.check52, %diff.check49
  br i1 %or.cond63, label %scalar.ph51.preheader, label %vector.ph53

vector.ph53:                                      ; preds = %.lr.ph33
  %n.vec55 = and i64 %wide.trip.count44, 2147483640
  br label %vector.body57

vector.body57:                                    ; preds = %vector.body57, %vector.ph53
  %index58 = phi i64 [ 0, %vector.ph53 ], [ %index.next61, %vector.body57 ]
  %61 = getelementptr inbounds [5 x i32], ptr %59, i64 0, i64 %index58
  %62 = getelementptr inbounds i8, ptr %61, i64 16
  %wide.load59 = load <4 x i32>, ptr %61, align 4, !tbaa !5
  %wide.load60 = load <4 x i32>, ptr %62, align 4, !tbaa !5
  %63 = getelementptr inbounds [15 x i32], ptr @lf_args, i64 0, i64 %index58
  %64 = getelementptr inbounds i8, ptr %63, i64 16
  store <4 x i32> %wide.load59, ptr %63, align 16, !tbaa !5
  store <4 x i32> %wide.load60, ptr %64, align 16, !tbaa !5
  %index.next61 = add nuw i64 %index58, 8
  %65 = icmp eq i64 %index.next61, %n.vec55
  br i1 %65, label %middle.block50, label %vector.body57, !llvm.loop !30

middle.block50:                                   ; preds = %vector.body57
  %cmp.n62 = icmp eq i64 %n.vec55, %wide.trip.count44
  br i1 %cmp.n62, label %._crit_edge34, label %scalar.ph51.preheader

scalar.ph51.preheader:                            ; preds = %middle.block50, %.lr.ph33
  %indvars.iv41.ph = phi i64 [ 0, %.lr.ph33 ], [ %n.vec55, %middle.block50 ]
  %xtraiter64 = and i64 %wide.trip.count44, 3
  %lcmp.mod65.not = icmp eq i64 %xtraiter64, 0
  br i1 %lcmp.mod65.not, label %scalar.ph51.prol.loopexit, label %scalar.ph51.prol

scalar.ph51.prol:                                 ; preds = %scalar.ph51.preheader, %scalar.ph51.prol
  %indvars.iv41.prol = phi i64 [ %indvars.iv.next42.prol, %scalar.ph51.prol ], [ %indvars.iv41.ph, %scalar.ph51.preheader ]
  %prol.iter66 = phi i64 [ %prol.iter66.next, %scalar.ph51.prol ], [ 0, %scalar.ph51.preheader ]
  %66 = getelementptr inbounds [5 x i32], ptr %59, i64 0, i64 %indvars.iv41.prol
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = getelementptr inbounds [15 x i32], ptr @lf_args, i64 0, i64 %indvars.iv41.prol
  store i32 %67, ptr %68, align 4, !tbaa !5
  %indvars.iv.next42.prol = add nuw nsw i64 %indvars.iv41.prol, 1
  %prol.iter66.next = add i64 %prol.iter66, 1
  %prol.iter66.cmp.not = icmp eq i64 %prol.iter66.next, %xtraiter64
  br i1 %prol.iter66.cmp.not, label %scalar.ph51.prol.loopexit, label %scalar.ph51.prol, !llvm.loop !31

scalar.ph51.prol.loopexit:                        ; preds = %scalar.ph51.prol, %scalar.ph51.preheader
  %indvars.iv41.unr = phi i64 [ %indvars.iv41.ph, %scalar.ph51.preheader ], [ %indvars.iv.next42.prol, %scalar.ph51.prol ]
  %69 = sub nsw i64 %indvars.iv41.ph, %wide.trip.count44
  %70 = icmp ugt i64 %69, -4
  br i1 %70, label %._crit_edge34, label %scalar.ph51

scalar.ph51:                                      ; preds = %scalar.ph51.prol.loopexit, %scalar.ph51
  %indvars.iv41 = phi i64 [ %indvars.iv.next42.3, %scalar.ph51 ], [ %indvars.iv41.unr, %scalar.ph51.prol.loopexit ]
  %71 = getelementptr inbounds [5 x i32], ptr %59, i64 0, i64 %indvars.iv41
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = getelementptr inbounds [15 x i32], ptr @lf_args, i64 0, i64 %indvars.iv41
  store i32 %72, ptr %73, align 4, !tbaa !5
  %indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
  %74 = getelementptr inbounds [5 x i32], ptr %59, i64 0, i64 %indvars.iv.next42
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = getelementptr inbounds [15 x i32], ptr @lf_args, i64 0, i64 %indvars.iv.next42
  store i32 %75, ptr %76, align 4, !tbaa !5
  %indvars.iv.next42.1 = add nuw nsw i64 %indvars.iv41, 2
  %77 = getelementptr inbounds [5 x i32], ptr %59, i64 0, i64 %indvars.iv.next42.1
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = getelementptr inbounds [15 x i32], ptr @lf_args, i64 0, i64 %indvars.iv.next42.1
  store i32 %78, ptr %79, align 4, !tbaa !5
  %indvars.iv.next42.2 = add nuw nsw i64 %indvars.iv41, 3
  %80 = getelementptr inbounds [5 x i32], ptr %59, i64 0, i64 %indvars.iv.next42.2
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = getelementptr inbounds [15 x i32], ptr @lf_args, i64 0, i64 %indvars.iv.next42.2
  store i32 %81, ptr %82, align 4, !tbaa !5
  %indvars.iv.next42.3 = add nuw nsw i64 %indvars.iv41, 4
  %exitcond45.not.3 = icmp eq i64 %indvars.iv.next42.3, %wide.trip.count44
  br i1 %exitcond45.not.3, label %._crit_edge34, label %scalar.ph51, !llvm.loop !32

._crit_edge34:                                    ; preds = %scalar.ph51.prol.loopexit, %scalar.ph51, %middle.block50, %.lr.ph38
  %83 = tail call i32 @fluent_adress()
  %84 = load i32, ptr @lf, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [50 x ptr], ptr @lf_index, i64 0, i64 %85
  %87 = load ptr, ptr %86, align 8, !tbaa !9
  %88 = sext i32 %83 to i64
  %89 = getelementptr inbounds i32, ptr %87, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = load ptr, ptr getelementptr inbounds (i8, ptr @ginitial_state, i64 16), align 8, !tbaa !33
  %92 = sext i32 %90 to i64
  %93 = getelementptr inbounds i8, ptr %91, i64 %92
  store i8 1, ptr %93, align 1, !tbaa !34
  %94 = getelementptr inbounds i8, ptr %.037, i64 24
  %95 = load float, ptr %94, align 8, !tbaa !35
  %96 = load ptr, ptr getelementptr inbounds (i8, ptr @ginitial_state, i64 24), align 8, !tbaa !36
  %97 = getelementptr inbounds float, ptr %96, i64 %92
  store float %95, ptr %97, align 4, !tbaa !37
  %98 = getelementptr inbounds i8, ptr %.037, i64 32
  %.0 = load ptr, ptr %98, align 8, !tbaa !9
  %.not23 = icmp eq ptr %.0, null
  br i1 %.not23, label %._crit_edge39, label %.lr.ph38, !llvm.loop !38

._crit_edge39:                                    ; preds = %._crit_edge34, %.preheader
  ret void
}

declare void @make_state(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

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

!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 = !{!"_Facts", !10, i64 0, !10, i64 8}
!13 = !{!14, !6, i64 0}
!14 = !{!"_Fact", !6, i64 0, !7, i64 4}
!15 = distinct !{!15, !16, !17, !18}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!"llvm.loop.isvectorized", i32 1}
!18 = !{!"llvm.loop.unroll.runtime.disable"}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.unroll.disable"}
!21 = distinct !{!21, !16, !17}
!22 = !{!23, !10, i64 0}
!23 = !{!"_State", !10, i64 0, !6, i64 8, !10, i64 16, !10, i64 24}
!24 = !{!23, !6, i64 8}
!25 = distinct !{!25, !16}
!26 = !{!27, !6, i64 0}
!27 = !{!"_FluentValues", !28, i64 0, !29, i64 24, !10, i64 32}
!28 = !{!"_Fluent", !6, i64 0, !7, i64 4}
!29 = !{!"float", !7, i64 0}
!30 = distinct !{!30, !16, !17, !18}
!31 = distinct !{!31, !20}
!32 = distinct !{!32, !16, !17}
!33 = !{!23, !10, i64 16}
!34 = !{!7, !7, i64 0}
!35 = !{!27, !29, i64 24}
!36 = !{!23, !10, i64 24}
!37 = !{!29, !29, i64 0}
!38 = distinct !{!38, !16}


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