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

	if(!m_feeder->str("proc")){
		m_feeder->setPos(m_start_line, m_start_char);
		return false;
	}

	if(!m_feeder->path(&m_name)){
		m_feeder->setPos(m_start_line, m_start_char);
		return false;
	}
	m_feeder->blank();

	if(!m_feeder->str("=")){
		m_feeder->setPos(m_start_line, m_start_char);
		return false;
	}

	string scr;
	bool scr_exist = m_feeder->doBlock(&scr) || m_feeder->lineResidual(&scr);
	if(!scr_exist){
		m_feeder->setPos(m_start_line, m_start_char);
		return false;
	}

	//create a file
	string tmpdir = m_env->m_tmpdir + "/" + m_name;
	ofstream ofs(tmpdir.c_str());
	ofs << scr;
	ofs.close();

	auto *p = new DataProc();
	p->setFileName(&tmpdir);
	m_env->setData(m_scopes.back(),&m_name,p);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x340, %rsp            # imm = 0x340
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdx
movq %rdx, -0x2f8(%rbp)
movq 0x8(%rdx), %rdi
movq %rdx, %rsi
addq $0x30, %rsi
addq $0x34, %rdx
callq 0x17610
movq -0x2f8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x2f0(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x2e8(%rbp)
callq 0x6710
movq -0x2e8(%rbp), %rdx
leaq 0x12a0b(%rip), %rsi     # 0x1d369
leaq -0x30(%rbp), %rdi
callq 0x7940
jmp 0xa969
movq -0x2f0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x17750
movb %al, -0x2f9(%rbp)
jmp 0xa981
movb -0x2f9(%rbp), %al
xorb $-0x1, %al
movb %al, -0x2fa(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x6280
leaq -0x31(%rbp), %rdi
callq 0x6480
movb -0x2fa(%rbp), %al
testb $0x1, %al
jne 0xa9ad
jmp 0xa9fd
movq -0x2f8(%rbp), %rax
movq 0x8(%rax), %rdi
movl 0x30(%rax), %esi
movl 0x34(%rax), %edx
callq 0x16c90
movb $0x0, -0x1(%rbp)
jmp 0xadca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xa9ef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x6280
leaq -0x31(%rbp), %rdi
callq 0x6480
jmp 0xadd8
movq -0x2f8(%rbp), %rsi
movq 0x8(%rsi), %rdi
addq $0x88, %rsi
callq 0x16220
testb $0x1, %al
jne 0xaa37
movq -0x2f8(%rbp), %rax
movq 0x8(%rax), %rdi
movl 0x30(%rax), %esi
movl 0x34(%rax), %edx
callq 0x16c90
movb $0x0, -0x1(%rbp)
jmp 0xadca
movq -0x2f8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x164a0
movq -0x2f8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x310(%rbp)
leaq -0x69(%rbp), %rdi
movq %rdi, -0x308(%rbp)
callq 0x6710
movq -0x308(%rbp), %rdx
leaq 0x12c68(%rip), %rsi     # 0x1d6df
leaq -0x68(%rbp), %rdi
callq 0x7940
jmp 0xaa82
movq -0x310(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x17750
movb %al, -0x311(%rbp)
jmp 0xaa9a
movb -0x311(%rbp), %al
xorb $-0x1, %al
movb %al, -0x312(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x6280
leaq -0x69(%rbp), %rdi
callq 0x6480
movb -0x312(%rbp), %al
testb $0x1, %al
jne 0xaac6
jmp 0xab16
movq -0x2f8(%rbp), %rax
movq 0x8(%rax), %rdi
movl 0x30(%rax), %esi
movl 0x34(%rax), %edx
callq 0x16c90
movb $0x0, -0x1(%rbp)
jmp 0xadca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xab08
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x6280
leaq -0x69(%rbp), %rdi
callq 0x6480
jmp 0xadd8
leaq -0x90(%rbp), %rdi
movq %rdi, -0x320(%rbp)
callq 0x65a0
movq -0x2f8(%rbp), %rax
movq -0x320(%rbp), %rsi
movq 0x8(%rax), %rdi
callq 0x17d70
movb %al, -0x313(%rbp)
jmp 0xab48
movb -0x313(%rbp), %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x321(%rbp)
jne 0xab8a
jmp 0xab5d
movq -0x2f8(%rbp), %rax
movq 0x8(%rax), %rdi
leaq -0x90(%rbp), %rsi
callq 0x17640
movb %al, -0x322(%rbp)
jmp 0xab7c
movb -0x322(%rbp), %al
movb %al, -0x321(%rbp)
jmp 0xab8a
movb -0x321(%rbp), %al
andb $0x1, %al
movb %al, -0x91(%rbp)
testb $0x1, -0x91(%rbp)
jne 0xabdd
movq -0x2f8(%rbp), %rax
movq 0x8(%rax), %rdi
movl 0x30(%rax), %esi
movl 0x34(%rax), %edx
callq 0x16c90
jmp 0xabb9
movb $0x0, -0x1(%rbp)
movl $0x1, -0x98(%rbp)
jmp 0xadae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xadbc
movq -0x2f8(%rbp), %rax
movq 0x10(%rax), %rsi
addq $0xc0, %rsi
leaq 0x129c4(%rip), %rdx     # 0x1d5ba
leaq -0xd8(%rbp), %rdi
callq 0x79f0
jmp 0xac04
movq -0x2f8(%rbp), %rdx
addq $0x88, %rdx
leaq -0xb8(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x8720
jmp 0xac27
leaq -0xd8(%rbp), %rdi
callq 0x6280
leaq -0xb8(%rbp), %rdi
callq 0x6190
movq %rax, %rsi
leaq -0x2d8(%rbp), %rdi
movl $0x10, %edx
callq 0x6490
jmp 0xac55
leaq -0x2d8(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x63a0
jmp 0xac6a
leaq -0x2d8(%rbp), %rdi
callq 0x65e0
jmp 0xac78
movl $0x68, %edi
callq 0x6420
movq %rax, -0x330(%rbp)
jmp 0xac8b
movq -0x330(%rbp), %rdi
callq 0x96f0
jmp 0xac99
movq -0x330(%rbp), %rax
movq %rax, -0x2e0(%rbp)
movq -0x2e0(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x97c0
jmp 0xacbc
movq -0x2f8(%rbp), %rdi
movq 0x10(%rdi), %rax
movq %rax, -0x338(%rbp)
addq $0x48, %rdi
callq 0xa5a0
movq -0x2f8(%rbp), %rdx
movq -0x338(%rbp), %rdi
movl (%rax), %esi
addq $0x88, %rdx
movq -0x2e0(%rbp), %rcx
callq 0xf250
jmp 0xacfc
movq -0x2f8(%rbp), %rdx
movq 0x8(%rdx), %rdi
movq %rdx, %rsi
addq $0x38, %rsi
addq $0x3c, %rdx
callq 0x17610
jmp 0xad19
movb $0x1, -0x1(%rbp)
movl $0x1, -0x98(%rbp)
leaq -0x2d8(%rbp), %rdi
callq 0x6610
leaq -0xb8(%rbp), %rdi
callq 0x6280
jmp 0xadae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x6280
jmp 0xadbc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xada0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xad94
movq -0x330(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x68, %esi
callq 0x6430
leaq -0x2d8(%rbp), %rdi
callq 0x6610
leaq -0xb8(%rbp), %rdi
callq 0x6280
jmp 0xadbc
leaq -0x90(%rbp), %rdi
callq 0x6280
jmp 0xadca
leaq -0x90(%rbp), %rdi
callq 0x6280
jmp 0xadd8
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x340, %rsp            # imm = 0x340
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x6700
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)