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

Disassembly:
mov qword [rsp + 0x20], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
mov rbp, rsp
sub rsp, 0x40
mov r15, r8
xor r10d, r10d
mov rdi, rdx
mov qword [rbp + 0x50], r10
mov rbx, r9
xor esi, esi
xor r9d, r9d
xor r11d, r11d
movzx edx, byte [r15]
xor r12d, r12d
inc r15
mov dword [rbp + 0x40], r9d
or r14d, 0xffffffff
mov dword [rbp + 0x48], r9d
xor r8d, r8d
mov r13, rcx
test rcx, rcx
jne 0x1400185a2
xor edi, edi
test dl, dl
je 0x140018bb8
lea r9, [0x140000000]
cmp r8d, 6
ja case.default.0x1400185c9
movsxd rax, r8d
mov ecx, dword [r9 + rax*4 + 0x18c24]
add rcx, r9
jmp rcx
cmp dl, 0x25
jne 0x1400185e2
movzx edx, byte [r15]
mov r8d, 1
inc r15
jmp case.default.0x1400185c9
lea rax, [r10 + 1]
cmp rax, rdi
jae 0x1400185ef
mov byte [r10 + r13], dl
movzx edx, byte [r15]
mov r10, rax
inc r15
mov qword [rbp + 0x50], rax
jmp case.default.0x1400185c9
movsx eax, dl
add eax, 0xffffffe0
cmp eax, 0x10
ja case.0x14001861a.33
cdqe
mov ecx, dword [r9 + rax*4 + 0x18c40]
add rcx, r9
jmp rcx
movzx edx, byte [r15]
or r11d, 1
inc r15
jmp case.default.0x1400185c9
movzx edx, byte [r15]
or r11d, 2
inc r15
jmp case.default.0x1400185c9
movzx edx, byte [r15]
or r11d, 4
inc r15
jmp case.default.0x1400185c9
movzx edx, byte [r15]
or r11d, 8
inc r15
jmp case.default.0x1400185c9
movzx edx, byte [r15]
or r11d, 0x10
inc r15
jmp case.default.0x1400185c9
movzx edx, byte [r15]
or r11d, 0x20
inc r15
jmp case.default.0x1400185c9
mov r8d, 2
jmp case.default.0x1400185c9
lea eax, [rdx - 0x30]
cmp al, 9
ja 0x1400186cb
add dl, 0xd0
mov ecx, 0x7fffffff
movsx r9d, dl
mov eax, 0x66666667
sub ecx, r9d
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add edx, eax
cmp r12d, edx
jg 0x140018bc4
movzx edx, byte [r15]
lea eax, [r12 + r12*4]
lea r12d, [r9 + rax*2]
inc r15
jmp case.default.0x1400185c9
cmp dl, 0x2a
jne 0x1400186ea
mov r12d, dword [rbx]
add rbx, 8
test r12d, r12d
jns 0x1400186e3
or r11d, 1
neg r12d
movzx edx, byte [r15]
inc r15
mov r8d, 3
jmp case.default.0x1400185c9
cmp dl, 0x2e
jne 0x14001870c
movzx edx, byte [r15]
mov r8d, 4
inc r15
jmp case.default.0x1400185c9
mov r8d, 5
jmp case.default.0x1400185c9
xor eax, eax
cmp r14d, 0xffffffff
cmovne eax, r14d
mov r14d, eax
lea eax, [rdx - 0x30]
cmp al, 9
ja 0x140018768
add dl, 0xd0
mov ecx, 0x7fffffff
movsx r9d, dl
mov eax, 0x66666667
sub ecx, r9d
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add edx, eax
cmp r14d, edx
jg 0x140018bc4
movzx edx, byte [r15]
lea eax, [r14 + r14*4]
lea r14d, [r9 + rax*2]
inc r15
jmp case.default.0x1400185c9
mov r8d, 5
cmp dl, 0x2a
jne case.default.0x1400185c9
mov r14d, dword [rbx]
add rbx, 8
movzx edx, byte [r15]
test r14d, r14d
mov eax, 0xffffffff
cmovs r14d, eax
inc r15
jmp case.default.0x1400185c9
movsx eax, dl
add eax, 0xffffffb4
cmp eax, 0x2e
ja case.0x1400187bb.82
cdqe
movzx eax, byte [r9 + rax + 0x18ca0]
mov ecx, dword [r9 + rax*4 + 0x18c84]
add rcx, r9
jmp rcx
movzx edx, byte [r15]
inc r15
cmp dl, 0x68
jne 0x1400187de
movzx edx, byte [r15]
mov esi, 1
inc r15
lea r8d, [rsi + 5]
jmp case.default.0x1400185c9
mov esi, 2
lea r8d, [rsi + 4]
jmp case.default.0x1400185c9
movzx edx, byte [r15]
inc r15
cmp dl, 0x6c
jne 0x14001880d
movzx edx, byte [r15]
mov esi, 4
inc r15
lea r8d, [rsi + 2]
jmp case.default.0x1400185c9
mov esi, 3
lea r8d, [rsi + 3]
jmp case.default.0x1400185c9
movzx edx, byte [r15]
mov esi, 5
inc r15
lea r8d, [rsi + 1]
jmp case.default.0x1400185c9
movzx edx, byte [r15]
mov esi, 8
inc r15
lea r8d, [rsi - 2]
jmp case.default.0x1400185c9
movzx edx, byte [r15]
mov esi, 7
inc r15
lea r8d, [rsi - 1]
jmp case.default.0x1400185c9
movzx edx, byte [r15]
mov esi, 6
inc r15
mov r8d, 6
jmp case.default.0x1400185c9
movsx eax, dl
add eax, 0xffffffdb
cmp eax, 0x53
ja case.0x140018896.53
cdqe
movzx eax, byte [r9 + rax + 0x18d14]
mov ecx, dword [r9 + rax*4 + 0x18cd0]
add rcx, r9
jmp rcx
lea eax, [rsi - 1]
cmp eax, 7
ja case.0x1400188ad.3
cdqe
mov ecx, dword [r9 + rax*4 + 0x18d68]
add rcx, r9
jmp rcx
movsx r9, byte [rbx]
add rbx, 8
jmp 0x1400188d3
movsx r9, word [rbx]
add rbx, 8
jmp 0x1400188d3
mov r9, qword [rbx]
add rbx, 8
jmp 0x1400188d3
movsxd r9, dword [rbx]
add rbx, 8
mov dword [rsp + 0x38], r11d
mov dword [rsp + 0x30], r14d
mov dword [rsp + 0x28], r12d
mov dword [rsp + 0x20], 0xa
mov r8, rdi
lea rdx, [rbp + 0x50]
mov rcx, r13
call fcn.140018ed0
mov r10, qword [rbp + 0x50]
jmp case.0x140018896.53
or r11d, 0x40
mov edx, reloc.WS2_32.dll_recv
jmp 0x140018919
mov edx, 8
jmp 0x140018919
mov edx, 0xa
bts r11d, 7
lea eax, [rsi - 1]
cmp eax, 7
ja case.0x140018933.3
cdqe
mov ecx, dword [r9 + rax*4 + 0x18d88]
add rcx, r9
jmp rcx
movzx r9d, byte [rbx]
add rbx, 8
jmp 0x140018959
movzx r9d, word [rbx]
add rbx, 8
jmp 0x140018959
mov r9, qword [rbx]
add rbx, 8
jmp 0x140018959
mov r9d, dword [rbx]
add rbx, 8
mov dword [rsp + 0x38], r11d
mov dword [rsp + 0x30], r14d
mov dword [rsp + 0x28], r12d
mov dword [rsp + 0x20], edx
jmp 0x1400188ea
or r11d, 0x40
add rbx, 8
movsd xmm3, qword [rbx - 8]
lea rax, [rbp + 0x48]
mov qword [rsp + 0x38], rax
lea rdx, [rbp + 0x50]
mov dword [rsp + 0x30], r11d
mov r8, rdi
mov dword [rsp + 0x28], r14d
mov rcx, r13
mov dword [rsp + 0x20], r12d
call fcn.1400191f0
mov r9d, dword [rbp + 0x48]
mov dword [rbp + 0x40], r9d
test r9d, r9d
je 0x1400188f9
mov r10, qword [rbp + 0x50]
jmp 0x140018bb8
or r11d, 0x40
bts r11d, 9
jmp case.0x140018896.42
or r11d, 0x40
bts r11d, 8
add rbx, 8
test r14d, r14d
mov eax, 1
cmove r14d, eax
jmp 0x140018979
add rbx, 8
lea rcx, [r10 + 1]
cmp rcx, rdi
jae 0x1400189fa
movzx eax, byte [rbx - 8]
mov byte [r10 + r13], al
mov r10, rcx
mov qword [rbp + 0x50], rcx
jmp case.0x140018896.53
mov r9, qword [rbx]
lea rdx, [rbp + 0x50]
mov dword [rsp + 0x30], r11d
add rbx, 8
mov dword [rsp + 0x28], r14d
mov r8, rdi
mov rcx, r13
mov dword [rsp + 0x20], r12d
call fcn.140018dd0
mov r10, qword [rbp + 0x50]
jmp case.0x140018896.53
mov r9, qword [rbx]
add rbx, 8
test r9, r9
jne 0x140018b17
xor ecx, ecx
lea rax, str._nil_
nop dword [rax]
inc ecx
lea rax, [rax + 1]
cmp byte [rax], 0
jne 0x140018a50
sub r12d, ecx
mov eax, 0
cmovns eax, r12d
mov edx, eax
neg edx
and r11b, 1
cmove edx, eax
test edx, edx
jle 0x140018aa5
mov r8d, 1
mov eax, edx
sub r8, r13
lea rcx, [r10 + r13]
add r10, rax
nop dword [rax + rax]
lea rax, [r8 + rcx]
cmp rax, rdi
jae 0x140018a9c
mov byte [rcx], 0x20
inc rcx
dec edx
test edx, edx
jg 0x140018a90
mov r9d, 1
lea r8, str._nil_
sub r9, r13
lea rcx, [r10 + r13]
sub r8, r10
nop dword [rax]
lea rax, [rcx + r9]
cmp rax, rdi
jae 0x140018ad0
movzx eax, byte [r8 + r10]
mov byte [rcx], al
inc r10
inc rcx
cmp byte [r8 + r10], 0
jne 0x140018ac0
mov qword [rbp + 0x50], r10
test edx, edx
jns case.0x140018896.53
neg edx
lea rcx, [r10 + r13]
mov r8d, edx
add r10, r8
mov qword [rbp + 0x50], r10
nop dword [rax]
lea rax, [rcx + r9]
cmp rax, rdi
jae 0x140018b0c
mov byte [rcx], 0x20
inc rcx
sub r8, 1
jne 0x140018b00
jmp case.0x140018896.53
or r11d, 0x88
mov dword [rsp + 0x38], r11d
mov dword [rsp + 0x30], r14d
mov dword [rsp + 0x28], r12d
mov dword [rsp + 0x20], reloc.WS2_32.dll_recv
jmp 0x1400188ea
lea eax, [rsi - 1]
cmp eax, 7
ja case.0x140018b4f.3
cdqe
mov ecx, dword [r9 + rax*4 + 0x18da8]
add rcx, r9
jmp rcx
mov rax, qword [rbx]
add rbx, 8
mov byte [rax], r10b
jmp case.0x140018896.53
mov rax, qword [rbx]
add rbx, 8
mov word [rax], r10w
jmp case.0x140018896.53
mov rax, qword [rbx]
add rbx, 8
mov qword [rax], r10
jmp case.0x140018896.53
mov rax, qword [rbx]
add rbx, 8
mov dword [rax], r10d
jmp case.0x140018896.53
lea rax, [r10 + 1]
cmp rax, rdi
jae 0x140018b8f
mov byte [r10 + r13], dl
mov r10, rax
mov qword [rbp + 0x50], rax
movzx edx, byte [r15]
xor r8d, r8d
inc r15
xor r12d, r12d
xor r11d, r11d
xor esi, esi
or r14d, 0xffffffff
test dl, dl
jne 0x1400185aa
mov r9d, dword [rbp + 0x40]
cmp r10, rdi
jae 0x140018bd1
mov byte [r10 + r13], 0
jmp 0x140018bdc
mov eax, 1
mov r9d, eax
mov dword [rbp + 0x40], eax
jmp 0x140018bb8
test rdi, rdi
je 0x140018bdc
mov byte [rdi + r13 - 1], 0
test r9d, r9d
jne 0x140018bef
cmp r10, 0x7fffffff
jae 0x140018bef
mov eax, r10d
jmp 0x140018c0a
call fcn.14002439c
cmp dword [rbp + 0x40], 0
mov ecx, 0x22
mov edx, 0x84
cmovne ecx, edx
mov dword [rax], ecx
or eax, 0xffffffff
mov rbx, qword [rsp + 0x98]
add rsp, 0x40
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret