Function at 0x140048840
Capabilities:
Manipulate console buffer

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r14
sub rsp, 0x60
mov rax, qword [0x1400ad368]
xor rax, rsp
mov qword [rsp + 0x58], rax
xor esi, esi
mov r14, r9
mov rdi, r8
mov rbx, rcx
sub edx, 1
je 0x140048b3b
sub edx, 1
je 0x140048a8c
cmp edx, 1
je 0x14004888c
mov r8, r9
mov rdx, rdi
call fcn.140048e00
jmp 0x140048ddb
cmp byte [rcx], sil
je 0x140048a5c
movsx rdx, word [rcx + 4]
movsx ecx, word [rcx + 2]
dec ecx
cmp ecx, edx
jle 0x1400489ba
cmp byte [rbx + rdx*8 + 0x2e4], sil
jne 0x1400489ba
mov ecx, dword [rbx + rdx*8 + 0x2e0]
test ecx, ecx
jle 0x1400488f8
movsx eax, word [rbx + 0x436]
cmp word [rbx + 0x474], ax
jle 0x1400488f8
cmp ecx, eax
jl 0x1400488f8
lfence
movsx eax, word [rbx + 0x436]
mov edx, 0x20
sub ecx, eax
inc ecx
movsxd r8, ecx
mov rcx, rbx
call fcn.140049160
jmp 0x1400489a4
mov rax, qword [rbx + 0x440]
cmp dword [rax + 0xc], esi
jne 0x1400489a4
cmp byte [rbx + 0x468], sil
jne 0x1400489a4
mov rdx, qword [rbx + 0x450]
lea r8, [0x14008fbcc]
mov r9d, 1
mov rcx, rbx
call fcn.14004a010
movzx eax, word [rbx + 0x436]
movzx r8d, byte [rbx + 0x469]
inc ax
mov word [rbx + 0x436], ax
test r8b, r8b
jne 0x140048965
movsx ecx, word [rbx + 0x474]
cwde
inc ecx
cdq
idiv ecx
mov word [rbx + 0x436], dx
jmp 0x140048968
movzx edx, ax
mov eax, dword [rbx + 0x46c]
add eax, 0xfffffc5c
cmp eax, 0x12
ja 0x14004899d
mov ecx, 0x60011
bt ecx, eax
jae 0x14004899d
test r8b, r8b
jne 0x14004899d
movsx ecx, word [rbx + 0x474]
movsx eax, dx
inc ecx
cdq
idiv ecx
mov word [rbx + 0x436], dx
mov byte [rbx + 0x478], 1
movsx eax, word [rbx + 4]
movsx ecx, word [rbx + 2]
inc eax
cdq
idiv ecx
mov word [rbx + 4], dx
jmp 0x140048ddb
cmp byte [rbx + 0x478], sil
je 0x1400489d5
cmp word [rbx + 0x436], si
jne 0x1400489d5
cmp byte [rbx + 0x469], sil
je 0x1400489fc
mov r8, qword [0x1400b0e60]
mov r9, 0xffffffffffffffff
inc r9
cmp word [r8 + r9*2], si
jne 0x1400489e3
mov rdx, qword [rbx + 0x450]
mov rcx, rbx
call fcn.14004a010
inc word [rbx + 0x438]
movzx eax, word [rbx + 0x438]
mov word [rbx + 0x436], si
mov byte [rbx + 0x478], sil
cmp word [rbx + 0x476], ax
jg 0x1400489a4
mov rax, qword [0x1400b0dd0]
cmp byte [rax + 0x4b1], sil
jne 0x140048a50
cmp dword [rax + 0x38], 2
jne 0x140048a50
mov rax, qword [rbx + 0x440]
cmp dword [rax + 0x18], esi
je 0x140048a50
mov rcx, rbx
call fcn.140049320
jmp 0x1400489a4
mov word [rbx + 0x438], si
jmp 0x1400489a4
movsx ecx, word [rcx + 0x436]
mov eax, ecx
cdq
and edx, 7
add eax, edx
mov edx, 0x20
sar eax, 3
lea eax, [rax*8 + 8]
sub eax, ecx
mov rcx, rbx
movsxd r8, eax
call fcn.140049160
jmp 0x140048ddb
cmp byte [rcx + 0x478], sil
je 0x140048aa7
cmp word [rcx + 0x436], si
jne 0x140048aa7
cmp byte [rcx + 0x469], sil
je 0x140048acb
mov r8, qword [0x1400b0e60]
mov r9, 0xffffffffffffffff
inc r9
cmp word [r8 + r9*2], si
jne 0x140048ab5
mov rdx, qword [rcx + 0x450]
call fcn.14004a010
movzx eax, word [rbx + 0x438]
inc ax
mov word [rbx + 0x436], si
mov word [rbx + 0x438], ax
mov byte [rbx + 0x478], sil
cmp byte [rbx], sil
je 0x140048af3
mov word [rbx + 4], si
cmp word [rbx + 0x476], ax
jg 0x140048ddb
mov rax, qword [0x1400b0dd0]
cmp byte [rax + 0x4b1], sil
jne 0x140048b2f
cmp dword [rax + 0x38], 2
jne 0x140048b2f
mov rax, qword [rbx + 0x440]
cmp dword [rax + 0x18], esi
je 0x140048b2f
mov rcx, rbx
call fcn.140049320
jmp 0x140048ddb
mov word [rbx + 0x438], si
jmp 0x140048ddb
mov r8d, 5
lea rdx, str.COLOR
mov rcx, rdi
call fcn.14006865c
mov rcx, rdi
test eax, eax
jne 0x140048bd5
lea r8, [rsp + 0x34]
lea rdx, [0x14009f57a]
call fcn.140025540
mov ecx, 7
cmp eax, 1
je 0x140048b80
movzx edx, cx
mov word [rsp + 0x34], cx
jmp 0x140048b85
movzx edx, word [rsp + 0x34]
mov rax, qword [rbx + 0x440]
cmp dword [rax + 0x24], esi
jne 0x140048b93
mov edx, ecx
movzx ecx, word [rbx + 0x428]
mov r8d, 0xf0
xor cx, dx
and cx, 0xf
xor cx, word [rbx + 0x428]
movzx eax, cl
movzx edx, cx
shr al, 4
xor dx, r8w
xor al, cl
and al, 0xf
cmovne dx, cx
mov rcx, qword [rbx + 0x450]
call qword [sym.imp.KERNEL32.dll_SetConsoleTextAttribute]
jmp 0x140048ddb
mov r8d, 2
lea rdx, [0x14009f4c4]
call fcn.14006865c
mov rcx, rdi
test eax, eax
jne 0x140048c5a
lea r8, [rsp + 0x38]
mov dword [rsp + 0x38], esi
lea rdx, [0x14009de2a]
lea ebp, [rax + 0x2d]
call fcn.140025540
test eax, eax
je 0x140048c26
mov eax, dword [rsp + 0x38]
test eax, eax
je 0x140048c21
sub eax, 1
je 0x140048c26
cmp eax, 1
jne 0x140048c26
lea ebp, [rax + 0x3c]
jmp 0x140048c26
mov ebp, 0x20
movsx ecx, word [rbx + 0x474]
movsx eax, word [rbx + 0x436]
cmp cx, ax
jl 0x140048c4b
sub ecx, eax
movzx edx, bp
inc ecx
movsxd r8, ecx
mov rcx, rbx
call fcn.140049160
xor edx, edx
mov rcx, rbx
call fcn.140049e10
jmp 0x140048ddb
mov r8d, 3
lea rdx, [0x14009f4d0]
call fcn.14006865c
test eax, eax
jne 0x140048d4b
cmp byte [rbx + 0x469], sil
jne 0x140048ddb
lea r8, [rsp + 0x30]
mov word [rsp + 0x30], si
lea rdx, [0x14009f562]
mov rcx, rdi
call fcn.140025540
test eax, eax
je 0x140048ddb
mov rcx, qword [rbx + 0x450]
lea rdx, [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
movzx eax, word [rsp + 0x30]
cmp si, word [rsp + 0x44]
jne 0x140048cc8
inc ax
mov word [rsp + 0x30], ax
mov rcx, qword [rbx + 0x450]
mov ebp, 1
sub bp, ax
mov word [rsp + 0x44], si
movzx eax, word [rsp + 0x46]
add ax, bp
mov word [rbx + 0x436], si
mov word [rsp + 0x46], ax
mov edx, dword [rsp + 0x44]
mov word [rbx + 0x438], ax
mov dword [rsp + 0x3c], esi
call qword [sym.imp.KERNEL32.dll_SetConsoleCursorPosition]
movsx eax, word [rsp + 0x30]
mov edx, 0x20
movsx r8d, word [rsp + 0x52]
mov r9d, dword [rsp + 0x44]
mov rcx, qword [rbx + 0x450]
imul r8d, eax
lea rax, [rsp + 0x3c]
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_FillConsoleOutputCharacterW]
mov edx, dword [rsp + 0x44]
mov rcx, qword [rbx + 0x450]
call qword [sym.imp.KERNEL32.dll_SetConsoleCursorPosition]
jmp 0x140048ddb
mov r8d, 5
lea rdx, str.TABLE
mov rcx, rdi
call fcn.14006865c
test eax, eax
jne 0x140048d71
mov rdx, rdi
mov rcx, rbx
call fcn.140049650
jmp 0x140048ddb
mov r8d, 6
lea rdx, str._TABLE
mov rcx, rdi
call fcn.14006865c
test eax, eax
jne 0x140048d9f
mov byte [rbx], sil
cmp si, word [rbx + 4]
je 0x140048ddb
xor edx, edx
mov rcx, rbx
call fcn.140049e10
jmp 0x140048ddb
mov ebp, 1
lea rdx, [0x14009f4f8]
mov r8d, ebp
mov rcx, rbx
call fcn.140048e00
mov r8, r14
mov rdx, rdi
mov rcx, rbx
call fcn.140048e00
mov r8d, ebp
lea rdx, [0x14009f4fc]
mov rcx, rbx
call fcn.140048e00
mov esi, 7
mov eax, esi
mov rcx, qword [rsp + 0x58]
xor rcx, rsp
call fcn.140050ca0
add rsp, 0x60
pop r14
pop rdi
pop rsi
pop rbp
pop rbx
ret