// File: 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
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xd0(%rbp)
addq $0x180, %rax            # imm = 0x180
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x32e30
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x32d10
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x32ce0
testb $0x1, %al
jne 0x2f324
jmp 0x2f4fc
leaq -0x18(%rbp), %rdi
callq 0x32e60
movq %rax, %rcx
movq -0xd0(%rbp), %rax
movq %rcx, -0x28(%rbp)
movq -0x28(%rbp), %rcx
movl 0x8(%rcx), %ecx
movl %ecx, -0x2c(%rbp)
movl -0x2c(%rbp), %ecx
movl %ecx, -0x30(%rbp)
movq 0x110(%rax), %rax
movq %rax, -0xf8(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xf0(%rbp)
leaq -0x50(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
leaq -0x30(%rbp), %rsi
callq 0x30330
xorl %eax, %eax
movl %eax, %esi
leaq -0x70(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq 0x32b50
movq -0xf8(%rbp), %rdi
movq -0xf0(%rbp), %rsi
movq -0xe8(%rbp), %rdx
movq -0xe0(%rbp), %rcx
callq 0x32a70
movb %al, -0xd1(%rbp)
jmp 0x2f3b8
movb -0xd1(%rbp), %al
xorb $-0x1, %al
movb %al, -0xf9(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x32b90
leaq -0x50(%rbp), %rdi
callq 0x32bb0
movb -0xf9(%rbp), %al
testb $0x1, %al
jne 0x2f3e7
jmp 0x2f4ec
callq 0x16af0
movb $0x1, -0xc1(%rbp)
movl $0x10, %edi
callq 0x82f0
movq %rax, -0x108(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rsi
leaq -0xc0(%rbp), %rdi
callq 0x32e90
jmp 0x2f419
leaq 0x4bf18(%rip), %rsi     # 0x7b338
leaq -0xa0(%rbp), %rdi
leaq -0xc0(%rbp), %rdx
callq 0xb510
jmp 0x2f435
movq -0x108(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x8a00
jmp 0x2f44a
movq -0x108(%rbp), %rdi
movb $0x0, -0xc1(%rbp)
movq 0x7fb61(%rip), %rsi     # 0xaefc0
movq 0x7fb1a(%rip), %rdx     # 0xaef80
callq 0x8b70
jmp 0x2f521
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x32b90
leaq -0x50(%rbp), %rdi
callq 0x32bb0
jmp 0x2f518
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x2f4d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x2f4c7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x83f0
leaq -0xc0(%rbp), %rdi
callq 0x83f0
testb $0x1, -0xc1(%rbp)
jne 0x2f4de
jmp 0x2f4ea
movq -0x108(%rbp), %rdi
callq 0x8490
jmp 0x2f518
jmp 0x2f4ee
leaq -0x18(%rbp), %rdi
callq 0x32f20
jmp 0x2f30e
movq -0xd0(%rbp), %rdi
addq $0x180, %rdi            # imm = 0x180
callq 0x32f50
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0x8bc0
nopw %cs:(%rax,%rax)