// File: /workspace/github_cpp_makefile_star2_O1/Luthaf[P]zeopp/networkstorage.cc
// Function: ATOM_NETWORK::minimizePointDistance(Point, double, double, double)
const Point ATOM_NETWORK::minimizePointDistance(Point origPoint, double dx, double dy, double dz){
    Point abc_one  = xyz_to_abc(origPoint);
    Point abc_two  = xyz_to_abc(dx, dy, dz);
    
    double minDa = DBL_MAX, minDb = DBL_MAX, minDc = DBL_MAX, best_a = DBL_MAX, best_b = DBL_MAX, best_c = DBL_MAX;
    getDistCalc().closest_periodic_image(abc_two[0], abc_two[1], abc_two[2], abc_one[0], abc_one[1], abc_one[2],
                                         minDa, minDb, minDc, best_a, best_b, best_c);
    return abc_to_xyz(best_a, best_b, best_c);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x120, %rsp            # imm = 0x120
movsd %xmm2, 0x30(%rsp)
movsd %xmm1, 0x28(%rsp)
movsd %xmm0, 0x20(%rsp)
movq %rsi, %r14
movq %rdi, %rbx
movq 0x150(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x140(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x78(%rsp), %rdi
callq 0x52082
movsd 0xd0(%r14), %xmm0
movsd 0x20(%rsp), %xmm1
mulsd 0xc8(%r14), %xmm1
movsd 0x28(%rsp), %xmm3
mulsd %xmm3, %xmm0
addsd %xmm0, %xmm1
movsd 0xd8(%r14), %xmm0
movsd 0x30(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0xf0(%r14), %xmm1
mulsd 0xe8(%r14), %xmm3
mulsd %xmm2, %xmm1
addsd %xmm1, %xmm3
movapd %xmm3, %xmm1
mulsd 0x108(%r14), %xmm2
leaq 0x90(%rsp), %r15
movq %r15, %rdi
callq 0x85436
movabsq $0x7fefffffffffffff, %rax # imm = 0x7FEFFFFFFFFFFFFF
movq %rax, 0x70(%rsp)
movq %rax, 0x68(%rsp)
movq %rax, 0x60(%rsp)
movq %rax, 0x48(%rsp)
movq %rax, 0x40(%rsp)
movq %rax, 0x38(%rsp)
leaq 0xa8(%rsp), %rdi
movq %r14, %rsi
callq 0x52aea
movq %r15, %rdi
xorl %esi, %esi
callq 0x85478
movsd (%rax), %xmm0
movsd %xmm0, 0x30(%rsp)
leaq 0x90(%rsp), %rdi
movl $0x1, %esi
callq 0x85478
movsd (%rax), %xmm0
movsd %xmm0, 0x28(%rsp)
leaq 0x90(%rsp), %rdi
movl $0x2, %esi
callq 0x85478
movsd (%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
leaq 0x78(%rsp), %rdi
xorl %esi, %esi
callq 0x85478
movsd (%rax), %xmm0
movsd %xmm0, 0x58(%rsp)
leaq 0x78(%rsp), %rdi
movl $0x1, %esi
callq 0x85478
movsd (%rax), %xmm0
movsd %xmm0, 0x50(%rsp)
leaq 0x78(%rsp), %rdi
movl $0x2, %esi
callq 0x85478
movsd (%rax), %xmm5
leaq 0x38(%rsp), %rax
movq %rax, (%rsp)
leaq 0xa8(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0x68(%rsp), %rdx
leaq 0x60(%rsp), %rcx
leaq 0x48(%rsp), %r8
leaq 0x40(%rsp), %r9
movsd 0x30(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
movsd 0x20(%rsp), %xmm2
movsd 0x58(%rsp), %xmm3
movsd 0x50(%rsp), %xmm4
callq 0x78cfe
movq 0xd8(%rsp), %rdi
testq %rdi, %rdi
je 0x540e7
movq 0xe8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x54104
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x54121
movq 0xb8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movsd 0x48(%rsp), %xmm3
movsd 0x40(%rsp), %xmm1
movsd 0x38(%rsp), %xmm2
movsd 0x50(%r14), %xmm0
mulsd 0x38(%r14), %xmm3
mulsd %xmm1, %xmm0
addsd %xmm0, %xmm3
movsd 0x68(%r14), %xmm0
mulsd %xmm2, %xmm0
addsd %xmm3, %xmm0
movsd 0x70(%r14), %xmm3
mulsd 0x58(%r14), %xmm1
mulsd %xmm2, %xmm3
addsd %xmm3, %xmm1
mulsd 0x78(%r14), %xmm2
movq %rbx, %rdi
callq 0x85436
movq %rbx, %rax
addq $0x120, %rsp            # imm = 0x120
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x38a78
movq %rbx, %rdi
callq 0x4780
nop