Function at 0x5b5650
Capabilities:
Get thread local storage value

Disassembly:
mov eax, dword [0x6eeaa0]
sub esp, 0x20
push ebx
push ebp
push esi
push edi
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ebx, eax
test ebx, ebx
jne 0x5b5676
pop edi
pop esi
pop ebp
mov eax, 5
pop ebx
add esp, 0x20
ret
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x40]
xor eax, eax
xor edi, edi
mov ax, word [ecx*2 + 0x699744]
xor ebp, ebp
mov dword [esp + 0x2c], eax
xor eax, eax
mov ax, word [edx*2 + 0x699744]
mov dword [esp + 0x14], edi
mov dword [esp + 0x28], eax
mov eax, dword [ebx + 0xab6]
test eax, eax
mov dword [esp + 0x10], ebp
mov dword [esp + 0x24], 1
mov dword [esp + 0x18], eax
jle 0x5b5b76
cmp dword [ebx], 0
jne 0x5b5b76
cmp ebp, 1
jae 0x5b56f9
lea esi, [ebx + 0x9088]
push ebx
push esi
call fcn.005b2330
mov edx, dword [esp + 0x18]
xor eax, eax
mov ax, word [esi]
mov ecx, ebp
shl eax, cl
add ebp, 8
add esp, 8
or edx, eax
cmp ebp, 1
mov dword [esp + 0x10], edx
jb 0x5b56d4
test byte [esp + 0x10], 1
je 0x5b57ab
mov esi, dword [esp + 0x10]
mov ecx, dword [esp + 0x18]
mov eax, dword [ebx + 0x44]
shr esi, 1
dec ebp
dec ecx
test eax, eax
mov dword [esp + 0x10], esi
mov dword [esp + 0x18], ecx
je 0x5b5738
mov eax, dword [ebx + 0x48]
test eax, eax
je 0x5b5738
mov eax, dword [ebx + 0x8cea]
test eax, eax
ja 0x5b5738
mov dword [esp + 0x18], 0
cmp ebp, 8
jae 0x5b576a
lea esi, [ebx + 0x9088]
push ebx
push esi
call fcn.005b2330
xor ecx, ecx
mov eax, dword [esp + 0x18]
mov cx, word [esi]
add esp, 8
mov edx, ecx
mov ecx, ebp
shl edx, cl
add ebp, 8
or eax, edx
cmp ebp, 8
mov dword [esp + 0x10], eax
jb 0x5b5743
mov al, byte [esp + 0x10]
mov byte [edi + ebx + 0xcd6], al
inc edi
cmp edi, 0x8000
mov dword [esp + 0x14], edi
jne 0x5b5798
push ebx
push edi
call fcn.005b3750
add esp, 8
xor eax, eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x14], eax
mov edi, eax
mov ecx, dword [esp + 0x10]
shr ecx, 8
mov dword [esp + 0x10], ecx
sub ebp, 8
jmp 0x5b5b6a
mov edx, dword [esp + 0x10]
shr edx, 1
dec ebp
mov dword [esp + 0x10], edx
cmp ebp, 6
jae 0x5b57e8
lea esi, [ebx + 0x9088]
push ebx
push esi
call fcn.005b2330
xor ecx, ecx
mov edi, dword [esp + 0x18]
mov cx, word [esi]
add esp, 8
mov edx, ecx
mov ecx, ebp
shl edx, cl
add ebp, 8
or edi, edx
cmp ebp, 6
mov dword [esp + 0x10], edi
jb 0x5b57c1
mov ecx, dword [esp + 0x10]
sub ebp, 6
mov eax, ecx
and eax, 0x3f
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x40]
shr ecx, 6
cmp ebp, eax
mov dword [esp + 0x10], ecx
jae 0x5b5835
lea esi, [ebx + 0x9088]
push ebx
push esi
call fcn.005b2330
mov edx, dword [esp + 0x18]
xor eax, eax
mov ax, word [esi]
mov ecx, ebp
shl eax, cl
add ebp, 8
add esp, 8
or edx, eax
mov eax, dword [esp + 0x40]
cmp ebp, eax
mov dword [esp + 0x10], edx
jb 0x5b580d
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x38]
not eax
and eax, ecx
lea ecx, [eax + eax*2]
xor eax, eax
mov al, byte [edx + ecx*2]
lea edi, [edx + ecx*2]
mov esi, eax
cmp esi, 0x10
jbe 0x5b58cf
cmp esi, 0x63
je 0x5b5b91
mov eax, dword [esp + 0x10]
xor ecx, ecx
mov cl, byte [edi + 1]
sub esi, 0x10
shr eax, cl
sub ebp, ecx
cmp ebp, esi
mov dword [esp + 0x10], eax
jae 0x5b58a8
lea eax, [ebx + 0x9088]
push ebx
push eax
call fcn.005b2330
xor ecx, ecx
mov eax, dword [esp + 0x18]
mov cx, word [ebx + 0x9088]
add esp, 8
mov edx, ecx
mov ecx, ebp
shl edx, cl
add ebp, 8
or eax, edx
cmp ebp, esi
mov dword [esp + 0x10], eax
jb 0x5b5878
mov ecx, dword [esp + 0x10]
xor eax, eax
mov ax, word [esi*2 + 0x699744]
not ecx
and eax, ecx
xor ecx, ecx
lea edx, [eax + eax*2]
mov eax, dword [edi + 2]
mov cl, byte [eax + edx*2]
lea edi, [eax + edx*2]
mov esi, ecx
cmp esi, 0x10
ja 0x5b5857
xor edx, edx
xor eax, eax
mov dl, byte [edi + 1]
mov ax, word [edi + 2]
mov edi, dword [esp + 0x14]
mov esi, edx
mov edx, dword [esp + 0x10]
mov ecx, esi
shr edx, cl
mov ecx, dword [esp + 0x1c]
sub edi, eax
mov eax, dword [esp + 0x3c]
sub ebp, esi
sub edi, ecx
cmp ebp, eax
mov dword [esp + 0x10], edx
jae 0x5b592e
lea esi, [ebx + 0x9088]
push ebx
push esi
call fcn.005b2330
xor ecx, ecx
mov eax, dword [esp + 0x18]
mov cx, word [esi]
add esp, 8
mov edx, ecx
mov ecx, ebp
shl edx, cl
add ebp, 8
or eax, edx
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x3c]
cmp ebp, eax
jb 0x5b5904
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x2c]
not eax
and eax, ecx
mov ecx, dword [esp + 0x34]
lea eax, [eax + eax*2]
lea edx, [ecx + eax*2]
xor eax, eax
mov dword [esp + 0x20], edx
mov al, byte [edx]
mov esi, eax
cmp esi, 0x10
jbe 0x5b59e3
cmp esi, 0x63
je 0x5b5b91
mov eax, dword [esp + 0x10]
xor ecx, ecx
mov cl, byte [edx + 1]
sub esi, 0x10
shr eax, cl
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x10], eax
mov eax, ecx
sub ebp, eax
cmp ebp, esi
jae 0x5b59b2
lea eax, [ebx + 0x9088]
push ebx
push eax
call fcn.005b2330
xor ecx, ecx
mov eax, dword [esp + 0x18]
mov cx, word [ebx + 0x9088]
add esp, 8
mov edx, ecx
mov ecx, ebp
shl edx, cl
add ebp, 8
or eax, edx
cmp ebp, esi
mov dword [esp + 0x10], eax
jb 0x5b597e
mov edx, dword [esp + 0x20]
mov ecx, dword [esp + 0x10]
xor eax, eax
mov ax, word [esi*2 + 0x699744]
not ecx
and eax, ecx
mov ecx, dword [edx + 2]
xor edx, edx
lea eax, [eax + eax*2]
mov dl, byte [ecx + eax*2]
lea eax, [ecx + eax*2]
mov esi, edx
mov dword [esp + 0x20], eax
cmp esi, 0x10
mov edx, eax
ja 0x5b5957
mov eax, dword [esp + 0x10]
xor ecx, ecx
mov cl, byte [edx + 1]
mov dword [esp + 0x1c], ecx
sub ebp, ecx
shr eax, cl
xor ecx, ecx
mov cx, word [edx + 2]
test esi, esi
mov dword [esp + 0x10], eax
mov dword [esp + 0x20], ecx
je 0x5b5a52
cmp ebp, 8
jae 0x5b5a3a
lea esi, [ebx + 0x9088]
push ebx
push esi
call fcn.005b2330
mov edx, dword [esp + 0x18]
xor eax, eax
mov ax, word [esi]
mov ecx, ebp
shl eax, cl
add ebp, 8
add esp, 8
or edx, eax
cmp ebp, 8
mov dword [esp + 0x10], edx
jb 0x5b5a11
mov ecx, dword [esp + 0x20]
mov eax, dword [esp + 0x10]
mov edx, eax
and edx, 0xff
shr eax, 8
add ecx, edx
mov dword [esp + 0x10], eax
sub ebp, 8
mov edx, dword [esp + 0x18]
mov eax, dword [ebx + 0x44]
sub edx, ecx
test eax, eax
mov dword [esp + 0x18], edx
je 0x5b5a7c
mov eax, dword [ebx + 0x48]
test eax, eax
je 0x5b5a7c
mov eax, dword [ebx + 0x8cea]
test eax, eax
ja 0x5b5a7c
mov dword [esp + 0x18], 0
mov eax, dword [esp + 0x14]
and edi, 0x7fff
cmp edi, eax
mov dword [esp + 0x1c], edi
mov esi, edi
ja 0x5b5a92
mov esi, eax
mov edx, 0x8000
sub edx, esi
cmp edx, ecx
jbe 0x5b5a9f
mov edx, ecx
sub ecx, edx
mov dword [esp + 0x20], ecx
mov ecx, dword [esp + 0x24]
test ecx, ecx
je 0x5b5ae2
cmp eax, edi
ja 0x5b5ae2
mov esi, dword [esp + 0x14]
mov ecx, edx
xor eax, eax
lea edi, [esi + ebx + 0xcd6]
mov esi, ecx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, esi
and ecx, 3
rep stosb byte es:[edi], al
mov ecx, dword [esp + 0x14]
mov edi, dword [esp + 0x1c]
add ecx, edx
add edi, edx
mov dword [esp + 0x14], ecx
mov eax, ecx
jmp 0x5b5b3b
mov ecx, eax
sub ecx, edi
cmp ecx, edx
jb 0x5b5b24
mov ecx, edx
lea esi, [ebx + edi + 0xcd6]
lea edi, [ebx + eax + 0xcd6]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov eax, dword [esp + 0x1c]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x14]
add ecx, edx
add eax, edx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x14], ecx
mov edi, dword [esp + 0x1c]
mov eax, ecx
jmp 0x5b5b3b
mov cl, byte [ebx + edi + 0xcd6]
mov byte [ebx + eax + 0xcd6], cl
inc eax
inc edi
dec edx
jne 0x5b5b24
mov dword [esp + 0x14], eax
mov ecx, dword [esp + 0x20]
cmp eax, 0x8000
jne 0x5b5b5e
push ebx
push eax
call fcn.005b3750
mov ecx, dword [esp + 0x28]
add esp, 8
xor eax, eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x14], eax
test ecx, ecx
jne 0x5b5a7c
mov edi, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
test eax, eax
jg 0x5b56c0
push ebx
push edi
call fcn.005b3750
mov eax, dword [ebx + 0x44]
add esp, 8
test eax, eax
je 0x5b5b9e
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x20
ret
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x20
ret
mov eax, dword [ebx + 0xab2]
pop edi
neg eax
sbb eax, eax
pop esi
pop ebp
and eax, 5
pop ebx
add esp, 0x20
ret