// File: /workspace/github_cpp_makefile_star2_O2/Eronana[P]strawberry/src/assembler.cpp
// Function: load_asmfile(char const*)
bool load_asmfile(const char *filename)
{
    ifstream asms(filename);
    if(!asms)return false;
    string line;
    for(int lines=0;;)
    {
        int read_lines=get_asm_line(asms,line);
        if(read_lines<0)break;
        lines+=read_lines;
        int pos=line.find(' ');
        string oper=line.substr(0,pos);
        toUpperCase(oper);
        string opnd;
        if(pos!=string::npos)
        {
            opnd=line.substr(pos+1);
            if(opnd.length()&&opnd[0]!='\''&&opnd[0]!='"')toUpperCase(opnd);
        }
        if(opnd.empty()&&*oper.rbegin()==':')
        {
            string label=string(oper,0,oper.size()-1);
            labels[toUpperCase(label)]=s_code.size();
        }
        else
        {
            s_code.push_back({lines,oper,opnd});
        }
    }
    asms.close();
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2b8, %rsp            # imm = 0x2B8
movq %rdi, %rsi
leaq 0xb0(%rsp), %rbx
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0x6490
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0xd0(%rsp,%rax), %eax
testb $0x5, %al
jne 0x16859
movl %eax, 0x4(%rsp)
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
xorl %r14d, %r14d
leaq 0x48(%rsp), %r12
leaq 0x28(%rsp), %r13
leaq 0x68(%rsp), %rbx
leaq 0xb0(%rsp), %rdi
movq %r12, %rsi
callq 0x16164
movl %eax, %r15d
testl %eax, %eax
js 0x1683e
movq %r12, %rdi
pushq $0x20
popq %rsi
xorl %edx, %edx
callq 0x6330
movq %rax, %rbp
movslq %ebp, %rcx
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x6250
addl %r15d, %r14d
shlq $0x20, %rbp
movq %r13, %rdi
callq 0x1662b
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
andq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
cmpq %rax, %rbp
je 0x16789
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %rbp
sarq $0x20, %rbp
movq %rbx, %rdi
movq %r12, %rsi
movq %rbp, %rdx
pushq $-0x1
popq %rcx
callq 0x6250
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x62d0
movq %rbx, %rdi
callq 0x6130
cmpq $0x0, 0x10(%rsp)
je 0x16789
movq 0x8(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x22, %eax
je 0x167ec
cmpl $0x27, %eax
je 0x167ec
leaq 0x8(%rsp), %rdi
callq 0x1662b
cmpq $0x0, 0x10(%rsp)
jne 0x167ec
movq 0x28(%rsp), %rax
movq 0x30(%rsp), %rcx
cmpb $0x3a, -0x1(%rax,%rcx)
jne 0x167ec
decq %rcx
movq %rbx, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x6090
movq 0x192e7(%rip), %r15     # 0x2fa98
movq 0x192d8(%rip), %rbp     # 0x2fa90
movq %rbx, %rdi
callq 0x1662b
leaq 0x19179(%rip), %rdi     # 0x2f940
movq %rbx, %rsi
callq 0xc20a
movq %rax, %rcx
subq %rbp, %r15
movq %r15, %rax
cqto
pushq $0x48
popq %rsi
idivq %rsi
movl %eax, (%rcx)
movq %rbx, %rdi
callq 0x6130
jmp 0x16827
movl %r14d, 0x68(%rsp)
leaq 0x70(%rsp), %rdi
movq %r13, %rsi
callq 0x6340
leaq 0x90(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x6340
leaq 0x19279(%rip), %rdi     # 0x2fa90
movq %rbx, %rsi
callq 0x18058
movq %rbx, %rdi
callq 0x17088
leaq 0x8(%rsp), %rdi
callq 0x6130
movq %r13, %rdi
callq 0x6130
jmp 0x166b8
leaq 0xb0(%rsp), %rdi
callq 0x6080
leaq 0x48(%rsp), %rdi
callq 0x6130
movl 0x4(%rsp), %eax
testb $0x5, %al
sete %bl
leaq 0xb0(%rsp), %rdi
callq 0x60a0
movl %ebx, %eax
addq $0x2b8, %rsp            # imm = 0x2B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x168c8
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
jmp 0x16897
jmp 0x168ad
jmp 0x168ad
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x6130
jmp 0x168b0
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x17088
jmp 0x168b0
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x6130
leaq 0x28(%rsp), %rdi
callq 0x6130
jmp 0x168cb
jmp 0x168c8
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x6130
leaq 0xb0(%rsp), %rdi
callq 0x60a0
movq %rbx, %rdi
callq 0x6460