// File: /workspace/github_cpp_makefile_star2_O3/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, %r12
movl %edx, %r13d
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x1dfd2(%rip), %rsi     # 0x75db8
xorl %r15d, %r15d
movl $0x3, %edi
movl %r14d, %edx
movl %r13d, %ecx
movq %r12, %r8
xorl %eax, %eax
callq 0x5342c
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 0x4fece
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 0x583ac
leaq 0x460(%rbx), %r13
leaq 0x1dd4d(%rip), %rax     # 0x75ba0
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, -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 0x1e082(%rip), %rsi     # 0x75f43
movl $0x3, %edi
movq %r12, %rdx
movl -0x30(%rbp), %ecx
xorl %eax, %eax
callq 0x5342c
movl $0x1, %edi
movl $0x10, %esi
callq 0x8440
testq %rax, %rax
je 0x5877c
movq %rax, %r15
movq %r12, %rdi
movl $0x3a, %esi
callq 0x8250
testq %rax, %rax
je 0x58565
movq %rax, %r14
subq %r12, %r14
leaq -0x1e0(%rbp), %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rax, -0x48(%rbp)
callq 0x8350
movb $0x0, -0x1e0(%rbp,%r14)
leaq -0xa0(%rbp), %rax
movq %rax, (%rsp)
leaq 0x1e025(%rip), %rsi     # 0x75f60
leaq -0x40(%rbp), %rdx
leaq -0x3c(%rbp), %rcx
leaq -0x29(%rbp), %r8
leaq -0x38(%rbp), %r9
movq -0x48(%rbp), %rdi
xorl %eax, %eax
callq 0x8610
jmp 0x58574
leaq -0x700(%rbp), %r14
movl $0x1000, (%r14)         # imm = 0x1000
leaq 0x1e4f7(%rip), %rsi     # 0x76467
movl $0x3, %edi
movq %r12, %rdx
xorl %eax, %eax
callq 0x5342c
movb $0x0, (%r13)
leaq 0x1e1a0(%rip), %rsi     # 0x7612b
movq %r12, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x8610
movl $0x40, %edi
callq 0x8840
testq %rax, %rax
je 0x5877c
movq %rax, %r15
movq $0x1, (%rax)
movl $0x0, 0x8(%rax)
movl -0x700(%rbp), %r14d
movslq %r14d, %rdi
callq 0x8840
movq %rax, 0x38(%r15)
testq %rax, %rax
je 0x58774
movl %r14d, 0xc(%r15)
movq %r15, %rdi
addq $0x10, %rdi
xorl %esi, %esi
callq 0x8910
movl -0x700(%rbp), %edx
leaq 0x1e485(%rip), %rsi     # 0x7647c
movq %r13, %rdi
xorl %eax, %eax
callq 0x8120
jmp 0x584dc
movq %r12, %rdi
movl $0x1, %esi
jmp 0x584bf
leaq -0x700(%rbp), %r14
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
xorl %esi, %esi
callq 0x8390
leaq -0x1e0(%rbp), %r15
movl $0x100, %edx            # imm = 0x100
movq %r15, %rdi
xorl %esi, %esi
callq 0x8390
leaq 0x1e2fb(%rip), %rsi     # 0x76341
movl $0x3, %edi
movq %r12, %rdx
xorl %eax, %eax
callq 0x5342c
movq $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x57bb4
leaq 0x1e0b1(%rip), %rsi     # 0x7612b
leaq -0x2e0(%rbp), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0x8610
testl %eax, %eax
jle 0x58504
movl -0x2e0(%rbp), %esi
leaq -0x1e0(%rbp), %rdx
movl $0x1, %edi
jmp 0x5839f
movq %r13, -0x50(%rbp)
xorl %r14d, %r14d
movq %r14, -0x700(%rbp)
movq %r14, -0x1e0(%rbp)
movq %r14, -0x2e0(%rbp)
movl $0x8, -0xa0(%rbp)
leaq 0x1dee3(%rip), %rsi     # 0x75fba
movl $0x3, %edi
movq %r12, %rdx
movl -0x30(%rbp), %r13d
movl %r13d, %ecx
xorl %eax, %eax
callq 0x5342c
movl $0x0, %r15d
testb $0x3, %r13b
je 0x584dc
leaq 0x1ded1(%rip), %rsi     # 0x75fd5
movq %r12, %rdi
callq 0x8160
testq %rax, %rax
je 0x581cc
movq %rax, %r15
xorl %r14d, %r14d
movl %r14d, %r13d
movzbl 0x2(%r15), %eax
addq $0x2, %r15
cmpl $0x52, %eax
jle 0x58154
cmpl $0x53, %eax
je 0x58171
movl $0x1, %r14d
cmpl $0x54, %eax
je 0x5819f
cmpl $0x78, %eax
jne 0x5819c
movq %r15, %rdi
leaq 0x1de92(%rip), %rsi     # 0x75fdd
leaq -0x700(%rbp), %rdx
jmp 0x58195
cmpl $0x2b, %eax
je 0x58184
cmpl $0x50, %eax
jne 0x5819c
movq %r15, %rdi
leaq 0x20ba3(%rip), %rsi     # 0x78d0b
leaq -0xa0(%rbp), %rdx
jmp 0x58195
movq %r15, %rdi
leaq 0x1de67(%rip), %rsi     # 0x75fe2
leaq -0x2e0(%rbp), %rdx
jmp 0x58195
movq %r15, %rdi
leaq 0x1de4a(%rip), %rsi     # 0x75fd8
leaq -0x1e0(%rbp), %rdx
xorl %eax, %eax
callq 0x8610
movl %r13d, %r14d
movq %r15, %rdi
leaq 0x1de2c(%rip), %rsi     # 0x75fd5
callq 0x8160
movq %rax, %r15
testq %rax, %rax
jne 0x5811b
movsd -0x1e0(%rbp), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jb 0x581db
movq $0x0, -0x1e0(%rbp)
xorpd %xmm1, %xmm1
movsd %xmm1, -0x48(%rbp)
movsd -0x2e0(%rbp), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jb 0x58201
movq $0x0, -0x2e0(%rbp)
xorpd %xmm1, %xmm1
movsd %xmm1, -0x58(%rbp)
movl $0x8b0, %edi            # imm = 0x8B0
callq 0x8840
testq %rax, %rax
je 0x5877c
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 0x1dd96(%rip), %rsi     # 0x75fd5
movq %r13, %rdi
callq 0x8160
testq %rax, %rax
movsd -0x48(%rbp), %xmm0
movsd -0x58(%rbp), %xmm1
je 0x58269
movb $0x0, (%rax)
movsd -0x1e0(%rbp), %xmm0
movsd -0x2e0(%rbp), %xmm1
movb $0x0, 0x420(%r15)
movl -0x30(%rbp), %eax
movl %eax, 0x820(%r15)
movl %r14d, 0x824(%r15)
movq $0x0, 0x828(%r15)
movl -0xa0(%rbp), %eax
movl %eax, 0x830(%r15)
xorps %xmm2, %xmm2
movups %xmm2, 0x838(%r15)
movups %xmm2, 0x848(%r15)
movups %xmm2, 0x858(%r15)
movl $0x0, 0x868(%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 0x4f542
movq %rax, %rdi
callq 0x4fa70
movq %r15, %rdi
movq %rax, %rsi
movq -0x50(%rbp), %rdx
callq 0x5bf4e
testl %eax, %eax
jne 0x584dc
jmp 0x58774
movq %r12, %rdi
xorl %esi, %esi
jmp 0x583c5
leaq -0x700(%rbp), %r14
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
xorl %esi, %esi
callq 0x8390
leaq 0x1dffd(%rip), %rsi     # 0x76341
movl $0x3, %edi
movq %r12, %rdx
xorl %eax, %eax
callq 0x5342c
movq $0x0, (%rsp)
movq %r12, %rdi
xorl %esi, %esi
movq %r14, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x57bb4
leaq 0x1ddb4(%rip), %rsi     # 0x7612b
leaq -0x1e0(%rbp), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0x8610
testl %eax, %eax
jle 0x58533
movl -0x1e0(%rbp), %esi
leaq 0x12258(%rip), %rdx     # 0x6a5f5
xorl %edi, %edi
movq %r13, %rcx
callq 0x5c689
jmp 0x584d9
movl $0x0, 0x8(%rbx)
movl $0x1, %eax
jmp 0x584f2
movq %r12, %rdi
movl $0x1, %esi
movq %r13, %rdx
callq 0x589a3
jmp 0x584d9
movq %r12, %rdi
xorl %esi, %esi
jmp 0x584d1
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
movl $0x1, %edi
movl $0x610, %esi            # imm = 0x610
callq 0x8440
testq %rax, %rax
je 0x5877c
movq %rax, %r15
leaq 0x8(%rax), %rcx
movq %rax, %r8
addq $0x108, %r8             # imm = 0x108
movq $0x0, (%rsp)
leaq -0x1e0(%rbp), %r14
leaq -0x2e0(%rbp), %rdx
movq %r12, %rdi
movq %r14, %rsi
xorl %r9d, %r9d
callq 0x57bb4
leaq 0x1de7e(%rip), %rsi     # 0x762d4
leaq -0x700(%rbp), %r12
movq %r12, %rdi
movq %r14, %rdx
leaq -0x2e0(%rbp), %rcx
xorl %eax, %eax
callq 0x8120
movq %r12, %rdi
movq %r13, %rsi
callq 0x58890
movq %rax, 0x608(%r15)
testq %rax, %rax
jne 0x584dc
leaq 0x1de55(%rip), %rsi     # 0x762e4
movl $0x1, %edi
xorl %eax, %eax
callq 0x5342c
jmp 0x58774
movq %r12, %rdi
movq %r13, %rsi
callq 0x58784
jmp 0x584d9
movq %r12, %rdi
movq %r13, %rsi
callq 0x58890
jmp 0x584d9
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x58b7d
jmp 0x584d9
movq %r12, %rdi
movl $0x1, %esi
movq %r13, %rdx
callq 0x58d36
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
leaq 0x1db9f(%rip), %rsi     # 0x760aa
xorl %r15d, %r15d
movq %r13, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x8120
leaq 0x1df25(%rip), %rsi     # 0x76447
movl $0x1, %edi
movq %r14, %rdx
xorl %eax, %eax
callq 0x5342c
jmp 0x584dc
leaq 0x1db70(%rip), %rsi     # 0x760aa
xorl %r15d, %r15d
leaq -0x700(%rbp), %rdx
movq %r13, %rdi
xorl %eax, %eax
callq 0x8120
movl -0x1e0(%rbp), %edx
leaq 0x1ddfb(%rip), %rsi     # 0x76356
movl $0x1, %edi
jmp 0x5872d
leaq -0x1e0(%rbp), %rdi
movq %r12, %rsi
callq 0x85c0
movq %r12, %rdi
movl $0x23, %esi
callq 0x8250
testq %rax, %rax
je 0x5859b
leaq 0x1d9e3(%rip), %rsi     # 0x75f70
leaq -0x34(%rbp), %rdx
movq %rax, %rdi
xorl %eax, %eax
callq 0x8610
leaq 0x1d76e(%rip), %rax     # 0x75d10
movl -0x40(%rbp), %ecx
xorl %r14d, %r14d
cmpl %ecx, (%rax)
je 0x585bf
incq %r14
addq $0x4, %rax
cmpq $0xb, %r14
jne 0x585a8
movl $0xb, %r14d
movsbl -0x29(%rbp), %edi
callq 0x8be0
movb %al, -0x29(%rbp)
leaq 0x1d9a2(%rip), %rsi     # 0x75f74
leaq -0x700(%rbp), %r12
leaq -0x1e0(%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 0x58739
movl %eax, %r12d
leaq -0xe0(%rbp), %rsi
movl %eax, %edi
callq 0x86c0
leaq -0xe0(%rbp), %rdi
movq $0x0, (%rdi)
movl $0x0, 0xc(%rdi)
movw $0x0, 0x16(%rdi)
leaq 0x1d6f0(%rip), %rax     # 0x75d40
movq %r13, -0x50(%rbp)
movl (%rax,%r14,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, -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 0x87f0
movl %r12d, %edi
movl $0x2, %esi
callq 0x8940
leaq -0x700(%rbp), %rsi
movq -0x50(%rbp), %rdi
callq 0x85c0
movl -0x34(%rbp), %edx
testl %edx, %edx
jle 0x5871e
leaq 0x1358e(%rip), %rsi     # 0x6bc88
leaq -0x300(%rbp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x8120
leaq -0x2e0(%rbp), %rsi
movq %r14, %rdi
callq 0x58784
movq %rax, 0x8(%r15)
leaq 0x1d881(%rip), %rsi     # 0x75fa6
movl $0x3, %edi
movl %r12d, %edx
xorl %eax, %eax
callq 0x5342c
jmp 0x584dc
callq 0x8070
movl (%rax), %ecx
leaq 0x1d835(%rip), %rsi     # 0x75f7c
leaq -0x700(%rbp), %r14
movq %r13, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x8120
leaq 0x1d82d(%rip), %rsi     # 0x75f8f
movl $0x1, %edi
movq %r13, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x5342c
movq %r15, %rdi
callq 0x87a0
xorl %r15d, %r15d
jmp 0x584dc