// File: /workspace/github_c_makefile_star2_O2/darwin-on-arm[P]darwin-sdk/developer_cmds/ctags/ctags.c
// Function: main
int
main(argc, argv)
	int	argc;
	char	**argv;
{
	static char	*outfile = "tags";	/* output file */
	int	aflag;				/* -a: append to tags */
	int	uflag;				/* -u: update tags */
	int	exit_val;			/* exit value */
	int	step;				/* step through args */
	int	ch;				/* getopts char */
	char	cmd[100];			/* too ugly to explain */

	aflag = uflag = NO;
	while ((ch = getopt(argc, argv, "BFadf:tuwvx")) != -1)
		switch(ch) {
		case 'B':
			searchar = '?';
			break;
		case 'F':
			searchar = '/';
			break;
		case 'a':
			aflag++;
			break;
		case 'd':
			dflag++;
			break;
		case 'f':
			outfile = optarg;
			break;
		case 't':
			tflag++;
			break;
		case 'T':
			tflag--;
			break;
		case 'u':
			uflag++;
			break;
		case 'w':
			wflag++;
			break;
		case 'v':
			vflag++;
		case 'x':
			xflag++;
			break;
		case '?':
		default:
			goto usage;
		}
	argv += optind;
	argc -= optind;
	if (!argc) {
usage:		(void)fprintf(stderr,
			"usage: ctags [-BFadtuwvx] [-f tagsfile] file ...\n");
		exit(1);
	}

	init();

	for (exit_val = step = 0; step < argc; ++step)
		if (!(inf = fopen(argv[step], "r"))) {
			warn("%s", argv[step]);
			exit_val = 1;
		}
		else {
			curfile = argv[step];
			find_entries(argv[step]);
			(void)fclose(inf);
		}

	if (head) {
		if (xflag)
			put_entries(head);
		else {
			if (uflag) {
				for (step = 0; step < argc; step++) {
					(void)sprintf(cmd,
						"mv %s OTAGS; fgrep -v '\t%s\t' OTAGS >%s; rm OTAGS",
							outfile, argv[step],
							outfile);
					(void)system(cmd);
				}
				++aflag;
			}
			if (!(outf = fopen(outfile, aflag ? "a" : "w")))
				err(exit_val ? exit_val : 1, "%s", outfile);
			put_entries(head);
			(void)fclose(outf);
			if (uflag) {
				(void)sprintf(cmd, "sort -o %s %s",
						outfile, outfile);
				(void)system(cmd);
			}
		}
	}
	exit(exit_val);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r14
movl %edi, %ebx
xorl %r13d, %r13d
leaq 0x1504(%rip), %r15      # 0x3079
leaq 0x14e4(%rip), %rbp      # 0x3060
xorl %r12d, %r12d
movl %ebx, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1180
leal -0x74(%rax), %ecx
cmpl $0x4, %ecx
jbe 0x1bc5
cmpl $0x42, %eax
je 0x1bdf
cmpl $0x46, %eax
je 0x1bf6
cmpl $0x54, %eax
je 0x1c1a
cmpl $0x61, %eax
je 0x1bff
cmpl $0x64, %eax
je 0x1c07
cmpl $0x66, %eax
jne 0x1c25
movq 0x341f(%rip), %rax      # 0x4fd8
movq (%rax), %rax
movq %rax, 0x355d(%rip)      # 0x5120
jmp 0x1b7f
movslq (%rbp,%rcx,4), %rax
addq %rbp, %rax
jmpq *%rax
incl 0x3543(%rip)            # 0x5118
jmp 0x1b7f
incl 0x3567(%rip)            # 0x5144
jmp 0x1b7f
movb $0x3f, 0x3536(%rip)     # 0x511c
jmp 0x1b7f
incl 0x355a(%rip)            # 0x5148
incl 0x3558(%rip)            # 0x514c
jmp 0x1b7f
movb $0x2f, 0x351f(%rip)     # 0x511c
jmp 0x1b7f
incl %r13d
jmp 0x1b7f
incl 0x3533(%rip)            # 0x5140
jmp 0x1b7f
incl %r12d
jmp 0x1b7f
decl 0x34f8(%rip)            # 0x5118
jmp 0x1b7f
cmpl $-0x1, %eax
jne 0x1c38
movq 0x339f(%rip), %rax      # 0x4fd0
movslq (%rax), %rax
subl %eax, %ebx
jne 0x1c5c
movq 0x33b9(%rip), %rax      # 0x4ff8
movq (%rax), %rcx
leaq 0x143c(%rip), %rdi      # 0x3085
pushq $0x31
popq %rsi
pushq $0x1
popq %rdx
callq 0x11b0
pushq $0x1
popq %rdi
callq 0x11a0
leaq (%r14,%rax,8), %rbp
callq 0x1dd0
xorl %eax, %eax
testl %ebx, %ebx
cmovlel %eax, %ebx
leaq 0x158a(%rip), %r14      # 0x31fd
xorl %r15d, %r15d
movl $0x0, 0xc(%rsp)
cmpq %r15, %rbx
je 0x1cd8
movq (%rbp,%r15,8), %rdi
movq %r14, %rsi
callq 0x1170
movq %rax, 0x34b9(%rip)      # 0x5150
movq (%rbp,%r15,8), %rsi
testq %rax, %rax
je 0x1cbe
movq %rsi, 0x34b0(%rip)      # 0x5158
movq %rsi, %rdi
callq 0x1eb0
movq 0x3499(%rip), %rdi      # 0x5150
callq 0x1060
jmp 0x1cd3
leaq 0x1432(%rip), %rdi      # 0x30f7
xorl %eax, %eax
callq 0x1050
pushq $0x1
popq %rax
movl %eax, 0xc(%rsp)
incq %r15
jmp 0x1c7e
movq 0x3481(%rip), %rdi      # 0x5160
testq %rdi, %rdi
je 0x1dc7
cmpl $0x0, 0x345d(%rip)      # 0x514c
jne 0x1d30
testl %r12d, %r12d
je 0x1d3d
leaq 0x10(%rsp), %r15
xorl %r14d, %r14d
cmpq %r14, %rbx
je 0x1d3a
movq 0x3416(%rip), %rdx      # 0x5120
movq (%rbp,%r14,8), %rcx
movq %r15, %rdi
leaq 0x139e(%rip), %rsi      # 0x30b7
movq %rdx, %r8
xorl %eax, %eax
callq 0x1190
movq %r15, %rdi
callq 0x1070
incq %r14
jmp 0x1cfe
callq 0x2503
jmp 0x1dc7
incl %r13d
movq 0x33dc(%rip), %rdi      # 0x5120
testl %r13d, %r13d
leaq 0x139c(%rip), %rax      # 0x30ea
leaq 0x1393(%rip), %rsi      # 0x30e8
cmoveq %rax, %rsi
callq 0x1170
movq %rax, 0x3403(%rip)      # 0x5168
testq %rax, %rax
jne 0x1d82
movq 0x33af(%rip), %rdx      # 0x5120
leaq 0x137f(%rip), %rsi      # 0x30f7
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x1120
movq 0x33d7(%rip), %rdi      # 0x5160
callq 0x2503
movq 0x33d3(%rip), %rdi      # 0x5168
callq 0x1060
testl %r12d, %r12d
je 0x1dc7
movq 0x337a(%rip), %rcx      # 0x5120
leaq 0x133f(%rip), %rsi      # 0x30ec
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %rcx, %rdx
xorl %eax, %eax
callq 0x1190
movq %rbx, %rdi
callq 0x1070
movl 0xc(%rsp), %edi
callq 0x11a0