// File: /workspace/github_c_makefile_star2_O1/ccxvii[P]mujs/main.c
// Function: main
int
main(int argc, char **argv)
{
	char *input;
	js_State *J;
	int status = 0;
	int strict = 0;
	int interactive = 0;
	int i, c;

	while ((c = xgetopt(argc, argv, "is")) != -1) {
		switch (c) {
		default: usage(); break;
		case 'i': interactive = 1; break;
		case 's': strict = 1; break;
		}
	}

	J = js_newstate(NULL, NULL, strict ? JS_STRICT : 0);
	if (!J) {
		fprintf(stderr, "Could not initialize MuJS.\n");
		exit(1);
	}

	js_newcfunction(J, jsB_gc, "gc", 0);
	js_setglobal(J, "gc");

	js_newcfunction(J, jsB_load, "load", 1);
	js_setglobal(J, "load");

	js_newcfunction(J, jsB_compile, "compile", 2);
	js_setglobal(J, "compile");

	js_newcfunction(J, jsB_print, "print", 0);
	js_setglobal(J, "print");

	js_newcfunction(J, jsB_write, "write", 0);
	js_setglobal(J, "write");

	js_newcfunction(J, jsB_read, "read", 1);
	js_setglobal(J, "read");

	js_newcfunction(J, jsB_readline, "readline", 0);
	js_setglobal(J, "readline");

	js_newcfunction(J, jsB_repr, "repr", 0);
	js_setglobal(J, "repr");

	js_newcfunction(J, jsB_quit, "quit", 1);
	js_setglobal(J, "quit");

	js_dostring(J, require_js);
	js_dostring(J, stacktrace_js);
	js_dostring(J, console_js);

	if (xoptind == argc) {
		interactive = 1;
	} else {
		c = xoptind++;

		js_newarray(J);
		i = 0;
		while (xoptind < argc) {
			js_pushstring(J, argv[xoptind++]);
			js_setindex(J, -2, i++);
		}
		js_setglobal(J, "scriptArgs");

		if (js_dofile(J, argv[c]))
			status = 1;
	}

	if (interactive) {
		printf("Welcome to MuJS %d.%d.%d.\n",
			JS_VERSION_MAJOR, JS_VERSION_MINOR, JS_VERSION_PATCH);
		if (isatty(0)) {
			using_history();
			rl_bind_key('\t', rl_insert);
			input = readline(PS1);
			while (input) {
				eval_print(J, input);
				if (*input)
					add_history(input);
				free(input);
				input = readline(PS1);
			}
			putchar('\n');
		} else {
			input = read_stdin();
			if (!input || !js_dostring(J, input))
				status = 1;
			free(input);
		}
	}

	js_gc(J, 0);
	js_freestate(J);

	return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movl %edi, %ebp
movl $0x0, (%rsp)
xorl %r13d, %r13d
movl %r13d, %eax
movl %eax, %r13d
movq 0x3cda5(%rip), %rax     # 0x40418
testq %rax, %rax
je 0x36e2
cmpb $0x0, (%rax)
je 0x36e2
movq 0x3cd94(%rip), %rax     # 0x40418
leaq 0x1(%rax), %r14
movq %r14, 0x3cd89(%rip)     # 0x40418
movb (%rax), %bl
movsbl %bl, %r12d
movl $0x3, %edx
leaq 0x31281(%rip), %rdi     # 0x34922
movl %r12d, %esi
callq 0x30c0
testq %rax, %rax
je 0x3765
cmpb $0x3a, %bl
je 0x3765
cmpb $0x3a, 0x1(%rax)
jne 0x37b9
cmpb $0x0, (%r14)
je 0x3745
movq %r14, 0x3cd4e(%rip)     # 0x40420
movq $0x0, 0x3cd3b(%rip) # 0x40418
jmp 0x37b9
cmpl $0x0, 0x3cd27(%rip)     # 0x40410
jne 0x36f5
movl $0x1, 0x3cd1b(%rip)     # 0x40410
movslq 0x3cd14(%rip), %rax     # 0x40410
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
cmpl %ebp, %eax
jge 0x37b9
movq (%r15,%rax,8), %rcx
cmpb $0x2d, (%rcx)
jne 0x37b9
movzbl 0x1(%rcx), %edx
testl %edx, %edx
je 0x37b9
cmpl $0x2d, %edx
jne 0x372e
cmpb $0x0, 0x2(%rcx)
je 0x378b
incq %rcx
movq %rcx, 0x3cce0(%rip)     # 0x40418
incl %eax
movl %eax, 0x3ccd0(%rip)     # 0x40410
jmp 0x367d
movslq 0x3ccc4(%rip), %rax     # 0x40410
cmpl %ebp, %eax
jge 0x3795
movq (%r15,%rax,8), %rcx
movq %rcx, 0x3ccc5(%rip)     # 0x40420
incl %eax
movl %eax, 0x3ccad(%rip)     # 0x40410
jmp 0x37b9
movq 0x3c87c(%rip), %rax     # 0x3ffe8
movq (%rax), %rdi
movq (%r15), %rdx
leaq 0x27904(%rip), %rsi     # 0x2b07d
movl %r12d, %ecx
xorl %eax, %eax
callq 0x3380
movl $0x3f, %r12d
jmp 0x37b9
incl %eax
movl %eax, 0x3cc7d(%rip)     # 0x40410
jmp 0x37b9
movq 0x3c84c(%rip), %rax     # 0x3ffe8
movq (%rax), %rdi
movq (%r15), %rdx
leaq 0x278ec(%rip), %rsi     # 0x2b095
movl %r12d, %ecx
xorl %eax, %eax
callq 0x3380
movl $0x3a, %r12d
movl $0x1, %eax
cmpl $0x69, %r12d
je 0x3669
cmpl $-0x1, %r12d
je 0x37e4
cmpl $0x73, %r12d
jne 0x3c32
movl $0x1, (%rsp)
jmp 0x3666
xorl %r14d, %r14d
xorl %edi, %edi
xorl %esi, %esi
movl (%rsp), %edx
callq 0x18444
testq %rax, %rax
je 0x3c37
movq %rax, %rbx
leaq 0x436(%rip), %rsi       # 0x3c3c
leaq 0x27813(%rip), %r12     # 0x2b020
movq %rax, %rdi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x66d4
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1640f
leaq 0x431(%rip), %rsi       # 0x3c5d
leaq 0x277f0(%rip), %r12     # 0x2b023
movq %rbx, %rdi
movq %r12, %rdx
movl $0x1, %ecx
callq 0x66d4
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1640f
leaq 0x46a(%rip), %rsi       # 0x3cbf
leaq 0x277cc(%rip), %r12     # 0x2b028
movq %rbx, %rdi
movq %r12, %rdx
movl $0x2, %ecx
callq 0x66d4
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1640f
leaq 0x491(%rip), %rsi       # 0x3d0f
leaq 0x277ab(%rip), %r12     # 0x2b030
movq %rbx, %rdi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x66d4
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1640f
leaq 0x4db(%rip), %rsi       # 0x3d7f
leaq 0x2778b(%rip), %r12     # 0x2b036
movq %rbx, %rdi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x66d4
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1640f
leaq 0x51b(%rip), %rsi       # 0x3de5
leaq 0x2776b(%rip), %r12     # 0x2b03c
movq %rbx, %rdi
movq %r12, %rdx
movl $0x1, %ecx
callq 0x66d4
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1640f
leaq 0x668(%rip), %rsi       # 0x3f5b
leaq 0x27747(%rip), %r12     # 0x2b041
movq %rbx, %rdi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x66d4
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1640f
leaq 0x693(%rip), %rsi       # 0x3fac
leaq 0x2772a(%rip), %r12     # 0x2b04a
movq %rbx, %rdi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x66d4
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1640f
leaq 0x677(%rip), %rsi       # 0x3fb6
leaq 0x27709(%rip), %r12     # 0x2b04f
movq %rbx, %rdi
movq %r12, %rdx
movl $0x1, %ecx
callq 0x66d4
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1640f
leaq 0x2785a(%rip), %rsi     # 0x2b1c2
movq %rbx, %rdi
callq 0x181be
leaq 0x27937(%rip), %rsi     # 0x2b2ae
movq %rbx, %rdi
callq 0x181be
leaq 0x279c8(%rip), %rsi     # 0x2b34e
movq %rbx, %rdi
callq 0x181be
movslq 0x3ca7b(%rip), %rcx     # 0x40410
movl $0x0, %eax
cmpl %ebp, %ecx
je 0x3a2a
movq %rcx, (%rsp)
leal 0x1(%rcx), %eax
movl %eax, 0x3ca61(%rip)     # 0x40410
movq %rbx, %rdi
callq 0x135de
movl 0x3ca53(%rip), %eax     # 0x40410
cmpl %ebp, %eax
jge 0x39fc
xorl %r14d, %r14d
leal 0x1(%rax), %ecx
movl %ecx, 0x3ca43(%rip)     # 0x40410
cltq
movq (%r15,%rax,8), %rsi
movq %rbx, %rdi
callq 0x13665
leal 0x1(%r14), %r12d
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movl %r14d, %edx
callq 0x1393c
movl 0x3ca1b(%rip), %eax     # 0x40410
movl %r12d, %r14d
cmpl %ebp, %eax
jl 0x39c4
leaq 0x27651(%rip), %rsi     # 0x2b054
movq %rbx, %rdi
callq 0x1640f
movq (%rsp), %rax
movq (%r15,%rax,8), %rsi
movq %rbx, %rdi
callq 0x182f9
xorl %r14d, %r14d
testl %eax, %eax
setne %r14b
testl %r13d, %r13d
sete %al
testb %al, %al
jne 0x3c0e
leaq 0x27626(%rip), %rdi     # 0x2b05f
xorl %r15d, %r15d
movl $0x1, %esi
movl $0x3, %edx
movl $0x5, %ecx
xorl %eax, %eax
callq 0x3030
xorl %edi, %edi
callq 0x30e0
testl %eax, %eax
je 0x3b4c
callq 0x3340
movq 0x3c573(%rip), %rsi     # 0x3ffe0
movl $0x9, %edi
callq 0x3400
leaq 0x275fc(%rip), %rdi     # 0x2b07a
callq 0x32e0
testq %rax, %rax
je 0x3b3d
movq %rax, %r12
leaq 0x278ff(%rip), %r15     # 0x2b395
leaq 0x27904(%rip), %r13     # 0x2b3a1
leaq 0x275d6(%rip), %rbp     # 0x2b07a
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x17a0b
movq %rbx, %rdi
testl %eax, %eax
jne 0x3b2f
callq 0x89b6
movq %rbx, %rdi
xorl %esi, %esi
callq 0x175f9
movq %rbx, %rdi
testl %eax, %eax
jne 0x3b36
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x14c51
testl %eax, %eax
je 0x3af5
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %r13, %rdx
callq 0x1499e
movq %rax, %rdi
callq 0x30f0
movq %rbx, %rdi
movl $0x1, %esi
callq 0x4127
cmpb $0x0, (%r12)
je 0x3b11
movq %r12, %rdi
callq 0x3390
movq %r12, %rdi
callq 0x31e0
movq %rbp, %rdi
callq 0x32e0
movq %rax, %r12
testq %rax, %rax
jne 0x3aa4
jmp 0x3b3d
callq 0x3420
jmp 0x3af5
callq 0x344f
jmp 0x3af5
movl $0xa, %edi
callq 0x3150
jmp 0x3c0e
movq %r14, (%rsp)
movl $0x200, %ebp            # imm = 0x200
movq 0x3c47c(%rip), %r14     # 0x3ffd8
xorl %r12d, %r12d
movslq %ebp, %rsi
movq %r12, %rdi
callq 0x3360
testq %rax, %rax
je 0x3bb3
movq %rax, %r13
movslq %r15d, %r12
movq %rax, %rdi
addq %r12, %rdi
movl %r12d, %eax
notl %eax
addl %ebp, %eax
movslq %eax, %rdx
movq (%r14), %rcx
movl $0x1, %esi
callq 0x32c0
movq %rax, %r15
addl %r12d, %r15d
leal -0x1(%rbp), %ecx
xorl %eax, %eax
cmpl %ecx, %r15d
setl %al
setge %cl
shll %cl, %ebp
addl %eax, %eax
movq %r13, %r12
testl %eax, %eax
je 0x3b5f
jmp 0x3bc2
movq %r12, %rdi
callq 0x347e
movl $0x1, %eax
jmp 0x3bad
cmpl $0x2, %eax
jne 0x3be5
movq (%r14), %rdi
callq 0x3210
testl %eax, %eax
jne 0x3bdd
movslq %r15d, %rax
movb $0x0, (%r12,%rax)
jmp 0x3be8
movq %r12, %rdi
callq 0x34a1
xorl %r12d, %r12d
movq (%rsp), %r14
testq %r12, %r12
je 0x3c00
movq %rbx, %rdi
movq %r12, %rsi
callq 0x181be
testl %eax, %eax
jne 0x3c06
movl $0x1, %r14d
movq %r12, %rdi
callq 0x31e0
movq %rbx, %rdi
xorl %esi, %esi
callq 0xd7b7
movq %rbx, %rdi
callq 0xdfb9
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x34e9
callq 0x34c4