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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xc
push ebx
mov ebx, edx
push esi
push edi
mov esi, ecx
mov eax, dword [ebx]
mov dword [esp + 0x10], eax
cmp eax, 0x28
jne 0x1016d84c
cmp dword [esi + 0x10], 0
lea ecx, [eax - 0x27]
jne 0x1016d76b
mov esi, dword [sym.python310.dll_PyExc_TypeError]
lea edx, [eax - 0xf]
mov ecx, str.format_requires_a_mapping
jmp 0x1016dc5b
inc dword [esi + 0x1c]
mov edx, dword [esi + 0x1c]
mov eax, edx
mov edi, dword [esi + 0x18]
mov dword [esp + 0x14], edx
dec edi
nop dword [eax + eax]
sub edi, 1
mov edx, eax
mov dword [esp + 0x10], edi
mov dword [esi + 0x18], edi
js 0x1016d871
mov edi, dword [esi + 0x14]
mov eax, dword [esi + 0x20]
cmp edi, 1
jne 0x1016d7a3
movzx eax, byte [eax + edx]
jmp 0x1016d7b1
cmp edi, 2
jne 0x1016d7ae
movzx eax, word [eax + edx*2]
jmp 0x1016d7b1
mov eax, dword [eax + edx*4]
mov dword [ebx], eax
cmp eax, 0x29
jne 0x1016d7bb
dec ecx
jmp 0x1016d7c1
cmp eax, 0x28
jne 0x1016d7c1
inc ecx
mov edi, dword [esp + 0x10]
lea eax, [edx + 1]
mov dword [esi + 0x1c], eax
test ecx, ecx
jg 0x1016d780
push edx
push dword [esp + 0x18]
push dword [esi + 0x24]
call sym.python310.dll_PyUnicode_Substring
mov edi, eax
add esp, 0xc
test edi, edi
je 0x1016dc91
cmp dword [esi + 4], 0
je 0x1016d809
mov ecx, dword [esi]
mov dword [esi + 4], 0
add dword [ecx], 0xffffffff
jne 0x1016d809
mov eax, dword [ecx + 4]
push ecx
mov eax, dword [eax + 0x18]
call eax
add esp, 4
push edi
push dword [esi + 0x10]
call sym.python310.dll_PyObject_GetItem
add esp, 8
mov dword [esi], eax
add dword [edi], 0xffffffff
jne 0x1016d828
mov eax, dword [edi + 4]
push edi
mov eax, dword [eax + 0x18]
call eax
add esp, 4
cmp dword [esi], 0
je 0x1016dc91
mov eax, dword [ebx]
mov dword [esi + 4], 1
mov dword [esi + 8], 0xffffffff
mov dword [esi + 0xc], 0xfffffffe
mov dword [esp + 0x10], eax
mov edx, dword [esi + 0x18]
sub edx, 1
mov dword [esi + 0x18], edx
js case.0x1016d8ab.37
mov edi, dword [esi + 0x1c]
nop
mov eax, dword [esi + 0x14]
mov ecx, dword [esi + 0x20]
cmp eax, 1
jne 0x1016d880
movzx ecx, byte [edi + ecx]
jmp 0x1016d88e
mov edx, 0x15
mov ecx, str.incomplete_format_key
jmp 0x1016dc55
cmp eax, 2
jne 0x1016d88b
movzx ecx, word [ecx + edi*2]
jmp 0x1016d88e
mov ecx, dword [ecx + edi*4]
inc edi
mov dword [ebx], ecx
lea eax, [ecx - 0x20]
mov dword [esi + 0x1c], edi
mov dword [esp + 0x10], ecx
cmp eax, 0x10
ja case.0x1016d8ab.37
movzx eax, byte [ecx + 0x1016dc9c]
mov dword [esp + 0x10], ecx
jmp dword [eax*4 + 0x1016dca4]
or dword [ebx + 4], 1
jmp 0x1016d8ce
or dword [ebx + 4], 2
jmp 0x1016d8ce
or dword [ebx + 4], 4
jmp 0x1016d8ce
or dword [ebx + 4], 8
jmp 0x1016d8ce
or dword [ebx + 4], 0x10
mov edx, dword [esi + 0x18]
sub edx, 1
mov dword [esp + 0x10], ecx
mov dword [esi + 0x18], edx
jns 0x1016d860
mov eax, dword [esp + 0x10]
cmp eax, 0x2a
jne 0x1016d9f1
mov ecx, dword [esi + 0xc]
mov edx, dword [esi + 8]
cmp ecx, edx
jge 0x1016d9dc
lea eax, [ecx + 1]
mov dword [esi + 0xc], eax
mov eax, dword [esi]
test edx, edx
js 0x1016d90e
push ecx
push eax
call sym.python310.dll_PyTuple_GetItem
add esp, 8
test eax, eax
je 0x1016dc91
mov ecx, dword [eax + 4]
test dword [ecx + 0x54], 0x1000000
jne 0x1016d937
mov esi, dword [sym.python310.dll_PyExc_TypeError]
mov edx, 0xb
mov ecx, str._wants_int
jmp 0x1016dc5b
push eax
call sym.python310.dll_PyLong_AsSsize_t
add esp, 4
mov dword [ebx + 8], eax
cmp eax, 0xffffffff
jne 0x1016d95d
mov ecx, dword [0x103fb118]
cmp dword [ecx + 0x34], 0
je 0x1016d961
or eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
test eax, eax
jns 0x1016d96a
or dword [ebx + 4], 1
neg eax
mov dword [ebx + 8], eax
mov ecx, dword [esi + 0x18]
sub ecx, 1
mov dword [esi + 0x18], ecx
js 0x1016d9d8
mov edx, dword [esi + 0x14]
mov eax, dword [esi + 0x1c]
mov edi, dword [esi + 0x20]
cmp edx, 1
jne 0x1016d989
movzx edi, byte [eax + edi]
jmp 0x1016d997
cmp edx, 2
jne 0x1016d994
movzx edi, word [edi + eax*2]
jmp 0x1016d997
mov edi, dword [edi + eax*4]
inc eax
mov dword [ebx], edi
mov dword [esi + 0x1c], eax
mov eax, ecx
cmp edi, 0x2e
jne 0x1016db44
lea ecx, [eax - 1]
mov dword [ebx + 0xc], 0
mov dword [esi + 0x18], ecx
test ecx, ecx
js 0x1016dc4b
mov edi, dword [esi + 0x14]
mov eax, dword [esi + 0x1c]
mov edx, dword [esi + 0x20]
cmp edi, 1
jne 0x1016daa4
movzx edx, byte [eax + edx]
jmp 0x1016dab2
mov edi, dword [ebx]
jmp 0x1016d99d
mov esi, dword [sym.python310.dll_PyExc_TypeError]
mov edx, 0x26
mov ecx, str.not_enough_arguments_for_format_string
jmp 0x1016dc5b
mov edi, eax
mov ecx, edx
cmp eax, 0x30
jb 0x1016d99d
cmp eax, 0x39
ja 0x1016d99d
lea ecx, [eax - 0x30]
mov dword [esp + 0x10], ecx
mov dword [ebx + 8], ecx
lea ecx, [edx - 1]
mov dword [esi + 0x18], ecx
test ecx, ecx
js 0x1016d99d
mov eax, dword [esi + 0x1c]
mov edx, dword [esi + 0x14]
mov edi, dword [esi + 0x20]
cmp edx, 1
jne 0x1016da27
movzx edi, byte [edi + eax]
jmp 0x1016da35
cmp edx, 2
jne 0x1016da32
movzx edi, word [edi + eax*2]
jmp 0x1016da35
mov edi, dword [edi + eax*4]
inc eax
mov dword [ebx], edi
mov dword [esp + 0x14], eax
mov dword [esi + 0x1c], eax
cmp edi, 0x30
jb 0x1016d99d
cmp edi, 0x39
ja 0x1016db44
mov ecx, 0x8000002f
mov eax, 0x66666667
sub ecx, edi
imul ecx
mov ecx, dword [esp + 0x10]
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp ecx, eax
jg 0x1016da95
lea eax, [ecx - 6]
lea eax, [ecx + eax*4]
lea ecx, [edi + eax*2]
mov eax, dword [esp + 0x14]
mov dword [esp + 0x10], ecx
mov dword [ebx + 8], ecx
mov ecx, dword [esi + 0x18]
sub ecx, 1
mov dword [esi + 0x18], ecx
jns 0x1016da16
jmp 0x1016dc4b
mov edx, 0xd
mov ecx, str.width_too_big
jmp 0x1016dc55
cmp edi, 2
jne 0x1016daaf
movzx edx, word [edx + eax*2]
jmp 0x1016dab2
mov edx, dword [edx + eax*4]
inc eax
mov dword [ebx], edx
mov dword [esi + 0x1c], eax
cmp edx, 0x2a
jne 0x1016db8c
mov ecx, esi
call fcn.1016ced0
test eax, eax
je 0x1016dc91
mov ecx, dword [eax + 4]
test dword [ecx + 0x54], 0x1000000
je 0x1016d922
push eax
call sym.python310.dll__PyLong_AsInt
add esp, 4
mov dword [ebx + 0xc], eax
cmp eax, 0xffffffff
jne 0x1016db06
mov eax, dword [0x103fb118]
cmp dword [eax + 0x34], 0
je 0x1016db0a
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
test eax, eax
jns 0x1016db11
mov dword [ebx + 0xc], 0
mov ecx, dword [esi + 0x18]
sub ecx, 1
mov dword [esi + 0x18], ecx
js 0x1016db44
mov edi, dword [esi + 0x14]
mov eax, dword [esi + 0x1c]
mov edx, dword [esi + 0x20]
cmp edi, 1
jne 0x1016db30
movzx edx, byte [edx + eax]
jmp 0x1016db3e
cmp edi, 2
jne 0x1016db3b
movzx edx, word [edx + eax*2]
jmp 0x1016db3e
mov edx, dword [edx + eax*4]
inc eax
mov dword [ebx], edx
mov dword [esi + 0x1c], eax
test ecx, ecx
js 0x1016dc4b
mov eax, dword [ebx]
cmp eax, 0x68
je 0x1016db61
cmp eax, 0x6c
je 0x1016db61
cmp eax, 0x4c
jne 0x1016dc9b
lea eax, [ecx - 1]
mov dword [esi + 0x18], eax
mov ecx, eax
test eax, eax
js 0x1016dc47
mov edi, dword [esi + 0x14]
mov eax, dword [esi + 0x1c]
mov edx, dword [esi + 0x20]
cmp edi, 1
jne 0x1016dc33
movzx edx, byte [eax + edx]
jmp 0x1016dc41
lea eax, [edx - 0x30]
cmp eax, 9
ja 0x1016db44
add edx, 0xffffffd0
add ecx, 0xffffffff
mov dword [esp + 0x10], edx
mov dword [ebx + 0xc], edx
mov dword [esi + 0x18], ecx
js 0x1016db44
mov eax, dword [esi + 0x1c]
nop dword [eax]
mov edx, dword [esi + 0x14]
mov edi, dword [esi + 0x20]
cmp edx, 1
jne 0x1016dbc1
movzx edi, byte [edi + eax]
jmp 0x1016dbcf
cmp edx, 2
jne 0x1016dbcc
movzx edi, word [edi + eax*2]
jmp 0x1016dbcf
mov edi, dword [edi + eax*4]
inc eax
mov dword [ebx], edi
mov dword [esp + 0x14], eax
mov dword [esi + 0x1c], eax
cmp edi, 0x30
jb 0x1016db44
cmp edi, 0x39
ja 0x1016db44
mov ecx, 0x8000002f
mov eax, 0x66666667
sub ecx, edi
imul ecx
mov ecx, dword [esp + 0x10]
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp ecx, eax
jg 0x1016dc2c
lea eax, [ecx - 6]
lea eax, [ecx + eax*4]
lea ecx, [edi + eax*2]
mov eax, dword [esp + 0x14]
mov dword [esp + 0x10], ecx
mov dword [ebx + 0xc], ecx
mov ecx, dword [esi + 0x18]
sub ecx, 1
mov dword [esi + 0x18], ecx
jns 0x1016dbb0
jmp 0x1016dc4b
mov ecx, str.precision_too_big
jmp 0x1016dc50
cmp edi, 2
jne 0x1016dc3e
movzx edx, word [edx + eax*2]
jmp 0x1016dc41
mov edx, dword [edx + eax*4]
inc eax
mov dword [ebx], edx
mov dword [esi + 0x1c], eax
test ecx, ecx
jns 0x1016dc9b
mov ecx, str.incomplete_format
mov edx, 0x11
mov esi, dword [sym.python310.dll_PyExc_ValueError]
mov edi, dword [0x103fb118]
push 0
push 0
push 0
call fcn.101599e0
add esp, 0xc
mov ebx, eax
push ebx
push esi
push edi
call sym.python310.dll__PyErr_SetObject
add esp, 0xc
test ebx, ebx
je 0x1016dc91
add dword [ebx], 0xffffffff
jne 0x1016dc91
mov eax, dword [ebx + 4]
push ebx
mov eax, dword [eax + 0x18]
call eax
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret