// File: 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
subq $0x190, %rsp            # imm = 0x190
movq %rdi, %rsi
movq %rsi, -0x10(%rbp)
leaq -0x50(%rbp), %rdi
movq %rdi, -0x158(%rbp)
callq 0x4190
movq -0x158(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0xb080
jmp 0xcf24
leaq -0x50(%rbp), %rdi
callq 0x4200
leaq 0x729c(%rip), %rsi      # 0x141d0
leaq -0x30(%rbp), %rdi
callq 0x9ea0
movb %al, -0x159(%rbp)
jmp 0xcf45
movb -0x159(%rbp), %al
testb $0x1, %al
jne 0xcf51
jmp 0xcf8e
movb $0x0, -0x1(%rbp)
movl $0x1, -0x60(%rbp)
jmp 0xd25c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x4200
jmp 0xcf78
jmp 0xd280
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xd273
leaq -0xa0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x4190
jmp 0xcfa0
leaq -0xc1(%rbp), %rdi
movq %rdi, -0x168(%rbp)
callq 0x45f0
movq -0x168(%rbp), %rdx
leaq 0x726c(%rip), %rsi      # 0x1422d
leaq -0xc0(%rbp), %rdi
callq 0x4490
jmp 0xcfcf
leaq -0x80(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0xc0(%rbp), %rdx
callq 0xb480
jmp 0xcfe8
leaq -0xc0(%rbp), %rdi
callq 0x4200
jmp 0xcff6
leaq -0xc1(%rbp), %rdi
callq 0x4400
leaq -0xa0(%rbp), %rdi
callq 0x4200
jmp 0xd010
movl $0x0, -0xc8(%rbp)
movslq -0xc8(%rbp), %rax
movq %rax, -0x178(%rbp)
leaq -0x80(%rbp), %rdi
callq 0xaa90
movq %rax, -0x170(%rbp)
jmp 0xd03a
movq -0x178(%rbp), %rax
movq -0x170(%rbp), %rcx
cmpq %rcx, %rax
jae 0xd237
movslq -0xc8(%rbp), %rdx
leaq -0xe8(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0xaab0
jmp 0xd06a
movl -0xc8(%rbp), %eax
incl %eax
movslq %eax, %rdx
leaq -0x128(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0xaab0
jmp 0xd087
leaq -0x149(%rbp), %rdi
movq %rdi, -0x180(%rbp)
callq 0x45f0
movq -0x180(%rbp), %rdx
leaq 0x7133(%rip), %rsi      # 0x141db
leaq -0x148(%rbp), %rdi
callq 0x4490
jmp 0xd0b6
leaq -0x108(%rbp), %rdi
leaq -0x128(%rbp), %rsi
leaq -0x148(%rbp), %rdx
callq 0xb970
jmp 0xd0d2
leaq -0x148(%rbp), %rdi
callq 0x4200
jmp 0xd0e0
leaq -0x149(%rbp), %rdi
callq 0x4400
leaq -0x128(%rbp), %rdi
callq 0x4200
jmp 0xd0fa
leaq 0xe267(%rip), %rdi      # 0x1b368
leaq -0xe8(%rbp), %rsi
callq 0xd3b0
movq %rax, -0x188(%rbp)
jmp 0xd116
movq -0x188(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x4060
jmp 0xd12b
leaq -0x108(%rbp), %rdi
callq 0x4200
jmp 0xd139
leaq -0xe8(%rbp), %rdi
callq 0x4200
jmp 0xd147
jmp 0xd149
movl -0xc8(%rbp), %eax
addl $0x2, %eax
movl %eax, -0xc8(%rbp)
jmp 0xd01a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xd187
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x4200
jmp 0xd185
jmp 0xd187
leaq -0xc1(%rbp), %rdi
callq 0x4400
leaq -0xa0(%rbp), %rdi
callq 0x4200
jmp 0xd1a1
jmp 0xd273
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xd24f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xd227
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xd1ef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x4200
jmp 0xd1ed
jmp 0xd1ef
leaq -0x149(%rbp), %rdi
callq 0x4400
leaq -0x128(%rbp), %rdi
callq 0x4200
jmp 0xd209
jmp 0xd227
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x4200
jmp 0xd225
jmp 0xd227
leaq -0xe8(%rbp), %rdi
callq 0x4200
jmp 0xd235
jmp 0xd24f
movb $0x1, -0x1(%rbp)
movl $0x1, -0x60(%rbp)
leaq -0x80(%rbp), %rdi
callq 0xaaf0
jmp 0xd24d
jmp 0xd25c
leaq -0x80(%rbp), %rdi
callq 0xaaf0
jmp 0xd25a
jmp 0xd273
leaq -0x30(%rbp), %rdi
callq 0x4200
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x4200
jmp 0xd27e
jmp 0xd280
movq -0x58(%rbp), %rdi
callq 0x45e0
movq %rax, %rdi
callq 0x4ec0
nopw %cs:(%rax,%rax)