LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/chahk0129[P]hash_bench/./pcm/cpucounters.h
// Function: PCM::getQPILinksPerSocket() const
uint64 getQPILinksPerSocket() const
    {
        switch (cpu_model)
        {
        case NEHALEM_EP:
        case WESTMERE_EP:
        case CLARKDALE:
            if (num_sockets == 2)
                return 2;
            else
                return 1;
        case NEHALEM_EX:
        case WESTMERE_EX:
            return 4;
        case JAKETOWN:
        case IVYTOWN:
        case HASWELLX:
        case BDX_DE:
        case BDX:
            return (server_pcicfg_uncore.size() && server_pcicfg_uncore[0].get()) ? (server_pcicfg_uncore[0]->getNumQPIPorts()) : 0;
        }
        return 0;
    }

// Assembly:
movl 0x4(%rdi), %eax
leal -0x25(%rax), %ecx
cmpl $0xa, %ecx
jbe 0xe502
leal -0x3e(%rax), %ecx
cmpl $0x18, %ecx
ja 0xe4fb
movl $0x1020003, %edx        # imm = 0x1020003
btl %ecx, %edx
jb 0xe51f
cmpl $0x1a, %eax
je 0xe512
jmp 0xe544
leaq 0x1bd9b(%rip), %rax     # 0x2a2a4
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
xorl %eax, %eax
cmpl $0x2, 0x18(%rdi)
sete %al
incq %rax
retq
movq 0xd8(%rdi), %rax
cmpq %rax, 0xe0(%rdi)
je 0xe544
movq (%rax), %rcx
testq %rcx, %rcx
je 0xe544
movq 0x48(%rcx), %rax
subq 0x40(%rcx), %rax
sarq $0x4, %rax
retq
xorl %eax, %eax
retq
pushq $0x4
popq %rax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Sooryakiran[P]dotV/src/verilog.cpp
// Function: wire_name(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
wire wire_name(wire full_name){
    /*------------------------------------------------------------------------------------------
    This is a very usefull function to extract the wire name from a wire declaration string.

    Params : full_name (wire), full name including width. Example : "[9:0] my_wire"
    Returns : Parsed string, if input contains infomration about widths. Example : "my_wire"                      
    ------------------------------------------------------------------------------------------*/
    string delim = "] ";
    size_t index;
    if(string::npos != (index = full_name.find(delim, 0))){
        return full_name.substr(index + 2);
    }
    else{
        return full_name;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x13fed(%rip), %rsi     # 0x1f053
leaq -0x40(%rbp), %r15
leaq -0x19(%rbp), %rdx
movq %r15, %rdi
callq 0xac60
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0xaf00
cmpq $-0x1, %rax
je 0xb0a0
addq $0x2, %rax
pushq $-0x1
popq %rcx
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0xa7d0
jmp 0xb0ab
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa970
leaq -0x40(%rbp), %rdi
callq 0xa370
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0xa370
movq %rbx, %rdi
callq 0xad00
// File: /workspace/github_cpp_makefile_star2_O2/Sooryakiran[P]dotV/src/verilog.cpp
// Function: Chip::generate_verilog[abi:cxx11]()
string Chip::generate_verilog(){
    /*------------------------------------------------------------------------------------------
    This function generates a formated output string verilog code.       

    Params : None
    Returns : code (string), output verilog code                          
    ------------------------------------------------------------------------------------------*/
    string code = "// Generated code\n// Sooryakiran P\n// ME17B174\n";
    set<string> headers = this->define_headers();
    for (set<string>::iterator i = headers.begin(); i != headers.end(); i++){
        code += "\n" + *i + "\n";
    }
    return code;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x13f2c(%rip), %rsi     # 0x1f020
leaq -0x58(%rbp), %rdx
callq 0xac60
leaq -0x58(%rbp), %rdi
movq %r14, %rsi
callq 0xaa00
leaq -0x50(%rbp), %rax
movq 0x10(%rax), %r13
leaq 0x13ff0(%rip), %r14     # 0x1f108
leaq -0x78(%rbp), %r15
leaq -0x98(%rbp), %r12
leaq -0x50(%rbp), %rax
cmpq %rax, %r13
je 0xb171
leaq 0x20(%r13), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0xa6c0
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xa150
movq %rbx, %rdi
movq %r12, %rsi
callq 0xaeb0
movq %r12, %rdi
callq 0xa370
movq %r15, %rdi
callq 0xa370
movq %r13, %rdi
callq 0xa8c0
movq %rax, %r13
jmp 0xb123
leaq -0x58(%rbp), %rdi
callq 0xab70
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0xb1bc
movq %rax, %r14
jmp 0xb1b3
movq %rax, %r14
jmp 0xb1aa
movq %rax, %r14
leaq -0x98(%rbp), %rdi
callq 0xa370
leaq -0x78(%rbp), %rdi
callq 0xa370
leaq -0x58(%rbp), %rdi
callq 0xab70
movq %rbx, %rdi
callq 0xa370
movq %r14, %rdi
callq 0xad00
// File: /workspace/github_cpp_makefile_star2_O2/Sooryakiran[P]dotV/src/verilog.cpp
// Function: Chip::define_headers[abi:cxx11]()
set<string> Chip::define_headers(){
    /*------------------------------------------------------------------------------------------
    This function recursively iterates through all the submodules if any to generate a set of
    module definitions.         

    Params : None
    Returns : all_headers (set<string>), a set of all module and submodule definitions.                          
    ------------------------------------------------------------------------------------------*/
    set<string> all_headers;
    all_headers.insert(this->definition);

    for(vector<Chip>::iterator sub = this->submodules.begin();
                               sub != this->submodules.end();
                               sub++){
        set<string> sub_header = sub->define_headers();
        all_headers.insert(sub_header.begin(), sub_header.end());
    }

    return all_headers;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
andl $0x0, 0x8(%rdi)
andq $0x0, 0x10(%rdi)
movq %rsi, %r14
leaq 0x8(%rdi), %rax
movq %rax, 0x18(%rdi)
movq %rax, 0x20(%rdi)
andq $0x0, 0x28(%rdi)
addq $0x20, %rsi
callq 0xab90
movq 0x68(%r14), %r15
leaq -0x50(%rbp), %r12
leaq -0x58(%rbp), %r13
cmpq 0x70(%r14), %r15
je 0xb243
movq %r13, %rdi
movq %r15, %rsi
callq 0xaa00
movq -0x40(%rbp), %rsi
movq %rbx, %rdi
movq %r12, %rdx
callq 0xac10
movq %r13, %rdi
callq 0xab70
addq $0x198, %r15            # imm = 0x198
jmp 0xb212
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xb257
movq %rax, %r14
jmp 0xb268
movq %rax, %r14
leaq -0x58(%rbp), %rdi
callq 0xab70
movq %rbx, %rdi
callq 0xab70
movq %r14, %rdi
callq 0xad00
// File: /workspace/github_cpp_makefile_star2_O2/Sooryakiran[P]dotV/src/verilog.cpp
// Function: Chip::num_transistors()
int Chip::num_transistors(){
    /*------------------------------------------------------------------------------------------
    This function recursively iterates through all the submodules and behaviours if any to count
    the number of transistors required to create an instance.

    Params : None
    Returns : total (int), transitor count.                         
    ------------------------------------------------------------------------------------------*/
    int total = this->transistors;
    
    for(vector<Chip>::iterator sub = this->submodules.begin();
                               sub != this->submodules.end();
                               sub++){

        total += sub->num_transistors();
    }

    for(vector<BehaviourModel>::iterator sub = this->behaviours.begin();
                                         sub != this->behaviours.end();
                                         sub ++){
        total += sub->num_transistors;
    }

    return total;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
movl 0x60(%rdi), %ebx
movq 0x68(%rdi), %r15
movq 0x70(%rdi), %r12
cmpq %r12, %r15
je 0xb2a9
movq %r15, %rdi
callq 0xa7c0
addl %eax, %ebx
addq $0x198, %r15            # imm = 0x198
jmp 0xb291
movq 0x178(%r14), %rax
movq 0x180(%r14), %rcx
cmpq %rcx, %rax
je 0xb2c4
addl (%rax), %ebx
addq $0x38, %rax
jmp 0xb2b7
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Sooryakiran[P]dotV/src/verilog.cpp
// Function: BehaviourModel::code[abi:cxx11]()
string BehaviourModel::code(){
    /*------------------------------------------------------------------------------------------
    TReturns the verilog code for the current behaviour as string.

    Returns: outs(string), verilog code for the current behaviour.
    ------------------------------------------------------------------------------------------*/
    string outs = "always @(";
    
    for(vector<string>::iterator i = this->sensitivity_list.begin(); i != this->sensitivity_list.end(); i++){
        if(i != this->sensitivity_list.begin()){
            outs += " or ";
        }
        outs += *i;
    }
    outs += ")\nbegin";

    for(vector<string>::iterator i = this->statements.begin(); i != this->statements.end(); i++){
        outs += "\n\t" + *i + ";";
    }
    outs +="\nend";
    return outs;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x131bf(%rip), %rsi     # 0x1f147
leaq -0x48(%rbp), %rdx
callq 0xac60
movq 0x20(%r14), %r15
leaq 0x131b5(%rip), %r12     # 0x1f151
cmpq 0x28(%r14), %r15
je 0xbfc4
cmpq 0x20(%r14), %r15
je 0xbfb3
movq %rbx, %rdi
movq %r12, %rsi
callq 0xae40
movq %rbx, %rdi
movq %r15, %rsi
callq 0xaeb0
addq $0x20, %r15
jmp 0xbf9c
leaq 0x1318b(%rip), %rsi     # 0x1f156
movq %rbx, %rdi
callq 0xae40
movq 0x8(%r14), %r15
leaq -0x68(%rbp), %r13
leaq -0x48(%rbp), %r12
cmpq 0x10(%r14), %r15
je 0xc02a
movq %r13, %rdi
leaq 0x13140(%rip), %rsi     # 0x1f12f
movq %r15, %rdx
callq 0xa6c0
movq %r12, %rdi
movq %r13, %rsi
leaq 0x1370e(%rip), %rdx     # 0x1f712
callq 0xa150
movq %rbx, %rdi
movq %r12, %rsi
callq 0xaeb0
movq %r12, %rdi
callq 0xa370
movq %r13, %rdi
callq 0xa370
addq $0x20, %r15
jmp 0xbfdf
leaq 0x1312d(%rip), %rsi     # 0x1f15e
movq %rbx, %rdi
callq 0xae40
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc06b
jmp 0xc06b
movq %rax, %r14
jmp 0xc060
movq %rax, %r14
leaq -0x48(%rbp), %rdi
callq 0xa370
leaq -0x68(%rbp), %rdi
callq 0xa370
jmp 0xc06e
movq %rax, %r14
movq %rbx, %rdi
callq 0xa370
movq %r14, %rdi
callq 0xad00
// File: /workspace/github_cpp_makefile_star2_O2/Sooryakiran[P]dotV/src/verilog.cpp
// Function: BehaviourModel::BehaviourModel(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>)
BehaviourModel::BehaviourModel(vector<string> sense_list){
    /*------------------------------------------------------------------------------------------
    The class constructor. 

    Param: sense_list (vector<string>), Sensitivity list
    ------------------------------------------------------------------------------------------*/
    this->sensitivity_list = sense_list;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
andl $0x0, (%rdi)
leaq 0x8(%rdi), %rbx
leaq 0x20(%rdi), %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movups %xmm0, 0x18(%rdi)
movups %xmm0, 0x28(%rdi)
movq %r14, %rdi
callq 0xa810
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
movq %r14, %rdi
callq 0xa550
movq %rbx, %rdi
callq 0xa550
movq %r15, %rdi
callq 0xad00
// File: /workspace/github_cpp_makefile_star2_O2/Sooryakiran[P]dotV/src/verilog.cpp
// Function: BehaviourModel::add(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool)
void BehaviourModel::add(string lhs, string rhs, bool is_blocking){
    /*------------------------------------------------------------------------------------------
    Adds a new statement to the behaviour model.

    Param: lhs(string), Left hand side of the statement.
    Param: rhs(string), Right hand side of the statment.
    Param: is_blocking(bool), BLOCK/N_BLOCK for blovking or non blocking statements
    ------------------------------------------------------------------------------------------*/
    string asg = (is_blocking)? " = " : " <= " ;
    string expr = lhs + asg + rhs;
    this->statements.push_back(expr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x1304f(%rip), %rax     # 0x1f13e
leaq 0x1304c(%rip), %rsi     # 0x1f142
testl %ecx, %ecx
cmovneq %rax, %rsi
leaq -0x80(%rbp), %r12
leaq -0x40(%rbp), %rdx
movq %r12, %rdi
callq 0xac60
leaq -0x60(%rbp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xae70
leaq -0x40(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movq %r14, %rdx
callq 0xaaf0
leaq -0x60(%rbp), %rdi
callq 0xa370
addq $0x8, %rbx
leaq -0x40(%rbp), %rsi
movq %rbx, %rdi
callq 0xa3e0
leaq -0x40(%rbp), %rdi
callq 0xa370
leaq -0x80(%rbp), %rdi
callq 0xa370
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
jmp 0xc173
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0xa370
jmp 0xc17d
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0xa370
movq %rbx, %rdi
callq 0xad00
// File: /workspace/github_cpp_makefile_star2_O2/Sooryakiran[P]dotV/src/verilog.cpp
// Function: JOIN::JOIN(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
JOIN::JOIN(string name, wire a, wire b){
    this->name = name;
    this->inputs.push_back(a);
    this->inputs.push_back(b);
    this->transistors = 0;
    this->definition = "module JOIN(a, a);\n"
                       "\t inout a;\n"
                       "endmodule";
    this->generate = "JOIN " + this->name + " (" + this->inputs.at(0) + ", " + this->inputs.at(1) + ");";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xc0, %rsp
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
callq 0xa690
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa410
leaq 0x80(%rbx), %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0xa3e0
movq %r14, %rdi
movq %r15, %rsi
callq 0xa3e0
andl $0x0, 0x60(%rbx)
leaq 0x20(%rbx), %rdi
leaq 0x12f7b(%rip), %rsi     # 0x1f163
callq 0xae50
leaq 0x12f97(%rip), %rsi     # 0x1f18b
leaq -0x40(%rbp), %rdi
movq %rbx, %rdx
callq 0xa6c0
leaq 0x12e66(%rip), %rdx     # 0x1f06d
leaq -0x60(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0xa150
movq %r14, %rdi
xorl %esi, %esi
callq 0xa200
leaq -0x80(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movq %rax, %rdx
callq 0xaaf0
leaq 0x12e3b(%rip), %rdx     # 0x1f070
leaq -0xa0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0xa150
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0xa200
leaq -0xc0(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
movq %rax, %rdx
callq 0xaaf0
leaq 0x134a4(%rip), %rdx     # 0x1f711
leaq -0xe0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0xa150
addq $0x40, %rbx
leaq -0xe0(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa920
movq %r14, %rdi
callq 0xa370
leaq -0xc0(%rbp), %rdi
callq 0xa370
leaq -0xa0(%rbp), %rdi
callq 0xa370
leaq -0x80(%rbp), %rdi
callq 0xa370
leaq -0x60(%rbp), %rdi
callq 0xa370
leaq -0x40(%rbp), %rdi
callq 0xa370
addq $0xc0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq -0xc0(%rbp), %rdi
callq 0xa370
jmp 0xc301
movq %rax, %r14
jmp 0xc30d
movq %rax, %r14
jmp 0xc324
jmp 0xc32f
movq %rax, %r14
leaq -0xa0(%rbp), %rdi
callq 0xa370
leaq -0x80(%rbp), %rdi
callq 0xa370
jmp 0xc31b
movq %rax, %r14
leaq -0x60(%rbp), %rdi
callq 0xa370
leaq -0x40(%rbp), %rdi
callq 0xa370
jmp 0xc332
movq %rax, %r14
movq %rbx, %rdi
callq 0xa230
movq %r14, %rdi
callq 0xad00
// File: /workspace/github_cpp_makefile_star2_O2/nvanbenschoten[P]byzantine-agreement/src/main.cc
// Function: ValidateCommanderId(std::vector<net::Address, std::allocator<net::Address>>&, int)
void ValidateCommanderId(generals::ProcessList& processes, int commander_id) {
  // Make sure the commander_id is valid
  if (commander_id < 0 || (size_t)commander_id >= processes.size()) {
    throw args::ValidationError("commander_id does not reference a process");
  }
  // Move the commander to the first element in the vector
  std::iter_swap(processes.begin(), processes.begin() + commander_id);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
testl %esi, %esi
js 0x63a2
movq %rdi, %rax
movl %esi, %ecx
movq (%rdi), %rdi
movq 0x8(%rax), %rax
subq %rdi, %rax
pushq $0x28
popq %rsi
cqto
idivq %rsi
cmpq %rcx, %rax
jbe 0x63a2
imulq $0x28, %rcx, %rsi
addq %rdi, %rsi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0xcb2e
pushq $0x10
popq %rdi
callq 0x51c0
movq %rax, %rbx
leaq 0xd5ab(%rip), %rsi      # 0x1395f
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x852c
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x85f0
xorl %ebp, %ebp
leaq 0x18024(%rip), %rsi     # 0x1e400
movq 0x18b95(%rip), %rdx     # 0x1ef78
movq %rbx, %rdi
callq 0x55c0
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x56b8
testb %bpl, %bpl
jne 0x6402
jmp 0x640a
movq %rax, %r14
movq %rbx, %rdi
callq 0x5270
movq %r14, %rdi
callq 0x55e0
// File: /workspace/github_cpp_makefile_star2_O2/nvanbenschoten[P]byzantine-agreement/src/main.cc
// Function: ValidateFaultyCount(std::vector<net::Address, std::allocator<net::Address>> const&, int)
void ValidateFaultyCount(const generals::ProcessList& processes, int faulty) {
  if (faulty < 0) {
    throw args::ValidationError("faulty count must be non-negative");
  }
  if ((size_t)faulty + 2 > processes.size()) {
    throw args::ValidationError(
        "the total number of processes must be no less than (faulty + 2)");
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
testl %esi, %esi
js 0x643e
addl $0x2, %esi
movq 0x8(%rdi), %rax
subq (%rdi), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
cmpq %rsi, %rax
jb 0x6489
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x51c0
movq %rax, %rbx
leaq 0xd539(%rip), %rsi      # 0x13989
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x852c
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x85f0
xorl %ebp, %ebp
leaq 0x17f88(%rip), %rsi     # 0x1e400
movq 0x18af9(%rip), %rdx     # 0x1ef78
movq %rbx, %rdi
callq 0x55c0
jmp 0x64d2
pushq $0x10
popq %rdi
callq 0x51c0
movq %rax, %rbx
leaq 0xd510(%rip), %rsi      # 0x139ab
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x852c
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x85f0
xorl %ebp, %ebp
leaq 0x17f3d(%rip), %rsi     # 0x1e400
movq 0x18aae(%rip), %rdx     # 0x1ef78
movq %rbx, %rdi
callq 0x55c0
jmp 0x64d6
jmp 0x64ea
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x56b8
testb %bpl, %bpl
jne 0x64ed
jmp 0x64f5
movq %rax, %r14
movq %rbx, %rdi
callq 0x5270
movq %r14, %rdi
callq 0x55e0
// File: /workspace/github_cpp_makefile_star2_O2/nvanbenschoten[P]byzantine-agreement/include/args.h
// Function: args::ValueFlagList<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector, args::ValueReader<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>::ParseValue(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
virtual void ParseValue(const std::string &value_) override {
    T v;
#ifdef ARGS_NOEXCEPT
    if (!reader(name, value_, v)) {
      error = Error::Parse;
    }
#else
    reader(name, value_, v);
#endif
    values.insert(std::end(values), v);
  }

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq %rsp, %rdi
callq 0x51f0
movq 0xd0(%rbx), %rsi
addq $0xc8, %rbx
movq %rsp, %rdx
movq %rbx, %rdi
callq 0xd5ea
movq %rsp, %rdi
callq 0x56b8
addq $0x20, %rsp
popq %rbx
retq
jmp 0xd506
movq %rax, %rbx
movq %rsp, %rdi
callq 0x56b8
movq %rbx, %rdi
callq 0x55e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/nvanbenschoten[P]byzantine-agreement/src/udp_conn.cc
// Function: udp::Client::Send(char const*, unsigned long) const
void Client::Send(const char *buf, size_t size) const {
  auto addr = remote_address_.addr();
  auto addrlen = remote_address_.addr_len();
  if (sendto(sockfd_, buf, size, 0, addr, addrlen) < 0) {
    throw net::SendException();
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl 0x10(%rdi), %eax
leaq 0x14(%rdi), %r8
pushq $0x10
popq %r9
movl %eax, %edi
xorl %ecx, %ecx
callq 0x5050
testq %rax, %rax
js 0xde59
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x180, %edi            # imm = 0x180
callq 0x51c0
movq %rax, %rbx
movq %rax, %rdi
callq 0xe298
leaq 0x10bdb(%rip), %rsi     # 0x1ea50
leaq 0x55c(%rip), %rdx       # 0xe3d8
movq %rbx, %rdi
callq 0x55c0
movq %rax, %r14
movq %rbx, %rdi
callq 0x5270
movq %r14, %rdi
callq 0x55e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/nvanbenschoten[P]byzantine-agreement/src/udp_conn.cc
// Function: udp::Client::SendWithAck(char const*, unsigned long, unsigned int, std::function<udp::ServerAction (std::shared_ptr<udp::Client const>, char*, unsigned long)>) const
void Client::SendWithAck(const char *buf, size_t size, unsigned int attempts,
                         OnReceiveFn validAck) const {
  bool noLimit = attempts == 0;
  for (; noLimit || attempts > 0; --attempts) {
    // Send the message to the client.
    Send(buf, size);

    // Create a zeroed out buffer to read the ack message into.
    char ackbuf[BUFSIZE];
    bzero(ackbuf, BUFSIZE);

    // receive from the socket.
    struct sockaddr_in clientaddr;
    socklen_t clientlen = sizeof(clientaddr);
    int n = recvfrom(sockfd_, ackbuf, BUFSIZE, 0,
                     (struct sockaddr *)&clientaddr, &clientlen);

    // Check for error cases. This is either a timeout or some kind of
    // networking error. For timeouts, try sending the message again. For
    // anything else, throw an exception.
    if (n < 0) {
      if (IsErrnoTimeout()) {
        continue;
      } else {
        throw net::ReceiveException();
      }
    }

    // Make sure the ack was valid.
    auto action = validAck(shared_from_this(), ackbuf, n);
    if (action == ServerAction::Stop) {
      return;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x448, %rsp            # imm = 0x448
movq %r8, 0x8(%rsp)
movl %ecx, %r15d
movq %rdx, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdi, %r13
leaq 0x40(%rsp), %rbx
movl %ecx, %ebp
testl %r15d, %r15d
sete %al
addl $-0x1, %ebp
setb %cl
orb %al, %cl
testb $0x1, %cl
je 0xdfb9
movq %r13, %rdi
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
callq 0xde34
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5200
movl $0x10, 0x4(%rsp)
movl 0x10(%r13), %edi
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rsi
xorl %ecx, %ecx
leaq 0x30(%rsp), %r8
leaq 0x4(%rsp), %r9
callq 0x5290
movq %rax, %r14
testl %r14d, %r14d
js 0xdf81
movl %r15d, %ebx
leaq 0x20(%rsp), %r15
movq %r15, %rdi
movq %r13, %r12
movq %r13, %rsi
callq 0xe51a
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
movq 0x8(%rsp), %rdi
movq %r15, %rsi
leaq 0x40(%rsp), %rdx
movq %rdx, %r13
movq %r14, %rcx
callq 0xe358
movl %eax, %r14d
leaq 0x28(%rsp), %rdi
callq 0xda3a
cmpl $0x1, %r14d
movl %ebx, %r15d
movq %r13, %rbx
movq %r12, %r13
jne 0xdec5
jmp 0xdfb9
callq 0xe2eb
testb %al, %al
jne 0xdec5
movl $0x180, %edi            # imm = 0x180
callq 0x51c0
movq %rax, %r14
movq %rax, %rdi
callq 0xe304
leaq 0x10abe(%rip), %rsi     # 0x1ea68
leaq 0x427(%rip), %rdx       # 0xe3d8
movq %r14, %rdi
callq 0x55c0
addq $0x448, %rsp            # imm = 0x448
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x5270
jmp 0xdfe5
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xda3a
movq %rbx, %rdi
callq 0x55e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/nvanbenschoten[P]byzantine-agreement/src/message.cc
// Function: msg::OrderString[abi:cxx11](msg::Order)
std::string OrderString(Order o) {
  switch (o) {
    case Order::RETREAT:
      return "retreat";
    case Order::ATTACK:
      return "attack";
    case Order::NO_ORDER:
      return "no order";
    default:
      throw std::invalid_argument("unexpected Order value");
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x2, %esi
je 0xe965
cmpl $0x1, %esi
je 0xe957
testl %esi, %esi
jne 0xe984
leaq 0x59c8(%rip), %rsi      # 0x14318
leaq 0x7(%rsp), %rdx
jmp 0xe971
leaq 0x59c2(%rip), %rsi      # 0x14320
leaq 0x6(%rsp), %rdx
jmp 0xe971
leaq 0x59e5(%rip), %rsi      # 0x14351
leaq 0x5(%rsp), %rdx
movq %rbx, %rdi
callq 0x852c
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $0x10
popq %rdi
callq 0x51c0
movq %rax, %rbx
leaq 0x59c4(%rip), %rsi      # 0x1435a
movq %rax, %rdi
callq 0x5640
movq 0x10623(%rip), %rsi     # 0x1efc8
movq 0x105fc(%rip), %rdx     # 0x1efa8
movq %rbx, %rdi
callq 0x55c0
movq %rax, %r14
movq %rbx, %rdi
callq 0x5270
movq %r14, %rdi
callq 0x55e0
// File: /workspace/github_cpp_makefile_star2_O2/nvanbenschoten[P]byzantine-agreement/src/message.cc
// Function: msg::operator<(msg::Message const&, msg::Message const&)
bool operator<(const Message& lhs, const Message& rhs) {
  if (lhs.round != rhs.round) {
    return lhs.round < rhs.round;
  }
  if (lhs.ids != rhs.ids) {
    return lhs.ids < rhs.ids;
  }
  return lhs.order < rhs.order;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl (%rsi), %eax
cmpl %eax, (%rdi)
jne 0xea08
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rdi), %r15
leaq 0x8(%rsi), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0xeaff
testb %al, %al
je 0xea0d
movq %r15, %rdi
movq %r12, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xeb09
setb %al
jmp 0xea17
movl 0x4(%r14), %eax
cmpl 0x4(%rbx), %eax
setl %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/nvanbenschoten[P]byzantine-agreement/src/message.cc
// Function: msg::operator<<(std::ostream&, msg::Message const&)
std::ostream& operator<<(std::ostream& o, const Message& m) {
  o << "{round: " << m.round << ", order: " << OrderString(m.order)
    << ", ids: <";
  for (size_t i = 0; i < m.ids.size(); ++i) {
    if (i > 0) o << ' ';
    o << m.ids[i];
  }
  o << ">}";
  return o;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x5935(%rip), %rsi      # 0x14371
callq 0x5320
movl (%r14), %esi
movq %rax, %rdi
callq 0x5230
leaq 0x5927(%rip), %rsi      # 0x1437a
movq %rax, %rdi
callq 0x5320
movq %rax, %r15
movl 0x4(%r14), %esi
movq %rsp, %r12
movq %r12, %rdi
callq 0xe934
movq %r15, %rdi
movq %r12, %rsi
callq 0x5300
leaq 0x5905(%rip), %rsi      # 0x14384
movq %rax, %rdi
callq 0x5320
movq %rsp, %rdi
callq 0x56b8
xorl %r15d, %r15d
pushq $0x20
popq %rbp
movq 0x8(%r14), %rax
movq 0x10(%r14), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rcx, %r15
jae 0xeacd
testq %r15, %r15
je 0xeabc
movq %rbx, %rdi
movl %ebp, %esi
callq 0x53c0
movq 0x8(%r14), %rax
movl (%rax,%r15,4), %esi
movq %rbx, %rdi
callq 0x5230
incq %r15
jmp 0xea95
leaq 0x58b9(%rip), %rsi      # 0x1438d
movq %rbx, %rdi
callq 0x5320
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x56b8
movq %rbx, %rdi
callq 0x55e0
// File: /workspace/github_cpp_makefile_star2_O2/nvanbenschoten[P]byzantine-agreement/src/general.cc
// Function: generals::ByzantineMsgFromBuf(char*, unsigned long)
std::experimental::optional<msg::Message> ByzantineMsgFromBuf(char* buf,
                                                              size_t n) {
  // Check to make sure the size of the buffer is correct.
  if (n < sizeof(msg::ByzantineMessage)) {
    return {};
  }

  // Copy out the message part.
  msg::Message msg;
  msg::ByzantineMessage* c_msg = reinterpret_cast<msg::ByzantineMessage*>(buf);
  msg.round = ntohl(c_msg->round);
  msg.order = static_cast<msg::Order>(ntohl(c_msg->order));

  msg.ids.resize((n - sizeof(*c_msg)) / sizeof(uint32_t));
  uint32_t* id_buf = reinterpret_cast<uint32_t*>(buf + sizeof(*c_msg));
  for (size_t i = 0; i < msg.ids.size(); ++i) {
    msg.ids[i] = ntohl(id_buf[i]);
  }

  return msg;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
cmpq $0xf, %rdx
ja 0xec11
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
andq $0x0, 0x20(%rbx)
jmp 0xec84
movq %rsi, %r15
leaq 0x8(%rsp), %r14
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
andq $0x0, 0x10(%r14)
movl 0x8(%rsi), %eax
bswapl %eax
movl %eax, -0x8(%r14)
movl 0xc(%rsi), %eax
bswapl %eax
movl %eax, -0x4(%r14)
addq $-0x10, %rdx
shrq $0x2, %rdx
movq %r14, %rdi
movq %rdx, %rsi
callq 0xfef8
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
xorl %edx, %edx
cmpq %rcx, %rdx
jae 0xec71
movl 0x10(%r15,%rdx,4), %esi
bswapl %esi
movl %esi, (%rax,%rdx,4)
incq %rdx
jmp 0xec5d
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x102be
movq %r14, %rdi
callq 0x1096c
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x1096c
movq %rbx, %rdi
callq 0x55e0
// File: /workspace/github_cpp_makefile_star2_O2/nvanbenschoten[P]byzantine-agreement/src/general.cc
// Function: generals::RoundOfAck(char*, unsigned long)
std::experimental::optional<unsigned int> RoundOfAck(char* buf, size_t n) {
  // Check to make sure the size of the buffer is correct.
  if (n != sizeof(msg::Ack)) {
    return {};
  }

  msg::Ack* ack = reinterpret_cast<msg::Ack*>(buf);
  return ntohl(ack->round);
}

// Assembly:
movq %rdi, %rax
cmpq $0xc, %rdx
jne 0xecb8
movl 0x8(%rsi), %ecx
bswapl %ecx
movl %ecx, (%rax)
movb $0x1, %cl
jmp 0xecbe
andq $0x0, (%rax)
xorl %ecx, %ecx
movb %cl, 0x4(%rax)
retq
// File: /workspace/github_cpp_makefile_star2_O2/nvanbenschoten[P]byzantine-agreement/src/general.cc
// Function: generals::SendMessage(std::shared_ptr<udp::Client const>, msg::Message const&)
void SendMessage(udp::ClientPtr client, const msg::Message& msg) {
  size_t size =
      sizeof(msg::ByzantineMessage) + sizeof(uint32_t) * msg.ids.size();
  char buf[size];
  bzero(buf, size);

  // Copy the message part.
  msg::ByzantineMessage* c_msg = reinterpret_cast<msg::ByzantineMessage*>(buf);
  c_msg->type = htonl(kByzantineMessageType);
  c_msg->size = htonl(size);
  c_msg->round = htonl(msg.round);
  c_msg->order = htonl(static_cast<int>(msg.order));

  // C++ does not support flexible arrays, so we need to be a little tricky
  // here. We already made sure the buffer was the correct size by adding space
  // for each of the ids at the end of ByzantineMessage. Now we populate the
  // array.
  uint32_t* id_buf = reinterpret_cast<uint32_t*>(buf + sizeof(*c_msg));
  for (size_t i = 0; i < msg.ids.size(); ++i) {
    id_buf[i] = htonl(msg.ids[i]);
  }

  // Passed to SendWithAck to verify that any acknowledgement we hear is valid.
  auto isValidAck = [msg](udp::ClientPtr _, char* buf, size_t n) {
    auto ackRound = RoundOfAck(buf, n);
    bool valid = ackRound && *ackRound == msg.round;
    if (!valid) return udp::ServerAction::Continue;
    return udp::ServerAction::Stop;
  };

  client->SendWithAck(buf, size, kSendAttempts, isValidAck);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, -0x48(%rbp)
movq %rsi, -0x38(%rbp)
movq 0x8(%rsi), %r13
movq 0x10(%rsi), %rbx
subq %r13, %rbx
movq %rbx, %r15
sarq $0x2, %r15
leaq 0x10(%rbx), %rdx
movq %rdx, -0x30(%rbp)
movq %rsp, %r14
movq %r14, -0x40(%rbp)
addq $0x1f, %rbx
andq $-0x10, %rbx
subq %rbx, %r14
movq %r14, %rsp
xorl %r12d, %r12d
movq %r14, %rdi
xorl %esi, %esi
callq 0x5200
movq -0x38(%rbp), %rsi
movl $0x1000000, (%r14)      # imm = 0x1000000
movq -0x30(%rbp), %rax
bswapl %eax
movl %eax, 0x4(%r14)
movl (%rsi), %eax
bswapl %eax
movl %eax, 0x8(%r14)
movl 0x4(%rsi), %eax
bswapl %eax
negq %rbx
movq -0x40(%rbp), %rcx
movl %eax, 0xc(%rcx,%rbx)
cmpq %r12, %r15
je 0xed5a
movl (%r13,%r12,4), %eax
bswapl %eax
movl %eax, 0x10(%r14,%r12,4)
incq %r12
jmp 0xed44
leaq -0x90(%rbp), %rdi
callq 0xff2a
movq -0x48(%rbp), %rax
movq (%rax), %r15
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
movaps %xmm0, -0x70(%rbp)
pushq $0x20
popq %rdi
callq 0x5330
movq %rax, %r12
leaq -0x90(%rbp), %rsi
movq %rax, %rdi
callq 0xff2a
leaq -0x70(%rbp), %r8
movq %r12, (%r8)
leaq 0xcac(%rip), %rax       # 0xfa4c
movq %rax, 0x18(%r8)
leaq 0xce3(%rip), %rax       # 0xfa8e
movq %rax, 0x10(%r8)
pushq $0x3
popq %rcx
movq %r15, %rdi
movq %r14, %rsi
movq -0x30(%rbp), %rdx
callq 0xde98
leaq -0x70(%rbp), %rdi
callq 0x9c80
leaq -0x88(%rbp), %rdi
callq 0x1096c
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xedf7
movq %rax, %rbx
pushq $0x20
popq %rsi
movq %r12, %rdi
callq 0x5340
jmp 0xedfa
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x9c80
leaq -0x88(%rbp), %rdi
callq 0x1096c
movq %rbx, %rdi
callq 0x55e0
// File: /workspace/github_cpp_makefile_star2_O2/nvanbenschoten[P]byzantine-agreement/src/general.cc
// Function: generals::SendAckForRound(std::shared_ptr<udp::Client const>, unsigned int)
void SendAckForRound(udp::ClientPtr client, unsigned int round) {
  msg::Ack ack = {};
  ack.type = htonl(kAckType);
  ack.size = htonl(sizeof(ack));
  ack.round = htonl(round);

  char* buf = reinterpret_cast<char*>(&ack);
  client->Send(buf, sizeof(ack));
}

// Assembly:
subq $0x18, %rsp
movabsq $0xc00000002000000, %rcx # imm = 0xC00000002000000
leaq 0xc(%rsp), %rax
movq %rcx, (%rax)
bswapl %esi
movl %esi, 0x8(%rax)
movq (%rdi), %rdi
pushq $0xc
popq %rdx
movq %rax, %rsi
callq 0xde34
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/nvanbenschoten[P]byzantine-agreement/src/general.cc
// Function: generals::StringToMaliciousBehavior(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
MaliciousBehavior StringToMaliciousBehavior(std::string str) {
  if (str == "silent") return MaliciousBehavior::SILENT;
  if (str == "delay_send") return MaliciousBehavior::DELAY_SEND;
  if (str == "partial_send") return MaliciousBehavior::PARTIAL_SEND;
  if (str == "wrong_order") return MaliciousBehavior::WRONG_ORDER;
  throw std::invalid_argument(
      "malicious behavior can one of {\"silent\", \"delay_send\", "
      "\"partial_send\", \"wrong_order\"}");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x5744(%rip), %rsi      # 0x14648
callq 0xe28b
testb %al, %al
je 0xef11
pushq $0x1
jmp 0xef54
leaq 0x5737(%rip), %rsi      # 0x1464f
movq %rbx, %rdi
callq 0xe28b
testb %al, %al
je 0xef28
pushq $0x2
jmp 0xef54
leaq 0x572b(%rip), %rsi      # 0x1465a
movq %rbx, %rdi
callq 0xe28b
testb %al, %al
je 0xef3f
pushq $0x4
jmp 0xef54
leaq 0x5721(%rip), %rsi      # 0x14667
movq %rbx, %rdi
callq 0xe28b
testb %al, %al
je 0xef5d
pushq $0x8
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $0x10
popq %rdi
callq 0x51c0
movq %rax, %rbx
leaq 0x5704(%rip), %rsi      # 0x14673
movq %rax, %rdi
callq 0x5640
movq 0x1004a(%rip), %rsi     # 0x1efc8
movq 0x10023(%rip), %rdx     # 0x1efa8
movq %rbx, %rdi
callq 0x55c0
movq %rax, %r14
movq %rbx, %rdi
callq 0x5270
movq %r14, %rdi
callq 0x55e0
// File: /workspace/github_cpp_makefile_star2_O2/nvanbenschoten[P]byzantine-agreement/src/general.cc
// Function: generals::MaliciousBehaviorString[abi:cxx11](generals::MaliciousBehavior)
std::string MaliciousBehaviorString(MaliciousBehavior m) {
  switch (m) {
    case MaliciousBehavior::SILENT:
      return "silent";
    case MaliciousBehavior::DELAY_SEND:
      return "delay_send";
    case MaliciousBehavior::PARTIAL_SEND:
      return "partial_send";
    case MaliciousBehavior::WRONG_ORDER:
      return "wrong_order";
    default:
      throw std::invalid_argument("unexpected MaliciousBehavior value");
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
decl %esi
cmpl $0x7, %esi
ja 0xf007
movq %rdi, %rbx
leaq 0x53db(%rip), %rax      # 0x14390
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x5683(%rip), %rsi      # 0x14648
leaq 0x7(%rsp), %rdx
jmp 0xeff4
leaq 0x5687(%rip), %rsi      # 0x1465a
leaq 0x5(%rsp), %rdx
jmp 0xeff4
leaq 0x5686(%rip), %rsi      # 0x14667
leaq 0x4(%rsp), %rdx
jmp 0xeff4
leaq 0x5660(%rip), %rsi      # 0x1464f
leaq 0x6(%rsp), %rdx
movq %rbx, %rdi
callq 0x852c
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $0x10
popq %rdi
callq 0x51c0
movq %rax, %rbx
leaq 0x56b0(%rip), %rsi      # 0x146c9
movq %rax, %rdi
callq 0x5640
movq 0xffa0(%rip), %rsi      # 0x1efc8
movq 0xff79(%rip), %rdx      # 0x1efa8
movq %rbx, %rdi
callq 0x55c0
movq %rax, %r14
movq %rbx, %rdi
callq 0x5270
movq %r14, %rdi
callq 0x55e0
// File: /workspace/github_cpp_makefile_star2_O2/nvanbenschoten[P]byzantine-agreement/src/general.cc
// Function: generals::Commander::OrderForMsg() const
msg::Order Commander::OrderForMsg() const {
  if (ExhibitsBehavior(MaliciousBehavior::WRONG_ORDER)) {
    // Send wrong order 30% of the time.
    static thread_local std::default_random_engine random_engine(
        std::chrono::system_clock::now().time_since_epoch().count());

    std::uniform_real_distribution<double> distribution(0.0, 1.0);
    if (distribution(random_engine) < 0.30) {
      return order_ == msg::Order::ATTACK ? msg::Order::RETREAT
                                          : msg::Order::ATTACK;
    }
  }
  return order_;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
testb $0x8, 0x60(%rdi)
jne 0xf429
movl 0x68(%rbx), %eax
jmp 0xf479
cmpb $0x0, %fs:-0x8
je 0xf47f
xorpd %xmm0, %xmm0
movhpd 0x5110(%rip), %xmm0     # xmm0 = xmm0[0],mem[0]
movq %rsp, %rdi
movapd %xmm0, (%rdi)
movq %fs:0x0, %rax
leaq -0x10(%rax), %rsi
callq 0xff5e
movl 0x68(%rbx), %eax
xorl %ecx, %ecx
cmpl $0x1, %eax
setne %dl
movsd 0x50f9(%rip), %xmm1     # 0x14568
ucomisd %xmm0, %xmm1
jbe 0xf479
movb %dl, %cl
movl %ecx, %eax
addq $0x10, %rsp
popq %rbx
retq
callq 0x5040
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %edx, %edx
divq %rcx
cmpq $0x1, %rdx
adcq $0x0, %rdx
movq %rdx, %fs:-0x10
movb $0x1, %fs:-0x8
jmp 0xf434
// File: /workspace/github_cpp_makefile_star2_O2/nvanbenschoten[P]byzantine-agreement/src/general.cc
// Function: generals::Lieutenant::ContinueUnlessTimeout()
udp::ServerAction Lieutenant::ContinueUnlessTimeout() {
  // Compute the duration between the start of the round and now.
  const auto now = std::chrono::steady_clock::now();
  const auto round_dur = std::chrono::duration_cast<std::chrono::microseconds>(
      now - round_start_ts_);

  // If this duration is more than the round timeout, handle the timeout.
  if (round_dur > kRoundTimeout) {
    HandleRoundTimeout();
  }
  return udp::ServerAction::Continue;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x5450
subq 0xa0(%rbx), %rax
cmpq $0x3b9acde8, %rax       # imm = 0x3B9ACDE8
jl 0xf576
movq %rbx, %rdi
callq 0xf57a
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/nvanbenschoten[P]byzantine-agreement/src/general.cc
// Function: generals::Lieutenant::MoveToNewRoundOrStop()
udp::ServerAction Lieutenant::MoveToNewRoundOrStop() {
  if (LastRound()) {
    ClearSenders();
    return udp::ServerAction::Stop;
  }
  InitNewRound();
  return udp::ServerAction::Continue;
}

// Assembly:
pushq %rax
movl 0x5c(%rdi), %eax
incl %eax
cmpl %eax, 0x64(%rdi)
jne 0xf5df
callq 0xf5e8
pushq $0x1
popq %rax
jmp 0xf5e6
callq 0xf604
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O2/nvanbenschoten[P]byzantine-agreement/src/general.cc
// Function: generals::Lieutenant::ValidMessage(msg::Message const&, net::Address const&) const
bool Lieutenant::ValidMessage(const msg::Message& msg,
                              const net::Address& from) const {
  // Invalid if the message is from a later round.
  if (msg.round > round_) {
    return false;
  }
  // Invalid if the message has an incorrect number of ids.
  if (msg.round + 1 != msg.ids.size()) {
    return false;
  }
  // Invalid if the first message is not from the General (pid 0);
  if (msg.ids.at(0) != 0) {
    return false;
  }
  // Invalid if not all ids are unique.
  std::set<unsigned int> idset;
  for (auto const& id : msg.ids) {
    // Invalid if any id is out of bounds.
    if (id >= processes_.size()) {
      return false;
    }
    // Invalid if any id is our id.
    if (id == id_) {
      return false;
    }
    idset.insert(id);
  }
  if (idset.size() < msg.ids.size()) {
    return false;
  }
  // Invalid if the last id does not match the sender. This check will not
  // be complete for processes on the same host, because we can not know the
  // sending port of the process, only its receiving port.
  if (processes_.at(msg.ids.back()).hostname() != from.hostname()) {
    return false;
  }
  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl (%rsi), %eax
cmpl 0x64(%rdi), %eax
ja 0xf9d8
movq %rsi, %r14
incl %eax
movq 0x10(%rsi), %rcx
subq 0x8(%rsi), %rcx
sarq $0x2, %rcx
cmpq %rax, %rcx
jne 0xf9d8
movq %rdx, %rbx
movq %rdi, %r15
leaq 0x8(%r14), %rdi
xorl %r13d, %r13d
xorl %esi, %esi
callq 0x10220
cmpl $0x0, (%rax)
jne 0xf9db
movq %rbx, 0x8(%rsp)
leaq 0x20(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
movq 0x8(%r14), %rbp
movq 0x10(%r14), %rbx
leaq 0x8(%r15), %rax
movq %rax, 0x10(%rsp)
pushq $0x28
popq %r12
cmpq %rbx, %rbp
je 0xf9ed
movl (%rbp), %ecx
movq 0x10(%r15), %rax
subq 0x8(%r15), %rax
cqto
idivq %r12
xorl %r13d, %r13d
cmpq %rcx, %rax
jbe 0xfa29
cmpl 0x58(%r15), %ecx
je 0xfa29
leaq 0x18(%rsp), %rdi
movq %rbp, %rsi
callq 0x1275a
addq $0x4, %rbp
jmp 0xf9a2
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%r14), %rax
movq %rax, %rcx
subq 0x8(%r14), %rcx
sarq $0x2, %rcx
cmpq %rcx, 0x40(%rsp)
jae 0xfa08
xorl %r13d, %r13d
jmp 0xfa29
movl -0x4(%rax), %esi
movq 0x10(%rsp), %rdi
callq 0x8610
movq %rax, %rdi
movq 0x8(%rsp), %rsi
callq 0x8605
movl %eax, %r13d
xorb $0x1, %r13b
leaq 0x18(%rsp), %rdi
callq 0x107e2
jmp 0xf9db
jmp 0xfa37
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x107e2
movq %rbx, %rdi
callq 0x55e0
// File: /workspace/github_cpp_makefile_star2_O2/bowenfan96[P]icl-mcs-enigma/main.cpp
// Function: main
int main(int argc, char** argv) 
{
    try {
        Enigma en(argc, argv);
        
        char input;
        while(std::cin >> std::ws >> input) {
            std::cout << en.encryptor(input) << std::flush;
        }
    }
    
    catch(int error) {
        return error;
    }
    
    return(NO_ERROR);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rsi, %rdx
movl %edi, %esi
leaq -0x70(%rbp), %rdi
callq 0x333e
movq 0x5b78(%rip), %rbx      # 0x7fd8
leaq -0x21(%rbp), %r14
leaq -0x70(%rbp), %r15
movq 0x5b51(%rip), %r12      # 0x7fc0
movq %rbx, %rdi
callq 0x2150
movq %rax, %rdi
movq %r14, %rsi
callq 0x2200
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x24b1
movsbl -0x21(%rbp), %esi
movq %r15, %rdi
callq 0x38ca
movsbl %al, %esi
movq %r12, %rdi
callq 0x21e0
movq %rax, %rdi
callq 0x2110
jmp 0x246f
leaq -0x70(%rbp), %rdi
callq 0x3a00
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %r14
movq %rax, %rbx
jmp 0x24e2
movq %rdx, %r14
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x3a00
movq %rbx, %rdi
cmpl $0x1, %r14d
jne 0x24f9
callq 0x20a0
movl (%rax), %ebx
callq 0x2270
jmp 0x24bc
callq 0x22a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/bowenfan96[P]icl-mcs-enigma/enigma.cpp
// Function: Enigma::is_numeric(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool Enigma::is_numeric(const std::string& index)
{
    for(auto ch : index) {
        if(!isdigit(ch)) {
            return false;
        }
    }
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rcx
movq 0x8(%rdi), %rax
xorl %esi, %esi
movq %rsi, %rdx
cmpq %rsi, %rax
je 0x28ad
movsbl (%rcx,%rdx), %edi
addl $-0x30, %edi
leaq 0x1(%rdx), %rsi
cmpl $0xa, %edi
jb 0x2895
cmpq %rdx, %rax
sete %al
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/bowenfan96[P]icl-mcs-enigma/enigma.cpp
// Function: Enigma::is_one_to_one(std::vector<int, std::allocator<int>> const&, std::vector<int, std::allocator<int>> const&)
bool Enigma::is_one_to_one(const std::vector<int>& map_from, const std::vector<int>& map_to) 
{
    // check if both arrays contain only unique elements
    int sz = map_to.size();
    
    std::unordered_set<int> set1;
    for(int i=0; i < sz; i++) {
        if(!set1.insert(map_from[i]).second) {
            return false;
        }
    }
    std::unordered_set<int> set2;
    for(int i=0; i < sz; i++) {
        if(!set2.insert(map_to[i]).second) {
            return false;
        }
    }
    
    // check if an index maps to itself
    for(int i=0; i < sz; i++) {
        if(map_from.at(i) == map_to.at(i)) {
            return false;
        }
    }
    
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %rbx
movq 0x8(%rsi), %rcx
subq (%rsi), %rcx
movq %rdi, %r14
shrq $0x2, %rcx
leaq -0x78(%rbp), %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)
xorl %esi, %esi
testl %ecx, %ecx
movl $0x0, %eax
movq %rcx, -0x30(%rbp)
cmovgl %ecx, %eax
movq %rax, -0x38(%rbp)
leaq 0x4(,%rax,4), %r12
leaq -0xa8(%rbp), %r15
leaq 0x4(%rsi), %r13
cmpq %r13, %r12
je 0x2963
addq (%r14), %rsi
movq %r15, %rdi
callq 0x42dc
movq %r13, %rsi
testb $0x1, %dl
jne 0x2940
xorl %ebx, %ebx
jmp 0x29ea
leaq -0x40(%rbp), %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)
xorl %esi, %esi
leaq -0x70(%rbp), %r15
leaq 0x4(%rsi), %r13
cmpq %r13, %r12
je 0x29a9
addq (%rbx), %rsi
movq %r15, %rdi
callq 0x42dc
movq %r13, %rsi
testb $0x1, %dl
jne 0x298b
jmp 0x29d7
movslq -0x30(%rbp), %r12
xorl %r15d, %r15d
cmpq %r15, -0x38(%rbp)
je 0x29db
movq %r14, %rdi
movq %r15, %rsi
callq 0x3bd2
movl (%rax), %r13d
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3bd2
incq %r15
cmpl (%rax), %r13d
jne 0x29b0
xorl %ebx, %ebx
jmp 0x29e1
cmpq %r12, %r15
setge %bl
leaq -0x70(%rbp), %rdi
callq 0x3d0a
leaq -0xa8(%rbp), %rdi
callq 0x3d0a
movl %ebx, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2a0c
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x3d0a
jmp 0x2a1d
movq %rax, %rbx
leaq -0xa8(%rbp), %rdi
callq 0x3d0a
movq %rbx, %rdi
callq 0x22a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/bowenfan96[P]icl-mcs-enigma/enigma.cpp
// Function: Enigma::Plugboard::mapper(int)
int Enigma::Plugboard::mapper(int input) 
{
    auto iter = std::find(map_from.cbegin(), map_from.cend(), input);
    
    if(iter != map_from.cend()) {
        int index = std::distance(map_from.cbegin(), iter);
        return map_to.at(index);
    }
    else {
        return input;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq -0x14(%rbp), %r14
movl %esi, (%r14)
movq (%rdi), %rdi
movq 0x8(%rbx), %rsi
movq %r14, %rdx
callq 0x422a
cmpq 0x8(%rbx), %rax
je 0x2a75
subq (%rbx), %rax
addq $0x18, %rbx
shrq $0x2, %rax
movslq %eax, %rsi
movq %rbx, %rdi
callq 0x3b14
movq %rax, %r14
movl (%r14), %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/bowenfan96[P]icl-mcs-enigma/enigma.cpp
// Function: Enigma::Rotor::rotate()
void Enigma::Rotor::rotate() 
{
    position = (position + 1) % 26;
    
    if(std::find(triggers.cbegin(), triggers.cend(), position) != triggers.cend()) {
        triggered = true;
    }
    else {
        triggered = false;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xe8(%rdi), %rcx
movl 0xe8(%rdi), %eax
incl %eax
pushq $0x1a
popq %rsi
cltd
idivl %esi
movl %edx, 0xe8(%rdi)
movq 0xd0(%rdi), %rdi
movq 0xd8(%rbx), %rsi
movq %rcx, %rdx
callq 0x422a
cmpq 0xd8(%rbx), %rax
setne 0xec(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop