// File: /workspace/github_cpp_makefile_star2_O3/davidgfnet[P]dns-db/dns_index.cc
// Function: DNS_DB::DnsIndex::addBlock(unsigned int, char const*, char const*)
int DNS_DB::DnsIndex::addBlock(unsigned int nwblk_id, const char * vmin, const char * vmax) {
	DNS_DB::DnsIndex::Node node;
	node.dnsblock_id = nwblk_id;
	memcpy(node.min, vmin, MAX_DNS_SIZE);
	memcpy(node.max, vmax, MAX_DNS_SIZE);
	nodes.push_back(node);

	// Now sort all the nodes
	std::sort(nodes.begin(), nodes.end(), DNS_DB::DnsIndex::Node::lessthan);

	for (unsigned int i = 0; i < nodes.size(); i++)
		if (nodes[i].dnsblock_id == nwblk_id)
			return i;

	assert(0 && "Should never reach this\n");
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movl %esi, 0x66(%rsp)
movl 0x1f(%rdx), %eax
movl %eax, 0x3f(%rsp)
movups (%rdx), %xmm0
movups 0x10(%rdx), %xmm1
movaps %xmm1, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movl 0x1f(%rcx), %eax
movl %eax, 0x62(%rsp)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups %xmm1, 0x53(%rsp)
movups %xmm0, 0x43(%rsp)
movq 0x8(%rdi), %rax
cmpq 0x10(%rdi), %rax
je 0x5158
leaq 0x20(%rsp), %rsi
movl $0x4a, %edx
movq %rax, %rdi
callq 0x3200
movq 0x8(%rbx), %r14
addq $0x4a, %r14
movq %r14, 0x8(%rbx)
jmp 0x516c
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x59ce
movq 0x8(%rbx), %r14
movq %rbx, 0x18(%rsp)
movq (%rbx), %r15
cmpq %r14, %r15
je 0x5429
movq %r14, %rbx
subq %r15, %rbx
movq %rbx, %rax
sarq %rax
movabsq $0x14c1bacf914c1bad, %rcx # imm = 0x14C1BACF914C1BAD
imulq %rcx, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
leaq 0x813(%rip), %rcx       # 0x59be
movq %r15, %rdi
movq %r14, %rsi
callq 0x5b23
cmpq $0x4a1, %rbx            # imm = 0x4A1
movq %r14, (%rsp)
movq %r15, 0x8(%rsp)
jl 0x5343
movl %ebp, 0x14(%rsp)
leaq 0x4a(%r15), %r12
movl $0x4a, %r13d
leaq 0x6e(%rsp), %rbp
movq %r15, %r14
movq 0x8(%rsp), %r15
leaq (%r15,%r13), %rbx
movl $0x23, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3110
movl $0x4a, %edx
movq %rbp, %rdi
movq %rbx, %rsi
testl %eax, %eax
jns 0x5229
callq 0x3200
subq %r13, %r14
addq $0x94, %r14
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x33b0
jmp 0x527a
callq 0x3200
movl $0x23, %edx
movq %rbp, %rdi
movq %r14, %rsi
callq 0x3110
movq %rbx, %r15
testl %eax, %eax
jns 0x527a
movq %r12, %r14
leaq -0x4a(%r14), %r15
movl $0x4a, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x3200
addq $-0x94, %r14
movl $0x23, %edx
movq %rbp, %rdi
movq %r14, %rsi
callq 0x3110
movq %r15, %r14
testl %eax, %eax
js 0x5248
movl $0x4a, %edx
movq %r15, %rdi
movq %rbp, %rsi
callq 0x3200
addq $0x4a, %r13
addq $0x4a, %r12
movq %rbx, %r14
cmpq $0x4a0, %r13            # imm = 0x4A0
jne 0x51e2
movq 0x8(%rsp), %rbx
addq $0x4a0, %rbx            # imm = 0x4A0
cmpq (%rsp), %rbx
movl 0x14(%rsp), %ebp
je 0x5429
leaq 0x6e(%rsp), %r14
movl $0x4a, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3200
leaq -0x4a(%rbx), %rsi
movl $0x23, %edx
movq %r14, %rdi
callq 0x3110
movq %rbx, %r15
testl %eax, %eax
movq %rbx, %r12
jns 0x5321
movq %r12, %rbx
leaq -0x4a(%rbx), %r15
movl $0x4a, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3200
addq $-0x94, %rbx
movl $0x23, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3110
movq %r15, %rbx
testl %eax, %eax
js 0x52ef
movl $0x4a, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x3200
addq $0x4a, %r12
cmpq (%rsp), %r12
movq %r12, %rbx
jne 0x52c1
jmp 0x5429
leaq 0x4a(%r15), %rax
cmpq %r14, %rax
je 0x5429
movq %r14, %rbx
movq %r15, %r12
leaq 0x6e(%rsp), %r13
movq %rax, %r14
movl $0x23, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x3110
movl $0x4a, %edx
movq %r13, %rdi
movq %r14, %rsi
testl %eax, %eax
jns 0x53af
callq 0x3200
movq %r14, %rdx
subq %r12, %rdx
subq %rdx, %r15
addq $0x94, %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x33b0
movl $0x4a, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x3200
jmp 0x5414
callq 0x3200
movl $0x23, %edx
movq %r13, %rdi
movq %r15, %rsi
callq 0x3110
movq %r14, %r15
testl %eax, %eax
jns 0x5400
movq %r14, %rbx
leaq -0x4a(%rbx), %r15
movl $0x4a, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3200
addq $-0x94, %rbx
movl $0x23, %edx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x3110
movq %r15, %rbx
testl %eax, %eax
js 0x53ce
movl $0x4a, %edx
movq %r15, %rdi
movq %r13, %rsi
callq 0x3200
movq (%rsp), %rbx
leaq 0x4a(%r14), %rax
movq %r14, %r15
cmpq %rbx, %rax
movq 0x8(%rsp), %r12
jne 0x535b
movq 0x18(%rsp), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rdx
subq %rcx, %rdx
je 0x545e
sarq %rdx
movabsq $0x14c1bacf914c1bad, %rax # imm = 0x14C1BACF914C1BAD
imulq %rax, %rdx
xorl %eax, %eax
imulq $0x4a, %rax, %rsi
cmpl %ebp, 0x46(%rcx,%rsi)
je 0x547d
incl %eax
cmpq %rax, %rdx
ja 0x544d
leaq 0x4e0c(%rip), %rdi      # 0xa271
leaq 0x4cde(%rip), %rsi      # 0xa14a
leaq 0x4e1f(%rip), %rcx      # 0xa292
movl $0x100, %edx            # imm = 0x100
callq 0x3180
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop