// File: /workspace/github_cpp_makefile_star2_O3/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 $0xa8, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
leaq 0x30(%rbx), %rsi
leaq 0x34(%rbx), %rdx
callq 0xfe78
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, 0x18(%rsp)
callq 0x8680
movq %rbx, %rdi
movq %r15, %rsi
callq 0x9c96
movl $0xc0, %ecx
testb %al, %al
jne 0x11469
movl $0xb0, %edi
callq 0x6320
movq %rax, %r15
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
movq %rax, %rdi
movq 0x18(%rsp), %rcx
callq 0x9380
movq %rbx, %rdi
movq %r15, %rsi
callq 0x9c96
movl $0xc8, %ecx
testb %al, %al
je 0x11479
movq 0x18(%rbx), %rax
movq (%rax), %rax
movq %rax, (%rbx,%rcx)
addq $-0x8, 0x20(%rbx)
movq 0x10(%rbx), %rdi
callq 0xbc62
movq (%rbx), %rcx
movq %rbx, %rdi
movl %eax, %esi
callq *0x30(%rcx)
leaq 0x38(%rbx), %rax
movq %rax, 0x8(%rsp)
leaq 0x3c(%rbx), %rax
movq %rax, 0x10(%rsp)
xorl %r14d, %r14d
movl $0xa8, %edi
callq 0x6320
movq %rax, %rbp
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
movq %rax, %rdi
movq 0x18(%rsp), %rcx
callq 0x11e14
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x9c96
testb %al, %al
je 0x116a5
movl %r14d, 0x24(%rsp)
movq 0x8(%rbx), %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
callq 0xfe78
movq 0x8(%rbx), %rdi
callq 0xf326
movq 0x18(%rbx), %rcx
movq 0x20(%rbx), %rax
movq %rax, %rdx
subq %rcx, %rdx
cmpq $0x8, %rdx
jbe 0x1152c
movq -0x10(%rcx,%rdx), %r14
testq %r14, %r14
leaq 0x38(%rsp), %r12
je 0x1153e
movb 0x86(%r14), %cl
movl $0x0, 0x4(%rsp)
jmp 0x11549
movb $0x1, %cl
movl %ecx, 0x4(%rsp)
xorl %r14d, %r14d
xorl %ecx, %ecx
leaq 0x38(%rsp), %r12
jmp 0x11549
movb $0x1, %cl
movl %ecx, 0x4(%rsp)
xorl %r14d, %r14d
xorl %ecx, %ecx
movq -0x8(%rax), %r13
movb %cl, 0x88(%r13)
movq 0x8(%rbx), %rbp
movq %r12, 0x28(%rsp)
leaq 0x28(%rsp), %r15
movq %r15, %rdi
leaq 0x3163(%rip), %rsi      # 0x146cf
leaq 0x315e(%rip), %rdx      # 0x146d1
callq 0x74f0
movq %rbp, %rdi
movq %r15, %rsi
callq 0xff28
movl %eax, %ebp
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x1159c
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6330
testb %bpl, %bpl
leaq 0x78(%rsp), %r12
je 0x115cc
movb $0x1, 0x85(%r13)
cmpb $0x0, 0x4(%rsp)
jne 0x11698
cmpb $0x0, 0x86(%r14)
je 0x11698
jmp 0x1182f
movq 0x8(%rbx), %rbp
movq %r12, 0x68(%rsp)
leaq 0x68(%rsp), %r15
movq %r15, %rdi
leaq 0x311c(%rip), %rsi      # 0x14700
leaq 0x3117(%rip), %rdx      # 0x14702
callq 0x74f0
movq %rbp, %rdi
movq %r15, %rsi
callq 0xff28
movl %eax, %ebp
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x11614
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x6330
testb %bpl, %bpl
je 0x11623
movb $0x1, 0x86(%r13)
jmp 0x11698
movq 0x8(%rbx), %rbp
leaq 0x58(%rsp), %r12
movq %r12, 0x48(%rsp)
leaq 0x48(%rsp), %r15
movq %r15, %rdi
leaq 0x30c3(%rip), %rsi      # 0x14703
leaq 0x30be(%rip), %rdx      # 0x14705
callq 0x74f0
movq %rbp, %rdi
movq %r15, %rsi
callq 0xff28
movl %eax, %ebp
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x11670
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x6330
testb %bpl, %bpl
je 0x116c0
cmpb $0x0, 0x4(%rsp)
jne 0x11690
cmpb $0x1, 0x86(%r14)
jne 0x11690
movb $0x1, 0x87(%r14)
jmp 0x11698
movb $0x1, 0x87(%r13)
movl 0x24(%rsp), %r14d
decl %r14d
jmp 0x114a2
testl %r14d, %r14d
jne 0x116cf
movq 0x8(%rbx), %rdi
movl 0x30(%rbx), %esi
movl 0x34(%rbx), %edx
callq 0xf828
xorl %eax, %eax
jmp 0x1181d
movq 0x8(%rbx), %rdi
movl 0x38(%rbx), %esi
movl 0x3c(%rbx), %edx
callq 0xf828
movq 0x8(%rbx), %r13
leaq 0x98(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x3020(%rip), %rsi      # 0x14706
leaq 0x301a(%rip), %rdx      # 0x14707
leaq 0x88(%rsp), %rbp
movq %rbp, %rdi
callq 0x74f0
movq %r13, %rdi
movq %rbp, %rsi
callq 0xff28
movl %eax, %ebp
movq 0x88(%rsp), %rdi
cmpq %r15, %rdi
je 0x11727
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x6330
testb %bpl, %bpl
je 0x11781
movb $0x1, 0xb8(%rbx)
movq 0x8(%rbx), %rdi
leaq 0x98(%rbx), %r13
movq %r13, %rsi
callq 0xf69c
testb %al, %al
je 0x1187a
movl $0x50, %edi
callq 0x6320
movq %rax, %rbp
movq %rax, %rdi
callq 0x8248
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 0xbb62
movl $0x90, %edi
callq 0x6320
movq %rax, %r13
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
movq %rax, %rdi
movq 0x18(%rsp), %rcx
callq 0x12d68
movq %rbx, %rdi
movq %r13, %rsi
callq 0x9c96
testb %al, %al
je 0x117c9
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 0x117de
movl 0x40(%rbx), %esi
movq (%rdi), %rax
callq *0x30(%rax)
movq 0xc0(%rbx), %rdi
testq %rdi, %rdi
je 0x117f3
movl 0x40(%rbx), %esi
movq (%rdi), %rax
callq *0x30(%rax)
movq 0x88(%rbx), %rdi
testq %rdi, %rdi
je 0x11808
movl 0x40(%rbx), %esi
movq (%rdi), %rax
callq *0x30(%rax)
movq 0x8(%rbx), %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
callq 0xfe78
movb $0x1, %al
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rbx), %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
callq 0xfe78
leaq 0x60(%rbx), %rdi
leaq 0x2e85(%rip), %rsi      # 0x146d2
callq 0x6410
movl $0x6, 0x80(%rbx)
movl $0x8, %edi
callq 0x6190
movq %rbx, (%rax)
leaq 0xa238(%rip), %rsi      # 0x1baa8
movq %rax, %rdi
xorl %edx, %edx
callq 0x6550
leaq 0x60(%rbx), %rdi
leaq 0x2e83(%rip), %rsi      # 0x14708
callq 0x6410
movl $0x2, 0x80(%rbx)
jmp 0x1185c
movq %rax, %r14
cmpl $0x1, %edx
jne 0x11989
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 0xa1d0(%rip), %rsi      # 0x1baa8
movq %rax, %rdi
xorl %edx, %edx
callq 0x6550
movq %rax, %r14
callq 0x6500
jmp 0x11989
movq %rax, %r14
movl $0x50, %esi
jmp 0x11981
movq %rax, %r14
movl $0xb0, %esi
jmp 0x11935
movq %rax, %r14
movl $0x90, %esi
movq %r13, %rdi
jmp 0x11984
movq %rax, %r14
movq 0x88(%rsp), %rdi
cmpq %r15, %rdi
je 0x11989
movq 0x98(%rsp), %rsi
jmp 0x11974
movq %rax, %r14
movl $0x90, %esi
movq %r15, %rdi
jmp 0x11984
movq %rax, %r14
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x11989
movq 0x58(%rsp), %rsi
jmp 0x11974
movq %rax, %r14
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x11989
movq 0x78(%rsp), %rsi
jmp 0x11974
movq %rax, %r14
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x11989
movq 0x38(%rsp), %rsi
incq %rsi
jmp 0x11984
movq %rax, %r14
movl $0xa8, %esi
movq %rbp, %rdi
callq 0x6330
movq %r14, %rdi
callq 0x6580
nop