// File: /workspace/github_c_makefile_star2_O1/rakitzis[P]rc/main.c
// Function: main
extern int main(int argc, char *argv[], char *envp[]) {
	char *dollarzero, *null[1];
	int c;
	initprint();
	dashsee[0] = dashsee[1] = NULL;
	dollarzero = argv[0];
	rc_pid = getpid();
	dashell = (*argv[0] == '-'); /* Unix tradition */
	while ((c = rc_getopt(argc, argv, "c:deiIlnopsvx")) != -1)
		switch (c) {
		case 'c':
			dashsee[0] = rc_optarg;
			goto quitopts;
		case 'd':
			dashdee = TRUE;
			break;
		case 'e':
			dashee = TRUE;
			break;
		case 'I':
			dashEYE = TRUE;
			interactive = FALSE;
			break;
		case 'i':
			dasheye = interactive = TRUE;
			break;
		case 'l':
			dashell = TRUE;
			break;
		case 'n':
			dashen = TRUE;
			break;
		case 'o':
			dashoh = TRUE;
			break;
		case 'p':
			dashpee = TRUE;
			break;
		case 's':
			dashess = TRUE;
			break;
		case 'v':
			dashvee = TRUE;
			break;
		case 'x':
			dashex = TRUE;
			break;
		case '?':
			exit(1);
		}
quitopts:
	argv += rc_optind;
	/* use isatty() iff neither -i nor -I is set, and iff the input is not
	 * from a script or -c flags */
	if (!dasheye && !dashEYE && dashsee[0] == NULL &&
			(dashess || *argv == NULL))
		interactive = isatty(0);
	if (!dashoh) {
		checkfd(0, rFrom);
		checkfd(1, rCreate);
		checkfd(2, rCreate);
	}
	initsignal();
	inithash();
	initparse();
	assigndefault("ifs", " ", "\t", "\n", (void *)0);
	assigndefault("nl", "\n", (void *)0);
#ifdef DEFAULTPATH
	assigndefault("path", DEFAULTPATH, (void *)0);
#endif
	assigndefault("pid", nprint("%d", rc_pid), (void *)0);
	assigndefault("prompt", "; ", "", (void *)0);
	assigndefault("tab", "\t", (void *)0);
	assigndefault("version", VERSION, (void *)0);
	initenv(envp);
	initinput();
	null[0] = NULL;
	starassign(dollarzero, null, FALSE); /* assign $0 to $* */
	inithandler();

	if (dashell) {
		char *rcrc;
		int fd;

		rcrc = concat(varlookup("home"), word("/.rcrc", NULL))->w;
		fd = rc_open(rcrc, rFrom);
		if (fd == -1) {
			if (errno != ENOENT)
				uerror(rcrc);
		} else {
			bool push_interactive;

			pushfd(fd);
			push_interactive = interactive;
			interactive = FALSE;
			doit(TRUE);
			interactive = push_interactive;
			close(fd);
		}
	}
	environ = makeenv();
	setlocale(LC_CTYPE, "");

	if (dashsee[0] != NULL || dashess) {	/* input from  -c or -s? */
		if (*argv != NULL)
			starassign(dollarzero, argv, FALSE);
		if (dashess)
			pushfd(0);
		else
			pushstring(dashsee, TRUE);
	} else if (*argv != NULL) {	/* else from a file? */
		b_dot(--argv);
		rc_exit(getstatus());
	} else {			/* else stdin */
		pushfd(0);
	}
	dasheye = FALSE;
	doit(TRUE);
	rc_exit(getstatus());
	return 0; /* Never really reached. */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r15
movq %rsi, %r14
movl %edi, %ebp
callq 0x5494
xorps %xmm0, %xmm0
movaps %xmm0, 0x10377(%rip)    # 0x19bb0
movq (%r14), %rax
movq %rax, 0x8(%rsp)
callq 0x30d0
movl %eax, 0x10374(%rip)     # 0x19bc0
movq (%r14), %rax
xorl %ecx, %ecx
cmpb $0x2d, (%rax)
sete %cl
movl %ecx, 0x10367(%rip)     # 0x19bc4
leaq 0x6564(%rip), %r12      # 0xfdc8
leaq 0x6505(%rip), %r13      # 0xfd70
movl $0x1, %ebx
movl %ebp, %edi
movq %r14, %rsi
movq %r12, %rdx
callq 0x5ea0
cmpl $0x62, %eax
jle 0x98a0
addl $-0x63, %eax
cmpl $0x15, %eax
ja 0x9870
movslq (%r13,%rax,4), %rax
addq %r13, %rax
jmpq *%rax
movl $0x1, 0x1032a(%rip)     # 0x19bc8
jmp 0x9870
cmpl $0x49, %eax
jne 0x9939
movb $0x1, 0x10320(%rip)     # 0x19bd0
movl $0x0, 0x1031a(%rip)     # 0x19bd4
jmp 0x9870
movl $0x1, 0x102fe(%rip)     # 0x19bc4
jmp 0x9870
movl $0x1, 0x1031e(%rip)     # 0x19bf0
jmp 0x9870
movl $0x1, 0x102fe(%rip)     # 0x19bdc
jmp 0x9870
movl %ebx, 0x102ee(%rip)     # 0x19bd4
movl %ebx, 0x102ec(%rip)     # 0x19bd8
jmp 0x9870
movl $0x1, 0x102d4(%rip)     # 0x19bcc
jmp 0x9870
movl $0x1, 0x102e1(%rip)     # 0x19be8
jmp 0x9870
movl $0x1, 0x102ca(%rip)     # 0x19be0
jmp 0x9870
movl $0x1, 0x102bf(%rip)     # 0x19be4
jmp 0x9870
movl $0x1, 0x102b8(%rip)     # 0x19bec
jmp 0x9870
cmpl $-0x1, %eax
je 0x9962
cmpl $0x3f, %eax
jne 0x9870
movl $0x1, %edi
callq 0x3330
leaq 0x10080(%rip), %rax     # 0x199d8
movq (%rax), %rax
movq %rax, 0x1024e(%rip)     # 0x19bb0
leaq 0xf98f(%rip), %rax      # 0x192f8
movslq (%rax), %rax
leaq (%r14,%rax,8), %r14
cmpl $0x0, 0x10261(%rip)     # 0x19bd8
jne 0x99aa
testb $0x1, 0x10250(%rip)     # 0x19bd0
jne 0x99aa
cmpq $0x0, 0x10226(%rip)     # 0x19bb0
jne 0x99aa
cmpl $0x0, 0x10255(%rip)     # 0x19be8
je 0x99a4
xorl %edi, %edi
callq 0x3090
movl %eax, 0x10232(%rip)     # 0x19bd4
jmp 0x99aa
cmpq $0x0, (%r14)
je 0x9995
cmpl $0x0, 0x1022f(%rip)     # 0x19be0
jne 0x99da
xorl %edi, %edi
xorl %esi, %esi
callq 0x9c30
movl $0x1, %edi
movl $0x1, %esi
callq 0x9c30
movl $0x2, %edi
movl $0x1, %esi
callq 0x9c30
callq 0xbbd4
callq 0x7324
callq 0xa238
leaq 0x5c81(%rip), %rdi      # 0xf671
leaq 0xab7a(%rip), %rsi      # 0x14571
leaq 0x63d8(%rip), %r12      # 0xfdd6
leaq 0xab6f(%rip), %r13      # 0x14574
movq %r12, %rdx
movq %r13, %rcx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x9c58
leaq 0x63bc(%rip), %rdi      # 0xfdd8
movq %r13, %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x9c58
leaq 0x56ac(%rip), %rdi      # 0xf0db
leaq 0x63a5(%rip), %rsi      # 0xfddb
leaq 0x63ad(%rip), %rdx      # 0xfdea
leaq 0x63a1(%rip), %rcx      # 0xfde5
leaq 0x568c(%rip), %r8       # 0xf0d7
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x9c58
movl 0x10165(%rip), %esi     # 0x19bc0
leaq 0x5d43(%rip), %rdi      # 0xf7a5
xorl %eax, %eax
callq 0xb274
leaq 0x5d4c(%rip), %rdi      # 0xf7bc
movq %rax, %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x9c58
leaq 0x5d29(%rip), %rdi      # 0xf7ac
leaq 0x6369(%rip), %rsi      # 0xfdf3
leaq 0x6346(%rip), %rdx      # 0xfdd7
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x9c58
leaq 0x6355(%rip), %rdi      # 0xfdf6
movq %r12, %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x9c58
leaq 0x5cff(%rip), %rdi      # 0xf7b3
leaq 0x633f(%rip), %rsi      # 0xfdfa
xorl %edx, %edx
xorl %eax, %eax
callq 0x9c58
movq %r15, %rdi
callq 0x792b
callq 0x834e
leaq 0x10(%rsp), %rsi
movq $0x0, (%rsi)
movq 0x8(%rsp), %r12
movq %r12, %rdi
xorl %edx, %edx
callq 0xccde
callq 0x4bec
cmpl $0x0, 0x100cc(%rip)     # 0x19bc4
je 0x9b78
leaq 0x55ce(%rip), %rdi      # 0xf0cf
callq 0xcaf4
movq %rax, %r15
leaq 0x62fe(%rip), %rdi      # 0xfe0e
xorl %esi, %esi
callq 0x6714
movq %r15, %rdi
movq %rax, %rsi
callq 0x67cf
movq (%rax), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0xa148
cmpl $-0x1, %eax
je 0x9b66
movl %eax, %ebp
movl %eax, %edi
callq 0x8384
movl 0x10091(%rip), %ebx     # 0x19bd4
movl $0x0, 0x10087(%rip)     # 0x19bd4
movl $0x1, %edi
callq 0x855f
movl %ebx, 0x10077(%rip)     # 0x19bd4
movl %ebp, %edi
callq 0x3170
jmp 0x9b78
callq 0x3040
cmpl $0x2, (%rax)
je 0x9b78
movq %r15, %rdi
callq 0xc7ed
callq 0x7a42
movq 0xf464(%rip), %rcx      # 0x18fe8
movq %rax, (%rcx)
leaq 0x6249(%rip), %rsi      # 0xfdd7
xorl %edi, %edi
callq 0x32b0
cmpq $0x0, 0x10013(%rip)     # 0x19bb0
movq (%r14), %rax
jne 0x9bca
cmpl $0x0, 0x1003f(%rip)     # 0x19be8
jne 0x9bca
testq %rax, %rax
je 0x9be5
addq $-0x8, %r14
movq %r14, %rdi
callq 0x35a9
callq 0xbc85
movl %eax, %edi
callq 0x4fb5
jmp 0x9bff
testq %rax, %rax
je 0x9bdc
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0xccde
cmpl $0x0, 0x10005(%rip)     # 0x19be8
je 0x9bee
xorl %edi, %edi
callq 0x8384
jmp 0x9bff
leaq 0xffbb(%rip), %rdi      # 0x19bb0
movl $0x1, %esi
callq 0x8426
movl $0x0, 0xffcf(%rip)      # 0x19bd8
movl $0x1, %edi
callq 0x855f
callq 0xbc85
movl %eax, %edi
callq 0x4fb5
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq