// File: /workspace/github_cpp_makefile_star2_O1/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 0x3b70
leaq -0xd0(%rbp), %rdi
movq %rbx, %rsi
callq 0x6ed2
movq -0x150(%rbp), %rdi
cmpq %r14, %rdi
je 0x81a2
callq 0x3240
leaq 0x4041(%rip), %rsi      # 0xc1ea
leaq -0xd0(%rbp), %rdi
callq 0x30f0
movl %eax, %ebx
testl %eax, %eax
je 0x839a
leaq -0x120(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0xd0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x130(%rbp), %rdi
callq 0x3b70
leaq -0x100(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x4064(%rip), %rsi      # 0xc25d
leaq 0x405e(%rip), %rdx      # 0xc25e
leaq -0x110(%rbp), %rdi
callq 0x5744
leaq -0x70(%rbp), %rdi
leaq -0x130(%rbp), %rsi
leaq -0x110(%rbp), %rdx
callq 0x7126
movl %ebx, -0x2c(%rbp)
movq -0x110(%rbp), %rdi
cmpq %r15, %rdi
je 0x8237
callq 0x3240
movq -0x130(%rbp), %rdi
cmpq %r14, %rdi
je 0x8248
callq 0x3240
cmpq $0x0, -0x68(%rbp)
je 0x838e
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 0x3b70
cmpq %r13, -0x68(%rbp)
jbe 0x82c1
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 0x3b70
jmp 0x82d5
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 0x3f0b(%rip), %rsi      # 0xc1f5
leaq 0x3f05(%rip), %rdx      # 0xc1f6
callq 0x5744
movq %r12, %rdi
leaq -0x50(%rbp), %rsi
movq %rbx, %rdx
callq 0x7440
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x831a
callq 0x3240
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x832c
callq 0x3240
leaq 0x8f4d(%rip), %rdi      # 0x11280
movq %r14, %rsi
callq 0x852c
movq %rax, %rdi
movq %r12, %rsi
callq 0x3140
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0x835e
callq 0x3240
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x8376
callq 0x3240
addq $0x40, %r15
leaq 0x2(%r13), %rax
incq %r13
cmpq %r13, -0x68(%rbp)
movq %rax, %r13
ja 0x8271
leaq -0x70(%rbp), %rdi
callq 0x6b32
movl -0x2c(%rbp), %ebx
leaq -0xc0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x83af
callq 0x3240
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 0x83df
callq 0x3240
jmp 0x83df
movq %rax, %rbx
movq -0x130(%rbp), %rdi
cmpq %r14, %rdi
je 0x8485
callq 0x3240
jmp 0x8485
jmp 0x8413
movq %rax, %rbx
movq -0x150(%rbp), %rdi
cmpq %r14, %rdi
jne 0x8495
jmp 0x849a
movq %rax, %rbx
jmp 0x8485
movq %rax, %rbx
jmp 0x8464
movq %rax, %rbx
jmp 0x847c
movq %rax, %rbx
jmp 0x843f
movq %rax, %rbx
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x843f
callq 0x3240
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
jmp 0x845a
movq %rax, %rbx
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0x8464
callq 0x3240
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x847c
callq 0x3240
leaq -0x70(%rbp), %rdi
callq 0x6b32
leaq -0xc0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x849a
callq 0x3240
movq %rbx, %rdi
callq 0x3440
movq %rax, %rdi
callq 0x3ad6