// File: /workspace/github_cpp_makefile_star2_O1/dadocolussi[P]gdc-circular_queue/src/gdc_circular_queue_factory.hpp
// Function: gdc::circular_queue_factory<unsigned long, gdc::circular_queue<unsigned long>>::map_shared(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
static Q* map_shared(const std::string& name)
		{
			// Ignore size. The true size is defined in the mapped memory.
			static long page_size = ::sysconf(_SC_PAGESIZE);
			if (page_size == -1)
			{
				std::string what("sysconf: ");
				what.append(::strerror(errno));
				throw circular_queue_error(what);
			}
			assert(page_size > 0);
			
			int fd = ::shm_open(name.c_str(), O_RDWR, S_IRWXU);
			if (fd == -1)
			{
				std::string what("shm_open: ");
				what.append(::strerror(errno));
				throw circular_queue_error(what);
			}
			
			size_type init_size = footprint(0);
			auto p = ::mmap(
				NULL,
				init_size,
				PROT_READ | PROT_WRITE,
				MAP_SHARED,
				fd,
				0);
			if (p == MAP_FAILED)
			{
				std::string what("mmap: ");
				what.append(::strerror(errno));
				::close(fd);
				throw circular_queue_error(what);
			}
			
			Q* q = new (p) Q();
			size_type capacity = q->capacity();
			
			if (capacity == 0)
			{
				// Not fully initialized yet.
				::munmap(p, init_size);
				::close(fd);
				throw circular_queue_error("Not fully initialized yet.");
			}
			
			if (::munmap(p, init_size) != 0)
			{
				std::string what("munmap: ");
				what.append(::strerror(errno));
				::close(fd);
				throw circular_queue_error(what);
			}
			
			size_type fp = footprint(capacity);
			p = ::mmap(
				NULL,
				fp + capacity,
				PROT_READ | PROT_WRITE,
				MAP_SHARED,
				fd,
				0);
			if (p == MAP_FAILED)
			{
				std::string what("mmap: ");
				what.append(::strerror(errno));
				::close(fd);
				throw circular_queue_error(what);
			}
			
			q = new (p) Q();
			void* pp = reinterpret_cast<char*>(p) + fp;
			void* p2 = ::mmap(
				pp,
				capacity,
				PROT_READ | PROT_WRITE, 
				MAP_SHARED | MAP_FIXED,
				fd,
				page_size);
			if (p2 == MAP_FAILED)
			{
				std::string what("mmap: ");
				what.append(::strerror(errno));
				::munmap(p, fp + capacity);
				::close(fd);
				throw circular_queue_error(what);
			}
			
			if (::close(fd) != 0)
			{
				std::string what("close: ");
				what.append(::strerror(errno));
				::munmap(p, fp + capacity);
				::close(fd);
				throw circular_queue_error(what);
			}
			
			return q;
		}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movb 0x3d7e(%rip), %al       # 0x71c8
