LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: IDEmbedder[P]IDembedder/./IDgroupsBase.hpp
// Function: IDgroupsBase::_init_temp_vector_to_embed(unsigned long, std::vector<double, std::allocator<double>> const&, std::vector<double, std::allocator<double>>&) const
void _init_temp_vector_to_embed(size_t group_index,
                                   const std::vector<double>& vector_to_embed,
                                   std::vector<double>& temp_vector_to_embed) const 
                                   {
                                        const std::vector<size_t>& group(_indices_of_groups[group_index]);
                                        size_t group_size = group.size();
                                        temp_vector_to_embed.resize(group_size);
                                        
                                        for (size_t i = 0; i < group_size; i++) {
                                            size_t dim = group[i];
                                            temp_vector_to_embed[i] = vector_to_embed[dim];
                                        }
                                    }

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq 0x40(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x4d10
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
callq 0x4d30
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0xef50
movq $0x0, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x18(%rsp), %rax
jae 0xee26
movq 0x20(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x4dd0
movq (%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x30(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x7da0
movsd (%rax), %xmm0
movsd %xmm0, (%rsp)
movq 0x28(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x7f80
movsd (%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0xedc3
addq $0x48, %rsp
retq
nopl (%rax,%rax)
// File: IDEmbedder[P]IDembedder/./IDgroupsBase.hpp
// Function: IDgroupsBase::_copy_part_results(std::vector<Pair, std::allocator<Pair>> const&, unsigned long const&, unsigned long&) const
void _copy_part_results(const std::vector<Pair>& part_results, 
                                const size_t& shift_index, 
                                size_t& next_place_index) const 
                                {
                                    for (const auto& pair : part_results) {
                                        _embedded_vector_groups[next_place_index] = pair;
                                        _embedded_vector_groups[next_place_index]._index += shift_index;
                                        next_place_index++;
                                    }
                                }

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rdi
callq 0xe3e0
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %rdi
callq 0xe410
movq %rax, 0x20(%rsp)
leaq 0x28(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0xe5a0
testb $0x1, %al
jne 0xeeb2
jmp 0xef3e
leaq 0x28(%rsp), %rdi
callq 0xe610
movq 0x10(%rsp), %rdi
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
addq $0x18, %rdi
movq 0x38(%rsp), %rax
movq (%rax), %rsi
callq 0x9c80
movq (%rsp), %rcx
movq 0x10(%rsp), %rdi
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x8(%rsp)
addq $0x18, %rdi
movq 0x38(%rsp), %rax
movq (%rax), %rsi
callq 0x9c80
movq 0x8(%rsp), %rcx
addq (%rax), %rcx
movq %rcx, (%rax)
movq 0x38(%rsp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
leaq 0x28(%rsp), %rdi
callq 0xe620
jmp 0xee9a
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: btbujiangjun[P]abcdl/include/utils/StringHelper.h
// Function: abcdl::utils::StringHelper::int2str[abi:cxx11](int)
std::string StringHelper::int2str(int n){
    std::stringstream ss;
    std::string s;
    ss << n;
    ss >> s;
    return s;
}

// Assembly:
subq $0x1c8, %rsp            # imm = 0x1C8
movq %rdi, 0x8(%rsp)
movq %rdi, %rax
movq %rax, (%rsp)
movq %rdi, 0x1c0(%rsp)
movq %rsi, 0x1b8(%rsp)
movl %edx, 0x1b4(%rsp)
leaq 0x28(%rsp), %rdi
callq 0xb3c0
movq 0x8(%rsp), %rdi
movb $0x0, 0x27(%rsp)
callq 0xb780
leaq 0x38(%rsp), %rdi
movl 0x1b4(%rsp), %esi
callq 0xb950
jmp 0xc456
movq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdi
callq 0xb6f0
jmp 0xc467
movb $0x1, 0x27(%rsp)
testb $0x1, 0x27(%rsp)
jne 0xc4a3
jmp 0xc499
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x18(%rsp)
movl %eax, 0x14(%rsp)
callq 0xb330
leaq 0x28(%rsp), %rdi
callq 0xb450
jmp 0xc4b9
movq 0x8(%rsp), %rdi
callq 0xb330
leaq 0x28(%rsp), %rdi
callq 0xb450
movq (%rsp), %rax
addq $0x1c8, %rsp            # imm = 0x1C8
retq
movq 0x18(%rsp), %rdi
callq 0xb980
nopw %cs:(%rax,%rax)
// File: btbujiangjun[P]abcdl/include/utils/StringHelper.h
// Function: abcdl::utils::StringHelper::real2str[abi:cxx11](float)
std::string StringHelper::real2str(real f){
    std::stringstream ss;
    std::string s;
    ss << f;
    ss >> s;
    return s;
}

// Assembly:
subq $0x1c8, %rsp            # imm = 0x1C8
movq %rdi, 0x8(%rsp)
movq %rdi, %rax
movq %rax, (%rsp)
movq %rdi, 0x1c0(%rsp)
movq %rsi, 0x1b8(%rsp)
movss %xmm0, 0x1b4(%rsp)
leaq 0x28(%rsp), %rdi
callq 0xb3c0
movq 0x8(%rsp), %rdi
movb $0x0, 0x27(%rsp)
callq 0xb780
leaq 0x38(%rsp), %rdi
movss 0x1b4(%rsp), %xmm0
callq 0xb440
jmp 0xc52a
movq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdi
callq 0xb6f0
jmp 0xc53b
movb $0x1, 0x27(%rsp)
testb $0x1, 0x27(%rsp)
jne 0xc577
jmp 0xc56d
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x18(%rsp)
movl %eax, 0x14(%rsp)
callq 0xb330
leaq 0x28(%rsp), %rdi
callq 0xb450
jmp 0xc58d
movq 0x8(%rsp), %rdi
callq 0xb330
leaq 0x28(%rsp), %rdi
callq 0xb450
movq (%rsp), %rax
addq $0x1c8, %rsp            # imm = 0x1C8
retq
movq 0x18(%rsp), %rdi
callq 0xb980
nopw (%rax,%rax)
// File: btbujiangjun[P]abcdl/include/utils/StringHelper.h
// Function: abcdl::utils::StringHelper::strtoupper(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::string StringHelper::strtoupper(std::string s){
    std::string t = s;
    int i = -1;
    while(t[i++]){
        t[i] = toupper(t[i]);
    }
    return t;
}

// Assembly:
subq $0x68, %rsp
movq %rdx, 0x20(%rsp)
movq %rsi, %rax
movq 0x20(%rsp), %rsi
movq %rdi, 0x28(%rsp)
movq %rdi, %rcx
movq %rcx, 0x30(%rsp)
movq %rdi, 0x60(%rsp)
movq %rax, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movb $0x0, 0x4f(%rsp)
callq 0xb210
movl $0xffffffff, 0x48(%rsp) # imm = 0xFFFFFFFF
movq 0x28(%rsp), %rdi
movslq 0x48(%rsp), %rsi
movl %esi, %eax
incl %eax
movl %eax, 0x48(%rsp)
callq 0xbab0
movq %rax, 0x18(%rsp)
jmp 0xc6cd
movq 0x18(%rsp), %rax
cmpb $0x0, (%rax)
je 0xc73b
movq 0x28(%rsp), %rdi
movslq 0x48(%rsp), %rsi
callq 0xbab0
movq %rax, 0x10(%rsp)
jmp 0xc6ed
movq 0x10(%rsp), %rax
movsbl (%rax), %edi
callq 0xbae0
movq 0x28(%rsp), %rdi
movb %al, 0x7(%rsp)
movslq 0x48(%rsp), %rsi
callq 0xbab0
movq %rax, 0x8(%rsp)
jmp 0xc714
movq 0x8(%rsp), %rax
movb 0x7(%rsp), %cl
movb %cl, (%rax)
jmp 0xc6af
movq 0x28(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x40(%rsp)
movl %eax, 0x3c(%rsp)
callq 0xb330
jmp 0xc75b
movb $0x1, 0x4f(%rsp)
testb $0x1, 0x4f(%rsp)
jne 0xc751
movq 0x28(%rsp), %rdi
callq 0xb330
movq 0x30(%rsp), %rax
addq $0x68, %rsp
retq
movq 0x40(%rsp), %rdi
callq 0xb980
nopw %cs:(%rax,%rax)
// File: btbujiangjun[P]abcdl/include/utils/StringHelper.h
// Function: abcdl::utils::StringHelper::strtolower(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::string StringHelper::strtolower(std::string s){
    std::string t = s;
    int i = -1;
    while(t[i++]){
        t[i] = tolower(t[i]);
    }
    return t;
}

// Assembly:
subq $0x68, %rsp
movq %rdx, 0x20(%rsp)
movq %rsi, %rax
movq 0x20(%rsp), %rsi
movq %rdi, 0x28(%rsp)
movq %rdi, %rcx
movq %rcx, 0x30(%rsp)
movq %rdi, 0x60(%rsp)
movq %rax, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movb $0x0, 0x4f(%rsp)
callq 0xb210
movl $0xffffffff, 0x48(%rsp) # imm = 0xFFFFFFFF
movq 0x28(%rsp), %rdi
movslq 0x48(%rsp), %rsi
movl %esi, %eax
incl %eax
movl %eax, 0x48(%rsp)
callq 0xbab0
movq %rax, 0x18(%rsp)
jmp 0xc83d
movq 0x18(%rsp), %rax
cmpb $0x0, (%rax)
je 0xc8ab
movq 0x28(%rsp), %rdi
movslq 0x48(%rsp), %rsi
callq 0xbab0
movq %rax, 0x10(%rsp)
jmp 0xc85d
movq 0x10(%rsp), %rax
movsbl (%rax), %edi
callq 0xbad8
movq 0x28(%rsp), %rdi
movb %al, 0x7(%rsp)
movslq 0x48(%rsp), %rsi
callq 0xbab0
movq %rax, 0x8(%rsp)
jmp 0xc884
movq 0x8(%rsp), %rax
movb 0x7(%rsp), %cl
movb %cl, (%rax)
jmp 0xc81f
movq 0x28(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x40(%rsp)
movl %eax, 0x3c(%rsp)
callq 0xb330
jmp 0xc8cb
movb $0x1, 0x4f(%rsp)
testb $0x1, 0x4f(%rsp)
jne 0xc8c1
movq 0x28(%rsp), %rdi
callq 0xb330
movq 0x30(%rsp), %rax
addq $0x68, %rsp
retq
movq 0x40(%rsp), %rdi
callq 0xb980
nopw %cs:(%rax,%rax)
// File: btbujiangjun[P]abcdl/include/rnn/Layer.h
// Function: abcdl::rnn::Layer::Layer(unsigned long, unsigned long, abcdl::framework::Cost*, abcdl::framework::ActivateFunc*)
Layer(const size_t hidden_dim,
		  const size_t bptt_truncate,
		  abcdl::framework::Cost* cost,
          abcdl::framework::ActivateFunc* activate_func){
	    _hidden_dim    = hidden_dim;
        _bptt_truncate = bptt_truncate;
		_cost          = cost;
        _activate_func = activate_func;
	}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
movq %r8, 0x10(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, 0x8(%rsp)
addq $0x20, %rdi
callq 0x1a3a0
movq 0x8(%rsp), %rax
movq 0x28(%rsp), %rcx
movq %rcx, (%rax)
movq 0x20(%rsp), %rcx
movq %rcx, 0x8(%rax)
movq 0x18(%rsp), %rcx
movq %rcx, 0x10(%rax)
movq 0x10(%rsp), %rcx
movq %rcx, 0x18(%rax)
addq $0x38, %rsp
retq
nopl (%rax)
// File: btbujiangjun[P]abcdl/src/rnn/RNN.cpp
// Function: abcdl::rnn::RNN::write_model(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool RNN::write_model(const std::string& path){
    std::vector<abcdl::algebra::Mat*> models;
    models.push_back(&_U);
    models.push_back(&_W);
    models.push_back(&_V);
    return loader.write<real>(models, path, "RNNMODEL", false);
}

// Assembly:
subq $0xc8, %rsp
movq %rdi, 0xc0(%rsp)
movq %rsi, 0xb8(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0x28(%rsp)
leaq 0xa0(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x56020
movq 0x28(%rsp), %rax
movq 0x30(%rsp), %rdi
addq $0x70, %rax
movq %rax, 0x98(%rsp)
leaq 0x98(%rsp), %rsi
callq 0x56850
jmp 0x54f7b
movq 0x28(%rsp), %rax
addq $0xa8, %rax
movq %rax, 0x80(%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x56850
jmp 0x54fa5
movq 0x28(%rsp), %rax
addq $0xe0, %rax
movq %rax, 0x78(%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x56850
jmp 0x54fc9
movq 0x28(%rsp), %rax
addq $0x50, %rax
movq %rax, 0x20(%rsp)
leaq 0x60(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x56f60
jmp 0x54feb
movq 0xb8(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x3f(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0xb990
movq 0x18(%rsp), %rdx
leaq 0x62d34(%rip), %rsi     # 0xb7d47
leaq 0x40(%rsp), %rdi
callq 0xb760
jmp 0x5501f
movq 0x10(%rsp), %rdx
movq 0x20(%rsp), %rdi
leaq 0x60(%rsp), %rsi
leaq 0x40(%rsp), %rcx
xorl %r8d, %r8d
callq 0x56880
movb %al, 0xf(%rsp)
jmp 0x55041
leaq 0x40(%rsp), %rdi
callq 0xb330
leaq 0x3f(%rsp), %rdi
callq 0xb5f0
leaq 0x60(%rsp), %rdi
callq 0x567f0
leaq 0xa0(%rsp), %rdi
callq 0x567f0
movb 0xf(%rsp), %al
andb $0x1, %al
addq $0xc8, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x90(%rsp)
movl %eax, 0x8c(%rsp)
jmp 0x550d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x90(%rsp)
movl %eax, 0x8c(%rsp)
jmp 0x550c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x90(%rsp)
movl %eax, 0x8c(%rsp)
leaq 0x40(%rsp), %rdi
callq 0xb330
leaq 0x3f(%rsp), %rdi
callq 0xb5f0
leaq 0x60(%rsp), %rdi
callq 0x567f0
leaq 0xa0(%rsp), %rdi
callq 0x567f0
movq 0x90(%rsp), %rdi
callq 0xb980
nopw %cs:(%rax,%rax)
// File: btbujiangjun[P]abcdl/src/rnn/RNN.cpp
// Function: abcdl::rnn::RNN::loss(abcdl::algebra::MatrixSet<float> const&, abcdl::algebra::MatrixSet<float> const&)
real RNN::loss(const abcdl::algebra::MatSet& train_seq_data,
               const abcdl::algebra::MatSet& train_seq_label){

    //L(y, o) = - (1/N)(Sum y_n*log(o_n))

    real loss_value = total_loss(train_seq_data, train_seq_label);
    size_t N = 0;
    
    size_t size = train_seq_label.size();
    for(size_t i = 0; i != size; i++){
        N += train_seq_label[i].rows();
    }

    return loss_value / N;
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movq %rdx, 0x80(%rsp)
movq 0x90(%rsp), %rdi
movq 0x88(%rsp), %rsi
movq 0x80(%rsp), %rdx
callq 0x55250
movss %xmm0, 0x7c(%rsp)
movq $0x0, 0x70(%rsp)
movq 0x80(%rsp), %rdi
callq 0x193c0
movq %rax, 0x68(%rsp)
movq $0x0, 0x60(%rsp)
movq 0x60(%rsp), %rax
cmpq 0x68(%rsp), %rax
je 0x551e2
movq 0x80(%rsp), %rsi
movq 0x60(%rsp), %rdx
leaq 0x38(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x55ba0
movq 0x18(%rsp), %rdi
callq 0x531e0
movq %rax, 0x20(%rsp)
jmp 0x5519f
movq 0x20(%rsp), %rax
addq 0x70(%rsp), %rax
movq %rax, 0x70(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x5bc10
movq 0x60(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x60(%rsp)
jmp 0x55166
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x5bc10
jmp 0x55244
movss 0x7c(%rsp), %xmm0
movss %xmm0, 0xc(%rsp)
movq 0x70(%rsp), %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, 0x10(%rsp)
testq %rax, %rax
movss %xmm0, 0x14(%rsp)
js 0x5522c
movss 0x10(%rsp), %xmm0
movss %xmm0, 0x14(%rsp)
movss 0xc(%rsp), %xmm0
movss 0x14(%rsp), %xmm1
divss %xmm1, %xmm0
addq $0x98, %rsp
retq
movq 0x30(%rsp), %rdi
callq 0xb980
nop
// File: hinrikHelga[P]Botnet/client.cpp
// Function: listenServer(int)
void listenServer(int serverSocket)
{
    int nread;                                  // Bytes read from socket
    char buffer[1025];                          // Buffer for reading input

    while(true)
    {
       memset(buffer, 0, sizeof(buffer));
       nread = read(serverSocket, buffer, sizeof(buffer));

       if(nread < 0)                      // Server has dropped us
       {
          printf("Over and Out\n");
          exit(0);
       }
       else if(nread > 0)
       {

          printf("%s\n", buffer);
       }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x410, %rsp            # imm = 0x410
movl %edi, -0x4(%rbp)
leaq -0x410(%rbp), %rdi
xorl %esi, %esi
movl $0x401, %edx            # imm = 0x401
callq 0x10a0
movl -0x4(%rbp), %edi
leaq -0x410(%rbp), %rsi
movl $0x401, %edx            # imm = 0x401
callq 0x1130
movl %eax, -0x8(%rbp)
cmpl $0x0, -0x8(%rbp)
jge 0x1313
leaq 0xcff(%rip), %rdi       # 0x2004
movb $0x0, %al
callq 0x1030
xorl %edi, %edi
callq 0x1110
cmpl $0x0, -0x8(%rbp)
jle 0x132e
leaq -0x410(%rbp), %rsi
leaq 0xd91(%rip), %rdi       # 0x20b8
movb $0x0, %al
callq 0x1030
jmp 0x1330
jmp 0x12ce
nopw %cs:(%rax,%rax)
// File: maclellant[P]ReliableGoBackN/./timers.h
// Function: diff(timespec const&, timespec const&)
timespec diff(const timespec& start, const timespec& end)
{
	timespec temp;
	if ((end.tv_nsec-start.tv_nsec) < 0)
	{
		temp.tv_sec = end.tv_sec-start.tv_sec - 1;
		temp.tv_nsec = NANO_PER_SEC + end.tv_nsec - start.tv_nsec;
	}
	else
	{
		temp.tv_sec = end.tv_sec-start.tv_sec;
		temp.tv_nsec = end.tv_nsec-start.tv_nsec;
	}
	return temp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
subq 0x8(%rcx), %rax
cmpq $0x0, %rax
jge 0x2564
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
subq (%rcx), %rax
subq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
addq $0x3b9aca00, %rax       # imm = 0x3B9ACA00
movq -0x18(%rbp), %rcx
subq 0x8(%rcx), %rax
movq %rax, -0x8(%rbp)
jmp 0x258a
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
subq (%rcx), %rax
movq %rax, -0x10(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
subq 0x8(%rcx), %rax
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: maclellant[P]ReliableGoBackN/server.cpp
// Function: packet_string[abi:cxx11](Packet&)
std::string packet_string(Packet& packet)
{
    char temp[PACKET_SIZE];
    memset(temp, '\0', PACKET_SIZE);
    memcpy(temp, packet.data(), packet.size());
    std::string result(temp);
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x250, %rsp            # imm = 0x250
movq %rdi, -0x240(%rbp)
movq %rdi, %rax
movq %rax, -0x250(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x210(%rbp), %rdi
movq %rdi, -0x238(%rbp)
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x2130
movq -0x10(%rbp), %rdi
callq 0x3c30
movq %rax, -0x248(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3c50
movq -0x248(%rbp), %rsi
movq -0x238(%rbp), %rdi
movzwl %ax, %eax
movl %eax, %edx
callq 0x21c0
movb $0x0, -0x211(%rbp)
leaq -0x212(%rbp), %rdi
movq %rdi, -0x230(%rbp)
callq 0x2390
movq -0x240(%rbp), %rdi
movq -0x238(%rbp), %rsi
movq -0x230(%rbp), %rdx
callq 0x3c70
jmp 0x2675
leaq -0x212(%rbp), %rdi
callq 0x2280
movb $0x1, -0x211(%rbp)
testb $0x1, -0x211(%rbp)
jne 0x26bf
jmp 0x26b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x212(%rbp), %rdi
callq 0x2280
jmp 0x26cf
movq -0x240(%rbp), %rdi
callq 0x2150
movq -0x250(%rbp), %rax
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq
movq -0x220(%rbp), %rdi
callq 0x2380
nopl (%rax,%rax)
// File: maclellant[P]ReliableGoBackN/server.cpp
// Function: packet_string[abi:cxx11](Packet&, unsigned long)
std::string packet_string(Packet& packet, size_t size)
{
    size_t amount = packet.size();
    if (amount > size)
        amount = size;
    char temp[PACKET_SIZE];
    memset(temp, '\0', PACKET_SIZE);
    memcpy(temp, packet.data(), amount);
    std::string result(temp);
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x260, %rsp            # imm = 0x260
movq %rdi, -0x248(%rbp)
movq %rdi, %rax
movq %rax, -0x240(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3c50
movzwl %ax, %eax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jbe 0x272a
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq -0x220(%rbp), %rdi
movq %rdi, -0x258(%rbp)
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x2130
movq -0x10(%rbp), %rdi
callq 0x3c30
movq -0x258(%rbp), %rdi
movq %rax, %rsi
movq -0x20(%rbp), %rdx
callq 0x21c0
movb $0x0, -0x221(%rbp)
leaq -0x222(%rbp), %rdi
movq %rdi, -0x250(%rbp)
callq 0x2390
movq -0x248(%rbp), %rdi
movq -0x258(%rbp), %rsi
movq -0x250(%rbp), %rdx
callq 0x3c70
jmp 0x2796
leaq -0x222(%rbp), %rdi
callq 0x2280
movb $0x1, -0x221(%rbp)
testb $0x1, -0x221(%rbp)
jne 0x27e0
jmp 0x27d4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
leaq -0x222(%rbp), %rdi
callq 0x2280
jmp 0x27f0
movq -0x248(%rbp), %rdi
callq 0x2150
movq -0x240(%rbp), %rax
addq $0x260, %rsp            # imm = 0x260
popq %rbp
retq
movq -0x230(%rbp), %rdi
callq 0x2380
nopl (%rax)
// File: maclellant[P]ReliableGoBackN/server.cpp
// Function: receive_success_msg(int, sockaddr_in)
void receive_success_msg(int sockfd, struct sockaddr_in client_addr)
{
    Packet received;
    struct sockaddr_in client_rec;
    socklen_t slen_rec = sizeof(client_addr);
    Timer final_timer = Timer();
    final_timer.start();

    while (1)
    {
        if (final_timer.timeout(SERVER_CLOSE_TIMEOUT_MSEC))
        {
            break;
        }
        int receiver = recvfrom(sockfd, received.buffer, PACKET_SIZE, 0, (struct sockaddr*)&client_rec, &slen_rec);
        if (receiver < 0)
        {          
            if (errno == EWOULDBLOCK)
            {
                errno = 0;
            }
            else
            {
                std::cerr << "Error: Could not receive from client" << std::endl;
                close(sockfd);
                exit(EXIT_FAILURE);
            }
        }
        else if (receiver > 0)
        {
            if (received.type() == GET)
            {
                break;
            }
        }
    }

    std::cout << "FINISHED: Successful GET command completed" << std::endl << std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x240, %rsp            # imm = 0x240
movq %rsi, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
movl %edi, -0x14(%rbp)
leaq -0x214(%rbp), %rdi
callq 0x6170
movl $0x10, -0x228(%rbp)
leaq -0x238(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x2130
leaq -0x238(%rbp), %rdi
callq 0x42d0
leaq -0x238(%rbp), %rdi
movl $0x7d0, %esi            # imm = 0x7D0
callq 0x3fe0
testb $0x1, %al
jne 0x33d2
jmp 0x33d7
jmp 0x347f
movl -0x14(%rbp), %edi
leaq -0x214(%rbp), %rsi
movl $0x200, %edx            # imm = 0x200
xorl %ecx, %ecx
leaq -0x224(%rbp), %r8
leaq -0x228(%rbp), %r9
callq 0x2190
movl %eax, -0x23c(%rbp)
cmpl $0x0, -0x23c(%rbp)
jge 0x3457
callq 0x2030
cmpl $0xb, (%rax)
jne 0x3421
callq 0x2030
movl $0x0, (%rax)
jmp 0x3455
movq 0x7bc8(%rip), %rdi      # 0xaff0
leaq 0x3dab(%rip), %rsi      # 0x71da
callq 0x2220
movq %rax, %rdi
movq 0x7b7a(%rip), %rsi      # 0xafb8
callq 0x2260
movl -0x14(%rbp), %edi
callq 0x23b0
movl $0x1, %edi
callq 0x22c0
jmp 0x347a
cmpl $0x0, -0x23c(%rbp)
jle 0x3478
leaq -0x214(%rbp), %rdi
callq 0x3d20
movzbl %al, %eax
cmpl $0x2, %eax
jne 0x3476
jmp 0x347f
jmp 0x3478
jmp 0x347a
jmp 0x33bb
movq 0x7b42(%rip), %rdi      # 0xafc8
leaq 0x3da0(%rip), %rsi      # 0x722d
callq 0x2220
movq %rax, %rdi
movq 0x7b1c(%rip), %rsi      # 0xafb8
callq 0x2260
movq %rax, %rdi
movq 0x7b0d(%rip), %rsi      # 0xafb8
callq 0x2260
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
nopl (%rax)
// File: maclellant[P]ReliableGoBackN/server.cpp
// Function: send_packet(int, sockaddr_in, Packet&, GremlinInfo&)
int send_packet(int sockfd, struct sockaddr_in client_addr, Packet& packet, GremlinInfo& info)
{
    int result = gremlin(packet.data(), info.corrupt_chance, info.loss_chance, info.delay_chance);
    if (result == FINE)
    {
        std::cout << "SENDING: sequence " << (int)packet.sequence() << "\n";
        std::cout << "DATA:\n";
        std::cout << packet_string(packet, 48);
        std::cout << "\n\n";
        if (sendto(sockfd, packet.buffer, PACKET_SIZE, 0, (struct sockaddr*) &client_addr, sizeof(client_addr)) == -1)
        {
            std::cerr << "Error: could not send packet to client" << std::endl;
            close(sockfd);
            exit(EXIT_FAILURE);
        }
    }

    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rsi, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
movl %edi, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0x3c30
movq %rax, %rdi
movq -0x28(%rbp), %rax
movl 0x8(%rax), %esi
movq -0x28(%rbp), %rax
movl 0x4(%rax), %edx
movq -0x28(%rbp), %rax
movl (%rax), %ecx
callq 0x3820
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jne 0x3800
movq 0x78c1(%rip), %rdi      # 0xafc8
movq %rdi, -0x70(%rbp)
leaq 0x3a5e(%rip), %rsi      # 0x7170
callq 0x2220
movq %rax, -0x78(%rbp)
movq -0x20(%rbp), %rdi
callq 0x4070
movq -0x78(%rbp), %rdi
movzbl %al, %esi
callq 0x2370
movq %rax, %rdi
leaq 0x39ee(%rip), %rsi      # 0x7128
callq 0x2220
movq -0x70(%rbp), %rdi
leaq 0x3a39(%rip), %rsi      # 0x7183
callq 0x2220
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdi
movq %rdi, -0x68(%rbp)
movl $0x30, %edx
callq 0x26e0
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x2200
jmp 0x3774
leaq -0x50(%rbp), %rdi
callq 0x2150
movq 0x7844(%rip), %rdi      # 0xafc8
leaq 0x399c(%rip), %rsi      # 0x7127
callq 0x2220
movl -0x14(%rbp), %edi
movq -0x20(%rbp), %rsi
movl $0x200, %edx            # imm = 0x200
xorl %ecx, %ecx
leaq -0x10(%rbp), %r8
movl $0x10, %r9d
callq 0x2060
cmpq $-0x1, %rax
jne 0x37fe
movq 0x7836(%rip), %rdi      # 0xaff0
leaq 0x39c9(%rip), %rsi      # 0x718a
callq 0x2220
movq %rax, %rdi
movq 0x77e8(%rip), %rsi      # 0xafb8
callq 0x2260
movl -0x14(%rbp), %edi
callq 0x23b0
movl $0x1, %edi
callq 0x22c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x2150
jmp 0x380c
jmp 0x3800
movl -0x2c(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x2380
nopw %cs:(%rax,%rax)
// File: maclellant[P]ReliableGoBackN/./timers.h
// Function: Timer::timeout(unsigned int)
bool timeout(unsigned int milli_timeout)
	{
		timespec end;
		clock_gettime(CLOCK_REALTIME, &end);
		nano_t nano_timeout = (nano_t)milli_timeout * NANO_PER_MILLI;

		if (nano_convert(diff(_start, end)) > nano_timeout)
			return true;

		return false;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
xorl %edi, %edi
leaq -0x28(%rbp), %rsi
callq 0x2210
movq -0x48(%rbp), %rdi
movl -0x14(%rbp), %eax
imulq $0xf4240, %rax, %rax    # imm = 0xF4240
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rsi
callq 0x2510
movq %rax, -0x40(%rbp)
movq %rdx, -0x38(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x25a0
cmpq -0x30(%rbp), %rax
jbe 0x403a
movb $0x1, -0x1(%rbp)
jmp 0x403e
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: maclellant[P]ReliableGoBackN/util.cpp
// Function: Packet::Packet(unsigned char, unsigned char)
Packet::Packet(uint8_t sequence, uint8_t type)
{
	bzero(buffer, PACKET_SIZE);

	char* segment = (char*)(buffer + 6);
	uint16_t* size = (uint16_t*)(buffer + 4);
	uint16_t* chksum = (uint16_t*)(buffer + 2);
	uint8_t* seq = (uint8_t*)(buffer + 1);
	uint8_t* packet_type = (uint8_t*)(buffer + 0);

	*size = 0;
	*seq = sequence;
	*packet_type = type;
	*chksum = calc_checksum(segment, (uint16_t)*size);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %dl, %al
movb %sil, %cl
movq %rdi, -0x8(%rbp)
movb %cl, -0x9(%rbp)
movb %al, -0xa(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x40(%rbp)
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x2130
movq -0x40(%rbp), %rax
movq %rax, %rcx
addq $0x6, %rcx
movq %rcx, -0x18(%rbp)
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x20(%rbp)
movq %rax, %rcx
addq $0x2, %rcx
movq %rcx, -0x28(%rbp)
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x30(%rbp)
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movw $0x0, (%rax)
movb -0x9(%rbp), %cl
movq -0x30(%rbp), %rax
movb %cl, (%rax)
movb -0xa(%rbp), %cl
movq -0x38(%rbp), %rax
movb %cl, (%rax)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rax
movzwl (%rax), %eax
movl %eax, %esi
callq 0x6220
movw %ax, %cx
movq -0x28(%rbp), %rax
movw %cx, (%rax)
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: maclellant[P]ReliableGoBackN/util.cpp
// Function: Packet::Packet(char*, unsigned short, unsigned char, unsigned char)
Packet::Packet(char* segment, uint16_t length, uint8_t sequence, uint8_t type)
{
	char* pack = (char*)(buffer + 6);
	uint16_t* size = (uint16_t*)(buffer + 4);
	uint16_t* chksum = (uint16_t*)(buffer + 2);
	uint8_t* seq = (uint8_t*)(buffer + 1);
	uint8_t* packet_type = (uint8_t*)(buffer + 0);

	bzero(buffer, PACKET_SIZE);
	memcpy(pack, segment, length);
	*size = length;
	*seq = sequence;
	*packet_type = type;
	*chksum = calc_checksum(pack, (uint16_t)*size);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %r8b, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movw %dx, -0x12(%rbp)
movb %cl, -0x13(%rbp)
movb %al, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, %rax
addq $0x6, %rax
movq %rax, -0x20(%rbp)
movq %rdi, %rax
addq $0x4, %rax
movq %rax, -0x28(%rbp)
movq %rdi, %rax
addq $0x2, %rax
movq %rax, -0x30(%rbp)
movq %rdi, %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movq %rdi, -0x40(%rbp)
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x2130
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movzwl -0x12(%rbp), %eax
movl %eax, %edx
callq 0x21c0
movw -0x12(%rbp), %cx
movq -0x28(%rbp), %rax
movw %cx, (%rax)
movb -0x13(%rbp), %cl
movq -0x38(%rbp), %rax
movb %cl, (%rax)
movb -0x14(%rbp), %cl
movq -0x40(%rbp), %rax
movb %cl, (%rax)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rax
movzwl (%rax), %eax
movl %eax, %esi
callq 0x6220
movw %ax, %cx
movq -0x30(%rbp), %rax
movw %cx, (%rax)
addq $0x40, %rsp
popq %rbp
retq
nop
// File: joncampbell123[P]floppytools/kryocomm.cpp
// Function: kryoflux_bits_refill(flux_bits&, kryoflux_event&, _IO_FILE*)
bool kryoflux_bits_refill(flux_bits &fb,struct kryoflux_event &ev,FILE *fp) {
    while (fb.avail() <= 24) {
        if (!kryoflux_read(ev,fp))
            return false;

        if (ev.message == MSG_FLUX) {
            long len;

            len = ((((long)ev.flux_interval - (long)fb.shortest) + (long)(fb.dist / 2l)) / (long)fb.dist) + 1l;
            if (len < 1) len = 1;
            if (len > 8) len = 8;

            fb.add((unsigned int)len);
        }
    }

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x7150
cmpl $0x18, %eax
ja 0x7132
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x6d90
testb $0x1, %al
jne 0x70b0
movb $0x0, -0x1(%rbp)
jmp 0x7136
movq -0x18(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x1, %eax
jne 0x712d
movq -0x18(%rbp), %rax
movl (%rax), %eax
movq -0x10(%rbp), %rcx
movl 0x8(%rcx), %ecx
subq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movl $0x2, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x30(%rbp), %rax
addq %rcx, %rax
movq -0x10(%rbp), %rcx
movl 0xc(%rcx), %ecx
cqto
idivq %rcx
addq $0x1, %rax
movq %rax, -0x28(%rbp)
cmpq $0x1, -0x28(%rbp)
jge 0x710f
movq $0x1, -0x28(%rbp)
cmpq $0x8, -0x28(%rbp)
jle 0x711e
movq $0x8, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %esi
callq 0x7170
jmp 0x7084
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: joncampbell123[P]floppytools/kryocomm.cpp
// Function: flux_bits::add(unsigned int)
void flux_bits::add(unsigned int len) {
    if (len != 0) {
        left  += len;
        if (left > (sizeof(unsigned int) * 8u)) fprintf(stderr,"flux_bits::add() overrun\n");
        bits <<= len;
        bits  += 1u << (len - 1u);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x71dd
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
addl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movl 0x4(%rax), %eax
cmpq $0x20, %rax
jbe 0x71bb
movq 0x6e36(%rip), %rax      # 0xdfe0
movq (%rax), %rdi
leaq 0x219c(%rip), %rsi      # 0x9350
movb $0x0, %al
callq 0x2220
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
movl (%rax), %edx
shll %cl, %edx
movl %edx, %ecx
movl %ecx, (%rax)
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
addl (%rax), %ecx
movl %ecx, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: joncampbell123[P]floppytools/kryocomm.cpp
// Function: flux_bits::peek(unsigned int) const
unsigned int flux_bits::peek(unsigned int bc) const {
    if (left >= bc)
        return (bits >> (left-bc)) & ((1u << bc) - 1u);

    fprintf(stderr,"flux_bits::peek() overrun\n");
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movl 0x4(%rax), %eax
cmpl -0x14(%rbp), %eax
jb 0x7253
movq -0x20(%rbp), %rcx
movl (%rcx), %eax
movl 0x4(%rcx), %ecx
subl -0x14(%rbp), %ecx
shrl %cl, %eax
movl -0x14(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
andl %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x7272
movq 0x6d86(%rip), %rax      # 0xdfe0
movq (%rax), %rdi
leaq 0x2106(%rip), %rsi      # 0x936a
movb $0x0, %al
callq 0x2220
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: joncampbell123[P]floppytools/kryocomm.cpp
// Function: flux_bits::get(unsigned int)
unsigned int flux_bits::get(unsigned int bc) {
    if (left >= bc) {
        unsigned int r = peek(bc);
        left -= bc;
        return r;
    }
    else {
        fprintf(stderr,"flux_bits::get() overrun\n");
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movl 0x4(%rax), %eax
cmpl -0x14(%rbp), %eax
jb 0x72c7
movq -0x20(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x7210
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, -0x18(%rbp)
movl -0x14(%rbp), %edx
movl 0x4(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x4(%rax)
movl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x72e6
movq 0x6d12(%rip), %rax      # 0xdfe0
movq (%rax), %rdi
leaq 0x20ad(%rip), %rsi      # 0x9385
movb $0x0, %al
callq 0x2220
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: joncampbell123[P]floppytools/kryocomm.cpp
// Function: flux_bits_mfm_decode_bit(flux_bits&, kryoflux_event&, _IO_FILE*)
int flux_bits_mfm_decode_bit(struct flux_bits &fb,struct kryoflux_event &ev,FILE *fp) {
    unsigned int raw,bit;

    if (fb.avail() < 2) {
        if (!kryoflux_bits_refill(fb,ev,fp))
            return -1;
    }

    raw = fb.peek(2);
    if (raw == 1/*01*/) {
        bit = 1;
    }
    else if (raw == 3/*11*/) {
        fb.get(1);
        return -1;
    }
    else {
        /* 10 if previous bit 0
         * 00 if previous bit 1 */
        raw ^= (1u ^ flux_bits_pbit) << 1u;
        if (raw != 0) {
            fb.get(1);
            return -1;
        }
        bit = 0;
    }

    fb.get(2);
    flux_bits_pbit = bit;
    return bit;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x7150
cmpl $0x2, %eax
jae 0x7765
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x7070
testb $0x1, %al
jne 0x7763
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x77f6
jmp 0x7765
movq -0x10(%rbp), %rdi
movl $0x2, %esi
callq 0x7210
movl %eax, -0x24(%rbp)
cmpl $0x1, -0x24(%rbp)
jne 0x7785
movl $0x1, -0x28(%rbp)
jmp 0x77d9
cmpl $0x3, -0x24(%rbp)
jne 0x77a2
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x7280
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x77f6
movl 0xaa20(%rip), %eax      # 0x121c8
xorl $0x1, %eax
shll %eax
xorl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x77d0
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x7280
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x77f6
movl $0x0, -0x28(%rbp)
jmp 0x77d9
movq -0x10(%rbp), %rdi
movl $0x2, %esi
callq 0x7280
movl -0x28(%rbp), %eax
movl %eax, 0xa9d8(%rip)      # 0x121c8
movl -0x28(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: joncampbell123[P]floppytools/kryocomm.cpp
// Function: flux_bits_mfm_decode(flux_bits&, kryoflux_event&, _IO_FILE*)
int flux_bits_mfm_decode(struct flux_bits &fb,struct kryoflux_event &ev,FILE *fp) {
    unsigned int byte = 0,i;
    int c;

    if (fb.avail() < 16) {
        if (!kryoflux_bits_refill(fb,ev,fp))
            return -1;
    }

    if (fb.peek(MFM_A1_SYNC_LENGTH) == MFM_A1_SYNC) {
        fb.get(MFM_A1_SYNC_LENGTH);
        flux_bits_pbit = 1; /* last bit of 0xA1 is 1 */
        return -MFM_A1_SYNC_BYTE;
    }

    for (i=0;i < 8;i++) {
        c = flux_bits_mfm_decode_bit(fb,ev,fp);
        if (c < 0 || c >= 2) return -1;
        byte |= (unsigned int)c << (7u - i);
    }

    return byte;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x10(%rbp), %rdi
callq 0x7150
cmpl $0x10, %eax
jae 0x784c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x7070
testb $0x1, %al
jne 0x784a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x78dc
jmp 0x784c
movq -0x10(%rbp), %rdi
movl $0x10, %esi
callq 0x7210
cmpl $0x4489, %eax           # imm = 0x4489
jne 0x7882
movq -0x10(%rbp), %rdi
movl $0x10, %esi
callq 0x7280
movl $0x1, 0xa94f(%rip)      # 0x121c8
movl $0xffffff5f, -0x4(%rbp) # imm = 0xFFFFFF5F
jmp 0x78dc
movl $0x0, -0x28(%rbp)
cmpl $0x8, -0x28(%rbp)
jae 0x78d6
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x7720
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jl 0x78af
cmpl $0x2, -0x2c(%rbp)
jl 0x78b8
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x78dc
movl -0x2c(%rbp), %eax
movl $0x7, %ecx
subl -0x28(%rbp), %ecx
shll %cl, %eax
orl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x7889
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: joncampbell123[P]floppytools/kryocomm.cpp
// Function: mfm_crc16fd_update(unsigned short, void const*, unsigned long)
mfm_crc16fd_t mfm_crc16fd_update(mfm_crc16fd_t crc, const void *data, size_t data_len)
{
    const unsigned char *d = (const unsigned char *)data;
    unsigned int tbl_idx;

    while (data_len--) {
        tbl_idx = ((crc >> 8) ^ *d) & 0xff;
        crc = (mfm_crc16fd_table[tbl_idx] ^ (crc << 8)) & 0xffff;
        d++;
    }
    return crc & 0xffff;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw %di, %ax
movw %ax, -0x2(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x18(%rbp)
cmpq $0x0, %rax
je 0x7968
movzwl -0x2(%rbp), %eax
sarl $0x8, %eax
movq -0x20(%rbp), %rcx
movzbl (%rcx), %ecx
xorl %ecx, %eax
andl $0xff, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl %eax, %ecx
leaq 0x1a8c(%rip), %rax      # 0x93d0
movzwl (%rax,%rcx,2), %eax
movzwl -0x2(%rbp), %ecx
shll $0x8, %ecx
xorl %ecx, %eax
andl $0xffff, %eax           # imm = 0xFFFF
movw %ax, -0x2(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x790b
movzwl -0x2(%rbp), %eax
andl $0xffff, %eax           # imm = 0xFFFF
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: joncampbell123[P]floppytools/kryocomm.cpp
// Function: kryoflux_update_stream_info(kryoflux_stream_info&, std::vector<unsigned char, std::allocator<unsigned char>>&)
bool kryoflux_update_stream_info(struct kryoflux_stream_info &si,std::vector<unsigned char> &msg) {
    std::string name,value;

    std::vector<unsigned char>::iterator mi = msg.begin();
    while (mi != msg.end() && *mi != 0) {
        kryoflux_parse_stream_nv_pair(name,value,mi,msg.end());

        if (name == "name")
            si.name = value;
        else if (name == "sck")
            si.sck = atof(value.c_str());
        else if (name == "ick")
            si.ick = atof(value.c_str());
    }

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x2200
leaq -0x50(%rbp), %rdi
callq 0x2200
movq -0x10(%rbp), %rdi
callq 0x85f0
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8620
movq %rax, -0x60(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x8550
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x75(%rbp)
jne 0x7bfa
jmp 0x7c0f
leaq -0x58(%rbp), %rdi
callq 0x8590
movzbl (%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x75(%rbp)
movb -0x75(%rbp), %al
testb $0x1, %al
jne 0x7c1b
jmp 0x7d0f
movq -0x10(%rbp), %rdi
callq 0x8620
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rcx
leaq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0x7a10
jmp 0x7c3f
leaq 0x1759(%rip), %rsi      # 0x939f
leaq -0x30(%rbp), %rdi
callq 0x8650
movb %al, -0x76(%rbp)
jmp 0x7c54
movb -0x76(%rbp), %al
testb $0x1, %al
jne 0x7c5d
jmp 0x7c94
movq -0x8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x2040
jmp 0x7c6c
jmp 0x7d0a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x2100
leaq -0x30(%rbp), %rdi
callq 0x2100
jmp 0x7d2e
leaq 0x1709(%rip), %rsi      # 0x93a4
leaq -0x30(%rbp), %rdi
callq 0x8650
movb %al, -0x77(%rbp)
jmp 0x7ca9
movb -0x77(%rbp), %al
testb $0x1, %al
jne 0x7cb2
jmp 0x7cce
leaq -0x50(%rbp), %rdi
callq 0x20b0
movq %rax, %rdi
callq 0x21d0
movq -0x8(%rbp), %rax
movsd %xmm0, 0x20(%rax)
jmp 0x7d08
leaq 0x16d3(%rip), %rsi      # 0x93a8
leaq -0x30(%rbp), %rdi
callq 0x8650
movb %al, -0x78(%rbp)
jmp 0x7ce3
movb -0x78(%rbp), %al
testb $0x1, %al
jne 0x7cec
jmp 0x7d06
leaq -0x50(%rbp), %rdi
callq 0x20b0
movq %rax, %rdi
callq 0x21d0
movq -0x8(%rbp), %rax
movsd %xmm0, 0x28(%rax)
jmp 0x7d08
jmp 0x7d0a
jmp 0x7bd2
leaq -0x50(%rbp), %rdi
callq 0x2100
leaq -0x30(%rbp), %rdi
callq 0x2100
movb $0x1, %al
andb $0x1, %al
addq $0x80, %rsp
popq %rbp
retq
movq -0x70(%rbp), %rdi
callq 0x2270
nopw (%rax,%rax)
// File: joncampbell123[P]floppytools/kryocomm.cpp
// Function: kryo_fopen(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int, unsigned int)
FILE *kryo_fopen(const std::string &cappath,unsigned int track,unsigned int head) {
    std::string path;
    char tmp[128];

    sprintf(tmp,"track%02u.%u.raw",track,head);
    path = cappath + "/" + tmp;

    return fopen(path.c_str(),"rb");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x2200
movl -0xc(%rbp), %edx
movl -0x10(%rbp), %ecx
leaq 0x1479(%rip), %rsi      # 0x91e4
xorl %eax, %eax
leaq -0xb0(%rbp), %rdi
callq 0x2060
movq -0x8(%rbp), %rsi
leaq 0x1471(%rip), %rdx      # 0x91f5
leaq -0xf0(%rbp), %rdi
callq 0x3cb0
jmp 0x7d92
leaq -0xd0(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
callq 0x3c60
jmp 0x7dae
leaq -0x30(%rbp), %rdi
movq %rdi, -0x110(%rbp)
leaq -0xd0(%rbp), %rsi
movq %rsi, -0x118(%rbp)
callq 0x21c0
movq -0x118(%rbp), %rdi
callq 0x2100
leaq -0xf0(%rbp), %rdi
callq 0x2100
movq -0x110(%rbp), %rdi
callq 0x20b0
movq %rax, %rdi
leaq 0x1404(%rip), %rsi      # 0x91fe
callq 0x21b0
movq %rax, -0x108(%rbp)
jmp 0x7e08
leaq -0x30(%rbp), %rdi
callq 0x2100
movq -0x108(%rbp), %rax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x7e53
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x2100
leaq -0x30(%rbp), %rdi
callq 0x2100
movq -0xf8(%rbp), %rdi
callq 0x2270
nopl (%rax,%rax)
// File: joncampbell123[P]floppytools/kryocomm.cpp
// Function: mfm_find_sync(flux_bits&, kryoflux_event, _IO_FILE*)
bool mfm_find_sync(flux_bits &fb,struct kryoflux_event ev,FILE *fp) {
    do {
        kryoflux_bits_refill(fb,ev,fp);

        while (fb.avail() >= MFM_A1_SYNC_LENGTH) {
            if (fb.peek(MFM_A1_SYNC_LENGTH) == MFM_A1_SYNC) {
                return true;
            }
            else {
                fb.get(1);
            }
        }

        if (!kryoflux_bits_refill(fb,ev,fp))
            break;
    } while (fb.avail() > 0);

    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rsi, -0x28(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
callq 0x7070
movq -0x10(%rbp), %rdi
callq 0x7150
cmpl $0x10, %eax
jb 0x7ed2
movq -0x10(%rbp), %rdi
movl $0x10, %esi
callq 0x7210
cmpl $0x4489, %eax           # imm = 0x4489
jne 0x7ec2
movb $0x1, -0x1(%rbp)
jmp 0x7efd
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x7280
jmp 0x7e99
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
callq 0x7070
testb $0x1, %al
jne 0x7ee9
jmp 0x7ef9
jmp 0x7eeb
movq -0x10(%rbp), %rdi
callq 0x7150
cmpl $0x0, %eax
ja 0x7e88
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: joncampbell123[P]floppytools/kryocomm.cpp
// Function: flux_bits_mfm_skip_sync(flux_bits&, kryoflux_event&, _IO_FILE*)
int flux_bits_mfm_skip_sync(struct flux_bits &fb,struct kryoflux_event &ev,FILE *fp) {
    int count=0,c;

    kryoflux_bits_refill(fb,ev,fp);
    while (fb.avail() >= MFM_A1_SYNC_LENGTH && fb.peek(MFM_A1_SYNC_LENGTH) == MFM_A1_SYNC) {
        c=flux_bits_mfm_decode(fb,ev,fp);
        if (c != -MFM_A1_SYNC_BYTE) {
            if (c < 0) break;
        }

        kryoflux_bits_refill(fb,ev,fp);
        count++;
    }

    return count;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x7070
movq -0x8(%rbp), %rdi
callq 0x7150
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x10, %ecx
movb %al, -0x21(%rbp)
jb 0x804a
movq -0x8(%rbp), %rdi
movl $0x10, %esi
callq 0x7210
cmpl $0x4489, %eax           # imm = 0x4489
sete %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0x8053
jmp 0x8096
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x7800
movl %eax, -0x20(%rbp)
cmpl $0xffffff5f, -0x20(%rbp) # imm = 0xFFFFFF5F
je 0x807a
cmpl $0x0, -0x20(%rbp)
jge 0x8078
jmp 0x8096
jmp 0x807a
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x7070
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x801c
movl -0x1c(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: joncampbell123[P]floppytools/kryocomm.cpp
// Function: flux_bits_mfm_read_sync_and_byte(flux_bits&, kryoflux_event&, _IO_FILE*)
int flux_bits_mfm_read_sync_and_byte(struct flux_bits &fb,struct kryoflux_event &ev,FILE *fp) {
    int c;

    // Require at least 3 sync codes, allow more to occur
    if ((c=flux_bits_mfm_skip_sync(fb,ev,fp)) < 3)
        return -MFM_READ_SYNC_ERROR;

    return flux_bits_mfm_decode(fb,ev,fp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x7ff0
movl %eax, -0x24(%rbp)
cmpl $0x3, %eax
jge 0x80d6
movl $0xfffffefe, -0x4(%rbp) # imm = 0xFFFFFEFE
jmp 0x80ea
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x7800
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)