LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/lvandeve[P]base256/base256.cpp
// Function: Decimal::decode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::string decode(const std::string& s) {
    std::string result;
    int count = 0;
    int val = 0;
    for(size_t i = 0; i < s.size(); i++) {
      char c = s[i];
      if((c >= '0' && c <= '9')) {
        int d = c - '0';
        if(count % 3 == 0) {
          val = d;
        } else {
          val *= 10;
          val += d;
        }
        if(count % 3 == 2) result.push_back(val);
        count++;
      }
    }
    return result;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
xorl %r15d, %r15d
pushq $0x3
popq %r12
xorl %r13d, %r13d
xorl %ebp, %ebp
cmpq 0x8(%r14), %r15
jae 0xa8ad
movq (%r14), %rax
movb (%rax,%r15), %cl
addb $-0x30, %cl
cmpb $0x9, %cl
ja 0xa8a8
movl %ebp, %eax
cltd
idivl %r12d
movzbl %r13b, %eax
imull $0xa, %eax, %eax
addb %cl, %al
testl %edx, %edx
movzbl %al, %esi
movzbl %cl, %r13d
cmovnel %esi, %r13d
cmpl $0x2, %edx
jne 0xa8a6
movsbl %al, %esi
movq %rbx, %rdi
callq 0x41a0
incl %ebp
incq %r15
jmp 0xa865
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x4408
movq %r14, %rdi
callq 0x43a0
// File: /workspace/github_cpp_makefile_star2_O2/lvandeve[P]base256/base256.cpp
// Function: Octal::encodeChar[abi:cxx11](unsigned char, unsigned char, unsigned char)
std::string encodeChar(unsigned char c, unsigned char prev, unsigned char next) {
    static const std::string d = "01234567";
    std::string result;
    result += d[c / 64];
    result += d[(c / 8) % 8];
    result += d[c % 8];
    if(prefix) result = "0" + result;
    return result;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movb 0xb200(%rip), %al       # 0x15af8
testb %al, %al
je 0xa9a2
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
andq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movzbl %bpl, %r15d
movl %r15d, %eax
shrl $0x6, %eax
movq 0xb1b7(%rip), %rcx      # 0x15ad8
movsbl (%rcx,%rax), %esi
movq %rbx, %rdi
callq 0x41a0
movl %r15d, %eax
shrl $0x3, %eax
andl $0x7, %eax
movq 0xb19b(%rip), %rcx      # 0x15ad8
movsbl (%rcx,%rax), %esi
movq %rbx, %rdi
callq 0x41a0
andl $0x7, %r15d
movq 0xb184(%rip), %rax      # 0x15ad8
movsbl (%rax,%r15), %esi
movq %rbx, %rdi
callq 0x41a0
cmpb $0x1, 0x8(%r14)
jne 0xa994
leaq 0x3902(%rip), %rsi      # 0xe271
leaq 0x8(%rsp), %rdi
movq %rbx, %rdx
callq 0x8cea
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4250
movq %r14, %rdi
callq 0x4408
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb14f(%rip), %rdi      # 0x15af8
callq 0x43b0
testl %eax, %eax
je 0xa900
leaq 0xb11b(%rip), %rdi      # 0x15ad8
leaq 0x3c76(%rip), %rsi      # 0xe63a
leaq 0x8(%rsp), %rdx
callq 0x40c0
movq 0xa5e3(%rip), %rdi      # 0x14fb8
leaq 0xb0fc(%rip), %rsi      # 0x15ad8
leaq 0xa825(%rip), %rdx      # 0x15208
callq 0x41b0
leaq 0xb109(%rip), %rdi      # 0x15af8
callq 0x4160
jmp 0xa900
movq %rax, %r14
leaq 0xb0f5(%rip), %rdi      # 0x15af8
callq 0x4150
jmp 0xaa17
jmp 0xaa0c
movq %rax, %r14
movq %rbx, %rdi
callq 0x4408
movq %r14, %rdi
callq 0x43a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/lvandeve[P]base256/base256.cpp
// Function: Binary::encodeChar[abi:cxx11](unsigned char, unsigned char, unsigned char)
std::string encodeChar(unsigned char c, unsigned char prev, unsigned char next) {
    std::string result;
    for(int j = 0; j < 8; j++) {
      if(lsb_first) {
        result += ((c >> j) & 1) ? '1' : '0';
      } else {
        result += ((c >> (7 - j)) & 1) ? '1' : '0';
      }
    }
    if(prefix) result = "0b" + result;
    return result;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %edx, %ebp
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movq %rsi, %r14
movb $0x0, 0x10(%rdi)
xorl %r15d, %r15d
pushq $0x7
popq %r12
cmpl $0x8, %r15d
je 0xaa8a
cmpb $0x0, 0x9(%r14)
movl %r12d, %eax
cmovnel %r15d, %eax
btl %eax, %ebp
movl $0x0, %esi
adcl $0x30, %esi
movq %rbx, %rdi
callq 0x41a0
incl %r15d
decl %r12d
jmp 0xaa5d
cmpb $0x0, 0x8(%r14)
je 0xaab9
leaq 0x3bab(%rip), %rsi      # 0xe643
movq %rsp, %rdi
movq %rbx, %rdx
callq 0x8cea
movq %rsp, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4250
movq %r14, %rdi
callq 0x4408
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0xaacb
movq %rax, %r14
movq %rbx, %rdi
callq 0x4408
movq %r14, %rdi
callq 0x43a0
// File: /workspace/github_cpp_makefile_star2_O2/lvandeve[P]base256/base256.cpp
// Function: Binary::decode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::string decode(const std::string& s) {
    std::string result;
    int count = 0;
    int val = 0;
    for(size_t i = 0; i < s.size(); i++) {
      char c = s[i];
      if(c != '0' && c != '1') continue;
      if(lsb_first) {
        val |= (c == '1' ? 1 : 0) << count;
      } else {
        val <<= 1;
        val |= (c == '1' ? 1 : 0);
      }
      count++;
      if(count == 8) {
        count = 0;
        char c2 = val;
        result += c2;
        val = 0;
      }
    }
    if(count != 0) {
      char c2 = val;
      result += c2;
    }
    return result;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
xorl %r12d, %r12d
xorl %eax, %eax
xorl %ebp, %ebp
cmpq 0x8(%r14), %r12
jae 0xab58
movq (%r14), %rcx
movb (%rcx,%r12), %cl
leal -0x32(%rcx), %edx
cmpb $-0x2, %dl
jb 0xab53
cmpb $0x1, 0x9(%r15)
jne 0xab32
xorl %edx, %edx
cmpb $0x31, %cl
sete %dl
movl %ebp, %ecx
shll %cl, %edx
orl %edx, %eax
jmp 0xab3d
xorl %edx, %edx
cmpb $0x31, %cl
sete %dl
leal (%rdx,%rax,2), %eax
incl %ebp
cmpl $0x8, %ebp
jne 0xab53
xorl %ebp, %ebp
movsbl %al, %esi
movq %rbx, %rdi
callq 0x41a0
xorl %eax, %eax
incq %r12
jmp 0xab06
testl %ebp, %ebp
je 0xab67
movsbl %al, %esi
movq %rbx, %rdi
callq 0x41a0
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0xab75
movq %rax, %r14
movq %rbx, %rdi
callq 0x4408
movq %r14, %rdi
callq 0x43a0
// File: /workspace/github_cpp_makefile_star2_O2/lvandeve[P]base256/base256.cpp
// Function: JSString::encodeChar[abi:cxx11](unsigned char, unsigned char, unsigned char)
std::string encodeChar(unsigned char c, unsigned char prev, unsigned char next) {
    if(c == '\b') return "\\b";
    if(c == '\f') return "\\f";
    if(c == '\n') return "\\n";
    if(c == '\r') return "\\r";
    if(c == '\t') return "\\t";
    if(c == '\\') return "\\\\";
    if(c == '\'') return "\\'";
    if(c >= 32 && c < 127) {
      std::string result;
      result += c;
      return result;
    }
    // in JS \0 is different than other octal, and should not have any *decimal* digit after it
    bool digitnext = (next >= '0' && next <= '9');
    if(c == 0 && !digitnext) return "\\0";
    int h0 = (c >> 4) & 15;
    int h1 = (c >> 0) & 15;
    static const std::string hex = "0123456789ABCDEF";
    std::string result = "\\x";
    result += hex[h0];
    result += hex[h1];
    return result;
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %r14d
movq %rdi, %rbx
leal -0x8(%r14), %eax
cmpl $0x5, %eax
ja 0xb76b
leaq 0x1903(%rip), %rcx      # 0xd054
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x2ef6(%rip), %rsi      # 0xe657
leaq 0xf(%rsp), %rdx
jmp 0xb87b
cmpl $0x27, %r14d
je 0xb7f9
cmpl $0x5c, %r14d
jne 0xb78c
leaq 0x2ee7(%rip), %rsi      # 0xe669
leaq 0xa(%rsp), %rdx
jmp 0xb87b
leal -0x20(%r14), %eax
cmpb $0x5e, %al
ja 0xb807
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
andq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movsbl %r14b, %esi
movq %rbx, %rdi
callq 0x41a0
jmp 0xb883
leaq 0x2ea7(%rip), %rsi      # 0xe663
leaq 0xb(%rsp), %rdx
jmp 0xb87b
leaq 0x2e90(%rip), %rsi      # 0xe65d
leaq 0xd(%rsp), %rdx
jmp 0xb87b
leaq 0x2e7c(%rip), %rsi      # 0xe65a
leaq 0xe(%rsp), %rdx
jmp 0xb87b
leaq 0x2e71(%rip), %rsi      # 0xe660
leaq 0xc(%rsp), %rdx
jmp 0xb87b
leaq 0x2e97(%rip), %rsi      # 0xe697
leaq 0x9(%rsp), %rdx
jmp 0xb87b
testb %r14b, %r14b
setne %al
addb $-0x30, %r8b
cmpb $0xa, %r8b
setb %cl
orb %al, %cl
je 0xb86f
movb 0xa2fe(%rip), %al       # 0x15b20
testb %al, %al
je 0xb890
movl %r14d, %r15d
shrl $0x4, %r15d
leaq 0x2e69(%rip), %rsi      # 0xe69d
leaq 0x6(%rsp), %rdx
movq %rbx, %rdi
callq 0x40c0
movq 0xa2b8(%rip), %rax      # 0x15b00
movsbl (%rax,%r15), %esi
movq %rbx, %rdi
callq 0x41a0
andl $0xf, %r14d
movq 0xa2a0(%rip), %rax      # 0x15b00
movsbl (%rax,%r14), %esi
movq %rbx, %rdi
callq 0x41a0
jmp 0xb883
leaq 0x2e24(%rip), %rsi      # 0xe69a
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x40c0
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0xa289(%rip), %rdi      # 0x15b20
callq 0x43b0
testl %eax, %eax
je 0xb826
leaq 0xa259(%rip), %rdi      # 0x15b00
leaq 0x2d6d(%rip), %rsi      # 0xe61b
leaq 0x7(%rsp), %rdx
callq 0x40c0
movq 0x96f9(%rip), %rdi      # 0x14fb8
leaq 0xa23a(%rip), %rsi      # 0x15b00
leaq 0x993b(%rip), %rdx      # 0x15208
callq 0x41b0
leaq 0xa247(%rip), %rdi      # 0x15b20
callq 0x4160
jmp 0xb826
movq %rax, %r14
leaq 0xa233(%rip), %rdi      # 0x15b20
callq 0x4150
jmp 0xb901
jmp 0xb8f6
movq %rax, %r14
movq %rbx, %rdi
callq 0x4408
movq %r14, %rdi
callq 0x43a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/lvandeve[P]base256/base256.cpp
// Function: JSONString::encodeChar[abi:cxx11](unsigned char, unsigned char, unsigned char)
std::string encodeChar(unsigned char c, unsigned char prev, unsigned char next) {
    if(c == '\b') return "\\b";
    if(c == '\f') return "\\f";
    if(c == '\n') return "\\n";
    if(c == '\r') return "\\r";
    if(c == '\t') return "\\t";
    if(c == '\\') return "\\\\";
    if(c == '\"') return "\\\"";
    if(c >= 32 && c < 127) {
      std::string result;
      result += c;
      return result;
    }
    static const std::string hex = "0123456789ABCDEF";
    int h0 = (c >> 4) & 15;
    int h1 = (c >> 0) & 15;
    std::string result = "\\u00";
    result += hex[h0];
    result += hex[h1];
    return result;
  }

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %edx, %r14d
movq %rdi, %rbx
leal -0x8(%r14), %eax
cmpl $0x5, %eax
ja 0xb9db
leaq 0x16ab(%rip), %rcx      # 0xd06c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x2c86(%rip), %rsi      # 0xe657
leaq 0x17(%rsp), %rdx
jmp 0xba5f
cmpl $0x22, %r14d
je 0xba53
cmpl $0x5c, %r14d
jne 0xb9f5
leaq 0x2c7b(%rip), %rsi      # 0xe669
leaq 0x12(%rsp), %rdx
jmp 0xba5f
leal -0x20(%r14), %eax
cmpb $0x5e, %al
ja 0xba72
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
andq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movsbl %r14b, %esi
movq %rbx, %rdi
callq 0x41a0
jmp 0xba67
leaq 0x2c41(%rip), %rsi      # 0xe663
leaq 0x13(%rsp), %rdx
jmp 0xba5f
leaq 0x2c2d(%rip), %rsi      # 0xe65d
leaq 0x15(%rsp), %rdx
jmp 0xba5f
leaq 0x2c1c(%rip), %rsi      # 0xe65a
leaq 0x16(%rsp), %rdx
jmp 0xba5f
leaq 0x2c14(%rip), %rsi      # 0xe660
leaq 0x14(%rsp), %rdx
jmp 0xba5f
leaq 0x2c12(%rip), %rsi      # 0xe66c
leaq 0x11(%rsp), %rdx
movq %rbx, %rdi
callq 0x40c0
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movb 0xa0d0(%rip), %al       # 0x15b48
testb %al, %al
je 0xbac3
leaq 0x2c21(%rip), %rsi      # 0xe6a4
leaq 0xf(%rsp), %rdx
movq %rbx, %rdi
callq 0x40c0
movl %r14d, %eax
shrl $0x4, %eax
movq 0xa08b(%rip), %rcx      # 0x15b28
movsbl (%rcx,%rax), %esi
movq %rbx, %rdi
callq 0x41a0
andl $0xf, %r14d
movq 0xa074(%rip), %rax      # 0x15b28
movsbl (%rax,%r14), %esi
movq %rbx, %rdi
callq 0x41a0
jmp 0xba67
leaq 0xa07e(%rip), %rdi      # 0x15b48
callq 0x43b0
testl %eax, %eax
je 0xba7c
leaq 0xa04e(%rip), %rdi      # 0x15b28
leaq 0x2b3a(%rip), %rsi      # 0xe61b
leaq 0x10(%rsp), %rdx
callq 0x40c0
movq 0x94c6(%rip), %rdi      # 0x14fb8
leaq 0xa02f(%rip), %rsi      # 0x15b28
leaq 0x9708(%rip), %rdx      # 0x15208
callq 0x41b0
leaq 0xa03c(%rip), %rdi      # 0x15b48
callq 0x4160
jmp 0xba7c
movq %rax, %r14
leaq 0xa028(%rip), %rdi      # 0x15b48
callq 0x4150
jmp 0xbb34
jmp 0xbb29
movq %rax, %r14
movq %rbx, %rdi
callq 0x4408
movq %r14, %rdi
callq 0x43a0
// File: /workspace/github_cpp_makefile_star2_O2/lvandeve[P]base256/base256.cpp
// Function: PythonString::encodeChar[abi:cxx11](unsigned char, unsigned char, unsigned char)
std::string encodeChar(unsigned char c, unsigned char prev, unsigned char next) {
    if(c == '\b') return "\\b";
    if(c == '\f') return "\\f";
    if(c == '\n') return "\\n";
    if(c == '\r') return "\\r";
    if(c == '\t') return "\\t";
    if(c == '\\') return "\\\\";
    if(c == '\'') return "\\'";
    if(c >= 32 && c < 127) {
      std::string result;
      result += c;
      return result;
    }
    // octal \0 should not have any *decimal* digit after it
    bool digitnext = (next >= '0' && next <= '9');
    if(c == 0 && !digitnext) return "\\0";
    int h0 = (c >> 4) & 15;
    int h1 = (c >> 0) & 15;
    static const std::string hex = "0123456789ABCDEF";
    std::string result = "\\x";
    result += hex[h0];
    result += hex[h1];
    return result;
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %r14d
movq %rdi, %rbx
leal -0x8(%r14), %eax
cmpl $0x5, %eax
ja 0xbbd1
leaq 0x14cd(%rip), %rcx      # 0xd084
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x2a90(%rip), %rsi      # 0xe657
leaq 0xf(%rsp), %rdx
jmp 0xbce1
cmpl $0x27, %r14d
je 0xbc5f
cmpl $0x5c, %r14d
jne 0xbbf2
leaq 0x2a81(%rip), %rsi      # 0xe669
leaq 0xa(%rsp), %rdx
jmp 0xbce1
leal -0x20(%r14), %eax
cmpb $0x5e, %al
ja 0xbc6d
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
andq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movsbl %r14b, %esi
movq %rbx, %rdi
callq 0x41a0
jmp 0xbce9
leaq 0x2a41(%rip), %rsi      # 0xe663
leaq 0xb(%rsp), %rdx
jmp 0xbce1
leaq 0x2a2a(%rip), %rsi      # 0xe65d
leaq 0xd(%rsp), %rdx
jmp 0xbce1
leaq 0x2a16(%rip), %rsi      # 0xe65a
leaq 0xe(%rsp), %rdx
jmp 0xbce1
leaq 0x2a0b(%rip), %rsi      # 0xe660
leaq 0xc(%rsp), %rdx
jmp 0xbce1
leaq 0x2a31(%rip), %rsi      # 0xe697
leaq 0x9(%rsp), %rdx
jmp 0xbce1
testb %r14b, %r14b
setne %al
addb $-0x30, %r8b
cmpb $0xa, %r8b
setb %cl
orb %al, %cl
je 0xbcd5
movb 0x9ee8(%rip), %al       # 0x15b70
testb %al, %al
je 0xbcf6
movl %r14d, %r15d
shrl $0x4, %r15d
leaq 0x2a03(%rip), %rsi      # 0xe69d
leaq 0x6(%rsp), %rdx
movq %rbx, %rdi
callq 0x40c0
movq 0x9ea2(%rip), %rax      # 0x15b50
movsbl (%rax,%r15), %esi
movq %rbx, %rdi
callq 0x41a0
andl $0xf, %r14d
movq 0x9e8a(%rip), %rax      # 0x15b50
movsbl (%rax,%r14), %esi
movq %rbx, %rdi
callq 0x41a0
jmp 0xbce9
leaq 0x29be(%rip), %rsi      # 0xe69a
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x40c0
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x9e73(%rip), %rdi      # 0x15b70
callq 0x43b0
testl %eax, %eax
je 0xbc8c
leaq 0x9e43(%rip), %rdi      # 0x15b50
leaq 0x2907(%rip), %rsi      # 0xe61b
leaq 0x7(%rsp), %rdx
callq 0x40c0
movq 0x9293(%rip), %rdi      # 0x14fb8
leaq 0x9e24(%rip), %rsi      # 0x15b50
leaq 0x94d5(%rip), %rdx      # 0x15208
callq 0x41b0
leaq 0x9e31(%rip), %rdi      # 0x15b70
callq 0x4160
jmp 0xbc8c
movq %rax, %r14
leaq 0x9e1d(%rip), %rdi      # 0x15b70
callq 0x4150
jmp 0xbd67
jmp 0xbd5c
movq %rax, %r14
movq %rbx, %rdi
callq 0x4408
movq %r14, %rdi
callq 0x43a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/isaacbrodsky[P]K-means-plus-plus/main.cpp
// Function: main
int main(int argc, char *argv[]) {

	// local variables
	Cluster_set clCluster_set_instance;

	// check if there are any command line arguments
	if (argc < 2) { // missing input argument
		cout << "No control file specified" << endl << endl;
		cout << "Required input format is: k-means++ <control file name>" << endl << endl;
		return 1;
	}
	else { // input argument present
		// read the parameter data from the input file
		clCluster_set_instance.Read_control_data(argv[1]);

		// start the clustering program
		clCluster_set_instance.Execute_clustering();
	} // if

	return 0;  // that's all folks
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x1468, %rsp           # imm = 0x1468
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x30(%rsp), %rdi
callq 0x3952
cmpl $0x1, %ebp
jg 0x3664
movq 0x99a0(%rip), %rdi      # 0xcfc0
leaq 0x49dd(%rip), %rsi      # 0x8004
callq 0x32d0
movq %rax, %rdi
callq 0x3120
movq %rax, %rdi
callq 0x3120
movq 0x997d(%rip), %rdi      # 0xcfc0
leaq 0x49d4(%rip), %rsi      # 0x801e
callq 0x32d0
movq %rax, %rdi
callq 0x3120
movq %rax, %rdi
callq 0x3120
pushq $0x1
popq %rbx
jmp 0x369c
movq 0x8(%rbx), %rsi
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36d8
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x3aa2
leaq 0x10(%rsp), %rdi
callq 0x30f0
xorl %ebx, %ebx
leaq 0x30(%rsp), %rdi
callq 0x3d64
leaq 0x30(%rsp), %rdi
callq 0x3714
movl %ebx, %eax
addq $0x1468, %rsp           # imm = 0x1468
popq %rbx
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x30f0
jmp 0x36c6
jmp 0x36c3
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x3714
movq %rbx, %rdi
callq 0x3450
// File: /workspace/github_cpp_makefile_star2_O2/isaacbrodsky[P]K-means-plus-plus/k-means-multi.cpp
// Function: Cluster_set::Cluster_set()
Cluster_set::Cluster_set(void){

	// local variables
	random_device rd;

	// initialize the class variables
	iIteration = 0;
	iK_count = 1;
	sIn_file = "default_in.dat";
	sOut_file = "default_out.txt";
	bUseLabels = false;
	fTolerance = 0.1f;
	// Use K-means++ by default.
	bUsePlusPlus = true;
	// Seed with real random value if available
	mtRandom = mt19937(rd());
	iNumThreads = 1;
	iNumPlusPlusThreads = 1;

	return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2710, %rsp           # imm = 0x2710
movq %rdi, %rbx
leaq 0x48(%rdi), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
movq %rax, 0x38(%rdi)
andq $0x0, 0x40(%rdi)
xorl %eax, %eax
movb %al, 0x48(%rdi)
leaq 0x68(%rdi), %rcx
movq %rcx, 0x58(%rdi)
andq $0x0, 0x60(%rdi)
leaq 0x38(%rdi), %r14
leaq 0x58(%rdi), %r15
movb %al, 0x68(%rdi)
movups %xmm0, 0x80(%rdi)
andq $0x0, 0x90(%rdi)
leaq 0xa8(%rdi), %r12
movq %r12, %rdi
callq 0x5258
movq %rsp, %rdi
callq 0x5262
andl $0x0, 0x98(%rbx)
movl $0x1, 0x30(%rbx)
leaq 0x46e0(%rip), %rsi      # 0x80b8
movq %r14, %rdi
callq 0x3470
leaq 0x46e0(%rip), %rsi      # 0x80c7
movq %r15, %rdi
callq 0x3470
movw $0x100, 0xa0(%rbx)      # imm = 0x100
movl $0x3dcccccd, 0x78(%rbx) # imm = 0x3DCCCCCD
movq %rsp, %rdi
callq 0x3370
movl %eax, %esi
leaq 0x1388(%rsp), %rdi
callq 0x52d6
leaq 0x1388(%rsp), %rsi
movl $0x1388, %edx           # imm = 0x1388
movq %r12, %rdi
callq 0x3220
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x1430(%rbx)
movq %rsp, %rdi
callq 0x52b8
addq $0x2710, %rsp           # imm = 0x2710
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x3a57
movq %rax, %r12
jmp 0x3a69
jmp 0x3a5e
movq %rax, %r12
movq %rsp, %rdi
callq 0x52b8
leaq 0x80(%rbx), %rdi
leaq 0x18(%rbx), %r13
callq 0x3748
movq %r15, %rdi
callq 0x30f0
movq %r14, %rdi
callq 0x30f0
movq %r13, %rdi
callq 0x376a
movq %rbx, %rdi
callq 0x376a
movq %r12, %rdi
callq 0x3450
nop
// File: /workspace/github_cpp_makefile_star2_O2/isaacbrodsky[P]K-means-plus-plus/k-means-multi.cpp
// Function: Cluster_set::Identify_mean_values()
void Cluster_set::Identify_mean_values(void){

	// local variables
	int iCluster_index, iAttribute_index;
	vector<float> vfValues;

	// allocate memory for the local vector
	vfValues.resize(iAttribute_ct);

	if (iIteration < 1) { // if this is the first iteration - initialize the cluster mean values
		if (bUsePlusPlus) {
			Initialize_plus_plus();
		}
		else { // Use the first k instances.
			for (iCluster_index = 0; iCluster_index < iK_count; iCluster_index++){ // read K-instances
				for (iAttribute_index = 0; iAttribute_index < iAttribute_ct; iAttribute_index++){ // read attributes
					vvfMeans[iCluster_index][iAttribute_index]
						= vclInput_data[iCluster_index].vfAttribute[iAttribute_index];
				} // for
			} //for
		}
	} // if

	// save the existing mean values
	for (iCluster_index = 0; iCluster_index < iK_count; iCluster_index++){
		for (iAttribute_index = 0; iAttribute_index < iAttribute_ct; iAttribute_index++){

			// copy the new_means values into the old_means values storage
			vvfOld_means[iCluster_index][iAttribute_index] = vvfMeans[iCluster_index][iAttribute_index];
		} // for
	} //for

	return;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movslq 0x9c(%rbx), %rsi
callq 0x530e
cmpl $0x0, 0x98(%rbx)
jg 0x3fe6
cmpb $0x0, 0xa1(%rbx)
je 0x4040
movq %rbx, %rdi
callq 0x4730
movl 0x9c(%rbx), %eax
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
movl 0x30(%rbx), %edx
testl %edx, %edx
cmovlel %ecx, %edx
cmpq %rdx, %rcx
je 0x4032
imulq $0x18, %rcx, %rsi
movq (%rbx), %rdi
addq %rsi, %rdi
addq 0x18(%rbx), %rsi
xorl %r8d, %r8d
cmpq %r8, %rax
je 0x402d
movq (%rdi), %r9
movss (%r9,%r8,4), %xmm0
movq (%rsi), %r9
movss %xmm0, (%r9,%r8,4)
incq %r8
jmp 0x4011
incq %rcx
jmp 0x3ffb
movq %rsp, %rdi
callq 0x37f0
addq $0x20, %rsp
popq %rbx
retq
movl 0x9c(%rbx), %eax
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
movl 0x30(%rbx), %edx
testl %edx, %edx
cmovlel %ecx, %edx
cmpq %rdx, %rcx
je 0x3fe6
movq %rcx, %rsi
shlq $0x6, %rsi
addq 0x80(%rbx), %rsi
imulq $0x18, %rcx, %rdi
addq (%rbx), %rdi
xorl %r8d, %r8d
cmpq %r8, %rax
je 0x408e
movq (%rsi), %r9
movss (%r9,%r8,4), %xmm0
movq (%rdi), %r9
movss %xmm0, (%r9,%r8,4)
incq %r8
jmp 0x4072
incq %rcx
jmp 0x4055
movq %rax, %rbx
movq %rsp, %rdi
callq 0x37f0
movq %rbx, %rdi
callq 0x3450
// File: /workspace/github_cpp_makefile_star2_O2/isaacbrodsky[P]K-means-plus-plus/k-means-multi.cpp
// Function: Cluster_set::Cluster_data()
void Cluster_set::Cluster_data(void){
	if (iNumThreads == 1)
	{
		//Don't bother creating more threads.
		Cluster_data_process(0, vclInput_data.size());
	}
	else
	{
		// local variables
		unsigned uPerThread;
		unsigned uData;
		unsigned uDataStart;
		int iThread_index;
		vector<thread> vtThreads;

		uDataStart = 0;
		uData = vclInput_data.size();
		uPerThread = uData / iNumThreads;

		//Split the dataset into parts and launch as individual
		//threads.
		for (iThread_index = 0; iThread_index < iNumThreads; iThread_index++)
		{
			//Force the last thread to take remaining data
			if (iThread_index == iNumThreads - 1)
			{
				uPerThread = uData - uDataStart;
			}

			vtThreads.push_back(thread([=](unsigned uStart, unsigned uLength) { Cluster_data_process(uStart, uLength); }, uDataStart, uPerThread));

			uDataStart += uPerThread;
		} // Launch all threads

		//Wait for all threads to complete.
		for (iThread_index = 0; iThread_index < iNumThreads; iThread_index++)
		{
			vtThreads[iThread_index].join();
		} // Wait for all threads
	}
	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl 0x1434(%rdi), %ecx
cmpl $0x1, %ecx
jne 0x40ec
movq 0x88(%rbx), %rdx
subq 0x80(%rbx), %rdx
shrq $0x6, %rdx
movq %rbx, %rdi
xorl %esi, %esi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4dc6
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rax
andq $0x0, 0x10(%rax)
movaps %xmm0, (%rax)
movq 0x88(%rbx), %r15
subq 0x80(%rbx), %r15
shrq $0x6, %r15
xorl %r12d, %r12d
movl %r15d, %eax
xorl %edx, %edx
divl %ecx
movl %eax, %ebp
leaq 0x8(%rsp), %r13
xorl %r14d, %r14d
cmpl %ecx, %r14d
jge 0x419b
decl %ecx
movl %r15d, %eax
subl %r12d, %eax
cmpl %ecx, %r14d
cmovel %eax, %ebp
andq $0x0, 0x8(%rsp)
pushq $0x18
popq %rdi
callq 0x32e0
leaq 0x8b06(%rip), %rcx      # 0xcc50
movq %rcx, (%rax)
movl %ebp, 0x8(%rax)
movl %r12d, 0xc(%rax)
movq %rbx, 0x10(%rax)
movq %rax, (%rsp)
movq %r13, %rdi
movq %rsp, %rsi
xorl %edx, %edx
callq 0x3280
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x4178
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x7248
movq %r13, %rdi
callq 0x5556
addl %ebp, %r12d
incl %r14d
movl 0x1434(%rbx), %ecx
jmp 0x4122
xorl %r14d, %r14d
xorl %r15d, %r15d
movslq %ecx, %rax
cmpq %rax, %r15
jge 0x41c5
movq 0x10(%rsp), %rdi
addq %r14, %rdi
callq 0x34b8
incq %r15
movl 0x1434(%rbx), %ecx
addq $0x8, %r14
jmp 0x41a1
leaq 0x10(%rsp), %rdi
callq 0x5564
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4203
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5556
jmp 0x4206
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x4206
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x4206
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x5564
movq %rbx, %rdi
callq 0x3450
// File: /workspace/github_cpp_makefile_star2_O2/isaacbrodsky[P]K-means-plus-plus/k-means-multi.cpp
// Function: Cluster_set::Calculate_cluster_means()
void Cluster_set::Calculate_cluster_means(void){

	// local variables
	int iK_index, iAttribute_index;
	unsigned uInstance_index, uInstance_sz;
	vector<int> viCounts(iK_count);

	uInstance_sz = vclInput_data.size();
	
	for (uInstance_index = 0; uInstance_index < uInstance_sz; uInstance_index++)
	{
		iK_index = vclInput_data[uInstance_index].iCluster;
		//loop through each vector attribute
		for (iAttribute_index = 0; iAttribute_index < iAttribute_ct; iAttribute_index++){
			vvfMeans[iK_index][iAttribute_index] += vclInput_data[uInstance_index].vfAttribute[iAttribute_index];
		} // for

		viCounts[iK_index]++;
	}
	
	// loop thru each cluster
	for (iK_index = 0; iK_index < iK_count; iK_index++){
		//loop through each vector attribute
		for (iAttribute_index = 0; iAttribute_index < iAttribute_ct; iAttribute_index++) {
			//If no elements, default to origin as per old code.
			if (viCounts[iK_index] == 0)
				vvfMeans[iK_index][iAttribute_index] = 0;
			else
				vvfMeans[iK_index][iAttribute_index] /= (float)viCounts[iK_index];
		}
	} // for

	return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movslq 0x30(%rdi), %rsi
leaq 0x8(%rsp), %r14
leaq 0x7(%rsp), %rdx
movq %r14, %rdi
callq 0x5586
movq 0x80(%rbx), %rax
movq 0x88(%rbx), %rdx
subq %rax, %rdx
shrq $0x6, %rdx
movq (%r14), %rcx
movl %edx, %edx
xorl %esi, %esi
xorl %edi, %edi
cmpq %rdx, %rdi
je 0x42b0
movq %rdi, %r8
shlq $0x6, %r8
leaq (%rax,%r8), %r9
movslq 0x38(%rax,%r8), %r8
movl 0x9c(%rbx), %r10d
imulq $0x18, %r8, %r11
addq (%rbx), %r11
testl %r10d, %r10d
cmovlel %esi, %r10d
xorl %r14d, %r14d
cmpq %r14, %r10
je 0x42a7
movq (%r9), %r15
movss (%r15,%r14,4), %xmm0
movq (%r11), %r15
addss (%r15,%r14,4), %xmm0
movss %xmm0, (%r15,%r14,4)
incq %r14
jmp 0x4285
incl (%rcx,%r8,4)
incq %rdi
jmp 0x4258
movl 0x9c(%rbx), %eax
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
movl 0x30(%rbx), %edx
testl %edx, %edx
cmovlel %ecx, %edx
cmpq %rdx, %rcx
je 0x4313
movq 0x8(%rsp), %rsi
imulq $0x18, %rcx, %rdi
addq (%rbx), %rdi
xorl %r8d, %r8d
cmpq %r8, %rax
je 0x430e
movl (%rsi,%rcx,4), %r9d
testl %r9d, %r9d
je 0x4301
cvtsi2ss %r9d, %xmm0
movq (%rdi), %r9
movss (%r9,%r8,4), %xmm1
divss %xmm0, %xmm1
movss %xmm1, (%r9,%r8,4)
jmp 0x4309
movq (%rdi), %r9
andl $0x0, (%r9,%r8,4)
incq %r8
jmp 0x42d9
incq %rcx
jmp 0x42c5
leaq 0x8(%rsp), %rdi
callq 0x744a
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/isaacbrodsky[P]K-means-plus-plus/k-means-multi.cpp
// Function: Cluster_set::Compare_mean_values()
bool Cluster_set::Compare_mean_values(void){

	// local variables
	bool bNot_done;
	float sStep_difference;
	float fResult_difference = 0;
	int iCluster_index, iAttribute_index;

	// calculate the difference between the old means and the new means
	for (iCluster_index = 0; iCluster_index < iK_count; iCluster_index++){ // by each cluster
		// compare the attribute mean values
		for (iAttribute_index = 0; iAttribute_index < iAttribute_ct; iAttribute_index++){

			sStep_difference = vvfMeans[iCluster_index][iAttribute_index]
				- vvfOld_means[iCluster_index][iAttribute_index];
			// guarantee a positive value without using squares
			if (sStep_difference < 0) sStep_difference = sStep_difference * (-1);

			// add the step difference to the total difference of means
			fResult_difference = fResult_difference + sStep_difference;

		} // for

	} // for

	// stop clustering if there is little change in  the mean values
	if (fResult_difference < fTolerance) bNot_done = false;
	else bNot_done = true;

	return bNot_done;

}

// Assembly:
pushq %rbx
movl 0x30(%rdi), %eax
movl 0x9c(%rdi), %ecx
movq (%rdi), %rdx
movq 0x18(%rdi), %rsi
xorl %r8d, %r8d
testl %ecx, %ecx
cmovlel %r8d, %ecx
testl %eax, %eax
cmovlel %r8d, %eax
xorps %xmm0, %xmm0
movaps 0x3d2e(%rip), %xmm1     # 0x8080
cmpq %rax, %r8
je 0x4394
imulq $0x18, %r8, %r9
leaq (%rdx,%r9), %r10
addq %rsi, %r9
xorl %r11d, %r11d
cmpq %r11, %rcx
je 0x438f
movq (%r10), %rbx
movss (%rbx,%r11,4), %xmm2
movq (%r9), %rbx
subss (%rbx,%r11,4), %xmm2
movaps %xmm2, %xmm3
xorps %xmm1, %xmm3
maxss %xmm2, %xmm3
addss %xmm3, %xmm0
incq %r11
jmp 0x4365
incq %r8
jmp 0x4352
movss 0x78(%rdi), %xmm1
ucomiss %xmm0, %xmm1
setbe %al
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/isaacbrodsky[P]K-means-plus-plus/k-means-multi.cpp
// Function: Cluster_set::Initialize_plus_plus_process(unsigned int, unsigned int, int, std::vector<float, std::allocator<float>>&, std::vector<bool, std::allocator<bool>> const&)
float Cluster_set::Initialize_plus_plus_process(unsigned uIndex, unsigned uLength, int iSelectedPoints, vector<float>& vfDistance, const vector<bool>& vbSkipPoints) {

	unsigned uLastIndex = uIndex + uLength;
	int iAttribute_index;
	int iK_index;
	float fSum_of_squares;
	float fDifference;
	float fTotalDistance = 0;

	// Compute distance to nearest cluster for all data instances.
	for (; uIndex < uLastIndex; uIndex++) {
		// Skip if already selected as a starting point
		if (!vbSkipPoints[uIndex]) {
			// Compute distance to nearest mean
			for (iK_index = 0; iK_index < iSelectedPoints; iK_index++) {
				fSum_of_squares = 0;

				for (iAttribute_index = 0; iAttribute_index < iAttribute_ct; iAttribute_index++) {
					fDifference = (vclInput_data[uIndex].vfAttribute[iAttribute_index] - vvfMeans[iK_index][iAttribute_index]);
					fSum_of_squares += (fDifference * fDifference);
				} // for

				// If this is the first evaluated distance, use it.
				// Otherwise only use the distance if it is better
				// than the previous best distance.
				if (iK_index == 0 || fSum_of_squares < vfDistance[uIndex]) {
					vfDistance[uIndex] = fSum_of_squares;
				}
			}

			// Sum the distance of all points to the closest
			// starting points as each one is calculated.
			fTotalDistance += vfDistance[uIndex];
		}
	}

	return fTotalDistance;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x10(%rsp)
movq %r8, %r14
movl %ecx, %r15d
movl %edx, %ebp
movl %esi, %r12d
movq %rdi, %r13
addl %esi, %ebp
xorl %eax, %eax
testl %ecx, %ecx
cmovlel %eax, %r15d
xorps %xmm0, %xmm0
movss %xmm0, 0xc(%rsp)
cmpl %ebp, %r12d
jae 0x471a
movl %r12d, %ebx
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x5416
testb %al, %al
jne 0x4712
movl 0x9c(%r13), %eax
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
movq (%r14), %rcx
movq %rbx, %rdx
shlq $0x6, %rdx
xorl %esi, %esi
cmpq %r15, %rsi
je 0x46fe
movq 0x80(%r13), %rdi
addq %rdx, %rdi
imulq $0x18, %rsi, %r8
addq (%r13), %r8
xorps %xmm0, %xmm0
xorl %r9d, %r9d
cmpq %r9, %rax
je 0x46e5
movq (%rdi), %r10
movss (%r10,%r9,4), %xmm1
movq (%r8), %r10
subss (%r10,%r9,4), %xmm1
mulss %xmm1, %xmm1
addss %xmm1, %xmm0
incq %r9
jmp 0x46c1
testq %rsi, %rsi
je 0x46f4
movss (%rcx,%rbx,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x46f9
movss %xmm0, (%rcx,%rbx,4)
incq %rsi
jmp 0x46a4
movq (%r14), %rax
movss 0xc(%rsp), %xmm0
addss (%rax,%rbx,4), %xmm0
movss %xmm0, 0xc(%rsp)
incl %r12d
jmp 0x4666
movss 0xc(%rsp), %xmm0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/isaacbrodsky[P]K-means-plus-plus/k-means-multi.cpp
// Function: Cluster_set::Cluster_data_process(unsigned int, unsigned int)
void Cluster_set::Cluster_data_process(unsigned uIndex, unsigned uLength)
{
	// local variables
	float fDifference;
	float fSquared_difference, fSum_of_squares;
	float fBest_squared_difference;
	int iBest_index;
	int iK_index, iAttribute_index;
	unsigned uLast = uIndex + uLength;

	// loop for all the input data values
	for (; uIndex < uLast; uIndex++) {

		// initialize the tracking variables
		fBest_squared_difference = FLT_MAX; // make this erroneously big
		iBest_index = -1; // Forces taking the first value

		// get the next data vector
		Cluster_instance& clData_instance = vclInput_data[uIndex];

		// loop thru all of the mean values
		for (iK_index = 0; iK_index < iK_count; iK_index++) {

			// initialize the variables
			fDifference = 0;
			fSum_of_squares = 0;

			// compare the data vector to the mean vector
			for (iAttribute_index = 0; iAttribute_index < iAttribute_ct; iAttribute_index++){
				// calculate the difference between the data value and the mean value
				fDifference = (clData_instance.vfAttribute[iAttribute_index] - vvfMeans[iK_index][iAttribute_index]);
				// square the difference
				fSquared_difference = fDifference * fDifference;
				// add to the sum of squares
				fSum_of_squares = fSum_of_squares + fSquared_difference;
			} // for

			// if this value is less than the best squared difference (BSD)
			if (iBest_index == -1 || fSum_of_squares < fBest_squared_difference){
				fBest_squared_difference = fSum_of_squares; // save it as BSD

				// and save the this index as best index
				iBest_index = iK_index;

			} // if
		} // for

		clData_instance.iCluster = iBest_index;
	} // for

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
addl %esi, %edx
movq 0x80(%rdi), %rax
movl 0x30(%rdi), %ecx
xorl %r8d, %r8d
testl %ecx, %ecx
cmovlel %r8d, %ecx
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
movss 0x32b1(%rip), %xmm0     # 0x80a4
cmpl %edx, %esi
jae 0x4e87
movl %esi, %r10d
shlq $0x6, %r10
addq %rax, %r10
movl 0x9c(%rdi), %r11d
testl %r11d, %r11d
cmovlel %r8d, %r11d
movq (%rdi), %rbx
xorl %r14d, %r14d
movaps %xmm0, %xmm1
movl %r9d, %ebp
cmpq %rcx, %r14
je 0x4e7c
imulq $0x18, %r14, %r15
addq %rbx, %r15
xorps %xmm2, %xmm2
xorl %r12d, %r12d
cmpq %r12, %r11
je 0x4e57
movq (%r10), %r13
movss (%r13,%r12,4), %xmm3
movq (%r15), %r13
subss (%r13,%r12,4), %xmm3
mulss %xmm3, %xmm3
addss %xmm3, %xmm2
incq %r12
jmp 0x4e31
cmpl $-0x1, %ebp
sete %r15b
ucomiss %xmm2, %xmm1
seta %r12b
orb %r15b, %r12b
testb %r12b, %r12b
jne 0x4e70
movaps %xmm1, %xmm2
cmovnel %r14d, %ebp
incq %r14
movaps %xmm2, %xmm1
jmp 0x4e1f
movl %ebp, 0x38(%r10)
incl %esi
jmp 0x4df3
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/akw0088[P]openssl/rsa_dec.cpp
// Function: createRSA(unsigned char*, bool)
RSA *createRSA(unsigned char *key, bool pub)
{
	RSA *rsa = NULL;
	BIO *keybio = BIO_new_mem_buf(key, -1); // a bio is just a memory buffer, -1 means do strlen of char *key

	if (keybio == NULL)
	{
		printf( "Failed to create key BIO");
		return 0;
	}

	if (pub)
	{
		rsa = PEM_read_bio_RSA_PUBKEY(keybio, &rsa, NULL, NULL);
	}
	else
	{
		rsa = PEM_read_bio_RSAPrivateKey(keybio, &rsa, NULL, NULL);
	}
	BIO_free_all(keybio);

	if (rsa == NULL)
	{
		printf( "Failed to create RSA");
	}
 
	return rsa;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %r14d
andq $0x0, -0x18(%rbp)
pushq $-0x1
popq %rsi
callq 0x1060
testq %rax, %rax
je 0x12b6
movq %rax, %rbx
leaq -0x18(%rbp), %rsi
movq %rax, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
testb %r14b, %r14b
je 0x12c8
callq 0x1170
jmp 0x12cd
leaq 0xd47(%rip), %rdi       # 0x2004
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x1050
jmp 0x12f4
callq 0x1150
movq %rax, -0x18(%rbp)
movq %rbx, %rdi
callq 0x1080
movq -0x18(%rbp), %rbx
testq %rbx, %rbx
jne 0x12f4
leaq 0xd34(%rip), %rdi       # 0x201d
xorl %eax, %eax
callq 0x1050
movq -0x18(%rbp), %rbx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/akw0088[P]openssl/rsa_dec.cpp
// Function: main
int main(int argc, char *argv[])
{
	unsigned char *prikey = NULL;
	unsigned int size;

	if (argc < 3)
	{
		printf("Usage: dec private_key encrypted_file\r\n");
		return -1;
	}

	prikey = (unsigned char *)get_file(argv[1], &size);
	if (prikey == NULL)
	{
		printf("Failed to open private key\r\n");
		return -1;
	}

	unsigned int encrypted_length = 0;

	unsigned char *encrypted = (unsigned char *)get_file(argv[2], &encrypted_length);

	printf("Read %d bytes of encrypted file\r\n", encrypted_length);
	unsigned char decrypted[4098]={};

	
	RSA *rsa = createRSA(prikey, false);
	int decrypted_length = RSA_private_decrypt(encrypted_length, encrypted, decrypted, rsa, RSA_PKCS1_PADDING);
	if (decrypted_length == -1)
	{
		char err[130];

		ERR_load_crypto_strings();
		ERR_error_string(ERR_get_error(), err);
		printf("ERROR: %s\n", err);
		return -1;
	}
	RSA_free(rsa);

	printf("Decrypted Text: %s\n", decrypted);
	printf("Decrypted Length: %d\n", decrypted_length);
	write_file((char *)"file.txt", (char *)decrypted, decrypted_length);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10a8, %rsp           # imm = 0x10A8
cmpl $0x2, %edi
jg 0x144c
leaq 0xca9(%rip), %rdi       # 0x20f0
jmp 0x151f
movq %rsi, %rbx
movq 0x8(%rsi), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1300
testq %rax, %rax
je 0x1518
movq %rax, %r14
leaq -0x2c(%rbp), %r15
andl $0x0, (%r15)
movq 0x10(%rbx), %rdi
movq %r15, %rsi
callq 0x1300
movq %rax, %r12
movl (%r15), %esi
leaq 0xbcf(%rip), %rdi       # 0x2058
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x1050
leaq -0x10d0(%rbp), %rdi
movl $0x1002, %edx           # imm = 0x1002
xorl %esi, %esi
callq 0x10a0
movq %r14, %rdi
xorl %esi, %esi
callq 0x127c
movq %rax, %r13
movl (%r15), %edi
pushq $0x1
popq %r8
movq %r12, %rsi
leaq -0x10d0(%rbp), %rdx
movq %rax, %rcx
callq 0x10b0
cmpl $-0x1, %eax
je 0x153b
movl %eax, %r14d
movq %r13, %rdi
callq 0x10f0
leaq 0xba3(%rip), %rdi       # 0x2085
leaq -0x10d0(%rbp), %r15
movq %r15, %rsi
xorl %eax, %eax
callq 0x1050
leaq 0xb9f(%rip), %rdi       # 0x2099
movl %r14d, %esi
xorl %eax, %eax
callq 0x1050
leaq 0xba4(%rip), %rdi       # 0x20af
movq %r15, %rsi
movl %r14d, %edx
callq 0x13ae
jmp 0x1527
leaq 0xbb5(%rip), %rdi       # 0x20d4
callq 0x1140
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x10a8, %rsp           # imm = 0x10A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x2
popq %rdi
xorl %esi, %esi
callq 0x1090
callq 0x1120
leaq -0xc0(%rbp), %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1070
leaq 0xb17(%rip), %rdi       # 0x207a
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1050
jmp 0x1524
// File: /workspace/github_cpp_makefile_star2_O2/Neurochrom[P]hours_calc/hours_calc.cpp
// Function: operator-(HourMin const&, HourMin const&)
unsigned operator-(const HourMin& hmLater, const HourMin& hmSooner)
{
   HourMin hmLater2 = hmLater;
   if (hmLater2 < hmSooner)
      hmLater2.h += 24;
   unsigned r = (hmLater2.h - hmSooner.h) * 60;
   if (hmLater2.m >= hmSooner.m)
      r += hmLater2.m - hmSooner.m;
   else
      r -= hmSooner.m - hmLater2.m;
   return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rcx
movq %rcx, %rax
shrq $0x20, %rax
movl (%rsi), %edx
cmpl %ecx, %edx
jbe 0x2525
movl 0x4(%rsi), %esi
jmp 0x253b
setae %dil
movl 0x4(%rsi), %esi
cmpl %eax, %esi
seta %r8b
andb %dil, %r8b
cmpb $0x1, %r8b
jne 0x253e
addl $0x18, %ecx
subl %edx, %ecx
imull $0x3c, %ecx, %ecx
subl %esi, %eax
addl %ecx, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Neurochrom[P]hours_calc/hours_calc.cpp
// Function: isEmptyOrWhitespace(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool isEmptyOrWhitespace(const std::string& s)
{
   for (size_t i = 0; i < s.size(); ++i)
      if (!isspace(s[i]))
         return false;
   return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %r14
movq 0x8(%rdi), %rbx
xorl %ecx, %ecx
movq %rcx, %r15
cmpq %rcx, %rbx
je 0x261a
movsbl (%r14,%r15), %edi
callq 0x2060
leaq 0x1(%r15), %rcx
testl %eax, %eax
jne 0x2600
cmpq %rbx, %r15
setae %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Neurochrom[P]hours_calc/hours_calc.cpp
// Function: lowerCase(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::string lowerCase(const std::string& s)
{
   std::string r = s;
   for (size_t i = 0; i < r.size(); ++i)
      if ((r[i] >= 'A') && (r[i] <= 'Z'))
         r[i] = (char)(r[i] - 'A' + 'a');
   return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x22f0
xorl %eax, %eax
cmpq 0x8(%rbx), %rax
jae 0x265b
movq (%rbx), %rcx
movb (%rcx,%rax), %dl
leal -0x41(%rdx), %esi
cmpb $0x19, %sil
ja 0x2656
orb $0x20, %dl
movb %dl, (%rcx,%rax)
incq %rax
jmp 0x263b
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Neurochrom[P]hours_calc/hours_calc.cpp
// Function: upperCase(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::string upperCase(const std::string& s)
{
    std::string r = s;
    for (size_t i = 0; i < r.size(); ++i)
        if ((r[i] >= 'a') && (r[i] <= 'z'))
            r[i] = (char)(r[i] - 'a' + 'A');
    return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x22f0
xorl %eax, %eax
cmpq 0x8(%rbx), %rax
jae 0x2695
movq (%rbx), %rcx
movb (%rcx,%rax), %dl
leal -0x61(%rdx), %esi
cmpb $0x19, %sil
ja 0x2690
addb $-0x20, %dl
movb %dl, (%rcx,%rax)
incq %rax
jmp 0x2675
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Neurochrom[P]hours_calc/hours_calc.cpp
// Function: expandStr(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned long)
std::string expandStr(const std::string& str, size_t size)
{
   size_t strLen = str.length();
   if (strLen >= size)
      return str;
   else
      return str + std::string(size - strLen, ' ');
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
subq 0x8(%rsi), %rdx
jbe 0x26ed
leaq -0x28(%rbp), %rax
movq %rax, -0x10(%rax)
leaq -0x38(%rbp), %r15
pushq $0x20
popq %rax
movq %r15, %rdi
movq %rdx, %rsi
movl %eax, %edx
callq 0x2260
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x42e3
leaq -0x38(%rbp), %rdi
callq 0x2120
jmp 0x26f8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x22f0
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x2120
movq %rbx, %rdi
callq 0x2390
// File: /workspace/github_cpp_makefile_star2_O2/Neurochrom[P]hours_calc/hours_calc.cpp
// Function: hoursMinsStr[abi:cxx11](unsigned int, unsigned long)
std::string hoursMinsStr(unsigned minutes, size_t size = 0)
{
   std::ostringstream oss;
   oss.precision(2);
   oss << std::fixed << minutes / 60.0 << " h";

   return expandStr(oss.str(), size);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdx, %r14
movl %esi, %r15d
movq %rdi, %rbx
leaq -0x1b8(%rbp), %r12
movq %r12, %rdi
callq 0x22e0
movq (%r12), %rax
movq -0x18(%rax), %rcx
movq $0x2, -0x1b0(%rbp,%rcx)
movq -0x18(%rax), %rax
movl $0xfffffefb, %ecx       # imm = 0xFFFFFEFB
andl -0x1a0(%rbp,%rax), %ecx
orl $0x4, %ecx
movl %ecx, -0x1a0(%rbp,%rax)
movl %r15d, %eax
cvtsi2sd %rax, %xmm0
divsd 0x3886(%rip), %xmm0     # 0x6008
movq %r12, %rdi
callq 0x2360
leaq 0x38bf(%rip), %rsi      # 0x6050
movq %rax, %rdi
callq 0x21f0
leaq -0x1b0(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x2340
leaq -0x40(%rbp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x269f
leaq -0x40(%rbp), %rdi
callq 0x2120
leaq -0x1b8(%rbp), %rdi
callq 0x20a0
movq %rbx, %rax
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x2120
jmp 0x27f3
jmp 0x27f0
movq %rax, %rbx
leaq -0x1b8(%rbp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x2390
// File: /workspace/github_cpp_makefile_star2_O2/Neurochrom[P]hours_calc/hours_calc.cpp
// Function: splitIntoTokens(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char const*, char const*)
std::vector<std::string> splitIntoTokens(const std::string& s, const char* separators, const char* incSeparators="")
{
   std::vector<std::string> r;
   std::string ss = s;
   for(;;)
   {
      size_t i = ss.find_first_of(separators);
      size_t ii = ss.find_first_of(incSeparators);
      assert( ii == std::string::npos || ii!=i );
      if(ii<i && ii>0)
      {
         assert(ii!=std::string::npos);
         std::string x = ss.substr(0, ii);
         if (!x.empty())
            r.push_back(x);
         ss = ss.substr(ii);
      }
      else if (i == std::string::npos)
      {
         if (!ss.empty())
            r.push_back(ss);
         break;
      }
      else
      {
         std::string x = ss.substr(0, i);
         if (!x.empty())
            r.push_back(x);
         ss = ss.substr(i + 1);
      }
   }
   return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, -0x40(%rbp)
movq %rdx, -0x38(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rdi, -0x30(%rbp)
andq $0x0, 0x10(%rdi)
leaq -0x60(%rbp), %rdi
callq 0x22f0
leaq -0x60(%rbp), %r12
leaq -0x80(%rbp), %r13
leaq -0xa0(%rbp), %rbx
movq %r12, %rdi
movq -0x38(%rbp), %rsi
xorl %edx, %edx
callq 0x2140
movq %rax, %r14
movq %r12, %rdi
movq -0x40(%rbp), %rsi
xorl %edx, %edx
callq 0x2140
movq %rax, %r15
cmpq $-0x1, %rax
sete %al
cmpq %r14, %r15
setne %cl
orb %al, %cl
je 0x2953
cmpq %r14, %r15
setae %al
testq %r15, %r15
sete %cl
orb %al, %cl
jne 0x28c4
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
movq %r15, %rcx
callq 0x2210
cmpq $0x0, -0x78(%rbp)
je 0x28b1
movq -0x30(%rbp), %rdi
movq %r13, %rsi
callq 0x4312
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
pushq $-0x1
popq %rcx
callq 0x2210
jmp 0x2901
cmpq $-0x1, %r14
je 0x2921
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
movq %r14, %rcx
callq 0x2210
cmpq $0x0, -0x78(%rbp)
je 0x28ed
movq -0x30(%rbp), %rdi
movq %r13, %rsi
callq 0x4312
incq %r14
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
pushq $-0x1
popq %rcx
callq 0x2210
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2290
movq %rbx, %rdi
callq 0x2120
movq %r13, %rdi
callq 0x2120
jmp 0x2847
cmpq $0x0, -0x58(%rbp)
movq -0x30(%rbp), %rbx
je 0x2938
leaq -0x60(%rbp), %rsi
movq %rbx, %rdi
callq 0x4312
leaq -0x60(%rbp), %rdi
callq 0x2120
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x36f9(%rip), %rdi      # 0x6053
leaq 0x3713(%rip), %rsi      # 0x6074
leaq 0x371b(%rip), %rcx      # 0x6083
movl $0x82, %edx
callq 0x2180
jmp 0x298f
movq %rax, %rbx
jmp 0x299b
jmp 0x2981
jmp 0x2981
jmp 0x2981
jmp 0x298f
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x2120
jmp 0x2992
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x2120
movq -0x30(%rbp), %rdi
callq 0x434e
movq %rbx, %rdi
callq 0x2390