Function at 0x4081b8
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 0x4081f0
mov al, byte [ecx]
lea edx, [eax - 0x2b]
and dl, 0xfd
jne 0x4081f0
fld1
cmp al, 0x2d
mov byte [ebp - 0x231], 1
mov ebx, 1
fchs
fld1
fcmove st(0), st(1)
fstp st(1)
jmp 0x4081fb
mov byte [ebp - 0x231], 0
fld1
xor ebx, ebx
lea eax, [ebx + 2]
cmp eax, esi
jge 0x408278
mov al, byte [edi + ebx]
mov edx, ebx
and eax, 0xffffffdf
cmp al, 0x4e
je 0x408218
cmp al, 0x49
jne 0x4082df
jmp 0x408288
fstp st(0)
mov al, byte [edi + ebx + 1]
and eax, 0xffffffdf
cmp al, 0x41
jne 0x408782
mov al, byte [edi + ebx + 2]
and eax, 0xffffffdf
cmp al, 0x4e
jne 0x408782
add ebx, 3
cmp ebx, esi
jge 0x408268
mov al, byte [edi + edx + 3]
mov edx, eax
and edx, 0xffffffdf
sub edx, 0x41
cmp dl, 0x19
jbe 0x408782
lea edx, [eax - 0x30]
cmp dl, 9
jbe 0x408782
cmp al, 0x5f
je 0x408782
fld dword [0x44dc78]
mov eax, dword [ebp + 8]
fstp qword [eax]
jmp 0x40879a
mov dword [ebp - 0x224], 0xffffffff
cmp ebx, esi
jl 0x4082df
jmp 0x4082fe
mov al, byte [edi + ebx + 1]
and eax, 0xffffffdf
cmp al, 0x4e
jne 0x408768
mov al, byte [edi + ebx + 2]
and eax, 0xffffffdf
cmp al, 0x46
jne 0x40876c
add ebx, 3
cmp ebx, esi
jge 0x4082d6
mov al, byte [edi + edx + 3]
mov edx, eax
and edx, 0xffffffdf
sub edx, 0x41
cmp dl, 0x19
jbe 0x408770
lea edx, [eax - 0x30]
cmp dl, 9
jbe 0x408774
cmp al, 0x5f
je 0x408778
fld1
fldz
jmp 0x4085a9
mov dword [ebp - 0x224], 0xffffffff
movzx eax, byte [edi + ebx]
lea edx, [eax - 0x30]
cmp dl, 9
ja 0x4082fe
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 0x40849e
mov cl, byte [edi + ebx]
lea eax, [ecx - 0x30]
cmp al, 9
ja 0x408390
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 0x40831c
cmp byte [edi + ebx], 0x5f
je 0x408383
jmp 0x40831c
cmp cl, 0x2e
jne 0x40849e
inc ebx
cmp dword [ebp - 0x22c], 0
jne 0x4083c3
xor edx, edx
mov eax, edx
cmp ebx, esi
jge 0x4083c5
cmp byte [edi + ebx], 0x30
jne 0x408786
inc edx
inc ebx
cmp ebx, esi
je 0x4083a5
cmp byte [edi + ebx], 0x5f
je 0x4083b6
jmp 0x4083a5
xor eax, eax
cmp dword [ebp - 0x224], 0xffffffff
jne 0x4083f1
cmp ebx, esi
jge 0x4083f1
mov dword [ebp - 0x224], 0xffffffff
movzx edx, byte [edi + ebx]
lea ecx, [edx - 0x30]
cmp cl, 9
ja 0x4083f1
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 0x4084b2
mov cl, byte [edi + ebx]
lea eax, [ecx - 0x30]
cmp al, 9
ja 0x4084b2
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 0x408401
cmp byte [edi + ebx], 0x5f
je 0x40848a
jmp 0x408401
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 0x4084e0
test ebx, ebx
je 0x408798
cmp ebx, 1
jne 0x4084e0
cmp byte [ebp - 0x231], 0
jne 0x40877c
lea edx, [ebx + 1]
cmp edx, esi
jge 0x408552
mov al, byte [edi + ebx]
and eax, 0xffffffdf
cmp al, 0x45
jne 0x408552
mov al, byte [edi + edx]
cmp al, 0x2b
je 0x408501
cmp al, 0x2d
jne 0x40850b
or edx, 0xffffffff
jmp 0x408506
mov edx, 1
add ebx, 2
jmp 0x408512
mov ebx, edx
mov edx, 1
mov al, byte [edi + ebx]
sub eax, 0x30
cmp al, 9
ja 0x408780
xor eax, eax
cmp ebx, esi
jge 0x408559
mov cl, byte [edi + ebx]
mov byte [ebp - 0x231], cl
sub ecx, 0x30
cmp cl, 9
ja 0x408559
imul eax, eax, 0xa
movzx ecx, byte [ebp - 0x231]
lea eax, [eax + ecx - 0x30]
inc ebx
cmp ebx, esi
je 0x408522
cmp byte [edi + ebx], 0x5f
je 0x408545
jmp 0x408522
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 0x408581
cmp dword [ebp - 0x238], 0xf
jg 0x4085bc
jmp 0x4085d6
mov eax, dword [ebp - 0x21c]
or eax, dword [ebp - 0x220]
je 0x40859b
test esi, esi
fldz
js 0x4085b0
fld1
fxch st(1)
jmp 0x4085a9
fstp st(0)
mov eax, dword [ebp + 8]
fldz
fstp qword [eax]
jmp 0x40879a
fdivp st(1)
jmp 0x408636
fmulp st(1)
mov eax, dword [ebp + 8]
fstp qword [eax]
jmp 0x40879a
cmp dword [ebp - 0x238], 0x10
jne 0x408686
cmp dword [ebp - 0x224], 9
je 0x40868a
cmp dword [ebp - 0x228], 0x16
jle 0x408602
mov eax, 0xf
sub eax, dword [ebp - 0x22c]
sub eax, dword [ebp - 0x230]
lea edx, [eax + 0x16]
cmp edx, dword [ebp - 0x228]
jge 0x408644
fstp st(0)
jmp 0x408690
fild qword [ebp - 0x220]
cmp dword [ebp - 0x21c], 0
jns 0x408617
fadd dword [0x44dc7c]
fstp qword [ebp - 0x220]
fld qword [ebp - 0x220]
mov eax, dword [ebp - 0x228]
fmulp st(1)
fld qword [eax*8 + 0x44d760]
test esi, esi
js 0x40863d
fmulp st(1)
jmp 0x408730
fdivp st(1)
jmp 0x408730
test esi, esi
js 0x40868e
fild qword [ebp - 0x220]
cmp dword [ebp - 0x21c], 0
jns 0x40865d
fadd dword [0x44dc7c]
mov edx, dword [ebp - 0x228]
fstp qword [ebp - 0x220]
fld qword [ebp - 0x220]
sub edx, eax
fmulp st(1)
fmul qword [eax*8 + 0x44d760]
fmul qword [edx*8 + 0x44d760]
jmp 0x408730
fstp st(0)
jmp 0x408690
fstp st(0)
jmp 0x408690
fstp st(0)
mov edx, 0x1f4
lea eax, [ebp - 0x20c]
call fcn.00404179
xor ecx, ecx
test ebx, ebx
je 0x4086d1
xor eax, eax
cmp byte [edi], 0x2e
sete al
cmp ebx, eax
jle 0x4086d1
mov dl, byte [edi + eax]
mov byte [ebp - 0x220], dl
sub edx, 0x2b
and dl, 0xfd
je 0x408737
mov dl, byte [ebp - 0x220]
sub edx, 0x30
cmp dl, 9
jbe 0x408737
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.00438590
mov eax, dword [ebp + 8]
fstp qword [eax]
jmp 0x40879a
cmp ecx, 0x1ed
jg 0x40874d
mov dl, byte [ebp - 0x220]
mov byte [ebp + ecx - 0x20c], dl
inc ecx
inc eax
cmp ebx, eax
je 0x4086ae
mov dl, byte [edi + eax]
cmp dl, 0x2e
je 0x40874d
cmp dl, 0x5f
je 0x40874d
jmp 0x4086ae
fstp st(0)
jmp 0x408782
fstp st(0)
jmp 0x408782
fstp st(0)
jmp 0x408782
fstp st(0)
jmp 0x408782
fstp st(0)
jmp 0x408782
fstp st(0)
jmp 0x408782
fstp st(0)
xor ebx, ebx
jmp 0x40879a
cmp dword [ebp - 0x224], 0xffffffff
jne 0x4083f1
jmp 0x4083d2
fstp st(0)
add esp, 0x24c
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret 4