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

Disassembly:
push ebp
mov ebp, esp
push edi
mov edi, ecx
push esi
mov esi, edx
push ebx
sub esp, 0x24c
test edx, edx
jle 0x40802a
mov al, byte [ecx]
lea edx, [eax - 0x2b]
and dl, 0xfd
jne 0x40802a
fld1
cmp al, 0x2d
mov byte [ebp - 0x231], 1
mov ebx, 1
fchs
fld1
fcmove st(0), st(1)
fstp st(1)
jmp 0x408035
mov byte [ebp - 0x231], 0
fld1
xor ebx, ebx
lea eax, [ebx + 2]
cmp eax, esi
jge 0x4080b2
mov al, byte [edi + ebx]
mov edx, ebx
and eax, 0xffffffdf
cmp al, 0x4e
je 0x408052
cmp al, 0x49
jne 0x408119
jmp 0x4080c2
fstp st(0)
mov al, byte [edi + ebx + 1]
and eax, 0xffffffdf
cmp al, 0x41
jne 0x4085bc
mov al, byte [edi + ebx + 2]
and eax, 0xffffffdf
cmp al, 0x4e
jne 0x4085bc
add ebx, 3
cmp ebx, esi
jge 0x4080a2
mov al, byte [edi + edx + 3]
mov edx, eax
and edx, 0xffffffdf
sub edx, 0x41
cmp dl, 0x19
jbe 0x4085bc
lea edx, [eax - 0x30]
cmp dl, 9
jbe 0x4085bc
cmp al, 0x5f
je 0x4085bc
fld dword [0xe3aab8]
mov eax, dword [ebp + 8]
fstp qword [eax]
jmp 0x4085d4
mov dword [ebp - 0x224], 0xffffffff
cmp ebx, esi
jl 0x408119
jmp 0x408138
mov al, byte [edi + ebx + 1]
and eax, 0xffffffdf
cmp al, 0x4e
jne 0x4085a2
mov al, byte [edi + ebx + 2]
and eax, 0xffffffdf
cmp al, 0x46
jne 0x4085a6
add ebx, 3
cmp ebx, esi
jge 0x408110
mov al, byte [edi + edx + 3]
mov edx, eax
and edx, 0xffffffdf
sub edx, 0x41
cmp dl, 0x19
jbe 0x4085aa
lea edx, [eax - 0x30]
cmp dl, 9
jbe 0x4085ae
cmp al, 0x5f
je 0x4085b2
fld1
fldz
jmp 0x4083e3
mov dword [ebp - 0x224], 0xffffffff
movzx eax, byte [edi + ebx]
lea edx, [eax - 0x30]
cmp dl, 9
ja 0x408138
sub eax, 0x30
mov dword [ebp - 0x224], eax
mov dword [ebp - 0x22c], 0
mov dword [ebp - 0x220], 0
mov dword [ebp - 0x21c], 0
cmp ebx, esi
jge 0x4082d8
mov cl, byte [edi + ebx]
lea eax, [ecx - 0x30]
cmp al, 9
ja 0x4081ca
imul eax, dword [ebp - 0x21c], 0xa
inc dword [ebp - 0x22c]
mov dword [ebp - 0x228], eax
mov eax, 0xa
mul dword [ebp - 0x220]
mov dword [ebp - 0x21c], edx
mov dword [ebp - 0x220], eax
mov eax, dword [ebp - 0x228]
add dword [ebp - 0x21c], eax
movzx eax, cl
sub eax, 0x30
cdq
add eax, dword [ebp - 0x220]
adc edx, dword [ebp - 0x21c]
mov dword [ebp - 0x220], eax
mov dword [ebp - 0x21c], edx
inc ebx
cmp ebx, esi
je 0x408156
cmp byte [edi + ebx], 0x5f
je 0x4081bd
jmp 0x408156
cmp cl, 0x2e
jne 0x4082d8
inc ebx
cmp dword [ebp - 0x22c], 0
jne 0x4081fd
xor edx, edx
mov eax, edx
cmp ebx, esi
jge 0x4081ff
cmp byte [edi + ebx], 0x30
jne 0x4085c0
inc edx
inc ebx
cmp ebx, esi
je 0x4081df
cmp byte [edi + ebx], 0x5f
je 0x4081f0
jmp 0x4081df
xor eax, eax
cmp dword [ebp - 0x224], 0xffffffff
jne 0x40822b
cmp ebx, esi
jge 0x40822b
mov dword [ebp - 0x224], 0xffffffff
movzx edx, byte [edi + ebx]
lea ecx, [edx - 0x30]
cmp cl, 9
ja 0x40822b
lea ecx, [edx - 0x30]
mov dword [ebp - 0x224], ecx
mov dword [ebp - 0x238], eax
mov dword [ebp - 0x23c], 0
mov eax, dword [ebp - 0x238]
mov dword [ebp - 0x228], eax
mov eax, dword [ebp - 0x23c]
mov dword [ebp - 0x230], eax
cmp ebx, esi
jge 0x4082ec
mov cl, byte [edi + ebx]
lea eax, [ecx - 0x30]
cmp al, 9
ja 0x4082ec
imul eax, dword [ebp - 0x21c], 0xa
inc dword [ebp - 0x23c]
inc dword [ebp - 0x238]
mov dword [ebp - 0x228], eax
mov eax, 0xa
mul dword [ebp - 0x220]
mov dword [ebp - 0x21c], edx
mov dword [ebp - 0x220], eax
mov eax, dword [ebp - 0x228]
add dword [ebp - 0x21c], eax
movzx eax, cl
sub eax, 0x30
cdq
add eax, dword [ebp - 0x220]
adc edx, dword [ebp - 0x21c]
mov dword [ebp - 0x220], eax
mov dword [ebp - 0x21c], edx
inc ebx
cmp ebx, esi
je 0x40823b
cmp byte [edi + ebx], 0x5f
je 0x4082c4
jmp 0x40823b
mov dword [ebp - 0x228], 0
mov dword [ebp - 0x230], 0
mov eax, dword [ebp - 0x22c]
add eax, dword [ebp - 0x230]
mov dword [ebp - 0x238], eax
jne 0x40831a
test ebx, ebx
je 0x4085d2
cmp ebx, 1
jne 0x40831a
cmp byte [ebp - 0x231], 0
jne 0x4085b6
lea edx, [ebx + 1]
cmp edx, esi
jge 0x40838c
mov al, byte [edi + ebx]
and eax, 0xffffffdf
cmp al, 0x45
jne 0x40838c
mov al, byte [edi + edx]
cmp al, 0x2b
je 0x40833b
cmp al, 0x2d
jne 0x408345
or edx, 0xffffffff
jmp 0x408340
mov edx, 1
add ebx, 2
jmp 0x40834c
mov ebx, edx
mov edx, 1
mov al, byte [edi + ebx]
sub eax, 0x30
cmp al, 9
ja 0x4085ba
xor eax, eax
cmp ebx, esi
jge 0x408393
mov cl, byte [edi + ebx]
mov byte [ebp - 0x231], cl
sub ecx, 0x30
cmp cl, 9
ja 0x408393
imul eax, eax, 0xa
movzx ecx, byte [ebp - 0x231]
lea eax, [eax + ecx - 0x30]
inc ebx
cmp ebx, esi
je 0x40835c
cmp byte [edi + ebx], 0x5f
je 0x40837f
jmp 0x40835c
mov edx, 1
xor eax, eax
imul eax, edx
sub eax, dword [ebp - 0x228]
mov esi, eax
neg eax
cmovs eax, esi
mov dword [ebp - 0x228], eax
cmp eax, 0x3e7
jg 0x4083bb
cmp dword [ebp - 0x238], 0xf
jg 0x4083f6
jmp 0x408410
mov eax, dword [ebp - 0x21c]
or eax, dword [ebp - 0x220]
je 0x4083d5
test esi, esi
fldz
js 0x4083ea
fld1
fxch st(1)
jmp 0x4083e3
fstp st(0)
mov eax, dword [ebp + 8]
fldz
fstp qword [eax]
jmp 0x4085d4
fdivp st(1)
jmp 0x408470
fmulp st(1)
mov eax, dword [ebp + 8]
fstp qword [eax]
jmp 0x4085d4
cmp dword [ebp - 0x238], 0x10
jne 0x4084c0
cmp dword [ebp - 0x224], 9
je 0x4084c4
cmp dword [ebp - 0x228], 0x16
jle 0x40843c
mov eax, 0xf
sub eax, dword [ebp - 0x22c]
sub eax, dword [ebp - 0x230]
lea edx, [eax + 0x16]
cmp edx, dword [ebp - 0x228]
jge 0x40847e
fstp st(0)
jmp 0x4084ca
fild qword [ebp - 0x220]
cmp dword [ebp - 0x21c], 0
jns 0x408451
fadd dword [0xe3aabc]
fstp qword [ebp - 0x220]
fld qword [ebp - 0x220]
mov eax, dword [ebp - 0x228]
fmulp st(1)
fld qword [eax*8 + 0xe3a680]
test esi, esi
js 0x408477
fmulp st(1)
jmp 0x40856a
fdivp st(1)
jmp 0x40856a
test esi, esi
js 0x4084c8
fild qword [ebp - 0x220]
cmp dword [ebp - 0x21c], 0
jns 0x408497
fadd dword [0xe3aabc]
mov edx, dword [ebp - 0x228]
fstp qword [ebp - 0x220]
fld qword [ebp - 0x220]
sub edx, eax
fmulp st(1)
fmul qword [eax*8 + 0xe3a680]
fmul qword [edx*8 + 0xe3a680]
jmp 0x40856a
fstp st(0)
jmp 0x4084ca
fstp st(0)
jmp 0x4084ca
fstp st(0)
mov edx, 0x1f4
lea eax, [ebp - 0x20c]
call fcn.00403f05
xor ecx, ecx
test ebx, ebx
je 0x40850b
xor eax, eax
cmp byte [edi], 0x2e
sete al
cmp ebx, eax
jle 0x40850b
mov dl, byte [edi + eax]
mov byte [ebp - 0x220], dl
sub edx, 0x2b
and dl, 0xfd
je 0x408571
mov dl, byte [ebp - 0x220]
sub edx, 0x30
cmp dl, 9
jbe 0x408571
mov eax, esi
mov esi, 0xa
mov dword [esp + 4], 0
sar eax, 0x1f
mov byte [ebp + ecx - 0x20c], 0x45
and eax, 2
add eax, 0x2b
mov byte [ebp + ecx - 0x20b], al
mov eax, dword [ebp - 0x228]
cdq
idiv esi
add edx, 0x30
mov byte [ebp + ecx - 0x208], dl
cdq
idiv esi
add eax, 0x30
add edx, 0x30
mov byte [ebp + ecx - 0x20a], al
lea eax, [ebp - 0x20c]
mov dword [esp], eax
mov byte [ebp + ecx - 0x209], dl
call fcn.00425000
mov eax, dword [ebp + 8]
fstp qword [eax]
jmp 0x4085d4
cmp ecx, 0x1ed
jg 0x408587
mov dl, byte [ebp - 0x220]
mov byte [ebp + ecx - 0x20c], dl
inc ecx
inc eax
cmp ebx, eax
je 0x4084e8
mov dl, byte [edi + eax]
cmp dl, 0x2e
je 0x408587
cmp dl, 0x5f
je 0x408587
jmp 0x4084e8
fstp st(0)
jmp 0x4085bc
fstp st(0)
jmp 0x4085bc
fstp st(0)
jmp 0x4085bc
fstp st(0)
jmp 0x4085bc
fstp st(0)
jmp 0x4085bc
fstp st(0)
jmp 0x4085bc
fstp st(0)
xor ebx, ebx
jmp 0x4085d4
cmp dword [ebp - 0x224], 0xffffffff
jne 0x40822b
jmp 0x40820c
fstp st(0)
add esp, 0x24c
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret 4