Reading assembly code

Even unobfuscated code is difficult to understand. Look at this function. Can you tell its purpose?