// File: DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::strstatx(bamboo::stream_t*, char*)
extern int strstatx(stream_t *stream, char *msg)
	{
		int state;

		tracet(4, "strstatx:\n");

		strlock(stream);

		if (!stream->port) {
			strunlock(stream);
			return stream->state;
		}
		switch (stream->type) {
		case STR_SERIAL: state = statexserial((serial_t *)stream->port, msg); break;
		case STR_FILE: state = statexfile((file_t   *)stream->port, msg); break;
		case STR_TCPSVR: state = statextcpsvr((tcpsvr_t *)stream->port, msg); break;
		case STR_TCPCLI: state = statextcpcli((tcpcli_t *)stream->port, msg); break;
		case STR_NTRIPSVR:
		case STR_NTRIPCLI: state = statexntrip((ntrip_t  *)stream->port, msg); break;
		case STR_NTRIPC_C:
		case STR_NTRIPC_S: state = statexntripc((ntripc_t *)stream->port, msg); break;
		case STR_UDPSVR: state = statexudpsvr((udp_t    *)stream->port, msg); break;
		case STR_UDPCLI: state = statexudpcli((udp_t    *)stream->port, msg); break;
		case STR_MEMBUF: state = statexmembuf((membuf_t *)stream->port, msg); break;
		case STR_FTP: state = statexftp((ftp_t    *)stream->port, msg); break;
		case STR_HTTP: state = statexftp((ftp_t    *)stream->port, msg); break;
		default:
			msg[0] = '\0';
			strunlock(stream);
			return 0;
		}
		if (state == 2 && (int)(tickget() - stream->tact) <= TINTACT) state = 3;
		strunlock(stream);
		return state;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x4, %edi
leaq 0x26c94(%rip), %rsi     # 0xc8be0
movb $0x0, %al
callq 0x95890
movq -0x10(%rbp), %rdi
callq 0x9ef00
movq -0x10(%rbp), %rax
cmpq $0x0, 0x58(%rax)
jne 0xa1f7f
movq -0x10(%rbp), %rdi
callq 0x9f2f0
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0xa20f6
movq -0x10(%rbp), %rax
movl (%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0xd, %eax
ja 0xa20ae
movq -0x28(%rbp), %rax
leaq 0x26ae7(%rip), %rcx     # 0xc8a88
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xa2100
movl %eax, -0x1c(%rbp)
jmp 0xa20c7
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xa2200
movl %eax, -0x1c(%rbp)
jmp 0xa20c7
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xa2540
movl %eax, -0x1c(%rbp)
jmp 0xa20c7
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xa26c0
movl %eax, -0x1c(%rbp)
jmp 0xa20c7
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xa26f0
movl %eax, -0x1c(%rbp)
jmp 0xa20c7
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xa2950
movl %eax, -0x1c(%rbp)
jmp 0xa20c7
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xa2c50
movl %eax, -0x1c(%rbp)
jmp 0xa20c7
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xa2d70
movl %eax, -0x1c(%rbp)
jmp 0xa20c7
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xa2ec0
movl %eax, -0x1c(%rbp)
jmp 0xa20c7
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xa2fe0
movl %eax, -0x1c(%rbp)
jmp 0xa20c7
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xa2fe0
movl %eax, -0x1c(%rbp)
jmp 0xa20c7
movq -0x18(%rbp), %rax
movb $0x0, (%rax)
movq -0x10(%rbp), %rdi
callq 0x9f2f0
movl $0x0, -0x4(%rbp)
jmp 0xa20f6
cmpl $0x2, -0x1c(%rbp)
jne 0xa20e7
callq 0x8f860
movq -0x10(%rbp), %rcx
subl 0x24(%rcx), %eax
cmpl $0xc8, %eax
jg 0xa20e7
movl $0x3, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
callq 0x9f2f0
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop