LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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 0x5d2c
cmpl $0x10000, %ebp          # imm = 0x10000
jae 0x6ccf
leaq 0xc(%rsp), %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x5eff
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x6cdf
movl %eax, %r14d
movzwl 0xc(%rsp), %edi
movl 0x5bdb(%rip), %esi      # 0xc870
orl $0x2, %esi
movl $0x11, %edx
callq 0x30a0
movl %eax, %r15d
testl %eax, %eax
js 0x6cca
cmpl $0x0, 0x5bc0(%rip)      # 0xc870
je 0x6cec
testl %ebp, %ebp
je 0x6cca
leaq 0xc(%rsp), %rsi
movl %r15d, %edi
movl %r14d, %edx
callq 0x3070
testl %eax, %eax
jne 0x6d04
movl %r15d, %ebx
jmp 0x6cdf
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 0x6cb2
movl %r15d, %edi
callq 0x5fc7
jmp 0x6cdf
// File: /workspace/github_cpp_makefile_star2_O1/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 0x5d2c
leaq 0x18(%rsp), %r12
movl $0x1c, (%r12)
movslq %ebx, %rbx
leaq 0x1c(%rsp), %r14
movl %ebp, %edi
movq %r15, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
movq %r14, %r8
movq %r12, %r9
callq 0x3240
movq %rax, %r13
testl %r13d, %r13d
jns 0x6d6e
callq 0x3040
cmpl $0x4, (%rax)
je 0x6d47
testl %r13d, %r13d
js 0x6d87
leaq 0x1c(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
callq 0x6b79
movl %r13d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x5d2c
leaq 0xc(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
movl %r15d, %edx
callq 0x5eff
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 0x6e03
cmpl $0x4, (%r12)
je 0x6ddb
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
testq %rsi, %rsi
je 0x24ee
movb (%rsi), %al
testb %al, %al
je 0x24ee
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1(%rsi), %r14
leaq 0x2(%rsi), %rcx
cmpb $0x78, %al
cmovneq %rsi, %r14
cmpb $0x78, 0x1(%rsi)
cmoveq %rcx, %r14
movq %r14, %rsi
callq 0x2506
movq %rax, 0x8(%rbx)
addq $0x10, %r14
movq %r14, %rsi
callq 0x2506
movq %rax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
movl $0xff, %edx
xorl %eax, %eax
cmpq $0x10, %rcx
je 0x2568
movb (%rsi,%rcx), %dil
leal -0x30(%rdi), %r8d
cmpb $0xa, %r8b
jb 0x254a
leal -0x61(%rdi), %r8d
cmpb $0x5, %r8b
ja 0x2536
addb $-0x57, %dil
movl %edi, %r8d
jmp 0x254a
leal -0x41(%rdi), %r8d
addb $-0x37, %dil
cmpb $0x6, %r8b
movzbl %dil, %r8d
cmovael %edx, %r8d
movq %rax, %rdi
shlq $0x4, %rdi
movzbl %r8b, %r8d
movq %r8, %r9
orq %rdi, %r9
incq %rcx
cmpb $-0x1, %r8b
cmovneq %r9, %rax
jne 0x250f
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 $0x9, %al
jbe 0x257f
leal -0x61(%rcx), %eax
cmpb $0x5, %al
ja 0x2580
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_O1/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 0x2651
xorl %eax, %eax
xorl %edx, %edx
retq
testq %r8, %r8
je 0x2661
cmpq $0x40, %r8
jne 0x2669
movq (%rdi), %rdx
jmp 0x2693
movq (%rdi), %rax
movq 0x8(%rdi), %rdx
retq
jae 0x268a
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_O1/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 0x26c6
xorl %eax, %eax
jmp 0x26d5
testq %r8, %r8
je 0x26d8
cmpq $0x40, %r8
jne 0x26e0
movq 0x8(%rdi), %rax
xorl %edx, %edx
retq
movq (%rdi), %rax
movq 0x8(%rdi), %rdx
retq
movq 0x8(%rdi), %rsi
jae 0x2701
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_O1/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{
    // split values into 4 32-bit parts
    uint64_t top[4] = {UPPER >> 32, UPPER & 0xffffffff, LOWER >> 32, LOWER & 0xffffffff};
    uint64_t bottom[4] = {rhs.UPPER >> 32, rhs.UPPER & 0xffffffff, rhs.LOWER >> 32, rhs.LOWER & 0xffffffff};
    uint64_t products[4][4];

    // multiply each component of the values
    for(int y = 3; y > -1; y--){
        for(int x = 3; x > -1; x--){
            products[3 - x][y] = top[x] * bottom[y];
        }
    }

    // first row
    uint64_t fourth32 = (products[0][3] & 0xffffffff);
    uint64_t third32  = (products[0][2] & 0xffffffff) + (products[0][3] >> 32);
    uint64_t second32 = (products[0][1] & 0xffffffff) + (products[0][2] >> 32);
    uint64_t first32  = (products[0][0] & 0xffffffff) + (products[0][1] >> 32);

    // second row
    third32  += (products[1][3] & 0xffffffff);
    second32 += (products[1][2] & 0xffffffff) + (products[1][3] >> 32);
    first32  += (products[1][1] & 0xffffffff) + (products[1][2] >> 32);

    // third row
    second32 += (products[2][3] & 0xffffffff);
    first32  += (products[2][2] & 0xffffffff) + (products[2][3] >> 32);

    // fourth row
    first32  += (products[3][3] & 0xffffffff);

    // move carry to next digit
    third32  += fourth32 >> 32;
    second32 += third32  >> 32;
    first32  += second32 >> 32;

    // remove carry from current digit
    fourth32 &= 0xffffffff;
    third32  &= 0xffffffff;
    second32 &= 0xffffffff;
    first32  &= 0xffffffff;

    // combine components
    return uint128_t((first32 << 32) | second32, (third32 << 32) | fourth32);
}

// Assembly:
subq $0x48, %rsp
movq 0x8(%rdi), %rax
movl %eax, %ecx
shrq $0x20, %rax
movq %rax, -0x60(%rsp)
movq %rcx, -0x58(%rsp)
movq (%rdi), %rax
movl %eax, %ecx
shrq $0x20, %rax
movq %rax, -0x50(%rsp)
movq %rcx, -0x48(%rsp)
movq 0x8(%rsi), %rax
movl %eax, %ecx
shrq $0x20, %rax
movq %rax, -0x80(%rsp)
movq %rcx, -0x78(%rsp)
movq (%rsi), %rax
movl %eax, %ecx
shrq $0x20, %rax
movq %rax, -0x70(%rsp)
movq %rcx, -0x68(%rsp)
movl $0x3, %eax
leaq -0x28(%rsp), %rcx
movq -0x80(%rsp,%rax,8), %rdx
movq %rcx, %rsi
movl $0x3, %edi
movq -0x60(%rsp,%rdi,8), %r8
imulq %rdx, %r8
movq %r8, (%rsi)
addq $0x20, %rsi
addq $-0x1, %rdi
jb 0x28a7
addq $-0x8, %rcx
subq $0x1, %rax
jae 0x289a
movq -0x28(%rsp), %r8
movl %r8d, %ecx
movq -0x38(%rsp), %rsi
movq -0x30(%rsp), %rdx
movl %edx, %eax
shrq $0x20, %r8
addq %rax, %r8
movl %esi, %eax
shrq $0x20, %rdx
addq %rax, %rdx
shrq $0x20, %rsi
movq -0x8(%rsp), %rdi
movl %edi, %eax
addq %r8, %rax
movq -0x10(%rsp), %r8
movl %r8d, %r9d
shrq $0x20, %rdi
addq %r9, %rdi
addq %rdx, %rdi
shrq $0x20, %r8
movq 0x18(%rsp), %rdx
addl -0x40(%rsp), %esi
movl %edx, %r9d
addl %esi, %r8d
addl -0x18(%rsp), %r8d
shrq $0x20, %rdx
addl %r8d, %edx
addl 0x10(%rsp), %edx
addq %rdi, %r9
addl 0x38(%rsp), %edx
movq %rax, %rsi
shrq $0x20, %rsi
addq %r9, %rsi
shlq $0x20, %rdx
addq %rsi, %rdx
shlq $0x20, %rax
orq %rcx, %rax
addq $0x48, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x33dc
movb 0x6(%r14), %al
leaq 0x6(%rsp), %rsi
movb %al, (%rsi)
movq %rbx, %rdi
callq 0x33dc
movb 0x5(%r14), %al
leaq 0x5(%rsp), %rsi
movb %al, (%rsi)
movq %rbx, %rdi
callq 0x33dc
movb 0x4(%r14), %al
leaq 0x4(%rsp), %rsi
movb %al, (%rsi)
movq %rbx, %rdi
callq 0x33dc
movb 0x3(%r14), %al
leaq 0x3(%rsp), %rsi
movb %al, (%rsi)
movq %rbx, %rdi
callq 0x33dc
movb 0x2(%r14), %al
leaq 0x2(%rsp), %rsi
movb %al, (%rsi)
movq %rbx, %rdi
callq 0x33dc
movb 0x1(%r14), %al
leaq 0x1(%rsp), %rsi
movb %al, (%rsi)
movq %rbx, %rdi
callq 0x33dc
movb (%r14), %al
movq %rsp, %rsi
movb %al, (%rsi)
movq %rbx, %rdi
callq 0x33dc
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2c56
bsrq %rax, %rcx
xorl $0x3f, %ecx
movb $-0x80, %al
jmp 0x2c67
movq (%rdi), %rax
testq %rax, %rax
je 0x2c6a
bsrq %rax, %rcx
xorl $0x3f, %ecx
movb $0x40, %al
subb %cl, %al
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x32b1
testb $0x2, %al
jne 0x32df
testb $0x8, %al
je 0x3326
leaq 0x4(%rsp), %rcx
movl $0x0, (%rcx)
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x10, %edx
callq 0x2d96
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x2160
jmp 0x330b
leaq 0x4(%rsp), %rcx
movl $0x0, (%rcx)
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x8, %edx
callq 0x2d96
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x2160
jmp 0x330b
leaq 0x4(%rsp), %rcx
movl $0x0, (%rcx)
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0xa, %edx
callq 0x2d96
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x2160
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3326
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2150
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
jmp 0x3335
jmp 0x3335
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3353
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2150
movq %rbx, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3644
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x78, 0x1(%rsi)
jne 0x35ba
addq $0x2, %r14
jmp 0x35c6
leaq 0x1(%r14), %rax
cmpb $0x78, (%r14)
cmoveq %rax, %r14
movq %r14, %rdi
callq 0x20a0
movq %rax, %r15
cmpl $0x3f, %r15d
jg 0x35f4
movl $0x40, %r12d
subl %r15d, %r12d
leaq 0x10(%rsp), %rdi
movl $0x30, %esi
movq %r12, %rdx
callq 0x20d0
jmp 0x35f7
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_O1/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 0x4999(%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 0x3771
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
cmpb $0x9, %cl
jbe 0x36f0
leal -0x61(%rax), %ecx
addb $-0x57, %al
cmpb $0x1a, %cl
movzbl %al, %ecx
cmovael %r14d, %ecx
movzbl %cl, %eax
movq %rax, 0x48(%rsp)
movq %r14, 0x50(%rsp)
leaq 0x4904(%rip), %rbp      # 0x8008
movups (%rbp), %xmm0
leaq 0x58(%rsp), %rax
movups %xmm0, (%rax)
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x457e
movq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x37a8
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 0x457e
movups 0x48(%rsp), %xmm0
movups 0x58(%rsp), %xmm1
movaps %xmm1, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
decq %rbx
jg 0x36d0
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x25a6
testb %al, %al
jne 0x3b56
leaq 0x963e(%rip), %rsi      # 0xd188
movq %rsp, %rdi
callq 0x27c2
testb %al, %al
je 0x3b7c
movups 0x964b(%rip), %xmm0     # 0xd1a8
movups %xmm0, 0x10(%rbx)
movups 0x9630(%rip), %xmm0     # 0xd198
movups %xmm0, (%rbx)
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x95f5(%rip), %rsi      # 0xd178
movq %rsp, %rdi
callq 0x275e
testb %al, %al
je 0x3ba6
leaq 0x4472(%rip), %rax      # 0x8008
movups (%rax), %xmm0
movups %xmm0, (%rbx)
movups (%r14), %xmm0
movups %xmm0, 0x10(%rbx)
jmp 0x3b6b
leaq 0x445b(%rip), %r15      # 0x8008
movq %rsp, %rdi
movq %r15, %rsi
callq 0x275e
testb %al, %al
je 0x3bcb
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x10(%rbx)
jmp 0x3b68
leaq 0x95a6(%rip), %rsi      # 0xd178
movq %rsp, %rdi
callq 0x27a6
testb %al, %al
je 0x3c57
leaq 0x10(%r14), %rdi
movq %rsp, %r15
movq %r15, %rsi
callq 0x2636
leaq 0x10(%rsp), %r12
movq %rax, (%r12)
movq %rdx, 0x8(%r12)
leaq 0x9576(%rip), %rdi      # 0xd178
movq %r15, %rsi
callq 0x281c
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
movq %rdx, 0x8(%rsi)
movq %r14, %rdi
callq 0x26ac
leaq 0x30(%rsp), %rsi
movq %rax, (%rsi)
movq %rdx, 0x8(%rsi)
movq %r12, %rdi
callq 0x27fa
movq %rax, %r12
movq %rdx, %r13
movq %r14, %rdi
movq %r15, %rsi
callq 0x2636
movq %rax, (%rbx)
movq %rdx, 0x8(%rbx)
movq %r12, 0x10(%rbx)
movq %r13, 0x18(%rbx)
jmp 0x3b6b
leaq 0x952a(%rip), %rdi      # 0xd188
movq %rsp, %rsi
callq 0x278a
testb %al, %al
je 0x3b56
leaq 0x9503(%rip), %rsi      # 0xd178
movq %rsp, %rdi
callq 0x278a
testb %al, %al
je 0x3b56
leaq 0x94ec(%rip), %rsi      # 0xd178
movq %rsp, %rdi
callq 0x281c
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movq %rdx, 0x8(%rsi)
movq %r14, %rdi
callq 0x2636
movups (%r15), %xmm0
movups %xmm0, (%rbx)
movq %rax, 0x10(%rbx)
movq %rdx, 0x18(%rbx)
jmp 0x3b6b
// File: /workspace/github_cpp_makefile_star2_O1/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(UPPER);
    }
    else if (shift == uint128_0){
        return *this;
    }
    else if (shift < uint128_128){
        return uint256_t(UPPER >> shift, (UPPER << (uint128_128 - shift)) + (LOWER >> shift));
    }
    else if ((uint128_256 > shift) && (shift > uint128_128)){
        return uint256_t(UPPER >> (shift - uint128_128));
    }
    else{
        return uint256_0;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movups (%rdx), %xmm0
movq %rsp, %r15
movaps %xmm0, (%r15)
leaq 0x10(%rdx), %rdi
callq 0x25a6
movl %eax, %ebp
leaq 0x93ea(%rip), %rsi      # 0xd188
movq %r15, %rdi
callq 0x27c2
testb %bpl, %bpl
jne 0x3ef5
testb %al, %al
jne 0x3ef5
leaq 0x93ba(%rip), %rsi      # 0xd178
movq %rsp, %rdi
callq 0x275e
testb %al, %al
je 0x3de5
movups 0x10(%r14), %xmm0
movups %xmm0, (%rbx)
leaq 0x422f(%rip), %rax      # 0x8008
movups (%rax), %xmm0
movups %xmm0, 0x10(%rbx)
jmp 0x3f0a
leaq 0x421c(%rip), %r15      # 0x8008
movq %rsp, %rdi
movq %r15, %rsi
callq 0x275e
testb %al, %al
je 0x3e0d
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x10(%rbx)
jmp 0x3f07
leaq 0x9364(%rip), %rsi      # 0xd178
movq %rsp, %rdi
callq 0x27a6
testb %al, %al
je 0x3e98
leaq 0x10(%r14), %r13
movq %rsp, %rbp
movq %r13, %rdi
movq %rbp, %rsi
callq 0x26ac
movq %rax, %r15
movq %rdx, %r12
leaq 0x9339(%rip), %rdi      # 0xd178
movq %rbp, %rsi
callq 0x281c
leaq 0x38(%rsp), %rsi
movq %rax, (%rsi)
movq %rdx, 0x8(%rsi)
movq %r13, %rdi
callq 0x2636
leaq 0x18(%rsp), %r13
movq %rax, (%r13)
movq %rdx, 0x8(%r13)
movq %r14, %rdi
movq %rbp, %rsi
callq 0x26ac
leaq 0x28(%rsp), %rsi
movq %rax, (%rsi)
movq %rdx, 0x8(%rsi)
movq %r13, %rdi
callq 0x27fa
movq %rax, (%rbx)
movq %rdx, 0x8(%rbx)
movq %r15, 0x10(%rbx)
movq %r12, 0x18(%rbx)
jmp 0x3f0a
leaq 0x92e9(%rip), %rdi      # 0xd188
movq %rsp, %rsi
callq 0x278a
testb %al, %al
je 0x3ef5
leaq 0x92c6(%rip), %rsi      # 0xd178
movq %rsp, %rdi
callq 0x278a
testb %al, %al
je 0x3ef5
addq $0x10, %r14
leaq 0x92af(%rip), %rsi      # 0xd178
movq %rsp, %rdi
callq 0x281c
leaq 0x18(%rsp), %rsi
movq %rax, (%rsi)
movq %rdx, 0x8(%rsi)
movq %r14, %rdi
callq 0x26ac
movq %rax, (%rbx)
movq %rdx, 0x8(%rbx)
movups (%r15), %xmm0
jmp 0x3ddc
movups 0x92ac(%rip), %xmm0     # 0xd1a8
movups %xmm0, 0x10(%rbx)
movups 0x9291(%rip), %xmm0     # 0xd198
movups %xmm0, (%rbx)
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10(%rdi), %r15
leaq 0x10(%rsi), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x275e
testb %al, %al
je 0x41e9
movq %r14, %rdi
movq %rbx, %rsi
jmp 0x41ef
movq %r15, %rdi
movq %r12, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x278a
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x10(%rdi), %r14
movq %r14, %rdi
callq 0x25a6
testb %al, %al
je 0x4f04
movups (%r14), %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
callq 0x25a6
movw $0x80, %bx
testb %al, %al
je 0x4f3b
movw $0x80, %bx
leaq 0x3132(%rip), %r14      # 0x8018
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x270e
incl %ebx
movq %r15, %rdi
callq 0x25a6
testb %al, %al
jne 0x4ee9
jmp 0x4f3b
movups (%rbx), %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
callq 0x25a6
xorl %ebx, %ebx
testb %al, %al
je 0x4f3b
leaq 0x30f9(%rip), %r14      # 0x8018
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x270e
incl %ebx
movq %r15, %rdi
callq 0x25a6
testb %al, %al
jne 0x4f22
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movl $0x20, %esi
callq 0x6600
leaq 0x10(%r14), %rdi
movq %rbx, %rsi
callq 0x2a0e
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2a0e
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x530d
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x2150
movq %r14, %rdi
callq 0x2250
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x52b2
movq (%rbx), %rdi
leaq -0x1(%rdi), %rax
movl $0x1, %r14d
xorl %ecx, %ecx
leaq 0x1(%rax), %rsi
decq %r14
cmpq $0x3f, %rcx
ja 0x534a
incq %rcx
cmpb $0x0, 0x1(%rax)
movq %rsi, %rax
je 0x5331
testq %r14, %r14
je 0x5370
movq 0x8(%rbx), %rdx
cmpq %rdx, %rsi
je 0x5363
subq %rdi, %rdx
addq %r14, %rdx
callq 0x2220
testq %r14, %r14
je 0x5370
addq 0x8(%rbx), %r14
movq %r14, 0x8(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %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 0x60be
testb $0x2, %al
jne 0x60ec
testb $0x8, %al
je 0x6133
leaq 0x4(%rsp), %rcx
movl $0x0, (%rcx)
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x10, %edx
callq 0x537c
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x2160
jmp 0x6118
leaq 0x4(%rsp), %rcx
movl $0x0, (%rcx)
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x8, %edx
callq 0x537c
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x2160
jmp 0x6118
leaq 0x4(%rsp), %rcx
movl $0x0, (%rcx)
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0xa, %edx
callq 0x537c
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x2160
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6133
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2150
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
jmp 0x6142
jmp 0x6142
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6160
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2150
movq %rbx, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
movq %rsp, %rsi
callq 0x2190
movq (%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0x3594
movups 0x20(%rsp), %xmm0
movups 0x30(%rsp), %xmm1
movups %xmm1, 0x10(%r14)
movups %xmm0, (%r14)
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x61cb
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2150
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x61da
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x61f3
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2150
movq %rbx, %rdi
callq 0x2250
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %rbx
movq %rdi, %r14
leaq 0xb0(%rsp), %r15
movups (%rsi), %xmm0
movups 0x10(%rsi), %xmm1
movaps %xmm1, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movq $0x1, (%rdi)
movq $0x0, 0x8(%rdi)
leaq 0x1dc9(%rip), %rax      # 0x8008
movups (%rax), %xmm0
movups %xmm0, 0x10(%rdi)
leaq 0xc0(%rsp), %rdi
movq %r15, %rsi
callq 0x25e4
leaq 0x20(%rsp), %rdi
movq %rax, (%rdi)
movq %rdx, 0x8(%rdi)
callq 0x25a6
testb %al, %al
je 0x637d
leaq 0x30(%rsp), %r13
leaq 0x40(%rsp), %rbp
leaq 0x20(%rsp), %r12
movq $0x1, 0x40(%rsp)
movq $0x0, 0x48(%rsp)
movq %r15, %rdi
movq %rbp, %rsi
callq 0x25c2
movq %rax, 0x20(%rsp)
movq %rdx, 0x28(%rsp)
leaq 0x1d5c(%rip), %rax      # 0x8008
movups (%rax), %xmm0
movups %xmm0, (%r13)
movq %r13, %rdi
movq %r12, %rsi
callq 0x25e4
movq %rax, 0x40(%rsp)
movq %rdx, 0x48(%rsp)
movq %rbp, %rdi
callq 0x25a6
testb %al, %al
je 0x6309
movaps 0x50(%rsp), %xmm0
movaps 0x60(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x6390
movups 0x20(%rsp), %xmm0
movups 0x30(%rsp), %xmm1
movups %xmm1, 0x10(%r14)
movups %xmm0, (%r14)
movaps 0x50(%rsp), %xmm0
movaps 0x60(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r12, %rdi
leaq 0x50(%rsp), %rsi
movq %rbx, %rdx
callq 0x6390
movups 0x20(%rsp), %xmm0
movups 0x30(%rsp), %xmm1
movaps %xmm1, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movl $0x1, 0x20(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x6692
leaq 0xc0(%rsp), %rdi
movq %r15, %rsi
callq 0x25e4
movq %rax, 0x20(%rsp)
movq %rdx, 0x28(%rsp)
movq %r12, %rdi
callq 0x25a6
testb %al, %al
jne 0x627e
movq %r14, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/sokolcom[P]tp-blockchain-task06/uint256_t/uint256_t.cpp
// Function: uint256_t::mulmod(uint256_t, uint256_t const&) const
uint256_t uint256_t::mulmod(uint256_t another, const uint256_t &modulo) const
{
    uint256_t result = 0;
    uint256_t a = *this;

    if (a > another)
    {
        uint256_t temp = a;
        a = another;
        another = temp;
    }

    while (a)
    {
        if (a & 1)
        {
            result = result.addmod(another, modulo);
        }

        another = another.addmod(another, modulo);
        a >>= 1;
    }

    // while (another)
    // {
    //     if (another % 2)
    //     {
    //         if (modulo - result < a)
    //         {
    //             // assert(result - (uint256_max - a) == result + a);
    //             result -= modulo - a;
    //         }
    //         else
    //         {
    //             // assert(modulo - result >= a);
    //             result += a;
    //         }
    //     }

    //     if (modulo - a < a)
    //     {
    //         a -= modulo - a;
    //     }
    //     else
    //     {
    //         // assert(uint256_max - a >= a);
    //         a *= 2;
    //     }
        
    //     another /= 2;
    // }

    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %rbx
movq %rdi, %r14
leaq 0x90(%rsp), %r15
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
leaq 0x1c4f(%rip), %rax      # 0x8008
movups (%rax), %xmm0
movups %xmm0, 0x10(%rdi)
movups (%rsi), %xmm0
movups 0x10(%rsi), %xmm1
leaq 0x30(%rsp), %rdi
movaps %xmm1, 0x10(%rdi)
movaps %xmm0, (%rdi)
movq %r15, %rsi
callq 0x41bc
testb %al, %al
je 0x640e
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movaps %xmm1, 0x10(%rsp)
movaps %xmm0, (%rsp)
movups (%r15), %xmm2
movups 0x10(%r15), %xmm3
movaps %xmm3, 0x40(%rsp)
movaps %xmm2, 0x30(%rsp)
movups %xmm0, (%r15)
movups %xmm1, 0x10(%r15)
leaq 0x40(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x25e4
movq %rsp, %rdi
movq %rax, (%rdi)
movq %rdx, 0x8(%rdi)
callq 0x25a6
testb %al, %al
je 0x6515
leaq 0x30(%rsp), %rbp
leaq 0x20(%rsp), %r12
movq %rsp, %r13
movq $0x1, 0x20(%rsp)
movq $0x0, 0x28(%rsp)
movq %rbp, %rdi
movq %r12, %rsi
callq 0x25c2
movq %rax, (%rsp)
movq %rdx, 0x8(%rsp)
leaq 0x1b9a(%rip), %rax      # 0x8008
movups (%rax), %xmm0
leaq 0x10(%rsp), %rdi
movups %xmm0, (%rdi)
movq %r13, %rsi
callq 0x25e4
movq %rax, 0x20(%rsp)
movq %rdx, 0x28(%rsp)
movq %r12, %rdi
callq 0x25a6
testb %al, %al
je 0x64ba
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x6528
movups (%rsp), %xmm0
movups 0x10(%rsp), %xmm1
movups %xmm1, 0x10(%r14)
movups %xmm0, (%r14)
movq %r13, %rdi
movq %r15, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x6528
movups (%rsp), %xmm0
movups 0x10(%rsp), %xmm1
movups %xmm1, 0x10(%r15)
movups %xmm0, (%r15)
movl $0x1, (%rsp)
movq %rbp, %rdi
movq %r13, %rsi
callq 0x6692
leaq 0x40(%rsp), %rdi
movq %rbp, %rsi
callq 0x25e4
movq %rax, (%rsp)
movq %rdx, 0x8(%rsp)
movq %r13, %rdi
callq 0x25a6
testb %al, %al
jne 0x6441
movq %r14, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/sokolcom[P]tp-blockchain-task06/uint256_t/uint256_t.cpp
// Function: uint256_t::addmod(uint256_t&, uint256_t const&) const
uint256_t uint256_t::addmod(uint256_t &another, const uint256_t &modulo) const
{
    uint256_t result;

    if (modulo - *this > another)
    {
        result = *this + another;
    }
    else
    {
        result = another - (modulo - *this);
    }

    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rcx, %r12
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rsp, %r13
movq %r13, %rdi
movq %rcx, %rsi
movq %r15, %rdx
callq 0x4450
movq %r13, %rdi
movq %r14, %rsi
callq 0x41bc
testb %al, %al
je 0x6571
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x435c
jmp 0x6590
movq %rsp, %r13
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x4450
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x4450
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/sokolcom[P]tp-blockchain-task06/uint256_t/uint256_t.cpp
// Function: uint256_t::from_bytes(unsigned char const*)
void uint256_t::from_bytes(const uint8_t *const bytes)
{
    uint64_t buffer64[4] = { 0 };
    for (uint8_t i = 0; i < 4; i++)
    {
        uint64_t value = 0;
        for (int8_t j = (i * 8) + 7; j >= (i * 8); j--)
        {
            value <<= 8;
            value |= (uint64_t)bytes[j];
        }

        buffer64[i] = value;
    }

    uint128_t upper(buffer64[3], buffer64[2]), lower(buffer64[1], buffer64[0]);
    UPPER = upper;
    LOWER = lower;
}

// Assembly:
xorps %xmm0, %xmm0
movaps %xmm0, -0x18(%rsp)
movaps %xmm0, -0x28(%rsp)
movl $0x8, %eax
xorl %ecx, %ecx
leaq (,%rcx,8), %rdx
movq %rax, %r8
xorl %r9d, %r9d
movq %r9, %r10
shlq $0x8, %r10
movzbl -0x1(%rsi,%r8), %r9d
orq %r10, %r9
decq %r8
cmpq %rdx, %r8
jg 0x65c4
movq %r9, -0x28(%rsp,%rcx,8)
incq %rcx
addq $0x8, %rax
cmpq $0x4, %rcx
jne 0x65b6
movaps -0x28(%rsp), %xmm0
movaps -0x18(%rsp), %xmm1
movups %xmm1, 0x10(%rdi)
movups %xmm0, (%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/sokolcom[P]tp-blockchain-task06/src/main.cpp
// Function: main
int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        throw std::invalid_argument("Error!\nInvalid amount of the options!");
        return FAILURE;
    }
    else
    {
        if (!strcmp(argv[1], "split"))
        {
            mode_split();
        }
        else if (!strcmp(argv[1], "recover"))
        {
            mode_recover();
        }
        else
        {
            throw std::invalid_argument("Error!\nUnknown option!");
            return FAILURE;
        }
    }

    return SUCCESS;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x2, %edi
jne 0x674d
movq 0x8(%rsi), %rbx
leaq 0x1a21(%rip), %rsi      # 0x8139
movq %rbx, %rdi
callq 0x21b0
testl %eax, %eax
je 0x673e
leaq 0x1a14(%rip), %rsi      # 0x813f
movq %rbx, %rdi
callq 0x21b0
testl %eax, %eax
jne 0x676b
callq 0x67b4
jmp 0x6743
callq 0x73d8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x10, %edi
callq 0x20b0
movq %rax, %rbx
leaq 0x19b2(%rip), %rsi      # 0x8113
movq %rax, %rdi
callq 0x2280
jmp 0x6787
movl $0x10, %edi
callq 0x20b0
movq %rax, %rbx
leaq 0x19c8(%rip), %rsi      # 0x8147
movq %rax, %rdi
callq 0x2280
movq 0x6842(%rip), %rsi      # 0xcfd0
movq 0x682b(%rip), %rdx      # 0xcfc0
movq %rbx, %rdi
callq 0x2240
jmp 0x679f
movq %rax, %r14
movq %rbx, %rdi
callq 0x2100
movq %r14, %rdi
callq 0x2250
nop
// File: /workspace/github_cpp_makefile_star2_O1/JRLamontagne[P]cdice_sa/CDICEMain.cpp
// Function: calc_CDICE(DICE*, DICE*)
void calc_CDICE(DICE *dice1, DICE *dice2)
{
	
  // Run the model over the dice object
  processModel(dice1);
  
  // Make temporary variables to hold the changes in utility
  double dutil_e;
  double dutil_c;
  int i;
  int t;
  int tsub;
  
  // Loop over the available time steps
  for(t=1; t<dice1->config.nPeriods; t++) {
    
    // Reset the temp dice object
    processModel(dice2);
    
    // Increment the consumption at this time step
    dice2->econ.c[t-1] += 1.0;
    
    // Do the post processing of this run
    postProcess(dice2);
    
    // Store the utility from this run
    dutil_c = dice2->econ.utility - dice1->econ.utility;
    
    // Reset the consumption
    dice2->econ.c[t-1] = dice1->econ.c[t-1];        
    
    // Increment the emissions at this time step
    dice2->econ.e[t-1] += 1.0;
    
    // Run the model on the temporary dice object
    for(tsub=t; tsub<dice1->config.nPeriods; tsub++) {
      calcCarb(dice2, tsub);
      if(dice2->ctrl.use_doeclim) {
				doeclim_dice_ts(dice2, tsub);
      }
      else {
				calcClim(dice2, tsub);
      }
      calcEcon(dice2, tsub);
    }
    
    // Do the post processing of this run
    postProcess(dice2);
    
    // Store the utility from this run
    dutil_e = dice2->econ.utility - dice1->econ.utility;
    
    // Calculate the SCC from these differences in utility
    dice1->econ.scc[t-1] = -1000.0 * (dutil_e / dutil_c);
  }
  
  // Delete the temporary DICE object
  //free_CDICE(dice2);
	
	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x5d08
cmpl $0x2, (%r14)
jl 0x26d3
movl $0x1, %r15d
movq %rbx, %rdi
callq 0x5d08
movq 0x308(%rbx), %rax
movsd -0x8(%rax,%r15,8), %xmm0
movsd 0x5a1c(%rip), %xmm1     # 0x8008
addsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rax,%r15,8)
movq %rbx, %rdi
callq 0x5a2f
movsd 0x380(%rbx), %xmm0
subsd 0x380(%r14), %xmm0
movsd %xmm0, (%rsp)
movq 0x308(%r14), %rax
movsd -0x8(%rax,%r15,8), %xmm0
movq 0x308(%rbx), %rax
movsd %xmm0, -0x8(%rax,%r15,8)
movq 0x3b8(%rbx), %rax
movsd -0x8(%rax,%r15,8), %xmm0
addsd 0x59c1(%rip), %xmm0     # 0x8008
movsd %xmm0, -0x8(%rax,%r15,8)
movslq (%r14), %rax
cmpq %rax, %r15
jge 0x2690
movl %r15d, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x536e
cmpl $0x0, 0x58(%rbx)
je 0x2675
movq %rbx, %rdi
movl %ebp, %esi
callq 0x7643
jmp 0x267f
movq %rbx, %rdi
movl %ebp, %esi
callq 0x54b5
movq %rbx, %rdi
movl %ebp, %esi
callq 0x5586
incl %ebp
cmpl (%r14), %ebp
jl 0x2659
movq %rbx, %rdi
callq 0x5a2f
movsd 0x380(%rbx), %xmm0
subsd 0x380(%r14), %xmm0
divsd (%rsp), %xmm0
mulsd 0x595a(%rip), %xmm0     # 0x8010
movq 0x2b0(%r14), %rax
movsd %xmm0, -0x8(%rax,%r15,8)
incq %r15
movslq (%r14), %rax
cmpq %rax, %r15
jl 0x25ce
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/JRLamontagne[P]cdice_sa/CDICEMain.cpp
// Function: readFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, int)
vector< vector<double> > readFile(string filename, int idx1, int idx2)
{
	ifstream inFile;
	inFile.open(filename.c_str());
	
	vector< vector <double> > params;
	vector<double> param_hold;
	string line;
	double p;
	int i=0;
	int j=0;
	
	while(getline(inFile, line))
	{
		param_hold.clear();
		stringstream inFile(line);
		if (i>=idx1)
		{
			if (i<idx2)
			{
				while(inFile >> p)
				{
					param_hold.push_back(p);
				}
				params.push_back(param_hold);
			}
		}
		i++;
	}
	
	return params;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3e8, %rsp            # imm = 0x3E8
movl %ecx, 0xc(%rsp)
movl %edx, 0x8(%rsp)
movq %rsi, %rbx
movq %rdi, %r12
leaq 0x1e0(%rsp), %r15
movq %r15, %rdi
callq 0x21f0
movq (%rbx), %rsi
movq %r15, %rdi
movl $0x8, %edx
callq 0x20f0
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
xorl %r14d, %r14d
movq %r12, (%rsp)
movq %r14, 0x10(%r12)
leaq 0x10(%rsp), %r12
movq %r14, 0x10(%r12)
movaps %xmm0, (%r12)
leaq 0x48(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r14, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x38(%rsp), %rbx
leaq 0x58(%rsp), %r13
leaq 0x30(%rsp), %rbp
movq 0x1e0(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %edx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2390
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2844
movq 0x10(%rsp), %rax
cmpq %rax, 0x18(%rsp)
je 0x27a9
movq %rax, 0x18(%rsp)
movq %r13, %rdi
movq %rbx, %rsi
movl $0x18, %edx
callq 0x22e0
cmpl 0x8(%rsp), %r14d
setl %al
cmpl 0xc(%rsp), %r14d
setge %cl
orb %al, %cl
jne 0x2820
movq %r13, %rdi
movq %rbp, %rsi
callq 0x2100
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2814
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x2807
movsd 0x30(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x27cd
movq %r12, %rdi
movq %rbp, %rdx
callq 0x34d0
jmp 0x27cd
movq (%rsp), %rdi
movq %r12, %rsi
callq 0x3196
incl %r14d
movq %r13, %rdi
movq 0x8783(%rip), %rsi      # 0xafb0
callq 0x2130
leaq 0xd8(%rsp), %rdi
callq 0x2090
jmp 0x275f
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x2860
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x21e0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
movq (%rsp), %rbx
je 0x287b
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21e0
leaq 0x1e0(%rsp), %rdi
callq 0x2070
movq %rbx, %rax
addq $0x3e8, %rsp            # imm = 0x3E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x2908
jmp 0x28ab
jmp 0x28a6
movq %rax, %rbx
jmp 0x28cc
movq %rax, %rbx
movq 0x86fb(%rip), %rsi      # 0xafb0
leaq 0x58(%rsp), %rdi
callq 0x2130
leaq 0xd8(%rsp), %rdi
callq 0x2090
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x28e8
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x21e0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x28ff
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21e0
movq (%rsp), %rdi
callq 0x31c2
leaq 0x1e0(%rsp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x2350
// File: /workspace/github_cpp_makefile_star2_O1/JRLamontagne[P]cdice_sa/CDICEInit.cpp
// Function: allocateCarb(DICE*)
void allocateCarb(DICE *dice)
{

  dice->carb.forcoth = new double[dice->config.nPeriods];	// Exogenous forcing for other GHG
  dice->carb.forc = new double[dice->config.nPeriods];		// Increase in radiative forcing [Wm-2 from 1900]
  dice->carb.mat = new double[dice->config.nPeriods];		// Carbon concentration increase in atmosphere [GtC from 1750]
  dice->carb.mu = new double[dice->config.nPeriods];		// Carbon concentration increase in shallow oceans [GtC from 1750]
  dice->carb.ml = new double[dice->config.nPeriods];		// Carbon concentration increase in lower oceans [GtC from 1750]
  
  dice->carb.atfrac = new double[dice->config.nPeriods];
  dice->carb.atfrac2010 = new double[dice->config.nPeriods];
  dice->carb.ppm = new double[dice->config.nPeriods];


  return;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq (%rdi), %rax
leaq (,%rax,8), %rcx
testq %rax, %rax
movq $-0x1, %r14
cmovnsq %rcx, %r14
movq %r14, %rdi
callq 0x2030
movq %rax, 0x468(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x470(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x478(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x480(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x488(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x490(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x498(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x4a0(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq