LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/NovaGL[P]HarmonyHubControl/HarmonyHubControl.cpp
// Function: Device::toString[abi:cxx11]()
std::string toString()
    {       
	std::string ret = m_strType;
	ret.append("\":\"");        
        ret.append(m_strLabel);
	ret.append("\"");
        ret.append(",\"ID\" :");
        ret.append(m_strID);
        ret.append(",\"");
        ret.append(m_strManufacturer);
	ret.append("\":\""); 
        ret.append(m_strModel);
	ret.append("\"");      
        ret.append(",\"Functions\": { \n ");
        std::vector<Function>::iterator it = m_vecFunctions.begin();
        std::vector<Function>::iterator ite = m_vecFunctions.end();
        for(; it != ite; ++it)
        {
            ret.append(it->toString());
        }
        ret=ret.substr(0, ret.size()-2);
        ret.append("}\n");
        return ret;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %r12
movq %r12, (%rdi)
movq 0x80(%rsi), %rsi
movq 0x88(%r14), %rdx
addq %rsi, %rdx
callq 0x87b6
leaq 0x3e59(%rip), %rsi      # 0xc0f9
movq %rbx, %rdi
callq 0x34f0
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
movq %rbx, %rdi
callq 0x3100
leaq 0x4c9a(%rip), %rsi      # 0xcf59
movq %rbx, %rdi
callq 0x34f0
leaq 0x4c82(%rip), %rsi      # 0xcf50
movq %rbx, %rdi
callq 0x34f0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x3100
leaq 0x4c6c(%rip), %rsi      # 0xcf58
movq %rbx, %rdi
callq 0x34f0
movq 0x40(%r14), %rsi
movq 0x48(%r14), %rdx
movq %rbx, %rdi
callq 0x3100
leaq 0x3dee(%rip), %rsi      # 0xc0f9
movq %rbx, %rdi
callq 0x34f0
movq 0x60(%r14), %rsi
movq 0x68(%r14), %rdx
movq %rbx, %rdi
callq 0x3100
leaq 0x4c2f(%rip), %rsi      # 0xcf59
movq %rbx, %rdi
callq 0x34f0
leaq 0x4c22(%rip), %rsi      # 0xcf5b
movq %rbx, %rdi
callq 0x34f0
movq 0xa0(%r14), %r15
movq 0xa8(%r14), %rbp
cmpq %rbp, %r15
je 0x839b
leaq 0x18(%rsp), %r13
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x85a4
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x3100
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x8392
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3290
addq $0x38, %r15
cmpq %rbp, %r15
jne 0x835e
movq 0x8(%rbx), %rcx
addq $-0x2, %rcx
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x32c0
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3330
movq (%r14), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x83dc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x4b8b(%rip), %rsi      # 0xcf6e
movq %rbx, %rdi
callq 0x34f0
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8403
jmp 0x8403
jmp 0x8403
movq %rax, %r14
jmp 0x8422
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x8422
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3290
movq (%rbx), %rdi
cmpq %r12, %rdi
je 0x8436
movq (%r12), %rsi
incq %rsi
callq 0x3290
movq %r14, %rdi
callq 0x34a0
// File: /workspace/github_cpp_makefile_star2_O1/NovaGL[P]HarmonyHubControl/HarmonyHubControl.cpp
// Function: Function::toString[abi:cxx11]()
std::string toString()
    {
        std::string ret=("\"");
	ret.append(m_strName);
	ret.append("\":[");
        std::vector<Action>::iterator it = m_vecActions.begin();
        std::vector<Action>::iterator ite = m_vecActions.end();
        for(; it != ite; ++it)
        {
	ret.append("\n\t");
	ret.append("\"");
        ret.append(it->toString());
	ret.append("\",");
        }
        ret=ret.substr(0, ret.size()-1);
        ret.append("],\n");
        return ret;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, 0x20(%rsp)
movq %rax, (%rdi)
leaq 0x498e(%rip), %rsi      # 0xcf59
leaq 0x4988(%rip), %rdx      # 0xcf5a
callq 0x8846
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x3100
leaq 0x4984(%rip), %rsi      # 0xcf71
movq %rbx, %rdi
callq 0x34f0
movq 0x20(%r14), %rbp
movq 0x28(%r14), %r15
cmpq %r15, %rbp
je 0x8681
leaq 0x10(%rsp), %r14
movq %rsp, %r12
leaq 0x45d1(%rip), %r13      # 0xcbe2
movq %rbx, %rdi
leaq 0x495a(%rip), %rsi      # 0xcf75
callq 0x34f0
movq %rbx, %rdi
leaq 0x492f(%rip), %rsi      # 0xcf59
callq 0x34f0
movq %r14, (%rsp)
movq (%rbp), %rsi
movq 0x8(%rbp), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x87b6
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x3100
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x866d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3290
movq %rbx, %rdi
movq %r13, %rsi
callq 0x34f0
addq $0x60, %rbp
cmpq %r15, %rbp
jne 0x8611
movq 0x8(%rbx), %rcx
decq %rcx
movq %rsp, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x32c0
movq %rsp, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3330
movq (%r14), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x86bd
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x48b4(%rip), %rsi      # 0xcf78
movq %rbx, %rdi
callq 0x34f0
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8701
jmp 0x8701
jmp 0x8701
jmp 0x8701
movq %rax, %r15
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x8704
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3290
jmp 0x8704
movq %rax, %r15
movq (%rbx), %rdi
movq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x871c
movq (%rax), %rsi
incq %rsi
callq 0x3290
movq %r15, %rdi
callq 0x34a0
// File: /workspace/github_cpp_makefile_star2_O1/NovaGL[P]HarmonyHubControl/./rapidjson/allocators.h
// Function: rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>::MemoryPoolAllocator(unsigned long, rapidjson::CrtAllocator*)
explicit
    MemoryPoolAllocator(size_t chunkSize = kDefaultChunkCapacity, BaseAllocator* baseAllocator = 0) : 
        chunk_capacity_(chunkSize),
        baseAllocator_(baseAllocator ? baseAllocator : RAPIDJSON_NEW(BaseAllocator)()),
        shared_(static_cast<SharedData*>(baseAllocator_ ? baseAllocator_->Malloc(SIZEOF_SHARED_DATA + SIZEOF_CHUNK_HEADER) : 0))
    {
        RAPIDJSON_ASSERT(baseAllocator_ != 0);
        RAPIDJSON_ASSERT(shared_ != 0);
        if (baseAllocator) {
            shared_->ownBaseAllocator = 0;
        }
        else {
            shared_->ownBaseAllocator = baseAllocator_;
        }
        shared_->chunkHead = GetChunkHead(shared_);
        shared_->chunkHead->capacity = 0;
        shared_->chunkHead->size = 0;
        shared_->chunkHead->next = 0;
        shared_->ownBuffer = true;
        shared_->refcount = 1;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsi, (%rdi)
testq %rdx, %rdx
je 0x89be
xorl %r14d, %r14d
jmp 0x89ce
movl $0x1, %edi
callq 0x3270
movq %rax, %r14
movq %rax, %rdx
movq %rdx, 0x8(%rbx)
movl $0x38, %edi
callq 0x3350
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x8a16
movq %r14, 0x8(%rax)
movq %rax, %rcx
addq $0x20, %rcx
movq %rcx, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movq $0x0, 0x30(%rax)
movb $0x1, 0x18(%rax)
movq $0x1, 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x4771(%rip), %rdi      # 0xd18e
leaq 0x46d8(%rip), %rsi      # 0xd0fc
leaq 0x46ea(%rip), %rcx      # 0xd115
movl $0xaf, %edx
callq 0x31a0
nop
// File: /workspace/github_cpp_makefile_star2_O1/NovaGL[P]HarmonyHubControl/./rapidjson/allocators.h
// Function: rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>::~MemoryPoolAllocator()
~MemoryPoolAllocator() RAPIDJSON_NOEXCEPT {
        if (!shared_) {
            // do nothing if moved
            return;
        }
        if (shared_->refcount > 1) {
            --shared_->refcount;
            return;
        }
        Clear();
        BaseAllocator *a = shared_->ownBaseAllocator;
        if (shared_->ownBuffer) {
            baseAllocator_->Free(shared_);
        }
        RAPIDJSON_DELETE(a);
    }

// Assembly:
pushq %rbx
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x8ac7
movq 0x10(%rax), %rcx
cmpq $0x2, %rcx
jb 0x8a99
decq %rcx
movq %rcx, 0x10(%rax)
jmp 0x8ac7
movq %rdi, %rbx
callq 0x8aca
movq 0x10(%rbx), %rdi
movq 0x8(%rdi), %rbx
cmpb $0x1, 0x18(%rdi)
jne 0x8ab4
callq 0x3320
testq %rbx, %rbx
je 0x8ac7
movl $0x1, %esi
movq %rbx, %rdi
popq %rbx
jmp 0x3290
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/NovaGL[P]HarmonyHubControl/./rapidjson/allocators.h
// Function: rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>::Clear()
void Clear() RAPIDJSON_NOEXCEPT {
        RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0);
        for (;;) {
            ChunkHeader* c = shared_->chunkHead;
            if (!c->next) {
                break;
            }
            shared_->chunkHead = c->next;
            baseAllocator_->Free(c);
        }
        shared_->chunkHead->size = 0;
    }

// Assembly:
pushq %rbx
movq 0x10(%rdi), %rax
cmpq $0x0, 0x10(%rax)
je 0x8b04
movq %rdi, %rbx
movq 0x10(%rbx), %rax
movq (%rax), %rdi
movq 0x10(%rdi), %rcx
testq %rcx, %rcx
je 0x8af3
movq %rcx, (%rax)
callq 0x3320
jmp 0x8ad9
movq 0x10(%rbx), %rax
movq (%rax), %rax
movq $0x0, 0x8(%rax)
popq %rbx
retq
leaq 0x4690(%rip), %rdi      # 0xd19b
leaq 0x45ea(%rip), %rsi      # 0xd0fc
leaq 0x4698(%rip), %rcx      # 0xd1b1
movl $0x115, %edx            # imm = 0x115
callq 0x31a0
nop
// File: /workspace/github_cpp_makefile_star2_O1/NovaGL[P]HarmonyHubControl/./rapidjson/allocators.h
// Function: rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>::Malloc(unsigned long)
void* Malloc(size_t size) {
        RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0);
        if (!size)
            return NULL;

        size = RAPIDJSON_ALIGN(size);
        if (RAPIDJSON_UNLIKELY(shared_->chunkHead->size + size > shared_->chunkHead->capacity))
            if (!AddChunk(chunk_capacity_ > size ? chunk_capacity_ : size))
                return NULL;

        void *buffer = GetChunkBuffer(shared_) + shared_->chunkHead->size;
        shared_->chunkHead->size += size;
        return buffer;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x10(%rdi), %rax
cmpq $0x0, 0x10(%rax)
je 0xa42f
movq %rsi, %rbx
testq %rsi, %rsi
je 0xa425
movq %rdi, %r14
addq $0x7, %rbx
andq $-0x8, %rbx
movq (%rax), %rax
movq 0x8(%rax), %rcx
addq %rbx, %rcx
cmpq (%rax), %rcx
ja 0xa40f
movq 0x10(%r14), %rax
movq (%rax), %rcx
movq 0x8(%rcx), %rdx
leaq (%rcx,%rdx), %rax
addq $0x18, %rax
addq %rdx, %rbx
movq %rbx, 0x8(%rcx)
jmp 0xa427
movq (%r14), %rsi
cmpq %rbx, %rsi
cmovbeq %rbx, %rsi
movq %r14, %rdi
callq 0xa44e
testb %al, %al
jne 0xa3f3
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x2d65(%rip), %rdi      # 0xd19b
leaq 0x2cbf(%rip), %rsi      # 0xd0fc
leaq 0x3c38(%rip), %rcx      # 0xe07c
movl $0x141, %edx            # imm = 0x141
callq 0x31a0
// File: /workspace/github_cpp_makefile_star2_O1/NovaGL[P]HarmonyHubControl/./rapidjson/allocators.h
// Function: rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>::AddChunk(unsigned long)
bool AddChunk(size_t capacity) {
        if (!baseAllocator_)
            shared_->ownBaseAllocator = baseAllocator_ = RAPIDJSON_NEW(BaseAllocator)();
        if (ChunkHeader* chunk = static_cast<ChunkHeader*>(baseAllocator_->Malloc(SIZEOF_CHUNK_HEADER + capacity))) {
            chunk->capacity = capacity;
            chunk->size = 0;
            chunk->next = shared_->chunkHead;
            shared_->chunkHead = chunk;
            return true;
        }
        else
            return false;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
cmpq $0x0, 0x8(%rdi)
jne 0xa475
movl $0x1, %edi
callq 0x3270
movq %rax, 0x8(%rbx)
movq 0x10(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq %r14, %rdi
addq $0x18, %rdi
je 0xa485
callq 0x3350
jmp 0xa487
xorl %eax, %eax
testq %rax, %rax
je 0xa4a5
movq %r14, (%rax)
movq $0x0, 0x8(%rax)
movq 0x10(%rbx), %rcx
movq (%rcx), %rdx
movq %rdx, 0x10(%rax)
movq %rax, (%rcx)
testq %rax, %rax
setne %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/NovaGL[P]HarmonyHubControl/./rapidjson/document.h
// Function: rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>>::SetObjectRaw(rapidjson::GenericMember<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>>*, unsigned int, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>&)
void SetObjectRaw(Member* members, SizeType count, Allocator& allocator) {
        data_.f.flags = kObjectFlag;
        if (count) {
            Member* m = DoAllocMembers(count, allocator);
            SetMembersPointer(m);
            std::memcpy(static_cast<void*>(m), members, count * sizeof(Member));
#if RAPIDJSON_USE_MEMBERSMAP
            Map* &map = GetMap(m);
            MapIterator* mit = GetMapIterators(map);
            for (SizeType i = 0; i < count; i++) {
                new (&mit[i]) MapIterator(map->insert(MapPair(m[i].name.data_, i)));
            }
#endif
        }
        else
            SetMembersPointer(0);
        data_.o.size = data_.o.capacity = count;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %edx, %ebx
movq %rdi, %r14
movabsq $-0x1000000000000, %r13 # imm = 0xFFFF000000000000
movw $0x3, 0xe(%rdi)
testl %edx, %edx
je 0xa5c6
movq %rsi, %r15
movl %ebx, %r12d
shlq $0x5, %r12
movq %rcx, %rdi
movq %r12, %rsi
callq 0xa3c2
andq 0x8(%r14), %r13
orq %rax, %r13
movq %r13, 0x8(%r14)
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x31f0
jmp 0xa5ca
andq %r13, 0x8(%r14)
movl %ebx, 0x4(%r14)
movl %ebx, (%r14)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/NovaGL[P]HarmonyHubControl/csocket.cpp
// Function: csocket::~csocket()
csocket::~csocket()
{
    if ( m_socketState != csocket::CLOSED )
    {
#ifdef _WIN32
        closesocket(m_socket);
#else
        ::close(m_socket);
#endif
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x831f(%rip), %rax      # 0x13d98
movq %rax, (%rdi)
cmpl $0x0, 0x2c(%rdi)
je 0xba8a
movl 0x8(%rbx), %edi
callq 0x3500
movq 0x30(%rbx), %rdi
addq $0x40, %rbx
cmpq %rbx, %rdi
je 0xbaa3
movq (%rbx), %rsi
incq %rsi
popq %rbx
jmp 0x3290
popq %rbx
retq
movq %rax, %rdi
callq 0x84b1
nop
// File: /workspace/github_cpp_makefile_star2_O1/NovaGL[P]HarmonyHubControl/csocket.cpp
// Function: csocket::canRead(bool*, float)
int csocket::canRead( bool* readyToRead, float waitTime )
{
    if (m_socketState != CONNECTED )
    {
        return ERROR_INAPPROPRIATE_STATE;
    }

    fd_set  fds;
    FD_ZERO(&fds);
    FD_SET(m_socket, &fds);
    int     nfds = 0;

    timeval timeout;

    if ( waitTime <= 0.0f ) 
    {
        timeout.tv_sec = 0;
        timeout.tv_usec = 0;
    } 
    else 
    {
        timeout.tv_sec  = (int)(waitTime);
        timeout.tv_usec = (int)(1000000.0f * 
            (waitTime - (float)timeout.tv_sec));
    }

    
#ifdef _WIN32
    nfds = m_socket+1;
#endif

    int n = select(nfds, &fds, NULL, NULL, &timeout);
    if ( n < 0 ) 
    {
        m_socketState = ERRORED;
        return FAILURE;
    }

    if (n == 1) 
    {
        *readyToRead = true;
        return SUCCESS;
    }

    if (n == 0)
    {
        *readyToRead = false;
    }

    return SUCCESS;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x90, %rsp
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
cmpl $0x1, 0x2c(%rdi)
jne 0xbdc3
movq %rsi, %rbx
movq %rdi, %r14
xorps %xmm1, %xmm1
movaps %xmm1, 0x80(%rsp)
movaps %xmm1, 0x70(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm1, 0x50(%rsp)
movaps %xmm1, 0x40(%rsp)
movaps %xmm1, 0x30(%rsp)
movaps %xmm1, 0x20(%rsp)
movaps %xmm1, 0x10(%rsp)
movl 0x8(%rdi), %ecx
leal 0x3f(%rcx), %eax
testl %ecx, %ecx
cmovnsl %ecx, %eax
movl %eax, %edx
andl $-0x40, %edx
subl %edx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
sarl $0x6, %eax
cltq
orq %rdx, 0x10(%rsp,%rax,8)
xorps %xmm2, %xmm2
ucomiss %xmm0, %xmm2
jae 0xbd86
cvttss2si %xmm0, %eax
cltq
movq %rax, (%rsp)
cvttps2dq %xmm0, %xmm1
cvtdq2ps %xmm1, %xmm1
subss %xmm1, %xmm0
mulss 0x3ccf(%rip), %xmm0     # 0xfa48
cvttss2si %xmm0, %eax
cltq
movq %rax, 0x8(%rsp)
jmp 0xbd8a
movaps %xmm1, (%rsp)
xorl %r15d, %r15d
leaq 0x10(%rsp), %rsi
movq %rsp, %r8
xorl %edi, %edi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x3240
testl %eax, %eax
js 0xbdb0
je 0xbdc0
cmpl $0x1, %eax
jne 0xbdc3
movb $0x1, (%rbx)
jmp 0xbdc3
movl $0x2, 0x2c(%r14)
movl $0x1, %r15d
jmp 0xbdc3
movb $0x0, (%rbx)
movl %r15d, %eax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/NovaGL[P]HarmonyHubControl/csocket.cpp
// Function: csocket::read(char*, unsigned int, bool)
int csocket::read( char* pDataBuffer, unsigned int numBytesToRead, bool bReadAll )
{
    if (m_socketState != CONNECTED ) 
    {
        return ERROR_INAPPROPRIATE_STATE;
    }

    int numBytesRemaining = numBytesToRead;
    int numBytesRead = 0;

    do 
    {
#ifdef _WIN32
        numBytesRead = recv( m_socket, pDataBuffer, numBytesRemaining, 0 );
#else
        numBytesRead = static_cast<int>(::read( m_socket, pDataBuffer, numBytesRemaining));
#endif

        if (numBytesRead < 0)
        {
            if ( bReadAll ) 
            {
#ifdef _WIN32
                Sleep(BLOCK_RETRY_INTERVAL_MSECS);
#else
                usleep(BLOCK_RETRY_INTERVAL_MSECS * 1000);
#endif
            } 
            else 
            {
                return numBytesRead;
            }
        } 
        
        if ( numBytesRead > 0 ) 
        {
            numBytesRemaining -= numBytesRead;
            pDataBuffer += numBytesRead;
        }

        if (numBytesRead == 0)
        {
            break;              
        }
        
    } while ((numBytesRemaining > 0) && (bReadAll) );

    return(numBytesToRead - numBytesRemaining);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
cmpl $0x1, 0x2c(%rdi)
jne 0xbe59
movl %ecx, %ebp
movq %rsi, %r14
movq %rdi, %r15
xorl %ebx, %ebx
movl %edx, 0x4(%rsp)
movl %edx, %r13d
movl 0x8(%r15), %edi
movslq %r13d, %rdx
movq %r14, %rsi
callq 0x33d0
movq %rax, %r12
testl %r12d, %r12d
jns 0xbe22
testb %bpl, %bpl
je 0xbe59
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x33b0
movl %r12d, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
testl %r12d, %r12d
cmovleq %rbx, %rax
movl $0x0, %ecx
cmovgl %r12d, %ecx
subl %ecx, %r13d
testl %r12d, %r12d
je 0xbe4f
testl %r13d, %r13d
jle 0xbe4f
addq %rax, %r14
testb %bpl, %bpl
jne 0xbdfc
movl 0x4(%rsp), %eax
subl %r13d, %eax
movl %eax, %r12d
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/NovaGL[P]HarmonyHubControl/csocket.cpp
// Function: csocket::write(char const*, unsigned int)
int csocket::write( const char* pDataBuffer, unsigned int numBytesToWrite )
{
    if (m_socketState != CONNECTED ) 
    {
        return ERROR_INAPPROPRIATE_STATE;
    }

    int numBytesRemaining = numBytesToWrite;
    int numBytestWritten = 0;

    while (numBytesRemaining  > 0) 
    {
#ifdef _WIN32
        numBytestWritten = send( m_socket, pDataBuffer, numBytesRemaining, 0 );
#else
        numBytestWritten= ::write( m_socket, pDataBuffer, numBytesRemaining );
#endif

        if (numBytestWritten < 0) 
        {
            m_socketState = ERRORED;
            return numBytestWritten;      
        }

        numBytesRemaining  -= numBytestWritten;
        pDataBuffer += numBytestWritten;
    }

    return(numBytesToWrite - numBytesRemaining);
}

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0x1, 0x2c(%rdi)
jne 0xbec7
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %edx, %ebp
testl %edx, %edx
jle 0xbeaf
movq %rsi, %r15
movq %rdi, %r14
movl %ebx, %ebp
movl 0x8(%r14), %edi
movl %ebp, %edx
movq %r15, %rsi
callq 0x3120
testl %eax, %eax
js 0xbeb5
movl %eax, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
addq %rcx, %r15
subl %eax, %ebp
jg 0xbe8e
subl %ebp, %ebx
movl %ebx, %eax
jmp 0xbebd
movl $0x2, 0x2c(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Themaister[P]umusd/alsa.cpp
// Function: ALSA::stop()
void ALSA::stop()
{
   if (pcm)
   {
      snd_pcm_drop(pcm);
      snd_pcm_close(pcm);
   }

   pcm = nullptr;
   fds.clear();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
testq %rdi, %rdi
je 0x5b77
callq 0x5040
movq 0x30(%rbx), %rdi
callq 0x5370
movq $0x0, 0x30(%rbx)
movq 0x38(%rbx), %rax
cmpq %rax, 0x40(%rbx)
je 0x5b8d
movq %rax, 0x40(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Themaister[P]umusd/alsa.cpp
// Function: ALSA::write(std::vector<unsigned char, std::allocator<unsigned char>> const&)
void ALSA::write(const FF::Buffer &buf)
{
   auto buffer = buf.data();
   auto size = snd_pcm_bytes_to_frames(pcm, buf.size());

   while (size)
   {
      auto frames = snd_pcm_writei(pcm, buffer, size);
      if (frames == -EPIPE || frames == -EINTR || frames == -ESTRPIPE)
      {
         if (snd_pcm_recover(pcm, frames, 1) < 0)
            throw std::runtime_error("Failed to recover ALSA.\n");
      }
      else if (frames < 0)
         throw std::runtime_error("ALSA failed to write.\n");

      buffer += snd_pcm_frames_to_bytes(pcm, frames);
      size -= frames;
   }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rsi), %r14
movq 0x8(%rsi), %rsi
movq 0x30(%rdi), %rdi
subq %r14, %rsi
callq 0x5130
testq %rax, %rax
je 0x5f6e
movq %rax, %r15
movq 0x30(%rbx), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x5060
movq %rax, %r12
cmpq $-0x56, %rax
je 0x5f3e
cmpq $-0x4, %r12
je 0x5f3e
cmpq $-0x20, %r12
jne 0x5f55
movq 0x30(%rbx), %rdi
movl %r12d, %esi
movl $0x1, %edx
callq 0x53b0
testl %eax, %eax
jns 0x5f5a
jmp 0x5f7a
testq %r12, %r12
js 0x5f98
movq 0x30(%rbx), %rdi
movq %r12, %rsi
callq 0x5320
addq %rax, %r14
subq %r12, %r15
jne 0x5f1a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0x10, %edi
callq 0x5420
movq %rax, %rbx
leaq 0x917d(%rip), %rsi      # 0xf10b
movq %rax, %rdi
callq 0x50d0
jmp 0x5fb4
movl $0x10, %edi
callq 0x5420
movq %rax, %rbx
leaq 0x9178(%rip), %rsi      # 0xf124
movq %rax, %rdi
callq 0x50d0
movq 0xffdd(%rip), %rsi      # 0x15f98
movq 0x1001e(%rip), %rdx     # 0x15fe0
movq %rbx, %rdi
callq 0x51c0
jmp 0x5fcc
movq %rax, %r14
movq %rbx, %rdi
callq 0x55f0
movq %r14, %rdi
callq 0x5200
nop
// File: /workspace/github_cpp_makefile_star2_O1/Themaister[P]umusd/alsa.cpp
// Function: ALSA::pollfds[abi:cxx11]() const
EventHandled::PollList ALSA::pollfds() const
{
   EventHandled::PollList list;
   for (auto fd : fds)
   {
      list.push_back({fd.fd,
            (fd.events & POLLIN ? EPOLLIN : 0) |
            (fd.events & POLLOUT ? EPOLLOUT : 0)});
   }

   return list;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq %rdi, 0x8(%rdi)
movq %rdi, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x38(%rsi), %r14
movq 0x40(%rsi), %r15
cmpq %r15, %r14
je 0x603e
movl (%r14), %r12d
movzwl 0x4(%r14), %r13d
movl $0x18, %edi
callq 0x5390
andl $0x5, %r13d
shlq $0x20, %r13
orq %r12, %r13
movq %r13, 0x10(%rax)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x50b0
incq 0x10(%rbx)
addq $0x8, %r14
jmp 0x6003
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%rbx), %rdi
cmpq %rbx, %rdi
je 0x606b
movq (%rdi), %r15
movl $0x18, %esi
callq 0x5070
movq %r15, %rdi
cmpq %rbx, %r15
jne 0x6056
movq %r14, %rdi
callq 0x5200
nop
// File: /workspace/github_cpp_makefile_star2_O1/Themaister[P]umusd/alsa.cpp
// Function: ALSA::handle(EventHandler&)
void ALSA::handle(EventHandler &handler)
{
   if (!pcm)
      return;

   for (auto &fd : fds)
      fd.revents = 0;

   if (poll(fds.data(), fds.size(), 0) < 0)
      throw std::runtime_error("ALSA poll failed.");

   unsigned short revents;
   if (snd_pcm_poll_descriptors_revents(pcm, fds.data(),
            fds.size(), &revents) < 0)
      throw std::runtime_error("ALSA revents failed.\n");

   if (!(revents & POLLOUT))
      return;

   Audio::handle(handler);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpq $0x0, 0x30(%rdi)
je 0x60e9
movq %rsi, %rbx
movq %rdi, %r14
movq 0x38(%rdi), %rdi
movq 0x40(%r14), %rsi
cmpq %rsi, %rdi
je 0x60a4
movq %rdi, %rax
movw $0x0, 0x6(%rax)
addq $0x8, %rax
cmpq %rsi, %rax
jne 0x6095
subq %rdi, %rsi
sarq $0x3, %rsi
xorl %edx, %edx
callq 0x53f0
testl %eax, %eax
js 0x60f1
movq 0x30(%r14), %rdi
movq 0x38(%r14), %rsi
movq 0x40(%r14), %rdx
subq %rsi, %rdx
shrq $0x3, %rdx
leaq 0x6(%rsp), %rcx
callq 0x5650
testl %eax, %eax
js 0x610f
testb $0x4, 0x6(%rsp)
je 0x60e9
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6446
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x10, %edi
callq 0x5420
movq %rax, %rbx
leaq 0x9036(%rip), %rsi      # 0xf13b
movq %rax, %rdi
callq 0x50d0
jmp 0x612b
movl $0x10, %edi
callq 0x5420
movq %rax, %rbx
leaq 0x902a(%rip), %rsi      # 0xf14d
movq %rax, %rdi
callq 0x50d0
movq 0xfe66(%rip), %rsi      # 0x15f98
movq 0xfea7(%rip), %rdx      # 0x15fe0
movq %rbx, %rdi
callq 0x51c0
jmp 0x6143
movq %rax, %r14
movq %rbx, %rdi
callq 0x55f0
movq %r14, %rdi
callq 0x5200
// File: /workspace/github_cpp_makefile_star2_O1/Themaister[P]umusd/audio.cpp
// Function: Audio::handle(EventHandler&)
void Audio::handle(EventHandler &handler)
{
   if (auto tmp = ff.lock())
   {
      auto buf = tmp->decode();
      if (buf.empty())
      {
         try
         {
            remote->next();
         }
         catch(...)
         {}
      }
      else
         write(buf);
   }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movq 0x20(%rdi), %rbx
testq %rbx, %rbx
je 0x646e
movl 0x8(%rbx), %eax
testl %eax, %eax
je 0x646c
leal 0x1(%rax), %ecx
lock
cmpxchgl %ecx, 0x8(%rbx)
jne 0x645c
jmp 0x646e
xorl %ebx, %ebx
testq %rbx, %rbx
je 0x647d
movl 0x8(%rbx), %eax
testl %eax, %eax
sete %al
jmp 0x647f
movb $0x1, %al
movq 0x18(%r14), %rdi
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0x64d6
callq 0xa892
movq %rsp, %rdi
movq %rax, %rsi
callq 0x652e
movq (%rsp), %rax
cmpq 0x8(%rsp), %rax
je 0x64b6
movq (%r14), %rax
movq %rsp, %rsi
movq %r14, %rdi
callq *0x38(%rax)
jmp 0x64c0
movq 0x28(%r14), %rdi
movq (%rdi), %rax
callq *0x20(%rax)
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x64d6
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x5070
testq %rbx, %rbx
je 0x64e3
movq %rbx, %rdi
callq 0x65e2
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rdi
callq 0x5050
callq 0x5590
jmp 0x64c0
movq %rax, %r14
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x6518
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x5070
jmp 0x6518
movq %rax, %r14
testq %rbx, %rbx
je 0x6525
movq %rbx, %rdi
callq 0x65e2
movq %r14, %rdi
callq 0x5200
nop
// File: /workspace/github_cpp_makefile_star2_O1/Themaister[P]umusd/command.cpp
// Function: SocketReply::handle(EventHandler&)
void SocketReply::handle(EventHandler &handler)
{
   size_t to_write = data.size() - ptr;

   ssize_t ret = write(fd, data.data() + ptr, to_write);
   if (ret <= 0)
   {
      handler.remove(*this);
      end_cb(false);
   }
   else
      ptr += ret;

   if (ptr >= data.size())
   {
      handler.remove(*this);
      end_cb(true);
   }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x28(%rdi), %rdx
movq 0x40(%rdi), %rsi
subq %rsi, %rdx
movl 0x18(%rdi), %edi
addq 0x20(%rbx), %rsi
callq 0x5620
testq %rax, %rax
jle 0x7516
addq %rax, 0x40(%rbx)
jmp 0x7539
movq %r14, %rdi
movq %rbx, %rsi
callq 0x9bcc
movb $0x0, 0x6(%rsp)
cmpq $0x0, 0x58(%rbx)
je 0x756e
leaq 0x48(%rbx), %rdi
leaq 0x6(%rsp), %rsi
callq *0x60(%rbx)
movq 0x40(%rbx), %rax
cmpq 0x28(%rbx), %rax
jb 0x7566
movq %r14, %rdi
movq %rbx, %rsi
callq 0x9bcc
movb $0x1, 0x7(%rsp)
cmpq $0x0, 0x58(%rbx)
je 0x756e
leaq 0x48(%rbx), %rdi
leaq 0x7(%rsp), %rsi
callq *0x60(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x52e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/Themaister[P]umusd/./utils.hpp
// Function: string_split(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&)
inline std::vector<std::string> string_split(const std::string &str, const std::string &delim)
{
   std::vector<std::string> res;
   auto tmp = str;

   char *cookie;
   const char *s = strtok_r(&tmp[0], delim.c_str(), &cookie);
   while (s)
   {
      res.push_back(s);
      s = strtok_r(nullptr, delim.c_str(), &cookie);
   }

   return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
movq %rsp, %rdi
movq %rax, %rsi
callq 0x8aac
movq (%rsp), %rdi
movq (%r14), %rsi
leaq 0x20(%rsp), %rdx
callq 0x5100
testq %rax, %rax
je 0x86ff
movq %rax, %r13
leaq 0x38(%rsp), %rbp
leaq 0x28(%rsp), %r15
leaq 0x20(%rsp), %r12
movq %rbp, 0x28(%rsp)
movq %r13, %rdi
callq 0x5120
leaq (%rax,%r13), %rdx
movq %r15, %rdi
movq %r13, %rsi
callq 0x6214
movq %rbx, %rdi
movq %r15, %rsi
callq 0x8b3c
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
je 0x86ea
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5070
movq (%r14), %rsi
xorl %edi, %edi
movq %r12, %rdx
callq 0x5100
movq %rax, %r13
testq %rax, %rax
jne 0x86ac
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x871a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5070
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x876b
movq %rax, %r14
jmp 0x8750
movq %rax, %r14
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
je 0x8750
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5070
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x876b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5070
movq %rbx, %rdi
callq 0x877c
movq %r14, %rdi
callq 0x5200
nop
// File: /workspace/github_cpp_makefile_star2_O1/Themaister[P]umusd/command.cpp
// Function: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> plain_action<std::_Bind<void (Remote::* (Remote*))()>>(std::_Bind<void (Remote::* (Remote*))()>)
inline std::string plain_action(Delegate func)
{
   try
   {
      func();
      return "OK";
   }
   catch(const std::exception &e)
   {
      std::cerr << e.what() << std::endl;
      return "ERROR";
   }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rsi), %rax
movq 0x10(%rsi), %rdi
addq 0x8(%rsi), %rdi
testb $0x1, %al
je 0x9448
movq (%rdi), %rcx
movq -0x1(%rcx,%rax), %rax
callq *%rax
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x5e31(%rip), %rsi      # 0xf289
leaq 0x5e2c(%rip), %rdx      # 0xf28b
movq %rbx, %rdi
callq 0x6214
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
jmp 0x9474
movq %rax, %r14
cmpl $0x1, %edx
jne 0x94d2
movq %r14, %rdi
callq 0x5050
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
movq 0xcb0c(%rip), %rdi      # 0x15fa0
movq %rax, %rsi
callq 0x54d0
movq %rax, %rdi
callq 0x52c0
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x5dda(%rip), %rsi      # 0xf28c
leaq 0x5dd8(%rip), %rdx      # 0xf291
movq %rbx, %rdi
callq 0x6214
callq 0x5590
jmp 0x9467
jmp 0x94ca
movq %rax, %r14
callq 0x5590
movq %r14, %rdi
callq 0x5200
movq %rax, %rdi
callq 0x6156
// File: /workspace/github_cpp_makefile_star2_O1/Themaister[P]umusd/eventhandler.cpp
// Function: EventHandler::wait()
bool EventHandler::wait()
{
   struct epoll_event events[16];
   int ret = epoll_wait(epfd, events, 16, -1);
   if (ret < 0)
      throw std::runtime_error("epoll_wait() failed.\n");

   for (int i = 0; i < ret; i++)
   {
      auto cb = cb_map[events[i].data.fd];
      if (cb)
         cb();
   }

   return !killed;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe0, %rsp
movq %rdi, %rbx
movl (%rdi), %edi
leaq 0x20(%rsp), %rsi
movl $0x10, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x5190
testl %eax, %eax
js 0x9d4f
je 0x9d39
leaq 0x8(%rbx), %r14
movl %eax, %r13d
leaq 0x24(%rsp), %r15
movq %rsp, %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x9f02
movq %r12, %rdi
movq %rax, %rsi
callq 0x9f66
cmpq $0x0, 0x10(%rsp)
je 0x9d19
movq %r12, %rdi
callq *0x18(%rsp)
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x9d30
movq %r12, %rdi
movq %r12, %rsi
movl $0x3, %edx
callq *%rax
addq $0xc, %r15
decq %r13
jne 0x9cf4
movb 0x4(%rbx), %al
xorb $0x1, %al
addq $0xe0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movl $0x10, %edi
callq 0x5420
movq %rax, %r14
leaq 0x581d(%rip), %rsi      # 0xf580
movq %rax, %rdi
callq 0x50d0
movq 0xc226(%rip), %rsi      # 0x15f98
movq 0xc267(%rip), %rdx      # 0x15fe0
movq %r14, %rdi
callq 0x51c0
movq %rax, %rbx
movq %r14, %rdi
callq 0x55f0
jmp 0x9da8
movq %rax, %rbx
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x9da8
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq %rbx, %rdi
callq 0x5200
jmp 0x9db2
movq %rax, %rdi
callq 0x6156
// File: /workspace/github_cpp_makefile_star2_O1/Themaister[P]umusd/ffmpeg.cpp
// Function: FF::FF(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
FF::FF(const std::string &path)
   : fctx(nullptr), actx(nullptr), aud_stream(-1), last_pos(0.0f), planar_audio(false)
{
   av_register_all();

   try
   {
      media_info.title = path;

      if (avformat_open_input(&fctx, path.c_str(), nullptr, nullptr) < 0)
         throw std::runtime_error("Failed to open file.\n");

      if (avformat_find_stream_info(fctx, nullptr) < 0)
         throw std::runtime_error("Failed to get stream info.\n");

      resolve_codecs();
      get_media_info();
   } 
   catch(...)
   {
      if (actx)
         avcodec_close(actx);
      if (fctx)
         avformat_close_input(&fctx);
      throw;
   }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0x10(%rdi)
leaq 0x38(%rdi), %rax
movq %rax, 0x28(%rdi)
xorl %eax, %eax
movq %rax, 0x30(%rdi)
movb %al, 0x38(%rdi)
leaq 0x58(%rdi), %rcx
movq %rcx, 0x48(%rdi)
movq %rax, 0x50(%rdi)
movb %al, 0x58(%rdi)
leaq 0x78(%rdi), %rcx
movq %rcx, 0x68(%rdi)
movq %rax, 0x70(%rdi)
movb %al, 0x78(%rdi)
movups %xmm0, 0x88(%rdi)
movups %xmm0, 0x91(%rdi)
callq 0x5210
leaq 0x28(%rbx), %rdi
movq %r14, %rsi
callq 0x5310
movq (%r14), %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x5470
testl %eax, %eax
js 0xa2f3
movq (%rbx), %rdi
xorl %esi, %esi
callq 0x5500
testl %eax, %eax
js 0xa311
movq %rbx, %rdi
callq 0xa3c6
movq %rbx, %rdi
callq 0xa4d4
popq %rbx
popq %r14
popq %r15
retq
movl $0x10, %edi
callq 0x5420
movq %rax, %r14
leaq 0x52d1(%rip), %rsi      # 0xf5d8
movq %rax, %rdi
callq 0x50d0
jmp 0xa32d
movl $0x10, %edi
callq 0x5420
movq %rax, %r14
leaq 0x52c9(%rip), %rsi      # 0xf5ee
movq %rax, %rdi
callq 0x50d0
movq 0xbc64(%rip), %rsi      # 0x15f98
movq 0xbca5(%rip), %rdx      # 0x15fe0
movq %r14, %rdi
callq 0x51c0
jmp 0xa345
movq %rax, %r15
movq %r14, %rdi
callq 0x55f0
jmp 0xa35a
movq %rax, %r14
jmp 0xa38b
movq %rax, %r15
movq %r15, %rdi
callq 0x5050
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0xa370
callq 0x5610
cmpq $0x0, (%rbx)
je 0xa37e
movq %rbx, %rdi
callq 0x5540
callq 0x55c0
movq %rax, %r14
callq 0x5590
leaq 0x88(%rbx), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0xa3a9
movq 0x98(%rbx), %rsi
subq %rdi, %rsi
callq 0x5070
addq $0x18, %rbx
movq %rbx, %rdi
callq 0x9822
movq %r14, %rdi
callq 0x5200
movq %rax, %rdi
callq 0x6156
nop
// File: /workspace/github_cpp_makefile_star2_O1/Themaister[P]umusd/ffmpeg.cpp
// Function: FF::resolve_codecs()
void FF::resolve_codecs()
{
   for (unsigned i = 0; i < fctx->nb_streams; i++)
   {
      if (fctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
      {
         aud_stream = i;
         break;
      }
   }

   if (aud_stream < 0)
      throw std::runtime_error("Failed to locate audio stream.\n");

   AVCodec *codec = avcodec_find_decoder(fctx->streams[aud_stream]->codec->codec_id);
   if (!codec)
      throw std::runtime_error("Failed to locate decoder for stream.\n");

   actx = fctx->streams[aud_stream]->codec;
   if (avcodec_open2(actx, codec, nullptr) < 0)
   {
      actx = nullptr;
      throw std::runtime_error("Failed to open codec.\n");
   }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rax
movl 0x2c(%rax), %ecx
testq %rcx, %rcx
je 0xa3f8
movq 0x30(%rax), %rsi
xorl %edx, %edx
movq (%rsi,%rdx,8), %rdi
movq 0x8(%rdi), %rdi
cmpl $0x1, 0xc(%rdi)
je 0xa3f5
incq %rdx
cmpl %edx, %ecx
jne 0xa3de
jmp 0xa3f8
movl %edx, 0x10(%rbx)
movslq 0x10(%rbx), %rcx
testq %rcx, %rcx
js 0xa447
movq 0x30(%rax), %rax
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rax
movl 0x18(%rax), %edi
callq 0x5330
testq %rax, %rax
je 0xa465
movq (%rbx), %rcx
movq 0x30(%rcx), %rcx
movslq 0x10(%rbx), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x8(%rcx), %rdi
movq %rdi, 0x8(%rbx)
movq %rax, %rsi
xorl %edx, %edx
callq 0x5480
testl %eax, %eax
js 0xa483
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x10, %edi
callq 0x5420
movq %rax, %rbx
leaq 0x51c2(%rip), %rsi      # 0xf61d
movq %rax, %rdi
callq 0x50d0
jmp 0xa4a7
movl $0x10, %edi
callq 0x5420
movq %rax, %rbx
leaq 0x51c4(%rip), %rsi      # 0xf63d
movq %rax, %rdi
callq 0x50d0
jmp 0xa4a7
movq $0x0, 0x8(%rbx)
movl $0x10, %edi
callq 0x5420
movq %rax, %rbx
leaq 0x51c4(%rip), %rsi      # 0xf663
movq %rax, %rdi
callq 0x50d0
movq 0xbaea(%rip), %rsi      # 0x15f98
movq 0xbb2b(%rip), %rdx      # 0x15fe0
movq %rbx, %rdi
callq 0x51c0
jmp 0xa4c1
jmp 0xa4c1
movq %rax, %r14
movq %rbx, %rdi
callq 0x55f0
movq %r14, %rdi
callq 0x5200
// File: /workspace/github_cpp_makefile_star2_O1/Themaister[P]umusd/ffmpeg.cpp
// Function: FF::get_media_info()
void FF::get_media_info()
{
   media_info.channels = actx->channels;
   media_info.rate = actx->sample_rate;
   media_info.fmt = fmt_conv(actx->sample_fmt);

   media_info.duration = fctx->streams[aud_stream]->duration * av_q2d(fctx->streams[aud_stream]->time_base);

   get_metadata(fctx->metadata);
   get_metadata(fctx->streams[aud_stream]->metadata);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movl 0x194(%rax), %ecx
movl %ecx, 0x18(%rdi)
movl 0x190(%rax), %ecx
movl %ecx, 0x1c(%rdi)
movl 0x198(%rax), %eax
leal -0x1(%rax), %ecx
cmpl $0x7, %ecx
ja 0xa528
leaq 0x5095(%rip), %rdx      # 0xf598
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movb $0x1, 0xa0(%rbx)
movl $0x1, %eax
jmp 0xa538
movb $0x1, 0xa0(%rbx)
movl $0x3, %eax
jmp 0xa538
xorl %eax, %eax
jmp 0xa538
movb $0x1, 0xa0(%rbx)
movl $0x2, %eax
movl %eax, 0x20(%rbx)
movq (%rbx), %rax
movq 0x30(%rax), %rcx
movslq 0x10(%rbx), %rdx
movq (%rcx,%rdx,8), %rcx
cvtsi2sdq 0x28(%rcx), %xmm0
movq 0x18(%rcx), %rcx
cvtsi2sd %ecx, %xmm1
shrq $0x20, %rcx
cvtsi2sd %ecx, %xmm2
divsd %xmm2, %xmm1
mulsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss %xmm0, 0x24(%rbx)
movq 0x4b0(%rax), %rsi
movq %rbx, %rdi
callq 0xa7a4
movq (%rbx), %rax
movq 0x30(%rax), %rax
movslq 0x10(%rbx), %rcx
movq (%rax,%rcx,8), %rax
movq 0x48(%rax), %rsi
movq %rbx, %rdi
popq %rbx
jmp 0xa7a4
nop
// File: /workspace/github_cpp_makefile_star2_O1/Themaister[P]umusd/ffmpeg.cpp
// Function: FF::~FF()
FF::~FF()
{
   if (actx)
      avcodec_close(actx);
   if (fctx)
      avformat_close_input(&fctx);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0xa5b2
callq 0x5610
cmpq $0x0, (%rbx)
je 0xa5c0
movq %rbx, %rdi
callq 0x5540
movq 0x88(%rbx), %rdi
testq %rdi, %rdi
je 0xa5db
movq 0x98(%rbx), %rsi
subq %rdi, %rsi
callq 0x5070
movq 0x68(%rbx), %rdi
leaq 0x78(%rbx), %rax
cmpq %rax, %rdi
je 0xa5f3
movq (%rax), %rsi
incq %rsi
callq 0x5070
movq 0x48(%rbx), %rdi
leaq 0x58(%rbx), %rax
cmpq %rax, %rdi
je 0xa60b
movq (%rax), %rsi
incq %rsi
callq 0x5070
movq 0x28(%rbx), %rdi
addq $0x38, %rbx
cmpq %rbx, %rdi
je 0xa624
movq (%rbx), %rsi
incq %rsi
popq %rbx
jmp 0x5070
popq %rbx
retq
movq %rax, %rdi
callq 0x6156
// File: /workspace/github_cpp_makefile_star2_O1/Themaister[P]umusd/ffmpeg.cpp
// Function: FF::operator=(FF&&)
FF& FF::operator=(FF &&ff)
{
   if (actx)
   {
      avcodec_close(actx);
      actx = nullptr;
   }

   if (fctx)
      avformat_close_input(&fctx);

   std::swap(fctx, ff.fctx);
   std::swap(actx, ff.actx);
   aud_stream = ff.aud_stream;
   media_info = ff.media_info;
   buffer = std::move(ff.buffer);
   planar_audio = ff.planar_audio;

   return *this;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0xa6d6
callq 0x5610
movq $0x0, 0x8(%rbx)
cmpq $0x0, (%rbx)
je 0xa6e4
movq %rbx, %rdi
callq 0x5540
movq (%rbx), %rax
movq (%r14), %rcx
movq %rcx, (%rbx)
movq %rax, (%r14)
movq 0x8(%rbx), %rax
movq 0x8(%r14), %rcx
movq %rcx, 0x8(%rbx)
movq %rax, 0x8(%r14)
movl 0x10(%r14), %eax
movl %eax, 0x10(%rbx)
movups 0x18(%r14), %xmm0
movups %xmm0, 0x18(%rbx)
leaq 0x28(%rbx), %rdi
leaq 0x28(%r14), %rsi
callq 0x5310
leaq 0x48(%rbx), %rdi
leaq 0x48(%r14), %rsi
callq 0x5310
leaq 0x68(%rbx), %rdi
leaq 0x68(%r14), %rsi
callq 0x5310
movl $0x88, %edi
leaq (%r14,%rdi), %rsi
addq %rbx, %rdi
callq 0xac58
movb 0xa0(%r14), %al
movb %al, 0xa0(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/Themaister[P]umusd/ffmpeg.cpp
// Function: FF::get_metadata(AVDictionary*)
void FF::get_metadata(AVDictionary *meta)
{
   auto entry = av_dict_get(meta, "title", nullptr, 0);
   if (entry && entry->value)
      media_info.title = entry->value;

   entry = av_dict_get(meta, "artist", nullptr, 0);
   if (entry && entry->value)
      media_info.artist = entry->value;

   entry = av_dict_get(meta, "album", nullptr, 0);
   if (entry && entry->value)
      media_info.album = entry->value;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x4e50(%rip), %rsi      # 0xf60a
movq %r14, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x5560
testq %rax, %rax
je 0xa7f7
movq 0x8(%rax), %r15
testq %r15, %r15
je 0xa7f7
leaq 0x28(%rbx), %r12
movq 0x30(%rbx), %r13
movq %r15, %rdi
callq 0x5120
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r15, %rcx
movq %rax, %r8
callq 0x54b0
leaq 0x4e12(%rip), %rsi      # 0xf610
movq %r14, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x5560
testq %rax, %rax
je 0xa83b
movq 0x8(%rax), %r15
testq %r15, %r15
je 0xa83b
leaq 0x48(%rbx), %r12
movq 0x50(%rbx), %r13
movq %r15, %rdi
callq 0x5120
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r15, %rcx
movq %rax, %r8
callq 0x54b0
leaq 0x4dd5(%rip), %rsi      # 0xf617
movq %r14, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x5560
testq %rax, %rax
je 0xa888
movq 0x8(%rax), %r14
testq %r14, %r14
je 0xa888
movq 0x70(%rbx), %r15
addq $0x68, %rbx
movq %r14, %rdi
callq 0x5120
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %r14, %rcx
movq %rax, %r8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x54b0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/Themaister[P]umusd/ffmpeg.cpp
// Function: FF::seek(float)
bool FF::seek(float pos)
{
   int flags = (pos < last_pos) ? AVSEEK_FLAG_BACKWARD : 0;

   double seek_to = pos / av_q2d(fctx->streams[aud_stream]->time_base);
   if (seek_to < 0.0)
      seek_to = 0.0;

   if (av_seek_frame(fctx, aud_stream, seek_to, flags) < 0)
      return false;

   last_pos = pos;
   avcodec_flush_buffers(actx);
   return true;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movss 0x14(%rdi), %xmm1
xorl %ecx, %ecx
ucomiss %xmm0, %xmm1
seta %cl
movss %xmm0, 0x4(%rsp)
cvtss2sd %xmm0, %xmm0
movq (%rdi), %rdi
movq 0x30(%rdi), %rax
movslq 0x10(%rbx), %rsi
movq (%rax,%rsi,8), %rax
movq 0x18(%rax), %rax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
shrq $0x20, %rax
cvtsi2sd %eax, %xmm2
divsd %xmm2, %xmm1
divsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
maxsd %xmm0, %xmm1
cvttsd2si %xmm1, %rdx
callq 0x54f0
movl %eax, %ebp
testl %eax, %eax
js 0xac1f
movss 0x4(%rsp), %xmm0
movss %xmm0, 0x14(%rbx)
movq 0x8(%rbx), %rdi
callq 0x5410
testl %ebp, %ebp
setns %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Themaister[P]umusd/main.cpp
// Function: main
int main(int argc, char *argv[])
{
   try
   {
      Player p;
      p.run();
   }
   catch(const std::exception &e)
   {
      std::cerr << e.what() << std::endl;
   }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
leaq 0x8(%rsp), %rdi
callq 0xb2e4
leaq 0x8(%rsp), %rdi
callq 0xb5d4
leaq 0xaa5f(%rip), %rax      # 0x15a10
addq $0x10, %rax
leaq 0xb8(%rsp), %rdi
movq %rax, -0xb0(%rdi)
callq 0xb146
leaq 0x68(%rsp), %rbx
movq %rbx, %rdi
callq 0xb146
movq -0x20(%rbx), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xaff1
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5070
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xb000
callq 0x65e2
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xb00f
callq 0x65e2
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0xb112
movq -0x8(%rbx), %rdi
testq %rdi, %rdi
je 0xb02a
callq 0x65e2
xorl %eax, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r14
retq
movq %rdx, %r14
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xb09c
jmp 0xb04f
movq %rdx, %r14
movq %rax, %rbx
cmpl $0x1, %r14d
jne 0xb08c
movq %rbx, %rdi
callq 0x5050
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
movq 0xaf33(%rip), %rdi      # 0x15fa0
movq %rax, %rsi
callq 0x54d0
movq %rax, %rdi
callq 0x52c0
callq 0x5590
jmp 0xb02a
movq %rax, %rbx
callq 0x5590
movq %rbx, %rdi
callq 0x5200
movq %rax, %rdi
callq 0x6156
// File: /workspace/github_cpp_makefile_star2_O1/Themaister[P]umusd/player.cpp
// Function: Player::play_media(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void Player::play_media(const std::string &path)
{
   if (!path.empty())
      queue.current(path);

   ff = std::make_shared<FF>(queue.current());
   dev->set_media(ff);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
cmpq $0x0, 0x8(%rsi)
je 0xb602
leaq 0x40(%rbx), %rdi
callq 0xc604
leaq 0x40(%rbx), %rdi
callq 0xc782
leaq 0x28(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x20(%rsp), %r14
leaq 0xf(%rsp), %rdx
movq %r14, %rsi
movq %rax, %rcx
callq 0xc52c
movaps (%r14), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r14)
movq 0x38(%rbx), %rdi
movups %xmm0, 0x30(%rbx)
testq %rdi, %rdi
je 0xb64a
callq 0x65e2
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0xb659
callq 0x65e2
movq 0x20(%rbx), %rdi
movq 0x30(%rbx), %rax
movq %rax, 0x10(%rsp)
movq 0x38(%rbx), %rax
movq %rax, 0x18(%rsp)
testq %rax, %rax
je 0xb689
movq 0xa915(%rip), %rcx      # 0x15f90
cmpb $0x0, (%rcx)
je 0xb685
incl 0xc(%rax)
jmp 0xb689
lock
incl 0xc(%rax)
leaq 0x10(%rsp), %rsi
callq 0x642c
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xb6c9
movq 0xa8ec(%rip), %rax      # 0x15f90
cmpb $0x0, (%rax)
je 0xb6b4
movl 0xc(%rdi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0xc(%rdi)
jmp 0xb6be
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
lock
xaddl %eax, 0xc(%rdi)
cmpl $0x1, %eax
jne 0xb6c9
movq (%rdi), %rax
callq *0x18(%rax)
addq $0x38, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xb6e3
callq 0x5769
movq %rbx, %rdi
callq 0x5200
nop