// File: /workspace/github_c_makefile_star2_O1/keiranrowan[P]tiny-core/./src/wc.c
// Function: main
int main(int argc, char **argv) {
	if (argc > 2) {
		if (strcmp(argv[1], "-h") == 0) {
			help();
		} else if (strcmp(argv[1], "-l") == 0) {
			if (strcmp(argv[2], "-") == 0) { 
			    int n;
				char ch;

				while ((ch = getc(stdin)) != EOF) {
					if (ch == '\n') {
						n++;
					}
				}

				printf("%i\n", n);
			} else {
				int i, n = 0;
				for (i = 2; i < argc; i++) {
					FILE *fp;
					char ch;
					
					fp = fopen(argv[i], "r");
					if (fp) {
						while ((ch = getc(fp)) != EOF) {
							if (ch == '\n') {
								n++;
							}
						}
						fclose(fp);
					}
				}
				
				printf("%i\n", n);
			}
		} else if (strcmp(argv[1], "-b") == 0) {
			if (strcmp(argv[2], "-") == 0) {
				int n = 0;
				char ch;

				while ((ch = getc(stdin)) != EOF) {
					n++;
				}

				printf("%i\n", n);
			} else {
				int i, n = 0;
				for (i = 2; i < argc; i++) {
					FILE *fp;
					char ch;
					
					fp = fopen(argv[i], "r");
					if (fp) {
						while ((ch = getc(fp)) != EOF) {
							n++;
						}
						fclose(fp);
					}
				}
				
				printf("%i\n", n);
			}
		} else if (strcmp(argv[1], "-w") == 0) {
			if (strcmp(argv[2], "-") == 0) {
				int n = 0, alpha = 0;
				char ch;

				while ((ch = getc(stdin)) != EOF) {
					if (!isspace(ch)) {
						alpha = 1;
					} else {
						if (alpha) {
							alpha = 0;
							n++;
						}
					}
				}

				printf("%i\n", n);
			} else {
				int i, n = 0;
				for (i = 2; i < argc; i++) {
					FILE *fp;
					char ch;
					
					fp = fopen(argv[i], "r");
					if (fp) {
						int alpha = 0;
						
						while ((ch = getc(fp)) != EOF) {
							if (!isspace(ch)) {
								alpha = 1;
							} else {
								if (alpha) {
									alpha = 0;
									n++;
								}
							}
						}
						fclose(fp);
					}
				}
				
				printf("%i\n", n);
			}
		} else if (strcmp(argv[1], "-c") == 0) {
			if (strcmp(argv[2], "-") == 0) {
				int n = 0;
				char ch;
				
				while ((ch = getc(stdin)) != EOF) {
					if (!(ch == '\n') || !(ch == '\t') || !(ch == ' ')) {
						n++;
					}
				}
				
				printf("%i\n", n);
			} else {
				int i, n = 0;
				for (i = 2; i < argc; i++) {
					FILE *fp;
					char ch;
					
					fp = fopen(argv[i], "r");
					if (fp) {
						while ((ch = getc(fp)) != EOF) {
							if (!(ch == '\n') || !(ch == '\t') || !(ch == ' ')) {
								n++;
							}
						}
						fclose(fp);
					}
				}
				
				printf("%i\n", n);
			}
		} else {
			printf("Missing flags...\n");
			help();
		}
	} else {
		printf("Invalid arguments...\n");
		help();
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpl $0x3, %edi
jl 0x122c
movq %rsi, %r13
movl %edi, %ebp
movq 0x8(%rsi), %r14
leaq 0xe45(%rip), %rsi       # 0x2004
movq %r14, %rdi
callq 0x1060
testl %eax, %eax
je 0x1238
leaq 0xe35(%rip), %rsi       # 0x2007
movq %r14, %rdi
callq 0x1060
testl %eax, %eax
je 0x1242
leaq 0xe2d(%rip), %rsi       # 0x2012
movq %r14, %rdi
callq 0x1060
testl %eax, %eax
je 0x12ad
leaq 0xe19(%rip), %rsi       # 0x2015
movq %r14, %rdi
callq 0x1060
testl %eax, %eax
je 0x1310
leaq 0xe05(%rip), %rsi       # 0x2018
movq %r14, %rdi
callq 0x1060
testl %eax, %eax
je 0x1401
leaq 0xe06(%rip), %rdi       # 0x2030
jmp 0x1233
leaq 0xde8(%rip), %rdi       # 0x201b
callq 0x1030
callq 0x1529
jmp 0x1518
movq 0x10(%r13), %rdi
leaq 0xdbd(%rip), %rsi       # 0x200a
callq 0x1060
testl %eax, %eax
je 0x13de
movl %ebp, %ebx
xorl %ebp, %ebp
movl $0x2, %r12d
leaq 0xda5(%rip), %r14       # 0x2010
movq (%r13,%r12,8), %rdi
movq %r14, %rsi
callq 0x1070
testq %rax, %rax
je 0x12a0
movq %rax, %r15
movq %r15, %rdi
callq 0x1080
cmpb $-0x1, %al
je 0x1298
movzbl %al, %eax
cmpl $0xa, %eax
jne 0x1280
incl %ebp
jmp 0x1280
movq %r15, %rdi
callq 0x1040
incq %r12
cmpq %rbx, %r12
jne 0x126b
jmp 0x145f
movq 0x10(%r13), %rdi
leaq 0xd52(%rip), %rsi       # 0x200a
callq 0x1060
testl %eax, %eax
je 0x146d
movl %ebp, %ebx
xorl %ebp, %ebp
movl $0x2, %r12d
leaq 0xd3a(%rip), %r14       # 0x2010
movq (%r13,%r12,8), %rdi
movq %r14, %rsi
callq 0x1070
testq %rax, %rax
je 0x1303
movq %rax, %r15
decl %ebp
movq %r15, %rdi
callq 0x1080
incl %ebp
cmpb $-0x1, %al
jne 0x12ed
movq %r15, %rdi
callq 0x1040
incq %r12
cmpq %rbx, %r12
jne 0x12d6
jmp 0x145f
movq 0x10(%r13), %rdi
leaq 0xcef(%rip), %rsi       # 0x200a
callq 0x1060
testl %eax, %eax
je 0x1489
movl %ebp, %eax
movq %rax, 0x8(%rsp)
movl $0x2, %ebx
xorl %ebp, %ebp
movq %r13, (%rsp)
movq (%r13,%rbx,8), %rdi
leaq 0xcca(%rip), %rsi       # 0x2010
callq 0x1070
testq %rax, %rax
je 0x13cb
movq %rax, %r15
movq %rbx, 0x10(%rsp)
movq %rax, %rdi
callq 0x1080
movl %eax, %r13d
shll $0x18, %r13d
cmpl $0xff000000, %r13d      # imm = 0xFF000000
je 0x13ba
xorl %r14d, %r14d
callq 0x1090
movq %rax, %r12
sarl $0x18, %r13d
movq (%r12), %rax
movslq %r13d, %rcx
movzwl (%rax,%rcx,2), %eax
xorl %ebx, %ebx
btl $0xd, %eax
setae %bl
movl $0x0, %eax
cmovael %eax, %r14d
addl %r14d, %ebp
movq %r15, %rdi
callq 0x1080
movl %eax, %r13d
shll $0x18, %r13d
movl %ebx, %r14d
cmpl $0xff000000, %r13d      # imm = 0xFF000000
jne 0x137b
movq %r15, %rdi
callq 0x1040
movq (%rsp), %r13
movq 0x10(%rsp), %rbx
incq %rbx
cmpq 0x8(%rsp), %rbx
jne 0x133a
jmp 0x145f
movq 0x2bfb(%rip), %r14      # 0x3fe0
movq (%r14), %rdi
callq 0x1080
cmpb $-0x1, %al
je 0x1508
movzbl %al, %eax
cmpl $0xa, %eax
jne 0x13e5
incl %ebx
jmp 0x13e5
movq 0x10(%r13), %rdi
leaq 0xbfe(%rip), %rsi       # 0x200a
callq 0x1060
testl %eax, %eax
je 0x14ee
movl %ebp, %ebx
xorl %ebp, %ebp
movl $0x2, %r12d
leaq 0xbe6(%rip), %r14       # 0x2010
movq (%r13,%r12,8), %rdi
movq %r14, %rsi
callq 0x1070
testq %rax, %rax
je 0x1457
movq %rax, %r15
decl %ebp
movq %r15, %rdi
callq 0x1080
incl %ebp
cmpb $-0x1, %al
jne 0x1441
movq %r15, %rdi
callq 0x1040
incq %r12
cmpq %rbx, %r12
jne 0x142a
leaq 0xba6(%rip), %rdi       # 0x200c
movl %ebp, %esi
jmp 0x1511
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq 0x2b67(%rip), %r14      # 0x3fe0
movq (%r14), %rdi
callq 0x1080
incl %ebx
cmpb $-0x1, %al
jne 0x1479
jmp 0x1508
movq 0x2b50(%rip), %r15      # 0x3fe0
movq (%r15), %rdi
callq 0x1080
movl %eax, %ebp
shll $0x18, %ebp
xorl %ebx, %ebx
cmpl $0xff000000, %ebp       # imm = 0xFF000000
je 0x1508
xorl %r12d, %r12d
callq 0x1090
movq %rax, %r14
xorl %eax, %eax
xorl %ebx, %ebx
sarl $0x18, %ebp
movq (%r14), %rcx
movslq %ebp, %rdx
movzwl (%rcx,%rdx,2), %ecx
xorl %r13d, %r13d
btl $0xd, %ecx
setae %r13b
cmovael %r12d, %eax
addl %eax, %ebx
movq (%r15), %rdi
callq 0x1080
movl %eax, %ebp
shll $0x18, %ebp
movl %r13d, %eax
cmpl $0xff000000, %ebp       # imm = 0xFF000000
jne 0x14b6
jmp 0x1508
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq 0x2ae6(%rip), %r14      # 0x3fe0
movq (%r14), %rdi
callq 0x1080
incl %ebx
cmpb $-0x1, %al
jne 0x14fa
leaq 0xafd(%rip), %rdi       # 0x200c
movl %ebx, %esi
xorl %eax, %eax
callq 0x1050
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq