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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0xc
push esi
mov esi, dword [ebp + 0x10]
test esi, esi
je 0x104f76d
push edi
mov edi, dword [ebp + 0x14]
test edi, edi
je 0x104f76c
cmp dword [ebp + 8], 0
je 0x104f76c
mov edx, dword [ebp + 0xc]
test edx, edx
je 0x104f76c
cmp dword [ebp + 0x18], 0
je 0x104f76c
mov eax, edi
shr eax, 1
mov cl, byte [eax + esi]
mov byte [ebp - 1], cl
mov eax, 0xadac
xor ecx, ecx
push ebx
mov dword [ebp - 8], eax
test edi, edi
jbe 0x104f65d
lea esp, [esp]
movzx ax, byte [ecx + esi]
xor word [ebp - 8], ax
test byte [ebp - 8], 1
je 0x104f566
mov ax, word [ebp - 8]
shr ax, 1
mov ebx, 0x8408
xor ax, bx
movzx eax, ax
mov dword [ebp - 8], eax
jmp 0x104f56a
shr word [ebp - 8], 1
test byte [ebp - 8], 1
je 0x104f587
mov ax, word [ebp - 8]
shr ax, 1
mov ebx, 0x8408
xor ax, bx
movzx eax, ax
mov dword [ebp - 8], eax
jmp 0x104f58b
shr word [ebp - 8], 1
test byte [ebp - 8], 1
je 0x104f5a8
mov ax, word [ebp - 8]
shr ax, 1
mov ebx, 0x8408
xor ax, bx
movzx eax, ax
mov dword [ebp - 8], eax
jmp 0x104f5ac
shr word [ebp - 8], 1
test byte [ebp - 8], 1
je 0x104f5c9
mov ax, word [ebp - 8]
shr ax, 1
mov ebx, 0x8408
xor ax, bx
movzx eax, ax
mov dword [ebp - 8], eax
jmp 0x104f5cd
shr word [ebp - 8], 1
test byte [ebp - 8], 1
je 0x104f5ea
mov ax, word [ebp - 8]
shr ax, 1
mov ebx, 0x8408
xor ax, bx
movzx eax, ax
mov dword [ebp - 8], eax
jmp 0x104f5ee
shr word [ebp - 8], 1
test byte [ebp - 8], 1
je 0x104f60b
mov ax, word [ebp - 8]
shr ax, 1
mov ebx, 0x8408
xor ax, bx
movzx eax, ax
mov dword [ebp - 8], eax
jmp 0x104f60f
shr word [ebp - 8], 1
test byte [ebp - 8], 1
je 0x104f62c
mov ax, word [ebp - 8]
shr ax, 1
mov ebx, 0x8408
xor ax, bx
movzx eax, ax
mov dword [ebp - 8], eax
jmp 0x104f630
shr word [ebp - 8], 1
test byte [ebp - 8], 1
je 0x104f64d
mov ax, word [ebp - 8]
shr ax, 1
mov ebx, 0x8408
xor ax, bx
movzx eax, ax
mov dword [ebp - 8], eax
jmp 0x104f654
shr word [ebp - 8], 1
mov eax, dword [ebp - 8]
inc ecx
cmp ecx, edi
jb 0x104f540
xor eax, edx
xor eax, edi
movzx ecx, ax
xor esi, esi
xor ebx, ebx
mov dword [ebp - 8], ecx
test edx, edx
jbe 0x104f76b
movzx eax, byte [ebp - 1]
cdq
mov ecx, 0xa
idiv ecx
mov dword [ebp - 0xc], edx
xor edx, edx
mov eax, ebx
div edi
mov eax, dword [ebp + 0x10]
mov ecx, 0xff
movzx eax, byte [edx + eax]
cdq
idiv ecx
mov eax, dword [ebp - 8]
mov ecx, edx
add cl, bl
cmp esi, 2
jb 0x104f6c2
mov dl, byte [ebp + 0xc]
and dl, 0xba
xor dl, al
and dl, 0xef
xor cl, dl
mov edx, dword [ebp + 0x18]
xor cl, byte [esi + edx - 2]
mov edx, dword [ebp + 8]
xor cl, byte [ebx + edx]
shr eax, 8
jmp 0x104f6cf
mov edx, dword [ebp + 8]
xor cl, byte [ebx + edx]
mov edx, eax
shr edx, 7
xor cl, dl
xor cl, al
mov al, cl
shr al, 4
cmp al, 0xa
jae 0x104f6de
add al, 0x30
jmp 0x104f6e0
add al, 0x37
mov byte [ebp - 1], al
mov eax, 0xaaaaaaab
mul esi
shr edx, 1
lea eax, [edx + edx*2]
mov edx, esi
sub edx, eax
mov dl, byte [ebp - 1]
jne 0x104f722
mov al, dl
sub al, 0x30
cmp al, 9
ja 0x104f705
mov byte [ebp - 1], al
jmp 0x104f70b
sub dl, 0x37
mov byte [ebp - 1], dl
mov eax, dword [ebp + 0x10]
movzx eax, byte [eax]
cdq
mov edi, 0xa
idiv edi
mov edi, dword [ebp + 0x14]
add dl, byte [ebp - 1]
add dl, 0x41
mov eax, dword [ebp + 0x18]
mov byte [esi + eax], dl
movzx eax, cl
and eax, 0x8000000f
jns 0x104f737
dec eax
or eax, 0xfffffff0
inc eax
cmp al, 0xa
jae 0x104f73f
add al, 0x30
jmp 0x104f741
add al, 0x37
mov cl, al
sub cl, 0x30
inc esi
cmp cl, 9
ja 0x104f750
mov al, cl
jmp 0x104f752
sub al, 0x37
mov cl, byte [ebp - 0xc]
mov edx, dword [ebp + 0x18]
add cl, al
add cl, 0x41
mov byte [esi + edx], cl
inc ebx
inc esi
cmp ebx, dword [ebp + 0xc]
jb 0x104f682
pop ebx
pop edi
pop esi
mov esp, ebp
pop ebp
ret 0x14