// File: /workspace/github_cpp_makefile_star2_O1/Dts0[P]addCopyright/main.cpp
// Function: main
int main(int argc,char** argv){
	if(argc==0){
		showHelp();
		return 0;
	}

	int readCnt = 0;
	string copyrightFile;
	vector<string> files;
	while((++readCnt)<argc){
		string argStr(argv[readCnt]);
		if(argStr[0]=='-'){
			if(argStr=="-c"){
				if(argv[readCnt+1])
					copyrightFile=argv[++readCnt];
				else {
					optionLackVal(argStr);
					showHelp();
					return 0;
				}
			}
			else if(argStr=="-h"){
				showHelp();
				return 0;
			} else if(argStr=="-v"){
				showVersion();
				return 0;
			} else {
				unknownOption(argStr);
				showHelp();
				return 0;
			}
		}
		else {
			files.push_back(argv[readCnt]);
		}
	}

	if(files.empty()){
		noOutputFile();
		showHelp();
		return 0;
	}
	int sucessCnt=0,failCnt=0;
	for(auto it=files.begin();it!=files.end();++it){
		if(addCopyright(*it,copyrightFile,cout)>0)
			++sucessCnt;
		else ++failCnt;
		cout<<endl;
	}
	cout<<"全部完成。"
		<<"\t其中"<<sucessCnt<<"个成功，"
		<<"\t"<<failCnt<<"个失败。"
		<<endl;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
testl %edi, %edi
je 0x2a9e
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
xorl %r12d, %r12d
movq %r12, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x50(%rsp), %rax
movq %r12, 0x10(%rax)
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
leaq 0x10(%rsp), %r15
leal 0x1(%r12), %r14d
cmpl %ebp, %r14d
jge 0x2aa8
movslq %r14d, %r13
movq (%rbx,%r13,8), %rsi
movq %r15, %rdi
leaq 0xe8(%rsp), %rdx
callq 0x3008
movq 0x10(%rsp), %rax
cmpb $0x2d, (%rax)
jne 0x297d
movq %r15, %rdi
leaq 0x1833(%rip), %rsi      # 0x4129
callq 0x2080
testl %eax, %eax
je 0x29d0
movq %r15, %rdi
leaq 0x181f(%rip), %rsi      # 0x412c
callq 0x2080
testl %eax, %eax
je 0x2a69
movq %r15, %rdi
leaq 0x180b(%rip), %rsi      # 0x412f
callq 0x2080
testl %eax, %eax
je 0x2a08
leaq 0xb8(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
leaq 0xa8(%rsp), %rdi
callq 0x30a2
leaq 0xa8(%rsp), %rdi
callq 0x2f4e
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rcx
jmp 0x2a56
movq (%rbx,%r13,8), %rsi
leaq 0xe8(%rsp), %r12
movq %r12, %rdi
leaq 0xb(%rsp), %rdx
callq 0x3008
leaq 0x50(%rsp), %rdi
movq %r12, %rsi
callq 0x31c2
movq 0xe8(%rsp), %rdi
leaq 0xf8(%rsp), %rax
cmpq %rax, %rdi
je 0x29c8
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x2170
movb $0x1, %r13b
jmp 0x2a71
movslq %r12d, %rax
movq 0x10(%rbx,%rax,8), %r13
testq %r13, %r13
je 0x2a0f
movq 0x38(%rsp), %r14
movq %r13, %rdi
callq 0x20b0
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
movq %r14, %rdx
movq %r13, %rcx
movq %rax, %r8
callq 0x2200
addl $0x2, %r12d
movb $0x1, %r13b
jmp 0x2a74
callq 0x2eba
jmp 0x2a6e
leaq 0xd8(%rsp), %rax
movq %rax, 0xc8(%rsp)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
leaq 0xc8(%rsp), %rdi
callq 0x30a2
leaq 0xc8(%rsp), %rdi
callq 0x2e44
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rcx
movq %rcx, %rax
cmpq %rcx, %rdi
je 0x2a69
movq (%rax), %rsi
incq %rsi
callq 0x2170
callq 0x2deb
xorl %r13d, %r13d
movl %r14d, %r12d
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x2a90
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2170
testb %r13b, %r13b
jne 0x28b9
jmp 0x2c95
callq 0x2deb
jmp 0x2cbb
movq 0x50(%rsp), %r14
cmpq 0x58(%rsp), %r14
je 0x2bd1
cmpq 0x58(%rsp), %r14
je 0x2be0
xorl %ebx, %ebx
xorl %ebp, %ebp
movl %ebx, 0xc(%rsp)
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %rdi
callq 0x30a2
leaq 0x98(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %rbx
movq %rbx, %rdi
callq 0x30a2
leaq 0x68(%rsp), %rdi
movq %rbx, %rsi
movq 0x34b3(%rip), %rdx      # 0x5fd8
callq 0x23ac
movl %eax, %r13d
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x2b52
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2170
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x2b6e
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2170
xorl %r15d, %r15d
xorl %r12d, %r12d
testl %r13d, %r13d
setle %r13b
setg %bl
movq 0x3453(%rip), %rcx      # 0x5fd8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq 0x3435(%rip), %rdi      # 0x5fd8
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movb %bl, %r12b
addl %r12d, %ebp
movb %r13b, %r15b
movl 0xc(%rsp), %ebx
addl %r15d, %ebx
addq $0x20, %r14
cmpq 0x58(%rsp), %r14
jne 0x2ac7
jmp 0x2be4
callq 0x2fc4
callq 0x2deb
jmp 0x2c95
xorl %ebp, %ebp
xorl %ebx, %ebx
movq 0x33ed(%rip), %rdi      # 0x5fd8
leaq 0x1540(%rip), %rsi      # 0x4132
movl $0xf, %edx
callq 0x21a0
movq 0x33d5(%rip), %rdi      # 0x5fd8
leaq 0x1538(%rip), %rsi      # 0x4142
movl $0x7, %edx
callq 0x21a0
movq 0x33bd(%rip), %rdi      # 0x5fd8
movl %ebp, %esi
callq 0x2210
movq %rax, %r14
leaq 0x151e(%rip), %rsi      # 0x414a
movl $0xc, %edx
movq %rax, %rdi
callq 0x21a0
leaq 0x1517(%rip), %rsi      # 0x4157
movl $0x1, %edx
movq %r14, %rdi
callq 0x21a0
movq %r14, %rdi
movl %ebx, %esi
callq 0x2210
movq %rax, %rbx
leaq 0x14f8(%rip), %rsi      # 0x4159
movl $0xc, %edx
movq %rax, %rdi
callq 0x21a0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
leaq 0x50(%rsp), %rdi
callq 0x3046
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x2cbb
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2170
xorl %eax, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2dba
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x2d9a
movq 0xd8(%rsp), %rsi
jmp 0x2d8d
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x2d9a
movq 0xb8(%rsp), %rsi
jmp 0x2d8d
jmp 0x2dba
movq %rax, %rbx
jmp 0x2d55
movq %rax, %rbx
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x2d55
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2170
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x2dbd
movq 0x78(%rsp), %rsi
jmp 0x2dae
jmp 0x2d97
movq %rax, %rbx
movq 0xe8(%rsp), %rdi
leaq 0xf8(%rsp), %rax
cmpq %rax, %rdi
je 0x2d9a
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x2170
jmp 0x2d9a
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x2dbd
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2170
jmp 0x2dbd
jmp 0x2dba
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x3046
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x2de3
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2170
movq %rbx, %rdi
callq 0x2220