Question: I have these two numbers original one is `1000` the new one is `440`

I need to calculate the percentage between them as follow:

```
1000 
440

The percentage that getting is 44% and left is 56%

```

my helper function:

```
function calculatePercentage($original, $given)
{
    $percentChange = (($original - $given) / $original) * 100;

    return round(abs($percentChange)) . '%';
}

```

This gives me the reset percentage!

Answer: 
This is consistent with x64 ABI (both Microsoft and SystemV). Stack must be aligned on 16 bytes boundary before calling a function ("call Q" in your example). Let's assume that the stack is initially at a 16 bytes boundary. When the program reaches "P" label (due to a "call P" instruction), RSP points 8 byte below, because "call" subtracts 8 to RSP and saves RIP (8 bytes) at \*RSP. Then, there are two "pushq" (line 2 and 3), each decreases RSP by 8, so RSP is still misaligned. That's why The compiler must subtract 8 to align RSP before executing "call Q" at line 8 and 10.

This article describes x86/x64 ABIs quite well:
<https://en.wikipedia.org/wiki/X86_calling_conventions>
24 bytes is not a power of 2 and hence cannot be an alignment. The real alignment is to 16 bytes and you forgot to account for the `call` instruction also pushing 8 bytes on the stack. So in total, the stack pointer is moved by 32 bytes, preserving alignment to 16 bytes.