// File: /workspace/github_c_makefile_star2_O0/CSerxzm[P]WindowstoLinuxInterface/src/COPY.c
// Function: main
int main(int argc, char** argv){
    char lines[argc+1][255];
    predealLine(argc, argv, lines);
    char* srcname = lines[1];
    char* dstname = lines[2];
    char option[5];
    FILE *src, *dst;
	
	if(access(srcname, F_OK)==-1) {
		printf("源文件不存在\n");
		return 0;
    }
    if(!access(dstname, F_OK)) {
        while(1) {
            printf("覆盖 %s 吗?(Yes/No/All):", dstname);
            scanf("%s", option);
            if(strcmp("No", option) == 0) {
                printf("已复制 0 个文件\n");
                return 0;
            } 
            else if(strcmp("Yes", option) == 0) {
                break;
            }
        }
    }
    src = fopen(srcname, "rb");
    dst = fopen(dstname, "wb");
    int bufferLen = 1024;
    int readCount = 0;
    char *buffer = (char*)malloc(bufferLen);
    while((readCount=fread(buffer, 1, bufferLen, src)) > 0) {
        fwrite(buffer, readCount, 1, dst);
    }
    printf("已复制 1 个文件\n");
    free(buffer);
    fclose(src);
    fclose(dst);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x8(%rbp), %eax
incl %eax
movq %rsp, %rcx
movq %rcx, -0x18(%rbp)
movq %rax, %rcx
shlq $0x8, %rcx
subq %rax, %rcx
addq $0xf, %rcx
movabsq $0x1fffffffff0, %rdx    # imm = 0x1FFFFFFFFF0
andq %rdx, %rcx
movq %rsp, %rdx
subq %rcx, %rdx
movq %rdx, -0x68(%rbp)
movq %rdx, %rsp
movq %rax, -0x20(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x1200
movq -0x68(%rbp), %rax
movq %rax, %rcx
addq $0xff, %rcx
movq %rcx, -0x28(%rbp)
addq $0x1fe, %rax            # imm = 0x1FE
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
xorl %esi, %esi
callq 0x10b0
cmpl $-0x1, %eax
jne 0x1447
leaq 0xbd7(%rip), %rdi       # 0x2004
movb $0x0, %al
callq 0x1070
movl $0x0, -0x4(%rbp)
movl $0x1, -0x4c(%rbp)
jmp 0x1582
movq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0x10b0
cmpl $0x0, %eax
jne 0x14d2
jmp 0x1459
jmp 0x145b
movq -0x30(%rbp), %rsi
leaq 0xbb2(%rip), %rdi       # 0x2018
movb $0x0, %al
callq 0x1070
leaq -0x35(%rbp), %rsi
leaq 0xbbc(%rip), %rdi       # 0x2034
movb $0x0, %al
callq 0x10d0
leaq -0x35(%rbp), %rsi
leaq 0xbad(%rip), %rdi       # 0x2037
callq 0x1080
cmpl $0x0, %eax
jne 0x14b5
leaq 0xb9f(%rip), %rdi       # 0x203a
movb $0x0, %al
callq 0x1070
movl $0x0, -0x4(%rbp)
movl $0x1, -0x4c(%rbp)
jmp 0x1582
leaq -0x35(%rbp), %rsi
leaq 0xb91(%rip), %rdi       # 0x2051
callq 0x1080
cmpl $0x0, %eax
jne 0x14cc
jmp 0x14d0
jmp 0x14ce
jmp 0x1459
jmp 0x14d2
movq -0x28(%rbp), %rdi
leaq 0xb78(%rip), %rsi       # 0x2055
callq 0x10c0
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rdi
leaq 0xb67(%rip), %rsi       # 0x2058
callq 0x10c0
movq %rax, -0x48(%rbp)
movl $0x400, -0x50(%rbp)     # imm = 0x400
movl $0x0, -0x54(%rbp)
movslq -0x50(%rbp), %rdi
callq 0x10a0
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
movslq -0x50(%rbp), %rdx
movq -0x40(%rbp), %rcx
movl $0x1, %esi
callq 0x1040
movl %eax, -0x54(%rbp)
cmpl $0x0, %eax
jle 0x154b
movq -0x60(%rbp), %rdi
movslq -0x54(%rbp), %rsi
movq -0x48(%rbp), %rcx
movl $0x1, %edx
callq 0x10e0
jmp 0x1515
leaq 0xb09(%rip), %rdi       # 0x205b
movb $0x0, %al
callq 0x1070
movq -0x60(%rbp), %rdi
callq 0x1030
movq -0x40(%rbp), %rdi
callq 0x1050
movq -0x48(%rbp), %rdi
callq 0x1050
movl $0x0, -0x4(%rbp)
movl $0x1, -0x4c(%rbp)
movq -0x18(%rbp), %rax
movq %rax, %rsp
movl -0x4(%rbp), %eax
movq %rbp, %rsp
popq %rbp
retq