testb %al, %al
je 0x355c
movq 0x3d67(%rip), %rax      # 0x71c0
cmpq $-0x1, %rax
je 0x3566
testq %rax, %rax
jle 0x35e5
movq (%rbx), %rdi
movl $0x2, %esi
movl $0x1c0, %edx            # imm = 0x1C0
callq 0x2260
cmpl $-0x1, %eax
je 0x3604
movl %eax, %ebx
xorl %edi, %edi
callq 0x3ddc
movq %rax, %r14
xorl %edi, %edi
movq %rax, %rsi
movl $0x3, %edx
movl $0x1, %ecx
movl %ebx, %r8d
xorl %r9d, %r9d
callq 0x2290
cmpq $-0x1, %rax
je 0x3683
movq 0x80(%rax), %r12
movq %rax, %rdi
movq %r14, %rsi
callq 0x20f0
testq %r12, %r12
je 0x3709
testl %eax, %eax
jne 0x3742
movq %r12, %rdi
callq 0x3ddc
movq %rax, %r13
leaq (%rax,%r12), %r14
xorl %edi, %edi
movq %r14, %rsi
movl $0x3, %edx
movl $0x1, %ecx
movl %ebx, %r8d
xorl %r9d, %r9d
callq 0x2290
cmpq $-0x1, %rax
je 0x37c8
movq %rax, %r15
addq %rax, %r13
movq 0x3ca6(%rip), %r9       # 0x71c0
movq %r13, %rdi
movq %r12, %rsi
movl $0x3, %edx
movl $0x11, %ecx
movl %ebx, %r8d
callq 0x2290
cmpq $-0x1, %rax
je 0x384e
movl %ebx, %edi
callq 0x22f0
testl %eax, %eax
jne 0x38e0
movq %r15, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x2310
jmp 0x3452
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xe34(%rip), %rsi       # 0x43aa
leaq 0xe36(%rip), %rdx       # 0x43b3
movq %rsp, %rdi
callq 0x2bc8
callq 0x2040
movl (%rax), %edi
callq 0x2080
movq %rsp, %rdi
movq %rax, %rsi
callq 0x22e0
movl $0x18, %edi
callq 0x20e0
movq %rax, %r14
leaq 0x8(%rax), %rdi
movq %rsp, %rsi
callq 0x21f0
leaq 0x378c(%rip), %rax      # 0x6d48
movq %rax, (%r14)
leaq 0x37b2(%rip), %rax      # 0x6d78
movq %rax, 0x8(%r14)
leaq 0x3737(%rip), %rsi      # 0x6d08
leaq -0x81a(%rip), %rdx      # 0x2dbe
movq %r14, %rdi
callq 0x2270
jmp 0x396d
leaq 0xa18(%rip), %rdi       # 0x4004
leaq 0xb14(%rip), %rsi       # 0x4107
leaq 0xdba(%rip), %rcx       # 0x43b4
movl $0xd5, %edx
callq 0x2120
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xce2(%rip), %rsi       # 0x42f6
leaq 0xce5(%rip), %rdx       # 0x4300
movq %rsp, %rdi
callq 0x2bc8
callq 0x2040
movl (%rax), %edi
callq 0x2080
movq %rsp, %rdi
movq %rax, %rsi
callq 0x22e0
movl $0x18, %edi
callq 0x20e0
movq %rax, %r14
leaq 0x8(%rax), %rdi
movq %rsp, %rsi
callq 0x21f0
leaq 0x36ee(%rip), %rax      # 0x6d48
movq %rax, (%r14)
leaq 0x3714(%rip), %rax      # 0x6d78
movq %rax, 0x8(%r14)
leaq 0x3699(%rip), %rsi      # 0x6d08
leaq -0x8b8(%rip), %rdx      # 0x2dbe
movq %r14, %rdi
callq 0x2270
jmp 0x396d
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xc7a(%rip), %rsi       # 0x430d
leaq 0xc79(%rip), %rdx       # 0x4313
movq %rsp, %rdi
callq 0x2bc8
callq 0x2040
movl (%rax), %edi
callq 0x2080
movq %rsp, %rdi
movq %rax, %rsi
callq 0x22e0
movl %ebx, %edi
callq 0x22f0
movl $0x18, %edi
callq 0x20e0
movq %rax, %r14
leaq 0x8(%rax), %rdi
movq %rsp, %rsi
callq 0x21f0
leaq 0x3668(%rip), %rax      # 0x6d48
movq %rax, (%r14)
leaq 0x368e(%rip), %rax      # 0x6d78
movq %rax, 0x8(%r14)
leaq 0x3613(%rip), %rsi      # 0x6d08
leaq -0x93e(%rip), %rdx      # 0x2dbe
movq %r14, %rdi
callq 0x2270
jmp 0x396d
movl %ebx, %edi
callq 0x22f0
movl $0x18, %edi
callq 0x20e0
movq %rax, %r14
leaq 0xd22(%rip), %rsi       # 0x4446
movq %rax, %rdi
callq 0x3e44
leaq 0x35d5(%rip), %rsi      # 0x6d08
leaq -0x97c(%rip), %rdx      # 0x2dbe
movq %r14, %rdi
callq 0x2270
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xd0f(%rip), %rsi       # 0x4461
leaq 0xd10(%rip), %rdx       # 0x4469
movq %rsp, %rdi
callq 0x2bc8
callq 0x2040
movl (%rax), %edi
callq 0x2080
movq %rsp, %rdi
movq %rax, %rsi
callq 0x22e0
movl %ebx, %edi
callq 0x22f0
movl $0x18, %edi
callq 0x20e0
movq %rax, %r14
leaq 0x8(%rax), %rdi
movq %rsp, %rsi
callq 0x21f0
leaq 0x35a9(%rip), %rax      # 0x6d48
movq %rax, (%r14)
leaq 0x35cf(%rip), %rax      # 0x6d78
movq %rax, 0x8(%r14)
leaq 0x3554(%rip), %rsi      # 0x6d08
leaq -0x9fd(%rip), %rdx      # 0x2dbe
movq %r14, %rdi
callq 0x2270
jmp 0x396d
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xb35(%rip), %rsi       # 0x430d
leaq 0xb34(%rip), %rdx       # 0x4313
movq %rsp, %rdi
callq 0x2bc8
callq 0x2040
movl (%rax), %edi
callq 0x2080
movq %rsp, %rdi
movq %rax, %rsi
callq 0x22e0
movl %ebx, %edi
callq 0x22f0
movl $0x18, %edi
callq 0x20e0
movq %rax, %r14
leaq 0x8(%rax), %rdi
movq %rsp, %rsi
callq 0x21f0
leaq 0x3523(%rip), %rax      # 0x6d48
movq %rax, (%r14)
leaq 0x3549(%rip), %rax      # 0x6d78
movq %rax, 0x8(%r14)
leaq 0x34ce(%rip), %rsi      # 0x6d08
leaq -0xa83(%rip), %rdx      # 0x2dbe
movq %r14, %rdi
callq 0x2270
jmp 0x396d
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xaae(%rip), %rsi       # 0x430d
leaq 0xaad(%rip), %rdx       # 0x4313
movq %rsp, %rdi
callq 0x2bc8
callq 0x2040
movl (%rax), %edi
callq 0x2080
movq %rsp, %rdi
movq %rax, %rsi
callq 0x22e0
movq %r15, %rdi
movq %r14, %rsi
callq 0x20f0
movl %ebx, %edi
callq 0x22f0
movl $0x18, %edi
callq 0x20e0
movq %rax, %r14
leaq 0x8(%rax), %rdi
movq %rsp, %rsi
callq 0x21f0
leaq 0x3491(%rip), %rax      # 0x6d48
movq %rax, (%r14)
leaq 0x34b7(%rip), %rax      # 0x6d78
movq %rax, 0x8(%r14)
leaq 0x343c(%rip), %rsi      # 0x6d08
leaq -0xb15(%rip), %rdx      # 0x2dbe
movq %r14, %rdi
callq 0x2270
jmp 0x396d
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xa23(%rip), %rsi       # 0x4314
leaq 0xa23(%rip), %rdx       # 0x431b
movq %rsp, %rdi
callq 0x2bc8
callq 0x2040
movl (%rax), %edi
callq 0x2080
movq %rsp, %rdi
movq %rax, %rsi
callq 0x22e0
movq %r15, %rdi
movq %r14, %rsi
callq 0x20f0
movl %ebx, %edi
callq 0x22f0
movl $0x18, %edi
callq 0x20e0
movq %rax, %r14
leaq 0x8(%rax), %rdi
movq %rsp, %rsi
callq 0x21f0
leaq 0x33ff(%rip), %rax      # 0x6d48
movq %rax, (%r14)
leaq 0x3425(%rip), %rax      # 0x6d78
movq %rax, 0x8(%r14)
leaq 0x33aa(%rip), %rsi      # 0x6d08
leaq -0xba7(%rip), %rdx      # 0x2dbe
movq %r14, %rdi
callq 0x2270
jmp 0x396f
movq %rax, %rbx
movq %r14, %rdi
callq 0x2160
jmp 0x399a
jmp 0x3984
jmp 0x3984
jmp 0x3984
jmp 0x3984
movq %rax, %rbx
movq %r14, %rdi
callq 0x2160
jmp 0x39ac
jmp 0x39a9
jmp 0x39a9
jmp 0x3997
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
jne 0x39b5
jmp 0x39e0
jmp 0x39a9
jmp 0x39a9
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x39e0
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21b0
jmp 0x39e0
jmp 0x39dd
jmp 0x39dd
jmp 0x39dd
jmp 0x39dd
movq %rax, %rbx
movq %r14, %rdi
callq 0x2160
jmp 0x39e0
jmp 0x39dd
jmp 0x39dd
movq %rax, %rbx
movq %rbx, %rdi
callq 0x2280