LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/ctSkennerton[P]fxtract/util/sock.c
// Function: host_ip
int
host_ip(char const *host, int port, IPSTR ip)
{
    dyninit();

    struct addrinfo *aip;
	ADRINFO hint = { AI_NUMERICSERV, AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP,
                            /*addrlen*/0, /*addr*/0, /*canonname*/0, /*next*/0 };
    char sport[7];

    if (port > 0) sprintf(sport, "%hu", (uint16_t)port);
    if (getaddrinfo(host, port > 0 ? sport : NULL, &hint, &aip))
        return -1;

    int fail = -!inet_ntop(aip->ai_family,
                           aip->ai_family == AF_INET   
                              ? (void*)&((IN4ADDR*)aip->ai_addr)->sin_addr
                              : (void*)&((IN6ADDR*)aip->ai_addr)->sin6_addr,
                           ip, sizeof(IPSTR));
    freeaddrinfo(aip);
    return fail;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
callq 0x5d1c
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movl $0x400, 0x10(%rsp)      # imm = 0x400
movabsq $0x600000001, %rax      # imm = 0x600000001
movq %rax, 0x18(%rsp)
testl %ebp, %ebp
jle 0x5cb7
movzwl %bp, %edx
leaq 0x2efa(%rip), %rsi      # 0x8ba0
leaq 0x9(%rsp), %r15
movq %r15, %rdi
xorl %eax, %eax
callq 0x3080
jmp 0x5cba
xorl %r15d, %r15d
leaq 0x10(%rsp), %rdx
movq %rsp, %rcx
movq %r14, %rdi
movq %r15, %rsi
callq 0x33e0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x5d0f
movq (%rsp), %rax
movl 0x4(%rax), %edi
xorl %ecx, %ecx
cmpl $0x2, %edi
setne %cl
movq 0x18(%rax), %rax
leaq (%rax,%rcx,4), %rsi
addq $0x4, %rsi
movq %rbx, %rdx
movl $0x2e, %ecx
callq 0x3310
xorl %ebp, %ebp
cmpq $0x1, %rax
sbbl %ebp, %ebp
movq (%rsp), %rdi
callq 0x33f0
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ctSkennerton[P]fxtract/util/sock.c
// Function: dyninit
static void
dyninit(void)
{
    if (sock_cloexec == 1) {    // initial state, ie neither 0 nor SOCK_CLOEXEC
#ifdef WIN32
        WSADATA wsaData;
        WSAStartup(WINSOCK_VERSION, &wsaData);
#endif
       #ifdef SOCK_CLOEXEC
        sock_cloexec = SOCK_CLOEXEC;    // Safely re-enter dyninit from sock_bind
        int fd = sock_bind("", 0);
        if (fd < 0) {
            sock_cloexec = 0;
            cmsg_cloexec = 0;
        } else {
           #if defined(linux) && defined(_GNU_SOURCE)
            // Test whether glibc.accept4 really works:
            IN4ADDR sin;
            socklen_t len = sizeof(sin);
            listen(fd, 1);
            getsockname(fd, (SOADDR*)&sin, &len);
            int con = sock_connect("127.0.0.1", ntohs(sin.sin_port), 1);
            int ret = accept4(fd, NULL, NULL, SOCK_CLOEXEC);
            has_accept4 = ret >= 0 && fcntl(ret, F_GETFD, 0) & FD_CLOEXEC;
            close(ret);
            close(con);
           #endif
            close(fd);
        }
       #else
        sock_cloexec = 0;
       #endif
    }
    errno = 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
cmpl $0x1, 0x6b41(%rip)      # 0xc870
jne 0x5dfc
movl $0x80000, 0x6b31(%rip)  # imm = 0x80000
leaq 0x30b8(%rip), %rdi      # 0x8dfe
xorl %r14d, %r14d
xorl %esi, %esi
callq 0x5e14
testl %eax, %eax
js 0x5df2
movl %eax, %ebx
leaq 0xc(%rsp), %r15
movl $0x10, (%r15)
movl %eax, %edi
movl $0x1, %esi
callq 0x3370
leaq 0x10(%rsp), %r12
movl %ebx, %edi
movq %r12, %rsi
movq %r15, %rdx
callq 0x32d0
movzwl 0x2(%r12), %eax
rolw $0x8, %ax
movzwl %ax, %esi
leaq 0x2275(%rip), %rdi      # 0x800d
movl $0x1, %edx
callq 0x6254
movl %eax, %ebp
movl %ebx, %edi
xorl %esi, %esi
xorl %edx, %edx
movl $0x80000, %ecx          # imm = 0x80000
callq 0x3180
movl %eax, %r15d
testl %eax, %eax
js 0x5dd3
movl %r15d, %edi
movl $0x1, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x31d0
movl %eax, %r14d
andl $0x1, %r14d
movl %r14d, 0x6ab6(%rip)     # 0xc890
movl %r15d, %edi
callq 0x3550
movl %ebp, %edi
callq 0x3550
movl %ebx, %edi
callq 0x3550
jmp 0x5dfc
movl $0x0, 0x6a74(%rip)      # 0xc870
callq 0x3040
movl $0x0, (%rax)
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ctSkennerton[P]fxtract/util/sock.c
// Function: sock_bind
int
sock_bind(IPSTR const ip, int port)
{
    dyninit();

    INxADDR addr;
    int addrlen = ininit(&addr, ip, port);
    if (addrlen < 0)
        return -1;

    int fd = sockit(addr.inx_family);
    if (fd < 0)
        return -1;
    #ifdef IPV6_V6ONLY
    if (addr.inx_family == AF_INET6) {
        int     no = 0;
        if (setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &no, sizeof(no)))
            return eclose(fd);
    }
    #endif
    //XXX support bindresvport(), i.e. ask for an arb port in 512..1023?
    return setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char*)&fd, sizeof fd)
            || bind(fd, (SOADDR*)&addr, addrlen)
            || listen(fd, 5)
         ? eclose(fd) : fd;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movl %esi, %ebx
