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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
mov eax, dword [0x64c194]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x2c], eax
movzx eax, word [ecx]
test ax, ax
push ebx
mov ebx, dword [ebp + 0x10]
je 0x40aed7
push esi
push edi
jmp 0x40a9cd
mov ecx, dword [ebp - 0x34]
inc ecx
inc ecx
cmp ax, 0x25
mov dword [ebp - 0x34], ecx
je 0x40a9de
push eax
jmp 0x40ad7c
and dword [ebp - 0x24], 0
and dword [ebp - 0x28], 0
mov edi, dword [ebp - 0x2c]
mov esi, dword [ebp - 0x34]
mov byte [ebp - 0x1a], 0
mov byte [ebp - 0x19], 0
mov dword [ebp - 0x38], 0x20
movzx edx, word [esi]
movzx eax, dx
inc esi
inc esi
mov ecx, eax
sub ecx, 0
mov dword [ebp - 0x3c], edx
mov dword [ebp - 0x34], esi
je 0x40aed5
sub ecx, 0x2d
je 0x40aaba
dec ecx
je 0x40aab1
sub ecx, 0x21
je 0x40a9fb
sub ecx, 0xc
je 0x40aa96
lea ecx, [eax - 0x30]
cmp ecx, 0xa
jae 0x40aa3b
lea ecx, [eax - 0x30]
jmp 0x40aa50
movzx ecx, word [0x65123c]
sub eax, ecx
cmp eax, 0xa
jae 0x40aa4d
mov ecx, eax
jmp 0x40aa50
or ecx, 0xffffffff
cmp ecx, 9
ja 0x40aac3
test ecx, ecx
jne 0x40aa70
mov eax, dword [edi + 4]
test eax, eax
jne 0x40aa69
mov dword [ebp - 0x38], 0x30
jmp 0x40aa70
movzx eax, word [eax + 0x24]
mov dword [ebp - 0x38], eax
cmp byte [ebp - 0x19], 0
je 0x40aa86
mov eax, dword [ebp - 0x28]
imul eax, eax, 0xa
add eax, ecx
mov dword [ebp - 0x28], eax
jmp 0x40a9fb
mov eax, dword [ebp - 0x24]
imul eax, eax, 0xa
add eax, ecx
mov dword [ebp - 0x24], eax
jmp 0x40a9fb
push 0x5d
push esi
call fcn.0052ec06
mov esi, eax
test esi, esi
pop ecx
pop ecx
je 0x40a9fb
inc esi
inc esi
jmp 0x40a9fb
mov byte [ebp - 0x19], 1
jmp 0x40a9fb
mov byte [ebp - 0x1a], 1
jmp 0x40a9fb
movzx eax, dx
xor esi, esi
xor cl, cl
cmp eax, 0x5a
mov dword [ebp - 0x30], esi
jg 0x40ac35
je 0x40aec6
cmp eax, 0x49
jg 0x40abaf
je 0x40ab9d
cmp eax, 0x42
jg 0x40ab58
je 0x40ab44
test eax, eax
je 0x40aed5
cmp eax, 0x2f
je 0x40ab3a
cmp eax, 0x3a
je 0x40ab2a
cmp eax, 0x41
jne 0x40ad79
mov eax, dword [ebx + 0x18]
cmp eax, 7
jge 0x40aec6
mov edx, edi
mov eax, dword [edx + eax*4 + 0x88]
mov dword [ebp - 0x30], eax
jmp 0x40ada2
mov eax, edi
mov eax, dword [eax + 0xb8]
mov dword [ebp - 0x30], eax
jmp 0x40adb0
mov eax, edi
mov eax, dword [eax + 0xbc]
jmp 0x40ab22
mov eax, dword [ebx + 0x10]
cmp eax, 0xc
jge 0x40aec6
mov edx, edi
mov eax, dword [edx + eax*4 + 0x3c]
jmp 0x40ab22
sub eax, 0x43
je 0x40ab88
dec eax
je 0x40ab71
sub eax, 4
jne 0x40ad79
mov esi, dword [ebx + 8]
jmp 0x40adb0
push edi
push ebx
push str._m___d___y
push dword [ebp - 0x20]
call fcn.0040a997
add esp, 0x10
jmp 0x40aec6
mov eax, dword [ebx + 0x14]
add eax, 0x76c
push 0x64
cdq
pop esi
idiv esi
mov esi, eax
jmp 0x40ada2
mov eax, dword [ebx + 8]
dec eax
push 0xc
cdq
pop ecx
idiv ecx
mov esi, edx
inc esi
jmp 0x40adb0
cmp eax, 0x55
jg 0x40abf8
je 0x40abeb
sub eax, 0x4d
je 0x40abe3
sub eax, 5
je 0x40abda
dec eax
je 0x40abd3
dec eax
jne 0x40ad79
push edi
push ebx
push str._H_:_M_:_S
jmp 0x40ab78
mov esi, dword [ebx]
jmp 0x40adb0
push edi
push ebx
push str._H_:_M
jmp 0x40ab78
mov esi, dword [ebx + 4]
jmp 0x40adb0
mov eax, dword [ebx + 0x1c]
sub eax, dword [ebx + 0x18]
add eax, 7
push 7
jmp 0x40ab92
sub eax, 0x57
je 0x40ac24
dec eax
je 0x40ac15
dec eax
jne 0x40ad79
mov esi, dword [ebx + 0x14]
add esi, 0x76c
jmp 0x40ada2
mov eax, edi
push eax
push ebx
push dword [eax + 0xa4]
jmp 0x40ab78
mov eax, dword [ebx + 0x18]
dec eax
cdq
push 7
pop esi
idiv esi
mov eax, dword [ebx + 0x1c]
sub eax, edx
jmp 0x40abf1
cmp eax, 0x6d
jg 0x40ad13
je 0x40ad07
cmp eax, 0x64
jg 0x40acb2
je 0x40acff
sub eax, 0x5f
je 0x40aca4
dec eax
dec eax
je 0x40ac8d
dec eax
je 0x40ace1
dec eax
jne 0x40ad79
push edi
push ebx
push 0x5d3654
push dword [ebp - 0x20]
call fcn.0040a997
push edi
push ebx
push dword [edi + 0xc0]
push dword [ebp - 0x20]
call fcn.0040a997
add esp, 0x20
jmp 0x40aec6
mov eax, dword [ebx + 0x18]
cmp eax, 7
jge 0x40aec6
mov edx, edi
mov eax, dword [edx + eax*4 + 0x6c]
jmp 0x40ab22
mov cl, 1
mov dword [ebp - 0x30], 0x5d3650
jmp 0x40ada2
sub eax, 0x65
je 0x40acf8
push 3
pop edx
sub eax, edx
je 0x40ace1
dec eax
dec eax
jne 0x40ad79
cmp dword [ebp - 0x24], eax
jne 0x40acd8
cmp byte [ebp - 0x1a], al
jne 0x40acd8
cmp byte [ebp - 0x19], al
jne 0x40acd8
mov dword [ebp - 0x28], edx
mov esi, dword [ebx + 0x1c]
inc esi
jmp 0x40ada2
mov eax, dword [ebx + 0x10]
cmp eax, 0xc
jge 0x40aec6
mov edx, edi
mov eax, dword [edx + eax*4 + 0xc]
jmp 0x40ab22
mov dword [ebp - 0x24], 2
mov esi, dword [ebx + 0xc]
jmp 0x40ada2
mov esi, dword [ebx + 0x10]
mov dword [ebp - 0x24], 2
jmp 0x40acdb
cmp eax, 0x75
jg 0x40ad6e
je 0x40ad5f
sub eax, 0x6e
je 0x40ad5b
dec eax
dec eax
je 0x40ad46
dec eax
dec eax
je 0x40ad3a
dec eax
dec eax
jne 0x40ad79
push 9
mov ecx, dword [ebp - 0x20]
call fcn.0040a964
jmp 0x40adc1
push edi
push ebx
push str._I_:_M_:_S__p
jmp 0x40ab78
xor eax, eax
cmp dword [ebx + 8], 0xc
setge al
mov eax, dword [edi + eax*4 + 0xb0]
jmp 0x40ab32
push 0xa
jmp 0x40ad2d
mov eax, dword [ebx + 0x18]
dec eax
push 7
cdq
pop esi
idiv esi
mov esi, edx
inc esi
jmp 0x40ad9e
sub eax, 0x77
je 0x40ad9b
dec eax
je 0x40ad8e
dec eax
je 0x40ad89
push dword [ebp - 0x3c]
mov ecx, dword [ebp - 0x20]
call fcn.0040a964
jmp 0x40aec6
mov esi, dword [ebx + 0x14]
jmp 0x40ada2
push edi
push ebx
push dword [edi + 0xa8]
jmp 0x40ab78
mov esi, dword [ebx + 0x18]
mov byte [ebp - 0x19], 1
cmp dword [ebx + 0x18], 0xffffffff
je 0x40aec6
test cl, cl
je 0x40adba
cmp dword [ebx + 8], 0xffffffff
je 0x40aec6
mov eax, dword [ebp - 0x30]
test eax, eax
jne 0x40ae2b
cmp dword [ebp - 0x24], 0
jne 0x40adda
cmp byte [ebp - 0x1a], 0
jne 0x40adda
cmp byte [ebp - 0x19], 0
jne 0x40adda
mov dword [ebp - 0x28], 2
and word [ebp - 6], 0
mov eax, edi
movzx edi, word [eax + 0xc4]
lea ecx, [ebp - 6]
mov eax, esi
xor edx, edx
push 0xa
pop esi
div esi
dec ecx
dec ecx
add edx, edi
cmp dword [ebp - 0x28], 0
mov word [ecx], dx
mov esi, eax
jbe 0x40ae06
dec dword [ebp - 0x28]
test esi, esi
je 0x40ae11
lea eax, [ebp - 0x18]
cmp ecx, eax
jne 0x40adeb
mov eax, ecx
mov dword [ebp - 0x30], ecx
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
test cx, cx
jne 0x40ae19
sub eax, edx
sar eax, 1
mov esi, eax
jmp 0x40ae50
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
test cx, cx
jne 0x40ae2e
sub eax, edx
sar eax, 1
cmp dword [ebp - 0x28], 0
mov esi, eax
jbe 0x40ae4c
cmp esi, dword [ebp - 0x28]
jbe 0x40ae4c
mov esi, dword [ebp - 0x28]
and dword [ebp - 0x28], 0
cmp byte [ebp - 0x1a], 0
jne 0x40ae6e
cmp esi, dword [ebp - 0x24]
jae 0x40ae6e
sub dword [ebp - 0x24], esi
push dword [ebp - 0x38]
mov ecx, dword [ebp - 0x20]
call fcn.0040a964
dec dword [ebp - 0x24]
jne 0x40ae5e
cmp dword [ebp - 0x28], 0
jbe 0x40ae8c
mov eax, dword [ebp - 0x2c]
movzx eax, word [eax + 0xc4]
mov ecx, dword [ebp - 0x20]
push eax
call fcn.0040a964
dec dword [ebp - 0x28]
jne 0x40ae74
test esi, esi
jbe 0x40aea9
mov edi, dword [ebp - 0x30]
movzx eax, word [edi]
test ax, ax
je 0x40aea9
mov ecx, dword [ebp - 0x20]
push eax
call fcn.0040a964
inc edi
inc edi
dec esi
jne 0x40ae93
cmp byte [ebp - 0x1a], 0
je 0x40aec6
cmp esi, dword [ebp - 0x24]
jae 0x40aec6
sub dword [ebp - 0x24], esi
mov ecx, dword [ebp - 0x20]
push 0x20
call fcn.0040a964
dec dword [ebp - 0x24]
jne 0x40aeb7
mov eax, dword [ebp - 0x34]
movzx eax, word [eax]
test ax, ax
jne 0x40a9ca
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop ebx
call fcn.0052a758
leave
ret