// File: /workspace/github_cpp_makefile_star2_O3/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 0x339b2(%rip), %eax     # 0x8fea4
movl %eax, -0x24(%rbp)
movl $0x1, -0x28(%rbp)
xorps %xmm0, %xmm0
leaq -0x40(%rbp), %r12
movaps %xmm0, (%r12)
leaq 0x19c97(%rip), %rsi     # 0x761a6
xorl %r15d, %r15d
movl $0x3, %edi
movl %ebx, %edx
xorl %eax, %eax
callq 0x5342c
movl %ebx, %edi
movl $0x1, %esi
movl $0x14, %edx
movq %r12, %rcx
movl $0x10, %r8d
callq 0x8b40
cmpl $-0x1, %eax
je 0x5c63d
leaq -0x40(%rbp), %rcx
movl %ebx, %edi
movl $0x1, %esi
movl $0x15, %edx
movl $0x10, %r8d
callq 0x8b40
cmpl $-0x1, %eax
je 0x5c63d
leaq -0x24(%rbp), %rcx
movl %ebx, %edi
movl $0x1, %esi
movl $0x8, %edx
movl $0x4, %r8d
callq 0x8b40
cmpl $-0x1, %eax
je 0x5c5a7
leaq -0x24(%rbp), %rcx
movl %ebx, %edi
movl $0x1, %esi
movl $0x7, %edx
movl $0x4, %r8d
callq 0x8b40
cmpl $-0x1, %eax
jne 0x5c5e0
callq 0x8070
movl (%rax), %ecx
movl -0x24(%rbp), %r8d
leaq 0x19c42(%rip), %rsi     # 0x761fb
movl $0x1, %edi
movl %ebx, %edx
xorl %eax, %eax
callq 0x5342c
movabsq $0x7a697366756220, %rax # imm = 0x7A697366756220
movq %rax, 0xe(%r14)
movups 0x19c51(%rip), %xmm0    # 0x7622d
movups %xmm0, (%r14)
movl $0x1, %r15d
leaq -0x28(%rbp), %rcx
movl %ebx, %edi
movl $0x6, %esi
movl $0x1, %edx
movl $0x4, %r8d
callq 0x8b40
cmpl $-0x1, %eax
jne 0x5c679
callq 0x8070
movl (%rax), %ecx
leaq 0x19c2f(%rip), %rsi     # 0x76243
movl $0x1, %edi
movl %ebx, %edx
xorl %eax, %eax
callq 0x5342c
movabsq $0x79616c65646f6e, %rax # imm = 0x79616C65646F6E
movq %rax, 0xf(%r14)
movups 0x19c38(%rip), %xmm0    # 0x7626f
movups %xmm0, (%r14)
jmp 0x5c679
movups 0x19b74(%rip), %xmm0    # 0x761b8
movups %xmm0, (%r14)
movabsq $0x6f656d69746f6e, %rax # imm = 0x6F656D69746F6E
movq %rax, 0xf(%r14)
callq 0x8070
movl (%rax), %ecx
leaq 0x19b6b(%rip), %rsi     # 0x761cf
movl $0x1, %edi
movl %ebx, %edx
xorl %eax, %eax
callq 0x5342c
movl %ebx, %edi
callq 0x8c40
movl %r15d, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq