// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xa0, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x2128(%rip), %rdx      # 0x41ad
callq 0x1170
movl %eax, -0x24(%rbp)
cmpl $-0x1, %eax
je 0x2176
movl -0x24(%rbp), %eax
addl $-0x3f, %eax
movl %eax, %ecx
movq %rcx, -0x98(%rbp)
subl $0x39, %eax
ja 0x216f
movq -0x98(%rbp), %rax
leaq 0x2004(%rip), %rcx      # 0x40c0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x3f, 0x4040(%rip)     # 0x610c
jmp 0x2171
movb $0x2f, 0x4034(%rip)     # 0x610c
jmp 0x2171
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2171
movl 0x403f(%rip), %eax      # 0x6130
addl $0x1, %eax
movl %eax, 0x4036(%rip)      # 0x6130
jmp 0x2171
movq 0x3ed5(%rip), %rax      # 0x5fd8
movq (%rax), %rax
movq %rax, 0x4003(%rip)      # 0x6110
jmp 0x2171
movl 0x3ff3(%rip), %eax      # 0x6108
addl $0x1, %eax
movl %eax, 0x3fea(%rip)      # 0x6108
jmp 0x2171
movl 0x3fe2(%rip), %eax      # 0x6108
addl $-0x1, %eax
movl %eax, 0x3fd9(%rip)      # 0x6108
jmp 0x2171
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x2171
movl 0x3ff2(%rip), %eax      # 0x6134
addl $0x1, %eax
movl %eax, 0x3fe9(%rip)      # 0x6134
jmp 0x2171
movl 0x3fe5(%rip), %eax      # 0x6138
addl $0x1, %eax
movl %eax, 0x3fdc(%rip)      # 0x6138
movl 0x3fda(%rip), %eax      # 0x613c
addl $0x1, %eax
movl %eax, 0x3fd1(%rip)      # 0x613c
jmp 0x2171
jmp 0x216f
jmp 0x21aa
jmp 0x2077
movq 0x3e53(%rip), %rax      # 0x5fd0
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movq 0x3e38(%rip), %rax      # 0x5fd0
movl (%rax), %ecx
movl -0x8(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x8(%rbp)
cmpl $0x0, -0x8(%rbp)
jne 0x21cc
jmp 0x21aa
movq 0x3e47(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
leaq 0x1ffe(%rip), %rsi      # 0x41b9
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x1190
callq 0x23d0
movl $0x0, -0x20(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x2273
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x214f(%rip), %rsi      # 0x434d
callq 0x1160
movq %rax, 0x3f36(%rip)      # 0x6140
cmpq $0x0, %rax
jne 0x2233
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x2008(%rip), %rdi      # 0x422b
movb $0x0, %al
callq 0x1050
movl $0x1, -0x1c(%rbp)
jmp 0x2263
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x3f02(%rip)      # 0x6148
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2550
movq 0x3ee2(%rip), %rdi      # 0x6140
callq 0x1060
jmp 0x2265
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x21df
cmpq $0x0, 0x3ed5(%rip)      # 0x6150
je 0x23ba
cmpl $0x0, 0x3eb4(%rip)      # 0x613c
je 0x229b
movq 0x3ebf(%rip), %rdi      # 0x6150
callq 0x31e0
jmp 0x23b8
cmpl $0x0, -0x18(%rbp)
je 0x22ff
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x22f6
leaq -0x90(%rbp), %rdi
movq 0x3e52(%rip), %rdx      # 0x6110
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movq 0x3e3f(%rip), %r8       # 0x6110
leaq 0x1f13(%rip), %rsi      # 0x41eb
movb $0x0, %al
callq 0x1180
leaq -0x90(%rbp), %rdi
callq 0x1070
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x22a8
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movq 0x3e0a(%rip), %rdi      # 0x6110
movl -0x14(%rbp), %ecx
leaq 0x1f0e(%rip), %rsi      # 0x421e
leaq 0x1f05(%rip), %rax      # 0x421c
cmpl $0x0, %ecx
cmovneq %rax, %rsi
callq 0x1160
movq %rax, 0x3e2e(%rip)      # 0x6158
cmpq $0x0, %rax
jne 0x2369
cmpl $0x0, -0x1c(%rbp)
je 0x2341
movl -0x1c(%rbp), %eax
movl %eax, -0x9c(%rbp)
jmp 0x234e
movl $0x1, %eax
movl %eax, -0x9c(%rbp)
jmp 0x234e
movl -0x9c(%rbp), %edi
movq 0x3db5(%rip), %rdx      # 0x6110
leaq 0x1ec9(%rip), %rsi      # 0x422b
movb $0x0, %al
callq 0x1120
movq 0x3de0(%rip), %rdi      # 0x6150
callq 0x31e0
movq 0x3ddc(%rip), %rdi      # 0x6158
callq 0x1060
cmpl $0x0, -0x18(%rbp)
je 0x23b6
leaq -0x90(%rbp), %rdi
movq 0x3d7b(%rip), %rdx      # 0x6110
movq 0x3d74(%rip), %rcx      # 0x6110
leaq 0x1e7d(%rip), %rsi      # 0x4220
movb $0x0, %al
callq 0x1180
leaq -0x90(%rbp), %rdi
callq 0x1070
jmp 0x23b8
jmp 0x23ba
movl -0x1c(%rbp), %edi
callq 0x1190
nopw %cs:(%rax,%rax)