LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/frolosofsky[P]pbft/main.cpp
// Function: main
int main() {
    Simulator sim(1);
    sim.actions({
        Message::WriteOpRequest{1},
        Message::WriteOpRequest{2},
        Message::WriteOpRequest{10},
        Message::ReadOpRequest{0},
        Message::ReadOpRequest{2},
        Message::ReadOpRequest{3},
        });
    sim.run();
    sim.destroy_node(1);
    sim.actions({
        Message::WriteOpRequest{1000},
        Message::WriteOpRequest{1234},
        Message::WriteOpRequest{9876},
        Message::ReadOpRequest{5},
        Message::ReadOpRequest{10},
        Message::ReadOpRequest{3},
        });
    sim.run();
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xd8, %rsp
leaq -0x90(%rbp), %rdi
xorl %ebx, %ebx
movl $0x1, %esi
xorl %edx, %edx
callq 0x330c
leaq -0xf0(%rbp), %rsi
movl %ebx, (%rsi)
movl $0x1, 0x8(%rsi)
movl %ebx, 0x10(%rsi)
movl $0x2, %eax
movl %eax, 0x18(%rsi)
movl %ebx, 0x20(%rsi)
movl $0xa, 0x28(%rsi)
movl %eax, 0x30(%rsi)
movq $0x0, 0x38(%rsi)
movl %eax, 0x40(%rsi)
movq $0x2, 0x48(%rsi)
movl %eax, 0x50(%rsi)
movq $0x3, 0x58(%rsi)
leaq -0x38(%rbp), %r14
leaq -0x19(%rbp), %rcx
movl $0x6, %edx
movq %r14, %rdi
callq 0x33b2
leaq -0x50(%rbp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x548c
movq -0x38(%rbp), %rdi
cmpq %r14, %rdi
je 0x31ed
movq (%rdi), %r15
movl $0x20, %esi
callq 0x2140
movq %r15, %rdi
cmpq %r14, %r15
jne 0x31d8
leaq -0x90(%rbp), %rdi
callq 0x340e
leaq -0x90(%rbp), %rdi
movl $0x1, %esi
callq 0x34a8
xorl %eax, %eax
leaq -0xf0(%rbp), %rsi
movl %eax, (%rsi)
movl $0x3e8, 0x8(%rsi)       # imm = 0x3E8
movl %eax, 0x10(%rsi)
movl $0x4d2, 0x18(%rsi)      # imm = 0x4D2
movl %eax, 0x20(%rsi)
movl $0x2694, 0x28(%rsi)     # imm = 0x2694
movl $0x2, %eax
movl %eax, 0x30(%rsi)
movq $0x5, 0x38(%rsi)
movl %eax, 0x40(%rsi)
movq $0xa, 0x48(%rsi)
movl %eax, 0x50(%rsi)
movq $0x3, 0x58(%rsi)
leaq -0x38(%rbp), %r14
leaq -0x19(%rbp), %rcx
movl $0x6, %edx
movq %r14, %rdi
callq 0x33b2
movq %rbx, %rdi
movq %r14, %rsi
callq 0x548c
movq -0x38(%rbp), %rdi
cmpq %r14, %rdi
je 0x3294
movq (%rdi), %r15
movl $0x20, %esi
callq 0x2140
movq %r15, %rdi
cmpq %r14, %r15
jne 0x327f
leaq -0x90(%rbp), %rdi
callq 0x340e
movq -0x50(%rbp), %rdi
cmpq %rbx, %rdi
je 0x32be
movq (%rdi), %r14
movl $0x20, %esi
callq 0x2140
movq %r14, %rdi
cmpq %rbx, %r14
jne 0x32a9
leaq -0x68(%rbp), %rdi
callq 0x38e0
leaq -0x80(%rbp), %rbx
movq %rbx, %rdi
callq 0x393c
movq -0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x32e1
callq 0x2ddc
xorl %eax, %eax
addq $0xd8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x32f5
jmp 0x32f5
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x34fa
movq %rbx, %rdi
callq 0x21f0
// File: /workspace/github_cpp_makefile_star2_O3/frolosofsky[P]pbft/main.cpp
// Function: Simulator::run()
void run() {
        constexpr int ticks_limit = 10000;
        int c = 0;
        while(not(_actions.size() == 0 && _client->ready()) && c < ticks_limit) {
            tick();
            ++c;
        }
        std::cout << "Simulation has taken " << c << " ticks" << std::endl;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
xorl %ebx, %ebx
cmpq $0x0, 0x50(%r14)
jne 0x342c
movq (%r14), %rax
movl 0x60(%rax), %ecx
cmpl 0x64(%rax), %ecx
je 0x3440
cmpl $0x270f, %ebx           # imm = 0x270F
ja 0x3440
movq %r14, %rdi
callq 0x5524
incl %ebx
jmp 0x341a
movq 0x6b91(%rip), %r14      # 0x9fd8
leaq 0x31ce(%rip), %rsi      # 0x661c
movl $0x15, %edx
movq %r14, %rdi
callq 0x2160
movq %r14, %rdi
movl %ebx, %esi
callq 0x21e0
movq %rax, %rbx
leaq 0x31c3(%rip), %rsi      # 0x6632
movl $0x6, %edx
movq %rax, %rdi
callq 0x2160
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x20e0
nop
// File: /workspace/github_cpp_makefile_star2_O3/frolosofsky[P]pbft/./pbft_types.h
// Function: std::ostream& operator<<<std::ostream>(std::ostream&, Message const&)
Stream &operator<<(Stream &os, Message const &m) {
    switch(m.type) {
    case Message::Type::Write:
        return os << "Write{" << m.data.write << "}";
    case Message::Type::Read:
        return os << "Read{" << m.data.read << "}";
    case Message::Type::WriteAck:
        return os << "WriteAck{" << m.data.write_ack << "}";
    case Message::Type::ReadAck:
        return os << "ReadAck{" << m.data.read_ack << "}";
    case Message::Type::Response:
        return os << "Response{" << m.data.response << "}";
    case Message::Type::PrePrepare:
        return os << "PrePrepare{" << m.data.preprepare << "}";
    case Message::Type::Prepare:
        return os << "Prepare{" << m.data.prepare << "}";
    case Message::Type::Commit:
        return os << "Commit{" << m.data.commit << "}";
    }
    return os; // happy gcc
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl (%rsi), %eax
cmpq $0x7, %rax
ja 0x3ffe
movq %rsi, %r14
leaq 0x23c5(%rip), %rcx      # 0x6280
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x2605(%rip), %rsi      # 0x64d0
movl $0x6, %edx
movq %rbx, %rdi
callq 0x2160
leaq 0x2645(%rip), %rsi      # 0x6524
movl $0x6, %edx
movq %rbx, %rdi
callq 0x2160
movl 0x8(%r14), %esi
movq %rbx, %rdi
callq 0x21e0
jmp 0x3fe7
leaq 0x25ee(%rip), %rsi      # 0x64f2
movl $0x9, %edx
movq %rbx, %rdi
callq 0x2160
addq $0x8, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x40a5
jmp 0x3fe7
leaq 0x25ad(%rip), %rsi      # 0x64d9
movl $0x5, %edx
movq %rbx, %rdi
callq 0x2160
leaq 0x25db(%rip), %rsi      # 0x651b
movl $0x6, %edx
movq %rbx, %rdi
callq 0x2160
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x20d0
jmp 0x3fe7
leaq 0x2584(%rip), %rsi      # 0x64e9
movl $0x8, %edx
movq %rbx, %rdi
callq 0x2160
addq $0x8, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4056
jmp 0x3fe7
leaq 0x257e(%rip), %rsi      # 0x6508
movl $0x7, %edx
jmp 0x3fd0
leaq 0x2547(%rip), %rsi      # 0x64df
movl $0x9, %edx
movq %rbx, %rdi
callq 0x2160
addq $0x8, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4006
jmp 0x3fe7
leaq 0x253f(%rip), %rsi      # 0x64fc
movl $0xb, %edx
jmp 0x3fd0
leaq 0x2534(%rip), %rsi      # 0x64ff
movl $0x8, %edx
movq %rbx, %rdi
callq 0x2160
addq $0x8, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x414f
movq %rax, %rbx
leaq 0x24e6(%rip), %rsi      # 0x64d7
movl $0x1, %edx
movq %rax, %rdi
callq 0x2160
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/frolosofsky[P]pbft/./pbft.h
// Function: PBFTNode::on_tick()
void on_tick() override {
        auto inbox = take_inbox();
        for(auto &mm : inbox) {
            auto const s = mm.first;
            auto &m = mm.second;
            switch(m.type) {
            case Message::Type::Write:
                process(s, std::move(m.data.write));
                break;
            case Message::Type::Read:
                process(s, std::move(m.data.read));
                break;
            case Message::Type::PrePrepare:
                process(s, std::move(m.data.preprepare));
                break;
            case Message::Type::Prepare:
                process(s, std::move(m.data.prepare));
                break;
            case Message::Type::Commit:
                process(s, std::move(m.data.commit));
                break;
            case Message::Type::WriteAck:
            case Message::Type::ReadAck:
            case Message::Type::Response:
                assert(not("Unreachable"));
            }
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %r15
leaq -0x38(%rbp), %rbx
movq %rbx, 0x8(%rbx)
movq %rbx, (%rbx)
movq $0x0, 0x10(%rbx)
leaq 0x48(%rdi), %rsi
movq %rbx, %rdi
callq 0x2200
movq 0x58(%r15), %rax
movq 0x10(%rbx), %rcx
movq %rcx, 0x58(%r15)
movq %rax, 0x10(%rbx)
movq (%rbx), %r14
cmpq %rbx, %r14
je 0x4781
leaq 0x1ba6(%rip), %r12      # 0x62c0
movl 0x18(%r14), %eax
cmpq $0x7, %rax
ja 0x4775
movq 0x10(%r14), %rsi
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
leaq 0x20(%r14), %rdx
movq %r15, %rdi
callq 0x47f4
jmp 0x4775
leaq 0x20(%r14), %rdx
movq %r15, %rdi
callq 0x48a4
jmp 0x4775
leaq 0x20(%r14), %rdx
movq %r15, %rdi
callq 0x4a98
jmp 0x4775
leaq 0x20(%r14), %rdx
movq %r15, %rdi
callq 0x4a10
jmp 0x4775
leaq 0x20(%r14), %rdx
movq %r15, %rdi
callq 0x4966
movq (%r14), %r14
cmpq %rbx, %r14
jne 0x471a
movq -0x38(%rbp), %r14
cmpq %rbx, %r14
je 0x479e
movq (%r14), %r15
movl $0x50, %esi
movq %r14, %rdi
callq 0x2140
movq %r15, %r14
cmpq %rbx, %r15
jne 0x4786
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x195f(%rip), %rdi      # 0x6111
leaq 0x1dc5(%rip), %rsi      # 0x657e
leaq 0x1de5(%rip), %rcx      # 0x65a5
movl $0xa1, %edx
callq 0x20c0
movq %rax, %r14
movq -0x38(%rbp), %rdi
cmpq %rbx, %rdi
je 0x47eb
movq (%rdi), %r15
movl $0x50, %esi
callq 0x2140
movq %r15, %rdi
cmpq %rbx, %r15
jne 0x47d6
movq %r14, %rdi
callq 0x21f0
nop
// File: /workspace/github_cpp_makefile_star2_O3/frolosofsky[P]pbft/./pbft.h
// Function: PBFTNode::process(unsigned long, Message::WriteOpRequest&&)
void process(uintptr_t sender, Message::WriteOpRequest &&msg) {
        if(_role != Role::Primary)
            return; // only primary reacts on client requests. Change-view in TODO
        auto p = prepreare(sender, std::move(msg));
        if(_state.preprepare(p.view, p.req_id))
            broadcast(std::move(p));
    }

// Assembly:
cmpl $0x0, 0x74(%rdi)
je 0x47fb
retq
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movslq (%rdx), %r12
callq 0x23ac
movl (%r15), %edx
movl 0x78(%rbx), %ecx
movl 0x58fd(%rip), %esi      # 0xa124
leal 0x1(%rsi), %edi
movl %edi, 0x58f4(%rip)      # 0xa124
movl 0x60(%rbx), %r8d
leal -0x1(%r8), %r9d
cmpl $0x5, %r9d
jae 0x489d
cmpl %ecx, 0x68(%rbx)
jne 0x4890
cmpl %esi, 0x6c(%rbx)
jne 0x4890
movl %ecx, 0x68(%rbx)
shrq %rax
addq %r12, %rax
movl %edi, 0x6c(%rbx)
movabsq $0x100000001, %rsi      # imm = 0x100000001
movq %rsi, 0x60(%rbx)
leaq -0x58(%rbp), %rsi
movl $0x5, (%rsi)
xorl %r8d, %r8d
movl %r8d, 0x8(%rsi)
movl %edx, 0x10(%rsi)
movq %rax, 0x18(%rsi)
movq %r14, 0x20(%rsi)
movl %ecx, 0x28(%rsi)
movl %edi, 0x2c(%rsi)
movl %r8d, 0x30(%rsi)
movq %rbx, %rdi
callq 0x2726
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
testl %r8d, %r8d
je 0x4848
jmp 0x4890
// File: /workspace/github_cpp_makefile_star2_O3/frolosofsky[P]pbft/./pbft.h
// Function: PBFTNode::process(unsigned long, Message::ReadOpRequest&&)
void process(uintptr_t sender, Message::ReadOpRequest &&msg) {
        if(_role != Role::Primary)
            return; // only primary reacts on client requests. Change-view in TODO
        auto p = prepreare(sender, std::move(msg));
        if(_state.preprepare(p.view, p.req_id))
            broadcast(std::move(p));
    }

// Assembly:
cmpl $0x0, 0x74(%rdi)
je 0x48ab
retq
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdx), %r12
callq 0x23ac
movq (%r15), %rdx
movl 0x78(%rbx), %ecx
movl 0x584d(%rip), %esi      # 0xa124
leal 0x1(%rsi), %edi
movl %edi, 0x5844(%rip)      # 0xa124
movl 0x60(%rbx), %r8d
leal -0x1(%r8), %r9d
cmpl $0x5, %r9d
jae 0x495e
cmpl %ecx, 0x68(%rbx)
jne 0x4951
cmpl %esi, 0x6c(%rbx)
jne 0x4951
movl %ecx, 0x68(%rbx)
shrq %rax
movabsq $0x2000000000000000, %rsi # imm = 0x2000000000000000
addq %rax, %rsi
addq %rsi, %r12
movl %edi, 0x6c(%rbx)
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x60(%rbx)
leaq -0x58(%rbp), %rsi
movl $0x5, (%rsi)
movl $0x2, 0x8(%rsi)
movq %rdx, 0x10(%rsi)
movq %r12, 0x18(%rsi)
movq %r14, 0x20(%rsi)
movl %ecx, 0x28(%rsi)
movl %edi, 0x2c(%rsi)
movl $0x0, 0x30(%rsi)
movq %rbx, %rdi
callq 0x2726
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
testl %r8d, %r8d
je 0x48f8
jmp 0x4951
nop
// File: /workspace/github_cpp_makefile_star2_O3/frolosofsky[P]pbft/./pbft.h
// Function: PBFTNode::process(unsigned long, Message::PrePrepare&&)
void process(uintptr_t sender[[gnu::unused]], Message::PrePrepare &&msg) {
        if(_role == Role::Primary)
            return; // only replicas react on preprepare
        if(!verify_message(msg))
            return;
        if(_state.preprepare(msg.view, msg.req_id) && _state.prepare(msg.view, msg.req_id))
            broadcast(prepare(std::move(msg)));
    }

// Assembly:
cmpl $0x0, 0x74(%rdi)
je 0x4a0e
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdx, %r14
movq %rdi, %rbx
movq %rdx, %rsi
callq 0x4ae4
testb %al, %al
je 0x4a06
movl 0x20(%r14), %esi
movl 0x24(%r14), %edx
movl 0x60(%rbx), %eax
leal -0x1(%rax), %ecx
cmpl $0x5, %ecx
jae 0x49af
cmpl %esi, 0x68(%rbx)
jne 0x4a06
leal -0x1(%rdx), %eax
cmpl %eax, 0x6c(%rbx)
je 0x49b3
jmp 0x4a06
testl %eax, %eax
jne 0x4a06
movl %esi, 0x68(%rbx)
leaq 0x60(%rbx), %rdi
movl %edx, 0x6c(%rbx)
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x60(%rbx)
callq 0x4c26
testb %al, %al
je 0x4a06
movq 0x20(%r14), %rax
leaq -0x48(%rbp), %rsi
movq %rax, 0x28(%rsi)
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x18(%rsi)
movups %xmm0, 0x8(%rsi)
movl $0x6, (%rsi)
movl $0x0, 0x30(%rsi)
movq %rbx, %rdi
callq 0x2726
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/frolosofsky[P]pbft/./pbft.h
// Function: PBFTNode::process(unsigned long, Message::Prepare&&)
void process(uintptr_t sender[[gnu::unused]], Message::Prepare &&msg) {
        if(!verify_message(msg))
            return;
        if(_state.prepare(msg.view, msg.req_id) && _state.commit(msg.view, msg.req_id))
            broadcast(commit(std::move(msg)));
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r14
movq %rdi, %rbx
movq %rdx, %rsi
callq 0x4c76
testb %al, %al
je 0x4a8d
leaq 0x60(%rbx), %r15
movl 0x20(%r14), %esi
movl 0x24(%r14), %edx
movq %r15, %rdi
callq 0x4c26
testb %al, %al
je 0x4a8d
movl 0x20(%r14), %esi
movl 0x24(%r14), %edx
movq %r15, %rdi
callq 0x4db8
testb %al, %al
je 0x4a8d
movq 0x20(%r14), %rax
leaq -0x50(%rbp), %rsi
movq %rax, 0x28(%rsi)
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x18(%rsi)
movups %xmm0, 0x8(%rsi)
movl $0x7, (%rsi)
movl $0x0, 0x30(%rsi)
movq %rbx, %rdi
callq 0x2726
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/frolosofsky[P]pbft/./pbft.h
// Function: PBFTNode::process(unsigned long, Message::Commit&&)
void process(uintptr_t sender[[gnu::unused]], Message::Commit &&msg) {
        if(!verify_message(msg))
            return;
        if(_state.commit(msg.view, msg.req_id) && _state.state() == State::Type::Committed)
            success(msg.client, msg.msg);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
movq %rdx, %rsi
callq 0x4e06
testb %al, %al
je 0x4ade
leaq 0x60(%r14), %rdi
movl 0x20(%rbx), %esi
movl 0x24(%rbx), %edx
callq 0x4db8
testb %al, %al
je 0x4ade
cmpl $0x5, 0x60(%r14)
jne 0x4ade
movq 0x18(%rbx), %rsi
movq %r14, %rdi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %rbp
jmp 0x4f48
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/frolosofsky[P]pbft/./pbft.h
// Function: State::prepare(unsigned int, unsigned int)
bool prepare(uint32_t view, uint32_t req_id) {
        if(_view != view || _req_id != req_id)
            return false;
        switch(_state) {
        case Type::Init:
            return false;
        case Type::PrePrepare:
            _state = Type::Prepare;
            _approves = 0;
            FALLTHROUGH;
        case Type::Prepare:
            ++_approves;
            if(_approves >= _f * 2) {
                _state = Type::Prepared;
                _approves = 1;
            }
            return true;
        case Type::Prepared:
        case Type::Commit:
        case Type::Committed:
            return false;
        }
        return false; // happy gcc
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %eax, %eax
cmpl %esi, 0x8(%rdi)
jne 0x4c73
cmpl %edx, 0xc(%rdi)
jne 0x4c73
movl (%rdi), %eax
cmpl $0x1, %eax
je 0x4c49
cmpl $0x2, %eax
jne 0x4c71
movl 0x4(%rdi), %ecx
incl %ecx
jmp 0x4c54
movl $0x2, (%rdi)
movl $0x1, %ecx
movl %ecx, 0x4(%rdi)
movl 0x10(%rdi), %edx
addl %edx, %edx
movb $0x1, %al
cmpl %edx, %ecx
jl 0x4c73
movabsq $0x100000003, %rcx      # imm = 0x100000003
movq %rcx, (%rdi)
jmp 0x4c73
xorl %eax, %eax
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/frolosofsky[P]pbft/./pbft.h
// Function: PBFTNode::success(unsigned long, Message::OpRequestMessage const&)
void success(uintptr_t client, Message::OpRequestMessage const &msg) {
        if(_success_strategy == nullptr)
            return;
        auto answer = _success_strategy->accept(msg);
        auto sig = signature(digest(answer), id());
        send_to(client, Message::Response{std::move(answer), sig});
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
movq 0x90(%rdi), %rsi
testq %rsi, %rsi
je 0x4ff0
movq %rdi, %r14
movq (%rsi), %rax
leaq -0x30(%rbp), %r15
movq %r15, %rdi
callq *0x10(%rax)
movl (%r15), %eax
movl %eax, -0x68(%rbp)
cmpl $0x7, %eax
ja 0x501a
cmpl $0x1, %eax
je 0x4fa4
cmpl $0x3, %eax
jne 0x4ffb
movslq -0x24(%rbp), %rax
movabsq $0x3000000000000000, %r15 # imm = 0x3000000000000000
addq %rax, %r15
jmp 0x4fb2
movabsq $0x1000000000000000, %r15 # imm = 0x1000000000000000
addq -0x20(%rbp), %r15
movq %r14, %rdi
callq 0x23ac
shrq %rax
addq %r15, %rax
movq -0x20(%rbp), %rcx
leaq -0x68(%rbp), %rdx
movq %rcx, 0x18(%rdx)
movups -0x30(%rbp), %xmm0
movups %xmm0, 0x8(%rdx)
movl $0x4, (%rdx)
movq %rax, 0x20(%rdx)
movl $0x0, 0x30(%rdx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x25d6
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x110f(%rip), %rdi      # 0x6111
leaq 0x148e(%rip), %rsi      # 0x6497
leaq 0x1496(%rip), %rcx      # 0x64a6
movl $0x77, %edx
callq 0x20c0
leaq -0x68(%rbp), %rsi
movl $0x0, 0x30(%rsi)
movq 0x4fac(%rip), %rdi      # 0x9fd8
callq 0x3e9b
movq %rax, %rdi
callq 0x2090
leaq 0x10d1(%rip), %rdi      # 0x6111
leaq 0x1426(%rip), %rsi      # 0x646d
leaq 0x142a(%rip), %rcx      # 0x6478
movl $0x26, %edx
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O3/frolosofsky[P]pbft/main.cpp
// Function: PBFT_DB::accept(Message::OpRequestMessage const&)
Message::OpResponseMessage accept(Message::OpRequestMessage const &msg) override {
        switch(msg.type) {
        case Message::Type::Write:
            return accept(msg.data.write);
        case Message::Type::Read:
            return accept(msg.data.read);
        case Message::Type::WriteAck:
        case Message::Type::ReadAck:
        case Message::Type::Response:
        case Message::Type::PrePrepare:
        case Message::Type::Prepare:
        case Message::Type::Commit:
            assert(not("Unreachable"));
        }
        return Message::ReadOpResponse{false, 0}; // happy gcc
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rdx), %eax
cmpq $0x7, %rax
ja 0x511f
leaq 0x126a(%rip), %rcx      # 0x6340
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addq $0x8, %rdx
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x5174
movl $0x1, (%rbx)
movb %al, 0x8(%rbx)
movl $0x10, %eax
jmp 0x5146
movq 0x8(%rdx), %rax
movq 0x8(%rsi), %rdx
movq 0x10(%rsi), %rcx
subq %rdx, %rcx
sarq $0x2, %rcx
cmpq %rcx, %rax
jae 0x512e
movl (%rdx,%rax,4), %esi
shlq $0x20, %rsi
jmp 0x5130
movl $0x3, (%rbx)
movl $0x8, %eax
xorl %edx, %edx
jmp 0x5146
xorl %esi, %esi
xorl %edx, %edx
cmpq %rcx, %rax
setb %dl
orq %rsi, %rdx
movl $0x3, (%rbx)
movl $0x8, %eax
movq %rdx, (%rbx,%rax)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0xfb6(%rip), %rdi       # 0x6111
leaq 0x12df(%rip), %rsi      # 0x6441
leaq 0x145d(%rip), %rcx      # 0x65c6
movl $0x14, %edx
callq 0x20c0
nop
// File: /workspace/github_cpp_makefile_star2_O3/frolosofsky[P]pbft/main.cpp
// Function: Simulator::tick()
void tick() {
        for(auto &l : _links)
            l->on_tick();
        for(auto &n : _nodes)
            if(n != nullptr)
                n->on_tick();
        if(_client->ready() && _actions.size() > 0) {
            _client->action(std::move(_actions.front()), alive_nodes());
            _actions.erase(_actions.begin());
        }
        _client->on_tick();
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %r14
movq 0x30(%rdi), %r15
cmpq %r15, %r14
je 0x554c
movq (%r14), %rdi
callq 0x2b98
addq $0x10, %r14
jmp 0x5539
movq 0x10(%rbx), %r14
movq 0x18(%rbx), %r15
cmpq %r15, %r14
je 0x556d
movq (%r14), %rdi
testq %rdi, %rdi
je 0x5567
movq (%rdi), %rax
callq *0x10(%rax)
addq $0x10, %r14
jmp 0x5554
movq (%rbx), %rdi
movl 0x60(%rdi), %eax
cmpl 0x64(%rdi), %eax
jne 0x55c8
cmpq $0x0, 0x50(%rbx)
je 0x55c8
movq 0x40(%rbx), %rsi
addq $0x10, %rsi
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rcx
xorl %edx, %edx
cmpq %rcx, %rax
je 0x55a3
cmpq $0x1, (%rax)
sbbl $-0x1, %edx
addq $0x10, %rax
jmp 0x5591
callq 0x55d8
movq 0x40(%rbx), %r14
decq 0x50(%rbx)
movq %r14, %rdi
callq 0x21b0
movl $0x20, %esi
movq %r14, %rdi
callq 0x2140
movq (%rbx), %rdi
movq (%rdi), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmpq *0x10(%rax)
// File: /workspace/github_cpp_makefile_star2_O3/frolosofsky[P]pbft/main.cpp
// Function: ClientNode::action(Message::OpRequestMessage&&, int)
void action(Message::OpRequestMessage &&msg, int answers) {
        std::cout << "Send " << msg << std::endl;
        broadcast(std::move(msg)); // don't care. only primary node should process it
        _actual_answers = 0;
        _expected_answers = answers;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
movq 0x49e0(%rip), %rdi      # 0x9fd8
leaq 0x103a(%rip), %rsi      # 0x6639
movl $0x5, %edx
callq 0x2160
movl (%r15), %eax
movl %eax, -0x60(%rbp)
cmpq $0x7, %rax
ja 0x5632
movq 0x8(%r15), %rcx
leaq 0xd40(%rip), %rdx       # 0x6360
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movl %ecx, -0x58(%rbp)
jmp 0x5632
movq %rcx, -0x58(%rbp)
leaq -0x60(%rbp), %r12
movl $0x0, 0x30(%r12)
movq 0x4992(%rip), %rdi      # 0x9fd8
movq %r12, %rsi
callq 0x3e9b
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20e0
movl (%r15), %eax
movl %eax, (%r12)
cmpq $0x7, %rax
ja 0x56a6
leaq 0xcf4(%rip), %rcx       # 0x6380
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x8(%r15), %eax
movl %eax, -0x58(%rbp)
jmp 0x56a6
movq 0x8(%r15), %rax
movq %rax, -0x58(%rbp)
xorl %r15d, %r15d
leaq -0x60(%rbp), %rsi
movl %r15d, 0x30(%rsi)
movq %r14, %rdi
callq 0x2726
movl %r15d, 0x64(%r14)
movl %ebx, 0x60(%r14)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa3a(%rip), %rdi       # 0x6111
leaq 0xdb9(%rip), %rsi       # 0x6497
leaq 0xe50(%rip), %rcx       # 0x6535
movl $0x66, %edx
callq 0x20c0
nop
// File: /workspace/github_cpp_makefile_star2_O3/cphinton42[P]hinton-language/src/ast.cpp
// Function: print_dot(Print_Buffer*, Array<Decl_AST*>)
void print_dot(Print_Buffer *pb, Array<Decl_AST*> decls)
{
    print_buf(pb, "digraph decls {\n");
    
    for(u64 i = 0; i < decls.count; ++i)
    {
        print_dot_rec(pb, decls[i]);
    }
    
    print_buf(pb, "}\n");
    flush_buffer(pb);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0xd4a5(%rip), %rsi      # 0x10d06
xorl %eax, %eax
callq 0x38a8
testq %r15, %r15
je 0x3884
xorl %r12d, %r12d
movq (%r14,%r12,8), %rsi
movq %rbx, %rdi
callq 0x3971
incq %r12
cmpq %r12, %r15
jne 0x3870
leaq 0xd48c(%rip), %rsi      # 0x10d17
movq %rbx, %rdi
xorl %eax, %eax
callq 0x38a8
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x40e9
// File: /workspace/github_cpp_makefile_star2_O3/cphinton42[P]hinton-language/src/io.cpp
// Function: print_buf(Print_Buffer*, char const*, ...)
void print_buf(Print_Buffer *pb, const byte *fmt, ...)
{
    va_list args;
    va_start(args, fmt);
    vprint_buf(pb, fmt, args);
    va_end(args);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x20(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x3908
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsi, 0x10(%rsp)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
movq 0x8(%rdi), %rdx
leaq 0x200(%rdx), %rax
cmpq %rax, 0x18(%rdi)
jae 0x3945
movq %rbx, %rdi
callq 0x40e9
movq 0x8(%rbx), %rdx
addq 0x10(%rbx), %rdx
leaq 0x3850(%rip), %rdi      # 0x71a0
movq %rsp, %r8
movq %rbx, %rsi
movq %r14, %rcx
callq 0xa229
movq %rbx, %rdi
callq 0x40e9
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/cphinton42[P]hinton-language/src/io.cpp
// Function: flush_buffer(Print_Buffer*)
void flush_buffer(Print_Buffer *pb)
{
    assert(pb->fd >= 0);
    assert(pb->buffer.data);
    
    if(pb->buffer.count)
    {
        // TODO: handle error and/or return error code ?
        s64 result = write(pb->fd, pb->buffer.data, pb->buffer.count);
        pb->buffer.count = 0;
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %edi
testl %edi, %edi
js 0x4114
movq 0x10(%rbx), %rsi
testq %rsi, %rsi
je 0x4133
movq 0x8(%rbx), %rdx
testq %rdx, %rdx
je 0x4112
callq 0x3040
movq $0x0, 0x8(%rbx)
popq %rbx
retq
leaq 0xd057(%rip), %rdi      # 0x11172
leaq 0xd01c(%rip), %rsi      # 0x1113e
leaq 0xd055(%rip), %rcx      # 0x1117e
movl $0x91, %edx
callq 0x3080
leaq 0xd066(%rip), %rdi      # 0x111a0
leaq 0xcffd(%rip), %rsi      # 0x1113e
leaq 0xd036(%rip), %rcx      # 0x1117e
movl $0x92, %edx
callq 0x3080
// File: /workspace/github_cpp_makefile_star2_O3/cphinton42[P]hinton-language/src/io.cpp
// Function: print_err(char const*, ...)
void print_err(const byte *fmt, ...)
{
    va_list args;
    va_start(args, fmt);
    vprint_buf(&stderr_buf, fmt, args);
    va_end(args);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x41cc
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rdi, 0x10(%rsp)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rsp)
movq 0x11d35(%rip), %rdx     # 0x15f28
leaq 0x200(%rdx), %rax
cmpq %rax, 0x11d37(%rip)     # 0x15f38
jae 0x4216
leaq 0x11d16(%rip), %rdi     # 0x15f20
callq 0x40e9
movq 0x11d12(%rip), %rdx     # 0x15f28
leaq 0x11d03(%rip), %r14     # 0x15f20
addq 0x11d0c(%rip), %rdx     # 0x15f30
leaq 0x2f75(%rip), %rdi      # 0x71a0
movq %rsp, %r8
movq %r14, %rsi
movq %rbx, %rcx
callq 0xa229
movq %r14, %rdi
callq 0x40e9
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/cphinton42[P]hinton-language/src/check.cpp
// Function: print_jobs(Array<Job>)
void print_jobs(Array<Job> jobs)
{
    for(u64 i = 0; i < jobs.count; ++i)
    {
        Job *job = &jobs[i];
        AST *ast = job->typecheck.ast;
        print_err("Waiting job %lu:\n\tStage: %lu\n\tLocation: %lu:%lu\n\tAST_Type: %s\n", i, job->stage, ast->line_number, ast->line_offset, ast_type_names[(u64)ast->type]);
    }
}

// Assembly:
testq %rdi, %rdi
je 0x6e60
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
addq $0x10, %rbx
leaq 0xe2a1(%rip), %r13      # 0x150c0
leaq 0xa267(%rip), %r15      # 0x1108d
xorl %r12d, %r12d
movq (%rbx), %rax
movl -0xc(%rbx), %edx
movl 0x8(%rax), %ecx
movl 0xc(%rax), %r8d
movzwl (%rax), %eax
movq (%r13,%rax,8), %r9
movq %r15, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x416b
incq %r12
addq $0x18, %rbx
cmpq %r12, %r14
jne 0x6e29
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/cphinton42[P]hinton-language/src/check.cpp
// Function: typecheck_all(Pool_Allocator*, Array<Decl_AST*>)
bool typecheck_all(Pool_Allocator *ast_pool, Array<Decl_AST*> decls)
{
    Dynamic_Array<Job> job_arrays[2] = {0};
    auto current = &job_arrays[0];
    auto next = &job_arrays[1];
    
    Context ctx;
    ctx.ast_pool = ast_pool;
    ctx.waiting_jobs = next;
    ctx.success = true;
    
    for(u64 i = 0; i < decls.count; ++i)
    {
        auto job = make_typecheck_job(nullptr, decls[i]);
        do_typecheck_job(&ctx, job);
    }
    
    if(!ctx.success)
    {
        print_err("Success flag was unset (1)\n");
        return false;
    }
    
    while(true)
    {
        auto tmp = current;
        current = next;
        next = tmp;
        
        if(current->count == 0)
        {
            return true;
        }
        next->count = 0;
        ctx.waiting_jobs = next;
        
        bool change = false;
        for(u64 i = 0; i < current->count; ++i)
        {
            if(do_typecheck_job(&ctx, (*current)[i]))
            {
                change = true;
            }
        }
        
        if(!ctx.success)
        {
            print_err("Success flag was unset (2)\n");
            return false;
        }
        else if(!change)
        {
            // TODO: detect error
            print_err("Error: no progress (%lu waiting jobs)\n", next->count);
            print_jobs(next->array);
            return false;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
xorps %xmm0, %xmm0
leaq 0x68(%rsp), %r12
movaps %xmm0, 0x8(%r12)
movaps %xmm0, -0x8(%r12)
movaps %xmm0, -0x18(%r12)
movq %rdi, 0x18(%rsp)
movq %r12, 0x20(%rsp)
movb $0x1, 0x28(%rsp)
testq %rsi, %rsi
je 0x6ee4
movq %rdx, %rbx
movq %rsi, %r14
xorl %r13d, %r13d
leaq 0x18(%rsp), %r15
movq (%rbx,%r13,8), %rax
movaps %xmm0, 0x30(%rsp)
movq %rax, 0x40(%rsp)
movq %rax, 0x10(%rsp)
movaps 0x30(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
callq 0x42b2
xorps %xmm0, %xmm0
incq %r13
cmpq %r13, %r14
jne 0x6eae
testb $0x1, 0x28(%rsp)
je 0x6f56
leaq 0x50(%rsp), %r15
leaq 0x18(%rsp), %rbx
cmpq $0x0, (%r12)
je 0x6f5f
movq %r15, %r14
movq %r12, %r15
movq $0x0, (%r14)
movq %r14, 0x20(%rsp)
cmpq $0x0, (%r12)
je 0x6f63
xorl %r12d, %r12d
xorl %ebp, %ebp
xorl %r13d, %r13d
movq 0x8(%r15), %rax
movq 0x10(%rax,%r12), %rcx
movq %rcx, 0x10(%rsp)
movups (%rax,%r12), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x42b2
orb %al, %r13b
incq %rbp
addq $0x18, %r12
cmpq (%r15), %rbp
jb 0x6f16
cmpb $0x0, 0x28(%rsp)
je 0x6f8b
movq %r14, %r12
testb $0x1, %r13b
jne 0x6eee
jmp 0x6f6a
leaq 0xa16f(%rip), %rdi      # 0x110cc
jmp 0x6f92
movb $0x1, %bl
jmp 0x6f9b
cmpb $0x0, 0x28(%rsp)
je 0x6f8b
movq (%r14), %rsi
leaq 0xa190(%rip), %rdi      # 0x11104
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x416b
movq (%r14), %rdi
movq 0x8(%r14), %rsi
callq 0x6e00
jmp 0x6f9b
leaq 0xa156(%rip), %rdi      # 0x110e8
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x416b
movl %ebx, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/cphinton42[P]hinton-language/src/io.cpp
// Function: read_entire_file(char const*)
String read_entire_file(const byte *file_name)
{
    String result = {0};
    
    int fd = open(file_name, O_CLOEXEC | O_RDONLY, 0);
    if(fd < 0)
    {
        return result;
    }
    defer {
        close(fd);
    };
    
    struct stat file_info;
    
    int status = fstat(fd, &file_info);
    if(status < 0)
    {
        return result;
    }
    
    u64 len = file_info.st_size;
    
    byte *memory = mem_alloc(byte, len+1);
    if(!memory)
    {
        return result;
    }
    
    u64 bytes_read = read(fd, memory, len);
    if(bytes_read < len)
    {
        mem_dealloc(memory, len+1);
        return result;
    }
    
    result.count = len+1;
    result.data = memory;
    result[len] = '\0';
    
    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x98, %rsp
xorl %r14d, %r14d
movl $0x80000, %esi          # imm = 0x80000
xorl %edx, %edx
xorl %eax, %eax
callq 0x3090
testl %eax, %eax
js 0x7049
movl %eax, %ebx
leaq 0x8(%rsp), %rsi
movl %eax, %edi
callq 0x30f0
testl %eax, %eax
js 0x7041
movq 0x38(%rsp), %r12
leaq 0x1(%r12), %r15
movq 0xeb7b(%rip), %rdi      # 0x15b70
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r15, %r8
callq *0xeb64(%rip)           # 0x15b68
movq %rax, %r14
testq %rax, %rax
je 0x7041
movl %ebx, %edi
movq %r14, %rsi
movq %r12, %rdx
callq 0x30d0
cmpq %r12, %rax
jae 0x704e
movq 0xeb4b(%rip), %rdi      # 0x15b70
movl $0x2, %esi
movq %r14, %rdx
movq %r15, %rcx
xorl %r8d, %r8d
callq *0xeb2f(%rip)           # 0x15b68
xorl %r14d, %r14d
xorl %r15d, %r15d
jmp 0x7053
xorl %r14d, %r14d
xorl %r15d, %r15d
jmp 0x7053
xorl %r15d, %r15d
jmp 0x705a
movb $0x0, (%r14,%r12)
movl %ebx, %edi
callq 0x3120
movq %r15, %rax
movq %r14, %rdx
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x7071
movq %rax, %r14
movl %ebx, %edi
callq 0x3120
movq %r14, %rdi
callq 0x3100
jmp 0x7085
movq %rax, %rdi
callq 0xee13
// File: /workspace/github_cpp_makefile_star2_O3/cphinton42[P]hinton-language/src/io.cpp
// Function: make_print_buffer(int, unsigned long)
Print_Buffer make_print_buffer(int fd, u64 buffer_size)
{
    Print_Buffer result;
    result.fd = fd;
    result.buffer.count = 0;
    result.buffer.data = mem_alloc(byte, buffer_size);
    result.buffer.allocated = buffer_size;
    
    assert(result.buffer.data);
    
    return result;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
movl %esi, (%rdi)
movq $0x0, 0x8(%rdi)
movq 0xeac8(%rip), %rdi      # 0x15b70
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r14, %r8
callq *0xeab1(%rip)           # 0x15b68
movq %rax, 0x10(%rbx)
movq %r14, 0x18(%rbx)
testq %rax, %rax
je 0x70cf
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xa055(%rip), %rdi      # 0x1112b
leaq 0xa061(%rip), %rsi      # 0x1113e
leaq 0xa065(%rip), %rcx      # 0x11149
movl $0x3e, %edx
callq 0x3080
// File: /workspace/github_cpp_makefile_star2_O3/cphinton42[P]hinton-language/src/io.cpp
// Function: make_file_print_buffer(char const*, unsigned long)
Print_Buffer make_file_print_buffer(const byte *file_name, u64 buffer_size)
{
    // Note: let umask decide the file permissions (except execute)
    int file = open(file_name, O_CLOEXEC | O_WRONLY | O_APPEND | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
    
    if(file < 0)
    {
        Print_Buffer result = {0};
        result.fd = file;
        return result;
    }
    else
    {
        return make_print_buffer(file, buffer_size);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
movq %rsi, %rdi
movl $0x80441, %esi          # imm = 0x80441
movl $0x1b6, %edx            # imm = 0x1B6
xorl %eax, %eax
callq 0x3090
testl %eax, %eax
js 0x711f
movq %rbx, %rdi
movl %eax, %esi
movq %r14, %rdx
callq 0x708d
jmp 0x712b
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movups %xmm0, 0x10(%rbx)
movl %eax, (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/cphinton42[P]hinton-language/src/io.cpp
// Function: print(char const*, ...)
void print(const byte *fmt, ...)
{
    va_list args;
    va_start(args, fmt);
    vprint_buf(&stdout_buf, fmt, args);
    va_end(args);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x7239
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rdi, 0x10(%rsp)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rsp)
movq 0xeca8(%rip), %rdx      # 0x15f08
leaq 0x200(%rdx), %rax
cmpq %rax, 0xecaa(%rip)      # 0x15f18
jae 0x7283
leaq 0xec89(%rip), %rdi      # 0x15f00
callq 0x40e9
movq 0xec85(%rip), %rdx      # 0x15f08
leaq 0xec76(%rip), %r14      # 0x15f00
addq 0xec7f(%rip), %rdx      # 0x15f10
leaq -0xf8(%rip), %rdi       # 0x71a0
movq %rsp, %r8
movq %r14, %rsi
movq %rbx, %rcx
callq 0xa229
movq %r14, %rdi
callq 0x40e9
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/cphinton42[P]hinton-language/src/io.cpp
// Function: free_buffer(Print_Buffer*, bool)
void free_buffer(Print_Buffer *pb, bool close_file)
{
    if(close_file && pb->fd >= 0)
    {
        close(pb->fd);
        pb->fd = -1;
    }
    if(pb->buffer.data)
    {
        mem_dealloc(pb->buffer.data, pb->buffer.allocated);
        zero_struct(&pb->buffer);
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testl %esi, %esi
je 0x72d2
movl (%rbx), %edi
testl %edi, %edi
js 0x72d2
callq 0x3120
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
movq 0x10(%rbx), %rdx
testq %rdx, %rdx
je 0x7303
movq 0x18(%rbx), %rcx
movq 0xe88a(%rip), %rdi      # 0x15b70
movl $0x2, %esi
xorl %r8d, %r8d
callq *0xe874(%rip)           # 0x15b68
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
movq $0x0, 0x18(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/cphinton42[P]hinton-language/src/io.cpp
// Function: print_err_indented(char*, char*, bool)
void print_err_indented(byte *start, byte *end, bool indent_first)
{
    bool indent = indent_first;
    
    if(start == end && indent)
    {
        print_err("    ");
    }
    
    while(start < end)
    {
        byte *end_section = start;
        while(end_section < end)
        {
            byte b = *end_section;
            ++end_section;
            
            if(b == '\r')
            {
                if(end_section < end && *end_section == '\n')
                {
                    ++end_section;
                }
                break;
            }
            else if(b == '\n')
            {
                break;
            }
        }
        
        if(indent)
        {
            print_err("    %.*s", (u32)(end_section - start), start);
        }
        else
        {
            print_err("%.*s", (u32)(end_section - start), start);
            indent = true;
        }
        
        start = end_section;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movl %ebp, %eax
xorb $0x1, %al
cmpq %rsi, %rdi
setne %cl
orb %al, %cl
jne 0x7331
leaq 0x9e86(%rip), %rdi      # 0x111b0
xorl %eax, %eax
callq 0x416b
cmpq %rbx, %r14
jae 0x7393
leaq 0x9e78(%rip), %r15      # 0x111b5
leaq 0x9e75(%rip), %rdi      # 0x111b9
testb %bpl, %bpl
cmovneq %r15, %rdi
movq %r14, %r12
cmpq %rbx, %r12
jae 0x7378
movzbl (%r12), %eax
incq %r12
cmpl $0xa, %eax
je 0x7378
cmpl $0xd, %eax
jne 0x734e
cmpq %rbx, %r12
jae 0x7378
leaq 0x1(%r12), %rax
cmpb $0xa, (%r12)
cmoveq %rax, %r12
movl %r12d, %esi
subl %r14d, %esi
movq %r14, %rdx
xorl %eax, %eax
callq 0x416b
movq %r12, %r14
movq %r15, %rdi
cmpq %rbx, %r12
jb 0x734e
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/cphinton42[P]hinton-language/src/lex.cpp
// Function: report_error(Array<char>, char*, char*, unsigned int, unsigned int, char const*)
internal void report_error(String program_text, byte *start_tok, byte *current, u32 line_number, u32 line_offset, const byte *error_text)
{
    byte *start_program = program_text.data;
    byte *end_program = start_program + program_text.count;
    
    byte *start = start_tok;
    byte *end = current;
    while(start > start_program)
    {
        if(*start == '\n' || *start == '\r')
        {
            ++start;
            break;
        }
        else
        {
            --start;
        }
    }
    while(end < end_program)
    {
        byte b = *end;
        ++end;
        
        if(b == '\r')
        {
            if(end < end_program && *end == '\n')
            {
                ++end;
            }
            break;
        }
        else if(b == '\n')
        {
            break;
        }
    }
    
    // TODO: remove color codes when not outputing to a terminal
    // TODO: perhaps change to highlight in the program text, rather than use an arrow ?
    
    print_err("\x1B[1;31mError\x1B[0m: %d:%d:\n    %s\n", line_number, line_offset, error_text);
    print_err_indented(start, start_tok);
    
    print_err("\x1B[1;33m%.*s\x1B[1;31m%c\x1B[0m", (u32)(current - start_tok), start_tok, *current);
    
    if(current != end)
    {
        print_err_indented(current+1, end, false);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rdx, %r15
cmpq %rsi, %rdx
jbe 0x8a8a
movq %r14, %r15
movzbl (%r15), %eax
cmpl $0xd, %eax
je 0x8a87
cmpl $0xa, %eax
je 0x8a87
decq %r15
cmpq %rsi, %r15
ja 0x8a6c
movq %rsi, %r15
jmp 0x8a8a
incq %r15
movq 0x30(%rsp), %rcx
addq %rdi, %rsi
movq %rbx, %r12
cmpq %rsi, %r12
jae 0x8abf
movzbl (%r12), %eax
incq %r12
cmpl $0xa, %eax
je 0x8abf
cmpl $0xd, %eax
jne 0x8a95
cmpq %rsi, %r12
jae 0x8abf
leaq 0x1(%r12), %rax
cmpb $0xa, (%r12)
cmoveq %rax, %r12
leaq 0x878c(%rip), %rdi      # 0x11252
movl %r8d, %esi
movl %r9d, %edx
xorl %eax, %eax
callq 0x416b
movq %r15, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x7305
movl %ebx, %esi
subl %r14d, %esi
movsbl (%rbx), %ecx
leaq 0x90ed(%rip), %rdi      # 0x11bdf
movq %r14, %rdx
xorl %eax, %eax
callq 0x416b
cmpq %rbx, %r12
je 0x8b1c
incq %rbx
movq %rbx, %rdi
movq %r12, %rsi
xorl %edx, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x7305
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/cphinton42[P]hinton-language/src/parse.cpp
// Function: parse_tokens(Parsing_Context*)
Dynamic_Array<Decl_AST*> parse_tokens(Parsing_Context *ctx)
{
    Dynamic_Array<Decl_AST*> result = {0};
    
    Token *current = ctx->tokens.data;
    Token *start_section = current;
    
    while(current->type != Token_Type::eof)
    {
        start_section = current;
        Decl_AST *decl = parse_decl(ctx, &current, Decl_Type::Statement);
        if(decl)
        {
            array_add(&result, decl);
        }
        else
        {
            while(true)
            {
                if(current->type == Token_Type::eof)
                {
                    break;
                }
                else if(current->type == Token_Type::semicolon)
                {
                    ++current;
                    break;
                }
                else
                {
                    ++current;
                }
            }
        }
    }
    
    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x18(%rsi), %rax
movq %rax, 0x8(%rsp)
cmpq $0x41, (%rax)
jne 0x90d2
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rsi, %r14
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x9369
testq %rax, %rax
je 0x910c
movq 0xca75(%rip), %rdx      # 0x15b68
movq 0xca76(%rip), %rcx      # 0x15b70
movq %rbx, %rdi
movq %rax, %rsi
callq 0xe765
movq 0x8(%rsp), %rax
jmp 0x912a
movq 0x8(%rsp), %rax
addq $0x20, %rax
movq -0x20(%rax), %rcx
cmpq $0x41, %rcx
je 0x90c5
cmpq $0x21, %rcx
jne 0x9111
movq %rax, 0x8(%rsp)
cmpq $0x41, (%rax)
jne 0x90da
jmp 0x90c5
// File: /workspace/github_cpp_makefile_star2_O3/cphinton42[P]hinton-language/src/scope.cpp
// Function: fnv1a_64(Array<char>)
u64 fnv1a_64(String s)
{
    const u64 offset_basis = 14695981039346656037UL;
    const u64 FNV_prime = 1099511628211UL;
    
    u64 hash = offset_basis;
    
    for(u64 i = 0; i < s.count; ++i)
    {
        hash ^= s.data[i];
        hash *= FNV_prime;
    }
    return hash;
}

// Assembly:
movabsq $-0x340d631b7bdddcdb, %r8 # imm = 0xCBF29CE484222325
testq %rdi, %rdi
je 0x9165
xorl %ecx, %ecx
movabsq $0x100000001b3, %rdx    # imm = 0x100000001B3
movsbq (%rsi,%rcx), %rax
xorq %r8, %rax
imulq %rdx, %rax
incq %rcx
movq %rax, %r8
cmpq %rcx, %rdi
jne 0x914d
retq
movq %r8, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O3/cphinton42[P]hinton-language/src/scope.cpp
// Function: create_scope_metadata(Scoping_Context*, Array<Decl_AST*>)
bool create_scope_metadata(Scoping_Context *ctx, Array<Decl_AST*> decls)
{
    ctx->success = true;
    
    Hashed_Scope *file_scope = pool_alloc(Hashed_Scope, ctx->ast_pool);
    init_hashed_scope(file_scope, nullptr, 0, 16);
    
    for(u64 i = 0; i < decls.count; ++i)
    {
        create_scope_metadata(ctx, nullptr, IDENT_DECL, file_scope, 0, decls[i]);
    }
    return ctx->success;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movb $0x1, 0x10(%rdi)
movq 0x8(%rdi), %rdi
movl $0x30, %esi
callq 0x962b
movq %rax, %r12
leaq 0x10(%rax), %rdi
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movl $0x10, %esi
callq 0xe7a6
testq %r15, %r15
je 0x91fa
xorl %r13d, %r13d
movq (%rbx,%r13,8), %r9
movl $0x2, %edx
movq %r14, %rdi
xorl %esi, %esi
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x9b53
incq %r13
cmpq %r13, %r15
jne 0x91d9
movb 0x10(%r14), %al
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/cphinton42[P]hinton-language/src/pool_allocator.cpp
// Function: pool_alloc_func(void*, Allocator_Mode, void*, unsigned long, unsigned long)
void *pool_alloc_func(void *data, Allocator_Mode mode, void *old_ptr, u64 old_size, u64 new_size)
{
    Pool_Allocator *pool = static_cast<Pool_Allocator*>(data);
    if(mode == Allocator_Mode::alloc)
    {
        return pool_alloc_(pool, new_size);
    }
    else if(mode == Allocator_Mode::resize)
    {
        // return pool_resize_(pool, old_ptr, old_size, new_size);
        return nullptr;
    }
    else if(mode == Allocator_Mode::dealloc)
    {
        // TODO: perhaps deallocate if the allocation was the most recent?
        assert(false);
        return nullptr;
    }
    
    assert(false);
    return nullptr;
}

// Assembly:
pushq %rax
testl %esi, %esi
je 0x95e6
cmpl $0x1, %esi
jne 0x95ef
xorl %eax, %eax
popq %rcx
retq
movq %r8, %rsi
popq %rax
jmp 0x962b
leaq 0x76da(%rip), %rdi      # 0x10cd0
cmpl $0x2, %esi
jne 0x9613
leaq 0x7c91(%rip), %rsi      # 0x11293
leaq 0x7ca1(%rip), %rcx      # 0x112aa
movl $0x19, %edx
callq 0x3080
leaq 0x7c79(%rip), %rsi      # 0x11293
leaq 0x7c89(%rip), %rcx      # 0x112aa
movl $0x1d, %edx
callq 0x3080