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

@gef_conn = external global ptr, align 8
@gfl_conn = external global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local zeroext i8 @assign_value(i32 noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3) #0 {
  %5 = alloca i8, align 1
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  store i32 %0, ptr %6, align 4, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !9
  %10 = load ptr, ptr @gef_conn, align 8, !tbaa !9
  %11 = load i32, ptr %6, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds %struct._EfConn, ptr %10, i64 %12
  %14 = getelementptr inbounds %struct._EfConn, ptr %13, i32 0, i32 21
  %15 = load ptr, ptr %14, align 8, !tbaa !11
  %16 = load i32, ptr %8, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds i32, ptr %15, i64 %17
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = icmp eq i32 %19, -1
  br i1 %20, label %21, label %33

21:                                               ; preds = %4
  %22 = load ptr, ptr @gef_conn, align 8, !tbaa !9
  %23 = load i32, ptr %6, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds %struct._EfConn, ptr %22, i64 %24
  %26 = getelementptr inbounds %struct._EfConn, ptr %25, i32 0, i32 22
  %27 = load ptr, ptr %26, align 8, !tbaa !14
  %28 = load i32, ptr %8, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds float, ptr %27, i64 %29
  %31 = load float, ptr %30, align 4, !tbaa !15
  %32 = load ptr, ptr %9, align 8, !tbaa !9
  store float %31, ptr %32, align 4, !tbaa !15
  store i8 1, ptr %5, align 1
  br label %87

33:                                               ; preds = %4
  %34 = load ptr, ptr @gfl_conn, align 8, !tbaa !9
  %35 = load ptr, ptr @gef_conn, align 8, !tbaa !9
  %36 = load i32, ptr %6, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds %struct._EfConn, ptr %35, i64 %37
  %39 = getelementptr inbounds %struct._EfConn, ptr %38, i32 0, i32 21
  %40 = load ptr, ptr %39, align 8, !tbaa !11
  %41 = load i32, ptr %8, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds i32, ptr %40, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds %struct._FlConn, ptr %34, i64 %45
  %47 = getelementptr inbounds %struct._FlConn, ptr %46, i32 0, i32 17
  %48 = load ptr, ptr %47, align 8, !tbaa !16
  %49 = load i32, ptr %7, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds i8, ptr %48, i64 %50
  %52 = load i8, ptr %51, align 1, !tbaa !18
  %53 = icmp ne i8 %52, 0
  br i1 %53, label %55, label %54

54:                                               ; preds = %33
  store i8 0, ptr %5, align 1
  br label %87

55:                                               ; preds = %33
  %56 = load ptr, ptr @gfl_conn, align 8, !tbaa !9
  %57 = load ptr, ptr @gef_conn, align 8, !tbaa !9
  %58 = load i32, ptr %6, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds %struct._EfConn, ptr %57, i64 %59
  %61 = getelementptr inbounds %struct._EfConn, ptr %60, i32 0, i32 21
  %62 = load ptr, ptr %61, align 8, !tbaa !11
  %63 = load i32, ptr %8, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds i32, ptr %62, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds %struct._FlConn, ptr %56, i64 %67
  %69 = getelementptr inbounds %struct._FlConn, ptr %68, i32 0, i32 18
  %70 = load ptr, ptr %69, align 8, !tbaa !19
  %71 = load i32, ptr %7, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds float, ptr %70, i64 %72
  %74 = load float, ptr %73, align 4, !tbaa !15
  %75 = load ptr, ptr @gef_conn, align 8, !tbaa !9
  %76 = load i32, ptr %6, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds %struct._EfConn, ptr %75, i64 %77
  %79 = getelementptr inbounds %struct._EfConn, ptr %78, i32 0, i32 22
  %80 = load ptr, ptr %79, align 8, !tbaa !14
  %81 = load i32, ptr %8, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds float, ptr %80, i64 %82
  %84 = load float, ptr %83, align 4, !tbaa !15
  %85 = fadd float %74, %84
  %86 = load ptr, ptr %9, align 8, !tbaa !9
  store float %85, ptr %86, align 4, !tbaa !15
  store i8 1, ptr %5, align 1
  br label %87

