LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/viniciu21[P]PetLolja/./src/PetFera.cpp
// Function: Petfera::leGenero(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
t_genero Petfera::leGenero(string str_prompt)
{
	string genero_string;
	t_genero genero;

	do
	{
		cout << str_prompt;
		cin >> genero_string;

		if (genero_string == "F" || genero_string == "f" || genero_string == "Femea")
		{
			genero = F;
			genero_string = "F";
			break;
		}
		else if (genero_string == "M" || genero_string == "m" || genero_string == "Macho")
		{
			genero = M;
			genero_string = "M";
			break;
		}

	} while (true);

	return genero;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x26c58(%rip), %r15     # 0x3afe0
leaq -0x48(%rbp), %r12
leaq 0x1a8be(%rip), %r13     # 0x2ec51
leaq 0x1b03f(%rip), %r14     # 0x2f3d9
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x26c28(%rip), %rdi     # 0x3afd0
callq 0x4210
movq %r15, %rdi
movq %r12, %rsi
callq 0x4220
movq %r12, %rdi
movq %r13, %rsi
callq 0x4090
testl %eax, %eax
je 0x1444d
movq %r12, %rdi
movq %r14, %rsi
callq 0x4090
testl %eax, %eax
je 0x1444d
movq %r12, %rdi
leaq 0x18d32(%rip), %rsi     # 0x2d116
callq 0x4090
testl %eax, %eax
je 0x1444d
movq %r12, %rdi
leaq 0x1a85c(%rip), %rsi     # 0x2ec53
callq 0x4090
testl %eax, %eax
je 0x1442a
movq %r12, %rdi
leaq 0x19947(%rip), %rsi     # 0x2dd51
callq 0x4090
testl %eax, %eax
je 0x1442a
movq %r12, %rdi
leaq 0x18cff(%rip), %rsi     # 0x2d11c
callq 0x4090
testl %eax, %eax
jne 0x1439a
movl $0xa, %ebx
leaq -0x48(%rbp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x1a815(%rip), %rcx     # 0x2ec53
movl $0x1, %r8d
xorl %esi, %esi
callq 0x42a0
jmp 0x1446e
movl $0xb, %ebx
leaq -0x48(%rbp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x1a7f0(%rip), %rcx     # 0x2ec51
movl $0x1, %r8d
xorl %esi, %esi
callq 0x42a0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x14487
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x41d0
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1449a
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x144b6
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x41d0
movq %rbx, %rdi
callq 0x42f0
// File: /workspace/github_cpp_makefile_star2_O3/viniciu21[P]PetLolja/./src/PetFera.cpp
// Function: Petfera::leBool(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool Petfera::leBool(string str_prompt)
{
	string resposta;
	do
	{
		cout << str_prompt;
		cin >> resposta;
	} while ((resposta != "S" && resposta != "s" && resposta != "sim") && (resposta != "N" && resposta != "n" && resposta != "nao"));
	if (resposta == "S" || resposta == "s" || resposta == "sim")
	{
		return true;
	}
	else
	{
		return false;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x26af4(%rip), %r15     # 0x3afe0
leaq -0x48(%rbp), %r12
leaq 0x1a75e(%rip), %r13     # 0x2ec55
leaq 0x1ada7(%rip), %r14     # 0x2f2a5
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x26ac4(%rip), %rdi     # 0x3afd0
callq 0x4210
movq %r15, %rdi
movq %r12, %rsi
callq 0x4220
movq %r12, %rdi
movq %r13, %rsi
callq 0x4090
testl %eax, %eax
je 0x1458a
movq %r12, %rdi
movq %r14, %rsi
callq 0x4090
testl %eax, %eax
je 0x1458a
movq %r12, %rdi
leaq 0x18c2c(%rip), %rsi     # 0x2d170
callq 0x4090
testl %eax, %eax
je 0x1458a
movq %r12, %rdi
leaq 0x1a700(%rip), %rsi     # 0x2ec57
callq 0x4090
testl %eax, %eax
je 0x1458a
movq %r12, %rdi
leaq 0x1a6ef(%rip), %rsi     # 0x2ec59
callq 0x4090
testl %eax, %eax
je 0x1458a
movq %r12, %rdi
leaq 0x18bf7(%rip), %rsi     # 0x2d174
callq 0x4090
testl %eax, %eax
jne 0x144fe
leaq 0x1a6c4(%rip), %rsi     # 0x2ec55
leaq -0x48(%rbp), %rdi
callq 0x4090
movb $0x1, %bl
testl %eax, %eax
je 0x145c9
leaq 0x1acfe(%rip), %rsi     # 0x2f2a5
leaq -0x48(%rbp), %rdi
callq 0x4090
testl %eax, %eax
je 0x145c9
leaq 0x18bb5(%rip), %rsi     # 0x2d170
leaq -0x48(%rbp), %rdi
callq 0x4090
testl %eax, %eax
sete %bl
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x145e2
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x41d0
movl %ebx, %eax
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 0x1460f
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x41d0
movq %rbx, %rdi
callq 0x42f0
nop
// File: /workspace/github_cpp_makefile_star2_O3/viniciu21[P]PetLolja/./src/PetFera.cpp
// Function: Petfera::lePelo(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
pelos Petfera::lePelo(string str_prompt)
{
	int resposta;

	cout << str_prompt;
	cin >> resposta;

	return pelos(resposta - 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
movq 0x2147e(%rip), %rdi     # 0x3afd0
movq %rax, %rsi
callq 0x4210
movq 0x2147f(%rip), %rdi     # 0x3afe0
leaq -0xc(%rbp), %rbx
movq %rbx, %rsi
callq 0x4110
movl (%rbx), %eax
decl %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/viniciu21[P]PetLolja/./src/PetFera.cpp
// Function: Petfera::leGestacao(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
TipoDeGestacao Petfera::leGestacao(string str_prompt)
{
	int resposta;

	cout << str_prompt;
	cin >> resposta;

	return TipoDeGestacao(resposta - 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
movq 0x21444(%rip), %rdi     # 0x3afd0
movq %rax, %rsi
callq 0x4210
movq 0x21445(%rip), %rdi     # 0x3afe0
leaq -0xc(%rbp), %rbx
movq %rbx, %rsi
callq 0x4110
movl (%rbx), %eax
decl %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/viniciu21[P]PetLolja/./src/PetFera.cpp
// Function: Petfera::leNivelDeSeguranca()
nivelDeSeguranca Petfera::leNivelDeSeguranca()
{
	nivelDeSeguranca nivel;
	short escolha;
	cout << "Escolha o nivel de segurança para seu tratador"
			 << "\n";

	cout << "5 --> Nivel verde"
			 << "\n";
	cout << "6 --> Nivel azul"
			 << "\n";
	cout << "7 --> Nivel vermelho"
			 << "\n";

	cin >> escolha;
	if (escolha == 5)
		nivel = Verde;
	if (escolha == 6)
		nivel = Azul;
	if (escolha == 7)
		nivel = Vermelho;

	return nivel;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq 0x1e8d6(%rip), %rbx     # 0x3afd0
leaq 0x124d3(%rip), %rsi     # 0x2ebd4
movl $0x2f, %edx
movq %rbx, %rdi
callq 0x4210
leaq 0x1131c(%rip), %r14     # 0x2da31
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4210
leaq 0x124d8(%rip), %rsi     # 0x2ec04
movl $0x11, %edx
movq %rbx, %rdi
callq 0x4210
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4210
leaq 0x124c6(%rip), %rsi     # 0x2ec16
movl $0x10, %edx
movq %rbx, %rdi
callq 0x4210
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4210
leaq 0x124b3(%rip), %rsi     # 0x2ec27
movl $0x14, %edx
movq %rbx, %rdi
callq 0x4210
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4210
movq 0x1e848(%rip), %rdi     # 0x3afe0
leaq -0x12(%rbp), %rbx
movq %rbx, %rsi
callq 0x4050
movzwl (%rbx), %eax
xorl %ecx, %ecx
cmpw $0x6, %ax
sete %cl
addl $0x5, %ecx
cmpw $0x7, %ax
movl $0x7, %eax
cmovnel %ecx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/shancheng[P]shancheng/src/sudoku.cpp
// Function: (anonymous namespace)::Sudoku::Print(std::ostream&)
void Print(ostream& os) {
    for (uint32_t row = 0; row < options.opt_size; ++row) {
      for (uint32_t col = 0; col < options.opt_size; ++col) {
        os << setw(2) << cells_[row][col].value << " ";
      }
      os << "\n";
    }
  }

// Assembly:
cmpl $0x0, 0xbe85(%rip)      # 0x122a8
je 0x64cf
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x8, %rbx
movl $0x1, %eax
xorl %r13d, %r13d
movq 0xbb6e(%rip), %r14      # 0x11fb8
leaq 0x5c85(%rip), %r12      # 0xc0d6
testl %eax, %eax
je 0x6498
movq %rbx, %rbp
xorl %r15d, %r15d
movq (%r14), %rax
movq -0x18(%rax), %rax
movq $0x2, 0x10(%r14,%rax)
movl (%rbp), %esi
movq %r14, %rdi
callq 0x5190
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x5280
incq %r15
movl 0xbe19(%rip), %eax      # 0x122a8
addq $0x48, %rbp
cmpq %rax, %r15
jb 0x645b
movl $0x1, %edx
movq %r14, %rdi
leaq 0x5be1(%rip), %rsi      # 0xc088
callq 0x5280
incq %r13
movl 0xbdf3(%rip), %eax      # 0x122a8
addq $0x708, %rbx            # imm = 0x708
cmpq %rax, %r13
jb 0x6451
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/shancheng[P]shancheng/src/sudoku.cpp
// Function: (anonymous namespace)::operator<<(std::ostream&, (anonymous namespace)::Cell const&)
ostream& operator<<(ostream& os, const Cell& cell) {
  os << '(' << (cell.row + 1) << ',' << (cell.col + 1) << ',' << cell.value << ',';
  for (auto it = cell.candidates.begin(); it != cell.candidates.end(); ++it) {
    os << *it << " ";
  }
  os << ')' << "\n";
  return os;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0xb(%rsp), %rsi
movb $0x28, (%rsi)
movq 0xbaca(%rip), %rdi      # 0x11fb8
movl $0x1, %edx
callq 0x5280
movl (%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x5190
movb $0x2c, %bpl
leaq 0xc(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x5280
movl 0x4(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x5190
leaq 0xd(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x5280
movl 0x8(%rbx), %esi
movq %rax, %rdi
callq 0x5190
leaq 0xe(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x5280
movq 0x28(%rbx), %r12
cmpq 0x30(%rbx), %r12
je 0x659c
movq 0xba49(%rip), %r14      # 0x11fb8
leaq 0x5b60(%rip), %r15      # 0xc0d6
movl (%r12), %esi
movq %r14, %rdi
callq 0x53e0
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x5280
addq $0x4, %r12
cmpq 0x30(%rbx), %r12
jne 0x6576
leaq 0xf(%rsp), %rsi
movb $0x29, (%rsi)
movq 0xba0d(%rip), %rdi      # 0x11fb8
movl $0x1, %edx
callq 0x5280
leaq 0x5acc(%rip), %rsi      # 0xc088
movl $0x1, %edx
movq %rax, %rdi
callq 0x5280
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/shancheng[P]shancheng/src/sudoku.cpp
// Function: (anonymous namespace)::Sudoku::Solve(unsigned long)
bool Solve(size_t index) {
    if (found_) {
      return true;
    }
    if (index == vec_.size()) {
      cout << "\nSolution:\n";
      cout << "-----------------------------------------------------------\n";
      Print(cout);
      return true;
    }
    Cell& cell = *vec_[index];
    auto endit = cell.candidates.end();
    for (auto it = cell.candidates.begin(); it != endit; ++it) {
      if (IsOk(cell, *it)) {
        cell.value = *it;
        cell.SetFlag(*it);
        if (Solve(index + 1)) {
          return true;
        }
        cell.ClearFlag(*it);
      }
    }
    return false;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movb $0x1, %bl
cmpb $0x0, 0xb110(%rdi)
jne 0x69ab
movq %rsi, %r15
movq %rdi, %r14
movq 0xb0f8(%rdi), %rax
movq 0xb100(%rdi), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rsi, %rcx
jne 0x691c
movq 0xb6d1(%rip), %r15      # 0x11fb8
leaq 0x584f(%rip), %rsi      # 0xc13d
movl $0xb, %edx
movq %r15, %rdi
callq 0x5280
leaq 0x578c(%rip), %rsi      # 0xc08e
movl $0x3c, %edx
movq %r15, %rdi
callq 0x5280
movq %r14, %rdi
callq 0x641c
jmp 0x69ab
movq (%rax,%r15,8), %r12
movq 0x28(%r12), %r13
movq 0x30(%r12), %rbp
cmpq %rbp, %r13
je 0x69a9
incq %r15
movq 0x10(%r12), %rax
movq 0x18(%r12), %rdx
movq 0x20(%r12), %rsi
movl (%rsi), %edi
movl (%r13), %ecx
movl (%rdx), %r8d
orl (%rax), %r8d
orl %edi, %r8d
btl %ecx, %r8d
jb 0x69a0
movl %ecx, 0x8(%r12)
movb (%r13), %cl
movl $0x1, %edi
shll %cl, %edi
orl %edi, (%rax)
orl %edi, (%rdx)
orl %edi, (%rsi)
movq %r14, %rdi
movq %r15, %rsi
callq 0x68a6
testb %al, %al
jne 0x69ab
movb (%r13), %cl
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
roll %cl, %esi
movq 0x10(%r12), %rax
andl %esi, (%rax)
movq 0x18(%r12), %rdx
andl %esi, (%rdx)
movq 0x20(%r12), %rsi
movl (%rsi), %edi
btrl %ecx, %edi
movl %edi, (%rsi)
addq $0x4, %r13
cmpq %rbp, %r13
jne 0x6943
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/t0mm4rx[P]piscine_cpp/day03/ex02/ScavTrap.cpp
// Function: ScavTrap::ScavTrap(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
ScavTrap::ScavTrap(std::string name) : ClapTrap(name)
{
	this->energyPoints = 50;
	this->maxEnergyPoints = 50;
	this->meleeAttackDamage = 20;
	this->rangedAttackDamage = 15;
	this->armorDamageReduction = 3;
	this->level = 1.0;
	std::cout << this->name << ": Hey ! At your service." << std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
leaq -0x38(%rbp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x2e44
movq %rbx, %rdi
movq %r14, %rsi
callq 0x233c
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x2f35
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x2100
leaq 0x2e44(%rip), %rax      # 0x5d80
movq %rax, (%rbx)
movabsq $0x3200000032, %rax     # imm = 0x3200000032
movq %rax, 0x10(%rbx)
movabsq $0xf00000014, %rax      # imm = 0xF00000014
movq %rax, 0x40(%rbx)
movl $0x3, 0x48(%rbx)
movl $0x3f800000, 0x18(%rbx) # imm = 0x3F800000
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq 0x3060(%rip), %rdi      # 0x5fd8
callq 0x2110
movq %rax, %r14
leaq 0x12a1(%rip), %rsi      # 0x4228
movl $0x18, %edx
movq %rax, %rdi
callq 0x2110
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x20f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2090
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x2feb
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x2100
jmp 0x2feb
movq %rax, %r14
movq %rbx, %rdi
callq 0x2558
movq %r14, %rdi
callq 0x2150
nop
// File: /workspace/github_cpp_makefile_star2_O3/PrarabdhJoshi[P]DatabaseImplementation/Record.cc
// Function: Record::CopyBits(char*, int)
void Record :: CopyBits(char *bits, int b_len) {

	delete [] this->bits;

	this->bits = new (std::nothrow) char[b_len];
	if (this->bits == NULL)
	{
		cout << "ERROR : Not enough memory. EXIT !!!\n";
		exit(1);
	}

	memcpy (this->bits, bits, b_len);
	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x2852
callq 0x2210
movslq %ebp, %r15
movq 0x9744(%rip), %rsi      # 0xbfa0
movq %r15, %rdi
callq 0x22d0
movq %rax, (%r14)
testq %rax, %rax
je 0x2884
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2130
movq 0x9735(%rip), %rdi      # 0xbfc0
leaq 0x5772(%rip), %rsi      # 0x8004
callq 0x2170
movl $0x1, %edi
callq 0x21f0
nop
// File: /workspace/github_cpp_makefile_star2_O3/PrarabdhJoshi[P]DatabaseImplementation/Record.cc
// Function: Record::Copy(Record*)
void Record :: Copy (Record *copyMe) {
	// this is a deep copy, so allocate the bits and move them over!
	delete [] bits;
	bits = new (std::nothrow) char[((int *) copyMe->bits)[0]];
	if (bits == NULL)
	{
		cout << "ERROR : Not enough memory. EXIT !!!\n";
		exit(1);
	}

	memcpy (bits, copyMe->bits, ((int *) copyMe->bits)[0]);

}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x28e5
callq 0x2210
movq (%rbx), %rax
movslq (%rax), %rdi
movq 0x96ae(%rip), %rsi      # 0xbfa0
callq 0x22d0
movq %rax, (%r14)
testq %rax, %rax
je 0x2914
movq (%rbx), %rsi
movslq (%rsi), %rdx
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2130
movq 0x96a5(%rip), %rdi      # 0xbfc0
leaq 0x56e2(%rip), %rsi      # 0x8004
callq 0x2170
movl $0x1, %edi
callq 0x21f0
nop
// File: /workspace/github_cpp_makefile_star2_O3/PrarabdhJoshi[P]DatabaseImplementation/Record.cc
// Function: Record::Print(Schema*)
void Record :: Print (Schema *mySchema) {

	int n = mySchema->GetNumAtts();
	Attribute *atts = mySchema->GetAtts();

	// loop through all of the attributes
	for (int i = 0; i < n; i++) {

		// print the attribute name
		cout << atts[i].name << ": ";

		// use the i^th slot at the head of the record to get the
		// offset to the correct attribute in the record
		int pointer = ((int *) bits)[i + 1];

		// here we determine the type, which given in the schema;
		// depending on the type we then print out the contents
		cout << "[";

		// first is integer
		if (atts[i].myType == Int) {
			int *myInt = (int *) &(bits[pointer]);
			cout << *myInt;	

		// then is a double
		} else if (atts[i].myType == Double) {
			double *myDouble = (double *) &(bits[pointer]);
			cout << *myDouble;	

		// then is a character string
		} else if (atts[i].myType == String) {
			char *myString = (char *) &(bits[pointer]);
			cout << myString;	
		} 

		cout << "]";

		// print out a comma as needed to make things pretty
		if (i != n - 1) {
			cout << ", ";
		}
	}

	cout << "\n";
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x427a
movl %eax, %r15d
movq %r14, %rdi
callq 0x427e
testl %r15d, %r15d
jle 0x2d87
movq %rax, %r14
leal -0x1(%r15), %eax
movl %r15d, %ecx
shlq $0x2, %rax
movq %rax, 0x10(%rsp)
shlq $0x2, %rcx
movq %rcx, 0x8(%rsp)
xorl %r13d, %r13d
movq 0x9350(%rip), %r15      # 0xbfc0
movq (%r14,%r13,4), %r12
testq %r12, %r12
je 0x2c91
movq %r12, %rdi
callq 0x20d0
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x21c0
jmp 0x2ca9
movq (%r15), %rax
movq -0x18(%rax), %rax
leaq (%r15,%rax), %rdi
movl 0x20(%r15,%rax), %esi
orl $0x1, %esi
callq 0x22e0
movl $0x2, %edx
movq %r15, %rdi
leaq 0x5f45(%rip), %rsi      # 0x8bfd
callq 0x21c0
movq (%rbx), %rax
movslq 0x4(%rax,%r13), %rbp
movl $0x1, %edx
movq %r15, %rdi
leaq 0x5355(%rip), %rsi      # 0x8029
callq 0x21c0
movl 0x8(%r14,%r13,4), %eax
cmpl $0x2, %eax
je 0x2d0e
cmpl $0x1, %eax
je 0x2cfc
testl %eax, %eax
jne 0x2d49
movq (%rbx), %rax
movl (%rax,%rbp), %esi
movq %r15, %rdi
callq 0x22f0
jmp 0x2d49
movq (%rbx), %rax
movsd (%rax,%rbp), %xmm0
movq %r15, %rdi
callq 0x22a0
jmp 0x2d49
movq (%rbx), %r12
testq %r12, %r12
je 0x2d31
addq %rbp, %r12
movq %r12, %rdi
callq 0x20d0
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x21c0
jmp 0x2d49
movq (%r15), %rax
movq -0x18(%rax), %rax
leaq (%r15,%rax), %rdi
movl 0x20(%r15,%rax), %esi
orl $0x1, %esi
callq 0x22e0
movl $0x1, %edx
movq %r15, %rdi
leaq 0x52d3(%rip), %rsi      # 0x802b
callq 0x21c0
cmpq %r13, 0x10(%rsp)
je 0x2d78
movl $0x2, %edx
movq %r15, %rdi
leaq 0x52ba(%rip), %rsi      # 0x802d
callq 0x21c0
addq $0x4, %r13
cmpq %r13, 0x8(%rsp)
jne 0x2c70
movq 0x9232(%rip), %rdi      # 0xbfc0
leaq 0x5dd0(%rip), %rsi      # 0x8b65
movl $0x1, %edx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21c0
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/PrarabdhJoshi[P]DatabaseImplementation/Comparison.cc
// Function: Comparison::Print()
void Comparison :: Print () {

	cout << "Att " << whichAtt1 << " from ";

	if (operand1 == Left)
		cout << "left record ";
	else if (operand1 == Right)
		cout << "right record ";
	else 
		cout << "literal record ";


	if (op == LessThan)
		cout << "< ";
	else if (op == GreaterThan)
		cout << "> ";
	else
		cout << "= ";


	cout << "Att " << whichAtt2 << " from ";

	if (operand2 == Left)
		cout << "left record ";
	else if (operand2 == Right)
		cout << "right record ";
	else
		cout << "literal record ";
 

	if (attType == Int)
		cout << "(Int)";
	else if (attType == Double)
		cout << "(Double)";
	else
		cout << "(String)";
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x91f0(%rip), %r14      # 0xbfc0
leaq 0x52a5(%rip), %rsi      # 0x807c
movl $0x4, %edx
movq %r14, %rdi
callq 0x21c0
movl 0x4(%rbx), %esi
movq %r14, %rdi
callq 0x22f0
leaq 0x5dd9(%rip), %rsi      # 0x8bcf
movl $0x6, %edx
movq %rax, %rdi
callq 0x21c0
movl (%rbx), %eax
movq 0x91b4(%rip), %rdi      # 0xbfc0
cmpl $0x1, %eax
je 0x2e23
testl %eax, %eax
jne 0x2e31
leaq 0x5265(%rip), %rsi      # 0x8081
movl $0xc, %edx
jmp 0x2e3d
leaq 0x5264(%rip), %rsi      # 0x808e
movl $0xd, %edx
jmp 0x2e3d
leaq 0x5264(%rip), %rsi      # 0x809c
movl $0xf, %edx
callq 0x21c0
movl 0x14(%rbx), %eax
cmpl $0x1, %eax
leaq 0x5260(%rip), %rcx      # 0x80af
leaq 0x525c(%rip), %rdx      # 0x80b2
cmoveq %rcx, %rdx
testl %eax, %eax
leaq 0x5249(%rip), %rsi      # 0x80ac
cmovneq %rdx, %rsi
movq 0x9152(%rip), %r14      # 0xbfc0
movl $0x2, %edx
movq %r14, %rdi
callq 0x21c0
leaq 0x51fa(%rip), %rsi      # 0x807c
movl $0x4, %edx
movq %r14, %rdi
callq 0x21c0
movl 0xc(%rbx), %esi
movq %r14, %rdi
callq 0x22f0
leaq 0x5d2e(%rip), %rsi      # 0x8bcf
movl $0x6, %edx
movq %rax, %rdi
callq 0x21c0
movl 0x8(%rbx), %eax
movq 0x9108(%rip), %rdi      # 0xbfc0
cmpl $0x1, %eax
je 0x2ecf
testl %eax, %eax
jne 0x2edd
leaq 0x51b9(%rip), %rsi      # 0x8081
movl $0xc, %edx
jmp 0x2ee9
leaq 0x51b8(%rip), %rsi      # 0x808e
movl $0xd, %edx
jmp 0x2ee9
leaq 0x51b8(%rip), %rsi      # 0x809c
movl $0xf, %edx
callq 0x21c0
movl 0x10(%rbx), %eax
movq 0x90c8(%rip), %rdi      # 0xbfc0
cmpl $0x1, %eax
je 0x2f0f
testl %eax, %eax
jne 0x2f18
leaq 0x51ad(%rip), %rsi      # 0x80b5
movl $0x5, %edx
jmp 0x2f24
leaq 0x51a5(%rip), %rsi      # 0x80bb
jmp 0x2f1f
leaq 0x51a5(%rip), %rsi      # 0x80c4
movl $0x8, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x21c0
// File: /workspace/github_cpp_makefile_star2_O3/PrarabdhJoshi[P]DatabaseImplementation/Comparison.cc
// Function: OrderMaker::OrderMaker(Schema*)
OrderMaker :: OrderMaker(Schema *schema) {
	numAtts = 0;

	int n = schema->GetNumAtts();
	Attribute *atts = schema->GetAtts();

	for (int i = 0; i < n; i++) {
		if (atts[i].myType == Int) {
			whichAtts[numAtts] = i;
			whichTypes[numAtts] = Int;
			numAtts++;
		}
	}

	// now add in the doubles
	for (int i = 0; i < n; i++) {
                if (atts[i].myType == Double) {
                        whichAtts[numAtts] = i;
                        whichTypes[numAtts] = Double;
                        numAtts++;
                }
        }

	// and finally the strings
        for (int i = 0; i < n; i++) {
                if (atts[i].myType == String) {
                        whichAtts[numAtts] = i;
                        whichTypes[numAtts] = String;
                        numAtts++;
                }
        }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl $0x0, (%rdi)
movq %rsi, %rdi
callq 0x427a
movl %eax, %ebp
movq %r14, %rdi
callq 0x427e
testl %ebp, %ebp
jle 0x2ff3
movl %ebp, %ecx
leaq 0x8(%rax), %rdx
xorl %esi, %esi
cmpl $0x0, (%rdx)
jne 0x2f85
movslq (%rbx), %rdi
movl %esi, 0x4(%rbx,%rdi,4)
movslq (%rbx), %rdi
movl $0x0, 0x54(%rbx,%rdi,4)
incl %edi
movl %edi, (%rbx)
incq %rsi
addq $0x10, %rdx
cmpq %rsi, %rcx
jne 0x2f6a
testl %ebp, %ebp
jle 0x2ff3
leaq 0x8(%rax), %rdx
xorl %esi, %esi
cmpl $0x1, (%rdx)
jne 0x2fb6
movslq (%rbx), %rdi
movl %esi, 0x4(%rbx,%rdi,4)
movslq (%rbx), %rdi
movl $0x1, 0x54(%rbx,%rdi,4)
incl %edi
movl %edi, (%rbx)
incq %rsi
addq $0x10, %rdx
cmpq %rsi, %rcx
jne 0x2f9b
testl %ebp, %ebp
jle 0x2ff3
addq $0x8, %rax
xorl %edx, %edx
cmpl $0x2, (%rax)
jne 0x2fe7
movslq (%rbx), %rsi
movl %edx, 0x4(%rbx,%rsi,4)
movslq (%rbx), %rsi
movl $0x2, 0x54(%rbx,%rsi,4)
incl %esi
movl %esi, (%rbx)
incq %rdx
addq $0x10, %rax
cmpq %rdx, %rcx
jne 0x2fcc
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/PrarabdhJoshi[P]DatabaseImplementation/Comparison.cc
// Function: OrderMaker::Print()
void OrderMaker :: Print () {
	printf("NumAtts = %5d\n", numAtts);
	for (int i = 0; i < numAtts; i++)
	{
		printf("%3d: %5d ", i, whichAtts[i]);
		if (whichTypes[i] == Int)
			printf("Int\n");
		else if (whichTypes[i] == Double)
			printf("Double\n");
		else
			printf("String\n");
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rdi), %esi
leaq 0x50be(%rip), %rdi      # 0x80cd
xorl %eax, %eax
callq 0x2060
cmpl $0x0, (%rbx)
jle 0x3071
leaq 0x50ba(%rip), %r14      # 0x80dc
leaq 0x523a(%rip), %r12      # 0x8263
leaq 0x522c(%rip), %r13      # 0x825c
leaq 0x5233(%rip), %rbp      # 0x826a
xorl %r15d, %r15d
movl 0x4(%rbx,%r15,4), %edx
movq %r14, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x2060
movl 0x54(%rbx,%r15,4), %eax
cmpl $0x1, %eax
movq %r13, %rdi
cmoveq %r12, %rdi
testl %eax, %eax
cmoveq %rbp, %rdi
callq 0x2280
incq %r15
movslq (%rbx), %rax
cmpq %rax, %r15
jl 0x303a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/PrarabdhJoshi[P]DatabaseImplementation/Comparison.cc
// Function: CNF::Print()
void CNF :: Print () {

	for (int i = 0; i < numAnds; i++) {
		
		cout << "( ";
		for (int j = 0; j < orLens[i]; j++) {
			orList[i][j].Print ();
			if (j < orLens[i] - 1)
				cout << " OR ";
		}
		cout << ") ";
		if (i < numAnds - 1)
			cout << " AND\n";
		else
			cout << "\n";
	}
}

// Assembly:
cmpl $0x0, 0x25d0(%rdi)
jle 0x322e
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r15d, %r15d
movq 0x8e6f(%rip), %r14      # 0xbfc0
movq %rdi, %r13
movl $0x2, %edx
movq %r14, %rdi
leaq 0x4f83(%rip), %rsi      # 0x80e6
callq 0x21c0
cmpl $0x0, 0x2580(%rbx,%r15,4)
jle 0x31be
movq %r13, %rbp
xorl %r12d, %r12d
movq %rbp, %rdi
callq 0x2dc2
movslq 0x2580(%rbx,%r15,4), %rax
movq %rax, %rcx
decq %rcx
cmpq %rcx, %r12
jge 0x31b0
movl $0x4, %edx
movq %r14, %rdi
leaq 0x4f46(%rip), %rsi      # 0x80e9
callq 0x21c0
movl 0x2580(%rbx,%r15,4), %eax
incq %r12
cltq
addq $0x18, %rbp
cmpq %rax, %r12
jl 0x3179
movl $0x2, %edx
movq %r14, %rdi
leaq 0x4f21(%rip), %rsi      # 0x80ee
callq 0x21c0
movslq 0x25d0(%rbx), %rax
decq %rax
cmpq %rax, %r15
jge 0x31f2
movl $0x5, %edx
movq %r14, %rdi
leaq 0x4f01(%rip), %rsi      # 0x80f1
jmp 0x3201
movl $0x1, %edx
movq %r14, %rdi
leaq 0x5964(%rip), %rsi      # 0x8b65
callq 0x21c0
incq %r15
movslq 0x25d0(%rbx), %rax
addq $0x1e0, %r13            # imm = 0x1E0
cmpq %rax, %r15
jl 0x3154
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/PrarabdhJoshi[P]DatabaseImplementation/Comparison.cc
// Function: AddLitToFile(int&, _IO_FILE*, _IO_FILE*, char*, Type)
void AddLitToFile (int &numFieldsInLiteral, FILE *outRecFile, FILE *outSchemaFile, char *value, Type myType) {

        // first write out the new record field
        fprintf (outRecFile, "%s|", value);

        // now write out the new schema field
        if (myType == Int) {
                fprintf (outSchemaFile, "att%d Int\n", numFieldsInLiteral);
        } else if (myType == Double) {
                fprintf (outSchemaFile, "att%d Double\n", numFieldsInLiteral);
        } else if (myType == String) {
                fprintf (outSchemaFile, "att%d String\n", numFieldsInLiteral);
        } else {
                cerr << "I don't know that type!!\n";
                exit (1);
        }

        // and note that we have another field
        numFieldsInLiteral++;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %r8d, %ebp
movq %rdx, %r14
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x4eb1(%rip), %rsi      # 0x80f7
movq %rax, %rdi
movq %rcx, %rdx
xorl %eax, %eax
callq 0x2240
cmpl $0x3, %ebp
jae 0x327b
movl %ebp, %eax
leaq 0x4e0f(%rip), %rcx      # 0x8070
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
movl (%rbx), %edx
movq %r14, %rdi
xorl %eax, %eax
callq 0x2240
incl (%rbx)
popq %rbx
popq %r14
popq %rbp
retq
movq 0x8d6e(%rip), %rdi      # 0xbff0
leaq 0x4e99(%rip), %rsi      # 0x8122
callq 0x2170
movl $0x1, %edi
callq 0x21f0
// File: /workspace/github_cpp_makefile_star2_O3/PrarabdhJoshi[P]DatabaseImplementation/ComparisonEngine.cc
// Function: ComparisonEngine::Compare(Record*, OrderMaker*, Record*, OrderMaker*)
int ComparisonEngine :: Compare (Record *left, OrderMaker *order_left, Record *right, OrderMaker *order_right) {

	char *val1, *val2;

	char *left_bits = left->GetBits();
	char *right_bits = right->GetBits();

	for (int i = 0; i < order_left->numAtts; i++) {
		val1 = left_bits + ((int *) left_bits)[order_left->whichAtts[i] + 1];
		val2 = right_bits + ((int *) right_bits)[order_right->whichAtts[i] + 1];
	
		// these are used to store the two operands, depending on their type
		int val1Int, val2Int;
		double val1Double, val2Double;
		
		// now check the type and do the comparison
		switch (order_left->whichTypes[i]) {
	
			// first case: we are dealing with integers
			case Int:
	
			// cast the two bit strings to ints
			val1Int = *((int *) val1);
			val2Int = *((int *) val2);
	
			// and do the comparison
			if (val1Int < val2Int) 
				return -1;
			else if (val1Int > val2Int)
				return 1;
	
			break;
	
	
			// second case: dealing with doubles
			case Double:
	
			// cast the two bit strings to doubles
			val1Double = *((double *) val1);
			val2Double = *((double *) val2);
	
			// and do the comparison
			if (val1Double < val2Double)
				return -1;
			else if (val1Double > val2Double)
				return 1;
	
			break;
	
	
			// last case: dealing with strings
			default:
			int sc = strcmp (val1, val2);
			if (sc != 0)
				return sc;

			break;
	
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r12
movq %rdx, %r14
movq %rsi, %rdi
callq 0x2832
movq %rax, %r15
movq %r12, %rdi
callq 0x2832
movslq (%r14), %r13
testq %r13, %r13
jle 0x3e83
movq %rax, %r12
xorl %ebp, %ebp
movslq 0x4(%r14,%rbp,4), %rax
movslq 0x4(%r15,%rax,4), %rdi
addq %r15, %rdi
movslq 0x4(%rbx,%rbp,4), %rax
movslq 0x4(%r12,%rax,4), %rsi
addq %r12, %rsi
movl 0x54(%r14,%rbp,4), %eax
cmpl $0x1, %eax
je 0x3e5c
testl %eax, %eax
jne 0x3e72
movl (%rsi), %eax
cmpl %eax, (%rdi)
jl 0x3e87
jle 0x3e7b
jmp 0x3e8e
movsd (%rdi), %xmm0
movsd (%rsi), %xmm1
ucomisd %xmm0, %xmm1
ja 0x3e87
ucomisd %xmm1, %xmm0
jbe 0x3e7b
jmp 0x3e8e
callq 0x2230
testl %eax, %eax
jne 0x3e93
incq %rbp
cmpq %rbp, %r13
jne 0x3e2a
xorl %eax, %eax
jmp 0x3e93
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x3e93
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/PrarabdhJoshi[P]DatabaseImplementation/ComparisonEngine.cc
// Function: ComparisonEngine::Compare(Record*, Record*, CNF*)
int ComparisonEngine :: Compare (Record *left, Record *literal, CNF *myComparison) {

	for (int i = 0; i < myComparison->numAnds; i++) {

		for (int j = 0; j < myComparison->orLens[i]; j++) {

			// this returns a 0 if the comparison did not eval to true
			int result = Run(left, literal, &myComparison->orList[i][j]);
			
			if (result != 0) {
				break;	
			}
			
			// if we made it through all of the comparisons without a hit, return a 0
			if (j == myComparison->orLens[i] - 1) {
				return 0;
			}
		}

		// this ends the for-loop for the OR-list... if we made it this far, then we'll go on to the
		// next disjunction in the overall CNF expression
	}

	// this ends the for-loop for the AND-list... if we made it this far, then we know that we
	// have satisfied the overall CNF expression
	return 1;	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movl 0x25d0(%rcx), %edx
movl $0x1, %eax
testl %edx, %edx
jle 0x3f2f
movq %rcx, %r14
movq %rsi, %r12
xorl %ebp, %ebp
movq %rcx, %r13
cmpl $0x0, 0x2580(%r14,%rbp,4)
jle 0x3f14
movq %r13, (%rsp)
xorl %ebx, %ebx
movq %r12, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq 0x3f3e
testl %eax, %eax
jne 0x3f09
movslq 0x2580(%r14,%rbp,4), %rax
leal -0x1(%rax), %ecx
cmpq %rcx, %rbx
je 0x3f2d
incq %rbx
addq $0x18, %r13
cmpq %rax, %rbx
jl 0x3edb
movl 0x25d0(%r14), %edx
movq (%rsp), %r13
incq %rbp
movslq %edx, %rcx
addq $0x1e0, %r13            # imm = 0x1E0
cmpq %rcx, %rbp
jl 0x3eca
movl $0x1, %eax
jmp 0x3f2f
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/PrarabdhJoshi[P]DatabaseImplementation/Schema.cc
// Function: Schema::Find(char const*)
int Schema :: Find (const char *attName) {

	for (int i = 0; i < numAtts; i++) {
		if (!strcmp (attName, myAtts[i].name)) {
			return i;
		}
	}

	// if we made it here, the attribute was not found
	return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movslq (%rdi), %r15
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %r15, %r15
jle 0x4221
movq %rsi, %r14
movq 0x8(%rdi), %r13
xorl %r12d, %r12d
movq (%r13), %rsi
movq %r14, %rdi
callq 0x2230
testl %eax, %eax
je 0x421e
incq %r12
addq $0x10, %r13
cmpq %r12, %r15
jne 0x4200
jmp 0x4221
movl %r12d, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/PrarabdhJoshi[P]DatabaseImplementation/Schema.cc
// Function: Schema::FindType(char const*)
Type Schema :: FindType (const char *attName) {

	for (int i = 0; i < numAtts; i++) {
		if (!strcmp (attName, myAtts[i].name)) {
			return myAtts[i].myType;
		}
	}

	// if we made it here, the attribute was not found
	return Int;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movslq (%rdi), %r14
testq %r14, %r14
jle 0x4265
movq %rsi, %rbx
movq 0x8(%rdi), %r15
shlq $0x4, %r14
xorl %r12d, %r12d
movq (%r15,%r12), %rsi
movq %rbx, %rdi
callq 0x2230
testl %eax, %eax
je 0x4269
addq $0x10, %r12
cmpq %r12, %r14
jne 0x424c
xorl %eax, %eax
jmp 0x426e
movl 0x8(%r15,%r12), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/PrarabdhJoshi[P]DatabaseImplementation/File.cc
// Function: Page::Page()
Page :: Page () {
	curSizeInBytes = sizeof (int);
	numRecs = 0;

	myRecs = new (std::nothrow) TwoWayList<Record>;
	if (myRecs == NULL)
	{
		cout << "ERROR : Not enough memory. EXIT !!!\n";
		exit(1);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x775e(%rip), %rax      # 0xbd40
movq %rax, (%rdi)
movabsq $0x400000000, %rax      # imm = 0x400000000
movq %rax, 0x10(%rdi)
movq 0x79a6(%rip), %rsi      # 0xbfa0
movl $0x8, %edi
callq 0x23a0
testq %rax, %rax
je 0x4620
movq %rax, %r14
movq %rax, %rdi
callq 0x4c82
movq %r14, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq $0x0, 0x8(%rbx)
movq 0x7991(%rip), %rdi      # 0xbfc0
leaq 0x39ce(%rip), %rsi      # 0x8004
callq 0x2170
movl $0x1, %edi
callq 0x21f0
movq %rax, %rbx
movq 0x7951(%rip), %rsi      # 0xbfa0
movq %r14, %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x2310
nop
// File: /workspace/github_cpp_makefile_star2_O3/PrarabdhJoshi[P]DatabaseImplementation/File.cc
// Function: Page::EmptyItOut()
void Page :: EmptyItOut () {

	// get rid of all of the records
	while (1) {
		Record temp;
		if (!GetFirst (&temp))
			break;
	}	

	// reset the page size
	curSizeInBytes = sizeof (int);
	numRecs = 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x25fc
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4700
movl %eax, %ebp
movq %r14, %rdi
callq 0x2604
testl %ebp, %ebp
jne 0x46b2
movabsq $0x400000000, %rax      # imm = 0x400000000
movq %rax, 0x10(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2604
movq %rbx, %rdi
callq 0x2310
nop
// File: /workspace/github_cpp_makefile_star2_O3/PrarabdhJoshi[P]DatabaseImplementation/File.cc
// Function: Page::GetFirst(Record*)
int Page :: GetFirst (Record *firstOne) {

	// move to the first record
	myRecs->MoveToStart ();

	// make sure there is data 
	if (!myRecs->RightLength ()) {
		return 0;
	}

	// and remove it
	myRecs->Remove (firstOne);
	numRecs--;

	char *b = firstOne->GetBits();
	curSizeInBytes -= ((int *) b)[0];

	return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
movq (%rdi), %rax
movq (%rax), %rcx
movq %rcx, 0x10(%rax)
movl 0x18(%rax), %ecx
addl %ecx, 0x1c(%rax)
movl $0x0, 0x18(%rax)
je 0x4743
movq %rsi, %r14
callq 0x4e0e
decl 0x10(%rbx)
movq %r14, %rdi
callq 0x2832
movl (%rax), %eax
subl %eax, 0x14(%rbx)
movl $0x1, %eax
jmp 0x4745
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/PrarabdhJoshi[P]DatabaseImplementation/File.cc
// Function: Page::Append(Record*)
int Page :: Append (Record *addMe) {
	char *b = addMe->GetBits();

	// first see if we can fit the record
	if (curSizeInBytes + ((int *) b)[0] > PAGE_SIZE) {
		return 0;
	}

	// move to the last record
	myRecs->MoveToFinish ();

	// and add it
	curSizeInBytes += ((int *) b)[0];
	myRecs->Insert(addMe);
	numRecs++;

	return 1;	
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2832
movl 0x14(%rbx), %edx
movl (%rax), %esi
addl %edx, %esi
xorl %ecx, %ecx
cmpl $0x20000, %esi          # imm = 0x20000
jg 0x47a6
movq 0x8(%rbx), %rdi
movq (%rdi), %rcx
movq 0x8(%rcx), %rsi
movq 0x10(%rsi), %rsi
movq %rsi, 0x10(%rcx)
movl 0x1c(%rcx), %esi
addl %esi, 0x18(%rcx)
movl $0x0, 0x1c(%rcx)
addl (%rax), %edx
movl %edx, 0x14(%rbx)
movq %r14, %rsi
callq 0x4e5e
incl 0x10(%rbx)
movl $0x1, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/PrarabdhJoshi[P]DatabaseImplementation/File.cc
// Function: Page::ToBinary(char*)
void Page :: ToBinary (char *bits) {

	// first write the number of records on the page
	((int *) bits)[0] = numRecs;

	char *curPos = bits + sizeof (int);

	// and copy the records one-by-one
	myRecs->MoveToStart ();
	for (int i = 0; i < numRecs; i++) {	
		char *b = myRecs->Current(0)->GetBits();
		
		// copy over the bits of the current record
		memcpy (curPos, b, ((int *) b)[0]);
		curPos += ((int *) b)[0];

		// and traverse the list
		myRecs->Advance ();
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl 0x10(%rdi), %ecx
movl %ecx, (%rsi)
movq 0x8(%rdi), %rax
movq (%rax), %rdx
movq (%rdx), %rax
movq %rax, 0x10(%rdx)
movl 0x18(%rdx), %esi
addl %esi, 0x1c(%rdx)
movl $0x0, 0x18(%rdx)
testl %ecx, %ecx
jle 0x483b
movq %rdi, %r14
addq $0x4, %rbx
xorl %ebp, %ebp
movq 0x8(%rax), %rax
movq (%rax), %rdi
callq 0x2832
movq %rax, %r15
movslq (%rax), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2130
movslq (%r15), %rax
addq %rax, %rbx
movq 0x8(%r14), %rax
movq (%rax), %rcx
movq 0x18(%rcx), %xmm0
paddd 0x3aee(%rip), %xmm0     # 0x8310
movq %xmm0, 0x18(%rcx)
movq 0x10(%rcx), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rcx)
incl %ebp
cmpl 0x10(%r14), %ebp
jl 0x47eb
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/PrarabdhJoshi[P]DatabaseImplementation/File.cc
// Function: Page::FromBinary(char*)
void Page :: FromBinary (char *bits) {

	// first read the number of records on the page
	numRecs = ((int *) bits)[0];

	// sanity check
	if (numRecs > 1000000 || numRecs < 0) {
		cerr << "This is probably an error.  Found " << numRecs << " records on a page.\n";
		exit (1);
	}

	// and now get the binary representations of each
	char *curPos = bits + sizeof (int);

	// first, empty out the list of current records
	myRecs->MoveToStart ();
	while (myRecs->RightLength ()) {
		Record temp;
		myRecs->Remove(&temp);
	}

	// now loop through and re-populate it
	Record *temp = new (std::nothrow) Record();
	if (temp == NULL)
	{
		cout << "ERROR : Not enough memory. EXIT !!!\n";
		exit(1);
	}

	curSizeInBytes = sizeof (int);
	for (int i = 0; i < numRecs; i++) {

		// get the length of the current record
		int len = ((int *) curPos)[0];
		curSizeInBytes += len;

		// create the record
		temp->CopyBits(curPos, len);

		// add it
		myRecs->Insert(temp);

		// and move along
		myRecs->Advance ();
		curPos += len;
	}

	delete temp;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl (%rsi), %eax
movl %eax, 0x10(%rdi)
cmpl $0xf4241, %eax          # imm = 0xF4241
jae 0x495d
movq %rsi, %r14
movq 0x8(%rbx), %rax
movq (%rax), %rax
movq (%rax), %rcx
movq %rcx, 0x10(%rax)
movl 0x18(%rax), %ecx
addl %ecx, 0x1c(%rax)
movl $0x0, 0x18(%rax)
je 0x48b3
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x25fc
movq 0x8(%rbx), %rdi
movq %r15, %rsi
callq 0x4e0e
movq %r15, %rdi
callq 0x2604
movq 0x8(%rbx), %rax
movq (%rax), %rax
cmpl $0x0, 0x1c(%rax)
jne 0x488a
movq 0x76e6(%rip), %rsi      # 0xbfa0
movl $0x8, %edi
callq 0x23a0
testq %rax, %rax
je 0x4987
movq %rax, %r15
movq %rax, %rdi
callq 0x25fc
movl $0x4, 0x14(%rbx)
cmpl $0x0, 0x10(%rbx)
jle 0x493b
addq $0x4, %r14
xorl %ebp, %ebp
movslq (%r14), %r12
addl %r12d, 0x14(%rbx)
movq %r15, %rdi
movq %r14, %rsi
movl %r12d, %edx
callq 0x2836
movq 0x8(%rbx), %rdi
movq %r15, %rsi
callq 0x4e5e
movq 0x8(%rbx), %rax
movq (%rax), %rax
movq 0x18(%rax), %xmm0
paddd 0x39f0(%rip), %xmm0     # 0x8310
movq %xmm0, 0x18(%rax)
movq 0x10(%rax), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, 0x10(%rax)
addq %r12, %r14
incl %ebp
cmpl 0x10(%rbx), %ebp
jl 0x48eb
movq %r15, %rdi
callq 0x2604
movl $0x8, %esi
movq %r15, %rdi
callq 0x21a0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x768c(%rip), %rdi      # 0xbff0
leaq 0x39b5(%rip), %rsi      # 0x8320
callq 0x2170
movl 0x10(%rbx), %esi
movq %rax, %rdi
callq 0x22f0
leaq 0x39c1(%rip), %rsi      # 0x8343
movq %rax, %rdi
jmp 0x4995
movq 0x7632(%rip), %rdi      # 0xbfc0
leaq 0x366f(%rip), %rsi      # 0x8004
callq 0x2170
movl $0x1, %edi
callq 0x21f0
movq %rax, %rbx
movq 0x75f2(%rip), %rsi      # 0xbfa0
movq %r15, %rdi
callq 0x20f0
jmp 0x49c5
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2604
movq %rbx, %rdi
callq 0x2310
nop
// File: /workspace/github_cpp_makefile_star2_O3/PrarabdhJoshi[P]DatabaseImplementation/File.cc
// Function: File::GetPage(Page*, long)
void File :: GetPage (Page *putItHere, off_t whichPage) {

	// this is because the first page has no data
	whichPage++;

	if (whichPage >= curLength) {
		cerr << "whichPage " << whichPage << " length " << curLength << endl;
		cerr << "BAD: you tried to read past the end of the file\n";
		exit (1);
	}

	// read in the specified page
	char *bits = new (std::nothrow) char[PAGE_SIZE];
	if (bits == NULL)
	{
		cout << "ERROR : Not enough memory. EXIT !!!\n";
		exit(1);
	}

	lseek (myFilDes, PAGE_SIZE * whichPage, SEEK_SET);
	read (myFilDes, bits, PAGE_SIZE);
	putItHere->FromBinary (bits);
	delete [] bits;
	
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rdi, %rbx
incq %r15
cmpq 0x8(%rdi), %r15
jge 0x4a46
movq %rsi, %r14
movq 0x75ad(%rip), %rsi      # 0xbfa0
movl $0x20000, %edi          # imm = 0x20000
callq 0x22d0
testq %rax, %rax
je 0x4a96
movq %rax, %r12
movl (%rbx), %edi
shlq $0x11, %r15
movq %r15, %rsi
xorl %edx, %edx
callq 0x2360
movl (%rbx), %edi
movl $0x20000, %edx          # imm = 0x20000
movq %r12, %rsi
callq 0x2250
movq %r14, %rdi
movq %r12, %rsi
callq 0x4846
movq %r12, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2210
movq 0x75a3(%rip), %r14      # 0xbff0
leaq 0x3904(%rip), %rsi      # 0x8358
movq %r14, %rdi
callq 0x2170
movq %rax, %rdi
movq %r15, %rsi
callq 0x2330
leaq 0x38f5(%rip), %rsi      # 0x8363
movq %rax, %rdi
callq 0x2170
movq 0x8(%rbx), %rsi
movq %rax, %rdi
callq 0x2330
movq %rax, %rdi
callq 0x20e0
leaq 0x38db(%rip), %rsi      # 0x836c
movq %r14, %rdi
jmp 0x4aa4
movq 0x7523(%rip), %rdi      # 0xbfc0
leaq 0x3560(%rip), %rsi      # 0x8004
callq 0x2170
movl $0x1, %edi
callq 0x21f0
nop
// File: /workspace/github_cpp_makefile_star2_O3/PrarabdhJoshi[P]DatabaseImplementation/File.cc
// Function: File::AddPage(Page*, long)
void File :: AddPage (Page *addMe, off_t whichPage) {

	// this is because the first page has no data
	whichPage++;

	// if we are trying to add past the end of the file, then
	// zero all of the pages out
	if (whichPage >= curLength) {
		
		// do the zeroing
		for (off_t i = curLength; i < whichPage; i++) {
			int foo = 0;
			lseek (myFilDes, PAGE_SIZE * i, SEEK_SET);
			write (myFilDes, &foo, sizeof (int));
		}

		// set the size
		curLength = whichPage + 1;	
	}

	// now write the page
	char *bits = new (std::nothrow) char[PAGE_SIZE];
	if (bits == NULL)
	{
		cout << "ERROR : Not enough memory. EXIT !!!\n";
		exit(1);
	}

	addMe->ToBinary (bits);
	lseek (myFilDes, PAGE_SIZE * whichPage, SEEK_SET);
	write (myFilDes, bits, PAGE_SIZE);
	delete [] bits;
#ifdef F_DEBUG
	cerr << " File: curLength " << curLength << " whichPage " << whichPage << endl;
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbp
movq %rdi, %rbx
leaq 0x1(%rdx), %r14
movq 0x8(%rdi), %r13
cmpq %r13, %r14
jl 0x4b30
movq %rdx, %r15
movq %rbp, 0x10(%rsp)
cmpq %rdx, %r13
jg 0x4b23
movq %r15, %r12
subq %r13, %r12
incq %r12
shlq $0x11, %r13
leaq 0xc(%rsp), %rbp
movl $0x0, 0xc(%rsp)
movl (%rbx), %edi
movq %r13, %rsi
xorl %edx, %edx
callq 0x2360
movl (%rbx), %edi
movl $0x4, %edx
movq %rbp, %rsi
callq 0x20b0
addq $0x20000, %r13          # imm = 0x20000
decq %r12
jne 0x4af4
addq $0x2, %r15
movq %r15, 0x8(%rbx)
movq 0x10(%rsp), %rbp
movq 0x7469(%rip), %rsi      # 0xbfa0
movl $0x20000, %edi          # imm = 0x20000
callq 0x22d0
testq %rax, %rax
je 0x4b89
movq %rax, %r12
movq %rbp, %rdi
movq %rax, %rsi
callq 0x47b4
movl (%rbx), %edi
shlq $0x11, %r14
movq %r14, %rsi
xorl %edx, %edx
callq 0x2360
movl (%rbx), %edi
movl $0x20000, %edx          # imm = 0x20000
movq %r12, %rsi
callq 0x20b0
movq %r12, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2210
movq 0x7430(%rip), %rdi      # 0xbfc0
leaq 0x346d(%rip), %rsi      # 0x8004
callq 0x2170
movl $0x1, %edi
callq 0x21f0
// File: /workspace/github_cpp_makefile_star2_O3/PrarabdhJoshi[P]DatabaseImplementation/File.cc
// Function: File::Open(int, char*)
void File :: Open (int fileLen, char *fName) {

	// figure out the flags for the system open call
        int mode;
        if (fileLen == 0)
                mode = O_TRUNC | O_RDWR | O_CREAT;
        else
                mode = O_RDWR;

	// actually do the open
        myFilDes = open (fName, mode, S_IRUSR | S_IWUSR);

#ifdef verbose
	cout << "Opening file " << fName << " with "<< curLength << " pages.\n";
#endif

	// see if there was an error
	if (myFilDes < 0) {
		cerr << "BAD!  Open did not work for " << fName << "\n";
		exit (1);
	}

	// read in the buffer if needed
	if (fileLen != 0) {

		// read in the first few bits, which is the page size
		lseek (myFilDes, 0, SEEK_SET);
		read (myFilDes, &curLength, sizeof (off_t));

	} else {
		curLength = 0;
	}

}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
testl %esi, %esi
movl $0x242, %eax            # imm = 0x242
movl $0x2, %esi
cmovel %eax, %esi
movq %rdx, %rdi
movl $0x180, %edx            # imm = 0x180
xorl %eax, %eax
callq 0x2120
movl %eax, (%rbx)
testl %eax, %eax
js 0x4c09
testl %ebp, %ebp
je 0x4bfc
movl %eax, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2360
movl (%rbx), %edi
addq $0x8, %rbx
movl $0x8, %edx
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x2250
movq $0x0, 0x8(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
movq 0x73e0(%rip), %rdi      # 0xbff0
leaq 0x3786(%rip), %rsi      # 0x839d
callq 0x2170
movq %rax, %rdi
movq %r14, %rsi
callq 0x2170
leaq 0x3f37(%rip), %rsi      # 0x8b65
movq %rax, %rdi
callq 0x2170
movl $0x1, %edi
callq 0x21f0