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

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x228
xor eax, eax
mov r10, rcx
mov rbx, rdx
test rcx, rcx
je 0x40776d
mov rax, qword [rcx]
cmp rax, r8
jle 0x40779d
mov dl, byte [r10 + r8 + 0x10]
lea ecx, [rdx - 0x2b]
and cl, 0xfd
jne 0x40779d
movsd xmm1, qword [0x00447120]
cmp dl, 0x2d
je 0x407794
movsd xmm1, qword [0x00447128]
lea r9, [r8 + 1]
mov r11b, 1
jmp 0x4077ab
movsd xmm1, qword [0x00447128]
mov r9, r8
xor r11d, r11d
lea rcx, [r9 + 2]
cmp rcx, rax
jge 0x407847
mov dl, byte [r10 + r9 + 0x10]
and edx, 0xffffffdf
cmp dl, 0x4e
je 0x4077cf
cmp dl, 0x49
jne 0x407847
jmp 0x407852
mov dl, byte [r10 + r9 + 0x11]
xor r12d, r12d
and edx, 0xffffffdf
cmp dl, 0x41
jne 0x407c51
mov dl, byte [r10 + rcx + 0x10]
and edx, 0xffffffdf
cmp dl, 0x4e
jne 0x407c51
add r9, 3
cmp r9, rax
jge 0x407827
mov al, byte [r10 + r9 + 0x10]
mov edx, eax
and edx, 0xffffffdf
sub edx, 0x41
cmp dl, 0x19
jbe 0x407c51
lea edx, [rax - 0x30]
cmp dl, 9
jbe 0x407c3d
cmp al, 0x5f
je 0x407c3d
movsd xmm0, qword [0x00447130]
xorps xmm1, xmm1
mulsd xmm0, xmm0
cvtsd2ss xmm0, xmm0
mulss xmm0, xmm1
cvtss2sd xmm0, xmm0
jmp 0x407ab0
or rcx, 0xffffffffffffffff
cmp r9, rax
jl 0x4078b3
jmp 0x4078cc
mov dl, byte [r10 + r9 + 0x11]
xor r12d, r12d
and edx, 0xffffffdf
cmp dl, 0x4e
jne 0x407c51
mov dl, byte [r10 + rcx + 0x10]
and edx, 0xffffffdf
cmp dl, 0x46
jne 0x407c51
add r9, 3
cmp r9, rax
jge 0x407a98
mov al, byte [r10 + r9 + 0x10]
mov edx, eax
and edx, 0xffffffdf
sub edx, 0x41
cmp dl, 0x19
jbe 0x407c51
lea edx, [rax - 0x30]
cmp dl, 9
jbe 0x407c3d
cmp al, 0x5f
je 0x407c3d
jmp 0x407a98
mov dl, byte [r10 + r9 + 0x10]
or rcx, 0xffffffffffffffff
lea esi, [rdx - 0x30]
cmp sil, 9
ja 0x4078cc
movzx ecx, dl
sub rcx, 0x30
xor r13d, r13d
xor esi, esi
cmp r9, rax
jge 0x4079a6
movzx edx, byte [r10 + r9 + 0x10]
lea edi, [rdx - 0x30]
cmp dil, 9
ja 0x407907
imul rsi, rsi, 0xa
inc r13
lea rsi, [rsi + rdx - 0x30]
inc r9
cmp r9, rax
je 0x4078d1
cmp byte [r10 + r9 + 0x10], 0x5f
je 0x4078f5
jmp 0x4078d1
cmp dl, 0x2e
jne 0x4079a6
inc r9
test r13, r13
jne 0x407943
xor edx, edx
mov r12, rdx
cmp r9, rax
jge 0x407946
cmp byte [r10 + r9 + 0x10], 0x30
jne 0x407c42
inc rdx
inc r9
cmp r9, rax
je 0x40791a
cmp byte [r10 + r9 + 0x10], 0x5f
je 0x407931
jmp 0x40791a
xor r12d, r12d
cmp rcx, 0xffffffffffffffff
jne 0x40796a
cmp r9, rax
jge 0x40796a
mov dl, byte [r10 + r9 + 0x10]
or rcx, 0xffffffffffffffff
lea edi, [rdx - 0x30]
cmp dil, 9
ja 0x40796a
movzx ecx, dl
sub rcx, 0x30
xor edx, edx
lea r14, [r12 + rdx]
mov rbp, rdx
cmp r9, rax
jge 0x4079ab
movzx edi, byte [r10 + r9 + 0x10]
lea r15d, [rdi - 0x30]
cmp r15b, 9
ja 0x4079ab
imul rsi, rsi, 0xa
inc rdx
lea rsi, [rsi + rdi - 0x30]
inc r9
cmp r9, rax
je 0x40796c
cmp byte [r10 + r9 + 0x10], 0x5f
je 0x407994
jmp 0x40796c
xor r14d, r14d
xor ebp, ebp
mov r12, r13
add r12, rbp
jne 0x4079ce
cmp r9, r8
je 0x407c51
lea rdx, [r8 + 1]
cmp rdx, r9
jne 0x4079ce
test r11b, r11b
jne 0x407c51
lea rdx, [r9 + 1]
cmp rdx, rax
jge 0x407a53
mov r11b, byte [r10 + r9 + 0x10]
and r11d, 0xffffffdf
cmp r11b, 0x45
jne 0x407a53
mov r11b, byte [r10 + rdx + 0x10]
cmp r11b, 0x2b
je 0x4079fd
or rdi, 0xffffffffffffffff
cmp r11b, 0x2d
je 0x407a02
jmp 0x407a08
mov edi, 1
add r9, 2
jmp 0x407a10
mov r9, rdx
mov edi, 1
mov dl, byte [r10 + r9 + 0x10]
sub edx, 0x30
cmp dl, 9
ja 0x407c3d
xor r11d, r11d
cmp r9, rax
jge 0x407a5b
movzx r15d, byte [r10 + r9 + 0x10]
lea edx, [r15 - 0x30]
cmp dl, 9
ja 0x407a5b
imul rdx, r11, 0xa
lea r11, [rdx + r15 - 0x30]
inc r9
cmp r9, rax
je 0x407a24
cmp byte [r10 + r9 + 0x10], 0x5f
je 0x407a41
jmp 0x407a24
mov edi, 1
xor r11d, r11d
imul r11, rdi
sub r11, r14
mov rax, r11
sar rax, 0x3f
mov rdi, rax
xor rdi, r11
sub rdi, rax
cmp rdi, 0x3e7
jg 0x407a83
cmp r12, 0xf
jg 0x407abf
jmp 0x407ad3
test rsi, rsi
je 0x407a8f
test r11, r11
jns 0x407a98
jmp 0x407aa9
mov qword [rbx], 0
jmp 0x407ab4
movsd xmm0, qword [0x00447128]
xorps xmm2, xmm2
divsd xmm0, xmm2
jmp 0x407aac
xorps xmm0, xmm0
mulsd xmm0, xmm1
movsd qword [rbx], xmm0
sub r9, r8
mov r12, r9
jmp 0x407c51
cmp r12, 0x10
jne 0x407b77
cmp rcx, 8
jg 0x407b77
cmp rdi, 0x16
jle 0x407af2
mov eax, 0xf
sub rax, r13
sub rax, rbp
lea rdx, [rax + 0x16]
cmp rdx, rdi
jge 0x407b2e
jmp 0x407b77
test rsi, rsi
js 0x407afe
cvtsi2sd xmm0, rsi
jmp 0x407b13
mov rcx, rsi
and esi, 1
shr rcx, 1
or rcx, rsi
cvtsi2sd xmm0, rcx
addsd xmm0, xmm0
lea rax, [0x00446aa0]
mulsd xmm0, xmm1
movsd xmm1, qword [rax + rdi*8]
test r11, r11
jns 0x407aac
divsd xmm0, xmm1
jmp 0x407ab0
test r11, r11
js 0x407b77
sub r9, r8
mov r12, r9
test rsi, rsi
js 0x407b45
cvtsi2sd xmm0, rsi
jmp 0x407b5a
mov rcx, rsi
and esi, 1
shr rcx, 1
or rcx, rsi
cvtsi2sd xmm0, rcx
addsd xmm0, xmm0
lea rcx, [0x00446aa0]
mulsd xmm0, xmm1
sub rdi, rax
mulsd xmm0, qword [rcx + rax*8]
mulsd xmm0, qword [rcx + rdi*8]
jmp 0x407c05
lea r13, [rsp + 0x2c]
mov edx, 0x1f4
mov rcx, r13
call fcn.00402c4d
xor ecx, ecx
mov r12, r9
sub r12, r8
cmp r9, r8
jle 0x407bbd
cmp byte [r10 + r8 + 0x10], 0x2e
jne 0x407ba1
inc r8
xor ecx, ecx
cmp r9, r8
jle 0x407bbd
mov al, byte [r10 + r8 + 0x10]
lea edx, [rax - 0x2b]
and dl, 0xfd
je 0x407c0b
lea edx, [rax - 0x30]
cmp dl, 9
jbe 0x407c0b
mov rax, rdi
mov r8d, 0xa
sar r11, 0x3f
mov byte [rsp + rcx + 0x2c], 0x45
cqo
and r11d, 2
idiv r8
add r11d, 0x2b
mov byte [rsp + rcx + 0x2d], r11b
add edx, 0x30
mov byte [rsp + rcx + 0x30], dl
cqo
idiv r8
add edx, 0x30
add eax, 0x30
mov byte [rsp + rcx + 0x2f], dl
xor edx, edx
mov byte [rsp + rcx + 0x2e], al
mov rcx, r13
call fcn.0043e240
movsd qword [rbx], xmm0
jmp 0x407c51
cmp rcx, 0x1ed
jg 0x407c1b
mov byte [rsp + rcx + 0x2c], al
inc rcx
inc r8
cmp r9, r8
jne 0x407c2b
mov r8, r9
jmp 0x407ba3
mov al, byte [r10 + r8 + 0x10]
cmp al, 0x2e
je 0x407c1b
cmp al, 0x5f
je 0x407c1b
jmp 0x407ba3
xor r12d, r12d
jmp 0x407c51
cmp rcx, 0xffffffffffffffff
jne 0x40796a
jmp 0x407951
mov rax, r12
add rsp, 0x228
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret