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

@shellsize = external dso_local global double, 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

; Function Attrs: nounwind
declare double @sqrt(double noundef) #2

; Function Attrs: nounwind uwtable
define dso_local double @findneighborlistupdate(ptr noundef %0) #3 {
  %2 = alloca ptr, align 8
  %3 = alloca double, align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.sparticle, ptr %15, i32 0, i32 0
  %17 = load double, ptr %16, align 8, !tbaa !9
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.sparticle, ptr %18, i32 0, i32 6
  %20 = load double, ptr %19, align 8, !tbaa !13
  %21 = fsub double %17, %20
  store double %21, ptr %3, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.sparticle, ptr %22, i32 0, i32 1
  %24 = load double, ptr %23, align 8, !tbaa !15
  %25 = load ptr, ptr %2, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.sparticle, ptr %25, i32 0, i32 7
  %27 = load double, ptr %26, align 8, !tbaa !16
  %28 = fsub double %24, %27
  store double %28, ptr %4, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %29 = load ptr, ptr %2, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.sparticle, ptr %29, i32 0, i32 2
  %31 = load double, ptr %30, align 8, !tbaa !17
  %32 = load ptr, ptr %2, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.sparticle, ptr %32, i32 0, i32 8
  %34 = load double, ptr %33, align 8, !tbaa !18
  %35 = fsub double %31, %34
  store double %35, ptr %5, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %36 = load ptr, ptr %2, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.sparticle, ptr %36, i32 0, i32 3
  %38 = load double, ptr %37, align 8, !tbaa !19
  store double %38, ptr %6, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.sparticle, ptr %39, i32 0, i32 4
  %41 = load double, ptr %40, align 8, !tbaa !20
  store double %41, ptr %7, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %42 = load ptr, ptr %2, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.sparticle, ptr %42, i32 0, i32 5
  %44 = load double, ptr %43, align 8, !tbaa !21
  store double %44, ptr %8, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %45 = load double, ptr %3, align 8, !tbaa !14
  %46 = load double, ptr %6, align 8, !tbaa !14
  %47 = load double, ptr %4, align 8, !tbaa !14
  %48 = load double, ptr %7, align 8, !tbaa !14
  %49 = fmul double %47, %48
  %50 = call double @llvm.fmuladd.f64(double %45, double %46, double %49)
  %51 = load double, ptr %5, align 8, !tbaa !14
  %52 = load double, ptr %8, align 8, !tbaa !14
  %53 = call double @llvm.fmuladd.f64(double %51, double %52, double %50)
  store double %53, ptr %9, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %54 = load double, ptr %6, align 8, !tbaa !14
  %55 = load double, ptr %6, align 8, !tbaa !14
  %56 = load double, ptr %7, align 8, !tbaa !14
  %57 = load double, ptr %7, align 8, !tbaa !14
  %58 = fmul double %56, %57
  %59 = call double @llvm.fmuladd.f64(double %54, double %55, double %58)
  %60 = load double, ptr %8, align 8, !tbaa !14
  %61 = load double, ptr %8, align 8, !tbaa !14
  %62 = call double @llvm.fmuladd.f64(double %60, double %61, double %59)
  store double %62, ptr %10, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %63 = load double, ptr %3, align 8, !tbaa !14
  %64 = load double, ptr %3, align 8, !tbaa !14
  %65 = load double, ptr %4, align 8, !tbaa !14
  %66 = load double, ptr %4, align 8, !tbaa !14
  %67 = fmul double %65, %66
  %68 = call double @llvm.fmuladd.f64(double %63, double %64, double %67)
  %69 = load double, ptr %5, align 8, !tbaa !14
  %70 = load double, ptr %5, align 8, !tbaa !14
  %71 = call double @llvm.fmuladd.f64(double %69, double %70, double %68)
  store double %71, ptr %11, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %72 = load double, ptr @shellsize, align 8, !tbaa !14
  %73 = fsub double %72, 1.000000e+00
  %74 = load ptr, ptr %2, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.sparticle, ptr %74, i32 0, i32 14
  %76 = load double, ptr %75, align 8, !tbaa !22
  %77 = fmul double %73, %76
  store double %77, ptr %12, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %78 = load double, ptr %9, align 8, !tbaa !14
  %79 = load double, ptr %9, align 8, !tbaa !14
  %80 = load double, ptr %10, align 8, !tbaa !14
  %81 = load double, ptr %11, align 8, !tbaa !14
  %82 = load double, ptr %12, align 8, !tbaa !14
  %83 = load double, ptr %12, align 8, !tbaa !14
  %84 = fneg double %82
  %85 = call double @llvm.fmuladd.f64(double %84, double %83, double %81)
  %86 = fmul double %80, %85
  %87 = fneg double %86
  %88 = call double @llvm.fmuladd.f64(double %78, double %79, double %87)
  store double %88, ptr %13, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %89 = load double, ptr %9, align 8, !tbaa !14
  %90 = fneg double %89
  %91 = load double, ptr %13, align 8, !tbaa !14
  %92 = call double @sqrt(double noundef %91) #4
  %93 = fadd double %90, %92
  %94 = load double, ptr %10, align 8, !tbaa !14
  %95 = fdiv double %93, %94
  store double %95, ptr %14, align 8, !tbaa !14
  %96 = load double, ptr %14, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  ret double %96
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 #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 }

