// File: /workspace/github_c_makefile_star2_O3/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 %rbx
subq $0xe8, %rsp
movq %rdi, %rbx
leaq 0xd8(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x3627(%rip), %rsi      # 0x180fa
leaq 0x3621(%rip), %rdx      # 0x180fb
leaq 0xc8(%rsp), %r14
movq %r14, %rdi
callq 0x59aa
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x4ab4
movb $0x1, %bpl
testb %al, %al
jne 0x14b4d
leaq 0x88(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x35eb(%rip), %rsi      # 0x180fc
leaq 0x35e5(%rip), %rdx      # 0x180fd
leaq 0x78(%rsp), %rdi
callq 0x59aa
leaq 0x78(%rsp), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x4ab4
movl %eax, %ebp
movq 0x78(%rsp), %rdi
cmpq %r14, %rdi
je 0x14b4d
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x42d0
movq 0xc8(%rsp), %rdi
cmpq %r15, %rdi
je 0x14b6a
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x42d0
testb %bpl, %bpl
je 0x14dde
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
leaq 0x58(%rsp), %rdi
movq %rbx, %rsi
callq 0x4c32
leaq 0x38(%rsp), %rdi
movq %rbx, %rsi
callq 0x4c32
leaq 0xcb84(%rip), %rdi      # 0x21728
leaq 0x38(%rsp), %rsi
callq 0x15f9a
movq %rax, %rbx
movl (%rax), %eax
leaq 0xa0(%rsp), %rdi
movl %eax, -0x8(%rdi)
leaq 0xb0(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
addq %rsi, %rdx
callq 0x5834
movq 0x28(%rbx), %rax
movq %rax, 0xc0(%rsp)
testq %rax, %rax
je 0x14dff
leaq 0x3504(%rip), %rsi      # 0x180fa
leaq 0x58(%rsp), %rdi
callq 0x40a0
testl %eax, %eax
je 0x14c74
leaq 0x34f1(%rip), %rsi      # 0x180fc
leaq 0x58(%rsp), %rdi
callq 0x40a0
testl %eax, %eax
jne 0x14d8b
movabsq $0x1000000001, %rax     # imm = 0x1000000001
movq %rax, (%rsp)
movl $0x3, 0x8(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xcb19(%rip), %rsi      # 0x21760
cmpq 0xcb1a(%rip), %rsi      # 0x21768
je 0x14ccd
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rsi)
movaps (%rsp), %xmm0
movups %xmm0, (%rsi)
movq 0xcaf9(%rip), %rsi      # 0x21760
addq $0x18, %rsi
movq %rsi, 0xcaee(%rip)      # 0x21760
jmp 0x14ce3
movabsq $0x2500000001, %rax     # imm = 0x2500000001
movq %rax, (%rsp)
movl $0x2, 0x8(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xcac2(%rip), %rsi      # 0x21760
cmpq 0xcac3(%rip), %rsi      # 0x21768
je 0x14cb9
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rsi)
movaps (%rsp), %xmm0
jmp 0x14d80
leaq 0xca98(%rip), %rdi      # 0x21758
movq %rsp, %rdx
callq 0x166b0
jmp 0x14d8b
leaq 0xca84(%rip), %rdi      # 0x21758
movq %rsp, %rdx
callq 0x166b0
movq 0xca7d(%rip), %rsi      # 0x21760
movabsq $0x1200000002, %rax     # imm = 0x1200000002
movq %rax, 0x20(%rsp)
movl $0x3, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
cmpq 0xca5e(%rip), %rsi      # 0x21768
je 0x14d31
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsi)
movups 0x20(%rsp), %xmm0
movups %xmm0, (%rsi)
movq 0xca3c(%rip), %rsi      # 0x21760
addq $0x18, %rsi
movq %rsi, 0xca31(%rip)      # 0x21760
jmp 0x14d49
leaq 0xca20(%rip), %rdi      # 0x21758
leaq 0x20(%rsp), %rdx
callq 0x16538
movq 0xca17(%rip), %rsi      # 0x21760
movabsq $0x2500000002, %rax     # imm = 0x2500000002
movq %rax, 0x20(%rsp)
movl $0x1, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
cmpq 0xc9f8(%rip), %rsi      # 0x21768
je 0x14dec
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsi)
movups 0x20(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x18, 0xc9d5(%rip)     # 0x21760
movq 0xa0(%rsp), %rdi
cmpq %r14, %rdi
je 0x14da8
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x42d0
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x14dc3
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x42d0
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x14dde
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x42d0
addq $0xe8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc965(%rip), %rdi      # 0x21758
leaq 0x20(%rsp), %rdx
callq 0x16538
jmp 0x14d8b
leaq 0x38(%rsp), %rdi
callq 0x4813
jmp 0x14e0d
jmp 0x14e0d
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
cmpq %r14, %rdi
je 0x14e58
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0x14e58
movq %rax, %rbx
jmp 0x14e73
movq %rax, %rbx
movq 0x78(%rsp), %rdi
cmpq %r14, %rdi
je 0x14e8b
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0x14e8b
jmp 0x14e88
movq %rax, %rbx
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x14e73
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x42d0
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x14ea8
movq 0x68(%rsp), %rsi
jmp 0x14ea0
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
cmpq %r15, %rdi
je 0x14ea8
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x42d0
movq %rbx, %rdi
callq 0x44e0