// File: /workspace/github_cpp_makefile_star2_O1/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), %r14
leaq 0x34(%rbx), %r12
movq %r14, %rsi
movq %r12, %rdx
callq 0x1003e
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, 0x10(%rsp)
callq 0x8670
movq %rbx, %rdi
movq %r15, %rsi
callq 0x9cc2
movl $0xc0, %ecx
testb %al, %al
jne 0x1164b
movl $0xb0, %edi
callq 0x6320
movq %rax, %r15
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
movq %rax, %rdi
movq 0x10(%rsp), %rcx
callq 0x937c
movq %rbx, %rdi
movq %r15, %rsi
callq 0x9cc2
movl $0xc8, %ecx
testb %al, %al
je 0x1165b
movq 0x18(%rbx), %rax
movq (%rax), %rax
movq %rax, (%rbx,%rcx)
addq $-0x8, 0x20(%rbx)
movq %r12, 0x20(%rsp)
movq %r14, 0x28(%rsp)
movq 0x10(%rbx), %rdi
callq 0xbc82
movq (%rbx), %rcx
movq %rbx, %rdi
movl %eax, %esi
callq *0x30(%rcx)
leaq 0x38(%rbx), %rax
movq %rax, (%rsp)
leaq 0x3c(%rbx), %rax
movq %rax, 0x8(%rsp)
leaq 0x88(%rsp), %r13
xorl %r14d, %r14d
movl $0xa8, %edi
callq 0x6320
movq %rax, %rbp
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
movq %rax, %rdi
movq 0x10(%rsp), %rcx
callq 0x1202c
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x9cc2
testb %al, %al
je 0x1188f
movq %r14, 0x30(%rsp)
movq %r13, %r12
movq 0x8(%rbx), %rdi
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
callq 0x1003e
movq 0x8(%rbx), %rdi
callq 0xf358
movq 0x18(%rbx), %rcx
movq 0x20(%rbx), %rax
movq %rax, %rdx
subq %rcx, %rdx
cmpq $0x8, %rdx
jbe 0x11708
movq -0x10(%rcx,%rdx), %rdx
jmp 0x1170a
xorl %edx, %edx
leaq 0x48(%rsp), %r13
movq -0x8(%rax), %rcx
testq %rdx, %rdx
movq %rdx, 0x18(%rsp)
je 0x11725
movb 0x86(%rdx), %al
jmp 0x11727
xorl %eax, %eax
movq %rcx, %r14
movb %al, 0x88(%rcx)
movq %rbx, %r15
movq 0x8(%rbx), %rbp
movq %r13, 0x38(%rsp)
leaq 0x38(%rsp), %rbx
movq %rbx, %rdi
leaq 0x2f6a(%rip), %rsi      # 0x146b5
leaq 0x2f65(%rip), %rdx      # 0x146b7
callq 0x74e6
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x100e8
movl %eax, %ebp
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0x1177b
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x6330
testb %bpl, %bpl
movq %r12, %r13
movq %r15, %rbx
je 0x117ae
movb $0x1, 0x85(%r14)
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x11882
cmpb $0x0, 0x86(%rax)
je 0x11882
jmp 0x11a2e
movq 0x8(%rbx), %rbp
movq %r13, 0x78(%rsp)
leaq 0x78(%rsp), %r15
movq %r15, %rdi
leaq 0x2f20(%rip), %rsi      # 0x146e6
leaq 0x2f1b(%rip), %rdx      # 0x146e8
callq 0x74e6
movq %rbp, %rdi
movq %r15, %rsi
callq 0x100e8
movl %eax, %ebp
movq 0x78(%rsp), %rdi
cmpq %r13, %rdi
je 0x117f9
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x6330
testb %bpl, %bpl
je 0x11808
movb $0x1, 0x86(%r14)
jmp 0x11882
movq 0x8(%rbx), %rbp
leaq 0x68(%rsp), %r12
movq %r12, 0x58(%rsp)
leaq 0x58(%rsp), %r15
movq %r15, %rdi
leaq 0x2ec4(%rip), %rsi      # 0x146e9
leaq 0x2ebf(%rip), %rdx      # 0x146eb
callq 0x74e6
movq %rbp, %rdi
movq %r15, %rsi
callq 0x100e8
movl %eax, %ebp
movq 0x58(%rsp), %rdi
cmpq %r12, %rdi
je 0x11855
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x6330
testb %bpl, %bpl
je 0x11a17
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x1187a
cmpb $0x1, 0x86(%rax)
jne 0x1187a
movb $0x1, 0x87(%rax)
jmp 0x11882
movb $0x1, 0x87(%r14)
movq 0x30(%rsp), %r14
decl %r14d
jmp 0x11695
testl %r14d, %r14d
setne %r14b
movq 0x8(%rbx), %r13
testb %r14b, %r14b
je 0x119ec
leaq 0xa8(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x2e36(%rip), %rsi      # 0x146ec
leaq 0x2e30(%rip), %rdx      # 0x146ed
leaq 0x98(%rsp), %rbp
movq %rbp, %rdi
callq 0x74e6
movq %r13, %rdi
movq %rbp, %rsi
callq 0x100e8
movl %eax, %ebp
movq 0x98(%rsp), %rdi
cmpq %r15, %rdi
je 0x118f7
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x6330
testb %bpl, %bpl
je 0x11951
movb $0x1, 0xb8(%rbx)
movq 0x8(%rbx), %rdi
leaq 0x98(%rbx), %r13
movq %r13, %rsi
callq 0xf7a4
testb %al, %al
je 0x11a78
movl $0x50, %edi
callq 0x6320
movq %rax, %rbp
movq %rax, %rdi
callq 0x8238
movq (%rbp), %rax
movq %rbp, %rdi
movq %r13, %rsi
callq *0x10(%rax)
movq 0x10(%rbx), %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %rbp, %rcx
callq 0xbb82
movl $0x90, %edi
callq 0x6320
movq %rax, %r13
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
movq %rax, %rdi
movq 0x10(%rsp), %rcx
callq 0x12f94
movq %rbx, %rdi
movq %r13, %rsi
callq 0x9cc2
testb %al, %al
je 0x11999
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 0x119ae
movl 0x40(%rbx), %esi
movq (%rdi), %rax
callq *0x30(%rax)
movq 0xc0(%rbx), %rdi
testq %rdi, %rdi
je 0x119c3
movl 0x40(%rbx), %esi
movq (%rdi), %rax
callq *0x30(%rax)
movq 0x88(%rbx), %rdi
testq %rdi, %rdi
je 0x119d8
movl 0x40(%rbx), %esi
movq (%rdi), %rax
callq *0x30(%rax)
movq 0x8(%rbx), %rdi
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
callq 0x1003e
jmp 0x11a02
movq 0x28(%rsp), %rax
movl (%rax), %esi
movq 0x20(%rsp), %rax
movl (%rax), %edx
movq %r13, %rdi
callq 0xf958
movl %r14d, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rbx), %rdi
movl 0x38(%rbx), %esi
movl 0x3c(%rbx), %edx
callq 0xf958
movb $0x1, %r14b
jmp 0x11896
movq 0x8(%rbx), %rdi
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
callq 0x1003e
leaq 0x60(%rbx), %rdi
leaq 0x2c6d(%rip), %rsi      # 0x146b8
callq 0x6410
movl $0x6, 0x80(%rbx)
movl $0x8, %edi
callq 0x6190
movq %rbx, (%rax)
leaq 0xa03a(%rip), %rsi      # 0x1baa8
movq %rax, %rdi
xorl %edx, %edx
callq 0x6550
leaq 0x60(%rbx), %rdi
leaq 0x2c6b(%rip), %rsi      # 0x146ee
callq 0x6410
movl $0x2, 0x80(%rbx)
jmp 0x11a5a
movq %rax, %r14
cmpl $0x1, %edx
jne 0x11b8a
movq %r14, %rdi
callq 0x6130
leaq 0xa0(%rax), %rsi
leaq 0x60(%rbx), %rdi
callq 0x61c0
movl $0x2, 0x80(%rbx)
movl $0x8, %edi
callq 0x6190
movq %rbx, (%rax)
leaq 0x9fd2(%rip), %rsi      # 0x1baa8
movq %rax, %rdi
xorl %edx, %edx
callq 0x6550
movq %rax, %r14
callq 0x6500
jmp 0x11b8a
movq %rax, %r14
movl $0x50, %esi
jmp 0x11b82
movq %rax, %r14
movl $0x90, %esi
movq %r13, %rdi
jmp 0x11b85
movq %rax, %r14
movq 0x98(%rsp), %rdi
cmpq %r15, %rdi
je 0x11b8a
movq 0xa8(%rsp), %rsi
jmp 0x11b75
movq %rax, %r14
movl $0xb0, %esi
jmp 0x11b33
movq %rax, %r14
movl $0x90, %esi
movq %r15, %rdi
jmp 0x11b85
movq %rax, %r14
movq 0x58(%rsp), %rdi
cmpq %r12, %rdi
je 0x11b8a
movq 0x68(%rsp), %rsi
jmp 0x11b75
movq %rax, %r14
movq 0x78(%rsp), %rdi
cmpq %r13, %rdi
je 0x11b8a
movq 0x88(%rsp), %rsi
jmp 0x11b75
movq %rax, %r14
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0x11b8a
movq 0x48(%rsp), %rsi
incq %rsi
jmp 0x11b85
movq %rax, %r14
movl $0xa8, %esi
movq %rbp, %rdi
callq 0x6330
movq %r14, %rdi
callq 0x6580