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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
mov ecx, dword [ebp + 0x10]
sub esp, 0x10
test ecx, ecx
je 0x104fa20
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x104fa20
cmp dword [ebp + 8], 0
je 0x104fa20
push edi
mov edi, dword [ebp + 0xc]
test edi, edi
je 0x104fa1f
cmp dword [ebp + 0x18], 0
je 0x104fa1f
mov edx, eax
shr edx, 1
mov dl, byte [edx + ecx]
push ebx
mov ebx, edi
mov byte [ebp - 1], dl
shr ebx, 1
xor edx, edx
push esi
mov dword [ebp - 0x10], ebx
mov dword [ebp - 8], 0xadac
test eax, eax
jbe 0x104f8ff
movzx si, byte [edx + ecx]
xor word [ebp - 8], si
test byte [ebp - 8], 1
je 0x104f808
mov si, word [ebp - 8]
shr si, 1
mov edi, 0x8408
xor si, di
movzx esi, si
mov dword [ebp - 8], esi
jmp 0x104f80c
shr word [ebp - 8], 1
test byte [ebp - 8], 1
je 0x104f829
mov si, word [ebp - 8]
shr si, 1
mov edi, 0x8408
xor si, di
movzx esi, si
mov dword [ebp - 8], esi
jmp 0x104f82d
shr word [ebp - 8], 1
test byte [ebp - 8], 1
je 0x104f84a
mov si, word [ebp - 8]
shr si, 1
mov edi, 0x8408
xor si, di
movzx esi, si
mov dword [ebp - 8], esi
jmp 0x104f84e
shr word [ebp - 8], 1
test byte [ebp - 8], 1
je 0x104f86b
mov si, word [ebp - 8]
shr si, 1
mov edi, 0x8408
xor si, di
movzx esi, si
mov dword [ebp - 8], esi
jmp 0x104f86f
shr word [ebp - 8], 1
test byte [ebp - 8], 1
je 0x104f88c
mov si, word [ebp - 8]
shr si, 1
mov edi, 0x8408
xor si, di
movzx esi, si
mov dword [ebp - 8], esi
jmp 0x104f890
shr word [ebp - 8], 1
test byte [ebp - 8], 1
je 0x104f8ad
mov si, word [ebp - 8]
shr si, 1
mov edi, 0x8408
xor si, di
movzx esi, si
mov dword [ebp - 8], esi
jmp 0x104f8b1
shr word [ebp - 8], 1
test byte [ebp - 8], 1
je 0x104f8ce
mov si, word [ebp - 8]
shr si, 1
mov edi, 0x8408
xor si, di
movzx esi, si
mov dword [ebp - 8], esi
jmp 0x104f8d2
shr word [ebp - 8], 1
test byte [ebp - 8], 1
je 0x104f8ef
mov si, word [ebp - 8]
shr si, 1
mov edi, 0x8408
xor si, di
movzx esi, si
mov dword [ebp - 8], esi
jmp 0x104f8f3
shr word [ebp - 8], 1
inc edx
cmp edx, eax
jb 0x104f7e2
mov edi, dword [ebp + 0xc]
mov edx, ebx
xor edx, eax
xor edx, dword [ebp - 8]
dec ebx
movzx eax, dx
mov dword [ebp + 0xc], eax
movzx eax, byte [ebp - 1]
cdq
mov esi, 0xa
idiv esi
mov dword [ebp - 8], ebx
mov dword [ebp - 0xc], edx
jmp 0x104f924
mov ecx, dword [ebp + 0x10]
mov esi, dword [ebp + 8]
sub edi, 2
mov eax, 0xaaaaaaab
mul edi
shr edx, 1
lea edx, [edx + edx*2]
mov eax, edi
add esi, edi
sub eax, edx
jne 0x104f95b
movzx eax, byte [ecx]
cdq
mov ecx, 0xa
idiv ecx
mov al, byte [esi]
sub al, dl
sub al, 0x41
cmp al, cl
jae 0x104f957
add al, 0x30
jmp 0x104f95d
add al, 0x37
jmp 0x104f95d
mov al, byte [esi]
mov dl, al
sub dl, 0x30
cmp dl, 9
ja 0x104f96f
movsx eax, al
sub eax, 0x30
jmp 0x104f983
mov cl, al
sub cl, 0x41
cmp cl, 5
ja 0x104f981
movsx eax, al
sub eax, 0x37
jmp 0x104f983
xor eax, eax
shl al, 4
mov cl, al
mov eax, 1
mov al, byte [eax + esi]
sub al, byte [ebp - 0xc]
sub al, 0x41
cmp al, 0xa
jae 0x104f99d
add al, 0x30
jmp 0x104f99f
add al, 0x37
cmp al, 0x30
jl 0x104f9af
cmp al, 0x39
jg 0x104f9af
movsx eax, al
sub eax, 0x30
jmp 0x104f9c1
cmp al, 0x41
jl 0x104f9bf
cmp al, 0x46
jg 0x104f9bf
movsx eax, al
sub eax, 0x37
jmp 0x104f9c1
xor eax, eax
or cl, al
xor edx, edx
mov eax, ebx
div dword [ebp + 0x14]
mov eax, dword [ebp + 0x10]
mov esi, 0xff
movzx eax, byte [edx + eax]
cdq
idiv esi
mov eax, dword [ebp + 0xc]
add dl, bl
cmp edi, 2
jb 0x104fa01
mov bl, byte [ebp - 0x10]
mov esi, dword [ebp + 8]
and bl, 0xba
xor bl, al
and bl, 0xef
xor dl, bl
xor dl, byte [edi + esi - 2]
mov ebx, dword [ebp - 8]
shr eax, 8
xor dl, al
jmp 0x104fa09
shr eax, 7
xor dl, al
xor dl, byte [ebp + 0xc]
xor cl, dl
mov edx, dword [ebp + 0x18]
mov byte [ebx + edx], cl
dec ebx
mov dword [ebp - 8], ebx
test edi, edi
jne 0x104f921
pop esi
pop ebx
pop edi
mov esp, ebp
pop ebp
ret 0x14