// File: /workspace/github_cpp_makefile_star2_O1/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 $0x88, %rsp
movq %rsi, %r14
movq %rdi, %r15
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movl $0x20, %edi
callq 0x2170
movq %rax, 0x10(%rsp)
movq %rax, 0x18(%rsp)
leaq 0x20(%rax), %rcx
movq %rcx, 0x20(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movq %rcx, 0x18(%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 0x3a4b(%rip), %al       # 0x61b8
testb $0x1, %al
jne 0x2915
leaq 0x68(%rsp), %r12
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x2120
movb $0x30, 0x48(%rsp)
movq %r12, %rdi
leaq 0x48(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x2544
movq %r12, %rdi
movq %r15, %rsi
callq *%r14
movl %eax, %ebp
testb %al, %al
je 0x28df
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movl $0x20, %edi
callq 0x2170
movq %rax, 0x30(%rsp)
movq %rax, 0x38(%rsp)
movq %rax, %rcx
addq $0x20, %rcx
movq %rcx, 0x40(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %rcx, 0x38(%rsp)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x21e0
movb 0x39b6(%rip), %al       # 0x61b8
testb $0x1, %al
jne 0x28c8
movb $0x1, %al
xchgb %al, 0x39a6(%rip)       # 0x61b8
movl $0x8, %edx
movq 0x37b2(%rip), %rdi      # 0x5fd0
leaq 0x18a1(%rip), %rsi      # 0x40c6
callq 0x21b0
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq 0x3795(%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, 0xf(%rsp)
leaq 0x48(%rsp), %rdi
leaq 0xf(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0x2544
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq %r13, %rdi
callq 0x21b0
movl $0x3, %edx
movq %rax, %rdi
leaq 0x1828(%rip), %rsi      # 0x40cf
callq 0x21b0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x28c8
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2180
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x28df
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x28fb
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2180
testb %bpl, %bpl
jne 0x2915
lock
incl 0x38b5(%rip)            # 0x61bc
movb 0x38ab(%rip), %al       # 0x61b8
testb $0x1, %al
je 0x277a
movl $0x40, %esi
movq %rbx, %rdi
callq 0x2180
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2939
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x29c4
jmp 0x2981
jmp 0x2975
movq %rax, %r14
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x2984
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2180
jmp 0x2984
movq %rax, %r14
jmp 0x299b
jmp 0x297c
movq %rax, %r14
jmp 0x29b7
movq %rax, %r14
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x299b
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x29b7
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2180
movl $0x40, %esi
movq %rbx, %rdi
callq 0x2180
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x29db
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq %r14, %rdi
callq 0x2290