// File: /workspace/github_cpp_makefile_star2_O3/cybozu[P]yrmcds/src/counter/sockets.cpp
// Function: yrmcds::counter::counter_socket::release_all()
void counter_socket::release_all() {
    for( auto& res: m_acquired_resources ) {
        uint32_t count = res.second;
        auto h = [count](const cybozu::hash_key&, object& obj) -> bool {
            if( ! obj.release(count) ) {
                cybozu::dump_stack();
                throw std::logic_error("<counter_socket::release_all> release failed");
            }
            return true;
        };
        if( ! m_hash.apply(*res.first, h, nullptr) ) {
            cybozu::dump_stack();
            throw std::logic_error("<counter_socket::release_all> not found: "
                                   + res.first->str());
        }
    }
    m_acquired_resources.clear();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq 0x190(%rdi), %r12
leaq 0x119b(%rip), %r13      # 0x14c66
leaq 0x20(%rsp), %r14
movq %rsp, %r15
movq (%r12), %r12
testq %r12, %r12
je 0x13bdf
movl 0x10(%r12), %eax
movq 0x110(%rbx), %rcx
movq 0x8(%r12), %rsi
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movl %eax, 0x20(%rsp)
leaq 0x10c2(%rip), %rax      # 0x14bc6
movq %rax, 0x38(%rsp)
movq %r13, 0x30(%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movq 0x28(%rsi), %rax
xorl %edx, %edx
divq (%rcx)
leaq (%rdx,%rdx,2), %rdi
shlq $0x4, %rdi
addq 0x8(%rcx), %rdi
movq %r14, %rdx
movq %r15, %rcx
callq 0x1530c
movl %eax, %ebp
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x13b50
movq %r15, %rdi
movq %r15, %rsi
movl $0x3, %edx
callq *%rax
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x13b67
movq %r14, %rdi
movq %r14, %rsi
movl $0x3, %edx
callq *%rax
testb %bpl, %bpl
jne 0x13ad3
callq 0xbb26
movl $0x10, %edi
callq 0x7220
movq %rax, %rbx
movq 0x8(%r12), %rax
movq 0x18(%rax), %rsi
leaq 0x10(%rsp), %r15
movq 0x20(%rax), %rdx
addq %rsi, %rdx
movq %r15, -0x10(%r15)
movq %rsp, %rdi
callq 0x9760
leaq 0x2163f(%rip), %rsi     # 0x351e9
leaq 0x20(%rsp), %rdi
movq %rsp, %rdx
callq 0xe391
movb $0x1, %bpl
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x77f0
xorl %ebp, %ebp
movq 0x323e8(%rip), %rsi     # 0x45fb8
movq 0x323b9(%rip), %rdx     # 0x45f90
movq %rbx, %rdi
callq 0x7960
addq $0x180, %rbx            # imm = 0x180
movq %rbx, %rdi
callq 0x14e24
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x13c1b
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x7500
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x13c31
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x7500
testb %bpl, %bpl
jne 0x13c56
jmp 0x13c97
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x13c56
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x7500
jmp 0x13c56
movq %rax, %r14
movq %rbx, %rdi
callq 0x7370
jmp 0x13c97
jmp 0x13ca1
jmp 0x13ca1
movq %rax, %r14
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x13c7e
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x13c97
leaq 0x20(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq %r14, %rdi
callq 0x79a0
jmp 0x13ca1
movq %rax, %rdi
callq 0x8f80
nop