There is no reason for this stuff... Well... not this way and not always.
If you are creating what I call a pseudo-assembly code (creating a C program, using C Runtime and libc in asm), then you must obey the ABI (MS-ABI or SysV ABI). This means RSP must be aligned by DQWORD (16 bytes). main() has a misaligned RSP, so you must do:
global main
main:
sub rsp,8 ; align RSP
...
add rsp,8 ; restore RSP before returning
xor eax,eax ; return 0;
ret
Of course, using libc in _start isn't a good idea (you'll need to initialize the library, the C Runtime).
In _start, on Windows, if you are using Win32 API, you must align RSP and reserve space to shadow space:
_start:
sub rsp,8+32 ; align RSP and reserve space for shadow space.
...
; Don't need to restore RSP here...
xor ecx,ecx
jmp [__imp_ExitProcess]
On SysV ABI (Linux, etc) it is garanteed that RSP will be aligned to DQWORD on _start entry. On MS-ABI it isn't!
[]s
Fred