LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/nvanbenschoten[P]total-order-multicast/src/udp_conn.cc
// Function: udp::Client::WaitBackoff(unsigned int) const
void Client::WaitBackoff(unsigned int multiplier) const {
  static thread_local std::default_random_engine random_engine(
      std::chrono::system_clock::now().time_since_epoch().count());

  // Wait on the order of 10 ms * multiplier.
  auto delay_base = std::chrono::milliseconds{10}.count();
  std::poisson_distribution<int> poisson(delay_base);
  int delay = poisson(random_engine);
  if (delay <= 0) {
    return;
  }
  delay *= multiplier;
  std::this_thread::sleep_for(std::chrono::milliseconds{delay});
  return;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x78, %rsp
movl %esi, %ebx
cmpb $0x0, %fs:-0x8
je 0x1296a
movabsq $0x4024000000000000, %rax # imm = 0x4024000000000000
leaq 0x10(%rsp), %r14
movq %rax, (%r14)
movq %r14, %rdi
callq 0x92c8
xorl %eax, %eax
movq %rax, 0x48(%r14)
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, 0x50(%r14)
movq %rax, 0x58(%r14)
movb $0x0, 0x60(%r14)
movq %fs:0x0, %rax
leaq -0x10(%rax), %rsi
movq %r14, %rdi
movq %r14, %rdx
callq 0x9492
testl %eax, %eax
jle 0x12962
imull %ebx, %eax
testl %eax, %eax
jle 0x12962
movl %eax, %ecx
movabsq $0x4189374bc6a7f0, %rdx # imm = 0x4189374BC6A7F0
movq %rcx, %rax
mulq %rdx
imulq $-0x3e8, %rdx, %rax     # imm = 0xFC18
addq %rcx, %rax
imulq $0xf4240, %rax, %rax    # imm = 0xF4240
movq %rsp, %rbx
movq %rdx, (%rbx)
movq %rax, 0x8(%rbx)
movq %rbx, %rdi
movq %rbx, %rsi
callq 0x5100
cmpl $-0x1, %eax
jne 0x12962
callq 0x5040
cmpl $0x4, (%rax)
je 0x12948
addq $0x78, %rsp
popq %rbx
popq %r14
retq
callq 0x58db
jmp 0x128be
// File: /workspace/github_cpp_makefile_star2_O1/nvanbenschoten[P]total-order-multicast/src/udp_conn.cc
// Function: udp::Server::Server(unsigned short, std::chrono::duration<long, std::ratio<1l, 1000000l>>)
Server::Server(unsigned short port, std::chrono::microseconds timeout)
    : sockfd_(CreateSocket(timeout)) {
  // Create a socket and associate the it with the port
  struct sockaddr_in server_address = {};
  server_address.sin_family = AF_INET;
  server_address.sin_addr.s_addr = htonl(INADDR_ANY);
  server_address.sin_port = htons(port);

  if (bind(sockfd_, (struct sockaddr *)&server_address,
           sizeof(server_address)) < 0) {
    throw net::BindException();
  }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebx
movq %rdi, %r14
movq %rdx, %rdi
callq 0x12314
movl %eax, (%r14)
xorps %xmm0, %xmm0
movq %rsp, %rsi
movaps %xmm0, (%rsi)
movw $0x2, (%rsi)
movl $0x0, 0x4(%rsi)
rolw $0x8, %bx
movw %bx, 0x2(%rsi)
movl %eax, %edi
movl $0x10, %edx
callq 0x5070
testl %eax, %eax
js 0x129c0
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movl $0x180, %edi            # imm = 0x180
callq 0x51a0
movq %rax, %rbx
movq %rax, %rdi
callq 0x12d9a
leaq 0x9264(%rip), %rsi      # 0x1bc40
leaq 0x429(%rip), %rdx       # 0x12e0c
movq %rbx, %rdi
callq 0x5610
movq %rax, %r14
movq %rbx, %rdi
callq 0x5280
movq %r14, %rdi
callq 0x5650
// File: /workspace/github_cpp_makefile_star2_O1/nvanbenschoten[P]total-order-multicast/src/message.cc
// Function: msg::operator<<(std::ostream&, msg::DataMessage const&)
std::ostream& operator<<(std::ostream& o, const DataMessage& data_msg) {
  o << "{type: " << data_msg.type;
  o << ", sender: " << data_msg.sender;
  o << ", msg_id: " << data_msg.msg_id;
  o << ", data: " << data_msg.data;
  o << "}";
  return o;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x20ba(%rip), %rsi      # 0x15237
movl $0x7, %edx
callq 0x53f0
movl (%r14), %esi
movq %rbx, %rdi
callq 0x5240
leaq 0x20a6(%rip), %rsi      # 0x1523f
movl $0xa, %edx
movq %rbx, %rdi
callq 0x53f0
movl 0x4(%r14), %esi
movq %rbx, %rdi
callq 0x5240
leaq 0x2091(%rip), %rsi      # 0x1524a
movl $0xa, %edx
movq %rbx, %rdi
callq 0x53f0
movl 0x8(%r14), %esi
movq %rbx, %rdi
callq 0x5240
leaq 0x207c(%rip), %rsi      # 0x15255
movl $0x8, %edx
movq %rbx, %rdi
callq 0x53f0
movl 0xc(%r14), %esi
movq %rbx, %rdi
callq 0x5240
leaq 0x1a62(%rip), %rsi      # 0x14c5b
movl $0x1, %edx
movq %rbx, %rdi
callq 0x53f0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/nvanbenschoten[P]total-order-multicast/src/message.cc
// Function: msg::operator<<(std::ostream&, msg::AckMessage const&)
std::ostream& operator<<(std::ostream& o, const AckMessage& ack_msg) {
  o << "{type: " << ack_msg.type;
  o << ", sender: " << ack_msg.sender;
  o << ", msg_id: " << ack_msg.msg_id;
  o << ", proposed_seq: " << ack_msg.proposed_seq;
  o << ", proposer: " << ack_msg.proposer;
  o << "}";
  return o;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x2015(%rip), %rsi      # 0x15237
movl $0x7, %edx
callq 0x53f0
movl (%r14), %esi
movq %rbx, %rdi
callq 0x5240
leaq 0x2001(%rip), %rsi      # 0x1523f
movl $0xa, %edx
movq %rbx, %rdi
callq 0x53f0
movl 0x4(%r14), %esi
movq %rbx, %rdi
callq 0x5240
leaq 0x1fec(%rip), %rsi      # 0x1524a
movl $0xa, %edx
movq %rbx, %rdi
callq 0x53f0
movl 0x8(%r14), %esi
movq %rbx, %rdi
callq 0x5240
leaq 0x1fe0(%rip), %rsi      # 0x1525e
movl $0x10, %edx
movq %rbx, %rdi
callq 0x53f0
movl 0xc(%r14), %esi
movq %rbx, %rdi
callq 0x5240
leaq 0x1fd1(%rip), %rsi      # 0x1526f
movl $0xc, %edx
movq %rbx, %rdi
callq 0x53f0
movl 0x10(%r14), %esi
movq %rbx, %rdi
callq 0x5240
leaq 0x199d(%rip), %rsi      # 0x14c5b
movl $0x1, %edx
movq %rbx, %rdi
callq 0x53f0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/nvanbenschoten[P]total-order-multicast/src/message.cc
// Function: msg::operator<<(std::ostream&, msg::SeqMessage const&)
std::ostream& operator<<(std::ostream& o, const SeqMessage& seq_msg) {
  o << "{type: " << seq_msg.type;
  o << ", sender: " << seq_msg.sender;
  o << ", msg_id: " << seq_msg.msg_id;
  o << ", final_seq: " << seq_msg.final_seq;
  o << ", final_seq_proposer: " << seq_msg.final_seq_proposer;
  o << "}";
  return o;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x1f50(%rip), %rsi      # 0x15237
movl $0x7, %edx
callq 0x53f0
movl (%r14), %esi
movq %rbx, %rdi
callq 0x5240
leaq 0x1f3c(%rip), %rsi      # 0x1523f
movl $0xa, %edx
movq %rbx, %rdi
callq 0x53f0
movl 0x4(%r14), %esi
movq %rbx, %rdi
callq 0x5240
leaq 0x1f27(%rip), %rsi      # 0x1524a
movl $0xa, %edx
movq %rbx, %rdi
callq 0x53f0
movl 0x8(%r14), %esi
movq %rbx, %rdi
callq 0x5240
leaq 0x1f39(%rip), %rsi      # 0x1527c
movl $0xd, %edx
movq %rbx, %rdi
callq 0x53f0
movl 0xc(%r14), %esi
movq %rbx, %rdi
callq 0x5240
leaq 0x1f27(%rip), %rsi      # 0x1528a
movl $0x16, %edx
movq %rbx, %rdi
callq 0x53f0
movl 0x10(%r14), %esi
movq %rbx, %rdi
callq 0x5240
leaq 0x18d8(%rip), %rsi      # 0x14c5b
movl $0x1, %edx
movq %rbx, %rdi
callq 0x53f0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/nvanbenschoten[P]total-order-multicast/src/message.cc
// Function: msg::operator<<(std::ostream&, msg::SeqAckMessage const&)
std::ostream& operator<<(std::ostream& o, const SeqAckMessage& seqack_msg) {
  o << "{type: " << seqack_msg.type;
  o << ", sender: " << seqack_msg.sender;
  o << ", msg_id: " << seqack_msg.msg_id;
  o << "}";
  return o;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x1e8b(%rip), %rsi      # 0x15237
movl $0x7, %edx
callq 0x53f0
movl (%r14), %esi
movq %rbx, %rdi
callq 0x5240
leaq 0x1e77(%rip), %rsi      # 0x1523f
movl $0xa, %edx
movq %rbx, %rdi
callq 0x53f0
movl 0x4(%r14), %esi
movq %rbx, %rdi
callq 0x5240
leaq 0x1e62(%rip), %rsi      # 0x1524a
movl $0xa, %edx
movq %rbx, %rdi
callq 0x53f0
movl 0x8(%r14), %esi
movq %rbx, %rdi
callq 0x5240
leaq 0x1853(%rip), %rsi      # 0x14c5b
movl $0x1, %edx
movq %rbx, %rdi
callq 0x53f0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/nvanbenschoten[P]total-order-multicast/src/net.cc
// Function: net::AddressWithDefaultPort(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::experimental::fundamentals_v1::optional<unsigned short>)
Address AddressWithDefaultPort(
    std::string addr, std::experimental::optional<unsigned short> port) {
  size_t found = addr.find(":");
  if (found != std::string::npos) {
    port = std::stoi(addr.substr(found + 1));
    addr = addr.substr(0, found);
  } else if (!port) {
    throw std::invalid_argument(
        "port not specified in address and no default port provided");
  }
  return Address(addr, *port);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %rbp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x1dd8(%rip), %rsi      # 0x152a1
movl $0x1, %ecx
movq %r15, %rdi
xorl %edx, %edx
callq 0x5630
cmpq $-0x1, %rax
je 0x135c7
movq %rax, %r12
movq %rbp, 0x8(%rsp)
leaq 0x1(%rax), %rdx
leaq 0x38(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq $-0x1, %rcx
callq 0x53a0
movq (%r13), %rbp
callq 0x5040
movq %rax, %r13
movl (%rax), %eax
movl %eax, 0x4(%rsp)
movl $0x0, (%r13)
leaq 0x10(%rsp), %r14
movq %rbp, %rdi
movq %r14, %rsi
movl $0xa, %edx
callq 0x54d0
cmpq %rbp, (%r14)
je 0x1363c
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x13648
movl (%r13), %ecx
cmpl $0x22, %ecx
je 0x13648
testl %ecx, %ecx
movq 0x8(%rsp), %rbp
jne 0x13567
movl 0x4(%rsp), %ecx
movl %ecx, (%r13)
movw %ax, (%rbp)
cmpb $0x0, 0x2(%rbp)
jne 0x13575
movb $0x1, 0x2(%rbp)
leaq 0x48(%rsp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0x13590
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x5370
leaq 0x38(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %r12, %rcx
callq 0x53a0
movq %r15, %rdi
movq %r14, %rsi
callq 0x5420
movq (%r14), %rdi
cmpq %r13, %rdi
je 0x135d1
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x5370
jmp 0x135d1
cmpb $0x0, 0x2(%rbp)
je 0x13654
leaq 0x28(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x7de6
movzwl (%rbp), %ebp
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x7de6
movw %bp, 0x20(%rbx)
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0x1362a
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x5370
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1c9b(%rip), %rdi      # 0x152de
callq 0x5210
leaq 0x1c8f(%rip), %rdi      # 0x152de
callq 0x54f0
movl $0x10, %edi
callq 0x51a0
movq %rax, %r14
leaq 0x1c3b(%rip), %rsi      # 0x152a3
movq %rax, %rdi
callq 0x56a0
movq 0x8951(%rip), %rsi      # 0x1bfc8
movq 0x8932(%rip), %rdx      # 0x1bfb0
movq %r14, %rdi
callq 0x5610
movq %rax, %rbx
movq %r14, %rdi
callq 0x5280
jmp 0x136d0
movq %rax, %rbx
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0x136d0
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x5370
jmp 0x136d0
movq %rax, %rbx
cmpl $0x0, (%r13)
jne 0x136c1
movl 0x4(%rsp), %eax
movl %eax, (%r13)
leaq 0x10(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x590a
movq %rbx, %rdi
callq 0x5650
// File: /workspace/github_cpp_makefile_star2_O1/lemire[P]backward_multiplication/include/backwardmultiply.h
// Function: backwardmultiply::multiplication(unsigned long, unsigned long const*, unsigned long, unsigned long*)
void multiplication(uint64_t w, const uint64_t *b, size_t n, uint64_t *output) {
  if ((w == 0) || (n == 0)) { // special case
    std::fill(output, output + n + 1, 0);
    return;
  }
  auto p = full_multiplication(w, b[0]);
  output[0] = p.low;
  uint64_t r = p.high;
  for (size_t i = 1; i < n; i++) {
    p = full_multiplication(w, b[i]);
    p.add(r);
    output[i] = p.low;
    r = p.high;
  }
  output[n] = r;
}

// Assembly:
movq %rdx, %r8
testq %rdi, %rdi
setne %al
testq %rdx, %rdx
setne %dl
testb %dl, %al
jne 0x12a5
leaq (%rcx,%r8,8), %rax
addq $0x8, %rax
cmpq %rcx, %rax
je 0x12e3
leaq 0x8(,%r8,8), %rdx
movq %rcx, %rdi
xorl %esi, %esi
jmp 0x1060
movq %rdi, %rax
mulq (%rsi)
movq %rdx, %r9
movq %rax, (%rcx)
cmpq $0x2, %r8
jb 0x12dc
movl $0x1, %r10d
movq %rdi, %rax
mulq (%rsi,%r10,8)
addq %r9, %rax
adcq $0x0, %rdx
movq %rax, (%rcx,%r10,8)
incq %r10
movq %rdx, %r9
cmpq %r10, %r8
jne 0x12bd
jmp 0x12df
movq %r9, %rdx
movq %rdx, (%rcx,%r8,8)
retq
// File: /workspace/github_cpp_makefile_star2_O1/lemire[P]backward_multiplication/include/backwardmultiply.h
// Function: backwardmultiply::multiplication_backward(unsigned long, unsigned long const*, unsigned long, unsigned long*)
void multiplication_backward(uint64_t w, const uint64_t *b, size_t n,
                             uint64_t *output) {
  if ((w == 0) || (n == 0)) { // special case
    std::fill(output, output + n + 1, 0);
    return;
  }
  auto p = full_multiplication(w, b[n - 1]);
  output[n - 1] = p.low;
  output[n] = p.high;
  for (size_t i = n - 2; i != SIZE_MAX; i--) {
    p = full_multiplication(w, b[i]);
    output[i] = p.low;
    bool overflow = (output[i + 1] + p.high < output[i + 1]);
    output[i + 1] += p.high;
    for (size_t j = i + 2; overflow; j++) {
      output[j]++;
      overflow = (output[j] == 0);
    }
  }
}

// Assembly:
movq %rdx, %r8
testq %rdi, %rdi
setne %al
testq %rdx, %rdx
setne %dl
testb %dl, %al
jne 0x1316
leaq (%rcx,%r8,8), %rax
addq $0x8, %rax
cmpq %rcx, %rax
je 0x135d
leaq 0x8(,%r8,8), %rdx
movq %rcx, %rdi
xorl %esi, %esi
jmp 0x1060
movq %rdi, %rax
mulq -0x8(%rsi,%r8,8)
movq %rax, -0x8(%rcx,%r8,8)
movq %rdx, (%rcx,%r8,8)
leaq -0x2(%r8), %r9
cmpq $-0x1, %r9
je 0x135d
leaq (%rcx,%r8,8), %r8
movq %rdi, %rax
mulq (%rsi,%r9,8)
movq %rax, (%rcx,%r9,8)
addq %rdx, 0x8(%rcx,%r9,8)
movq %r8, %rax
jae 0x1353
incq (%rax)
leaq 0x8(%rax), %rax
je 0x134a
addq $-0x8, %r8
subq $0x1, %r9
jae 0x1335
retq
// File: /workspace/github_cpp_makefile_star2_O1/lemire[P]backward_multiplication/include/backwardmultiply.h
// Function: backwardmultiply::multiplication_backward_limit(unsigned long, unsigned long const*, unsigned long, unsigned long*, unsigned long)
size_t multiplication_backward_limit(uint64_t w, const uint64_t *b, size_t n,
                                     uint64_t *output, size_t minexactwords) {
  if ((w == 0) || (n == 0)) { // special case
    std::fill(output, output + n + 1, 0);
    return n + 1;
  }

  auto p = full_multiplication(w, b[n - 1]);
  output[n - 1] = p.low;
  output[n] = p.high;
  if (minexactwords <= 1) {
    // check if addition overflows
    if (p.low + w - 1 >= p.low) {
      // we are good at output[n]
      return 1;
    }
  }
  for (size_t i = n - 2; i != SIZE_MAX; i--) {
    p = full_multiplication(w, b[i]);
    output[i] = p.low;
    bool overflow = (output[i + 1] + p.high < output[i + 1]);
    output[i + 1] += p.high;
    for (size_t j = i + 2; overflow; j++) {
      output[j]++;
      overflow = (output[j] == 0);
    }
    if (minexactwords <= n - i) {
      // check if addition overflows
      if (p.low + w - 1 >= p.low) {
        // we are good at output[n], ..., output[i+1], so we have
        // n - (i+1) + 1 = n - i good words
        return n - i;
      }
      if (minexactwords < n - i) {
        // then the only way we could overflow is if the following is true
        if (output[i + 1] != 0xFFFFFFFFFFFFFFFF) {
          // we are good at output[n], ..., output[i+2], so we have
          // n - (i+2) + 1 = n - i - 1 good words

          return n - i - 1;
        }
      }
    }
  }
  return n + 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
testq %rdi, %rdi
setne %al
testq %rdx, %rdx
setne %dl
testb %dl, %al
jne 0x13a0
leaq (%rcx,%rbx,8), %rax
addq $0x8, %rax
cmpq %rcx, %rax
je 0x1398
leaq 0x8(,%rbx,8), %rdx
movq %rcx, %rdi
xorl %esi, %esi
callq 0x1060
incq %rbx
jmp 0x1451
movq %rdi, %rax
mulq -0x8(%rsi,%rbx,8)
movq %rax, -0x8(%rcx,%rbx,8)
movq %rdx, (%rcx,%rbx,8)
movq %rdi, %r9
negq %r9
cmpq $0x1, %r8
ja 0x13cb
movl $0x1, %edx
cmpq %r9, %rax
jbe 0x1454
leaq -0x2(%rbx), %r14
cmpq $-0x1, %r14
sete %r10b
je 0x1446
leaq (%rcx,%rbx,8), %r15
movq %rdi, %rax
mulq (%rsi,%r14,8)
movq %rax, (%rcx,%r14,8)
addq %rdx, 0x8(%rcx,%r14,8)
movq %r15, %rdx
jae 0x13fb
incq (%rdx)
leaq 0x8(%rdx), %rdx
je 0x13f2
movq %rbx, %r12
subq %r14, %r12
movb $0x1, %dl
cmpq %r8, %r12
jb 0x1429
cmpq %r9, %rax
jbe 0x1424
cmpq %r8, %r12
jbe 0x1429
decq %r12
cmpq $-0x1, 0x8(%rcx,%r14,8)
sete %dl
cmovneq %r12, %r11
jmp 0x1429
xorl %edx, %edx
movq %r12, %r11
testb %dl, %dl
je 0x1446
movq %r14, %rax
subq $0x1, %rax
setb %r10b
addq $-0x8, %r15
testq %r14, %r14
movq %rax, %r14
jne 0x13dd
jmp 0x1446
incq %rbx
testb $0x1, %r10b
cmoveq %r11, %rbx
movq %rbx, %rdx
movq %rdx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/lemire[P]backward_multiplication/include/backwardmultiply.h
// Function: backwardmultiply::multiplication_backward_limit_resume(unsigned long, unsigned long const*, unsigned long, unsigned long*, unsigned long, unsigned long&)
size_t multiplication_backward_limit_resume(uint64_t w, const uint64_t *b,
                                            size_t n, uint64_t *output,
                                            size_t minexactwords,
                                            size_t &previousindex) {
  if (n == 0) { // special case
    std::fill(output, output + n + 1, 0);
    return n + 1; // we are done!!!
  }
  if (previousindex > n) {
    // assume we are done
    return n + 1;
  }
  if (previousindex == n) {
    previousindex = n - 1;
    auto p = full_multiplication(w, b[n - 1]);
    output[n - 1] = p.low;
    output[n] = p.high;
    if (minexactwords <= 1) {
      // check if addition overflows
      if (p.low + w - 1 >= p.low) {
        // we are good
        return 1;
      }
    }
  }

  for (size_t i = previousindex - 1; i != SIZE_MAX; i--) {
    auto p = full_multiplication(w, b[i]);
    output[i] = p.low;
    bool overflow = (output[i + 1] + p.high < output[i + 1]);
    output[i + 1] += p.high;
    for (size_t j = i + 2; overflow; j++) {
      output[j]++;
      overflow = (output[j] == 0);
    }
    if (minexactwords <= n - i) {
      // check if addition overflows
      if (p.low + w - 1 >= p.low) {
        // we are good
        previousindex = i;
        return n - i;
      }
      if (minexactwords < n - i) {
        // then the only way we could overflow is if the following is true
        if (output[i + 1] != 0xFFFFFFFFFFFFFFFF) {
          previousindex = i;
          return n - i - 1;
        }
      }
    }
  }
  previousindex = SIZE_MAX;
  return n + 1;
}

// Assembly:
testq %rdx, %rdx
je 0x147b
movq %rdx, %r10
cmpq %rdx, (%r9)
jbe 0x148d
incq %r10
movq %r10, %r11
jmp 0x1559
movq $0x0, (%rcx)
movl $0x1, %r11d
jmp 0x1559
jne 0x14c2
leaq -0x1(%r10), %rax
movq %rax, (%r9)
movq %rdi, %rax
mulq -0x8(%rsi,%r10,8)
movq %rax, -0x8(%rcx,%r10,8)
movq %rdx, (%rcx,%r10,8)
cmpq $0x1, %r8
ja 0x14c2
movq %rdi, %rdx
negq %rdx
movl $0x1, %r11d
cmpq %rdx, %rax
jbe 0x1559
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq (%r9), %rbx
movq %rdi, %r14
negq %r14
leaq (%rcx,%rbx,8), %r15
addq $0x8, %r15
movl $0x1, %r11d
movq %rbx, %r12
subq $0x1, %rbx
jb 0x153e
movq %rdi, %rax
mulq (%rsi,%rbx,8)
movq %rax, (%rcx,%rbx,8)
addq %rdx, (%rcx,%r12,8)
movq %r15, %rdx
jae 0x1508
incq (%rdx)
leaq 0x8(%rdx), %rdx
je 0x14ff
movq %r10, %r13
subq %rbx, %r13
movb $0x1, %dl
cmpq %r8, %r13
jb 0x1536
cmpq %r14, %rax
jbe 0x152e
cmpq %r8, %r13
jbe 0x1536
cmpq $-0x1, (%rcx,%r12,8)
je 0x1536
movq %rbx, (%r9)
decq %r13
jmp 0x1531
movq %rbx, (%r9)
xorl %edx, %edx
movq %r13, %r11
addq $-0x8, %r15
testb %dl, %dl
jne 0x14e2
testq %r12, %r12
jne 0x1550
movq $-0x1, (%r9)
incq %r10
movq %r10, %r11
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
movq %r11, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O1/t0mm4rx[P]piscine_cpp/day07/ex02/./Array.hpp
// Function: Array<int>::operator=(Array<int> const&)
const Array &operator=(const Array &target)
		{
			if (this->array != nullptr)
				delete [] this->array;
			this->array = new T[target.size()];
			this->n = target.size();
			for (unsigned int i = 0; i < target.size(); i++)
				this->array[i] = target.array[i];
			return (*this);
		}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x19a1
callq 0x1100
movl 0x8(%r14), %r15d
movq %r15, %rdi
shlq $0x2, %rdi
callq 0x1030
movq %rax, (%rbx)
movl %r15d, 0x8(%rbx)
cmpl $0x0, 0x8(%r14)
je 0x19dc
movq (%r14), %rcx
movl 0x8(%r14), %edx
cmpl $0x1, %edx
adcl $0x0, %edx
xorl %esi, %esi
movl (%rcx,%rsi,4), %edi
movl %edi, (%rax,%rsi,4)
incq %rsi
cmpq %rsi, %rdx
jne 0x19ce
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Baobaobear[P]sort/sorttest.cpp
// Function: data_shuffle_shellsort(baobao::TestClass*, unsigned long)
static void data_shuffle_shellsort(sort_element_t arr[], size_t n)
{
    baobao::random_shuffle(arr, arr + n);

    sort_element_t *beg = arr, *end = arr + n;
    size_t incre = 1;
    while (incre < (size_t)(end - beg) / 3)
        incre = incre * 3 + 1; // A003462, Pratt, 1971, Knuth, 1973
    for (; incre >= 10; incre /= 3)
    {
        sort_element_t *bound = beg + incre;
        for (sort_element_t *i = bound; i < end; ++i)
        {
            sort_element_t *p = i;
            sort_element_t val = *i;
            for (; p >= bound && val < *(p - incre); p -= incre)
                *p = *(p - incre);
            *p = val;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movq %rsi, %r15
shlq $0x5, %r15
addq %rdi, %r15
movq %rdi, 0x8(%rsp)
movq %r15, %rsi
callq 0x4863
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
movq %rbx, %rax
mulq %rcx
movl $0x1, %eax
movq %rbx, 0x10(%rsp)
cmpq $0x6, %rbx
jb 0x3c68
shrq %rdx
leaq (%rax,%rax,2), %rax
incq %rax
cmpq %rdx, %rax
jb 0x3c5c
cmpq $0xa, %rax
jb 0x3d74
leaq 0x20(%rsp), %rdi
movq %rax, (%rsp)
cmpq 0x10(%rsp), %rax
jge 0x3d50
movq (%rsp), %rax
shlq $0x5, %rax
movq 0x8(%rsp), %r14
leaq (%r14,%rax), %rsi
leaq (%r14,%rax), %r8
addq $0x8, %r8
negq %rax
xorl %r10d, %r10d
movq %rsi, %rdx
movq %r10, %r9
shlq $0x5, %r9
movl (%rdx), %ebp
movl %ebp, 0x18(%rsp)
movl 0x4(%rdx), %r12d
movl %r12d, 0x1c(%rsp)
movq 0x10(%r8,%r9), %r11
movq %r11, 0x10(%rdi)
movups (%r8,%r9), %xmm0
movups %xmm0, (%rdi)
movq %rdx, %r11
cmpq %rsi, %rdx
jb 0x3d1d
movq %r14, %r9
movq %rdx, %r13
movl (%r13,%rax), %ebx
cmpl %ebx, %ebp
jge 0x3d1a
leaq (%rax,%r13), %r11
movl %ebx, (%r13)
movl 0x4(%r11), %ebx
movl %ebx, 0x4(%r13)
movl $0x2, %ebx
movl (%r9,%rbx,4), %ecx
movl %ecx, (%r13,%rbx,4)
incq %rbx
cmpq $0x8, %rbx
jne 0x3cfb
addq %rax, %r9
movq %r11, %r13
cmpq %rsi, %r11
jae 0x3cdd
jmp 0x3d1d
movq %r13, %r11
movl %ebp, (%r11)
movl %r12d, 0x4(%r11)
movl $0x2, %r9d
movl 0x18(%rsp,%r9,4), %ecx
movl %ecx, (%r11,%r9,4)
incq %r9
cmpq $0x8, %r9
jne 0x3d2a
addq $0x20, %rdx
incq %r10
addq $0x20, %r14
cmpq %r15, %rdx
jb 0x3ca8
movq (%rsp), %rsi
movq %rsi, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rcx
shrq %rdx
cmpq $0x1d, %rsi
movq %rdx, %rax
ja 0x3c77
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Baobaobear[P]sort/./sortlib.hpp
// Function: void baobao::internal::q_insert_sort<baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>)
void q_insert_sort(RandomAccessIterator beg, RandomAccessIterator end, Comp compare)
{
    const int incre = 13;
    for (RandomAccessIterator i = beg + incre, j = beg; i < end; ++i, ++j)
    {
        if (compare(*i, *j))
        {
            std::swap(*i, *j);
        }
    }

    for (RandomAccessIterator i = beg + 1; i < end; ++i)
    {
        if (compare(*i, *(i - 1)))
        {
            typename std::iterator_traits<RandomAccessIterator>::value_type val = *i;
            RandomAccessIterator j = i - 1;
            *i = *j;
            for (;j != beg && compare(val, *(j - 1)); --j)
            {
                *j = *(j - 1);
            }
            *j = val;
        }
    }
}

// Assembly:
pushq %rbx
leaq 0x1a0(%rdi), %rax
cmpq %rsi, %rax
jae 0x3eda
movq %rdi, %rcx
movl (%rax), %edx
movl (%rcx), %r9d
cmpl %r9d, %edx
jge 0x3ecd
movl 0x4(%rax), %r8d
movq 0x18(%rax), %r10
movq %r10, -0x10(%rsp)
movups 0x8(%rax), %xmm0
movaps %xmm0, -0x20(%rsp)
movl %r9d, (%rax)
movl 0x4(%rcx), %r9d
movl %r9d, 0x4(%rax)
leaq 0x8(%rcx), %r9
movq $-0x18, %r10
movl 0x20(%rcx,%r10), %r11d
movl %r11d, 0x1c0(%rcx,%r10)
addq $0x4, %r10
jne 0x3ea2
movl %edx, (%rcx)
movl %r8d, 0x4(%rcx)
movq -0x10(%rsp), %rdx
movq %rdx, 0x10(%r9)
movaps -0x20(%rsp), %xmm0
movups %xmm0, (%r9)
addq $0x20, %rax
addq $0x20, %rcx
cmpq %rsi, %rax
jb 0x3e6c
leaq 0x20(%rdi), %rax
cmpq %rsi, %rax
jae 0x3fb6
movq %rdi, %rcx
movl (%rax), %edx
movl (%rcx), %r9d
cmpl %r9d, %edx
jge 0x3fa5
movl %edx, -0x20(%rsp)
movl 0x24(%rcx), %r8d
movl %r8d, -0x1c(%rsp)
movl $0x2, %r10d
movl 0x20(%rcx,%r10,4), %r11d
movl %r11d, -0x20(%rsp,%r10,4)
incq %r10
cmpq $0x8, %r10
jne 0x3f0b
movl %r9d, (%rax)
movl 0x4(%rcx), %r9d
movl %r9d, 0x24(%rcx)
movl $0x2, %r9d
movl (%rcx,%r9,4), %r10d
movl %r10d, 0x20(%rcx,%r9,4)
incq %r9
cmpq $0x8, %r9
jne 0x3f2f
movq %rcx, %r9
cmpq %rdi, %rcx
je 0x3f87
movq %rcx, %r10
movl -0x20(%r10), %r11d
cmpl %r11d, %edx
jge 0x3f84
leaq -0x20(%r10), %r9
movl %r11d, (%r10)
movl -0x1c(%r10), %r11d
movl %r11d, 0x4(%r10)
movq $-0x18, %r11
movl (%r10,%r11), %ebx
movl %ebx, 0x20(%r10,%r11)
addq $0x4, %r11
jne 0x3f6b
movq %r9, %r10
cmpq %rdi, %r9
jne 0x3f4c
jmp 0x3f87
movq %r10, %r9
movl %edx, (%r9)
movl %r8d, 0x4(%r9)
movl $0x2, %edx
movl -0x20(%rsp,%rdx,4), %r8d
movl %r8d, (%r9,%rdx,4)
incq %rdx
cmpq $0x8, %rdx
jne 0x3f93
addq $0x20, %rax
addq $0x20, %rcx
cmpq %rsi, %rax
jb 0x3eea
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/Baobaobear[P]sort/./sortlib.hpp
// Function: baobao::util::taus88::init(unsigned int)
void init (uint32_t seed1, uint32_t seed2, uint32_t seed3)
    {
        s[0] = seed1;
        s[1] = seed2;
        s[2] = seed3;
        for (int i = 0; i < init_iter; ++i) (*this)();
    }

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
imull $0x8088405, %esi, %eax  # imm = 0x8088405
addl $0x8088406, %eax        # imm = 0x8088406
movl %esi, (%rdi)
notl %esi
imull $0x8088405, %esi, %ecx  # imm = 0x8088405
incl %ecx
movl %eax, 0x4(%rdi)
movl %ecx, 0x8(%rdi)
movl $0x10, %ebp
movq %rbx, %rdi
callq 0x45e6
decl %ebp
jne 0x45d2
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Baobaobear[P]sort/./sortlib.hpp
// Function: baobao::util::taus88::operator()()
uint32_t operator()() {
        s[0] = tausworthe(s[0], 12, 13, 19, 4294967294UL);
        s[1] = tausworthe(s[1], 4, 2, 25, 4294967288UL);
        s[2] = tausworthe(s[2], 17, 3, 11, 4294967280UL);
        return (s[0] ^ s[1] ^ s[2]);
    }

// Assembly:
movl (%rdi), %eax
movl 0x4(%rdi), %edx
movl %eax, %ecx
shll $0xd, %ecx
xorl %eax, %ecx
andl $-0x2, %eax
shll $0xc, %eax
shrl $0x13, %ecx
orl %eax, %ecx
movl %ecx, (%rdi)
leal (,%rdx,4), %eax
xorl %edx, %eax
shll $0x4, %edx
andl $-0x80, %edx
shrl $0x19, %eax
orl %edx, %eax
movl %eax, 0x4(%rdi)
movl 0x8(%rdi), %edx
leal (,%rdx,8), %esi
xorl %edx, %esi
andl $-0x10, %edx
shll $0x11, %edx
shrl $0xb, %esi
orl %edx, %esi
movl %esi, 0x8(%rdi)
xorl %ecx, %eax
xorl %esi, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Baobaobear[P]sort/./sorttest.hpp
// Function: void baobao::random_shuffle<baobao::TestClass*>(baobao::TestClass*, baobao::TestClass*)
void random_shuffle(RandomAccessIterator beg, RandomAccessIterator end)
{
    typename std::iterator_traits<RandomAccessIterator>::difference_type n;
    n = end - beg;
    while (--n >= 1)
    {
        std::swap(*(beg + n), *(beg + random_int((uint32_t)n)));
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
subq %rdi, %r14
sarq $0x5, %r14
cmpq $0x2, %r14
jl 0x491d
movq %rdi, %rbx
movq %r14, %rax
shlq $0x5, %rax
leaq (%rax,%rdi), %r12
addq $-0x18, %r12
leaq -0x1(%r14), %r15
movq %r15, %r13
shlq $0x5, %r13
movl %r15d, %edi
callq 0x2406
movl %eax, %esi
shlq $0x5, %rsi
leaq (%rbx,%rsi), %rax
movl (%rbx,%r13), %ecx
movl 0x4(%rbx,%r13), %edx
movq 0x18(%rbx,%r13), %rdi
movq %rdi, 0x10(%rsp)
movups 0x8(%rbx,%r13), %xmm0
movaps %xmm0, (%rsp)
leaq 0x8(%rbx,%rsi), %rsi
movl -0x8(%rsi), %edi
movl %edi, (%rbx,%r13)
movl -0x4(%rsi), %edi
movl %edi, 0x4(%rbx,%r13)
xorl %edi, %edi
movl (%rsi,%rdi,4), %r8d
movl %r8d, (%r12,%rdi,4)
incq %rdi
cmpq $0x6, %rdi
jne 0x48e6
movl %ecx, (%rax)
movl %edx, 0x4(%rax)
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rsi)
movaps (%rsp), %xmm0
movups %xmm0, (%rsi)
addq $-0x20, %r12
cmpq $0x2, %r14
movq %r15, %r14
jg 0x4896
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/Baobaobear[P]sort/./sortlib.hpp
// Function: baobao::util::uint32_distributor<baobao::util::taus88>::i8(unsigned int)
uint32_t i8(uint32_t n) {
        ++n;
        if (r8s == 0) {
            r8 = eg(); r8s = 4;
        }
        if ((n & -n) == n) {
            --r8s;
            uint32_t r = r8 & 0xff;
            r8 >>= 8;
            return r & (n - 1);
        }
        uint32_t m = n;
        while (m & (m - 1)) m += m & -m;
        --m;
        for (;;) {
            --r8s;
            uint32_t r = r8 & 0xff;
            r8 >>= 8;
            r &= m;
            if (r < n) return r;
            if (r8s == 0) {
                r8 = eg(); r8s = 4;
            }
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
leal 0x1(%r14), %ebp
cmpl $0x0, 0x14(%rdi)
jne 0x4da2
movq (%rbx), %rdi
callq 0x45e6
movl %eax, 0x10(%rbx)
movl $0x4, 0x14(%rbx)
testl %r14d, %ebp
je 0x4e02
movl %ebp, %eax
leal -0x1(%rax), %ecx
testl %ecx, %eax
je 0x4dbc
movl %eax, %ecx
negl %ecx
andl %eax, %ecx
addl %eax, %ecx
movl %ecx, %eax
jmp 0x4da9
movzbl %cl, %r14d
movl 0x10(%rbx), %eax
movl 0x14(%rbx), %ecx
decl %ecx
movl %ecx, 0x14(%rbx)
movl %r14d, %r12d
andl %eax, %r12d
shrl $0x8, %eax
movl %eax, 0x10(%rbx)
movl %r12d, %eax
cmpl %ebp, %r12d
jb 0x4df8
testl %ecx, %ecx
jne 0x4df5
movq (%rbx), %rdi
callq 0x45e6
movl %eax, 0x10(%rbx)
movl $0x4, 0x14(%rbx)
movl %r15d, %eax
movl %eax, %r15d
cmpl %ebp, %r12d
jae 0x4dc0
jmp 0x4e15
decl 0x14(%rbx)
movl 0x10(%rbx), %eax
andl %eax, %r14d
shrl $0x8, %eax
movl %eax, 0x10(%rbx)
movzbl %r14b, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Baobaobear[P]sort/./sortlib.hpp
// Function: baobao::util::uint32_distributor<baobao::util::taus88>::i16(unsigned int)
uint32_t i16(uint32_t n) {
        ++n;
        if (r16s == 0) {
            r16 = eg(); r16s = 2;
        }
        if ((n & -n) == n) {
            --r16s;
            uint32_t r = r16 & 0xffff;
            r16 >>= 16;
            return r & (n - 1);
        }
        uint32_t m = n;
        while (m & (m - 1)) m += m & -m;
        --m;
        for (;;) {
            --r16s;
            uint32_t r = r16 & 0xffff;
            r16 >>= 16;
            r &= m;
            if (r < n) return r;
            if (r16s == 0) {
                r16 = eg(); r16s = 2;
            }
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
leal 0x1(%r14), %ebp
cmpl $0x0, 0xc(%rdi)
jne 0x4e48
movq (%rbx), %rdi
callq 0x45e6
movl %eax, 0x8(%rbx)
movl $0x2, 0xc(%rbx)
testl %r14d, %ebp
je 0x4ea8
movl %ebp, %eax
leal -0x1(%rax), %ecx
testl %ecx, %eax
je 0x4e62
movl %eax, %ecx
negl %ecx
andl %eax, %ecx
addl %eax, %ecx
movl %ecx, %eax
jmp 0x4e4f
movzwl %cx, %r14d
movl 0x8(%rbx), %eax
movl 0xc(%rbx), %ecx
decl %ecx
movl %ecx, 0xc(%rbx)
movl %r14d, %r12d
andl %eax, %r12d
shrl $0x10, %eax
movl %eax, 0x8(%rbx)
movl %r12d, %eax
cmpl %ebp, %r12d
jb 0x4e9e
testl %ecx, %ecx
jne 0x4e9b
movq (%rbx), %rdi
callq 0x45e6
movl %eax, 0x8(%rbx)
movl $0x2, 0xc(%rbx)
movl %r15d, %eax
movl %eax, %r15d
cmpl %ebp, %r12d
jae 0x4e66
jmp 0x4ebb
decl 0xc(%rbx)
movl 0x8(%rbx), %eax
andl %eax, %r14d
shrl $0x10, %eax
movl %eax, 0x8(%rbx)
movzwl %r14w, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Baobaobear[P]sort/./sortlib.hpp
// Function: baobao::util::uint32_distributor<baobao::util::taus88>::i32(unsigned int)
uint32_t i32(uint32_t n) {
        ++n;
        if ((n & -n) == n) {
            uint32_t r = (uint32_t)eg();
            return r & (n - 1);
        }
        uint32_t m = n;
        while (m & (m - 1)) m += m & -m;
        --m;
        for (;;) {
            uint32_t r = (uint32_t)eg();
            r &= m;
            if (r < n) return r;
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
leal 0x1(%r14), %r15d
testl %esi, %r15d
je 0x4f07
movl %r15d, %eax
leal -0x1(%rax), %r14d
testl %r14d, %eax
je 0x4ef2
movl %eax, %ecx
negl %ecx
andl %eax, %ecx
addl %eax, %ecx
movl %ecx, %eax
jmp 0x4edd
movq (%rbx), %rdi
callq 0x45e6
andl %r14d, %eax
cmpl %r15d, %eax
cmovbl %eax, %ebp
jae 0x4ef2
jmp 0x4f14
movq (%rbx), %rdi
callq 0x45e6
movl %eax, %ebp
andl %r14d, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Baobaobear[P]sort/./sortlib.hpp
// Function: void baobao::internal::insert_sort<baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>)
void insert_sort(RandomAccessIterator beg, RandomAccessIterator end, Comp compare)
{
    for (RandomAccessIterator i = beg + 1; i < end; ++i)
    {
        if (compare(*i, *(i - 1)))
        {
            typename std::iterator_traits<RandomAccessIterator>::value_type val = *i;
            RandomAccessIterator j = i - 1;
            *i = *j;
            for (;j != beg && compare(val, *(j - 1)); --j)
            {
                *j = *(j - 1);
            }
            *j = val;
        }
    }
}

// Assembly:
leaq 0x20(%rdi), %rax
cmpq %rsi, %rax
jae 0x6756
pushq %rbx
movq %rdi, %rcx
movl (%rax), %edx
movl (%rcx), %r9d
cmpl %r9d, %edx
jge 0x6744
movl %edx, -0x20(%rsp)
movl 0x24(%rcx), %r8d
movl %r8d, -0x1c(%rsp)
movl $0x2, %r10d
movl 0x20(%rcx,%r10,4), %r11d
movl %r11d, -0x20(%rsp,%r10,4)
incq %r10
cmpq $0x8, %r10
jne 0x66aa
movl %r9d, (%rax)
movl 0x4(%rcx), %r9d
movl %r9d, 0x24(%rcx)
movl $0x2, %r9d
movl (%rcx,%r9,4), %r10d
movl %r10d, 0x20(%rcx,%r9,4)
incq %r9
cmpq $0x8, %r9
jne 0x66ce
movq %rcx, %r9
cmpq %rdi, %rcx
je 0x6726
movq %rcx, %r10
movl -0x20(%r10), %r11d
cmpl %r11d, %edx
jge 0x6723
leaq -0x20(%r10), %r9
movl %r11d, (%r10)
movl -0x1c(%r10), %r11d
movl %r11d, 0x4(%r10)
movq $-0x18, %r11
movl (%r10,%r11), %ebx
movl %ebx, 0x20(%r10,%r11)
addq $0x4, %r11
jne 0x670a
movq %r9, %r10
cmpq %rdi, %r9
jne 0x66eb
jmp 0x6726
movq %r10, %r9
movl %edx, (%r9)
movl %r8d, 0x4(%r9)
movl $0x2, %edx
movl -0x20(%rsp,%rdx,4), %r8d
movl %r8d, (%r9,%rdx,4)
incq %rdx
cmpq $0x8, %rdx
jne 0x6732
addq $0x20, %rax
addq $0x20, %rcx
cmpq %rsi, %rax
jb 0x6689
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/Baobaobear[P]sort/./sortlib.hpp
// Function: void baobao::internal::heap_sort_p<baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>)
void heap_sort_p(RandomAccessIterator beg, RandomAccessIterator end, Comp compare)
{
    if (end - beg > 1)
    {
        for (RandomAccessIterator i = beg + (end - beg) / 2; i >= beg; --i)
            max_heapify_p(beg, i, end - 1, compare);
        for (--end; end > beg; )
        {
            std::swap(*beg, *end--);
            max_heapify_p(beg, beg, end, compare);
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r12
subq %rdi, %r12
sarq $0x5, %r12
cmpq $0x2, %r12
jl 0x6822
movq %rsi, %rbx
movq %rdi, %r14
shlq $0x4, %r12
andq $-0x20, %r12
addq %rdi, %r12
leaq -0x20(%rsi), %r15
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x6830
addq $-0x20, %r12
cmpq %r14, %r12
jae 0x678d
cmpq %r14, %r15
jbe 0x6822
leaq 0x8(%r14), %r13
movl (%r14), %eax
movl 0x4(%r14), %ecx
movq 0x10(%r13), %rdx
movq %rdx, 0x10(%rsp)
movups (%r13), %xmm0
movaps %xmm0, (%rsp)
movl (%r15), %edx
movl %edx, (%r14)
movl 0x4(%r15), %edx
movl %edx, 0x4(%r14)
leaq 0x8(%r15), %rdx
movq $-0x18, %rsi
movl (%rbx,%rsi), %edi
movl %edi, 0x20(%r14,%rsi)
addq $0x4, %rsi
jne 0x67df
leaq -0x20(%r15), %r12
movl %eax, (%r15)
movl %ecx, 0x4(%r15)
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rdx)
movaps (%rsp), %xmm0
movups %xmm0, (%rdx)
movq %r14, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x6830
addq $-0x20, %rbx
movq %r12, %r15
cmpq %r14, %r12
ja 0x67ad
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/Baobaobear[P]sort/./sortlib.hpp
// Function: baobao::TestClass* baobao::internal::insert_sort_limit<baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>, int)
RandomAccessIterator insert_sort_limit(RandomAccessIterator beg, RandomAccessIterator end, Comp compare, int limit)
{
    for (RandomAccessIterator i = beg + 1; i < end; ++i)
    {
        if (!compare(*i, *(i - 1)))
        {
            ++limit;
            continue;
        }
        typename std::iterator_traits<RandomAccessIterator>::value_type val = *i;
        RandomAccessIterator j = i - 1;
        *i = *j;
        for (;j != beg && compare(val, *(j - 1)); --j)
        {
            if (--limit <= 0)
            {
                *j = val;
                return i;
            }
            *j = *(j - 1);
        }
        *j = val;
    }
    return end;
}

// Assembly:
leaq 0x20(%rdi), %rcx
cmpq %rsi, %rcx
jae 0x6d8c
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r8
movl (%rcx), %r9d
movl (%r8), %r11d
cmpl %r11d, %r9d
jge 0x6d11
movl %r9d, -0x20(%rsp)
movl 0x24(%r8), %r10d
movl %r10d, -0x1c(%rsp)
movl $0x2, %ebx
movl 0x20(%r8,%rbx,4), %ebp
movl %ebp, -0x20(%rsp,%rbx,4)
incq %rbx
cmpq $0x8, %rbx
jne 0x6c8a
movl %r11d, (%rcx)
movl 0x4(%r8), %r11d
movl %r11d, 0x24(%r8)
movl $0x2, %r11d
movl (%r8,%r11,4), %ebx
movl %ebx, 0x20(%r8,%r11,4)
incq %r11
cmpq $0x8, %r11
jne 0x6cad
cmpq %rdi, %r8
je 0x6d18
testl %edx, %edx
movl $0x1, %r11d
cmovlel %edx, %r11d
decl %r11d
movq %r8, %rbx
movl -0x20(%rbx), %ebp
cmpl %ebp, %r9d
jge 0x6d1d
cmpl $0x1, %edx
jle 0x6d47
leaq -0x20(%rbx), %r14
decl %edx
movl %ebp, (%rbx)
movl -0x1c(%rbx), %ebp
movl %ebp, 0x4(%rbx)
movq $-0x18, %r15
movl (%rbx,%r15), %ebp
movl %ebp, 0x20(%rbx,%r15)
addq $0x4, %r15
jne 0x6cf8
movq %r14, %rbx
cmpq %rdi, %r14
jne 0x6cd6
jmp 0x6d20
incl %edx
movl %edx, %r11d
jmp 0x6d6e
movq %r8, %r14
jmp 0x6d20
movq %rbx, %r14
movl %r9d, (%r14)
movl %r10d, 0x4(%r14)
movl $0x2, %r9d
movl -0x20(%rsp,%r9,4), %r10d
movl %r10d, (%r14,%r9,4)
incq %r9
cmpq $0x8, %r9
jne 0x6d2d
movb $0x1, %r9b
movl %edx, %r11d
jmp 0x6d69
movl %r9d, (%rbx)
movl %r10d, 0x4(%rbx)
movl $0x2, %eax
movl -0x20(%rsp,%rax,4), %edx
movl %edx, (%rbx,%rax,4)
incq %rax
cmpq $0x8, %rax
jne 0x6d53
xorl %r9d, %r9d
movq %rcx, %rax
testb %r9b, %r9b
je 0x6d85
addq $0x20, %rcx
addq $0x20, %r8
movl %r11d, %edx
cmpq %rsi, %rcx
jb 0x6c68
movq %rsi, %rax
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O1/Baobaobear[P]sort/./sortlib.hpp
// Function: void baobao::sort::merge_sort<baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>)
void merge_sort(RandomAccessIterator beg, RandomAccessIterator end, Comp compare)
{
    if (end - beg > 1)
    {
        typedef typename std::iterator_traits<RandomAccessIterator>::value_type value_type;
        value_type * buf = (value_type*)malloc((end - beg) / 2 * sizeof(value_type));
        internal::merge_sort_recursive<false>(buf, beg, end, compare);
        free(buf);
    }
}

// Assembly:
movq %rsi, %rax
subq %rdi, %rax
cmpq $0x21, %rax
jl 0x6dda
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
shrq %rax
movabsq $0x3fffffffffffffe0, %rdi # imm = 0x3FFFFFFFFFFFFFE0
andq %rax, %rdi
callq 0x21e0
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x6ddb
movq %r15, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x21c0
retq
// File: /workspace/github_cpp_makefile_star2_O1/Baobaobear[P]sort/./sortlib.hpp
// Function: void baobao::internal::merge_sort_recursive<false, baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>)
void merge_sort_recursive(RandomAccessBufferIterator buf, RandomAccessIterator beg, RandomAccessIterator end, Comp compare)
{
    size_t len = end - beg;
    if (len < merge_insertion_sort_threshold)
    {
        insert_sort(beg, end, compare);
        return;
    }
    RandomAccessIterator mid = beg + (len >> 1);
    merge_sort_recursive<safecopy>(buf, beg, mid, compare);
    merge_sort_recursive<safecopy>(buf, mid, end, compare);
    merge_2_part<safecopy>(buf, beg, mid, end, compare);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdx, %r15
subq %rsi, %r15
sarq $0x5, %r15
cmpq $0x1f, %r15
ja 0x6e0f
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6678
movq %rdi, %r12
shlq $0x4, %r15
andq $-0x20, %r15
addq %r14, %r15
movq %r14, %rsi
movq %r15, %rdx
callq 0x6ddb
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x6ddb
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6e52
// File: /workspace/github_cpp_makefile_star2_O1/Baobaobear[P]sort/./sortlib.hpp
// Function: void baobao::sort::merge_sort_s<baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>)
void merge_sort_s(RandomAccessIterator beg, RandomAccessIterator end, Comp compare)
{
    if (end - beg > 1)
    {
        typedef typename std::iterator_traits<RandomAccessIterator>::value_type value_type;
        value_type * buf = new value_type[(end - beg) / 2];
        internal::merge_sort_recursive<true>(buf, beg, end, compare);
        delete[] buf;
    }
}

// Assembly:
movq %rsi, %rax
subq %rdi, %rax
cmpq $0x21, %rax
jl 0x71e7
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
shrq %rax
movabsq $0x3fffffffffffffe0, %r15 # imm = 0x3FFFFFFFFFFFFFE0
andq %rax, %r15
movq %r15, %rdi
callq 0x2030
movq %rax, %r12
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x20d0
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x71e8
movq %r12, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x21d0
retq
// File: /workspace/github_cpp_makefile_star2_O1/Baobaobear[P]sort/./sortlib.hpp
// Function: void baobao::internal::merge_sort_with_buffer<false, baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>, bool)
void merge_sort_with_buffer(RandomAccessIterator beg, RandomAccessIterator end, Comp compare, bool buffered)
{
    if (end - beg > 1)
    {
        typedef typename std::iterator_traits<RandomAccessIterator>::value_type value_type;
        if (buffered)
        {
            if ((end - beg) / 2 * sizeof(value_type) <= merge_sort_stack_buffer_size)
            {
                value_type buf[merge_sort_stack_buffer_size / sizeof(value_type)];
                merge_sort_recursive<safecopy>(buf, beg, end, compare);
            }
            else if (merge_sort_alloc_buffer)
            {
                size_t bufsize = (size_t)sqrt(end - beg + 0.1);
                value_type * buf = new value_type[bufsize];
                merge_sort_recursive_with_buffer<safecopy>(buf, bufsize, beg, end, compare);
                delete[] buf;
            }
            else
            {
                // not really in-place, uses a fixed size of buffer in stack
                value_type buf[merge_sort_stack_buffer_size / sizeof(value_type)];
                merge_sort_recursive_with_buffer<safecopy>(buf, sizeof(buf) / sizeof(value_type), beg, end, compare);
            }
        }
        else
        {
            merge_sort_recursive_with_buffer<false>((value_type*)NULL, 0, beg, end, compare);
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4000, %rsp           # imm = 0x4000
movq %rsi, %rcx
subq %rdi, %rcx
movq %rcx, %rax
sarq $0x5, %rax
cmpq $0x2, %rax
jl 0x763a
movq %rsi, %rbx
movq %rdi, %r14
testb %dl, %dl
je 0x764b
andq $-0x40, %rcx
cmpq $0x8001, %rcx           # imm = 0x8001
ja 0x766a
movq %rsp, %r15
movl $0x4000, %edx           # imm = 0x4000
movq %r15, %rdi
xorl %esi, %esi
callq 0x20d0
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x6ddb
addq $0x4000, %rsp           # imm = 0x4000
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
xorl %edi, %edi
xorl %esi, %esi
movq %r14, %rdx
movq %rbx, %rcx
addq $0x4000, %rsp           # imm = 0x4000
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7707
cvtsi2sd %rax, %xmm0
addsd 0xc991(%rip), %xmm0     # 0x14008
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x7687
sqrtsd %xmm0, %xmm0
jmp 0x768c
callq 0x2140
cvttsd2si %xmm0, %rax
movq %rax, %rcx
subsd 0xc974(%rip), %xmm0     # 0x14010
cvttsd2si %xmm0, %r15
sarq $0x3f, %rcx
andq %rcx, %r15
orq %rax, %r15
movq %r15, %rax
shrq $0x3b, %rax
movq %r15, %r12
shlq $0x5, %r12
xorl %edi, %edi
negq %rax
sbbq %rdi, %rdi
orq %r12, %rdi
callq 0x2030
movq %rax, %r13
testq %r15, %r15
je 0x76de
movq %r13, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x20d0
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x7707
movq %r13, %rdi
addq $0x4000, %rsp           # imm = 0x4000
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x21d0
// File: /workspace/github_cpp_makefile_star2_O1/Baobaobear[P]sort/./sortlib.hpp
// Function: void baobao::internal::merge_sort_recursive_with_buffer<false, baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, unsigned long, baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>)
void merge_sort_recursive_with_buffer(RandomAccessBufferIterator buf, size_t bufsize, RandomAccessIterator beg, RandomAccessIterator end, Comp compare)
{
    size_t len = end - beg;
    if (len < merge_insertion_sort_threshold)
    {
        insert_sort(beg, end, compare);
        return;
    }
    RandomAccessIterator mid = beg + (len >> 1);
    merge_sort_recursive_with_buffer<safecopy>(buf, bufsize, beg, mid, compare);
    merge_sort_recursive_with_buffer<safecopy>(buf, bufsize, mid, end, compare);
    merge_2_part_with_buffer<safecopy>(buf, bufsize, beg, mid, end, compare);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rcx, %r15
subq %rdx, %r15
sarq $0x5, %r15
cmpq $0x1f, %r15
ja 0x773a
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x6678
movq %rsi, %r12
movq %rdi, %r13
shlq $0x4, %r15
andq $-0x20, %r15
addq %r14, %r15
movq %r14, %rdx
movq %r15, %rcx
callq 0x7707
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x7707
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r15, %rcx
movq %rbx, %r8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7784