// File: /workspace/github_c_makefile_star2_O1/generot[P]VM-0/src/lang/vc.cc
// Function: inpout(lexer&)
void inpout(lexer& lx) {
    if(!(EXPECT("?") || EXPECT("!")))
        return;

    instr in = instr();

    string op = lx.accept();
    string ident = lx.accept();

    symbol sym = symbol_table[ident];
    if(!sym.addr)
        ISSUE_ERROR("Undefined reference to variable \"%s\".", ident.c_str());

    if(op == "?") {
        in = { INST_ADDR, OPC_SYSCALL, SC_READ };
        in.addr = sym.addr;

        bytecode.push_back(in);
    }
    else if(op == "!") {
        in = { INST_ADDR, OPC_PUSH, SC_INVALID };
        in.addr = sym.addr;

        bytecode.push_back(in);
        bytecode.push_back({ INST_NOARGS, OPC_DEREF, SC_INVALID });
        bytecode.push_back({ INST_NOARGS, OPC_SYSCALL, SC_WRITELN });
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xe0, %rsp
movq %rdi, %rbx
leaq 0xd0(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x3606(%rip), %rsi      # 0x180fa
leaq 0x3600(%rip), %rdx      # 0x180fb
leaq 0xc0(%rsp), %r14
movq %r14, %rdi
callq 0x59ce
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x4ab4
movl %eax, %r14d
movb $0x1, %bpl
testb %al, %al
jne 0x14b58
leaq 0x80(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x35c6(%rip), %rsi      # 0x180fc
leaq 0x35c0(%rip), %rdx      # 0x180fd
leaq 0x70(%rsp), %rdi
callq 0x59ce
leaq 0x70(%rsp), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x4ab4
movl %eax, %ebp
testb %r14b, %r14b
jne 0x14b7e
leaq 0x80(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x14b7e
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x42d0
movq 0xc0(%rsp), %rdi
cmpq %r15, %rdi
je 0x14b9b
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x42d0
testb %bpl, %bpl
je 0x14dfb
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
leaq 0x50(%rsp), %rdi
movq %rbx, %rsi
callq 0x4c32
leaq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0x4c32
leaq 0xcb53(%rip), %rdi      # 0x21728
leaq 0x30(%rsp), %rsi
callq 0x160b6
movq %rax, %rbx
movl (%rax), %eax
leaq 0x98(%rsp), %rdi
movl %eax, -0x8(%rdi)
leaq 0xa8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
addq %rsi, %rdx
callq 0x585e
movq 0x28(%rbx), %rax
movq %rax, 0xb8(%rsp)
testq %rax, %rax
je 0x14e1e
leaq 0x34d3(%rip), %rsi      # 0x180fa
leaq 0x50(%rsp), %rdi
callq 0x40a0
testl %eax, %eax
je 0x14c9b
leaq 0x34c0(%rip), %rsi      # 0x180fc
leaq 0x50(%rsp), %rdi
callq 0x40a0
testl %eax, %eax
jne 0x14da8
movabsq $0x1000000001, %rax     # imm = 0x1000000001
movq %rax, (%rsp)
movl $0x3, 0x8(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xcae8(%rip), %rsi      # 0x21760
cmpq 0xcae9(%rip), %rsi      # 0x21768
je 0x14cf4
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rsi)
movaps (%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x18, 0xcac7(%rip)     # 0x21760
jmp 0x14d03
movabsq $0x2500000001, %rax     # imm = 0x2500000001
movq %rax, (%rsp)
movl $0x2, 0x8(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xca9b(%rip), %rsi      # 0x21760
cmpq 0xca9c(%rip), %rsi      # 0x21768
je 0x14ce0
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rsi)
movaps (%rsp), %xmm0
jmp 0x14d9d
leaq 0xca71(%rip), %rdi      # 0x21758
movq %rsp, %rdx
callq 0x167d8
jmp 0x14da8
leaq 0xca5d(%rip), %rdi      # 0x21758
movq %rsp, %rdx
callq 0x167d8
movabsq $0x1200000002, %rax     # imm = 0x1200000002
movq %rax, 0x18(%rsp)
movl $0x3, 0x20(%rsp)
movq $0x0, 0x28(%rsp)
movq 0xca36(%rip), %rsi      # 0x21760
cmpq 0xca37(%rip), %rsi      # 0x21768
je 0x14d4e
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsi)
movups 0x18(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x18, 0xca14(%rip)     # 0x21760
jmp 0x14d5f
leaq 0xca03(%rip), %rdi      # 0x21758
leaq 0x18(%rsp), %rdx
callq 0x16660
movabsq $0x2500000002, %rax     # imm = 0x2500000002
movq %rax, 0x18(%rsp)
movl $0x1, 0x20(%rsp)
movq $0x0, 0x28(%rsp)
movq 0xc9da(%rip), %rsi      # 0x21760
cmpq 0xc9db(%rip), %rsi      # 0x21768
je 0x14e0b
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsi)
movups 0x18(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x18, 0xc9b8(%rip)     # 0x21760
movq 0x98(%rsp), %rdi
cmpq %r14, %rdi
je 0x14dc5
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x42d0
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x14de0
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x42d0
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x14dfb
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x42d0
addq $0xe0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc946(%rip), %rdi      # 0x21758
leaq 0x18(%rsp), %rdx
callq 0x16660
jmp 0x14da8
leaq 0x30(%rsp), %rdi
callq 0x4815
jmp 0x14e2c
jmp 0x14e2c
movq %rax, %rbx
movq 0x98(%rsp), %rdi
cmpq %r14, %rdi
je 0x14e77
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0x14e77
movq %rax, %rbx
jmp 0x14e92
movq %rax, %rbx
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0x14eaa
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0x14eaa
jmp 0x14ea7
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x14e92
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x42d0
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x14ec7
movq 0x60(%rsp), %rsi
jmp 0x14ebf
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
cmpq %r15, %rdi
je 0x14ec7
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x42d0
movq %rbx, %rdi
callq 0x44e0