movq %rdi, %r14
callq 0x5d1c
leaq 0x14(%rsp), %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x5ef5
testl %eax, %eax
js 0x5e8d
movl %eax, %ebp
movzwl 0x14(%rsp), %edi
callq 0x5f70
movl %eax, 0xc(%rsp)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x5ee4
movl %eax, %r14d
cmpw $0xa, 0x14(%rsp)
jne 0x5e94
leaq 0x10(%rsp), %rcx
movl $0x0, (%rcx)
movl %r14d, %edi
movl $0x29, %esi
movl $0x1a, %edx
movl $0x4, %r8d
callq 0x34e0
testl %eax, %eax
je 0x5e94
movl %r14d, %edi
jmp 0x5edf
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x5ee4
leaq 0xc(%rsp), %rcx
movl %r14d, %edi
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %r8d
callq 0x34e0
testl %eax, %eax
jne 0x5edb
movl 0xc(%rsp), %edi
leaq 0x14(%rsp), %rsi
movl %ebp, %edx
callq 0x3070
testl %eax, %eax
jne 0x5edb
movl 0xc(%rsp), %edi
movl $0x5, %esi
callq 0x3370
testl %eax, %eax
je 0x5eef
movl 0xc(%rsp), %edi
callq 0x5fc2
movl %ebx, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movl 0xc(%rsp), %ebx
jmp 0x5ee4
// File: /workspace/github_cpp_makefile_star2_O3/ctSkennerton[P]fxtract/util/sock.c
// Function: ininit
static int
ininit(INxADDR *xp, IPSTR const ip, int port)
{
   #if defined(__FreeBSD__) || defined(__APPLE__)
       #define SETLEN(x) (int)(xp->in4.sin_len = (x))
   #else
       #define SETLEN(x) (int)(x)
   #endif
    // We rely on INADDR_ANY == 0x00000000
    memset(xp, 0, sizeof(*xp));
    xp->inx_port   = (uint16_t)htons((uint16_t)port);
    xp->inx_family = AF_INET;
    return !ip || !*ip ||
              1 == inet_pton(AF_INET, ip, &xp->in4.sin_addr)
            ? SETLEN(sizeof(IN4ADDR))
            : 1 == inet_pton(xp->inx_family = AF_INET6, ip, &xp->in6.sin6_addr)
            ? SETLEN(sizeof(IN6ADDR))
            : -1;
   #undef SETLEN
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%rdi)
movq $0x0, 0x14(%rdi)
rolw $0x8, %dx
movw %dx, 0x2(%rdi)
movw $0x2, (%rdi)
movl $0x10, %ebx
testq %rsi, %rsi
je 0x5f68
movq %rsi, %r15
cmpb $0x0, (%rsi)
je 0x5f68
movq %rdi, %r14
leaq 0x4(%rdi), %rdx
movl $0x2, %edi
movq %r15, %rsi
callq 0x3520
cmpl $0x1, %eax
je 0x5f68
movw $0xa, (%r14)
addq $0x8, %r14
movl $0xa, %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3520
xorl %ebx, %ebx
cmpl $0x1, %eax
setne %bl
negl %ebx
orl $0x1c, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/ctSkennerton[P]fxtract/util/sock.c
// Function: sockit
static int
sockit(int domain)
{
    int fd = socket(domain, SOCK_STREAM | sock_cloexec, 0);
    if (fd < 0) return -1;

#ifdef SO_NOSIGPIPE
    // If the connection breaks. the client finds out because SEND fails (RECV just waits).
    //  On Darwin, by default, writing to a broken connection throws SIGPIPE.
    int on = 1;
    if (setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, (const void *) &on, sizeof on))
        return eclose(fd);
#endif
    return fd >= 0 && !sock_cloexec && fcntl(fd, F_SETFD, FD_CLOEXEC) ? eclose(fd) : fd;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl 0x68f7(%rip), %esi      # 0xc870
