// File: SMT-COMP[P]scrambler/scrambler.cpp
// Function: parse_core(std::istream&, std::unordered_set<std::string, std::hash<std::string>, std::equal_to<std::string>, std::allocator<std::string>>&)
bool parse_core(std::istream &src, StringSet &out)
{
    std::string name;
    src >> name;
    if (!src || name != "unsat") {
        return false;
    }
    // skip chars until a '(' is found
    char c;
    while (src.get(c) && c != '(') {
        if (!isspace(c)) {
            return false;
        }
    }
    if (!src) {
        return false;
    }
    bool done = false;
    while (src && !done) {
        src >> name;
        if (name.empty()) {
            return false;
        }
        if (name[name.size()-1] == ')') {
            name = name.substr(0, name.size()-1);
            done = true;
        }
        if (!name.empty()) {
            out.insert(name);
        }
    }

    std::vector<std::string> outnames(out.begin(), out.end());
    std::sort(outnames.begin(), outnames.end());

    std::cout << ";; parsed " << outnames.size() << " names:";
    for (size_t i = 0; i < outnames.size(); ++i) {
        std::cout << " " << outnames[i];
    }
    std::cout << std::endl;

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
leaq -0x20(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0x3210
movq -0xa0(%rbp), %rsi
movq -0x10(%rbp), %rdi
callq 0x3110
jmp 0x5715
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3120
movb %al, -0xa1(%rbp)
jmp 0x5730
movb -0xa1(%rbp), %al
testb $0x1, %al
jne 0x5760
jmp 0x573c
leaq 0x13c47(%rip), %rsi     # 0x1938a
leaq -0x20(%rbp), %rdi
callq 0x77c0
movb %al, -0xa2(%rbp)
jmp 0x5754
movb -0xa2(%rbp), %al
testb $0x1, %al
jne 0x5760
jmp 0x5781
movb $0x0, -0x1(%rbp)
movl $0x1, -0x30(%rbp)
jmp 0x5b3d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x5b54
jmp 0x5783
movq -0x10(%rbp), %rdi
leaq -0x31(%rbp), %rsi
callq 0x3350
movq %rax, -0xb0(%rbp)
jmp 0x5799
movq -0xb0(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3300
movb %al, -0xb1(%rbp)
jmp 0x57b7
movb -0xb1(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0xb2(%rbp)
jne 0x57cc
jmp 0x57dc
movsbl -0x31(%rbp), %eax
cmpl $0x28, %eax
setne %al
movb %al, -0xb2(%rbp)
movb -0xb2(%rbp), %al
testb $0x1, %al
jne 0x57e8
jmp 0x580b
movsbl -0x31(%rbp), %edi
callq 0x3040
cmpl $0x0, %eax
jne 0x5806
movb $0x0, -0x1(%rbp)
movl $0x1, -0x30(%rbp)
jmp 0x5b3d
jmp 0x5783
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3120
movb %al, -0xb3(%rbp)
jmp 0x5826
movb -0xb3(%rbp), %al
testb $0x1, %al
jne 0x5832
jmp 0x5842
movb $0x0, -0x1(%rbp)
movl $0x1, -0x30(%rbp)
jmp 0x5b3d
movb $0x0, -0x32(%rbp)
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3300
movb %al, -0xb4(%rbp)
jmp 0x5861
movb -0xb4(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0xb5(%rbp)
jne 0x5876
jmp 0x5881
movb -0x32(%rbp), %al
xorb $-0x1, %al
movb %al, -0xb5(%rbp)
movb -0xb5(%rbp), %al
testb $0x1, %al
jne 0x5890
jmp 0x5980
movq -0x10(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x3110
jmp 0x589f
leaq -0x20(%rbp), %rdi
callq 0x34f0
testb $0x1, %al
jne 0x58ae
jmp 0x58be
movb $0x0, -0x1(%rbp)
movl $0x1, -0x30(%rbp)
jmp 0x5b3d
leaq -0x20(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x33c0
movq -0xc8(%rbp), %rdi
movq %rax, %rsi
decq %rsi
callq 0x30e0
movq %rax, -0xc0(%rbp)
jmp 0x58e9
movq -0xc0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x29, %eax
jne 0x593e
leaq -0x20(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x33c0
movq -0xd0(%rbp), %rsi
movq %rax, %rcx
decq %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0x40(%rbp), %rdi
callq 0x3450
jmp 0x5924
leaq -0x20(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x31b0
leaq -0x40(%rbp), %rdi
callq 0x3518
movb $0x1, -0x32(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x34f0
testb $0x1, %al
jne 0x597b
movq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x77f0
movb %dl, -0xd9(%rbp)
movq %rax, -0xd8(%rbp)
jmp 0x5967
movb -0xd9(%rbp), %al
movq -0xd8(%rbp), %rcx
movq %rcx, -0x50(%rbp)
movb %al, -0x48(%rbp)
jmp 0x5846
movq -0x18(%rbp), %rdi
callq 0x7830
movq %rax, -0x70(%rbp)
movq -0x18(%rbp), %rdi
callq 0x7860
movq %rax, -0x78(%rbp)
leaq -0x79(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x7890
movq -0xe8(%rbp), %rcx
movq -0x70(%rbp), %rsi
movq -0x78(%rbp), %rdx
leaq -0x68(%rbp), %rdi
callq 0x78b0
jmp 0x59c4
leaq -0x79(%rbp), %rdi
callq 0x7930
leaq -0x68(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0x7990
movq -0xf0(%rbp), %rdi
movq %rax, -0x88(%rbp)
callq 0x79c0
movq %rax, -0x90(%rbp)
movq -0x88(%rbp), %rdi
movq -0x90(%rbp), %rsi
callq 0x7950
jmp 0x5a0c
movq 0x205a5(%rip), %rdi     # 0x25fb8
leaq 0x13976(%rip), %rsi     # 0x19390
callq 0x3260
movq %rax, -0xf8(%rbp)
jmp 0x5a28
leaq -0x68(%rbp), %rdi
callq 0x79f0
movq -0xf8(%rbp), %rdi
movq %rax, %rsi
callq 0x3090
movq %rax, -0x100(%rbp)
jmp 0x5a49
movq -0x100(%rbp), %rdi
leaq 0x13944(%rip), %rsi     # 0x1939b
callq 0x3260
jmp 0x5a5e
movq $0x0, -0x98(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x108(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x79f0
movq %rax, %rcx
movq -0x108(%rbp), %rax
cmpq %rcx, %rax
jae 0x5b14
movq 0x2051e(%rip), %rdi     # 0x25fb8
leaq 0x1557c(%rip), %rsi     # 0x1b01d
callq 0x3260
movq %rax, -0x110(%rbp)
jmp 0x5aaf
movq -0x98(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x7a10
movq -0x110(%rbp), %rdi
movq %rax, %rsi
callq 0x3310
jmp 0x5ad0
jmp 0x5ad2
movq -0x98(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x98(%rbp)
jmp 0x5a69
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x79(%rbp), %rdi
callq 0x7930
jmp 0x5b54
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x7a30
jmp 0x5b54
movq 0x2049d(%rip), %rdi     # 0x25fb8
movq 0x2047e(%rip), %rsi     # 0x25fa0
callq 0x3280
jmp 0x5b29
movb $0x1, -0x1(%rbp)
movl $0x1, -0x30(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x7a30
leaq -0x20(%rbp), %rdi
callq 0x3518
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
leaq -0x20(%rbp), %rdi
callq 0x3518
movq -0x28(%rbp), %rdi
callq 0x3460
nopw %cs:(%rax,%rax)