Function at 0x4f9810
Capabilities:
Get thread local storage value
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x23c
mov eax, dword [0x5b46a4]
xor eax, esp
mov dword [esp + 0x238], eax
push ebx
push esi
push edi
mov ebx, ecx
mov dword [esp + 0x4c], ebx
mov al, byte [ebp + 0xc]
xor edx, edx
mov byte [esp + 0xe], al
mov byte [esp + 0x78], al
mov eax, dword [ebp + 0x14]
mov dword [esp + 0x14], eax
mov eax, dword [ebp + 0x18]
mov dword [esp + 0x50], eax
mov eax, dword [ebp + 0x2c]
mov dword [esp + 0x18], eax
mov eax, dword [ebp + 0x30]
mov dword [esp + 0x48], eax
mov eax, dword [ebp + 0x38]
mov dword [esp + 0x38], eax
mov eax, dword [ebp + 0x3c]
mov dword [esp + 0x34], eax
mov eax, dword [ebp + 0x40]
mov ecx, dword [ebp + 0x10]
mov dword [esp + 0x30], eax
mov eax, dword [ebp + 0x44]
mov dword [esp + 0x74], eax
xor eax, eax
mov edi, dword [ebp + 8]
mov dword [esp + 0x80], edi
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x10], eax
mov dword [esp + 0x58], eax
mov dword [esp + 0x5c], edx
cmp byte [ecx], al
jne 0x4f98a5
mov dword [edi], eax
mov dword [edi + 4], edx
jmp 0x4f9e3b
push dword [ebx + 0x218]
lea esi, [ebx + 0x218]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
test eax, eax
je 0x4f98cd
mov dword [edi], 0
mov dword [edi + 4], 0
jmp 0x4f9e3b
push esi
lea ecx, [esp + 0x58]
call fcn.004f8340
mov eax, dword [ebp + 0x48]
test al, 4
je 0x4f991b
mov esi, dword [ebp + 0x24]
test eax, 0x300
mov eax, dword [ebp + 0x28]
je 0x4f98f7
xor esi, dword [ebx + 0x128]
xor eax, dword [ebx + 0x12c]
mov dword [esp + 0x2c], esi
mov esi, dword [ebp + 0x1c]
xor esi, dword [ebx + 0x128]
mov dword [esp + 0x20], esi
mov esi, dword [ebp + 0x20]
xor esi, dword [ebx + 0x12c]
mov dword [esp + 0x28], eax
mov dword [esp + 0x3c], esi
jmp 0x4f9937
mov eax, dword [ebp + 0x28]
mov dword [esp + 0x28], eax
mov eax, dword [ebp + 0x24]
mov dword [esp + 0x2c], eax
mov eax, dword [ebp + 0x20]
mov dword [esp + 0x3c], eax
mov eax, dword [ebp + 0x1c]
mov dword [esp + 0x20], eax
push dword [esp + 0x48]
lea eax, [esp + 0x64]
mov ecx, ebx
push eax
call fcn.004f82d0
call fcn.004f2640
test al, al
je 0x4f995b
lea ecx, [esp + 0x40]
call fcn.004f2580
jmp 0x4f9968
xorps xmm0, xmm0
lea eax, [esp + 0x68]
movlpd qword [esp + 0x68], xmm0
mov ecx, dword [eax]
mov eax, dword [eax + 4]
mov dword [esp + 0x70], ecx
mov ecx, ebx
mov dword [esp + 0x68], eax
call fcn.004f91a0
push dword [ebx + 0x210]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
mov dword [esp + 0x40], esi
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [esp + 0x18], eax
jne 0x4f9ad5
call fcn.00510d80
push dword [esp + 0x18]
mov ecx, eax
call fcn.00510bd0
mov esi, eax
mov dword [esp + 0x24], esi
call fcn.004fb760
push dword [eax]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp esi, eax
je 0x4f9ad1
test esi, esi
je 0x4f9ad1
cmp byte [esi], 0
je 0x4f9ad1
call fcn.004fb760
push esi
mov ecx, eax
call fcn.004efae0
lea edi, [ebx + 0x1c]
push edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea ecx, [esp + 0x18]
push ecx
lea ecx, [esp + 0x80]
push ecx
lea ecx, [ebx + 0xbc]
call fcn.004e9600
mov esi, dword [esp + 0x7c]
cmp esi, dword [ebx + 0xc0]
jne 0x4f9a39
push dword [esp + 0x24]
lea eax, [esp + 0x1c]
push ecx
push eax
lea ecx, [ebx + 0xbc]
call fcn.004fb480
add esp, 4
mov ecx, eax
call fcn.004f3c10
jmp 0x4f9ac3
sub esp, 8
mov ecx, esp
push 0x5ad460
call fcn.004e0870
sub esp, 8
lea eax, [esi + 0xc]
mov ecx, esp
push eax
call fcn.004e0840
push ecx
xor edx, edx
lea ecx, [esp + 0x98]
call fcn.004fe470
mov edx, dword [esp + 0x9c]
lea eax, [esp + 0x38]
mov ecx, dword [esp + 0x98]
add esp, 0x14
push dword [esp + 0x54]
push eax
call fcn.004fce90
mov ecx, dword [esp + 0x90]
add esp, 8
cmp eax, ecx
jne 0x4f9ab7
sub ecx, dword [esp + 0x84]
test ecx, 0xfffffff8
je 0x4f9aab
push 0x2c
lea ecx, [esi + 0xc]
call fcn.004f77e0
push dword [esp + 0x24]
lea ecx, [esi + 0xc]
call fcn.004e0ae0
lea ecx, [esp + 0x84]
call fcn.004fb160
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edi, dword [esp + 0x80]
mov esi, dword [esp + 0x40]
mov eax, dword [esp + 0x1c]
test byte [eax], 8
je 0x4f9b05
push ecx
push dword [esp + 0x34]
mov cl, byte [esp + 0x16]
push dword [esp + 0x3c]
push dword [esp + 0x44]
push dword [ebp + 0x34]
sub esp, 8
push dword [esp + 0x30]
call fcn.005117f0
mov eax, dword [esp + 0x3c]
add esp, 0x20
test byte [eax], 1
mov dword [esp + 0x208], 0xf
mov dword [esp + 0x204], 0
mov byte [esp + 0x1f4], 0
je 0x4f9c81
mov byte [esp + 0xf], 0
lea eax, [ebx + 4]
test esi, esi
je 0x4f9b46
lea eax, [esp + 0x58]
mov ecx, esi
push eax
call fcn.004f8740
jmp 0x4f9b60
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push 1
lea eax, [esp + 0x5c]
mov byte [esp + 0x13], 1
push eax
mov ecx, ebx
call fcn.004f9690
mov esi, eax
test esi, esi
je 0x4f9bc0
push dword [esp + 0x68]
mov ecx, esi
push dword [esp + 0x74]
push dword [esp + 0x6c]
push dword [esp + 0x6c]
push dword [ebp + 0x48]
push dword [esp + 0x88]
push dword [esp + 0x48]
push dword [esp + 0x50]
push dword [esp + 0x58]
push dword [ebp + 0x34]
push dword [esp + 0x50]
push dword [esp + 0x58]
push dword [esp + 0x6c]
push dword [esp + 0x54]
push dword [esp + 0x88]
push dword [esp + 0x50]
push dword [esp + 0x5c]
push dword [esp + 0xbc]
push dword [esp + 0x60]
call fcn.005161b0
mov eax, dword [ebx + 0x17c]
test al, 8
je 0x4f9c0d
cmp byte [esp + 0xe], 0x58
mov ecx, 0x42
movzx eax, byte [esp + 0xe]
push esi
push dword [esp + 0x4c]
cmove eax, ecx
mov ecx, ebx
movzx eax, al
push eax
lea eax, [esp + 0x238]
push eax
call fcn.004f9f40
push eax
lea ecx, [esp + 0x1f8]
call fcn.004eb7a0
lea ecx, [esp + 0x22c]
call fcn.004e0b20
cmp byte [esp + 0xf], 0
je 0x4f9c1e
lea eax, [ebx + 4]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp dword [esp + 0x204], 0
je 0x4f9c81
cmp dword [0x5c1b2c], 2
jg 0x4f9c66
push 2
push 0x50d
mov eax, 4
lea ecx, [esp + 0x98]
push str.d:webapps_b_build_slave_repo_build_src_base_trace_event_trace_log.cc
mov dword [esp + 0x1c], eax
call fcn.004ebdd0
lea ecx, [esp + 0x1f4]
add eax, 8
push ecx
push eax
call fcn.004e3aa0
add esp, 8
mov eax, dword [esp + 0x10]
test al, 4
je 0x4f9c85
and eax, 0xfffffffb
lea ecx, [esp + 0x90]
mov dword [esp + 0x10], eax
call fcn.004ebe90
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x1c]
cmp dword [ebx + 0x160], ecx
jne 0x4f9d3c
mov dword [esp + 0x20c], 0
mov dword [esp + 0x210], 0
mov dword [esp + 0x228], 0xf
mov dword [esp + 0x224], 0
mov byte [esp + 0x214], 0
test al, 8
je 0x4f9cd9
lea ecx, [esp + 0x140]
call fcn.004ebe90
lea esi, [ebx + 4]
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edx, dword [esp + 0x14]
lea ecx, [ebx + 0x164]
call fcn.004f2950
mov ecx, dword [esp + 0x4c]
mov bl, al
add ecx, 0x140
push ecx
lea ecx, [esp + 0x210]
call fcn.004ed6e0
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test bl, bl
je 0x4f9d2c
mov eax, dword [esp + 0x20c]
test eax, eax
je 0x4f9d2c
push eax
call dword [esp + 0x214]
add esp, 4
lea ecx, [esp + 0x20c]
call fcn.004ecf30
mov ebx, dword [esp + 0x4c]
mov eax, dword [esp + 0x1c]
mov esi, dword [esp + 0x14]
test byte [eax], 4
je 0x4f9d9b
mov ecx, dword [ebx + 0x4c]
mov bl, byte [esp + 0xe]
test ecx, ecx
je 0x4f9d9f
push dword [ebp + 0x48]
cmp bl, 0x58
mov edx, 0x42
push dword [esp + 0x34]
push dword [esp + 0x3c]
push dword [esp + 0x44]
push dword [ebp + 0x34]
push dword [esp + 0x50]
push dword [esp + 0x38]
push dword [esp + 0x6c]
push esi
push eax
movzx eax, bl
cmove eax, edx
movzx eax, al
push eax
push dword [esp + 0x90]
push dword [esp + 0x90]
call ecx
add esp, 0x34
jmp 0x4f9d9f
mov bl, byte [esp + 0xe]
test byte [ebp + 0x48], 1
jne 0x4f9de6
cmp dword [0x5c2bd4], 0
je 0x4f9de6
mov eax, dword [0x5c2bd4]
test eax, eax
setne al
test al, al
je 0x4f9de6
cmp bl, 0x42
je 0x4f9ddf
cmp bl, 0x58
je 0x4f9ddf
cmp bl, 0x45
jne 0x4f9de6
call fcn.00512e70
mov ecx, dword [eax + 4]
cmp dword [eax], ecx
je 0x4f9de6
add ecx, 0xfffffffc
mov dword [eax + 4], ecx
jmp 0x4f9de6
mov ecx, esi
call fcn.00512ee0
mov eax, dword [esp + 0x58]
mov dword [edi], eax
mov eax, dword [esp + 0x5c]
mov dword [edi + 4], eax
mov eax, dword [esp + 0x208]
cmp eax, 0x10
jb 0x4f9e14
inc eax
lea ecx, [esp + 0x1f4]
push eax
push dword [esp + 0x1f8]
call fcn.004e2910
lea ecx, [esp + 0x54]
mov dword [esp + 0x208], 0xf
mov dword [esp + 0x204], 0
mov byte [esp + 0x1f4], 0
call fcn.004f83b0
mov ecx, dword [esp + 0x244]
mov eax, edi
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0053a230
mov esp, ebp
pop ebp
ret 0x44