// File: /workspace/github_cpp_makefile_star2_O1/nmmmnu[P]HM3/hm3/multitableiterator/collectioniterator_impl.h
// Function: hm3::multitableiterator::CollectionIterator<std::vector<hm3::SkipList, std::allocator<hm3::SkipList>>>::dereference_() const
const Pair &CollectionIterator<CONTAINER>::dereference_() const{
	std::vector<size_type>	indexes;
	const Pair		*cpair = nullptr;

	// step 1: find first minimal add other minimals into index
	for(size_type i = 0; i < it_.size(); ++i){
		const Pair &pair = *it_[i];

		// skip if is null
		if ( ! pair )
			continue;

		// initialize
		if (cpair == nullptr){
			indexes.clear();
			indexes.push_back(i);
			cpair = &pair;

			continue;
		}

		int const cmp = pair.cmp(*cpair);

		// if is smaller, start over
		if (cmp < 0){
			indexes.clear();
			indexes.push_back(i);
			cpair = &pair;

			continue;
		}

		// same, add to list.
		if (cmp == 0){
			indexes.push_back(i);

			// if newer, swap
			if ( pair.cmpTime(*cpair) > 0 )
				cpair = &pair;
		}
	}

	// SETTING MUTABLE VARIABLES
	if (cpair){
		tmp_pair = cpair;
		tmp_index = std::move(indexes);

		return *tmp_pair;
	}else{
		tmp_pair = cpair;

		return Pair::zero();
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
xorl %r12d, %r12d
movq %r12, 0x10(%rsp)
movq %r12, 0x20(%rsp)
movq (%rdi), %rax
cmpq %rax, 0x8(%rdi)
je 0x873f
xorl %r13d, %r13d
leaq 0x8ed2(%rip), %r14      # 0x114e8
leaq 0x20(%rsp), %r15
xorl %ecx, %ecx
shlq $0x4, %rcx
leaq (%rax,%rcx), %rbp
leaq (%rax,%rcx), %rsi
addq $0x8, %rsi
movq %rbp, %rdi
callq 0xa71a
movq %r14, %r12
testb %al, %al
jne 0x8647
movq %rbp, %rdi
callq 0xa716
movq %rax, %r12
cmpq $0x0, (%r12)
je 0x8715
testq %r13, %r13
je 0x8696
movq %r13, %rdi
callq 0xacd4
movq %r12, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0xad48
testl %eax, %eax
js 0x86bf
jne 0x8715
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x86fb
movq 0x20(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x8706
movq (%rsp), %rax
cmpq %rax, 0x8(%rsp)
je 0x86a6
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
jne 0x86db
movq %rsp, %rdi
movq %r15, %rdx
callq 0x87b4
jmp 0x8718
movq (%rsp), %rax
cmpq %rax, 0x8(%rsp)
je 0x86cf
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x86ee
movq 0x20(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x8718
movq %rsp, %rdi
movq %r15, %rdx
callq 0x87b4
jmp 0x8718
movq %rsp, %rdi
movq %r15, %rdx
callq 0x87b4
movq %r12, %rdi
movq %r13, %rsi
callq 0xad8c
testl %eax, %eax
jg 0x8718
movq %r13, %r12
movq 0x20(%rsp), %rcx
incq %rcx
movq %rcx, 0x20(%rsp)
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
subq %rax, %rdx
sarq $0x4, %rdx
movq %r12, %r13
cmpq %rdx, %rcx
jb 0x861d
testq %r12, %r12
je 0x875a
movq %r12, 0x20(%rbx)
leaq 0x28(%rbx), %rdi
movq %rsp, %rsi
callq 0x88d4
movq 0x20(%rbx), %rbx
jmp 0x8769
movq $0x0, 0x20(%rbx)
leaq 0x8d7f(%rip), %rbx      # 0x114e8
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x877f
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2190
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8793
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x87ac
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2190
movq %rbx, %rdi
callq 0x2240