LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtkcmn.cpp
// Function: bamboo::cmpeph(void const*, void const*)
static int cmpeph(const void *p1, const void *p2)
{
    eph_t *q1=(eph_t *)p1,*q2=(eph_t *)p2;
    return q1->ttr.time!=q2->ttr.time?(int)(q1->ttr.time-q2->ttr.time):
           (q1->toe.time!=q2->toe.time?(int)(q1->toe.time-q2->toe.time):
            q1->sat-q2->sat);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x40(%rdi), %rax
movq 0x40(%rsi), %rcx
cmpq %rcx, %rax
jne 0x4d30d
movq 0x20(%rdi), %rax
movq 0x20(%rsi), %rcx
cmpq %rcx, %rax
jne 0x4d30d
movl (%rdi), %eax
subl (%rsi), %eax
jmp 0x4d30f
subl %ecx, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtkcmn.cpp
// Function: bamboo::cmpgeph(void const*, void const*)
static int cmpgeph(const void *p1, const void *p2)
{
    geph_t *q1=(geph_t *)p1,*q2=(geph_t *)p2;
    return q1->tof.time!=q2->tof.time?(int)(q1->tof.time-q2->tof.time):
           (q1->toe.time!=q2->toe.time?(int)(q1->toe.time-q2->toe.time):
            q1->sat-q2->sat);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x28(%rdi), %rax
movq 0x28(%rsi), %rcx
cmpq %rcx, %rax
jne 0x4d335
movq 0x18(%rdi), %rax
movq 0x18(%rsi), %rcx
cmpq %rcx, %rax
jne 0x4d335
movl (%rdi), %eax
subl (%rsi), %eax
jmp 0x4d337
subl %ecx, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtkcmn.cpp
// Function: bamboo::cmpseph(void const*, void const*)
static int cmpseph(const void *p1, const void *p2)
{
    seph_t *q1=(seph_t *)p1,*q2=(seph_t *)p2;
    return q1->tof.time!=q2->tof.time?(int)(q1->tof.time-q2->tof.time):
           (q1->t0.time!=q2->t0.time?(int)(q1->t0.time-q2->t0.time):
            q1->sat-q2->sat);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x18(%rdi), %rax
movq 0x18(%rsi), %rcx
cmpq %rcx, %rax
jne 0x4d35d
movq 0x8(%rdi), %rax
movq 0x8(%rsi), %rcx
cmpq %rcx, %rax
jne 0x4d35d
movl (%rdi), %eax
subl (%rsi), %eax
jmp 0x4d35f
subl %ecx, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/skytraq.cpp
// Function: bamboo::input_stq(bamboo::raw_t*, unsigned char)
extern int input_stq(raw_t *raw, unsigned char data)
{
    trace(5,"input_stq: data=%02x\n",data);
    
    /* synchronize frame */
    if (raw->nbyte==0) {
        if (!sync_stq(raw->buff,data)) return 0;
        raw->nbyte=2;
        return 0;
    }
    raw->buff[raw->nbyte++]=data;
    
    if (raw->nbyte==4) {
        if ((raw->len=U2(raw->buff+2)+7)>MAXRAWLEN) {
            trace(2,"stq message length error: len=%d\n",raw->len);
            raw->nbyte=0;
            return -1;
        }
    }
    if (raw->nbyte<4||raw->nbyte<raw->len) return 0;
    raw->nbyte=0;
    
    /* decode skytraq raw message */
    return decode_stq(raw);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r15d
movq %rdi, %rbx
leaq 0x1e161(%rip), %rsi     # 0x6b5b0
xorl %r14d, %r14d
pushq $0x5
popq %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x455bc
movslq 0x81a74(%rbx), %rax
testq %rax, %rax
je 0x4d4c3
leal 0x1(%rax), %ecx
movl %ecx, 0x81a74(%rbx)
movb %r15b, 0x81a90(%rbx,%rax)
movl 0x81a74(%rbx), %eax
cmpl $0x4, %eax
jne 0x4d4ed
movzwl 0x81a92(%rbx), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
leal 0x7(%rcx), %edx
movl %edx, 0x81a78(%rbx)
cmpw $0xffa, %cx             # imm = 0xFFA
jb 0x4d4f5
leaq 0x1e11a(%rip), %rsi     # 0x6b5c6
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x455bc
andl $0x0, 0x81a74(%rbx)
pushq $-0x1
popq %r14
jmp 0x4d4fc
movb 0x81a91(%rbx), %al
movb %al, 0x81a90(%rbx)
movb %r15b, 0x81a91(%rbx)
xorb $-0x60, %al
xorb $-0x5f, %r15b
orb %al, %r15b
jne 0x4d4fc
movl $0x2, 0x81a74(%rbx)
jmp 0x4d4fc
jl 0x4d4f9
movl 0x81a78(%rbx), %edx
cmpl %edx, %eax
jge 0x4d50a
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
andl $0x0, 0x81a74(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4d520
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/skytraq.cpp
// Function: bamboo::input_stqf(bamboo::raw_t*, _IO_FILE*)
extern int input_stqf(raw_t *raw, FILE *fp)
{
    int i,data;
    
    trace(4,"input_stqf:\n");
    
    /* synchronize frame */
    if (raw->nbyte==0) {
        for (i=0;;i++) {
            if ((data=fgetc(fp))==EOF) return -2;
            if (sync_stq(raw->buff,(unsigned char)data)) break;
            if (i>=4096) return 0;
        }
    }
    if (fread(raw->buff+2,1,2,fp)<2) return -2;
    raw->nbyte=4;
    
    if ((raw->len=U2(raw->buff+2)+7)>MAXRAWLEN) {
        trace(2,"stq message length error: len=%d\n",raw->len);
        raw->nbyte=0;
        return -1;
    }
    if (fread(raw->buff+4,1,raw->len-4,fp)<(size_t)(raw->len-4)) return -2;
    raw->nbyte=0;
    
    /* decode skytraq raw message */
    return decode_stq(raw);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x1d11b(%rip), %rsi     # 0x6b5e8
pushq $0x4
popq %rdi
xorl %eax, %eax
callq 0x455bc
cmpl $0x0, 0x81a74(%rbx)
pushq $-0x2
popq %r14
je 0x4e54b
leaq 0x81a92(%rbx), %rdi
pushq $0x1
popq %rsi
pushq $0x2
popq %rdx
movq %r15, %rcx
callq 0x8920
cmpq $0x2, %rax
jb 0x4e5ac
movl $0x4, 0x81a74(%rbx)
movzwl 0x81a92(%rbx), %eax
rolw $0x8, %ax
movzwl %ax, %edx
leal 0x7(%rdx), %eax
movl %eax, 0x81a78(%rbx)
cmpw $0xffa, %dx             # imm = 0xFFA
jb 0x4e587
leaq 0x1d094(%rip), %rsi     # 0x6b5c6
pushq $0x2
popq %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x455bc
andl $0x0, 0x81a74(%rbx)
pushq $-0x1
popq %r14
jmp 0x4e5ac
movl $0x1001, %r12d          # imm = 0x1001
movq %r15, %rdi
callq 0x89b0
cmpl $-0x1, %eax
je 0x4e5ac
movb 0x81a91(%rbx), %cl
movb %cl, 0x81a90(%rbx)
movb %al, 0x81a91(%rbx)
xorb $-0x60, %cl
xorb $-0x5f, %al
orb %cl, %al
je 0x4e4e4
decl %r12d
jne 0x4e551
xorl %r14d, %r14d
jmp 0x4e5ac
leaq 0x81a94(%rbx), %rdi
addl $0x3, %edx
pushq $0x1
popq %rsi
movq %r15, %rcx
callq 0x8920
movslq 0x81a78(%rbx), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
jae 0x4e5b8
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
andl $0x0, 0x81a74(%rbx)
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4d520
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/skytraq.cpp
// Function: bamboo::checksum(unsigned char*, int)
static unsigned char checksum(unsigned char *buff, int len)
{
    unsigned char cs=0;
    int i;
    
    for (i=4;i<len-3;i++) {
        cs^=buff[i];
    }
    return cs;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
addl $-0x3, %esi
movslq %esi, %rcx
movabsq $0x4, %rdx
xorl %eax, %eax
cmpq %rcx, %rdx
jge 0x4e948
xorb (%rdi,%rdx), %al
incq %rdx
jmp 0x4e93b
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/skytraq.cpp
// Function: bamboo::adj_utcweek(bamboo::gtime_t, double*)
static void adj_utcweek(gtime_t time, double *utc)
{
    int week;
    
    if (utc[3]>=256.0) return;
    time2gpst(time,&week);
    utc[3]+=week/256*256;
    if      (utc[3]<week-128) utc[3]+=256.0;
    else if (utc[3]>week+128) utc[3]-=256.0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movsd 0x18(%rsi), %xmm1
ucomisd 0x16e99(%rip), %xmm1    # 0x65c10
jae 0x4eddb
movq %rsi, %rbx
leaq -0x14(%rbp), %r14
movq %r14, %rsi
callq 0x470f1
movl (%r14), %ecx
movl $0x100, %esi            # imm = 0x100
movl %ecx, %eax
cltd
idivl %esi
shll $0x8, %eax
cvtsi2sd %eax, %xmm0
addsd 0x18(%rbx), %xmm0
movsd %xmm0, 0x18(%rbx)
leal -0x80(%rcx), %eax
cvtsi2sd %eax, %xmm1
ucomisd %xmm0, %xmm1
jbe 0x4edbd
movsd 0x16e55(%rip), %xmm1    # 0x65c10
jmp 0x4edd2
subl $-0x80, %ecx
cvtsi2sd %ecx, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x4eddb
movsd 0x1c796(%rip), %xmm1    # 0x6b568
addsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::decodetcppath(char const*, char*, char*, char*, char*, char*, char*)
void decodetcppath(const char *path, char *addr, char *port, char *user,
		char *passwd, char *mntpnt, char *str)
	{
		char buff[MAXSTRPATH], *p, *q;

		tracet(4, "decodetcpepath: path=%s\n", path);

		if (port) *port = '\0';
		if (user) *user = '\0';
		if (passwd) *passwd = '\0';
		if (mntpnt) *mntpnt = '\0';
		if (str) *str = '\0';

		strcpy(buff, path);

		if (!(p = strrchr(buff, '@'))) p = buff;

		if ((p = strchr(p, '/'))) {
			if ((q = strchr(p + 1, ':'))) {
				*q = '\0'; if (str) strcpy(str, q + 1);
			}
			*p = '\0'; if (mntpnt) strcpy(mntpnt, p + 1);
		}
		if ((p = strrchr(buff, '@'))) {
			*p++ = '\0';
			if ((q = strchr(buff, ':'))) {
				*q = '\0'; if (passwd) strcpy(passwd, q + 1);
			}
			if (user) strcpy(user, buff);
		}
		else p = buff;

		if ((q = strchr(p, ':'))) {
			*q = '\0'; if (port) strcpy(port, q + 1);
		}
		if (addr) strcpy(addr, p);
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
movq %r9, %rbx
movq %r8, %r13
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, -0x40(%rbp)
movq %rdi, %r14
leaq 0x1cfb6(%rip), %rsi     # 0x6bdc8
pushq $0x4
popq %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x4acf2
testq %r12, %r12
je 0x4ee29
movb $0x0, (%r12)
testq %r15, %r15
je 0x4ee32
movb $0x0, (%r15)
testq %r13, %r13
je 0x4ee3c
movb $0x0, (%r13)
movq 0x10(%rbp), %rax
testq %rbx, %rbx
je 0x4ee48
movb $0x0, (%rbx)
movq %r13, -0x30(%rbp)
movq %r12, -0x38(%rbp)
testq %rax, %rax
je 0x4ee58
movb $0x0, (%rax)
leaq -0x440(%rbp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x85c0
pushq $0x40
popq %rsi
movq %r13, %rdi
callq 0x8690
testq %rax, %rax
cmoveq %r13, %rax
pushq $0x2f
popq %rsi
movq %rax, %rdi
callq 0x8250
testq %rax, %rax
je 0x4eed0
movq %rax, %r14
movq %rax, %r12
incq %r12
pushq $0x3a
popq %rsi
movq %r12, %rdi
callq 0x8250
testq %rax, %rax
movq 0x10(%rbp), %rdi
je 0x4eebc
movb $0x0, (%rax)
testq %rdi, %rdi
je 0x4eebc
incq %rax
movq %rax, %rsi
callq 0x85c0
movb $0x0, (%r14)
testq %rbx, %rbx
je 0x4eed0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x85c0
pushq $0x40
popq %rsi
movq %r13, %rdi
callq 0x8690
testq %rax, %rax
movq -0x38(%rbp), %r14
je 0x4ef2f
movq %rax, %rbx
movb $0x0, (%rax)
leaq -0x440(%rbp), %rdi
pushq $0x3a
popq %rsi
callq 0x8250
testq %rax, %rax
movq -0x30(%rbp), %rdi
je 0x4ef15
movb $0x0, (%rax)
testq %rdi, %rdi
je 0x4ef15
incq %rax
movq %rax, %rsi
callq 0x85c0
incq %rbx
testq %r15, %r15
je 0x4ef2c
leaq -0x440(%rbp), %rsi
movq %r15, %rdi
callq 0x85c0
movq %rbx, %r13
pushq $0x3a
popq %rsi
movq %r13, %rdi
callq 0x8250
testq %rax, %rax
je 0x4ef55
movb $0x0, (%rax)
testq %r14, %r14
je 0x4ef55
incq %rax
movq %r14, %rdi
movq %rax, %rsi
callq 0x85c0
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x4ef66
movq %r13, %rsi
callq 0x85c0
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::strinit(bamboo::stream_t*)
extern void strinit(stream_t *stream)
	{
		tracet(3, "strinit:\n");

		stream->type = 0;
		stream->mode = 0;
		stream->state = 0;
		stream->inb = stream->inr = stream->outb = stream->outr = 0;
		stream->tick_i = stream->tick_o = stream->tact = stream->inbt = stream->outbt = 0;
		initlock(&stream->lock);
		stream->port = NULL;
		stream->path[0] = '\0';
		stream->msg[0] = '\0';
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x1ce4d(%rip), %rsi     # 0x6bdee
xorl %r14d, %r14d
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x4acf2
leaq 0x30(%rbx), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
xorl %esi, %esi
callq 0x8910
andq $0x0, 0x58(%rbx)
movb %r14b, 0x60(%rbx)
movb %r14b, 0x460(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::opentcpsvr(char const*, char*)
static tcpsvr_t *opentcpsvr(const char *path, char *msg)
	{
		tcpsvr_t *tcpsvr, tcpsvr0 = { {0} };
		char port[256] = "";

		tracet(3, "opentcpsvr: path=%s\n", path);

		if (!(tcpsvr = (tcpsvr_t *)malloc(sizeof(tcpsvr_t)))) return NULL;
		*tcpsvr = tcpsvr0;
		decodetcppath(path, tcpsvr->svr.saddr, port, NULL, NULL, NULL, NULL);
		if (sscanf(port, "%d", &tcpsvr->svr.port) < 1) {
			sprintf(msg, "port error: %s", port);
			tracet(1, "opentcpsvr: port error port=%s\n", port);
			free(tcpsvr);
			return NULL;
		}
		if (!gentcp(&tcpsvr->svr, 0, msg)) {
			free(tcpsvr);
			return NULL;
		}
		tcpsvr->svr.tcon = 0;
		return tcpsvr;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x110, %rsp            # imm = 0x110
movq %rsi, %r14
movq %rdi, %r15
leaq -0x120(%rbp), %rdi
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x8390
leaq 0x1c75d(%rip), %rsi     # 0x6c0d5
pushq $0x3
popq %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x4acf2
pushq $0x1
popq %rdi
movl $0x12928, %esi          # imm = 0x12928
callq 0x8440
testq %rax, %rax
je 0x4fa31
movq %rax, %rbx
leaq 0x4(%rax), %rsi
andq $0x0, (%rsp)
leaq -0x120(%rbp), %r12
movq %r15, %rdi
movq %r12, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x4ede4
movq %rbx, %rdx
addq $0x104, %rdx            # imm = 0x104
leaq 0x1c799(%rip), %rsi     # 0x6c16b
movq %r12, %rdi
xorl %eax, %eax
callq 0x8600
testl %eax, %eax
jle 0x4f9fa
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x53202
testl %eax, %eax
je 0x4fa29
andl $0x0, 0x11c(%rbx)
jmp 0x4fa33
leaq 0x1c6e9(%rip), %rsi     # 0x6c0ea
leaq -0x120(%rbp), %r15
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x8110
leaq 0x1c6dd(%rip), %rsi     # 0x6c0f9
pushq $0x1
popq %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x4acf2
movq %rbx, %rdi
callq 0x8780
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x110, %rsp            # imm = 0x110
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::opentcpcli(char const*, char*)
static tcpcli_t *opentcpcli(const char *path, char *msg)
	{
		tcpcli_t *tcpcli, tcpcli0 = { {0} };
		char port[256] = "";

		tracet(3, "opentcpcli: path=%s\n", path);

		if (!(tcpcli = (tcpcli_t *)malloc(sizeof(tcpcli_t)))) return NULL;
		*tcpcli = tcpcli0;
		decodetcppath(path, tcpcli->svr.saddr, port, NULL, NULL, NULL, NULL);
		if (sscanf(port, "%d", &tcpcli->svr.port) < 1) {
			sprintf(msg, "port error: %s", port);
			tracet(1, "opentcp: port error port=%s\n", port);
			free(tcpcli);
			return NULL;
		}
		tcpcli->svr.tcon = 0;
		tcpcli->toinact = toinact;
		tcpcli->tirecon = ticonnect;
		return tcpcli;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x110, %rsp            # imm = 0x110
movq %rsi, %rbx
movq %rdi, %r15
leaq -0x120(%rbp), %rdi
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x8390
leaq 0x1c84e(%rip), %rsi     # 0x6c2c6
pushq $0x3
popq %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x4acf2
pushq $0x1
popq %rdi
movl $0x130, %esi            # imm = 0x130
callq 0x8440
testq %rax, %rax
je 0x4fb3b
movq %rax, %r14
leaq 0x4(%rax), %rsi
andq $0x0, (%rsp)
leaq -0x120(%rbp), %r12
movq %r15, %rdi
movq %r12, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x4ede4
movq %r14, %rdx
addq $0x104, %rdx            # imm = 0x104
leaq 0x1c699(%rip), %rsi     # 0x6c16b
movq %r12, %rdi
xorl %eax, %eax
callq 0x8600
testl %eax, %eax
jle 0x4fb04
andl $0x0, 0x11c(%r14)
movl 0x383be(%rip), %eax     # 0x87eac
movl %eax, 0x128(%r14)
movl 0x383b5(%rip), %eax     # 0x87eb0
movl %eax, 0x12c(%r14)
jmp 0x4fb3e
leaq 0x1c5df(%rip), %rsi     # 0x6c0ea
leaq -0x120(%rbp), %r15
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x8110
leaq 0x1c7b5(%rip), %rsi     # 0x6c2db
pushq $0x1
popq %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x4acf2
movq %r14, %rdi
callq 0x8780
xorl %r14d, %r14d
movq %r14, %rax
addq $0x110, %rsp            # imm = 0x110
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::openftp(char const*, int, char*)
static ftp_t *openftp(const char *path, int type, char *msg)
	{
		ftp_t *ftp;

		tracet(3, "openftp: path=%s type=%d\n", path, type);

		msg[0] = '\0';

		if (!(ftp = (ftp_t *)malloc(sizeof(ftp_t)))) return NULL;

		ftp->state = 0;
		ftp->proto = type;
		ftp->error = 0;
		ftp->thread = 0;
		ftp->local[0] = '\0';

		/* decode ftp path */
		decodeftppath(path, ftp->addr, ftp->file, ftp->user, ftp->passwd, ftp->topts);

		/* set first download time */
		ftp->tnext = timeadd(timeget(), 10.0);

		return ftp;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rdx, %rbx
movl %esi, %r14d
movq %rdi, %r12
leaq 0x1c5de(%rip), %rsi     # 0x6c4ce
pushq $0x3
popq %rdi
movq %r12, %rdx
movl %r14d, %ecx
xorl %eax, %eax
callq 0x4acf2
movb $0x0, (%rbx)
movl $0xe38, %edi            # imm = 0xE38
callq 0x8830
movq %rax, %rbx
testq %rax, %rax
je 0x50087
andl $0x0, (%rbx)
movl %r14d, 0x4(%rbx)
andl $0x0, 0x8(%rbx)
andq $0x0, 0xe30(%rbx)
xorl %r14d, %r14d
movb %r14b, 0xa0c(%rbx)
leaq 0x40c(%rbx), %r15
leaq 0x1c5a4(%rip), %rsi     # 0x6c4e8
pushq $0x4
popq %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x4acf2
movb %r14b, 0x80c(%rbx)
movb %r14b, 0x90c(%rbx)
movsd 0x1be49(%rip), %xmm0    # 0x6bdb0
movups %xmm0, 0xe0c(%rbx)
leaq -0x430(%rbp), %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x85c0
pushq $0x2f
popq %rsi
movq %r14, %rdi
callq 0x8250
testq %rax, %rax
je 0x4ffed
movq %rax, %r12
leaq 0x1(%rax), %r13
leaq 0x1c077(%rip), %rsi     # 0x6c015
movq %r13, %rdi
callq 0x8170
testq %rax, %rax
je 0x4ffdf
leaq 0xe0c(%rbx), %rdx
leaq 0xe10(%rbx), %rcx
leaq 0xe14(%rbx), %r8
leaq 0xe18(%rbx), %r9
movb $0x0, (%rax)
addq $0x2, %rax
leaq 0x1c52a(%rip), %rsi     # 0x6c4ff
movq %rax, %rdi
xorl %eax, %eax
callq 0x8600
movq %r15, %rdi
movq %r13, %rsi
callq 0x85c0
movq %r12, %r15
leaq 0xc(%rbx), %r12
movb $0x0, (%r15)
pushq $0x40
popq %rsi
movq %r14, %rdi
callq 0x8690
testq %rax, %rax
je 0x50058
movq %rax, %r15
leaq 0x80c(%rbx), %r14
movb $0x0, (%rax)
leaq -0x430(%rbp), %rdi
pushq $0x3a
popq %rsi
callq 0x8250
movq %rax, %r13
testq %rax, %rax
je 0x5003e
movq %rbx, %rdi
addq $0x90c, %rdi            # imm = 0x90C
movq %r13, %rsi
incq %rsi
callq 0x85c0
incq %r15
movb $0x0, (%r13)
leaq -0x430(%rbp), %rsi
movq %r14, %rdi
callq 0x85c0
movq %r15, %r14
movq %r12, %rdi
movq %r14, %rsi
callq 0x85c0
callq 0x47349
movsd 0x10a48(%rip), %xmm1    # 0x60ab8
movq %rax, %rdi
callq 0x472ee
movq %rax, 0xe20(%rbx)
movsd %xmm0, 0xe28(%rbx)
movq %rbx, %rax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::closetcpsvr(bamboo::tcpsvr_tag*)
static void closetcpsvr(tcpsvr_t *tcpsvr)
	{
		int i;

		tracet(3, "closetcpsvr:\n");

		for (i = 0; i < MAXCLI; i++) {
			if (tcpsvr->cli[i].state) closesocket(tcpsvr->cli[i].sock);
		}
		closesocket(tcpsvr->svr.sock);
		free(tcpsvr);
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x1c2aa(%rip), %rsi     # 0x6c549
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x4acf2
movl $0x240, %r14d           # imm = 0x240
cmpq $0x12a40, %r14          # imm = 0x12A40
je 0x502d5
cmpl $0x0, -0x118(%rbx,%r14)
je 0x502cc
movl (%rbx,%r14), %edi
callq 0x8c70
addq $0x128, %r14            # imm = 0x128
jmp 0x502af
movl 0x118(%rbx), %edi
callq 0x8c70
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x8780
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::closentripc(bamboo::ntripc_t*)
static void closentripc(ntripc_t *ntripc)
	{
		tracet(3, "closentripc: state=%d\n", ntripc->state);

		closetcpsvr(ntripc->tcp);
		free(ntripc->srctbl);
		free(ntripc);
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rdi), %edx
leaq 0x1c216(%rip), %rsi     # 0x6c583
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x4acf2
movq 0x338(%rbx), %rdi
callq 0x5028e
movq 0x308(%rbx), %rdi
callq 0x8780
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x8780
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::strsync(bamboo::stream_t*, bamboo::stream_t*)
extern void strsync(stream_t *stream1, stream_t *stream2)
	{
		file_t *file1, *file2;
		if (stream1->type != STR_FILE || stream2->type != STR_FILE) return;
		file1 = (file_t*)stream1->port;
		file2 = (file_t*)stream2->port;
		if (file1&&file2) syncfile(file1, file2);
	}

// Assembly:
cmpl $0x2, (%rdi)
jne 0x5043f
cmpl $0x2, (%rsi)
jne 0x5043f
movq 0x58(%rdi), %rcx
movq 0x58(%rsi), %rax
testq %rcx, %rcx
setne %dl
testq %rax, %rax
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x5043f
pushq %rbp
movq %rsp, %rbp
cmpq $0x0, 0x8(%rcx)
je 0x5043e
cmpq $0x0, 0x8(%rax)
je 0x5043e
andl $0x0, 0x828(%rcx)
movl $0x1, 0x828(%rax)
movl 0x85c(%rcx), %ecx
subl 0x85c(%rax), %ecx
movl %ecx, 0x82c(%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::readtcpcli(bamboo::tcpcli_t*, unsigned char*, int, char*)
static int readtcpcli(tcpcli_t *tcpcli, unsigned char *buff, int n, char *msg)
	{
		int nr, err;

		tracet(4, "readtcpcli: sock=%d\n", tcpcli->svr.sock);

		if (!waittcpcli(tcpcli, msg)) return 0;

		if ((nr = recv_nb(tcpcli->svr.sock, buff, n)) == -1) {
			if ((err = errsock())) {
				tracet(1, "readtcpcli: recv error sock=%d err=%d\n", tcpcli->svr.sock, err);
				sprintf(msg, "recv error (%d)", err);
			}
			else {
				sprintf(msg, "disconnected");
			}
			discontcp(&tcpcli->svr, tcpcli->tirecon);
			return 0;
		}
		if (nr > 0) tcpcli->svr.tact = tickget();
		tracet(5, "readtcpcli: exit sock=%d nr=%d\n", tcpcli->svr.sock, nr);
		return nr;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movl %edx, %r12d
movq %rsi, %r13
movq %rdi, %rbx
movl 0x118(%rdi), %edx
leaq 0x1b9ba(%rip), %rsi     # 0x6c770
xorl %r14d, %r14d
pushq $0x4
popq %rdi
xorl %eax, %eax
callq 0x4acf2
movq %rbx, %rdi
movq %r15, %rsi
callq 0x53c06
testl %eax, %eax
je 0x50e81
movl 0x118(%rbx), %edi
movq %r13, %rsi
movl %r12d, %edx
callq 0x53a26
cmpl $-0x1, %eax
je 0x50e1d
movl %eax, %r12d
testl %eax, %eax
jle 0x50dfe
callq 0x47c01
movl %eax, 0x120(%rbx)
movl 0x118(%rbx), %edx
leaq 0x1b9be(%rip), %rsi     # 0x6c7c9
pushq $0x5
popq %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x4acf2
movl %r12d, %r14d
jmp 0x50e81
callq 0x533ff
testl %eax, %eax
je 0x50e58
movl %eax, %r12d
movl 0x118(%rbx), %edx
leaq 0x1b94f(%rip), %rsi     # 0x6c785
pushq $0x1
popq %rdi
movl %eax, %ecx
xorl %eax, %eax
callq 0x4acf2
leaq 0x1b963(%rip), %rsi     # 0x6c7ac
movq %r15, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0x8110
jmp 0x50e73
movabsq $0x64657463656e6e, %rax # imm = 0x64657463656E6E
movq %rax, 0x5(%r15)
movabsq $0x656e6e6f63736964, %rax # imm = 0x656E6E6F63736964
movq %rax, (%r15)
movl 0x12c(%rbx), %esi
movq %rbx, %rdi
callq 0x53ac3
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::writetcpsvr(bamboo::tcpsvr_tag*, unsigned char*, int, char*)
static int writetcpsvr(tcpsvr_t *tcpsvr, unsigned char *buff, int n, char *msg)
	{
		int i, ns = 0, err;

		tracet(4, "writetcpsvr: state=%d n=%d\n", tcpsvr->svr.state, n);

		if (!waittcpsvr(tcpsvr, msg)) return 0;

		for (i = 0; i < MAXCLI; i++) {
			if (tcpsvr->cli[i].state != 2) continue;

			if ((ns = send_nb(tcpsvr->cli[i].sock, buff, n)) == -1) {
				if ((err = errsock())) {
					tracet(1, "writetcpsvr: send error i=%d sock=%d err=%d\n", i,
						tcpsvr->cli[i].sock, err);
				}
				discontcp(&tcpsvr->cli[i], ticonnect);
				updatetcpsvr(tcpsvr, msg);
				return 0;
			}
			if (ns > 0) tcpsvr->cli[i].tact = tickget();
		}
		return ns;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movl %edx, %r12d
movq %rsi, %r13
movq %rdi, %r15
movl (%rdi), %edx
leaq 0x1b89f(%rip), %rsi     # 0x6d250
xorl %r14d, %r14d
pushq $0x4
popq %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x4acf2
movq %r15, %rdi
movq %rbx, %rsi
callq 0x53819
testl %eax, %eax
je 0x51a75
movq %rbx, -0x38(%rbp)
movq %r15, -0x30(%rbp)
addq $0x128, %r15            # imm = 0x128
xorl %ebx, %ebx
xorl %r14d, %r14d
cmpq $0x100, %rbx            # imm = 0x100
je 0x51a75
cmpl $0x2, (%r15)
jne 0x51a25
movl 0x118(%r15), %edi
movq %r13, %rsi
movl %r12d, %edx
callq 0x55008
cmpl $-0x1, %eax
je 0x51a31
movl %eax, %r14d
testl %eax, %eax
jle 0x51a25
callq 0x47c01
movl %eax, 0x120(%r15)
incq %rbx
addq $0x128, %r15            # imm = 0x128
jmp 0x519e8
callq 0x533ff
testl %eax, %eax
je 0x51a57
movl 0x118(%r15), %ecx
leaq 0x1b824(%rip), %rsi     # 0x6d26c
pushq $0x1
popq %rdi
movl %ebx, %edx
movl %eax, %r8d
xorl %eax, %eax
callq 0x4acf2
movl 0x36453(%rip), %esi     # 0x87eb0
movq %r15, %rdi
callq 0x53ac3
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x53b10
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::writetcpcli(bamboo::tcpcli_t*, unsigned char*, int, char*)
static int writetcpcli(tcpcli_t *tcpcli, unsigned char *buff, int n, char *msg)
	{
		int ns, err;

		tracet(3, "writetcpcli: sock=%d state=%d n=%d\n", tcpcli->svr.sock, tcpcli->svr.state, n);

		if (!waittcpcli(tcpcli, msg)) return 0;

		if ((ns = send_nb(tcpcli->svr.sock, buff, n)) == -1) {
			if ((err = errsock())) {
				tracet(1, "writetcp: send error sock=%d err=%d\n", tcpcli->svr.sock, err);
				sprintf(msg, "send error (%d)", err);
			}
			else {
				sprintf(msg, "disconnected");
			}
			discontcp(&tcpcli->svr, tcpcli->tirecon);
			return 0;
		}
		if (ns > 0) tcpcli->svr.tact = tickget();
		tracet(5, "writetcpcli: exit sock=%d ns=%d\n", tcpcli->svr.sock, ns);
		return ns;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movl %edx, %r12d
movq %rsi, %r13
movq %rdi, %rbx
movl (%rdi), %ecx
movl 0x118(%rdi), %edx
leaq 0x1b7e9(%rip), %rsi     # 0x6d299
xorl %r14d, %r14d
pushq $0x3
popq %rdi
movl %r12d, %r8d
xorl %eax, %eax
callq 0x4acf2
movq %rbx, %rdi
movq %r15, %rsi
callq 0x53c06
testl %eax, %eax
je 0x51b7e
movl 0x118(%rbx), %edi
movq %r13, %rsi
movl %r12d, %edx
callq 0x55008
cmpl $-0x1, %eax
je 0x51b1a
movl %eax, %r12d
testl %eax, %eax
jle 0x51afb
callq 0x47c01
movl %eax, 0x120(%rbx)
movl 0x118(%rbx), %edx
leaq 0x1b7ea(%rip), %rsi     # 0x6d2f2
pushq $0x5
popq %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x4acf2
movl %r12d, %r14d
jmp 0x51b7e
callq 0x533ff
testl %eax, %eax
je 0x51b55
movl %eax, %r12d
movl 0x118(%rbx), %edx
leaq 0x1b78a(%rip), %rsi     # 0x6d2bd
pushq $0x1
popq %rdi
movl %eax, %ecx
xorl %eax, %eax
callq 0x4acf2
leaq 0x1b79c(%rip), %rsi     # 0x6d2e2
movq %r15, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0x8110
jmp 0x51b70
movabsq $0x64657463656e6e, %rax # imm = 0x64657463656E6E
movq %rax, 0x5(%r15)
movabsq $0x656e6e6f63736964, %rax # imm = 0x656E6E6F63736964
movq %rax, (%r15)
movl 0x12c(%rbx), %esi
movq %rbx, %rdi
callq 0x53ac3
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::strsetsel(bamboo::stream_t*, char const*)
extern int strsetsel(stream_t *stream, const char *sel)
	{
		if (!stream->port ||
			(stream->type != STR_NTRIPC_S && stream->type != STR_NTRIPC_C)) {
			return 0;
		}
		strlock(stream);

		strcpy(((ntripc_t *)stream->port)->mntpnt, sel);

		strunlock(stream);
		return 1;
	}

// Assembly:
xorl %eax, %eax
cmpq $0x0, 0x58(%rdi)
je 0x51be4
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl (%rdi), %ecx
andl $-0x2, %ecx
cmpl $0xa, %ecx
jne 0x51bda
movq %rsi, %rbx
leaq 0x30(%r14), %r15
movq %r15, %rdi
callq 0x8900
movq 0x58(%r14), %rdi
addq $0x8, %rdi
movq %rbx, %rsi
callq 0x85c0
movq %r15, %rdi
callq 0x84b0
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::strgetsel(bamboo::stream_t*, char*)
extern int strgetsel(stream_t *stream, char *sel)
	{
		*sel = '\0';

		if (!stream->port ||
			(stream->type != STR_NTRIPC_S && stream->type != STR_NTRIPC_C)) {
			return 0;
		}
		strlock(stream);

		strcpy(sel, ((ntripc_t *)stream->port)->mntpnt);

		strunlock(stream);
		return 1;
	}

// Assembly:
movb $0x0, (%rsi)
xorl %eax, %eax
cmpq $0x0, 0x58(%rdi)
je 0x51c3c
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl (%rdi), %ecx
andl $-0x2, %ecx
cmpl $0xa, %ecx
jne 0x51c32
movq %rsi, %rbx
leaq 0x30(%r14), %r15
movq %r15, %rdi
callq 0x8900
movq 0x58(%r14), %rsi
addq $0x8, %rsi
movq %rbx, %rdi
callq 0x85c0
movq %r15, %rdi
callq 0x84b0
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::strgetmsgid(bamboo::stream_t*, int*)
extern int strgetmsgid(stream_t *stream, int *msgid) {
		if (!stream->port ||
			(stream->type != STR_NTRIPC_S && stream->type != STR_NTRIPC_C)) {
			return 0;
		}
		strlock(stream);
		*msgid = ((ntripc_t*)stream->port)->msgid;
		strunlock(stream);
		return 1;
	}

// Assembly:
xorl %eax, %eax
cmpq $0x0, 0x58(%rdi)
je 0x51c8d
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl (%rdi), %ecx
andl $-0x2, %ecx
cmpl $0xa, %ecx
jne 0x51c83
movq %rsi, %rbx
leaq 0x30(%r14), %r15
movq %r15, %rdi
callq 0x8900
movq 0x58(%r14), %rax
movl 0x820f40(%rax), %eax
movl %eax, (%rbx)
movq %r15, %rdi
callq 0x84b0
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::strsetmsgid(bamboo::stream_t*, int)
extern int strsetmsgid(stream_t *stream, int msgid) {
		if (!stream->port ||
			(stream->type != STR_NTRIPC_S && stream->type != STR_NTRIPC_C)) {
			return 0;
		}
		strlock(stream);

		((ntripc_t*)stream->port)->msgid = msgid;
		strunlock(stream);
		return 1;
	}

// Assembly:
xorl %eax, %eax
cmpq $0x0, 0x58(%rdi)
je 0x51cdb
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl (%rdi), %ecx
andl $-0x2, %ecx
cmpl $0xa, %ecx
jne 0x51cd1
movl %esi, %ebx
leaq 0x30(%r14), %r15
movq %r15, %rdi
callq 0x8900
movq 0x58(%r14), %rax
movl %ebx, 0x820f40(%rax)
movq %r15, %rdi
callq 0x84b0
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::strstat(bamboo::stream_t*, char*)
extern int strstat(stream_t *stream, char *msg)
	{
		int state;

		tracet(4, "strstat:\n");

		strlock(stream);
		if (msg) {
			strncpy(msg, stream->msg, MAXSTRMSG - 1); msg[MAXSTRMSG - 1] = '\0';
		}
		if (!stream->port) {
			strunlock(stream);
			return stream->state;
		}
		switch (stream->type) {
		case STR_SERIAL: state = stateserial((serial_t *)stream->port); break;
		case STR_FILE: state = statefile((file_t   *)stream->port); break;
		case STR_TCPSVR: state = statetcpsvr((tcpsvr_t *)stream->port); break;
		case STR_TCPCLI: state = statetcpcli((tcpcli_t *)stream->port); break;
		case STR_NTRIPSVR:
		case STR_NTRIPCLI: state = statentrip((ntrip_t  *)stream->port); break;
		case STR_NTRIPC_C:
		case STR_NTRIPC_S: state = statentripc((ntripc_t *)stream->port); break;
		case STR_UDPSVR: state = stateudpsvr((udp_t    *)stream->port); break;
		case STR_UDPCLI: state = stateudpcli((udp_t    *)stream->port); break;
		case STR_MEMBUF: state = statemembuf((membuf_t *)stream->port); break;
		case STR_FTP: state = stateftp((ftp_t    *)stream->port); break;
		case STR_HTTP: state = stateftp((ftp_t    *)stream->port); break;
		default:
			strunlock(stream);
			return 0;
		}
		if (state == 2 && (int)(tickget() - stream->tact) <= TINTACT) state = 3;
		strunlock(stream);
		return state;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
leaq 0x1a183(%rip), %rsi     # 0x6be76
pushq $0x4
popq %rdi
xorl %eax, %eax
callq 0x4acf2
leaq 0x30(%r14), %rbx
movq %rbx, %rdi
callq 0x8900
testq %r15, %r15
je 0x51d2a
leaq 0x460(%r14), %rsi
movl $0x3ff, %edx            # imm = 0x3FF
movq %r15, %rdi
callq 0x8360
movb $0x0, 0x3ff(%r15)
movq 0x58(%r14), %rax
testq %rax, %rax
je 0x51d7d
movl (%r14), %ecx
decl %ecx
cmpl $0xd, %ecx
ja 0x51dc2
leaq 0x19f98(%rip), %rdx     # 0x6bce0
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl (%rax), %r15d
cmpl $0x2, %r15d
jne 0x51d73
callq 0x47c01
subl 0x24(%r14), %eax
xorl %r15d, %r15d
cmpl $0xc9, %eax
setl %r15b
orl $0x2, %r15d
movq %rbx, %rdi
callq 0x84b0
jmp 0x51d89
movq %rbx, %rdi
callq 0x84b0
movl 0x8(%r14), %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl (%rax), %edx
xorl %eax, %eax
cmpl $0x3, %edx
setl %cl
testl %edx, %edx
je 0x51d5a
movb %cl, %al
leal -0x1(,%rax,4), %r15d
jmp 0x51d73
movl (%rax), %r15d
testl %r15d, %r15d
jne 0x51d54
movq 0x8510(%rax), %rax
jmp 0x51d51
movq %rbx, %rdi
callq 0x84b0
xorl %r15d, %r15d
jmp 0x51d89
cmpl $0x0, 0x4(%rax)
je 0x51d5a
pushq $-0x1
popq %r15
jmp 0x51d73
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::strsum(bamboo::stream_t*, int*, int*, int*, int*)
extern void strsum(stream_t *stream, int *inb, int *inr, int *outb, int *outr)
	{
		tracet(4, "strsum:\n");

		strlock(stream);
		if (inb)  *inb = stream->inb;
		if (inr)  *inr = stream->inr;
		if (outb) *outb = stream->outb;
		if (outr) *outr = stream->outr;
		strunlock(stream);
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, -0x30(%rbp)
movq %rcx, %r15
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x1974d(%rip), %rsi     # 0x6be8b
pushq $0x4
popq %rdi
xorl %eax, %eax
callq 0x4acf2
leaq 0x30(%r14), %r12
movq %r12, %rdi
callq 0x8900
testq %rbx, %rbx
je 0x5275f
movl 0xc(%r14), %eax
movl %eax, (%rbx)
testq %r13, %r13
je 0x5276c
movl 0x10(%r14), %eax
movl %eax, (%r13)
testq %r15, %r15
movq -0x30(%rbp), %rcx
je 0x5277c
movl 0x14(%r14), %eax
movl %eax, (%r15)
testq %rcx, %rcx
je 0x52787
movl 0x18(%r14), %eax
movl %eax, (%rcx)
movq %r12, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x84b0
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::strsetsrctbl(bamboo::stream_t*, char const*)
extern int strsetsrctbl(stream_t *stream, const char *file)
	{
		FILE *fp;
		ntripc_t *ntripc;
		char *srctbl = NULL, *srctbl_n;
		int n = 0, nmax;

		tracet(3, "strsetsrctbl: file=%s\n", file);

		strlock(stream);

		if (stream->type != STR_NTRIPC_C && stream->type != STR_NTRIPC_S) {
			strunlock(stream);
			return 1;
		}
		if (!(ntripc = (ntripc_t *)stream->port)) {
			strunlock(stream);
			return 0;
		}
		if (!(fp = fopen(file, "rb"))) {
			tracet(2, "strsetsrctbl: file open error %s\n", file);
			strunlock(stream);
			return 0;
		}
		for (nmax = 4096;; nmax += 4096) {
			if (!(srctbl_n = (char *)realloc(srctbl, nmax))) {
				free(srctbl); fclose(fp);
				strunlock(stream);
				return 0;
			}
			srctbl = srctbl_n;
			n += fread(srctbl + n, 1, nmax - 1 - n, fp);
			if (n < nmax - 1) break;
		}
		srctbl[n++] = '\0';
		fclose(fp);
		tracet(3, "strsetsrctbl: n=%d\n", n);

		lock(&ntripc->lock_srctbl);

		free(ntripc->srctbl);
		ntripc->srctbl = srctbl;

		unlock(&ntripc->lock_srctbl);
		strunlock(stream);
		return 1;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x196d9(%rip), %rsi     # 0x6be94
xorl %r14d, %r14d
pushq $0x3
popq %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x4acf2
leaq 0x30(%rbx), %r12
movq %r12, %rdi
callq 0x8900
movl (%rbx), %eax
andl $-0x2, %eax
pushq $0x1
popq %rcx
cmpl $0xa, %eax
jne 0x528cd
movq 0x58(%rbx), %rbx
testq %rbx, %rbx
je 0x52903
leaq 0x196af(%rip), %rsi     # 0x6beab
movq %r15, %rdi
callq 0x8750
movq %rax, -0x30(%rbp)
testq %rax, %rax
je 0x528d2
movq %rbx, -0x40(%rbp)
movq %r12, -0x38(%rbp)
xorl %r15d, %r15d
movl $0xfff, %r12d           # imm = 0xFFF
xorl %r14d, %r14d
leaq 0x1(%r12), %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x8a70
testq %rax, %rax
je 0x528eb
movq %rax, %rbx
movslq %r14d, %r14
movq %rax, %rdi
addq %r14, %rdi
movq %r12, %rdx
subq %r14, %rdx
pushq $0x1
popq %rsi
movq -0x30(%rbp), %rcx
callq 0x8920
addl %eax, %r14d
movslq %r14d, %rax
addq $0x1000, %r12           # imm = 0x1000
decq %r13
movq %rbx, %r15
cmpq %rax, %r13
jle 0x52825
leal 0x1(%rax), %r15d
movb $0x0, (%rbx,%rax)
movq -0x30(%rbp), %rdi
callq 0x8620
leaq 0x19644(%rip), %rsi     # 0x6bed0
pushq $0x3
popq %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x4acf2
movq -0x40(%rbp), %r15
leaq 0x310(%r15), %r14
movq %r14, %rdi
callq 0x8900
movq 0x308(%r15), %rdi
callq 0x8780
movq %rbx, 0x308(%r15)
movq %r14, %rdi
callq 0x84b0
pushq $0x1
popq %r14
jmp 0x528ff
movl %ecx, %r14d
jmp 0x52903
leaq 0x195d5(%rip), %rsi     # 0x6beae
xorl %r14d, %r14d
pushq $0x2
popq %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x4acf2
jmp 0x52903
movq %r15, %rdi
callq 0x8780
movq -0x30(%rbp), %rdi
callq 0x8620
xorl %r14d, %r14d
movq -0x38(%rbp), %r12
movq %r12, %rdi
callq 0x84b0
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::strsetopt(int const*)
extern void strsetopt(const int *opt)
	{
		tracet(3, "strsetopt: opt=%d %d %d %d %d %d %d %d\n", opt[0], opt[1], opt[2],
			opt[3], opt[4], opt[5], opt[6], opt[7]);

		toinact = 0 < opt[0] && opt[0] < 1000 ? 1000 : opt[0]; /* >=1s */
		ticonnect = opt[1] < 1000 ? 1000 : opt[1]; /* >=1s */
		tirate = opt[2] < 100 ? 100 : opt[2]; /* >=0.1s */
		buffsize = opt[3] < 4096 ? 4096 : opt[3]; /* >=4096byte */
		fswapmargin = opt[4] < 0 ? 0 : opt[4];
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %edx
movl 0x4(%rdi), %ecx
movl 0x8(%rdi), %r8d
movl 0xc(%rdi), %r9d
movl 0x10(%rdi), %r10d
movl 0x14(%rdi), %r11d
movl 0x18(%rdi), %r15d
movl 0x1c(%rdi), %r12d
leaq 0x19595(%rip), %rsi     # 0x6bee4
xorl %r14d, %r14d
pushq $0x3
popq %rdi
xorl %eax, %eax
pushq %r12
pushq %r15
pushq %r11
pushq %r10
callq 0x4acf2
addq $0x20, %rsp
movl (%rbx), %eax
leal -0x1(%rax), %ecx
cmpl $0x3e7, %ecx            # imm = 0x3E7
movl $0x3e8, %ecx            # imm = 0x3E8
cmovbl %ecx, %eax
movl %eax, 0x3552b(%rip)     # 0x87eac
movl 0x4(%rbx), %eax
cmpl $0x3e9, %eax            # imm = 0x3E9
cmovgel %eax, %ecx
movl %ecx, 0x3551e(%rip)     # 0x87eb0
movl 0x8(%rbx), %eax
cmpl $0x65, %eax
pushq $0x64
popq %rcx
cmovgel %eax, %ecx
movl %ecx, 0x35504(%rip)     # 0x87ea8
movl 0xc(%rbx), %eax
cmpl $0x1001, %eax           # imm = 0x1001
movl $0x1000, %ecx           # imm = 0x1000
cmovgel %eax, %ecx
movl %ecx, 0x354fa(%rip)     # 0x87eb4
movl 0x10(%rbx), %eax
testl %eax, %eax
cmovgl %eax, %r14d
movl %r14d, 0x354ee(%rip)    # 0x87eb8
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::strsettimeout(bamboo::stream_t*, int, int)
extern void strsettimeout(stream_t *stream, int toinact, int tirecon)
	{
		tcpcli_t *tcpcli;

		tracet(3, "strsettimeout: toinact=%d tirecon=%d\n", toinact, tirecon);

		if (stream->type == STR_TCPCLI) {
			tcpcli = (tcpcli_t *)stream->port;
		}
		else if (stream->type == STR_NTRIPCLI || stream->type == STR_NTRIPSVR) {
			tcpcli = ((ntrip_t *)stream->port)->tcp;
		}
		else return;

		tcpcli->toinact = toinact;
		tcpcli->tirecon = tirecon;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r14d
movq %rdi, %r15
leaq 0x19520(%rip), %rsi     # 0x6bf0c
pushq $0x3
popq %rdi
movl %r14d, %edx
movl %ebx, %ecx
xorl %eax, %eax
callq 0x4acf2
movl (%r15), %eax
leal -0x6(%rax), %ecx
cmpl $0x2, %ecx
jae 0x52a14
movl $0x8510, %eax           # imm = 0x8510
addq 0x58(%r15), %rax
movq %rax, %r15
jmp 0x52a1d
cmpl $0x4, %eax
jne 0x52a2d
addq $0x58, %r15
movq (%r15), %rax
movl %r14d, 0x128(%rax)
movl %ebx, 0x12c(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::strgettime(bamboo::stream_t*)
extern gtime_t strgettime(stream_t *stream)
	{
		file_t *file;
		if (stream->type == STR_FILE && (stream->mode&STR_MODE_R) &&
			(file = (file_t *)stream->port)) {
			return timeadd(file->time, file->start); /* replay start time */
		}
		return utc2gpst(timeget());
	}

// Assembly:
cmpl $0x2, (%rdi)
jne 0x52acc
testb $0x1, 0x4(%rdi)
je 0x52acc
movq 0x58(%rdi), %rax
testq %rax, %rax
je 0x52acc
movq 0x838(%rax), %rdi
movsd 0x840(%rax), %xmm0
movsd 0x870(%rax), %xmm1
jmp 0x472ee
pushq %rbp
movq %rsp, %rbp
callq 0x47349
movq %rax, %rdi
popq %rbp
jmp 0x477da
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::waittcpsvr(bamboo::tcpsvr_tag*, char*)
static int waittcpsvr(tcpsvr_t *tcpsvr, char *msg)
	{
		tracet(4, "waittcpsvr: sock=%d state=%d\n", tcpsvr->svr.sock, tcpsvr->svr.state);

		if (tcpsvr->svr.state <= 0) return 0;

		while (accsock(tcpsvr, msg));

		updatetcpsvr(tcpsvr, msg);
		return tcpsvr->svr.state == 2;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rsi, -0x30(%rbp)
movq %rdi, %rbx
movl (%rdi), %ecx
movl 0x118(%rdi), %edx
leaq 0x18e52(%rip), %rsi     # 0x6c695
xorl %r15d, %r15d
pushq $0x4
popq %rdi
xorl %eax, %eax
callq 0x4acf2
cmpl $0x0, (%rbx)
jle 0x53a11
leaq 0x248(%rbx), %r14
leaq 0x18e4c(%rip), %rsi     # 0x6c6b3
pushq $0x4
popq %rdi
movq %r14, -0x40(%rbp)
movl $0x10, -0x34(%rbp)
movl 0x118(%rbx), %edx
xorl %eax, %eax
callq 0x4acf2
xorl %r13d, %r13d
cmpq $0x100, %r13            # imm = 0x100
je 0x539fb
cmpl $0x0, -0x120(%r14)
je 0x538a8
incq %r13
addq $0x128, %r14            # imm = 0x128
jmp 0x53885
movl 0x118(%rbx), %r15d
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
xorl %eax, %eax
cmpq $0x10, %rax
je 0x538cc
andq $0x0, -0xe0(%rbp,%rax,8)
incq %rax
jmp 0x538b8
movl %r15d, %eax
cltd
pushq $0x40
popq %rcx
idivl %ecx
movslq %eax, %rdx
shll $0x6, %eax
movl %r15d, %ecx
subl %eax, %ecx
pushq $0x1
popq %rax
shlq %cl, %rax
orq %rax, -0xe0(%rbp,%rdx,8)
leal 0x1(%r15), %edi
leaq -0xe0(%rbp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
leaq -0x60(%rbp), %r8
callq 0x85e0
testl %eax, %eax
jle 0x5391a
movl %r15d, %edi
leaq -0x50(%rbp), %rsi
leaq -0x34(%rbp), %rdx
callq 0x8210
movl %eax, %r12d
testl %eax, %eax
je 0x539fb
cmpl $-0x1, %r12d
je 0x539b7
movl %r12d, %edi
movq -0x30(%rbp), %rsi
callq 0x5340c
testl %eax, %eax
je 0x539fb
movl %r12d, -0x8(%r14)
movups -0x50(%rbp), %xmm0
movups %xmm0, -0x18(%r14)
leaq -0x11c(%r14), %r15
movl -0x4c(%rbp), %edi
callq 0x82a0
movq %r15, %rdi
movq %rax, %rsi
callq 0x85c0
movq -0x30(%rbp), %rdi
movq %r15, %rsi
callq 0x85c0
movl -0x8(%r14), %edx
pushq $0x3
popq %rdi
leaq 0x18d79(%rip), %rsi     # 0x6c6fd
movq %r15, %rcx
movl %r13d, %r8d
xorl %eax, %eax
callq 0x4acf2
movl $0x2, -0x120(%r14)
callq 0x47c01
movl %eax, (%r14)
movq -0x40(%rbp), %r14
leaq 0x18d04(%rip), %rsi     # 0x6c6b3
pushq $0x4
popq %rdi
jmp 0x5386e
callq 0x533ff
movl %eax, %r15d
leaq 0x18cff(%rip), %rsi     # 0x6c6c5
movq -0x30(%rbp), %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x8110
movl 0x118(%rbx), %edx
leaq 0x18cf7(%rip), %rsi     # 0x6c6d7
pushq $0x1
popq %rdi
movl %r15d, %ecx
xorl %eax, %eax
callq 0x4acf2
movl 0x118(%rbx), %edi
callq 0x8c70
andl $0x0, (%rbx)
movq %rbx, %rdi
movq -0x30(%rbp), %rsi
callq 0x53b10
xorl %r15d, %r15d
cmpl $0x2, (%rbx)
sete %r15b
movl %r15d, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::recv_nb(int, unsigned char*, int)
static int recv_nb(socket_t sock, unsigned char *buff, int n)
	{
		struct timeval tv = { 0 };
		fd_set rs;
		int ret, nr;

		FD_ZERO(&rs); FD_SET(sock, &rs);
		ret = select(sock + 1, &rs, NULL, NULL, &tv);
		if (ret <= 0) return ret;
		nr = recv(sock, (char *)buff, n, 0);
		return nr <= 0 ? -1 : nr;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x98, %rsp
movl %edx, %r14d
movq %rsi, %rbx
movl %edi, %r15d
xorps %xmm0, %xmm0
movaps %xmm0, -0x30(%rbp)
xorl %eax, %eax
cmpq $0x10, %rax
je 0x53a5c
andq $0x0, -0xb0(%rbp,%rax,8)
incq %rax
jmp 0x53a48
pushq $0x40
popq %rcx
movl %r15d, %eax
cltd
idivl %ecx
movslq %eax, %rdx
shll $0x6, %eax
movl %r15d, %ecx
subl %eax, %ecx
pushq $0x1
popq %rax
shlq %cl, %rax
orq %rax, -0xb0(%rbp,%rdx,8)
leal 0x1(%r15), %edi
leaq -0xb0(%rbp), %rsi
leaq -0x30(%rbp), %r8
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x85e0
testl %eax, %eax
jle 0x53ab5
movslq %r14d, %rdx
movl %r15d, %edi
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0x8220
movq %rax, %rcx
testl %ecx, %ecx
pushq $-0x1
popq %rax
cmovgl %ecx, %eax
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::discontcp(bamboo::tcp_t*, int)
static void discontcp(tcp_t *tcp, int tcon)
	{
		tracet(3, "discontcp: sock=%d tcon=%d\n", tcp->sock, tcon);

		closesocket(tcp->sock);
		tcp->state = 0;
		tcp->tcon = tcon;
		tcp->tdis = tickget();
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movl 0x118(%rdi), %edx
leaq 0x18c4a(%rip), %rsi     # 0x6c726
pushq $0x3
popq %rdi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x4acf2
movl 0x118(%r14), %edi
callq 0x8c70
andl $0x0, (%r14)
movl %ebx, 0x11c(%r14)
callq 0x47c01
movl %eax, 0x124(%r14)
popq %rbx
popq %r14
popq %rbp
retq