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

; 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._NormEffect = type { i32, [15 x i32], [15 x i32], ptr, i32, ptr, i32, ptr, i32, ptr, ptr, ptr, i32, ptr, ptr, ptr, i32, ptr, ptr }

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

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @free_ExpNode(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @free_single_NormEffect(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  %4 = load ptr, ptr %2, align 8, !tbaa !5
  %5 = icmp ne ptr %4, null
  br i1 %5, label %6, label %132

6:                                                ; preds = %1
  %7 = load ptr, ptr %2, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct._NormEffect, ptr %7, i32 0, i32 3
  %9 = load ptr, ptr %8, align 8, !tbaa !9
  %10 = icmp ne ptr %9, null
  br i1 %10, label %11, label %15

11:                                               ; preds = %6
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct._NormEffect, ptr %12, i32 0, i32 3
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  call void @free(ptr noundef %14) #3
  br label %15

15:                                               ; preds = %11, %6
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct._NormEffect, ptr %16, i32 0, i32 5
  %18 = load ptr, ptr %17, align 8, !tbaa !12
  %19 = icmp ne ptr %18, null
  br i1 %19, label %20, label %24

20:                                               ; preds = %15
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct._NormEffect, ptr %21, i32 0, i32 5
  %23 = load ptr, ptr %22, align 8, !tbaa !12
  call void @free(ptr noundef %23) #3
  br label %24

24:                                               ; preds = %20, %15
  %25 = load ptr, ptr %2, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct._NormEffect, ptr %25, i32 0, i32 7
  %27 = load ptr, ptr %26, align 8, !tbaa !13
  %28 = icmp ne ptr %27, null
  br i1 %28, label %29, label %33

29:                                               ; preds = %24
  %30 = load ptr, ptr %2, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct._NormEffect, ptr %30, i32 0, i32 7
  %32 = load ptr, ptr %31, align 8, !tbaa !13
  call void @free(ptr noundef %32) #3
  br label %33

33:                                               ; preds = %29, %24
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct._NormEffect, ptr %34, i32 0, i32 9
  %36 = load ptr, ptr %35, align 8, !tbaa !14
  %37 = icmp ne ptr %36, null
  br i1 %37, label %38, label %42

38:                                               ; preds = %33
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct._NormEffect, ptr %39, i32 0, i32 9
  %41 = load ptr, ptr %40, align 8, !tbaa !14
  call void @free(ptr noundef %41) #3
  br label %42

42:                                               ; preds = %38, %33
  store i32 0, ptr %3, align 4, !tbaa !15
  br label %43

43:                                               ; preds = %64, %42
  %44 = load i32, ptr %3, align 4, !tbaa !15
  %45 = load ptr, ptr %2, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct._NormEffect, ptr %45, i32 0, i32 12
  %47 = load i32, ptr %46, align 8, !tbaa !16
  %48 = icmp slt i32 %44, %47
  br i1 %48, label %49, label %67

49:                                               ; preds = %43
  %50 = load ptr, ptr %2, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct._NormEffect, ptr %50, i32 0, i32 10
  %52 = load ptr, ptr %51, align 8, !tbaa !17
  %53 = load i32, ptr %3, align 4, !tbaa !15
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds ptr, ptr %52, i64 %54
  %56 = load ptr, ptr %55, align 8, !tbaa !5
  call void @free_ExpNode(ptr noundef %56)
  %57 = load ptr, ptr %2, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct._NormEffect, ptr %57, i32 0, i32 11
  %59 = load ptr, ptr %58, align 8, !tbaa !18
  %60 = load i32, ptr %3, align 4, !tbaa !15
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds ptr, ptr %59, i64 %61
  %63 = load ptr, ptr %62, align 8, !tbaa !5
  call void @free_ExpNode(ptr noundef %63)
  br label %64

64:                                               ; preds = %49
  %65 = load i32, ptr %3, align 4, !tbaa !15
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %3, align 4, !tbaa !15
  br label %43, !llvm.loop !19

67:                                               ; preds = %43
  %68 = load ptr, ptr %2, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct._NormEffect, ptr %68, i32 0, i32 10
  %70 = load ptr, ptr %69, align 8, !tbaa !17
  %71 = icmp ne ptr %70, null
  br i1 %71, label %72, label %76

72:                                               ; preds = %67
  %73 = load ptr, ptr %2, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct._NormEffect, ptr %73, i32 0, i32 10
  %75 = load ptr, ptr %74, align 8, !tbaa !17
  call void @free(ptr noundef %75) #3
  br label %76

76:                                               ; preds = %72, %67
  %77 = load ptr, ptr %2, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct._NormEffect, ptr %77, i32 0, i32 11
  %79 = load ptr, ptr %78, align 8, !tbaa !18
  %80 = icmp ne ptr %79, null
  br i1 %80, label %81, label %85

81:                                               ; preds = %76
  %82 = load ptr, ptr %2, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct._NormEffect, ptr %82, i32 0, i32 11
  %84 = load ptr, ptr %83, align 8, !tbaa !18
  call void @free(ptr noundef %84) #3
  br label %85

85:                                               ; preds = %81, %76
  %86 = load ptr, ptr %2, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct._NormEffect, ptr %86, i32 0, i32 13
  %88 = load ptr, ptr %87, align 8, !tbaa !21
  %89 = icmp ne ptr %88, null
  br i1 %89, label %90, label %94

90:                                               ; preds = %85
  %91 = load ptr, ptr %2, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct._NormEffect, ptr %91, i32 0, i32 13
  %93 = load ptr, ptr %92, align 8, !tbaa !21
  call void @free(ptr noundef %93) #3
  br label %94

94:                                               ; preds = %90, %85
  %95 = load ptr, ptr %2, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct._NormEffect, ptr %95, i32 0, i32 14
  %97 = load ptr, ptr %96, align 8, !tbaa !22
  %98 = icmp ne ptr %97, null
  br i1 %98, label %99, label %103

99:                                               ; preds = %94
  %100 = load ptr, ptr %2, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct._NormEffect, ptr %100, i32 0, i32 14
  %102 = load ptr, ptr %101, align 8, !tbaa !22
  call void @free(ptr noundef %102) #3
  br label %103

103:                                              ; preds = %99, %94
  store i32 0, ptr %3, align 4, !tbaa !15
  br label %104

104:                                              ; preds = %118, %103
  %105 = load i32, ptr %3, align 4, !tbaa !15
  %106 = load ptr, ptr %2, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct._NormEffect, ptr %106, i32 0, i32 16
  %108 = load i32, ptr %107, align 8, !tbaa !23
  %109 = icmp slt i32 %105, %108
  br i1 %109, label %110, label %121

110:                                              ; preds = %104
  %111 = load ptr, ptr %2, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct._NormEffect, ptr %111, i32 0, i32 15
  %113 = load ptr, ptr %112, align 8, !tbaa !24
  %114 = load i32, ptr %3, align 4, !tbaa !15
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds ptr, ptr %113, i64 %115
  %117 = load ptr, ptr %116, align 8, !tbaa !5
  call void @free_ExpNode(ptr noundef %117)
  br label %118

118:                                              ; preds = %110
  %119 = load i32, ptr %3, align 4, !tbaa !15
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %3, align 4, !tbaa !15
  br label %104, !llvm.loop !25

121:                                              ; preds = %104
  %122 = load ptr, ptr %2, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct._NormEffect, ptr %122, i32 0, i32 15
  %124 = load ptr, ptr %123, align 8, !tbaa !24
  %125 = icmp ne ptr %124, null
  br i1 %125, label %126, label %130

126:                                              ; preds = %121
  %127 = load ptr, ptr %2, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct._NormEffect, ptr %127, i32 0, i32 15
  %129 = load ptr, ptr %128, align 8, !tbaa !24
  call void @free(ptr noundef %129) #3
  br label %130

130:                                              ; preds = %126, %121
  %131 = load ptr, ptr %2, align 8, !tbaa !5
  call void @free(ptr noundef %131) #3
  br label %132

132:                                              ; preds = %130, %1
  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 = { 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 = { 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, !6, i64 128}
!10 = !{!"_NormEffect", !11, i64 0, !7, i64 4, !7, i64 64, !6, i64 128, !11, i64 136, !6, i64 144, !11, i64 152, !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, !6, i64 248}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 144}
!13 = !{!10, !6, i64 160}
!14 = !{!10, !6, i64 176}
!15 = !{!11, !11, i64 0}
!16 = !{!10, !11, i64 200}
!17 = !{!10, !6, i64 184}
!18 = !{!10, !6, i64 192}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!10, !6, i64 208}
!22 = !{!10, !6, i64 216}
!23 = !{!10, !11, i64 232}
!24 = !{!10, !6, i64 224}
!25 = distinct !{!25, !20}


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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @free_ExpNode(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @free_single_NormEffect(ptr noundef %0) local_unnamed_addr #1 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %65, label %2

2:                                                ; preds = %1
  %3 = getelementptr inbounds i8, ptr %0, i64 128
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %.not41 = icmp eq ptr %4, null
  br i1 %.not41, label %6, label %5

5:                                                ; preds = %2
  tail call void @free(ptr noundef nonnull %4) #2
  br label %6

6:                                                ; preds = %5, %2
  %7 = getelementptr inbounds i8, ptr %0, i64 144
  %8 = load ptr, ptr %7, align 8, !tbaa !11
  %.not42 = icmp eq ptr %8, null
  br i1 %.not42, label %10, label %9

9:                                                ; preds = %6
  tail call void @free(ptr noundef nonnull %8) #2
  br label %10

10:                                               ; preds = %9, %6
  %11 = getelementptr inbounds i8, ptr %0, i64 160
  %12 = load ptr, ptr %11, align 8, !tbaa !12
  %.not43 = icmp eq ptr %12, null
  br i1 %.not43, label %14, label %13

13:                                               ; preds = %10
  tail call void @free(ptr noundef nonnull %12) #2
  br label %14

14:                                               ; preds = %13, %10
  %15 = getelementptr inbounds i8, ptr %0, i64 176
  %16 = load ptr, ptr %15, align 8, !tbaa !13
  %.not44 = icmp eq ptr %16, null
  br i1 %.not44, label %18, label %17

17:                                               ; preds = %14
  tail call void @free(ptr noundef nonnull %16) #2
  br label %18

18:                                               ; preds = %17, %14
  %19 = getelementptr inbounds i8, ptr %0, i64 200
  %20 = load i32, ptr %19, align 8, !tbaa !14
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %18
  %22 = getelementptr inbounds i8, ptr %0, i64 184
  %23 = getelementptr inbounds i8, ptr %0, i64 192
  br label %24

24:                                               ; preds = %.lr.ph, %24
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %24 ]
  %25 = load ptr, ptr %22, align 8, !tbaa !15
  %26 = getelementptr inbounds ptr, ptr %25, i64 %indvars.iv
  %27 = load ptr, ptr %26, align 8, !tbaa !16
  tail call void @free_ExpNode(ptr noundef %27)
  %28 = load ptr, ptr %23, align 8, !tbaa !17
  %29 = getelementptr inbounds ptr, ptr %28, i64 %indvars.iv
  %30 = load ptr, ptr %29, align 8, !tbaa !16
  tail call void @free_ExpNode(ptr noundef %30)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %31 = load i32, ptr %19, align 8, !tbaa !14
  %32 = sext i32 %31 to i64
  %33 = icmp slt i64 %indvars.iv.next, %32
  br i1 %33, label %24, label %._crit_edge, !llvm.loop !18

._crit_edge:                                      ; preds = %24, %18
  %34 = getelementptr inbounds i8, ptr %0, i64 184
  %35 = load ptr, ptr %34, align 8, !tbaa !15
  %.not45 = icmp eq ptr %35, null
  br i1 %.not45, label %37, label %36

36:                                               ; preds = %._crit_edge
  tail call void @free(ptr noundef nonnull %35) #2
  br label %37

37:                                               ; preds = %36, %._crit_edge
  %38 = getelementptr inbounds i8, ptr %0, i64 192
  %39 = load ptr, ptr %38, align 8, !tbaa !17
  %.not46 = icmp eq ptr %39, null
  br i1 %.not46, label %41, label %40

40:                                               ; preds = %37
  tail call void @free(ptr noundef nonnull %39) #2
  br label %41

41:                                               ; preds = %40, %37
  %42 = getelementptr inbounds i8, ptr %0, i64 208
  %43 = load ptr, ptr %42, align 8, !tbaa !20
  %.not47 = icmp eq ptr %43, null
  br i1 %.not47, label %45, label %44

44:                                               ; preds = %41
  tail call void @free(ptr noundef nonnull %43) #2
  br label %45

45:                                               ; preds = %44, %41
  %46 = getelementptr inbounds i8, ptr %0, i64 216
  %47 = load ptr, ptr %46, align 8, !tbaa !21
  %.not48 = icmp eq ptr %47, null
  br i1 %.not48, label %49, label %48

48:                                               ; preds = %45
  tail call void @free(ptr noundef nonnull %47) #2
  br label %49

49:                                               ; preds = %48, %45
  %50 = getelementptr inbounds i8, ptr %0, i64 232
  %51 = load i32, ptr %50, align 8, !tbaa !22
  %52 = icmp sgt i32 %51, 0
  br i1 %52, label %.lr.ph53, label %._crit_edge54

.lr.ph53:                                         ; preds = %49
  %53 = getelementptr inbounds i8, ptr %0, i64 224
  br label %54

54:                                               ; preds = %.lr.ph53, %54
  %indvars.iv56 = phi i64 [ 0, %.lr.ph53 ], [ %indvars.iv.next57, %54 ]
  %55 = load ptr, ptr %53, align 8, !tbaa !23
  %56 = getelementptr inbounds ptr, ptr %55, i64 %indvars.iv56
  %57 = load ptr, ptr %56, align 8, !tbaa !16
  tail call void @free_ExpNode(ptr noundef %57)
  %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
  %58 = load i32, ptr %50, align 8, !tbaa !22
  %59 = sext i32 %58 to i64
  %60 = icmp slt i64 %indvars.iv.next57, %59
  br i1 %60, label %54, label %._crit_edge54, !llvm.loop !24

._crit_edge54:                                    ; preds = %54, %49
  %61 = getelementptr inbounds i8, ptr %0, i64 224
  %62 = load ptr, ptr %61, align 8, !tbaa !23
  %.not49 = icmp eq ptr %62, null
  br i1 %.not49, label %64, label %63

63:                                               ; preds = %._crit_edge54
  tail call void @free(ptr noundef nonnull %62) #2
  br label %64

64:                                               ; preds = %63, %._crit_edge54
  tail call void @free(ptr noundef nonnull %0) #2
  br label %65

65:                                               ; preds = %64, %1
  ret void
}

attributes #0 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, 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 #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 = { 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, !10, i64 128}
!6 = !{!"_NormEffect", !7, i64 0, !8, i64 4, !8, i64 64, !10, i64 128, !7, i64 136, !10, i64 144, !7, i64 152, !10, i64 160, !7, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !7, i64 200, !10, i64 208, !10, i64 216, !10, i64 224, !7, i64 232, !10, i64 240, !10, i64 248}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !10, i64 144}
!12 = !{!6, !10, i64 160}
!13 = !{!6, !10, i64 176}
!14 = !{!6, !7, i64 200}
!15 = !{!6, !10, i64 184}
!16 = !{!10, !10, i64 0}
!17 = !{!6, !10, i64 192}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!6, !10, i64 208}
!21 = !{!6, !10, i64 216}
!22 = !{!6, !7, i64 232}
!23 = !{!6, !10, i64 224}
!24 = distinct !{!24, !19}


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