// File: /workspace/github_cpp_makefile_star2_O2/ryuichiueda[P]GlueLang/src/Job.cc
// Function: Job::parse()
bool Job::parse(void)
{
	m_feeder->getPos(&m_start_line, &m_start_char);

	// scanning of file name 
	// If `file <filename> =` is found, 
	// the DefFile object is pushed as the first element of m_nodes.
	// This node is also given to the last command line.
	if(add(new DefFile(m_feeder,m_env,&m_scopes))){
		m_outfile = (DefFile *)m_nodes[0];	
		m_nodes.pop_back();
	}else if(add(new DefStr(m_feeder,m_env,&m_scopes))){
		m_outstr = (DefStr *)m_nodes[0];	
		m_nodes.pop_back();
	}

	setJobId(m_env->publishJobId());
	int comnum = 0;
	while(1){
		if(add(new Pipeline(m_feeder,m_env,&m_scopes)))
			comnum++;
		else
			break;

		m_feeder->getPos(&m_end_line, &m_end_char);
		m_feeder->blank();

		size_t num = m_nodes.size();
		Pipeline *back1 = (Pipeline *)m_nodes.back();
		Pipeline *back2 = num >= 2 ? (Pipeline *)m_nodes[num-2] : NULL;

		back1->m_is_then = back2 != NULL and back2->m_has_then;

		if(m_feeder->str(">>")){
			back1->m_has_and = true;
			if(back2 != NULL and back2->m_has_then){
				m_feeder->getPos(&m_end_line, &m_end_char);
				m_error_msg = "Invalid connection (>> is connected after ?>)";
				m_exit_status = 6;
				throw this;
			}
		}else if(m_feeder->str("?>")){
			back1->m_has_then = true;
		}else if(m_feeder->str("!>")){
			if(back2 != NULL and back2->m_has_then)
				back2->m_has_or = true;
			else
				back1->m_has_or = true;
		}else{
			m_feeder->setPos(m_end_line, m_end_char);
			break;
		}
	}

	if(comnum < 1){
		m_feeder->setPos(m_start_line,m_start_char);
		return false;
	}

	// whether background proc or not
	if(m_feeder->str("&")){
		m_is_background = true;
		if(! m_feeder->variable(&m_job_name)){
			m_error_msg = "no job name";
			m_exit_status = 2;
			throw this;
		}

		DataJob *d = new DataJob();
		d->setData(&m_job_name);

		try{
			m_env->setData(0,&m_job_name,d);
		}catch(Environment *e){
			m_error_msg = e->m_error_msg;	
			m_exit_status = 2;
			throw this;
		}
	}

	if(add(new Where(m_feeder,m_env,&m_scopes))){
		m_where = (Where *)m_nodes.back();
		m_nodes.pop_back();

	}
	if(m_outstr != NULL)	m_outstr->setJobId(m_job_id);
	if(m_outfile != NULL)	m_outfile->setJobId(m_job_id);
	if(m_where != NULL)	m_where->setJobId(m_job_id);

	m_feeder->getPos(&m_end_line, &m_end_char);
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
leaq 0x30(%rbx), %rsi
leaq 0x34(%rbx), %rdx
callq 0xd614
movl $0x90, %edi
callq 0x6320
movq %rax, %r15
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
leaq 0x48(%rbx), %rcx
movq %rax, %rdi
movq %rcx, 0x28(%rsp)
callq 0x7fe0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x8e02
movl $0xc0, %ecx
testb %al, %al
jne 0xe4c3
movl $0xb0, %edi
callq 0x6320
movq %rax, %r15
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
movq %rax, %rdi
movq 0x28(%rsp), %rcx
callq 0x885c
movq %rbx, %rdi
movq %r15, %rsi
callq 0x8e02
movl $0xc8, %ecx
testb %al, %al
je 0xe4d3
movq 0x18(%rbx), %rax
movq (%rax), %rax
movq %rax, (%rbx,%rcx)
addq $-0x8, 0x20(%rbx)
movq 0x10(%rbx), %rdi
callq 0xa246
movq (%rbx), %rcx
movq %rbx, %rdi
movl %eax, %esi
callq *0x30(%rcx)
leaq 0x38(%rbx), %rax
movq %rax, 0x18(%rsp)
leaq 0x3c(%rbx), %rax
movq %rax, 0x20(%rsp)
xorl %ebp, %ebp
leaq 0x98(%rsp), %r14
leaq 0x78(%rsp), %r15
movl $0xa8, %edi
callq 0x6320
movq %rax, %r12
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
movq %rax, %rdi
movq 0x28(%rsp), %rcx
callq 0xed74
movq %rbx, %rdi
movq %r12, %rsi
callq 0x8e02
testb %al, %al
je 0xe6cc
movq %r14, %r13
movq 0x8(%rbx), %rdi
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
callq 0xd614
movq 0x8(%rbx), %rdi
callq 0xcc02
movq 0x18(%rbx), %rcx
movq 0x20(%rbx), %rax
movq %rax, %rdx
subq %rcx, %rdx
cmpq $0x8, %rdx
movl %ebp, 0x34(%rsp)
jbe 0xe598
movq -0x10(%rcx,%rdx), %rcx
testq %rcx, %rcx
leaq 0x58(%rsp), %r14
je 0xe5b0
movq %rcx, 0x10(%rsp)
movb 0x86(%rcx), %cl
movl $0x0, 0xc(%rsp)
jmp 0xe5c1
movb $0x1, %cl
movl %ecx, 0xc(%rsp)
movq $0x0, 0x10(%rsp)
xorl %ecx, %ecx
leaq 0x58(%rsp), %r14
jmp 0xe5c1
movb $0x1, %cl
movl %ecx, 0xc(%rsp)
movq $0x0, 0x10(%rsp)
xorl %ecx, %ecx
movq -0x8(%rax), %rbp
movb %cl, 0x88(%rbp)
movq 0x8(%rbx), %r12
movq %r14, %rdi
leaq 0x30b6(%rip), %rsi      # 0x1168f
leaq 0xb(%rsp), %rdx
callq 0x708c
movq %r12, %rdi
movq %r14, %rsi
callq 0xd6ae
movl %eax, %r12d
movq %r14, %rdi
callq 0x6150
testb %r12b, %r12b
je 0xe62a
movb $0x1, 0x85(%rbp)
cmpb $0x0, 0xc(%rsp)
movq %r13, %r14
jne 0xe6c1
movq 0x10(%rsp), %rax
cmpb $0x0, 0x86(%rax)
je 0xe6c1
jmp 0xe82e
movq 0x8(%rbx), %r12
movq %r13, %r14
movq %r13, %rdi
leaq 0x3085(%rip), %rsi      # 0x116c0
leaq 0xb(%rsp), %rdx
callq 0x708c
movq %r12, %rdi
movq %r14, %rsi
callq 0xd6ae
movl %eax, %r12d
movq %r14, %rdi
callq 0x6150
testb %r12b, %r12b
je 0xe669
movb $0x1, 0x86(%rbp)
jmp 0xe6c1
movq 0x8(%rbx), %r12
movq %r15, %rdi
leaq 0x304c(%rip), %rsi      # 0x116c3
leaq 0xb(%rsp), %rdx
callq 0x708c
movq %r12, %rdi
movq %r15, %rsi
callq 0xd6ae
movl %eax, %r12d
movq %r15, %rdi
callq 0x6150
testb %r12b, %r12b
je 0xe6e6
cmpb $0x0, 0xc(%rsp)
movq 0x10(%rsp), %rax
jne 0xe6ba
cmpb $0x1, 0x86(%rax)
jne 0xe6ba
movb $0x1, 0x87(%rax)
jmp 0xe6c1
movb $0x1, 0x87(%rbp)
movl 0x34(%rsp), %ebp
decl %ebp
jmp 0xe508
testl %ebp, %ebp
jne 0xe6f5
movq 0x8(%rbx), %rdi
movl 0x30(%rbx), %esi
movl 0x34(%rbx), %edx
callq 0xd0a2
xorl %eax, %eax
jmp 0xe81c
movq 0x8(%rbx), %rdi
movl 0x38(%rbx), %esi
movl 0x3c(%rbx), %edx
callq 0xd0a2
movq 0x8(%rbx), %r15
leaq 0x2fc6(%rip), %rsi      # 0x116c6
leaq 0x38(%rsp), %rdi
leaq 0xb(%rsp), %rdx
callq 0x708c
leaq 0x38(%rsp), %rsi
movq %r15, %rdi
callq 0xd6ae
movl %eax, %ebp
leaq 0x38(%rsp), %rdi
callq 0x6150
testb %bpl, %bpl
je 0xe780
movb $0x1, 0xb8(%rbx)
movq 0x8(%rbx), %rdi
leaq 0x98(%rbx), %r15
movq %r15, %rsi
callq 0xcf68
testb %al, %al
je 0xe877
pushq $0x50
popq %rdi
callq 0x6320
movq %rax, %r13
movq %rax, %rdi
callq 0x7ca0
movq (%r13), %rax
movq %r13, %rdi
movq %r15, %rsi
callq *0x10(%rax)
movq 0x10(%rbx), %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %r13, %rcx
callq 0xa180
movl $0x90, %edi
callq 0x6320
movq %rax, %r15
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
movq %rax, %rdi
movq 0x28(%rsp), %rcx
callq 0xfa18
movq %rbx, %rdi
movq %r15, %rsi
callq 0x8e02
testb %al, %al
je 0xe7c8
movq 0x20(%rbx), %rax
movq -0x8(%rax), %rcx
addq $-0x8, %rax
movq %rcx, 0x88(%rbx)
movq %rax, 0x20(%rbx)
movq 0xc8(%rbx), %rdi
testq %rdi, %rdi
je 0xe7dd
movl 0x40(%rbx), %esi
movq (%rdi), %rax
callq *0x30(%rax)
movq 0xc0(%rbx), %rdi
testq %rdi, %rdi
je 0xe7f2
movl 0x40(%rbx), %esi
movq (%rdi), %rax
callq *0x30(%rax)
movq 0x88(%rbx), %rdi
testq %rdi, %rdi
je 0xe807
movl 0x40(%rbx), %esi
movq (%rdi), %rax
callq *0x30(%rax)
movq 0x8(%rbx), %rdi
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
callq 0xd614
movb $0x1, %al
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rbx), %rdi
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
callq 0xd614
leaq 0x60(%rbx), %rdi
leaq 0x2e46(%rip), %rsi      # 0x11692
callq 0x6400
movl $0x6, 0x80(%rbx)
pushq $0x8
popq %rdi
callq 0x6190
movq %rbx, (%rax)
leaq 0xb23b(%rip), %rsi      # 0x19aa8
movq %rax, %rdi
xorl %edx, %edx
callq 0x6540
leaq 0x60(%rbx), %rdi
leaq 0x2e46(%rip), %rsi      # 0x116c8
callq 0x6400
movl $0x2, 0x80(%rbx)
jmp 0xe85b
movq %rax, %r14
cmpl $0x1, %edx
jne 0xe956
movq %r14, %rdi
callq 0x6120
leaq 0xa0(%rax), %rsi
leaq 0x60(%rbx), %rdi
callq 0x61c0
movl $0x2, 0x80(%rbx)
pushq $0x8
popq %rdi
callq 0x6190
movq %rbx, (%rax)
leaq 0xb1d5(%rip), %rsi      # 0x19aa8
movq %rax, %rdi
xorl %edx, %edx
callq 0x6540
movq %rax, %r14
callq 0x6500
jmp 0xe956
movq %rax, %r14
pushq $0x50
popq %rsi
movq %r13, %rdi
jmp 0xe951
movq %rax, %r14
movl $0xb0, %esi
jmp 0xe912
jmp 0xe90a
movq %rax, %r14
leaq 0x38(%rsp), %rdi
jmp 0xe93f
jmp 0xe932
movq %rax, %r14
movl $0x90, %esi
movq %r15, %rdi
jmp 0xe951
jmp 0xe932
movq %rax, %r14
leaq 0x78(%rsp), %rdi
jmp 0xe93f
jmp 0xe932
movq %rax, %r14
leaq 0x98(%rsp), %rdi
jmp 0xe93f
movq %rax, %r14
jmp 0xe956
movq %rax, %r14
leaq 0x58(%rsp), %rdi
callq 0x6150
jmp 0xe956
movq %rax, %r14
movl $0xa8, %esi
movq %r12, %rdi
callq 0x6330
movq %r14, %rdi
callq 0x6560