// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]cproc/main.c
// Function: main
int
main(int argc, char *argv[])
{
	bool pponly = false;
	char *output = NULL, *target = NULL;

	argv0 = progname(argv[0], "cproc-qbe");
	ARGBEGIN {
	case 'E':
		pponly = true;
		break;
	case 't':
		target = EARGF(usage());
		break;
	case 'o':
		output = EARGF(usage());
		break;
	default:
		usage();
	} ARGEND

	targinit(target);

	if (output && !freopen(output, "w", stdout))
		fatal("open %s:", output);

	if (argc) {
		while (argc--)
			scanfrom(argv[argc], NULL);
		scanopen();
	} else {
		scanfrom("<stdin>", stdin);
	}

	ppinit();
	if (pponly) {
		ppflags |= PPNEWLINE;
		while (tok.kind != TEOF) {
			tokenprint(&tok);
			next();
		}
	} else {
		scopeinit();
		while (tok.kind != TEOF) {
			if (!decl(&filescope, NULL)) {
				if (tok.kind == TSEMICOLON)
					error(&tok.loc, "unexpected ';' at top-level");
				error(&tok.loc, "expected declaration or function definition");
			}
		}
		emittentativedefns();
	}

	fflush(stdout);
	if (ferror(stdout))
		fatal("write failed");
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movl %edi, %ebx
movq (%rsi), %rdi
leaq 0xa1df(%rip), %rsi      # 0x14633
callq 0xe167
leaq 0x11cd8(%rip), %rcx     # 0x1c138
movq %rax, (%rcx)
xorl %ecx, %ecx
testl %ebx, %ebx
setg %cl
leaq (%r14,%rcx,8), %r12
subl %ecx, %ebx
je 0xa53a
xorl %edi, %edi
xorl %r14d, %r14d
xorl %r15d, %r15d
movq (%r12), %rdx
cmpb $0x2d, (%rdx)
jne 0xa544
cmpb $0x2d, 0x1(%rdx)
jne 0xa49b
cmpb $0x0, 0x2(%rdx)
je 0xa67e
leaq 0x1(%rdx), %rcx
movzbl 0x1(%rdx), %r8d
cmpl $0x6e, %r8d
jle 0xa4cb
cmpl $0x6f, %r8d
je 0xa4d9
cmpl $0x74, %r8d
jne 0xa689
cmpb $0x0, 0x2(%rdx)
je 0xa4fc
addq $0x2, %rdx
xorl %esi, %esi
movq %rdx, %rdi
jmp 0xa4e8
movb $0x1, %sil
cmpl $0x45, %r8d
jne 0xa51c
movb $0x1, %r15b
jmp 0xa512
cmpb $0x0, 0x2(%rdx)
je 0xa4ed
addq $0x2, %rdx
xorl %esi, %esi
movq %rdx, %r14
movq %rdx, %rcx
jmp 0xa512
movq 0x8(%r12), %r14
testq %r14, %r14
jne 0xa50a
jmp 0xa691
movq 0x8(%r12), %rdi
testq %rdi, %rdi
je 0xa691
addq $0x8, %r12
decl %ebx
xorl %esi, %esi
movq %rcx, %rdx
testb %sil, %sil
jne 0xa49b
jmp 0xa525
testl %r8d, %r8d
jne 0xa689
xorl %ecx, %ecx
testl %ebx, %ebx
setg %cl
leaq (%r12,%rcx,8), %r12
subl %ecx, %ebx
jne 0xa47e
jmp 0xa542
xorl %r15d, %r15d
xorl %r14d, %r14d
xorl %edi, %edi
xorl %ebx, %ebx
callq 0xd28c
testq %r14, %r14
je 0xa57d
movq 0x10a6b(%rip), %rax     # 0x1afc0
movq (%rax), %rdx
leaq 0xbaff(%rip), %rsi      # 0x1605e
movq %r14, %rdi
callq 0x3100
testq %rax, %rax
jne 0xa57d
leaq 0xa0ca(%rip), %rdi      # 0x1463d
movq %r14, %rsi
xorl %eax, %eax
callq 0xe054
testl %ebx, %ebx
je 0xa59c
movslq %ebx, %rbx
movq -0x8(%r12,%rbx,8), %rdi
xorl %esi, %esi
callq 0xbad8
decq %rbx
jne 0xa584
callq 0xbb9e
jmp 0xa5b2
movq 0x10a25(%rip), %rax     # 0x1afc8
movq (%rax), %rsi
leaq 0xa099(%rip), %rdi      # 0x14646
callq 0xbad8
callq 0xa9b8
testb $0x1, %r15b
je 0xa5e2
leaq 0x11a24(%rip), %rax     # 0x1bfe8
orb $0x1, (%rax)
leaq 0x11b3a(%rip), %rbx     # 0x1c108
cmpl $0x1, (%rbx)
je 0xa649
movq %rbx, %rdi
callq 0xd34c
callq 0xa9d0
jmp 0xa5ce
callq 0xc5ac
leaq 0x11b1a(%rip), %r13     # 0x1c108
cmpl $0x1, (%r13)
je 0xa644
leaq 0x11aa4(%rip), %rbx     # 0x1c0a0
leaq 0x8(%r13), %r14
leaq 0xa047(%rip), %r15      # 0x1464e
leaq 0xa05c(%rip), %r12      # 0x1466a
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4c95
testb %al, %al
jne 0xa63d
cmpl $0x61, (%r13)
jne 0xa630
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0xd56a
movq %r14, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0xd56a
cmpl $0x1, (%r13)
jne 0xa60e
callq 0x5899
movq 0x10970(%rip), %rbx     # 0x1afc0
movq (%rbx), %rdi
callq 0x3190
movq (%rbx), %rdi
callq 0x3060
testl %eax, %eax
je 0xa672
leaq 0xa02b(%rip), %rdi      # 0x14696
xorl %eax, %eax
callq 0xe054
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
addq $0x8, %r12
decl %ebx
jmp 0xa544
movq %rax, %rdi
callq 0x3260
callq 0xa696