// File: /workspace/github_cpp_makefile_star2_O1/davidgfnet[P]dns-db/dns_db.cc
// Function: DNS_DB::getNewBlock(int)
DNS_DB::DnsBlock * DNS_DB::getNewBlock(int blockid) {
	// Generate path in a hierachical way, to prevent many files in a directory
	// This should be beneficial on most file systems
	std::string filename = to_string(blockid,16);
	std::string dir1 = filename.substr(filename.size()-1,1) + "/";
	std::string dir2 = filename.substr(filename.size()-2,1) + "/";
	std::string blockfile = db_path + "/" + dir1 + dir2 + filename + ".blk";

	if (!FileMapper::getInstance().fileExists(blockfile)) {
		mkdir((db_path).c_str(),                           S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
		mkdir((db_path + "/" + dir1).c_str(),              S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
		mkdir((db_path + "/" + dir1 + "/" + dir2).c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
	}

	return new DNS_DB::DnsBlock(blockfile, blockid);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movl %esi, %ebx
movq %rdi, %r14
leaq 0xe8(%rsp), %r15
movq %r15, %rdi
movl $0x10, %edx
callq 0x3b7e
movq 0x8(%r15), %rdx
decq %rdx
leaq 0x68(%rsp), %rdi
movl $0x1, %ecx
movq %r15, %rsi
callq 0x3270
leaq 0x62ca(%rip), %rsi      # 0xa00b
leaq 0x68(%rsp), %rdi
callq 0x3470
leaq 0x98(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3d7b
movq %rdx, 0x88(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x98(%rsp)
jmp 0x3d81
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x90(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x78(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0x3daf
callq 0x3220
leaq 0xe8(%rsp), %rsi
movq 0x8(%rsi), %rdx
addq $-0x2, %rdx
leaq 0xc8(%rsp), %rdi
movl $0x1, %ecx
callq 0x3270
leaq 0x6233(%rip), %rsi      # 0xa00b
leaq 0xc8(%rsp), %rdi
callq 0x3470
movq %r15, 0x68(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3e08
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
jmp 0x3e0f
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, 0x70(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xd8(%rsp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0x3e3d
callq 0x3220
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x68(%r14), %rsi
movq 0x70(%r14), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x480e
leaq 0x61a9(%rip), %rsi      # 0xa00b
leaq 0x8(%rsp), %rdi
callq 0x3470
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
leaq 0x8(%rsp), %rdi
callq 0x3090
leaq 0xb8(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3eb6
movq %rdx, 0xa8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xb8(%rsp)
jmp 0x3ebd
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0xa8(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
callq 0x3090
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3f13
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x3f1b
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0xe8(%rsp), %rsi
movq 0xf0(%rsp), %rdx
callq 0x3090
leaq 0x58(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3f73
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x3f7a
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x6070(%rip), %rsi      # 0xa00d
callq 0x3470
movq %r13, 0xc8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3fce
movq %rdx, 0xc8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xd8(%rsp)
jmp 0x3fd6
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0xd0(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0x4000
callq 0x3220
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x400f
callq 0x3220
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x4021
callq 0x3220
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x4035
callq 0x3220
callq 0x4668
leaq 0xc8(%rsp), %rsi
movq %rax, %rdi
callq 0x79b2
testb %al, %al
jne 0x42a3
movq 0x68(%r14), %rdi
movl $0x1fd, %esi            # imm = 0x1FD
callq 0x3100
leaq 0x28(%rsp), %rdi
movq %r12, (%rdi)
movq 0x68(%r14), %rsi
movq 0x70(%r14), %rdx
addq %rsi, %rdx
callq 0x480e
leaq 0x5f8c(%rip), %rsi      # 0xa00b
leaq 0x28(%rsp), %rdi
callq 0x3470
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
leaq 0x28(%rsp), %rdi
callq 0x3090
movq %rbp, 0x48(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x40c6
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x40cd
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x50(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x48(%rsp), %rdi
movl $0x1fd, %esi            # imm = 0x1FD
callq 0x3100
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0x4103
callq 0x3220
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x4112
callq 0x3220
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
movq %rax, (%rdi)
movq 0x68(%r14), %rsi
movq 0x70(%r14), %rdx
addq %rsi, %rdx
callq 0x480e
leaq 0x5ed5(%rip), %rsi      # 0xa00b
leaq 0x8(%rsp), %rdi
callq 0x3470
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
leaq 0x8(%rsp), %rdi
callq 0x3090
movq %r15, 0xa8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4186
movq %rdx, 0xa8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xb8(%rsp)
jmp 0x418d
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0xa8(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x5e58(%rip), %rsi      # 0xa00b
callq 0x3470
movq %r12, 0x28(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x41db
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x41e3
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
callq 0x3090
movq %rbp, 0x48(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4231
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x4238
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x50(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x48(%rsp), %rdi
movl $0x1fd, %esi            # imm = 0x1FD
callq 0x3100
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0x426e
callq 0x3220
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x427d
callq 0x3220
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x428f
callq 0x3220
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x42a3
callq 0x3220
movl $0x28, %edi
callq 0x3250
movq %rax, %r14
leaq 0xc8(%rsp), %rsi
movq %rax, %rdi
movl %ebx, %edx
callq 0x60c8
movq 0xc8(%rsp), %rdi
cmpq %r13, %rdi
je 0x42d4
callq 0x3220
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
leaq 0x98(%rsp), %rbx
je 0x42f0
callq 0x3220
movq 0x88(%rsp), %rdi
cmpq %rbx, %rdi
je 0x4302
callq 0x3220
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4318
callq 0x3220
movq %r14, %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x4344
callq 0x3220
jmp 0x4344
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x435d
callq 0x3220
jmp 0x435d
jmp 0x435a
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
jne 0x4395
jmp 0x4425
jmp 0x4422
jmp 0x4378
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
jne 0x4395
jmp 0x4425
jmp 0x4422
movq %rax, %rbx
movq %r14, %rdi
callq 0x3220
jmp 0x4425
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0x43b6
callq 0x3220
jmp 0x43b6
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x43ca
callq 0x3220
jmp 0x43ca
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x43e3
callq 0x3220
jmp 0x43e3
jmp 0x43e0
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
jne 0x4432
jmp 0x4437
movq %rax, %rbx
jmp 0x4437
movq %rax, %rbx
leaq 0xd8(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x4441
movq %rax, %rbx
jmp 0x444b
movq %rax, %rbx
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x445b
movq %rax, %rbx
jmp 0x4465
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
cmpq %r13, %rdi
je 0x4437
callq 0x3220
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x444b
callq 0x3220
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x4465
callq 0x3220
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x447b
callq 0x3220
movq %rbx, %rdi
callq 0x3400
nop