// File: /workspace/github_c_makefile_star2_O3/darwin-on-arm[P]darwin-sdk/developer_cmds/unifdef/unifdef.c
// Function: main
int
main(int argc, char *argv[])
{
	int opt;

	while ((opt = getopt(argc, argv, "i:D:U:I:o:bBcdeKklnsStV")) != -1)
		switch (opt) {
		case 'i': /* treat stuff controlled by these symbols as text */
			/*
			 * For strict backwards-compatibility the U or D
			 * should be immediately after the -i but it doesn't
			 * matter much if we relax that requirement.
			 */
			opt = *optarg++;
			if (opt == 'D')
				addsym(true, true, optarg);
			else if (opt == 'U')
				addsym(true, false, optarg);
			else
				usage();
			break;
		case 'D': /* define a symbol */
			addsym(false, true, optarg);
			break;
		case 'U': /* undef a symbol */
			addsym(false, false, optarg);
			break;
		case 'I': /* no-op for compatibility with cpp */
			break;
		case 'b': /* blank deleted lines instead of omitting them */
		case 'l': /* backwards compatibility */
			lnblank = true;
			break;
		case 'B': /* compress blank lines around removed section */
			compblank = true;
			break;
		case 'c': /* treat -D as -U and vice versa */
			complement = true;
			break;
		case 'd':
			debugging = true;
			break;
		case 'e': /* fewer errors from dodgy lines */
			iocccok = true;
			break;
		case 'K': /* keep ambiguous #ifs */
			strictlogic = true;
			break;
		case 'k': /* process constant #ifs */
			killconsts = true;
			break;
		case 'n': /* add #line directive after deleted lines */
			lnnum = true;
			break;
		case 'o': /* output to a file */
			ofilename = optarg;
			break;
		case 's': /* only output list of symbols that control #ifs */
			symlist = true;
			break;
		case 'S': /* list symbols with their nesting depth */
			symlist = symdepth = true;
			break;
		case 't': /* don't parse C comments */
			text = true;
			break;
		case 'V': /* print version */
			version();
		default:
			usage();
		}
	argc -= optind;
	argv += optind;
	if (compblank && lnblank)
		errx(2, "-B and -b are mutually exclusive");
	if (argc > 1) {
		errx(2, "can only do one file");
	} else if (argc == 1 && strcmp(*argv, "-") != 0) {
		filename = *argv;
		input = fopen(filename, "rb");
		if (input == NULL)
			err(2, "can't open %s", filename);
	} else {
		filename = "[stdin]";
		input = stdin;
	}
	if (ofilename == NULL) {
		ofilename = "[stdout]";
		output = stdout;
	} else {
		struct stat ist, ost;
		if (stat(ofilename, &ost) == 0 &&
		    fstat(fileno(input), &ist) == 0)
			overwriting = (ist.st_dev == ost.st_dev
				    && ist.st_ino == ost.st_ino);
		if (overwriting) {
			const char *dirsep;
			int ofd;

			dirsep = strrchr(ofilename, '/');
			if (dirsep != NULL)
				snprintf(tempname, sizeof(tempname),
				    "%.*s/" TEMPLATE,
				    (int)(dirsep - ofilename), ofilename);
			else
				snprintf(tempname, sizeof(tempname),
				    TEMPLATE);
			ofd = mkstemp(tempname);
			if (ofd != -1)
				output = fdopen(ofd, "wb+");
			if (output == NULL)
				err(2, "can't create temporary file");
			fchmod(ofd, ist.st_mode & (S_IRWXU|S_IRWXG|S_IRWXO));
		} else {
			output = fopen(ofilename, "wb");
			if (output == NULL)
				err(2, "can't open %s", ofilename);
		}
	}
	process();
	abort(); /* bug */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x2e0d(%rip), %r14      # 0x6206
leaq 0x2c10(%rip), %r15      # 0x6010
movq 0x5bd1(%rip), %r12      # 0x8fd8
leaq 0x2c2a(%rip), %r13      # 0x6038
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x3230
leal -0x53(%rax), %ecx
cmpl $0x21, %ecx
ja 0x3436
movslq (%r13,%rcx,4), %rax
addq %r13, %rax
jmpq *%rax
movb $0x1, 0x5d3c(%rip)      # 0x9170
jmp 0x340e
leal -0x42(%rax), %ecx
cmpl $0x9, %ecx
ja 0x3520
movslq (%r15,%rcx,4), %rax
addq %r15, %rax
jmpq *%rax
movb $0x1, 0x5d1f(%rip)      # 0x9171
jmp 0x340e
movb $0x1, 0x5d1b(%rip)      # 0x9176
jmp 0x340e
movb $0x1, 0x5d13(%rip)      # 0x9177
jmp 0x340e
movq (%r12), %rax
movq %rax, 0x5d07(%rip)      # 0x9178
jmp 0x340e
movq (%r12), %rdx
xorl %edi, %edi
jmp 0x3514
movb $0x1, %al
movb %al, 0x5cfb(%rip)       # 0x9181
movb %al, 0x5cf4(%rip)       # 0x9180
jmp 0x340e
movb $0x1, 0x5cdf(%rip)      # 0x9174
jmp 0x340e
movb $0x1, 0x5cd1(%rip)      # 0x9172
jmp 0x340e
movq (%r12), %rax
leaq 0x1(%rax), %rdx
movq %rdx, (%r12)
movzbl (%rax), %eax
cmpl $0x55, %eax
je 0x350f
cmpl $0x44, %eax
jne 0x3555
movl $0x1, %edi
jmp 0x3500
movb $0x1, 0x5caf(%rip)      # 0x9180
jmp 0x340e
movb $0x1, 0x5c96(%rip)      # 0x9173
jmp 0x340e
movb $0x1, 0x5c99(%rip)      # 0x9182
jmp 0x340e
movb $0x1, 0x5c80(%rip)      # 0x9175
jmp 0x340e
movq (%r12), %rdx
xorl %edi, %edi
movl $0x1, %esi
callq 0x37cc
jmp 0x340e
movl $0x1, %edi
xorl %esi, %esi
callq 0x37cc
jmp 0x340e
cmpl $-0x1, %eax
jne 0x3555
movq 0x5aa4(%rip), %rax      # 0x8fd0
movslq (%rax), %rax
cmpb $0x1, 0x5c3b(%rip)      # 0x9171
jne 0x35d3
cmpb $0x1, 0x5c2d(%rip)      # 0x9170
jne 0x35d3
leaq 0x2cce(%rip), %rsi      # 0x621e
jmp 0x35e1
movq 0x5a9c(%rip), %rax      # 0x8ff8
movq (%rax), %rcx
leaq 0x2d47(%rip), %rdi      # 0x62ad
movl $0x61, %esi
movl $0x1, %edx
callq 0x3250
movl $0x2, %edi
callq 0x3240
leaq 0x2b5a(%rip), %rbx      # 0x60e0
movq 0x5a6b(%rip), %r14      # 0x8ff8
movzbl 0x1(%rbx), %eax
cmpl $0x24, %eax
je 0x359f
incq %rbx
testl %eax, %eax
jne 0x358d
jmp 0x35cc
movb 0x2(%rbx), %al
addq $0x2, %rbx
cmpb $0x24, %al
je 0x35bd
movsbl %al, %edi
movq (%r14), %rsi
callq 0x3170
movb 0x1(%rbx), %al
incq %rbx
jmp 0x35a6
movq (%r14), %rsi
movl $0xa, %edi
callq 0x3170
jmp 0x358d
xorl %edi, %edi
callq 0x3240
subl %eax, %ebp
cmpl $0x2, %ebp
jl 0x35ed
leaq 0x2c5e(%rip), %rsi      # 0x623f
movl $0x2, %edi
xorl %eax, %eax
callq 0x30e0
cmpl $0x1, %ebp
jne 0x3601
movq (%rbx,%rax,8), %rdi
cmpb $0x2d, (%rdi)
jne 0x3622
cmpb $0x0, 0x1(%rdi)
jne 0x3622
leaq 0x2c5d(%rip), %rax      # 0x6265
movq %rax, 0x5b79(%rip)      # 0x9188
movq 0x59b2(%rip), %rax      # 0x8fc8
movq (%rax), %rax
movq %rax, 0x5b70(%rip)      # 0x9190
jmp 0x364d
movq %rdi, 0x5b5f(%rip)      # 0x9188
leaq 0x2c24(%rip), %rsi      # 0x6254
callq 0x3210
movq %rax, 0x5b54(%rip)      # 0x9190
testq %rax, %rax
jne 0x364d
movq 0x5b40(%rip), %rdx      # 0x9188
jmp 0x373a
movq 0x5b24(%rip), %rdi      # 0x9178
testq %rdi, %rdi
jne 0x367d
leaq 0x2c0d(%rip), %rax      # 0x626d
movq %rax, 0x5b11(%rip)      # 0x9178
movq 0x5952(%rip), %rax      # 0x8fc0
movq (%rax), %rax
movq %rax, 0x5b20(%rip)      # 0x9198
callq 0x38cb
leaq 0x98(%rsp), %rsi
callq 0x3190
testl %eax, %eax
jne 0x36ce
movq 0x5afb(%rip), %rdi      # 0x9190
callq 0x31b0
leaq 0x8(%rsp), %rsi
movl %eax, %edi
callq 0x3270
testl %eax, %eax
jne 0x36ce
movq 0x8(%rsp), %rax
xorq 0x98(%rsp), %rax
movq 0xa0(%rsp), %rcx
xorq 0x10(%rsp), %rcx
orq %rax, %rcx
sete 0x5ad2(%rip)            # 0x91a0
movq 0x5aa3(%rip), %rbx      # 0x9178
cmpb $0x1, 0x5ac4(%rip)      # 0x91a0
jne 0x3714
movq %rbx, %rdi
movl $0x2f, %esi
callq 0x3120
testq %rax, %rax
jne 0x374d
movabsq $0x5858585858582e, %rax # imm = 0x5858585858582E
movq %rax, 0x5ab6(%rip)      # 0x91b7
movabsq $0x2e66656466696e75, %rax # imm = 0x2E66656466696E75
movq %rax, 0x5a9e(%rip)      # 0x91b0
jmp 0x376e
leaq 0x2b8f(%rip), %rsi      # 0x62aa
movq %rbx, %rdi
callq 0x3210
movq %rax, 0x5a6e(%rip)      # 0x9198
testq %rax, %rax
jne 0x3678
movq 0x5a3e(%rip), %rdx      # 0x9178
leaq 0x2b16(%rip), %rsi      # 0x6257
movl $0x2, %edi
xorl %eax, %eax
callq 0x31c0
subl %ebx, %eax
leaq 0x5a5a(%rip), %rdi      # 0x91b0
leaq 0x2b19(%rip), %rdx      # 0x6276
movl $0x1000, %esi           # imm = 0x1000
movl %eax, %ecx
movq %rbx, %r8
xorl %eax, %eax
callq 0x3110
leaq 0x5a3b(%rip), %rdi      # 0x91b0
callq 0x31e0
movl %eax, %ebx
cmpl $-0x1, %eax
jne 0x378a
movq 0x5a10(%rip), %rax      # 0x9198
jmp 0x379f
leaq 0x2af9(%rip), %rsi      # 0x628a
movl %ebx, %edi
callq 0x31f0
movq %rax, 0x59f9(%rip)      # 0x9198
testq %rax, %rax
jne 0x37b7
leaq 0x2ae3(%rip), %rsi      # 0x628e
movl $0x2, %edi
xorl %eax, %eax
callq 0x31c0
movl $0x1ff, %esi            # imm = 0x1FF
andl 0x20(%rsp), %esi
movl %ebx, %edi
callq 0x3200
callq 0x38cb