LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: SunriseFox[P]very-simple-c-compiler/./src/tree.cpp
// Function: TreeNode::addChild(TreeNode*)
void TreeNode::addChild(TreeNode *node)
{
    if (node == nullptr
            || (node->nodeType == NODE_STATMENT
                && static_cast<StatementNode*>(node)->type == StatementNode::StatementNode::ST_EMPTY)) return;
    if (child == nullptr) {
        child = node;
        return;
    }
    if (child->sibling == nullptr) {
        child->sibling = node;
        return;
    }
    auto cur = child->sibling;
    while (cur->sibling != nullptr) {
        cur = cur->sibling;
    }
    cur->sibling = node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x1573f
movq -0x10(%rbp), %rax
cmpl $0x1, 0x10(%rax)
jne 0x15741
movq -0x10(%rbp), %rax
cmpl $0x1, 0x30(%rax)
jne 0x15741
jmp 0x157b0
movq -0x20(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x1575a
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, 0x18(%rax)
jmp 0x157b0
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
cmpq $0x0, 0x20(%rax)
jne 0x1577b
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x18(%rax), %rax
movq %rcx, 0x20(%rax)
jmp 0x157b0
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x157a4
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x1578b
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: SunriseFox[P]very-simple-c-compiler/./src/tree.cpp
// Function: TreeNode::addSibling(TreeNode*)
void TreeNode::addSibling(TreeNode *node)
{
    if (sibling == nullptr) {
        sibling = node;
        return;
    }
    auto cur = sibling;
    while (cur->sibling != nullptr) {
        cur = cur->sibling;
    }
    cur->sibling = node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, 0x20(%rax)
jne 0x157e9
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, 0x20(%rax)
jmp 0x1581a
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x1580e
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x157f5
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
popq %rbp
retq
nopl (%rax)
// File: SunriseFox[P]very-simple-c-compiler/./src/tree.cpp
// Function: ExprNode::ExprNode(int, Symbol::ValueType, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool)
ExprNode::ExprNode(int lineno, Symbol::ValueType type, string value, bool isConstant)
    : TreeNode(lineno, NODE_EXPRESSION)
{
    if (isConstant)
        this->symbol = new Constant(type, value);
    else
        this->symbol = new Variable(type, value);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rcx, -0x90(%rbp)
movb %r8b, %al
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x88(%rbp)
movl -0xc(%rbp), %esi
movl $0x3, %edx
callq 0x156b0
movq -0x88(%rbp), %rax
leaq 0xb22a(%rip), %rcx      # 0x20c48
addq $0x10, %rcx
movq %rcx, (%rax)
testb $0x1, -0x19(%rbp)
je 0x15aef
movl $0x30, %edi
callq 0x3250
movq %rax, -0x98(%rbp)
jmp 0x15a42
movq -0x90(%rbp), %rsi
movb $0x1, -0x51(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x9c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x3110
jmp 0x15a61
movl -0x9c(%rbp), %esi
movq -0x98(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x154b0
jmp 0x15a79
movq -0x88(%rbp), %rax
movq -0x98(%rbp), %rcx
movb $0x0, -0x51(%rbp)
movq %rcx, 0x28(%rax)
leaq -0x50(%rbp), %rdi
callq 0x3180
jmp 0x15b98
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x15ba1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x15ad1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x3180
testb $0x1, -0x51(%rbp)
jne 0x15ad9
jmp 0x15aea
movq -0x98(%rbp), %rdi
movl $0x30, %esi
callq 0x3260
jmp 0x15ba1
movl $0x30, %edi
callq 0x3250
movq %rax, -0xa8(%rbp)
jmp 0x15b02
movq -0x90(%rbp), %rsi
movb $0x1, -0x79(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0xac(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x3110
jmp 0x15b21
movl -0xac(%rbp), %esi
movq -0xa8(%rbp), %rdi
leaq -0x78(%rbp), %rdx
callq 0x15530
jmp 0x15b39
movq -0x88(%rbp), %rax
movq -0xa8(%rbp), %rcx
movb $0x0, -0x79(%rbp)
movq %rcx, 0x28(%rax)
leaq -0x78(%rbp), %rdi
callq 0x3180
jmp 0x15b98
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x15b7d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x3180
testb $0x1, -0x79(%rbp)
jne 0x15b85
jmp 0x15b96
movq -0xa8(%rbp), %rdi
movl $0x30, %esi
callq 0x3260
jmp 0x15ba1
addq $0xb0, %rsp
popq %rbp
retq
movq -0x88(%rbp), %rdi
callq 0x169c0
movq -0x28(%rbp), %rdi
callq 0x3480
nopw %cs:(%rax,%rax)
// File: sykeben[P]overos/cmd/hello.cpp
// Function: main
int main(int argc, char** argv) {
	cout << "Hello, World! I'm gonna test arguments now!" << _TERM;
	cout << "Arguments used with \"" << argv[0] << "\":" << _TERM;
  for (int n = 1; n < argc; n++)
    cout << setw(2) << n << ": " << argv[n] << _TERM;
  return 0;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq 0x2deb(%rip), %rdi      # 0x3fd8
leaq 0xe10(%rip), %rsi       # 0x2004
callq 0x1040
movq %rax, %rdi
movl $0xa, %esi
callq 0x1060
movq 0x2dcb(%rip), %rdi      # 0x3fd8
leaq 0xe1c(%rip), %rsi       # 0x2030
callq 0x1040
movq %rax, %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x1040
movq %rax, %rdi
leaq 0xe14(%rip), %rsi       # 0x2046
callq 0x1040
movq %rax, %rdi
movl $0xa, %esi
callq 0x1060
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x12b5
movl $0x2, %edi
callq 0x12c0
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %esi
movq 0x2d6e(%rip), %rdi      # 0x3fd8
callq 0x1050
movq %rax, %rdi
movl -0x14(%rbp), %esi
callq 0x1080
movq %rax, %rdi
leaq 0xdc5(%rip), %rsi       # 0x2049
callq 0x1040
movq %rax, %rdi
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x1040
movq %rax, %rdi
movl $0xa, %esi
callq 0x1060
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x124b
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: Altius[P]hotspot2/src/hotspot2_part1.cpp
// Function: intern(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
string* intern(string s)
{
  map<string, string*>::iterator it = interned.find(s);
  if (it == interned.end())
    {
      interned[s] = new string(s);
      chromAsInt[interned[s]] = static_cast<int>(interned.size());
      return interned[s];
    }
  return it->second;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, %rsi
movq %rsi, -0x38(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x17c1e(%rip), %rdi     # 0x1b278
callq 0x9fd0
movq %rax, -0x18(%rbp)
leaq 0x17c0e(%rip), %rdi     # 0x1b278
callq 0xa030
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0xa000
testb $0x1, %al
jne 0x3689
jmp 0x3727
movl $0x20, %edi
callq 0x3250
movq -0x38(%rbp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x40(%rbp)
callq 0x30e0
jmp 0x36a8
movq -0x38(%rbp), %rsi
leaq 0x17bc5(%rip), %rdi     # 0x1b278
callq 0xa060
movq -0x40(%rbp), %rcx
movq %rcx, (%rax)
leaq 0x17bb2(%rip), %rdi     # 0x1b278
callq 0xa140
movq -0x38(%rbp), %rsi
movl %eax, -0x44(%rbp)
leaq 0x17b9f(%rip), %rdi     # 0x1b278
callq 0xa060
movq %rax, %rsi
leaq 0x17bc0(%rip), %rdi     # 0x1b2a8
callq 0xa160
movl -0x44(%rbp), %ecx
movq -0x38(%rbp), %rsi
movl %ecx, (%rax)
leaq 0x17b7b(%rip), %rdi     # 0x1b278
callq 0xa060
movq (%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x3738
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
movl $0x20, %esi
callq 0x3260
jmp 0x3742
leaq -0x18(%rbp), %rdi
callq 0xa240
movq 0x20(%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x3430
nopl (%rax,%rax)
// File: Altius[P]hotspot2/src/hotspot2_part1.cpp
// Function: idxFromChrom(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*)
int idxFromChrom(string* ptr)
{
  map<string*, int>::const_iterator it = chromAsInt.find(ptr);
  if (chromAsInt.end() == it)
    {
      cerr << "Coding error:  Line " << __LINE__ << ", failed to find \""
	   << *ptr << "\" in the lookup table." << endl << endl;
      exit(2);
    }
  return it->second;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x17b45(%rip), %rdi     # 0x1b2a8
leaq -0x8(%rbp), %rsi
callq 0xa260
movq %rax, -0x18(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0xa290
leaq 0x17b24(%rip), %rdi     # 0x1b2a8
callq 0xa2e0
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0xa290
leaq -0x20(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0xa2b0
testb $0x1, %al
jne 0x37ad
jmp 0x381f
movq 0x1783c(%rip), %rdi     # 0x1aff0
leaq 0xf885(%rip), %rsi      # 0x13040
callq 0x3240
movq %rax, %rdi
movl $0x34, %esi
callq 0x3420
movq %rax, %rdi
leaq 0xf87e(%rip), %rsi      # 0x13055
callq 0x3240
movq %rax, %rdi
movq -0x8(%rbp), %rsi
callq 0x3230
movq %rax, %rdi
leaq 0xf876(%rip), %rsi      # 0x13068
callq 0x3240
movq %rax, %rdi
movq 0x177a7(%rip), %rsi     # 0x1afa8
callq 0x3280
movq %rax, %rdi
movq 0x17798(%rip), %rsi     # 0x1afa8
callq 0x3280
movl $0x2, %edi
callq 0x3330
leaq -0x10(%rbp), %rdi
callq 0xa310
movl 0x8(%rax), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: Altius[P]hotspot2/src/hotspot2_part1.cpp
// Function: nextProbNegativeBinomial(int const&, long double const&, std::vector<long double, std::allocator<long double>> const&)
long double nextProbNegativeBinomial(const int& k, const long double& prevVal, const vector<long double>& params)
{
  if (params.size() < 2)
    {
      cerr << "Error:  nextProbNegativeBinomial() received an incorrect parameter vector; expected m, r."
           << endl
           << endl;
      exit(1);
    }
  if (0 == k)
    {
      cerr << "Error:  nextProbNegativeBinomial() received k = 0, which is invalid (require k > 0)."
           << endl
           << endl;
      exit(1);
    }
  const long double &m(params[0]), &r(params[1]), kk(static_cast<long double>(k));
  if (r + m == 0)
    {
      cerr << "Error:  nextProbNegativeBinomial() received m = " << m
           << " and r = " << r << ", which is invalid (require r+m > 0)."
           << endl
           << endl;
      exit(1);
    }
  return prevVal * m * (r + kk - 1.) / ((r + m) * kk);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0xa330
cmpq $0x2, %rax
jae 0x389e
movq 0x17786(%rip), %rdi     # 0x1aff0
leaq 0xf80e(%rip), %rsi      # 0x1307f
callq 0x3240
movq %rax, %rdi
movq 0x17728(%rip), %rsi     # 0x1afa8
callq 0x3280
movq %rax, %rdi
movq 0x17719(%rip), %rsi     # 0x1afa8
callq 0x3280
movl $0x1, %edi
callq 0x3330
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpl (%rcx), %eax
jne 0x38e3
movq 0x17741(%rip), %rdi     # 0x1aff0
leaq 0xf823(%rip), %rsi      # 0x130d9
callq 0x3240
movq %rax, %rdi
movq 0x176e3(%rip), %rsi     # 0x1afa8
callq 0x3280
movq %rax, %rdi
movq 0x176d4(%rip), %rsi     # 0x1afa8
callq 0x3280
movl $0x1, %edi
callq 0x3330
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xa350
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0xa350
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x44(%rbp)
fildl -0x44(%rbp)
fstpt -0x40(%rbp)
movq -0x28(%rbp), %rax
fldt (%rax)
movq -0x20(%rbp), %rax
fldt (%rax)
faddp %st, %st(1)
fldz
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
jne 0x39b8
jp 0x39b8
jmp 0x3939
movq 0x176b0(%rip), %rdi     # 0x1aff0
leaq 0xf7e7(%rip), %rsi      # 0x1312e
callq 0x3240
movq %rax, %rdi
movq -0x20(%rbp), %rax
fldt (%rax)
movq %rsp, %rax
fstpt (%rax)
callq 0x3300
movq %rax, %rdi
leaq 0xf7f6(%rip), %rsi      # 0x1315f
callq 0x3240
movq %rax, %rdi
movq -0x28(%rbp), %rax
fldt (%rax)
movq %rsp, %rax
fstpt (%rax)
callq 0x3300
movq %rax, %rdi
leaq 0xf7de(%rip), %rsi      # 0x13169
callq 0x3240
movq %rax, %rdi
movq 0x1760e(%rip), %rsi     # 0x1afa8
callq 0x3280
movq %rax, %rdi
movq 0x175ff(%rip), %rsi     # 0x1afa8
callq 0x3280
movl $0x1, %edi
callq 0x3330
movq -0x10(%rbp), %rax
fldt (%rax)
movq -0x20(%rbp), %rax
fldt (%rax)
fmul %st, %st(1)
movq -0x28(%rbp), %rax
fldt (%rax)
fldt -0x40(%rbp)
fld %st(1)
fadd %st(1), %st
fld1
fchs
faddp %st, %st(1)
fmulp %st, %st(4)
fxch %st(1)
faddp %st, %st(2)
fmulp %st, %st(1)
fdivrp %st, %st(1)
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: Altius[P]hotspot2/src/hotspot2_part1.cpp
// Function: nextProbPoisson(int const&, long double const&, std::vector<long double, std::allocator<long double>> const&)
long double nextProbPoisson(const int& k, const long double& prevVal, const vector<long double>& params)
{
  if (params.empty())
    {
      cerr << "Error:  nextProbPoisson() received an incorrect parameter vector; expected m."
           << endl
           << endl;
      exit(1);
    }
  if (0 == k)
    {
      cerr << "Error:  nextProbPoisson() received k = 0, which is invalid (require k > 0)."
           << endl
           << endl;
      exit(1);
    }
  const long double &m(params[0]), kk(static_cast<long double>(k));
  return prevVal * m / kk;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0xa370
testb $0x1, %al
jne 0x3bb3
jmp 0x3bee
movq 0x17436(%rip), %rdi     # 0x1aff0
leaq 0xf6c4(%rip), %rsi      # 0x13285
callq 0x3240
movq %rax, %rdi
movq 0x173d8(%rip), %rsi     # 0x1afa8
callq 0x3280
movq %rax, %rdi
movq 0x173c9(%rip), %rsi     # 0x1afa8
callq 0x3280
movl $0x1, %edi
callq 0x3330
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpl (%rcx), %eax
jne 0x3c33
movq 0x173f1(%rip), %rdi     # 0x1aff0
leaq 0xf6cd(%rip), %rsi      # 0x132d3
callq 0x3240
movq %rax, %rdi
movq 0x17393(%rip), %rsi     # 0x1afa8
callq 0x3280
movq %rax, %rdi
movq 0x17384(%rip), %rsi     # 0x1afa8
callq 0x3280
movl $0x1, %edi
callq 0x3330
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xa350
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x34(%rbp)
fildl -0x34(%rbp)
fstpt -0x30(%rbp)
movq -0x10(%rbp), %rax
fldt (%rax)
movq -0x20(%rbp), %rax
fldt (%rax)
fmulp %st, %st(1)
fldt -0x30(%rbp)
fdivrp %st, %st(1)
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: Altius[P]hotspot2/src/hotspot2_part1.cpp
// Function: BackgroundRegionManager::BackgroundRegionManager(int const&, int const&)
BackgroundRegionManager::BackgroundRegionManager(const int& samplingInterval, const int& MAlength)
{
  m_posL = m_posC = m_posR = -1;
  m_runningSum_count = m_runningSum_countSquared
    = m_runningSum_count_duringPrevComputation = m_runningSum_countSquared_duringPrevComputation = 0;
  m_numPtsInNullRegion = m_numPtsInNullRegion_duringPrevComputation = 0;
  m_kcutoff = m_modeYval = m_modeXval = -1;
  m_MAlength = MAlength; // see explanation in findCutoff(); 5 is good when samplingInterval = 1, 15 is good when windowSize/samplingInterval ~= 250
  m_thresholdRatio = 1.33; // see explanation in findCutoff(); could instead try 1.4. 1.5 seems to be too high, 1.2 seems to be too low.
  m_sliding = false;
  m_needToUpdate_kcutoff = true;

  m_samplingInterval = samplingInterval;
  m_nextPosToSample = -1;
  m_sampledDataDistnSize = 0;

  m_minMAxN = m_kTrendReversal = -1;
  m_prev_k = -1;
  m_pmf = NULL;
  m_pCurChrom = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x38(%rbp)
addq $0x50, %rdi
movq %rdi, -0x40(%rbp)
callq 0xa7e0
movq -0x38(%rbp), %rdi
addq $0x68, %rdi
movq %rdi, -0x30(%rbp)
callq 0xa800
jmp 0x40fc
movq -0x38(%rbp), %rdi
addq $0xb8, %rdi
callq 0xa800
jmp 0x410e
movq -0x38(%rbp), %rdi
addq $0x120, %rdi            # imm = 0x120
callq 0xa820
movq -0x38(%rbp), %rdi
addq $0x170, %rdi            # imm = 0x170
callq 0xa840
movq -0x38(%rbp), %rax
movl $0xffffffff, 0x4(%rax)  # imm = 0xFFFFFFFF
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq $0x0, 0x30(%rax)
movq $0x0, 0x28(%rax)
movq $0x0, 0x18(%rax)
movq $0x0, 0x10(%rax)
movl $0x0, 0x38(%rax)
movl $0x0, 0x20(%rax)
movl $0xffffffff, 0x108(%rax) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x10c(%rax) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x110(%rax) # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, 0x3c(%rax)
fldl 0xee77(%rip)            # 0x13018
fstpt 0x40(%rax)
movb $0x0, 0x118(%rax)
movb $0x1, 0x119(%rax)
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, 0x158(%rax)
movl $0xffffffff, 0x15c(%rax) # imm = 0xFFFFFFFF
movl $0x0, 0x160(%rax)
movl $0xffffffff, 0x114(%rax) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x150(%rax) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x154(%rax) # imm = 0xFFFFFFFF
movq $0x0, 0x168(%rax)
movq $0x0, 0x188(%rax)
addq $0x40, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x422f
movq -0x30(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0xa860
movq -0x40(%rbp), %rdi
callq 0xa8d0
movq -0x20(%rbp), %rdi
callq 0x3430
nopw %cs:(%rax,%rax)
// File: Altius[P]hotspot2/src/hotspot2_part1.cpp
// Function: BackgroundRegionManager::setBounds(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const*, int, int)
void BackgroundRegionManager::setBounds(const string* pChrom, const int posL, const int posR)
{
  if (posR <= posL)
    {
      cerr << "Error:  BackgroundRegionManager::setBounds() received posL = "
           << posL << " and posR = " << posR << "; must have posL <= posR."
           << endl
           << endl;
      exit(1);
    }
  m_pCurChrom = pChrom; // used solely for warning and error messages and debugging
  m_posL = posL;
  m_posR = posR;
  m_posC = m_posL + (m_posR - m_posL) / 2; // integer division
  m_nextPosToSample = m_posL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jg 0x42e5
movq 0x16d73(%rip), %rdi     # 0x1aff0
leaq 0xf0dc(%rip), %rsi      # 0x13360
callq 0x3240
movq %rax, %rdi
movl -0x14(%rbp), %esi
callq 0x3420
movq %rax, %rdi
leaq 0xf100(%rip), %rsi      # 0x1339e
callq 0x3240
movq %rax, %rdi
movl -0x18(%rbp), %esi
callq 0x3420
movq %rax, %rdi
leaq 0xf0f3(%rip), %rsi      # 0x133ab
callq 0x3240
movq %rax, %rdi
movq 0x16ce1(%rip), %rsi     # 0x1afa8
callq 0x3280
movq %rax, %rdi
movq 0x16cd2(%rip), %rsi     # 0x1afa8
callq 0x3280
movl $0x1, %edi
callq 0x3330
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rax
movq %rax, 0x188(%rdx)
movl -0x14(%rbp), %eax
movl %eax, (%rdx)
movl -0x18(%rbp), %eax
movl %eax, 0x4(%rdx)
movl (%rdx), %ecx
movl 0x4(%rdx), %eax
subl (%rdx), %eax
movl $0x2, %esi
cltd
idivl %esi
movl %eax, %edx
movq -0x20(%rbp), %rax
addl %edx, %ecx
movl %ecx, 0x8(%rax)
movl (%rax), %ecx
movl %ecx, 0x15c(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: Altius[P]hotspot2/src/hotspot2_part1.cpp
// Function: SiteManager::writeLastUnreportedSite()
inline void SiteManager::writeLastUnreportedSite()
{
  if (!m_sites.empty())
    {
      cout << idxFromChrom(m_sites.front().chrom) << '\t'
	   << m_sites.front().begPos << '\t'
	   << m_sites.front().endPos - m_sites.front().begPos << '\t'
	   << m_sites.front().negLog10P_scaled;
#ifdef DEBUG
      cout << '\t' << m_sites.front().sampled;
#endif
      cout << '\n';
      m_ofsJustNegLog10PscaledAndNumOccs << m_sites.front().negLog10P_scaled << '\t'
					 << m_sites.front().endPos - m_sites.front().begPos << '\n';
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x10(%rbp)
callq 0xbaa0
testb $0x1, %al
jne 0xa760
movq -0x10(%rbp), %rdi
callq 0xbad0
movq (%rax), %rdi
callq 0x3750
movl %eax, %esi
movq 0x1096d(%rip), %rdi     # 0x1afc8
callq 0x3420
movq %rax, %rdi
movl $0x9, %esi
callq 0x3310
movq -0x10(%rbp), %rdi
movq %rax, -0x48(%rbp)
callq 0xbad0
movq -0x48(%rbp), %rdi
movq 0x20(%rax), %rsi
callq 0x3470
movq %rax, %rdi
movl $0x9, %esi
callq 0x3310
movq -0x10(%rbp), %rdi
movq %rax, -0x38(%rbp)
callq 0xbad0
movq -0x10(%rbp), %rdi
movq 0x28(%rax), %rax
movq %rax, -0x40(%rbp)
callq 0xbad0
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdi
subq 0x20(%rax), %rsi
callq 0x3470
movq %rax, %rdi
movl $0x9, %esi
callq 0x3310
movq -0x10(%rbp), %rdi
movq %rax, -0x30(%rbp)
callq 0xbad0
movq -0x30(%rbp), %rdi
movl 0x34(%rax), %esi
callq 0x3420
movq 0x108d8(%rip), %rdi     # 0x1afc8
movl $0xa, %esi
callq 0x3310
movq -0x10(%rbp), %rdi
movq 0x50(%rdi), %rax
movq %rax, -0x28(%rbp)
callq 0xbad0
movq -0x28(%rbp), %rdi
movl 0x34(%rax), %esi
callq 0x3420
movq %rax, %rdi
movl $0x9, %esi
callq 0x3310
movq -0x10(%rbp), %rdi
movq %rax, -0x18(%rbp)
callq 0xbad0
movq -0x10(%rbp), %rdi
movq 0x28(%rax), %rax
movq %rax, -0x20(%rbp)
callq 0xbad0
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdi
subq 0x20(%rax), %rsi
callq 0x3470
movq %rax, %rdi
movl $0xa, %esi
callq 0x3310
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: TheiaRT[P]libiris/tcp_client.cpp
// Function: TCPClient::connect(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
bool TCPClient::connect(std::string address, int port)
{
    /* New client; sock does not exist */
    if (sock == -1) {
        sock = socket(AF_INET, SOCK_STREAM, IPPROTO_IP);
        if (sock < 0) {
            perror("Could not create socket.");
            return false;
        }

#if defined(__APPLE__) && defined(__MACH__)
        int set = 1;
        setsockopt(sock, SOL_SOCKET, SO_NOSIGPIPE, (void *)&set, sizeof(set));
#endif
    }
    else {
        /* Do nothing; sock exists */
    }

    /* Set up address structure */
    if (inet_addr(address.c_str()) == -1) {
        struct hostent *he;
        struct in_addr **addr_list;

        /* Valgrind may incorrectly report this as leaking. */
        he = gethostbyname(address.c_str());
        if (he == NULL) {
            herror("Could not resolve hostname.");
            return false;
        }

        addr_list = (struct in_addr **) he->h_addr_list;
        for (int i = 0; addr_list[i] != NULL; i++) {
            server.sin_addr = *addr_list[i];
            break;
        }
    }
    else {
        server.sin_addr.s_addr = inet_addr(address.c_str());
    }

    server.sin_family = AF_INET;
    server.sin_port = htons(port);

    if (::connect(sock, (struct sockaddr *)&server, sizeof(server)) < 0) {
        perror("Connect failed.");
        return false;
    }

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rsi, -0x48(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpl $-0x1, (%rax)
jne 0x2509
movl $0x2, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x2070
movl %eax, %ecx
movq -0x40(%rbp), %rax
movl %ecx, (%rax)
cmpl $0x0, (%rax)
jge 0x2507
leaq 0xb0b(%rip), %rdi       # 0x3004
callq 0x2160
movb $0x0, -0x1(%rbp)
jmp 0x25ed
jmp 0x250b
jmp 0x250b
movq -0x48(%rbp), %rdi
callq 0x20b0
movq %rax, %rdi
callq 0x21c0
cmpl $-0x1, %eax
jne 0x258b
movq -0x48(%rbp), %rdi
callq 0x20b0
movq %rax, %rdi
callq 0x2220
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x2552
leaq 0xad9(%rip), %rdi       # 0x301d
callq 0x2230
movb $0x0, -0x1(%rbp)
jmp 0x25ed
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x2589
movq -0x40(%rbp), %rax
movq -0x30(%rbp), %rcx
movslq -0x34(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movl (%rcx), %ecx
movl %ecx, 0x8(%rax)
jmp 0x25a5
movq -0x48(%rbp), %rdi
callq 0x20b0
movq %rax, %rdi
callq 0x21c0
movl %eax, %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x40(%rbp), %rax
movw $0x2, 0x4(%rax)
movl -0x1c(%rbp), %eax
movzwl %ax, %edi
callq 0x2040
movq -0x40(%rbp), %rsi
movw %ax, 0x6(%rsi)
movl (%rsi), %edi
addq $0x4, %rsi
movl $0x10, %edx
callq 0x2150
cmpl $0x0, %eax
jge 0x25e9
leaq 0xa5b(%rip), %rdi       # 0x3039
callq 0x2160
movb $0x0, -0x1(%rbp)
jmp 0x25ed
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: TheiaRT[P]libiris/tcp_client.cpp
// Function: TCPClient::send_data(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
bool TCPClient::send_data(std::string data, int size)
{
    if (send(sock, data.c_str(), data.length(), 0) < 0) {
        perror("Send failed.");
        return false;
    }

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rsi, -0x40(%rbp)
movq %rdi, %rax
movq -0x40(%rbp), %rdi
movq %rdi, -0x38(%rbp)
movq %rax, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
callq 0x20b0
movq -0x38(%rbp), %rdi
movq %rax, -0x28(%rbp)
callq 0x2290
movl -0x2c(%rbp), %edi
movq -0x28(%rbp), %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x20e0
cmpq $0x0, %rax
jge 0x2666
leaq 0x9ee(%rip), %rdi       # 0x3049
callq 0x2160
movb $0x0, -0x1(%rbp)
jmp 0x266a
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: TheiaRT[P]libiris/tcp_client.cpp
// Function: TCPClient::receive[abi:cxx11](int)
std::string TCPClient::receive(int size)
{
    std::string buffer = "";
    char *cbuffer = new char[size];
    bzero(cbuffer, size);
    int recvd = 0;
    while ((recvd = recv(sock, cbuffer, size - 1, 0)) > 0) {
        buffer += cbuffer;
        bzero(cbuffer, size);
    }

    if (recvd < 0) {
        perror("Receive failed.");
        return std::string();
    }

    delete [] cbuffer;
    close(sock);
    sock = -1;
    return buffer;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x80(%rbp)
movq %rdi, %rax
movq %rax, -0x78(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq -0x39(%rbp), %rdi
movq %rdi, -0x68(%rbp)
callq 0x22d0
movq -0x68(%rbp), %rdx
leaq 0xa04(%rip), %rsi       # 0x30c5
leaq -0x38(%rbp), %rdi
callq 0x2820
jmp 0x26cc
leaq -0x39(%rbp), %rdi
callq 0x21f0
movslq -0x14(%rbp), %rdi
callq 0x2030
movq %rax, -0x88(%rbp)
jmp 0x26e7
movq -0x88(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
movslq -0x14(%rbp), %rdx
xorl %esi, %esi
callq 0x20f0
movl $0x0, -0x5c(%rbp)
movq -0x70(%rbp), %rax
movl (%rax), %edi
movq -0x58(%rbp), %rsi
movl -0x14(%rbp), %eax
decl %eax
movslq %eax, %rdx
xorl %ecx, %ecx
callq 0x2090
movq %rax, -0x90(%rbp)
jmp 0x272a
movq -0x90(%rbp), %rax
movl %eax, -0x5c(%rbp)
cmpl $0x0, %eax
jle 0x278d
movq -0x58(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x21a0
jmp 0x2748
movq -0x58(%rbp), %rdi
movslq -0x14(%rbp), %rdx
xorl %esi, %esi
callq 0x20f0
jmp 0x2708
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x39(%rbp), %rdi
callq 0x21f0
jmp 0x2811
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x2110
jmp 0x2811
cmpl $0x0, -0x5c(%rbp)
jge 0x27b3
leaq 0x8bc(%rip), %rdi       # 0x3056
callq 0x2160
jmp 0x27a1
movq -0x80(%rbp), %rdi
callq 0x2270
movl $0x1, -0x60(%rbp)
jmp 0x27fb
movq -0x58(%rbp), %rax
movq %rax, -0x98(%rbp)
cmpq $0x0, %rax
je 0x27d0
movq -0x98(%rbp), %rdi
callq 0x2260
movq -0x70(%rbp), %rax
movl (%rax), %edi
callq 0x22f0
jmp 0x27dd
movq -0x80(%rbp), %rdi
movq -0x70(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
leaq -0x38(%rbp), %rsi
callq 0x2100
movl $0x1, -0x60(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x2110
movq -0x78(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x22c0
nopw (%rax,%rax)
// File: roberty65[P]bServer/frame/testClient/testEcho.cpp
// Function: main
int main(int argc, char **argv)
{
	if (argc < 2) {
		fprintf(stderr, "Usage: %s host(like tcp://127.0.0.1:5010) [cmd] [thread-cnt]\n", argv[0]);
		exit(0);
	}

	srandom(time(NULL));	
	setbuf(stdout, NULL);

	host = argv[1];
	if (argc >= 3) cmd = atoi(argv[2]);
	if (argc >= 4) tcnt = atoi(argv[3]);

	test001_sync_req_rsp();
	test002_async_req_rsp();
	test003_mt_sync_req_rsp();
	test004_mt_async_req_rsp();

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x8(%rbp)
jge 0x23f2
movq 0x4c0d(%rip), %rax      # 0x6fe0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
leaq 0x2c20(%rip), %rsi      # 0x5004
movb $0x0, %al
callq 0x2210
xorl %edi, %edi
callq 0x21b0
xorl %eax, %eax
movl %eax, %edi
callq 0x2160
movl %eax, %edi
callq 0x2060
movq 0x4bbf(%rip), %rax      # 0x6fc8
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2200
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x4d4c(%rip)      # 0x7170
cmpl $0x3, -0x8(%rbp)
jl 0x243d
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2240
movl %eax, 0x4dcf(%rip)      # 0x720c
cmpl $0x4, -0x8(%rbp)
jl 0x2456
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x2240
movl %eax, 0x4d22(%rip)      # 0x7178
callq 0x2480
callq 0x2550
callq 0x26c0
callq 0x2800
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: roberty65[P]bServer/frame/testClient/testEcho.cpp
// Function: test001_sync_req_rsp()
static void test001_sync_req_rsp()
{
	static const char *tag = "test001: sync-req-rsp";
	fprintf(stdout, "%s start...\n", tag);

	int fd = beyondy::XbsClient(host, O_NONBLOCK, 30000);
	if (fd < 0) {
		fprintf(stdout, "%s connect failed: %m\n", tag);	
		exit(1);
	}
	
	for (int i = 0; i < scnt; ++i) {
		__test001_sync_req_rsp(fd, sizes[i]);
	}

	close(fd);
	fprintf(stdout, "%s done\n", tag);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq 0x4b39(%rip), %rax      # 0x6fc8
movq (%rax), %rdi
movq 0x4ce7(%rip), %rdx      # 0x7180
leaq 0x2bd0(%rip), %rsi      # 0x5070
movb $0x0, %al
callq 0x2210
movq 0x4cc2(%rip), %rdi      # 0x7170
movl $0x800, %esi            # imm = 0x800
movl $0x7530, %edx           # imm = 0x7530
callq 0x3d20
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jge 0x24ef
movq 0x4afb(%rip), %rax      # 0x6fc8
movq (%rax), %rdi
movq 0x4ca9(%rip), %rdx      # 0x7180
leaq 0x2b9f(%rip), %rsi      # 0x507d
movb $0x0, %al
callq 0x2210
movl $0x1, %edi
callq 0x21b0
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
cmpl 0x4c89(%rip), %eax      # 0x7188
jge 0x2522
movl -0x4(%rbp), %edi
movslq -0x8(%rbp), %rcx
leaq 0x4c81(%rip), %rax      # 0x7190
movl (%rax,%rcx,4), %esi
callq 0x2850
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x24f6
movl -0x4(%rbp), %edi
callq 0x22a0
movq 0x4a97(%rip), %rax      # 0x6fc8
movq (%rax), %rdi
movq 0x4c45(%rip), %rdx      # 0x7180
leaq 0x2b52(%rip), %rsi      # 0x5094
movb $0x0, %al
callq 0x2210
addq $0x10, %rsp
popq %rbp
retq
nop
// File: roberty65[P]bServer/frame/testClient/testEcho.cpp
// Function: test002_async_req_rsp()
static void test002_async_req_rsp()
{
	static const char *tag = "test002: async-req-rsp";
	fprintf(stdout, "%s start...\n", tag);

	int fd = beyondy::XbsClient(host, O_NONBLOCK, 30000);
	if (fd < 0) {
		fprintf(stdout, "%s connect failed: %m\n", tag);
		exit(1);
	}

	pthread_t senderTid, readerTid;
	errno = pthread_create(&senderTid, NULL, __test002_sender_entry, (void *)(long)fd);
	if (errno != 0) {
		fprintf(stdout, "%s create thread for sender failed: %m\n", tag);
		exit(1);
	}

	errno = pthread_create(&readerTid, NULL, __test002_reader_entry, (void *)(long)fd);
	if (errno != 0) {
		fprintf(stdout, "%s create thread for reader failed: %m\n", tag);
		exit(1);
	}

	pthread_join(senderTid, NULL);
	pthread_join(readerTid, NULL);

	close(fd);
	fprintf(stdout, "%s done\n", tag);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq 0x4a69(%rip), %rax      # 0x6fc8
movq (%rax), %rdi
movq 0x4c6f(%rip), %rdx      # 0x71d8
leaq 0x2b00(%rip), %rsi      # 0x5070
movb $0x0, %al
callq 0x2210
movq 0x4bf2(%rip), %rdi      # 0x7170
movl $0x800, %esi            # imm = 0x800
movl $0x7530, %edx           # imm = 0x7530
callq 0x3d20
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jge 0x25bf
movq 0x4a2b(%rip), %rax      # 0x6fc8
movq (%rax), %rdi
movq 0x4c31(%rip), %rdx      # 0x71d8
leaq 0x2acf(%rip), %rsi      # 0x507d
movb $0x0, %al
callq 0x2210
movl $0x1, %edi
callq 0x21b0
movslq -0x4(%rbp), %rcx
leaq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0x4fe(%rip), %rdx       # 0x2ad0
callq 0x2280
movl %eax, -0x1c(%rbp)
callq 0x2040
movl -0x1c(%rbp), %ecx
movl %ecx, (%rax)
callq 0x2040
cmpl $0x0, (%rax)
je 0x2617
movq 0x49d3(%rip), %rax      # 0x6fc8
movq (%rax), %rdi
movq 0x4bd9(%rip), %rdx      # 0x71d8
leaq 0x2b3a(%rip), %rsi      # 0x5140
movb $0x0, %al
callq 0x2210
movl $0x1, %edi
callq 0x21b0
movslq -0x4(%rbp), %rcx
leaq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0x586(%rip), %rdx       # 0x2bb0
callq 0x2280
movl %eax, -0x20(%rbp)
callq 0x2040
movl -0x20(%rbp), %ecx
movl %ecx, (%rax)
callq 0x2040
cmpl $0x0, (%rax)
je 0x266f
movq 0x497b(%rip), %rax      # 0x6fc8
movq (%rax), %rdi
movq 0x4b81(%rip), %rdx      # 0x71d8
leaq 0x2b0a(%rip), %rsi      # 0x5168
movb $0x0, %al
callq 0x2210
movl $0x1, %edi
callq 0x21b0
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2150
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2150
movl -0x4(%rbp), %edi
callq 0x22a0
movq 0x4930(%rip), %rax      # 0x6fc8
movq (%rax), %rdi
movq 0x4b36(%rip), %rdx      # 0x71d8
leaq 0x29eb(%rip), %rsi      # 0x5094
movb $0x0, %al
callq 0x2210
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: roberty65[P]bServer/frame/testClient/testEcho.cpp
// Function: test003_mt_sync_req_rsp()
static void test003_mt_sync_req_rsp()
{
	static const char *tag = "test003: mt-sync-req-rsp";
	fprintf(stdout, "%s start...\n", tag);


	pthread_t tids[tcnt];
	for (int i = 0; i < tcnt; ++i) {
		errno = pthread_create(&tids[i], NULL, __test003_worker, (void *)(long)i);
		if (errno) {
			fprintf(stdout, "%s create the %dth thread failed: %m\n", tag, i);
			exit(1);
		}
	}

	for (int i = 0; i < tcnt; ++i) {
		pthread_join(tids[i], NULL);
	}

	fprintf(stdout, "%s done\n", tag);
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq 0x48f9(%rip), %rax      # 0x6fc8
movq (%rax), %rdi
movq 0x4b17(%rip), %rdx      # 0x71f0
leaq 0x2990(%rip), %rsi      # 0x5070
xorl %eax, %eax
callq 0x2210
movl 0x4a8b(%rip), %eax      # 0x7178
movq %rsp, %rcx
movq %rcx, -0x8(%rbp)
leaq 0xf(,%rax,8), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x20(%rbp)
movq %rcx, %rsp
movq %rax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl 0x4a57(%rip), %eax      # 0x7178
jge 0x2796
movq -0x20(%rbp), %rdi
movslq -0x14(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movslq -0x14(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
leaq 0x53f(%rip), %rdx       # 0x2c80
callq 0x2280
movl %eax, -0x24(%rbp)
callq 0x2040
movl -0x24(%rbp), %ecx
movl %ecx, (%rax)
callq 0x2040
cmpl $0x0, (%rax)
je 0x2789
movq 0x4864(%rip), %rax      # 0x6fc8
movq (%rax), %rdi
movq 0x4a82(%rip), %rdx      # 0x71f0
movl -0x14(%rbp), %ecx
leaq 0x2ac0(%rip), %rsi      # 0x5238
movb $0x0, %al
callq 0x2210
movl $0x1, %edi
callq 0x21b0
jmp 0x278b
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2718
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl 0x49d2(%rip), %eax      # 0x7178
jge 0x27c8
movq -0x20(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2150
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x279d
movq 0x47f9(%rip), %rax      # 0x6fc8
movq (%rax), %rdi
movq 0x4a17(%rip), %rdx      # 0x71f0
leaq 0x28b4(%rip), %rsi      # 0x5094
movb $0x0, %al
callq 0x2210
movq -0x8(%rbp), %rax
movq %rax, %rsp
movq %rbp, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: roberty65[P]bServer/frame/testClient/testEcho.cpp
// Function: _test001_sync_req_rsp(int, int)
static void __test001_sync_req_rsp(int fd, int size)
{
	static const char *tag = "test001: sync-req-rsp";
	struct timeval t1, t2, t3;

	gettimeofday(&t1, NULL);
	__send_req(fd, cmd, size, tag);

	gettimeofday(&t2, NULL);
	__read_rsp(fd, size, tag);

	gettimeofday(&t3, NULL);
	fprintf(stdout, "OK: %s pkg-size=%d, write-time=%ldms read-rsp=%ldms\n",
		tag, size, DIFF_TV(&t1, &t2), DIFF_TV(&t2, &t3));
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
leaq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2260
movl -0x4(%rbp), %edi
movl 0x4998(%rip), %esi      # 0x720c
movl -0x8(%rbp), %edx
movq 0x494a(%rip), %rcx      # 0x71c8
callq 0x2930
leaq -0x28(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2260
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
movq 0x492b(%rip), %rdx      # 0x71c8
callq 0x2a30
leaq -0x38(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2260
movq 0x4712(%rip), %rax      # 0x6fc8
movq (%rax), %rdi
movq 0x4908(%rip), %rax      # 0x71c8
movq %rax, -0x40(%rbp)
movl -0x8(%rbp), %ecx
movq -0x28(%rbp), %rax
subq -0x18(%rbp), %rax
imulq $0x3e8, %rax, %r8       # imm = 0x3E8
movq -0x20(%rbp), %rax
subq -0x10(%rbp), %rax
movl $0x3e8, %esi            # imm = 0x3E8
cqto
idivq %rsi
addq %rax, %r8
movq -0x38(%rbp), %rax
subq -0x28(%rbp), %rax
imulq $0x3e8, %rax, %r9       # imm = 0x3E8
movq -0x30(%rbp), %rax
subq -0x20(%rbp), %rax
movl $0x3e8, %esi            # imm = 0x3E8
cqto
idivq %rsi
movq -0x40(%rbp), %rdx
addq %rax, %r9
leaq 0x2783(%rip), %rsi      # 0x509d
movb $0x0, %al
callq 0x2210
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: roberty65[P]bServer/frame/testClient/testEcho.cpp
// Function: _read_rsp(int, int, char const*)
static void __read_rsp(int fd, int size, const char *tag)
{
	int msize = size + sizeof(struct proto_h16_head);
	char *rspbuf = new char[msize];

	ssize_t rlen = beyondy::XbsReadN(fd, rspbuf, msize, timeout);
	if (rlen != msize) {
		fprintf(stdout, "FAIL: %s pkg-size=%d, read rsp failed: %m\n", tag, msize);
		exit(1);
	}

	// TODO: cksum rspbuf
	delete[] rspbuf;
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movslq -0x8(%rbp), %rax
addq $0x10, %rax
movl %eax, -0x14(%rbp)
movslq -0x14(%rbp), %rdi
callq 0x2030
movq %rax, -0x20(%rbp)
movl -0x4(%rbp), %edi
movq -0x20(%rbp), %rsi
movslq -0x14(%rbp), %rdx
movslq 0x4764(%rip), %rcx      # 0x71d0
callq 0x32a0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movslq -0x14(%rbp), %rcx
cmpq %rcx, %rax
je 0x2aab
movq 0x453f(%rip), %rax      # 0x6fc8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
movl -0x14(%rbp), %ecx
leaq 0x2664(%rip), %rsi      # 0x50fe
movb $0x0, %al
callq 0x2210
movl $0x1, %edi
callq 0x21b0
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x2ac2
movq -0x30(%rbp), %rdi
callq 0x21d0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: roberty65[P]bServer/frame/testClient/testEcho.cpp
// Function: _test002_sender_entry(void*)
static void *__test002_sender_entry(void *p)
{
	static const char *tag = "test002: async-req-rsp sender";

	int fd = (int)(long)p;	
	for (int i = 0; i < scnt; ++i) {
		struct timeval t1, t2;

		gettimeofday(&t1, NULL);
		__send_req(fd, cmd, sizes[i], tag);

		gettimeofday(&t2, NULL);
		fprintf(stdout, "%s send req with pkg-size=%ld took %ldms\n", \
			tag, (long)sizes[i], DIFF_TV(&t1, &t2));
	}

	return NULL;	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl %eax, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl 0x4695(%rip), %eax      # 0x7188
jge 0x2b9e
leaq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2260
movl -0xc(%rbp), %edi
movl 0x46fd(%rip), %esi      # 0x720c
movslq -0x10(%rbp), %rcx
leaq 0x4676(%rip), %rax      # 0x7190
movl (%rax,%rcx,4), %edx
movq 0x46bc(%rip), %rcx      # 0x71e0
callq 0x2930
leaq -0x30(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2260
movq 0x448b(%rip), %rax      # 0x6fc8
movq (%rax), %rdi
movq 0x4699(%rip), %rax      # 0x71e0
movq %rax, -0x38(%rbp)
movslq -0x10(%rbp), %rcx
leaq 0x463a(%rip), %rax      # 0x7190
movslq (%rax,%rcx,4), %rcx
movq -0x30(%rbp), %rax
subq -0x20(%rbp), %rax
imulq $0x3e8, %rax, %r8       # imm = 0x3E8
movq -0x28(%rbp), %rax
subq -0x18(%rbp), %rax
movl $0x3e8, %esi            # imm = 0x3E8
cqto
idivq %rsi
movq -0x38(%rbp), %rdx
addq %rax, %r8
leaq 0x2625(%rip), %rsi      # 0x51ae
movb $0x0, %al
callq 0x2210
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x2aea
xorl %eax, %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: roberty65[P]bServer/frame/testClient/testEcho.cpp
// Function: _test002_reader_entry(void*)
static void *__test002_reader_entry(void *p)
{
	static const char *tag = "test002: async-req-rsp reader";

	int fd = (int)(long)p;
	for (int i = 0; i < scnt; ++i) {
		struct timeval t1, t2;

		gettimeofday(&t1, NULL);
		__read_rsp(fd, sizes[i], tag);

		gettimeofday(&t2, NULL);
		fprintf(stdout, "%s read rsp for pkg-size=%ld took %ldms\n", 
			tag, (long)sizes[i], DIFF_TV(&t1, &t2));
	}

	return NULL;	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl %eax, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl 0x45b5(%rip), %eax      # 0x7188
jge 0x2c78
leaq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2260
movl -0xc(%rbp), %edi
movslq -0x10(%rbp), %rcx
leaq 0x459c(%rip), %rax      # 0x7190
movl (%rax,%rcx,4), %esi
movq 0x45ea(%rip), %rdx      # 0x71e8
callq 0x2a30
leaq -0x30(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2260
movq 0x43b1(%rip), %rax      # 0x6fc8
movq (%rax), %rdi
movq 0x45c7(%rip), %rax      # 0x71e8
movq %rax, -0x38(%rbp)
movslq -0x10(%rbp), %rcx
leaq 0x4560(%rip), %rax      # 0x7190
movslq (%rax,%rcx,4), %rcx
movq -0x30(%rbp), %rax
subq -0x20(%rbp), %rax
imulq $0x3e8, %rax, %r8       # imm = 0x3E8
movq -0x28(%rbp), %rax
subq -0x18(%rbp), %rax
movl $0x3e8, %esi            # imm = 0x3E8
cqto
idivq %rsi
movq -0x38(%rbp), %rdx
addq %rax, %r8
leaq 0x2593(%rip), %rsi      # 0x51f6
movb $0x0, %al
callq 0x2210
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x2bca
xorl %eax, %eax
addq $0x40, %rsp
popq %rbp
retq
// File: roberty65[P]bServer/frame/testClient/testEcho.cpp
// Function: _test003_worker(void*)
static void *__test003_worker(void *p)
{
	static const char *tag = "test003: mt-sync-req-rsp-worker";

	int fd = beyondy::XbsClient(host, O_NONBLOCK, 30000);
	if (fd < 0) {
		fprintf(stdout, "%s connect failed: %m\n", tag);
		exit(1);
	}

	for (int i = 0; i < scnt; ++i) {
		struct timeval t1, t2, t3;

		gettimeofday(&t1, NULL);	
		__send_req(fd, cmd, sizes[i], tag);

		gettimeofday(&t2, NULL);
		__read_rsp(fd, sizes[i], tag);

		gettimeofday(&t3, NULL);
		fprintf(stdout, "%s pkg-size=%ld send took %ldms, read took %ld ms\n", \
			tag, (long)sizes[i], DIFF_TV(&t1, &t2), DIFF_TV(&t2, &t3));
	}

	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq 0x44dd(%rip), %rdi      # 0x7170
movl $0x800, %esi            # imm = 0x800
movl $0x7530, %edx           # imm = 0x7530
callq 0x3d20
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jge 0x2cd4
movq 0x4316(%rip), %rax      # 0x6fc8
movq (%rax), %rdi
movq 0x453c(%rip), %rdx      # 0x71f8
leaq 0x23ba(%rip), %rsi      # 0x507d
movb $0x0, %al
callq 0x2210
movl $0x1, %edi
callq 0x21b0
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl 0x44a4(%rip), %eax      # 0x7188
jge 0x2ddd
leaq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2260
movl -0xc(%rbp), %edi
movl 0x450c(%rip), %esi      # 0x720c
movslq -0x10(%rbp), %rcx
leaq 0x4485(%rip), %rax      # 0x7190
movl (%rax,%rcx,4), %edx
movq 0x44e3(%rip), %rcx      # 0x71f8
callq 0x2930
leaq -0x30(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2260
movl -0xc(%rbp), %edi
movslq -0x10(%rbp), %rcx
leaq 0x445b(%rip), %rax      # 0x7190
movl (%rax,%rcx,4), %esi
movq 0x44b9(%rip), %rdx      # 0x71f8
callq 0x2a30
leaq -0x40(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2260
movq 0x4270(%rip), %rax      # 0x6fc8
movq (%rax), %rdi
movq 0x4496(%rip), %rax      # 0x71f8
movq %rax, -0x48(%rbp)
movslq -0x10(%rbp), %rcx
leaq 0x441f(%rip), %rax      # 0x7190
movslq (%rax,%rcx,4), %rcx
movq -0x30(%rbp), %rax
subq -0x20(%rbp), %rax
imulq $0x3e8, %rax, %r8       # imm = 0x3E8
movq -0x28(%rbp), %rax
subq -0x18(%rbp), %rax
movl $0x3e8, %esi            # imm = 0x3E8
cqto
idivq %rsi
addq %rax, %r8
movq -0x40(%rbp), %rax
subq -0x30(%rbp), %rax
imulq $0x3e8, %rax, %r9       # imm = 0x3E8
movq -0x38(%rbp), %rax
subq -0x28(%rbp), %rax
movl $0x3e8, %esi            # imm = 0x3E8
cqto
idivq %rsi
movq -0x48(%rbp), %rdx
addq %rax, %r9
leaq 0x24b6(%rip), %rsi      # 0x527e
movb $0x0, %al
callq 0x2210
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x2cdb
xorl %eax, %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: daltonbr[P]RayTracing/./src/vec3.h
// Function: random_in_unit_sphere()
vec3 random_in_unit_sphere()
{
    vec3 p;
    do
    {
        p = 2.0 * vec3(drand48(), drand48(), drand48()) - vec3(1, 1, 1);
    } while (p.squared_length() >= 1.0);
    return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
leaq -0xc(%rbp), %rdi
callq 0x20a20
callq 0x20c0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x8c(%rbp)
callq 0x20c0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x90(%rbp)
callq 0x20c0
movss -0x90(%rbp), %xmm1
movaps %xmm0, %xmm2
movss -0x8c(%rbp), %xmm0
cvtsd2ss %xmm2, %xmm2
leaq -0x34(%rbp), %rdi
movq %rdi, -0x88(%rbp)
callq 0x20b10
movq -0x88(%rbp), %rdi
movss 0x1fc33(%rip), %xmm0    # 0x22004
callq 0x20aa0
movss %xmm1, -0x40(%rbp)
movlpd %xmm0, -0x48(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x20(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x28(%rbp)
leaq -0x54(%rbp), %rdi
movq %rdi, -0x80(%rbp)
movss 0x1fc0a(%rip), %xmm2    # 0x22008
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0x20b10
movq -0x80(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x20a30
movss %xmm1, -0x60(%rbp)
movlpd %xmm0, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x18(%rbp)
movl -0x60(%rbp), %eax
movl %eax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xc(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0xc(%rbp), %rdi
callq 0x20b50
cvtss2sd %xmm0, %xmm0
movsd 0x1fc4f(%rip), %xmm1    # 0x220a0
ucomisd %xmm1, %xmm0
jae 0x2374
movl -0x4(%rbp), %eax
movl %eax, -0x70(%rbp)
movq -0xc(%rbp), %rax
movq %rax, -0x78(%rbp)
movsd -0x78(%rbp), %xmm0
movss -0x70(%rbp), %xmm1
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)