// File: /workspace/github_cpp_makefile_star2_O1/DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::setsock(int, char*)
static int setsock(socket_t sock, char *msg)
	{
		int bs = buffsize, mode = 1;
#ifdef WIN32
		int tv = 0;
#else
		struct timeval tv = { 0 };
#endif
		tracet(3, "setsock: sock=%d\n", sock);

		if (setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, (const char *)&tv, sizeof(tv)) == -1 ||
			setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (const char *)&tv, sizeof(tv)) == -1) {
			sprintf(msg, "sockopt error: notimeo");
			tracet(1, "setsock: setsockopt error 1 sock=%d err=%d\n", sock, errsock());
			closesocket(sock);
			return 0;
		}
		if (setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (const char *)&bs, sizeof(bs)) == -1 ||
			setsockopt(sock, SOL_SOCKET, SO_SNDBUF, (const char *)&bs, sizeof(bs)) == -1) {
			tracet(1, "setsock: setsockopt error 2 sock=%d err=%d bs=%d\n", sock, errsock(), bs);
			sprintf(msg, "sockopt error: bufsiz");
		}
		if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (const char *)&mode, sizeof(mode)) == -1) {
			tracet(1, "setsock: setsockopt error 3 sock=%d err=%d\n", sock, errsock());
			sprintf(msg, "sockopt error: nodelay");
		}
		return 1;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movl %edi, %ebx
movl 0x32e82(%rip), %eax     # 0x8fea4
movl %eax, -0x24(%rbp)
movl $0x1, -0x28(%rbp)
xorps %xmm0, %xmm0
leaq -0x40(%rbp), %r12
movaps %xmm0, (%r12)
leaq 0x191e2(%rip), %rsi     # 0x76221
xorl %r15d, %r15d
movl $0x3, %edi
movl %ebx, %edx
xorl %eax, %eax
callq 0x53ec4
movl %ebx, %edi
movl $0x1, %esi
movl $0x14, %edx
movq %r12, %rcx
movl $0x10, %r8d
callq 0x8b50
cmpl $-0x1, %eax
je 0x5d16d
leaq -0x40(%rbp), %rcx
movl %ebx, %edi
movl $0x1, %esi
movl $0x15, %edx
movl $0x10, %r8d
callq 0x8b50
cmpl $-0x1, %eax
je 0x5d16d
leaq -0x24(%rbp), %rcx
movl %ebx, %edi
movl $0x1, %esi
movl $0x8, %edx
movl $0x4, %r8d
callq 0x8b50
cmpl $-0x1, %eax
je 0x5d0d7
leaq -0x24(%rbp), %rcx
movl %ebx, %edi
movl $0x1, %esi
movl $0x7, %edx
movl $0x4, %r8d
callq 0x8b50
cmpl $-0x1, %eax
jne 0x5d110
callq 0x8070
movl (%rax), %ecx
movl -0x24(%rbp), %r8d
leaq 0x1918d(%rip), %rsi     # 0x76276
movl $0x1, %edi
movl %ebx, %edx
xorl %eax, %eax
callq 0x53ec4
movabsq $0x7a697366756220, %rax # imm = 0x7A697366756220
movq %rax, 0xe(%r14)
movups 0x1919c(%rip), %xmm0    # 0x762a8
movups %xmm0, (%r14)
movl $0x1, %r15d
leaq -0x28(%rbp), %rcx
movl %ebx, %edi
movl $0x6, %esi
movl $0x1, %edx
movl $0x4, %r8d
callq 0x8b50
cmpl $-0x1, %eax
jne 0x5d1a9
callq 0x8070
movl (%rax), %ecx
leaq 0x1917a(%rip), %rsi     # 0x762be
movl $0x1, %edi
movl %ebx, %edx
xorl %eax, %eax
callq 0x53ec4
movabsq $0x79616c65646f6e, %rax # imm = 0x79616C65646F6E
movq %rax, 0xf(%r14)
movups 0x19183(%rip), %xmm0    # 0x762ea
movups %xmm0, (%r14)
jmp 0x5d1a9
movups 0x190bf(%rip), %xmm0    # 0x76233
movups %xmm0, (%r14)
movabsq $0x6f656d69746f6e, %rax # imm = 0x6F656D69746F6E
movq %rax, 0xf(%r14)
callq 0x8070
movl (%rax), %ecx
leaq 0x190b6(%rip), %rsi     # 0x7624a
movl $0x1, %edi
movl %ebx, %edx
xorl %eax, %eax
callq 0x53ec4
movl %ebx, %edi
callq 0x8c50
movl %r15d, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq