// File: /workspace/github_cpp_makefile_star2_O1/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, %r15
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 0x51d7
leaq 0x20(%rsp), %rsi
movl $0x4a, %edx
movq %rax, %rdi
callq 0x3200
addq $0x4a, 0x8(%r15)
jmp 0x51e7
leaq 0x20(%rsp), %rdx
movq %r15, %rdi
movq %rax, %rsi
callq 0x5a3e
movq (%r15), %r14
movq 0x8(%r15), %r12
cmpq %r12, %r14
je 0x549f
movq %r12, %rbx
subq %r14, %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 0x809(%rip), %rcx       # 0x5a2e
movq %r14, %rdi
movq %r12, %rsi
callq 0x5b93
cmpq $0x4a1, %rbx            # imm = 0x4A1
movq %r14, 0x8(%rsp)
movq %r12, (%rsp)
jl 0x53c4
movq %r15, 0x18(%rsp)
movl %ebp, 0x14(%rsp)
leaq 0x4a(%r14), %r15
movl $0x4a, %r13d
leaq 0x6e(%rsp), %rbp
movq 0x8(%rsp), %r12
leaq (%r12,%r13), %rbx
movl $0x23, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3110
movl $0x4a, %edx
movq %rbp, %rdi
movq %rbx, %rsi
testl %eax, %eax
jns 0x52a5
callq 0x3200
subq %r13, %r14
addq $0x94, %r14
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x33b0
jmp 0x52f6
callq 0x3200
movl $0x23, %edx
movq %rbp, %rdi
movq %r14, %rsi
callq 0x3110
movq %rbx, %r12
testl %eax, %eax
jns 0x52f6
movq %r15, %r14
leaq -0x4a(%r14), %r12
movl $0x4a, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x3200
addq $-0x94, %r14
movl $0x23, %edx
movq %rbp, %rdi
movq %r14, %rsi
callq 0x3110
movq %r12, %r14
testl %eax, %eax
js 0x52c4
movl $0x4a, %edx
movq %r12, %rdi
movq %rbp, %rsi
callq 0x3200
addq $0x4a, %r13
addq $0x4a, %r15
movq %rbx, %r14
cmpq $0x4a0, %r13            # imm = 0x4A0
jne 0x525e
movq 0x8(%rsp), %rbx
addq $0x4a0, %rbx            # imm = 0x4A0
cmpq (%rsp), %rbx
movl 0x14(%rsp), %ebp
movq 0x18(%rsp), %r15
je 0x549f
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, %r12
testl %eax, %eax
movq %rbx, %r13
jns 0x53a2
movq %r13, %rbx
leaq -0x4a(%rbx), %r12
movl $0x4a, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3200
addq $-0x94, %rbx
movl $0x23, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3110
movq %r12, %rbx
testl %eax, %eax
js 0x5370
movl $0x4a, %edx
movq %r12, %rdi
movq %r14, %rsi
callq 0x3200
addq $0x4a, %r13
cmpq (%rsp), %r13
movq %r13, %rbx
jne 0x5342
jmp 0x549f
leaq 0x4a(%r14), %rax
cmpq %r12, %rax
je 0x549f
movq %r14, %rbx
leaq 0x6e(%rsp), %r13
movq %r14, %r12
movq %rax, %r14
movl $0x23, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3110
movl $0x4a, %edx
movq %r13, %rdi
movq %r14, %rsi
testl %eax, %eax
jns 0x5428
callq 0x3200
movq %r14, %rdx
subq %rbx, %rdx
subq %rdx, %r12
addq $0x94, %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x33b0
movl $0x4a, %edx
movq %rbx, %rdi
jmp 0x5481
callq 0x3200
movl $0x23, %edx
movq %r13, %rdi
movq %r12, %rsi
callq 0x3110
movq %r14, %r12
testl %eax, %eax
jns 0x5479
movq %r14, %rbx
leaq -0x4a(%rbx), %r12
movl $0x4a, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3200
addq $-0x94, %rbx
movl $0x23, %edx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x3110
movq %r12, %rbx
testl %eax, %eax
js 0x5447
movl $0x4a, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x3200
leaq 0x4a(%r14), %rax
movq %r14, %r12
cmpq (%rsp), %rax
movq 0x8(%rsp), %rbx
jne 0x53dc
movq (%r15), %rcx
movq 0x8(%r15), %rdx
subq %rcx, %rdx
je 0x54cf
sarq %rdx
movabsq $0x14c1bacf914c1bad, %rax # imm = 0x14C1BACF914C1BAD
imulq %rax, %rdx
xorl %eax, %eax
imulq $0x4a, %rax, %rsi
cmpl %ebp, 0x46(%rcx,%rsi)
je 0x54ee
incl %eax
cmpq %rax, %rdx
ja 0x54be
leaq 0x4d9b(%rip), %rdi      # 0xa271
leaq 0x4c6d(%rip), %rsi      # 0xa14a
leaq 0x4dae(%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