!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 = !{!"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, !11, i64 48}
!14 = !{!11, !11, i64 0}
!15 = !{!10, !11, i64 8}
!16 = !{!10, !11, i64 56}
!17 = !{!10, !11, i64 16}
!18 = !{!10, !11, i64 64}
!19 = !{!10, !11, i64 24}
!20 = !{!10, !11, i64 32}
!21 = !{!10, !11, i64 40}
!22 = !{!10, !11, i64 296}


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

@shellsize = external dso_local local_unnamed_addr global double, align 8

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(readwrite, inaccessiblemem: write) uwtable
define dso_local double @findneighborlistupdate(ptr nocapture noundef readonly %0) local_unnamed_addr #2 {
  %2 = load double, ptr %0, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 48
  %4 = load double, ptr %3, align 8, !tbaa !12
  %5 = fsub double %2, %4
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = load double, ptr %6, align 8, !tbaa !13
  %8 = getelementptr inbounds i8, ptr %0, i64 56
  %9 = load double, ptr %8, align 8, !tbaa !14
  %10 = fsub double %7, %9
  %11 = getelementptr inbounds i8, ptr %0, i64 16
  %12 = load double, ptr %11, align 8, !tbaa !15
  %13 = getelementptr inbounds i8, ptr %0, i64 64
  %14 = load double, ptr %13, align 8, !tbaa !16
  %15 = fsub double %12, %14
  %16 = getelementptr inbounds i8, ptr %0, i64 24
  %17 = load double, ptr %16, align 8, !tbaa !17
  %18 = getelementptr inbounds i8, ptr %0, i64 32
  %19 = load double, ptr %18, align 8, !tbaa !18
  %20 = getelementptr inbounds i8, ptr %0, i64 40
  %21 = load double, ptr %20, align 8, !tbaa !19
  %22 = fmul double %10, %19
  %23 = tail call double @llvm.fmuladd.f64(double %5, double %17, double %22)
  %24 = tail call double @llvm.fmuladd.f64(double %15, double %21, double %23)
  %25 = fmul double %19, %19
  %26 = tail call double @llvm.fmuladd.f64(double %17, double %17, double %25)
  %27 = tail call double @llvm.fmuladd.f64(double %21, double %21, double %26)
  %28 = fmul double %10, %10
  %29 = tail call double @llvm.fmuladd.f64(double %5, double %5, double %28)
  %30 = tail call double @llvm.fmuladd.f64(double %15, double %15, double %29)
  %31 = load double, ptr @shellsize, align 8, !tbaa !20
  %32 = fadd double %31, -1.000000e+00
  %33 = getelementptr inbounds i8, ptr %0, i64 296
  %34 = load double, ptr %33, align 8, !tbaa !21
  %35 = fmul double %32, %34
  %36 = fneg double %35
  %37 = tail call double @llvm.fmuladd.f64(double %36, double %35, double %30)
  %38 = fneg double %27
  %39 = fmul double %37, %38
  %40 = tail call double @llvm.fmuladd.f64(double %24, double %24, double %39)
  %41 = tail call double @sqrt(double noundef %40) #3
  %42 = fsub double %41, %24
  %43 = fdiv double %42, %27
  ret double %43
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { mustprogress nofree nounwind willreturn memory(write) "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 = { mustprogress nofree nounwind willreturn memory(readwrite, inaccessiblemem: write) 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, !7, i64 0}
!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, !7, i64 48}
!13 = !{!6, !7, i64 8}
!14 = !{!6, !7, i64 56}
!15 = !{!6, !7, i64 16}
!16 = !{!6, !7, i64 64}
!17 = !{!6, !7, i64 24}
!18 = !{!6, !7, i64 32}
!19 = !{!6, !7, i64 40}
!20 = !{!7, !7, i64 0}
!21 = !{!6, !7, i64 296}


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