Function at 0x509490
Capabilities:
Resolve function by parsing pe exports

Disassembly:
mov ecx, dword [0x8993fc]
mov ecx, dword fs:[ecx]
mov ecx, dword [ecx]
cmp esp, dword [ecx + 8]
jbe 0x50980b
sub esp, 0x6c
mov eax, dword [esp + 0x70]
mov ecx, dword [eax + 0x60]
nop
mov dword [esp], 0
mov dword [esp + 4], ecx
call sym.runtime.selectnbrecv
movzx eax, byte [esp + 8]
test al, al
jne 0x509596
mov eax, dword [esp + 0x70]
mov dword [esp], eax
call sym.sync_atomic.LoadInt32
cmp dword [esp + 4], 1
je 0x509576
mov eax, dword [esp + 0x70]
mov ecx, dword [eax + 0x40]
mov edx, dword [eax + 0x60]
mov dword [esp + 0x44], 0
mov dword [esp + 0x48], 0
mov dword [esp + 0x4c], 0
mov dword [esp + 0x50], 0
mov dword [esp + 0x44], ecx
lea ecx, [esp + 0x20]
mov dword [esp + 0x48], ecx
mov dword [esp + 0x4c], edx
lea ecx, [esp + 0x44]
mov dword [esp], ecx
lea ecx, [esp + 0x20]
mov dword [esp + 4], ecx
mov dword [esp + 8], 0
mov dword [esp + 0xc], 1
mov dword [esp + 0x10], 1
mov byte [esp + 0x14], 1
call sym.runtime.selectgo
mov eax, dword [esp + 0x18]
test eax, eax
je 0x5095b6
mov eax, dword [0x85a030]
mov ecx, dword [0x85a034]
mov dword [esp + 0x74], 0
mov dword [esp + 0x78], eax
mov dword [esp + 0x7c], ecx
add esp, 0x6c
ret
mov eax, dword [0x85a060]
mov ecx, dword [0x85a064]
mov dword [esp + 0x74], 0
mov dword [esp + 0x78], eax
mov dword [esp + 0x7c], ecx
add esp, 0x6c
ret
mov eax, dword [0x85a030]
mov ecx, dword [0x85a034]
mov dword [esp + 0x74], 0
mov dword [esp + 0x78], eax
mov dword [esp + 0x7c], ecx
add esp, 0x6c
ret
mov eax, dword [esp + 0x70]
lea ecx, [eax + 8]
mov dword [esp + 0x40], ecx
mov dword [esp], ecx
call sym.sync_atomic.LoadUint32
mov eax, dword [esp + 4]
cmp eax, 0xfffffffe
jae 0x5097eb
mov dword [esp + 0x28], eax
mov ecx, dword [esp + 0x40]
mov dword [esp], ecx
lea ecx, [eax + 2]
mov dword [esp + 8], ecx
call sym.sync_atomic.CompareAndSwapUint32
movzx eax, byte [esp + 0xc]
test al, al
je 0x5095b6
mov eax, dword [esp + 0x70]
mov dword [esp], eax
mov ecx, dword [esp + 0x28]
mov dword [esp + 4], ecx
mov dword [esp + 8], 0
call sym.github.com_hashicorp_yamux.newStream
mov eax, dword [esp + 0x70]
lea ecx, [eax + 0x38]
mov dword [esp + 0x3c], ecx
mov edx, dword [esp + 0xc]
mov dword [esp + 0x30], edx
mov dword [esp], ecx
call sym.sync._Mutex_.Lock
mov eax, dword [esp + 0x70]
mov ecx, dword [eax + 0x30]
lea edx, [0x6621c0]
mov dword [esp], edx
mov dword [esp + 4], ecx
mov ecx, dword [esp + 0x28]
mov dword [esp + 8], ecx
call sym.runtime.mapassign_fast32
mov eax, dword [esp + 0xc]
test byte [eax], al
mov ecx, dword [0x899508]
test ecx, ecx
jne 0x509664
mov ecx, dword [esp + 0x30]
jmp 0x509674
call sym.runtime.gcWriteBarrier2
mov ecx, dword [esp + 0x30]
mov dword [edi], ecx
mov edx, dword [eax]
mov dword [edi + 4], edx
mov dword [eax], ecx
mov eax, dword [esp + 0x70]
mov edx, dword [eax + 0x34]
lea ebx, [0x662200]
mov dword [esp], ebx
mov dword [esp + 4], edx
mov edx, dword [esp + 0x28]
mov dword [esp + 8], edx
call sym.runtime.mapassign_fast32
mov eax, dword [esp + 0xc]
test byte [eax], al
mov eax, dword [esp + 0x3c]
mov dword [esp], eax
call sym.sync._Mutex_.Unlock
mov eax, dword [esp + 0x70]
mov ecx, dword [eax + 0xc]
mov edx, dword [ecx + 0x1c]
mov ecx, dword [ecx + 0x20]
test ecx, ecx
setg cl
sete bl
test edx, edx
seta dl
and ebx, edx
or ecx, ebx
test cl, cl
je 0x509719
lea eax, [0x66d660]
mov dword [esp], eax
call sym.runtime.newobject
mov eax, dword [esp + 4]
lea ecx, [sym.github.com_hashicorp_yamux._Session_.OpenStream.gowrap1]
mov dword [eax], ecx
mov ecx, dword [0x899508]
test ecx, ecx
jne 0x5096f9
mov ecx, dword [esp + 0x70]
mov edx, dword [esp + 0x30]
jmp 0x50970b
call sym.runtime.gcWriteBarrier2
mov ecx, dword [esp + 0x70]
mov dword [edi], ecx
mov edx, dword [esp + 0x30]
mov dword [edi + 4], edx
mov dword [eax + 4], ecx
mov dword [eax + 8], edx
mov dword [esp], eax
call sym.runtime.newproc
mov eax, dword [esp + 0x30]
mov dword [esp], eax
call sym.github.com_hashicorp_yamux._Stream_.sendWindowUpdate
mov eax, dword [esp + 4]
mov ecx, dword [esp + 8]
test eax, eax
je 0x5097cf
mov dword [esp + 0x2c], eax
mov dword [esp + 0x38], ecx
mov eax, dword [esp + 0x70]
mov ecx, dword [eax + 0x40]
mov dword [esp], 0
mov dword [esp + 4], ecx
call sym.runtime.selectnbrecv
movzx eax, byte [esp + 8]
test al, al
jne 0x5097b3
mov ecx, dword [esp + 0x70]
mov ecx, dword [ecx + 0x10]
mov dword [esp + 0x34], ecx
lea edi, [esp + 0x54]
xor eax, eax
call fcn.0046f01a
lea ecx, [sym.github.com_hashicorp_yamux._Session_.OpenStream._Logger_.Printf.func1]
mov dword [esp + 0x54], ecx
mov dword [esp + 0x5c], 0x3f
lea ecx, [0x6a543b]
mov dword [esp + 0x58], ecx
mov ecx, dword [esp + 0x34]
mov dword [esp], ecx
mov dword [esp + 4], 0
mov dword [esp + 8], 2
lea ecx, [esp + 0x54]
mov dword [esp + 0xc], ecx
call sym.log._Logger_.output
mov dword [esp + 0x74], 0
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x78], eax
mov eax, dword [esp + 0x38]
mov dword [esp + 0x7c], eax
add esp, 0x6c
ret
mov eax, dword [esp + 0x30]
mov dword [esp + 0x74], eax
mov dword [esp + 0x78], 0
mov dword [esp + 0x7c], 0
add esp, 0x6c
ret
mov eax, dword [0x85a038]
mov ecx, dword [0x85a03c]
mov dword [esp + 0x74], 0
mov dword [esp + 0x78], eax
mov dword [esp + 0x7c], ecx
add esp, 0x6c
ret
call sym.runtime.morestack_noctxt
jmp sym.github.com_hashicorp_yamux._Session_.OpenStream