Function at 0x10046550
Capabilities:
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x68
push edi
mov edi, ecx
cmp dword [edi], 0
je 0x10046825
push ebx
push esi
push dword [edi]
xor ebx, ebx
push ebx
push dword [edi + 4]
call fcn.10024e53
push dword [edi + 4]
call fcn.10065982
mov eax, 0x256915a
xor esi, esi
mov dword [ebp - 0x48], eax
add esp, 0x10
mov dword [ebp - 0x44], eax
inc esi
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0xc], 0xcd7d
mov dword [ebp - 0xc], ebx
jmp 0x100465a6
mov eax, dword [ebp - 0xc]
mov dword [ebp + eax*4 - 0x20], esi
inc dword [ebp - 0xc]
cmp dword [ebp - 0xc], esi
jl 0x1004659c
mov dword [ebp - 0x40], ebx
cmp dword [ebp - 0x40], ebx
jl 0x100465f3
mov dword [ebp - 0x1c], 0xffffffff
lea ecx, [ebp - 0x38]
push esi
call fcn.100176ef
mov dword [ebp - 0x1c], 0x53061ece
mov dword [ebp - 8], esi
mov dword [ebp - 0xc], ebx
jmp 0x100465de
mov ecx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x38]
mov dword [eax + ecx*4], esi
inc dword [ebp - 0xc]
cmp dword [ebp - 0xc], esi
jl 0x100465d2
dec dword [ebp - 8]
lea ecx, [ebp - 0x38]
call fcn.10017771
dec dword [ebp - 0x40]
jns 0x100465b3
mov dword [ebp - 0xc], ebx
jmp 0x10046716
mov dword [ebp - 8], 0x72585faf
mov dword [ebp - 0x18], 0xeca5
mov dword [ebp - 0x1c], 0xd9140931
mov dword [ebp - 8], 3
cmp dword [ebp - 8], ebx
jl 0x1004664a
mov byte [ebp - 1], bl
cmp byte [ebp - 1], bl
je 0x10046630
push ebx
push 0x172a
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov byte [ebp - 1], bl
cmp byte [ebp - 1], bl
je 0x10046645
push ebx
push 0x1445
push ebx
call dword [sym.imp.GDI32.dll_ExtCreateRegion]
dec dword [ebp - 8]
jns 0x1004661c
mov dword [ebp - 8], 3
cmp dword [ebp - 8], ebx
jl 0x10046713
mov dword [ebp - 0x14], esi
mov dword [ebp - 0x10], 0xa832a49e
mov dword [ebp - 0x1c], 0xfffffffa
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], ebx
jne 0x1004667c
mov eax, dword [ebp - 0x40]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x14]
xor ecx, ecx
cmp eax, 0xae22781
setne cl
xor eax, eax
test ecx, ecx
setg al
cmp eax, esi
jl 0x1004669b
mov ecx, ebx
cmp dword [ebp - 0x40], ebx
je 0x1004669d
mov ecx, esi
mov eax, dword [ebp - 0x40]
xor edx, edx
neg ecx
cmp ecx, eax
mov ecx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x18]
setg dl
add ecx, edx
xor edx, edx
cmp ecx, eax
mov eax, dword [ebp - 0xc]
setle dl
sub edx, 6
mov eax, dword [ebp + eax*4 - 0x48]
neg edx
sbb edx, edx
xor ecx, ecx
inc edx
cmp ecx, eax
sbb eax, eax
inc eax
sub eax, edx
neg eax
sbb eax, eax
inc eax
cmp eax, dword [ebp - 0xc]
jg 0x100466e1
mov edx, ebx
cmp dword [ebp - 0x1c], ebx
je 0x100466e3
mov edx, esi
mov eax, dword [ebp - 0x18]
xor ecx, ecx
cmp edx, eax
push 8
setl cl
pop eax
sub eax, ecx
sub eax, dword [ebp - 8]
sub eax, dword [ebp - 0x1c]
neg eax
sbb eax, eax
inc eax
mov dword [ebp - 0x1c], eax
mov ecx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0xc]
mov dword [ebp + eax*4 - 0x48], ecx
dec dword [ebp - 8]
jns 0x1004665a
inc dword [ebp - 0xc]
cmp dword [ebp - 0xc], 3
jle 0x100465fb
push 4
pop esi
push esi
lea ecx, [ebp - 0x2c]
mov dword [edi + 4], ebx
call fcn.100176ef
mov dword [ebp - 0xc], 0x532fe223
mov dword [ebp - 8], ebx
jmp 0x1004674b
mov ecx, dword [ebp - 8]
mov eax, dword [ebp - 0x2c]
mov dword [eax + ecx*4], 0xb9b5
inc dword [ebp - 8]
cmp dword [ebp - 8], esi
jl 0x1004673b
mov dword [ebp - 8], ebx
jmp 0x10046763
mov eax, dword [ebp - 8]
mov dword [ebp + eax*4 - 0x68], 0xfffffff9
inc dword [ebp - 8]
cmp dword [ebp - 8], esi
jl 0x10046755
mov dword [ebp - 0xc], ebx
cmp dword [ebp - 0xc], 3
jg 0x10046819
mov eax, 0x2526041
mov dword [ebp - 0x58], eax
mov dword [ebp - 0x54], eax
mov dword [ebp - 0x50], eax
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x1c], 8
mov dword [ebp - 0x18], 0xfffffffa
mov dword [ebp - 0x54], ebx
jmp 0x100467fb
mov ecx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x2c]
cmp dword [eax + ecx*4], ebx
je 0x100467ed
mov eax, dword [ebp - 0xc]
xor ecx, ecx
mov edx, dword [ebp - 0xc]
mov esi, dword [ebp - 0x2c]
mov eax, dword [esi + eax*4]
imul eax, dword [esi + 4]
cmp eax, dword [esi + edx*4]
setg cl
cmp ecx, dword [esi + 0xc]
jg 0x100467d3
mov ecx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x2c]
cmp dword [eax + ecx*4], ebx
jne 0x100467d3
xor esi, esi
inc esi
mov ecx, esi
jmp 0x100467d8
xor esi, esi
mov ecx, ebx
inc esi
xor eax, eax
cmp ecx, esi
setl al
mov dword [ebp - 0x1c], eax
mov eax, esi
cmp dword [ebp - 0x1c], 0xb0ad8ea5
jne 0x100467ef
mov eax, ebx
mov dword [ebp - 0x64], eax
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x68], eax
inc dword [ebp - 0x54]
cmp dword [ebp - 0x54], 3
jle 0x10046799
mov eax, dword [ebp - 0x64]
mov dword [ebp - 0x60], eax
mov eax, 0x2526041
inc dword [ebp - 0xc]
cmp dword [ebp - 0xc], 3
jle 0x1004677a
lea ecx, [ebp - 0x2c]
call fcn.10017771
pop esi
mov dword [edi], ebx
pop ebx
pop edi
mov esp, ebp
pop ebp
ret