LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/jansucan[P]diff-dd/src/buffered_stream.cpp
// Function: BufferedStream::Reader::read_current_buffer(unsigned long)
DataPart
Reader::read_current_buffer(size_t data_size)
{
    DataPart dp;

    // Set data
    if (m_buffer_offset == 0) {
        dp.data = std::shared_ptr<char[]>{m_buffers[m_buffer_index]};
    } else {
        dp.data = std::shared_ptr<char[]>{
            m_buffers[m_buffer_index],
            static_cast<char *>(m_buffers[m_buffer_index].get()) +
                m_buffer_offset};
    }

    const size_t size_left{m_buffer_size - m_buffer_offset};
    dp.size = std::min(data_size, size_left);
    m_buffer_offset += dp.size;
    return dp;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rdi), %r12
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movq 0x40(%rsi), %rax
testq %rax, %rax
je 0x3a37
movq 0x20(%rbx), %rcx
movq 0x38(%rbx), %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rsi
addq $0x8, %rsi
addq -0x8(%rsi), %rax
leaq 0x8(%rsp), %r13
movq %rax, -0x8(%r13)
movq %r13, %rdi
callq 0x3fa2
movq %rsp, %rsi
movq %r12, %rdi
callq 0x42fe
movq %r13, %rdi
jmp 0x3a5e
movq 0x38(%rbx), %rsi
shlq $0x4, %rsi
addq 0x20(%rbx), %rsi
movq %rsp, %r13
movq %r13, %rdi
callq 0x3f8e
movq %r12, %rdi
movq %r13, %rsi
callq 0x42fe
leaq 0x8(%rsp), %rdi
callq 0x3ed0
movq 0x40(%rbx), %rax
movq 0x48(%rbx), %rcx
subq %rax, %rcx
cmpq %r15, %rcx
cmovaeq %r15, %rcx
movq %rcx, (%r14)
addq %rax, %rcx
movq %rcx, 0x40(%rbx)
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/jansucan[P]diff-dd/src/buffered_stream.cpp
// Function: BufferedStream::Reader::read_stream(std::shared_ptr<char []>, unsigned long)
size_t
Reader::read_stream(std::shared_ptr<char[]> data, size_t data_size)
{
    m_istream.read(data.get(), data_size);

    if (!m_istream.good() && !m_istream.eof()) {
        throw Error("cannot read from stream");
    }

    return m_istream.gcount();
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq (%rsi), %rsi
callq 0x3290
movq 0x18(%rbx), %rax
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x20(%rax,%rcx), %ecx
testl %ecx, %ecx
sete %dl
andl $0x2, %ecx
shrl %ecx
orb %dl, %cl
je 0x3ad1
movq 0x8(%rax), %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x3130
movq %rax, %rbx
leaq 0x4655(%rip), %rsi      # 0x8138
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x3e0e
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x3e4a
xorl %ebp, %ebp
leaq 0x9025(%rip), %rsi      # 0xcb30
movq 0x949e(%rip), %rdx      # 0xcfb0
movq %rbx, %rdi
callq 0x3330
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x3398
testb %bpl, %bpl
jne 0x3b31
jmp 0x3b39
movq %rax, %r14
movq %rbx, %rdi
callq 0x3180
movq %r14, %rdi
callq 0x3340
nop
// File: /workspace/github_cpp_makefile_star2_O2/jansucan[P]diff-dd/src/buffered_stream.cpp
// Function: BufferedStream::Writer::Writer(std::ostream&, unsigned long)
Writer::Writer(std::ostream &ostream, size_t buffer_capacity)
    : m_ostream(ostream), m_buffer_size(0), m_buffer_capacity(buffer_capacity)
{
    try {
        m_buffer = std::make_unique<char[]>(m_buffer_capacity);
    } catch (const std::bad_alloc &e) {
        throw Error("cannot allocate buffer for output stream data");
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
leaq 0x9002(%rip), %rax      # 0xcb58
movq %rax, (%rdi)
movq %rsi, 0x8(%rdi)
leaq 0x10(%rdi), %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movq %rdx, 0x20(%rdi)
movq %rdx, %rdi
callq 0x3030
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x3150
leaq 0x8(%rsp), %r14
andq $0x0, (%r14)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3fc2
movq %r14, %rdi
callq 0x3e8c
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
cmpl $0x1, %edx
jne 0x3c28
movq %r15, %rdi
callq 0x30e0
pushq $0x10
popq %rdi
callq 0x3130
movq %rax, %r14
leaq 0x4583(%rip), %rsi      # 0x8150
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x3e0e
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x3e4a
xorl %ebp, %ebp
leaq 0x8f3b(%rip), %rsi      # 0xcb30
movq 0x93b4(%rip), %rdx      # 0xcfb0
movq %r14, %rdi
callq 0x3330
movq %rax, %r15
leaq 0x8(%rsp), %rdi
callq 0x3398
testb %bpl, %bpl
jne 0x3c1b
jmp 0x3c23
movq %rax, %r15
movq %r14, %rdi
callq 0x3180
callq 0x3320
movq %rbx, %rdi
callq 0x3e8c
movq %r15, %rdi
callq 0x3340
movq %rax, %rdi
callq 0x3e5f
// File: /workspace/github_cpp_makefile_star2_O2/jansucan[P]diff-dd/src/buffered_stream.cpp
// Function: BufferedStream::Writer::write(char const*, unsigned long)
void
Writer::write(const char *data, size_t data_size)
{
    size_t free{m_buffer_capacity - m_buffer_size};
    if (data_size <= free) {
        // There is free space in the buffer
        write_buffer(data, data_size);
    } else {
        // No free space
        flush_buffer();
        if (data_size <= m_buffer_capacity) {
            // Data fits into the buffer
            write_buffer(data, data_size);
        } else {
            // Doesn't fit
            write_stream(data, data_size);
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x18(%rdi), %rdi
movq 0x20(%r14), %rax
subq %rdi, %rax
cmpq %rdx, %rax
jae 0x3cd5
movq %r14, %rdi
callq 0x3c68
cmpq %rbx, 0x20(%r14)
jae 0x3cdb
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x3d1c
addq 0x10(%r14), %rdi
jmp 0x3ce3
movq 0x10(%r14), %rdi
addq 0x18(%r14), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x31b0
addq %rbx, 0x18(%r14)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/jansucan[P]diff-dd/src/./format_v2.h
// Function: FormatV2::Writer::writeDiffRecord(unsigned long, unsigned long, std::vector<FormatV2::RecordData, std::allocator<FormatV2::RecordData>>)
void writeDiffRecord(
        uint64_t offset, size_t size,
        std::vector<RecordData> data) // cppcheck-suppress passedByValue
    {
        writeOffset(offset);
        writeSize(size);
        for (auto it = data.begin(); it != data.end(); ++it) {
            writeData(*it);
        }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movq %rdi, %r14
callq 0x559e
movq %r14, %rdi
movq %r15, %rsi
callq 0x55b6
movq (%rbx), %r12
leaq 0x18(%rsp), %r15
leaq 0x8(%rsp), %r13
cmpq 0x8(%rbx), %r12
je 0x4e47
movq %r13, %rdi
movq %r12, %rsi
callq 0x55da
movq %r14, %rdi
movq %r13, %rsi
callq 0x55ce
movq %r15, %rdi
callq 0x3ed0
addq $0x18, %r12
jmp 0x4e1d
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %r15, %rdi
callq 0x3ed0
movq %rbx, %rdi
callq 0x3340
// File: /workspace/github_cpp_makefile_star2_O2/jansucan[P]diff-dd/src/create.cpp
// Function: PagedStreamReader::getNextPage()
Page getNextPage()
    {
        const BufferedStream::DataPart dp{
            m_reader.readMultipart(m_page_size_bytes)};

        m_stream_pos_bytes += dp.size;

        return Page{dp.data, m_stream_pos_bytes - dp.size, m_stream_pos_bytes};
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
addq $0x8, %rsi
movq (%r14), %rdx
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x3966
movq (%r15), %rax
addq %rax, 0x58(%r14)
leaq 0x18(%rsp), %r15
movq %rsp, %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x3f8e
movq 0x58(%r14), %rcx
movq %rcx, %rdx
subq -0x8(%r15), %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5468
leaq 0x8(%rsp), %rdi
callq 0x3ed0
leaq 0x20(%rsp), %rdi
callq 0x3ed0
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/jansucan[P]diff-dd/src/main.cpp
// Function: main
int
main(int argc, char **argv)
{
    try {
        if (Options::Parser::isHelp(argc, argv)) {
            Options::printUsage();
        } else if (Options::Parser::isVersion(argc, argv)) {
            print_version();
        } else if (Options::Parser::isCreate(argc, argv)) {
            create(Options::Parser::parseCreate(argc, argv));
        } else if (Options::Parser::isRestore(argc, argv)) {
            restore(Options::Parser::parseRestore(argc, argv));
        } else {
            Options::printUsage();
            exit(1);
        }
    } catch (const Options::Error &e) {
        Options::printUsage();
        std::cerr << "ERROR: " << e.what() << std::endl;
        exit(1);
    } catch (const DiffddError &e) {
        std::cerr << "ERROR: " << e.what() << std::endl;
        exit(1);
    }

    exit(0);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rsi, %rbx
movl %edi, %ebp
callq 0x5c1a
testb %al, %al
je 0x58e0
callq 0x5a78
xorl %edi, %edi
callq 0x3260
movl %ebp, %edi
movq %rbx, %rsi
callq 0x5c48
testb %al, %al
je 0x58f5
callq 0x5880
jmp 0x58d9
movl %ebp, %edi
movq %rbx, %rsi
callq 0x5c54
testb %al, %al
je 0x5922
movq %rsp, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x5c6c
movq %rsp, %rdi
callq 0x455d
movq %rsp, %rdi
callq 0x5a3a
jmp 0x58d9
movl %ebp, %edi
movq %rbx, %rsi
callq 0x5c60
testb %al, %al
je 0x594f
movq %rsp, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x6192
movq %rsp, %rdi
callq 0x67e0
movq %rsp, %rdi
callq 0x5a5e
jmp 0x58d9
callq 0x5a78
jmp 0x5a10
movq %rdx, %r14
movq %rax, %rbx
movq %rsp, %rdi
callq 0x5a5e
jmp 0x5983
jmp 0x597d
movq %rdx, %r14
movq %rax, %rbx
movq %rsp, %rdi
callq 0x5a3a
jmp 0x5983
jmp 0x597d
movq %rdx, %r14
movq %rax, %rbx
cmpl $0x2, %r14d
jne 0x59cd
movq %rbx, %rdi
callq 0x30e0
movq %rax, %rbx
callq 0x5a78
movq 0x7650(%rip), %rdi      # 0xcff0
leaq 0x2dc9(%rip), %rsi      # 0x8770
callq 0x31f0
movq %rax, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x31f0
movq %rax, %rdi
callq 0x3120
jmp 0x5a10
cmpl $0x1, %r14d
jne 0x5a2a
movq %rbx, %rdi
callq 0x30e0
movq %rax, %rbx
movq 0x760b(%rip), %rdi      # 0xcff0
leaq 0x2d84(%rip), %rsi      # 0x8770
callq 0x31f0
movq %rax, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x31f0
movq %rax, %rdi
callq 0x3120
pushq $0x1
popq %rdi
callq 0x3260
movq %rax, %rbx
callq 0x3320
jmp 0x5a2a
movq %rax, %rbx
callq 0x3320
movq %rbx, %rdi
callq 0x3340
movq %rax, %rdi
callq 0x3e5f
// File: /workspace/github_cpp_makefile_star2_O2/jansucan[P]diff-dd/src/options.cpp
// Function: Options::printUsage()
void
printUsage()
{
    std::cout << "Usage: " << PROGRAM_NAME_STR << " create";
    std::cout << " [-B BUFFER_SIZE] -i INFILE -b BASEFILE -o OUTFILE"
              << std::endl;

    std::cout << "   Or: " << PROGRAM_NAME_STR << " restore";
    std::cout << " [-B BUFFER_SIZE] -d DIFFFILE -o OUTFILE" << std::endl;

    std::cout << "   Or: " << PROGRAM_NAME_STR << " version" << std::endl;

    std::cout << "   Or: " << PROGRAM_NAME_STR << " help" << std::endl;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x7544(%rip), %rbx      # 0xcfc8
leaq 0x2cfe(%rip), %rsi      # 0x8789
movq %rbx, %rdi
callq 0x31f0
leaq 0x77de(%rip), %r14      # 0xd278
movq %rax, %rdi
movq %r14, %rsi
callq 0x31d0
leaq 0x2ce5(%rip), %rsi      # 0x8791
movq %rax, %rdi
callq 0x31f0
leaq 0x2cde(%rip), %rsi      # 0x8799
movq %rbx, %rdi
callq 0x31f0
movq %rax, %rdi
callq 0x3120
leaq 0x2cfa(%rip), %r15      # 0x87cc
movq %rbx, %rdi
movq %r15, %rsi
callq 0x31f0
movq %rax, %rdi
movq %r14, %rsi
callq 0x31d0
leaq 0x2ce5(%rip), %rsi      # 0x87d4
movq %rax, %rdi
callq 0x31f0
leaq 0x2cdf(%rip), %rsi      # 0x87dd
movq %rbx, %rdi
callq 0x31f0
movq %rax, %rdi
callq 0x3120
movq %rbx, %rdi
movq %r15, %rsi
callq 0x31f0
movq %rax, %rdi
movq %r14, %rsi
callq 0x31d0
leaq 0x2e7b(%rip), %rsi      # 0x89a6
movq %rax, %rdi
callq 0x31f0
movq %rax, %rdi
callq 0x3120
movq %rbx, %rdi
movq %r15, %rsi
callq 0x31f0
movq %rax, %rdi
movq %r14, %rsi
callq 0x31d0
leaq 0x2cae(%rip), %rsi      # 0x8806
movq %rax, %rdi
callq 0x31f0
movq %rax, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x3120
nop
// File: /workspace/github_cpp_makefile_star2_O2/jansucan[P]diff-dd/src/options.cpp
// Function: Options::Parser::parseUnsigned(char const*, unsigned int*)
int
Parser::parseUnsigned(const char *const arg, uint32_t *const value)
{
    char *end;

    errno = 0;

    *value = strtoul(arg, &end, 0);

    return ((*end != '\0') || (errno != 0)) ? -1 : 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r15
movq %rdi, %r12
callq 0x3040
movq %rax, %r14
andl $0x0, (%rax)
leaq 0x8(%rsp), %r13
xorl %ebx, %ebx
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x30c0
movl %eax, (%r15)
movq (%r13), %rax
cmpb $0x0, (%rax)
je 0x617d
pushq $-0x1
popq %rbx
jmp 0x6182
cmpl (%r14), %ebx
sbbl %ebx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/jansucan[P]diff-dd/src/./format_v2.h
// Function: FormatV2::Reader::readOffset()
uint64_t readOffset()
    {
        uint64_t raw_offset;
        const size_t r{m_reader.read(sizeof(raw_offset),
                                     reinterpret_cast<char *>(&raw_offset))};
        if (r != sizeof(raw_offset)) {
            m_eof = true;
        }
        return be64toh(raw_offset);
    }

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
pushq $0x8
popq %rsi
leaq 0x8(%rsp), %rdx
callq 0x38c0
cmpq $0x8, %rax
je 0x6c7b
movb $0x1, 0x50(%rbx)
movq 0x8(%rsp), %rax
bswapq %rax
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/jansucan[P]diff-dd/src/./format_v2.h
// Function: FormatV2::Reader::readSize()
size_t readSize()
    {
        uint32_t raw_size;
        const size_t r{m_reader.read(sizeof(raw_size),
                                     reinterpret_cast<char *>(&raw_size))};
        if (r != sizeof(raw_size)) {
            m_eof = true;
        }
        return be32toh(raw_size);
    }

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
pushq $0x4
popq %rsi
leaq 0xc(%rsp), %rdx
callq 0x38c0
cmpq $0x4, %rax
je 0x6ca9
movb $0x1, 0x50(%rbx)
movl 0xc(%rsp), %eax
bswapl %eax
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/jansucan[P]diff-dd/src/./format_v2.h
// Function: FormatV2::Reader::readRecordData(unsigned long)
RecordData readRecordData(size_t size)
    {
        const BufferedStream::DataPart dp = m_reader.readMultipart(size);
        return RecordData{
            .size = dp.size,
            .data = dp.data,
        };
    }

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rdi
callq 0x3966
movq (%r14), %rax
movq %rax, (%rbx)
movq %rbx, %rdi
addq $0x8, %rdi
leaq 0x8(%rsp), %rsi
callq 0x3f8e
leaq 0x10(%rsp), %rdi
callq 0x3ed0
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/jasmeet13n[P]HTTP-Proxy-Server-Client/client.cpp
// Function: get_http_request(char*)
char *get_http_request(char *url){
	int len = strlen(url);
	char *output = (char *)malloc((len+50)*sizeof(char));
	int i=0, k=4;
	output[0]='G';output[1]='E';output[2]='T';output[3]=' ';
	if(len>7){
		if(url[0]=='h' && url[1]=='t' && url[2]=='t' && url[3]=='p' && url[4]==':' && url[5]=='/' && url[6]=='/')
			i = 7;
	}
	int tmp = i;								// Seperate the URL into file name and host name
	while(i<len && url[tmp]!='/')
		tmp++;
	output[k++]='/';
	tmp++;
	while(tmp<len)
		output[k++]=url[tmp++];
	output[k++]=' ';output[k++]='H';output[k++]='T';output[k++]='T';output[k++]='P';output[k++]='/';
	output[k++]='1';output[k++]='.';output[k++]='0';output[k++]='\r';output[k++]='\n';
	output[k++]='H';output[k++]='o';output[k++]='s';output[k++]='t';output[k++]=':';output[k++]=' ';
	while(i<len && url[i]!='/')
		output[k++] = url[i++];
	output[k++]='\r';output[k++]='\n';output[k++]='\r';output[k++]='\n';output[k]='\0';
	return output;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x2080
movq %rax, %r14
addl $0x32, %eax
movslq %eax, %rdi
callq 0x2190
movl $0x20544547, (%rax)     # imm = 0x20544547
xorl %ecx, %ecx
cmpl $0x8, %r14d
jl 0x2444
cmpb $0x68, (%rbx)
jne 0x2444
cmpb $0x74, 0x1(%rbx)
jne 0x2444
cmpb $0x74, 0x2(%rbx)
jne 0x2444
cmpb $0x70, 0x3(%rbx)
jne 0x2444
cmpb $0x3a, 0x4(%rbx)
jne 0x2444
cmpb $0x2f, 0x5(%rbx)
jne 0x2444
xorl %edx, %edx
cmpb $0x2f, 0x6(%rbx)
pushq $0x7
popq %rcx
cmovnel %edx, %ecx
movl %ecx, %ecx
movq %rcx, %rsi
cmpl %r14d, %ecx
jge 0x2459
cmpb $0x2f, (%rbx,%rsi)
je 0x2459
incq %rsi
jmp 0x2449
movb $0x2f, 0x4(%rax)
leaq (%rbx,%rsi), %rdi
pushq $0x16
popq %rdx
leal (%rsi,%rdx), %r8d
addl $-0x15, %r8d
cmpl %r14d, %r8d
jge 0x2480
movb -0x15(%rdi,%rdx), %r8b
movb %r8b, -0x11(%rax,%rdx)
incq %rdx
jmp 0x2464
leal -0x11(%rdx), %esi
movaps 0xb86(%rip), %xmm0      # 0x3010
movups %xmm0, (%rax,%rsi)
movb $0x20, 0x10(%rax,%rsi)
movslq %r14d, %rsi
cmpq %rsi, %rcx
jge 0x24b1
movb (%rbx,%rcx), %dil
cmpb $0x2f, %dil
je 0x24b1
incq %rcx
movb %dil, (%rax,%rdx)
incq %rdx
jmp 0x2496
movl %edx, %ecx
movl $0xa0d0a0d, (%rax,%rcx) # imm = 0xA0D0A0D
movb $0x0, 0x4(%rax,%rcx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jasmeet13n[P]HTTP-Proxy-Server-Client/client.cpp
// Function: get_filename(char*)
char *get_filename(char *qq){
	char *name = (char *)malloc(512*sizeof(char));
	int k=0;
	int last = 0;
	int i=0;
	int len = strlen(qq);
	while(i < len){
		if(qq[i]=='/')
			last = i;
		i++;
	}
	if(last!=0){
		memcpy(name,&qq[last+1],(len-last-1));
		name[len-last]='\0';
	}
	if(strlen(name)==0){
		name[k++]='i';name[k++]='n';name[k++]='d';name[k++]='e';name[k++]='x';name[k++]='.';		// if filename cannot be extracted, set default name to index.html
		name[k++]='h';name[k++]='t';name[k++]='m';name[k++]='l';name[k]='\0';
		return name;
	}
	return name;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r15
movl $0x200, %edi            # imm = 0x200
callq 0x2190
movq %rax, %rbx
movq %r15, %rdi
callq 0x2080
movq %rax, %r14
xorl %ecx, %ecx
testl %r14d, %r14d
movl $0x0, %edx
cmovgl %r14d, %edx
xorl %eax, %eax
cmpq %rcx, %rdx
je 0x250b
cmpb $0x2f, (%r15,%rcx)
cmovel %ecx, %eax
incq %rcx
jmp 0x24f9
testl %eax, %eax
je 0x2537
movslq %eax, %rcx
leaq (%r15,%rcx), %rsi
incq %rsi
subl %eax, %r14d
leal -0x1(%r14), %eax
movslq %eax, %rdx
movq %rbx, %rdi
callq 0x20f0
movslq %r14d, %rax
movb $0x0, (%rbx,%rax)
cmpb $0x0, (%rbx)
jne 0x254e
movabsq $0x74682e7865646e69, %rax # imm = 0x74682E7865646E69
movq %rax, (%rbx)
movw $0x6c6d, 0x8(%rbx)      # imm = 0x6C6D
movb $0x0, 0xa(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tlaloc1313[P]chess-project/draw.cpp
// Function: drawMoves(Board*)
void drawMoves(Board* gameBoard){
  cout<< "Moves: \n";

  //Loops from start to current point in game.
  for (int i = 0; i < gameBoard->getMoveNumber(); i++){
    if (i%2 == 0) {
      cout << (i/2)+1 << ". ";
    }

    cout << gameBoard->getPastPiece(i) << gameBoard->getPastSquare(i) << "  ";
  }
  cout << std::endl << std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x6565(%rip), %r14      # 0x8fd0
leaq 0x37a2(%rip), %rsi      # 0x6214
movq %r14, %rdi
callq 0x20f0
xorl %r15d, %r15d
leaq -0x48(%rbp), %r13
movq %rbx, %rdi
callq 0x3d04
cmpl %eax, %r15d
jge 0x2b00
testb $0x1, %r15b
jne 0x2ab2
movl %r15d, %esi
shrl %esi
incl %esi
movq %r14, %rdi
callq 0x21a0
movq %rax, %rdi
leaq 0x36e4(%rip), %rsi      # 0x6191
callq 0x20f0
movq %rbx, %rdi
movl %r15d, %esi
callq 0x3bf0
movq %r14, %rdi
movq %rax, %rsi
callq 0x20f0
movq %rax, %r12
movq %r13, %rdi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x3cde
movq %r12, %rdi
movq %r13, %rsi
callq 0x20d0
movq %rax, %rdi
leaq 0x372f(%rip), %rsi      # 0x621d
callq 0x20f0
movq %r13, %rdi
callq 0x2080
incl %r15d
jmp 0x2a81
movq 0x64c9(%rip), %rdi      # 0x8fd0
callq 0x2090
movq %rax, %rdi
callq 0x2090
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x21b0
// File: /workspace/github_cpp_makefile_star2_O2/tlaloc1313[P]chess-project/setup.cpp
// Function: setup(Board*)
int setup(Board* gameBoard) {

  //Pawns
  for (int i = 1; i<64; i+=8) {
    gameBoard->addPiece('p', i, 1);
    gameBoard->addPiece('p', i+5 , 0);
  }

  //Rooks
  gameBoard->addPiece('r', 0, 1);
  gameBoard->addPiece('r', 56, 1);
  gameBoard->addPiece('r', 7, 0);
  gameBoard->addPiece('r', 63, 0);

  //Bishops
  gameBoard->addPiece('b', 16, 1);
  gameBoard->addPiece('b', 40, 1);
  gameBoard->addPiece('b', 23, 0);
  gameBoard->addPiece('b', 47, 0);

  //Knights - note 'n' as type
  gameBoard->addPiece('n', 8, 1);
  gameBoard->addPiece('n', 48, 1);
  gameBoard->addPiece('n', 15, 0);
  gameBoard->addPiece('n', 55, 0);

  //Kings - note 'k' as type
  gameBoard->addPiece('k', 32, 1);
  gameBoard->addPiece('k', 39, 0);

  //Queens
  gameBoard->addPiece('q', 24, 1);
  gameBoard->addPiece('q', 31, 0);

return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
pushq $0x1
popq %r14
pushq $0x70
popq %r15
movl %r14d, %r12d
cmpl $0x40, %r12d
jae 0x2ec0
movq %rbx, %rdi
movl %r15d, %esi
movl %r12d, %edx
movl %r14d, %ecx
callq 0x370e
leal 0x5(%r12), %edx
movq %rbx, %rdi
movl %r15d, %esi
xorl %ecx, %ecx
callq 0x370e
addl $0x8, %r12d
jmp 0x2e91
pushq $0x72
popq %r15
pushq $0x1
popq %r14
movq %rbx, %rdi
movl %r15d, %esi
xorl %edx, %edx
movl %r14d, %ecx
callq 0x370e
pushq $0x38
popq %rdx
movq %rbx, %rdi
movl %r15d, %esi
movl %r14d, %ecx
callq 0x370e
pushq $0x7
popq %rdx
movq %rbx, %rdi
movl %r15d, %esi
xorl %ecx, %ecx
callq 0x370e
pushq $0x3f
popq %rdx
movq %rbx, %rdi
movl %r15d, %esi
xorl %ecx, %ecx
callq 0x370e
pushq $0x62
popq %r15
pushq $0x10
popq %rdx
movq %rbx, %rdi
movl %r15d, %esi
movl %r14d, %ecx
callq 0x370e
pushq $0x28
popq %rdx
movq %rbx, %rdi
movl %r15d, %esi
movl %r14d, %ecx
callq 0x370e
pushq $0x17
popq %rdx
movq %rbx, %rdi
movl %r15d, %esi
xorl %ecx, %ecx
callq 0x370e
pushq $0x2f
popq %rdx
movq %rbx, %rdi
movl %r15d, %esi
xorl %ecx, %ecx
callq 0x370e
pushq $0x6e
popq %r15
pushq $0x8
popq %rdx
movq %rbx, %rdi
movl %r15d, %esi
movl %r14d, %ecx
callq 0x370e
pushq $0x30
popq %rdx
movq %rbx, %rdi
movl %r15d, %esi
movl %r14d, %ecx
callq 0x370e
pushq $0xf
popq %rdx
movq %rbx, %rdi
movl %r15d, %esi
xorl %ecx, %ecx
callq 0x370e
pushq $0x37
popq %rdx
movq %rbx, %rdi
movl %r15d, %esi
xorl %ecx, %ecx
callq 0x370e
pushq $0x6b
popq %r15
pushq $0x20
popq %rdx
movq %rbx, %rdi
movl %r15d, %esi
movl %r14d, %ecx
callq 0x370e
pushq $0x27
popq %rdx
movq %rbx, %rdi
movl %r15d, %esi
xorl %ecx, %ecx
callq 0x370e
pushq $0x71
popq %r15
pushq $0x18
popq %rdx
movq %rbx, %rdi
movl %r15d, %esi
movl %r14d, %ecx
callq 0x370e
pushq $0x1f
popq %rdx
movq %rbx, %rdi
movl %r15d, %esi
xorl %ecx, %ecx
callq 0x370e
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tlaloc1313[P]chess-project/decodeEncode.cpp
// Function: encode[abi:cxx11](int)
string encode(int code){
  string takeString = "";

  //Special Case: CASTLING
  if (code == 69) {
    return "O-O";
  }
  if (code == 70) {
    return "O-O-O";
  }

  //If the move took a piece
  if (code>199 && code <264) {
    takeString = "x";
    code -= 200;
  }

  int row = code%8; //gets an integer for the row
  int column = (code-row)/8; //gets an integer for the column
  string rowString = to_string(row+1); //Converts to a string for concatenation
  string columnString;

  //Assigns a letter based on the row
  switch (column) {
    case 0:
      columnString = "a";
    break;
    case 1:
      columnString = "b";
    break;
    case 2:
      columnString = "c";
    break;
    case 3:
      columnString = "d";
    break;
    case 4:
      columnString = "e";
    break;
    case 5:
      columnString = "f";
    break;
    case 6:
      columnString = "g";
    break;
    case 7:
      columnString = "h";
    break;
    default:
      return "Undefined";
  }
  //Concatenates the column and row
  string output = takeString + columnString + rowString;
  return output;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x2d9c(%rip), %rsi      # 0x600e
leaq -0x98(%rbp), %rdi
leaq -0x38(%rbp), %rdx
callq 0x2070
cmpl $0x46, %r14d
je 0x32a6
cmpl $0x45, %r14d
jne 0x32be
leaq 0x3016(%rip), %rsi      # 0x62ab
leaq -0x38(%rbp), %rdx
movq %rbx, %rdi
callq 0x2070
jmp 0x338a
leaq 0x2ffc(%rip), %rsi      # 0x62a9
leaq -0x38(%rbp), %rdx
movq %rbx, %rdi
callq 0x2070
jmp 0x338a
leal -0xc8(%r14), %r15d
cmpl $0x3f, %r15d
ja 0x32e1
leaq 0x301a(%rip), %rsi      # 0x62ec
leaq -0x98(%rbp), %rdi
callq 0x21c0
movl %r15d, %r14d
pushq $0x8
popq %rcx
movl %r14d, %eax
cltd
idivl %ecx
movl %eax, %r15d
leal (,%r15,8), %eax
negl %eax
leal (%r14,%rax), %esi
incl %esi
leaq -0x38(%rbp), %rdi
callq 0x33ed
leaq -0x68(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
cmpl $0x8, %r15d
jae 0x3365
movl %r15d, %eax
leaq 0x2f3a(%rip), %rcx      # 0x6260
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
leaq -0x78(%rbp), %rdi
callq 0x21c0
leaq -0x58(%rbp), %rdi
leaq -0x98(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0x3476
leaq -0x58(%rbp), %rsi
leaq -0x38(%rbp), %rdx
movq %rbx, %rdi
callq 0x344d
leaq -0x58(%rbp), %rdi
callq 0x2080
jmp 0x3378
leaq 0x2f82(%rip), %rsi      # 0x62ee
leaq -0x58(%rbp), %rdx
movq %rbx, %rdi
callq 0x2070
leaq -0x78(%rbp), %rdi
callq 0x2080
leaq -0x38(%rbp), %rdi
callq 0x2080
leaq -0x98(%rbp), %rdi
callq 0x2080
movq %rbx, %rax
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x2080
jmp 0x33bc
jmp 0x33b9
jmp 0x33b9
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x2080
leaq -0x38(%rbp), %rdi
callq 0x2080
jmp 0x33d9
jmp 0x33d6
jmp 0x33d6
jmp 0x33d6
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x21b0
// File: /workspace/github_cpp_makefile_star2_O2/tlaloc1313[P]chess-project/Board.cpp
// Function: Board::Board()
Board::Board(){
  for (int i=0; i<64; i++){
    activeArray[i]=0;
  }
  moveNumber = 0;
  movesSince = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x55e1(%rip), %rax      # 0x8b68
movq %rax, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x248(%rdi)
movups %xmm0, 0x258(%rdi)
movups %xmm0, 0x268(%rdi)
xorl %eax, %eax
cmpq $0x40, %rax
je 0x35b7
movb $0x0, 0x208(%rdi,%rax)
incq %rax
jmp 0x35a4
andq $0x0, 0x278(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tlaloc1313[P]chess-project/Board.cpp
// Function: Board::Board(Piece**, bool*, std::vector<char, std::allocator<char>>, std::vector<int, std::allocator<int>>)
Board::Board (Piece** pieceArr, bool activeArr[64], std::vector<char> pstPcs, std::vector<int> pstMvs){
	for (int i = 0; i < 64; i++) {
		activeArray[i] = 0;
		if (activeArr[i]) {
			addPiece(pieceArr[i]->getType(), i, pieceArr[i]->getIsWhite());
		}
	}
	for (unsigned i = 0; i < pstPcs.size(); i++) {
		pastPieces.push_back(pstPcs.at(i));
	}
	for (unsigned i = 0; i < pstMvs.size(); i++) {
		pastMoves.push_back(pstMvs.at(i));
	}
	moveNumber = 0;
  movesSince = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %r15
movq %rcx, %r13
movq %rdx, -0x48(%rbp)
movq %rsi, %r14
leaq 0x5581(%rip), %rax      # 0x8b68
movq %rax, (%rdi)
leaq 0x248(%rdi), %rax
movq %rax, -0x40(%rbp)
leaq 0x260(%rdi), %rax
movq %rax, -0x38(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, 0x248(%rdi)
movups %xmm0, 0x258(%rdi)
movq %rdi, -0x30(%rbp)
movups %xmm0, 0x268(%rdi)
xorl %r12d, %r12d
cmpq $0x40, %r12
je 0x3668
movq -0x30(%rbp), %rax
movb $0x0, 0x208(%rax,%r12)
movq -0x48(%rbp), %rax
cmpb $0x1, (%rax,%r12)
jne 0x3663
movq (%r14,%r12,8), %rdi
callq 0x5694
movl %eax, %ebx
movq (%r14,%r12,8), %rdi
callq 0x569e
movzbl %al, %ecx
movsbl %bl, %esi
movq -0x30(%rbp), %rdi
movl %r12d, %edx
callq 0x370e
incq %r12
jmp 0x361f
xorl %ebx, %ebx
movq -0x40(%rbp), %r14
movq -0x38(%rbp), %r12
movl %ebx, %ebx
movq 0x8(%r13), %rax
subq (%r13), %rax
cmpq %rbx, %rax
jbe 0x369b
movq %r13, %rdi
movq %rbx, %rsi
callq 0x4960
movq %r14, %rdi
movq %rax, %rsi
callq 0x493e
incl %ebx
jmp 0x3672
xorl %ebx, %ebx
movl %ebx, %ebx
movq 0x8(%r15), %rax
subq (%r15), %rax
sarq $0x2, %rax
cmpq %rbx, %rax
jbe 0x36c9
movq %r15, %rdi
movq %rbx, %rsi
callq 0x49a4
movq %r12, %rdi
movq %rax, %rsi
callq 0x497e
incl %ebx
jmp 0x369d
movq -0x30(%rbp), %rax
andq $0x0, 0x278(%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x40(%rbp), %r14
movq -0x38(%rbp), %r12
jmp 0x36f6
jmp 0x36f3
movq %rax, %rbx
movq %r12, %rdi
callq 0x2a3c
movq %r14, %rdi
callq 0x2a28
movq %rbx, %rdi
callq 0x21b0
// File: /workspace/github_cpp_makefile_star2_O2/tlaloc1313[P]chess-project/Board.cpp
// Function: Board::addPiece(char, int, int)
int Board::addPiece(char type, int startSpace, int isWhite){
  if (activeArray[startSpace] == 1) { //If the space is taken
    return -1;
  }
  activeArray[startSpace] = 1; //Activates the space before placing the piece
  switch (type){
    case 'b':
      pieceArray[startSpace] = new Bishop(startSpace, isWhite);
      break;
    case 'n':
      pieceArray[startSpace] = new Knight(startSpace, isWhite);
      break;
    case 'p':
      pieceArray[startSpace] = new Pawn(startSpace, isWhite);
      break;
    case 'k':
      pieceArray[startSpace] = new King(startSpace, isWhite);
      break;
    case 'q':
      pieceArray[startSpace] = new Queen(startSpace, isWhite);
      break;
    case 'r':
      pieceArray[startSpace] = new Rook(startSpace, isWhite);
      break;
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movslq %edx, %r15
cmpb $0x0, 0x208(%rdi,%r15)
je 0x3732
pushq $-0x1
popq %rbx
jmp 0x381d
movl %ecx, %r12d
movl %edx, %r13d
movq %rdi, %r14
movb $0x1, 0x208(%rdi,%r15)
movsbl %sil, %eax
xorl %ebx, %ebx
leal -0x6b(%rax), %ecx
cmpl $0x7, %ecx
ja 0x3781
leaq 0x2c73(%rip), %rax      # 0x63cc
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
pushq $0x18
popq %rdi
callq 0x2100
movq %rax, -0x30(%rbp)
movq %rax, %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0x5050
jmp 0x3814
cmpl $0x62, %eax
jne 0x381d
pushq $0x18
popq %rdi
callq 0x2100
movq %rax, -0x30(%rbp)
movq %rax, %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0x4f54
jmp 0x3814
pushq $0x18
popq %rdi
callq 0x2100
movq %rax, -0x30(%rbp)
movq %rax, %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0x584c
jmp 0x3814
pushq $0x18
popq %rdi
callq 0x2100
movq %rax, -0x30(%rbp)
movq %rax, %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0x5270
jmp 0x3814
pushq $0x18
popq %rdi
callq 0x2100
movq %rax, -0x30(%rbp)
movq %rax, %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0x5150
jmp 0x3814
pushq $0x18
popq %rdi
callq 0x2100
movq %rax, -0x30(%rbp)
movq %rax, %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0x56d4
movq -0x30(%rbp), %rax
movq %rax, 0x8(%r14,%r15,8)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3838
jmp 0x3838
jmp 0x3838
jmp 0x3838
jmp 0x3838
movq %rax, %rbx
movq -0x30(%rbp), %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x21b0
// File: /workspace/github_cpp_makefile_star2_O2/tlaloc1313[P]chess-project/Board.cpp
// Function: Board::getPiece(int)
const char* Board::getPiece(int space){
  char type = pieceArray[space]->getType();
  bool isWhite = pieceArray[space]->getIsWhite();

  if (isWhite == 1) {
    //White Pieces
    switch (type) {
      case 'p':
      return u8"\u2659";
      case 'r':
      return u8"\u2656";
      case 'b':
      return u8"\u2657";
      case 'n':
      return u8"\u2658";
      case 'k':
      return u8"♔";
      case 'q':
      return u8"\u2655";
    }
  } else {
    //Black Pieces
    switch (type) {
      case 'p':
      return u8"\u265F";
      case 'r':
      return u8"\u265C";
      case 'b':
      return u8"\u265D";
      case 'n':
      return u8"\u265E";
      case 'k':
      return u8"\u265A";
      case 'q':
      return u8"\u265B";
    }
  }

  return u8"\uFFFD";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movslq %esi, %r15
movq 0x8(%rdi,%r15,8), %rdi
callq 0x5694
movl %eax, %ebx
movq 0x8(%r14,%r15,8), %rdi
callq 0x569e
movzbl %bl, %ecx
testb %al, %al
je 0x3b59
leal -0x6b(%rcx), %eax
cmpl $0x7, %eax
ja 0x3b7a
leaq 0x28c8(%rip), %rcx      # 0x640c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x292f(%rip), %rax      # 0x6483
jmp 0x3be5
leal -0x6b(%rcx), %eax
cmpl $0x7, %eax
ja 0x3b88
leaq 0x2884(%rip), %rcx      # 0x63ec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x2923(%rip), %rax      # 0x649b
jmp 0x3be5
cmpl $0x62, %ecx
jne 0x3b96
leaq 0x28f5(%rip), %rax      # 0x647b
jmp 0x3be5
cmpl $0x62, %ecx
jne 0x3b96
leaq 0x28ff(%rip), %rax      # 0x6493
jmp 0x3be5
leaq 0x2906(%rip), %rax      # 0x64a3
jmp 0x3be5
leaq 0x28d1(%rip), %rax      # 0x6477
jmp 0x3be5
leaq 0x28e0(%rip), %rax      # 0x648f
jmp 0x3be5
leaq 0x28bb(%rip), %rax      # 0x6473
jmp 0x3be5
leaq 0x28ca(%rip), %rax      # 0x648b
jmp 0x3be5
leaq 0x28b5(%rip), %rax      # 0x647f
jmp 0x3be5
leaq 0x28c4(%rip), %rax      # 0x6497
jmp 0x3be5
leaq 0x28ab(%rip), %rax      # 0x6487
jmp 0x3be5
leaq 0x28ba(%rip), %rax      # 0x649f
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tlaloc1313[P]chess-project/Board.cpp
// Function: Board::getPastPiece(int)
const char* Board::getPastPiece(int number) {

  //Special Cases
  if (pastPieces[number] == 'x') {
    return u8"\u200A";
  }


  int isWhite = ((number + 1) % 2);

  if (isWhite == 1) {
    //White Pieces
    switch (pastPieces[number]) {
      case 'p':
      return u8"\u2659";
      case 'r':
      return u8"\u2656";
      case 'b':
      return u8"\u2657";
      case 'n':
      return u8"\u2658";
      case 'k':
      return u8"♔";
      case 'q':
      return u8"\u2655";
    }
  } else {
    //Black Pieces
    switch (pastPieces[number]) {
      case 'p':
      return u8"\u265F";
      case 'r':
      return u8"\u265C";
      case 'b':
      return u8"\u265D";
      case 'n':
      return u8"\u265E";
      case 'k':
      return u8"\u265A";
      case 'q':
      return u8"\u265B";
    }
  }

  //Error character
  return u8"\uFFFD";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movslq %esi, %rax
movq 0x248(%rdi), %rcx
movzbl (%rcx,%rax), %eax
cmpl $0x78, %eax
jne 0x3c10
leaq 0x2899(%rip), %rax      # 0x64a7
popq %rbp
retq
incl %esi
andl $0x80000001, %esi       # imm = 0x80000001
leal -0x6b(%rax), %ecx
cmpl $0x1, %esi
jne 0x3c3e
cmpl $0x7, %ecx
ja 0x3c5c
leaq 0x2820(%rip), %rax      # 0x644c
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x2847(%rip), %rax      # 0x6483
jmp 0x3c0e
cmpl $0x7, %ecx
ja 0x3c6a
leaq 0x27e2(%rip), %rax      # 0x642c
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x2841(%rip), %rax      # 0x649b
jmp 0x3c0e
cmpl $0x62, %eax
jne 0x3c78
leaq 0x2813(%rip), %rax      # 0x647b
jmp 0x3c0e
cmpl $0x62, %eax
jne 0x3c78
leaq 0x281d(%rip), %rax      # 0x6493
jmp 0x3c0e
leaq 0x2824(%rip), %rax      # 0x64a3
jmp 0x3c0e
leaq 0x27ef(%rip), %rax      # 0x6477
jmp 0x3c0e
leaq 0x27fe(%rip), %rax      # 0x648f
jmp 0x3c0e
leaq 0x27d6(%rip), %rax      # 0x6473
jmp 0x3c0e
leaq 0x27e2(%rip), %rax      # 0x648b
jmp 0x3c0e
leaq 0x27ca(%rip), %rax      # 0x647f
jmp 0x3c0e
leaq 0x27d6(%rip), %rax      # 0x6497
jmp 0x3c0e
leaq 0x27ba(%rip), %rax      # 0x6487
jmp 0x3c0e
leaq 0x27c6(%rip), %rax      # 0x649f
jmp 0x3c0e
// File: /workspace/github_cpp_makefile_star2_O2/tlaloc1313[P]chess-project/Bishop.cpp
// Function: Bishop::Bishop(int, int)
Bishop::Bishop(int startingSquare, int pieceIsWhite){
  location = startingSquare;
  pieceType = 'b';
  isWhite = pieceIsWhite;
  hasMoved = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r14d
movq %rdi, %r15
callq 0x53f4
leaq 0x3c26(%rip), %rax      # 0x8b98
movq %rax, (%r15)
movl %r14d, 0xc(%r15)
movb $0x62, 0x8(%r15)
testl %ebx, %ebx
setne 0x10(%r15)
movb $0x0, 0x11(%r15)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tlaloc1313[P]chess-project/Bishop.cpp
// Function: Bishop::move(int, bool*)
bool Bishop::move(int square, bool activeArray[64]){
  // Decoding square numbers:
  int fromRow = row(location);
  int fromCol = col(location);
  int toRow = row(square);
  int toCol = col(square);

  // Pieces can't move to the square they are already on.
  if (square == location) {
    return 0;
  }
  // Checks that the move is strictly diagonal, and uses 'checkDiagonal' to
  // ensure that no other pieces are in the way.
  if ((abs(toRow-fromRow) == abs(toCol-fromCol)) && checkDiagonal(square, activeArray) == -1) {
		location = square;
    hasMoved = 1;
		return 1;
  } else {
    return 0;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, -0x30(%rbp)
movl %esi, %r14d
movq %rdi, %rbx
movl 0xc(%rdi), %edi
callq 0x3558
movl %eax, %r12d
movl 0xc(%rbx), %edi
callq 0x356a
movl %eax, %r13d
movl %r14d, %edi
callq 0x3558
movl %eax, %r15d
movl %r14d, %edi
callq 0x356a
cmpl %r14d, 0xc(%rbx)
je 0x500b
subl %r12d, %r15d
movl %r15d, %ecx
negl %ecx
cmovsl %r15d, %ecx
subl %r13d, %eax
movl %eax, %edx
negl %edx
cmovsl %eax, %edx
cmpl %edx, %ecx
jne 0x500b
movq %rbx, %rdi
movl %r14d, %esi
movq -0x30(%rbp), %rdx
callq 0x55ae
cmpl $-0x1, %eax
je 0x501c
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r14d, 0xc(%rbx)
movb $0x1, 0x11(%rbx)
movb $0x1, %al
jmp 0x500d
// File: /workspace/github_cpp_makefile_star2_O2/tlaloc1313[P]chess-project/King.cpp
// Function: King::King(int, int)
King::King(int startingSquare, int pieceIsWhite){
  location = startingSquare;
  pieceType = 'k';
  isWhite = pieceIsWhite;
  hasMoved = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r14d
movq %rdi, %r15
callq 0x53f4
leaq 0x3b7a(%rip), %rax      # 0x8be8
movq %rax, (%r15)
movl %r14d, 0xc(%r15)
movb $0x6b, 0x8(%r15)
testl %ebx, %ebx
setne 0x10(%r15)
movb $0x0, 0x11(%r15)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tlaloc1313[P]chess-project/King.cpp
// Function: King::move(int, bool*)
bool King::move(int square, bool activeArray[64]){
  //Decoding square numbers:
  int fromRow = row(location);
  int fromCol = col(location);
  int toRow = row(square);
  int toCol = col(square);

  // Same square check
  if (square==location){
    return 0;
  }

  // The king can move 1 square in any direction
  if ( abs(fromRow-toRow)<2 && abs(fromCol-toCol)<2 ){
    location = square;
    hasMoved = 1;
    return 1;
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
movl 0xc(%rdi), %edi
callq 0x3558
movl %eax, %r12d
movl 0xc(%rbx), %edi
callq 0x356a
movl %eax, %r15d
movl %r14d, %edi
callq 0x3558
movl %eax, %r13d
movl %r14d, %edi
callq 0x356a
cmpl %r14d, 0xc(%rbx)
je 0x5103
subl %r13d, %r12d
movl %r12d, %ecx
negl %ecx
cmovsl %r12d, %ecx
cmpl $0x1, %ecx
ja 0x5103
subl %eax, %r15d
movl %r15d, %eax
negl %eax
cmovsl %r15d, %eax
cmpl $0x1, %eax
ja 0x5103
movl %r14d, 0xc(%rbx)
movb $0x1, 0x11(%rbx)
movb $0x1, %al
jmp 0x5105
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tlaloc1313[P]chess-project/King.cpp
// Function: King::castle(int)
void King::castle(int square){
  if (hasMoved == 0){
    location = square;
    hasMoved = 1;
  }
  return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpb $0x0, 0x11(%rdi)
jne 0x5125
movl %esi, 0xc(%rdi)
movb $0x1, 0x11(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tlaloc1313[P]chess-project/Knight.cpp
// Function: Knight::Knight(int, int)
Knight::Knight(int startingSquare, int pieceIsWhite){
  location = startingSquare;
  pieceType = 'n';
  isWhite = pieceIsWhite;
  hasMoved = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r14d
movq %rdi, %r15
callq 0x53f4
leaq 0x3aca(%rip), %rax      # 0x8c38
movq %rax, (%r15)
movl %r14d, 0xc(%r15)
movb $0x6e, 0x8(%r15)
testl %ebx, %ebx
setne 0x10(%r15)
movb $0x0, 0x11(%r15)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tlaloc1313[P]chess-project/Knight.cpp
// Function: Knight::move(int, bool*)
bool Knight::move(int square, bool activeArray[64]){
  int currentPos = location;
  int dist = abs(currentPos - square);

  // Checks that the move is legal using relative position of start and end space.
  if (dist == 6 || dist == 10 || dist == 15 || dist == 17) {
    // Move is illegal if it involves going off the edge of the board
    if (row(currentPos)<2 && row(square)>5) {
      return 0;
    }
    if (row(currentPos)>5 && row(square)<2) {
      return 0;
    }
    if (col(currentPos)<2 && col(square)>5) {
      return 0;
    }
    if (col(currentPos)>5 && col(square)<2) {
      return 0;
    }

    // Moves piece and returns
    location = square;
    hasMoved = 1;
    return 1;
  }
	return 0; // Failure
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl 0xc(%rdi), %r15d
movl %r15d, %eax
subl %esi, %eax
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
xorl %eax, %eax
cmpl $0x11, %ecx
ja 0x523d
movl $0x28440, %edx          # imm = 0x28440
btl %ecx, %edx
jae 0x523d
movl %esi, %r14d
movq %rdi, %rbx
movl %r15d, %edi
callq 0x3558
cmpl $0x1, %eax
jg 0x51e1
movl %r14d, %edi
callq 0x3558
cmpl $0x5, %eax
jg 0x522f
movl %r15d, %edi
callq 0x3558
cmpl $0x6, %eax
jl 0x51fb
movl %r14d, %edi
callq 0x3558
cmpl $0x2, %eax
jl 0x522f
movl %r15d, %edi
callq 0x356a
cmpl $0x1, %eax
jg 0x5215
movl %r14d, %edi
callq 0x356a
cmpl $0x5, %eax
jg 0x522f
movl %r15d, %edi
callq 0x356a
cmpl $0x6, %eax
jl 0x5233
movl %r14d, %edi
callq 0x356a
cmpl $0x2, %eax
jge 0x5233
xorl %eax, %eax
jmp 0x523d
movl %r14d, 0xc(%rbx)
movb $0x1, 0x11(%rbx)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tlaloc1313[P]chess-project/Piece.cpp
// Function: Piece::direction(int)
int Piece::direction(int destination){
	int dir;

	if (col(location) < col(destination)) {
		if (row(location) < row(destination)) {
			dir = 1;
		} else if (row(location) > row(destination)) {
			dir = 7;
		} else {
			dir = 0;
		}
	} else if (col(location) > col(destination)) {
		if (row(location) < row(destination)) {
			dir = 3;
		} else if (row(location) > row(destination)) {
			dir = 5;
		} else {
			dir = 4;
		}
	} else {
		if (row(location) < row(destination)) {
			dir = 2;
		} else {
			dir = 6;
		}
	}
	return dir;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movl 0xc(%rdi), %edi
callq 0x356a
movl %eax, %r15d
movl %ebx, %edi
callq 0x356a
movl 0xc(%r14), %edi
cmpl %eax, %r15d
jge 0x5452
callq 0x3558
movl %eax, %r15d
movl %ebx, %edi
callq 0x3558
cmpl %eax, %r15d
jge 0x5486
pushq $0x1
jmp 0x5483
callq 0x356a
movl %eax, %r12d
movl %ebx, %edi
callq 0x356a
movl %eax, %r13d
movl 0xc(%r14), %edi
callq 0x3558
movl %eax, %r15d
movl %ebx, %edi
callq 0x3558
cmpl %r13d, %r12d
jle 0x54a6
cmpl %eax, %r15d
jge 0x54b7
pushq $0x3
popq %rax
jmp 0x54d7
movl 0xc(%r14), %edi
callq 0x3558
movl %eax, %r14d
movl %ebx, %edi
callq 0x3558
xorl %ecx, %ecx
cmpl %eax, %r14d
pushq $0x7
popq %rax
cmovlel %ecx, %eax
jmp 0x54d7
xorl %ecx, %ecx
cmpl %eax, %r15d
setge %cl
leal 0x2(,%rcx,4), %eax
jmp 0x54d7
movl 0xc(%r14), %edi
callq 0x3558
movl %eax, %r14d
movl %ebx, %edi
callq 0x3558
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %r14d
setg %al
orl $0x4, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tlaloc1313[P]chess-project/Piece.cpp
// Function: Piece::checkStraight(int, bool*)
int Piece::checkStraight(int destination, bool activeArray[64]) {
	int dir = direction(destination);

	int east, north, west, south;

	switch (dir) {
		case 0: //East
			for (east = location+8; east < destination; east+=8) {
				if (activeArray[east] == 1) {
					return east;
				}
			}
			break;
		case 2: //North
			for (north = location+1; north < destination; north++) {
				if (activeArray[north] == 1) {
					return north;
				}
			}
			break;
		case 4: //West
			for (west = location-8; west > destination; west-=8) {
				if (activeArray[west] == 1) {
					return west;
				}
			}
			break;
		case 6: //South
			for (south = location-1; south > destination; south--) {
				if (activeArray[south] == 1) {
					return south;
				}
			}
			break;
	}

	//If there are no pieces found
	return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %r14d
movq %rdi, %r15
callq 0x540c
pushq $-0x1
popq %rcx
cmpl $0x6, %eax
ja 0x55a0
movl %eax, %eax
leaq 0x1039(%rip), %rdx      # 0x654c
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movslq 0xc(%r15), %rax
movslq %r14d, %rdx
movq %rax, %rsi
addq $0x8, %rsi
cmpq %rdx, %rsi
jge 0x55a0
addl $0x8, %eax
cmpb $0x0, (%rbx,%rsi)
leaq 0x8(%rsi), %rsi
je 0x552a
jmp 0x55a2
movslq 0xc(%r15), %rax
movslq %r14d, %rdx
movq %rax, %rsi
addq $-0x8, %rsi
cmpq %rdx, %rsi
jle 0x55a0
addl $-0x8, %eax
cmpb $0x0, (%rbx,%rsi)
leaq -0x8(%rsi), %rsi
je 0x554c
jmp 0x55a2
movslq 0xc(%r15), %rax
movslq %r14d, %rdx
movq %rax, %rsi
incq %rsi
cmpq %rdx, %rsi
jge 0x55a0
incl %eax
cmpb $0x0, (%rbx,%rsi)
leaq 0x1(%rsi), %rsi
je 0x556d
jmp 0x55a2
movslq 0xc(%r15), %rax
movslq %r14d, %rdx
movq %rax, %rsi
decq %rsi
cmpq %rdx, %rsi
jle 0x55a0
decl %eax
cmpb $0x1, (%rbx,%rsi)
leaq -0x1(%rsi), %rsi
jne 0x558d
jmp 0x55a2
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tlaloc1313[P]chess-project/Piece.cpp
// Function: Piece::checkDiagonal(int, bool*)
int Piece::checkDiagonal(int destination, bool activeArray[64]) {
	int dir = direction(destination);
	switch (dir) {
		case 1: //North East
			for (int ne = location+9; ne < destination; ne+=9) {
				if (activeArray[ne] == 1) {
					return ne;
				}
			}
			break;
		case 3: //North West
			for (int nw = location-7; nw > destination; nw-=7) {
				if (activeArray[nw] == 1) {
					return nw;
				}
			}
			break;
		case 5: //South West
			for (int sw = location-9; sw > destination; sw-=9) {
				if (activeArray[sw] == 1) {
					return sw;
				}
			}
			break;
		case 7: //South East
			for (int se = location+7; se < destination; se+=7) {
				if (activeArray[se] == 1) {
					return se;
				}
			}
			break;
	}

	//If there are no pieces found
	return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %r14d
movq %rdi, %r15
callq 0x540c
pushq $-0x1
popq %rcx
decl %eax
cmpl $0x6, %eax
ja 0x566c
leaq 0xf8d(%rip), %rdx       # 0x6568
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movslq 0xc(%r15), %rax
movslq %r14d, %rdx
movq %rax, %rsi
addq $0x9, %rsi
cmpq %rdx, %rsi
jge 0x566c
addl $0x9, %eax
cmpb $0x0, (%rbx,%rsi)
leaq 0x9(%rsi), %rsi
je 0x55f2
jmp 0x566e
movslq 0xc(%r15), %rax
movslq %r14d, %rdx
movq %rax, %rsi
addq $-0x9, %rsi
cmpq %rdx, %rsi
jle 0x566c
addl $-0x9, %eax
cmpb $0x0, (%rbx,%rsi)
leaq -0x9(%rsi), %rsi
je 0x5614
jmp 0x566e
movslq 0xc(%r15), %rax
movslq %r14d, %rdx
movq %rax, %rsi
addq $-0x7, %rsi
cmpq %rdx, %rsi
jle 0x566c
addl $-0x7, %eax
cmpb $0x0, (%rbx,%rsi)
leaq -0x7(%rsi), %rsi
je 0x5636
jmp 0x566e
movslq 0xc(%r15), %rax
movslq %r14d, %rdx
movq %rax, %rsi
addq $0x7, %rsi
cmpq %rdx, %rsi
jge 0x566c
addl $0x7, %eax
cmpb $0x1, (%rbx,%rsi)
leaq 0x7(%rsi), %rsi
jne 0x5658
jmp 0x566e
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop