Function at 0x40bde0
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
sub esp, 0x38
push esi
push edi
mov edi, dword [ebx + 8]
mov edx, ecx
xorps xmm0, xmm0
mov dword [ebp - 0x1c], edx
movsd qword [ebp - 0x38], xmm0
mov eax, dword [edi + 0x14]
mov ecx, eax
sub ecx, dword [edi + 8]
add ecx, dword [edi + 0x1c]
mov dword [ebp - 0x24], ecx
cmp byte [eax], 0x2d
jne 0x40be2e
mov ecx, edi
call fcn.00409ec0
mov edx, dword [ebp - 0x1c]
mov byte [ebp - 3], 1
jmp 0x40be32
mov byte [ebp - 3], 0
mov eax, dword [edi + 0x14]
xorps xmm0, xmm0
movlpd qword [ebp - 0x30], xmm0
mov byte [ebp - 2], 0
mov dword [ebp - 0x14], 0
mov cl, byte [eax]
mov byte [ebp - 5], cl
cmp cl, 0x30
jne 0x40be73
xor esi, esi
mov ecx, edi
mov dword [ebp - 0x18], esi
call fcn.00409ec0
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x30]
mov byte [ebp - 1], 0
mov dword [ebp - 0xc], eax
jmp 0x40c051
cmp cl, 0x31
jl 0x40c568
cmp cl, 0x39
jg 0x40c568
mov ecx, edi
call fcn.00409ec0
mov ecx, dword [edi + 0x14]
movsx esi, byte [ebp - 5]
sub esi, 0x30
cmp byte [ebp - 3], 0
mov dword [ebp - 0x18], esi
mov al, byte [ecx]
mov byte [ebp - 4], al
je 0x40bef8
cmp al, 0x30
jl 0x40bee0
cmp al, 0x39
ja 0x40bee0
cmp esi, 0xccccccc
jb 0x40beba
jne 0x40bee8
cmp al, 0x38
ja 0x40bee8
mov ecx, edi
call fcn.00409ec0
movzx eax, byte [ebp - 4]
lea ecx, [esi - 6]
inc dword [ebp - 0x14]
lea ecx, [esi + ecx*4]
lea esi, [eax + ecx*2]
mov ecx, dword [edi + 0x14]
mov dword [ebp - 0x18], esi
mov al, byte [ecx]
mov byte [ebp - 4], al
cmp al, 0x30
jge 0x40bea8
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x10], eax
jmp 0x40bf46
mov dword [ebp - 0xc], esi
mov dword [ebp - 0x10], 0
mov byte [ebp - 2], 1
jmp 0x40bf4c
cmp al, 0x30
jl 0x40bf40
nop dword [eax]
cmp al, 0x39
ja 0x40bf40
cmp esi, 0x19999999
jb 0x40bf1a
jne 0x40c0b6
cmp al, 0x35
ja 0x40c0b6
mov ecx, edi
call fcn.00409ec0
movzx eax, byte [ebp - 4]
lea ecx, [esi - 6]
inc dword [ebp - 0x14]
lea ecx, [esi + ecx*4]
lea esi, [eax + ecx*2]
mov ecx, dword [edi + 0x14]
mov dword [ebp - 0x18], esi
mov al, byte [ecx]
mov byte [ebp - 4], al
cmp al, 0x30
jge 0x40bf00
mov edx, dword [ebp - 0x2c]
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0x30]
mov dword [ebp - 0xc], eax
cmp byte [ebp - 2], 0
mov esi, ecx
mov byte [ebp - 1], 0
je 0x40c002
cmp byte [ebp - 3], 0
mov dl, byte [ecx]
mov byte [ebp - 4], dl
mov edx, dword [ebp - 0x10]
je 0x40c0dc
cmp byte [ebp - 4], 0x30
jl 0x40c002
mov al, byte [ecx]
mov byte [ebp - 4], al
mov eax, dword [ebp - 0xc]
mov cl, byte [ebp - 4]
cmp cl, 0x39
ja 0x40c002
cmp edx, 0xccccccc
jb 0x40bfb9
ja 0x40bf99
cmp eax, 0xcccccccc
jb 0x40bfb9
cmp eax, 0xcccccccc
jne 0x40c0c7
cmp edx, 0xccccccc
jne 0x40c0c7
cmp cl, 0x38
ja 0x40c0c7
mov ecx, edi
call fcn.00409ec0
mov eax, dword [ebp - 0xc]
xor edx, edx
mov ecx, dword [ebp - 0x10]
movzx esi, byte [ebp - 4]
shld ecx, eax, 2
sub esi, 0x30
shl eax, 2
add dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
adc dword [ebp - 0x10], ecx
mov ecx, dword [ebp - 0x10]
shld ecx, eax, 1
add eax, eax
add eax, esi
mov esi, dword [edi + 0x14]
mov dword [ebp - 0xc], eax
adc edx, ecx
inc dword [ebp - 0x14]
mov dword [ebp - 0x10], edx
mov cl, byte [esi]
mov byte [ebp - 4], cl
cmp cl, 0x30
jge 0x40bf83
cmp byte [ebp - 1], 0
je 0x40c04e
cmp byte [esi], 0x30
jl 0x40c04e
mov al, byte [esi]
mov byte [ebp - 4], al
cmp al, 0x39
ja 0x40c04e
mov ecx, edi
call fcn.00409ec0
movzx eax, byte [ebp - 4]
movsd xmm1, qword [ebp - 0x38]
sub eax, 0x30
mulsd xmm1, qword [0x45fd08]
movd xmm0, eax
mov eax, dword [edi + 0x14]
cvtdq2pd xmm0, xmm0
mov al, byte [eax]
mov byte [ebp - 4], al
addsd xmm1, xmm0
movsd qword [ebp - 0x38], xmm1
cmp al, 0x30
jge 0x40c012
mov esi, dword [ebp - 0x18]
mov eax, dword [edi + 0x14]
mov dword [ebp - 0x20], 0
cmp byte [eax], 0x2e
jne 0x40c1fa
mov ecx, edi
call fcn.00409ec0
mov eax, dword [edi + 0x14]
mov dword [ebp - 0x2c], eax
mov cl, byte [eax]
mov byte [ebp - 4], cl
cmp cl, 0x30
jl 0x40c225
cmp cl, 0x39
jg 0x40c225
mov dl, byte [ebp - 1]
test dl, dl
jne 0x40c199
cmp byte [ebp - 2], dl
je 0x40c184
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebp - 0x10]
call fcn.00451cb0
mov eax, dword [ebp - 0x2c]
mov cl, byte [ebp - 4]
mov byte [ebp - 1], 1
jmp 0x40c1a1
xor edx, edx
mov dword [ebp - 0xc], esi
mov dword [ebp - 0x10], edx
mov byte [ebp - 2], 1
jmp 0x40bf4c
mov ecx, eax
call fcn.00451cb0
movsd qword [ebp - 0x38], xmm0
mov byte [ebp - 1], 1
jmp 0x40c002
cmp byte [ebp - 4], 0x30
jl 0x40c002
mov al, byte [ecx]
mov esi, ecx
mov byte [ebp - 4], al
mov eax, dword [ebp - 0xc]
mov cl, byte [ebp - 4]
cmp cl, 0x39
ja 0x40c002
cmp edx, 0x19999999
jb 0x40c121
ja 0x40c10d
cmp eax, 0x99999999
jb 0x40c121
cmp eax, 0x99999999
jne 0x40c16f
cmp edx, 0x19999999
jne 0x40c16f
cmp cl, 0x35
ja 0x40c16f
mov ecx, edi
call fcn.00409ec0
mov eax, dword [ebp - 0xc]
xor edx, edx
mov ecx, dword [ebp - 0x10]
movzx esi, byte [ebp - 4]
shld ecx, eax, 2
sub esi, 0x30
shl eax, 2
add dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
adc dword [ebp - 0x10], ecx
mov ecx, dword [ebp - 0x10]
shld ecx, eax, 1
add eax, eax
add eax, esi
mov esi, dword [edi + 0x14]
mov dword [ebp - 0xc], eax
adc edx, ecx
inc dword [ebp - 0x14]
mov dword [ebp - 0x10], edx
mov cl, byte [esi]
mov byte [ebp - 4], cl
cmp cl, 0x30
jge 0x40c0f3
jmp 0x40c04e
mov ecx, eax
call fcn.00451cb0
movsd qword [ebp - 0x38], xmm0
mov byte [ebp - 1], 1
jmp 0x40c008
mov ecx, esi
xor edx, edx
call fcn.00451cb0
mov eax, dword [ebp - 0x2c]
mov cl, byte [ebp - 4]
mov byte [ebp - 1], 1
jmp 0x40c1a1
movsd xmm0, qword [ebp - 0x38]
mov byte [ebp - 1], dl
movsd qword [ebp - 0x38], xmm0
cmp cl, 0x39
ja 0x40c1fa
mov ecx, edi
call fcn.00409ec0
cmp dword [ebp - 0x14], 0x11
jge 0x40c1ed
movzx eax, byte [ebp - 4]
movsd xmm1, qword [ebp - 0x38]
sub eax, 0x30
mulsd xmm1, qword [0x45fd08]
dec dword [ebp - 0x20]
movd xmm0, eax
cvtdq2pd xmm0, xmm0
addsd xmm1, xmm0
comisd xmm1, xmmword [0x45fd00]
movsd qword [ebp - 0x38], xmm1
jbe 0x40c1ed
inc dword [ebp - 0x14]
mov eax, dword [edi + 0x14]
mov cl, byte [eax]
mov byte [ebp - 4], cl
cmp cl, 0x30
jge 0x40c1a6
mov al, byte [eax]
xor ecx, ecx
cmp al, 0x65
je 0x40c20a
cmp al, 0x45
jne 0x40c331
mov ecx, edi
call fcn.00409ec0
cmp byte [ebp - 1], 0
jne 0x40c255
cmp byte [ebp - 2], 0
je 0x40c243
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebp - 0x10]
jmp 0x40c247
mov edx, dword [ebp - 0x1c]
sub eax, dword [edi + 8]
add eax, dword [edi + 0x1c]
mov dword [edx + 0x18], 0xe
mov dword [edx + 0x1c], eax
pop edi
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret 8
mov ecx, esi
xor edx, edx
call fcn.00451cb0
movsd qword [ebp - 0x38], xmm0
mov byte [ebp - 1], 1
mov ecx, dword [edi + 0x14]
mov byte [ebp - 5], 0
mov al, byte [ecx]
mov byte [ebp - 4], al
cmp al, 0x2b
jne 0x40c26e
mov ecx, edi
call fcn.00409ec0
jmp 0x40c27d
cmp al, 0x2d
jne 0x40c285
mov ecx, edi
call fcn.00409ec0
mov byte [ebp - 5], 1
mov ecx, dword [edi + 0x14]
mov al, byte [ecx]
mov byte [ebp - 4], al
sub al, 0x30
cmp al, 9
ja 0x40c3cf
mov ecx, edi
call fcn.00409ec0
mov eax, dword [edi + 0x14]
movsx ecx, byte [ebp - 4]
sub ecx, 0x30
cmp byte [ebp - 5], 0
mov dword [ebp - 0x14], ecx
mov al, byte [eax]
mov byte [ebp - 4], al
je 0x40c370
mov ecx, dword [ebp - 0x20]
mov eax, 0x66666667
lea ecx, [ecx + 0x7ffffff7]
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [ebp - 0x2c], eax
mov al, byte [ebp - 4]
cmp al, 0x30
jl 0x40c32c
mov esi, dword [ebp - 0x14]
nop dword [eax]
cmp al, 0x39
ja 0x40c326
mov ecx, edi
call fcn.00409ec0
movzx eax, byte [ebp - 4]
lea esi, [esi + esi*4]
lea esi, [esi - 0x18]
lea esi, [eax + esi*2]
cmp esi, dword [ebp - 0x2c]
jle 0x40c31a
mov eax, dword [edi + 0x14]
mov al, byte [eax]
cmp al, 0x30
jl 0x40c31a
cmp al, 0x39
ja 0x40c31a
mov ecx, edi
call fcn.00409ec0
mov eax, dword [edi + 0x14]
mov al, byte [eax]
cmp al, 0x30
jge 0x40c306
mov eax, dword [edi + 0x14]
mov al, byte [eax]
mov byte [ebp - 4], al
cmp al, 0x30
jge 0x40c2e0
mov dword [ebp - 0x14], esi
mov esi, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x14]
neg ecx
cmp byte [ebp - 1], 0
je 0x40c47e
mov eax, dword [ebp - 0x20]
movsd xmm0, qword [ebp - 0x38]
add eax, ecx
cmp eax, 0xfffffecc
jge 0x40c3fd
divsd xmm0, qword [0x45fd18]
add eax, 0x134
cmp eax, 0xfffffecc
jge 0x40c3ed
xorps xmm0, xmm0
jmp 0x40c41d
mov edx, 0x134
sub edx, dword [ebp - 0x20]
mov dword [ebp - 0x2c], edx
cmp al, 0x30
jl 0x40c331
nop
cmp al, 0x39
ja 0x40c331
mov ecx, edi
call fcn.00409ec0
mov eax, dword [ebp - 0x14]
lea ecx, [eax + eax*4]
movzx eax, byte [ebp - 4]
lea ecx, [ecx - 0x18]
lea ecx, [eax + ecx*2]
mov dword [ebp - 0x14], ecx
cmp ecx, dword [ebp - 0x2c]
jg 0x40c3b4
mov eax, dword [edi + 0x14]
mov al, byte [eax]
mov byte [ebp - 4], al
cmp al, 0x30
jge 0x40c380
jmp 0x40c331
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x24]
mov dword [edx + 0x18], 0xd
mov dword [edx + 0x1c], eax
pop edi
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret 8
sub ecx, dword [edi + 8]
mov edx, dword [ebp - 0x1c]
add ecx, dword [edi + 0x1c]
mov dword [edx + 0x18], 0xf
mov dword [edx + 0x1c], ecx
pop edi
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret 8
shl eax, 3
mov ecx, 0x45ecb8
sub ecx, eax
divsd xmm0, qword [ecx]
jmp 0x40c41d
lea ecx, [eax*8]
test eax, eax
js 0x40c412
mulsd xmm0, qword [ecx + 0x45ecb8]
jmp 0x40c41d
mov eax, 0x45ecb8
sub eax, ecx
divsd xmm0, qword [eax]
comisd xmm0, xmmword [0x45fd20]
ja 0x40c3b4
cmp byte [ebp - 3], 0
je 0x40c434
xorps xmm0, xmmword [0x45fd40]
mov ecx, dword [ebx + 0xc]
mov eax, dword [ecx + 0x28]
lea esi, [ecx + 0x18]
sub eax, dword [esi + 0xc]
movsd qword [ebp - 0x38], xmm0
cmp eax, 0x10
jge 0x40c452
push ecx
mov ecx, esi
call fcn.0040c900
mov ecx, dword [esi + 0xc]
xorps xmm0, xmm0
lea eax, [ecx + 0x10]
mov dword [esi + 0xc], eax
mov eax, 0x216
movups xmmword [ecx], xmm0
mov word [ecx + 0xe], ax
movsd xmm0, qword [ebp - 0x38]
movsd qword [ecx], xmm0
pop edi
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret 8
cmp byte [ebp - 2], 0
je 0x40c4d4
cmp byte [ebp - 3], 0
je 0x40c4a3
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x10]
neg eax
adc ecx, 0
neg ecx
push ecx
mov ecx, dword [ebx + 0xc]
push eax
call fcn.0040c620
jmp 0x40c4b1
push dword [ebp - 0x10]
mov ecx, dword [ebx + 0xc]
push dword [ebp - 0xc]
call fcn.0040c590
test al, al
jne 0x40c578
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x24]
mov dword [edx + 0x18], 0x10
mov dword [edx + 0x1c], eax
pop edi
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret 8
mov edi, dword [ebx + 0xc]
mov eax, dword [edi + 0x28]
lea ecx, [edi + 0x18]
sub eax, dword [edi + 0x24]
cmp byte [ebp - 3], 0
je 0x40c528
neg esi
cmp eax, 0x10
jge 0x40c4f3
push ecx
call fcn.0040c900
mov ecx, dword [edi + 0x24]
xorps xmm0, xmm0
test esi, esi
lea eax, [ecx + 0x10]
mov dword [edi + 0x24], 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
pop edi
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret 8
cmp eax, 0x10
jge 0x40c533
push ecx
call fcn.0040c900
mov ecx, dword [edi + 0x24]
xorps xmm0, xmm0
lea eax, [ecx + 0x10]
mov dword [edi + 0x24], eax
movups xmmword [ecx], xmm0
mov dword [ecx], esi
shr esi, 0x1a
not esi
mov dword [ecx + 4], 0
and esi, 0x20
or esi, 0x1d6
mov word [ecx + 0xe], si
pop edi
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret 8
sub eax, dword [edi + 8]
add eax, dword [edi + 0x1c]
mov dword [edx + 0x18], 3
mov dword [edx + 0x1c], eax
pop edi
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret 8