// File: /workspace/github_cpp_makefile_star2_O3/Jacobious52[P]Tanks/TextureTools.cpp
// Function: TextureTools::load_texture_file(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool TextureTools::load_texture_file(std::string filename)
{
    std::string text = StringTools::readall(filename);

    if (text == "$NO FILE")
    {
        return false;
    }

    // put file into map by spliting at "
    vstring textures = StringTools::tokens(text, "\"");

    for (int i = 0; i < textures.get_count(); i+=2)
    {
        std::string key = textures[i];
        std::string texture = StringTools::trim(textures[i + 1], "\n");

        _texture_map[key] = texture;
    }

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
leaq -0x140(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%rdi), %rsi
movq 0x8(%rdi), %rdx
addq %rsi, %rdx
leaq -0x150(%rbp), %rbx
movq %rbx, %rdi
callq 0x3b60
leaq -0xd0(%rbp), %rdi
movq %rbx, %rsi
callq 0x6ed2
movq -0x150(%rbp), %rdi
cmpq %r14, %rdi
je 0x81b2
callq 0x3230
leaq 0x4031(%rip), %rsi      # 0xc1ea
leaq -0xd0(%rbp), %rdi
callq 0x30f0
movl %eax, %ebx
testl %eax, %eax
je 0x83aa
leaq -0x120(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0xd0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x130(%rbp), %rdi
callq 0x3b60
leaq -0x100(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x404c(%rip), %rsi      # 0xc255
leaq 0x4046(%rip), %rdx      # 0xc256
leaq -0x110(%rbp), %rdi
callq 0x574e
leaq -0x70(%rbp), %rdi
leaq -0x130(%rbp), %rsi
leaq -0x110(%rbp), %rdx
callq 0x7132
movl %ebx, -0x2c(%rbp)
movq -0x110(%rbp), %rdi
cmpq %r15, %rdi
je 0x8247
callq 0x3230
movq -0x130(%rbp), %rdi
cmpq %r14, %rdi
je 0x8258
callq 0x3230
cmpq $0x0, -0x68(%rbp)
je 0x839e
movl $0x1, %r13d
xorl %r15d, %r15d
leaq -0xb0(%rbp), %r14
leaq -0x90(%rbp), %rbx
leaq -0xf0(%rbp), %r12
movq -0x70(%rbp), %rax
leaq -0xa0(%rbp), %rcx
movq %rcx, -0xb0(%rbp)
movq (%rax,%r15), %rsi
movq 0x8(%rax,%r15), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x3b60
cmpq %r13, -0x68(%rbp)
jbe 0x82d1
movq -0x70(%rbp), %rax
leaq -0x40(%rbp), %rcx
movq %rcx, -0x50(%rbp)
movq 0x20(%rax,%r15), %rsi
movq 0x28(%rax,%r15), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %rdi
callq 0x3b60
jmp 0x82e5
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
movb $0x0, -0x40(%rbp)
leaq -0x80(%rbp), %rax
movq %rax, -0x90(%rbp)
movq %rbx, %rdi
leaq 0x3efb(%rip), %rsi      # 0xc1f5
leaq 0x3ef5(%rip), %rdx      # 0xc1f6
callq 0x574e
movq %r12, %rdi
leaq -0x50(%rbp), %rsi
movq %rbx, %rdx
callq 0x744c
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x832a
callq 0x3230
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x833c
callq 0x3230
leaq 0x8f35(%rip), %rdi      # 0x11278
movq %r14, %rsi
callq 0x853c
movq %rax, %rdi
movq %r12, %rsi
callq 0x3140
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0x836e
callq 0x3230
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x8386
callq 0x3230
addq $0x40, %r15
leaq 0x2(%r13), %rax
incq %r13
cmpq %r13, -0x68(%rbp)
movq %rax, %r13
ja 0x8281
leaq -0x70(%rbp), %rdi
callq 0x6b34
movl -0x2c(%rbp), %ebx
leaq -0xc0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x83bf
callq 0x3230
testl %ebx, %ebx
setne %al
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x110(%rbp), %rdi
cmpq %r15, %rdi
je 0x83ef
callq 0x3230
jmp 0x83ef
movq %rax, %rbx
movq -0x130(%rbp), %rdi
cmpq %r14, %rdi
je 0x8495
callq 0x3230
jmp 0x8495
jmp 0x8423
movq %rax, %rbx
movq -0x150(%rbp), %rdi
cmpq %r14, %rdi
jne 0x84a5
jmp 0x84aa
movq %rax, %rbx
jmp 0x8495
movq %rax, %rbx
jmp 0x8474
movq %rax, %rbx
jmp 0x848c
movq %rax, %rbx
jmp 0x844f
movq %rax, %rbx
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x844f
callq 0x3230
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
jmp 0x846a
movq %rax, %rbx
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0x8474
callq 0x3230
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x848c
callq 0x3230
leaq -0x70(%rbp), %rdi
callq 0x6b34
leaq -0xc0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x84aa
callq 0x3230
movq %rbx, %rdi
callq 0x3430
movq %rax, %rdi
callq 0x3ac6