// File: /workspace/github_cpp_makefile_star2_O3/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 0x3abe
movq 0x8(%r15), %rdx
decq %rdx
leaq 0x68(%rsp), %rdi
movl $0x1, %ecx
movq %r15, %rsi
callq 0x3270
leaq 0x638a(%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 0x3cbb
movq %rdx, 0x88(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x98(%rsp)
jmp 0x3cc1
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 0x3cef
callq 0x3220
leaq 0xe8(%rsp), %rsi
movq 0x8(%rsi), %rdx
addq $-0x2, %rdx
leaq 0xc8(%rsp), %rdi
movl $0x1, %ecx
callq 0x3270
leaq 0x62f3(%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 0x3d48
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
jmp 0x3d4f
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 0x3d7d
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 0x475c
leaq 0x6269(%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 0x3df6
movq %rdx, 0xa8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xb8(%rsp)
jmp 0x3dfd
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 0x3e53
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x3e5b
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 0x3eb3
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x3eba
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 0x6130(%rip), %rsi      # 0xa00d
callq 0x3470
movq %r13, 0xc8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3f0e
movq %rdx, 0xc8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xd8(%rsp)
jmp 0x3f16
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 0x3f40
callq 0x3220
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x3f4f
callq 0x3220
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3f61
callq 0x3220
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3f75
callq 0x3220
callq 0x45b2
leaq 0xc8(%rsp), %rsi
movq %rax, %rdi
callq 0x785c
testb %al, %al
jne 0x41e3
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 0x475c
leaq 0x604c(%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 0x4006
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x400d
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 0x4043
callq 0x3220
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x4052
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 0x475c
leaq 0x5f95(%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 0x40c6
movq %rdx, 0xa8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xb8(%rsp)
jmp 0x40cd
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 0x5f18(%rip), %rsi      # 0xa00b
callq 0x3470
movq %r12, 0x28(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x411b
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x4123
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 0x4171
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x4178
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 0x41ae
callq 0x3220
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x41bd
callq 0x3220
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x41cf
callq 0x3220
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x41e3
callq 0x3220
movl $0x28, %edi
callq 0x3250
movq %rax, %r14
leaq 0xc8(%rsp), %rsi
movq %rax, %rdi
movl %ebx, %edx
callq 0x6040
movq 0xc8(%rsp), %rdi
cmpq %r13, %rdi
je 0x4214
callq 0x3220
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
leaq 0x98(%rsp), %rbx
je 0x4230
callq 0x3220
movq 0x88(%rsp), %rdi
cmpq %rbx, %rdi
je 0x4242
callq 0x3220
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4258
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 0x4284
callq 0x3220
jmp 0x4284
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x429d
callq 0x3220
jmp 0x429d
jmp 0x429a
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
jne 0x42d5
jmp 0x4365
jmp 0x4362
jmp 0x42b8
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
jne 0x42d5
jmp 0x4365
jmp 0x4362
movq %rax, %rbx
movq %r14, %rdi
callq 0x3220
jmp 0x4365
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0x42f6
callq 0x3220
jmp 0x42f6
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x430a
callq 0x3220
jmp 0x430a
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x4323
callq 0x3220
jmp 0x4323
jmp 0x4320
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
jne 0x4372
jmp 0x4377
movq %rax, %rbx
jmp 0x4377
movq %rax, %rbx
leaq 0xd8(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x4381
movq %rax, %rbx
jmp 0x438b
movq %rax, %rbx
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x439b
movq %rax, %rbx
jmp 0x43a5
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
cmpq %r13, %rdi
je 0x4377
callq 0x3220
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x438b
callq 0x3220
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x43a5
callq 0x3220
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x43bb
callq 0x3220
movq %rbx, %rdi
callq 0x3400
nop