Function at 0x409410
Capabilities:
Set thread local storage value

Disassembly:
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x28
mov r12d, dword [rsp + 0x80]
mov esi, ecx
mov ebx, edx
mov ecx, 0x40000
xor edx, edx
mov edi, r8d
mov rbp, r9
call sym.OPENSSL_init_crypto
test eax, eax
je 0x409520
lea rdx, [sym.err_do_init_ossl_]
lea rcx, [0x0063ea9c]
call sym.CRYPTO_THREAD_run_once
test eax, eax
je 0x409520
mov eax, dword [0x0063e260]
test eax, eax
je 0x409520
lea rcx, [0x0063ea94]
call sym.CRYPTO_THREAD_get_local
mov r13, rax
cmp rax, 0xffffffffffffffff
je 0x409520
test rax, rax
je 0x409560
mov eax, dword [r13 + 0x200]
lea r10d, [rax + 1]
mov eax, r10d
sar eax, 0x1f
shr eax, 0x1c
add r10d, eax
and r10d, 0xf
sub r10d, eax
mov dword [r13 + 0x200], r10d
cmp r10d, dword [r13 + 0x204]
jne 0x4094d1
lea eax, [r10 + 1]
cdq
shr edx, 0x1c
add eax, edx
and eax, 0xf
sub eax, edx
mov dword [r13 + 0x204], eax
shl ebx, 0xc
shl esi, 0x18
movsxd r10, r10d
and edi, 0xfff
and ebx, 0xfff000
lea rax, [r13 + r10*4]
lea rdx, [r13 + r10*8]
or esi, ebx
mov dword [rax], 0
or edi, esi
mov dword [rax + 0x40], edi
mov qword [rdx + 0x140], rbp
mov dword [rax + 0x1c0], r12d
test byte [rax + 0x100], 1
jne 0x409530
mov dword [r13 + r10*4 + 0x100], 0
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
ret
mov rcx, qword [rdx + 0x80]
mov r8d, 0x199
lea rdx, str.crypto_err_err.c
call sym.CRYPTO_free
movsxd r10, dword [r13 + 0x200]
mov qword [r13 + r10*8 + 0x80], 0
jmp 0x409514
mov rdx, 0xffffffffffffffff
lea rcx, [0x0063ea94]
call sym.CRYPTO_THREAD_set_local
test eax, eax
je 0x409520
mov r8d, 0x2b1
lea rdx, str.crypto_err_err.c
mov ecx, 0x208
call sym.CRYPTO_zalloc
mov r13, rax
test rax, rax
je 0x409771
mov ecx, 2
call sym.ossl_init_thread_start
test eax, eax
je 0x4095d0
mov rdx, r13
lea rcx, [0x0063ea94]
call sym.CRYPTO_THREAD_set_local
test eax, eax
je 0x4095d0
xor edx, edx
mov ecx, 2
call sym.OPENSSL_init_crypto
jmp 0x40948d
test byte [r13 + 0x100], 1
jne 0x40978b
mov dword [r13 + 0x100], 0
test byte [r13 + 0x104], 1
jne 0x4099f2
mov dword [r13 + 0x104], 0
test byte [r13 + 0x108], 1
jne 0x4099c9
mov dword [r13 + 0x108], 0
test byte [r13 + 0x10c], 1
jne 0x4099a0
mov dword [r13 + 0x10c], 0
test byte [r13 + 0x110], 1
jne 0x409977
mov dword [r13 + 0x110], 0
test byte [r13 + 0x114], 1
jne 0x40994e
mov dword [r13 + 0x114], 0
test byte [r13 + 0x118], 1
jne 0x409925
mov dword [r13 + 0x118], 0
test byte [r13 + 0x11c], 1
jne 0x4098fc
mov dword [r13 + 0x11c], 0
test byte [r13 + 0x120], 1
jne 0x4098d3
mov dword [r13 + 0x120], 0
test byte [r13 + 0x124], 1
jne 0x4098aa
mov dword [r13 + 0x124], 0
test byte [r13 + 0x128], 1
jne 0x409881
mov dword [r13 + 0x128], 0
test byte [r13 + 0x12c], 1
jne 0x409858
mov dword [r13 + 0x12c], 0
test byte [r13 + 0x130], 1
jne 0x40982f
mov dword [r13 + 0x130], 0
test byte [r13 + 0x134], 1
jne 0x409806
mov dword [r13 + 0x134], 0
test byte [r13 + 0x138], 1
jne 0x4097dd
mov dword [r13 + 0x138], 0
test byte [r13 + 0x13c], 1
jne 0x4097b4
mov r8d, 0x107
lea rdx, str.crypto_err_err.c
mov rcx, r13
mov dword [r13 + 0x13c], 0
call sym.CRYPTO_free
xor edx, edx
lea rcx, [0x0063ea94]
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
jmp sym.CRYPTO_THREAD_set_local
mov rcx, qword [r13 + 0x80]
mov r8d, 0x105
lea rdx, str.crypto_err_err.c
call sym.CRYPTO_free
mov qword [r13 + 0x80], 0
jmp 0x4095de
mov rcx, qword [r13 + 0xf8]
mov r8d, 0x105
lea rdx, str.crypto_err_err.c
call sym.CRYPTO_free
mov qword [r13 + 0xf8], 0
jmp 0x409751
mov rcx, qword [r13 + 0xf0]
mov r8d, 0x105
lea rdx, str.crypto_err_err.c
call sym.CRYPTO_free
mov qword [r13 + 0xf0], 0
jmp 0x40973c
mov rcx, qword [r13 + 0xe8]
mov r8d, 0x105
lea rdx, str.crypto_err_err.c
call sym.CRYPTO_free
mov qword [r13 + 0xe8], 0
jmp 0x409723
mov rcx, qword [r13 + 0xe0]
mov r8d, 0x105
lea rdx, str.crypto_err_err.c
call sym.CRYPTO_free
mov qword [r13 + 0xe0], 0
jmp 0x40970a
mov rcx, qword [r13 + 0xd8]
mov r8d, 0x105
lea rdx, str.crypto_err_err.c
call sym.CRYPTO_free
mov qword [r13 + 0xd8], 0
jmp 0x4096f1
mov rcx, qword [r13 + 0xd0]
mov r8d, 0x105
lea rdx, str.crypto_err_err.c
call sym.CRYPTO_free
mov qword [r13 + 0xd0], 0
jmp 0x4096d8
mov rcx, qword [r13 + 0xc8]
mov r8d, 0x105
lea rdx, str.crypto_err_err.c
call sym.CRYPTO_free
mov qword [r13 + 0xc8], 0
jmp 0x4096bf
mov rcx, qword [r13 + 0xc0]
mov r8d, 0x105
lea rdx, str.crypto_err_err.c
call sym.CRYPTO_free
mov qword [r13 + 0xc0], 0
jmp 0x4096a6
mov rcx, qword [r13 + 0xb8]
mov r8d, 0x105
lea rdx, str.crypto_err_err.c
call sym.CRYPTO_free
mov qword [r13 + 0xb8], 0
jmp 0x40968d
mov rcx, qword [r13 + 0xb0]
mov r8d, 0x105
lea rdx, str.crypto_err_err.c
call sym.CRYPTO_free
mov qword [r13 + 0xb0], 0
jmp 0x409674
mov rcx, qword [r13 + 0xa8]
mov r8d, 0x105
lea rdx, str.crypto_err_err.c
call sym.CRYPTO_free
mov qword [r13 + 0xa8], 0
jmp 0x40965b
mov rcx, qword [r13 + 0xa0]
mov r8d, 0x105
lea rdx, str.crypto_err_err.c
call sym.CRYPTO_free
mov qword [r13 + 0xa0], 0
jmp 0x409642
mov rcx, qword [r13 + 0x98]
mov r8d, 0x105
lea rdx, str.crypto_err_err.c
call sym.CRYPTO_free
mov qword [r13 + 0x98], 0
jmp 0x409629
mov rcx, qword [r13 + 0x90]
mov r8d, 0x105
lea rdx, str.crypto_err_err.c
call sym.CRYPTO_free
mov qword [r13 + 0x90], 0
jmp 0x409610
mov rcx, qword [r13 + 0x88]
mov r8d, 0x105
lea rdx, str.crypto_err_err.c
call sym.CRYPTO_free
mov qword [r13 + 0x88], 0
jmp 0x4095f7