// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x90, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x8(%rbp)
jle 0x16c7
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0xe42(%rip), %rsi       # 0x2004
callq 0x1050
cmpl $0x0, %eax
jne 0x11d6
callq 0x16f0
jmp 0x16c5
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0xe22(%rip), %rsi       # 0x2007
callq 0x1050
cmpl $0x0, %eax
jne 0x12e1
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0xe08(%rip), %rsi       # 0x200a
callq 0x1050
cmpl $0x0, %eax
jne 0x1252
jmp 0x120e
movq 0x2dcb(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
callq 0x1070
movb %al, -0x15(%rbp)
movsbl %al, %eax
cmpl $-0x1, %eax
je 0x123c
movsbl -0x15(%rbp), %eax
cmpl $0xa, %eax
jne 0x123a
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x120e
movl -0x14(%rbp), %esi
leaq 0xdc6(%rip), %rdi       # 0x200c
movb $0x0, %al
callq 0x1040
jmp 0x12dc
movl $0x0, -0x20(%rbp)
movl $0x2, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x12cb
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xd95(%rip), %rsi       # 0x2010
callq 0x1060
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x12be
jmp 0x128d
movq -0x28(%rbp), %rdi
callq 0x1070
movb %al, -0x29(%rbp)
movsbl %al, %eax
cmpl $-0x1, %eax
je 0x12b5
movsbl -0x29(%rbp), %eax
cmpl $0xa, %eax
jne 0x12b3
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x128d
movq -0x28(%rbp), %rdi
callq 0x1030
jmp 0x12c0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1260
movl -0x20(%rbp), %esi
leaq 0xd37(%rip), %rdi       # 0x200c
movb $0x0, %al
callq 0x1040
jmp 0x16c3
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0xd22(%rip), %rsi       # 0x2012
callq 0x1050
cmpl $0x0, %eax
jne 0x13df
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0xcfd(%rip), %rsi       # 0x200a
callq 0x1050
cmpl $0x0, %eax
jne 0x1359
movl $0x0, -0x30(%rbp)
movq 0x2cbb(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
callq 0x1070
movb %al, -0x31(%rbp)
movsbl %al, %eax
cmpl $-0x1, %eax
je 0x1343
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x131e
movl -0x30(%rbp), %esi
leaq 0xcbf(%rip), %rdi       # 0x200c
movb $0x0, %al
callq 0x1040
jmp 0x13da
movl $0x0, -0x3c(%rbp)
movl $0x2, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x13c9
movq -0x10(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xc8e(%rip), %rsi       # 0x2010
callq 0x1060
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0x13bc
jmp 0x1394
movq -0x48(%rbp), %rdi
callq 0x1070
movb %al, -0x49(%rbp)
movsbl %al, %eax
cmpl $-0x1, %eax
je 0x13b3
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x1394
movq -0x48(%rbp), %rdi
callq 0x1030
jmp 0x13be
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x1367
movl -0x3c(%rbp), %esi
leaq 0xc39(%rip), %rdi       # 0x200c
movb $0x0, %al
callq 0x1040
jmp 0x16c1
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0xc27(%rip), %rsi       # 0x2015
callq 0x1050
cmpl $0x0, %eax
jne 0x155a
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0xbff(%rip), %rsi       # 0x200a
callq 0x1050
cmpl $0x0, %eax
jne 0x1493
movl $0x0, -0x50(%rbp)
movl $0x0, -0x54(%rbp)
movq 0x2bb6(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
callq 0x1070
movb %al, -0x55(%rbp)
movsbl %al, %eax
cmpl $-0x1, %eax
je 0x147d
callq 0x1080
movq (%rax), %rax
movsbl -0x55(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
jne 0x1463
movl $0x1, -0x54(%rbp)
jmp 0x147b
cmpl $0x0, -0x54(%rbp)
je 0x1479
movl $0x0, -0x54(%rbp)
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x147b
jmp 0x1423
movl -0x50(%rbp), %esi
leaq 0xb85(%rip), %rdi       # 0x200c
movb $0x0, %al
callq 0x1040
jmp 0x1555
movl $0x0, -0x60(%rbp)
movl $0x2, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x1544
movq -0x10(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xb50(%rip), %rsi       # 0x2010
callq 0x1060
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x68(%rbp)
je 0x1534
movl $0x0, -0x70(%rbp)
movq -0x68(%rbp), %rdi
callq 0x1070
movb %al, -0x69(%rbp)
movsbl %al, %eax
cmpl $-0x1, %eax
je 0x152b
callq 0x1080
movq (%rax), %rax
movsbl -0x69(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
jne 0x1511
movl $0x1, -0x70(%rbp)
jmp 0x1529
cmpl $0x0, -0x70(%rbp)
je 0x1527
movl $0x0, -0x70(%rbp)
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x1529
jmp 0x14d7
movq -0x68(%rbp), %rdi
callq 0x1030
jmp 0x1536
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x14a1
movl -0x60(%rbp), %esi
leaq 0xabe(%rip), %rdi       # 0x200c
movb $0x0, %al
callq 0x1040
jmp 0x16bf
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0xaaf(%rip), %rsi       # 0x2018
callq 0x1050
cmpl $0x0, %eax
jne 0x16aa
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0xa84(%rip), %rsi       # 0x200a
callq 0x1050
cmpl $0x0, %eax
jne 0x15ed
movl $0x0, -0x74(%rbp)
movq 0x2a42(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
callq 0x1070
movb %al, -0x75(%rbp)
movsbl %al, %eax
cmpl $-0x1, %eax
je 0x15d7
movsbl -0x75(%rbp), %eax
cmpl $0xa, %eax
jne 0x15cc
movsbl -0x75(%rbp), %eax
cmpl $0x9, %eax
jne 0x15cc
movsbl -0x75(%rbp), %eax
cmpl $0x20, %eax
je 0x15d5
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x1597
movl -0x74(%rbp), %esi
leaq 0xa2b(%rip), %rdi       # 0x200c
movb $0x0, %al
callq 0x1040
jmp 0x16a8
movl $0x0, -0x80(%rbp)
movl $0x2, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x1697
movq -0x10(%rbp), %rax
movslq -0x7c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x9f6(%rip), %rsi       # 0x2010
callq 0x1060
movq %rax, -0x88(%rbp)
cmpq $0x0, -0x88(%rbp)
je 0x1687
jmp 0x1632
movq -0x88(%rbp), %rdi
callq 0x1070
movb %al, -0x89(%rbp)
movsbl %al, %eax
cmpl $-0x1, %eax
je 0x167b
movsbl -0x89(%rbp), %eax
cmpl $0xa, %eax
jne 0x1670
movsbl -0x89(%rbp), %eax
cmpl $0x9, %eax
jne 0x1670
movsbl -0x89(%rbp), %eax
cmpl $0x20, %eax
je 0x1679
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0x1632
movq -0x88(%rbp), %rdi
callq 0x1030
jmp 0x1689
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x15fb
movl -0x80(%rbp), %esi
leaq 0x96b(%rip), %rdi       # 0x200c
movb $0x0, %al
callq 0x1040
jmp 0x16bd
leaq 0x96a(%rip), %rdi       # 0x201b
movb $0x0, %al
callq 0x1040
callq 0x16f0
jmp 0x16bf
jmp 0x16c1
jmp 0x16c3
jmp 0x16c5
jmp 0x16da
leaq 0x95f(%rip), %rdi       # 0x202d
movb $0x0, %al
callq 0x1040
callq 0x16f0
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)