// File: /workspace/github_cpp_makefile_star2_O2/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 $0x6e8, %rsp            # imm = 0x6E8
movq %rcx, %r14
movl %edx, %r13d
movl %esi, %r12d
movq %rdi, %rbx
leaq 0x1cdf5(%rip), %rsi     # 0x6bdf8
xorl %r15d, %r15d
pushq $0x3
popq %rdi
movl %r12d, %edx
movl %r13d, %ecx
movq %r14, %r8
xorl %eax, %eax
callq 0x4acf2
movl %r12d, (%rbx)
movl %r13d, 0x4(%rbx)
leaq 0x60(%rbx), %rdi
movq %r14, %rsi
callq 0x85c0
xorpd %xmm0, %xmm0
movupd %xmm0, 0xc(%rbx)
callq 0x47c01
movl %eax, 0x20(%rbx)
movl %eax, 0x1c(%rbx)
andq $0x0, 0x28(%rbx)
movb $0x0, 0x460(%rbx)
andq $0x0, 0x58(%rbx)
decl %r12d
cmpl $0xf, %r12d
ja 0x4f436
leaq 0x460(%rbx), %rdx
leaq 0x1cb74(%rip), %rax     # 0x6bbe0
movslq (%rax,%r12,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq %rdx, -0x40(%rbp)
movl $0x2580, -0x50(%rbp)    # imm = 0x2580
andl $0x0, -0x44(%rbp)
movl $0x8, -0x4c(%rbp)
movl $0x1, -0x48(%rbp)
movb $0x4e, -0x29(%rbp)
xorpd %xmm0, %xmm0
movapd %xmm0, -0x70(%rbp)
movapd %xmm0, -0x80(%rbp)
movapd %xmm0, -0x90(%rbp)
movapd %xmm0, -0xa0(%rbp)
movupd %xmm0, -0xb4(%rbp)
movapd %xmm0, -0xc0(%rbp)
movapd %xmm0, -0xd0(%rbp)
movapd %xmm0, -0xe0(%rbp)
leaq 0x1cea8(%rip), %rsi     # 0x6bf83
pushq $0x3
popq %rdi
movq %r14, %rdx
movl %r13d, %ecx
xorl %eax, %eax
callq 0x4acf2
pushq $0x1
popq %rdi
pushq $0x10
popq %rsi
callq 0x8440
testq %rax, %rax
je 0x4f93e
movq %rax, %r15
pushq $0x3a
popq %rsi
movq %r14, %rdi
callq 0x8250
testq %rax, %rax
je 0x4f733
movq %rax, %r12
subq %r14, %r12
leaq -0x1e0(%rbp), %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rax, -0x38(%rbp)
callq 0x8360
movb $0x0, -0x1e0(%rbp,%r12)
leaq -0xa0(%rbp), %rax
movq %rax, (%rsp)
leaq 0x1ce53(%rip), %rsi     # 0x6bfa0
leaq -0x50(%rbp), %rdx
leaq -0x4c(%rbp), %rcx
leaq -0x29(%rbp), %r8
leaq -0x48(%rbp), %r9
movq -0x38(%rbp), %rdi
xorl %eax, %eax
callq 0x8600
jmp 0x4f742
leaq -0x700(%rbp), %r15
movl $0x1000, (%r15)         # imm = 0x1000
leaq 0x1d325(%rip), %rsi     # 0x6c4a7
pushq $0x3
popq %rdi
movq %rdx, %r13
movq %r14, %rdx
xorl %eax, %eax
callq 0x4acf2
movq %r13, %r12
movb $0x0, (%r13)
leaq 0x1cfca(%rip), %rsi     # 0x6c16b
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x8600
pushq $0x40
popq %rdi
callq 0x8830
testq %rax, %rax
je 0x4f93e
movq %rax, %r15
movq $0x1, (%rax)
andl $0x0, 0x8(%rax)
movl -0x700(%rbp), %r14d
movslq %r14d, %rdi
callq 0x8830
movq %rax, 0x38(%r15)
testq %rax, %rax
je 0x4f936
movl %r14d, 0xc(%r15)
movq %r15, %rdi
addq $0x10, %rdi
xorl %esi, %esi
callq 0x8910
movl -0x700(%rbp), %edx
leaq 0x1d2b4(%rip), %rsi     # 0x6c4bc
movq %r12, %rdi
xorl %eax, %eax
callq 0x8110
jmp 0x4f551
pushq $0x1
popq %rsi
movq %r14, %rdi
jmp 0x4f53c
movq %rdx, %r13
leaq -0x700(%rbp), %r15
movl $0x100, %edx            # imm = 0x100
movq %r15, %rdi
xorl %esi, %esi
callq 0x8390
leaq -0x1e0(%rbp), %r12
movl $0x100, %edx            # imm = 0x100
movq %r12, %rdi
xorl %esi, %esi
callq 0x8390
leaq 0x1d129(%rip), %rsi     # 0x6c381
pushq $0x3
popq %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x4acf2
andq $0x0, (%rsp)
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x4ede4
leaq 0x1cee4(%rip), %rsi     # 0x6c16b
leaq -0x2e0(%rbp), %rdx
movq %r15, %rdi
xorl %eax, %eax
callq 0x8600
testl %eax, %eax
jle 0x4f6cc
movl -0x2e0(%rbp), %esi
pushq $0x1
popq %rdi
leaq -0x1e0(%rbp), %rdx
movq %r13, %rcx
jmp 0x4f42c
movq %rdx, -0x40(%rbp)
andq $0x0, -0x700(%rbp)
andq $0x0, -0x1e0(%rbp)
andq $0x0, -0x2e0(%rbp)
movl $0x8, -0xa0(%rbp)
leaq 0x1cd15(%rip), %rsi     # 0x6bffa
xorl %r15d, %r15d
pushq $0x3
popq %rdi
movq %r14, %rdx
movl %r13d, %ecx
xorl %eax, %eax
callq 0x4acf2
testb $0x3, %r13b
je 0x4f551
leaq 0x1cd0c(%rip), %r15     # 0x6c015
movl $0x0, -0x38(%rbp)
movq %r14, %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x8170
testq %rax, %rax
je 0x4f579
movq %rax, %r12
addq $0x2, %r12
movzbl 0x2(%rax), %eax
cmpl $0x2b, %eax
je 0x4f38c
cmpl $0x50, %eax
je 0x4f353
cmpl $0x53, %eax
je 0x4f379
cmpl $0x78, %eax
je 0x4f366
cmpl $0x54, %eax
jne 0x4f313
pushq $0x1
popq %rax
movl %eax, -0x38(%rbp)
jmp 0x4f313
movq %r12, %rdi
leaq 0x1f982(%rip), %rsi     # 0x6ecdf
leaq -0xa0(%rbp), %rdx
jmp 0x4f39d
movq %r12, %rdi
leaq 0x1ccad(%rip), %rsi     # 0x6c01d
leaq -0x700(%rbp), %rdx
jmp 0x4f39d
movq %r12, %rdi
leaq 0x1cc9f(%rip), %rsi     # 0x6c022
leaq -0x2e0(%rbp), %rdx
jmp 0x4f39d
movq %r12, %rdi
leaq 0x1cc82(%rip), %rsi     # 0x6c018
leaq -0x1e0(%rbp), %rdx
xorl %eax, %eax
callq 0x8600
jmp 0x4f313
movq %r14, %rdi
xorl %esi, %esi
jmp 0x4f448
movq %rdx, %r12
leaq -0x700(%rbp), %r15
movl $0x100, %edx            # imm = 0x100
movq %r15, %rdi
xorl %esi, %esi
callq 0x8390
leaq 0x1cfae(%rip), %rsi     # 0x6c381
pushq $0x3
popq %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x4acf2
andq $0x0, (%rsp)
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x4ede4
leaq 0x1cd6a(%rip), %rsi     # 0x6c16b
leaq -0x1e0(%rbp), %rdx
movq %r15, %rdi
xorl %eax, %eax
callq 0x8600
testl %eax, %eax
jle 0x4f703
movl -0x1e0(%rbp), %esi
leaq 0x111be(%rip), %rdx     # 0x605e5
xorl %edi, %edi
movq %r12, %rcx
callq 0x53595
jmp 0x4f54e
andl $0x0, 0x8(%rbx)
pushq $0x1
popq %rax
jmp 0x4f567
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x4fb51
jmp 0x4f54e
movq %r14, %rdi
xorl %esi, %esi
jmp 0x4f549
movq %rdx, -0x40(%rbp)
leaq -0x1e0(%rbp), %rdi
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x8390
leaq -0x2e0(%rbp), %rdi
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x8390
pushq $0x1
popq %rdi
movl $0x610, %esi            # imm = 0x610
callq 0x8440
testq %rax, %rax
je 0x4f93e
movq %rax, %r15
leaq 0x8(%rax), %rcx
movq %rax, %r8
addq $0x108, %r8             # imm = 0x108
andq $0x0, (%rsp)
leaq -0x1e0(%rbp), %r12
leaq -0x2e0(%rbp), %r13
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
xorl %r9d, %r9d
callq 0x4ede4
leaq 0x1ce3c(%rip), %rsi     # 0x6c314
leaq -0x700(%rbp), %r14
movq %r14, %rdi
movq %r12, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x8110
movq %r14, %rdi
movq -0x40(%rbp), %rsi
callq 0x4fa46
movq %rax, 0x608(%r15)
testq %rax, %rax
jne 0x4f551
leaq 0x1ce16(%rip), %rsi     # 0x6c324
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x4acf2
jmp 0x4f936
movq %r14, %rdi
movq %rdx, %rsi
callq 0x4f946
jmp 0x4f54e
movq %r14, %rdi
movq %rdx, %rsi
callq 0x4fa46
jmp 0x4f54e
movq %r14, %rdi
xorl %esi, %esi
callq 0x4fd17
jmp 0x4f54e
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x4fecc
movq %rax, %r15
movq %r15, 0x58(%rbx)
xorl %eax, %eax
testq %r15, %r15
setne %al
leal -0x1(,%rax,2), %ecx
movl %ecx, 0x8(%rbx)
addq $0x6e8, %rsp            # imm = 0x6E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsd -0x1e0(%rbp), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jb 0x4f597
andq $0x0, -0x1e0(%rbp)
xorpd %xmm1, %xmm1
movsd %xmm1, -0x60(%rbp)
movsd -0x2e0(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jb 0x4f5b6
andq $0x0, -0x2e0(%rbp)
xorpd %xmm1, %xmm1
movsd %xmm1, -0x58(%rbp)
movl $0x8b0, %edi            # imm = 0x8B0
callq 0x8830
testq %rax, %rax
je 0x4f93e
movq %rax, %r15
leaq 0x20(%rax), %r12
xorpd %xmm0, %xmm0
movupd %xmm0, 0x10(%rax)
movupd %xmm0, (%rax)
movq %r12, %rdi
movq %r14, %rsi
callq 0x85c0
leaq 0x1ca21(%rip), %rsi     # 0x6c015
movq %r12, %rdi
callq 0x8170
testq %rax, %rax
movsd -0x60(%rbp), %xmm0
movsd -0x58(%rbp), %xmm1
je 0x4f61e
movb $0x0, (%rax)
movsd -0x1e0(%rbp), %xmm0
movsd -0x2e0(%rbp), %xmm1
movb $0x0, 0x420(%r15)
movl %r13d, 0x820(%r15)
movl -0x38(%rbp), %eax
movl %eax, 0x824(%r15)
andq $0x0, 0x828(%r15)
movl -0xa0(%rbp), %eax
movl %eax, 0x830(%r15)
xorps %xmm2, %xmm2
movups %xmm2, 0x838(%r15)
andl $0x0, 0x868(%r15)
movups %xmm2, 0x848(%r15)
movups %xmm2, 0x858(%r15)
movsd %xmm0, 0x870(%r15)
movsd -0x700(%rbp), %xmm0
movsd %xmm0, 0x878(%r15)
movsd %xmm1, 0x880(%r15)
movq %r15, %rdi
addq $0x888, %rdi            # imm = 0x888
xorl %esi, %esi
callq 0x8910
callq 0x47349
movq %rax, %rdi
callq 0x477da
movq %r15, %rdi
movq %rax, %rsi
movq -0x40(%rbp), %rdx
callq 0x52ebf
testl %eax, %eax
jne 0x4f551
jmp 0x4f936
leaq 0x1ca17(%rip), %rsi     # 0x6c0ea
xorl %r15d, %r15d
leaq -0x700(%rbp), %r14
movq %r13, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x8110
leaq 0x1cd96(%rip), %rsi     # 0x6c487
pushq $0x1
popq %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x4acf2
jmp 0x4f551
leaq 0x1c9e0(%rip), %rsi     # 0x6c0ea
xorl %r15d, %r15d
leaq -0x700(%rbp), %rdx
movq %r12, %rdi
xorl %eax, %eax
callq 0x8110
movl -0x1e0(%rbp), %edx
leaq 0x1cc6b(%rip), %rsi     # 0x6c396
pushq $0x1
popq %rdi
jmp 0x4f8f4
leaq -0x1e0(%rbp), %rdi
movq %r14, %rsi
callq 0x85c0
pushq $0x23
popq %rsi
movq %r14, %rdi
callq 0x8250
testq %rax, %rax
je 0x4f767
leaq 0x1c857(%rip), %rsi     # 0x6bfb0
leaq -0x44(%rbp), %rdx
movq %rax, %rdi
xorl %eax, %eax
callq 0x8600
leaq 0x1c5e2(%rip), %rax     # 0x6bd50
movl -0x50(%rbp), %edx
xorl %ecx, %ecx
pushq $0xb
popq %rsi
cmpq $0xb, %rcx
je 0x4f789
cmpl %edx, (%rax)
je 0x4f78f
incq %rcx
addq $0x4, %rax
jmp 0x4f776
movq %rsi, -0x38(%rbp)
jmp 0x4f793
movq %rcx, -0x38(%rbp)
movsbl -0x29(%rbp), %edi
callq 0x8be0
movb %al, -0x29(%rbp)
leaq 0x1c80e(%rip), %rsi     # 0x6bfb4
leaq -0x700(%rbp), %r14
leaq -0x1e0(%rbp), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0x8110
andl $0x3, %r13d
xorl %eax, %eax
cmpl $0x2, %r13d
sete %al
orl $0x900, %eax            # imm = 0x900
cmpl $0x3, %r13d
movl $0x902, %esi            # imm = 0x902
cmovnel %eax, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x8490
movl %eax, (%r15)
testl %eax, %eax
js 0x4f900
movl %eax, %r12d
leaq -0xe0(%rbp), %r14
movl %eax, %edi
movq %r14, %rsi
callq 0x86b0
andq $0x0, (%r14)
andl $0x0, 0xc(%r14)
andw $0x0, 0x16(%r14)
leaq 0x1c565(%rip), %rax     # 0x6bd80
movq -0x38(%rbp), %rcx
movl (%rax,%rcx,4), %r13d
movq %r14, %rdi
movl %r13d, %esi
callq 0x8680
movq %r14, %rdi
movl %r13d, %esi
callq 0x83c0
xorl %eax, %eax
cmpl $0x7, -0x4c(%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, -0x48(%rbp)
sete %dl
shll $0x6, %edx
orl %ecx, %edx
xorl %ecx, %ecx
cmpl $0x737472, -0xa0(%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 0x87d0
pushq $0x2
popq %rsi
movl %r12d, %edi
callq 0x8940
leaq -0x700(%rbp), %rsi
movq -0x40(%rbp), %rdi
callq 0x85c0
movl -0x44(%rbp), %edx
testl %edx, %edx
jle 0x4f8e7
leaq 0x123c5(%rip), %rsi     # 0x61c88
leaq -0x300(%rbp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x8110
leaq -0x2e0(%rbp), %rsi
movq %r14, %rdi
callq 0x4f946
movq %rax, 0x8(%r15)
leaq 0x1c6f8(%rip), %rsi     # 0x6bfe6
pushq $0x3
popq %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0x4acf2
jmp 0x4f551
callq 0x8060
movl (%rax), %ecx
leaq 0x1c6ae(%rip), %rsi     # 0x6bfbc
movq -0x40(%rbp), %r12
movq %r12, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x8110
leaq 0x1c6a9(%rip), %rsi     # 0x6bfcf
pushq $0x1
popq %rdi
movq %r12, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x4acf2
movq %r15, %rdi
callq 0x8780
xorl %r15d, %r15d
jmp 0x4f551