LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/Sherhang[P]redis-for-cpp/credis.cpp
// Function: Redis::zrevrange(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, long, long, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, bool)
bool Redis::zrevrange(const std::string& key, int64_t start, int64_t stop, std::vector<std::string>& values, bool with_scores)
{
    std::string cmd = "ZREVRANGE " + key + " " + num2str<int64_t>(start) + " "
        + num2str<int64_t>(stop) + (with_scores ? " WITHSCORES" : "");
    values.clear();
    if (execReplyArray(cmd, values))
    {
        return true;
    }
    return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movl %r9d, %ebp
movq %r8, %rbx
movq %rsi, %rax
movq %rdi, %r14
movq %rdx, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
leaq 0xb00d(%rip), %rsi      # 0x1116f
leaq 0xf8(%rsp), %r15
movq %r15, %rdi
movq %rax, %rdx
callq 0x7822
leaq 0xba76(%rip), %rdx      # 0x11bf2
leaq 0x58(%rsp), %rdi
movq %r15, %rsi
callq 0x78ff
leaq 0x38(%rsp), %rdi
leaq 0x10(%rsp), %rdx
movq %r14, %rsi
callq 0x791e
leaq 0x78(%rsp), %rdi
leaq 0x58(%rsp), %rsi
leaq 0x38(%rsp), %rdx
callq 0x7898
leaq 0xba3c(%rip), %rdx      # 0x11bf2
leaq 0x98(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x78ff
leaq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movq %r14, %rsi
callq 0x791e
leaq 0xb8(%rsp), %rdi
leaq 0x98(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x7898
leaq 0xaf68(%rip), %rax      # 0x11163
leaq 0xb0a2(%rip), %rdx      # 0x112a4
testb %bpl, %bpl
cmovneq %rax, %rdx
leaq 0xd8(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x78ff
leaq 0xb8(%rsp), %rdi
callq 0x3180
leaq 0x18(%rsp), %rdi
callq 0x3180
leaq 0x98(%rsp), %rdi
callq 0x3180
leaq 0x78(%rsp), %rdi
callq 0x3180
leaq 0x38(%rsp), %rdi
callq 0x3180
leaq 0x58(%rsp), %rdi
callq 0x3180
leaq 0xf8(%rsp), %rdi
callq 0x3180
movq %rbx, %rdi
callq 0x79b8
leaq 0xd8(%rsp), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x486c
movl %eax, %ebx
leaq 0xd8(%rsp), %rdi
callq 0x3180
movl %ebx, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
jmp 0x6315
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x3180
jmp 0x62c9
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3180
jmp 0x62d8
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x3180
jmp 0x62ea
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x3180
jmp 0x62f9
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x3180
leaq 0x58(%rsp), %rdi
callq 0x3180
leaq 0xf8(%rsp), %rdi
callq 0x3180
movq %rbx, %rdi
callq 0x35a0
movq %rax, %rbx
jmp 0x6303
movq %rax, %rbx
jmp 0x630d
// File: /workspace/github_cpp_makefile_star2_O2/Sherhang[P]redis-for-cpp/credis.cpp
// Function: Redis::zremrangebyrank(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, long, long)
int64_t Redis::zremrangebyrank(const std::string& key, int64_t start, int64_t stop)
{
    int64_t ret = -1;
    std::string cmd = "ZREMRANGEBYRANK " + key + " " + num2str<int64_t>(start) + " " + num2str<int64_t>(stop);
    execReplyInt(cmd, ret);
    return ret;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xf8, %rsp
movq %rsi, %rax
movq %rdi, %rbx
movq %rdx, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
orq $-0x1, (%rsp)
leaq 0xae28(%rip), %rsi      # 0x1117a
leaq 0xd8(%rsp), %r14
movq %r14, %rdi
movq %rax, %rdx
callq 0x7822
leaq 0xb886(%rip), %rdx      # 0x11bf2
leaq 0x58(%rsp), %rdi
movq %r14, %rsi
callq 0x78ff
leaq 0x38(%rsp), %rdi
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
callq 0x791e
leaq 0x78(%rsp), %rdi
leaq 0x58(%rsp), %rsi
leaq 0x38(%rsp), %rdx
callq 0x7898
leaq 0xb84c(%rip), %rdx      # 0x11bf2
leaq 0x98(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x78ff
leaq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movq %rbx, %rsi
callq 0x791e
leaq 0xb8(%rsp), %rdi
leaq 0x98(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x7898
leaq 0x18(%rsp), %rdi
callq 0x3180
leaq 0x98(%rsp), %rdi
callq 0x3180
leaq 0x78(%rsp), %rdi
callq 0x3180
leaq 0x38(%rsp), %rdi
callq 0x3180
leaq 0x58(%rsp), %rdi
callq 0x3180
leaq 0xd8(%rsp), %rdi
callq 0x3180
leaq 0xb8(%rsp), %rsi
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x450c
movq (%rsp), %rbx
leaq 0xb8(%rsp), %rdi
callq 0x3180
movq %rbx, %rax
addq $0xf8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
jmp 0x64b9
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3180
jmp 0x6477
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x3180
jmp 0x6489
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x3180
jmp 0x6498
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x3180
jmp 0x64a7
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x3180
leaq 0xd8(%rsp), %rdi
callq 0x3180
movq %rbx, %rdi
callq 0x35a0
movq %rax, %rbx
jmp 0x64b1
nop
// File: /workspace/github_cpp_makefile_star2_O2/Sherhang[P]redis-for-cpp/credis.cpp
// Function: Redis::zremrangebyscore(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, double, double)
int64_t Redis::zremrangebyscore(const std::string& key, double min, double max)
{
    int64_t ret = -1;
    std::string cmd = "ZREMRANGEBYSCORE " + key + " " + num2str<double>(min) + " "
        + num2str<double>(max);
    execReplyInt(cmd, ret);
    return ret;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xf8, %rsp
movq %rsi, %rdx
movq %rdi, %rbx
movsd %xmm0, 0x10(%rsp)
movsd %xmm1, 0x8(%rsp)
orq $-0x1, (%rsp)
leaq 0xac97(%rip), %rsi      # 0x1118b
leaq 0xd8(%rsp), %r14
movq %r14, %rdi
callq 0x7822
leaq 0xb6e7(%rip), %rdx      # 0x11bf2
leaq 0x58(%rsp), %rdi
movq %r14, %rsi
callq 0x78ff
leaq 0x38(%rsp), %rdi
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
callq 0x7bba
leaq 0x78(%rsp), %rdi
leaq 0x58(%rsp), %rsi
leaq 0x38(%rsp), %rdx
callq 0x7898
leaq 0xb6ad(%rip), %rdx      # 0x11bf2
leaq 0x98(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x78ff
leaq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movq %rbx, %rsi
callq 0x7bba
leaq 0xb8(%rsp), %rdi
leaq 0x98(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x7898
leaq 0x18(%rsp), %rdi
callq 0x3180
leaq 0x98(%rsp), %rdi
callq 0x3180
leaq 0x78(%rsp), %rdi
callq 0x3180
leaq 0x38(%rsp), %rdi
callq 0x3180
leaq 0x58(%rsp), %rdi
callq 0x3180
leaq 0xd8(%rsp), %rdi
callq 0x3180
leaq 0xb8(%rsp), %rsi
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x450c
movq (%rsp), %rbx
leaq 0xb8(%rsp), %rdi
callq 0x3180
movq %rbx, %rax
addq $0xf8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
jmp 0x6658
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3180
jmp 0x6616
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x3180
jmp 0x6628
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x3180
jmp 0x6637
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x3180
jmp 0x6646
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x3180
leaq 0xd8(%rsp), %rdi
callq 0x3180
movq %rbx, %rdi
callq 0x35a0
movq %rax, %rbx
jmp 0x6650
// File: /workspace/github_cpp_makefile_star2_O2/Sherhang[P]redis-for-cpp/credis.cpp
// Function: Redis::zscore(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::string Redis::zscore(const std::string& key, const std::string& member)
{
    std::string score;
    std::string cmd = "ZSCORE " + key + " " + member;
    execReplyString(cmd, score);
    return score;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rcx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
leaq 0xab0a(%rip), %rsi      # 0x1119d
movq %rsp, %rdi
callq 0x7822
leaq 0xb550(%rip), %rdx      # 0x11bf2
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
callq 0x78ff
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movq %r15, %rdx
callq 0x3e7c
leaq 0x20(%rsp), %rdi
callq 0x3180
movq %rsp, %rdi
callq 0x3180
leaq 0x40(%rsp), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x512e
leaq 0x40(%rsp), %rdi
callq 0x3180
movq %rbx, %rax
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
leaq 0x40(%rsp), %rdi
jmp 0x6719
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0x3180
jmp 0x6716
movq %rax, %r14
movq %rsp, %rdi
callq 0x3180
jmp 0x6723
movq %rax, %r14
movq %rbx, %rdi
callq 0x3180
movq %r14, %rdi
callq 0x35a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Sherhang[P]redis-for-cpp/credis.cpp
// Function: Redis::hmset(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&)
bool Redis::hmset(const std::string& key, const std::vector<std::string> & fields, const std::vector<std::string> & values)
{
    if(_context == NULL || fields.size() != values.size()) 
    {
        return false;
    }
    if(fields.empty())
    {
        return true;
    }
    std::string cmd = "HMSET " + key;
    for(uint32_t i = 0; i < fields.size(); ++i)
    {
        cmd = cmd + " " + fields[i]+ " " + values[i];
    }
    return exec(cmd);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
cmpq $0x0, 0x8(%rdi)
je 0x6edc
movq %rdx, %r15
movq %rsi, %rdx
movq %rdi, (%rsp)
movq (%r15), %rax
movq 0x8(%r15), %r8
movq %r8, %rsi
subq %rax, %rsi
movq 0x8(%rcx), %rdi
subq (%rcx), %rdi
cmpq %rdi, %rsi
jne 0x6edc
cmpq %r8, %rax
je 0x6efc
movq %rcx, 0x10(%rsp)
leaq 0xa3af(%rip), %rsi      # 0x111b3
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x7822
xorl %ebp, %ebp
leaq 0x58(%rsp), %rbx
movq %r15, 0x8(%rsp)
movl %ebp, %ebp
movq 0x8(%r15), %rax
subq (%r15), %rax
sarq $0x5, %rax
cmpq %rbp, %rax
jbe 0x6ee0
movq %rbx, %rdi
movq %r14, %r12
movq %r14, %rsi
leaq 0xadaf(%rip), %rdx      # 0x11bf2
callq 0x7c98
movq %rbp, %r14
shlq $0x5, %r14
movq (%r15), %rdx
addq %r14, %rdx
leaq 0x38(%rsp), %r15
movq %r15, %rdi
movq %rbx, %r13
movq %rbx, %rsi
callq 0x3e7c
leaq 0x78(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
leaq 0xad78(%rip), %rdx      # 0x11bf2
callq 0x78ff
movq 0x10(%rsp), %rax
addq (%rax), %r14
leaq 0x98(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x3e7c
movq %r12, %r14
movq %r12, %rdi
movq %r15, %rsi
callq 0x3410
movq %r15, %rdi
callq 0x3180
movq %rbx, %rdi
callq 0x3180
leaq 0x38(%rsp), %rdi
callq 0x3180
movq %r13, %rbx
movq %r13, %rdi
callq 0x3180
incl %ebp
movq 0x8(%rsp), %r15
jmp 0x6e1d
xorl %ebx, %ebx
jmp 0x6efe
leaq 0x18(%rsp), %rsi
movq (%rsp), %rdi
callq 0x6f56
movl %eax, %ebx
leaq 0x18(%rsp), %rdi
callq 0x3180
jmp 0x6efe
movb $0x1, %bl
movl %ebx, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6f32
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x3180
jmp 0x6f26
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x3180
jmp 0x6f3a
movq %rax, %rbx
jmp 0x6f44
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x3180
leaq 0x18(%rsp), %rdi
callq 0x3180
movq %rbx, %rdi
callq 0x35a0
// File: /workspace/github_cpp_makefile_star2_O2/Sherhang[P]redis-for-cpp/credis.cpp
// Function: Redis::exec(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool Redis::exec(const std::string& cmd)
{
    if(_context==NULL) 
    {
        return false;
    }
    redisReply* _reply = (redisReply*)::redisCommand(_context, cmd.c_str());
    if(isError(_reply))
    {
        freeReply(_reply);
        return false;
    }
    return true;
}

// Assembly:
pushq %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x6f7c
movq (%rsi), %rsi
xorl %eax, %eax
callq 0xb190
movb $0x1, %bl
testq %rax, %rax
jne 0x6f7e
xorl %ebx, %ebx
xorl %esi, %esi
callq 0x43f8
jmp 0x6f7e
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/Sherhang[P]redis-for-cpp/credis.cpp
// Function: Redis::hmget(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&)
bool Redis::hmget(const std::string& key, const std::vector<std::string> & fields, std::vector<std::string> & values)
{
    if(_context == NULL) 
    {
        return false;
    }
    values.clear();
    std::string cmd = "HMGET " + key;
    for(uint32_t i = 0; i < fields.size(); ++i)
    {
        cmd = cmd + " " + fields[i];
    }
    return exec(cmd, values);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
xorl %ebx, %ebx
cmpq $0x0, 0x8(%rdi)
je 0x7054
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
movq %rcx, 0x10(%rsp)
movq %rcx, %rdi
callq 0x79b8
leaq 0xa1fe(%rip), %rsi      # 0x111ba
leaq 0x18(%rsp), %r13
movq %r13, %rdi
movq %r14, %rdx
callq 0x7822
leaq 0xac1f(%rip), %rbp      # 0x11bf2
leaq 0x38(%rsp), %r14
leaq 0x58(%rsp), %r15
movl %ebx, %ebx
movq 0x8(%r12), %rax
subq (%r12), %rax
sarq $0x5, %rax
cmpq %rbx, %rax
jbe 0x7034
movq %r14, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x7c98
movq %rbx, %rdx
shlq $0x5, %rdx
addq (%r12), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x3e7c
movq %r13, %rdi
movq %r15, %rsi
callq 0x3410
movq %r15, %rdi
callq 0x3180
movq %r14, %rdi
callq 0x3180
incl %ebx
jmp 0x6fdd
leaq 0x18(%rsp), %rsi
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rdx
callq 0x41d6
movl %eax, %ebx
leaq 0x18(%rsp), %rdi
callq 0x3180
movl %ebx, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7076
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x3180
jmp 0x7079
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3180
movq %rbx, %rdi
callq 0x35a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Sherhang[P]redis-for-cpp/credis.cpp
// Function: Redis::hgetall(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>&)
bool Redis::hgetall(const std::string& key, std::map<std::string, std::string>& value)
{
    if(_context == NULL) 
    {
        return false;
    }

    value.clear();
    redisReply* _reply = (redisReply*)::redisCommand(_context, "HGETALL %s", key.c_str());
    if (!isError(_reply)) 
    {
        if (_reply->type == REDIS_REPLY_ERROR) 
        {
            freeReply(_reply);
            return false;
        }
        if (_reply->type == REDIS_REPLY_ARRAY) 
        {
            for (size_t i = 0; i < _reply->elements; i = i+2) 
            {
                std::string key(_reply->element[i]->str, _reply->element[i]->len);
                std::string val(_reply->element[i+1]->str, _reply->element[i+1]->len);
                value[key] = val;
            }
            freeReply(_reply);
            return true;
        }
    }
    freeReply(_reply);
    return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
cmpq $0x0, 0x8(%rdi)
je 0x718c
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rdx, %rdi
callq 0x7f24
movq 0x8(%r15), %rdi
movq (%r14), %rdx
leaq 0xa0fd(%rip), %rsi      # 0x111c1
xorl %eax, %eax
callq 0xb190
movq %rax, %r14
testq %rax, %rax
je 0x717a
movl (%r14), %eax
cmpl $0x6, %eax
je 0x7184
cmpl $0x2, %eax
jne 0x717a
leaq 0x18(%rsp), %rbp
xorl %r13d, %r13d
leaq 0x28(%rsp), %r15
leaq 0x8(%rsp), %r12
cmpq 0x20(%r14), %r13
jae 0x719d
movq 0x28(%r14), %rax
movq (%rax,%r13,8), %rax
movq 0x18(%rax), %rsi
movq 0x10(%rax), %rdx
addq %rsi, %rdx
leaq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
movq %r15, %rdi
callq 0x7cd0
movq 0x28(%r14), %rax
movq 0x8(%rax,%r13,8), %rax
movq 0x18(%rax), %rsi
movq 0x10(%rax), %rdx
addq %rsi, %rdx
movq %rbp, 0x8(%rsp)
movq %r12, %rdi
callq 0x7cd0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7c32
movq %rax, %rdi
movq %r12, %rsi
callq 0x31e0
movq %r12, %rdi
callq 0x3180
movq %r15, %rdi
callq 0x3180
addq $0x2, %r13
jmp 0x70fe
movq %r14, %rsi
callq 0x43f8
jmp 0x718c
movq %r14, %rdi
callq 0x8ae0
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x8ae0
movb $0x1, %al
jmp 0x718e
movq %rax, %rbx
jmp 0x71bb
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3180
leaq 0x28(%rsp), %rdi
callq 0x3180
movq %rbx, %rdi
callq 0x35a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Sherhang[P]redis-for-cpp/./credis.h
// Function: float Redis::str2num<float>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
T str2num(const std::string& str)
    {
        std::stringstream ss;
        T num;
        ss << str;
        ss >> num;
        return num;
    }

// Assembly:
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movq %rsi, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3270
leaq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0x3320
leaq 0x8(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x3630
movss 0x4(%rsp), %xmm0
movss %xmm0, (%rsp)
leaq 0x8(%rsp), %rdi
callq 0x32a0
movss (%rsp), %xmm0
addq $0x190, %rsp            # imm = 0x190
popq %rbx
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x32a0
movq %rbx, %rdi
callq 0x35a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Sherhang[P]redis-for-cpp/redis_connect_pool.cpp
// Function: RedisConnectPool::~RedisConnectPool()
RedisConnectPool::~RedisConnectPool()
{
    {
	MutexGuard guard(&_mutex);
	list<redisContext*>::iterator it = _connectPool.begin();
	list<redisContext*>::iterator itEnd = _connectPool.end();
	for (; it != itEnd; ++it)
	{
	    //if(*it != NULL)
            {
                redisFree(*it);
                *it = NULL;
            }
	}
	_connectPool.clear();
    }

	pthread_mutex_destroy(&_mutex);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x68(%rdi), %r14
movq %r14, %rdi
callq 0x34b0
leaq 0x50(%rbx), %r15
movq %r15, %r12
movq (%r12), %r12
cmpq %r15, %r12
je 0x84cf
movq 0x10(%r12), %rdi
callq 0xa3d0
andq $0x0, 0x10(%r12)
jmp 0x84b4
movq %r15, %rdi
callq 0x899a
movq %r14, %rdi
callq 0x32c0
movq %r14, %rdi
callq 0x33e0
movq %r15, %rdi
callq 0x89c6
leaq 0x28(%rbx), %rdi
callq 0x3180
addq $0x8, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3180
movq %rax, %rdi
callq 0x3f0f
nop
// File: /workspace/github_cpp_makefile_star2_O2/Sherhang[P]redis-for-cpp/redis_connect_pool.cpp
// Function: RedisConnectPool::init(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool RedisConnectPool::init(int iPoolSize, const string& redisIP, int redisPort, const string& passwd)
{
    MutexGuard guard(&_mutex);    
    _redisIP = redisIP;
    _redisProt = redisPort;
    _passwd = passwd;
    _iPoolSize = iPoolSize;
    _iUsedCount = 0;
    _needPasswd = true;
    return initConnectPool();   
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r15
movl %ecx, %r12d
movq %rdx, %r13
movl %esi, %ebp
movq %rdi, %r14
leaq 0x68(%rdi), %rbx
movq %rbx, %rdi
callq 0x34b0
leaq 0x8(%r14), %rdi
movq %r13, %rsi
callq 0x31e0
movl %r12d, 0x48(%r14)
leaq 0x28(%r14), %rdi
movq %r15, %rsi
callq 0x31e0
movl %ebp, (%r14)
andl $0x0, 0x4(%r14)
movb $0x1, 0x90(%r14)
movq %r14, %rdi
callq 0x859e
movq %rbx, %rdi
callq 0x32c0
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x32c0
movq %r14, %rdi
callq 0x35a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Sherhang[P]redis-for-cpp/redis_connect_pool.cpp
// Function: RedisConnectPool::initConnectPool()
bool RedisConnectPool::initConnectPool()
{
	for (int i = 0; i < _iPoolSize; ++i)
	{
	    redisContext *redisConn = connect();
            if(redisConn)
            {
    	        _connectPool.push_back(redisConn);
            }
        }
	
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x50(%rdi), %r14
xorl %ebp, %ebp
movq %rsp, %r15
cmpl (%rbx), %ebp
jge 0x85d5
movq %rbx, %rdi
callq 0x85e2
movq %rax, (%rsp)
testq %rax, %rax
je 0x85d1
movq %r14, %rdi
movq %r15, %rsi
callq 0x89b2
incl %ebp
jmp 0x85b1
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Sherhang[P]redis-for-cpp/redis_connect_pool.cpp
// Function: RedisConnectPool::connect()
redisContext * RedisConnectPool::connect()
{
    redisContext *redisConn = NULL;
    redisConn = redisConnect(_redisIP.c_str(), _redisProt);
    if(redisConn != NULL && redisConn->err)
    {
        if (redisConn->errstr != NULL)
        {
        }
        
        if (NULL != redisConn)
        {
            redisFree(redisConn);
        }
        redisConn = NULL;
        return NULL;
    }
    if (!_needPasswd ) 
    {
        //debug 
        return redisConn;
    }
    std::string cmd = "AUTH " + (_passwd.empty()? "1245678" : _passwd);
    redisReply *reply = (redisReply*)::redisCommand(redisConn, cmd.c_str());
    if (reply == NULL && redisConn->err != 0)
    {
        return NULL;
    }

    if (reply->type == REDIS_REPLY_STATUS && strcasecmp(reply->str, "OK") != 0)
    {
        return NULL;
    }
    if (reply->type == REDIS_REPLY_ERROR) 
    {
        if (strcasecmp(reply->str, "ERR Client sent AUTH, but no password is set") == 0) 
        {
            _needPasswd = false;
            reConnect(redisConn);
        } 
        else 
        {
            return NULL;
        }
    }
    if(reply)
    {
        freeReplyObject(reply);
        reply = NULL;
    }
    
    return redisConn;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rdi, %r14
movq 0x8(%rdi), %rdi
movl 0x48(%r14), %esi
callq 0xa690
movq %rax, %rbx
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x861c
cmpl $0x0, (%rbx)
je 0x861c
movq %rbx, %rdi
callq 0xa3d0
xorl %ebx, %ebx
jmp 0x8701
cmpb $0x1, 0x90(%r14)
jne 0x8701
movq 0x30(%r14), %r15
testq %r15, %r15
je 0x8643
leaq 0x28(%r14), %rsi
leaq 0x10(%rsp), %rdi
callq 0x3470
jmp 0x8659
leaq 0x8c0b(%rip), %rsi      # 0x11255
leaq 0x10(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x3140
leaq 0x8b9b(%rip), %rsi      # 0x111fb
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x7994
leaq 0x10(%rsp), %rdi
callq 0x3180
testq %r15, %r15
movq 0x30(%rsp), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0xb190
movq %rax, %r15
testq %rax, %rax
je 0x86b6
movl (%r15), %eax
cmpl $0x6, %eax
je 0x86bd
cmpl $0x5, %eax
jne 0x86ea
movq 0x18(%r15), %rdi
leaq 0x8a69(%rip), %rsi      # 0x11114
callq 0x33b0
testl %eax, %eax
jne 0x86d1
jmp 0x86ea
cmpl $0x0, (%rbx)
jne 0x86d1
jmp 0x8693
movq 0x18(%r15), %rdi
leaq 0x8b95(%rip), %rsi      # 0x1125d
callq 0x33b0
testl %eax, %eax
je 0x86d5
xorl %ebx, %ebx
jmp 0x86f7
movb $0x0, 0x90(%r14)
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x873a
movq %r15, %rdi
callq 0x8ae0
movq 0x8(%rsp), %rbx
leaq 0x30(%rsp), %rdi
callq 0x3180
movq %rbx, %rax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3180
jmp 0x8720
movq %rax, %rbx
testq %r15, %r15
jmp 0x8732
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x3180
movq %rbx, %rdi
callq 0x35a0
// File: /workspace/github_cpp_makefile_star2_O2/Sherhang[P]redis-for-cpp/redis_connect_pool.cpp
// Function: RedisConnectPool::reConnect(redisContext*&)
bool RedisConnectPool::reConnect(redisContext* &redisConn)
{
    if(redisConn)
    {
	redisFree(redisConn);
        redisConn = NULL;
    }
	redisConn = connect();
    if(redisConn == NULL)
        return false;
    
	return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rdi
testq %rdi, %rdi
je 0x8755
callq 0xa3d0
andq $0x0, (%rbx)
movq %r14, %rdi
callq 0x85e2
movq %rax, (%rbx)
testq %rax, %rax
setne %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/Sherhang[P]redis-for-cpp/redis_connect_pool.cpp
// Function: RedisConnectPool::getConnect()
redisContext * RedisConnectPool::getConnect()
{
	redisContext *retConn = NULL;
	MutexGuard guard(&_mutex);    
	{
		if (_connectPool.empty())
		{
			return retConn;
		}
		else
		{
		    retConn = _connectPool.front();
		    _connectPool.pop_front();
                    _iUsedCount++;
		}
	}

	if (retConn == NULL)
	{
		reConnect(retConn);
	}

	return retConn;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
leaq 0x68(%rdi), %rbx
movq %rbx, %rdi
callq 0x34b0
leaq 0x50(%r14), %rdi
movq 0x50(%r14), %rax
cmpq %rdi, %rax
je 0x87be
movq 0x10(%rax), %r15
movq %r15, 0x8(%rsp)
callq 0x89be
incl 0x4(%r14)
testq %r15, %r15
jne 0x87c1
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x873a
movq 0x8(%rsp), %r15
jmp 0x87c1
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x32c0
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x32c0
movq %r14, %rdi
callq 0x35a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Sherhang[P]redis-for-cpp/redis_connect_pool.cpp
// Function: RedisConnectPool::releaseConnect(redisContext*)
void RedisConnectPool::releaseConnect(redisContext *redisConn)
{
    if(redisConn == NULL)
        return ;
    if(find(_connectPool.begin(), _connectPool.end(), redisConn) != _connectPool.end())
    {
        return;
    }
    MutexGuard guard(&_mutex);    
	if(redisConn != NULL)
    {
            if(redisConn->err)
            {
                if (!reConnect(redisConn)) 
                {
                    return;
                }
            }
        if(isUseful(redisConn))
        {
	        _connectPool.push_back(redisConn);
            _iUsedCount--;
        }
	}

	return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, 0x8(%rsp)
testq %rsi, %rsi
je 0x8898
movq %rdi, %rbx
leaq 0x50(%rdi), %r15
movq 0x50(%rdi), %rdi
leaq 0x8(%rsp), %rdx
movq %r15, %rsi
callq 0x8abb
cmpq %r15, %rax
jne 0x8898
leaq 0x68(%rbx), %r14
movq %r14, %rdi
callq 0x34b0
movq 0x8(%rsp), %rax
testq %rax, %rax
je 0x8890
cmpl $0x0, (%rax)
je 0x8872
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x873a
testb %al, %al
je 0x8890
leaq 0x8(%rsp), %rsi
callq 0x88b6
testb %al, %al
je 0x8890
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x89b2
decl 0x4(%rbx)
movq %r14, %rdi
callq 0x32c0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x32c0
movq %rbx, %rdi
callq 0x35a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Sherhang[P]redis-for-cpp/redis_connect_pool.cpp
// Function: RedisConnectPool::isUseful(redisContext*&)
bool RedisConnectPool::isUseful(redisContext* &redisConn)
{
	if (NULL == redisConn)
	{
		return false;
	}
    
	bool bPingRet = true;
	string command = "PING";
	redisReply *reply = (redisReply*)redisCommand(redisConn, command.c_str());
	if (reply == NULL && redisConn->err != 0)
	{
		bPingRet = false;
	}

	if (reply->type == REDIS_REPLY_STATUS)
	{
		string strRet = reply->str;
		if (strRet.find("PONG") != string::npos)
		{
			freeReplyObject(reply);
            reply = NULL;
		}
	}
    if(reply)
    {
	    freeReplyObject(reply);
        reply = NULL;
    }
	
	return bPingRet;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
cmpq $0x0, (%rsi)
je 0x8965
movq %rsi, %r15
leaq 0x87c1(%rip), %rsi      # 0x11094
leaq 0x30(%rsp), %rbx
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x3140
movq (%r15), %rdi
movq (%rbx), %rsi
xorl %eax, %eax
callq 0xb190
movq %rax, %r14
movb $0x1, %bl
testq %rax, %rax
jne 0x8905
movq (%r15), %rax
cmpl $0x0, (%rax)
sete %bl
cmpl $0x5, (%r14)
jne 0x8951
movq 0x18(%r14), %rsi
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x3140
leaq 0x8774(%rip), %rsi      # 0x11099
leaq 0x10(%rsp), %rdi
xorl %edx, %edx
callq 0x3620
cmpq $-0x1, %rax
je 0x8942
movq %r14, %rdi
callq 0x8ae0
xorl %r14d, %r14d
leaq 0x10(%rsp), %rdi
callq 0x3180
testq %r14, %r14
je 0x8959
movq %r14, %rdi
callq 0x8ae0
leaq 0x30(%rsp), %rdi
callq 0x3180
jmp 0x8967
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3180
jmp 0x8987
jmp 0x8984
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x3180
movq %rbx, %rdi
callq 0x35a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/hzeller[P]gcode-cli/machine-connection.cc
// Function: OpenTCPSocket(char const*)
int OpenTCPSocket(const char *host) {
    char *host_copy = NULL;
    const char *port = "8888";
    const char *colon_pos;
    if ((colon_pos = strchr(host, ':')) != NULL) {
        port = colon_pos + 1;
        host_copy = strdup(host);
        host_copy[colon_pos - host] = '\0';
        host = host_copy;
    }
    struct addrinfo addr_hints = {};
    addr_hints.ai_family = AF_INET;
    addr_hints.ai_socktype = SOCK_STREAM;

    struct addrinfo *addr_result = NULL;
    int rc;
    if ((rc = getaddrinfo(host, port, &addr_hints, &addr_result)) != 0) {
        // We're in OpenTCPSocket(), because opening as a tty failed before,
        // so make reference of that in this error message.
        fprintf(stderr,
                "Not a tty and "
                "can't resolve as TCP endpoint '%s' (port %s): %s\n",
                host, port, gai_strerror(rc));
        free(host_copy);
        return -1;
    }
    free(host_copy);
    if (addr_result == NULL) return -1;
    int fd = socket(addr_result->ai_family, addr_result->ai_socktype,
                    addr_result->ai_protocol);
    if (fd >= 0 &&
        connect(fd, addr_result->ai_addr, addr_result->ai_addrlen) < 0) {
        perror("TCP connect()");
        close(fd);
        fd = -1;
    }

    freeaddrinfo(addr_result);
    return fd;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
pushq $0x3a
popq %rsi
callq 0x20e0
testq %rax, %rax
je 0x2dfd
movq %rax, %r12
leaq 0x1(%rax), %r15
movq %rbx, %rdi
callq 0x2320
movq %rax, %r14
subq %rbx, %r12
movb $0x0, (%rax,%r12)
movq %rax, %rbx
jmp 0x2e07
leaq 0x1bd1(%rip), %r15      # 0x49d5
xorl %r14d, %r14d
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x20(%rdx)
movaps %xmm0, 0x10(%rdx)
movabsq $0x100000002, %rax      # imm = 0x100000002
movq %rax, 0x4(%rdx)
leaq 0x8(%rsp), %rcx
andq $0x0, (%rcx)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2210
testl %eax, %eax
jne 0x2e89
movq %r14, %rdi
callq 0x21f0
movq 0x8(%rsp), %rax
testq %rax, %rax
je 0x2ebc
movl 0x4(%rax), %edi
movl 0x8(%rax), %esi
movl 0xc(%rax), %edx
callq 0x2080
movl %eax, %ebx
testl %eax, %eax
js 0x2e7d
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rsi
movl 0x10(%rax), %edx
movl %ebx, %edi
callq 0x2180
testl %eax, %eax
js 0x2ecd
movq 0x8(%rsp), %rdi
callq 0x2240
jmp 0x2ebf
movq 0x4148(%rip), %rcx      # 0x6fd8
movq (%rcx), %r12
movl %eax, %edi
callq 0x2250
leaq 0x1b39(%rip), %rsi      # 0x49da
movq %r12, %rdi
movq %rbx, %rdx
movq %r15, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x2290
movq %r14, %rdi
callq 0x21f0
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1b46(%rip), %rdi      # 0x4a1a
callq 0x2190
movl %ebx, %edi
callq 0x2340
pushq $-0x1
popq %rbx
jmp 0x2e7d
nop
// File: /workspace/github_cpp_makefile_star2_O2/hzeller[P]gcode-cli/machine-connection.cc
// Function: MachineConnection::DiscardPendingInput(int, _IO_FILE*)
int MachineConnection::DiscardPendingInput(int timeout_ms,
                                           FILE *echo_discarded) {
    if (input_fd_ < 0) return 0;
    int total_bytes = 0;
    char buf[128];
    while (AwaitReadReady(input_fd_, timeout_ms) > 0) {
        int r = read(input_fd_, buf, sizeof(buf));
        if (r < 0) {
            perror("reading trouble");
            return -1;
        }
        total_bytes += r;
        if (r > 0 && echo_discarded) {
            fwrite(buf, r, 1, echo_discarded);
        }
    }
    return total_bytes;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdi, %r14
movl 0x4(%rdi), %edi
testl %edi, %edi
js 0x33bb
movq %rdx, %rbx
movl $0x3e8, %ecx            # imm = 0x3E8
movl %esi, %eax
cltd
idivl %ecx
movslq %eax, %r13
imull $0x3e8, %edx, %eax      # imm = 0x3E8
movslq %eax, %r12
xorl %r15d, %r15d
xorl %eax, %eax
cmpq $0x10, %rax
je 0x3318
andq $0x0, 0x10(%rsp,%rax,8)
incq %rax
jmp 0x3307
movl %edi, %eax
cltd
pushq $0x40
popq %rcx
idivl %ecx
movslq %eax, %rdx
shll $0x6, %eax
movl %edi, %ecx
subl %eax, %ecx
pushq $0x1
popq %rax
shlq %cl, %rax
orq %rax, 0x10(%rsp,%rdx,8)
movq %r13, (%rsp)
movq %r12, 0x8(%rsp)
incl %edi
leaq 0x10(%rsp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movq %rsp, %r8
callq 0x21a0
testl %eax, %eax
js 0x33be
movq 0x8(%rsp), %rax
cqto
movl $0x3e8, %ecx            # imm = 0x3E8
idivq %rcx
testl %eax, %eax
jle 0x33be
movl 0x4(%r14), %edi
movl $0x80, %edx
leaq 0x90(%rsp), %rsi
callq 0x22a0
movq %rax, %rbp
testl %ebp, %ebp
js 0x33d3
testq %rbx, %rbx
sete %al
testl %ebp, %ebp
sete %cl
orb %al, %cl
jne 0x33af
movl %ebp, %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
leaq 0x90(%rsp), %rdi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x2330
addl %ebp, %r15d
movl 0x4(%r14), %edi
jmp 0x3305
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x164e(%rip), %rdi      # 0x4a28
callq 0x2190
pushq $-0x1
popq %r15
jmp 0x33be
nop
// File: /workspace/github_cpp_makefile_star2_O2/hzeller[P]gcode-cli/machine-connection.cc
// Function: MachineConnection::WriteBlocks(char*, std::vector<std::basic_string_view<char, std::char_traits<char>>, std::allocator<std::basic_string_view<char, std::char_traits<char>>>> const&)
bool MachineConnection::WriteBlocks(
    char *scratch_buffer, const std::vector<std::string_view> &blocks) {
    // Note: not using writev(), as snippets can be a lot and writev() has a
    // bunch of limitations (e.g. UIO_MAXIOV == 1024). Thus simply
    // reassmbling into buffer.
    char *pos = scratch_buffer;
    for (auto block : blocks) {
        memcpy(pos, block.data(), block.size());
        pos += block.size();
    }
    return reliable_write(output_fd_, scratch_buffer, pos - scratch_buffer);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
movq (%rdx), %r13
movq 0x8(%rdx), %rbp
movq %rsi, %r14
cmpq %rbp, %r13
je 0x3422
movq (%r13), %r12
movq 0x8(%r13), %rsi
movq %r14, %rdi
movq %r12, %rdx
callq 0x2170
addq %r12, %r14
addq $0x10, %r13
jmp 0x3401
movl (%r15), %ebp
subl %ebx, %r14d
movl %r14d, %r15d
testl %r14d, %r14d
je 0x3452
movslq %r15d, %rdx
movl %ebp, %edi
movq %rbx, %rsi
callq 0x20c0
movl %r15d, %r14d
subl %eax, %r14d
movl %eax, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
addq %rcx, %rbx
testl %eax, %eax
jns 0x3428
testl %r15d, %r15d
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/hzeller[P]gcode-cli/buffered-line-reader.cc
// Function: BufferedLineReader::Refill()
bool BufferedLineReader::Refill() {
    data_begin_ = buffer_;
    data_end_ = data_begin_;
    if (eof_) return false;
    if (!remainder_.empty()) {
        // get remainder to the beginning of the buffer.
        memmove(data_begin_, remainder_.data(), remainder_.size());
        data_end_ += remainder_.size();
    }
    const ssize_t r = read(fd_, data_end_, buffer_size_ - remainder_.size());
    if (r > 0) {
        data_end_ += r;
    } else {
        eof_ = true;
        if (r < 0) perror("Reading input");
        if (!remainder_.empty()) {
            // Close remainder with a newline
            *data_end_++ = '\n';
        }
    }
    remainder_ = {};
    return data_end_ > data_begin_;
}

// Assembly:
movq 0x10(%rdi), %rsi
movq %rsi, 0x20(%rdi)
movq %rsi, 0x28(%rdi)
cmpb $0x0, 0x19(%rdi)
je 0x38a7
xorl %eax, %eax
retq
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x30(%rdi), %rdx
testq %rdx, %rdx
je 0x38d7
movq 0x38(%rbx), %rax
movq %rsi, %rdi
movq %rax, %rsi
callq 0x22e0
movq 0x30(%rbx), %rax
movq 0x28(%rbx), %rsi
addq %rax, %rsi
movq %rsi, 0x28(%rbx)
jmp 0x38d9
xorl %eax, %eax
leaq 0x30(%rbx), %r14
movl (%rbx), %edi
movq 0x8(%rbx), %rdx
subq %rax, %rdx
callq 0x22a0
testq %rax, %rax
jle 0x38fa
addq 0x28(%rbx), %rax
movq %rax, 0x28(%rbx)
jmp 0x391a
movb $0x1, 0x19(%rbx)
js 0x3930
cmpq $0x0, 0x30(%rbx)
movq 0x28(%rbx), %rax
je 0x391a
leaq 0x1(%rax), %rcx
movq %rcx, 0x28(%rbx)
movb $0xa, (%rax)
movq 0x28(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
cmpq 0x20(%rbx), %rax
seta %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x11f7(%rip), %rdi      # 0x4b2e
callq 0x2190
jmp 0x3900
// File: /workspace/github_cpp_makefile_star2_O2/hzeller[P]gcode-cli/buffered-line-reader.cc
// Function: BufferedLineReader::ReadNextLines(unsigned long)
std::vector<std::string_view> BufferedLineReader::ReadNextLines(size_t n) {
    std::vector<std::string_view> result;
    result.reserve(n);
    if (data_begin_ >= data_end_ && !Refill()) {
        return result;
    }
    char *end_line;
    while ((end_line = std::find_if(data_begin_, data_end_, [](char c) {
                return c == '\n' || c == '\r';
            })) != data_end_) {
        auto line = MakeCommentFreeLine(data_begin_, end_line);
        if (!line.empty()) result.push_back(line);
        data_begin_ = end_line + 1;
        if (result.size() >= n) {
            return result;
        }
    }
    remainder_ = std::string_view(data_begin_, data_end_ - data_begin_);
    data_begin_ = data_end_;  // consume all.
    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movq %rdx, %rsi
callq 0x3bf4
movq 0x20(%r14), %rsi
cmpq 0x28(%r14), %rsi
jb 0x3985
movq %r14, %rdi
callq 0x3892
testb %al, %al
je 0x3ae1
movq 0x20(%r14), %rsi
movq %rsp, %r12
movq 0x28(%r14), %rax
movq %rax, %rcx
subq %rsi, %rcx
movq %rcx, %r8
sarq $0x2, %r8
xorl %edi, %edi
xorl %edx, %edx
testq %r8, %r8
jle 0x3a6f
movzbl (%rsi,%rdi,4), %r9d
cmpl $0xa, %r9d
je 0x39f9
cmpl $0xd, %r9d
je 0x39f9
movzbl 0x1(%rsi,%rdi,4), %r9d
cmpl $0xa, %r9d
je 0x3a01
cmpl $0xd, %r9d
je 0x3a01
movzbl 0x2(%rsi,%rdi,4), %r9d
cmpl $0xa, %r9d
je 0x3a0c
cmpl $0xd, %r9d
je 0x3a0c
movzbl 0x3(%rsi,%rdi,4), %r9d
cmpl $0xa, %r9d
je 0x3a18
cmpl $0xd, %r9d
je 0x3a18
decq %r8
addq $-0x4, %rdx
incq %rdi
jmp 0x399d
movq %rsi, %r13
subq %rdx, %r13
jmp 0x3a22
movq %rsi, %r13
subq %rdx, %r13
incq %r13
jmp 0x3a22
movq %rsi, %r13
subq %rdx, %r13
addq $0x2, %r13
jmp 0x3a22
movq %rsi, %r13
subq %rdx, %r13
addq $0x3, %r13
cmpq %rax, %r13
je 0x3ad5
movq %r14, %rdi
movq %r13, %rdx
callq 0x3b08
movq %rax, (%rsp)
movq %rdx, 0x8(%rsp)
testq %rax, %rax
je 0x3a4f
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3c9c
incq %r13
movq %r13, 0x20(%r14)
movq 0x8(%rbx), %rax
subq (%rbx), %rax
sarq $0x4, %rax
movq %r13, %rsi
cmpq %r15, %rax
jb 0x3988
jmp 0x3ae1
movq %rsi, %r13
subq %rdx, %r13
leaq (%rcx,%rdx), %r8
cmpq $0x1, %r8
je 0x3abe
cmpq $0x3, %r8
je 0x3a8d
cmpq $0x2, %r8
je 0x3aa4
jmp 0x3ad5
movzbl (%rsi,%rdi,4), %edi
cmpl $0xa, %edi
je 0x3a22
cmpl $0xd, %edi
je 0x3a22
movq %rsi, %r13
subq %rdx, %r13
incq %r13
movzbl (%r13), %edx
cmpl $0xa, %edx
je 0x3a22
cmpl $0xd, %edx
je 0x3a22
incq %r13
movzbl (%r13), %edx
cmpl $0xa, %edx
je 0x3a22
cmpl $0xd, %edx
je 0x3a22
movq %rcx, 0x30(%r14)
movq %rsi, 0x38(%r14)
movq %rax, 0x20(%r14)
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x3af4
movq %rax, %r14
movq %rbx, %rdi
callq 0x2d8a
movq %r14, %rdi
callq 0x2300
nop
// File: /workspace/github_cpp_makefile_star2_O2/hzeller[P]gcode-cli/buffered-line-reader.cc
// Function: BufferedLineReader::MakeCommentFreeLine(char*, char*)
std::string_view BufferedLineReader::MakeCommentFreeLine(char *first,
                                                         char *last) {
    if (remove_comments_) {
        char *start_of_comment = (char *)memchr(first, ';', last - first + 1);
        if (start_of_comment) last = start_of_comment - 1;
    }
    while (first <= last && isspace(*first)) first++;
    while (last >= first && isspace(*last)) last--;  // also removing newline
    if (last < first) return {};
    *++last = '\n';  // Fresh newline behind resulting new last.
    return std::string_view(first, last - first + 1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
cmpb $0x1, 0x18(%rdi)
jne 0x3b38
movq %r14, %rdx
subq %rbx, %rdx
incq %rdx
pushq $0x3b
popq %rsi
movq %rbx, %rdi
callq 0x21d0
leaq -0x1(%rax), %rcx
testq %rax, %rax
cmovneq %rcx, %r14
movq %r14, %r15
subq %rbx, %r15
addq $0x2, %r15
cmpq %r14, %rbx
ja 0x3b6e
movsbl (%rbx), %edi
callq 0x2060
testl %eax, %eax
je 0x3b6e
incq %rbx
decq %r15
jmp 0x3b42
movsbl (%r14), %edi
callq 0x2060
testl %eax, %eax
je 0x3b7a
decq %r14
decq %r15
cmpq %rbx, %r14
jae 0x3b5b
xorl %r15d, %r15d
xorl %ebx, %ebx
jmp 0x3b7f
movb $0xa, 0x1(%r14)
movq %r15, %rax
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/hzeller[P]gcode-cli/buffered-line-reader.cc
// Function: BufferedLineReader::ReadLine()
std::string_view BufferedLineReader::ReadLine() {
    while (!is_eof()) {
        auto lines = ReadNextLines(1);
        if (lines.empty()) continue;  // could happen at buffer switchover
        return lines[0];
    }
    return {};
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movq %rsp, %r12
cmpb $0x0, 0x19(%r14)
jne 0x3bda
movq %r12, %rdi
movq %r14, %rsi
pushq $0x1
popq %rdx
callq 0x393e
movq (%rsp), %rbp
movq 0x8(%rsp), %r13
cmpq %r13, %rbp
je 0x3bcb
movq (%rbp), %rbx
movq 0x8(%rbp), %r15
movq %r12, %rdi
callq 0x2d8a
cmpq %r13, %rbp
je 0x3ba0
jmp 0x3bdf
xorl %ebx, %ebx
xorl %r15d, %r15d
movq %rbx, %rax
movq %r15, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Hybryd[P]HyRoadGenerator/Polygon.cpp
// Function: Polygon::area()
double Polygon::area()
{
  double res=0;
  for(int i=0;i<size();++i)
    res+=(poly[i].second.x()-poly[i].first.x())*(poly[i].first.y()+poly[i].second.y());
  return fabs(res)/2.0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
subq %rax, %rcx
shrq $0x4, %rcx
xorl %edx, %edx
testl %ecx, %ecx
cmovlel %edx, %ecx
shlq $0x4, %rcx
xorpd %xmm0, %xmm0
cmpq %rdx, %rcx
je 0x14f9
movss 0x4(%rax,%rdx), %xmm1
movss 0x8(%rax,%rdx), %xmm2
subss (%rax,%rdx), %xmm2
addss 0xc(%rax,%rdx), %xmm1
mulss %xmm2, %xmm1
cvtss2sd %xmm1, %xmm1
addsd %xmm1, %xmm0
addq $0x10, %rdx
jmp 0x14cb
andpd 0x2b0f(%rip), %xmm0     # 0x4010
mulsd 0x2b37(%rip), %xmm0     # 0x4040
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Hybryd[P]HyRoadGenerator/Polygon.cpp
// Function: Polygon::diameter()
double Polygon::diameter()
{
  double res=0;
  for(int i=0;i<size();++i)
    res=MAXI(res,sqrt((poly[i].second.x() - poly[i].first.x())*(poly[i].second.x() - poly[i].first.x()) + (poly[i].second.y() - poly[i].first.y())*(poly[i].second.y() - poly[i].first.y())));

  return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
subq %rax, %rcx
shrq $0x4, %rcx
xorl %edx, %edx
testl %ecx, %ecx
cmovlel %edx, %ecx
shlq $0x4, %rcx
xorpd %xmm0, %xmm0
cmpq %rdx, %rcx
je 0x1567
movss 0x8(%rax,%rdx), %xmm1
movss 0xc(%rax,%rdx), %xmm2
subss (%rax,%rdx), %xmm1
subss 0x4(%rax,%rdx), %xmm2
mulss %xmm2, %xmm2
mulss %xmm1, %xmm1
addss %xmm2, %xmm1
cvtss2sd %xmm1, %xmm1
sqrtsd %xmm1, %xmm1
maxsd %xmm1, %xmm0
addq $0x10, %rdx
jmp 0x152d
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Hybryd[P]HyRoadGenerator/Polygon.cpp
// Function: Polygon::width()
double Polygon::width()
{
  double res=100000000; // the power of infinity
  for(int i=0;i<size();++i)
    res=MINI(res,sqrt((poly[i].second.x() - poly[i].first.x())*(poly[i].second.x() - poly[i].first.x()) + (poly[i].second.y() - poly[i].first.y())*(poly[i].second.y() - poly[i].first.y())));
  return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
subq %rax, %rcx
shrq $0x4, %rcx
xorl %edx, %edx
testl %ecx, %ecx
cmovlel %edx, %ecx
shlq $0x4, %rcx
movsd 0x2ab9(%rip), %xmm0     # 0x4048
cmpq %rdx, %rcx
je 0x15c9
movss 0x8(%rax,%rdx), %xmm1
movss 0xc(%rax,%rdx), %xmm2
subss (%rax,%rdx), %xmm1
subss 0x4(%rax,%rdx), %xmm2
mulss %xmm2, %xmm2
mulss %xmm1, %xmm1
addss %xmm2, %xmm1
cvtss2sd %xmm1, %xmm1
sqrtsd %xmm1, %xmm1
minsd %xmm1, %xmm0
addq $0x10, %rdx
jmp 0x158f
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Hybryd[P]HyRoadGenerator/Polygon.cpp
// Function: Polygon::isClosed()
bool Polygon::isClosed()
{
  bool res=true;
  for(int i=0;i<size()-1;++i)
    res &= (poly[i].second == poly[i+1].first);
  res &= (poly[size()-1].second == poly[0].first);
  return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rcx
movq 0x8(%rdi), %rdx
subq %rcx, %rdx
shrq $0x4, %rdx
decl %edx
xorl %esi, %esi
testl %edx, %edx
movl $0x0, %edi
cmovgl %edx, %edi
shlq $0x4, %rdi
movb $0x1, %al
cmpq %rsi, %rdi
je 0x1628
movss 0xc(%rcx,%rsi), %xmm0
movss 0x14(%rcx,%rsi), %xmm1
movss 0x10(%rcx,%rsi), %xmm2
movss 0x8(%rcx,%rsi), %xmm3
cmpeqps %xmm2, %xmm3
cmpeqps %xmm0, %xmm1
andps %xmm3, %xmm1
movd %xmm1, %r8d
andb %r8b, %al
addq $0x10, %rsi
jmp 0x15f2
movslq %edx, %rdx
shlq $0x4, %rdx
movss 0xc(%rcx,%rdx), %xmm0
movss 0x4(%rcx), %xmm1
movss 0x8(%rcx,%rdx), %xmm2
movss (%rcx), %xmm3
cmpeqps %xmm2, %xmm3
cmpeqps %xmm0, %xmm1
andps %xmm3, %xmm1
movd %xmm1, %ecx
andb %cl, %al
andb $0x1, %al
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Hybryd[P]HyRoadGenerator/Polygon.cpp
// Function: Polygon::isAcceptable(double)
bool Polygon::isAcceptable(double x)
{
  //return (area()/perimeter() > x); // notgood
  bool res;
  double w=width();
  if(w==0)
    res=false;
  else
  {
    res = (diameter()/w < x);
//    if(res)
//      std::cerr << diameter()/w << std::endl;
  }
  return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
movsd %xmm0, -0x18(%rbp)
movq %rdi, %rbx
callq 0x156a
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x1680
jp 0x1680
xorl %eax, %eax
jmp 0x169e
movq %rbx, %rdi
movsd %xmm0, -0x10(%rbp)
callq 0x150c
divsd -0x10(%rbp), %xmm0
movsd -0x18(%rbp), %xmm1
ucomisd %xmm0, %xmm1
seta %al
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Hybryd[P]HyRoadGenerator/Polygon.cpp
// Function: Polygon::getBary()
Point Polygon::getBary()
{
  Point res(0,0);
  
  for(int i=0;i<size();++i)
  {
    res.x(res.x() + poly[i].first.x());
    res.y(res.y() + poly[i].first.y());
  }
  
  res.x(res.x()/size());
  res.y(res.y()/size());

  return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rsi), %rdx
movq 0x8(%rsi), %rcx
subq %rdx, %rcx
shrq $0x4, %rcx
xorl %esi, %esi
testl %ecx, %ecx
movl $0x0, %r8d
cmovgl %ecx, %r8d
movq %rdi, %rax
shlq $0x4, %r8
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
cmpq %rsi, %r8
je 0x16e9
addss (%rdx,%rsi), %xmm1
addss 0x4(%rdx,%rsi), %xmm0
addq $0x10, %rsi
jmp 0x16d3
cvtsi2ss %ecx, %xmm2
divss %xmm2, %xmm1
movss %xmm1, (%rax)
divss %xmm2, %xmm0
movss %xmm0, 0x4(%rax)
popq %rbp
retq