LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/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 0x6226
testb %al, %al
je 0x5e04
callq 0x5fac
xorl %edi, %edi
callq 0x32b0
movl %ebp, %edi
movq %rbx, %rsi
callq 0x6272
testb %al, %al
je 0x5e19
callq 0x5d6c
jmp 0x5dfd
movl %ebp, %edi
movq %rbx, %rsi
callq 0x629a
testb %al, %al
je 0x5e46
movq %rsp, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x62ea
movq %rsp, %rdi
callq 0x45fa
movq %rsp, %rdi
callq 0x5f88
jmp 0x5dfd
movl %ebp, %edi
movq %rbx, %rsi
callq 0x62c2
testb %al, %al
je 0x5e82
movq %rsp, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x69c4
movq %rsp, %rdi
callq 0x71fc
leaq 0x30(%rsp), %rdi
callq 0x4bb4
leaq 0x8(%rsp), %rdi
callq 0x4bb4
jmp 0x5dfd
callq 0x5fac
jmp 0x5f5b
movq %rdx, %r14
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x4bb4
leaq 0x8(%rsp), %rdi
callq 0x4bb4
jmp 0x5ec2
jmp 0x5ebc
movq %rdx, %r14
movq %rax, %rbx
movq %rsp, %rdi
callq 0x5f88
jmp 0x5ec2
jmp 0x5ebc
movq %rdx, %r14
movq %rax, %rbx
cmpl $0x2, %r14d
jne 0x5f12
movq %rbx, %rdi
callq 0x30f0
movq %rax, %rbx
callq 0x5fac
movq 0x6111(%rip), %rdi      # 0xbff0
leaq 0x28a6(%rip), %rsi      # 0x878c
movl $0x7, %edx
callq 0x3280
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0x60f0(%rip), %rdi      # 0xbff0
movq %rax, %rsi
callq 0x3210
movq %rax, %rdi
callq 0x3120
jmp 0x5f5b
cmpl $0x1, %r14d
jne 0x5f77
movq %rbx, %rdi
callq 0x30f0
movq %rax, %rbx
movq 0x60c6(%rip), %rdi      # 0xbff0
leaq 0x285b(%rip), %rsi      # 0x878c
movl $0x7, %edx
callq 0x3280
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0x60a5(%rip), %rdi      # 0xbff0
movq %rax, %rsi
callq 0x3210
movq %rax, %rdi
callq 0x3120
movl $0x1, %edi
callq 0x32b0
movq %rax, %rbx
callq 0x3350
jmp 0x5f77
movq %rax, %rbx
callq 0x3350
movq %rbx, %rdi
callq 0x3370
movq %rax, %rdi
callq 0x409c
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3b58
movq (%r14), %rax
movq %rax, (%rbx)
movq 0x8(%r14), %rax
movq %rax, 0x8(%rbx)
movq 0x10(%r14), %rdi
movq %rdi, 0x10(%rbx)
testq %rdi, %rdi
je 0x77ba
movq 0x4823(%rip), %rax      # 0xbfc0
cmpb $0x0, (%rax)
je 0x77a7
incl 0x8(%rdi)
jmp 0x77b5
lock
incl 0x8(%rdi)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x77ba
callq 0x4130
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x2090
movq %rax, %r12
addl $0x32, %eax
movslq %eax, %rdi
callq 0x21b0
movq %rax, %rbx
movl $0x20544547, (%rax)     # imm = 0x20544547
xorl %edx, %edx
cmpl $0x8, %r12d
jl 0x2527
cmpb $0x68, (%r14)
jne 0x2527
cmpb $0x74, 0x1(%r14)
jne 0x2527
cmpb $0x74, 0x2(%r14)
jne 0x2527
cmpb $0x70, 0x3(%r14)
jne 0x2527
cmpb $0x3a, 0x4(%r14)
jne 0x2527
cmpb $0x2f, 0x5(%r14)
jne 0x2527
xorl %eax, %eax
cmpb $0x2f, 0x6(%r14)
movl $0x7, %edx
cmovnel %eax, %edx
movl %edx, %r13d
movl %edx, %eax
cmpl %r12d, %edx
jge 0x2543
leal -0x1(%rdx), %eax
leaq (%r14,%r13), %rcx
incl %eax
cmpb $0x2f, (%rcx)
leaq 0x1(%rcx), %rcx
jne 0x2538
movb $0x2f, 0x4(%rbx)
leal 0x1(%rax), %ecx
movl $0x5, %r15d
cmpl %r12d, %ecx
jge 0x2583
movq %rbx, %rdi
addq $0x5, %rdi
movl %eax, %ecx
leaq (%r14,%rcx), %rsi
incq %rsi
movl %r12d, %r15d
subl %eax, %r15d
movq %rdx, -0x30(%rbp)
leal -0x2(%r15), %edx
incq %rdx
callq 0x20f0
movq -0x30(%rbp), %rdx
addl $0x4, %r15d
leal 0x11(%r15), %eax
movl %r15d, %ecx
movaps 0xa7f(%rip), %xmm0      # 0x3010
movups %xmm0, (%rbx,%rcx)
movb $0x20, 0x10(%rbx,%rcx)
cmpl %r12d, %edx
jge 0x25bb
movl %eax, %eax
movl %r12d, %ecx
movb (%r14,%r13), %dl
cmpb $0x2f, %dl
je 0x25bb
incq %r13
movb %dl, (%rbx,%rax)
incq %rax
cmpq %r13, %rcx
jne 0x25a4
movl %eax, %eax
movl $0xa0d0a0d, (%rbx,%rax) # imm = 0xA0D0A0D
movb $0x0, 0x4(%rbx,%rax)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x21b0
movq %rax, %rbx
movq %r15, %rdi
callq 0x2090
movq %rax, %r14
testl %r14d, %r14d
jle 0x264e
movl %r14d, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %edx, %edx
xorl %eax, %eax
cmpb $0x2f, (%r15,%rdx)
cmovel %edx, %eax
incq %rdx
cmpq %rdx, %rcx
jne 0x2612
testl %eax, %eax
je 0x264e
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 0x2665
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_O3/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, %r14
movq 0x6455(%rip), %rbx      # 0x8fd0
leaq 0x3692(%rip), %rsi      # 0x6214
movl $0x8, %edx
movq %rbx, %rdi
callq 0x2120
movq %r14, %rdi
callq 0x428e
testl %eax, %eax
jle 0x2c69
xorl %r15d, %r15d
leaq 0x3674(%rip), %r12      # 0x621d
testb $0x1, %r15b
jne 0x2bd2
movl %r15d, %esi
shrl %esi
incl %esi
movq %rbx, %rdi
callq 0x21b0
movl $0x2, %edx
movq %rax, %rdi
leaq 0x35c4(%rip), %rsi      # 0x6191
callq 0x2120
movq %r14, %rdi
movl %r15d, %esi
callq 0x417a
testq %rax, %rax
je 0x2bfd
movq %rax, %r13
movq %rax, %rdi
callq 0x2080
movq %rbx, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x2120
jmp 0x2c14
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x21a0
leaq -0x48(%rbp), %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x4268
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %rbx, %rdi
callq 0x2120
movl $0x2, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2120
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2c55
callq 0x20f0
incl %r15d
movq %r14, %rdi
callq 0x428e
cmpl %eax, %r15d
jl 0x2ba9
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20a0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20a0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2cde
callq 0x20f0
movq %rbx, %rdi
callq 0x21c0
// File: /workspace/github_cpp_makefile_star2_O3/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 %r14
pushq %rbx
movq %rdi, %rbx
movl $0x1, %r14d
movq %rbx, %rdi
movl $0x70, %esi
movl %r14d, %edx
movl $0x1, %ecx
callq 0x3c38
leal 0x5(%r14), %edx
movq %rbx, %rdi
movl $0x70, %esi
xorl %ecx, %ecx
callq 0x3c38
leal 0x8(%r14), %eax
cmpl $0x38, %r14d
movl %eax, %r14d
jb 0x3158
movq %rbx, %rdi
movl $0x72, %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x3c38
movq %rbx, %rdi
movl $0x72, %esi
movl $0x38, %edx
movl $0x1, %ecx
callq 0x3c38
movq %rbx, %rdi
movl $0x72, %esi
movl $0x7, %edx
xorl %ecx, %ecx
callq 0x3c38
movq %rbx, %rdi
movl $0x72, %esi
movl $0x3f, %edx
xorl %ecx, %ecx
callq 0x3c38
movq %rbx, %rdi
movl $0x62, %esi
movl $0x10, %edx
movl $0x1, %ecx
callq 0x3c38
movq %rbx, %rdi
movl $0x62, %esi
movl $0x28, %edx
movl $0x1, %ecx
callq 0x3c38
movq %rbx, %rdi
movl $0x62, %esi
movl $0x17, %edx
xorl %ecx, %ecx
callq 0x3c38
movq %rbx, %rdi
movl $0x62, %esi
movl $0x2f, %edx
xorl %ecx, %ecx
callq 0x3c38
movq %rbx, %rdi
movl $0x6e, %esi
movl $0x8, %edx
movl $0x1, %ecx
callq 0x3c38
movq %rbx, %rdi
movl $0x6e, %esi
movl $0x30, %edx
movl $0x1, %ecx
callq 0x3c38
movq %rbx, %rdi
movl $0x6e, %esi
movl $0xf, %edx
xorl %ecx, %ecx
callq 0x3c38
movq %rbx, %rdi
movl $0x6e, %esi
movl $0x37, %edx
xorl %ecx, %ecx
callq 0x3c38
movq %rbx, %rdi
movl $0x6b, %esi
movl $0x20, %edx
movl $0x1, %ecx
callq 0x3c38
movq %rbx, %rdi
movl $0x6b, %esi
movl $0x27, %edx
xorl %ecx, %ecx
callq 0x3c38
movq %rbx, %rdi
movl $0x71, %esi
movl $0x18, %edx
movl $0x1, %ecx
callq 0x3c38
movq %rbx, %rdi
movl $0x71, %esi
movl $0x1f, %edx
xorl %ecx, %ecx
callq 0x3c38
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/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, -0x48(%rbp)
movq %rcx, -0x40(%rbp)
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
leaq 0x50a7(%rip), %rax      # 0x8b68
movq %rax, (%rdi)
leaq 0x248(%rdi), %rax
movq %rax, -0x38(%rbp)
leaq 0x260(%rdi), %rax
movq %rax, -0x30(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, 0x248(%rdi)
movups %xmm0, 0x258(%rdi)
movups %xmm0, 0x268(%rdi)
xorl %r15d, %r15d
movb $0x0, 0x208(%r12,%r15)
cmpb $0x1, (%rbx,%r15)
jne 0x3b2c
movq (%r14,%r15,8), %rdi
callq 0x5c48
movl %eax, %r13d
movq (%r14,%r15,8), %rdi
callq 0x5c52
movzbl %al, %ecx
movsbl %r13b, %esi
movq %r12, %rdi
movl %r15d, %edx
callq 0x3c38
incq %r15
cmpq $0x40, %r15
jne 0x3af5
movq -0x40(%rbp), %r13
movq (%r13), %rdx
cmpq %rdx, 0x8(%r13)
movq -0x38(%rbp), %r14
movq -0x48(%rbp), %r15
je 0x3b91
movl $0x1, %ebx
xorl %eax, %eax
addq %rax, %rdx
movq 0x250(%r12), %rsi
cmpq 0x258(%r12), %rsi
je 0x3b75
movb (%rdx), %al
movb %al, (%rsi)
incq 0x250(%r12)
jmp 0x3b7d
movq %r14, %rdi
callq 0x50cc
movl %ebx, %eax
movq (%r13), %rdx
movq 0x8(%r13), %rcx
subq %rdx, %rcx
incl %ebx
cmpq %rax, %rcx
ja 0x3b52
movq (%r15), %rax
cmpq %rax, 0x8(%r15)
movq -0x30(%rbp), %r14
je 0x3bec
movl $0x1, %ebx
xorl %ecx, %ecx
leaq (%rax,%rcx,4), %rdx
movq 0x268(%r12), %rsi
cmpq 0x270(%r12), %rsi
je 0x3bcd
movl (%rdx), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x268(%r12)
jmp 0x3bd8
movq %r14, %rdi
callq 0x51be
movq (%r15), %rax
movl %ebx, %ecx
movq 0x8(%r15), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
incl %ebx
cmpq %rcx, %rdx
ja 0x3ba5
movq $0x0, 0x278(%r12)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3c0b
jmp 0x3c0b
movq %rax, %rbx
movq -0x30(%rbp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x3c1f
callq 0x20f0
movq -0x38(%rbp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x3c30
callq 0x20f0
movq %rbx, %rdi
callq 0x21c0
// File: /workspace/github_cpp_makefile_star2_O3/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
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpb $0x0, 0x208(%rdi,%r15)
jne 0x3d54
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 0x3cae
leaq 0x2778(%rip), %rax      # 0x63fc
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movl $0x18, %edi
callq 0x2110
movq %rax, -0x30(%rbp)
movq %rax, %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0x55f0
jmp 0x3d4b
cmpl $0x62, %eax
jne 0x3d54
movl $0x18, %edi
callq 0x2110
movq %rax, -0x30(%rbp)
movq %rax, %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0x54f4
jmp 0x3d4b
movl $0x18, %edi
callq 0x2110
movq %rax, -0x30(%rbp)
movq %rax, %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0x5e00
jmp 0x3d4b
movl $0x18, %edi
callq 0x2110
movq %rax, -0x30(%rbp)
movq %rax, %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0x5810
jmp 0x3d4b
movl $0x18, %edi
callq 0x2110
movq %rax, -0x30(%rbp)
movq %rax, %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0x56f0
jmp 0x3d4b
movl $0x18, %edi
callq 0x2110
movq %rax, -0x30(%rbp)
movq %rax, %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0x5c88
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 0x3d6f
jmp 0x3d6f
jmp 0x3d6f
jmp 0x3d6f
jmp 0x3d6f
movq %rax, %rbx
movq -0x30(%rbp), %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x21c0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x5c48
movl %eax, %ebx
movq 0x8(%r14,%r15,8), %rdi
callq 0x5c52
movzbl %bl, %ecx
testb %al, %al
je 0x40e3
leal -0x6b(%rcx), %eax
cmpl $0x7, %eax
ja 0x4104
leaq 0x236e(%rip), %rcx      # 0x643c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x23d5(%rip), %rax      # 0x64b3
jmp 0x416f
leal -0x6b(%rcx), %eax
cmpl $0x7, %eax
ja 0x4112
leaq 0x232a(%rip), %rcx      # 0x641c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x23c9(%rip), %rax      # 0x64cb
jmp 0x416f
cmpl $0x62, %ecx
jne 0x4120
leaq 0x239b(%rip), %rax      # 0x64ab
jmp 0x416f
cmpl $0x62, %ecx
jne 0x4120
leaq 0x23a5(%rip), %rax      # 0x64c3
jmp 0x416f
leaq 0x23ac(%rip), %rax      # 0x64d3
jmp 0x416f
leaq 0x2377(%rip), %rax      # 0x64a7
jmp 0x416f
leaq 0x2386(%rip), %rax      # 0x64bf
jmp 0x416f
leaq 0x2361(%rip), %rax      # 0x64a3
jmp 0x416f
leaq 0x2370(%rip), %rax      # 0x64bb
jmp 0x416f
leaq 0x235b(%rip), %rax      # 0x64af
jmp 0x416f
leaq 0x236a(%rip), %rax      # 0x64c7
jmp 0x416f
leaq 0x2351(%rip), %rax      # 0x64b7
jmp 0x416f
leaq 0x2360(%rip), %rax      # 0x64cf
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x419a
leaq 0x233f(%rip), %rax      # 0x64d7
popq %rbp
retq
incl %esi
andl $0x80000001, %esi       # imm = 0x80000001
leal -0x6b(%rax), %ecx
cmpl $0x1, %esi
jne 0x41c8
cmpl $0x7, %ecx
ja 0x41e6
leaq 0x22c6(%rip), %rax      # 0x647c
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x22ed(%rip), %rax      # 0x64b3
jmp 0x4198
cmpl $0x7, %ecx
ja 0x41f4
leaq 0x2288(%rip), %rax      # 0x645c
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x22e7(%rip), %rax      # 0x64cb
jmp 0x4198
cmpl $0x62, %eax
jne 0x4202
leaq 0x22b9(%rip), %rax      # 0x64ab
jmp 0x4198
cmpl $0x62, %eax
jne 0x4202
leaq 0x22c3(%rip), %rax      # 0x64c3
jmp 0x4198
leaq 0x22ca(%rip), %rax      # 0x64d3
jmp 0x4198
leaq 0x2295(%rip), %rax      # 0x64a7
jmp 0x4198
leaq 0x22a4(%rip), %rax      # 0x64bf
jmp 0x4198
leaq 0x227c(%rip), %rax      # 0x64a3
jmp 0x4198
leaq 0x2288(%rip), %rax      # 0x64bb
jmp 0x4198
leaq 0x2270(%rip), %rax      # 0x64af
jmp 0x4198
leaq 0x227c(%rip), %rax      # 0x64c7
jmp 0x4198
leaq 0x2260(%rip), %rax      # 0x64b7
jmp 0x4198
leaq 0x226c(%rip), %rax      # 0x64cf
jmp 0x4198
// File: /workspace/github_cpp_makefile_star2_O3/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 0x599c
leaq 0x3686(%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_O3/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 0x3a20
movl %eax, %r12d
movl 0xc(%rbx), %edi
callq 0x3a35
movl %eax, %r13d
movl %r14d, %edi
callq 0x3a20
movl %eax, %r15d
movl %r14d, %edi
callq 0x3a35
cmpl %r14d, 0xc(%rbx)
je 0x55ab
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 0x55ab
movq %rbx, %rdi
movl %r14d, %esi
movq -0x30(%rbp), %rdx
callq 0x5b62
cmpl $-0x1, %eax
je 0x55bc
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 0x55ad
// File: /workspace/github_cpp_makefile_star2_O3/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 0x599c
leaq 0x35da(%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_O3/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 0x3a20
movl %eax, %r12d
movl 0xc(%rbx), %edi
callq 0x3a35
movl %eax, %r15d
movl %r14d, %edi
callq 0x3a20
movl %eax, %r13d
movl %r14d, %edi
callq 0x3a35
cmpl %r14d, 0xc(%rbx)
je 0x56a3
subl %r13d, %r12d
movl %r12d, %ecx
negl %ecx
cmovsl %r12d, %ecx
cmpl $0x1, %ecx
ja 0x56a3
subl %eax, %r15d
movl %r15d, %eax
negl %eax
cmovsl %r15d, %eax
cmpl $0x1, %eax
ja 0x56a3
movl %r14d, 0xc(%rbx)
movb $0x1, 0x11(%rbx)
movb $0x1, %al
jmp 0x56a5
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_O3/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 0x56c5
movl %esi, 0xc(%rdi)
movb $0x1, 0x11(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x599c
leaq 0x352a(%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_O3/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 0x57dd
movl $0x28440, %edx          # imm = 0x28440
btl %ecx, %edx
jae 0x57dd
movl %esi, %r14d
movq %rdi, %rbx
movl %r15d, %edi
callq 0x3a20
cmpl $0x1, %eax
jg 0x5781
movl %r14d, %edi
callq 0x3a20
cmpl $0x5, %eax
jg 0x57cf
movl %r15d, %edi
callq 0x3a20
cmpl $0x6, %eax
jl 0x579b
movl %r14d, %edi
callq 0x3a20
cmpl $0x2, %eax
jl 0x57cf
movl %r15d, %edi
callq 0x3a35
cmpl $0x1, %eax
jg 0x57b5
movl %r14d, %edi
callq 0x3a35
cmpl $0x5, %eax
jg 0x57cf
movl %r15d, %edi
callq 0x3a35
cmpl $0x6, %eax
jl 0x57d3
movl %r14d, %edi
callq 0x3a35
cmpl $0x2, %eax
jge 0x57d3
xorl %eax, %eax
jmp 0x57dd
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_O3/tlaloc1313[P]chess-project/Pawn.cpp
// Function: Pawn::Pawn(int, int)
Pawn::Pawn(int startingSquare, int pieceIsWhite){
  location = startingSquare;
  pieceType = 'p';
  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 0x599c
leaq 0x345a(%rip), %rax      # 0x8c88
movq %rax, (%r15)
movl %r14d, 0xc(%r15)
movb $0x70, 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_O3/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 0x3a35
movl %eax, %r15d
movl %ebx, %edi
callq 0x3a35
movl 0xc(%r14), %edi
cmpl %eax, %r15d
jge 0x5a23
callq 0x3a20
movl %eax, %r15d
movl %ebx, %edi
callq 0x3a20
movl %eax, %ecx
movl $0x1, %eax
cmpl %ecx, %r15d
jl 0x5a8a
movl 0xc(%r14), %edi
callq 0x3a20
movl %eax, %r14d
movl %ebx, %edi
callq 0x3a20
xorl %ecx, %ecx
cmpl %eax, %r14d
movl $0x7, %eax
cmovlel %ecx, %eax
jmp 0x5a8a
callq 0x3a35
movl %eax, %r12d
movl %ebx, %edi
callq 0x3a35
movl %eax, %r13d
movl 0xc(%r14), %edi
callq 0x3a20
movl %eax, %r15d
movl %ebx, %edi
callq 0x3a20
movl %eax, %ecx
cmpl %r13d, %r12d
jle 0x5a7b
movl $0x3, %eax
cmpl %ecx, %r15d
jl 0x5a8a
movl 0xc(%r14), %edi
callq 0x3a20
movl %eax, %r14d
movl %ebx, %edi
callq 0x3a20
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %r14d
setg %al
orl $0x4, %eax
jmp 0x5a8a
xorl %eax, %eax
cmpl %ecx, %r15d
setge %al
leal 0x2(,%rax,4), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x59b4
cmpl $0x6, %eax
ja 0x5b51
movl %eax, %eax
leaq 0xa78(%rip), %rcx       # 0x653c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movslq 0xc(%r15), %rax
movslq %r14d, %rcx
movq %rax, %rdx
addq $0x8, %rdx
cmpq %rcx, %rdx
jge 0x5b51
addl $0x8, %eax
cmpb $0x0, (%rbx,%rdx)
leaq 0x8(%rdx), %rdx
je 0x5adb
jmp 0x5b56
movslq 0xc(%r15), %rax
movslq %r14d, %rcx
movq %rax, %rdx
addq $-0x8, %rdx
cmpq %rcx, %rdx
jle 0x5b51
addl $-0x8, %eax
cmpb $0x0, (%rbx,%rdx)
leaq -0x8(%rdx), %rdx
je 0x5afd
jmp 0x5b56
movslq 0xc(%r15), %rax
movslq %r14d, %rcx
movq %rax, %rdx
incq %rdx
cmpq %rcx, %rdx
jge 0x5b51
incl %eax
cmpb $0x0, (%rbx,%rdx)
leaq 0x1(%rdx), %rdx
je 0x5b1e
jmp 0x5b56
movslq 0xc(%r15), %rax
movslq %r14d, %rcx
movq %rax, %rdx
decq %rdx
cmpq %rcx, %rdx
jle 0x5b51
decl %eax
cmpb $0x1, (%rbx,%rdx)
leaq -0x1(%rdx), %rdx
jne 0x5b3e
jmp 0x5b56
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x59b4
decl %eax
cmpl $0x6, %eax
ja 0x5c1d
leaq 0x9cc(%rip), %rcx       # 0x6558
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movslq 0xc(%r15), %rax
movslq %r14d, %rcx
movq %rax, %rdx
addq $0x9, %rdx
cmpq %rcx, %rdx
jge 0x5c1d
addl $0x9, %eax
cmpb $0x0, (%rbx,%rdx)
leaq 0x9(%rdx), %rdx
je 0x5ba3
jmp 0x5c22
movslq 0xc(%r15), %rax
movslq %r14d, %rcx
movq %rax, %rdx
addq $-0x9, %rdx
cmpq %rcx, %rdx
jle 0x5c1d
addl $-0x9, %eax
cmpb $0x0, (%rbx,%rdx)
leaq -0x9(%rdx), %rdx
je 0x5bc5
jmp 0x5c22
movslq 0xc(%r15), %rax
movslq %r14d, %rcx
movq %rax, %rdx
addq $-0x7, %rdx
cmpq %rcx, %rdx
jle 0x5c1d
addl $-0x7, %eax
cmpb $0x0, (%rbx,%rdx)
leaq -0x7(%rdx), %rdx
je 0x5be7
jmp 0x5c22
movslq 0xc(%r15), %rax
movslq %r14d, %rcx
movq %rax, %rdx
addq $0x7, %rdx
cmpq %rcx, %rdx
jge 0x5c1d
addl $0x7, %eax
cmpb $0x1, (%rbx,%rdx)
leaq 0x7(%rdx), %rdx
jne 0x5c09
jmp 0x5c22
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tlaloc1313[P]chess-project/Queen.cpp
// Function: Queen::Queen(int, int)
Queen::Queen(int startingSquare, int pieceIsWhite){
  location = startingSquare;
  pieceType = 'q';
  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 0x599c
leaq 0x307a(%rip), %rax      # 0x8d20
movq %rax, (%r15)
movl %r14d, 0xc(%r15)
movb $0x71, 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_O3/tlaloc1313[P]chess-project/Queen.cpp
// Function: Queen::checkPath(int, bool*)
bool Queen::checkPath(int destination, bool activeArray[64]){
	int dir = direction(destination);
	if (dir%2 == 0) {
		if (checkStraight(destination, activeArray) == -1) {
			return 1;
		}
	} else {
		if (checkDiagonal(destination, activeArray) == -1) {
			return 1;
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %r14d
movq %rdi, %r15
callq 0x59b4
movq %r15, %rdi
movl %r14d, %esi
movq %rbx, %rdx
testb $0x1, %al
jne 0x5cf6
callq 0x5a9a
jmp 0x5cfb
callq 0x5b62
cmpl $-0x1, %eax
je 0x5d04
xorl %eax, %eax
jmp 0x5d06
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tlaloc1313[P]chess-project/Queen.cpp
// Function: Queen::move(int, bool*)
bool Queen::move(int square, bool activeArray[64]){
	int currentLocation = location;
  // Illegal if moving to current position
  if (currentLocation == square) {
    return 0;
  }

  // Move OK if piece is moving to same row or col OR moving diagonally
  // AND path is free
  if (  ((row(currentLocation) == row(square)
        || col(currentLocation) == col(square))
        || (abs(row(square)-row(location)) == abs(col(square)-col(location))))
      && checkPath(square, activeArray)){
    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 0xc(%rdi), %r12d
cmpl %esi, %r12d
je 0x5dc8
movq %rdx, %r15
movl %esi, %r14d
movq %rdi, %rbx
movl %r12d, %edi
callq 0x3a20
movl %eax, %r13d
movl %r14d, %edi
callq 0x3a20
cmpl %eax, %r13d
je 0x5daa
movl %r12d, %edi
callq 0x3a35
movl %eax, %r12d
movl %r14d, %edi
callq 0x3a35
cmpl %eax, %r12d
je 0x5daa
movl %r14d, %edi
callq 0x3a20
movl %eax, %r12d
movl 0xc(%rbx), %edi
callq 0x3a20
subl %eax, %r12d
movl %r12d, %r13d
negl %r13d
cmovsl %r12d, %r13d
movl %r14d, %edi
callq 0x3a35
movl %eax, %r12d
movl 0xc(%rbx), %edi
callq 0x3a35
subl %eax, %r12d
movl %r12d, %eax
negl %eax
cmovsl %r12d, %eax
cmpl %eax, %r13d
jne 0x5dc8
movq (%rbx), %rax
movq %rbx, %rdi
movl %r14d, %esi
movq %r15, %rdx
callq *(%rax)
testb %al, %al
je 0x5dc8
movl %r14d, 0xc(%rbx)
movb $0x1, 0x11(%rbx)
movb $0x1, %al
jmp 0x5dca
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tlaloc1313[P]chess-project/Rook.cpp
// Function: Rook::Rook(int, int)
Rook::Rook(int startingSquare, int pieceIsWhite){
  location = startingSquare;
  pieceType = 'r';
  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 0x599c
leaq 0x2f52(%rip), %rax      # 0x8d70
movq %rax, (%r15)
movl %r14d, 0xc(%r15)
movb $0x72, 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_O3/tlaloc1313[P]chess-project/Rook.cpp
// Function: Rook::move(int, bool*)
bool Rook::move(int square, bool activeArray[64]){
  int currentLocation = location;
  //Illegal if moving to current position
  if (currentLocation == square) {
    return 0;
  }

  // Move is legal if piece is moving to same row or col and path is empty
  if ((row(currentLocation) == row(square) || col(currentLocation) == col(square)) && checkStraight(square, activeArray) == -1) {
    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 0xc(%rdi), %r12d
cmpl %esi, %r12d
je 0x5ea5
movq %rdx, %r15
movl %esi, %r14d
movq %rdi, %rbx
movl %r12d, %edi
callq 0x3a20
movl %eax, %r13d
movl %r14d, %edi
callq 0x3a20
cmpl %eax, %r13d
je 0x5e92
movl %r12d, %edi
callq 0x3a35
movl %eax, %r12d
movl %r14d, %edi
callq 0x3a35
cmpl %eax, %r12d
jne 0x5ea5
movq %rbx, %rdi
movl %r14d, %esi
movq %r15, %rdx
callq 0x5a9a
cmpl $-0x1, %eax
je 0x5eb6
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 0x5ea7
// File: /workspace/github_cpp_makefile_star2_O3/tlaloc1313[P]chess-project/Rook.cpp
// Function: Rook::castle(int)
void Rook::castle(int square){
  if (hasMoved == 0){
    location = square;
    hasMoved = 1;
  }
  return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpb $0x0, 0x11(%rdi)
jne 0x5ed3
movl %esi, 0xc(%rdi)
movb $0x1, 0x11(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/kdungs[P]codecon/src/gloves.cc
// Function: main
int main() {
  auto gm = GloveMatcher{};

  auto line = std::string{};
  getline(std::cin, line);  // ignore number
  while (getline(std::cin, line)) {
    gm.process(line);
  }

  std::cout << gm.matched() << '\n';
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x70, %rsp
xorps %xmm0, %xmm0
leaq 0x38(%rsp), %rbx
movaps %xmm0, -0x8(%rbx)
movaps %xmm0, 0x8(%rbx)
movaps %xmm0, 0x18(%rbx)
leaq 0x68(%rsp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
movups %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
movaps %xmm0, -0x8(%rax)
leaq 0x20(%rsp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
movq 0x2c19(%rip), %rdi      # 0x3fe0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x10c0
movsbl %al, %edx
movq 0x2bfe(%rip), %r14      # 0x3fe0
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x1180
leaq 0x10(%rsp), %r15
leaq 0x30(%rsp), %r12
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x10c0
movsbl %al, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x1180
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x1436
movq %r12, %rdi
movq %r15, %rsi
callq 0x14c0
jmp 0x13f9
xorl %esi, %esi
cmpq 0x50(%rsp), %rsi
sbbl %esi, %esi
orl 0x30(%rsp), %esi
movq 0x2b86(%rip), %rdi      # 0x3fd0
callq 0x1150
leaq 0xf(%rsp), %rsi
movb $0xa, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x1100
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x147b
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x10e0
movq %rbx, %rdi
callq 0x1b80
xorl %eax, %eax
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x1495
movq %rax, %r14
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x14af
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x10e0
movq %rbx, %rdi
callq 0x1b80
movq %r14, %rdi
callq 0x1160
nop
// File: /workspace/github_cpp_makefile_star2_O3/raemarks[P]SuffixTree/src/SuffixTree.cpp
// Function: suffixtree::Tree::Tree(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Tree::Tree(
	std::string& input,
	std::string alphabet
	):
	input(input),
	alphabet(alphabet),
	B(input.length() + 1, 0),
	B_i(0),
	ranDFS(false),
	nIntNodes(1),
	nLeaves(0)
{
	input += '$';

	size_t size = sizeof(Node) * input.length() * 2;
	alloc_buf = (Node*)malloc(size);
	bzero(alloc_buf, size);

	alloc_i = 0;

	nextNodeId = input.length();
	root = newNode(assignId(), nullptr, 0, 0);
	lowestIntNode = root;
	root->suffixLink = root;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r15
movq %rdi, %r14
leaq 0x18(%rdi), %rbx
leaq 0x28(%rdi), %r13
movq %r13, 0x18(%rdi)
movq (%rdx), %rsi
movq 0x8(%rdx), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x2f76
movq %r15, 0x40(%r14)
movl $0x0, 0x50(%r14)
xorl %eax, %eax
movb %al, 0x54(%r14)
movq $0x1, 0x58(%r14)
leaq 0x68(%r14), %r12
movq 0x8(%r15), %rsi
incq %rsi
leaq 0xf(%rsp), %rdx
movb %al, (%rdx)
leaq 0xe(%rsp), %rcx
movq %r12, %rdi
callq 0x2f16
movq %r15, %rdi
movl $0x24, %esi
callq 0x20e0
movq 0x8(%r15), %rbx
imulq $0xb0, %rbx, %rsi
movl $0x1, %edi
callq 0x20a0
movq %rax, (%r14)
leal 0x1(%rbx), %ecx
movl %ecx, 0x48(%r14)
movl $0x1, 0x8(%r14)
movl %ebx, 0x50(%rax)
movq %rax, 0x10(%r14)
movq %rax, 0x60(%r14)
movq %rax, 0x18(%rax)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r15
movq (%r12), %rdi
testq %rdi, %rdi
je 0x2454
movq 0x78(%r14), %rsi
subq %rdi, %rsi
callq 0x2130
jmp 0x2454
movq %rax, %r15
movq (%rbx), %rdi
cmpq %r13, %rdi
je 0x2468
movq (%r13), %rsi
incq %rsi
callq 0x2130
movq %r15, %rdi
callq 0x21c0
// File: /workspace/github_cpp_makefile_star2_O3/raemarks[P]SuffixTree/src/SuffixTree.cpp
// Function: suffixtree::Tree::newNode(int, suffixtree::Node*, int, int)
Node *Tree::newNode(int id, Node *parent, int beg, int len) {
	Node *nxt = &alloc_buf[alloc_i++];
	nxt->id = id;
	nxt->parent = parent;
	nxt->beg = beg;
	nxt->len = len;
	if (parent != nullptr) {
		nxt->stringDepth = parent->stringDepth + len;
	}
	return nxt;
}

// Assembly:
movq (%rdi), %r9
movslq 0x8(%rdi), %rax
leal 0x1(%rax), %r10d
movl %r10d, 0x8(%rdi)
imulq $0x58, %rax, %rdi
leaq (%r9,%rdi), %rax
movl %esi, 0x50(%r9,%rdi)
movq %rdx, (%r9,%rdi)
movl %ecx, 0x48(%r9,%rdi)
movl %r8d, 0x4c(%r9,%rdi)
testq %rdx, %rdx
je 0x24a7
addl 0x54(%rdx), %r8d
movl %r8d, 0x54(%rax)
retq
// File: /workspace/github_cpp_makefile_star2_O3/raemarks[P]SuffixTree/src/SuffixTree.cpp
// Function: suffixtree::Tree::Build()
void Tree::Build() {
	Node *n = root;
	for (int i = 0; i < input.length(); i++) {
		n = insertSuffix(n, i);
	}
	DisplayChildren(root);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rax
movq 0x40(%rdi), %rcx
cmpq $0x0, 0x8(%rcx)
je 0x24ea
xorl %r14d, %r14d
movq %rbx, %rdi
movq %rax, %rsi
movl %r14d, %edx
callq 0x24fc
incq %r14
movq 0x40(%rbx), %rcx
cmpq %r14, 0x8(%rcx)
ja 0x24cb
movq 0x10(%rbx), %rax
movq %rbx, %rdi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2582
// File: /workspace/github_cpp_makefile_star2_O3/raemarks[P]SuffixTree/src/SuffixTree.cpp
// Function: suffixtree::Tree::insertSuffix(suffixtree::Node*, int)
Node*
Tree::insertSuffix(
	Node *prevLeaf,
	int suffix
	)
{
	Node *u = prevLeaf->parent;

	nLeaves++;

	if (prevLeaf == root) {
		return findPathAndInsert(root, suffix, 0, input.length());

	} else if (u->suffixLink != nullptr) {
		//Case 1: u already existed at the start of iteration (suffix-1).
		Node *v = u->suffixLink;
		//u->stringDepth is equivalent to the length of alpha
		return findPathAndInsert(v, suffix, suffix + v->stringDepth,
			input.length() - suffix - v->stringDepth);

	} else if (u->parent != root) {
		//Case 2A: u was created during iteration (suffix-1), and u' is not root
		Node *uprime = u->parent;
		Node *vprime = uprime->suffixLink;
		//Beta is the edge label between u and uprime.
		int beta = u->beg;
		int betalen = u->len;

		Node *v = nodeHopToV(vprime, beta, betalen);
		u->suffixLink = v;

		return findPathAndInsert(v, suffix, suffix + v->stringDepth,
			input.length() - suffix - v->stringDepth);

	} else {
		//Case 2B: u was created during iteration (suffix-1), and u' is the root
		Node *uprime = u->parent; // root
		Node *vprime = uprime->suffixLink; // also the root
		int betaprime = u->beg + 1; // beta = x betaprime
		int betaprimelen = u->len - 1;

		Node *v = nodeHopToV(vprime, betaprime, betaprimelen);
		u->suffixLink = v;

		return findPathAndInsert(v, suffix, suffix + v->stringDepth,
			input.length() - suffix - v->stringDepth);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rax
movq %rdi, %r14
movq (%rsi), %r15
incl 0x5c(%rdi)
movl %edx, %ebx
movq 0x10(%rdi), %rsi
cmpq %rax, %rsi
je 0x2537
movq 0x18(%r15), %rax
testq %rax, %rax
jne 0x255f
movq (%r15), %rcx
movq 0x18(%rcx), %rax
movl 0x48(%r15), %edx
cmpq %rsi, %rcx
je 0x2548
movl 0x4c(%r15), %ecx
jmp 0x2550
movq 0x40(%r14), %rax
movl 0x8(%rax), %r8d
movq %r14, %rdi
movl %ebx, %edx
xorl %ecx, %ecx
jmp 0x2577
incl %edx
movl 0x4c(%r15), %ecx
decl %ecx
movq %r14, %rdi
movq %rax, %rsi
callq 0x293e
movq %rax, 0x18(%r15)
movl 0x54(%rax), %ecx
addl %ebx, %ecx
movq 0x40(%r14), %rdx
movl 0x8(%rdx), %r8d
subl %ecx, %r8d
movq %r14, %rdi
movq %rax, %rsi
movl %ebx, %edx
popq %rbx
popq %r14
popq %r15
jmp 0x2674
nop