87:                                               ; preds = %55, %54, %21
  %88 = load i8, ptr %5, align 1
  ret i8 %88
}

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 = !{!12, !10, i64 152}
!12 = !{!"_EfConn", !6, i64 0, !7, i64 4, !7, i64 5, !13, 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, !13, i64 192, !7, i64 196, !6, i64 200, !7, i64 204, !6, i64 208, !6, i64 212}
!13 = !{!"float", !7, i64 0}
!14 = !{!12, !10, i64 160}
!15 = !{!13, !13, i64 0}
!16 = !{!17, !10, i64 112}
!17 = !{!"_FlConn", !10, i64 0, !6, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !6, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !6, i64 72, !7, i64 76, !10, i64 80, !10, i64 88, !6, i64 96, !7, i64 100, !13, i64 104, !7, i64 108, !10, i64 112, !10, i64 120, !7, i64 128, !13, i64 132, !6, i64 136}
!18 = !{!7, !7, i64 0}
!19 = !{!17, !10, i64 120}


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

@gef_conn = external local_unnamed_addr global ptr, align 8
@gfl_conn = external local_unnamed_addr global ptr, align 8

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local zeroext range(i8 0, 2) i8 @assign_value(i32 noundef %0, i32 noundef %1, i32 noundef %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #0 {
  %5 = load ptr, ptr @gef_conn, align 8, !tbaa !5
  %6 = sext i32 %0 to i64
  %7 = getelementptr inbounds %struct._EfConn, ptr %5, i64 %6
  %8 = getelementptr inbounds i8, ptr %7, i64 152
  %9 = load ptr, ptr %8, align 8, !tbaa !9
  %10 = sext i32 %2 to i64
  %11 = getelementptr inbounds i32, ptr %9, i64 %10
  %12 = load i32, ptr %11, align 4, !tbaa !13
  %13 = icmp eq i32 %12, -1
  br i1 %13, label %14, label %19

14:                                               ; preds = %4
  %15 = getelementptr inbounds i8, ptr %7, i64 160
  %16 = load ptr, ptr %15, align 8, !tbaa !14
  %17 = getelementptr inbounds float, ptr %16, i64 %10
  %18 = load float, ptr %17, align 4, !tbaa !15
  br label %.sink.split

19:                                               ; preds = %4
  %20 = load ptr, ptr @gfl_conn, align 8, !tbaa !5
  %21 = sext i32 %12 to i64
  %22 = getelementptr inbounds %struct._FlConn, ptr %20, i64 %21
  %23 = getelementptr inbounds i8, ptr %22, i64 112
  %24 = load ptr, ptr %23, align 8, !tbaa !16
  %25 = sext i32 %1 to i64
  %26 = getelementptr inbounds i8, ptr %24, i64 %25
  %27 = load i8, ptr %26, align 1, !tbaa !18
  %.not = icmp eq i8 %27, 0
  br i1 %.not, label %38, label %28

28:                                               ; preds = %19
  %29 = getelementptr inbounds i8, ptr %22, i64 120
  %30 = load ptr, ptr %29, align 8, !tbaa !19
  %31 = getelementptr inbounds float, ptr %30, i64 %25
  %32 = load float, ptr %31, align 4, !tbaa !15
  %33 = getelementptr inbounds i8, ptr %7, i64 160
  %34 = load ptr, ptr %33, align 8, !tbaa !14
  %35 = getelementptr inbounds float, ptr %34, i64 %10
  %36 = load float, ptr %35, align 4, !tbaa !15
  %37 = fadd float %32, %36
  br label %.sink.split

.sink.split:                                      ; preds = %14, %28
  %.sink = phi float [ %37, %28 ], [ %18, %14 ]
  store float %.sink, ptr %3, align 4, !tbaa !15
  br label %38

38:                                               ; preds = %.sink.split, %19
  %.0 = phi i8 [ 0, %19 ], [ 1, %.sink.split ]
  ret i8 %.0
}

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass