; input: esi = source, edi = buffer, ecx = length
add edi, ecx
xor ecx, ecx
L002:
mov al, [ecx+esi]
cmp al, 20
je L009
cmp al, 0
je L009
inc ecx
jmp L002
L009:
sub edi, ecx
push edi
rep movsb
pop edi
lodsb
test al, al
je L020
dec edi
stosb
dec edi
jmp L002
L020:
retn