LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/Shenggan[P]SnowFlake/test/../SnowFlake.h
// Function: SnowFlake::nextId()
uint64_t nextId() {
        std::unique_lock<std::mutex> lock(mutex_);
        uint64_t currStmp = getNewstmp();
        if (currStmp < lastStmp) {
            LLOG(ERRO) << "Clock moved backwards.  Refusing to generate id";
            exit(0);
        }

        if (currStmp == lastStmp) {
            sequence = (sequence + 1) & max_sequence_num_;
            if (sequence == 0) {
                currStmp = getNextMill();
            }
        } else {
            sequence = 0;
        }
        lastStmp = currStmp;
        return (currStmp - start_stmp_) << timestmp_left
                | datacenterId << datacenter_left
                | machineId << machine_left
                | sequence;
    }

// Assembly:
pushq %rbx
subq $0xc0, %rsp
movq %rdi, %rbx
leaq 0x20(%rdi), %rsi
leaq 0x10(%rsp), %rdi
callq 0x3692
movq %rbx, %rdi
callq 0x36a8
cmpq 0x18(%rbx), %rax
jb 0x2a60
jne 0x2a16
movl 0x10(%rbx), %ecx
incl %ecx
andl $0xfff, %ecx            # imm = 0xFFF
movq %rcx, 0x10(%rbx)
jne 0x2a1d
movq %rbx, %rdi
callq 0x375c
movq 0x10(%rbx), %rcx
jmp 0x2a1d
andq $0x0, 0x10(%rbx)
xorl %ecx, %ecx
movq %rax, 0x18(%rbx)
shlq $0x16, %rax
movabsq $-0x562832f817c00000, %rdx # imm = 0xA9D7CD07E8400000
addq %rax, %rdx
movq (%rbx), %rax
movq 0x8(%rbx), %rbx
shlq $0x11, %rax
orq %rdx, %rax
shlq $0xc, %rbx
orq %rcx, %rbx
orq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3772
movq %rbx, %rax
addq $0xc0, %rsp
popq %rbx
retq
callq 0x26e6
cmpl $0x2, (%rax)
jg 0x2af7
leaq 0x162e(%rip), %rsi      # 0x40a3
leaq 0x40(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x2764
leaq 0x162c(%rip), %rsi      # 0x40b7
leaq 0x20(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x2764
leaq 0x60(%rsp), %rdi
pushq $0x2
popq %rsi
leaq 0x40(%rsp), %rdx
leaq 0x20(%rsp), %rcx
pushq $0x43
popq %r8
callq 0x27a0
leaq 0x1602(%rip), %rsi      # 0x40be
leaq 0x60(%rsp), %rdi
callq 0x36d8
movq %rax, %rbx
callq 0x26e6
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2b42
leaq 0x60(%rsp), %rdi
callq 0x2c2c
leaq 0x20(%rsp), %rdi
callq 0x2080
leaq 0x40(%rsp), %rdi
callq 0x2080
xorl %edi, %edi
callq 0x21d0
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x2c2c
jmp 0x2b10
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x2080
jmp 0x2b1f
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x2080
jmp 0x2b30
jmp 0x2b2d
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3772
movq %rbx, %rdi
callq 0x22a0
// File: /workspace/github_cpp_makefile_star2_O2/Shenggan[P]SnowFlake/test/../utils/lightlog.h
// Function: llog::Logger::operator+=(llog::Message const&)
void operator+=(const Message& m)
    {
        mtx_.lock();
        if (console_)
            std::cout << m.get_string() + '\n';
        if (file_)
            log_file << m.get_string(false) + '\n';
        mtx_.unlock();
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x4648(%rip), %rdi      # 0x71a0
callq 0x2e6e
cmpb $0x1, 0x4(%rbx)
jne 0x2ba7
leaq 0x20(%r14), %rsi
leaq 0x40(%r14), %rdx
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x37f9
movq %rsp, %rdi
pushq $0xa
popq %rdx
movq %r15, %rsi
callq 0x37d7
movq 0x444b(%rip), %rdi      # 0x6fd8
movq %rsp, %rsi
callq 0x2140
movq %rsp, %rdi
callq 0x2080
leaq 0x20(%rsp), %rdi
callq 0x2080
cmpb $0x1, 0x5(%rbx)
jne 0x2bf0
leaq 0x40(%r14), %rdx
leaq 0x20(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x37f9
movq %rsp, %rdi
pushq $0xa
popq %rdx
movq %r15, %rsi
callq 0x37d7
addq $0x8, %rbx
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x2140
movq %rsp, %rdi
callq 0x2080
leaq 0x20(%rsp), %rdi
callq 0x2080
leaq 0x45a9(%rip), %rdi      # 0x71a0
callq 0x2100
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x2c0a
jmp 0x2c17
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2080
jmp 0x2c1a
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x22a0
// File: /workspace/github_cpp_makefile_star2_O2/Shenggan[P]SnowFlake/test/../utils/lightlog.h
// Function: llog::Logger::init_log_file(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void init_log_file(std::string log_file_name = "output.log") {
        if (file_ == true)
            log_file.close();
        log_file.open(log_file_name);
        file_ = true;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x1, 0x5(%rdi)
jne 0x2c65
leaq 0x8(%rbx), %rdi
callq 0x2220
leaq 0x8(%rbx), %rdi
pushq $0x10
popq %rdx
movq %r14, %rsi
callq 0x2090
movb $0x1, 0x5(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/Shenggan[P]SnowFlake/test/../utils/lightlog.h
// Function: llog::Logger::Logger()
Logger() {
        if (getenv("LLOG_LV") == NULL)
            m_level_ = LOG_LEVEL_INFO;
        else{
            std::string ev_level = getenv("LLOG_LV");
            if (ev_level == "WARN")
                m_level_ = LOG_LEVEL_WARNING;
            else if (ev_level == "ERRO")
                m_level_ = LOG_LEVEL_ERROR;
            else
                m_level_ = LOG_LEVEL_INFO;
        }
        console_ = true;
        file_ = false;
    }

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
movq %r14, %rdi
callq 0x2280
leaq 0x1191(%rip), %rdi      # 0x4030
callq 0x21e0
testq %rax, %rax
je 0x2ed5
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
movq %rax, %rsi
callq 0x2764
leaq 0x1176(%rip), %rsi      # 0x4038
leaq 0x8(%rsp), %rdi
callq 0x2f5c
testb %al, %al
je 0x2eda
pushq $0x1
popq %rax
jmp 0x2ef0
andl $0x0, (%rbx)
jmp 0x2efc
leaq 0x115c(%rip), %rsi      # 0x403d
leaq 0x8(%rsp), %rdi
callq 0x2f5c
movzbl %al, %eax
addl %eax, %eax
movl %eax, (%rbx)
leaq 0x8(%rsp), %rdi
callq 0x2080
movw $0x1, 0x4(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x2240
movq %rbx, %rdi
callq 0x22a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Shenggan[P]SnowFlake/test/../utils/lightlog.h
// Function: llog::Message::colorStr(int, int, 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&, bool)
std::string colorStr(int color, int bold, const std::string & delimiter, const std::string & t, bool if_color = true) {
        std::stringstream ss;
        if (if_color)
            ss << "\033[" << bold << ";" << color << "m";
        ss << t;
        if (if_color)
            ss << "\033[0m";
        ss << delimiter;
		return ss.str();
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %r9, %r15
movq %r8, %r14
movl %ecx, %r12d
movl %edx, %ebp
movq %rdi, %rbx
movb 0x1c0(%rsp), %r13b
movq %rsp, %rdi
callq 0x20c0
testb %r13b, %r13b
je 0x346a
leaq 0x10(%rsp), %rdi
leaq 0xc3d(%rip), %rsi       # 0x406f
callq 0x2170
movq %rax, %rdi
movl %r12d, %esi
callq 0x2290
leaq 0xc29(%rip), %rsi       # 0x4072
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
movl %ebp, %esi
callq 0x2290
leaq 0xc15(%rip), %rsi       # 0x4077
movq %rax, %rdi
callq 0x2170
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x2140
testb %r13b, %r13b
je 0x348e
leaq 0xbee(%rip), %rsi       # 0x4074
movq %r12, %rdi
callq 0x2170
movq %r12, %rdi
movq %r14, %rsi
callq 0x2140
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x2260
movq %rsp, %rdi
callq 0x20f0
movq %rbx, %rax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x22a0
// File: /workspace/github_cpp_makefile_star2_O2/Shenggan[P]SnowFlake/test/../SnowFlake.h
// Function: SnowFlake::getNewstmp()
uint64_t getNewstmp() {
        struct timeval tv;
        gettimeofday(&tv, NULL);

        uint64_t time = tv.tv_usec;
        time /= 1000;
        time += (tv.tv_sec * 1000);
        return time;
    }

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsp, %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2270
movq 0x8(%rbx), %rax
movl $0x3e8, %ecx            # imm = 0x3E8
xorl %edx, %edx
divq %rcx
imulq $0x3e8, (%rbx), %rcx    # imm = 0x3E8
addq %rcx, %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/Shenggan[P]SnowFlake/test/../SnowFlake.h
// Function: SnowFlake::getNextMill()
uint64_t getNextMill() {
        uint64_t mill = getNewstmp();
        while (mill <= lastStmp) {
            mill = getNewstmp();
        }
        return mill;
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x36a8
cmpq 0x18(%rbx), %rax
ja 0x3770
movq %rbx, %rdi
jmp 0x3760
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/YerevaNN[P]pmi/pmi.cpp
// Function: model::clear()
void model::clear() {
    locked = false;
    dictionary.clear();
    words.clear();
    unlockedCount.clear();
    lockedCount.clear();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movb $0x0, (%rdi)
addq $0x8, %rdi
callq 0x2746
leaq 0x40(%rbx), %rdi
callq 0x2eb4
leaq 0x58(%rbx), %rdi
callq 0x2644
movq 0x90(%rbx), %rax
cmpq %rax, 0x98(%rbx)
je 0x28c9
movq %rax, 0x98(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/YerevaNN[P]pmi/pmi.cpp
// Function: model::count(unsigned long, unsigned long) const
occurences model::count(ngram x, ngram y) const {
    if(x > y) {
        std::swap(x, y);
    }
    if(locked) {
        auto key = std::make_pair((pair(x) << (3 * 21)) | pair(y), occurences(0));
        auto I = std::lower_bound(lockedCount.begin(), lockedCount.end(), key);
        if(I == lockedCount.end() ||
           I->first != key.first) {
            report("%d %d %llx %llx %llx %llx\n", I == lockedCount.end() , I->first != key.first,
                   uint64(I->first >> 64),
                   uint64((I->first << 64) >> 64),
                   uint64(key.first >> 64),
                   uint64((key.first << 64) >> 64)
                   );
            return 0;
        }
        return I->second;
    } else {
        return unlockedCount.at((pair(x) << (3 * 21)) | pair(y));
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
cmpq %rdx, %rsi
movq %rdx, %rax
cmovaq %rsi, %rax
cmovbq %rsi, %rdx
cmpb $0x1, (%rdi)
jne 0x294f
movq %rdx, %rcx
shrq %rcx
shlq $0x3f, %rdx
orq %rax, %rdx
movq %rsp, %r14
movq %rcx, 0x8(%r14)
movq %rdx, (%r14)
andl $0x0, 0x10(%r14)
movq 0x90(%rbx), %rdi
movq 0x98(%rbx), %rsi
movq %r14, %rdx
callq 0x2f17
movq 0x98(%rbx), %rcx
movq (%rax), %r9
movq 0x8(%rax), %r8
movq (%r14), %r11
movq 0x8(%r14), %r10
cmpq %rcx, %rax
je 0x297e
movq %r9, %rdx
xorq %r11, %rdx
movq %r8, %rsi
xorq %r10, %rsi
orq %rdx, %rsi
jne 0x297e
movl 0x10(%rax), %ebx
jmp 0x2974
addq $0x58, %rbx
movq %rdx, %rcx
shrq %rcx
shlq $0x3f, %rdx
orq %rax, %rdx
movq %rsp, %rsi
movq %rcx, 0x8(%rsi)
movq %rdx, (%rsi)
movq %rbx, %rdi
callq 0x2fa2
movl (%rax), %ebx
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
xorl %edx, %edx
cmpq %rcx, %rax
sete %dl
movq 0x763b(%rip), %r14      # 0x9fc8
movq (%r14), %rdi
movq %r9, %rax
xorq %r11, %rax
movq %r8, %rsi
xorq %r10, %rsi
xorl %ecx, %ecx
orq %rax, %rsi
setne %cl
leaq 0x366f(%rip), %rsi      # 0x601a
xorl %ebx, %ebx
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x21a0
popq %rcx
popq %rdx
movq (%r14), %rdi
callq 0x2130
jmp 0x2974
// File: /workspace/github_cpp_makefile_star2_O2/YerevaNN[P]pmi/pmi.cpp
// Function: model::lock()
void model::lock() {
    if(locked) {
        return;
    }
    report("Locking...");
    lockedCount.clear();
    while(!unlockedCount.empty()) {
        lockedCount.push_back(*unlockedCount.begin());
        unlockedCount.erase(unlockedCount.begin());
    }
    report("Indexing...");
    std::sort(lockedCount.begin(), lockedCount.end());
    locked = true;
    report("Done\n");
    return;
}

// Assembly:
cmpb $0x0, (%rdi)
je 0x29ca
retq
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movq 0x75e7(%rip), %r13      # 0x9fc8
movq (%r13), %rcx
leaq 0x3649(%rip), %rdi      # 0x6035
pushq $0xa
popq %rsi
pushq $0x1
popq %rdx
callq 0x2220
movq (%r13), %rdi
callq 0x2130
movq 0x90(%rbx), %rax
cmpq %rax, 0x98(%rbx)
je 0x2a17
movq %rax, 0x98(%rbx)
leaq 0x90(%rbx), %r14
leaq 0x58(%rbx), %r15
movq %rsp, %r12
cmpq $0x0, 0x70(%rbx)
je 0x2a61
movq 0x68(%rbx), %rax
movq 0x10(%rax), %rcx
movq 0x18(%rax), %rdx
movq %rcx, (%rsp)
movq %rdx, 0x8(%rsp)
movl 0x20(%rax), %eax
movl %eax, 0x10(%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x306c
movq 0x68(%rbx), %rsi
movq %r15, %rdi
callq 0x31e8
jmp 0x2a25
movq (%r13), %rcx
leaq 0x35d4(%rip), %rdi      # 0x6040
pushq $0xb
popq %rsi
pushq $0x1
popq %r14
movq %r14, %rdx
callq 0x2220
movq (%r13), %rdi
callq 0x2130
movq 0x90(%rbx), %rdi
movq 0x98(%rbx), %rsi
callq 0x32ea
movb $0x1, (%rbx)
movq (%r13), %rcx
leaq 0x35a7(%rip), %rdi      # 0x604c
pushq $0x5
popq %rsi
movq %r14, %rdx
callq 0x2220
movq (%r13), %rdi
callq 0x2130
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/YerevaNN[P]pmi/pmi.cpp
// Function: model::unlock()
void model::unlock() {
    if(!locked) {
        return;
    }
    report("Unlocking...");
    while(!lockedCount.empty()) {
        unlockedCount.insert(lockedCount.back());
        lockedCount.pop_back();
    }
    locked = false;
    report("Done\n");
    return;
}

// Assembly:
cmpb $0x1, (%rdi)
je 0x2ace
retq
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x74eb(%rip), %r15      # 0x9fc8
movq (%r15), %rcx
leaq 0x356b(%rip), %rdi      # 0x6052
pushq $0xc
popq %rsi
pushq $0x1
popq %rdx
callq 0x2220
movq (%r15), %rdi
callq 0x2130
leaq 0x58(%rbx), %r14
movq 0x98(%rbx), %rsi
cmpq %rsi, 0x90(%rbx)
je 0x2b2e
addq $-0x20, %rsi
movq %r14, %rdi
callq 0x39ca
movq 0x98(%rbx), %rsi
addq $-0x20, %rsi
movq %rsi, 0x98(%rbx)
jmp 0x2b05
movb $0x0, (%rbx)
movq (%r15), %rcx
leaq 0x3511(%rip), %rdi      # 0x604c
pushq $0x5
popq %rsi
pushq $0x1
popq %rdx
callq 0x2220
movq (%r15), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2130
nop
// File: /workspace/github_cpp_makefile_star2_O2/YerevaNN[P]pmi/pmi.cpp
// Function: model::dump(std::ostream&)
void model::dump(std::ostream& out){
    lock();
    
    report("Dumping...");
    report("\b\b\b Dictionary...");
    size dictionarySize = words.size();
    out.write((const char*)&dictionarySize, sizeof(dictionarySize));
    for(auto w : words) {
        std::string s = w;
        s.resize(wordMaxLength, 0);
        out.write(s.c_str(), wordMaxLength);
    }
    report("\b\b\b Matrix...");
    size matrixSize = lockedCount.size();
    out.write((const char *)&matrixSize, sizeof(matrixSize));
    for(auto i : lockedCount) {
        pair key = i.first;
        out.write((const char*)&key, sizeof(key));
        occurences val = i.second;
        out.write((const char*)&val, sizeof(val));
    }
    report("Done\n");
    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
movq %rdi, %r12
callq 0x29c4
movq 0x7454(%rip), %r14      # 0x9fc8
movq (%r14), %rcx
leaq 0x34e1(%rip), %rdi      # 0x605f
pushq $0xa
popq %rsi
pushq $0x1
popq %r15
movq %r15, %rdx
callq 0x2220
movq (%r14), %rdi
callq 0x2130
movq (%r14), %rcx
leaq 0x34cb(%rip), %rdi      # 0x606a
pushq $0x11
popq %rsi
movq %r15, %rdx
callq 0x2220
movq (%r14), %rdi
callq 0x2130
movq 0x48(%r12), %rax
subq 0x40(%r12), %rax
sarq $0x5, %rax
leaq 0x50(%rsp), %rsi
movq %rax, (%rsi)
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0x2170
movq 0x40(%r12), %r15
movq %r12, 0x8(%rsp)
movq 0x48(%r12), %r14
leaq 0x10(%rsp), %r12
leaq 0x30(%rsp), %r13
pushq $0x40
popq %rbp
cmpq %r14, %r15
je 0x2c3d
movq %r12, %rdi
movq %r15, %rsi
callq 0x2190
movq %r13, %rdi
movq %r12, %rsi
callq 0x2190
movq %r13, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x2050
movq 0x30(%rsp), %rsi
movq %rbx, %rdi
movq %rbp, %rdx
callq 0x2170
movq %r13, %rdi
callq 0x20a0
movq %r12, %rdi
callq 0x20a0
addq $0x20, %r15
jmp 0x2bef
movq 0x7384(%rip), %r14      # 0x9fc8
movq (%r14), %rcx
leaq 0x342e(%rip), %rdi      # 0x607c
pushq $0xd
popq %rsi
pushq $0x1
popq %rdx
callq 0x2220
movq (%r14), %rdi
callq 0x2130
movq 0x8(%rsp), %r14
movq 0x98(%r14), %rax
subq 0x90(%r14), %rax
sarq $0x5, %rax
leaq 0x30(%rsp), %rsi
movq %rax, (%rsi)
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0x2170
movq 0x90(%r14), %rbp
movq 0x98(%r14), %r14
leaq 0x4(%rsp), %r12
pushq $0x4
popq %r13
cmpq %r14, %rbp
je 0x2cdd
movaps (%rbp), %xmm0
movl 0x10(%rbp), %r15d
movaps %xmm0, 0x10(%rsp)
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
pushq $0x10
popq %rdx
callq 0x2170
movl %r15d, 0x4(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x2170
addq $0x20, %rbp
jmp 0x2ca2
movq 0x72e4(%rip), %rbx      # 0x9fc8
movq (%rbx), %rcx
leaq 0x335e(%rip), %rdi      # 0x604c
pushq $0x5
popq %rsi
pushq $0x1
popq %rdx
callq 0x2220
movq (%rbx), %rdi
callq 0x2130
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x2d22
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x20a0
leaq 0x10(%rsp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x2210
// File: /workspace/github_cpp_makefile_star2_O2/YerevaNN[P]pmi/pmi.cpp
// Function: model::load(std::istream&)
void model::load(std::istream& in) {
    clear();
    lock();
    
    report("Loading...");
    
    size dictionarySize;
    in.read((char*)&dictionarySize, sizeof(dictionarySize));
    for(word i = 0; i < dictionarySize; ++i) {
        char s[wordMaxLength];
        in.read(s, wordMaxLength);
        std::string w(s);
        dictionary[w] = i;
        words.push_back(w);
    }
    size matrixSize;
    in.read((char*)&matrixSize, sizeof(matrixSize));
    for(size i = 0; i < matrixSize; ++i) {
        pair key;
        in.read((char*)&key, sizeof(key));
        occurences val;
        in.read((char*)&val, sizeof(val));
        lockedCount.push_back(std::make_pair(key, val));
    }
    report("Done\n");
    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %rbx
movq %rdi, %r12
callq 0x2890
movq %r12, %rdi
callq 0x29c4
movq 0x7269(%rip), %r14      # 0x9fc8
movq (%r14), %rcx
leaq 0x3321(%rip), %rdi      # 0x608a
pushq $0xa
popq %rsi
pushq $0x1
popq %rdx
callq 0x2220
movq (%r14), %rdi
callq 0x2130
leaq 0x18(%rsp), %rsi
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0x2140
leaq 0x8(%r12), %r15
movq %r12, 0x8(%rsp)
addq $0x40, %r12
xorl %ebp, %ebp
leaq 0x40(%rsp), %r13
leaq 0x20(%rsp), %r14
cmpq 0x18(%rsp), %rbp
jae 0x2df1
movq %rbx, %rdi
movq %r13, %rsi
pushq $0x40
popq %rdx
callq 0x2140
movq %r14, %rdi
movq %r13, %rsi
leaq 0x10(%rsp), %rdx
callq 0x2070
movq %r15, %rdi
movq %r14, %rsi
callq 0x3ce6
movq %rbp, (%rax)
movq %r12, %rdi
movq %r14, %rsi
callq 0x2ebc
movq %r14, %rdi
callq 0x20a0
incq %rbp
jmp 0x2da6
leaq 0x10(%rsp), %rsi
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0x2140
addq $0x90, 0x8(%rsp)
xorl %r14d, %r14d
pushq $0x10
popq %r15
leaq 0x4(%rsp), %r12
pushq $0x4
popq %r13
leaq 0x40(%rsp), %rbp
cmpq 0x10(%rsp), %r14
jae 0x2e68
movq %rbx, %rdi
leaq 0x20(%rsp), %rsi
movq %r15, %rdx
callq 0x2140
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x2140
movaps 0x20(%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
movl 0x4(%rsp), %eax
movl %eax, 0x50(%rsp)
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x306c
incq %r14
jmp 0x2e1f
movq 0x7159(%rip), %rbx      # 0x9fc8
movq (%rbx), %rcx
leaq 0x31d3(%rip), %rdi      # 0x604c
pushq $0x5
popq %rsi
pushq $0x1
popq %rdx
callq 0x2220
movq (%rbx), %rdi
callq 0x2130
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x2210
nop
// File: /workspace/github_cpp_makefile_star2_O2/YerevaNN[P]pmi/train.cpp
// Function: model::train(std::istream&, unsigned long)
void model::train(std::istream& in, size_t windowSize) {
    clear();
    
    std::deque<word> window;
    
    std::string s;
    
    while(window.size() != windowSize) {
        window.push_back(readWord(in));
    }
    
    size counter = 0;
    
    while(true) {
        processWindow(window.begin(), window.end());
        
        word add = readWord(in);
        if(add == emptyWord) {
            break;
        }
        window.push_back(add);
        window.pop_front();
        
        ++counter;
        if(counter % 731 == 0)
            report("\r%lld\t\t", counter);
    }
    std::cerr << std::endl;

    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2890
leaq 0x20(%rsp), %r12
movq %r12, %rdi
callq 0x4674
leaq 0xa8(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq %rsp, %r13
movq %r12, %rdi
callq 0x45a4
cmpq %r15, %rax
je 0x447c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x43b6
movq %rax, (%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x49fc
jmp 0x4453
pushq $0x1
popq %rbp
movq %rsp, %r15
leaq 0x20(%rsp), %r13
movq %rbp, %rax
xorl %edx, %edx
movl $0x2db, %ecx            # imm = 0x2DB
divq %rcx
movq %rax, %r12
movups 0x30(%rsp), %xmm0
movups 0x40(%rsp), %xmm1
movups 0x50(%rsp), %xmm2
movups 0x60(%rsp), %xmm3
movaps %xmm0, (%rsp)
movaps %xmm1, 0x10(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movq %r14, %rdi
movq %r15, %rsi
leaq 0x70(%rsp), %rdx
callq 0x45b4
movq %r14, %rdi
movq %rbx, %rsi
callq 0x43b6
movq %rax, (%rsp)
cmpq $0x1fffff, %rax         # imm = 0x1FFFFF
je 0x4546
movq %r13, %rdi
movq %r15, %rsi
callq 0x4632
imulq $0x2db, %r12, %rax      # imm = 0x2DB
pushq $0x1
popq %r12
subq %rax, %r12
movq %r13, %rdi
callq 0x4656
addq %rbp, %r12
cmpq $0x1, %r12
je 0x4529
movq 0x5aaf(%rip), %rax      # 0x9fc8
movq (%rax), %rdi
callq 0x2130
incq %rbp
jmp 0x4487
movq 0x5a98(%rip), %rax      # 0x9fc8
movq (%rax), %rdi
leaq 0x1b84(%rip), %rsi      # 0x60be
movq %rbp, %rdx
xorl %eax, %eax
callq 0x21a0
jmp 0x4512
movq 0x5aa3(%rip), %rdi      # 0x9ff0
callq 0x20b0
leaq 0x98(%rsp), %rdi
callq 0x20a0
leaq 0x20(%rsp), %rdi
callq 0x4996
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4581
jmp 0x4581
jmp 0x4581
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x20a0
leaq 0x20(%rsp), %rdi
callq 0x4996
movq %rbx, %rdi
callq 0x2210
nop
// File: /workspace/github_cpp_makefile_star2_O2/YerevaNN[P]pmi/train.cpp
// Function: void model::processWindow<std::_Deque_iterator<unsigned long, unsigned long&, unsigned long*>>(std::_Deque_iterator<unsigned long, unsigned long&, unsigned long*> const&, std::_Deque_iterator<unsigned long, unsigned long&, unsigned long*> const&)
void model::processWindow(const ForwardIterator& begin, const ForwardIterator& end) {
    auto ngrams = getNgrams(begin, end);
    for(auto i : ngrams) {
        for(auto j : ngrams) {
            push(i, j);
        }
    }
    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rdi
callq 0x4bea
movq (%r14), %r15
movq 0x8(%r14), %r12
cmpq %r12, %r15
je 0x4608
movq (%r15), %r14
movq (%rsp), %r13
movq 0x8(%rsp), %rbp
cmpq %rbp, %r13
je 0x4602
movq (%r13), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x437c
addq $0x8, %r13
jmp 0x45e8
addq $0x8, %r15
jmp 0x45d7
movq %rsp, %rdi
callq 0x55a0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x55a0
movq %rbx, %rdi
callq 0x2210
// File: /workspace/github_cpp_makefile_star2_O2/YerevaNN[P]pmi/train.cpp
// Function: std::vector<unsigned long, std::allocator<unsigned long>> getNgrams<std::_Deque_iterator<unsigned long, unsigned long&, unsigned long*>>(std::_Deque_iterator<unsigned long, unsigned long&, unsigned long*> const&, std::_Deque_iterator<unsigned long, unsigned long&, unsigned long*> const&)
std::vector<ngram> getNgrams(const T& begin, const T& end) {
    std::vector<ngram> ngrams;
    
    if(std::distance(begin, end) >= 1) {
        auto unigrams = getUnigrams(begin, end);
        ngrams.insert(ngrams.end(), unigrams.begin(), unigrams.end());
    }
    if(std::distance(begin, end) >= 2) {
        auto bigrams = getBigrams(begin, end);
        ngrams.insert(ngrams.end(), bigrams.begin(), bigrams.end());
    }
    if(std::distance(begin, end) >= 3) {
        auto trigrams = getTrigrams(begin, end);
        ngrams.insert(ngrams.end(), trigrams.begin(), trigrams.end());
    }
    
    return ngrams;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xe0, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
andq $0x0, 0x10(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movups (%rsi), %xmm0
leaq 0xc0(%rsp), %rdi
movaps %xmm0, (%rdi)
movups 0x10(%rsi), %xmm0
movaps %xmm0, 0x10(%rdi)
movups (%rdx), %xmm0
leaq 0xa0(%rsp), %rsi
movaps %xmm0, (%rsi)
movups 0x10(%rdx), %xmm0
movaps %xmm0, 0x10(%rsi)
callq 0x4d79
testq %rax, %rax
jle 0x4c70
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x4dae
movq 0x8(%rbx), %rsi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq %rbx, %rdi
callq 0x4e86
leaq 0x8(%rsp), %rdi
callq 0x55a0
movups (%r15), %xmm0
leaq 0x80(%rsp), %rdi
movaps %xmm0, (%rdi)
movups 0x10(%r15), %xmm0
movaps %xmm0, 0x10(%rdi)
movups (%r14), %xmm0
leaq 0x60(%rsp), %rsi
movaps %xmm0, (%rsi)
movups 0x10(%r14), %xmm0
movaps %xmm0, 0x10(%rsi)
callq 0x4d79
cmpq $0x2, %rax
jl 0x4cd8
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x4ea6
movq 0x8(%rbx), %rsi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq %rbx, %rdi
callq 0x4e86
leaq 0x8(%rsp), %rdi
callq 0x55a0
movups (%r15), %xmm0
leaq 0x40(%rsp), %rdi
movaps %xmm0, (%rdi)
movups 0x10(%r15), %xmm0
movaps %xmm0, 0x10(%rdi)
movups (%r14), %xmm0
leaq 0x20(%rsp), %rsi
movaps %xmm0, (%rsi)
movups 0x10(%r14), %xmm0
movaps %xmm0, 0x10(%rsi)
callq 0x4d79
cmpq $0x3, %rax
jl 0x4d3d
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x4fe7
movq 0x8(%rbx), %rsi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq %rbx, %rdi
callq 0x4e86
leaq 0x8(%rsp), %rdi
callq 0x55a0
movq %rbx, %rax
addq $0xe0, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x4d55
jmp 0x4d66
jmp 0x4d55
jmp 0x4d66
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x55a0
jmp 0x4d69
jmp 0x4d66
movq %rax, %r14
movq %rbx, %rdi
callq 0x55a0
movq %r14, %rdi
callq 0x2210
// File: /workspace/github_cpp_makefile_star2_O2/YerevaNN[P]pmi/train.cpp
// Function: std::vector<unsigned long, std::allocator<unsigned long>> getUnigrams<std::_Deque_iterator<unsigned long, unsigned long&, unsigned long*>>(std::_Deque_iterator<unsigned long, unsigned long&, unsigned long*> const&, std::_Deque_iterator<unsigned long, unsigned long&, unsigned long*> const&)
std::vector<ngram> getUnigrams(const T& begin, const T& end) {
    std::unordered_set<ngram> ngrams;
    for(auto I = begin; I != end; ++I) {
        ngrams.insert(hash(*I));
    }
    return std::vector<ngram> (ngrams.begin(), ngrams.end());
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r14
movq %rdi, 0x8(%rsp)
leaq 0x40(%rsp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
movups %xmm0, -0x8(%rax)
movq (%rsi), %r13
movq 0x10(%rsi), %rbx
movq 0x18(%rsi), %rbp
leaq 0x10(%rsp), %r15
movq %rsp, %r12
cmpq (%r14), %r13
je 0x4e3b
movq (%r13), %rdi
movl $0x1fffff, %esi         # imm = 0x1FFFFF
movl $0x1fffff, %edx         # imm = 0x1FFFFF
callq 0x27e8
movq %rax, (%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x51d6
addq $0x8, %r13
cmpq %rbx, %r13
jne 0x4dfa
movq 0x8(%rbp), %r13
addq $0x8, %rbp
leaq 0x200(%r13), %rbx
jmp 0x4dfa
movq 0x20(%rsp), %rsi
movq %rsp, %rcx
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x51a4
leaq 0x10(%rsp), %rdi
callq 0x5624
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4e70
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x5624
movq %rbx, %rdi
callq 0x2210
nop
// File: /workspace/github_cpp_makefile_star2_O2/YerevaNN[P]pmi/train.cpp
// Function: std::vector<unsigned long, std::allocator<unsigned long>> getBigrams<std::_Deque_iterator<unsigned long, unsigned long&, unsigned long*>>(std::_Deque_iterator<unsigned long, unsigned long&, unsigned long*> const&, std::_Deque_iterator<unsigned long, unsigned long&, unsigned long*> const&)
std::vector<ngram> getBigrams(const T& begin, const T& end) {
    std::unordered_set<ngram> ngrams;
    for(auto I = begin, J = std::next(I); J != end; ++I, ++J) {
        ngrams.insert(hash(*I, *J));
    }
    return std::vector<ngram> (ngrams.begin(), ngrams.end());
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdx, %r14
movq %rdi, 0x20(%rsp)
leaq 0x60(%rsp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
movups %xmm0, -0x8(%rax)
movq (%rsi), %r13
movq 0x8(%rsi), %rax
movq 0x10(%rsi), %rbx
movq 0x18(%rsi), %rbp
leaq 0x68(%rsp), %rsi
movq %r13, (%rsi)
movq %rax, 0x8(%rsi)
movq %rbx, 0x10(%rsi)
movq %rbp, 0x18(%rsi)
movq %rsp, %rdi
pushq $0x1
popq %rdx
callq 0x5899
movq (%rsp), %rax
leaq 0x30(%rsp), %r15
leaq 0x28(%rsp), %r12
cmpq (%r14), %rax
je 0x4f98
movq (%r13), %rdi
movq (%rax), %rsi
movl $0x1fffff, %edx         # imm = 0x1FFFFF
callq 0x27e8
movq %rax, 0x28(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x51d6
addq $0x8, %r13
cmpq %rbx, %r13
jne 0x4f5c
movq 0x8(%rbp), %r13
addq $0x8, %rbp
leaq 0x200(%r13), %rbx
movq (%rsp), %rax
addq $0x8, %rax
movq %rax, (%rsp)
cmpq 0x10(%rsp), %rax
jne 0x4f1e
movq 0x18(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x18(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
leaq 0x200(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq %rax, (%rsp)
jmp 0x4f1e
movq 0x40(%rsp), %rsi
movq %rsp, %rcx
movq 0x20(%rsp), %rbx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x51a4
leaq 0x30(%rsp), %rdi
callq 0x5624
movq %rbx, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4fd2
jmp 0x4fd2
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x5624
movq %rbx, %rdi
callq 0x2210
// File: /workspace/github_cpp_makefile_star2_O2/YerevaNN[P]pmi/train.cpp
// Function: std::vector<unsigned long, std::allocator<unsigned long>> getTrigrams<std::_Deque_iterator<unsigned long, unsigned long&, unsigned long*>>(std::_Deque_iterator<unsigned long, unsigned long&, unsigned long*> const&, std::_Deque_iterator<unsigned long, unsigned long&, unsigned long*> const&)
std::vector<ngram> getTrigrams(const T& begin, const T& end) {
    std::unordered_set<ngram> ngrams;
    for(auto I = begin, J = std::next(I), K = std::next(J); K != end; ++I, ++J, ++K) {
        ngrams.insert(hash(*I, *J, *K));
    }
    return std::vector<ngram> (ngrams.begin(), ngrams.end());
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdx, %r14
movq %rdi, %r15
leaq 0x88(%rsp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
movups %xmm0, -0x8(%rax)
movq (%rsi), %r13
movq 0x8(%rsi), %rax
movq 0x10(%rsi), %rbx
movq 0x18(%rsi), %rbp
leaq 0xb8(%rsp), %rsi
movq %r13, (%rsi)
movq %rax, 0x8(%rsi)
movq %rbx, 0x10(%rsi)
movq %rbp, 0x18(%rsi)
movq %rsp, %rdi
pushq $0x1
popq %rdx
callq 0x5899
movq %r15, 0x48(%rsp)
movaps (%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
leaq 0x90(%rsp), %rsi
movaps %xmm0, (%rsi)
movaps %xmm1, 0x10(%rsi)
leaq 0x28(%rsp), %rdi
pushq $0x1
popq %rdx
callq 0x5899
movq 0x28(%rsp), %rax
leaq 0x58(%rsp), %r15
leaq 0x50(%rsp), %r12
cmpq (%r14), %rax
je 0x5152
movq (%r13), %rdi
movq (%rsp), %rcx
movq (%rcx), %rsi
movq (%rax), %rdx
callq 0x27e8
movq %rax, 0x50(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x51d6
addq $0x8, %r13
cmpq %rbx, %r13
jne 0x50d2
movq 0x8(%rbp), %r13
addq $0x8, %rbp
leaq 0x200(%r13), %rbx
movq (%rsp), %rax
addq $0x8, %rax
movq %rax, (%rsp)
cmpq 0x10(%rsp), %rax
jne 0x510c
movq 0x18(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x18(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
leaq 0x200(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq %rax, (%rsp)
movq 0x28(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x28(%rsp)
cmpq 0x38(%rsp), %rax
jne 0x508e
movq 0x40(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x40(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x30(%rsp)
leaq 0x200(%rax), %rcx
movq %rcx, 0x38(%rsp)
movq %rax, 0x28(%rsp)
jmp 0x508e
movq 0x68(%rsp), %rsi
movq %rsp, %rcx
movq 0x48(%rsp), %rbx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x51a4
leaq 0x58(%rsp), %rdi
callq 0x5624
movq %rbx, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x518e
jmp 0x518e
jmp 0x518e
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x5624
movq %rbx, %rdi
callq 0x2210
nop
// File: /workspace/github_cpp_makefile_star2_O2/vssense[P]Compiler/src/front-end/front-end_main.cpp
// Function: main
int main(const int argc, const char* argv[])
{
    FrontEndInfo info = {};
    info.input_file = argv[1];

    info.parser_dump_required = (strcmp(argv[parser_dump_flag_offset], "1") == 0);
    info.tree_dump_required   = (strcmp(argv[tree_dump_flag_offset],   "1") == 0);
    info.emit_tree_requiered  = (strcmp(argv[emit_tree_flag_offset],   "1") == 0);
    info.emit_code_requiered  = (strcmp(argv[emit_code_flag_offset],   "1") == 0);

    if (argc - 1 > emit_code_flag_offset)
    {
        info.output_file = argv[emit_code_flag_offset + 1];
    }


    if (info.emit_code_requiered)
    {
        const char* output = "translated_program.shl";
        if (info.output_file != nullptr)
        {
            output = info.output_file;
        }

        Translate(info.input_file, output);
        return 0;
    }

    Parser* parser = Parse(info.input_file);
    if (info.parser_dump_required)
    {
        ParserDump(parser);
    }

    Tree* tree = GetTree(parser);
    if (info.tree_dump_required)
    {
        TreeDump(tree);
    }

    if (info.emit_tree_requiered)
    {
        const char* output = "tree_in_written_form.txt";
        WriteToFile(tree, info.output_file);
    }
    else
    {
        WriteToFile(tree, tree_tmp_file);
    }

    DestructTree(tree);
    DeleteTree(tree);

    DestructParser(parser);
    DeleteParser(parser);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x10(%rsi), %rax
cmpb $0x31, (%rax)
jne 0x22dd
cmpb $0x0, 0x1(%rax)
sete %r15b
jmp 0x22e0
xorl %r15d, %r15d
movq 0x18(%rsi), %rax
cmpb $0x31, (%rax)
jne 0x22f3
cmpb $0x0, 0x1(%rax)
sete %r12b
jmp 0x22f6
xorl %r12d, %r12d
movq 0x20(%rsi), %rax
cmpb $0x31, (%rax)
jne 0x2309
cmpb $0x0, 0x1(%rax)
sete %r13b
jmp 0x230c
xorl %r13d, %r13d
movq 0x28(%rsi), %rax
cmpb $0x31, (%rax)
jne 0x231e
cmpb $0x0, 0x1(%rax)
sete %al
jmp 0x2320
xorl %eax, %eax
cmpl $0x7, %edi
jl 0x232b
movq 0x30(%rsi), %rbx
jmp 0x232d
xorl %ebx, %ebx
movq 0x8(%rsi), %rdi
testb %al, %al
je 0x234a
testq %rbx, %rbx
leaq 0x3cd8(%rip), %rsi      # 0x6017
cmovneq %rbx, %rsi
callq 0x48b0
jmp 0x23ae
callq 0x2fbb
movq %rax, %r14
testb %r15b, %r15b
je 0x235f
movq %r14, %rdi
callq 0x30f3
movq %r14, %rdi
callq 0x38d9
movq %rax, %r15
testb %r12b, %r12b
je 0x2377
movq %r15, %rdi
callq 0x35f6
testb %r13b, %r13b
jne 0x2383
movq 0x7d6d(%rip), %rbx      # 0xa0f0
movq %r15, %rdi
movq %rbx, %rsi
callq 0x23c0
movq %r15, %rdi
callq 0x3852
movq %r15, %rdi
callq 0x38af
movq %r14, %rdi
callq 0x303a
movq %r14, %rdi
callq 0x30c7
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/vssense[P]Compiler/src/front-end/translator.cpp
// Function: Translate(char const*, char const*)
void Translate(const char* input, const char* output)
{
    assert(input);

    Tree* tree = GetTreeFromFile(input);
    TreeDump(tree);
    FILE* translate = fopen(output, "w");
    assert(translate);

    fprintf(translate, "~ THIS FILE WAS GENERATED AUTOMATICLY\n"
                       "~ TREE TAKED FROM FILE '%s'          \n"
                       "~ CHECK FILE BEFORE COMPILING      \n\n", input);

    TranslateTree(tree, translate);

    DestructTree(tree);
    DeleteTree(tree);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x4925
movq %rsi, %r15
movq %rdi, %r14
callq 0x256e
movq %rax, %rbx
movq %rax, %rdi
callq 0x35f6
leaq 0x179e(%rip), %rsi      # 0x607a
movq %r15, %rdi
callq 0x2100
testq %rax, %rax
je 0x493e
movq %rax, %r15
leaq 0x29b3(%rip), %rsi      # 0x72a6
movq %rax, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2150
movq %rbx, %rdi
movq %r15, %rsi
callq 0x495b
movq %rbx, %rdi
callq 0x3852
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x38af
leaq 0x1881(%rip), %rdi      # 0x61ad
leaq 0x2921(%rip), %rsi      # 0x7254
leaq 0x2937(%rip), %rcx      # 0x7271
pushq $0x18
jmp 0x4955
leaq 0x2957(%rip), %rdi      # 0x729c
leaq 0x2908(%rip), %rsi      # 0x7254
leaq 0x291e(%rip), %rcx      # 0x7271
pushq $0x1d
popq %rdx
callq 0x2090
// File: /workspace/github_cpp_makefile_star2_O2/vssense[P]Compiler/src/front-end/translator.cpp
// Function: TranslateTree(Tree*, _IO_FILE*)
void TranslateTree(Tree* tree, FILE* file)
{
    assert(tree);
    assert(file);

    Node* node = tree->root;

    while (node != nullptr)
    {
        TranslateFunc(node->right, file);
        node = node->left;
        fprintf(file, "\n");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x49a6
movq %rsi, %rbx
testq %rsi, %rsi
je 0x49bf
movq (%rdi), %r15
pushq $0xa
popq %r14
testq %r15, %r15
je 0x499b
movq 0x20(%r15), %rdi
movq %rbx, %rsi
callq 0x49dc
movq 0x18(%r15), %r15
movl %r14d, %edi
movq %rbx, %rsi
callq 0x2120
jmp 0x4979
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1681(%rip), %rdi      # 0x602e
leaq 0x28a0(%rip), %rsi      # 0x7254
leaq 0x295d(%rip), %rcx      # 0x7318
pushq $0x2b
jmp 0x49d6
leaq 0x1e65(%rip), %rdi      # 0x682b
leaq 0x2887(%rip), %rsi      # 0x7254
leaq 0x2944(%rip), %rcx      # 0x7318
pushq $0x2c
popq %rdx
callq 0x2090
// File: /workspace/github_cpp_makefile_star2_O2/vssense[P]Compiler/src/front-end/translator.cpp
// Function: TranslateFunc(Node*, _IO_FILE*)
void TranslateFunc(Node* node, FILE* file)
{
    assert(node);
    assert(file);

    fprintf(file, "%s %s(", OPERATORS[DECLARATOR].rus_name, node->value.name);
    TranslateArgs(node->right, file);
    fprintf(file, ")\n");
    TranslateCompound(node->left, file, 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x4a42
movq %rsi, %rbx
testq %rsi, %rsi
je 0x4a5b
movq %rdi, %r14
movq 0x8(%rdi), %rcx
leaq 0x2960(%rip), %rsi      # 0x735e
leaq 0x1b54(%rip), %rdx      # 0x6559
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2150
movq 0x20(%r14), %rdi
movq %rbx, %rsi
callq 0x4a78
leaq 0x2943(%rip), %rdi      # 0x7365
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x21b0
movq 0x18(%r14), %rdi
movq %rbx, %rsi
xorl %edx, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x4ae6
leaq 0x1693(%rip), %rdi      # 0x60dc
leaq 0x2804(%rip), %rsi      # 0x7254
leaq 0x28e4(%rip), %rcx      # 0x733b
pushq $0x3a
jmp 0x4a72
leaq 0x1dc9(%rip), %rdi      # 0x682b
leaq 0x27eb(%rip), %rsi      # 0x7254
leaq 0x28cb(%rip), %rcx      # 0x733b
pushq $0x3b
popq %rdx
callq 0x2090
// File: /workspace/github_cpp_makefile_star2_O2/vssense[P]Compiler/src/front-end/translator.cpp
// Function: TranslateArgs(Node*, _IO_FILE*)
void TranslateArgs(Node* node, FILE* file)
{
    assert(file);

    if (node != nullptr)
    {
        fprintf(file, "%s", node->value.name);
        node = node->right;

        while (node != nullptr)
        {
            fprintf(file, ", %s", node->value.name);
            node = node->right;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x4ac9
movq %rdi, %r14
testq %rdi, %rdi
je 0x4abe
movq %rsi, %rbx
movq 0x8(%r14), %rdi
callq 0x20f0
leaq 0x28e9(%rip), %r15      # 0x738b
movq 0x20(%r14), %r14
testq %r14, %r14
je 0x4abe
movq 0x8(%r14), %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2150
jmp 0x4aa2
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1d5b(%rip), %rdi      # 0x682b
leaq 0x277d(%rip), %rsi      # 0x7254
leaq 0x288a(%rip), %rcx      # 0x7368
pushq $0x45
popq %rdx
callq 0x2090
// File: /workspace/github_cpp_makefile_star2_O2/vssense[P]Compiler/src/front-end/translator.cpp
// Function: TranslateCompound(Node*, _IO_FILE*, unsigned long)
void TranslateCompound(Node* node, FILE* file, size_t num_tabs)
{
    assert(node);
    assert(file);

    if (node == nullptr)
    {
        return;
    }

    node = node->right;
    SetTabs(file, num_tabs);
    fprintf(file, "%s\n", OPERATORS[OPENING_BRACE].rus_name);

    while (node != nullptr)
    {
        TranslateStatement(node->left, file, num_tabs + 1);
        node = node->right;
    }

    SetTabs(file, num_tabs);
    fprintf(file, "%s\n", OPERATORS[CLOSING_BRACE].rus_name);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0x4b7b
movq %rsi, %rbx
testq %rsi, %rsi
je 0x4b94
movq %rdx, %r14
movq 0x20(%rdi), %r12
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x4bb1
leaq 0x28bd(%rip), %rsi      # 0x73dc
leaq 0x1ab0(%rip), %rdx      # 0x65d6
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2150
leaq 0x1(%r14), %r15
testq %r12, %r12
je 0x4b50
movq 0x18(%r12), %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x4c05
movq 0x20(%r12), %r12
jmp 0x4b34
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4bb1
leaq 0x287a(%rip), %rsi      # 0x73dc
leaq 0x1a7c(%rip), %rdx      # 0x65e5
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2150
leaq 0x155a(%rip), %rdi      # 0x60dc
leaq 0x26cb(%rip), %rsi      # 0x7254
leaq 0x281d(%rip), %rcx      # 0x73ad
pushq $0x60
jmp 0x4bab
leaq 0x1c90(%rip), %rdi      # 0x682b
leaq 0x26b2(%rip), %rsi      # 0x7254
leaq 0x2804(%rip), %rcx      # 0x73ad
pushq $0x61
popq %rdx
callq 0x2090
// File: /workspace/github_cpp_makefile_star2_O2/vssense[P]Compiler/src/front-end/translator.cpp
// Function: TranslateExpression(Node*, _IO_FILE*)
void TranslateExpression(Node* node, FILE* file)
{
    assert(node);
    assert(file);

    switch (node->type)
    {
        case MATH_TYPE :
        {
            if (NeededBracket(node))
            {
                fprintf(file, "(");
            }
            
            TranslateExpression(node->left, file);
            fprintf(file, " %s ", STRING_MATH_OP[node->value.op]);
            TranslateExpression(node->right, file);

            if (NeededBracket(node)) 
            {
                fprintf(file, ")");
            }
            break;
        }
        case NUMB_TYPE :
        {   
            IntToDrevniyRus(file, node->value.number);   
            break;
        }
        case CALL_TYPE :
        {
            if (!TranslateStdCall(node, file))
            {
                fprintf(file, "%s(", node->left->value.name);
                TranslateParams(node->right, file);
                fprintf(file, ")");
            }
            break;
        }
        case ID_TYPE :
        {
            fprintf(file, "%s", node->value.name);
            break;
        }
        default :
        {
            fprintf(file, "can't interpret this construction");
            // printf("I'm here, but I shouldn't, line = %d\n", __LINE__);
            break;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x4ef1
movq %rsi, %rbx
testq %rsi, %rsi
je 0x4f10
movq %rdi, %r14
movl (%rdi), %eax
cmpl $0x4, %eax
je 0x4e94
cmpl $0xc, %eax
je 0x4e70
cmpl $0xf, %eax
je 0x4e84
cmpl $0xe, %eax
jne 0x4ea4
cmpl $0x1, 0x8(%r14)
ja 0x4e26
movq 0x10(%r14), %rax
cmpl $0xe, (%rax)
jne 0x4e26
pushq $0x28
popq %rdi
movq %rbx, %rsi
callq 0x2120
movq 0x18(%r14), %rdi
movq %rbx, %rsi
callq 0x4dca
movslq 0x8(%r14), %rax
leaq 0x52d3(%rip), %rcx      # 0xa110
movq (%rcx,%rax,8), %rdx
leaq 0x25ef(%rip), %rsi      # 0x7437
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2150
movq 0x20(%r14), %rdi
movq %rbx, %rsi
callq 0x4dca
cmpl $0x1, 0x8(%r14)
ja 0x4e7f
movq 0x10(%r14), %rax
cmpl $0xe, (%rax)
jne 0x4e7f
jmp 0x4ee2
movq %r14, %rdi
movq %rbx, %rsi
callq 0x50e1
testb %al, %al
je 0x4ebd
popq %rbx
popq %r14
popq %rbp
retq
movl 0x8(%r14), %esi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x5293
movq 0x8(%r14), %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x20f0
leaq 0x2565(%rip), %rdi      # 0x7410
pushq $0x21
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
popq %rbx
popq %r14
popq %rbp
jmp 0x21b0
movq 0x18(%r14), %rax
movq 0x8(%rax), %rdx
leaq 0x2495(%rip), %rsi      # 0x7361
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2150
movq 0x20(%r14), %rdi
movq %rbx, %rsi
callq 0x51c9
pushq $0x29
popq %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x2120
leaq 0x11e4(%rip), %rdi      # 0x60dc
leaq 0x2355(%rip), %rsi      # 0x7254
leaq 0x261d(%rip), %rcx      # 0x7523
movl $0xf9, %edx
callq 0x2090
leaq 0x1914(%rip), %rdi      # 0x682b
leaq 0x2336(%rip), %rsi      # 0x7254
leaq 0x25fe(%rip), %rcx      # 0x7523
movl $0xfa, %edx
callq 0x2090
// File: /workspace/github_cpp_makefile_star2_O2/vssense[P]Compiler/src/front-end/translator.cpp
// Function: TranslateCondition(Node*, _IO_FILE*, unsigned long)
void TranslateCondition(Node* node, FILE* file, size_t num_tabs)
{
    assert(node);
    assert(file);

    fprintf(file, "%s (", OPERATORS[IF].rus_name);
    TranslateExpression(node->left, file);
    fprintf(file, ")\n");

    TranslateCompound(node->right->left, file, num_tabs);

    if (node->right->right != nullptr)
    {
        SetTabs(file, num_tabs);
        fprintf(file, "%s\n", OPERATORS[ELSE].rus_name);
        TranslateCompound(node->right->right, file, num_tabs);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x4ff6
movq %rsi, %r14
testq %rsi, %rsi
je 0x5015
movq %rdx, %rbx
movq %rdi, %r15
leaq 0x2578(%rip), %rsi      # 0x74d3
leaq 0x1649(%rip), %rdx      # 0x65ab
movq %r14, %rdi
xorl %eax, %eax
callq 0x2150
movq 0x18(%r15), %rdi
movq %r14, %rsi
callq 0x4dca
leaq 0x23e6(%rip), %rdi      # 0x7365
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x21b0
movq 0x20(%r15), %rax
movq 0x18(%rax), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x4ae6
movq 0x20(%r15), %rax
cmpq $0x0, 0x20(%rax)
je 0x4feb
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4bb1
leaq 0x241f(%rip), %rsi      # 0x73dc
leaq 0x15f1(%rip), %rdx      # 0x65b5
movq %r14, %rdi
xorl %eax, %eax
callq 0x2150
movq 0x20(%r15), %rax
movq 0x20(%rax), %rdi
movq %r14, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4ae6
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10df(%rip), %rdi      # 0x60dc
leaq 0x2250(%rip), %rsi      # 0x7254
leaq 0x24cd(%rip), %rcx      # 0x74d8
movl $0xdf, %edx
callq 0x2090
leaq 0x180f(%rip), %rdi      # 0x682b
leaq 0x2231(%rip), %rsi      # 0x7254
leaq 0x24ae(%rip), %rcx      # 0x74d8
movl $0xe0, %edx
callq 0x2090
// File: /workspace/github_cpp_makefile_star2_O2/vssense[P]Compiler/src/front-end/translator.cpp
// Function: TranslateLoop(Node*, _IO_FILE*, unsigned long)
void TranslateLoop(Node* node, FILE* file, size_t num_tabs)
{
    assert(node);
    assert(file);

    fprintf(file, "%s (", OPERATORS[LOOP].rus_name);
    TranslateExpression(node->left, file);
    fprintf(file, ")\n");

    TranslateCompound(node->right, file, num_tabs);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x50a3
movq %rsi, %r14
testq %rsi, %rsi
je 0x50c2
movq %rdx, %rbx
movq %rdi, %r15
leaq 0x247b(%rip), %rsi      # 0x74d3
leaq 0x1518(%rip), %rdx      # 0x6577
movq %r14, %rdi
xorl %eax, %eax
callq 0x2150
movq 0x18(%r15), %rdi
movq %r14, %rsi
callq 0x4dca
leaq 0x22e9(%rip), %rdi      # 0x7365
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x21b0
movq 0x20(%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4ae6
leaq 0x1032(%rip), %rdi      # 0x60dc
leaq 0x21a3(%rip), %rsi      # 0x7254
leaq 0x23f0(%rip), %rcx      # 0x74a8
movl $0xd3, %edx
callq 0x2090
leaq 0x1762(%rip), %rdi      # 0x682b
leaq 0x2184(%rip), %rsi      # 0x7254
leaq 0x23d1(%rip), %rcx      # 0x74a8
movl $0xd4, %edx
callq 0x2090