// File: /workspace/github_c_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
movq (%rsi), %rdi
leaq 0xa405(%rip), %rsi      # 0x14693
callq 0xe16b
leaq 0x11e9e(%rip), %rcx     # 0x1c138
movq %rax, (%rcx)
xorl %ecx, %ecx
testl %ebp, %ebp
setg %cl
movl %ebp, %r12d
subl %ecx, %r12d
je 0xa358
xorl %ecx, %ecx
testl %ebp, %ebp
setg %cl
leaq (%rbx,%rcx,8), %r15
xorl %edi, %edi
xorl %ebx, %ebx
xorl %r14d, %r14d
movq (%r15), %rcx
cmpb $0x2d, (%rcx)
jne 0xa386
cmpb $0x2d, 0x1(%rcx)
jne 0xa2de
cmpb $0x0, 0x2(%rcx)
je 0xa37f
incq %rcx
movl %r14d, %esi
movl %esi, %r14d
movzbl (%rcx), %edx
incq %rcx
movb $0x1, %sil
cmpl $0x45, %edx
je 0xa2e4
cmpl $0x74, %edx
je 0xa312
cmpl $0x6f, %edx
je 0xa308
testl %edx, %edx
je 0xa33e
jmp 0xa4c6
cmpb $0x0, (%rcx)
je 0xa31c
movq %rcx, %rbx
jmp 0xa33e
cmpb $0x0, (%rcx)
je 0xa32a
movq %rcx, %rdi
jmp 0xa33e
movq 0x8(%r15), %rbx
testq %rbx, %rbx
jne 0xa337
jmp 0xa4ce
movq 0x8(%r15), %rdi
testq %rdi, %rdi
je 0xa4ce
addq $0x8, %r15
decl %r12d
xorl %ecx, %ecx
testl %r12d, %r12d
setg %cl
leaq (%r15,%rcx,8), %r15
subl %ecx, %r12d
jne 0xa2c2
xorl %r12d, %r12d
jmp 0xa386
xorl %edi, %edi
callq 0xd2a4
movq 0x10c62(%rip), %rax     # 0x1afc8
movq (%rax), %rsi
leaq 0xa336(%rip), %rdi      # 0x146a6
callq 0xbaa4
callq 0xa908
jmp 0xa425
addq $0x8, %r15
decl %r12d
callq 0xd2a4
testq %rbx, %rbx
je 0xa3bf
movq 0x10c29(%rip), %rax     # 0x1afc0
movq (%rax), %rdx
leaq 0xbd5d(%rip), %rsi      # 0x160fe
movq %rbx, %rdi
callq 0x3100
testq %rax, %rax
jne 0xa3bf
leaq 0xa2e8(%rip), %rdi      # 0x1469d
movq %rbx, %rsi
xorl %eax, %eax
callq 0xe058
testl %r12d, %r12d
je 0xa3df
movslq %r12d, %rbx
movq -0x8(%r15,%rbx,8), %rdi
xorl %esi, %esi
callq 0xbaa4
decq %rbx
jne 0xa3c7
callq 0xbb6a
jmp 0xa3f5
movq 0x10be2(%rip), %rax     # 0x1afc8
movq (%rax), %rsi
leaq 0xa2b6(%rip), %rdi      # 0x146a6
callq 0xbaa4
callq 0xa908
testb $0x1, %r14b
je 0xa425
leaq 0x11be1(%rip), %rax     # 0x1bfe8
orb $0x1, (%rax)
leaq 0x11cf7(%rip), %rbx     # 0x1c108
cmpl $0x1, (%rbx)
je 0xa48c
movq %rbx, %rdi
callq 0xd34c
callq 0xa920
jmp 0xa411
callq 0xc5c8
leaq 0x11cd7(%rip), %r13     # 0x1c108
cmpl $0x1, (%r13)
je 0xa487
leaq 0x11c61(%rip), %rbx     # 0x1c0a0
leaq 0x8(%r13), %r14
leaq 0xa264(%rip), %r15      # 0x146ae
leaq 0xa279(%rip), %r12      # 0x146ca
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4aeb
testb %al, %al
jne 0xa480
cmpl $0x61, (%r13)
jne 0xa473
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0xd55c
movq %r14, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0xd55c
cmpl $0x1, (%r13)
jne 0xa451
callq 0x56fd
movq 0x10b2d(%rip), %rbx     # 0x1afc0
movq (%rbx), %rdi
callq 0x3190
movq (%rbx), %rdi
callq 0x3060
testl %eax, %eax
je 0xa4b5
leaq 0xa248(%rip), %rdi      # 0x146f6
xorl %eax, %eax
callq 0xe058
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0x3260
callq 0xa4d3