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

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff8
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x40d66d
mov eax, dword fs:[0]
push eax
push ebx
sub esp, 0x50
mov eax, dword [0x413040]
xor eax, ebp
mov dword [ebp - 0x14], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x38], ecx
mov eax, dword [ebx + 0xc]
mov dword [ebp - 0x3c], eax
mov eax, dword [ebx + 8]
mov dword [ebp - 0x18], eax
mov ecx, dword [eax + 4]
mov edi, dword [eax]
mov dword [ebp - 0x5c], ecx
mov dword [ebp - 0x1c], ecx
mov eax, edi
mov dword [ebp - 4], 0
sub eax, ecx
xorps xmm1, xmm1
mov dword [ebp - 0x54], eax
mov al, byte [edi]
cmp al, 0x2d
jne 0x40aed7
mov al, byte [edi + 1]
inc edi
mov dl, 1
jmp 0x40aed9
xor dl, dl
mov byte [ebp - 0x23], dl
xorps xmm0, xmm0
movlpd qword [ebp - 0x50], xmm0
mov esi, edi
mov byte [ebp - 0x21], 0
mov dword [ebp - 0x34], 0
cmp al, 0x30
jne 0x40af07
lea edi, [esi + 1]
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x20], edi
jmp 0x40afbd
cmp al, 0x31
jl 0x40b60e
cmp al, 0x39
jg 0x40b60e
movsx ecx, al
lea edi, [esi + 1]
mov al, byte [edi]
sub ecx, 0x30
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x44], ecx
test dl, dl
je 0x40af7f
cmp al, 0x30
jl 0x40afbd
mov edx, edi
mov esi, edi
cmp al, 0x39
ja 0x40afbd
cmp ecx, 0xccccccc
jb 0x40af50
jne 0x40af74
mov edx, esi
cmp al, 0x38
ja 0x40af74
movsx eax, byte [edx]
lea ecx, [ecx + ecx*4]
inc dword [ebp - 0x34]
lea edi, [edx + 1]
lea ecx, [ecx - 0x18]
mov dword [ebp - 0x20], edi
mov edx, edi
mov esi, edi
lea ecx, [eax + ecx*2]
mov al, byte [edi]
mov dword [ebp - 0x44], ecx
cmp al, 0x30
jge 0x40af38
jmp 0x40afbd
mov dl, 1
mov eax, ecx
xor ecx, ecx
mov byte [ebp - 0x21], dl
jmp 0x40afc6
cmp al, 0x30
jl 0x40afbd
mov edx, edi
mov esi, edi
cmp al, 0x39
jg 0x40afbd
cmp ecx, 0x19999999
jb 0x40af9b
jne 0x40af74
mov edx, esi
cmp al, 0x35
jg 0x40af74
movsx eax, byte [edx]
lea ecx, [ecx + ecx*4]
inc dword [ebp - 0x34]
lea edi, [edx + 1]
lea ecx, [ecx - 0x18]
mov dword [ebp - 0x20], edi
mov edx, edi
mov esi, edi
lea ecx, [eax + ecx*2]
mov al, byte [edi]
mov dword [ebp - 0x44], ecx
cmp al, 0x30
jge 0x40af87
mov eax, dword [ebp - 0x50]
mov ecx, dword [ebp - 0x4c]
mov dl, byte [ebp - 0x21]
xor dh, dh
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], ecx
mov byte [ebp - 0x22], dh
test dl, dl
je 0x40b105
mov dl, byte [edi]
cmp byte [ebp - 0x23], dh
je 0x40b080
cmp dl, 0x30
jl 0x40b102
mov esi, edi
mov dword [ebp - 0x30], esi
cmp dl, 0x39
ja 0x40b0ff
cmp ecx, 0xccccccc
jb 0x40b023
ja 0x40b00c
cmp eax, 0xcccccccc
jb 0x40b023
cmp eax, 0xcccccccc
jne 0x40b06a
cmp ecx, 0xccccccc
jne 0x40b06a
mov esi, dword [ebp - 0x30]
cmp dl, 0x38
ja 0x40b06a
shld ecx, eax, 2
lea edi, [esi + 1]
xor edx, edx
movsx esi, byte [esi]
shl eax, 2
sub esi, 0x30
add dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x2c]
adc dword [ebp - 0x28], ecx
mov ecx, dword [ebp - 0x28]
shld ecx, eax, 1
mov dword [ebp - 0x20], edi
add eax, eax
mov dword [ebp - 0x30], edi
add eax, esi
mov esi, edi
mov dword [ebp - 0x2c], eax
adc edx, ecx
inc dword [ebp - 0x34]
mov ecx, edx
mov dl, byte [edi]
mov dword [ebp - 0x28], ecx
cmp dl, 0x30
jge 0x40aff2
jmp 0x40b0ff
mov edx, ecx
mov ecx, eax
call fcn.0040cb20
mov dh, 1
movaps xmm1, xmm0
mov byte [ebp - 0x22], dh
jmp 0x40b102
cmp dl, 0x30
jl 0x40b102
mov esi, edi
mov dword [ebp - 0x30], esi
nop
cmp dl, 0x39
ja 0x40b0ff
cmp ecx, 0x19999999
jb 0x40b0bd
ja 0x40b0a6
cmp eax, 0x99999999
jb 0x40b0bd
cmp eax, 0x99999999
jne 0x40b06a
cmp ecx, 0x19999999
jne 0x40b06a
mov esi, dword [ebp - 0x30]
cmp dl, 0x35
ja 0x40b06a
shld ecx, eax, 2
lea edi, [esi + 1]
xor edx, edx
movsx esi, byte [esi]
shl eax, 2
sub esi, 0x30
add dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x2c]
adc dword [ebp - 0x28], ecx
mov ecx, dword [ebp - 0x28]
shld ecx, eax, 1
mov dword [ebp - 0x20], edi
add eax, eax
mov dword [ebp - 0x30], edi
add eax, esi
mov esi, edi
mov dword [ebp - 0x2c], eax
adc edx, ecx
inc dword [ebp - 0x34]
mov ecx, edx
mov dl, byte [edi]
mov dword [ebp - 0x28], ecx
cmp dl, 0x30
jge 0x40b090
mov dh, byte [ebp - 0x22]
mov dl, byte [ebp - 0x21]
movsd xmm2, qword [0x40f528]
test dh, dh
je 0x40b148
mov al, byte [edi]
cmp al, 0x30
jl 0x40b148
mov ecx, edi
nop dword [eax]
cmp al, 0x39
ja 0x40b148
movsx eax, byte [ecx]
lea edi, [ecx + 1]
sub eax, 0x30
mulsd xmm1, xmm2
mov dword [ebp - 0x20], edi
mov ecx, edi
movd xmm0, eax
mov al, byte [edi]
cvtdq2pd xmm0, xmm0
addsd xmm1, xmm0
cmp al, 0x30
jge 0x40b120
mov al, byte [edi]
mov dword [ebp - 0x30], 0
cmp al, 0x2e
jne 0x40b159
inc edi
mov dword [ebp - 0x20], edi
mov esi, edi
cmp al, 0x2e
jne 0x40b204
mov al, byte [esi]
cmp al, 0x30
jl 0x40b228
cmp al, 0x39
jg 0x40b228
test dh, dh
jne 0x40b1a0
test dl, dl
je 0x40b185
mov ecx, dword [ebp - 0x2c]
mov edx, dword [ebp - 0x28]
jmp 0x40b18a
mov ecx, dword [ebp - 0x44]
xor edx, edx
call fcn.0040cb20
movsd xmm2, qword [0x40f528]
movaps xmm1, xmm0
mov byte [ebp - 0x22], 1
jmp 0x40b1a3
mov byte [ebp - 0x22], dh
mov cl, byte [edi]
mov eax, esi
mov dword [ebp - 0x4c], esi
mov edx, esi
xorps xmm3, xmm3
nop
mov esi, edx
cmp cl, 0x39
jg 0x40b201
mov ecx, dword [ebp - 0x34]
cmp ecx, 0x11
jge 0x40b1ea
dec dword [ebp - 0x30]
lea edi, [eax + 1]
movsx eax, byte [eax]
sub eax, 0x30
mulsd xmm1, xmm2
mov dword [ebp - 0x20], edi
movd xmm0, eax
cvtdq2pd xmm0, xmm0
addsd xmm1, xmm0
comisd xmm1, xmm3
jbe 0x40b1f1
inc ecx
mov dword [ebp - 0x34], ecx
jmp 0x40b1f1
mov edi, dword [ebp - 0x4c]
inc edi
mov dword [ebp - 0x20], edi
mov cl, byte [edi]
mov esi, edi
mov eax, esi
mov dword [ebp - 0x4c], eax
mov edx, eax
cmp cl, 0x30
jge 0x40b1b0
mov dh, byte [ebp - 0x22]
cmp byte [esi], 0x65
je 0x40b212
cmp byte [esi], 0x45
jne 0x40b35e
lea edi, [esi + 1]
mov esi, edi
test dh, dh
jne 0x40b24c
cmp byte [ebp - 0x21], dh
je 0x40b23b
mov ecx, dword [ebp - 0x2c]
mov edx, dword [ebp - 0x28]
jmp 0x40b240
mov ecx, dword [ebp - 0x38]
mov eax, 0xe
sub esi, dword [ebp - 0x5c]
mov dword [ebp - 0x3c], ecx
jmp 0x40b623
mov ecx, dword [ebp - 0x44]
xor edx, edx
call fcn.0040cb20
movaps xmm1, xmm0
mov byte [ebp - 0x22], 1
mov cl, byte [esi]
xor dl, dl
cmp cl, 0x2b
je 0x40b25c
cmp cl, 0x2d
jne 0x40b264
mov dl, 1
mov cl, byte [esi + 1]
lea edi, [esi + 1]
mov esi, edi
lea eax, [ecx - 0x30]
cmp al, 9
ja 0x40b349
lea edi, [esi + 1]
movsx esi, cl
mov cl, byte [edi]
sub esi, 0x30
mov dword [ebp - 0x20], edi
mov byte [ebp - 0x3d], cl
test dl, dl
je 0x40b306
mov ecx, dword [ebp - 0x30]
mov eax, 0x66666667
add ecx, 0x7ffffff7
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp byte [ebp - 0x3d], 0x30
mov dword [ebp - 0x4c], eax
jl 0x40b302
mov al, byte [edi]
mov edx, edi
nop
cmp al, 0x39
jg 0x40b302
movsx eax, byte [edx]
lea ecx, [esi + esi*4]
lea esi, [ecx - 0x18]
lea edi, [edx + 1]
mov dword [ebp - 0x20], edi
mov edx, edi
lea esi, [eax + esi*2]
mov dword [ebp - 0x34], esi
cmp esi, dword [ebp - 0x4c]
jle 0x40b2fc
mov al, byte [edi]
cmp al, 0x30
jl 0x40b2fc
mov ecx, edi
mov esi, edi
nop word [eax + eax]
mov edx, ecx
cmp al, 0x39
ja 0x40b2f9
mov al, byte [esi + 1]
lea edi, [esi + 1]
mov dword [ebp - 0x20], edi
mov ecx, edi
mov edx, edi
mov esi, edi
cmp al, 0x30
jge 0x40b2e0
mov esi, dword [ebp - 0x34]
mov al, byte [edi]
cmp al, 0x30
jge 0x40b2b0
neg esi
jmp 0x40b360
mov edx, dword [ebp - 0x30]
mov eax, 0x134
sub eax, edx
mov dword [ebp - 0x4c], eax
cmp cl, 0x30
jl 0x40b363
mov al, byte [edi]
mov edx, edi
nop dword [eax]
cmp al, 0x39
jg 0x40b360
movsx eax, byte [edx]
lea ecx, [esi + esi*4]
lea esi, [ecx - 0x18]
lea edi, [edx + 1]
mov dword [ebp - 0x20], edi
lea esi, [eax + esi*2]
cmp esi, dword [ebp - 0x4c]
jg 0x40b3d0
mov al, byte [edi]
mov edx, edi
cmp al, 0x30
jge 0x40b320
jmp 0x40b360
mov eax, dword [ebp - 0x38]
sub esi, dword [ebp - 0x5c]
mov dword [eax + 0x18], 0xf
mov dword [eax + 0x1c], esi
jmp 0x40b639
xor esi, esi
mov edx, dword [ebp - 0x30]
cmp byte [ebp - 0x22], 0
je 0x40b434
lea eax, [esi + edx]
cmp eax, 0xfffffecc
jge 0x40b3a3
divsd xmm1, qword [0x40f530]
add eax, 0x134
cmp eax, 0xfffffecc
jge 0x40b390
xorps xmm0, xmm0
jmp 0x40b3c6
shl eax, 3
mov ecx, 0x40ea48
sub ecx, eax
movaps xmm0, xmm1
divsd xmm0, qword [ecx]
jmp 0x40b3c6
lea ecx, [eax*8]
movaps xmm0, xmm1
test eax, eax
js 0x40b3bb
mulsd xmm0, qword [ecx + 0x40ea48]
jmp 0x40b3c6
mov eax, 0x40ea48
sub eax, ecx
divsd xmm0, qword [eax]
comisd xmm0, xmmword [0x40f538]
jbe 0x40b3e5
mov eax, dword [ebp - 0x38]
mov ecx, dword [ebp - 0x54]
mov dword [eax + 0x18], 0xd
mov dword [eax + 0x1c], ecx
jmp 0x40b639
cmp byte [ebp - 0x23], 0
je 0x40b3f2
xorps xmm0, xmmword [0x40f540]
mov esi, dword [ebp - 0x3c]
movsd qword [ebp - 0x58], xmm0
mov eax, dword [esi + 0x28]
sub eax, dword [esi + 0x24]
cmp eax, 0x10
jge 0x40b40e
push ecx
lea ecx, [esi + 0x18]
call fcn.0040b8c0
mov ecx, dword [esi + 0x24]
xorps xmm0, xmm0
movsd xmm3, qword [ebp - 0x58]
lea eax, [ecx + 0x10]
mov dword [esi + 0x24], eax
mov eax, 0x216
movups xmmword [ecx], xmm0
mov word [ecx + 0xe], ax
movsd qword [ecx], xmm3
jmp 0x40b639
mov edx, dword [ebp - 0x3c]
add edx, 0x18
mov dword [ebp - 0x38], edx
mov eax, dword [edx + 0x10]
sub eax, dword [edx + 0xc]
cmp byte [ebp - 0x21], 0
je 0x40b589
cmp byte [ebp - 0x23], 0
je 0x40b505
mov esi, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x28]
neg esi
adc ecx, 0
neg ecx
mov dword [ebp - 0x28], ecx
cmp eax, 0x10
jge 0x40b47a
push ecx
mov ecx, edx
call fcn.0040b8c0
mov ecx, dword [ebp - 0x28]
mov edx, dword [ebp - 0x38]
mov eax, dword [edx + 0xc]
xorps xmm0, xmm0
mov dword [ebp - 0x3c], eax
add eax, 0x10
mov dword [edx + 0xc], eax
mov eax, 0x96
mov edx, dword [ebp - 0x3c]
movups xmmword [edx], xmm0
mov dword [edx], esi
mov dword [edx + 4], ecx
mov word [edx + 0xe], ax
test ecx, ecx
jl 0x40b4e0
jg 0x40b4a7
test esi, esi
jb 0x40b4e0
mov eax, 0x196
mov word [edx + 0xe], ax
xor eax, eax
or eax, ecx
jne 0x40b4c1
mov eax, 0x1d6
mov word [edx + 0xe], ax
jmp 0x40b4c6
mov eax, 0x196
and esi, 0x80000000
or esi, ecx
jne 0x40b639
or eax, 0x20
mov word [edx + 0xe], ax
jmp 0x40b639
cmp ecx, 0xffffffff
jl 0x40b639
jg 0x40b4f7
cmp esi, 0x80000000
jb 0x40b639
mov eax, 0xb6
mov word [edx + 0xe], ax
jmp 0x40b639
cmp eax, 0x10
jge 0x40b515
push ecx
mov ecx, edx
call fcn.0040b8c0
mov edx, dword [ebp - 0x38]
mov esi, dword [edx + 0xc]
xorps xmm0, xmm0
mov ecx, dword [ebp - 0x2c]
lea eax, [esi + 0x10]
mov dword [edx + 0xc], eax
mov eax, 0x116
mov edx, dword [ebp - 0x28]
mov dword [ebp - 0x3c], eax
movups xmmword [esi], xmm0
mov dword [esi], ecx
mov dword [esi + 4], edx
mov word [esi + 0xe], ax
test edx, edx
jl 0x40b551
jg 0x40b545
test ecx, ecx
jb 0x40b551
mov eax, 0x196
mov word [esi + 0xe], ax
mov dword [ebp - 0x3c], eax
movzx eax, ax
mov dword [ebp - 0x54], eax
xor eax, eax
or eax, edx
jne 0x40b56c
mov eax, dword [ebp - 0x3c]
or eax, 0x40
mov word [esi + 0xe], ax
movzx eax, ax
jmp 0x40b56f
mov eax, dword [ebp - 0x54]
and ecx, 0x80000000
or ecx, edx
jne 0x40b639
or eax, 0x20
mov word [esi + 0xe], ax
jmp 0x40b639
cmp byte [ebp - 0x23], 0
je 0x40b5d0
mov esi, dword [ebp - 0x44]
neg esi
cmp eax, 0x10
jge 0x40b5a4
push ecx
mov ecx, edx
call fcn.0040b8c0
mov edx, dword [ebp - 0x38]
mov ecx, dword [edx + 0xc]
xorps xmm0, xmm0
test esi, esi
lea eax, [ecx + 0x10]
mov dword [edx + 0xc], eax
mov eax, esi
cdq
movups xmmword [ecx], xmm0
mov dword [ecx], eax
mov eax, 0xb6
mov dword [ecx + 4], edx
mov edx, 0x1f6
cmovns eax, edx
mov word [ecx + 0xe], ax
jmp 0x40b639
cmp eax, 0x10
jge 0x40b5e0
push ecx
mov ecx, edx
call fcn.0040b8c0
mov edx, dword [ebp - 0x38]
mov ecx, dword [edx + 0xc]
xorps xmm0, xmm0
lea eax, [ecx + 0x10]
mov dword [edx + 0xc], eax
mov eax, dword [ebp - 0x44]
movups xmmword [ecx], xmm0
mov dword [ecx], eax
shr eax, 0x1a
not eax
mov dword [ecx + 4], 0
and eax, 0x20
or eax, 0x1d6
mov word [ecx + 0xe], ax
jmp 0x40b639
mov eax, dword [ebp - 0x38]
sub esi, ecx
mov dword [ebp - 0x54], 3
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x54]
mov edx, dword [ebp - 0x38]
mov ecx, 0x18
mov dword [edx + ecx], eax
mov edx, 0x1c
mov ecx, dword [ebp - 0x3c]
mov dword [edx + ecx], esi
mov ecx, dword [ebx + 8]
mov eax, dword [ebp - 0x5c]
mov dword [ecx], edi
mov dword [ecx + 4], eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.0040bdd2
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret 8