// File: /workspace/github_cpp_makefile_star2_O1/metopa[P]HTTP_Server/src/content/CDirContent.cpp
// Function: CDirContent::load()
void CDirContent::load() {
	int rc;
	DIR * dir;
	dirent entry;
	dirent * result;
	Log.ger<>( DEBUG_REQUEST, "Directory:", realPath_m, userPath_m );
	vector<CHTMLGenerator> files_m;

	if ( !( dir = opendir( realPath_m.c_str() ) ) ) {
		int errNo = errno;

		switch ( errNo ) {
			case EACCES:
				throw PermissionDeniedException( userPath_m );
			case ENOENT:
				throw FileNotFoundException( userPath_m );
			default:
				throw FileErrorException( userPath_m );
		}
	}

	while ( !( rc = readdir_r( dir, &entry, &result ) ) ) {
		if ( result == nullptr )
			break;
		files_m.push_back( CHTMLGenerator( result->d_name ) );
		Log.ger<>( DEBUG_REQUEST, "Directory", result->d_name, (int)result->d_type );
		if ( result->d_type == DT_DIR || result->d_type == DT_REG )
			files_m.back().makeHyperlink( makeLink( result->d_name ) );
		files_m.back().enlarge();
		if ( !strcmp( result->d_name, ".." ) )
			files_m.back().setPriority( -2 );
		else if ( !strcmp( result->d_name, "." ) )
			files_m.back().setPriority( -1 );
	}

	stable_sort( files_m.begin(), files_m.end() );

	CHTMLGenerator table( string( "Index of " ) + userPath_m );
	table.enlarge( 2 ).makeTable( files_m );
	if ( rc )
		table.append( "\nAn error occured while reading directory content. Try to refresh page\n" );
	string rawHTML = table.wrap( string( "Index of " ) + userPath_m.c_str() );
	data_m.insert( data_m.begin(), rawHTML.begin(), rawHTML.end() );

	closedir( dir );

	size_m = data_m.size();

	modificationTime();
	creationTime();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rdi, %rbx
leaq 0x40(%rdi), %rcx
leaq 0x20(%rdi), %r8
leaq 0x17081(%rip), %rdi     # 0x225c8
leaq 0xce9c(%rip), %rdx      # 0x183ea
movl $0x7, %esi
movq %r8, 0x50(%rsp)
callq 0xbdca
xorps %xmm0, %xmm0
movaps %xmm0, 0x80(%rsp)
movq $0x0, 0x90(%rsp)
movq %rbx, %r14
movq 0x40(%rbx), %rdi
callq 0x5620
movq %rax, 0x98(%rsp)
testq %rax, %rax
je 0xba85
leaq 0x18(%rsp), %r13
leaq 0x8(%rsp), %rbp
leaq 0x28(%rsp), %r15
movq 0x98(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
leaq 0x58(%rsp), %rdx
callq 0x51c0
movl %eax, %ebx
testl %eax, %eax
jne 0xb77e
movq 0x58(%rsp), %r12
testq %r12, %r12
je 0xb77e
leaq 0x13(%r12), %rbx
movq %r13, 0x8(%rsp)
movq %rbx, %rdi
callq 0x51f0
leaq (%r12,%rax), %rdx
addq $0x13, %rdx
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x8f0e
movq %r15, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0xed5c
leaq 0x80(%rsp), %rdi
movq %r15, %rsi
callq 0xc3d6
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xb630
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x53f0
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0xb647
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x53f0
movq 0x58(%rsp), %rcx
movzbl 0x12(%rcx), %eax
addq $0x13, %rcx
movl %eax, 0x28(%rsp)
leaq 0x16f69(%rip), %rdi     # 0x225c8
movl $0x7, %esi
leaq 0xcd8a(%rip), %rdx      # 0x183f5
movq %r15, %r8
callq 0xc066
movq 0x58(%rsp), %r13
movzbl 0x12(%r13), %eax
cmpl $0x8, %eax
je 0xb68b
cmpl $0x4, %eax
jne 0xb711
movq 0x88(%rsp), %rbx
leaq 0x13(%r13), %r12
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r12, %rdi
callq 0x51f0
leaq (%rax,%r13), %rdx
addq $0x13, %rdx
movq %rbp, %rdi
movq %r12, %rsi
callq 0x8f0e
movq %r15, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0xbc3c
addq $-0x28, %rbx
movq %rbx, %rdi
movq %r15, %rsi
leaq 0x18(%rsp), %rbx
callq 0xf766
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xb6fa
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x53f0
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0xb711
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x53f0
movq 0x88(%rsp), %rdi
addq $-0x28, %rdi
xorl %esi, %esi
callq 0xfc52
leaq 0x18(%rsp), %r13
movq 0x58(%rsp), %rbx
addq $0x13, %rbx
movq %rbx, %rdi
leaq 0xcf6a(%rip), %rsi      # 0x186a6
callq 0x55b0
testl %eax, %eax
je 0xb763
movq %rbx, %rdi
leaq 0xcf58(%rip), %rsi      # 0x186a7
callq 0x55b0
testl %eax, %eax
jne 0xb5a0
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
jmp 0xb768
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq 0x88(%rsp), %rdi
addq $-0x28, %rdi
callq 0x1006e
jmp 0xb5a0
movq 0x80(%rsp), %r15
movq 0x88(%rsp), %r12
cmpq %r12, %r15
je 0xb7fb
movq %r12, %rax
subq %r15, %rax
sarq $0x3, %rax
movabsq $-0x3333333333333333, %rcx # imm = 0xCCCCCCCCCCCCCCCD
imulq %rax, %rcx
leaq 0x1(%rcx), %rax
shrq $0x3f, %rax
leaq (%rcx,%rax), %rdx
incq %rdx
sarq %rdx
leaq 0x28(%rsp), %rdi
movq %r15, %rsi
callq 0xc69e
movq 0x38(%rsp), %rdx
testq %rdx, %rdx
je 0xb7e6
movq 0x30(%rsp), %rcx
movq %r15, %rdi
movq %r12, %rsi
callq 0xc7b0
jmp 0xb7f1
movq %r15, %rdi
movq %r12, %rsi
callq 0xc725
leaq 0x28(%rsp), %rdi
callq 0xc876
leaq 0x70(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xcbf4(%rip), %rsi      # 0x183ff
leaq 0xcbf6(%rip), %rdx      # 0x18408
leaq 0x60(%rsp), %rdi
callq 0x8f0e
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
leaq 0x60(%rsp), %rdi
callq 0x5160
leaq 0x18(%rsp), %rsi
movq %rsi, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xb856
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0xb85c
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x28(%rsp), %rdi
xorl %edx, %edx
callq 0xed5c
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xb8a0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x53f0
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0xb8b7
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x53f0
leaq 0x28(%rsp), %rdi
movl $0x2, %esi
callq 0xfc52
leaq 0x80(%rsp), %rsi
movq %rax, %rdi
callq 0xf96e
testl %ebx, %ebx
je 0xb925
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
movq %rax, (%rdi)
leaq 0xcb1b(%rip), %rsi      # 0x18409
leaq 0xcb5b(%rip), %rdx      # 0x18450
callq 0x8f0e
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xf740
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xb925
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x53f0
leaq 0xb0(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xcac6(%rip), %rsi      # 0x183ff
leaq 0xcac8(%rip), %rdx      # 0x18408
leaq 0xa0(%rsp), %rdi
callq 0x8f0e
movq 0x50(%rsp), %rax
movq (%rax), %rsi
leaq 0xa0(%rsp), %rdi
callq 0x57b0
movq %r15, 0x60(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xb985
movq %rdx, 0x60(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x70(%rsp)
jmp 0xb98c
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rsi
leaq 0x60(%rsp), %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0xfea2
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0xb9ce
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x53f0
movq 0xa0(%rsp), %rdi
cmpq %r12, %rdi
je 0xb9eb
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x53f0
leaq 0x8(%r14), %rdi
movq 0x8(%r14), %rsi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
addq %rdx, %rcx
callq 0xddb6
movq 0x98(%rsp), %rdi
callq 0x5680
movq 0x10(%r14), %rax
subq 0x8(%r14), %rax
movq %rax, 0x60(%r14)
movq %r14, %rdi
callq 0xbd7a
movq %r14, %rdi
callq 0xb498
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xba4a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x53f0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xba66
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x53f0
leaq 0x80(%rsp), %rdi
callq 0xc1d8
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5060
movl (%rax), %ebx
movl $0x48, %edi
callq 0x5200
movq %rax, %r14
cmpl $0x2, %ebx
je 0xbab9
cmpl $0xd, %ebx
jne 0xbacf
movq %r14, %rdi
movq 0x50(%rsp), %rsi
callq 0xbf3a
leaq 0x15ae9(%rip), %rsi     # 0x215a0
jmp 0xbae3
movq %r14, %rdi
movq 0x50(%rsp), %rsi
callq 0xbf86
leaq 0x158d3(%rip), %rsi     # 0x213a0
jmp 0xbae3
movq %r14, %rdi
movq 0x50(%rsp), %rsi
callq 0xc01a
leaq 0x15ad5(%rip), %rsi     # 0x215b8
leaq -0x3ec2(%rip), %rdx     # 0x7c28
movq %r14, %rdi
callq 0x5700
jmp 0xbaf6
jmp 0xbaf6
movq %rax, %rbx
movq %r14, %rdi
callq 0x52e0
jmp 0xbc27
jmp 0xbc24
jmp 0xbb2b
jmp 0xbbbf
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xc876
jmp 0xbc27
jmp 0xbc24
jmp 0xbb2b
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xbbc2
movq 0x18(%rsp), %rsi
jmp 0xbb7c
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0xbb67
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x53f0
jmp 0xbb67
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
cmpq %r12, %rdi
je 0xbbc2
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x53f0
jmp 0xbbc2
jmp 0xbbbf
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xbbac
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x53f0
jmp 0xbbac
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0xbc27
movq 0x70(%rsp), %rsi
jmp 0xbc1a
jmp 0xbc24
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xbc27
movq 0x38(%rsp), %rsi
jmp 0xbc1a
jmp 0xbc24
jmp 0xbbe2
jmp 0xbbe7
jmp 0xbc24
jmp 0xbc24
movq %rax, %rbx
jmp 0xbc06
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xbc06
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x53f0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xbc27
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x53f0
jmp 0xbc27
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0xc1d8
movq %rbx, %rdi
callq 0x5730