// File: /workspace/github_c_makefile_star2_O1/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 0x2dfd(%rip), %r14      # 0x6206
leaq 0x2c00(%rip), %r15      # 0x6010
movq 0x5bc1(%rip), %r12      # 0x8fd8
leaq 0x2c1a(%rip), %r13      # 0x6038
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x3240
leal -0x53(%rax), %ecx
cmpl $0x21, %ecx
ja 0x3446
movslq (%r13,%rcx,4), %rax
addq %r13, %rax
jmpq *%rax
movb $0x1, 0x5d2c(%rip)      # 0x9170
jmp 0x341e
leal -0x42(%rax), %ecx
cmpl $0x9, %ecx
ja 0x3530
movslq (%r15,%rcx,4), %rax
addq %r15, %rax
jmpq *%rax
movb $0x1, 0x5d0f(%rip)      # 0x9171
jmp 0x341e
movb $0x1, 0x5d0b(%rip)      # 0x9176
jmp 0x341e
movb $0x1, 0x5d03(%rip)      # 0x9177
jmp 0x341e
movq (%r12), %rax
movq %rax, 0x5cf7(%rip)      # 0x9178
jmp 0x341e
movq (%r12), %rdx
xorl %edi, %edi
jmp 0x3524
movb $0x1, %al
movb %al, 0x5ceb(%rip)       # 0x9181
movb %al, 0x5ce4(%rip)       # 0x9180
jmp 0x341e
movb $0x1, 0x5ccf(%rip)      # 0x9174
jmp 0x341e
movb $0x1, 0x5cc1(%rip)      # 0x9172
jmp 0x341e
movq (%r12), %rax
leaq 0x1(%rax), %rdx
movq %rdx, (%r12)
movzbl (%rax), %eax
cmpl $0x55, %eax
je 0x351f
cmpl $0x44, %eax
jne 0x3565
movl $0x1, %edi
jmp 0x3510
movb $0x1, 0x5c9f(%rip)      # 0x9180
jmp 0x341e
movb $0x1, 0x5c86(%rip)      # 0x9173
jmp 0x341e
movb $0x1, 0x5c89(%rip)      # 0x9182
jmp 0x341e
movb $0x1, 0x5c70(%rip)      # 0x9175
jmp 0x341e
movq (%r12), %rdx
xorl %edi, %edi
movl $0x1, %esi
callq 0x37ed
jmp 0x341e
movl $0x1, %edi
xorl %esi, %esi
callq 0x37ed
jmp 0x341e
cmpl $-0x1, %eax
jne 0x3565
movq 0x5a94(%rip), %rax      # 0x8fd0
movslq (%rax), %rax
cmpb $0x1, 0x5c2b(%rip)      # 0x9171
jne 0x35e3
cmpb $0x1, 0x5c1d(%rip)      # 0x9170
jne 0x35e3
leaq 0x2cbe(%rip), %rsi      # 0x621e
jmp 0x35f1
movq 0x5a8c(%rip), %rax      # 0x8ff8
movq (%rax), %rcx
leaq 0x2d39(%rip), %rdi      # 0x62af
movl $0x61, %esi
movl $0x1, %edx
callq 0x3260
movl $0x2, %edi
callq 0x3250
leaq 0x2b4a(%rip), %rbx      # 0x60e0
movq 0x5a5b(%rip), %r14      # 0x8ff8
movzbl 0x1(%rbx), %eax
cmpl $0x24, %eax
je 0x35af
incq %rbx
testl %eax, %eax
jne 0x359d
jmp 0x35dc
movb 0x2(%rbx), %al
addq $0x2, %rbx
cmpb $0x24, %al
je 0x35cd
movsbl %al, %edi
movq (%r14), %rsi
callq 0x3180
movb 0x1(%rbx), %al
incq %rbx
jmp 0x35b6
movq (%r14), %rsi
movl $0xa, %edi
callq 0x3180
jmp 0x359d
xorl %edi, %edi
callq 0x3250
subl %eax, %ebp
cmpl $0x2, %ebp
jl 0x35fd
leaq 0x2c4e(%rip), %rsi      # 0x623f
movl $0x2, %edi
xorl %eax, %eax
callq 0x30e0
cmpl $0x1, %ebp
jne 0x361d
movq (%rbx,%rax,8), %rbx
leaq 0x2c47(%rip), %rsi      # 0x6254
movq %rbx, %rdi
callq 0x3170
testl %eax, %eax
jne 0x370a
leaq 0x2c43(%rip), %rax      # 0x6267
movq %rax, 0x5b5d(%rip)      # 0x9188
movq 0x5996(%rip), %rax      # 0x8fc8
movq (%rax), %rax
movq %rax, 0x5b54(%rip)      # 0x9190
movq 0x5b35(%rip), %rdi      # 0x9178
testq %rdi, %rdi
jne 0x366c
leaq 0x2c20(%rip), %rax      # 0x626f
movq %rax, 0x5b22(%rip)      # 0x9178
movq 0x5963(%rip), %rax      # 0x8fc0
movq (%rax), %rax
movq %rax, 0x5b31(%rip)      # 0x9198
callq 0x38f9
leaq 0x98(%rsp), %rsi
callq 0x31a0
testl %eax, %eax
jne 0x36bd
movq 0x5b0c(%rip), %rdi      # 0x9190
callq 0x31c0
leaq 0x8(%rsp), %rsi
movl %eax, %edi
callq 0x3280
testl %eax, %eax
jne 0x36bd
movq 0x8(%rsp), %rax
xorq 0x98(%rsp), %rax
movq 0xa0(%rsp), %rcx
xorq 0x10(%rsp), %rcx
orq %rax, %rcx
sete 0x5ae3(%rip)            # 0x91a0
movq 0x5ab4(%rip), %rbx      # 0x9178
cmpb $0x1, 0x5ad5(%rip)      # 0x91a0
jne 0x3739
movq %rbx, %rdi
movl $0x2f, %esi
callq 0x3120
testq %rax, %rax
jne 0x3772
movabsq $0x5858585858582e, %rax # imm = 0x5858585858582E
movq %rax, 0x5ac3(%rip)      # 0x91b7
movabsq $0x2e66656466696e75, %rax # imm = 0x2E66656466696E75
movq %rax, 0x5aab(%rip)      # 0x91b0
jmp 0x3793
movq %rbx, 0x5a77(%rip)      # 0x9188
leaq 0x2b3e(%rip), %rsi      # 0x6256
movq %rbx, %rdi
callq 0x3220
movq %rax, 0x5a69(%rip)      # 0x9190
testq %rax, %rax
jne 0x363c
movq 0x5a51(%rip), %rdx      # 0x9188
jmp 0x375f
leaq 0x2b6c(%rip), %rsi      # 0x62ac
movq %rbx, %rdi
callq 0x3220
movq %rax, 0x5a49(%rip)      # 0x9198
testq %rax, %rax
jne 0x3667
movq 0x5a19(%rip), %rdx      # 0x9178
leaq 0x2af3(%rip), %rsi      # 0x6259
movl $0x2, %edi
xorl %eax, %eax
callq 0x31d0
subl %ebx, %eax
leaq 0x5a35(%rip), %rdi      # 0x91b0
leaq 0x2af6(%rip), %rdx      # 0x6278
movl $0x1000, %esi           # imm = 0x1000
movl %eax, %ecx
movq %rbx, %r8
xorl %eax, %eax
callq 0x3110
leaq 0x5a16(%rip), %rdi      # 0x91b0
callq 0x31f0
movl %eax, %ebx
cmpl $-0x1, %eax
je 0x37bb
leaq 0x2adf(%rip), %rsi      # 0x628c
movl %ebx, %edi
callq 0x3200
movq %rax, 0x59dd(%rip)      # 0x9198
cmpq $0x0, 0x59d5(%rip)      # 0x9198
jne 0x37d8
leaq 0x2ac4(%rip), %rsi      # 0x6290
movl $0x2, %edi
xorl %eax, %eax
callq 0x31d0
movl $0x1ff, %esi            # imm = 0x1FF
andl 0x20(%rsp), %esi
movl %ebx, %edi
callq 0x3210
callq 0x38f9