struct return
How a large struct comes back from a function - the caller passes a hidden address and the function writes the struct there.
Struct-return (sret) passes the address of caller-allocated result storage as a hidden argument (rdi on System V, rcx on Microsoft x64, a0 on RISC-V; x8 on AAPCS64, not counting as an argument) and returns that address in rax on x86-64; small structs instead come back in registers.
Examples
A 32-byte struct returned on x86-64 Linux is written to memory the caller provides, whose address arrives in
rdi.