// File: /workspace/github_cpp_makefile_star2_O3/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 0x17159(%rip), %rdi     # 0x225c0
leaq 0xcf7c(%rip), %rdx      # 0x183ea
movl $0x7, %esi
movq %r8, 0x50(%rsp)
callq 0xbce4
xorps %xmm0, %xmm0
movaps %xmm0, 0x80(%rsp)
movq $0x0, 0x90(%rsp)
movq %rbx, %r12
movq 0x40(%rbx), %rdi
callq 0x5610
movq %rax, 0x98(%rsp)
testq %rax, %rax
je 0xb99e
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, %r14d
testl %eax, %eax
jne 0xb690
movq 0x58(%rsp), %rbx
testq %rbx, %rbx
je 0xb690
leaq 0x13(%rbx), %r14
movq %r13, 0x8(%rsp)
movq %r14, %rdi
callq 0x51f0
leaq (%rbx,%rax), %rdx
addq $0x13, %rdx
movq %rbp, %rdi
movq %r14, %rsi
callq 0x8e2c
movq %r15, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0xed10
leaq 0x80(%rsp), %rdi
movq %r15, %rsi
callq 0xc2f2
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xb550
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x53f0
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0xb567
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x53f0
movq 0x58(%rsp), %rcx
movzbl 0x12(%rcx), %eax
addq $0x13, %rcx
movl %eax, 0x28(%rsp)
leaq 0x17041(%rip), %rdi     # 0x225c0
movl $0x7, %esi
leaq 0xce6a(%rip), %rdx      # 0x183f5
movq %r15, %r8
callq 0xbf80
movq 0x58(%rsp), %r13
movzbl 0x12(%r13), %eax
cmpl $0x8, %eax
je 0xb5ab
cmpl $0x4, %eax
jne 0xb631
movq 0x88(%rsp), %r14
leaq 0x13(%r13), %rbx
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
callq 0x51f0
leaq (%rax,%r13), %rdx
addq $0x13, %rdx
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x8e2c
movq %r15, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0xbb56
addq $-0x28, %r14
movq %r14, %rdi
movq %r15, %rsi
leaq 0x18(%rsp), %rbx
callq 0xf71a
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xb61a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x53f0
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0xb631
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x53f0
movq 0x88(%rsp), %rdi
addq $-0x28, %rdi
xorl %esi, %esi
callq 0xfc06
leaq 0x18(%rsp), %r13
movq 0x58(%rsp), %rax
cmpb $0x2e, 0x13(%rax)
jne 0xb4c0
cmpb $0x2e, 0x14(%rax)
jne 0xb664
cmpb $0x0, 0x15(%rax)
je 0xb675
cmpb $0x0, 0x14(%rax)
jne 0xb4c0
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
jmp 0xb67a
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq 0x88(%rsp), %rdi
addq $-0x28, %rdi
callq 0x10022
jmp 0xb4c0
movq 0x80(%rsp), %r15
movq 0x88(%rsp), %rbx
cmpq %rbx, %r15
je 0xb70d
movq %rbx, %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 0xc5c2
movq 0x38(%rsp), %rdx
testq %rdx, %rdx
je 0xb6f8
movq 0x30(%rsp), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xc6d6
jmp 0xb703
movq %r15, %rdi
movq %rbx, %rsi
callq 0xc649
leaq 0x28(%rsp), %rdi
callq 0xc79c
leaq 0x70(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xcce2(%rip), %rsi      # 0x183ff
leaq 0xcce4(%rip), %rdx      # 0x18408
leaq 0x60(%rsp), %rdi
callq 0x8e2c
movq 0x20(%r12), %rsi
movq 0x28(%r12), %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 0xb76a
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0xb770
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 0xed10
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xb7b4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x53f0
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0xb7cb
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x53f0
leaq 0x28(%rsp), %rdi
movl $0x2, %esi
callq 0xfc06
leaq 0x80(%rsp), %rsi
movq %rax, %rdi
callq 0xf922
testl %r14d, %r14d
je 0xb83a
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
movq %rax, (%rdi)
leaq 0xcc06(%rip), %rsi      # 0x18409
leaq 0xcc46(%rip), %rdx      # 0x18450
callq 0x8e2c
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xf6f4
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xb83a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x53f0
leaq 0xb0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xcbb2(%rip), %rsi      # 0x183ff
leaq 0xcbb4(%rip), %rdx      # 0x18408
leaq 0xa0(%rsp), %rdi
callq 0x8e2c
movq 0x50(%rsp), %rax
movq (%rax), %rsi
leaq 0xa0(%rsp), %rdi
callq 0x57a0
movq %r15, 0x60(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xb899
movq %rdx, 0x60(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x70(%rsp)
jmp 0xb8a0
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 0xfe56
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0xb8e2
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x53f0
movq 0xa0(%rsp), %rdi
cmpq %r14, %rdi
je 0xb8ff
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x53f0
leaq 0x8(%r12), %rdi
movq 0x8(%r12), %rsi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
addq %rdx, %rcx
callq 0xdd18
movq 0x98(%rsp), %rdi
callq 0x5670
movq 0x10(%r12), %rax
subq 0x8(%r12), %rax
movq %rax, 0x60(%r12)
movq %r12, %rdi
callq 0xbc94
movq %r12, %rdi
callq 0xb3b8
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xb963
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x53f0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xb97f
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x53f0
leaq 0x80(%rsp), %rdi
callq 0xc0f2
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 0xb9d2
cmpl $0xd, %ebx
jne 0xb9e8
movq %r14, %rdi
movq 0x50(%rsp), %rsi
callq 0xbe54
leaq 0x15c08(%rip), %rsi     # 0x215d8
jmp 0xb9fc
movq %r14, %rdi
movq 0x50(%rsp), %rsi
callq 0xbea0
leaq 0x159f2(%rip), %rsi     # 0x213d8
jmp 0xb9fc
movq %r14, %rdi
movq 0x50(%rsp), %rsi
callq 0xbf34
leaq 0x15bf4(%rip), %rsi     # 0x215f0
leaq -0x3ee1(%rip), %rdx     # 0x7b22
movq %r14, %rdi
callq 0x56f0
jmp 0xba0f
jmp 0xba0f
movq %rax, %rbx
movq %r14, %rdi
callq 0x52e0
jmp 0xbb40
jmp 0xbb3d
jmp 0xba44
jmp 0xbad8
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xc79c
jmp 0xbb40
jmp 0xbb3d
jmp 0xba44
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xbadb
movq 0x18(%rsp), %rsi
jmp 0xba95
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0xba80
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x53f0
jmp 0xba80
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
cmpq %r14, %rdi
je 0xbadb
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x53f0
jmp 0xbadb
jmp 0xbad8
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xbac5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x53f0
jmp 0xbac5
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0xbb40
movq 0x70(%rsp), %rsi
jmp 0xbb2f
jmp 0xbb3d
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xbb40
movq 0x38(%rsp), %rsi
jmp 0xbb2f
jmp 0xbafc
jmp 0xbb3d
jmp 0xbaf7
movq %rax, %rbx
jmp 0xbb1b
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xbb1b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x53f0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xbb40
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x53f0
jmp 0xbb40
jmp 0xbb3d
jmp 0xbb3d
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0xc0f2
movq %rbx, %rdi
callq 0x5720
nop