; LLVM IR from FSmallenburg/EDMD :: Grow (mdgrow)

; 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.sparticle = type { double, double, double, double, double, double, double, double, double, double, [24 x ptr], i8, double, double, double, double, i8, i8, i8, i8, i32, i32, i32, ptr, i32, ptr, ptr, i32, i8 }

@celllist = external dso_local global [75 x [75 x [75 x ptr]]], align 16

; Function Attrs: nounwind uwtable
define dso_local void @removefromcelllist(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds %struct.sparticle, ptr %3, i32 0, i32 25
  %5 = load ptr, ptr %4, align 8, !tbaa !9
  %6 = icmp ne ptr %5, null
  br i1 %6, label %7, label %15

7:                                                ; preds = %1
  %8 = load ptr, ptr %2, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.sparticle, ptr %8, i32 0, i32 26
  %10 = load ptr, ptr %9, align 8, !tbaa !13
  %11 = load ptr, ptr %2, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.sparticle, ptr %11, i32 0, i32 25
  %13 = load ptr, ptr %12, align 8, !tbaa !9
  %14 = getelementptr inbounds %struct.sparticle, ptr %13, i32 0, i32 26
  store ptr %10, ptr %14, align 8, !tbaa !13
  br label %34

15:                                               ; preds = %1
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.sparticle, ptr %16, i32 0, i32 26
  %18 = load ptr, ptr %17, align 8, !tbaa !13
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.sparticle, ptr %19, i32 0, i32 17
  %21 = load i8, ptr %20, align 1, !tbaa !14
  %22 = zext i8 %21 to i64
  %23 = getelementptr inbounds [75 x [75 x [75 x ptr]]], ptr @celllist, i64 0, i64 %22
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.sparticle, ptr %24, i32 0, i32 18
  %26 = load i8, ptr %25, align 2, !tbaa !15
  %27 = zext i8 %26 to i64
  %28 = getelementptr inbounds [75 x [75 x ptr]], ptr %23, i64 0, i64 %27
  %29 = load ptr, ptr %2, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.sparticle, ptr %29, i32 0, i32 19
  %31 = load i8, ptr %30, align 1, !tbaa !16
  %32 = zext i8 %31 to i64
  %33 = getelementptr inbounds [75 x ptr], ptr %28, i64 0, i64 %32
  store ptr %18, ptr %33, align 8, !tbaa !5
  br label %34

34:                                               ; preds = %15, %7
  %35 = load ptr, ptr %2, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.sparticle, ptr %35, i32 0, i32 26
  %37 = load ptr, ptr %36, align 8, !tbaa !13
  %38 = icmp ne ptr %37, null
  br i1 %38, label %39, label %47

39:                                               ; preds = %34
  %40 = load ptr, ptr %2, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.sparticle, ptr %40, i32 0, i32 25
  %42 = load ptr, ptr %41, align 8, !tbaa !9
  %43 = load ptr, ptr %2, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.sparticle, ptr %43, i32 0, i32 26
  %45 = load ptr, ptr %44, align 8, !tbaa !13
  %46 = getelementptr inbounds %struct.sparticle, ptr %45, i32 0, i32 25
  store ptr %42, ptr %46, align 8, !tbaa !9
  br label %47

47:                                               ; preds = %39, %34
  ret void
}

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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 344}
!10 = !{!"sparticle", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !7, i64 80, !7, i64 272, !11, i64 280, !11, i64 288, !11, i64 296, !11, i64 304, !7, i64 312, !7, i64 313, !7, i64 314, !7, i64 315, !12, i64 316, !12, i64 320, !12, i64 324, !6, i64 328, !12, i64 336, !6, i64 344, !6, i64 352, !12, i64 360, !7, i64 364}
!11 = !{!"double", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!10, !6, i64 352}
!14 = !{!10, !7, i64 313}
!15 = !{!10, !7, i64 314}
!16 = !{!10, !7, i64 315}


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

@celllist = external dso_local local_unnamed_addr global [75 x [75 x [75 x ptr]]], align 16

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local void @removefromcelllist(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 344
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %.not = icmp eq ptr %3, null
  %4 = getelementptr inbounds i8, ptr %0, i64 352
  %5 = load ptr, ptr %4, align 8, !tbaa !12
  br i1 %.not, label %8, label %6

6:                                                ; preds = %1
  %7 = getelementptr inbounds i8, ptr %3, i64 352
  br label %19

8:                                                ; preds = %1
  %9 = getelementptr inbounds i8, ptr %0, i64 313
  %10 = load i8, ptr %9, align 1, !tbaa !13
  %11 = zext i8 %10 to i64
  %12 = getelementptr inbounds i8, ptr %0, i64 314
  %13 = load i8, ptr %12, align 2, !tbaa !14
  %14 = zext i8 %13 to i64
  %15 = getelementptr inbounds i8, ptr %0, i64 315
  %16 = load i8, ptr %15, align 1, !tbaa !15
  %17 = zext i8 %16 to i64
  %18 = getelementptr inbounds [75 x [75 x [75 x ptr]]], ptr @celllist, i64 0, i64 %11, i64 %14, i64 %17
  br label %19

19:                                               ; preds = %8, %6
  %.sink = phi ptr [ %18, %8 ], [ %7, %6 ]
  store ptr %5, ptr %.sink, align 8, !tbaa !16
  %.not11 = icmp eq ptr %5, null
  br i1 %.not11, label %23, label %20

20:                                               ; preds = %19
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %5, i64 344
  store ptr %21, ptr %22, align 8, !tbaa !5
  br label %23

23:                                               ; preds = %20, %19
  ret void
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, 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, !11, i64 344}
!6 = !{!"sparticle", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !8, i64 80, !8, i64 272, !7, i64 280, !7, i64 288, !7, i64 296, !7, i64 304, !8, i64 312, !8, i64 313, !8, i64 314, !8, i64 315, !10, i64 316, !10, i64 320, !10, i64 324, !11, i64 328, !10, i64 336, !11, i64 344, !11, i64 352, !10, i64 360, !8, i64 364}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!6, !11, i64 352}
!13 = !{!6, !8, i64 313}
!14 = !{!6, !8, i64 314}
!15 = !{!6, !8, i64 315}
!16 = !{!11, !11, i64 0}


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