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

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

@.str.29 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [42 x i8], align 1

declare i32 @printf(ptr noundef, ...) #0

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

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

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i8 @translate_divisions(ptr noundef %0) #3 {
  %2 = alloca i8, align 1
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %6 = load ptr, ptr %3, align 8, !tbaa !5
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct._ExpNode, ptr %7, i32 0, i32 0
  %9 = load i32, ptr %8, align 8, !tbaa !9
  switch i32 %9, label %121 [
    i32 1006, label %10
    i32 1005, label %58
    i32 1003, label %97
    i32 1004, label %97
    i32 1002, label %112
    i32 1001, label %120
    i32 1000, label %120
  ]

10:                                               ; preds = %1
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct._ExpNode, ptr %12, i32 0, i32 7
  %14 = load ptr, ptr %13, align 8, !tbaa !13
  %15 = getelementptr inbounds %struct._ExpNode, ptr %14, i32 0, i32 4
  %16 = load float, ptr %15, align 8, !tbaa !14
  %17 = fcmp oeq float %16, 0.000000e+00
  br i1 %17, label %18, label %20

18:                                               ; preds = %10
  %19 = call i32 (ptr, ...) @printf(ptr noundef @.str.29)
  store i8 0, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %128

20:                                               ; preds = %10
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = load ptr, ptr %21, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct._ExpNode, ptr %22, i32 0, i32 6
  %24 = call zeroext i8 @translate_divisions(ptr noundef %23)
  %25 = icmp ne i8 %24, 0
  br i1 %25, label %27, label %26

26:                                               ; preds = %20
  store i8 0, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %128

27:                                               ; preds = %20
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = load ptr, ptr %28, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct._ExpNode, ptr %29, i32 0, i32 0
  store i32 1005, ptr %30, align 8, !tbaa !9
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = load ptr, ptr %31, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._ExpNode, ptr %32, i32 0, i32 7
  %34 = load ptr, ptr %33, align 8, !tbaa !13
  %35 = getelementptr inbounds %struct._ExpNode, ptr %34, i32 0, i32 4
  %36 = load float, ptr %35, align 8, !tbaa !14
  %37 = fdiv float 1.000000e+00, %36
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = load ptr, ptr %38, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct._ExpNode, ptr %39, i32 0, i32 7
  %41 = load ptr, ptr %40, align 8, !tbaa !13
  %42 = getelementptr inbounds %struct._ExpNode, ptr %41, i32 0, i32 4
  store float %37, ptr %42, align 8, !tbaa !14
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = load ptr, ptr %43, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct._ExpNode, ptr %44, i32 0, i32 7
  %46 = load ptr, ptr %45, align 8, !tbaa !13
  store ptr %46, ptr %4, align 8, !tbaa !5
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = load ptr, ptr %47, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct._ExpNode, ptr %48, i32 0, i32 6
  %50 = load ptr, ptr %49, align 8, !tbaa !15
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = load ptr, ptr %51, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct._ExpNode, ptr %52, i32 0, i32 7
  store ptr %50, ptr %53, align 8, !tbaa !13
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = load ptr, ptr %55, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct._ExpNode, ptr %56, i32 0, i32 6
  store ptr %54, ptr %57, align 8, !tbaa !15
  br label %127

58:                                               ; preds = %1
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct._ExpNode, ptr %60, i32 0, i32 6
  %62 = call zeroext i8 @translate_divisions(ptr noundef %61)
  %63 = icmp ne i8 %62, 0
  br i1 %63, label %65, label %64

64:                                               ; preds = %58
  store i8 0, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %128

65:                                               ; preds = %58
  %66 = load ptr, ptr %3, align 8, !tbaa !5
  %67 = load ptr, ptr %66, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._ExpNode, ptr %67, i32 0, i32 7
  %69 = call zeroext i8 @translate_divisions(ptr noundef %68)
  %70 = icmp ne i8 %69, 0
  br i1 %70, label %72, label %71

71:                                               ; preds = %65
  store i8 0, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %128

72:                                               ; preds = %65
  %73 = load ptr, ptr %3, align 8, !tbaa !5
  %74 = load ptr, ptr %73, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct._ExpNode, ptr %74, i32 0, i32 7
  %76 = load ptr, ptr %75, align 8, !tbaa !13
  %77 = getelementptr inbounds %struct._ExpNode, ptr %76, i32 0, i32 0
  %78 = load i32, ptr %77, align 8, !tbaa !9
  %79 = icmp eq i32 %78, 1001
  br i1 %79, label %80, label %96

