LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/neubig[P]egret/Egret/src/utils.cpp
// Function: doubleToString[abi:cxx11](double)
string doubleToString(double i)
{
  stringstream ss;
  ss.precision(20);
  if(i==0)
	  return "0.0";
  ss<<i;
  string ans;
  ss>>ans;
  return ans;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movsd %xmm0, (%rsp)
movq %rdi, %rbx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x3200
movq (%r14), %rax
movq -0x18(%rax), %rax
movq $0x14, 0x10(%rsp,%rax)
xorpd %xmm0, %xmm0
movsd (%rsp), %xmm1
ucomisd %xmm0, %xmm1
jne 0x40a3d
jp 0x40a3d
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x148a(%rip), %rsi      # 0x41eb6
leaq 0x1486(%rip), %rdx      # 0x41eb9
movq %rbx, %rdi
callq 0xb8a2
jmp 0x40a6b
movapd %xmm1, %xmm0
leaq 0x18(%rsp), %rdi
callq 0x34a0
leaq 0x10(%rbx), %r15
movq %r15, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x33a0
movq 0x15536(%rip), %rsi     # 0x55fa8
leaq 0x8(%rsp), %rdi
callq 0x3230
leaq 0x88(%rsp), %rdi
callq 0x30e0
movq %rbx, %rax
addq $0x190, %rsp            # imm = 0x190
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x40ab6
movq (%r15), %rsi
incq %rsi
callq 0x32e0
jmp 0x40ab6
jmp 0x40ab3
movq %rax, %r14
movq 0x154eb(%rip), %rsi     # 0x55fa8
leaq 0x8(%rsp), %rdi
callq 0x3230
leaq 0x88(%rsp), %rdi
callq 0x30e0
movq %r14, %rdi
callq 0x3530
// File: /workspace/github_cpp_makefile_star2_O1/neubig[P]egret/Egret/src/utils.cpp
// Function: replaceSubStr(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
string& replaceSubStr(string& in, string oldSub, string newSub)
{
	size_t pos=0;
	while(true)
	{
		pos=in.find(oldSub,pos);
		if(pos!=string::npos)
		{
			in.replace(pos,oldSub.length(),newSub);
			pos+=newSub.length();
		}
		else break;
	}
	return in;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq (%rsi), %rsi
movq 0x8(%r15), %rcx
xorl %edx, %edx
callq 0x3510
cmpq $-0x1, %rax
je 0x40b39
movq %rax, %r12
movq 0x8(%r15), %rdx
movq (%rbx), %rcx
movq 0x8(%rbx), %r8
movq %r14, %rdi
movq %r12, %rsi
callq 0x3330
addq 0x8(%rbx), %r12
movq (%r15), %rsi
movq 0x8(%r15), %rcx
movq %r14, %rdi
movq %r12, %rdx
callq 0x3510
movq %rax, %r12
cmpq $-0x1, %rax
jne 0x40b04
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/ruankotovich[P]B-Tree/src/iohandler.cpp
// Function: IOHandler::parseNext()
void IOHandler::parseNext()
{
  if (fscanf(this->file, "\"%d\";", &this->idBuffer) == 1) {
    // READ TITLE
    readColumn(this->file, this->readBuffer, ';');

    std::memcpy(this->titleBuffer, this->readBuffer, FIELD_TITLE_MAX_SIZE);
    this->titleBuffer[FIELD_TITLE_MAX_SIZE - 1] = '\0';
    // READ YEAR
    fscanf(this->file, "\"%d\";", &this->yearBuffer);

    // READ AUTHOR
    readColumn(this->file, this->readBuffer, ';');
    std::memcpy(this->authorsBuffer, this->readBuffer, FIELD_AUTHORS_MAX_SIZE);
    this->authorsBuffer[FIELD_AUTHORS_MAX_SIZE - 1] = '\0';
    // READ CITATION
    fscanf(this->file, "\"%d\";", &this->citationsBuffer);

    // READ DATE
    readColumn(this->file, this->readBuffer, ';');
    std::memcpy(this->dateBuffer, this->readBuffer, FIELD_DATE_MAX_SIZE);
    this->dateBuffer[FIELD_DATE_MAX_SIZE - 1] = '\0';
    // READ SNIPPET
    readColumn(this->file, readBuffer, ';');
    std::memcpy(this->snippetBuffer, this->readBuffer, FIELD_SNIPPET_MAX_SIZE);
    this->snippetBuffer[FIELD_SNIPPET_MAX_SIZE - 1] = '\0';
    this->state = IOHANDLER_READY;
  } else {
    this->state = IOHANDLER_END;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
leaq 0xc(%rbx), %rdx
leaq 0x29f6(%rip), %rsi      # 0x4004
xorl %eax, %eax
callq 0x1170
movb $0x2, %bpl
cmpl $0x1, %eax
jne 0x16f4
movq (%rbx), %rdi
leaq 0x958(%rbx), %r14
movq %r14, %rsi
callq 0x1703
leaq 0x10(%rbx), %rdi
movl $0x12c, %edx            # imm = 0x12C
movq %r14, %rsi
callq 0x1090
xorl %ebp, %ebp
movb %bpl, 0x13b(%rbx)
movq (%rbx), %rdi
leaq 0x13c(%rbx), %rdx
leaq 0x29a6(%rip), %r15      # 0x4004
movq %r15, %rsi
xorl %eax, %eax
callq 0x1170
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x1703
leaq 0x140(%rbx), %rdi
movl $0x400, %edx            # imm = 0x400
movq %r14, %rsi
callq 0x1090
movb %bpl, 0x53f(%rbx)
movq (%rbx), %rdi
leaq 0x540(%rbx), %rdx
movq %r15, %rsi
xorl %eax, %eax
callq 0x1170
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x1703
movl 0x968(%rbx), %eax
movl %eax, 0x554(%rbx)
movups 0x958(%rbx), %xmm0
movups %xmm0, 0x544(%rbx)
movb %bpl, 0x557(%rbx)
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x1703
leaq 0x558(%rbx), %rdi
movl $0x400, %edx            # imm = 0x400
movq %r14, %rsi
callq 0x1090
movb %bpl, 0x957(%rbx)
movb %bpl, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/ruankotovich[P]B-Tree/src/iohandler.cpp
// Function: readColumn(_IO_FILE*, char*, char)
static inline void readColumn(FILE* file, char* buffer, char previous)
{
  char current = fgetc(file);
  int pointer = 0;
  char type;
  type = pairClass(previous, current);
  if (type != R_SON) {
    current = fgetc(file);
    do {
      previous = current;
      current = fgetc(file);
      if (type < R_SOR) {
        buffer[pointer++] = previous;
      }
    } while ((type = after_pairClass(previous, current)) < R_EOC);
  } else {
    fscanf(file, "ULL\n");
    fscanf(file, "ULL\r\n");
    fscanf(file, "ULL;");
    pointer = 1;
  }
  buffer[pointer - 1] = '\0';
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x1130
cmpb $0x4e, %al
jne 0x1754
leaq 0x28f0(%rip), %rsi      # 0x4011
movq %r14, %rdi
xorl %eax, %eax
callq 0x1170
leaq 0x28e4(%rip), %rsi      # 0x4016
movq %r14, %rdi
xorl %eax, %eax
callq 0x1170
leaq 0x28d9(%rip), %rsi      # 0x401c
movq %r14, %rdi
xorl %eax, %eax
callq 0x1170
movl $0x1, %eax
jmp 0x17d3
cmpb $0x3b, %al
sete %r15b
addb %r15b, %r15b
movq %r14, %rdi
callq 0x1130
xorl %ebp, %ebp
movl %eax, %r12d
movq %r14, %rdi
callq 0x1130
testb %r15b, %r15b
jne 0x1780
movslq %ebp, %rcx
incl %ebp
movb %r12b, (%rbx,%rcx)
cmpb $0xd, %r12b
je 0x17b9
movzbl %r12b, %ecx
cmpl $0x3b, %ecx
je 0x17ad
cmpl $0x22, %ecx
jne 0x17b4
movb $0x2, %r15b
cmpb $0xa, %al
je 0x17ca
movzbl %al, %ecx
cmpl $0x3b, %ecx
je 0x17ca
cmpl $0xff, %ecx
jne 0x17b4
jmp 0x17ca
movb $0x1, %r15b
cmpb $0x22, %al
je 0x17ca
xorl %r15d, %r15d
jmp 0x17ca
cmpb $-0x1, %al
sete %cl
cmpb $0xa, %al
sete %r15b
orb %cl, %r15b
addb %r15b, %r15b
cmpb $0x2, %r15b
jb 0x1767
movslq %ebp, %rax
movb $0x0, -0x1(%rbx,%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/ruankotovich[P]B-Tree/src/iohandler.cpp
// Function: IOHandler::operator>>(Article_t&)
void IOHandler::operator>>(Article_t& article)
{
  article.id = idBuffer;
  article.year = yearBuffer;
  article.citations = citationsBuffer;
  std::memcpy(article.title, this->titleBuffer, FIELD_TITLE_MAX_SIZE);
  std::memcpy(article.authors, this->authorsBuffer, FIELD_AUTHORS_MAX_SIZE);
  std::memcpy(article.date, this->dateBuffer, FIELD_DATE_MAX_SIZE);
  std::memcpy(article.snippet, this->snippetBuffer, FIELD_SNIPPET_MAX_SIZE);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0xc(%rdi), %eax
movl %eax, (%rsi)
movl 0x13c(%rdi), %eax
movl %eax, 0x130(%rsi)
movl 0x540(%rdi), %eax
movl %eax, 0x534(%rsi)
leaq 0x4(%rsi), %rdi
leaq 0x10(%r14), %rsi
movl $0x12c, %edx            # imm = 0x12C
callq 0x1090
leaq 0x134(%rbx), %rdi
leaq 0x140(%r14), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x1090
movups 0x544(%r14), %xmm0
movups %xmm0, 0x538(%rbx)
movl 0x554(%r14), %eax
movl %eax, 0x548(%rbx)
addq $0x54c, %rbx            # imm = 0x54C
addq $0x558, %r14            # imm = 0x558
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1090
// File: /workspace/github_cpp_makefile_star2_O1/ruankotovich[P]B-Tree/src/secondarybtree.cpp
// Function: SecondaryBTreeNode::insert(SecondaryBTreeDataMap&)
int SecondaryBTreeNode::insert(SecondaryBTreeDataMap& key)
{ // [TROCAR]

    int i;

    for (i = count; i >= 1; i--) {
        if (key > keys[i - 1]) {
            keys[i] = key;
            break;
        } else {
            keys[i] = keys[i - 1];
        }
    }
    if (i == 0) {
        keys[0] = key;
    }

    count++;

    return i;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
movzwl (%rdi), %ebp
movl %ebp, %r14d
testl %ebp, %ebp
je 0x1a22
leaq 0x4(%rbx), %r13
movl %ebp, %r14d
imulq $0x130, %r14, %rax      # imm = 0x130
leaq (%rax,%rbx), %r12
addq $-0x12c, %r12           # imm = 0xFED4
movq %r15, %rdi
movq %r12, %rsi
callq 0x1100
testl %eax, %eax
jg 0x19f8
decq %r14
leaq 0x130(%r12), %rdi
movl $0x12c, %edx            # imm = 0x12C
movq %r12, %rsi
callq 0x1090
movl 0x12c(%r12), %eax
movl %eax, 0x25c(%r12)
leaq 0x1(%r14), %rax
addq $-0x130, %r12           # imm = 0xFED0
cmpq $0x1, %rax
jg 0x19ae
jmp 0x1a22
movl %r14d, %eax
imulq $0x130, %rax, %r12      # imm = 0x130
leaq (%r12,%r13), %rdi
movl $0x12c, %edx            # imm = 0x12C
movq %r15, %rsi
callq 0x1090
movl 0x12c(%r15), %eax
movl %eax, 0x12c(%r13,%r12)
testl %r14d, %r14d
jne 0x1a45
leaq 0x4(%rbx), %rdi
movl $0x12c, %edx            # imm = 0x12C
movq %r15, %rsi
callq 0x1090
movl 0x12c(%r15), %eax
movl %eax, 0x130(%rbx)
incl %ebp
movw %bp, (%rbx)
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/ruankotovich[P]B-Tree/src/secondarybtree.cpp
// Function: SecondaryBTree::buildIndex(_IO_FILE*)
void SecondaryBTree::buildIndex(FILE* indexFile)
{
    rewind(indexFile);
    fwrite(&rootOffset, sizeof(AbstractBlock_t), 1, indexFile);

    fseek(indexFile, sizeof(AbstractBlock_t), SEEK_SET);
    fwrite(root, sizeof(AbstractBlock_t), 1, indexFile);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x1040
leaq 0x140(%r14), %rdi
movl $0x1000, %esi           # imm = 0x1000
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1180
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
xorl %edx, %edx
callq 0x10d0
movq 0x138(%r14), %rdi
movl $0x1000, %esi           # imm = 0x1000
movl $0x1, %edx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1180
// File: /workspace/github_cpp_makefile_star2_O1/ruankotovich[P]B-Tree/src/secondarybtree.cpp
// Function: SecondaryBTree::readRoot(_IO_FILE*)
void SecondaryBTree::readRoot(FILE* indexFile)
{
    rewind(indexFile);
    fread(&rootOffset, sizeof(int), 1, indexFile);

    SecondaryBTreeNodeReinterpret* reinterpretation = (SecondaryBTreeNodeReinterpret*)this->root;

    fseek(indexFile, sizeof(AbstractBlock_t) * rootOffset, SEEK_SET);
    fread(&reinterpretation->block, sizeof(AbstractBlock_t), 1, indexFile);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x1040
leaq 0x140(%r14), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1110
movq 0x138(%r14), %r15
movslq 0x140(%r14), %rsi
shlq $0xc, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x10d0
movl $0x1000, %esi           # imm = 0x1000
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
popq %rbx
popq %r14
popq %r15
jmp 0x1110
// File: /workspace/github_cpp_makefile_star2_O1/ruankotovich[P]B-Tree/src/secondarybtree.cpp
// Function: SecondaryBTree::insert(SecondaryBTreeDataMap&, _IO_FILE*)
void SecondaryBTree::insert(SecondaryBTreeDataMap& key, FILE* indexFile)
{ // [TROCAR]
    auto result = insertRecursive(key, root, rootOffset, indexFile);

    if (result.hasBeenSplit) { // se tiver um promovido vindo de um split abaixo
        SecondaryBTreeNodeReinterpret* newRoot = new SecondaryBTreeNodeReinterpret();
        newRoot->node.insert(result.promotedKey); // insere a key promovida do nível abaixo
        newRoot->node.blockPointers[0] = rootOffset; //apontador esquerdo -> antiga raíz

        // considerando que o block splittado já foi salvo no arquivo na função insertRecursive
        newRoot->node.blockPointers[1] = result.newBlockOffset;
        newRoot->node.countPointers = 2;

        // salvar o newRoot no arquivo da SecondaryBTree
        rootOffset = writeNewNode(&newRoot->node, indexFile);

        // atualizar o header
        fseek(indexFile, 0, SEEK_SET);

        fwrite(&rootOffset, sizeof(AbstractBlock_t), 1, indexFile);

        delete (root);
        root = newRoot;

        fseek(indexFile, 0, SEEK_END);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x140, %rsp            # imm = 0x140
movq %rdx, %rbx
movq %rsi, %rdx
movq %rdi, %r14
movq 0x138(%rdi), %rcx
movl 0x140(%rdi), %r8d
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %r9
callq 0x1b42
cmpb $0x1, (%r15)
jne 0x2527
leaq 0x140(%r14), %r12
movl $0x1000, %edi           # imm = 0x1000
callq 0x10b0
movq %rax, %r15
movl $0x0, (%rax)
leaq 0xc(%rsp), %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x1976
movl 0x140(%r14), %eax
movl %eax, 0xe44(%r15)
movl 0x130(%r13), %eax
movl %eax, 0xe48(%r15)
movw $0x2, 0x2(%r15)
movq %rbx, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x10d0
movl $0x1000, %esi           # imm = 0x1000
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x1180
movq %rbx, %rdi
callq 0x1030
shrq $0xc, %rax
decl %eax
movl %eax, 0x140(%r14)
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x10d0
movl $0x1000, %esi           # imm = 0x1000
movl $0x1, %edx
movq %r12, %rdi
movq %rbx, %rcx
callq 0x1180
movq 0x138(%r14), %rdi
testq %rdi, %rdi
je 0x2501
movl $0x1000, %esi           # imm = 0x1000
callq 0x10c0
movq %r15, 0x138(%r14)
movq %rbx, %rdi
xorl %esi, %esi
movl $0x2, %edx
addq $0x140, %rsp            # imm = 0x140
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x10d0
addq $0x140, %rsp            # imm = 0x140
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/ruankotovich[P]B-Tree/src/primarybtree.cpp
// Function: PrimaryBTreeNode::insert(int)
unsigned short PrimaryBTreeNode::insert(int key)
{ // [TROCAR]

    unsigned short i;

    for (i = count; i >= 1; i--) {
        if (key > keys[i - 1]) {
            keys[i] = key;
            break;
        } else {
            keys[i] = keys[i - 1];
        }
    }
    if (i == 0) {
        keys[0] = key;
    }

    count++;

    return i;
}

// Assembly:
movzwl (%rdi), %ecx
movl %ecx, %eax
testw %cx, %cx
je 0x28d7
leaq 0x4(%rdi), %rdx
movl %ecx, %eax
movzwl %ax, %r8d
leal -0x1(%r8), %r9d
movl (%rdx,%r9,4), %r9d
leaq (%rdx,%r8,4), %r8
cmpl %esi, %r9d
jl 0x28db
movl %r9d, (%r8)
decw %ax
jne 0x28b8
xorl %eax, %eax
leaq 0x4(%rdi), %r8
movl %esi, (%r8)
incl %ecx
movw %cx, (%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/ruankotovich[P]B-Tree/src/primarybtree.cpp
// Function: PrimaryBTree::buildIndex(_IO_FILE*)
void PrimaryBTree::buildIndex(FILE* indexFile)
{
    rewind(indexFile);
    fwrite(&rootOffset, sizeof(AbstractBlock_t), 1, indexFile);

    fseek(indexFile, sizeof(AbstractBlock_t), SEEK_SET);
    fwrite(root, sizeof(AbstractBlock_t), 1, indexFile);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x1040
leaq 0x18(%r14), %rdi
movl $0x1000, %esi           # imm = 0x1000
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1180
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
xorl %edx, %edx
callq 0x10d0
movq 0x10(%r14), %rdi
movl $0x1000, %esi           # imm = 0x1000
movl $0x1, %edx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1180
// File: /workspace/github_cpp_makefile_star2_O1/ruankotovich[P]B-Tree/src/primarybtree.cpp
// Function: PrimaryBTree::readRoot(_IO_FILE*)
void PrimaryBTree::readRoot(FILE* indexFile)
{
    rewind(indexFile);
    fread(&rootOffset, sizeof(unsigned short), 1, indexFile);

    PrimaryBTreeNodeReinterpret* reinterpretation = (PrimaryBTreeNodeReinterpret*)this->root;

    fseek(indexFile, sizeof(AbstractBlock_t) * rootOffset, SEEK_SET);
    fread(&reinterpretation->block, sizeof(AbstractBlock_t), 1, indexFile);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x1040
leaq 0x18(%r14), %rdi
movl $0x2, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1110
movq 0x10(%r14), %r15
movzwl 0x18(%r14), %esi
shll $0xc, %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x10d0
movl $0x1000, %esi           # imm = 0x1000
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
popq %rbx
popq %r14
popq %r15
jmp 0x1110
nop
// File: /workspace/github_cpp_makefile_star2_O1/ruankotovich[P]B-Tree/src/primarybtree.cpp
// Function: PrimaryBTree::insert(int, _IO_FILE*)
void PrimaryBTree::insert(int key, FILE* indexFile)
{ // [TROCAR]
    auto result = insertRecursive(key, root, rootOffset, indexFile);

    if (result.hasBeenSplit) { // se tiver um promovido vindo de um split abaixo
        PrimaryBTreeNodeReinterpret* newRoot = new PrimaryBTreeNodeReinterpret();
        newRoot->node.insert(result.promotedKey); // insere a key promovida do nível abaixo
        newRoot->node.blockPointers[0] = rootOffset; //apontador esquerdo -> antiga raíz

        // considerando que o block splittado já foi salvo no arquivo na função insertRecursive
        newRoot->node.blockPointers[1] = result.newBlockOffset;
        newRoot->node.countPointers = 2;

        // salvar o newRoot no arquivo da PrimaryBTree
        rootOffset = writeNewNode(&newRoot->node, indexFile);

        // atualizar o header
        fseek(indexFile, 0, SEEK_SET);

        fwrite(&rootOffset, sizeof(AbstractBlock_t), 1, indexFile);

        delete (root);
        root = newRoot;

        fseek(indexFile, 0, SEEK_END);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movq 0x10(%rdi), %rdx
movzwl 0x18(%rdi), %ecx
movq %rbx, %r8
callq 0x29c4
movq %rax, %r13
testb $0x1, %r13b
je 0x305f
movl %edx, %ebp
leaq 0x18(%r14), %r12
movl $0x1000, %edi           # imm = 0x1000
callq 0x10b0
movq %rax, %r15
movl $0x0, (%rax)
shrq $0x20, %r13
movq %rax, %rdi
movl %r13d, %esi
callq 0x28a8
movzwl 0x18(%r14), %eax
movw %ax, 0xaa4(%r15)
movw %bp, 0xaa6(%r15)
movw $0x2, 0x2(%r15)
movq %rbx, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x10d0
movl $0x1000, %esi           # imm = 0x1000
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x1180
movq %rbx, %rdi
callq 0x1030
shrl $0xc, %eax
decl %eax
movw %ax, 0x18(%r14)
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x10d0
movl $0x1000, %esi           # imm = 0x1000
movl $0x1, %edx
movq %r12, %rdi
movq %rbx, %rcx
callq 0x1180
movq 0x10(%r14), %rdi
testq %rdi, %rdi
je 0x303e
movl $0x1000, %esi           # imm = 0x1000
callq 0x10c0
movq %r15, 0x10(%r14)
movq %rbx, %rdi
xorl %esi, %esi
movl $0x2, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10d0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/ruankotovich[P]B-Tree/src/article.cpp
// Function: Article_t::Article_t(int, char*, int, char*, int, char*, char*)
Article_t::Article_t(int id, char title[FIELD_TITLE_MAX_SIZE], int year, char authors[FIELD_AUTHORS_MAX_SIZE], int citations, char date[FIELD_DATE_MAX_SIZE], char snippet[FIELD_SNIPPET_MAX_SIZE])
: id(id)
, year(year)
, citations(citations)
{
  std::memcpy(this->title, title, FIELD_TITLE_MAX_SIZE);
  std::memcpy(this->authors, authors, FIELD_AUTHORS_MAX_SIZE);
  std::memcpy(this->date, date, FIELD_DATE_MAX_SIZE);
  std::memcpy(this->snippet, snippet, FIELD_SNIPPET_MAX_SIZE);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r15
movq %rdx, %rax
movq %rdi, %r14
movq 0x38(%rsp), %rbx
movq 0x30(%rsp), %r12
movl %esi, (%rdi)
movl %ecx, 0x130(%rdi)
movl %r9d, 0x534(%rdi)
addq $0x4, %rdi
movl $0x12c, %edx            # imm = 0x12C
movq %rax, %rsi
callq 0x1090
leaq 0x134(%r14), %rdi
movl $0x400, %edx            # imm = 0x400
movq %r15, %rsi
callq 0x1090
movups (%r12), %xmm0
movups %xmm0, 0x538(%r14)
movl 0x10(%r12), %eax
movl %eax, 0x548(%r14)
addq $0x54c, %r14            # imm = 0x54C
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1090
// File: /workspace/github_cpp_makefile_star2_O1/ruankotovich[P]B-Tree/src/article.cpp
// Function: Article_t::toString[abi:cxx11]()
std::string Article_t::toString() {
  std::stringstream ss;
  ss << "> Id: " << id << "\n\n";
  ss << "> Title: \"" << title << "\"" << "\n\n";
  ss << "> Year: " << year << "\n\n";
  ss << "> Authors: \"" << authors << "\"" << "\n\n";
  ss << "> Citations: \"" << citations << "\"" << "\n\n";
  ss << "> Date: " << date << "\n\n";
  ss << "> Snippet: \"" << snippet << "\"";

  return ss.str();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rsi, %r15
movq %rdi, %rbx
movq %rsp, %rdi
callq 0x1070
leaq 0x10(%rsp), %r14
leaq 0xd6c(%rip), %rsi       # 0x403c
movl $0x6, %edx
movq %r14, %rdi
callq 0x10e0
movl (%r15), %esi
movq %r14, %rdi
callq 0x1150
leaq 0xd54(%rip), %rsi       # 0x4043
movl $0x2, %edx
movq %rax, %rdi
callq 0x10e0
leaq 0xd43(%rip), %rsi       # 0x4046
movl $0xa, %edx
movq %r14, %rdi
callq 0x10e0
leaq 0x4(%r15), %r12
movq %r12, %rdi
callq 0x1060
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x10e0
leaq 0xd1e(%rip), %rsi       # 0x404f
movl $0x1, %edx
movq %r14, %rdi
callq 0x10e0
leaq 0xcfe(%rip), %rsi       # 0x4043
movl $0x2, %edx
movq %r14, %rdi
callq 0x10e0
leaq 0xcf8(%rip), %rsi       # 0x4051
movl $0x8, %edx
movq %r14, %rdi
callq 0x10e0
movl 0x130(%r15), %esi
movq %r14, %rdi
callq 0x1150
leaq 0xcc7(%rip), %rsi       # 0x4043
movl $0x2, %edx
movq %rax, %rdi
callq 0x10e0
leaq 0xcca(%rip), %rsi       # 0x405a
movl $0xc, %edx
movq %r14, %rdi
callq 0x10e0
leaq 0x134(%r15), %r12
movq %r12, %rdi
callq 0x1060
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x10e0
leaq 0xc8e(%rip), %rsi       # 0x404f
movl $0x1, %edx
movq %r14, %rdi
callq 0x10e0
leaq 0xc6e(%rip), %rsi       # 0x4043
movl $0x2, %edx
movq %r14, %rdi
callq 0x10e0
leaq 0xc7e(%rip), %rsi       # 0x4067
movl $0xe, %edx
movq %r14, %rdi
callq 0x10e0
movl 0x534(%r15), %esi
movq %r14, %rdi
callq 0x1150
movq %rax, %r12
leaq 0xc40(%rip), %rsi       # 0x404f
movl $0x1, %edx
movq %rax, %rdi
callq 0x10e0
leaq 0xc20(%rip), %rsi       # 0x4043
movl $0x2, %edx
movq %r12, %rdi
callq 0x10e0
leaq 0xc3f(%rip), %rsi       # 0x4076
movl $0x8, %edx
movq %r14, %rdi
callq 0x10e0
leaq 0x538(%r15), %r12
movq %r12, %rdi
callq 0x1060
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x10e0
leaq 0xbdb(%rip), %rsi       # 0x4043
movl $0x2, %edx
movq %r14, %rdi
callq 0x10e0
leaq 0xc03(%rip), %rsi       # 0x407f
movl $0xc, %edx
movq %r14, %rdi
callq 0x10e0
addq $0x54c, %r15            # imm = 0x54C
movq %r15, %rdi
callq 0x1060
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x10e0
leaq 0xba2(%rip), %rsi       # 0x404f
movl $0x1, %edx
movq %r14, %rdi
callq 0x10e0
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x1140
movq 0x2afa(%rip), %rsi      # 0x5fc8
movq %rsp, %rdi
callq 0x1080
leaq 0x80(%rsp), %rdi
callq 0x1050
movq %rbx, %rax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x2ac9(%rip), %rsi      # 0x5fc8
movq %rsp, %rdi
callq 0x1080
leaq 0x80(%rsp), %rdi
callq 0x1050
movq %rbx, %rdi
callq 0x1160
// File: /workspace/github_cpp_makefile_star2_O1/ruankotovich[P]B-Tree/src/block.cpp
// Function: Block_t::tryPutArticle(Article_t&)
bool Block_t::tryPutArticle(Article_t& article)
{
  Header_Interpretation_t* headerOnBytes = (Header_Interpretation_t*)(&this->content[0]);
  Tail_Interpretation_t* tailOnBytes = (Tail_Interpretation_t*)(&this->content[TAIL_LOCATION]);

  unsigned char position = headerOnBytes->struct_header.count;
  unsigned int realPosition = DATA_LOCATION + (position * sizeof(Article_t));

  if (realPosition < BLOCK_SIZE - sizeof(Article_t)) {
    Article_Interpretation_t* articleOnBytes = (Article_Interpretation_t*)(&this->content[realPosition]);

    std::memcpy(&articleOnBytes->struct_article, &article, sizeof(Article_Interpretation_t));

    ++headerOnBytes->struct_header.count;
    tailOnBytes->struct_tail.verificationMask = headerOnBytes->struct_header.verificationMask = VERIFICATION_MASK;

    return true;
  }

  return false;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movb 0x8(%rdi), %bpl
testb %bpl, %bpl
jne 0x3559
movq %rdi, %rbx
addq $0x9, %rdi
movl $0x94c, %edx            # imm = 0x94C
callq 0x1090
movb $0x1, 0x8(%rbx)
movabsq $0x1591c7f96733dc5d, %rax # imm = 0x1591C7F96733DC5D
movq %rax, (%rbx)
movq %rax, 0xff7(%rbx)
testb %bpl, %bpl
sete %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/ruankotovich[P]B-Tree/src/hashfilefactory.cpp
// Function: HashFileFactory::createBinaryFilePerfectHash(_IO_FILE*, _IO_FILE*)
void HashFileFactory::createBinaryFilePerfectHash(FILE *toRead, FILE *toWrite) {
  IOHandler handler(toRead);

  FILE* primaryIndexFileWrite = fopen("files/primaryindex.block", "wb+");
  FILE* secondaryIndexFileWrite = fopen("files/secondaryindex.block", "wb+");


  PrimaryBTree pBtree;
  SecondaryBTree sBtree;

  pBtree.buildIndex(primaryIndexFileWrite);
  sBtree.buildIndex(secondaryIndexFileWrite);

  this->hashSize = handler.getBiggestId();

  Article_t currentArticle;
  SecondaryBTreeDataMap key;

  while (handler.hasNext()) {
    handler >> currentArticle;
    Block_t currentBlock;
    currentBlock.tryPutArticle(currentArticle);
    currentBlock.validate();

    std::memcpy(key.key, currentArticle.title, SECONDARY_KEY_LENGTH);
    key.dataPointer = currentArticle.id;

    pBtree.insert(currentArticle.id, primaryIndexFileWrite);
    sBtree.insert(key, secondaryIndexFileWrite);

    fseek(toWrite, currentArticle.id * sizeof(Block_t), SEEK_SET);
    fwrite(&currentBlock, sizeof(Block_t), 1, toWrite);

    handler.parseNext();
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3558, %rsp           # imm = 0x3558
movq %rdx, %rbx
movq %rdi, 0x8(%rsp)
leaq 0xc00(%rsp), %rdi
callq 0x187c
leaq 0xaab(%rip), %rdi       # 0x408c
leaq 0xa4c(%rip), %r15       # 0x4034
movq %r15, %rsi
callq 0x10f0
movq %rax, %r14
leaq 0xaab(%rip), %rdi       # 0x40a5
movq %r15, %rsi
callq 0x10f0
movq %rax, %r12
leaq 0x18(%rsp), %r13
movq %r13, %rdi
callq 0x28e4
leaq 0x168(%rsp), %rbp
movq %rbp, %rdi
callq 0x1a5c
movq %r13, %rdi
movq %r14, 0x10(%rsp)
movq %r14, %rsi
callq 0x2916
movq %rbp, %rdi
movq %r12, %r15
movq %r12, %rsi
callq 0x1a86
leaq 0xc00(%rsp), %r14
movq %r14, %rdi
callq 0x132c
movq 0x8(%rsp), %rcx
movl %eax, (%rcx)
leaq 0x2b4(%rsp), %rdi
callq 0x321c
movq %r14, %rdi
callq 0x1874
testb %al, %al
je 0x373f
leaq 0xc00(%rsp), %r13
leaq 0x2b4(%rsp), %rbp
leaq 0x2558(%rsp), %r12
leaq 0x38(%rsp), %r14
movq %r13, %rdi
movq %rbp, %rsi
callq 0x17e2
movq %r12, %rdi
callq 0x35b0
movq %r12, %rdi
movq %rbp, %rsi
callq 0x3524
movq %r12, %rdi
callq 0x3578
movl $0x12c, %edx            # imm = 0x12C
movq %r14, %rdi
leaq 0x2b8(%rsp), %rsi
callq 0x1090
movl 0x2b4(%rsp), %esi
movl %esi, 0x164(%rsp)
leaq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rdx
callq 0x2f62
leaq 0x168(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2400
movslq 0x2b4(%rsp), %rsi
shlq $0xc, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x10d0
movl $0x1000, %esi           # imm = 0x1000
movl $0x1, %edx
movq %r12, %rdi
movq %rbx, %rcx
callq 0x1180
movq %r13, %rdi
callq 0x15f6
movq %r13, %rdi
callq 0x1874
testb %al, %al
jne 0x3691
addq $0x3558, %rsp           # imm = 0x3558
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/ruankotovich[P]B-Tree/src/hashfinder.cpp
// Function: getArticleFromHash(int, Article_t*, _IO_FILE*)
bool getArticleFromHash(int id, Article_t *article, FILE *toRead) {
  Block_t block;

  fseek(toRead, sizeof(Block_t) * id, SEEK_SET);
  fread(&block, sizeof(Block_t), 1, toRead);

  if (!block.isValid()) {
    return false;
  }

  memcpy(article, block.getArticle(0), sizeof(Article_t));

  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movq %rdx, %r14
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x35b0
movslq %ebp, %rsi
shlq $0xc, %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x10d0
movl $0x1000, %esi           # imm = 0x1000
movl $0x1, %edx
movq %r15, %rdi
movq %r14, %rcx
callq 0x1110
movq %r15, %rdi
callq 0x3592
movl %eax, %ebp
testb %al, %al
je 0x37c6
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0x3566
movl $0x94c, %edx            # imm = 0x94C
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1090
movl %ebp, %eax
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/xdsopl[P]FEC/./reed_solomon.hh
// Function: ReedSolomon<16, 0, GF::Types<8, 285, unsigned char>>::ReedSolomon()
ReedSolomon()
	{
		// $generator = \prod_{i=0}^{NR}(x-pe^{FCR+i})$
		ValueType tmp[NR+1];
		IndexType root(FCR), pe(1);
		for (int i = 0; i < NR; ++i) {
			tmp[i] = ValueType(1);
			for (int j = i; j > 0; --j)
				tmp[j] = fma(root, tmp[j], tmp[j-1]);
			tmp[0] *= root;
			root *= pe;
		}
		tmp[NR] = ValueType(1);
#ifndef NDEBUG
		std::cout << "generator = ";
		for (int i = NR; i > 0; --i) {
			if (!tmp[i])
				continue;
			if (tmp[i] != ValueType(1))
				std::cout << (int)tmp[i] << "*";
			std::cout << "x";
			if (i != 1)
				std::cout << "^" << i;
			std::cout << " + ";
		}
		std::cout << (int)tmp[0] << std::endl;
#endif
		for (int i = 0; i <= NR; ++i)
			generator[i] = index(tmp[i]);
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0xf(%rsp), %r14
movb $0x0, (%r14)
movl $0x1, %r12d
xorl %r13d, %r13d
leaq 0x10(%rsp), %r15
movb $0x1, 0x10(%rsp,%r13)
movq %r12, %rbp
testq %r13, %r13
je 0x489c
leal -0x2(%rbp), %eax
movzbl 0xf(%rsp,%rbp), %esi
movzbl 0x10(%rsp,%rax), %edx
movzbl 0xf(%rsp), %edi
callq 0x9fa2
movb %al, 0xf(%rsp,%rbp)
decq %rbp
cmpq $0x1, %rbp
jg 0x4878
movzbl 0xf(%rsp), %esi
movq %r15, %rdi
callq 0xa01c
movq %r14, %rdi
movl $0x1, %esi
callq 0xa056
incq %r13
incq %r12
cmpq $0x10, %r13
jne 0x486a
movb $0x1, 0x20(%rsp)
movq 0xd070a(%rip), %r14     # 0xd4fd8
leaq 0xaa2b(%rip), %rsi      # 0xf300
movl $0xc, %edx
movq %r14, %rdi
callq 0x2190
movl $0x11, %r13d
leaq 0xa5aa(%rip), %r15      # 0xee99
leaq 0xa5a7(%rip), %r12      # 0xee9d
leaq 0xa59a(%rip), %rbp      # 0xee97
movzbl 0xf(%rsp,%r13), %esi
testl %esi, %esi
je 0x496a
cmpl $0x1, %esi
je 0x4924
movq %r14, %rdi
callq 0x2200
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x2190
movl $0x1, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2190
cmpq $0x2, %r13
je 0x495a
movl $0x1, %edx
movq %r14, %rdi
leaq 0xa552(%rip), %rsi      # 0xee9b
callq 0x2190
leal -0x1(%r13), %esi
movq %r14, %rdi
callq 0x2200
movl $0x3, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x2190
decq %r13
cmpq $0x1, %r13
ja 0x48fd
movzbl 0x10(%rsp), %esi
movq 0xd0659(%rip), %rdi     # 0xd4fd8
callq 0x2200
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
xorl %eax, %eax
leaq 0xc739(%rip), %rcx      # 0x110f0
movzbl 0x10(%rsp,%rax), %edx
testq %rdx, %rdx
je 0x49df
movb (%rdx,%rcx), %dl
movb %dl, (%rbx,%rax)
incq %rax
cmpq $0x11, %rax
jne 0x49b7
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9e95(%rip), %rdi      # 0xe87b
leaq 0x9ac9(%rip), %rsi      # 0xe4b6
leaq 0xaf60(%rip), %rcx      # 0xf954
movl $0x61, %edx
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O1/xdsopl[P]FEC/./galois_field.hh
// Function: GF::Value<4, 19, unsigned char> GF::fma<4, 19, unsigned char>(GF::Index<4, 19, unsigned char>, GF::Value<4, 19, unsigned char>, GF::Value<4, 19, unsigned char>)
Value<M, POLY, TYPE> fma(Index<M, POLY, TYPE> a, Value<M, POLY, TYPE> b, Value<M, POLY, TYPE> c)
{
	assert(a.i < a.modulus());
	assert(b.v <= b.N);
	assert(c.v <= c.N);
	return !b.v ? c : (value(a * index(b)) + c);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebp
cmpb $0xf, %bpl
jae 0x7880
cmpb $0x10, %sil
jae 0x789f
movl %edx, %ebx
cmpb $0x10, %bl
jae 0x78be
testb %sil, %sil
je 0x7877
movzbl %sil, %edi
callq 0x7a58
movzbl %bpl, %edi
movzbl %al, %esi
callq 0x79d1
cmpb $0xf, %al
jae 0x78dd
movzbl %al, %eax
leaq 0x975b(%rip), %rcx      # 0x10fc0
movzbl (%rax,%rcx), %edi
movzbl %bl, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x795a
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x6e09(%rip), %rdi      # 0xe690
leaq 0x6c28(%rip), %rsi      # 0xe4b6
leaq 0x6e0d(%rip), %rcx      # 0xe6a2
movl $0xe9, %edx
callq 0x20c0
leaq 0x6d7b(%rip), %rdi      # 0xe621
leaq 0x6c09(%rip), %rsi      # 0xe4b6
leaq 0x6dee(%rip), %rcx      # 0xe6a2
movl $0xea, %edx
callq 0x20c0
leaq 0x6e65(%rip), %rdi      # 0xe72a
leaq 0x6bea(%rip), %rsi      # 0xe4b6
leaq 0x6dcf(%rip), %rcx      # 0xe6a2
movl $0xeb, %edx
callq 0x20c0
leaq 0x6dac(%rip), %rdi      # 0xe690
leaq 0x6bcb(%rip), %rsi      # 0xe4b6
leaq 0x6e43(%rip), %rcx      # 0xe735
movl $0x67, %edx
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O1/xdsopl[P]FEC/./galois_field.hh
// Function: GF::Index<4, 19, unsigned char> GF::operator*<4, 19, unsigned char>(GF::Index<4, 19, unsigned char>, GF::Index<4, 19, unsigned char>)
Index<M, POLY, TYPE> operator * (Index<M, POLY, TYPE> a, Index<M, POLY, TYPE> b)
{
	assert(a.i < a.modulus());
	assert(b.i < b.modulus());
	TYPE tmp = a.i + b.i;
	return Index<M, POLY, TYPE>(a.modulus() - a.i <= b.i ? tmp - a.modulus() : tmp);
}

// Assembly:
pushq %rax
cmpb $0xf, %dil
jae 0x79fb
cmpb $0xf, %sil
jae 0x7a1a
leal (%rsi,%rdi), %eax
movb $0xf, %cl
subb %dil, %cl
leal -0xf(%rax), %edx
cmpb %sil, %cl
movzbl %al, %ecx
movzbl %dl, %eax
cmoval %ecx, %eax
cmpb $0xf, %al
jae 0x7a39
popq %rcx
retq
leaq 0x6c8e(%rip), %rdi      # 0xe690
leaq 0x6aad(%rip), %rsi      # 0xe4b6
leaq 0x6d83(%rip), %rcx      # 0xe793
movl $0x8d, %edx
callq 0x20c0
leaq 0x6dea(%rip), %rdi      # 0xe80b
leaq 0x6a8e(%rip), %rsi      # 0xe4b6
leaq 0x6d64(%rip), %rcx      # 0xe793
movl $0x8e, %edx
callq 0x20c0
leaq 0x6bec(%rip), %rdi      # 0xe62c
leaq 0x6a6f(%rip), %rsi      # 0xe4b6
leaq 0x6bec(%rip), %rcx      # 0xe63a
movl $0x3f, %edx
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O1/xdsopl[P]FEC/./bose_chaudhuri_hocquenghem.hh
// Function: BoseChaudhuriHocquenghem<24, 1, 65343, GF::Types<16, 65581, unsigned short>>::encode(GF::Value<16, 65581, unsigned short>*)
void encode(ValueType *code)
	{
		// $code = data * x^{NP} + (data * x^{NP}) \mod{generator}$
		for (int i = 0; i < NP; ++i)
			code[K+i] = ValueType(0);
		for (int i = 0; i < K; ++i) {
			if (code[i] != code[K]) {
				for (int j = 1; j < NP; ++j)
					code[K+j-1] = generator[NP-j] + code[K+j];
				code[N-1] = generator[0];
			} else {
				for (int j = 1; j < NP; ++j)
					code[K+j-1] = code[K+j];
				code[N-1] = ValueType(0);
			}
		}
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x1fe7e(%rsi), %r15
xorl %r13d, %r13d
movl $0x180, %edx            # imm = 0x180
movq %r15, %rdi
xorl %esi, %esi
callq 0x20b0
leaq 0x1fe80(%rbx), %r12
movzwl (%rbx,%r13,2), %eax
cmpw 0x1fe7e(%rbx), %ax
jne 0xb556
movl $0x17e, %edx            # imm = 0x17E
movq %r15, %rdi
movq %r12, %rsi
callq 0x21e0
movw $0x0, 0x1fffc(%rbx)
jmp 0xb57f
movl $0x17e, %eax            # imm = 0x17E
movq %r12, %rcx
movzwl (%rcx), %edx
xorw (%r14,%rax), %dx
movw %dx, -0x2(%rcx)
addq $0x2, %rcx
addq $-0x2, %rax
jne 0xb55e
movzwl (%r14), %eax
movw %ax, 0x1fffc(%rbx)
incq %r13
cmpq $0xff3f, %r13           # imm = 0xFF3F
jne 0xb52d
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/xdsopl[P]FEC/./bose_chaudhuri_hocquenghem.hh
// Function: BoseChaudhuriHocquenghem<24, 1, 65343, GF::Types<16, 65581, unsigned short>>::decode(GF::Value<16, 65581, unsigned short>*, GF::Index<16, 65581, unsigned short>*, int)
int decode(ValueType *code, IndexType *erasures = 0, int erasures_count = 0)
	{
		assert(0 <= erasures_count && erasures_count <= NR);
#if 0
		for (int i = 0; i < erasures_count; ++i)
			code[(int)erasures[i]] = ValueType(0);
#endif
		ValueType syndromes[NR];
		if (!compute_syndromes(code, syndromes))
			return 0;
		IndexType locations[NR];
		ValueType magnitudes[NR];
		int count = Correction<NR, FCR, GF>::algorithm(syndromes, locations, magnitudes, erasures, erasures_count);
		if (count <= 0)
			return count;
		for (int i = 0; i < count; ++i)
			if (1 < (int)magnitudes[i])
				return -1;
		for (int i = 0; i < count; ++i)
			code[(int)locations[i]] += magnitudes[i];
		int corrections_count = 0;
		for (int i = 0; i < count; ++i)
			corrections_count += !!magnitudes[i];
		return corrections_count;
	}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x90, %rsp
cmpl $0x19, %ecx
jae 0xb63c
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %rbx
leaq 0x60(%rsp), %rdx
callq 0xb65c
testl %eax, %eax
je 0xb627
leaq 0x60(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movq %rsp, %rdx
movq %r14, %rcx
movl %ebp, %r8d
callq 0xb6f6
testl %eax, %eax
jle 0xb630
movl %eax, %ecx
xorl %edx, %edx
cmpw $0x1, (%rsp,%rdx,2)
ja 0xb62b
incq %rdx
cmpq %rdx, %rcx
jne 0xb5e0
xorl %edx, %edx
movzwl (%rsp,%rdx,2), %esi
movzwl 0x30(%rsp,%rdx,2), %edi
xorw %si, (%rbx,%rdi,2)
incq %rdx
cmpq %rdx, %rcx
jne 0xb5f1
cmpl $0x2, %eax
movl $0x1, %ecx
cmovgel %eax, %ecx
xorl %edx, %edx
xorl %eax, %eax
cmpw $0x1, (%rsp,%rdx,2)
sbbl $-0x1, %eax
incq %rdx
cmpq %rdx, %rcx
jne 0xb615
jmp 0xb630
xorl %eax, %eax
jmp 0xb630
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x90, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x365c(%rip), %rdi      # 0xec9f
leaq 0x2d3b(%rip), %rsi      # 0xe385
leaq 0x4c96(%rip), %rcx      # 0x102e7
movl $0x62, %edx
callq 0x20c0
nop
// File: /workspace/github_cpp_makefile_star2_O1/xdsopl[P]FEC/./bose_chaudhuri_hocquenghem.hh
// Function: BoseChaudhuriHocquenghem<6, 1, 5, GF::Types<4, 19, unsigned char>>::compute_syndromes(GF::Value<4, 19, unsigned char>*, GF::Value<4, 19, unsigned char>*)
int compute_syndromes(ValueType *code, ValueType *syndromes)
	{
		// $syndromes_i = code(pe^{FCR+i})$
		for (int i = 0; i < NR; ++i)
			syndromes[i] = code[0];
		for (int j = 1; j < N; ++j) {
			IndexType root(FCR), pe(1);
			for (int i = 0; i < NR; ++i) {
				syndromes[i] = fma(root, syndromes[i], code[j]);
				root *= pe;
			}
		}
		int nonzero = 0;
		for (int i = 0; i < NR; ++i)
			nonzero += !!syndromes[i];
		return nonzero;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r14
xorl %eax, %eax
movb (%r14), %cl
movb %cl, (%rbx,%rax)
incq %rax
cmpq $0x6, %rax
jne 0x7c87
movl $0x1, %r12d
leaq 0xf(%rsp), %r15
movb $0x1, 0xf(%rsp)
xorl %r13d, %r13d
movzbl (%r14,%r12), %edx
movzbl (%rbx,%r13), %esi
movzbl 0xf(%rsp), %edi
callq 0x781d
movb %al, (%rbx,%r13)
movq %r15, %rdi
movl $0x1, %esi
callq 0x78fc
incq %r13
cmpq $0x6, %r13
jne 0x7ca9
incq %r12
cmpq $0xf, %r12
jne 0x7ca1
xorl %ecx, %ecx
xorl %eax, %eax
cmpb $0x1, (%rbx,%rcx)
sbbl $-0x1, %eax
incq %rcx
cmpq $0x6, %rcx
jne 0x7ce4
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/xdsopl[P]FEC/./berlekamp_massey.hh
// Function: BerlekampMassey<6, GF::Types<4, 19, unsigned char>>::algorithm(GF::Value<4, 19, unsigned char>*, GF::Value<4, 19, unsigned char>*, int)
static int algorithm(ValueType *s, ValueType *C, int count = 0)
	{
		ValueType B[NR+1];
		for (int i = 0; i <= NR; ++i)
			B[i] = C[i];
		int L = count;
		for (int n = count, m = 1; n < NR; ++n) {
			ValueType d(s[n]);
			for (int i = 1; i <= L; ++i)
				d += C[i] * s[n-i];
			if (!d) {
				++m;
			} else {
				ValueType T[NR+1];
				for (int i = 0; i < m; ++i)
					T[i] = C[i];
				for (int i = m; i <= NR; ++i)
					T[i] = fma(d, B[i-m], C[i]);
				if (2 * L <= n + count) {
					L = n + count + 1 - L;
					for (int i = 0; i <= NR; ++i)
						B[i] = C[i] / d;
					m = 1;
				} else {
					++m;
				}
				for (int i = 0; i <= NR; ++i)
					C[i] = T[i];
			}
		}
		return L;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %edx, %ebp
movl (%rsi), %eax
movl 0x3(%rsi), %ecx
movl %ecx, 0x13(%rsp)
movl %eax, 0x10(%rsp)
cmpl $0x5, %edx
jg 0x85a8
movq %rsi, %r14
movslq %ebp, %rax
leaq (%rdi,%rax), %r12
leaq 0x1(%rsi), %rcx
movq %rcx, 0x38(%rsp)
movl $0x1, %esi
leaq 0xb(%rsp), %r13
movq %rax, 0x40(%rsp)
movq %rax, %rdx
movq %rdi, 0x30(%rsp)
movl %esi, 0xc(%rsp)
movq %rdx, 0x20(%rsp)
movb (%rdi,%rdx), %al
movb %al, 0xb(%rsp)
movq %rbp, 0x28(%rsp)
testl %ebp, %ebp
jle 0x84bc
movq 0x28(%rsp), %rax
leal 0x1(%rax), %ebx
negq %rbx
movq $-0x1, %r15
movq 0x38(%rsp), %rbp
movzbl (%r12,%r15), %esi
movzbl (%rbp), %edi
callq 0x874c
movzbl %al, %esi
movq %r13, %rdi
callq 0x77e4
decq %r15
incq %rbp
cmpq %r15, %rbx
jne 0x8498
cmpb $0x0, 0xb(%rsp)
je 0x853e
movl 0xc(%rsp), %ebx
testl %ebx, %ebx
jle 0x84da
movl %ebx, %edx
leaq 0x19(%rsp), %rdi
movq %r14, %rsi
callq 0x2100
cmpl $0x6, %ebx
jg 0x8515
movslq 0xc(%rsp), %rbx
incq %rbx
leaq 0x10(%rsp), %r15
movq %rbx, %rbp
movzbl -0x1(%r14,%rbx), %edx
movzbl (%r15), %esi
movzbl 0xb(%rsp), %edi
callq 0x8806
movb %al, 0x18(%rsp,%rbx)
incq %rbp
incq %r15
cmpl $0x7, %ebx
movq %rbp, %rbx
jne 0x84ef
movq 0x28(%rsp), %rbp
leal (,%rbp,2), %eax
movq 0x40(%rsp), %rcx
movq 0x20(%rsp), %rdx
leaq (%rdx,%rcx), %rbx
cltq
cmpq %rax, %rbx
jge 0x8555
movl 0xc(%rsp), %esi
incl %esi
jmp 0x8585
movl 0xc(%rsp), %esi
incl %esi
movq 0x28(%rsp), %rbp
movq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rdx
jmp 0x8599
xorl %r15d, %r15d
movzbl (%r14,%r15), %edi
movzbl 0xb(%rsp), %esi
callq 0x88fc
movb %al, 0x10(%rsp,%r15)
incq %r15
cmpq $0x7, %r15
jne 0x8558
subl %ebp, %ebx
incl %ebx
movl $0x1, %esi
movl %ebx, %ebp
movq 0x20(%rsp), %rdx
movl 0x19(%rsp), %eax
movl 0x1c(%rsp), %ecx
movl %ecx, 0x3(%r14)
movl %eax, (%r14)
movq 0x30(%rsp), %rdi
incq %rdx
incq %r12
cmpl $0x6, %edx
jne 0x8468
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/xdsopl[P]FEC/./find_locations.hh
// Function: FindLocations<16, GF::Types<8, 285, unsigned char>>::search(GF::Value<8, 285, unsigned char>*, int, GF::Index<8, 285, unsigned char>*)
static int search(ValueType *locator, int locator_degree, IndexType *locations)
	{
		if (locator_degree == 1) {
			locations[0] = (index(locator[0]) / index(locator[1])) / IndexType(1);
			return 1;
		}
		if (locator_degree == 2) {
			if (!locator[1] || !locator[0])
				return 0;
			ValueType a(locator[2]), b(locator[1]), c(locator[0]);
			ValueType ba(b/a), R(Artin_Schreier_imap(a*c/(b*b)));
			if (!R)
				return 0;
			locations[0] = index(ba * R) / IndexType(1);
			locations[1] = index(ba * R + ba) / IndexType(1);
			return 2;
		}
		return Chien<NR, GF>::search(locator, locator_degree, locations);
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
cmpl $0x2, %esi
je 0xad01
cmpl $0x1, %esi
jne 0xade2
movzbl (%rdi), %eax
testq %rax, %rax
je 0xadf8
movzbl 0x1(%rdi), %ecx
testq %rcx, %rcx
je 0xadf8
leaq 0x6416(%rip), %rdx      # 0x110f0
movzbl (%rax,%rdx), %edi
movzbl (%rcx,%rdx), %esi
callq 0xaa0d
movzbl %al, %edi
movl $0x1, %r14d
movl $0x1, %esi
callq 0xaa0d
movb %al, (%rbx)
jmp 0xadd0
movb 0x1(%rdi), %al
xorl %r14d, %r14d
testb %al, %al
je 0xadd0
movb (%rdi), %r13b
testb %r13b, %r13b
je 0xadd0
movzbl 0x2(%rdi), %r15d
movzbl %al, %r12d
movl %r12d, %edi
movl %r15d, %esi
callq 0xaf02
movl %eax, %ebp
movzbl %r13b, %esi
movl %r15d, %edi
callq 0xae36
movl %eax, %r15d
movl %r12d, %edi
movl %r12d, %esi
callq 0xae36
movzbl %r15b, %edi
movzbl %al, %esi
callq 0xaf02
testb %al, %al
je 0xae17
movzbl %al, %eax
leaq 0x6487(%rip), %rcx      # 0x111f0
movb (%rax,%rcx), %al
testb %al, %al
je 0xadd0
movzbl %bpl, %r14d
movzbl %al, %r15d
movl %r14d, %edi
movl %r15d, %esi
callq 0xae36
testb %al, %al
je 0xadf8
movzbl %al, %eax
leaq 0x635f(%rip), %r12      # 0x110f0
movzbl (%rax,%r12), %edi
movl $0x1, %esi
callq 0xaa0d
movb %al, (%rbx)
movl %r14d, %edi
movl %r15d, %esi
callq 0xae36
cmpb %al, %r14b
je 0xadf8
xorb %bpl, %al
movzbl %al, %eax
movzbl (%rax,%r12), %edi
movl $0x1, %esi
callq 0xaa0d
movb %al, 0x1(%rbx)
movl $0x2, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xaf7e
leaq 0x3a7c(%rip), %rdi      # 0xe87b
leaq 0x36b0(%rip), %rsi      # 0xe4b6
leaq 0x4b47(%rip), %rcx      # 0xf954
movl $0x61, %edx
callq 0x20c0
leaq 0x3a5d(%rip), %rdi      # 0xe87b
leaq 0x3691(%rip), %rsi      # 0xe4b6
leaq 0x4f7c(%rip), %rcx      # 0xfda8
movl $0x6e, %edx
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O1/xdsopl[P]FEC/./galois_field.hh
// Function: GF::Value<4, 19, unsigned char> GF::fma<4, 19, unsigned char>(GF::Value<4, 19, unsigned char>, GF::Value<4, 19, unsigned char>, GF::Value<4, 19, unsigned char>)
Value<M, POLY, TYPE> fma(Value<M, POLY, TYPE> a, Value<M, POLY, TYPE> b, Value<M, POLY, TYPE> c)
{
	assert(a.v <= a.N);
	assert(b.v <= b.N);
	assert(c.v <= c.N);
	return (!a.v || !b.v) ? c : (value(index(a) * index(b)) + c);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpb $0x10, %dil
jae 0x8880
movl %esi, %ebp
cmpb $0x10, %bpl
jae 0x889f
movl %edx, %ebx
cmpb $0x10, %bl
jae 0x88be
testb %dil, %dil
setne %al
testb %bpl, %bpl
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x8879
movzbl %dil, %edi
callq 0x7a58
movl %eax, %r14d
movzbl %bpl, %edi
callq 0x7a58
movzbl %r14b, %edi
movzbl %al, %esi
callq 0x79d1
cmpb $0xf, %al
jae 0x88dd
movzbl %al, %eax
leaq 0x8757(%rip), %rcx      # 0x10fc0
movzbl (%rax,%rcx), %edi
movzbl %bl, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x795a
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x5c97(%rip), %rdi      # 0xe51e
leaq 0x5c28(%rip), %rsi      # 0xe4b6
leaq 0x679a(%rip), %rcx      # 0xf02f
movl $0xfb, %edx
callq 0x20c0
leaq 0x5d7b(%rip), %rdi      # 0xe621
leaq 0x5c09(%rip), %rsi      # 0xe4b6
leaq 0x677b(%rip), %rcx      # 0xf02f
movl $0xfc, %edx
callq 0x20c0
leaq 0x5e65(%rip), %rdi      # 0xe72a
leaq 0x5bea(%rip), %rsi      # 0xe4b6
leaq 0x675c(%rip), %rcx      # 0xf02f
movl $0xfd, %edx
callq 0x20c0
leaq 0x5dac(%rip), %rdi      # 0xe690
leaq 0x5bcb(%rip), %rsi      # 0xe4b6
leaq 0x5e43(%rip), %rcx      # 0xe735
movl $0x67, %edx
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O1/xdsopl[P]FEC/./galois_field.hh
// Function: GF::Value<4, 19, unsigned char> GF::operator/<4, 19, unsigned char>(GF::Value<4, 19, unsigned char>, GF::Value<4, 19, unsigned char>)
Value<M, POLY, TYPE> operator / (Value<M, POLY, TYPE> a, Value<M, POLY, TYPE> b)
{
	assert(a.v <= a.N);
	assert(b.v <= b.N);
	assert(b.v);
	return !a.v ? a.zero() : value(index(a) / index(b));
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
cmpb $0x10, %dil
jae 0x8950
movl %esi, %ebx
cmpb $0x10, %bl
jae 0x896f
testb %bl, %bl
je 0x898e
testb %dil, %dil
je 0x8947
movzbl %dil, %edi
callq 0x7a58
movl %eax, %ebp
movzbl %bl, %edi
callq 0x7a58
movzbl %bpl, %edi
movzbl %al, %esi
callq 0x82f8
cmpb $0xf, %al
jae 0x89ad
movzbl %al, %eax
leaq 0x867e(%rip), %rcx      # 0x10fc0
movb (%rax,%rcx), %al
jmp 0x8949
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x5bc7(%rip), %rdi      # 0xe51e
leaq 0x5b58(%rip), %rsi      # 0xe4b6
leaq 0x6752(%rip), %rcx      # 0xf0b7
movl $0xb6, %edx
callq 0x20c0
leaq 0x5cab(%rip), %rdi      # 0xe621
leaq 0x5b39(%rip), %rsi      # 0xe4b6
leaq 0x6733(%rip), %rcx      # 0xf0b7
movl $0xb7, %edx
callq 0x20c0
leaq 0x679a(%rip), %rdi      # 0xf12f
leaq 0x5b1a(%rip), %rsi      # 0xe4b6
leaq 0x6714(%rip), %rcx      # 0xf0b7
movl $0xb8, %edx
callq 0x20c0
leaq 0x5cdc(%rip), %rdi      # 0xe690
leaq 0x5afb(%rip), %rsi      # 0xe4b6
leaq 0x5d73(%rip), %rcx      # 0xe735
movl $0x67, %edx
callq 0x20c0