This document discusses using Clang tooling to refactor raw memory accesses in embedded C code to be type-safe and readable. It involves parsing a CMSIS SVD file to get the device memory map, writing AST matchers to find raw memory accesses, and generating fix-its to refactor the accesses. The tool is implemented as a Clang-tidy check for static analysis and refactoring at compile-time. Challenges include handling cases where register offsets cannot be evaluated statically and designing the tools to work with existing code patterns.