// File: /workspace/github_c_makefile_star2_O0/CSerxzm[P]WindowstoLinuxInterface/src/XCOPY.c
// Function: mycpdir
int mycpdir(char *name1, char *name2)
{
    int ret;
    DIR *dir1;
    DIR *dir2;
    struct dirent *drr;
    struct stat info;
    struct stat dirinfo;
    char buf1[1024];
    char buf2[1024];
    lstat(name1, &info);
    dir1=opendir(name1);
    if(dir1==NULL)
    {
        perror("opendir1");
        return 1;
    }
    dir2=opendir(name2); 
    if(dir2==NULL)
    {
        mkdir(name2, info.st_mode);
        dir2=opendir(name2);
    }

    while(1)
    {
        bzero(buf2, sizeof(buf2));
        bzero(buf2, sizeof(buf2));
        drr=readdir(dir1);
        if(drr==NULL)break;
        if(*drr->d_name=='.')
            continue;
        sprintf(buf1, "%s/%s", name1, drr->d_name);
        sprintf(buf2, "%s/%s", name2, drr->d_name);
        ret=lstat(buf1, &dirinfo);
        if(ret<0)
        {
            perror("lstat\n");
            break;
        }
        if(S_ISDIR(dirinfo.st_mode))
        {
            mycpdir(buf1 , buf2);
        }
        else if(S_ISREG(dirinfo.st_mode))
        {
            mycp(buf1, buf2);
        }
        else if(S_ISLNK(dirinfo.st_mode))
        {
            mycplink(buf1, buf2);
        }
    }
	closedir(dir1);
    closedir(dir2);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x960, %rsp            # imm = 0x960
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x10d0
movq -0x10(%rbp), %rdi
callq 0x1060
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x15df
leaq 0xa3b(%rip), %rdi       # 0x2009
callq 0x1130
movl $0x1, -0x4(%rbp)
jmp 0x1760
movq -0x18(%rbp), %rdi
callq 0x1060
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x160f
movq -0x18(%rbp), %rdi
movl -0xb0(%rbp), %esi
callq 0x1030
movq -0x18(%rbp), %rdi
callq 0x1060
movq %rax, -0x30(%rbp)
jmp 0x1611
leaq -0x960(%rbp), %rdi
xorl %esi, %esi
movl $0x400, %edx            # imm = 0x400
callq 0x1090
leaq -0x960(%rbp), %rdi
xorl %esi, %esi
movl $0x400, %edx            # imm = 0x400
callq 0x1090
movq -0x28(%rbp), %rdi
callq 0x10f0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x1650
jmp 0x1747
movq -0x38(%rbp), %rax
movsbl 0x13(%rax), %eax
cmpl $0x2e, %eax
jne 0x165f
jmp 0x1611
leaq -0x560(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x38(%rbp), %rcx
addq $0x13, %rcx
leaq 0x999(%rip), %rsi       # 0x2012
movb $0x0, %al
callq 0x1140
leaq -0x960(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x38(%rbp), %rcx
addq $0x13, %rcx
leaq 0x978(%rip), %rsi       # 0x2012
movb $0x0, %al
callq 0x1140
leaq -0x560(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x10d0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jge 0x16cb
leaq 0x954(%rip), %rdi       # 0x2018
callq 0x1130
jmp 0x1747
movl -0x140(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x16f2
leaq -0x560(%rbp), %rdi
leaq -0x960(%rbp), %rsi
callq 0x1590
jmp 0x1742
movl -0x140(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x8000, %eax           # imm = 0x8000
jne 0x1719
leaq -0x560(%rbp), %rdi
leaq -0x960(%rbp), %rsi
callq 0x1470
jmp 0x1740
movl -0x140(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0xa000, %eax           # imm = 0xA000
jne 0x173e
leaq -0x560(%rbp), %rdi
leaq -0x960(%rbp), %rsi
callq 0x1400
jmp 0x1740
jmp 0x1742
jmp 0x1611
movq -0x28(%rbp), %rdi
callq 0x10b0
movq -0x30(%rbp), %rdi
callq 0x10b0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x960, %rsp            # imm = 0x960
popq %rbp
retq
nopl (%rax)