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

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x54
call fcn.00629030
push ebx
push esi
mov esi, edx
mov dword [ebp - 0x24], ecx
xor ebx, ebx
mov dword [ebp - 0x14], esi
push edi
mov dword [ebp - 0x10], ebx
mov eax, dword [esi + 4]
mov dword [ebp - 0xc], 6
mov dword [ebp - 0x1c], 5
cmp eax, 0x17
jne 0x477929
mov eax, dword [esi + 0xc]
mov edx, ebx
and eax, 0x100
setne dl
test eax, 0x100
mov eax, 5
setne bl
mov dword [ebp - 0x10], ebx
lea edx, [edx*2 + 0xb]
jmp 0x47795c
cmp eax, 0x18
jne 0x477cd3
test dword [esi + 0xc], 0x100
mov eax, 6
mov dword [ebp - 0xc], 7
mov dword [ebp - 0x1c], eax
je 0x477957
mov ebx, 1
lea edx, [eax + 9]
mov dword [ebp - 0x10], ebx
jmp 0x47795c
mov edx, 0xd
mov edi, dword [esi]
xorps xmm0, xmm0
mov ecx, dword [esi + 8]
xor esi, esi
mov dword [ebp - 8], edi
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x34], esi
movups xmmword [ebp - 0x54], xmm0
movups xmmword [ebp - 0x44], xmm0
cmp edi, edx
jl 0x477cd3
xor edx, edx
mov dword [ebp - 0x30], 7
mov dword [ebp - 0x18], edx
nop dword [eax + eax]
test ebx, ebx
jne 0x4779b3
cmp edx, eax
jne 0x4779b3
mov al, byte [esi + ecx]
cmp al, 0x5a
je 0x477b61
cmp al, 0x2b
je 0x477b61
cmp al, 0x2d
je 0x477b61
mov bl, byte [esi + ecx]
mov al, bl
sub al, 0x30
cmp al, 9
ja 0x477cd3
inc esi
movsx eax, bl
mov dword [ebp - 0x28], eax
cmp esi, edi
je 0x477cd3
mov bl, byte [esi + ecx]
mov al, bl
sub al, 0x30
cmp al, 9
ja 0x477cd3
mov eax, dword [ebp - 0x28]
inc esi
lea ecx, [eax + eax*4]
movsx eax, bl
lea ebx, [ecx - 0x108]
lea ebx, [eax + ebx*2]
mov dword [ebp - 0x2c], ebx
cmp esi, edi
je 0x477cd3
mov edi, dword [ebp - 0x14]
lea eax, [edx + 1]
mov ecx, dword [edi + 4]
cmp ecx, 0x17
mov edi, dword [ebp - 8]
cmovne eax, edx
cmp ebx, dword [eax*4 + 0x696060]
jl 0x477cd3
cmp ebx, dword [eax*4 + 0x696010]
jg 0x477cd3
cmp eax, 6
ja case.default.0x477a33
jmp dword [eax*4 + 0x477cdc]
lea eax, [ebx - 0x13]
imul eax, eax, 0x64
mov dword [ebp - 0x40], eax
jmp case.default.0x477a33
cmp ecx, 0x17
jne 0x477a65
cmp ebx, 0x32
jge 0x477a5d
lea eax, [ebx + 0x64]
mov dword [ebp - 0x40], eax
jmp case.default.0x477a33
mov dword [ebp - 0x40], ebx
jmp case.default.0x477a33
add dword [ebp - 0x40], ebx
jmp case.default.0x477a33
lea eax, [ebx - 1]
mov dword [ebp - 0x44], eax
jmp case.default.0x477a33
mov ecx, dword [ebp - 0x44]
mov edi, dword [ebp - 0x40]
cmp ecx, 1
jne 0x477a96
lea ecx, [edi + 0x76c]
call fcn.00477870
mov ecx, dword [ebp - 0x44]
add eax, 0x1c
jmp 0x477a9d
mov eax, dword [ecx*4 + 0x6960c0]
cmp ebx, eax
jg 0x477cd3
mov dword [ebp - 0x48], ebx
add edi, 0x76c
add ebx, dword [ecx*4 + 0x695fc4]
lea eax, [ebx - 1]
mov dword [ebp - 0x38], eax
cmp ecx, 2
jl 0x477ad5
mov ecx, edi
call fcn.00477870
dec eax
add eax, ebx
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x44]
add eax, 2
jmp 0x477ad9
dec edi
lea eax, [ecx + 0xe]
imul ecx, eax, 0xd
mov eax, 0x51eb851f
imul edi
sar edx, 5
mov ebx, edx
shr ebx, 0x1f
add ebx, edx
imul eax, ebx, 0xffffff9c
add edi, eax
mov eax, 0x66666667
imul ecx
mov dword [ebp - 0x28], edi
mov eax, ebx
sar edx, 1
mov edi, edx
shr edi, 0x1f
add edi, edx
cdq
and edx, 3
add eax, edx
sar eax, 2
add edi, eax
mov eax, dword [ebp - 0x28]
lea ecx, [eax + ebx*4]
cdq
and edx, 3
add ecx, ebx
add eax, edx
add ecx, edi
sar eax, 2
add eax, ecx
mov edi, dword [ebp - 8]
mov ecx, dword [ebp - 0x2c]
add ecx, 6
add eax, ecx
cdq
idiv dword [ebp - 0x30]
mov dword [ebp - 0x3c], edx
mov edx, dword [ebp - 0x18]
jmp case.default.0x477a33
mov dword [ebp - 0x4c], ebx
jmp case.default.0x477a33
mov dword [ebp - 0x50], ebx
jmp case.default.0x477a33
mov dword [ebp - 0x54], ebx
mov ecx, dword [ebp - 0x20]
inc edx
mov ebx, dword [ebp - 0x10]
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x18], edx
cmp edx, dword [ebp - 0xc]
jl 0x477990
mov eax, dword [ebp - 0x14]
cmp dword [eax + 4], 0x18
jne 0x477bae
cmp byte [esi + ecx], 0x2e
jne 0x477bae
test ebx, ebx
jne 0x477cd3
inc esi
cmp esi, edi
je 0x477cd3
mov edx, esi
jge 0x477cd3
nop dword [eax]
mov al, byte [esi + ecx]
sub al, 0x30
cmp al, 9
ja 0x477b9e
inc esi
cmp esi, edi
jl 0x477b90
cmp edx, esi
je 0x477cd3
cmp esi, edi
je 0x477cd3
mov al, byte [esi + ecx]
mov byte [ebp - 1], al
cmp al, 0x5a
jne 0x477bc1
mov ebx, dword [ebp - 8]
inc esi
jmp 0x477ca7
test ebx, ebx
jne 0x477cd3
cmp al, 0x2b
je 0x477bd5
cmp al, 0x2d
jne 0x477cd3
inc esi
xor edi, edi
lea eax, [esi + 4]
cmp eax, dword [ebp - 8]
jne 0x477cd3
mov eax, dword [ebp - 0xc]
mov edx, eax
add eax, 2
mov dword [ebp - 0x2c], eax
nop
mov ah, byte [esi + ecx]
mov al, ah
sub al, 0x30
cmp al, 9
ja 0x477cd3
movsx eax, ah
mov dword [ebp - 0x30], eax
mov ah, byte [esi + ecx + 1]
mov al, ah
sub al, 0x30
cmp al, 9
ja 0x477cd3
mov ecx, dword [ebp - 0x30]
mov ebx, dword [ebp - 0x14]
movsx eax, ah
lea ecx, [ecx + ecx*4]
cmp dword [ebx + 4], 0x17
lea ecx, [ecx - 0x108]
mov ebx, dword [ebp - 8]
lea ecx, [eax + ecx*2]
lea eax, [edx + 1]
cmovne eax, edx
shl eax, 2
cmp ecx, dword [eax + 0x696060]
jl 0x477cd3
cmp ecx, dword [eax + 0x696010]
jg 0x477cd3
cmp dword [ebp - 0x24], 0
je 0x477c76
mov eax, dword [ebp - 0xc]
cmp edx, eax
jne 0x477c67
imul edi, ecx, 0xe10
jmp 0x477c76
inc eax
cmp edx, eax
jne 0x477c76
mov eax, ecx
shl eax, 4
sub eax, ecx
lea edi, [edi + eax*4]
mov ecx, dword [ebp - 0x20]
inc edx
add esi, 2
cmp edx, dword [ebp - 0x2c]
jl 0x477bf0
test edi, edi
je 0x477ca7
mov eax, edi
lea ecx, [ebp - 0x54]
neg eax
cmp byte [ebp - 1], 0x2d
cmove eax, edi
xor edx, edx
push eax
call fcn.0049a240
add esp, 4
test eax, eax
je 0x477cd3
cmp esi, ebx
jne 0x477cd3
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x477cc7
movups xmm0, xmmword [ebp - 0x54]
mov ecx, dword [ebp - 0x34]
movups xmmword [eax], xmm0
movups xmm0, xmmword [ebp - 0x44]
movups xmmword [eax + 0x10], xmm0
mov dword [eax + 0x20], ecx
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret