Function at 0x140040990
Capabilities:
Get thread local storage value

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x48
mov rbx, r9
mov rbp, r8
mov edi, edx
mov rsi, rcx
mov rax, qword [0x1402b7040]
xor rax, rsp
mov qword [rsp + 0x40], rax
mov eax, dword [0x1402c9778]
mov ecx, dword [0x1402c6098]
mov rdx, qword gs:[0x58]
mov rcx, qword [rdx + rcx*8]
cmp eax, dword [rcx + 4]
jg 0x140040abc
mov ecx, dword [0x1402c5808]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
and rax, 0xfffffffffffffffc
je 0x140040b0f
mov rcx, qword [0x1402c9768]
shl rcx, 4
mov edx, dword [rax + rcx + 8]
cmp edx, dword [0x1402c9770]
jne 0x140040b0f
add rax, rcx
cmp qword [rax], 0
je 0x140040b0f
mov ecx, dword [0x1402c5808]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
and rax, 0xfffffffffffffffc
je 0x140040ab7
mov rcx, qword [0x1402c9768]
shl rcx, 4
mov edx, dword [rax + rcx + 8]
cmp edx, dword [0x1402c9770]
jne 0x140040ab7
add rax, rcx
mov r13, qword [rax]
lea r14, [r13 + 8]
mov rcx, qword [r13 + 8]
test rcx, rcx
je 0x140040a7f
mov rax, r14
xor edx, edx
cmp qword [rcx + 0x20], rsi
setb dl
cmovae rax, rcx
mov rcx, qword [rcx + rdx*8]
test rcx, rcx
jne 0x140040a60
cmp rax, r14
jne 0x140040c7f
cmp edi, 1
je case.default.0x140040ab0
mov rcx, qword [rsp + 0x40]
xor rcx, rsp
call fcn.14019f290
mov rcx, rsi
mov edx, edi
mov r8, rbp
mov r9, rbx
add rsp, 0x48
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
jmp qword [sym.imp.USER32.dll_DefWindowProcW]
xor r13d, r13d
jmp 0x140040a50
lea rcx, [0x1402c9778]
call fcn.14019ce70
cmp dword [0x1402c9778], 0xffffffff
jne 0x1400409df
mov qword [0x1402c9770], 0
lea rcx, [0x1402c9768]
mov qword [0x1402c9768], 0xffffffffffffffff
lea rdx, [0x140049490]
call fcn.140028120
lea rcx, [0x1402c9778]
call fcn.14019cd94
jmp 0x1400409df
mov ecx, Ordinal_26
call fcn.14019ca88
mov r15, rax
add rax, 8
xorps xmm0, xmm0
movups xmmword [r15 + 8], xmm0
mov qword [r15], rax
mov ecx, dword [0x1402c5808]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
and rax, 0xfffffffffffffffc
je 0x140040ba8
mov rcx, qword [0x1402c9768]
shl rcx, 4
mov edx, dword [rax + rcx + 8]
cmp edx, dword [0x1402c9770]
jne 0x140040ba8
add rax, rcx
mov r12, qword [rax]
mov ecx, dword [0x1402c5808]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
and rax, 0xfffffffffffffffc
jne 0x140040b76
test r15, r15
je 0x140040b9a
call fcn.14000ff40
mov rcx, qword [0x1402c9768]
shl rcx, 4
mov qword [rax + rcx], r15
mov ecx, dword [0x1402c9770]
mov rdx, qword [0x1402c9768]
shl rdx, 4
mov dword [rax + rdx + 8], ecx
test r12, r12
je 0x140040a1d
jmp 0x140040e15
xor r12d, r12d
jmp 0x140040b5a
mov rax, qword [rbx]
mov rbp, rbx
jmp 0x140040bf8
mov rbx, rax
mov rax, qword [rax + 0x20]
cmp rdi, rax
jb 0x140040bad
jbe 0x140040e12
mov rax, qword [rbx + 8]
test rax, rax
jne 0x140040bb5
lea rbp, [rbx + 8]
jmp 0x140040bfd
mov dword [rsp + 0x34], edi
mov rax, rsi
mov rsi, rbp
mov qword [rsp + 0x28], rbx
mov r15, qword [rbx]
mov rdi, rax
mov qword [r15 + 8], rax
mov rax, qword [r14]
mov rbp, r14
mov rbx, r14
test rax, rax
jne 0x140040bb5
mov ecx, 0x30
call fcn.14019ca88
mov r12, rax
mov qword [rax + 0x20], rdi
movabs rax, 0xfffffffc00000000
and rax, r15
cmp rax, qword [0x1402b9708]
jne 0x140040c2c
mov rcx, r15
call fcn.140004d30
mov qword [r12 + 0x28], r15
xorps xmm0, xmm0
movups xmmword [r12], xmm0
mov qword [r12 + 0x10], rbx
mov qword [rbp], r12
mov rax, qword [r13]
mov rax, qword [rax]
test rax, rax
je 0x140040c56
mov qword [r13], rax
mov r12, qword [rbp]
mov rcx, qword [r13 + 8]
mov rdx, r12
call fcn.14013f220
inc qword [r13 + 0x10]
test r15, r15
mov rbx, qword [rsp + 0x28]
mov rbp, rsi
mov rsi, rdi
mov edi, dword [rsp + 0x34]
jne 0x140040c96
jmp 0x140040a88
cmp rsi, qword [rax + 0x20]
jb 0x140040a7f
mov r15, qword [rax + 0x28]
test r15, r15
je 0x140040e0f
mov qword [rsp + 0x38], 0
mov r12, qword [r15]
test r12, r12
je 0x140040df6
mov eax, 1
lock xadd dword [r12], eax
test eax, eax
jle 0x140040df9
mov qword [rsp + 0x28], rsi
cmp eax, 0x7fffffff
je 0x140040dfc
mov rax, qword [r15]
mov rax, qword [rax + 8]
lea rcx, [rsp + 0x38]
mov qword [rsp + 0x20], rcx
mov rcx, r12
mov edx, edi
mov rsi, rbp
mov r8, rbp
mov r9, rbx
call qword [0x1402a7b00]
mov ebp, eax
lock dec dword [r12]
je 0x140040e02
test bpl, bpl
jne 0x140040d1d
mov rcx, qword [rsp + 0x28]
mov edx, edi
mov r8, rsi
mov r9, rbx
call qword [sym.imp.USER32.dll_DefWindowProcW]
mov qword [rsp + 0x38], rax
cmp edi, 2
je 0x140040d4f
mov rax, qword [rsp + 0x38]
mov rcx, qword [rsp + 0x40]
xor rcx, rsp
cmp rcx, qword [0x1402b7040]
je 0x140040d3e
call fcn.14019f290
int3
add rsp, 0x48
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov qword [r15 + 8], 0
mov rcx, qword [r14]
test rcx, rcx
mov r8, qword [rsp + 0x28]
je 0x140040dff
mov rax, rcx
mov rdi, r14
xor edx, edx
cmp qword [rax + 0x20], r8
setb dl
cmovae rdi, rax
mov rax, qword [rax + rdx*8]
test rax, rax
jne 0x140040d6e
cmp rdi, r14
je 0x140040dff
cmp r8, qword [rdi + 0x20]
jb 0x140040dff
mov rdx, qword [rdi + 8]
test rdx, rdx
jne 0x140040de9
mov rdx, rdi
mov rax, qword [rdx + 0x10]
cmp rdx, qword [rax]
mov rdx, rax
jne 0x140040d9b
cmp qword [r13], rdi
jne 0x140040db1
mov qword [r13], rax
dec qword [r13 + 0x10]
mov rdx, rdi
call fcn.14013bf40
mov rcx, qword [rdi + 0x28]
movabs rax, 0xfffffffc00000000
and rax, rcx
cmp rax, qword [0x1402b9708]
jne 0x140040ddc
call fcn.140004e70
mov rcx, rdi
call fcn.14019cac4
jmp 0x140040d22
mov rax, rdx
mov rdx, qword [rdx]
test rdx, rdx
je 0x140040da7
jmp 0x140040de9
int3
int3
int3
int3
mov rcx, r12
call fcn.14019af30
jmp 0x140040d00
int3
int3
mov rcx, qword [r12 + 8]
call fcn.1400494c0
mov rcx, r12
call fcn.14019cac4
jmp 0x140040a1d
lea rax, sym.imp.USER32.dll_DefWindowProcW
jmp 0x140266a84
lea rax, sym.imp.USER32.dll_DestroyWindow
jmp 0x140266a84
push rcx
push rdx
push r8
push r9
sub rsp, 0x48
movdqa xmmword [rsp], xmm0
movdqa xmmword [rsp + 0x10], xmm1
movdqa xmmword [rsp + 0x20], xmm2
movdqa xmmword [rsp + 0x30], xmm3
mov rdx, rax
lea rcx, [0x1402a7c70]
call fcn.14019e808
movdqa xmm0, xmmword [rsp]
movdqa xmm1, xmmword [rsp + 0x10]
movdqa xmm2, xmmword [rsp + 0x20]
movdqa xmm3, xmmword [rsp + 0x30]
add rsp, 0x48
pop r9
pop r8
pop rdx
pop rcx
jmp rax