// File: shutow[P]shared_mutex/test2.cpp
// Function: (anonymous namespace)::Test::test()
bool test()
		{
			gx::shared_lock l(m_cache_mutex);
			const auto number = getrand();
			auto it = m_cache.find(number);
			if (it == m_cache.end())
			{
				l.upgrade_to_exclusive();
				it = m_cache.find(number);
				if (it == m_cache.end())
				{
					auto ret = m_cache.emplace(std::make_pair(number, std::vector<uint32_t>()));
					for (uint32_t i = 0; i < number; ++i) ret.first->second.push_back(number);
					it = ret.first;
				}
				l.downgrade_to_shared();
			}
			bool res = true;
			if (it->second.size() != it->first)
			{
				return false;
			}
			else
			{
				for (auto n : it->second)
				{
					if (it->first != n)
					{
						res = false;
						break;
					}
				}
			}
			return res;
		}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rsi
movq %rsi, -0xe8(%rbp)
addq $0x48, %rsi
leaq -0x20(%rbp), %rdi
callq 0x3f20
movq -0xe8(%rbp), %rdi
callq 0x7aa0
movl %eax, -0xe0(%rbp)
jmp 0x775b
movq -0xe8(%rbp), %rdi
movl -0xe0(%rbp), %eax
movl %eax, -0x24(%rbp)
addq $0x10, %rdi
leaq -0x24(%rbp), %rsi
callq 0x9720
movq %rax, -0xf0(%rbp)
jmp 0x7781
movq -0xe8(%rbp), %rdi
movq -0xf0(%rbp), %rax
movq %rax, -0x40(%rbp)
addq $0x10, %rdi
callq 0x9780
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x9750
testb $0x1, %al
jne 0x77b6
jmp 0x7976
leaq -0x20(%rbp), %rdi
callq 0x3f60
jmp 0x77c1
movq -0xe8(%rbp), %rdi
addq $0x10, %rdi
leaq -0x24(%rbp), %rsi
callq 0x9720
movq %rax, -0xf8(%rbp)
jmp 0x77de
movq -0xe8(%rbp), %rdi
movq -0xf8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x40(%rbp)
addq $0x10, %rdi
callq 0x9780
movq %rax, -0x58(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x9750
testb $0x1, %al
jne 0x781b
jmp 0x7969
movq -0xe8(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x108(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0xa0(%rbp)
movq $0x0, -0x90(%rbp)
leaq -0xa0(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x9830
movq -0x100(%rbp), %rdx
leaq -0x88(%rbp), %rdi
leaq -0x24(%rbp), %rsi
callq 0x97f0
jmp 0x786e
movq -0x108(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x97b0
movb %dl, -0x111(%rbp)
movq %rax, -0x110(%rbp)
jmp 0x7890
movb -0x111(%rbp), %al
movq -0x110(%rbp), %rcx
movq %rcx, -0xb0(%rbp)
movb %al, -0xa8(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0x68(%rbp)
movb -0xa8(%rbp), %al
movb %al, -0x60(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x9850
leaq -0xa0(%rbp), %rdi
callq 0x8490
movl $0x0, -0xb4(%rbp)
movl -0xb4(%rbp), %eax
cmpl -0x24(%rbp), %eax
jae 0x7961
leaq -0x68(%rbp), %rdi
callq 0x9870
movq %rax, %rdi
addq $0x8, %rdi
leaq -0x24(%rbp), %rsi
callq 0x98a0
jmp 0x7906
jmp 0x7908
movl -0xb4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb4(%rbp)
jmp 0x78e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x7a87
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x7950
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x9850
leaq -0xa0(%rbp), %rdi
callq 0x8490
jmp 0x7a87
movq -0x68(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x4260
jmp 0x7974
jmp 0x7976
movb $0x1, -0xb5(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x9870
movq %rax, %rdi
addq $0x8, %rdi
callq 0x9910
movq %rax, -0x120(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x9870
movq %rax, %rcx
movq -0x120(%rbp), %rax
movl (%rcx), %ecx
cmpq %rcx, %rax
je 0x79c6
movb $0x0, -0x1(%rbp)
movl $0x1, -0xbc(%rbp)
jmp 0x7a70
leaq -0x40(%rbp), %rdi
callq 0x9870
addq $0x8, %rax
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rdi
callq 0x9930
movq %rax, -0xd0(%rbp)
movq -0xc8(%rbp), %rdi
callq 0x9960
movq %rax, -0xd8(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x9990
testb $0x1, %al
jne 0x7a19
jmp 0x7a59
leaq -0xd0(%rbp), %rdi
callq 0x99d0
movl (%rax), %eax
movl %eax, -0xdc(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x9870
movl (%rax), %eax
cmpl -0xdc(%rbp), %eax
je 0x7a49
movb $0x0, -0xb5(%rbp)
jmp 0x7a59
jmp 0x7a4b
leaq -0xd0(%rbp), %rdi
callq 0x99f0
jmp 0x7a00
jmp 0x7a5b
movb -0xb5(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movl $0x1, -0xbc(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x42b0
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
leaq -0x20(%rbp), %rdi
callq 0x42b0
movq -0x30(%rbp), %rdi
callq 0x2260
nopl (%rax)