Fix for clang

clang does not support global register variables. Relevant code was
refactored. In addition, arguments are passed to triggers correctly
on x86_64
c -> cpp rename to match the content