Function at 0x5b4580
Capabilities:
Get thread local storage value

Disassembly:
sub esp, 0x24
mov eax, dword [0x6eeaa0]
push ebx
push ebp
push esi
push edi
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
xor ebx, ebx
cmp edi, ebx
mov dword [esp + 0x24], edi
jne 0x5b45ac
pop edi
pop esi
pop ebp
mov eax, 5
pop ebx
add esp, 0x24
ret
mov ecx, dword [esp + 0x44]
mov edx, dword [esp + 0x48]
xor eax, eax
xor ebp, ebp
mov ax, word [ecx*2 + 0x699744]
mov ecx, dword [esp + 0x4c]
mov dword [esp + 0x28], eax
xor eax, eax
mov ax, word [edx*2 + 0x699744]
mov dword [esp + 0x14], ebx
mov dword [esp + 0x30], eax
xor eax, eax
mov ax, word [ecx*2 + 0x699744]
mov dword [esp + 0x20], 1
mov dword [esp + 0x2c], eax
mov eax, dword [edi + 0xab6]
cmp eax, ebx
mov dword [esp + 0x1c], eax
jle 0x5b4ae8
cmp dword [edi], 0
jne 0x5b4ae8
cmp ebp, 1
jae 0x5b4633
lea esi, [edi + 0x9088]
push edi
push esi
call fcn.005b2330
xor edx, edx
mov ecx, ebp
mov dx, word [esi]
add ebp, 8
shl edx, cl
add esp, 8
or ebx, edx
cmp ebp, 1
jb 0x5b4616
test bl, 1
je 0x5b4768
mov ecx, dword [esp + 0x1c]
mov eax, dword [edi + 0x44]
shr ebx, 1
dec ebp
dec ecx
test eax, eax
mov dword [esp + 0x1c], ecx
je 0x5b4668
mov eax, dword [edi + 0x48]
test eax, eax
je 0x5b4668
mov eax, dword [edi + 0x8cea]
test eax, eax
ja 0x5b4668
mov dword [esp + 0x1c], 0
cmp ebp, dword [esp + 0x44]
jae 0x5b4694
lea esi, [edi + 0x9088]
push edi
push esi
call fcn.005b2330
xor eax, eax
mov ecx, ebp
mov ax, word [esi]
add ebp, 8
shl eax, cl
add esp, 8
or ebx, eax
mov eax, dword [esp + 0x44]
cmp ebp, eax
jb 0x5b4674
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x38]
mov eax, ebx
not eax
and eax, ecx
lea ecx, [eax + eax*2]
xor eax, eax
mov al, byte [edx + ecx*2]
lea edx, [edx + ecx*2]
mov esi, eax
cmp esi, 0x10
mov dword [esp + 0x18], edx
jbe 0x5b4728
cmp esi, 0x63
je 0x5b4b07
xor ecx, ecx
sub esi, 0x10
mov cl, byte [edx + 1]
sub ebp, ecx
shr ebx, cl
cmp ebp, esi
jae 0x5b46fd
lea eax, [edi + 0x9088]
push edi
push eax
call fcn.005b2330
xor ecx, ecx
add esp, 8
mov cx, word [edi + 0x9088]
mov edx, ecx
mov ecx, ebp
shl edx, cl
add ebp, 8
or ebx, edx
cmp ebp, esi
jb 0x5b46d1
mov edx, dword [esp + 0x18]
xor eax, eax
mov ecx, ebx
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 + 0x18], eax
cmp esi, 0x10
mov edx, eax
ja 0x5b46b8
mov eax, dword [esp + 0x14]
xor ecx, ecx
mov cl, byte [edx + 1]
shr ebx, cl
sub ebp, ecx
mov cl, byte [edx + 2]
mov byte [eax + edi + 0xcd6], cl
inc eax
cmp eax, 0x8000
mov dword [esp + 0x14], eax
jne 0x5b4adc
push edi
push eax
call fcn.005b3750
add esp, 8
xor eax, eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x14], eax
jmp 0x5b4adc
shr ebx, 1
dec ebp
cmp ebp, 7
jae 0x5b4793
lea esi, [edi + 0x9088]
push edi
push esi
call fcn.005b2330
xor edx, edx
mov ecx, ebp
mov dx, word [esi]
add ebp, 8
shl edx, cl
add esp, 8
or ebx, edx
cmp ebp, 7
jb 0x5b4776
mov eax, ebx
sub ebp, 7
and eax, 0x7f
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x4c]
shr ebx, 7
cmp ebp, eax
jae 0x5b47d0
lea esi, [edi + 0x9088]
push edi
push esi
call fcn.005b2330
xor eax, eax
mov ecx, ebp
mov ax, word [esi]
add ebp, 8
shl eax, cl
add esp, 8
or ebx, eax
mov eax, dword [esp + 0x4c]
cmp ebp, eax
jb 0x5b47b0
mov edx, dword [esp + 0x2c]
mov ecx, ebx
not ecx
and ecx, edx
mov edx, dword [esp + 0x40]
xor eax, eax
lea ecx, [ecx + ecx*2]
mov al, byte [edx + ecx*2]
lea edx, [edx + ecx*2]
mov esi, eax
mov dword [esp + 0x18], edx
cmp esi, 0x10
jbe 0x5b4864
cmp esi, 0x63
je 0x5b4b07
xor ecx, ecx
sub esi, 0x10
mov cl, byte [edx + 1]
sub ebp, ecx
shr ebx, cl
cmp ebp, esi
jae 0x5b4839
lea eax, [edi + 0x9088]
push edi
push eax
call fcn.005b2330
xor ecx, ecx
add esp, 8
mov cx, word [edi + 0x9088]
mov edx, ecx
mov ecx, ebp
shl edx, cl
add ebp, 8
or ebx, edx
cmp ebp, esi
jb 0x5b480d
mov edx, dword [esp + 0x18]
xor eax, eax
mov ecx, ebx
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 + 0x18], eax
cmp esi, 0x10
mov edx, eax
ja 0x5b47f4
xor ecx, ecx
xor eax, eax
mov cl, byte [edx + 1]
mov ax, word [edx + 2]
mov edx, dword [esp + 0x10]
sub ebp, ecx
shr ebx, cl
mov ecx, eax
mov eax, dword [esp + 0x14]
sub eax, ecx
mov ecx, dword [esp + 0x48]
sub eax, edx
cmp ebp, ecx
mov dword [esp + 0x10], eax
jae 0x5b48b7
lea esi, [edi + 0x9088]
push edi
push esi
call fcn.005b2330
xor edx, edx
mov eax, dword [esp + 0x50]
mov dx, word [esi]
mov ecx, ebp
shl edx, cl
add ebp, 8
add esp, 8
or ebx, edx
cmp ebp, eax
jb 0x5b4893
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x30]
mov ecx, ebx
not ecx
and ecx, edx
mov edx, dword [esp + 0x3c]
lea ecx, [ecx + ecx*2]
lea edx, [edx + ecx*2]
xor ecx, ecx
mov dword [esp + 0x18], edx
mov cl, byte [edx]
mov esi, ecx
cmp esi, 0x10
jbe 0x5b494d
cmp esi, 0x63
je 0x5b4b07
xor ecx, ecx
sub esi, 0x10
mov cl, byte [edx + 1]
sub ebp, ecx
shr ebx, cl
cmp ebp, esi
jae 0x5b491d
lea eax, [edi + 0x9088]
push edi
push eax
call fcn.005b2330
xor edx, edx
mov ecx, ebp
mov dx, word [edi + 0x9088]
add ebp, 8
shl edx, cl
add esp, 8
or ebx, edx
cmp ebp, esi
jb 0x5b48f3
mov edx, dword [esp + 0x18]
xor ecx, ecx
mov edx, dword [edx + 2]
mov cx, word [esi*2 + 0x699744]
mov esi, ebx
not esi
and ecx, esi
mov eax, dword [esp + 0x10]
lea ecx, [ecx + ecx*2]
lea esi, [edx + ecx*2]
xor ecx, ecx
mov dword [esp + 0x18], esi
mov cl, byte [esi]
mov edx, dword [esp + 0x18]
mov esi, ecx
cmp esi, 0x10
ja 0x5b48da
xor ecx, ecx
mov cl, byte [edx + 1]
mov dword [esp + 0x18], ecx
sub ebp, ecx
shr ebx, cl
xor ecx, ecx
mov cx, word [edx + 2]
test esi, esi
mov dword [esp + 0x18], ecx
je 0x5b49ac
cmp ebp, 8
jae 0x5b4998
lea esi, [edi + 0x9088]
push edi
push esi
call fcn.005b2330
xor edx, edx
mov ecx, ebp
mov dx, word [esi]
add ebp, 8
shl edx, cl
add esp, 8
or ebx, edx
cmp ebp, 8
jb 0x5b4973
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x18]
mov edx, ebx
and edx, 0xff
add ecx, edx
shr ebx, 8
mov dword [esp + 0x18], ecx
sub ebp, 8
mov edx, dword [esp + 0x1c]
sub edx, ecx
mov ecx, dword [edi + 0x44]
test ecx, ecx
mov dword [esp + 0x1c], edx
je 0x5b49d6
mov ecx, dword [edi + 0x48]
test ecx, ecx
je 0x5b49d6
mov ecx, dword [edi + 0x8cea]
test ecx, ecx
ja 0x5b49d6
mov dword [esp + 0x1c], 0
mov esi, dword [esp + 0x14]
and eax, 0x7fff
cmp eax, esi
mov dword [esp + 0x10], eax
mov ecx, eax
ja 0x5b49eb
mov ecx, esi
mov edx, 0x8000
sub edx, ecx
mov ecx, dword [esp + 0x18]
cmp edx, ecx
jbe 0x5b49fc
mov edx, ecx
sub ecx, edx
mov dword [esp + 0x18], ecx
mov ecx, dword [esp + 0x20]
test ecx, ecx
je 0x5b4a43
cmp esi, eax
ja 0x5b4a43
mov ecx, edx
lea edi, [esi + edi + 0xcd6]
mov esi, ecx
xor eax, eax
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 eax, dword [esp + 0x10]
mov edi, dword [esp + 0x24]
add ecx, edx
add eax, edx
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], eax
mov esi, ecx
jmp 0x5b4ab0
mov ecx, dword [esp + 0x10]
mov eax, esi
sub eax, ecx
cmp eax, edx
jb 0x5b4a91
mov eax, dword [esp + 0x10]
mov ecx, edx
lea esi, [edi + eax + 0xcd6]
mov eax, dword [esp + 0x14]
lea edi, [edi + eax + 0xcd6]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov eax, dword [esp + 0x10]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x14]
mov edi, dword [esp + 0x24]
add ecx, edx
add eax, edx
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], eax
mov esi, ecx
jmp 0x5b4ab0
mov eax, dword [esp + 0x10]
mov cl, byte [edi + eax + 0xcd6]
mov byte [edi + esi + 0xcd6], cl
inc esi
inc eax
dec edx
jne 0x5b4a95
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], esi
cmp esi, 0x8000
jne 0x5b4ad0
push edi
push esi
call fcn.005b3750
add esp, 8
xor eax, eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x18]
test ecx, ecx
jne 0x5b49d6
mov eax, dword [esp + 0x1c]
test eax, eax
jg 0x5b4602
mov edx, dword [esp + 0x14]
push edi
push edx
call fcn.005b3750
mov eax, dword [edi + 0x44]
add esp, 8
test eax, eax
je 0x5b4b14
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x24
ret
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x24
ret
mov eax, dword [edi + 0xab2]
pop edi
neg eax
sbb eax, eax
pop esi
pop ebp
and eax, 5
pop ebx
add esp, 0x24
ret