Function at 0x4078af
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 0x4078d2
mov rax, qword [rcx]
cmp rax, r8
jle 0x407902
mov dl, byte [r10 + r8 + 0x10]
lea ecx, [rdx - 0x2b]
and cl, 0xfd
jne 0x407902
movsd xmm1, qword [0x004470b8]
cmp dl, 0x2d
je 0x4078f9
movsd xmm1, qword [0x004470c0]
lea r9, [r8 + 1]
mov r11b, 1
jmp 0x407910
movsd xmm1, qword [0x004470c0]
mov r9, r8
xor r11d, r11d
lea rcx, [r9 + 2]
cmp rcx, rax
jge 0x4079a9
mov dl, byte [r10 + r9 + 0x10]
and edx, 0xffffffdf
cmp dl, 0x4e
je 0x407934
cmp dl, 0x49
jne 0x4079a9
jmp 0x4079b7
mov dl, byte [r10 + r9 + 0x11]
xor r12d, r12d
and edx, 0xffffffdf
cmp dl, 0x41
jne 0x407db7
mov dl, byte [r10 + rcx + 0x10]
and edx, 0xffffffdf
cmp dl, 0x4e
jne 0x407db7
add r9, 3
cmp r9, rax
jge 0x40798c
mov al, byte [r10 + r9 + 0x10]
mov edx, eax
and edx, 0xffffffdf
sub edx, 0x41
cmp dl, 0x19
jbe 0x407db7
lea edx, [rax - 0x30]
cmp dl, 9
jbe 0x407da3
cmp al, 0x5f
je 0x407da3
movsd xmm0, qword [0x004470c8]
xorps xmm1, xmm1
mulsd xmm0, xmm0
cvtsd2ss xmm0, xmm0
mulss xmm0, xmm1
cvtss2sd xmm0, xmm0
jmp 0x407a22
or rcx, 0xffffffffffffffff
cmp r9, rax
jl 0x407a31
jmp 0x407a4a
mov dl, byte [r10 + r9 + 0x11]
xor r12d, r12d
and edx, 0xffffffdf
cmp dl, 0x4e
jne 0x407db7
mov dl, byte [r10 + rcx + 0x10]
and edx, 0xffffffdf
cmp dl, 0x46
jne 0x407db7
add r9, 3
cmp r9, rax
jge 0x407a0f
mov al, byte [r10 + r9 + 0x10]
mov edx, eax
and edx, 0xffffffdf
sub edx, 0x41
cmp dl, 0x19
jbe 0x407db7
lea edx, [rax - 0x30]
cmp dl, 9
jbe 0x407da3
cmp al, 0x5f
je 0x407da3
movsd xmm0, qword [0x004470c0]
xorps xmm2, xmm2
divsd xmm0, xmm2
mulsd xmm0, xmm1
sub r9, r8
movsd qword [rbx], xmm0
mov r12, r9
jmp 0x407db7
mov dl, byte [r10 + r9 + 0x10]
or rcx, 0xffffffffffffffff
lea esi, [rdx - 0x30]
cmp sil, 9
ja 0x407a4a
movzx ecx, dl
sub rcx, 0x30
xor r13d, r13d
xor esi, esi
cmp r9, rax
jge 0x407b24
movzx edx, byte [r10 + r9 + 0x10]
lea edi, [rdx - 0x30]
cmp dil, 9
ja 0x407a85
imul rsi, rsi, 0xa
inc r13
lea rsi, [rsi + rdx - 0x30]
inc r9
cmp r9, rax
je 0x407a4f
cmp byte [r10 + r9 + 0x10], 0x5f
je 0x407a73
jmp 0x407a4f
cmp dl, 0x2e
jne 0x407b24
inc r9
test r13, r13
jne 0x407ac1
xor edx, edx
mov r12, rdx
cmp r9, rax
jge 0x407ac4
cmp byte [r10 + r9 + 0x10], 0x30
jne 0x407da8
inc rdx
inc r9
cmp r9, rax
je 0x407a98
cmp byte [r10 + r9 + 0x10], 0x5f
je 0x407aaf
jmp 0x407a98
xor r12d, r12d
cmp rcx, 0xffffffffffffffff
jne 0x407ae8
cmp r9, rax
jge 0x407ae8
mov dl, byte [r10 + r9 + 0x10]
or rcx, 0xffffffffffffffff
lea edi, [rdx - 0x30]
cmp dil, 9
ja 0x407ae8
movzx ecx, dl
sub rcx, 0x30
xor edx, edx
lea r14, [r12 + rdx]
mov rbp, rdx
cmp r9, rax
jge 0x407b29
movzx edi, byte [r10 + r9 + 0x10]
lea r15d, [rdi - 0x30]
cmp r15b, 9
ja 0x407b29
imul rsi, rsi, 0xa
inc rdx
lea rsi, [rsi + rdi - 0x30]
inc r9
cmp r9, rax
je 0x407aea
cmp byte [r10 + r9 + 0x10], 0x5f
je 0x407b12
jmp 0x407aea
xor r14d, r14d
xor ebp, ebp
mov r12, r13
add r12, rbp
jne 0x407b4c
cmp r9, r8
je 0x407db7
lea rdx, [r8 + 1]
cmp rdx, r9
jne 0x407b4c
test r11b, r11b
jne 0x407db7
lea rdx, [r9 + 1]
cmp rdx, rax
jge 0x407bd1
mov r11b, byte [r10 + r9 + 0x10]
and r11d, 0xffffffdf
cmp r11b, 0x45
jne 0x407bd1
mov r11b, byte [r10 + rdx + 0x10]
cmp r11b, 0x2b
je 0x407b7b
or rdi, 0xffffffffffffffff
cmp r11b, 0x2d
je 0x407b80
jmp 0x407b86
mov edi, 1
add r9, 2
jmp 0x407b8e
mov r9, rdx
mov edi, 1
mov dl, byte [r10 + r9 + 0x10]
sub edx, 0x30
cmp dl, 9
ja 0x407da3
xor r11d, r11d
cmp r9, rax
jge 0x407bd9
movzx r15d, byte [r10 + r9 + 0x10]
lea edx, [r15 - 0x30]
cmp dl, 9
ja 0x407bd9
imul rdx, r11, 0xa
lea r11, [rdx + r15 - 0x30]
inc r9
cmp r9, rax
je 0x407ba2
cmp byte [r10 + r9 + 0x10], 0x5f
je 0x407bbf
jmp 0x407ba2
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 0x407c01
cmp r12, 0xf
jg 0x407c12
jmp 0x407c26
xorps xmm0, xmm0
test r11, r11
jns 0x407a0f
jmp 0x407a1e
cmp r12, 0x10
jne 0x407cd1
cmp rcx, 8
jg 0x407cd1
cmp rdi, 0x16
jle 0x407c45
mov eax, 0xf
sub rax, r13
sub rax, rbp
lea rdx, [rax + 0x16]
cmp rdx, rdi
jge 0x407c88
jmp 0x407cd1
test rsi, rsi
js 0x407c51
cvtsi2sd xmm0, rsi
jmp 0x407c66
mov rcx, rsi
and esi, 1
shr rcx, 1
or rcx, rsi
cvtsi2sd xmm0, rcx
addsd xmm0, xmm0
lea rax, [0x00446a20]
mulsd xmm0, xmm1
movsd xmm1, qword [rax + rdi*8]
test r11, r11
jns 0x407a1e
divsd xmm0, xmm1
jmp 0x407a22
test r11, r11
js 0x407cd1
sub r9, r8
mov r12, r9
test rsi, rsi
js 0x407c9f
cvtsi2sd xmm0, rsi
jmp 0x407cb4
mov rcx, rsi
and esi, 1
shr rcx, 1
or rcx, rsi
cvtsi2sd xmm0, rcx
addsd xmm0, xmm0
lea rcx, [0x00446a20]
mulsd xmm0, xmm1
sub rdi, rax
mulsd xmm0, qword [rcx + rax*8]
mulsd xmm0, qword [rcx + rdi*8]
jmp 0x407d6d
lea r13, [rsp + 0x2c]
mov edx, 0x1f4
mov rcx, r13
call fcn.00402beb
xor eax, eax
sub r9, r8
mov r12, r9
test r10, r10
je 0x407cf3
mov rax, qword [r10]
xor ecx, ecx
cmp rax, r8
jle 0x407d25
cmp byte [r10 + r8 + 0x10], 0x2e
jne 0x407d05
inc r8
xor ecx, ecx
cmp r8, rax
jge 0x407d25
mov dl, byte [r10 + r8 + 0x10]
lea r9d, [rdx - 0x2b]
and r9b, 0xfd
je 0x407d73
lea r9d, [rdx - 0x30]
cmp r9b, 9
jbe 0x407d73
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.0043df20
movsd qword [rbx], xmm0
jmp 0x407db7
cmp rcx, 0x1ed
jg 0x407d83
mov byte [rsp + rcx + 0x2c], dl
inc rcx
inc r8
cmp r8, rax
je 0x407d07
mov dl, byte [r10 + r8 + 0x10]
cmp dl, 0x2e
je 0x407d83
cmp dl, 0x5f
je 0x407d83
jmp 0x407d07
xor r12d, r12d
jmp 0x407db7
cmp rcx, 0xffffffffffffffff
jne 0x407ae8
jmp 0x407acf
mov rax, r12
add rsp, 0x228
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret