// File: /workspace/github_cpp_makefile_star2_O1/DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::stropen(bamboo::stream_t*, int, int, char const*)
extern int stropen(stream_t *stream, int type, int mode, const char *path)
	{
		tracet(3, "stropen: type=%d mode=%d path=%s\n", type, mode, path);

		stream->type = type;
		stream->mode = mode;
		strcpy(stream->path, path);
		stream->inb = stream->inr = stream->outb = stream->outr = 0;
		stream->tick_i = stream->tick_o = tickget();
		stream->inbt = stream->outbt = 0;
		stream->msg[0] = '\0';
		stream->port = NULL;
		switch (type) {
		case STR_SERIAL: stream->port = openserial(path, mode, stream->msg); break;
		case STR_FILE: stream->port = openfile(path, mode, stream->msg); break;
		case STR_TCPSVR: stream->port = opentcpsvr(path, stream->msg); break;
		case STR_TCPCLI: stream->port = opentcpcli(path, stream->msg); break;
		case STR_NTRIPSVR: stream->port = openntrip(path, 0, stream->msg); break;
		case STR_NTRIPCLI: stream->port = openntrip(path, 1, stream->msg); break;
		case STR_NTRIPC_S: stream->port = openntripc(path, 0, stream->msg); break;
		case STR_NTRIPC_C: stream->port = openntripc(path, 1, stream->msg); break;
		case STR_UDPSVR: stream->port = openudpsvr(path, stream->msg); break;
		case STR_UDPCLI: stream->port = openudpcli(path, stream->msg); break;
		case STR_MEMBUF: stream->port = openmembuf(path, stream->msg); break;
		case STR_FTP: stream->port = openftp(path, 0, stream->msg); break;
		case STR_HTTP: stream->port = openftp(path, 1, stream->msg); break;
		case STR_VRSCONCLI: stream->port = openvrsconcli(path, stream->msg); break;
		case STR_VRSCONSVR: stream->port = openvrsconsvr(path, stream->msg); break;
		default: stream->state = 0; return 1;
		}
		stream->state = !stream->port ? -1 : 1;
		return stream->port != NULL;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x6d8, %rsp            # imm = 0x6D8
movq %rcx, %r12
movl %edx, %r13d
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x1d43e(%rip), %rsi     # 0x75e08
xorl %r15d, %r15d
movl $0x3, %edi
movl %r14d, %edx
movl %r13d, %ecx
movq %r12, %r8
xorl %eax, %eax
callq 0x53ec4
movl %r14d, (%rbx)
movl %r13d, -0x30(%rbp)
movl %r13d, 0x4(%rbx)
leaq 0x60(%rbx), %rdi
movq %r12, %rsi
callq 0x85c0
xorpd %xmm0, %xmm0
movupd %xmm0, 0xc(%rbx)
callq 0x5088f
movl %eax, 0x20(%rbx)
movl %eax, 0x1c(%rbx)
movq %r15, 0x28(%rbx)
movb $0x0, 0x460(%rbx)
movq %r15, 0x58(%rbx)
decl %r14d
cmpl $0xf, %r14d
ja 0x58f69
leaq 0x460(%rbx), %r13
leaq 0x1d1b9(%rip), %rax     # 0x75bf0
movslq (%rax,%r14,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movl $0x2580, -0x40(%rbp)    # imm = 0x2580
movl $0x8, -0x3c(%rbp)
movl $0x1, -0x38(%rbp)
movl $0x0, -0x34(%rbp)
movb $0x4e, -0x29(%rbp)
xorpd %xmm0, %xmm0
movapd %xmm0, -0x60(%rbp)
movapd %xmm0, -0x70(%rbp)
movapd %xmm0, -0x80(%rbp)
movapd %xmm0, -0x90(%rbp)
movupd %xmm0, -0xa4(%rbp)
movapd %xmm0, -0xb0(%rbp)
movapd %xmm0, -0xc0(%rbp)
movapd %xmm0, -0xd0(%rbp)
leaq 0x1d4f1(%rip), %rsi     # 0x75f93
movl $0x3, %edi
movq %r12, %rdx
movl -0x30(%rbp), %ecx
xorl %eax, %eax
callq 0x53ec4
movl $0x1, %edi
movl $0x10, %esi
callq 0x8440
testq %rax, %rax
je 0x59350
movq %rax, %r15
movq %r12, %rdi
movl $0x3a, %esi
callq 0x8250
testq %rax, %rax
je 0x59107
movq %rax, %r14
subq %r12, %r14
leaq -0x1d0(%rbp), %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rax, -0x50(%rbp)
callq 0x8350
movb $0x0, -0x1d0(%rbp,%r14)
leaq -0x90(%rbp), %rax
movq %rax, (%rsp)
leaq 0x1d494(%rip), %rsi     # 0x75fb0
leaq -0x40(%rbp), %rdx
leaq -0x3c(%rbp), %rcx
leaq -0x29(%rbp), %r8
leaq -0x38(%rbp), %r9
movq -0x50(%rbp), %rdi
xorl %eax, %eax
callq 0x8610
jmp 0x59116
leaq -0x6f0(%rbp), %r14
movl $0x1000, (%r14)         # imm = 0x1000
leaq 0x1d991(%rip), %rsi     # 0x764e2
movl $0x3, %edi
movq %r12, %rdx
xorl %eax, %eax
callq 0x53ec4
movb $0x0, (%r13)
leaq 0x1d63a(%rip), %rsi     # 0x761a6
movq %r12, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x8610
movl $0x40, %edi
callq 0x8850
testq %rax, %rax
je 0x59350
movq %rax, %r15
movq $0x1, (%rax)
movl $0x0, 0x8(%rax)
movl -0x6f0(%rbp), %r14d
movslq %r14d, %rdi
callq 0x8850
movq %rax, 0x38(%r15)
testq %rax, %rax
je 0x59348
movl %r14d, 0xc(%r15)
movq %r15, %rdi
addq $0x10, %rdi
xorl %esi, %esi
callq 0x8920
movl -0x6f0(%rbp), %edx
leaq 0x1d91f(%rip), %rsi     # 0x764f7
movq %r13, %rdi
xorl %eax, %eax
callq 0x8120
jmp 0x59353
movq %r12, %rdi
movl $0x1, %esi
jmp 0x59081
leaq -0x6f0(%rbp), %r14
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
xorl %esi, %esi
callq 0x8390
leaq -0x1d0(%rbp), %r15
movl $0x100, %edx            # imm = 0x100
movq %r15, %rdi
xorl %esi, %esi
callq 0x8390
leaq 0x1d795(%rip), %rsi     # 0x763bc
movl $0x3, %edi
movq %r12, %rdx
xorl %eax, %eax
callq 0x53ec4
movq $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x58798
leaq 0x1d54b(%rip), %rsi     # 0x761a6
leaq -0x2d0(%rbp), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0x8610
testl %eax, %eax
jle 0x590a3
movl -0x2d0(%rbp), %esi
leaq -0x1d0(%rbp), %rdx
movl $0x1, %edi
jmp 0x58f5c
movq %r13, -0x48(%rbp)
xorl %r14d, %r14d
movq %r14, -0x6f0(%rbp)
movq %r14, -0x1d0(%rbp)
movq %r14, -0x2d0(%rbp)
movl $0x8, -0x90(%rbp)
leaq 0x1d37d(%rip), %rsi     # 0x76035
movl $0x3, %edi
movq %r12, %rdx
movl -0x30(%rbp), %r13d
movl %r13d, %ecx
xorl %eax, %eax
callq 0x53ec4
movl $0x0, %r15d
testb $0x3, %r13b
je 0x59353
leaq 0x1d36b(%rip), %rsi     # 0x76050
movq %r12, %rdi
callq 0x8160
testq %rax, %rax
je 0x58d9b
movq %rax, %r15
xorl %r13d, %r13d
movzbl 0x2(%r15), %eax
addq $0x2, %r15
cmpl $0x52, %eax
jle 0x58d32
cmpl $0x53, %eax
je 0x58d4f
movl $0x1, %r14d
cmpl $0x54, %eax
je 0x58d7d
cmpl $0x78, %eax
jne 0x58d7a
movq %r15, %rdi
leaq 0x1d32f(%rip), %rsi     # 0x76058
leaq -0x6f0(%rbp), %rdx
jmp 0x58d73
cmpl $0x2b, %eax
je 0x58d62
cmpl $0x50, %eax
jne 0x58d7a
movq %r15, %rdi
leaq 0x1ffed(%rip), %rsi     # 0x78d33
leaq -0x90(%rbp), %rdx
jmp 0x58d73
movq %r15, %rdi
leaq 0x1d304(%rip), %rsi     # 0x7605d
leaq -0x2d0(%rbp), %rdx
jmp 0x58d73
movq %r15, %rdi
leaq 0x1d2e7(%rip), %rsi     # 0x76053
leaq -0x1d0(%rbp), %rdx
xorl %eax, %eax
callq 0x8610
movl %r13d, %r14d
movq %r15, %rdi
leaq 0x1d2c9(%rip), %rsi     # 0x76050
callq 0x8160
movq %rax, %r15
movl %r14d, %r13d
testq %rax, %rax
jne 0x58cfc
xorpd %xmm0, %xmm0
ucomisd -0x1d0(%rbp), %xmm0
jb 0x58db4
movq $0x0, -0x1d0(%rbp)
ucomisd -0x2d0(%rbp), %xmm0
jb 0x58dc9
movq $0x0, -0x2d0(%rbp)
movl $0x8b0, %edi            # imm = 0x8B0
callq 0x8850
testq %rax, %rax
je 0x59350
movq %rax, %r15
leaq 0x20(%rax), %r13
xorpd %xmm0, %xmm0
movupd %xmm0, 0x10(%rax)
movupd %xmm0, (%rax)
movq %r13, %rdi
movq %r12, %rsi
callq 0x85c0
leaq 0x1d24e(%rip), %rsi     # 0x76050
movq %r13, %rdi
callq 0x8160
testq %rax, %rax
je 0x58e12
movb $0x0, (%rax)
movb $0x0, 0x420(%r15)
movl -0x30(%rbp), %eax
movl %eax, 0x820(%r15)
movl %r14d, 0x824(%r15)
movq $0x0, 0x828(%r15)
movl -0x90(%rbp), %eax
movl %eax, 0x830(%r15)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x838(%r15)
movupd %xmm0, 0x848(%r15)
movupd %xmm0, 0x858(%r15)
movl $0x0, 0x868(%r15)
movsd -0x1d0(%rbp), %xmm0
movsd %xmm0, 0x870(%r15)
movsd -0x6f0(%rbp), %xmm0
movsd %xmm0, 0x878(%r15)
movsd -0x2d0(%rbp), %xmm0
movsd %xmm0, 0x880(%r15)
movq %r15, %rdi
addq $0x888, %rdi            # imm = 0x888
xorl %esi, %esi
callq 0x8920
callq 0x4febe
movq %rax, %rdi
callq 0x5040e
movq %r15, %rdi
movq %rax, %rsi
movq -0x48(%rbp), %rdx
callq 0x5ca8c
testl %eax, %eax
jne 0x59353
jmp 0x59348
movq %r12, %rdi
xorl %esi, %esi
jmp 0x58f82
leaq -0x6f0(%rbp), %r14
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
xorl %esi, %esi
callq 0x8390
leaq 0x1d4bb(%rip), %rsi     # 0x763bc
movl $0x3, %edi
movq %r12, %rdx
xorl %eax, %eax
callq 0x53ec4
movq $0x0, (%rsp)
movq %r12, %rdi
xorl %esi, %esi
movq %r14, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x58798
leaq 0x1d272(%rip), %rsi     # 0x761a6
leaq -0x1d0(%rbp), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0x8610
testl %eax, %eax
jle 0x590d5
movl -0x1d0(%rbp), %esi
leaq 0x1169b(%rip), %rdx     # 0x6a5f5
xorl %edi, %edi
movq %r13, %rcx
callq 0x5d1b9
jmp 0x5909b
movl $0x0, 0x8(%rbx)
movl $0x1, %eax
jmp 0x5936b
movq %r12, %rdi
movl $0x1, %esi
movq %r13, %rdx
callq 0x595b0
jmp 0x5909b
movq %r12, %rdi
xorl %esi, %esi
jmp 0x59093
leaq -0x1d0(%rbp), %rdi
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x8390
leaq -0x2d0(%rbp), %rdi
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x8390
movl $0x1, %edi
movl $0x610, %esi            # imm = 0x610
callq 0x8440
testq %rax, %rax
je 0x59350
movq %rax, %r15
xorl %eax, %eax
movq %rax, (%r15)
leaq 0x8(%r15), %rcx
movq %r15, %r8
addq $0x108, %r8             # imm = 0x108
movq %rax, (%rsp)
leaq -0x1d0(%rbp), %r14
leaq -0x2d0(%rbp), %rdx
movq %r12, %rdi
movq %r14, %rsi
xorl %r9d, %r9d
callq 0x58798
leaq 0x1d33b(%rip), %rsi     # 0x7634f
leaq -0x6f0(%rbp), %r12
movq %r12, %rdi
movq %r14, %rdx
leaq -0x2d0(%rbp), %rcx
xorl %eax, %eax
callq 0x8120
movq %r12, %rdi
movq %r13, %rsi
callq 0x59493
movq %rax, 0x608(%r15)
testq %rax, %rax
jne 0x59353
leaq 0x1d30e(%rip), %rsi     # 0x7635f
movl $0x1, %edi
xorl %eax, %eax
callq 0x53ec4
jmp 0x59348
movq %r12, %rdi
movq %r13, %rsi
callq 0x5937d
jmp 0x5909b
movq %r12, %rdi
movq %r13, %rsi
callq 0x59493
jmp 0x5909b
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x5978a
jmp 0x5909b
movq %r12, %rdi
movl $0x1, %esi
movq %r13, %rdx
callq 0x59943
movq %rax, %r15
jmp 0x59353
leaq 0x1d07b(%rip), %rsi     # 0x76125
xorl %r15d, %r15d
movq %r13, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x8120
leaq 0x1d401(%rip), %rsi     # 0x764c2
movl $0x1, %edi
movq %r14, %rdx
xorl %eax, %eax
callq 0x53ec4
jmp 0x59353
leaq 0x1d049(%rip), %rsi     # 0x76125
xorl %r15d, %r15d
leaq -0x6f0(%rbp), %rdx
movq %r13, %rdi
xorl %eax, %eax
callq 0x8120
movl -0x1d0(%rbp), %edx
leaq 0x1d2d4(%rip), %rsi     # 0x763d1
movl $0x1, %edi
jmp 0x59304
leaq -0x1d0(%rbp), %rdi
movq %r12, %rsi
callq 0x85c0
movq %r12, %rdi
movl $0x23, %esi
callq 0x8250
testq %rax, %rax
je 0x5913d
leaq 0x1ce91(%rip), %rsi     # 0x75fc0
leaq -0x34(%rbp), %rdx
movq %rax, %rdi
xorl %eax, %eax
callq 0x8610
leaq 0x1cc1c(%rip), %rax     # 0x75d60
movl -0x40(%rbp), %edx
xorl %r14d, %r14d
cmpl %edx, (%rax)
je 0x59161
incq %r14
addq $0x4, %rax
cmpq $0xb, %r14
jne 0x5914a
movl $0xb, %r14d
cmpl $0xc, %r14d
jb 0x5918f
leaq 0x1ce56(%rip), %rsi     # 0x75fc4
movq %r13, %rdi
xorl %eax, %eax
callq 0x8120
leaq 0x1ce58(%rip), %rsi     # 0x75fd7
movl $0x1, %edi
movq %r13, %rdx
movq %r12, %rcx
jmp 0x59341
movsbl -0x29(%rbp), %edi
callq 0x8bf0
movb %al, -0x29(%rbp)
leaq 0x1ce4d(%rip), %rsi     # 0x75fef
leaq -0x6f0(%rbp), %r12
leaq -0x1d0(%rbp), %rdx
movq %r12, %rdi
xorl %eax, %eax
callq 0x8120
movl -0x30(%rbp), %ecx
andl $0x3, %ecx
xorl %eax, %eax
cmpl $0x2, %ecx
sete %al
orl $0x900, %eax            # imm = 0x900
cmpl $0x3, %ecx
movl $0x902, %esi            # imm = 0x902
cmovnel %eax, %esi
movq %r12, %rdi
xorl %eax, %eax
callq 0x8490
movl %eax, (%r15)
testl %eax, %eax
js 0x5930d
movl %eax, %r12d
leaq -0xd0(%rbp), %rsi
movl %eax, %edi
callq 0x86d0
xorl %eax, %eax
leaq -0xd0(%rbp), %rdi
movq %rax, (%rdi)
movl $0x0, 0xc(%rdi)
movw $0x0, 0x16(%rdi)
movl %r14d, %eax
leaq 0x1cb6f(%rip), %rcx     # 0x75d90
movq %r13, -0x48(%rbp)
movl (%rcx,%rax,4), %r13d
movq %rdi, %r14
movl %r13d, %esi
callq 0x8690
movq %r14, %rdi
movl %r13d, %esi
callq 0x83c0
xorl %eax, %eax
cmpl $0x7, -0x3c(%rbp)
setne %al
shll $0x4, %eax
orl 0x8(%r14), %eax
movb -0x29(%rbp), %cl
xorl %edx, %edx
cmpb $0x45, %cl
sete %dl
shll $0x8, %edx
cmpb $0x4f, %cl
movl $0x300, %ecx            # imm = 0x300
cmovnel %edx, %ecx
xorl %edx, %edx
cmpl $0x2, -0x38(%rbp)
sete %dl
shll $0x6, %edx
orl %ecx, %edx
xorl %ecx, %ecx
cmpl $0x737472, -0x90(%rbp)  # imm = 0x737472
sete %cl
shll $0x1f, %ecx
orl %edx, %ecx
orl %eax, %ecx
orl $0x20, %ecx
movl %ecx, 0x8(%r14)
movl %r12d, %edi
xorl %esi, %esi
movq %r14, %rdx
callq 0x8800
movl %r12d, %edi
movl $0x2, %esi
callq 0x8950
leaq -0x6f0(%rbp), %rsi
movq -0x48(%rbp), %rdi
callq 0x85c0
xorl %eax, %eax
movq %rax, 0x8(%r15)
movl -0x34(%rbp), %edx
testl %edx, %edx
jle 0x592f5
leaq 0x129b7(%rip), %rsi     # 0x6bc88
leaq -0x2f0(%rbp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x8120
leaq -0x2d0(%rbp), %rsi
movq %r14, %rdi
callq 0x5937d
movq %rax, 0x8(%r15)
leaq 0x1cd25(%rip), %rsi     # 0x76021
movl $0x3, %edi
movl %r12d, %edx
xorl %eax, %eax
callq 0x53ec4
jmp 0x59353
callq 0x8070
movl (%rax), %ecx
leaq 0x1ccdc(%rip), %rsi     # 0x75ff7
leaq -0x6f0(%rbp), %r14
movq %r13, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x8120
leaq 0x1ccd4(%rip), %rsi     # 0x7600a
movl $0x1, %edi
movq %r13, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x53ec4
movq %r15, %rdi
callq 0x87b0
xorl %r15d, %r15d
movq %r15, 0x58(%rbx)
xorl %eax, %eax
cmpq $0x0, 0x58(%rbx)
setne %al
leal -0x1(,%rax,2), %ecx
movl %ecx, 0x8(%rbx)
addq $0x6d8, %rsp            # imm = 0x6D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq