// File: reedoolang[P]reedoo/reedoo.cc
// Function: load_program(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
string load_program(string filename) {

  string filedata;

    ifstream rdfile(filename,ios::binary);
    /* We check to see whether or not we can open the file. This doesn't tell use whether
       the file exists because permissions could also prevent us being able to open the file. */
    if (!rdfile) {
      cout << IO_ERROR << "Unable to open the file \"" << filename << "\"." << endl;
      exit(0);
    }
    /* Loop through and grab each line of the file, then store each line in filedata. */
    for (std::string line; std::getline(rdfile, line); )
    {
        filedata += line;
        filedata += "\n";
    }

    /* Close the file when we're done. */
    rdfile.close();

    /* Return the data so that the rest of the program can use it. */
    return filedata;                       
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2a0, %rsp            # imm = 0x2A0
movq %rsi, -0x258(%rbp)
movq %rdi, -0x268(%rbp)
movq %rdi, %rax
movq %rax, -0x260(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
callq 0x33b0
movq -0x258(%rbp), %rsi
leaq -0x220(%rbp), %rdi
movl $0x4, %edx
callq 0x3420
jmp 0x432e
movq -0x220(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x220(%rbp,%rax), %rdi
callq 0x3180
movb %al, -0x269(%rbp)
jmp 0x434e
movb -0x269(%rbp), %al
testb $0x1, %al
jne 0x435d
jmp 0x4417
movq 0x13c64(%rip), %rdi     # 0x17fc8
leaq 0xecc9(%rip), %rsi      # 0x13034
callq 0x3290
movq %rax, -0x278(%rbp)
jmp 0x4379
movq -0x278(%rbp), %rdi
leaq 0xecb9(%rip), %rsi      # 0x13040
callq 0x3290
movq %rax, -0x280(%rbp)
jmp 0x4395
movq -0x258(%rbp), %rsi
movq -0x280(%rbp), %rdi
callq 0x3270
movq %rax, -0x288(%rbp)
jmp 0x43b1
movq -0x288(%rbp), %rdi
leaq 0xec9b(%rip), %rsi      # 0x1305a
callq 0x3290
movq %rax, -0x290(%rbp)
jmp 0x43cd
movq -0x290(%rbp), %rdi
movq 0x13bd5(%rip), %rsi     # 0x17fb0
callq 0x32e0
jmp 0x43e2
xorl %edi, %edi
callq 0x3340
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x4516
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x44ec
leaq -0x250(%rbp), %rdi
callq 0x33b0
leaq -0x220(%rbp), %rdi
leaq -0x250(%rbp), %rsi
callq 0x30a0
movq %rax, -0x298(%rbp)
jmp 0x443f
movq -0x298(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3370
movb %al, -0x299(%rbp)
jmp 0x445d
movb -0x299(%rbp), %al
testb $0x1, %al
jne 0x4497
jmp 0x4469
leaq -0x250(%rbp), %rdi
callq 0x31d0
jmp 0x44c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0x250(%rbp), %rdi
callq 0x31d0
jmp 0x44ec
movq -0x268(%rbp), %rdi
leaq -0x250(%rbp), %rsi
callq 0x3380
jmp 0x44ac
movq -0x268(%rbp), %rdi
leaq 0xeba3(%rip), %rsi      # 0x1305d
callq 0x3280
jmp 0x44c1
jmp 0x4423
leaq -0x220(%rbp), %rdi
callq 0x30b0
jmp 0x44d4
movb $0x1, -0x11(%rbp)
leaq -0x220(%rbp), %rdi
callq 0x30d0
testb $0x1, -0x11(%rbp)
jne 0x4506
jmp 0x44fa
leaq -0x220(%rbp), %rdi
callq 0x30d0
jmp 0x4516
movq -0x268(%rbp), %rdi
callq 0x31d0
movq -0x260(%rbp), %rax
addq $0x2a0, %rsp            # imm = 0x2A0
popq %rbp
retq
movq -0x268(%rbp), %rdi
callq 0x31d0
movq -0x228(%rbp), %rdi
callq 0x3460
nop