orl $0x1, %esi
xorl %edx, %edx
callq 0x30a0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x5fb9
movl %eax, %ebp
cmpl $0x0, 0x68db(%rip)      # 0xc870
je 0x5f9b
movl %ebp, %ebx
jmp 0x5fb9
movl %ebp, %edi
movl $0x2, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x31d0
testl %eax, %eax
je 0x5f97
movl %ebp, %edi
callq 0x5fc2
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ctSkennerton[P]fxtract/util/sock.c
// Function: sock_accept
int
sock_accept(int skt)
{
    dyninit();

    int fd;
    do fd =
           #if 0 && defined(linux) && defined(_GNU_SOURCE)
            has_accept4 ? accept4(skt, NULL, NULL, sock_cloexec) :
           #endif
            accept(skt, NULL, NULL);
    while (fd < 0 && errno == EINTR);

    return fd >= 0 && !has_accept4 && fcntl(fd, F_SETFD, FD_CLOEXEC)
         ? eclose(fd) : fd;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebp
callq 0x5d1c
movl %ebp, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x30e0
movl %eax, %ebx
testl %eax, %eax
jns 0x600e
callq 0x3040
cmpl $0x4, (%rax)
je 0x5ff1
jmp 0x603a
cmpl $0x0, 0x687b(%rip)      # 0xc890
jne 0x603a
movl %ebx, %edi
movl $0x2, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x31d0
testl %eax, %eax
je 0x603a
movl %ebx, %edi
callq 0x5fc2
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ctSkennerton[P]fxtract/util/sock.c
// Function: sock_create
int
sock_create(char const *path)
{
    dyninit();

#ifdef WIN32
    //CreateNamedPipe...  http://msdn.microsoft.com/en-us/library/windows/desktop/aa365601%28v=vs.85%29.aspx
    return INVALID_SOCKET;
#else
    UNADDR sun;
    int fd, len = uninit(&sun, path);
    if (!len) return errno = EINVAL, -1;
    if (unlink(path) && errno != ENOENT) return -1;
    if (0 > (fd = sockit(AF_UNIX))) return -1;

    return setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &fd, sizeof fd)
           || bind(fd, (SOADDR*)&sun, sizeof sun.sun_family + len)
           || listen(fd, 5)
         ? eclose(fd) : fd;
#endif
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
callq 0x5d1c
leaq 0xa(%rsp), %rdi
movq %rbx, %rsi
callq 0x610d
testl %eax, %eax
je 0x60ee
movl %eax, %ebp
movq %rbx, %rdi
callq 0x3160
testl %eax, %eax
je 0x6083
callq 0x3040
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x2, (%rax)
jne 0x60fe
movl $0x1, %edi
callq 0x5f70
movl %eax, 0x4(%rsp)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x60fe
leaq 0x4(%rsp), %rcx
movl %eax, %edi
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %r8d
callq 0x34e0
testl %eax, %eax
jne 0x60e3
movl 0x4(%rsp), %edi
addl $0x2, %ebp
leaq 0xa(%rsp), %rsi
movl %ebp, %edx
callq 0x3070
testl %eax, %eax
jne 0x60e3
movl 0x4(%rsp), %edi
movl $0x5, %esi
callq 0x3370
testl %eax, %eax
je 0x6107
movl 0x4(%rsp), %edi
callq 0x5fc2
jmp 0x60fe
callq 0x3040
movl $0x16, (%rax)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x78, %rsp
popq %rbx
popq %rbp
retq
movl 0x4(%rsp), %ebx
jmp 0x60fe
// File: /workspace/github_cpp_makefile_star2_O3/ctSkennerton[P]fxtract/util/sock.c
// Function: sock_open
int
sock_open(char const *path)
{
    dyninit();

#ifdef WIN32
    // WaitNamedPipe, CreateFile 
    return INVALID_SOCKET;
#else
    struct stat st;
    UNADDR sun;
    int fd, ret, len = uninit(&sun, path);
    if (!len || stat(path, &st) || !S_ISSOCK(st.st_mode))
        return errno = EINVAL, -1;

    if (0 > (fd = sockit(AF_UNIX))) return -1;

    do errno = 0, ret = connect(fd, (SOADDR*)&sun, SUN_LEN(&sun));
    while (ret < 0 && errno == EINTR);

    return ret < 0 && errno != EAGAIN ? eclose(fd) : fd;
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movq %rdi, %rbx
callq 0x5d1c
leaq 0x2(%rsp), %rdi
movq %rbx, %rsi
callq 0x610d
testl %eax, %eax
je 0x621f
leaq 0x70(%rsp), %rsi
movq %rbx, %rdi
callq 0x32b0
testl %eax, %eax
jne 0x621f
movl $0xf000, %eax           # imm = 0xF000
andl 0x88(%rsp), %eax
cmpl $0xc000, %eax           # imm = 0xC000
jne 0x621f
movl $0x1, %edi
callq 0x5f70
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x622f
movl %eax, %ebp
callq 0x3040
movq %rax, %r14
leaq 0x4(%rsp), %r15
leaq 0x2(%rsp), %r12
movl $0x0, (%r14)
movq %r15, %rdi
callq 0x3140
leal 0x2(%rax), %edx
movl %ebp, %edi
movq %r12, %rsi
callq 0x3280
testl %eax, %eax
jns 0x621b
movl (%r14), %eax
cmpl $0x4, %eax
je 0x61ee
cmpl $0xb, %eax
jne 0x6241
movl %ebp, %ebx
jmp 0x622f
callq 0x3040
movl $0x16, (%rax)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl %ebp, %edi
callq 0x5fc2
jmp 0x622f
// File: /workspace/github_cpp_makefile_star2_O3/ctSkennerton[P]fxtract/util/sock.c
// Function: sock_connect
int
sock_connect(const char *host, int port, int nowait)
{
    dyninit();

    char sport[7];
    sprintf(sport, "%hu", (uint16_t)port);
    ADRINFO *aip, hint = {
        AI_NUMERICSERV, AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP,
        /*addrlen */0, /*addr */0, /*canonname */0, /*next */0
    };

    if (getaddrinfo(host, sport, &hint, &aip)) return -1;

    // "ai_family" usable here because PF_INET=AF_INET, PF_INET6=AF_INET6.
    int fd = sockit(aip->ai_family), ret = -1;
    if (fd >= 0
        && !(nowait && sock_setopt(fd, SOCK_NOWAIT, 1))
        && !setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char*)&fd, sizeof fd)) {

        do errno = 0, ret = connect(fd, aip->ai_addr, aip->ai_addrlen);
        while (ret < 0 && errno == EINTR);
    }

    freeaddrinfo(aip);
    return ret < 0 && errno != EINPROGRESS ? eclose(fd) : fd;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x58, %rsp
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
callq 0x5d1c
movzwl %bp, %edx
leaq 0x292c(%rip), %rsi      # 0x8ba0
leaq 0x19(%rsp), %r15
movq %r15, %rdi
xorl %eax, %eax
callq 0x3080
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x20(%rdx)
movaps %xmm0, 0x10(%rdx)
movl $0x400, (%rdx)          # imm = 0x400
movabsq $0x600000001, %rax      # imm = 0x600000001
movq %rax, 0x8(%rdx)
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
movq %r15, %rsi
callq 0x33e0
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0x636d
movq 0x10(%rsp), %rax
movl 0x4(%rax), %edi
callq 0x5f70
movl %eax, 0xc(%rsp)
testl %eax, %eax
js 0x6345
movl %eax, %ebp
testl %ebx, %ebx
je 0x62f9
movl %ebp, %edi
movl $0x2, %esi
movl $0x1, %edx
callq 0x6384
testl %eax, %eax
jne 0x6345
leaq 0xc(%rsp), %rcx
movl %ebp, %edi
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %r8d
callq 0x34e0
testl %eax, %eax
jne 0x6345
callq 0x3040
movq %rax, %rbx
movl $0x0, (%rbx)
movl 0xc(%rsp), %edi
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rsi
movl 0x10(%rax), %edx
callq 0x3280
testl %eax, %eax
jns 0x6378
cmpl $0x4, (%rbx)
je 0x6321
movq 0x10(%rsp), %rdi
callq 0x33f0
callq 0x3040
cmpl $0x73, (%rax)
jne 0x635f
movl 0xc(%rsp), %eax
jmp 0x636d
movl 0xc(%rsp), %edi
callq 0x5fc2
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %rdi
callq 0x33f0
jmp 0x6359
// File: /workspace/github_cpp_makefile_star2_O3/ctSkennerton[P]fxtract/util/sock.c
// Function: sock_setopt
int
sock_setopt(int skt, SOCK_OPT opt, int val)
{
    dyninit();

    if (opt >= SOCK_OPTS) return errno = EINVAL, -1;
#ifdef TCP_KEEPALIVE    // Darwin,FreeBSD
    if (opt == SOCK_KEEPALIVE && setsockopt(skt, SOL_SOCKET, SO_KEEPALIVE, (char const*)&val, sizeof val))
        return -1;
#endif

    struct linger lng = { val > 0, val }; //XXX why winwarn?
    return opt == SOCK_LINGER      ? setsockopt(skt, SOL_SOCKET, SO_LINGER, &lng, sizeof lng)
        : opts[opt].lvl == F_GETFL ? fcntl(skt, F_SETFL, BIT(fcntl(skt, F_GETFL, 0), opts[opt].opt, val))
                                   : setsockopt(skt, opts[opt].lvl, opts[opt].opt, (char*)&val, sizeof val);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movl %esi, %r14d
movl %edi, %ebx
movl %edx, 0xc(%rsp)
callq 0x5d1c
cmpl $0x8, %r14d
jb 0x63b9
callq 0x3040
movl $0x16, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x6443
xorl %eax, %eax
testl %ebp, %ebp
setg %al
movl %eax, 0x10(%rsp)
movl %ebp, 0x14(%rsp)
cmpl $0x6, %r14d
jne 0x63e7
leaq 0x10(%rsp), %rcx
movl %ebx, %edi
movl $0x1, %esi
movl $0xd, %edx
movl $0x8, %r8d
jmp 0x643e
movl %r14d, %r14d
leaq 0x27ef(%rip), %r15      # 0x8be0
movl (%r15,%r14,8), %esi
cmpl $0x3, %esi
jne 0x642c
movl %ebx, %edi
movl $0x3, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x31d0
movl 0x4(%r15,%r14,8), %edx
movl %edx, %ecx
orl %eax, %ecx
notl %edx
andl %eax, %edx
testl %ebp, %ebp
cmovnel %ecx, %edx
movl %ebx, %edi
movl $0x4, %esi
xorl %eax, %eax
callq 0x31d0
jmp 0x6443
movl 0x4(%r15,%r14,8), %edx
leaq 0xc(%rsp), %rcx
movl %ebx, %edi
movl $0x4, %r8d
callq 0x34e0
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ctSkennerton[P]fxtract/util/sock.c
// Function: sock_ready
int
sock_ready(int skt, int mode, int waitsecs)
{
    dyninit();

    int ret, err;
#ifdef USE_POLL
    struct pollfd sockpoll = { skt, mode ? POLLOUT : POLLIN,  0 };

    do errno = 0, ret = poll(&sockpoll, 1, waitsecs);
    while (ret < 0 && errno == EINTR);

    err = sockpoll.revents & POLLERR;
#else//USE_POLL
    fd_set rwfds, erfds;
    FD_ZERO(&rwfds);
    FD_ZERO(&erfds);
    do {
        struct timeval to = { waitsecs, 0 }, *top = waitsecs == WAIT_FOREVER ? NULL : &to;
        FD_SET(skt, &rwfds);
        FD_SET(skt, &erfds);

        errno = 0;
        ret = mode  ? select(skt + 1, NULL, &rwfds, &erfds, top)
                    : select(skt + 1, &rwfds, NULL, &erfds, top);
    } while (ret < 0 && errno == EINTR);

    err = FD_ISSET(skt, &erfds);
#endif//USE_POLL

    return err && ret > 0 ? -2 : ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movl %edx, %ebp
movl %esi, 0xc(%rsp)
movl %edi, %r14d
callq 0x5d1c
xorps %xmm0, %xmm0
leaq 0xa0(%rsp), %rax
movaps %xmm0, (%rax)
movaps %xmm0, 0x10(%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, 0x30(%rax)
movaps %xmm0, 0x40(%rax)
movaps %xmm0, 0x50(%rax)
movaps %xmm0, 0x60(%rax)
movaps %xmm0, 0x70(%rax)
leaq 0x20(%rsp), %rsi
movaps %xmm0, (%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x50(%rsi)
movslq %ebp, %r15
xorl %eax, %eax
cmpl $-0x1, %r15d
leaq 0x10(%rsp), %r13
cmoveq %rax, %r13
leal 0x3f(%r14), %eax
testl %r14d, %r14d
cmovnsl %r14d, %eax
movl %eax, %edx
andl $-0x40, %edx
movl %r14d, %ecx
subl %edx, %ecx
movl $0x1, %r12d
shlq %cl, %r12
movaps %xmm0, 0x60(%rsi)
movaps %xmm0, 0x70(%rsi)
sarl $0x6, %eax
movslq %eax, %rbx
callq 0x3040
movq %rax, %rbp
incl %r14d
orq %r12, 0xa0(%rsp,%rbx,8)
orq %r12, 0x20(%rsp,%rbx,8)
movq %r15, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movl $0x0, (%rbp)
cmpl $0x0, 0xc(%rsp)
je 0x6534
movl %r14d, %edi
xorl %esi, %esi
leaq 0xa0(%rsp), %rdx
jmp 0x6541
movl %r14d, %edi
leaq 0xa0(%rsp), %rsi
xorl %edx, %edx
leaq 0x20(%rsp), %rcx
movq %r13, %r8
callq 0x32f0
testl %eax, %eax
jns 0x6558
cmpl $0x4, (%rbp)
je 0x64fc
testq %r12, 0x20(%rsp,%rbx,8)
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
cmovel %eax, %ecx
testl %eax, %eax
cmovlel %eax, %ecx
movl %ecx, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ctSkennerton[P]fxtract/util/sock.c
// Function: sock_recv
int
sock_recv(int skt, char *buf, int size)
{
    dyninit();

    int ret;
    do errno = 0, ret = recv(skt, buf, size, 0);
    while (ret < 0 && errno == EINTR);
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, %rbx
movl %edi, %ebp
callq 0x5d1c
callq 0x3040
movq %rax, %r14
movslq %r15d, %r15
movl $0x0, (%r14)
movl %ebp, %edi
movq %rbx, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x30f0
testl %eax, %eax
jns 0x67af
cmpl $0x4, (%r14)
je 0x678f
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ctSkennerton[P]fxtract/util/sock.c
// Function: sock_send
int
sock_send(int skt, char const *buf, int size)
{
    dyninit();

    int ret;
    do errno = 0, ret = send(skt, buf, size, 0);
    while (ret < 0 && errno == EINTR);
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, %rbx
movl %edi, %ebp
callq 0x5d1c
callq 0x3040
movq %rax, %r14
movslq %r15d, %r15
movl $0x0, (%r14)
movl %ebp, %edi
movq %rbx, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x3190
testl %eax, %eax
jns 0x67f9
cmpl $0x4, (%r14)
je 0x67d9
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ctSkennerton[P]fxtract/util/sock.c
// Function: sock_recvfd
int
sock_recvfd(int skt, int *pfd, char *buf, int size)
{
    dyninit();

    int ret;
    char x;
    FDCMSG ctl = { {sizeof ctl, 0, 0} , -1 };
    struct iovec iov[2] = { {&x, sizeof x} , {buf, size} };
    struct msghdr msg = { 0, 0, iov, 1 + (buf && size), &ctl, sizeof ctl, 0 };

    do errno = 0, ret = recvmsg(skt, &msg, cmsg_cloexec);
    while (ret < 0 && errno == EINTR);

    if (ret >= 0 && !cmsg_cloexec && fcntl(ctl.fd, F_SETFD, FD_CLOEXEC))
        return close(ctl.fd), -1;

    if (pfd)
        *pfd = ctl.fd;

    return ret < 0 ? ret
        : memcmp(&ctl.c, &fdc_hdr, sizeof fdc_hdr) ? errno = ENOMSG, -1
        : ret - (int) sizeof(x) * (ret > 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x90, %rsp
movl %ecx, %r14d
movq %rdx, %r15
movq %rsi, %rbx
movl %edi, %ebp
callq 0x5d1c
movdqu 0x2385(%rip), %xmm0     # 0x8bb0
leaq 0x10(%rsp), %rax
movdqa %xmm0, (%rax)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rcx, 0x10(%rax)
leaq 0xf(%rsp), %rcx
leaq 0x30(%rsp), %rdx
movq %rcx, (%rdx)
movq $0x1, 0x8(%rdx)
movq %r15, 0x10(%rdx)
movslq %r14d, %rcx
movq %rcx, 0x18(%rdx)
leaq 0x58(%rsp), %r12
movq $0x0, (%r12)
xorl %esi, %esi
movl %esi, 0x8(%r12)
movq %rdx, 0x10(%r12)
testq %r15, %r15
setne %dl
testl %ecx, %ecx
setne %cl
andb %dl, %cl
movzbl %cl, %ecx
incq %rcx
movq %rcx, 0x18(%r12)
movq %rax, 0x20(%r12)
movq $0x18, 0x28(%r12)
movl %esi, 0x30(%r12)
callq 0x3040
movq %rax, %r15
movl $0x0, (%r15)
movl %ebp, %edi
movq %r12, %rsi
xorl %edx, %edx
callq 0x30c0
movq %rax, %r14
testl %r14d, %r14d
jns 0x68cc
cmpl $0x4, (%r15)
je 0x68a9
jmp 0x68f0
movl 0x20(%rsp), %edi
movl $0x2, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x31d0
testl %eax, %eax
je 0x68f0
movl 0x20(%rsp), %edi
callq 0x3550
jmp 0x6920
testq %rbx, %rbx
je 0x68fb
movl 0x20(%rsp), %eax
movl %eax, (%rbx)
testl %r14d, %r14d
js 0x6930
movdqa 0x10(%rsp), %xmm0
pcmpeqb 0x2282(%rip), %xmm0     # 0x8b90
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x6928
movl $0x2a, (%r15)
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x6930
cmpl $0x1, %r14d
adcl $-0x1, %r14d
movl %r14d, %eax
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ctSkennerton[P]fxtract/util/sock.c
// Function: sock_sendfd
int
sock_sendfd(int skt, int fd, char const *buf, int size)
{
    dyninit();

    char          x = 0;
    FDCMSG        ctl = { fdc_hdr, fd };
    struct iovec  iov[2] = { {&x, sizeof x}, {(void *) (intptr_t) buf, size} };
    struct msghdr msg = { 0, 0, iov, 1 + (buf && size), &ctl, sizeof ctl, 0 };
    int           ret;

    do errno = 0, ret = sendmsg(skt, &msg, 0);
    while (ret < 0 && errno == EINTR);

    return ret - sizeof(x) * (ret > 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
movl %ecx, %ebp
movq %rdx, %r15
movl %esi, %r14d
movl %edi, %ebx
callq 0x5d1c
leaq 0xf(%rsp), %rax
movb $0x0, (%rax)
movups 0x225a(%rip), %xmm0     # 0x8bc8
leaq 0x10(%rsp), %rcx
movaps %xmm0, (%rcx)
movl %r14d, 0x10(%rcx)
leaq 0x30(%rsp), %rdx
movq %rax, (%rdx)
movq $0x1, 0x8(%rdx)
movq %r15, 0x10(%rdx)
movslq %ebp, %rax
movq %rax, 0x18(%rdx)
leaq 0x50(%rsp), %r14
movq $0x0, (%r14)
xorl %esi, %esi
movl %esi, 0x8(%r14)
movq %rdx, 0x10(%r14)
testq %r15, %r15
setne %dl
testl %eax, %eax
setne %al
andb %dl, %al
movzbl %al, %eax
incq %rax
movq %rax, 0x18(%r14)
movq %rcx, 0x20(%r14)
movq $0x18, 0x28(%r14)
movl %esi, 0x30(%r14)
callq 0x3040
movq %rax, %r15
movl $0x0, (%r15)
movl %ebx, %edi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3250
testl %eax, %eax
jns 0x69f7
cmpl $0x4, (%r15)
je 0x69da
xorl %ecx, %ecx
testl %eax, %eax
setg %cl
subl %ecx, %eax
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ctSkennerton[P]fxtract/util/sock.c
// Function: sock_getopt
int
sock_getopt(int skt, SOCK_OPT opt)
{
    dyninit();

    int         ret, val;
    socklen_t   len;

    if (opt >= SOCK_OPTS) return errno = EINVAL, -1;

    if (opt == SOCK_LINGER) {
        struct linger lng;
        len = sizeof lng;
        ret = getsockopt(skt, SOL_SOCKET, SO_LINGER, (char*)&lng, &len);
        return ret ? ret : lng.l_onoff ? lng.l_linger : 0;
    } else if (opts[opt].lvl == F_GETFL) {
        return !!(fcntl(skt, F_GETFL, 0) & opts[opt].opt);
    } else {
        len = sizeof val;
        ret = getsockopt(skt, opts[opt].lvl, opts[opt].opt, (char*)&val, &len);
        return ret ? ret : val;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movl %edi, %ebx
callq 0x5d1c
cmpl $0x8, %ebp
jb 0x6a3b
callq 0x3040
movl $0x16, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x6acf
cmpl $0x6, %ebp
jne 0x6a79
leaq 0x14(%rsp), %r8
movl $0x8, (%r8)
leaq 0xc(%rsp), %r14
movl %ebx, %edi
movl $0x1, %esi
movl $0xd, %edx
movq %r14, %rcx
callq 0x3230
movl %eax, %ecx
movl (%r14), %eax
testl %eax, %eax
je 0x6a72
movl 0x10(%rsp), %eax
testl %ecx, %ecx
cmovnel %ecx, %eax
jmp 0x6acf
movl %ebp, %r14d
leaq 0x215d(%rip), %r15      # 0x8be0
movl (%r15,%r14,8), %esi
cmpl $0x3, %esi
jne 0x6aaa
movl %ebx, %edi
movl $0x3, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x31d0
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, 0x4(%r15,%r14,8)
setne %al
jmp 0x6acf
leaq 0x14(%rsp), %r8
movl $0x4, (%r8)
movl 0x4(%r15,%r14,8), %edx
leaq 0xc(%rsp), %rcx
movl %ebx, %edi
callq 0x3230
testl %eax, %eax
jne 0x6acf
movl 0xc(%rsp), %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ctSkennerton[P]fxtract/util/sock.c
// Function: sock_addr
int
sock_addr(int skt, IPSTR ip, int *pport, char *name, int size)
{
    dyninit();

    INxADDR sin;
    socklen_t len = sizeof(sin);
    if (0 > getsockname(skt, (SOADDR*)&sin, &len))
        return -1;

    ininfo(&sin, ip, pport);
    return -(name && size
             && getnameinfo((SOADDR*) &sin, len, name, size, NULL, 0, 0));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movl %r8d, %ebx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movl %edi, %ebp
callq 0x5d1c
leaq 0x10(%rsp), %rdx
movl $0x1c, (%rdx)
leaq 0x14(%rsp), %rsi
movl %ebp, %edi
callq 0x32d0
testl %eax, %eax
js 0x6b60
leaq 0x14(%rsp), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x6b76
testq %r14, %r14
sete %al
testl %ebx, %ebx
sete %cl
xorl %r15d, %r15d
orb %al, %cl
jne 0x6b66
movl 0x10(%rsp), %esi
movl $0x0, (%rsp)
xorl %r15d, %r15d
leaq 0x14(%rsp), %rdi
movq %r14, %rdx
movl %ebx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x31e0
negl %eax
sbbl %r15d, %r15d
jmp 0x6b66
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movl %r15d, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ctSkennerton[P]fxtract/util/sock.c
// Function: ininfo
static void
ininfo(INxADDR const*xp, IPSTR ip, int *pport)
{
    if (pport) *pport = ntohs(xp->inx_port);
    if (ip) inet_ntop(AF_INET,
                      xp->inx_family == AF_INET ? (void const*)&xp->in4.sin_addr
                                                : (void const*)&xp->in6.sin6_addr,
                      ip, sizeof(IPSTR));
}

// Assembly:
movq %rsi, %rax
testq %rdx, %rdx
je 0x6b8b
movzwl 0x2(%rdi), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
movl %ecx, (%rdx)
testq %rax, %rax
je 0x6bb3
xorl %ecx, %ecx
cmpw $0x2, (%rdi)
setne %cl
leaq (%rdi,%rcx,4), %rsi
addq $0x4, %rsi
movl $0x2, %edi
movq %rax, %rdx
movl $0x2e, %ecx
jmp 0x3310
retq
// File: /workspace/github_cpp_makefile_star2_O3/ctSkennerton[P]fxtract/util/sock.c
// Function: sock_peer
int
sock_peer(int skt, IPSTR ip, int *pport, char *name, int size)
{
    dyninit();

    INxADDR sin;
    socklen_t len = sizeof(sin);
    if (0 > getpeername(skt, (SOADDR*)&sin, &len)) return -1;

    ininfo(&sin, ip, pport);
    return -(name && size &&
             getnameinfo((SOADDR*)&sin, len, name, size, NULL, 0,
                          NI_NAMEREQD + NI_NOFQDN));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movl %r8d, %ebx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movl %edi, %ebp
callq 0x5d1c
leaq 0x10(%rsp), %rdx
movl $0x1c, (%rdx)
leaq 0x14(%rsp), %rsi
movl %ebp, %edi
callq 0x3210
testl %eax, %eax
js 0x6c3a
leaq 0x14(%rsp), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x6b76
testq %r14, %r14
sete %al
testl %ebx, %ebx
sete %cl
xorl %r15d, %r15d
orb %al, %cl
jne 0x6c40
movl 0x10(%rsp), %esi
movl $0xc, (%rsp)
xorl %r15d, %r15d
leaq 0x14(%rsp), %rdi
movq %r14, %rdx
movl %ebx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x31e0
negl %eax
sbbl %r15d, %r15d
jmp 0x6c40
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movl %r15d, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ctSkennerton[P]fxtract/util/sock.c
// Function: udp_open
int
udp_open(IPSTR const ip, int port)
{
    dyninit();

    if (port & -65536) return errno = EINVAL, -1;

    INxADDR addr;
    int addrlen = ininit(&addr, ip, port);
    if (addrlen < 0) return addrlen;

    int fd = socket(addr.inx_family, SOCK_DGRAM | sock_cloexec, IPPROTO_UDP);
    return fd >= 0 && ((!sock_cloexec && fcntl(fd, F_SETFD, FD_CLOEXEC))
                       || (port && bind(fd, (SOADDR*)&addr, addrlen))
                      ) ? eclose(fd) : fd;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebp
movq %rdi, %rbx
callq 0x5d1c
cmpl $0x10000, %ebp          # imm = 0x10000
jae 0x6ccc
leaq 0xc(%rsp), %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x5ef5
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x6cdc
movl %eax, %r14d
movzwl 0xc(%rsp), %edi
movl 0x5bde(%rip), %esi      # 0xc870
orl $0x2, %esi
movl $0x11, %edx
callq 0x30a0
movl %eax, %r15d
testl %eax, %eax
js 0x6cc7
cmpl $0x0, 0x5bc3(%rip)      # 0xc870
je 0x6ce9
testl %ebp, %ebp
je 0x6cc7
leaq 0xc(%rsp), %rsi
movl %r15d, %edi
movl %r14d, %edx
callq 0x3070
testl %eax, %eax
jne 0x6d01
movl %r15d, %ebx
jmp 0x6cdc
callq 0x3040
movl $0x16, (%rax)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %r15d, %edi
movl $0x2, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x31d0
testl %eax, %eax
je 0x6caf
movl %r15d, %edi
callq 0x5fc2
jmp 0x6cdc
// File: /workspace/github_cpp_makefile_star2_O3/ctSkennerton[P]fxtract/util/sock.c
// Function: udp_recv
int
udp_recv(int fd, char *buf, int size, IPSTR ip, int *port)
{
    dyninit();

    INxADDR     addr;
    socklen_t   addrlen = sizeof(addr);
    int         len;

    do len = recvfrom(fd, buf, size, /*flags*/0, (SOADDR*)&addr, &addrlen);
    while (len < 0 && errno == EINTR);
    if (len >= 0) ininfo(&addr, ip, port);
    return len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
movl %edx, %ebx
movq %rsi, %r15
movl %edi, %ebp
callq 0x5d1c
leaq 0x18(%rsp), %r12
movl $0x1c, (%r12)
movslq %ebx, %r13
leaq 0x1c(%rsp), %rbx
movl %ebp, %edi
movq %r15, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
movq %rbx, %r8
movq %r12, %r9
callq 0x3240
movq %rax, %r14
testl %r14d, %r14d
jns 0x6d6d
callq 0x3040
cmpl $0x4, (%rax)
je 0x6d44
jmp 0x6d81
leaq 0x1c(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
callq 0x6b76
movl %r14d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ctSkennerton[P]fxtract/util/sock.c
// Function: udp_send
int
udp_send(int fd, char const *buf, int size, IPSTR const ip, int port)
{
    dyninit();

    INxADDR addr;
    int ret, addrlen = ininit(&addr, ip, port);
    do errno = 0, ret = sendto(fd, buf, size, /*flags*/0, (SOADDR const*) &addr, addrlen);
    while (ret < 0 && errno == EINTR);

    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r8d, %r15d
movq %rcx, %r12
movl %edx, %r13d
movq %rsi, %rbx
movl %edi, %ebp
callq 0x5d1c
leaq 0xc(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
movl %r15d, %edx
callq 0x5ef5
movl %eax, %r15d
callq 0x3040
movq %rax, %r12
movslq %r13d, %r13
movl $0x0, (%r12)
movl %ebp, %edi
movq %rbx, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
movq %r14, %r8
movl %r15d, %r9d
callq 0x3050
testl %eax, %eax
jns 0x6dfd
cmpl $0x4, (%r12)
je 0x6dd5
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/sokolcom[P]tp-blockchain-task06/uint256_t/uint128_t.cpp
// Function: uint128_t::ConvertToUint64(char const*) const
uint64_t uint128_t::ConvertToUint64(const char *s) const {
    int count = 0;
    uint64_t val = 0;
    while (count < 16) {
        uint8_t hv = HexToInt(&s[count++]);
        if (hv == 0xFF)
            break;

        val = (val << 4) | hv;
    }
    return val;
}

// Assembly:
xorl %ecx, %ecx
xorl %edx, %edx
movq %rdx, %rax
cmpq $0x10, %rcx
je 0x2555
movb (%rsi,%rcx), %dl
leal -0x30(%rdx), %edi
cmpb $0xa, %dil
jb 0x253b
leal -0x61(%rdx), %edi
cmpb $0x5, %dil
ja 0x252d
addb $-0x57, %dl
jmp 0x2539
leal -0x41(%rdx), %edi
cmpb $0x5, %dil
ja 0x2555
addb $-0x37, %dl
movl %edx, %edi
movq %rax, %r8
shlq $0x4, %r8
movzbl %dil, %edi
movq %rdi, %rdx
orq %r8, %rdx
incq %rcx
cmpb $-0x1, %dil
jne 0x250a
retq
// File: /workspace/github_cpp_makefile_star2_O3/sokolcom[P]tp-blockchain-task06/uint256_t/uint128_t.cpp
// Function: uint128_t::HexToInt(char const*) const
uint8_t uint128_t::HexToInt(const char *s) const {
    uint8_t ret = 0xFF;
    if (*s >= '0' && *s <= '9') {
        ret = uint8_t(*s - '0');
    }
    else if (*s >= 'a' && *s <= 'f') {
        ret = uint8_t(*s - 'a' + 10);
    }
    else if (*s >= 'A' && *s <= 'F') {
        ret = uint8_t(*s - 'A' + 10);
    }
    return ret;
}

// Assembly:
movb (%rsi), %cl
leal -0x30(%rcx), %eax
cmpb $0xa, %al
jb 0x256b
leal -0x61(%rcx), %eax
cmpb $0x5, %al
ja 0x256c
addb $-0x57, %cl
movl %ecx, %eax
retq
leal -0x41(%rcx), %eax
addb $-0x37, %cl
cmpb $0x6, %al
movzbl %cl, %ecx
movl $0xff, %eax
cmovbl %ecx, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/sokolcom[P]tp-blockchain-task06/uint256_t/uint128_t.cpp
// Function: uint128_t::operator<<(uint128_t const&) const
uint128_t uint128_t::operator<<(const uint128_t & rhs) const{
    const uint64_t shift = rhs.LOWER;
    if (((bool) rhs.UPPER) || (shift >= 128)){
        return uint128_0;
    }
    else if (shift == 64){
        return uint128_t(LOWER, 0);
    }
    else if (shift == 0){
        return *this;
    }
    else if (shift < 64){
        return uint128_t((UPPER << shift) + (LOWER >> (64 - shift)), LOWER << shift);
    }
    else if ((128 > shift) && (shift > 64)){
        return uint128_t(LOWER << (shift - 64), 0);
    }
    else{
        return uint128_0;
    }
}

// Assembly:
movq (%rsi), %r8
cmpq $0x0, 0x8(%rsi)
setne %al
cmpq $0x7f, %r8
seta %cl
orb %al, %cl
je 0x2637
xorl %eax, %eax
xorl %edx, %edx
retq
testq %r8, %r8
je 0x2647
cmpq $0x40, %r8
jne 0x264f
movq (%rdi), %rdx
jmp 0x2679
movq (%rdi), %rax
movq 0x8(%rdi), %rdx
retq
jae 0x2670
movq (%rdi), %rax
movq 0x8(%rdi), %rsi
movl %r8d, %ecx
shlq %cl, %rsi
negb %cl
movq %rax, %rdx
shrq %cl, %rdx
addq %rsi, %rdx
movl %r8d, %ecx
shlq %cl, %rax
retq
movq (%rdi), %rdx
movl %r8d, %ecx
shlq %cl, %rdx
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/sokolcom[P]tp-blockchain-task06/uint256_t/uint128_t.cpp
// Function: uint128_t::operator>>(uint128_t const&) const
uint128_t uint128_t::operator>>(const uint128_t & rhs) const{
    const uint64_t shift = rhs.LOWER;
    if (((bool) rhs.UPPER) || (shift >= 128)){
        return uint128_0;
    }
    else if (shift == 64){
        return uint128_t(0, UPPER);
    }
    else if (shift == 0){
        return *this;
    }
    else if (shift < 64){
        return uint128_t(UPPER >> shift, (UPPER << (64 - shift)) + (LOWER >> shift));
    }
    else if ((128 > shift) && (shift > 64)){
        return uint128_t(0, (UPPER >> (shift - 64)));
    }
    else{
        return uint128_0;
    }
}

// Assembly:
movq (%rsi), %r8
cmpq $0x0, 0x8(%rsi)
setne %al
cmpq $0x7f, %r8
seta %cl
orb %al, %cl
je 0x26ac
xorl %eax, %eax
jmp 0x26bb
testq %r8, %r8
je 0x26be
cmpq $0x40, %r8
jne 0x26c6
movq 0x8(%rdi), %rax
xorl %edx, %edx
retq
movq (%rdi), %rax
movq 0x8(%rdi), %rdx
retq
movq 0x8(%rdi), %rsi
jae 0x26e7
movq %rsi, %rdx
movl %r8d, %ecx
shrq %cl, %rdx
negb %cl
shlq %cl, %rsi
movq (%rdi), %rax
movl %r8d, %ecx
shrq %cl, %rax
addq %rsi, %rax
retq
movl %r8d, %ecx
shrq %cl, %rsi
xorl %edx, %edx
movq %rsi, %rax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/sokolcom[P]tp-blockchain-task06/uint256_t/uint128_t.cpp
// Function: uint128_t::ConvertToVector(std::vector<unsigned char, std::allocator<unsigned char>>&, unsigned long const&) const
void uint128_t::ConvertToVector(std::vector<uint8_t> & ret, const uint64_t & val) const {
    ret.push_back(static_cast<uint8_t>(val >> 56));
    ret.push_back(static_cast<uint8_t>(val >> 48));
    ret.push_back(static_cast<uint8_t>(val >> 40));
    ret.push_back(static_cast<uint8_t>(val >> 32));
    ret.push_back(static_cast<uint8_t>(val >> 24));
    ret.push_back(static_cast<uint8_t>(val >> 16));
    ret.push_back(static_cast<uint8_t>(val >> 8));
    ret.push_back(static_cast<uint8_t>(val));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movb 0x7(%rdx), %al
leaq 0x7(%rsp), %rsi
movb %al, (%rsi)
movq %rbx, %rdi
callq 0x33c2
movb 0x6(%r14), %al
leaq 0x6(%rsp), %rsi
movb %al, (%rsi)
movq %rbx, %rdi
callq 0x33c2
movb 0x5(%r14), %al
leaq 0x5(%rsp), %rsi
movb %al, (%rsi)
movq %rbx, %rdi
callq 0x33c2
movb 0x4(%r14), %al
leaq 0x4(%rsp), %rsi
movb %al, (%rsi)
movq %rbx, %rdi
callq 0x33c2
movb 0x3(%r14), %al
leaq 0x3(%rsp), %rsi
movb %al, (%rsi)
movq %rbx, %rdi
callq 0x33c2
movb 0x2(%r14), %al
leaq 0x2(%rsp), %rsi
movb %al, (%rsi)
movq %rbx, %rdi
callq 0x33c2
movb 0x1(%r14), %al
leaq 0x1(%rsp), %rsi
movb %al, (%rsi)
movq %rbx, %rdi
callq 0x33c2
movb (%r14), %al
movq %rsp, %rsi
movb %al, (%rsi)
movq %rbx, %rdi
callq 0x33c2
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/sokolcom[P]tp-blockchain-task06/uint256_t/uint128_t.cpp
// Function: uint128_t::bits() const
uint8_t uint128_t::bits() const{
    uint8_t out = 0;
    if (UPPER){
        out = 64;
        uint64_t up = UPPER;
        while (up){
            up >>= 1;
            out++;
        }
    }
    else{
        uint64_t low = LOWER;
        while (low){
            low >>= 1;
            out++;
        }
    }
    return out;
}

// Assembly:
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x2c3e
bsrq %rax, %rcx
xorl $0x3f, %ecx
movb $-0x80, %al
jmp 0x2c4f
movq (%rdi), %rax
testq %rax, %rax
je 0x2c52
bsrq %rax, %rcx
xorl $0x3f, %ecx
movb $0x40, %al
subb %cl, %al
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/sokolcom[P]tp-blockchain-task06/uint256_t/uint128_t.cpp
// Function: operator<<(std::ostream&, uint128_t const&)
std::ostream & operator<<(std::ostream & stream, const uint128_t & rhs){
    if (stream.flags() & stream.oct){
        stream << rhs.str(8);
    }
    else if (stream.flags() & stream.dec){
        stream << rhs.str(10);
    }
    else if (stream.flags() & stream.hex){
        stream << rhs.str(16);
    }
    return stream;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq (%rdi), %rax
movq -0x18(%rax), %rax
movl 0x18(%rdi,%rax), %eax
testb $0x40, %al
jne 0x3297
testb $0x2, %al
jne 0x32c5
testb $0x8, %al
je 0x330c
leaq 0x4(%rsp), %rcx
movl $0x0, (%rcx)
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x10, %edx
callq 0x2d7c
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x2160
jmp 0x32f1
leaq 0x4(%rsp), %rcx
movl $0x0, (%rcx)
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x8, %edx
callq 0x2d7c
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x2160
jmp 0x32f1
leaq 0x4(%rsp), %rcx
movl $0x0, (%rcx)
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0xa, %edx
callq 0x2d7c
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x2160
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x330c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2150
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
jmp 0x331b
jmp 0x331b
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3339
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2150
movq %rbx, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O3/sokolcom[P]tp-blockchain-task06/uint256_t/uint256_t.cpp
// Function: uint256_t::init(char const*)
void uint256_t::init(const char * s) {
    //create from string
    char buffer[64];
    if (s == NULL) { uint256_t(); return; }
    if (s[1] == 'x')
        s += 2;
    else if (*s == 'x')
        s++;

    int len = strlen(s);
    int padLength = 0;
    if (len < 64) {
        padLength = 64 - len;
        memset(buffer, '0', padLength);
    }

    memcpy(buffer + padLength, s, len);

    UPPER = uint128_t(buffer);
    LOWER = uint128_t(buffer + 32);
}

// Assembly:
testq %rsi, %rsi
je 0x3638
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x78, 0x1(%rsi)
jne 0x35ae
addq $0x2, %r14
jmp 0x35ba
leaq 0x1(%r14), %rax
cmpb $0x78, (%r14)
cmoveq %rax, %r14
movq %r14, %rdi
callq 0x20a0
movq %rax, %r15
cmpl $0x3f, %r15d
jg 0x35e8
movl $0x40, %r12d
subl %r15d, %r12d
leaq 0x10(%rsp), %rdi
movl $0x30, %esi
movq %r12, %rdx
callq 0x20d0
jmp 0x35eb
xorl %r12d, %r12d
leaq (%rsp,%r12), %rdi
addq $0x10, %rdi
movslq %r15d, %rdx
movq %r14, %rsi
callq 0x2120
movq %rsp, %r14
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x24f0
movups (%r14), %xmm0
movups %xmm0, 0x10(%rbx)
leaq 0x30(%rsp), %rsi
movq %rsp, %r14
movq %r14, %rdi
callq 0x24f0
movups (%r14), %xmm0
movups %xmm0, (%rbx)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/sokolcom[P]tp-blockchain-task06/uint256_t/uint256_t.cpp
// Function: uint256_t::init_from_base(char const*, unsigned char)
void uint256_t::init_from_base(const char * s, uint8_t base) {
    *this = 0;

    uint256_t power(1);
    uint8_t digit;
    int pos = strlen(s) - 1;
    while(pos >= 0) {
        digit = 0;
        if('0' <= s[pos] && s[pos] <= '9') {
            digit = s[pos] - '0';
        } else if('a' <= s[pos] && s[pos] <= 'z') {
            digit = s[pos] - 'a' + 10;
        }
        *this += digit * power;
        pos--;
        power *= base;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %edx, %r15d
leaq 0x49a5(%rip), %rax      # 0x8008
movups (%rax), %xmm0
movups %xmm0, 0x10(%rdi)
xorps %xmm0, %xmm0
movq %rdi, 0x10(%rsp)
movups %xmm0, (%rdi)
movq $0x1, 0x20(%rsp)
movq $0x0, 0x28(%rsp)
movups (%rax), %xmm0
movups %xmm0, 0x30(%rsp)
movq %rsi, 0x18(%rsp)
movq %rsi, %rdi
callq 0x20a0
decl %eax
js 0x3769
movzbl %r15b, %ecx
movq %rcx, 0x8(%rsp)
movl %eax, %ebx
incq %rbx
xorl %r14d, %r14d
leaq 0x68(%rsp), %r15
leaq 0x20(%rsp), %r12
leaq 0x48(%rsp), %r13
movq 0x18(%rsp), %rax
movb -0x1(%rax,%rbx), %al
leal -0x30(%rax), %ecx
leal -0x61(%rax), %edx
addb $-0x57, %al
cmpb $0x1a, %dl
movzbl %al, %eax
cmovael %r14d, %eax
cmpb $0xa, %cl
movzbl %cl, %ecx
cmovael %eax, %ecx
movzbl %cl, %eax
movq %rax, 0x48(%rsp)
movq %r14, 0x50(%rsp)
leaq 0x490c(%rip), %rbp      # 0x8008
movups (%rbp), %xmm0
leaq 0x58(%rsp), %rax
movups %xmm0, (%rax)
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x4576
movq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x37a0
movq 0x8(%rsp), %rax
movq %rax, 0x68(%rsp)
movq %r14, 0x70(%rsp)
movups (%rbp), %xmm0
leaq 0x78(%rsp), %rax
movups %xmm0, (%rax)
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x4576
movups 0x48(%rsp), %xmm0
movups 0x58(%rsp), %xmm1
movaps %xmm1, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
decq %rbx
jg 0x36c4
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/sokolcom[P]tp-blockchain-task06/uint256_t/uint256_t.cpp
// Function: uint256_t::operator<<(uint256_t const&) const
uint256_t uint256_t::operator<<(const uint256_t & rhs) const{
    const uint128_t shift = rhs.LOWER;
    if (((bool) rhs.UPPER) || (shift >= uint128_256)){
        return uint256_0;
    }
    else if (shift == uint128_128){
        return uint256_t(LOWER, uint128_0);
    }
    else if (shift == uint128_0){
        return *this;
    }
    else if (shift < uint128_128){
        return uint256_t((UPPER << shift) + (LOWER >> (uint128_128 - shift)), LOWER << shift);
    }
    else if ((uint128_256 > shift) && (shift > uint128_128)){
        return uint256_t(LOWER << (shift - uint128_128), uint128_0);
    }
    else{
        return uint256_0;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movups (%rdx), %xmm0
movaps %xmm0, (%rsp)
leaq 0x10(%rdx), %rdi
callq 0x2592
testb %al, %al
jne 0x3b4e
leaq 0x9646(%rip), %rsi      # 0xd188
movq %rsp, %rdi
callq 0x27a8
testb %al, %al
je 0x3b74
movups 0x9653(%rip), %xmm0     # 0xd1a8
movups %xmm0, 0x10(%rbx)
movups 0x9638(%rip), %xmm0     # 0xd198
movups %xmm0, (%rbx)
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x95fd(%rip), %rsi      # 0xd178
movq %rsp, %rdi
callq 0x2744
testb %al, %al
je 0x3b9e
leaq 0x447a(%rip), %rax      # 0x8008
movups (%rax), %xmm0
movups %xmm0, (%rbx)
movups (%r14), %xmm0
movups %xmm0, 0x10(%rbx)
jmp 0x3b63
leaq 0x4463(%rip), %r15      # 0x8008
movq %rsp, %rdi
movq %r15, %rsi
callq 0x2744
testb %al, %al
je 0x3bc3
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x10(%rbx)
jmp 0x3b60
leaq 0x95ae(%rip), %rsi      # 0xd178
movq %rsp, %rdi
callq 0x278c
testb %al, %al
je 0x3c4f
leaq 0x10(%r14), %rdi
movq %rsp, %r15
movq %r15, %rsi
callq 0x261c
leaq 0x10(%rsp), %r12
movq %rax, (%r12)
movq %rdx, 0x8(%r12)
leaq 0x957e(%rip), %rdi      # 0xd178
movq %r15, %rsi
callq 0x2802
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
movq %rdx, 0x8(%rsi)
movq %r14, %rdi
callq 0x2692
leaq 0x30(%rsp), %rsi
movq %rax, (%rsi)
movq %rdx, 0x8(%rsi)
movq %r12, %rdi
callq 0x27e0
movq %rax, %r12
movq %rdx, %r13
movq %r14, %rdi
movq %r15, %rsi
callq 0x261c
movq %rax, (%rbx)
movq %rdx, 0x8(%rbx)
movq %r12, 0x10(%rbx)
movq %r13, 0x18(%rbx)
jmp 0x3b63
leaq 0x9532(%rip), %rdi      # 0xd188
movq %rsp, %rsi
callq 0x2770
testb %al, %al
je 0x3b4e
leaq 0x950b(%rip), %rsi      # 0xd178
movq %rsp, %rdi
callq 0x2770
testb %al, %al
je 0x3b4e
leaq 0x94f4(%rip), %rsi      # 0xd178
movq %rsp, %rdi
callq 0x2802
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movq %rdx, 0x8(%rsi)
movq %r14, %rdi
callq 0x261c
movups (%r15), %xmm0
movups %xmm0, (%rbx)
movq %rax, 0x10(%rbx)
movq %rdx, 0x18(%rbx)
jmp 0x3b63