Convert indecipherable macros to inline functions This was fun. Signed-off-by: Ran Benita <ran234@gmail.com>