Function at 0x51a6e8
Capabilities:
Validate payment card number using luhn algorithm

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x58
mov ecx, dword [ebp + 0xc]
push ebx
mov ebx, dword [ebp + 0x10]
xor eax, eax
push esi
push edi
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x24], eax
mov dword [ebp - 0xc], ecx
mov dword [ebp - 0x1c], eax
mov esi, dword [ebp - 0xc]
mov eax, esi
movsx edi, byte [esi]
test edi, edi
je 0x51a71c
cmp edi, 0x25
je 0x51a71c
inc esi
mov dword [ebp - 0xc], esi
jmp 0x51a70a
sub esi, eax
je 0x51a733
push esi
push eax
push dword [ebp + 8]
call fcn.0050b9c9
add dword [ebp + 8], esi
add esp, 0xc
add dword [ebp - 0x1c], esi
test edi, edi
je 0x51ab92
inc dword [ebp - 0xc]
xor eax, eax
or edi, 0xffffffff
and byte [ebp + 0xf], al
mov dword [ebp - 8], eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0xc]
inc dword [ebp - 0xc]
movsx eax, byte [eax]
mov dword [ebp - 0x10], eax
cmp eax, 0x23
jle 0x51a819
mov ecx, dword [ebp - 0x10]
cmp ecx, 0x44
jg 0x51a893
je 0x51a8cd
cmp ecx, 0x2a
je 0x51a872
cmp ecx, 0x2b
je 0x51a869
cmp ecx, 0x2d
je 0x51a88a
cmp ecx, 0x2e
je 0x51a7d3
cmp ecx, 0x30
je 0x51a845
jle 0x51acd1
cmp ecx, 0x39
jg 0x51acd1
xor eax, eax
mov ecx, dword [ebp - 0x10]
lea eax, [eax + eax*4]
lea eax, [ecx + eax*2 - 0x30]
mov ecx, dword [ebp - 0xc]
inc dword [ebp - 0xc]
movsx ecx, byte [ecx]
mov dword [ebp - 0x10], ecx
add ecx, 0xffffffd0
cmp ecx, 9
jbe 0x51a7b0
mov dword [ebp - 0x18], eax
jmp 0x51a811
mov eax, dword [ebp - 0xc]
inc dword [ebp - 0xc]
movsx ecx, byte [eax]
cmp ecx, 0x2a
mov dword [ebp - 0x10], ecx
je 0x51a84e
xor eax, eax
add ecx, 0xffffffd0
cmp ecx, 9
ja 0x51a806
mov ecx, dword [ebp - 0x10]
lea eax, [eax + eax*4]
lea eax, [ecx + eax*2 - 0x30]
mov ecx, dword [ebp - 0xc]
inc dword [ebp - 0xc]
movsx ecx, byte [ecx]
mov dword [ebp - 0x10], ecx
jmp 0x51a7e6
test eax, eax
jge 0x51a80f
or edi, 0xffffffff
jmp 0x51a811
mov edi, eax
mov eax, dword [ebp - 0x10]
jmp 0x51a75b
cmp dword [ebp - 0x10], 0x23
je 0x51a83c
cmp dword [ebp - 0x10], 0x20
jne 0x51acd1
cmp byte [ebp + 0xf], 0
jne 0x51a74f
mov byte [ebp + 0xf], 0x20
jmp 0x51a74f
or dword [ebp - 8], 8
jmp 0x51a74f
or dword [ebp - 8], 0x20
jmp 0x51a74f
mov eax, dword [ebx]
add ebx, 4
test eax, eax
mov dword [ebp + 0x10], ebx
jge 0x51a862
or edi, 0xffffffff
jmp 0x51a74f
mov edi, eax
jmp 0x51a74f
mov byte [ebp + 0xf], 0x2b
jmp 0x51a74f
mov eax, dword [ebx]
add ebx, 4
test eax, eax
mov dword [ebp + 0x10], ebx
mov dword [ebp - 0x18], eax
jge 0x51a74f
neg eax
mov dword [ebp - 0x18], eax
or dword [ebp - 8], 0x10
jmp 0x51a74f
cmp ecx, 0x55
jle 0x51a8d6
cmp ecx, 0x63
jle 0x51ac40
cmp ecx, 0x68
jg 0x51a8b5
jne 0x51ac67
or dword [ebp - 8], 4
jmp 0x51a74f
cmp ecx, 0x6c
jg 0x51aca4
jne 0x51ac6e
or dword [ebp - 8], 1
jmp 0x51a74f
or dword [ebp - 8], 1
jmp 0x51ac73
cmp eax, 0x55
je 0x51aba0
cmp eax, 0x4f
jne 0x51acd1
or dword [ebp - 8], 1
test byte [ebp - 8], 1
jne 0x51a903
test byte [ebp - 8], 4
je 0x51a903
movzx ecx, word [ebx]
add ebx, 4
mov dword [ebp + 0x10], ebx
jmp 0x51a90b
mov ecx, dword [ebx]
add ebx, 4
mov dword [ebp + 0x10], ebx
xor eax, eax
and byte [ebp + 0xf], 0
test edi, edi
mov dword [ebp - 0x28], edi
jl 0x51a91c
and dword [ebp - 8], 0xffffffdf
test ecx, ecx
lea esi, [ebp - 0x30]
jne 0x51a927
test edi, edi
je 0x51a991
sub eax, 0
je 0x51a975
dec eax
je 0x51a94e
dec eax
je 0x51a939
mov esi, str.bug_in_vfprintf:_bad_base
jmp 0x51a999
mov edx, dword [ebp - 0x24]
mov eax, ecx
and eax, 0xf
dec esi
shr ecx, 4
mov al, byte [eax + edx]
mov byte [esi], al
jne 0x51a939
jmp 0x51a991
cmp ecx, 0xa
dec esi
jb 0x51a96e
push 0xa
mov eax, ecx
xor edx, edx
pop edi
div edi
push edi
mov eax, ecx
pop ecx
add dl, 0x30
mov byte [esi], dl
xor edx, edx
div ecx
mov ecx, eax
jmp 0x51a94e
add cl, 0x30
mov byte [esi], cl
jmp 0x51a991
mov al, cl
dec esi
and al, 7
add al, 0x30
shr ecx, 3
mov byte [esi], al
jne 0x51a975
test byte [ebp - 8], 8
je 0x51a991
cmp al, 0x30
je 0x51a991
dec esi
mov byte [esi], 0x30
lea eax, [ebp - 0x30]
sub eax, esi
mov dword [ebp - 0x14], eax
mov edi, dword [ebp - 0x14]
cmp byte [ebp + 0xf], 0
mov eax, edi
mov dword [ebp - 0x2c], eax
je 0x51a9ac
lea eax, [edi + 1]
jmp 0x51a9b5
test byte [ebp - 8], 0x40
je 0x51a9b8
lea eax, [edi + 2]
mov dword [ebp - 0x2c], eax
mov ecx, dword [ebp - 0x28]
cmp ecx, eax
mov dword [ebp - 0x20], ecx
jg 0x51a9c5
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 8]
and eax, 0x30
mov dword [ebp - 0x30], eax
jne 0x51aa18
mov edi, dword [ebp - 0x18]
sub edi, dword [ebp - 0x20]
test edi, edi
jle 0x51aa18
cmp edi, 0x10
jle 0x51aa04
lea ebx, [edi - 1]
shr ebx, 4
push 0x10
push str.________________0000000000000000
push dword [ebp + 8]
call fcn.0050b9c9
add dword [ebp + 8], 0x10
add esp, 0xc
sub edi, 0x10
dec ebx
jne 0x51a9e5
mov ebx, dword [ebp + 0x10]
push edi
push str.________________0000000000000000
push dword [ebp + 8]
call fcn.0050b9c9
add esp, 0xc
add dword [ebp + 8], edi
cmp byte [ebp + 0xf], 0
je 0x51aa34
lea eax, [ebp + 0xf]
push 1
push eax
push dword [ebp + 8]
call fcn.0050b9c9
add esp, 0xc
inc dword [ebp + 8]
jmp 0x51aa59
test byte [ebp - 8], 0x40
je 0x51aa59
mov al, byte [ebp - 0x10]
push 2
mov byte [ebp - 1], al
lea eax, [ebp - 2]
push eax
mov byte [ebp - 2], 0x30
push dword [ebp + 8]
call fcn.0050b9c9
add esp, 0xc
add dword [ebp + 8], 2
cmp dword [ebp - 0x30], 0x20
jne 0x51aaa7
mov edi, dword [ebp - 0x18]
sub edi, dword [ebp - 0x20]
test edi, edi
jle 0x51aaa7
cmp edi, 0x10
jle 0x51aa90
lea ebx, [edi - 1]
shr ebx, 4
push 0x10
push 0x57b650
push dword [ebp + 8]
call fcn.0050b9c9
add dword [ebp + 8], 0x10
add esp, 0xc
sub edi, 0x10
dec ebx
jne 0x51aa74
push edi
push 0x57b650
push dword [ebp + 8]
call fcn.0050b9c9
mov ebx, dword [ebp + 0x10]
add esp, 0xc
add dword [ebp + 8], edi
mov edi, dword [ebp - 0x28]
sub edi, dword [ebp - 0x2c]
test edi, edi
jle 0x51aaef
cmp edi, 0x10
jle 0x51aad8
lea ebx, [edi - 1]
shr ebx, 4
push 0x10
push 0x57b650
push dword [ebp + 8]
call fcn.0050b9c9
add dword [ebp + 8], 0x10
add esp, 0xc
sub edi, 0x10
dec ebx
jne 0x51aabc
push edi
push 0x57b650
push dword [ebp + 8]
call fcn.0050b9c9
mov ebx, dword [ebp + 0x10]
add esp, 0xc
add dword [ebp + 8], edi
mov edi, dword [ebp - 0x14]
push edi
push esi
push dword [ebp + 8]
call fcn.0050b9c9
add dword [ebp + 8], edi
add esp, 0xc
test byte [ebp - 8], 0x10
je 0x51ab4d
mov esi, dword [ebp - 0x18]
sub esi, dword [ebp - 0x20]
test esi, esi
jle 0x51ab4d
cmp esi, 0x10
jle 0x51ab39
lea edi, [esi - 1]
shr edi, 4
push 0x10
push str.________________0000000000000000
push dword [ebp + 8]
call fcn.0050b9c9
add dword [ebp + 8], 0x10
add esp, 0xc
sub esi, 0x10
dec edi
jne 0x51ab1d
push esi
push str.________________0000000000000000
push dword [ebp + 8]
call fcn.0050b9c9
add esp, 0xc
add dword [ebp + 8], esi
mov eax, dword [ebp - 0x20]
cmp dword [ebp - 0x18], eax
jle 0x51ab58
mov eax, dword [ebp - 0x18]
add dword [ebp - 0x1c], eax
jmp 0x51a705
test byte [ebp - 8], 1
jne 0x51ab80
test byte [ebp - 8], 4
je 0x51ab80
mov eax, dword [ebx]
mov cx, word [ebp - 0x1c]
add ebx, 4
mov dword [ebp + 0x10], ebx
mov word [eax], cx
jmp 0x51a705
mov eax, dword [ebx]
mov ecx, dword [ebp - 0x1c]
add ebx, 4
mov dword [ebp + 0x10], ebx
mov dword [eax], ecx
jmp 0x51a705
mov eax, dword [ebp + 8]
pop edi
pop esi
pop ebx
and byte [eax], 0
mov eax, dword [ebp - 0x1c]
leave
ret
or dword [ebp - 8], 1
test byte [ebp - 8], 1
jne 0x51abbb
test byte [ebp - 8], 4
je 0x51abbb
movzx ecx, word [ebx]
add ebx, 4
mov dword [ebp + 0x10], ebx
jmp 0x51abc3
mov ecx, dword [ebx]
add ebx, 4
mov dword [ebp + 0x10], ebx
push 1
pop eax
jmp 0x51a90d
mov esi, dword [ebx]
add ebx, 4
test esi, esi
mov dword [ebp + 0x10], ebx
jne 0x51abdc
mov esi, str._null_
test edi, edi
jl 0x51ac0b
lea ecx, [edi + esi]
mov eax, esi
cmp esi, ecx
jae 0x51abf3
cmp byte [eax], 0
je 0x51abf3
inc eax
cmp eax, ecx
jb 0x51abe9
cmp ecx, eax
ja 0x51abf9
xor eax, eax
test eax, eax
je 0x51ac06
sub eax, esi
cmp eax, edi
mov dword [ebp - 0x14], eax
jle 0x51ac15
mov dword [ebp - 0x14], edi
jmp 0x51ac15
push esi
call fcn.00529f40
pop ecx
mov dword [ebp - 0x14], eax
and byte [ebp + 0xf], 0
jmp 0x51a999
mov ecx, dword [ebx]
add ebx, 4
or dword [ebp - 8], 0x40
push 2
mov dword [ebp + 0x10], ebx
pop eax
mov dword [ebp - 0x24], str.0123456789abcdef
mov dword [ebp - 0x10], 0x78
jmp 0x51a90d
cmp eax, 0x63
je 0x51ac5a
cmp eax, 0x58
jne 0x51acd1
mov dword [ebp - 0x24], str.0123456789ABCDEF
jmp 0x51acf5
mov al, byte [ebx]
add ebx, 4
mov dword [ebp + 0x10], ebx
lea esi, [ebp - 0x58]
jmp 0x51acdf
cmp eax, 0x64
je 0x51ac73
jmp 0x51acd1
cmp eax, 0x69
jne 0x51acd1
test byte [ebp - 8], 1
jne 0x51ac8a
test byte [ebp - 8], 4
je 0x51ac8a
movsx ecx, word [ebx]
add ebx, 4
mov dword [ebp + 0x10], ebx
jmp 0x51ac92
mov ecx, dword [ebx]
add ebx, 4
mov dword [ebp + 0x10], ebx
test ecx, ecx
jge 0x51ac9c
neg ecx
mov byte [ebp + 0xf], 0x2d
push 1
pop eax
jmp 0x51a911
sub eax, 0x6e
je 0x51ab60
dec eax
je 0x51a8ec
dec eax
je 0x51ac1e
sub eax, 3
je 0x51abcb
dec eax
dec eax
je 0x51aba4
sub eax, 3
je 0x51acee
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x51ab92
lea esi, [ebp - 0x58]
mov byte [ebp - 0x58], al
mov dword [ebp - 0x14], 1
jmp 0x51ac15
mov dword [ebp - 0x24], str.0123456789abcdef
test byte [ebp - 8], 1
jne 0x51ad0c
test byte [ebp - 8], 4
je 0x51ad0c
movzx ecx, word [ebx]
add ebx, 4
mov dword [ebp + 0x10], ebx
jmp 0x51ad14
mov ecx, dword [ebx]
add ebx, 4
mov dword [ebp + 0x10], ebx
test byte [ebp - 8], 8
push 2
pop eax
je 0x51a90d
test ecx, ecx
je 0x51a90d
or dword [ebp - 8], 0x40
jmp 0x51a90d