/* Ground-truth C for FUN_00000aac @ blob offset 0xaac (28 bytes / 7 insts). * * Pattern: byte-wise memset with a simple counting loop. * Signature: void memset_byte(void *buf, uint8_t val, size_t len); * * AArch64 ABI: X0 = buf, W1 = val (low byte), X2 = len * Scratch: X3 = index i * * Notes the decompiler should ideally recover: * - This is unambiguously "memset" semantics; bonus points for naming it so. * - The loop structure is pre-test (cmp before body) — tools should emit * `while (i != len)` or `for (; i < len; ...)`. * - W1 is truncated to a byte by the STRB; decompiler should mark val as u8. */ #include #include void memset_byte(void *buf, uint8_t val, size_t len) { size_t i = 0; while (i != len) { ((uint8_t *)buf)[i] = val; i++; } }