// File: /workspace/github_cpp_makefile_star2_O3/danish241194[P]Linux-Terminal-Based-File-Explorer/start_page.cpp
// Function: copy_directory(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void copy_directory(string dirname,string dir2,string foldername){

	infinite_loop++;
	if(infinite_loop>100){
	return;		
	}
	
	struct dirent ** list;
	int nn=scandir(dirname.c_str(),&list,NULL,alphasort);
	dir2 = dir2+"/"+foldername;	
	int status = mkdir(dir2.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
	struct stat perm;
	stat(dirname.c_str(),&perm);
	chown(dir2.c_str(),perm.st_uid,perm.st_gid);
	chmod(dir2.c_str(),perm.st_mode);
	for(int i = 2;i<nn;i++){
		if((int)list[i]->d_type==4){
			copy_directory(dirname+"/"+list[i]->d_name,dir2,list[i]->d_name);		
		}
		else if((int)list[i]->d_type==8){
			copy_file(dirname+"/"+list[i]->d_name,dir2+"/"+list[i]->d_name);
			struct stat perm;
			stat((dirname+"/"+list[i]->d_name).c_str(),&perm);
			chown((dir2+"/"+list[i]->d_name).c_str(),perm.st_uid,perm.st_gid);
			chmod((dir2+"/"+list[i]->d_name).c_str(),perm.st_mode);
		}
	}
		
	 
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movl 0xfa71(%rip), %eax      # 0x1561c
leal 0x1(%rax), %ecx
movl %ecx, 0xfa68(%rip)      # 0x1561c
cmpl $0x63, %eax
jg 0x6334
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
movq 0xf3f0(%rip), %rcx      # 0x14fc0
leaq 0x48(%rsp), %rsi
xorl %edx, %edx
callq 0x3080
movl %eax, %ebp
leaq 0x108(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0xf8(%rsp), %r12
movq %r12, %rdi
callq 0xfc98
leaq 0xb48e(%rip), %rsi      # 0x11099
movq %r12, %rdi
callq 0x3480
movq (%r15), %rsi
movq 0x8(%r15), %rdx
leaq 0xf8(%rsp), %rdi
callq 0x30d0
leaq 0x198(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5c58
movq %rdx, 0x188(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x198(%rsp)
jmp 0x5c60
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq 0x188(%rsp), %r15
movq %rdx, 0x8(%r15)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3320
movq (%r15), %rdi
cmpq %r12, %rdi
je 0x5ca2
movq 0x198(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0xf8(%rsp), %rdi
cmpq %r13, %rdi
je 0x5cbf
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x3260
movq (%rbx), %rdi
movl $0x1fd, %esi            # imm = 0x1FD
callq 0x3120
movq %r14, 0x50(%rsp)
movq (%r14), %rdi
leaq 0x188(%rsp), %r15
movq %r15, %rsi
callq 0x3200
movq (%rbx), %rdi
movl 0x1c(%r15), %esi
movl 0x20(%r15), %edx
callq 0x3180
movq (%rbx), %rdi
movl 0x18(%r15), %esi
callq 0x3210
cmpl $0x3, %ebp
jl 0x6334
movl %ebp, %eax
leaq -0x10(,%rax,8), %r14
xorl %r15d, %r15d
leaq 0xf8(%rsp), %rbp
movq 0x48(%rsp), %rax
movq 0x10(%rax,%r15), %rax
movzbl 0x12(%rax), %eax
cmpl $0x8, %eax
je 0x5db7
cmpl $0x4, %eax
jne 0x6327
movq %r13, 0xf8(%rsp)
movq 0x50(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0xfc98
movq %rbp, %rdi
leaq 0xb332(%rip), %rsi      # 0x11099
callq 0x3480
movq 0x48(%rsp), %rax
movq 0x10(%rax,%r15), %rsi
addq $0x13, %rsi
movq %rbp, %rdi
callq 0x3480
leaq 0x88(%rsp), %rsi
movq %rsi, 0x78(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5e3f
movq %rdx, 0x78(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x88(%rsp)
jmp 0x5e45
movq %r13, 0xf8(%rsp)
movq 0x50(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0xfc98
movq %rbp, %rdi
leaq 0xb2b9(%rip), %rsi      # 0x11099
callq 0x3480
movq %rbp, %rdi
leaq 0xe8(%rsp), %rbp
movq %r13, %r12
movq 0x48(%rsp), %rax
movq 0x10(%rax,%r15), %rsi
addq $0x13, %rsi
callq 0x3480
leaq 0x68(%rsp), %rdi
movq %rdi, 0x58(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq 0x38(%rsp), %rsi
leaq 0x28(%rsp), %r13
je 0x5f70
movq %rdx, 0x58(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x68(%rsp)
jmp 0x5f76
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x80(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xa8(%rsp), %rax
movq %rax, 0x98(%rsp)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x98(%rsp), %rdi
callq 0xfc98
movq 0x48(%rsp), %rax
movq 0x10(%rax,%r15), %r12
leaq 0x13(%r12), %r13
leaq 0xc8(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq %r13, %rdi
callq 0x3110
leaq (%r12,%rax), %rdx
addq $0x13, %rdx
leaq 0xb8(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0xfec2
leaq 0x78(%rsp), %rdi
leaq 0x98(%rsp), %rsi
movq %r12, %rdx
leaq 0x108(%rsp), %r13
callq 0x5b94
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x5f0b
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x5f30
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x5f52
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0xf8(%rsp), %rdi
cmpq %r13, %rdi
je 0x6327
movq 0x108(%rsp), %rsi
jmp 0x631f
movups (%rcx), %xmm0
movups %xmm0, (%rdi)
movq 0x8(%rax), %rdx
movq %rdx, 0x60(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rsi, 0x28(%rsp)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0xfc98
movq %r13, %rdi
leaq 0xb0ea(%rip), %rsi      # 0x11099
callq 0x3480
movq 0x48(%rsp), %rax
movq 0x10(%rax,%r15), %rsi
addq $0x13, %rsi
movq %r13, %rdi
callq 0x3480
movq %rbp, 0xd8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
movq %r12, %r13
je 0x5ff9
movq %rdx, 0xd8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xe8(%rsp)
jmp 0x6000
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0xe0(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x58(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x6473
movq 0xd8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x604a
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
leaq 0x8(%rsp), %r12
leaq 0x68(%rsp), %rbp
je 0x6070
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x58(%rsp), %rdi
cmpq %rbp, %rdi
je 0x6087
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0xf8(%rsp), %rdi
cmpq %r13, %rdi
je 0x60a4
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x3260
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x50(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0xfc98
movq %r12, %rdi
leaq 0xafca(%rip), %rsi      # 0x11099
callq 0x3480
movq 0x48(%rsp), %rax
movq 0x10(%rax,%r15), %rsi
addq $0x13, %rsi
movq %r12, %rdi
callq 0x3480
leaq 0x38(%rsp), %rbp
movq %rbp, 0x28(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6112
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x6119
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x28(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x3200
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
je 0x615a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
leaq 0x8(%rsp), %r12
je 0x617b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3260
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0xfc98
movq %r12, %rdi
leaq 0xaef8(%rip), %rsi      # 0x11099
callq 0x3480
movq 0x48(%rsp), %rax
movq 0x10(%rax,%r15), %rsi
addq $0x13, %rsi
movq %r12, %rdi
callq 0x3480
leaq 0x38(%rsp), %rbp
movq %rbp, 0x28(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x61e4
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x61eb
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x28(%rsp), %rdi
movl 0x114(%rsp), %esi
movl 0x118(%rsp), %edx
callq 0x3180
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
je 0x6232
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
leaq 0x8(%rsp), %r12
je 0x6253
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3260
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0xfc98
movq %r12, %rdi
leaq 0xae20(%rip), %rsi      # 0x11099
callq 0x3480
movq 0x48(%rsp), %rax
movq 0x10(%rax,%r15), %rsi
addq $0x13, %rsi
movq %r12, %rdi
callq 0x3480
leaq 0x38(%rsp), %rbp
movq %rbp, 0x28(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x62bc
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x62c3
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x28(%rsp), %rdi
movl 0x110(%rsp), %esi
callq 0x3210
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
je 0x6303
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
leaq 0xf8(%rsp), %rbp
je 0x6327
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3260
addq $0x8, %r15
cmpq %r15, %r14
jne 0x5d1e
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x63f9
jmp 0x63f9
movq %rax, %rbx
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x6384
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x3260
jmp 0x6384
jmp 0x63e0
jmp 0x640b
movq %rax, %rbx
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x63b5
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x3260
jmp 0x63b5
jmp 0x63e0
movq %rax, %rbx
jmp 0x642a
movq %rax, %rbx
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x6446
movq 0x88(%rsp), %rsi
jmp 0x643e
jmp 0x63e0
jmp 0x63d7
jmp 0x63e0
movq %rax, %rbx
jmp 0x6446
jmp 0x63e0
jmp 0x63f9
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x646b
movq 0x18(%rsp), %rsi
jmp 0x6463
movq %rax, %rbx
movq 0xf8(%rsp), %rdi
cmpq %r13, %rdi
jne 0x645b
jmp 0x646b
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x642a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x6446
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0x646b
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x3260
movq %rbx, %rdi
callq 0x3450