80:                                               ; preds = %72
  %81 = load ptr, ptr %3, align 8, !tbaa !5
  %82 = load ptr, ptr %81, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct._ExpNode, ptr %82, i32 0, i32 7
  %84 = load ptr, ptr %83, align 8, !tbaa !13
  store ptr %84, ptr %4, align 8, !tbaa !5
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = load ptr, ptr %85, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct._ExpNode, ptr %86, i32 0, i32 6
  %88 = load ptr, ptr %87, align 8, !tbaa !15
  %89 = load ptr, ptr %3, align 8, !tbaa !5
  %90 = load ptr, ptr %89, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct._ExpNode, ptr %90, i32 0, i32 7
  store ptr %88, ptr %91, align 8, !tbaa !13
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = load ptr, ptr %3, align 8, !tbaa !5
  %94 = load ptr, ptr %93, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct._ExpNode, ptr %94, i32 0, i32 6
  store ptr %92, ptr %95, align 8, !tbaa !15
  br label %96

96:                                               ; preds = %80, %72
  br label %127

97:                                               ; preds = %1, %1
  %98 = load ptr, ptr %3, align 8, !tbaa !5
  %99 = load ptr, ptr %98, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct._ExpNode, ptr %99, i32 0, i32 6
  %101 = call zeroext i8 @translate_divisions(ptr noundef %100)
  %102 = icmp ne i8 %101, 0
  br i1 %102, label %104, label %103

103:                                              ; preds = %97
  store i8 0, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %128

104:                                              ; preds = %97
  %105 = load ptr, ptr %3, align 8, !tbaa !5
  %106 = load ptr, ptr %105, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct._ExpNode, ptr %106, i32 0, i32 7
  %108 = call zeroext i8 @translate_divisions(ptr noundef %107)
  %109 = icmp ne i8 %108, 0
  br i1 %109, label %111, label %110

110:                                              ; preds = %104
  store i8 0, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %128

111:                                              ; preds = %104
  br label %127

112:                                              ; preds = %1
  %113 = load ptr, ptr %3, align 8, !tbaa !5
  %114 = load ptr, ptr %113, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct._ExpNode, ptr %114, i32 0, i32 5
  %116 = call zeroext i8 @translate_divisions(ptr noundef %115)
  %117 = icmp ne i8 %116, 0
  br i1 %117, label %119, label %118

118:                                              ; preds = %112
  store i8 0, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %128

119:                                              ; preds = %112
  br label %127

120:                                              ; preds = %1, %1
  br label %127

121:                                              ; preds = %1
  %122 = load ptr, ptr %3, align 8, !tbaa !5
  %123 = load ptr, ptr %122, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct._ExpNode, ptr %123, i32 0, i32 0
  %125 = load i32, ptr %124, align 8, !tbaa !9
  %126 = call i32 (ptr, ...) @printf(ptr noundef @.str.30, i32 noundef %125)
  call void @exit(i32 noundef 1) #5
  unreachable

127:                                              ; preds = %120, %119, %111, %96, %27
  store i8 1, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %128

128:                                              ; preds = %127, %118, %110, %103, %71, %64, %26, %18
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  %129 = load i8, ptr %2, align 1
  ret i8 %129
}

