// File: /workspace/github_c_makefile_star2_O1/almk277[P]ROSE/rasm/parser.cpp
// Function: parser::parse_operands(instruction const&)
void parser::parse_operands(const instruction &instr)
{
	string name;
	for (auto op = instr.operands; *op; ++op) {
		switch (*op) {
		case '-': break;
		case 'c':
			m.text.put(s.read_byte());
			break;
		case 'w':
			m.text.put(s.read_int());
			break;
		case 's':
		case 'v':
		case 'i':
		case 'f':
		case 'a':
		case 'b':
		case 'F':
		case 'o':
			s >> name;
			m.text.put(m.text.find_var(name));
			break;
		case 'D':
			s >> name;
			m.text.put(m.data[name]);
			break;
		case 'P':
			s >> name;
			m.text.put(m.ptbl[name]);
			break;
		case 'A':
			s >> name;
			m.text.put(m.str[name]);
			break;
		case 'M':
			s >> name;
			m.text.put(m.mtbl[name]);
			break;
		case 'I':
			s >> name;
			m.text.put(m.imp[name]);
			break;
		case 'r':
			s >> name;
			m.text.add_ref(name, s.line());
			break;
		default: throw std::logic_error("wrong operand type");
		} // switch (*op)
	} // for
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x8(%rsi), %r13
leaq 0x2dce(%rip), %rbp      # 0xe5d4
leaq 0x8(%rsp), %r14
leaq 0x2de6(%rip), %r12      # 0xe5f8
movzbl (%r13), %eax
cmpl $0x4c, %eax
jle 0xb866
leal -0x61(%rax), %ecx
cmpl $0x16, %ecx
ja 0xb8a9
movslq (%r12,%rcx,4), %rax
addq %r12, %rax
jmpq *%rax
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x6264
movq 0x8(%rbx), %r15
leaq 0x260(%r15), %rdi
movq %r14, %rsi
callq 0xc294
addq $0x240, %r15            # imm = 0x240
movzbl %al, %esi
movq %r15, %rdi
callq 0xc1f4
incq %r13
jmp 0xb812
leal -0x41(%rax), %ecx
cmpl $0x8, %ecx
ja 0xb8de
movslq (%rbp,%rcx,4), %rax
addq %rbp, %rax
jmpq *%rax
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x6264
movq 0x8(%rbx), %r15
leaq 0x338(%r15), %rdi
movq %r14, %rsi
callq 0x7a72
addq $0x240, %r15            # imm = 0x240
movq %r15, %rdi
movl %eax, %esi
callq 0x8aaa
jmp 0xb861
cmpl $0x4d, %eax
je 0xb98f
cmpl $0x50, %eax
jne 0xb9e1
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x6264
movq 0x8(%rbx), %r15
leaq 0xa0(%r15), %rdi
movq %r14, %rsi
callq 0xc294
jmp 0xb84f
cmpl $0x2d, %eax
je 0xb861
jmp 0xb9b2
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x6264
movq 0x8(%rbx), %r15
leaq 0x390(%r15), %rdi
movq %r14, %rsi
callq 0xc294
jmp 0xb84f
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x6264
movq 0x8(%rbx), %r15
leaq 0x180(%r15), %rdi
movq %r14, %rsi
callq 0xc294
jmp 0xb84f
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x6264
movq 0x8(%rbx), %rdi
movl $0x240, %eax            # imm = 0x240
addq %rax, %rdi
movq (%rbx), %rax
movl 0x8(%rax), %edx
movq %r14, %rsi
callq 0x7eee
jmp 0xb861
movq (%rbx), %rdi
movq 0x8(%rbx), %r15
callq 0x622a
addq $0x240, %r15            # imm = 0x240
movq %r15, %rdi
movl %eax, %esi
callq 0xc210
jmp 0xb861
movq (%rbx), %rdi
movq 0x8(%rbx), %r15
callq 0x623e
jmp 0xb84f
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x6264
movq 0x8(%rbx), %r15
leaq 0x110(%r15), %rdi
movq %r14, %rsi
callq 0xc294
jmp 0xb84f
testl %eax, %eax
jne 0xb9e1
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xb9d2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3260
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x3150
movq %rax, %r14
leaq 0x2cd0(%rip), %rsi      # 0xe6c5
movq %rax, %rdi
callq 0x33b0
movq 0x85cc(%rip), %rsi      # 0x13fd0
movq 0x85b5(%rip), %rdx      # 0x13fc0
movq %r14, %rdi
callq 0x3480
jmp 0xba22
movq %rax, %rbx
movq %r14, %rdi
callq 0x31f0
jmp 0xba25
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xba41
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3260
movq %rbx, %rdi
callq 0x34a0
nop