Byte-exact, both symbols, whole object. section_infos_equal passes for _wcscat
(42 bytes) and _wcscpy (28 bytes); with zero relocations in either the .text
sections are literally byte-identical. Status MISSING -> Matching.
The unit holds two functions: the CRT keeps wcscpy in WCSCAT.C, which is why
config.json has no separate wcscpy entry. Section order is wcscat then wcscpy,
matching source order.
Both are leaf functions with no externals and no data. wcscat needs no code for
its return value - dst is loaded into EAX at offset 0 and never clobbered, since
the body works in EDX/ECX/ESI - so a plain "return dst" costs nothing. The scan
loop rotation the target shows is just what while (*cp) cp++; gives at /O1.
Byte-exact on the first build; no iteration required.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Byte-exact, all four functions, whole object. Source was a pure skeleton with
no code; status MISSING work now NonMatching -> Matching.
An iterative quicksort for 2-byte and 4-byte elements with a 30-deep bounds
stack and a selection-sort cutoff at 8. The two code_* symbols are the
selection sorts and take hi in EAX under VC7's custom convention for statics.
The comparator takes values, not pointers, and the zero-extension in the target
pins the 2-byte element type to word rather than short.
Five source-shape findings, each read off the disassembly:
- the swap loads both elements then stores to *best first, which is
temp = *best; *best = *hi; *hi = temp - the mirror of the natural form. That
alone made both selection sorts exact.
- element_count and size are unsigned: the target uses jb, ja and shr where
signed types give jl, jg and sar.
- the source writes lo+1 < j, not the algebraically identical lo < j-1, which
reverses the lea and cmp operands.
- the larger-partition test compares raw byte differences. On word pointers
every element-count form makes MSVC emit two sars or cancel them and mask,
costing 16 bytes; only an explicit byte-basis comparison gives the plain dec.
j-1-lo >= hi-i, j-lo > hi-i and the byte form are integer-identical and only
the last matches.
- depth = 0 is assigned before hi; the reverse order swaps the two stores.
Both qsort bodies went exact from the same five fixes, which is good evidence
the shapes are right rather than coincidental.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>