LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: 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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
callq 0x8020
leaq -0x1f(%rbp), %rdi
movl -0x14(%rbp), %eax
movzwl %ax, %edx
leaq 0x33c8(%rip), %rsi      # 0xbba0
movb $0x0, %al
callq 0x3090
leaq -0x58(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x31c0
movl $0x400, -0x58(%rbp)     # imm = 0x400
movl $0x1, -0x50(%rbp)
movl $0x6, -0x4c(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x1f(%rbp), %rsi
leaq -0x58(%rbp), %rdx
leaq -0x28(%rbp), %rcx
callq 0x33f0
cmpl $0x0, %eax
je 0x882a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x890b
movq -0x28(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x8310
movl %eax, -0x5c(%rbp)
movl $0xffffffff, -0x60(%rbp) # imm = 0xFFFFFFFF
cmpl $0x0, -0x5c(%rbp)
jl 0x88d9
cmpl $0x0, -0x18(%rbp)
je 0x8867
movl -0x5c(%rbp), %edi
movl $0x2, %esi
movl $0x1, %edx
callq 0x8920
cmpl $0x0, %eax
jne 0x88d9
movl -0x5c(%rbp), %edi
movl $0x1, %esi
movl $0x2, %edx
leaq -0x5c(%rbp), %rcx
movl $0x4, %r8d
callq 0x3500
cmpl $0x0, %eax
jne 0x88d9
jmp 0x888a
callq 0x3040
movl $0x0, (%rax)
movl -0x5c(%rbp), %edi
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x28(%rbp), %rax
movl 0x10(%rax), %edx
movq -0x68(%rbp), %rsi
callq 0x3290
movl %eax, -0x60(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x60(%rbp)
movb %al, -0x69(%rbp)
jge 0x88d0
callq 0x3040
cmpl $0x4, (%rax)
sete %al
movb %al, -0x69(%rbp)
movb -0x69(%rbp), %al
testb $0x1, %al
jne 0x888a
jmp 0x88d9
movq -0x28(%rbp), %rdi
callq 0x3400
cmpl $0x0, -0x60(%rbp)
jge 0x88ff
callq 0x3040
cmpl $0x73, (%rax)
je 0x88ff
movl -0x5c(%rbp), %edi
callq 0x8390
movl %eax, -0x70(%rbp)
jmp 0x8905
movl -0x5c(%rbp), %eax
movl %eax, -0x70(%rbp)
movl -0x70(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
callq 0x8020
cmpl $0x8, -0xc(%rbp)
jb 0x8953
callq 0x3040
movl $0x16, (%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8a2b
cmpl $0x0, -0x10(%rbp)
setg %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x18(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x14(%rbp)
cmpl $0x6, -0xc(%rbp)
jne 0x8992
movl -0x8(%rbp), %edi
movl $0x1, %esi
movl $0xd, %edx
leaq -0x18(%rbp), %rcx
movl $0x8, %r8d
callq 0x3500
movl %eax, -0x1c(%rbp)
jmp 0x8a25
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0x6ef2(%rip), %rax      # 0xf890
cmpl $0x3, (%rax,%rcx,8)
jne 0x89eb
movl -0x8(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x8(%rbp), %edi
movl $0x3, %esi
xorl %edx, %edx
movb $0x0, %al
callq 0x31e0
movl %eax, %edi
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0x6ec7(%rip), %rax      # 0xf890
movl 0x4(%rax,%rcx,8), %esi
movl -0x10(%rbp), %edx
callq 0x9590
movl -0x24(%rbp), %edi
movl %eax, %edx
movl $0x4, %esi
movb $0x0, %al
callq 0x31e0
movl %eax, -0x20(%rbp)
jmp 0x8a1f
movl -0x8(%rbp), %edi
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0x6e96(%rip), %rax      # 0xf890
movl (%rax,%rcx,8), %esi
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0x6e87(%rip), %rax      # 0xf890
movl 0x4(%rax,%rcx,8), %edx
leaq -0x10(%rbp), %rcx
movl $0x4, %r8d
callq 0x3500
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
callq 0x8020
callq 0x3040
movl $0x0, (%rax)
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
movslq -0x14(%rbp), %rdx
xorl %ecx, %ecx
callq 0x3100
movl %eax, -0x18(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x18(%rbp)
movb %al, -0x19(%rbp)
jge 0x9080
callq 0x3040
cmpl $0x4, (%rax)
sete %al
movb %al, -0x19(%rbp)
movb -0x19(%rbp), %al
testb $0x1, %al
jne 0x9047
movl -0x18(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
// File: 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
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
callq 0x8020
callq 0x3040
movl $0x0, (%rax)
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
movslq -0x14(%rbp), %rdx
xorl %ecx, %ecx
callq 0x31a0
movl %eax, -0x18(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x18(%rbp)
movb %al, -0x19(%rbp)
jge 0x90e0
callq 0x3040
cmpl $0x4, (%rax)
sete %al
movb %al, -0x19(%rbp)
movb -0x19(%rbp), %al
testb $0x1, %al
jne 0x90a7
movl -0x18(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
// File: 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
movq %rsp, %rbp
subq $0xa0, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
callq 0x8020
movb $0x0, -0x15(%rbp)
movq 0x2898(%rip), %rax      # 0xbbc0
movq %rax, -0x30(%rbp)
movq 0x2895(%rip), %rax      # 0xbbc8
movq %rax, -0x28(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x20(%rbp)
leaq -0x15(%rbp), %rax
movq %rax, -0x50(%rbp)
movq $0x1, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movslq -0x14(%rbp), %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x88(%rbp)
movl $0x0, -0x80(%rbp)
leaq -0x50(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x88(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x98(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x10(%rbp)
movb %al, -0x8d(%rbp)
je 0x93a5
cmpl $0x0, -0x14(%rbp)
setne %al
movb %al, -0x8d(%rbp)
movq -0x98(%rbp), %rax
movb -0x8d(%rbp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq %rcx, (%rax)
leaq -0x30(%rbp), %rax
movq %rax, -0x68(%rbp)
movq $0x18, -0x60(%rbp)
movl $0x0, -0x58(%rbp)
callq 0x3040
movl $0x0, (%rax)
movl -0x4(%rbp), %edi
leaq -0x88(%rbp), %rsi
xorl %edx, %edx
callq 0x3260
movl %eax, -0x8c(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x8c(%rbp)
movb %al, -0x99(%rbp)
jge 0x941c
callq 0x3040
cmpl $0x4, (%rax)
sete %al
movb %al, -0x99(%rbp)
movb -0x99(%rbp), %al
testb $0x1, %al
jne 0x93d8
movslq -0x8c(%rbp), %rax
cmpl $0x0, -0x8c(%rbp)
setg %cl
andb $0x1, %cl
movzbl %cl, %ecx
movslq %ecx, %rcx
shlq $0x0, %rcx
subq %rcx, %rax
addq $0xa0, %rsp
popq %rbp
retq
// File: 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
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
callq 0x8020
cmpl $0x8, -0xc(%rbp)
jb 0x9480
callq 0x3040
movl $0x16, (%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x9578
cmpl $0x6, -0xc(%rbp)
jne 0x94de
movl $0x8, -0x18(%rbp)
movl -0x8(%rbp), %edi
movl $0x1, %esi
movl $0xd, %edx
leaq -0x20(%rbp), %rcx
leaq -0x18(%rbp), %r8
callq 0x3240
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0x94b8
movl -0x10(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x94d3
cmpl $0x0, -0x20(%rbp)
je 0x94c6
movl -0x1c(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0x94cd
xorl %eax, %eax
movl %eax, -0x28(%rbp)
jmp 0x94cd
movl -0x28(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x9578
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0x63a6(%rip), %rax      # 0xf890
cmpl $0x3, (%rax,%rcx,8)
jne 0x9525
movl -0x8(%rbp), %edi
movl $0x3, %esi
xorl %edx, %edx
movb $0x0, %al
callq 0x31e0
movl -0xc(%rbp), %ecx
movl %ecx, %edx
leaq 0x6383(%rip), %rcx      # 0xf890
andl 0x4(%rcx,%rdx,8), %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x9578
movl $0x4, -0x18(%rbp)
movl -0x8(%rbp), %edi
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0x6355(%rip), %rax      # 0xf890
movl (%rax,%rcx,8), %esi
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0x6346(%rip), %rax      # 0xf890
movl 0x4(%rax,%rcx,8), %edx
leaq -0x14(%rbp), %rcx
leaq -0x18(%rbp), %r8
callq 0x3240
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0x956c
movl -0x10(%rbp), %eax
movl %eax, -0x2c(%rbp)
jmp 0x9572
movl -0x14(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
callq 0x8020
movl $0x1c, -0x44(%rbp)
movl -0x8(%rbp), %edi
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rsi
leaq -0x44(%rbp), %rdx
callq 0x32e0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jle 0x9620
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x9682
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x40(%rbp), %rdi
callq 0x9690
xorl %eax, %eax
cmpq $0x0, -0x20(%rbp)
movb %al, -0x51(%rbp)
je 0x9673
xorl %eax, %eax
cmpl $0x0, -0x24(%rbp)
movb %al, -0x51(%rbp)
je 0x9673
movl -0x44(%rbp), %esi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
leaq -0x40(%rbp), %rdi
xorl %eax, %eax
movl %eax, %r8d
xorl %r9d, %r9d
movl $0x0, (%rsp)
callq 0x31f0
cmpl $0x0, %eax
setne %al
movb %al, -0x51(%rbp)
movb -0x51(%rbp), %al
andb $0x1, %al
movzbl %al, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x96c1
movq -0x8(%rbp), %rax
movzwl 0x2(%rax), %edi
callq 0x3510
movzwl %ax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
cmpq $0x0, -0x10(%rbp)
je 0x9705
movq -0x8(%rbp), %rax
movzwl (%rax), %eax
cmpl $0x2, %eax
jne 0x96e2
movq -0x8(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x20(%rbp)
jmp 0x96ee
movq -0x8(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdx
movl $0x2, %edi
movl $0x2e, %ecx
callq 0x3320
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
callq 0x8020
movl $0x1c, -0x44(%rbp)
movl -0x8(%rbp), %edi
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rsi
leaq -0x44(%rbp), %rdx
callq 0x3220
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jle 0x9760
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x97c2
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x40(%rbp), %rdi
callq 0x9690
xorl %eax, %eax
cmpq $0x0, -0x20(%rbp)
movb %al, -0x51(%rbp)
je 0x97b3
xorl %eax, %eax
cmpl $0x0, -0x24(%rbp)
movb %al, -0x51(%rbp)
je 0x97b3
movl -0x44(%rbp), %esi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
leaq -0x40(%rbp), %rdi
xorl %eax, %eax
movl %eax, %r8d
xorl %r9d, %r9d
movl $0xc, (%rsp)
callq 0x31f0
cmpl $0x0, %eax
setne %al
movb %al, -0x51(%rbp)
movb -0x51(%rbp), %al
andb $0x1, %al
movzbl %al, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
callq 0x8020
movl -0x14(%rbp), %eax
andl $0xffff0000, %eax       # imm = 0xFFFF0000
cmpl $0x0, %eax
je 0x9808
callq 0x3040
movl $0x16, (%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x98a6
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
leaq -0x30(%rbp), %rdi
callq 0x8250
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jge 0x9829
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x98a6
movzwl -0x30(%rbp), %edi
movl 0x609d(%rip), %esi      # 0xf8d0
orl $0x2, %esi
movl $0x11, %edx
callq 0x30b0
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
jl 0x989a
cmpl $0x0, 0x6080(%rip)      # 0xf8d0
jne 0x986b
movl -0x38(%rbp), %edi
movl $0x2, %esi
movl $0x1, %edx
movb $0x0, %al
callq 0x31e0
cmpl $0x0, %eax
jne 0x988d
cmpl $0x0, -0x14(%rbp)
je 0x989a
movl -0x38(%rbp), %edi
leaq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
movl -0x34(%rbp), %edx
movq -0x40(%rbp), %rsi
callq 0x3080
cmpl $0x0, %eax
je 0x989a
movl -0x38(%rbp), %edi
callq 0x8390
movl %eax, -0x44(%rbp)
jmp 0x98a0
movl -0x38(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nop
// File: 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
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
callq 0x8020
movl $0x1c, -0x48(%rbp)
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
movslq -0x14(%rbp), %rdx
leaq -0x44(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %r8
xorl %ecx, %ecx
leaq -0x48(%rbp), %r9
callq 0x3250
movl %eax, -0x4c(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x4c(%rbp)
movb %al, -0x59(%rbp)
jge 0x9914
callq 0x3040
cmpl $0x4, (%rax)
sete %al
movb %al, -0x59(%rbp)
movb -0x59(%rbp), %al
testb $0x1, %al
jne 0x98d6
cmpl $0x0, -0x4c(%rbp)
jl 0x9932
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x44(%rbp), %rdi
callq 0x9690
movl -0x4c(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
callq 0x8020
movq -0x20(%rbp), %rsi
movl -0x24(%rbp), %edx
leaq -0x40(%rbp), %rdi
callq 0x8250
movl %eax, -0x48(%rbp)
callq 0x3040
movl $0x0, (%rax)
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
movslq -0x14(%rbp), %rdx
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movl -0x48(%rbp), %r9d
movq -0x50(%rbp), %r8
xorl %ecx, %ecx
callq 0x3060
movl %eax, -0x44(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x44(%rbp)
movb %al, -0x51(%rbp)
jge 0x99bb
callq 0x3040
cmpl $0x4, (%rax)
sete %al
movb %al, -0x51(%rbp)
movb -0x51(%rbp), %al
testb $0x1, %al
jne 0x9972
movl -0x44(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: sokolcom[P]tp-blockchain-task06/uint256_t/uint128_t.cpp
// Function: uint128_t::init(char const*)
void uint128_t::init(const char *s) {
    if (s == NULL || s[0] == 0) { uint128_t(); return; }
    if (s[1] == 'x')
        s += 2;
    else if (*s == 'x')
        s++;

    UPPER = ConvertToUint64(s);
    LOWER = ConvertToUint64(s + 16);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x380b
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x381d
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x3100
jmp 0x387e
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x78, %eax
jne 0x3838
movq -0x10(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x10(%rbp)
jmp 0x3852
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x78, %eax
jne 0x3850
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x3852
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x38f0
movq -0x28(%rbp), %rdi
movq %rax, 0x8(%rdi)
movq -0x10(%rbp), %rsi
addq $0x10, %rsi
callq 0x38f0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x14(%rbp)
movq $0x0, -0x20(%rbp)
cmpl $0x10, -0x14(%rbp)
jge 0x395f
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
cltq
addq %rax, %rsi
callq 0x3970
movb %al, -0x21(%rbp)
movzbl -0x21(%rbp), %eax
cmpl $0xff, %eax
jne 0x394a
jmp 0x395f
movq -0x20(%rbp), %rax
shlq $0x4, %rax
movzbl -0x21(%rbp), %ecx
orq %rcx, %rax
movq %rax, -0x20(%rbp)
jmp 0x3917
movq -0x20(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $-0x1, -0x11(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jl 0x39a7
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x39, %eax
jg 0x39a7
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
subl $0x30, %eax
movb %al, -0x11(%rbp)
jmp 0x39fd
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x61, %eax
jl 0x39d1
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x66, %eax
jg 0x39d1
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
subl $0x61, %eax
addl $0xa, %eax
movb %al, -0x11(%rbp)
jmp 0x39fb
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x41, %eax
jl 0x39f9
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x46, %eax
jg 0x39f9
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
subl $0x41, %eax
addl $0xa, %eax
movb %al, -0x11(%rbp)
jmp 0x39fb
jmp 0x39fd
movb -0x11(%rbp), %al
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x3d18
cmpq $0x80, -0x28(%rbp)
jb 0x3d33
movq 0x124f1(%rip), %rax     # 0x16210
movq %rax, -0x10(%rbp)
movq 0x124ee(%rip), %rax     # 0x16218
movq %rax, -0x8(%rbp)
jmp 0x3e23
cmpq $0x40, -0x28(%rbp)
jne 0x3d57
movq -0x58(%rbp), %rsi
movl $0x0, -0x2c(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x2c(%rbp), %rdx
callq 0x5950
jmp 0x3e23
cmpq $0x0, -0x28(%rbp)
jne 0x3d76
movq -0x58(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x10(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x3e23
cmpq $0x40, -0x28(%rbp)
jae 0x3dcb
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x28(%rbp), %rcx
shlq %cl, %rdx
movq %rdx, -0x60(%rbp)
movq (%rax), %rdx
movl $0x40, %ecx
subq -0x28(%rbp), %rcx
shrq %cl, %rdx
movq -0x60(%rbp), %rcx
addq %rdx, %rcx
movq %rcx, -0x38(%rbp)
movq (%rax), %rax
movq -0x28(%rbp), %rcx
shlq %cl, %rax
movq %rax, -0x40(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x5920
jmp 0x3e23
movl $0x80, %eax
cmpq -0x28(%rbp), %rax
jbe 0x3e0d
cmpq $0x40, -0x28(%rbp)
jbe 0x3e0d
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq -0x28(%rbp), %rcx
subq $0x40, %rcx
shlq %cl, %rax
movq %rax, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x48(%rbp), %rsi
leaq -0x4c(%rbp), %rdx
callq 0x5950
jmp 0x3e23
movq 0x123fc(%rip), %rax     # 0x16210
movq %rax, -0x10(%rbp)
movq 0x123f9(%rip), %rax     # 0x16218
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x3ec8
cmpq $0x80, -0x28(%rbp)
jb 0x3ee3
movq 0x12341(%rip), %rax     # 0x16210
movq %rax, -0x10(%rbp)
movq 0x1233e(%rip), %rax     # 0x16218
movq %rax, -0x8(%rbp)
jmp 0x3fdb
cmpq $0x40, -0x28(%rbp)
jne 0x3f0b
movq -0x58(%rbp), %rdx
movl $0x0, -0x2c(%rbp)
addq $0x8, %rdx
leaq -0x10(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x5980
jmp 0x3fdb
cmpq $0x0, -0x28(%rbp)
jne 0x3f2a
movq -0x58(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x10(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x3fdb
cmpq $0x40, -0x28(%rbp)
jae 0x3f82
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x28(%rbp), %rcx
shrq %cl, %rdx
movq %rdx, %rcx
movq %rcx, -0x38(%rbp)
movq 0x8(%rax), %rax
movl $0x40, %ecx
subq -0x28(%rbp), %rcx
shlq %cl, %rax
movq -0x58(%rbp), %rcx
movq (%rcx), %rdx
movq -0x28(%rbp), %rcx
shrq %cl, %rdx
movq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x5920
jmp 0x3fdb
movl $0x80, %eax
cmpq -0x28(%rbp), %rax
jbe 0x3fc5
cmpq $0x40, -0x28(%rbp)
jbe 0x3fc5
movq -0x58(%rbp), %rax
movl $0x0, -0x44(%rbp)
movq 0x8(%rax), %rax
movq -0x28(%rbp), %rcx
subq $0x40, %rcx
shrq %cl, %rax
movq %rax, -0x50(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x44(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x5980
jmp 0x3fdb
movq 0x12244(%rip), %rax     # 0x16210
movq %rax, -0x10(%rbp)
movq 0x12241(%rip), %rax     # 0x16218
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
shrq $0x38, %rax
movb %al, -0x19(%rbp)
leaq -0x19(%rbp), %rsi
callq 0x59b0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
shrq $0x30, %rax
movb %al, -0x1a(%rbp)
leaq -0x1a(%rbp), %rsi
callq 0x59b0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
shrq $0x28, %rax
movb %al, -0x1b(%rbp)
leaq -0x1b(%rbp), %rsi
callq 0x59b0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
shrq $0x20, %rax
movb %al, -0x1c(%rbp)
leaq -0x1c(%rbp), %rsi
callq 0x59b0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
shrq $0x18, %rax
movb %al, -0x1d(%rbp)
leaq -0x1d(%rbp), %rsi
callq 0x59b0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
shrq $0x10, %rax
movb %al, -0x1e(%rbp)
leaq -0x1e(%rbp), %rsi
callq 0x59b0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
shrq $0x8, %rax
movb %al, -0x1f(%rbp)
leaq -0x1f(%rbp), %rsi
callq 0x59b0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
movb %al, -0x20(%rbp)
leaq -0x20(%rbp), %rsi
callq 0x59b0
addq $0x20, %rsp
popq %rbp
retq
nop
// File: 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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movb $0x0, -0x9(%rbp)
cmpq $0x0, 0x8(%rax)
je 0x4b69
movq -0x28(%rbp), %rax
movb $0x40, -0x9(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x4b67
movq -0x18(%rbp), %rax
shrq %rax
movq %rax, -0x18(%rbp)
movb -0x9(%rbp), %al
addb $0x1, %al
movb %al, -0x9(%rbp)
jmp 0x4b4b
jmp 0x4b92
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x4b90
movq -0x20(%rbp), %rax
shrq %rax
movq %rax, -0x20(%rbp)
movb -0x9(%rbp), %al
addb $0x1, %al
movb %al, -0x9(%rbp)
jmp 0x4b74
jmp 0x4b92
movb -0x9(%rbp), %al
popq %rbp
retq
nopw (%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq (%rdi), %rax
addq -0x18(%rax), %rdi
callq 0x5f30
movl %eax, %edi
movl $0x40, %esi
callq 0x5f10
cmpl $0x0, %eax
je 0x57a0
movq -0x8(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rsi
movl $0x0, -0x34(%rbp)
leaq -0x30(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
movl $0x8, %edx
leaq -0x34(%rbp), %rcx
callq 0x4e20
movq -0xa8(%rbp), %rdi
movq -0xa0(%rbp), %rsi
callq 0x31f0
jmp 0x5778
leaq -0x30(%rbp), %rdi
callq 0x3140
jmp 0x58c7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3140
jmp 0x58d4
movq -0x8(%rbp), %rdi
movq (%rdi), %rax
addq -0x18(%rax), %rdi
callq 0x5f30
movl %eax, %edi
movl $0x2, %esi
callq 0x5f10
cmpl $0x0, %eax
je 0x582d
movq -0x8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x10(%rbp), %rsi
movl $0x0, -0x6c(%rbp)
leaq -0x68(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
movl $0xa, %edx
leaq -0x6c(%rbp), %rcx
callq 0x4e20
movq -0xb8(%rbp), %rdi
movq -0xb0(%rbp), %rsi
callq 0x31f0
jmp 0x5805
leaq -0x68(%rbp), %rdi
callq 0x3140
jmp 0x58c5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x3140
jmp 0x58d4
movq -0x8(%rbp), %rdi
movq (%rdi), %rax
addq -0x18(%rax), %rdi
callq 0x5f30
movl %eax, %edi
movl $0x8, %esi
callq 0x5f10
cmpl $0x0, %eax
je 0x58c3
movq -0x8(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x10(%rbp), %rsi
movl $0x0, -0x94(%rbp)
leaq -0x90(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
movl $0x10, %edx
leaq -0x94(%rbp), %rcx
callq 0x4e20
movq -0xc8(%rbp), %rdi
movq -0xc0(%rbp), %rsi
callq 0x31f0
jmp 0x589b
leaq -0x90(%rbp), %rdi
callq 0x3140
jmp 0x58c3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x3140
jmp 0x58d4
jmp 0x58c5
jmp 0x58c7
movq -0x8(%rbp), %rax
addq $0xd0, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x3380
nopl (%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa0(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x6bca
leaq -0x70(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x3100
jmp 0x6ca7
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x78, %eax
jne 0x6be5
movq -0x10(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x10(%rbp)
jmp 0x6bff
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x78, %eax
jne 0x6bfd
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x6bff
movq -0x10(%rbp), %rdi
callq 0x30d0
movl %eax, -0x74(%rbp)
movl $0x0, -0x78(%rbp)
cmpl $0x40, -0x74(%rbp)
jge 0x6c35
movl $0x40, %eax
subl -0x74(%rbp), %eax
movl %eax, -0x78(%rbp)
leaq -0x50(%rbp), %rdi
movslq -0x78(%rbp), %rdx
movl $0x30, %esi
callq 0x3100
leaq -0x50(%rbp), %rdi
movslq -0x78(%rbp), %rax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
movslq -0x74(%rbp), %rdx
callq 0x31c0
leaq -0x50(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0x3890
movq -0xa0(%rbp), %rax
movq -0x88(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x80(%rbp), %rcx
movq %rcx, 0x18(%rax)
leaq -0x50(%rbp), %rsi
addq $0x20, %rsi
leaq -0x98(%rbp), %rdi
callq 0x3890
movq -0xa0(%rbp), %rax
movq -0x98(%rbp), %rcx
movq %rcx, (%rax)
movq -0x90(%rbp), %rcx
movq %rcx, 0x8(%rax)
addq $0xa0, %rsp
popq %rbp
retq
// File: 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
movq %rsp, %rbp
subq $0x70, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x70(%rbp)
movl $0x0, -0x18(%rbp)
leaq -0x18(%rbp), %rsi
callq 0xacb0
movl $0x1, -0x3c(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
callq 0xabf0
movq -0x10(%rbp), %rdi
callq 0x30d0
subq $0x1, %rax
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
jl 0x6e2f
movb $0x0, -0x3d(%rbp)
movq -0x10(%rbp), %rax
movslq -0x44(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
movl $0x30, %eax
cmpl %ecx, %eax
jg 0x6db9
movq -0x10(%rbp), %rax
movslq -0x44(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x39, %eax
jg 0x6db9
movq -0x10(%rbp), %rax
movslq -0x44(%rbp), %rcx
movsbl (%rax,%rcx), %eax
subl $0x30, %eax
movb %al, -0x3d(%rbp)
jmp 0x6df6
movq -0x10(%rbp), %rax
movslq -0x44(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
movl $0x61, %eax
cmpl %ecx, %eax
jg 0x6df4
movq -0x10(%rbp), %rax
movslq -0x44(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x7a, %eax
jg 0x6df4
movq -0x10(%rbp), %rax
movslq -0x44(%rbp), %rcx
movsbl (%rax,%rcx), %eax
subl $0x61, %eax
addl $0xa, %eax
movb %al, -0x3d(%rbp)
jmp 0x6df6
leaq -0x68(%rbp), %rdi
leaq -0x3d(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0xad40
movq -0x70(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x6ea0
movl -0x44(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x11(%rbp), %rsi
callq 0xad70
jmp 0x6d71
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: sokolcom[P]tp-blockchain-task06/uint256_t/uint256_t.cpp
// Function: uint256_t::operator>(uint256_t const&) const
bool uint256_t::operator>(const uint256_t & rhs) const{
    if (UPPER == rhs.UPPER){
        return (LOWER > rhs.LOWER);
    }
    if (UPPER > rhs.UPPER){
        return true;
    }
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x20(%rbp)
addq $0x10, %rdi
movq -0x18(%rbp), %rsi
addq $0x10, %rsi
callq 0x40e0
testb $0x1, %al
jne 0x7e8f
jmp 0x7ea3
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4180
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x7ec8
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
movq -0x18(%rbp), %rsi
addq $0x10, %rsi
callq 0x4180
testb $0x1, %al
jne 0x7ebe
jmp 0x7ec4
movb $0x1, -0x1(%rbp)
jmp 0x7ec8
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: sokolcom[P]tp-blockchain-task06/uint256_t/uint256_t.cpp
// Function: uint256_t::bits() const
uint16_t uint256_t::bits() const{
    uint16_t out = 0;
    if (UPPER){
        out = 128;
        uint128_t up = UPPER;
        while (up){
            up >>= uint128_1;
            out++;
        }
    }
    else{
        uint128_t low = LOWER;
        while (low){
            low >>= uint128_1;
            out++;
        }
    }
    return out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x38(%rbp)
movw $0x0, -0xa(%rbp)
addq $0x10, %rdi
callq 0x3a40
testb $0x1, %al
jne 0x8e79
jmp 0x8ec2
movq -0x38(%rbp), %rax
movw $0x80, -0xa(%rbp)
movq 0x10(%rax), %rcx
movq %rcx, -0x20(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x3a40
testb $0x1, %al
jne 0x8ea2
jmp 0x8ec0
leaq -0x20(%rbp), %rdi
leaq 0xd373(%rip), %rsi      # 0x16220
callq 0x3ff0
movw -0xa(%rbp), %ax
addw $0x1, %ax
movw %ax, -0xa(%rbp)
jmp 0x8e93
jmp 0x8f04
movq -0x38(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x30(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3a40
testb $0x1, %al
jne 0x8ee4
jmp 0x8f02
leaq -0x30(%rbp), %rdi
leaq 0xd331(%rip), %rsi      # 0x16220
callq 0x3ff0
movw -0xa(%rbp), %ax
addw $0x1, %ax
movw %ax, -0xa(%rbp)
jmp 0x8ed5
jmp 0x8f04
movw -0xa(%rbp), %ax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: sokolcom[P]tp-blockchain-task06/uint256_t/uint256_t.cpp
// Function: uint256_t::export_bits() const
std::vector<uint8_t> uint256_t::export_bits() const {
    std::vector<uint8_t> ret;
    ret.reserve(32);
    UPPER.export_bits(ret);
    LOWER.export_bits(ret);
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x30(%rbp)
movq %rdi, %rax
movq %rax, -0x40(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movb $0x0, -0x11(%rbp)
callq 0xb030
movq -0x30(%rbp), %rdi
movl $0x20, %esi
callq 0xb050
jmp 0x934c
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdi
addq $0x10, %rdi
callq 0x48b0
jmp 0x935f
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdi
callq 0x48b0
jmp 0x936e
movb $0x1, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
jne 0x939a
jmp 0x9391
movq -0x30(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0xb130
jmp 0x93a4
movq -0x30(%rbp), %rdi
callq 0xb130
movq -0x40(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x3380
nopl (%rax)
// File: sokolcom[P]tp-blockchain-task06/uint256_t/uint256_t.cpp
// Function: uint256_t::export_bits_truncate() const
std::vector<uint8_t> uint256_t::export_bits_truncate() const {
    std::vector<uint8_t> ret = export_bits();

	//prune the zeroes
	int i = 0;
	while (ret[i] == 0 && i < 64) i++;
	ret.erase(ret.begin(), ret.begin() + i);

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x68(%rbp)
movq %rdi, %rax
movq %rax, -0x60(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rsi
movb $0x0, -0x11(%rbp)
callq 0x9310
movl $0x0, -0x18(%rbp)
movq -0x68(%rbp), %rdi
movslq -0x18(%rbp), %rsi
callq 0xb190
movzbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x69(%rbp)
jne 0x9406
cmpl $0x40, -0x18(%rbp)
setl %al
movb %al, -0x69(%rbp)
movb -0x69(%rbp), %al
testb $0x1, %al
jne 0x940f
jmp 0x941a
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x93e2
movq -0x68(%rbp), %rdi
callq 0x6340
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0xb240
movq -0x68(%rbp), %rdi
callq 0x6340
movq %rax, -0x40(%rbp)
movslq -0x18(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0xb280
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0xb240
movq -0x68(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0xb1b0
movq %rax, -0x78(%rbp)
jmp 0x9476
movq -0x78(%rbp), %rax
movq %rax, -0x58(%rbp)
movb $0x1, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
jne 0x94aa
jmp 0x94a1
movq -0x68(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
callq 0xb130
jmp 0x94b7
movq -0x68(%rbp), %rdi
callq 0xb130
movq -0x60(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x3380
// File: sokolcom[P]tp-blockchain-task06/uint256_t/uint256_t.cpp
// Function: operator<<(std::ostream&, uint256_t const&)
std::ostream & operator<<(std::ostream & stream, const uint256_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 %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq (%rdi), %rax
addq -0x18(%rax), %rdi
callq 0x5f30
movl %eax, %edi
movl $0x40, %esi
callq 0x5f10
cmpl $0x0, %eax
je 0xa410
movq -0x8(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rsi
movl $0x0, -0x34(%rbp)
leaq -0x30(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
movl $0x8, %edx
leaq -0x34(%rbp), %rcx
callq 0x94c0
movq -0xa8(%rbp), %rdi
movq -0xa0(%rbp), %rsi
callq 0x31f0
jmp 0xa3e8
leaq -0x30(%rbp), %rdi
callq 0x3140
jmp 0xa537
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3140
jmp 0xa544
movq -0x8(%rbp), %rdi
movq (%rdi), %rax
addq -0x18(%rax), %rdi
callq 0x5f30
movl %eax, %edi
movl $0x2, %esi
callq 0x5f10
cmpl $0x0, %eax
je 0xa49d
movq -0x8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x10(%rbp), %rsi
movl $0x0, -0x6c(%rbp)
leaq -0x68(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
movl $0xa, %edx
leaq -0x6c(%rbp), %rcx
callq 0x94c0
movq -0xb8(%rbp), %rdi
movq -0xb0(%rbp), %rsi
callq 0x31f0
jmp 0xa475
leaq -0x68(%rbp), %rdi
callq 0x3140
jmp 0xa535
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x3140
jmp 0xa544
movq -0x8(%rbp), %rdi
movq (%rdi), %rax
addq -0x18(%rax), %rdi
callq 0x5f30
movl %eax, %edi
movl $0x8, %esi
callq 0x5f10
cmpl $0x0, %eax
je 0xa533
movq -0x8(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x10(%rbp), %rsi
movl $0x0, -0x94(%rbp)
leaq -0x90(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
movl $0x10, %edx
leaq -0x94(%rbp), %rcx
callq 0x94c0
movq -0xc8(%rbp), %rdi
movq -0xc0(%rbp), %rsi
callq 0x31f0
jmp 0xa50b
leaq -0x90(%rbp), %rdi
callq 0x3140
jmp 0xa533
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x3140
jmp 0xa544
jmp 0xa535
jmp 0xa537
movq -0x8(%rbp), %rax
addq $0xd0, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x3380
nopl (%rax)
// File: sokolcom[P]tp-blockchain-task06/uint256_t/uint256_t.cpp
// Function: operator>>(std::istream&, uint256_t&)
std::istream &operator>>(std::istream &stream, uint256_t &rhs)
{
    std::string hexstring;
    stream >> hexstring;
    uint256_t temp = hexstring;
    rhs = std::move(temp);
    return stream;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x30(%rbp), %rdi
movq %rdi, -0x68(%rbp)
callq 0x32e0
movq -0x68(%rbp), %rsi
movq -0x8(%rbp), %rdi
callq 0x32b0
jmp 0xa57c
leaq -0x60(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x6b50
jmp 0xa58b
movq -0x10(%rbp), %rax
movq -0x60(%rbp), %rcx
movq %rcx, (%rax)
movq -0x58(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x50(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x48(%rbp), %rcx
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3140
movq -0x70(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3140
movq -0x38(%rbp), %rdi
callq 0x3380
nopw (%rax,%rax)
// File: sokolcom[P]tp-blockchain-task06/uint256_t/uint256_t.cpp
// Function: uint256_t::powmod(uint256_t, uint256_t const&) const
uint256_t uint256_t::powmod(uint256_t power, const uint256_t &modulo) const
{
    uint256_t a = *this;
    uint256_t result = 1;

    while (power)
    {
        if (power & 1)
        {
            // assert(uint256_max / a > result);
            result = result.mulmod(a, modulo);
            // result = result * a % modulo;
        }

        // assert(uint256_max / a > a);
        a = a.mulmod(a, modulo);
        // a = a * a % modulo;
        power >>= 1;
    }

    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x100(%rbp)
movq %rdi, %rax
movq %rax, -0xf8(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq %rsi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x30(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x28(%rbp)
movq 0x10(%rax), %rcx
movq %rcx, -0x20(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
movl $0x1, -0x34(%rbp)
leaq -0x34(%rbp), %rsi
callq 0xabf0
movq -0xf0(%rbp), %rdi
callq 0x6fa0
testb $0x1, %al
jne 0xa667
jmp 0xa7da
movq -0xf0(%rbp), %rsi
movl $0x1, -0x5c(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x5c(%rbp), %rdx
callq 0xb5e0
leaq -0x58(%rbp), %rdi
callq 0x6fa0
testb $0x1, %al
jne 0xa694
jmp 0xa723
movq -0x100(%rbp), %rsi
movq -0x30(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rdx
leaq -0x80(%rbp), %rdi
leaq -0xa0(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
callq 0xa7f0
movq -0x100(%rbp), %rax
movq -0x80(%rbp), %rcx
movq %rcx, (%rax)
movq -0x78(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x70(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x68(%rbp), %rcx
movq %rcx, 0x18(%rax)
movq -0x30(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x10(%rbp), %rdx
leaq -0xc0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq -0xe0(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
callq 0xa7f0
movq -0xf0(%rbp), %rdi
movq -0xc0(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0xa8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x1, -0xe4(%rbp)
leaq -0xe4(%rbp), %rsi
callq 0xb640
jmp 0xa652
movq -0xf8(%rbp), %rax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopw (%rax,%rax)