// File: metopa[P]HTTP_Server/src/content/CPathResolver.cpp
// Function: CPathResolver::unwindPath(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void CPathResolver::unwindPath( const string& path ) {
	int depth = 0;
	int state = 0;
	for ( unsigned long int i = 0; i < path.length() && depth >= 0; i++ ) {
		switch ( state ) {
			case 0:
				if ( path[i] == '.' )
					state = 2;
				else if ( path[i] == '/' )
					state = 0;
				else state = 1;
				break;
			case 1:
				if ( path[i] == '/' ) {
					state = 0;
					depth++;
				}
				break;
			case 2:
				if ( path[i] == '.' )
					state = 3;
				else if ( path[i] == '/' )
					state = 0;
				else state = 1;
				break;
			case 3:
				if ( path[i] == '.' ) {
					state = 0;
					depth--;
				}
				else state = 1;
				break;
			default:
				break;
		}
	}
	if ( depth < 0 )
		throw PermissionDeniedException( path );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
callq 0x67d0
movq -0x38(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x2d(%rbp)
jae 0x1f132
cmpl $0x0, -0x14(%rbp)
setge %al
movb %al, -0x2d(%rbp)
movb -0x2d(%rbp), %al
testb $0x1, %al
jne 0x1f13e
jmp 0x1f260
movl -0x18(%rbp), %eax
movq %rax, -0x40(%rbp)
subq $0x3, %rax
ja 0x1f24b
movq -0x40(%rbp), %rax
leaq 0xd4ba(%rip), %rcx      # 0x2c614
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x6580
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x1f181
movl $0x2, -0x18(%rbp)
jmp 0x1f1a8
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x6580
movsbl (%rax), %eax
cmpl $0x2f, %eax
jne 0x1f19f
movl $0x0, -0x18(%rbp)
jmp 0x1f1a6
movl $0x1, -0x18(%rbp)
jmp 0x1f1a8
jmp 0x1f24d
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x6580
movsbl (%rax), %eax
cmpl $0x2f, %eax
jne 0x1f1d2
movl $0x0, -0x18(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1f24d
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x6580
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x1f1f2
movl $0x3, -0x18(%rbp)
jmp 0x1f219
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x6580
movsbl (%rax), %eax
cmpl $0x2f, %eax
jne 0x1f210
movl $0x0, -0x18(%rbp)
jmp 0x1f217
movl $0x1, -0x18(%rbp)
jmp 0x1f219
jmp 0x1f24d
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x6580
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x1f242
movl $0x0, -0x18(%rbp)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1f249
movl $0x1, -0x18(%rbp)
jmp 0x1f24d
jmp 0x1f24d
jmp 0x1f24f
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x1f106
cmpl $0x0, -0x14(%rbp)
jge 0x1f2b3
movl $0x48, %edi
callq 0x6280
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rsi
callq 0x168f0
jmp 0x1f285
movq -0x48(%rbp), %rdi
leaq 0x1f368(%rip), %rsi     # 0x3e5f8
leaq -0x8967(%rip), %rdx     # 0x16930
callq 0x68e0
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x63b0
jmp 0x1f2b9
addq $0x50, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x6920
nopw %cs:(%rax,%rax)