LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: aaronshim[P]SATurday/./formula.cpp
// Function: Formula::clone()
Formula *Formula::clone() {
  Formula *newFormula = new Formula(nVars);

  for (int i = 0; i < nClauses; i ++) {
    newFormula->addClause(clauses[i]->clone());
  }

  return newFormula;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x20, %edi
callq 0x2140
movq %rax, %rdi
movq -0x30(%rbp), %rax
movq %rdi, %rcx
movq %rcx, -0x28(%rbp)
movl 0x4(%rax), %esi
callq 0x4360
jmp 0x3446
movq -0x28(%rbp), %rax
movq %rax, -0x10(%rbp)
movl $0x0, -0x20(%rbp)
movq -0x30(%rbp), %rcx
movl -0x20(%rbp), %eax
cmpl (%rcx), %eax
jge 0x34b4
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
addq $0x8, %rdi
movslq -0x20(%rbp), %rsi
callq 0x41e0
movq (%rax), %rdi
callq 0x2d80
movq -0x38(%rbp), %rdi
movq %rax, %rsi
callq 0x32e0
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x3455
movq -0x28(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x20, %esi
callq 0x2150
jmp 0x34be
movq -0x10(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x21e0
nopw (%rax,%rax)
// File: aaronshim[P]SATurday/./formula.cpp
// Function: Formula::toString[abi:cxx11]()
string Formula::toString() {
  ostringstream os;

  os << "nClauses: " << nClauses << endl
     << "nVars: " << nVars << endl;

  for (int i = 0; i < nClauses; i ++) {
    os << clauses[i]->toString() << endl;
  }

  return os.str();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x210, %rsp            # imm = 0x210
movq %rdi, -0x1e0(%rbp)
movq %rdi, %rax
movq %rax, -0x1d8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x1d0(%rbp)
leaq -0x188(%rbp), %rdi
movq %rdi, -0x1c8(%rbp)
callq 0x2190
movq -0x1c8(%rbp), %rdi
leaq 0x3af8(%rip), %rsi      # 0x7018
callq 0x2120
movq %rax, -0x1c0(%rbp)
jmp 0x352e
movq -0x1c0(%rbp), %rdi
movq -0x1d0(%rbp), %rax
movl (%rax), %esi
callq 0x21d0
movq %rax, -0x1e8(%rbp)
jmp 0x354c
movq -0x1e8(%rbp), %rdi
movq 0x7a66(%rip), %rsi      # 0xafc0
callq 0x2170
movq %rax, -0x1f0(%rbp)
jmp 0x3568
movq -0x1f0(%rbp), %rdi
leaq 0x3aad(%rip), %rsi      # 0x7023
callq 0x2120
movq %rax, -0x1f8(%rbp)
jmp 0x3584
movq -0x1f8(%rbp), %rdi
movq -0x1d0(%rbp), %rax
movl 0x4(%rax), %esi
callq 0x21d0
movq %rax, -0x200(%rbp)
jmp 0x35a3
movq -0x200(%rbp), %rdi
movq 0x7a0f(%rip), %rsi      # 0xafc0
callq 0x2170
jmp 0x35b8
movl $0x0, -0x198(%rbp)
movq -0x1d0(%rbp), %rcx
movl -0x198(%rbp), %eax
cmpl (%rcx), %eax
jge 0x3684
movq -0x1d0(%rbp), %rdi
addq $0x8, %rdi
movslq -0x198(%rbp), %rsi
callq 0x41e0
movq (%rax), %rsi
leaq -0x1b8(%rbp), %rdi
callq 0x2e20
jmp 0x35ff
leaq -0x188(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x20f0
movq %rax, -0x208(%rbp)
jmp 0x361b
movq -0x208(%rbp), %rdi
movq 0x7997(%rip), %rsi      # 0xafc0
callq 0x2170
jmp 0x3630
leaq -0x1b8(%rbp), %rdi
callq 0x20c0
movl -0x198(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x198(%rbp)
jmp 0x35c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x190(%rbp)
movl %eax, -0x194(%rbp)
jmp 0x36b5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x190(%rbp)
movl %eax, -0x194(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x20c0
jmp 0x36b5
movq -0x1e0(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x2160
jmp 0x3699
leaq -0x188(%rbp), %rdi
callq 0x2040
movq -0x1d8(%rbp), %rax
addq $0x210, %rsp            # imm = 0x210
popq %rbp
retq
leaq -0x188(%rbp), %rdi
callq 0x2040
movq -0x190(%rbp), %rdi
callq 0x21e0
nopl (%rax)
// File: aaronshim[P]SATurday/./parser.cpp
// Function: Parser::parse(_IO_FILE*)
Formula *Parser::parse(FILE *file) {
  int nClauses, nVars;
  fscanf(file, "p cnf %d %d", &nVars, &nClauses);

  Formula *formula = new Formula(nVars);

  for (int i = 0; i < nClauses; i ++) {
    Clause *clause = new Clause();
    formula->addClause(clause);

    // Get next literal.
    while (1) {
      int literal;
      int nScanned = fscanf(file, "%d", &literal);

      if (nScanned == 0 || literal == 0) break;

      clause->addLiteral(abs(literal) - 1, literal > 0);
    }
  }

  return formula;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x3944(%rip), %rsi      # 0x702b
xorl %eax, %eax
leaq -0x10(%rbp), %rdx
leaq -0xc(%rbp), %rcx
callq 0x21f0
movl $0x20, %edi
callq 0x2140
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x40(%rbp)
movl -0x10(%rbp), %esi
callq 0x4360
jmp 0x3714
movq -0x40(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x37e2
movl $0x20, %edi
callq 0x2140
movq %rax, %rdi
movq %rdi, -0x48(%rbp)
xorl %esi, %esi
movl $0x20, %edx
callq 0x20b0
movq -0x48(%rbp), %rdi
callq 0x4070
movq -0x48(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x32e0
movq -0x8(%rbp), %rdi
leaq 0x38bf(%rip), %rsi      # 0x7034
leaq -0x34(%rbp), %rdx
movb $0x0, %al
callq 0x21f0
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
je 0x378f
cmpl $0x0, -0x34(%rbp)
jne 0x37ad
jmp 0x37d2
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x20, %esi
callq 0x2150
jmp 0x37ec
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %esi
movl %esi, %eax
negl %eax
cmovnsl %eax, %esi
subl $0x1, %esi
cmpl $0x0, -0x34(%rbp)
setg %al
movzbl %al, %edx
andl $0x1, %edx
callq 0x29b0
jmp 0x376a
jmp 0x37d4
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x3723
movq -0x18(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x21e0
nopw %cs:(%rax,%rax)
// File: aaronshim[P]SATurday/./parser.cpp
// Function: Parser::open(char*)
FILE *Parser::open(char *fname) {
  FILE *file = fopen(fname, "r");

  if (file == NULL) {
    return NULL;
  }

  return file;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x3820(%rip), %rsi      # 0x7037
callq 0x2180
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x3831
movq $0x0, -0x8(%rbp)
jmp 0x3839
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: aaronshim[P]SATurday/./solver.cpp
// Function: Solver::solve(Formula*)
Model *Solver::solve(Formula *formula) {
  Model *model = new Model(formula->getNVars());

  // // This is just testing code.
  // model->setVar(0);
  // model->setVar(1);
  // model->clearVar(2);
  // cout << model->toString() << endl;

  // Setup.
  srand(time(NULL));

  Model *solvedModel;

  // If nodes failed was surpassed, we restart.
  while (nodesFailed >= CUTOFF) {
    nodesFailed = 0;
    CUTOFF += GLOBAL_CUTOFF;
    solvedModel = solveR(formula, model, 0);
  }

  return solvedModel;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl $0x10, %edi
callq 0x2140
movq %rax, -0x30(%rbp)
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3320
movq -0x30(%rbp), %rdi
movl %eax, %esi
callq 0x23d0
jmp 0x3884
movq -0x38(%rbp), %rax
movq %rax, -0x10(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x2100
movl %eax, %edi
callq 0x2110
movl 0x788a(%rip), %eax      # 0xb12c
cmpl 0x7868(%rip), %eax      # 0xb110
jl 0x38f6
movl $0x0, 0x7878(%rip)      # 0xb12c
movl 0x7856(%rip), %eax      # 0xb110
addl $0xc8, %eax
movl %eax, 0x784b(%rip)      # 0xb110
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %edx, %edx
callq 0x3910
movq %rax, -0x28(%rbp)
jmp 0x389c
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x10, %esi
callq 0x2150
jmp 0x3900
movq -0x28(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x21e0
nopl (%rax)
// File: aaronshim[P]SATurday/./solver.cpp
// Function: Solver::solveRClone(Formula*, Model*, int, int, int)
Model *Solver::solveRClone(Formula *formula, Model *model, int index, int setVar, int backtrackDepth) {
  Model *modelClone = model->clone();
  Formula *formulaClone = formula->clone();
  if (setVar) {
    modelClone->setVar(index);
  } else {
    modelClone->clearVar(index);
  }
  Model *retModel = solveR(formulaClone, modelClone, backtrackDepth + 1);
  delete formulaClone;
  delete modelClone;
  return retModel;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2740
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3410
movq %rax, -0x30(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0x3ac8
movq -0x28(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x24d0
jmp 0x3ad4
movq -0x28(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x24f0
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl -0x1c(%rbp), %edx
addl $0x1, %edx
callq 0x3910
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
je 0x3b10
movq -0x40(%rbp), %rdi
callq 0x2f70
movq -0x40(%rbp), %rdi
movl $0x20, %esi
callq 0x2150
movq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, %rax
je 0x3b35
movq -0x48(%rbp), %rdi
callq 0x2440
movq -0x48(%rbp), %rdi
movl $0x10, %esi
callq 0x2150
movq -0x38(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nop
// File: aaronshim[P]SATurday/main.cpp
// Function: main
int main(int argc, char **argv) {
  if (argc != 2) {
    cerr << "usage: saturday <filename>" << endl;
    return 1;
  }

  // Get file pointer for <filename>.
  char *fname = argv[1];
  FILE *file = Parser::open(fname);
  if (file == NULL) {
    cerr << "File '" << fname << "' failed to open!" << endl;
    return 1;
  }

  // Parse the file.
  Formula *formula = Parser::parse(file);
  fclose(file);

  if (DEBUG >= 5)
    cout << formula->toString();

  // // model testing code
  // Model *testModel = new Model(5);
  // testModel->setVar(1);
  // testModel->setVar(2);
  // testModel->clearVar(2);
  // cout << testModel->toString() << endl;

  Model *model = Solver::solve(formula);

  if (model == NULL) {
    cout << "s UNSATISFIABLE" << endl;
  } else {
    cout << "s SATISFIABLE" << endl;
    cout << "v " << model->toString() << endl;
  }

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x8(%rbp)
je 0x3b8d
movq 0x748a(%rip), %rdi      # 0xaff0
leaq 0x34cc(%rip), %rsi      # 0x7039
callq 0x2120
movq %rax, %rdi
movq 0x7444(%rip), %rsi      # 0xafc0
callq 0x2170
movl $0x1, -0x4(%rbp)
jmp 0x3ce0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3800
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x3bf6
movq 0x743c(%rip), %rdi      # 0xaff0
leaq 0x3499(%rip), %rsi      # 0x7054
callq 0x2120
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x2120
movq %rax, %rdi
leaq 0x3485(%rip), %rsi      # 0x705b
callq 0x2120
movq %rax, %rdi
movq 0x73db(%rip), %rsi      # 0xafc0
callq 0x2170
movl $0x1, -0x4(%rbp)
jmp 0x3ce0
movq -0x20(%rbp), %rdi
callq 0x36d0
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0x2130
movq -0x28(%rbp), %rdi
callq 0x3850
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x3c47
movq 0x73a9(%rip), %rdi      # 0xafd0
leaq 0x343f(%rip), %rsi      # 0x706d
callq 0x2120
movq %rax, %rdi
movq 0x7383(%rip), %rsi      # 0xafc0
callq 0x2170
jmp 0x3cd9
movq 0x7382(%rip), %rdi      # 0xafd0
movq %rdi, -0x80(%rbp)
leaq 0x3424(%rip), %rsi      # 0x707d
callq 0x2120
movq %rax, %rdi
movq 0x7358(%rip), %rsi      # 0xafc0
callq 0x2170
movq -0x80(%rbp), %rdi
leaq 0x3413(%rip), %rsi      # 0x708b
callq 0x2120
movq %rax, -0x78(%rbp)
movq -0x30(%rbp), %rsi
leaq -0x50(%rbp), %rdi
movq %rdi, -0x70(%rbp)
callq 0x2620
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0x20f0
movq %rax, -0x68(%rbp)
jmp 0x3ca5
movq -0x68(%rbp), %rdi
movq 0x7310(%rip), %rsi      # 0xafc0
callq 0x2170
jmp 0x3cb7
leaq -0x50(%rbp), %rdi
callq 0x20c0
jmp 0x3cd9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x20c0
jmp 0x3cec
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x21e0
nopw %cs:(%rax,%rax)
nop
// File: suyash[P]chan/examples/tylertreat_chan/buffered.cc
// Function: main
int main() {
	chan::buffered_chan<std::string> c(2);

	c << "buffered" << "channel";

	std::string message;

	c >> message;
	printf("received '%s'\n", message.c_str());

	c >> message;
	printf("received '%s'\n", message.c_str());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
leaq -0xc8(%rbp), %rdi
movl $0x2, %esi
callq 0x2880
leaq -0xc0(%rbp), %rax
movq %rax, -0x158(%rbp)
leaq -0xe9(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0x2270
movq -0x150(%rbp), %rdx
leaq 0x1b39(%rip), %rsi      # 0x4004
leaq -0xe8(%rbp), %rdi
callq 0x2980
jmp 0x24d9
movq -0x158(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x2950
movq %rax, -0x160(%rbp)
jmp 0x24f5
leaq -0x121(%rbp), %rdi
movq %rdi, -0x168(%rbp)
callq 0x2270
movq -0x168(%rbp), %rdx
leaq 0x1b4d(%rip), %rsi      # 0x4063
leaq -0x120(%rbp), %rdi
callq 0x2980
jmp 0x2524
movq -0x160(%rbp), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
leaq -0x120(%rbp), %rsi
callq *%rax
jmp 0x253d
leaq -0x120(%rbp), %rdi
callq 0x2100
leaq -0x121(%rbp), %rdi
callq 0x21a0
leaq -0xe8(%rbp), %rdi
callq 0x2100
leaq -0xe9(%rbp), %rdi
callq 0x21a0
leaq -0x148(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0x21f0
movq -0x170(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
callq 0x2a30
jmp 0x2595
leaq -0x148(%rbp), %rdi
callq 0x20a0
movq %rax, %rsi
leaq 0x1a62(%rip), %rdi      # 0x400d
xorl %eax, %eax
callq 0x2050
jmp 0x25b4
leaq -0xc8(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x2a30
jmp 0x25c9
leaq -0x148(%rbp), %rdi
callq 0x20a0
movq %rax, %rsi
leaq 0x1a2e(%rip), %rdi      # 0x400d
xorl %eax, %eax
callq 0x2050
jmp 0x25e8
leaq -0x148(%rbp), %rdi
callq 0x2100
leaq -0xc8(%rbp), %rdi
callq 0x2a60
xorl %eax, %eax
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x267d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x2671
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x2665
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x2100
leaq -0x121(%rbp), %rdi
callq 0x21a0
leaq -0xe8(%rbp), %rdi
callq 0x2100
leaq -0xe9(%rbp), %rdi
callq 0x21a0
jmp 0x26a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x2100
leaq -0xc8(%rbp), %rdi
callq 0x2a60
movq -0xf8(%rbp), %rdi
callq 0x2260
nopw %cs:(%rax,%rax)
// File: dacunni[P]stlloader/./stlloader.h
// Function: stlloader::print(stlloader::Facet const&)
void print(const Facet & facet)
{
    auto & n = facet.normal;
    printf("n %f %f %f\n", n.x, n.y, n.z);
    for(int i = 0; i < 3; ++i) {
        auto & v = facet.vertices[i];
        printf(" v%d %f %f %f\n", i, v.x, v.y, v.z);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x24, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movss (%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x10(%rbp), %rax
movss 0x4(%rax), %xmm1
cvtss2sd %xmm1, %xmm1
movq -0x10(%rbp), %rax
movss 0x8(%rax), %xmm2
cvtss2sd %xmm2, %xmm2
leaq 0x395f(%rip), %rdi      # 0x7004
movb $0x3, %al
callq 0x3040
movl $0x0, -0x14(%rbp)
cmpl $0x3, -0x14(%rbp)
jge 0x370e
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rax
movss (%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x20(%rbp), %rax
movss 0x4(%rax), %xmm1
cvtss2sd %xmm1, %xmm1
movq -0x20(%rbp), %rax
movss 0x8(%rax), %xmm2
cvtss2sd %xmm2, %xmm2
leaq 0x3914(%rip), %rdi      # 0x7010
movb $0x3, %al
callq 0x3040
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x36b3
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: dacunni[P]stlloader/./stlloader.h
// Function: stlloader::print(stlloader::Mesh const&)
void print(const Mesh & mesh)
{
    std::cout << "name: " << mesh.name << '\n';
    std::cout << "header: " << mesh.header << '\n';
    std::cout << "num facets: " << mesh.facets.size() << '\n';
    for(auto & facet : mesh.facets) {
        print(facet);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq 0x6895(%rip), %rdi      # 0x9fc8
leaq 0x38e5(%rip), %rsi      # 0x701f
callq 0x3270
movq %rax, %rdi
movq -0x8(%rbp), %rsi
addq $0x18, %rsi
callq 0x3260
movq %rax, %rdi
movl $0xa, %esi
callq 0x3300
movq 0x6865(%rip), %rdi      # 0x9fc8
leaq 0x38bc(%rip), %rsi      # 0x7026
callq 0x3270
movq %rax, %rdi
movq -0x8(%rbp), %rsi
addq $0x38, %rsi
callq 0x3260
movq %rax, %rdi
movl $0xa, %esi
callq 0x3300
movq 0x6835(%rip), %rdi      # 0x9fc8
leaq 0x3895(%rip), %rsi      # 0x702f
callq 0x3270
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
callq 0x50f0
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0x3090
movq %rax, %rdi
movl $0xa, %esi
callq 0x3300
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5120
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5150
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x5180
testb $0x1, %al
jne 0x37fa
jmp 0x381b
leaq -0x18(%rbp), %rdi
callq 0x51c0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x3660
leaq -0x18(%rbp), %rdi
callq 0x51e0
jmp 0x37e7
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: dacunni[P]stlloader/./stlloader.h
// Function: stlloader::consume(std::istream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void consume(std::istream & is, const std::string & expected)
{
    std::string line, label;
    std::getline(is, line);
    std::istringstream ss(line);
    ss >> label;
    if(label != expected)
        throw;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1f0, %rsp            # imm = 0x1F0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x30(%rbp), %rdi
movq %rdi, -0x1e8(%rbp)
callq 0x3390
leaq -0x50(%rbp), %rdi
callq 0x3390
movq -0x1e8(%rbp), %rsi
movq -0x8(%rbp), %rdi
callq 0x3060
jmp 0x386e
leaq -0x1e0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x8, %edx
callq 0x3410
jmp 0x3885
leaq -0x1e0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x3340
jmp 0x3897
movq -0x10(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x5200
testb $0x1, %al
jne 0x38aa
jmp 0x38d9
callq 0x33a0
jmp 0x391b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x3900
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0x3150
jmp 0x3900
leaq -0x1e0(%rbp), %rdi
callq 0x3150
leaq -0x50(%rbp), %rdi
callq 0x3190
leaq -0x30(%rbp), %rdi
callq 0x3190
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbp
retq
leaq -0x50(%rbp), %rdi
callq 0x3190
leaq -0x30(%rbp), %rdi
callq 0x3190
movq -0x58(%rbp), %rdi
callq 0x3440
nopl (%rax,%rax)
// File: dacunni[P]stlloader/./stlloader.h
// Function: stlloader::parse_ascii_solid(std::istream&, stlloader::Mesh&)
void parse_ascii_solid(std::istream & is, Mesh & mesh)
{
    std::string line, kind, param;

    while(std::getline(is, line)) {
        std::istringstream ss(line);
        ss >> kind;
        if(kind == "endsolid") {
            break;
        }
        else if(kind == "facet") {
            Facet facet = {};
            ss >> param;
            if(param != "normal")
                throw;
            ss >> facet.normal;
            parse_ascii_facet(is, facet);
            mesh.facets.push_back(facet);
        }
        else { throw; }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x250, %rsp            # imm = 0x250
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3390
leaq -0x50(%rbp), %rdi
callq 0x3390
leaq -0x70(%rbp), %rdi
callq 0x3390
movq -0x8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3060
movq %rax, -0x248(%rbp)
jmp 0x3cc4
movq -0x248(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3320
movb %al, -0x249(%rbp)
jmp 0x3ce2
movb -0x249(%rbp), %al
testb $0x1, %al
jne 0x3cf1
jmp 0x3e67
leaq -0x200(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x8, %edx
callq 0x3410
jmp 0x3d08
leaq -0x200(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x3340
jmp 0x3d1a
leaq 0x3339(%rip), %rsi      # 0x705a
leaq -0x50(%rbp), %rdi
callq 0x5230
movb %al, -0x24a(%rbp)
jmp 0x3d32
movb -0x24a(%rbp), %al
testb $0x1, %al
jne 0x3d3e
jmp 0x3d7b
movl $0x3, -0x204(%rbp)
jmp 0x3e48
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x3e8b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x3150
jmp 0x3e8b
leaq 0x32d2(%rip), %rsi      # 0x7054
leaq -0x50(%rbp), %rdi
callq 0x5230
movb %al, -0x24b(%rbp)
jmp 0x3d93
movb -0x24b(%rbp), %al
testb $0x1, %al
jne 0x3da2
jmp 0x3e35
xorps %xmm0, %xmm0
movaps %xmm0, -0x220(%rbp)
movaps %xmm0, -0x230(%rbp)
movaps %xmm0, -0x240(%rbp)
leaq -0x200(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x3340
jmp 0x3dcc
leaq 0x3290(%rip), %rsi      # 0x7063
leaq -0x70(%rbp), %rdi
callq 0x5260
movb %al, -0x24c(%rbp)
jmp 0x3de4
movb -0x24c(%rbp), %al
testb $0x1, %al
jne 0x3df0
jmp 0x3dfa
callq 0x33a0
jmp 0x3eaf
leaq -0x21c(%rbp), %rsi
leaq -0x200(%rbp), %rdi
callq 0x3610
jmp 0x3e0f
movq -0x8(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x39a0
jmp 0x3e21
movq -0x10(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x5340
jmp 0x3e33
jmp 0x3e3c
callq 0x33a0
jmp 0x3eaf
jmp 0x3e3e
movl $0x0, -0x204(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x3150
movl -0x204(%rbp), %eax
testl %eax, %eax
je 0x3e62
jmp 0x3e60
jmp 0x3e67
jmp 0x3cae
leaq -0x70(%rbp), %rdi
callq 0x3190
leaq -0x50(%rbp), %rdi
callq 0x3190
leaq -0x30(%rbp), %rdi
callq 0x3190
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq
leaq -0x70(%rbp), %rdi
callq 0x3190
leaq -0x50(%rbp), %rdi
callq 0x3190
leaq -0x30(%rbp), %rdi
callq 0x3190
movq -0x78(%rbp), %rdi
callq 0x3440
nop
// File: dacunni[P]stlloader/./stlloader.h
// Function: stlloader::parse_ascii_stream(std::istream&, stlloader::Mesh&)
void parse_ascii_stream(std::istream & is, Mesh & mesh)
{
    std::string line, kind;
    while(std::getline(is, line)) {
        std::istringstream ss(line);
        ss >> kind;
        if(kind == "solid") {
            ss.ignore(line.length(), ' ');
            std::getline(ss, mesh.name);
            parse_ascii_solid(is, mesh);
        }
        else { throw; }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1f0, %rsp            # imm = 0x1F0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3390
leaq -0x50(%rbp), %rdi
callq 0x3390
movq -0x8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3060
movq %rax, -0x1e8(%rbp)
jmp 0x3eeb
movq -0x1e8(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3320
movb %al, -0x1e9(%rbp)
jmp 0x3f09
movb -0x1e9(%rbp), %al
testb $0x1, %al
jne 0x3f18
jmp 0x3feb
leaq -0x1e0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x8, %edx
callq 0x3410
jmp 0x3f2f
leaq -0x1e0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x3340
jmp 0x3f41
leaq 0x3115(%rip), %rsi      # 0x705d
leaq -0x50(%rbp), %rdi
callq 0x5230
movb %al, -0x1ea(%rbp)
jmp 0x3f59
movb -0x1ea(%rbp), %al
testb $0x1, %al
jne 0x3f65
jmp 0x3fd3
leaq -0x30(%rbp), %rdi
callq 0x33c0
movq %rax, %rsi
leaq -0x1e0(%rbp), %rdi
movl $0x20, %edx
callq 0x31b0
jmp 0x3f84
movq -0x10(%rbp), %rsi
addq $0x18, %rsi
leaq -0x1e0(%rbp), %rdi
callq 0x3060
jmp 0x3f9a
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x3c80
jmp 0x3fa9
jmp 0x3fda
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x4006
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0x3150
jmp 0x4006
callq 0x33a0
jmp 0x4021
leaq -0x1e0(%rbp), %rdi
callq 0x3150
jmp 0x3ed5
leaq -0x50(%rbp), %rdi
callq 0x3190
leaq -0x30(%rbp), %rdi
callq 0x3190
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbp
retq
leaq -0x50(%rbp), %rdi
callq 0x3190
leaq -0x30(%rbp), %rdi
callq 0x3190
movq -0x58(%rbp), %rdi
callq 0x3440
nopw %cs:(%rax,%rax)
// File: dacunni[P]stlloader/./stlloader.h
// Function: float stlloader::little_endian_to_native<float>(float)
float little_endian_to_native(float v) {
    uint32_t vntemp;
    std::memcpy(&vntemp, &v, sizeof(vntemp));
    vntemp = little_endian_to_native(vntemp);
    float result;
    std::memcpy(&result, &vntemp, sizeof(vntemp)); 
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movss %xmm0, -0x4(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %edi
callq 0x53b0
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0xc(%rbp)
movss -0xc(%rbp), %xmm0
addq $0x10, %rsp
popq %rbp
retq
nop
// File: dacunni[P]stlloader/./stlloader.h
// Function: unsigned short stlloader::read_binary_value<unsigned short>(std::istream&)
uint16_t read_binary_value(std::istream & is) {
    uint16_t value;
    is.read((char*)&value, 2);
    value = little_endian_to_native(value);
    return value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq -0xa(%rbp), %rsi
movl $0x2, %edx
callq 0x3330
movzwl -0xa(%rbp), %edi
callq 0x5400
movw %ax, -0xa(%rbp)
movw -0xa(%rbp), %ax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: dacunni[P]stlloader/./stlloader.h
// Function: unsigned int stlloader::read_binary_value<unsigned int>(std::istream&)
uint32_t read_binary_value(std::istream & is) {
    uint32_t value;
    is.read((char*)&value, 4);
    value = little_endian_to_native(value);
    return value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq -0xc(%rbp), %rsi
movl $0x4, %edx
callq 0x3330
movl -0xc(%rbp), %edi
callq 0x53b0
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: dacunni[P]stlloader/./stlloader.h
// Function: float stlloader::read_binary_value<float>(std::istream&)
float read_binary_value(std::istream & is) {
    float value;
    is.read((char*)&value, 4);
    value = little_endian_to_native(value);
    return value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq -0xc(%rbp), %rsi
movl $0x4, %edx
callq 0x3330
movss -0xc(%rbp), %xmm0
callq 0x4030
movss %xmm0, -0xc(%rbp)
movss -0xc(%rbp), %xmm0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: dacunni[P]stlloader/./stlloader.h
// Function: stlloader::Normal stlloader::read_binary_value<stlloader::Normal>(std::istream&)
Normal read_binary_value(std::istream & is) {
    Normal n;
    n.x = read_binary_value<float>(is);
    n.y = read_binary_value<float>(is);
    n.z = read_binary_value<float>(is);
    return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x40e0
movss %xmm0, -0xc(%rbp)
movq -0x18(%rbp), %rdi
callq 0x40e0
movss %xmm0, -0x8(%rbp)
movq -0x18(%rbp), %rdi
callq 0x40e0
movss %xmm0, -0x4(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x20(%rbp)
movq -0xc(%rbp), %rax
movq %rax, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
movss -0x20(%rbp), %xmm1
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: dacunni[P]stlloader/./stlloader.h
// Function: stlloader::parse_binary_stream(std::istream&, stlloader::Mesh&)
void parse_binary_stream(std::istream & is, Mesh & mesh)
{
    char header[STL_BINARY_HDR_SIZE + 1]; // header plus null byte
    is.read(header, STL_BINARY_HDR_SIZE);
    header[STL_BINARY_HDR_SIZE] = '\0'; // null terminate just in case
    mesh.header = header;

    auto num_triangles = read_binary_value<uint32_t>(is);

    for(uint32_t ti = 0; ti < num_triangles; ++ti) {
        Facet facet = {};
        facet.normal = read_binary_value<Normal>(is);
        for(int vi = 0; vi < 3; ++vi) {
            facet.vertices[vi] = read_binary_value<Vertex>(is);
        }
        // This field is unused, but must be present
        //auto attrib_byte_count = read_binary_value<uint16_t>(is);
        read_binary_value<uint16_t>(is);
        mesh.facets.push_back(facet);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
movl $0x50, %edx
callq 0x3330
movb $0x0, -0x20(%rbp)
leaq -0x70(%rbp), %rsi
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
callq 0x3380
movq -0x8(%rbp), %rdi
callq 0x40a0
movl %eax, -0x74(%rbp)
movl $0x0, -0x78(%rbp)
movl -0x78(%rbp), %eax
cmpl -0x74(%rbp), %eax
jae 0x4344
xorps %xmm0, %xmm0
movaps %xmm0, -0x90(%rbp)
movaps %xmm0, -0xa0(%rbp)
movaps %xmm0, -0xb0(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4120
movss %xmm1, -0xc8(%rbp)
movlpd %xmm0, -0xd0(%rbp)
movq -0xd0(%rbp), %rax
movq %rax, -0xbc(%rbp)
movl -0xc8(%rbp), %eax
movl %eax, -0xb4(%rbp)
movq -0xbc(%rbp), %rax
movq %rax, -0x8c(%rbp)
movl -0xb4(%rbp), %eax
movl %eax, -0x84(%rbp)
movl $0x0, -0xd4(%rbp)
cmpl $0x3, -0xd4(%rbp)
jge 0x431d
movq -0x8(%rbp), %rdi
callq 0x4180
movss %xmm1, -0xe8(%rbp)
movlpd %xmm0, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
movq %rax, -0xe0(%rbp)
movl -0xe8(%rbp), %eax
movl %eax, -0xd8(%rbp)
leaq -0xb0(%rbp), %rax
movslq -0xd4(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq -0xe0(%rbp), %rcx
movq %rcx, (%rax)
movl -0xd8(%rbp), %ecx
movl %ecx, 0x8(%rax)
movl -0xd4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd4(%rbp)
jmp 0x42a8
movq -0x8(%rbp), %rdi
callq 0x4060
movq -0x10(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x5340
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x422d
addq $0xf0, %rsp
popq %rbp
retq
nopl (%rax)
// File: dacunni[P]stlloader/./stlloader.h
// Function: stlloader::parse_stream(std::istream&, stlloader::Mesh&)
void parse_stream(std::istream & is, Mesh & mesh)
{
    // Read enough of file to determine its type.
    char header_start[6] = "";
    is.read(header_start, 5);
    header_start[5] = '\0';
    is.seekg(0, is.end);
    int file_size = is.tellg();

    // Rewind so parsers can start at the beginning.
    is.seekg(0, is.beg);

    // Ascii files start with "solid"
    bool is_ascii = (std::string(header_start) == "solid");

    // WAR: Some binary files appear to be ASCII, since they violate
    // the rule of not using "solid" in their metadata. Try to detect
    // this
    int geom_size = file_size - STL_BINARY_HDR_SIZE - STL_BINARY_META_SIZE;

    if(is_ascii &&
       geom_size > 0 &&
       geom_size % STL_BINARY_TRIANGLE_SIZE == 0) {
        //std::cout << "File looks suspiciously like a binary STL\n";
        is_ascii = false;
    }

    if(is_ascii) {
        parse_ascii_stream(is, mesh);
    }
    else {
        parse_binary_stream(is, mesh);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movw $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x18(%rbp), %rsi
movq %rsi, -0x80(%rbp)
movl $0x5, %edx
callq 0x3330
movb $0x0, -0x13(%rbp)
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, -0x84(%rbp)
movl %eax, %esi
movq %rsi, -0x90(%rbp)
movl $0x2, %edx
callq 0x3370
movq -0x8(%rbp), %rdi
callq 0x3430
movq %rax, -0x30(%rbp)
movq %rdx, -0x28(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x5460
movq -0x90(%rbp), %rsi
movl -0x84(%rbp), %edx
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3370
leaq -0x59(%rbp), %rdi
movq %rdi, -0x78(%rbp)
callq 0x3450
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
leaq -0x58(%rbp), %rdi
callq 0x5290
jmp 0x43fc
leaq 0x2c5a(%rip), %rsi      # 0x705d
leaq -0x58(%rbp), %rdi
callq 0x5230
movb %al, -0x91(%rbp)
jmp 0x4414
leaq -0x58(%rbp), %rdi
callq 0x3190
leaq -0x59(%rbp), %rdi
callq 0x32b0
movb -0x91(%rbp), %al
andb $0x1, %al
movb %al, -0x31(%rbp)
movslq -0x1c(%rbp), %rax
subq $0x50, %rax
subq $0x4, %rax
movl %eax, -0x70(%rbp)
testb $0x1, -0x31(%rbp)
je 0x4494
cmpl $0x0, -0x70(%rbp)
jle 0x4494
movslq -0x70(%rbp), %rax
movl $0x32, %ecx
xorl %edx, %edx
divq %rcx
cmpq $0x0, %rdx
jne 0x4494
movb $0x0, -0x31(%rbp)
jmp 0x4494
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x4489
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3190
leaq -0x59(%rbp), %rdi
callq 0x32b0
jmp 0x44bf
testb $0x1, -0x31(%rbp)
je 0x44a9
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x3eb0
jmp 0x44b6
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x41e0
addq $0xa0, %rsp
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x3440
nopl (%rax,%rax)
// File: dacunni[P]stlloader/./stlloader.h
// Function: stlloader::parse_file(char const*, stlloader::Mesh&)
void parse_file(const char * filename, Mesh & mesh)
{
    std::ifstream ifs;
    ifs.exceptions(std::ifstream::failbit | std::ifstream::badbit);
    try {
        ifs.open(filename, std::ifstream::binary);
    }
    catch(...) {
        throw std::runtime_error("File not found: " + std::string(filename));
    }
    parse_stream(ifs, mesh);
    ifs.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x290, %rsp            # imm = 0x290
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x218(%rbp), %rdi
callq 0x32f0
movq -0x218(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x218(%rbp,%rax), %rax
movq %rax, -0x278(%rbp)
movl $0x4, %edi
movl $0x1, %esi
callq 0x5480
movl %eax, -0x270(%rbp)
jmp 0x4520
movl -0x270(%rbp), %esi
movq -0x278(%rbp), %rdi
callq 0x30e0
jmp 0x4534
movq -0x8(%rbp), %rsi
leaq -0x218(%rbp), %rdi
movl $0x4, %edx
callq 0x31a0
jmp 0x454b
jmp 0x46ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x46e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
movq -0x220(%rbp), %rdi
callq 0x3110
movb $0x1, -0x26a(%rbp)
movl $0x10, %edi
callq 0x3160
movq %rax, -0x290(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x288(%rbp)
leaq -0x269(%rbp), %rdi
movq %rdi, -0x280(%rbp)
callq 0x3450
movq -0x288(%rbp), %rsi
movq -0x280(%rbp), %rdx
leaq -0x268(%rbp), %rdi
callq 0x5290
jmp 0x45d7
leaq 0x2a8c(%rip), %rsi      # 0x706a
leaq -0x248(%rbp), %rdi
leaq -0x268(%rbp), %rdx
callq 0x54a0
jmp 0x45f3
movq -0x290(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x33e0
jmp 0x4608
movq -0x290(%rbp), %rdi
movb $0x0, -0x26a(%rbp)
movq 0x59d3(%rip), %rsi      # 0x9ff0
movq 0x599c(%rip), %rdx      # 0x9fc0
callq 0x3420
jmp 0x4701
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x4680
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x4674
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x248(%rbp), %rdi
callq 0x3190
leaq -0x268(%rbp), %rdi
callq 0x3190
leaq -0x269(%rbp), %rdi
callq 0x32b0
testb $0x1, -0x26a(%rbp)
jne 0x4697
jmp 0x46a3
movq -0x290(%rbp), %rdi
callq 0x31f0
callq 0x3400
jmp 0x46aa
jmp 0x46e1
movq -0x10(%rbp), %rsi
leaq -0x218(%rbp), %rdi
callq 0x4350
jmp 0x46be
leaq -0x218(%rbp), %rdi
callq 0x3080
jmp 0x46cc
leaq -0x218(%rbp), %rdi
callq 0x30b0
addq $0x290, %rsp            # imm = 0x290
popq %rbp
retq
leaq -0x218(%rbp), %rdi
callq 0x30b0
movq -0x220(%rbp), %rdi
callq 0x3440
movq %rax, %rdi
callq 0x54f0
nopw %cs:(%rax,%rax)
// File: dacunni[P]stlloader/./stlloader.h
// Function: float stlloader::native_to_little_endian<float>(float)
float native_to_little_endian(float v) {
    uint32_t vntemp;
    std::memcpy(&vntemp, &v, sizeof(vntemp));
    vntemp = native_to_little_endian(vntemp);
    float result;
    std::memcpy(&result, &vntemp, sizeof(vntemp)); 
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movss %xmm0, -0x4(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %edi
callq 0x5500
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0xc(%rbp)
movss -0xc(%rbp), %xmm0
addq $0x10, %rsp
popq %rbp
retq
nop
// File: dacunni[P]stlloader/./stlloader.h
// Function: unsigned int stlloader::little_endian_to_native<unsigned int>(unsigned int)
T little_endian_to_native(T v) {
    T vn = 0;
    for(unsigned int i = 0; i < sizeof(T); ++i) {
        vn += (T)((uint8_t*)&v)[i] << (8 * i);
    }
    return vn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl $0x0, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpq $0x4, %rax
jae 0x53ef
movl -0xc(%rbp), %eax
movzbl -0x4(%rbp,%rax), %eax
movl -0xc(%rbp), %ecx
shll $0x3, %ecx
shll %cl, %eax
addl -0x8(%rbp), %eax
movl %eax, -0x8(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x53c5
movl -0x8(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: dacunni[P]stlloader/./stlloader.h
// Function: unsigned int stlloader::native_to_little_endian<unsigned int>(unsigned int)
T native_to_little_endian(T v) {
    T vn = 0;
    for(unsigned int i = 0; i < sizeof(T); ++i) {
        ((uint8_t*)&vn)[i] = (v >> (8 * i)) & 0xFF;
    }
    return vn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl $0x0, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpq $0x4, %rax
jae 0x5542
movl -0x4(%rbp), %eax
movl -0xc(%rbp), %ecx
shll $0x3, %ecx
shrl %cl, %eax
andl $0xff, %eax
movb %al, %cl
movl -0xc(%rbp), %eax
movb %cl, -0x8(%rbp,%rax)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x5515
movl -0x8(%rbp), %eax
popq %rbp
retq
nopw (%rax,%rax)
// File: reddragon[P]packed-memory-array/impl2.cpp
// Function: log2(int)
int log2(int n) {
    int lg2 = 0;
    while (n > 1) {
        n /= 2;
        ++lg2;
    }
    return lg2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl $0x0, -0x8(%rbp)
cmpl $0x1, -0x4(%rbp)
jle 0x12bd
movl -0x4(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x4(%rbp)
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x129e
movl -0x8(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: reddragon[P]packed-memory-array/impl2.cpp
// Function: test_inserts(PMA&)
void
test_inserts(PMA &p1) {
    p1.insert(80);
    p1.print();

    p1.insert(50);
    p1.print();

    p1.insert(70);
    p1.print();

    p1.insert(90);
    p1.print();

    // assert(is_sorted(p1.begin(), p1.end()));

    // return 0;
    p1.insert(65);
    p1.print();

    p1.insert(85);
    p1.print();

    p1.insert(10);
    p1.print();

    p1.insert(21);
    p1.print();

    p1.insert(22);
    p1.print();

    p1.insert(20);
    p1.print();

    p1.insert(24);
    p1.print();

    p1.insert(15);
    p1.print();

    p1.insert(17);
    p1.print();

    p1.insert(23);
    p1.print();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x50, %esi
callq 0x1540
movq -0x8(%rbp), %rdi
callq 0x1720
movq -0x8(%rbp), %rdi
movl $0x32, %esi
callq 0x1540
movq -0x8(%rbp), %rdi
callq 0x1720
movq -0x8(%rbp), %rdi
movl $0x46, %esi
callq 0x1540
movq -0x8(%rbp), %rdi
callq 0x1720
movq -0x8(%rbp), %rdi
movl $0x5a, %esi
callq 0x1540
movq -0x8(%rbp), %rdi
callq 0x1720
movq -0x8(%rbp), %rdi
movl $0x41, %esi
callq 0x1540
movq -0x8(%rbp), %rdi
callq 0x1720
movq -0x8(%rbp), %rdi
movl $0x55, %esi
callq 0x1540
movq -0x8(%rbp), %rdi
callq 0x1720
movq -0x8(%rbp), %rdi
movl $0xa, %esi
callq 0x1540
movq -0x8(%rbp), %rdi
callq 0x1720
movq -0x8(%rbp), %rdi
movl $0x15, %esi
callq 0x1540
movq -0x8(%rbp), %rdi
callq 0x1720
movq -0x8(%rbp), %rdi
movl $0x16, %esi
callq 0x1540
movq -0x8(%rbp), %rdi
callq 0x1720
movq -0x8(%rbp), %rdi
movl $0x14, %esi
callq 0x1540
movq -0x8(%rbp), %rdi
callq 0x1720
movq -0x8(%rbp), %rdi
movl $0x18, %esi
callq 0x1540
movq -0x8(%rbp), %rdi
callq 0x1720
movq -0x8(%rbp), %rdi
movl $0xf, %esi
callq 0x1540
movq -0x8(%rbp), %rdi
callq 0x1720
movq -0x8(%rbp), %rdi
movl $0x11, %esi
callq 0x1540
movq -0x8(%rbp), %rdi
callq 0x1720
movq -0x8(%rbp), %rdi
movl $0x17, %esi
callq 0x1540
movq -0x8(%rbp), %rdi
callq 0x1720
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: reddragon[P]packed-memory-array/impl2.cpp
// Function: main
int
main() {
    dprintf("log2(%d) = %d\n", 6, log2(6));
    PMA p1;
    // PMA p2(4);
    // PMA p3(8);
    // PMA p10(1024);

    // p10.left_interval_boundary(54, 8);

    // test_inserts(p1);

    srand(0);
    vi_t v;
#define NINSERTS 10000000
    for (int i = 0; i < NINSERTS; ++i) {
        // p1.insert(rand() % 65536);
        p1.insert(NINSERTS - i);
        // v.insert(v.begin(), 100000 - i);
    }
    printf("%llu moves to insert %d elements\n", nmoves, p1.size());

    // assert(is_sorted(p1.begin(), p1.end()));

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movl $0x0, -0x4(%rbp)
leaq -0x78(%rbp), %rdi
movl $0x2, %esi
callq 0x17d0
xorl %edi, %edi
callq 0x10d0
leaq -0x90(%rbp), %rdi
callq 0x18e0
movl $0x0, -0x94(%rbp)
cmpl $0x989680, -0x94(%rbp)  # imm = 0x989680
jge 0x14cd
movl -0x94(%rbp), %eax
movl $0x989680, %esi         # imm = 0x989680
subl %eax, %esi
leaq -0x78(%rbp), %rdi
callq 0x1540
jmp 0x1491
jmp 0x1493
movl -0x94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x94(%rbp)
jmp 0x146d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x1920
leaq -0x78(%rbp), %rdi
callq 0x1980
jmp 0x152a
movq 0x9bfc(%rip), %rax      # 0xb0d0
movq %rax, -0xb0(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x1900
movl %eax, -0xa8(%rbp)
jmp 0x14ec
movl -0xa8(%rbp), %edx
movq -0xb0(%rbp), %rsi
leaq 0x5b40(%rip), %rdi      # 0x7040
xorl %eax, %eax
callq 0x1030
jmp 0x1509
leaq -0x90(%rbp), %rdi
callq 0x1920
leaq -0x78(%rbp), %rdi
callq 0x1980
movl -0x4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
movq -0xa0(%rbp), %rdi
callq 0x1140
nopw %cs:(%rax,%rax)
// File: reddragon[P]packed-memory-array/impl2.cpp
// Function: PMA::PMA(int)
PMA(int capacity = 2)
        : nelems(0) {
        assert(capacity > 1);
        assert(1 << log2(capacity) == capacity);

        this->init_vars(capacity);
        this->impl.resize(capacity);
        this->present.resize(capacity);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
callq 0x18e0
movq -0x30(%rbp), %rdi
movl $0x0, 0x18(%rdi)
addq $0x20, %rdi
movq %rdi, -0x38(%rbp)
callq 0x4c90
movq -0x30(%rbp), %rdi
addq $0x58, %rdi
movq %rdi, -0x28(%rbp)
callq 0x18e0
cmpl $0x1, -0xc(%rbp)
jle 0x181d
jmp 0x183c
leaq 0x5a68(%rip), %rdi      # 0x728c
leaq 0x583e(%rip), %rsi      # 0x7069
movl $0x63, %edx
leaq 0x5a62(%rip), %rcx      # 0x7299
callq 0x1090
movl -0xc(%rbp), %edi
callq 0x1290
movl %eax, %ecx
movl $0x1, %eax
shll %cl, %eax
cmpl -0xc(%rbp), %eax
jne 0x1854
jmp 0x1873
leaq 0x5953(%rip), %rdi      # 0x71ae
leaq 0x5807(%rip), %rsi      # 0x7069
movl $0x64, %edx
leaq 0x5a2b(%rip), %rcx      # 0x7299
callq 0x1090
movq -0x30(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x3ef0
movq -0x30(%rbp), %rdi
movslq -0xc(%rbp), %rsi
callq 0x4cb0
jmp 0x188e
movq -0x30(%rbp), %rdi
addq $0x20, %rdi
movslq -0xc(%rbp), %rsi
xorl %edx, %edx
callq 0x4d40
jmp 0x18a3
addq $0x40, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x1920
movq -0x38(%rbp), %rdi
callq 0x3fb0
movq -0x30(%rbp), %rdi
callq 0x1920
movq -0x18(%rbp), %rdi
callq 0x1140
nopl (%rax)
// File: reddragon[P]packed-memory-array/impl2.cpp
// Function: PMA::lower_bound(int)
int
    lower_bound(int v) {
        int i;
        if (this->nelems == 0) {
            i = this->impl.size();
        } else {
#if 0
            for (i = 0; i < this->impl.size(); ++i) {
                if (this->present[i] && !(this->impl[i] < v)) {
                    break;
                }
            }
#else
            int l = 0, r = this->nchunks;
            int m;
            while (l != r) {
                m = l + (r-l)/2;
                int sz;
                int left = left_interval_boundary(m * chunk_size, chunk_size);
                int pos = lb_in_chunk(left, v);

                // Why does this work? We assume that every chunk of
                // size this->chunk_size contains at least 1
                // element. Hence, if we reach the end of an interval
                // without finding a lower bound, we conclude that all
                // the elements in this chunk are < 'v'. Because every
                // chunk contains at least 1 element, we will never
                // reach the end of an interval because the interval
                // is empty.
                //
                // Note: This is why we need lower density thresholds!
                // 
                if (pos == left + chunk_size) {
                    // Move to right half
                    l = m + 1;
                } else {
                    r = m;
                }
            }
            i = l * chunk_size;
#endif
        }
        dprintf("lower_bound(%d) == %d\n", v, i);
        return i;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpl $0x0, 0x18(%rax)
jne 0x19ee
movq -0x30(%rbp), %rdi
callq 0x1a90
movl %eax, -0x10(%rbp)
jmp 0x1a7f
movq -0x30(%rbp), %rax
movl $0x0, -0x14(%rbp)
movl 0x4c(%rax), %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
je 0x1a71
movq -0x30(%rbp), %rdi
movl -0x14(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x18(%rbp), %eax
subl -0x14(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x34(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %esi
imull 0x48(%rdi), %esi
movl 0x48(%rdi), %edx
callq 0x1ab0
movq -0x30(%rbp), %rdi
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %esi
movl -0xc(%rbp), %edx
callq 0x2490
movq -0x30(%rbp), %rdx
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl -0x24(%rbp), %ecx
addl 0x48(%rdx), %ecx
cmpl %ecx, %eax
jne 0x1a69
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1a6f
movl -0x1c(%rbp), %eax
movl %eax, -0x18(%rbp)
jmp 0x19ff
movq -0x30(%rbp), %rcx
movl -0x14(%rbp), %eax
imull 0x48(%rcx), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: reddragon[P]packed-memory-array/impl2.cpp
// Function: PMA::left_interval_boundary(int, int)
int
    left_interval_boundary(int i, int interval_size) {
        assert(interval_size == (1 << log2(interval_size)));
        assert(i < (int)this->impl.size());

        int q = i / interval_size;
        int boundary = q * interval_size;
        dprintf("left_interval_boundary(%d, %d) = %d\n", i, interval_size, boundary);
        return boundary;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x10(%rbp), %edi
callq 0x1290
movl %eax, %ecx
movl -0x1c(%rbp), %eax
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
cmpl %ecx, %eax
jne 0x1aec
jmp 0x1b0b
leaq 0x55ac(%rip), %rdi      # 0x709f
leaq 0x556f(%rip), %rsi      # 0x7069
movl $0x7f, %edx
leaq 0x55c5(%rip), %rcx      # 0x70cb
callq 0x1090
movq -0x28(%rbp), %rdi
movl -0xc(%rbp), %eax
movl %eax, -0x2c(%rbp)
callq 0x1a90
movq %rax, %rcx
movl -0x2c(%rbp), %eax
cmpl %ecx, %eax
jge 0x1b26
jmp 0x1b45
leaq 0x55c8(%rip), %rdi      # 0x70f5
leaq 0x5535(%rip), %rsi      # 0x7069
movl $0x80, %edx
leaq 0x558b(%rip), %rcx      # 0x70cb
callq 0x1090
movl -0xc(%rbp), %eax
cltd
idivl -0x10(%rbp)
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
imull -0x10(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)