// File: /workspace/github_cpp_makefile_star2_O2/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 $0x118, %rsp            # imm = 0x118
movl %edi, 0x4(%rsp)
testl %edi, %edi
je 0x288d
movq %rsi, %rbx
leaq 0x48(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x10(%rsp), %rax
andq $0x0, 0x10(%rax)
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
xorl %r14d, %r14d
leaq 0x98(%rsp), %r15
leaq 0xf8(%rsp), %r12
leal 0x1(%r14), %r13d
cmpl 0x4(%rsp), %r13d
jge 0x2897
movslq %r13d, %rbp
movq (%rbx,%rbp,8), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x2b9a
movq 0x98(%rsp), %rax
cmpb $0x2d, (%rax)
jne 0x27d7
movq %r15, %rdi
leaq 0x981(%rip), %rsi       # 0x3129
callq 0x2bd5
testb %al, %al
je 0x2802
movslq %r14d, %rax
movq 0x10(%rbx,%rax,8), %rsi
testq %rsi, %rsi
je 0x282f
leaq 0x38(%rsp), %rdi
callq 0x2260
addl $0x2, %r14d
movb $0x1, %bpl
movl %r14d, %r13d
jmp 0x2874
movq (%rbx,%rbp,8), %rsi
movq %r12, %rdi
leaq 0xb(%rsp), %rdx
callq 0x2b9a
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x2cf4
movq %r12, %rdi
callq 0x20d0
movb $0x1, %bpl
jmp 0x2874
movq %r15, %rdi
leaq 0x920(%rip), %rsi       # 0x312c
callq 0x2bd5
testb %al, %al
jne 0x286d
movq %r15, %rdi
leaq 0x910(%rip), %rsi       # 0x312f
callq 0x2bd5
testb %al, %al
je 0x284b
callq 0x2aea
jmp 0x2872
leaq 0x78(%rsp), %rdi
movq %r15, %rsi
callq 0x21e0
leaq 0x78(%rsp), %r14
movq %r14, %rdi
callq 0x2ab0
jmp 0x2865
leaq 0x58(%rsp), %rdi
movq %r15, %rsi
callq 0x21e0
leaq 0x58(%rsp), %r14
movq %r14, %rdi
callq 0x2b43
movq %r14, %rdi
callq 0x20d0
callq 0x2a6e
xorl %ebp, %ebp
movq %r15, %rdi
callq 0x20d0
movl %r13d, %r14d
testb %bpl, %bpl
jne 0x2770
jmp 0x29c8
callq 0x2a6e
jmp 0x29dc
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rax
cmpq %rax, %rsi
je 0x29be
xorl %ebp, %ebp
leaq 0xd8(%rsp), %rdi
movq 0x271d(%rip), %r15      # 0x4fd8
xorl %ebx, %ebx
cmpq %rax, %rsi
je 0x2951
movl %ebp, 0x4(%rsp)
movl %ebx, 0xc(%rsp)
movq %rdi, %r14
movq %rsi, 0x30(%rsp)
callq 0x21e0
leaq 0xb8(%rsp), %rbx
movq %rbx, %rdi
leaq 0x38(%rsp), %rsi
callq 0x21e0
movq %r14, %rbp
movq %r14, %rdi
movq %rbx, %rsi
movq %rbx, %r12
movq %r15, %rbx
movq %r15, %rdx
callq 0x23bc
movl %eax, %r13d
movq %r12, %rdi
callq 0x20d0
movq %rbp, %rdi
callq 0x20d0
movq %rbx, %rdi
callq 0x20e0
xorl %eax, %eax
xorl %ecx, %ecx
testl %r13d, %r13d
setg %al
setle %cl
movl 0xc(%rsp), %ebx
addl %ecx, %ebx
movl 0x4(%rsp), %ebp
addl %eax, %ebp
movq 0x30(%rsp), %rsi
addq $0x20, %rsi
movq 0x18(%rsp), %rax
movq %r14, %rdi
jmp 0x28bd
movq 0x2680(%rip), %rdi      # 0x4fd8
leaq 0x7d3(%rip), %rsi       # 0x3132
callq 0x2170
leaq 0x7d7(%rip), %rsi       # 0x3142
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
movl %ebp, %esi
callq 0x2220
leaq 0x7c6(%rip), %rsi       # 0x314a
movq %rax, %rdi
callq 0x2170
leaq 0x7c4(%rip), %rsi       # 0x3157
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
movl %ebx, %esi
callq 0x2220
leaq 0x7ad(%rip), %rsi       # 0x3159
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20e0
jmp 0x29c8
callq 0x2b7d
callq 0x2a6e
leaq 0x10(%rsp), %rdi
callq 0x2be2
leaq 0x38(%rsp), %rdi
callq 0x20d0
xorl %eax, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2a4f
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
jmp 0x2a15
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
jmp 0x2a15
jmp 0x2a4f
jmp 0x2a3b
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0x20d0
jmp 0x2a3e
movq %rax, %rbx
jmp 0x2a31
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x20d0
leaq 0xd8(%rsp), %rdi
jmp 0x2a46
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x20d0
jmp 0x2a52
jmp 0x2a4f
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2be2
leaq 0x38(%rsp), %rdi
callq 0x20d0
movq %rbx, %rdi
callq 0x2230