(lack of)volatile keyword might be messing up the concurrency, so added volatile to all the globals and the inline assembly