attributes #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 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 }
attributes #5 = { 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 = !{!10, !11, i64 0}
!10 = !{!"_ExpNode", !11, i64 0, !6, i64 8, !11, i64 16, !12, i64 20, !12, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!11 = !{!"int", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!10, !6, i64 48}
!14 = !{!10, !12, i64 24}
!15 = !{!10, !6, i64 40}


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

@.str.29 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [42 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
define dso_local zeroext range(i8 0, 2) i8 @translate_divisions(ptr nocapture noundef readonly %0) local_unnamed_addr #2 {
  %2 = load ptr, ptr %0, align 8, !tbaa !5
  %3 = load i32, ptr %2, align 8, !tbaa !9
  switch i32 %3, label %45 [
    i32 1006, label %4
    i32 1005, label %22
    i32 1003, label %35
    i32 1004, label %35
    i32 1002, label %42
    i32 1001, label %51
    i32 1000, label %51
  ]

4:                                                ; preds = %1
  %5 = getelementptr inbounds i8, ptr %2, i64 48
  %6 = load ptr, ptr %5, align 8, !tbaa !13
  %7 = getelementptr inbounds i8, ptr %6, i64 24
  %8 = load float, ptr %7, align 8, !tbaa !14
  %9 = fcmp oeq float %8, 0.000000e+00
  br i1 %9, label %10, label %12

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

12:                                               ; preds = %4
  %13 = getelementptr inbounds i8, ptr %2, i64 40
  %14 = tail call zeroext i8 @translate_divisions(ptr noundef nonnull %13)
  %.not27 = icmp eq i8 %14, 0
  br i1 %.not27, label %52, label %15

15:                                               ; preds = %12
  %16 = load ptr, ptr %0, align 8, !tbaa !5
  store i32 1005, ptr %16, align 8, !tbaa !9
  %17 = getelementptr inbounds i8, ptr %16, i64 48
  %18 = load ptr, ptr %17, align 8, !tbaa !13
  %19 = getelementptr inbounds i8, ptr %18, i64 24
  %20 = load float, ptr %19, align 8, !tbaa !14
  %21 = fdiv float 1.000000e+00, %20
  store float %21, ptr %19, align 8, !tbaa !14
  br label %.sink.split

22:                                               ; preds = %1
  %23 = getelementptr inbounds i8, ptr %2, i64 40
  %24 = tail call zeroext i8 @translate_divisions(ptr noundef nonnull %23)
  %.not25 = icmp eq i8 %24, 0
  br i1 %.not25, label %52, label %25

25:                                               ; preds = %22
  %26 = load ptr, ptr %0, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %26, i64 48
  %28 = tail call zeroext i8 @translate_divisions(ptr noundef nonnull %27)
  %.not26 = icmp eq i8 %28, 0
  br i1 %.not26, label %52, label %29

29:                                               ; preds = %25
  %30 = load ptr, ptr %0, align 8, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %30, i64 48
  %32 = load ptr, ptr %31, align 8, !tbaa !13
  %33 = load i32, ptr %32, align 8, !tbaa !9
  %34 = icmp eq i32 %33, 1001
  br i1 %34, label %.sink.split, label %51

35:                                               ; preds = %1, %1
  %36 = getelementptr inbounds i8, ptr %2, i64 40
  %37 = tail call zeroext i8 @translate_divisions(ptr noundef nonnull %36)
  %.not23 = icmp eq i8 %37, 0
  br i1 %.not23, label %52, label %38

38:                                               ; preds = %35
  %39 = load ptr, ptr %0, align 8, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %39, i64 48
  %41 = tail call zeroext i8 @translate_divisions(ptr noundef nonnull %40)
  %.not24 = icmp eq i8 %41, 0
  br i1 %.not24, label %52, label %51

42:                                               ; preds = %1
  %43 = getelementptr inbounds i8, ptr %2, i64 32
  %44 = tail call zeroext i8 @translate_divisions(ptr noundef nonnull %43)
  %.not = icmp eq i8 %44, 0
  br i1 %.not, label %52, label %51

45:                                               ; preds = %1
  %46 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.30, i32 noundef %3)
  tail call void @exit(i32 noundef 1) #3
  unreachable

.sink.split:                                      ; preds = %29, %15
  %.sink33 = phi ptr [ %16, %15 ], [ %30, %29 ]
  %.sink31 = phi ptr [ %17, %15 ], [ %31, %29 ]
  %.sink = phi ptr [ %18, %15 ], [ %32, %29 ]
  %47 = getelementptr inbounds i8, ptr %.sink33, i64 40
  %48 = load ptr, ptr %47, align 8, !tbaa !15
  store ptr %48, ptr %.sink31, align 8, !tbaa !13
  %49 = load ptr, ptr %0, align 8, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %49, i64 40
  store ptr %.sink, ptr %50, align 8, !tbaa !15
  br label %51

51:                                               ; preds = %.sink.split, %1, %1, %42, %38, %29
  br label %52

52:                                               ; preds = %42, %38, %35, %25, %22, %12, %51, %10
  %.0 = phi i8 [ 1, %51 ], [ 0, %10 ], [ 0, %12 ], [ 0, %22 ], [ 0, %25 ], [ 0, %35 ], [ 0, %38 ], [ 0, %42 ]
  ret i8 %.0
}

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 = { 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 #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 = { 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 = !{!10, !11, i64 0}
!10 = !{!"_ExpNode", !11, i64 0, !6, i64 8, !11, i64 16, !12, i64 20, !12, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!11 = !{!"int", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!10, !6, i64 48}
!14 = !{!10, !12, i64 24}
!15 = !{!10, !6, i64 40}


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