// File: /workspace/github_c_makefile_star2_O2/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 0x1e5d(%rip), %r14      # 0x5206
leaq 0x1c60(%rip), %r12      # 0x5010
movq 0x4c21(%rip), %r13      # 0x7fd8
leaq 0x1c7a(%rip), %r15      # 0x5038
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x3230
leal -0x53(%rax), %ecx
cmpl $0x21, %ecx
ja 0x33e5
movslq (%r15,%rcx,4), %rax
addq %r15, %rax
jmpq *%rax
movb $0x1, 0x4d8d(%rip)      # 0x8170
jmp 0x33be
leal -0x42(%rax), %ecx
cmpl $0x9, %ecx
ja 0x34d3
movslq (%r12,%rcx,4), %rax
addq %r12, %rax
jmpq *%rax
movb $0x1, 0x4d70(%rip)      # 0x8171
jmp 0x33be
movb $0x1, 0x4d6c(%rip)      # 0x8176
jmp 0x33be
movb $0x1, 0x4d64(%rip)      # 0x8177
jmp 0x33be
movq (%r13), %rax
movq %rax, 0x4d58(%rip)      # 0x8178
jmp 0x33be
movq (%r13), %rdx
xorl %edi, %edi
jmp 0x34c7
movb $0x1, %al
movb %al, 0x4d4c(%rip)       # 0x8181
movb %al, 0x4d45(%rip)       # 0x8180
jmp 0x33be
movb $0x1, 0x4d30(%rip)      # 0x8174
jmp 0x33be
movb $0x1, 0x4d22(%rip)      # 0x8172
jmp 0x33be
movq (%r13), %rax
leaq 0x1(%rax), %rdx
movq %rdx, (%r13)
movzbl (%rax), %eax
cmpl $0x55, %eax
je 0x34c4
cmpl $0x44, %eax
jne 0x34fd
pushq $0x1
popq %rdi
movl %edi, %esi
callq 0x3744
jmp 0x33be
movb $0x1, 0x4cf8(%rip)      # 0x8180
jmp 0x33be
movb $0x1, 0x4cdf(%rip)      # 0x8173
jmp 0x33be
movb $0x1, 0x4ce2(%rip)      # 0x8182
jmp 0x33be
movb $0x1, 0x4cc9(%rip)      # 0x8175
jmp 0x33be
movq (%r13), %rdx
xorl %edi, %edi
pushq $0x1
popq %rsi
callq 0x3744
jmp 0x33be
pushq $0x1
popq %rdi
xorl %esi, %esi
callq 0x3744
jmp 0x33be
cmpl $-0x1, %eax
jne 0x34fd
movq 0x4af1(%rip), %rax      # 0x7fd0
movslq (%rax), %rax
cmpb $0x1, 0x4c88(%rip)      # 0x8171
jne 0x3553
cmpb $0x1, 0x4c7e(%rip)      # 0x8170
jne 0x3553
leaq 0x1d23(%rip), %rsi      # 0x521e
jmp 0x3561
callq 0x3826
leaq 0x1bd7(%rip), %r14      # 0x50e0
movq 0x4ae8(%rip), %r15      # 0x7ff8
pushq $0xa
popq %rbx
movzbl 0x1(%r14), %eax
cmpl $0x24, %eax
je 0x3526
incq %r14
testl %eax, %eax
jne 0x3513
jmp 0x354c
addq $0x2, %r14
movsbl (%r14), %edi
cmpl $0x24, %edi
je 0x3540
movq (%r15), %rsi
callq 0x3170
incq %r14
jmp 0x352a
movq (%r15), %rsi
movl %ebx, %edi
callq 0x3170
jmp 0x3513
xorl %edi, %edi
callq 0x3240
subl %eax, %ebp
cmpl $0x2, %ebp
jl 0x356b
leaq 0x1cde(%rip), %rsi      # 0x523f
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x30e0
cmpl $0x1, %ebp
jne 0x357f
movq (%rbx,%rax,8), %rdi
cmpb $0x2d, (%rdi)
jne 0x35a0
cmpb $0x0, 0x1(%rdi)
jne 0x35a0
leaq 0x1cdf(%rip), %rax      # 0x5265
movq %rax, 0x4bfb(%rip)      # 0x8188
movq 0x4a34(%rip), %rax      # 0x7fc8
movq (%rax), %rax
movq %rax, 0x4bf2(%rip)      # 0x8190
jmp 0x35cb
movq %rdi, 0x4be1(%rip)      # 0x8188
leaq 0x1ca6(%rip), %rsi      # 0x5254
callq 0x3210
movq %rax, 0x4bd6(%rip)      # 0x8190
testq %rax, %rax
jne 0x35cb
movq 0x4bc2(%rip), %rdx      # 0x8188
jmp 0x36b6
movq 0x4ba6(%rip), %rdi      # 0x8178
testq %rdi, %rdi
jne 0x35fb
leaq 0x1c8f(%rip), %rax      # 0x526d
movq %rax, 0x4b93(%rip)      # 0x8178
movq 0x49d4(%rip), %rax      # 0x7fc0
movq (%rax), %rax
movq %rax, 0x4ba2(%rip)      # 0x8198
callq 0x384b
leaq 0x98(%rsp), %rsi
callq 0x3190
testl %eax, %eax
jne 0x364c
movq 0x4b7d(%rip), %rdi      # 0x8190
callq 0x31b0
leaq 0x8(%rsp), %rsi
movl %eax, %edi
callq 0x3270
testl %eax, %eax
jne 0x364c
movq 0x8(%rsp), %rax
xorq 0x98(%rsp), %rax
movq 0xa0(%rsp), %rcx
xorq 0x10(%rsp), %rcx
orq %rax, %rcx
sete 0x4b54(%rip)            # 0x81a0
movq 0x4b25(%rip), %rbx      # 0x8178
cmpb $0x1, 0x4b46(%rip)      # 0x81a0
jne 0x3690
pushq $0x2f
popq %rsi
movq %rbx, %rdi
callq 0x3120
testq %rax, %rax
jne 0x36c7
movabsq $0x5858585858582e, %rax # imm = 0x5858585858582E
movq %rax, 0x4b3a(%rip)      # 0x81b7
movabsq $0x2e66656466696e75, %rax # imm = 0x2E66656466696E75
movq %rax, 0x4b22(%rip)      # 0x81b0
jmp 0x36e8
leaq 0x1c13(%rip), %rsi      # 0x52aa
movq %rbx, %rdi
callq 0x3210
movq %rax, 0x4af2(%rip)      # 0x8198
testq %rax, %rax
jne 0x35f6
movq 0x4ac2(%rip), %rdx      # 0x8178
leaq 0x1b9a(%rip), %rsi      # 0x5257
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x31c0
subl %ebx, %eax
leaq 0x4ae0(%rip), %rdi      # 0x81b0
leaq 0x1b9f(%rip), %rdx      # 0x5276
movl $0x1000, %esi           # imm = 0x1000
movl %eax, %ecx
movq %rbx, %r8
xorl %eax, %eax
callq 0x3110
leaq 0x4ac1(%rip), %rdi      # 0x81b0
callq 0x31e0
movl %eax, %ebx
cmpl $-0x1, %eax
jne 0x3704
movq 0x4a96(%rip), %rax      # 0x8198
jmp 0x3719
leaq 0x1b7f(%rip), %rsi      # 0x528a
movl %ebx, %edi
callq 0x31f0
movq %rax, 0x4a7f(%rip)      # 0x8198
testq %rax, %rax
jne 0x372f
leaq 0x1b69(%rip), %rsi      # 0x528e
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x31c0
movl $0x1ff, %esi            # imm = 0x1FF
andl 0x20(%rsp), %esi
movl %ebx, %edi
callq 0x3200
callq 0x384b