// File: /workspace/github_cpp_makefile_star2_O3/jorbs[P]stellar-keypair-tool/keypair.cpp
// Function: process(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool (*)(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&))
void process(const std::string &term, bool (*matches)(const std::string &input, const std::string &suffix)) {
  std::vector<uint8_t> pk(crypto_sign_PUBLICKEYBYTES);
  std::vector<uint8_t> sk(crypto_sign_SECRETKEYBYTES);

  for (;!found; count++) {
    crypto_sign_keypair(pk.data(), sk.data());

    std::string encodedPk = encode(PUBLIC_KEY, pk);

    if (matches(encodedPk, term)) {
      std::vector<uint8_t> seed(crypto_sign_SEEDBYTES);

      crypto_sign_ed25519_sk_to_seed(seed.data(), sk.data());

      if (!found) {
        found = true;
        std::cout << "FOUND!\n\n"
                  << encodedPk << std::endl
                  << encode(SEED, seed) << "\n\n\a";
      }

      break;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r14
movq %rdi, %r15
movl $0x20, %edi
callq 0x2170
movq %rax, %rbp
movq %rax, 0x8(%rsp)
addq $0x20, %rax
movq %rax, 0x18(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%rbp)
movups %xmm0, 0x10(%rbp)
movq %rax, 0x10(%rsp)
movl $0x40, %edi
callq 0x2170
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movb 0x3a71(%rip), %al       # 0x61b8
testb $0x1, %al
jne 0x28dc
leaq 0x58(%rsp), %r12
movq 0x8(%rsp), %rbp
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x2120
movb $0x30, 0x20(%rsp)
movq %r12, %rdi
leaq 0x20(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x2533
movq %r12, %rdi
movq %r15, %rsi
callq *%r14
movl %eax, %ebp
testb %al, %al
je 0x28a6
movl $0x20, %edi
callq 0x2170
movq %rax, 0x40(%rsp)
movq %rax, %rcx
addq $0x20, %rcx
movq %rcx, 0x50(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %rcx, 0x48(%rsp)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x21e0
movb 0x39ef(%rip), %al       # 0x61b8
testb $0x1, %al
jne 0x288f
movb $0x1, %al
xchgb %al, 0x39df(%rip)       # 0x61b8
movl $0x8, %edx
movq 0x37eb(%rip), %rdi      # 0x5fd0
leaq 0x18da(%rip), %rsi      # 0x40c6
callq 0x21b0
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
movq 0x37ce(%rip), %rdi      # 0x5fd0
callq 0x21b0
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20e0
movq %rax, %r13
movb $-0x70, 0x7(%rsp)
leaq 0x20(%rsp), %rdi
leaq 0x7(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x2533
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq %r13, %rdi
callq 0x21b0
movl $0x3, %edx
movq %rax, %rdi
leaq 0x1861(%rip), %rsi      # 0x40cf
callq 0x21b0
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x288f
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2180
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x28a6
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x28c2
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x2180
testb %bpl, %bpl
jne 0x28dc
lock
incl 0x38ee(%rip)            # 0x61bc
movb 0x38e4(%rip), %al       # 0x61b8
testb $0x1, %al
je 0x2754
movl $0x40, %esi
movq %rbx, %rdi
callq 0x2180
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x2900
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x2998
jmp 0x294b
jmp 0x293c
movq %rax, %r14
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x294e
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2180
jmp 0x294e
movq %rax, %r14
jmp 0x2965
movq %rax, %r14
jmp 0x2986
movq %rax, %r14
jmp 0x2981
movq %rax, %r14
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x2965
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x2981
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x2180
movq 0x8(%rsp), %rbp
movl $0x40, %esi
movq %rbx, %rdi
callq 0x2180
testq %rbp, %rbp
je 0x29a8
movq 0x18(%rsp), %rsi
subq %rbp, %rsi
movq %rbp, %rdi
callq 0x2180
movq %r14, %rdi
callq 0x2290