// File: /workspace/github_c_makefile_star2_O3/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 0x2ee4(%rip), %rbp      # 0xe5d4
leaq 0x8(%rsp), %r14
leaq 0x2efc(%rip), %r12      # 0xe5f8
movzbl (%r13), %eax
cmpl $0x4c, %eax
jle 0xb750
leal -0x61(%rax), %ecx
cmpl $0x16, %ecx
ja 0xb793
movslq (%r12,%rcx,4), %rax
addq %r12, %rax
jmpq *%rax
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x61fc
movq 0x8(%rbx), %r15
leaq 0x260(%r15), %rdi
movq %r14, %rsi
callq 0xc182
addq $0x240, %r15            # imm = 0x240
movzbl %al, %esi
movq %r15, %rdi
callq 0xc0e2
incq %r13
jmp 0xb6fc
leal -0x41(%rax), %ecx
cmpl $0x8, %ecx
ja 0xb7c8
movslq (%rbp,%rcx,4), %rax
addq %rbp, %rax
jmpq *%rax
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x61fc
movq 0x8(%rbx), %r15
leaq 0x338(%r15), %rdi
movq %r14, %rsi
callq 0x79c8
addq $0x240, %r15            # imm = 0x240
movq %r15, %rdi
movl %eax, %esi
callq 0x8a4c
jmp 0xb74b
cmpl $0x4d, %eax
je 0xb879
cmpl $0x50, %eax
jne 0xb8cb
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x61fc
movq 0x8(%rbx), %r15
leaq 0xa0(%r15), %rdi
movq %r14, %rsi
callq 0xc182
jmp 0xb739
cmpl $0x2d, %eax
je 0xb74b
jmp 0xb89c
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x61fc
movq 0x8(%rbx), %r15
leaq 0x390(%r15), %rdi
movq %r14, %rsi
callq 0xc182
jmp 0xb739
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x61fc
movq 0x8(%rbx), %r15
leaq 0x180(%r15), %rdi
movq %r14, %rsi
callq 0xc182
jmp 0xb739
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x61fc
movq 0x8(%rbx), %rdi
movl $0x240, %eax            # imm = 0x240
addq %rax, %rdi
movq (%rbx), %rax
movl 0x8(%rax), %edx
movq %r14, %rsi
callq 0x7e64
jmp 0xb74b
movq (%rbx), %rdi
movq 0x8(%rbx), %r15
callq 0x61c2
addq $0x240, %r15            # imm = 0x240
movq %r15, %rdi
movl %eax, %esi
callq 0xc0fe
jmp 0xb74b
movq (%rbx), %rdi
movq 0x8(%rbx), %r15
callq 0x61d6
jmp 0xb739
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x61fc
movq 0x8(%rbx), %r15
leaq 0x110(%r15), %rdi
movq %r14, %rsi
callq 0xc182
jmp 0xb739
testl %eax, %eax
jne 0xb8cb
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xb8bc
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 0x2de6(%rip), %rsi      # 0xe6c5
movq %rax, %rdi
callq 0x33b0
movq 0x86e2(%rip), %rsi      # 0x13fd0
movq 0x86cb(%rip), %rdx      # 0x13fc0
movq %r14, %rdi
callq 0x3480
jmp 0xb90c
movq %rax, %rbx
movq %r14, %rdi
callq 0x31f0
jmp 0xb90f
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xb92b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3260
movq %rbx, %rdi
callq 0x34a0
nop