LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/IDEmbedder[P]IDembedder/./Grid.hpp
// Function: Grid::find_simplex(std::vector<double, std::allocator<double>> const&, std::vector<double, std::allocator<double>>&, std::vector<unsigned long, std::allocator<unsigned long>>&, std::vector<unsigned long, std::allocator<unsigned long>>&) const
void find_simplex(const std::vector<double>& vector_to_embed, std::vector<double>& norms, std::vector<size_t>& lower_bounds, std::vector<size_t>& indices) const {
            for (size_t i = 0; i < get_num_of_dims(); i++) {
                const std::vector<double>& current_dim(_discrete_points[i]);
                double feature_value = vector_to_embed[i];
        
                _correction_of_feature_out_of_range(feature_value, current_dim);
                size_t bound_of_feature = _find_lower_bound(current_dim, feature_value);
                lower_bounds[i] = bound_of_feature;
                
                double lower_value = current_dim[bound_of_feature];
                double upper_value = current_dim[bound_of_feature + 1];
                norms[i] = _norm_calc(lower_value, upper_value, feature_value);
                
                indices[i] = i;
            }
        
            sort(indices.begin(), indices.end(), [&](const size_t& i, const size_t& j)
            { return norms[i] < norms[j]; });
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r14
movq %rcx, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq (%rdi), %rbp
cmpq %rbp, 0x8(%rdi)
je 0x35b1
movq %rsi, %r12
movq %rdi, %r13
xorl %ebx, %ebx
xorl %r15d, %r15d
movq (%r12), %rax
movsd (%rax,%r15,8), %xmm0
movsd %xmm0, (%rsp)
movq (%rbp,%rbx), %rax
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
ja 0x352d
movq 0x8(%rbp,%rbx), %rax
movsd -0x8(%rax), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x3532
movsd %xmm1, (%rsp)
addq %rbx, %rbp
movq %r13, %rdi
movq %rbp, %rsi
movq %rsp, %rdx
callq 0x370a
movq 0x10(%rsp), %rcx
movq (%rcx), %rcx
movq %rax, (%rcx,%r15,8)
movq (%rbp), %rcx
movsd (%rcx,%rax,8), %xmm0
movsd 0x8(%rcx,%rax,8), %xmm1
movsd (%rsp), %xmm2
subsd %xmm0, %xmm2
subsd %xmm0, %xmm1
divsd %xmm1, %xmm2
movq 0x8(%rsp), %rax
movq (%rax), %rax
movsd %xmm2, (%rax,%r15,8)
movq (%r14), %rax
movq %r15, (%rax,%r15,8)
incq %r15
movq (%r13), %rbp
movq 0x8(%r13), %rax
subq %rbp, %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
addq $0x18, %rbx
cmpq %rax, %r15
jb 0x34ff
movq (%r14), %r15
movq 0x8(%r14), %r14
cmpq %r14, %r15
je 0x35f5
movq %r14, %rax
subq %r15, %rax
sarq $0x3, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r15, %rdi
movq %r14, %rsi
movq 0x8(%rsp), %rbx
movq %rbx, %rcx
callq 0x3791
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x38b2
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/IDEmbedder[P]IDembedder/./ID.hpp
// Function: ID::_embedded_vector_indices_calc(std::vector<unsigned long, std::allocator<unsigned long>> const&, std::vector<unsigned long, std::allocator<unsigned long>> const&) const
void _embedded_vector_indices_calc(const std::vector<size_t>& lower_bounds, const std::vector<size_t>& indices_order) const {
            size_t next_index;
            size_t prod_size_i;
            
            _embedded_vector[0]._index = _discrete_points_for_all_dims.index_calc(lower_bounds);
        
            for (size_t i = 1; i < _embedded_vector.size(); i++) {
                prod_size_i = _steps_between_dims()[indices_order[_steps_between_dims().size() - i]];
                next_index = _embedded_vector[i - 1]._index + prod_size_i;
                _embedded_vector[i]._index = next_index;    
            }
        }

// Assembly:
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
subq %rax, %rcx
je 0x36b6
sarq $0x3, %rcx
movq 0x20(%rdi), %rsi
cmpq $0x1, %rcx
adcq $0x0, %rcx
xorl %r9d, %r9d
xorl %r8d, %r8d
movq (%rsi,%r9,8), %r10
imulq (%rax,%r9,8), %r10
addq %r10, %r8
incq %r9
cmpq %r9, %rcx
jne 0x36a0
jmp 0x36b9
xorl %r8d, %r8d
movq 0x38(%rdi), %rax
movq %r8, (%rax)
movq 0x40(%rdi), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
cmpq $0x2, %rcx
jb 0x3708
movq 0x20(%rdi), %rsi
movq 0x28(%rdi), %rdi
subq %rsi, %rdi
negq %rcx
addq (%rdx), %rdi
addq $0x10, %rax
movq $-0x1, %rdx
movq (%rdi,%rdx,8), %r8
movq -0x10(%rax), %r9
addq (%rsi,%r8,8), %r9
movq %r9, (%rax)
decq %rdx
addq $0x10, %rax
cmpq %rdx, %rcx
jne 0x36ed
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/IDEmbedder[P]IDembedder/./Grid.hpp
// Function: Grid::_find_lower_bound(std::vector<double, std::allocator<double>> const&, double&) const
void _correction_of_feature_out_of_range(double& feature_value, const std::vector<double>& dim_discrete_points) const {
            if (feature_value < dim_discrete_points.front())
                feature_value = dim_discrete_points.front();
            else if (feature_value > dim_discrete_points.back())
                feature_value = dim_discrete_points.back();
        }

// Assembly:
movsd (%rdx), %xmm1
movq (%rsi), %rcx
movsd (%rcx), %xmm0
ucomisd %xmm1, %xmm0
ja 0x372a
movq 0x8(%rsi), %rax
movsd -0x8(%rax), %xmm0
ucomisd %xmm0, %xmm1
jbe 0x372e
movsd %xmm0, (%rdx)
movq 0x8(%rsi), %rsi
subq %rcx, %rsi
sarq $0x3, %rsi
movq %rcx, %rdi
testq %rsi, %rsi
jle 0x376e
movsd (%rdx), %xmm0
movq %rsi, %r8
movq %rcx, %rdi
movq %rsi, %rax
shrq %rax
ucomisd (%rdi,%rax,8), %xmm0
jbe 0x3766
leaq (%rdi,%rax,8), %rdi
addq $0x8, %rdi
notq %rax
addq %r8, %rax
movq %rax, %r8
testq %rax, %rax
jg 0x374e
subq %rcx, %rdi
movq %rdi, %rax
sarq $0x3, %rax
decq %rsi
cmpq %rsi, %rax
je 0x378d
movsd (%rcx,%rdi), %xmm0
ucomisd (%rdx), %xmm0
jne 0x378d
jnp 0x3790
decq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O1/IDEmbedder[P]IDembedder/./Grid.hpp
// Function: Grid::double_grid()
void double_grid() {
            _discrete_points.resize(2 * get_num_of_dims());
            std::copy_n(_discrete_points.begin(), get_num_of_dims()/2, _discrete_points.begin() + get_num_of_dims()/2);
            _number_of_vertices *= _number_of_vertices;
            _steps_between_dims = std::vector<size_t>(get_num_of_dims(), 1);
            _steps_between_dims_calc();
        }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rax
subq (%rdi), %rax
sarq $0x3, %rax
movabsq $0x5555555555555556, %rsi # imm = 0x5555555555555556
imulq %rax, %rsi
callq 0x3cf2
movq (%rbx), %r14
movq 0x8(%rbx), %rax
subq %r14, %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %r15 # imm = 0xAAAAAAAAAAAAAAAB
imulq %r15, %rax
cmpq $0x2, %rax
jb 0x3c4e
shrq %rax
leaq 0x1(%rax), %r12
shlq $0x3, %rax
leaq (%rax,%rax,2), %r13
leaq (%r14,%r13), %rdi
movq %r14, %rsi
callq 0x2f46
addq $0x18, %r14
decq %r12
cmpq $0x1, %r12
jg 0x3c35
movq 0x18(%rbx), %rax
imulq %rax, %rax
movq %rax, 0x18(%rbx)
movq 0x8(%rbx), %rsi
subq (%rbx), %rsi
sarq $0x3, %rsi
imulq %r15, %rsi
leaq 0x10(%rsp), %rdx
movq $0x1, (%rdx)
leaq 0x18(%rsp), %r14
leaq 0xf(%rsp), %rcx
movq %r14, %rdi
callq 0x2cf2
leaq 0x20(%rbx), %rdi
movq %r14, %rsi
callq 0x3f0c
movq (%r14), %rdi
testq %rdi, %rdi
je 0x3ca8
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x10f0
movq %rbx, %rdi
callq 0x2d70
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/IDEmbedder[P]IDembedder/./IDpair.hpp
// Function: IDpair::_less(std::vector<double, std::allocator<double>> const&, std::vector<double, std::allocator<double>> const&) const
bool _less(const std::vector<double>& vector_to_cmp1, const std::vector<double>& vector_to_cmp2) const {
            for (size_t i = 0; i < vector_to_cmp1.size(); i++) {
                if (vector_to_cmp1[i] < vector_to_cmp2[i])
                    return true;
                else if (vector_to_cmp1[i] > vector_to_cmp2[i])
                    return false;
            }
            
            return false;
        }

// Assembly:
movq (%rsi), %rdi
movq 0x8(%rsi), %rsi
subq %rdi, %rsi
setne %al
je 0x40d9
sarq $0x3, %rsi
movq (%rdx), %rdx
cmpq $0x1, %rsi
movq %rsi, %r8
adcq $0x0, %r8
movsd (%rdi), %xmm0
movsd (%rdx), %xmm1
movb $0x1, %cl
ucomisd %xmm0, %xmm1
ja 0x40d9
movl $0x1, %r9d
ucomisd %xmm1, %xmm0
ja 0x40de
cmpq %rsi, %r9
setb %al
cmpq %r9, %r8
je 0x40d9
movsd (%rdi,%r9,8), %xmm0
movsd (%rdx,%r9,8), %xmm1
incq %r9
ucomisd %xmm0, %xmm1
jbe 0x40b1
jmp 0x40d9
andb %cl, %al
andb $0x1, %al
retq
xorl %ecx, %ecx
jmp 0x40d9
// File: /workspace/github_cpp_makefile_star2_O1/IDEmbedder[P]IDembedder/./IDpair.hpp
// Function: IDpair::_embed(std::vector<double, std::allocator<double>> const&, std::vector<double, std::allocator<double>> const&) const
const std::vector<Pair>& _embed(const std::vector<double>& vector_to_cmp1, const std::vector<double>& vector_to_cmp2) const {
/*            std::cout << _num_of_dims() << " " << vector_to_cmp1.size() << " " << vector_to_cmp2.size() << std::endl;
            
            for (auto i : vector_to_cmp1) {
                std::cout << i << " ";
            }
            std::cout << std::endl;
            for (auto i : vector_to_cmp2) {
                std::cout << i << " ";
            }
            std::cout << std::endl;*/
            
            assert((_num_of_dims() / 2) == vector_to_cmp1.size()
            && (_num_of_dims() / 2) == vector_to_cmp2.size()
            && "Number of features should be equal to number of dimensions of discrete points");
            
            std::vector<double> concat_vector_to_map(vector_to_cmp1);
            
            concat_vector_to_map.insert(concat_vector_to_map.end(), vector_to_cmp2.begin(), vector_to_cmp2.end());
        
            return ID::operator()(concat_vector_to_map);
        }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x1e9a
movq 0x8(%r15), %rsi
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
callq 0x416a
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x2272
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x4138
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x10f0
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x4147
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x4161
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x10f0
movq %rbx, %rdi
callq 0x1160
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, (%rsp)
movq (%rdi), %r12
leaq (%rsi,%rsi,2), %r13
movq 0x8(%r12,%r13,8), %rbp
movq (%r12,%r13,8), %r15
movq %rbp, %rbx
subq %r15, %rbx
sarq $0x3, %rbx
movq %rcx, %rdi
movq %rbx, %rsi
callq 0x4bec
cmpq %r15, %rbp
je 0x4bdd
leaq (%r12,%r13,8), %rax
movq (%rax), %rax
movq (%rsp), %rcx
movq (%rcx), %rcx
movq (%r14), %rdx
cmpq $0x1, %rbx
adcq $0x0, %rbx
xorl %esi, %esi
movq (%rax,%rsi,8), %rdi
movsd (%rcx,%rdi,8), %xmm0
movsd %xmm0, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rbx
jne 0x4bc7
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movl %edx, %ebp
movq %rdi, %rbx
movq %rsp, %rdi
callq 0xa2e0
leaq 0x10(%rbx), %r15
movq %r15, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
leaq 0x10(%rsp), %rdi
movl %ebp, %esi
callq 0xa760
movq %rsp, %rdi
movq %rbx, %rsi
callq 0xa550
movq 0x5fcb3(%rip), %rsi     # 0x6af70
movq %rsp, %rdi
callq 0xa330
leaq 0x80(%rsp), %rdi
callq 0xa140
movq %rbx, %rax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0xb2f3
callq 0xa440
movq 0x5fc76(%rip), %rsi     # 0x6af70
movq %rsp, %rdi
callq 0xa330
leaq 0x80(%rsp), %rdi
callq 0xa140
movq %r14, %rdi
callq 0xa780
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %r15
pushq %r14
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movss %xmm0, 0x4(%rsp)
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0xa2e0
leaq 0x10(%rbx), %r15
movq %r15, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
leaq 0x18(%rsp), %rdi
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rsp), %xmm0
callq 0xa6c0
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0xa550
movq 0x5fbff(%rip), %rsi     # 0x6af70
leaq 0x8(%rsp), %rdi
callq 0xa330
leaq 0x88(%rsp), %rdi
callq 0xa140
movq %rbx, %rax
addq $0x190, %rsp            # imm = 0x190
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0xb3a8
callq 0xa440
movq 0x5fbc1(%rip), %rsi     # 0x6af70
leaq 0x8(%rsp), %rdi
callq 0xa330
leaq 0x88(%rsp), %rdi
callq 0xa140
movq %r14, %rdi
callq 0xa780
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
movq (%rdx), %rsi
movq 0x8(%rdx), %rdx
addq %rsi, %rdx
callq 0x12b94
movq (%rbx), %r14
cmpb $0x0, -0x1(%r14)
je 0xb46d
xorl %r15d, %r15d
movsbl (%r14,%r15), %edi
callq 0xa800
movb %al, (%r14,%r15)
movq (%rbx), %r14
cmpb $0x0, (%r14,%r15)
leaq 0x1(%r15), %r15
jne 0xb451
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
movq (%rdx), %rsi
movq 0x8(%rdx), %rdx
addq %rsi, %rdx
callq 0x12b94
movq (%rbx), %r14
cmpb $0x0, -0x1(%r14)
je 0xb4fd
xorl %r15d, %r15d
movsbl (%r14,%r15), %edi
callq 0xa630
movb %al, (%r14,%r15)
movq (%rbx), %r14
cmpb $0x0, (%r14,%r15)
leaq 0x1(%r15), %r15
jne 0xb4e1
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
leaq 0x70(%rdi), %rax
movq %rax, 0x18(%rsp)
movq 0x8(%rsp), %rsi
testq %rsi, %rsi
je 0x23e9f
movq %rax, (%rsi)
addq $0x8, 0x8(%rsp)
jmp 0x23eac
movq %rsp, %rdi
leaq 0x18(%rsp), %rdx
callq 0x2545c
leaq 0xa8(%r14), %rax
movq %rax, 0x18(%rsp)
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x23ecf
movq %rax, (%rsi)
addq $0x8, 0x8(%rsp)
jmp 0x23edc
movq %rsp, %rdi
leaq 0x18(%rsp), %rdx
callq 0x2545c
leaq 0xe0(%r14), %rax
movq %rax, 0x18(%rsp)
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x23eff
movq %rax, (%rsi)
addq $0x8, 0x8(%rsp)
jmp 0x23f0c
movq %rsp, %rdi
leaq 0x18(%rsp), %rdx
callq 0x2545c
leaq 0x38(%rsp), %rdi
movq %rsp, %rsi
callq 0x250b6
leaq 0x28(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x25d78(%rip), %rsi     # 0x49ca1
leaq 0x25d79(%rip), %rdx     # 0x49ca9
leaq 0x18(%rsp), %rdi
callq 0x14914
addq $0x50, %r14
leaq 0x38(%rsp), %rsi
leaq 0x18(%rsp), %rcx
movq %r14, %rdi
movq %rbx, %rdx
xorl %r8d, %r8d
callq 0x24b28
movl %eax, %ebx
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x23f67
callq 0xa440
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x23f76
callq 0xa440
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x23f84
callq 0xa440
movl %ebx, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x23fbe
jmp 0x23fbe
jmp 0x23fbe
movq %rax, %rbx
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x23fad
callq 0xa440
jmp 0x23fad
movq %rax, %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x23fc1
callq 0xa440
jmp 0x23fc1
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x23fcf
callq 0xa440
movq %rbx, %rdi
callq 0xa780
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdx, %rbx
callq 0x2407e
movq 0x8(%rbx), %rax
movq (%rbx), %rcx
subq %rcx, %rax
je 0x2404b
movss %xmm0, 0x4(%rsp)
sarq $0x3, %rax
movabsq $-0x3333333333333333, %r13 # imm = 0xCCCCCCCCCCCCCCCD
imulq %rax, %r13
xorl %r14d, %r14d
leaq 0x8(%rsp), %r15
xorl %r12d, %r12d
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2465a
addq 0x8(%rsp), %r12
movq %r15, %rdi
callq 0x26dc2
incq %r14
cmpq %r14, %r13
jne 0x2401c
testq %r12, %r12
js 0x24050
cvtsi2ss %r12, %xmm1
jmp 0x24066
xorps %xmm1, %xmm1
jmp 0x2406c
movq %r12, %rax
shrq %rax
andl $0x1, %r12d
orq %rax, %r12
cvtsi2ss %r12, %xmm1
addss %xmm1, %xmm1
movss 0x4(%rsp), %xmm0
divss %xmm1, %xmm0
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r14
pushq %rbx
subq $0x410, %rsp            # imm = 0x410
movl %edi, %ebx
leaq -0x420(%rbp), %r14
movl $0x401, %edx            # imm = 0x401
movq %r14, %rdi
xorl %esi, %esi
callq 0x1090
movl $0x401, %edx            # imm = 0x401
movl %ebx, %edi
movq %r14, %rsi
callq 0x1120
testl %eax, %eax
js 0x1363
testl %eax, %eax
je 0x1333
movq %r14, %rdi
callq 0x1140
jmp 0x1333
leaq 0xd3b(%rip), %rdi       # 0x20a5
callq 0x1140
xorl %edi, %edi
callq 0x1100
// File: /workspace/github_cpp_makefile_star2_O1/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 (%rsi), %rax
movq 0x8(%rsi), %rcx
movq (%rdi), %rsi
movq 0x8(%rdi), %rdi
movq %rcx, %rdx
subq %rdi, %rdx
js 0x243b
subq %rsi, %rax
jmp 0x244e
notq %rsi
addq %rsi, %rax
subq %rdi, %rcx
addq $0x3b9aca00, %rcx       # imm = 0x3B9ACA00
movq %rcx, %rdx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x220(%rbp), %r15
movl $0x200, %edx            # imm = 0x200
movq %r15, %rdi
xorl %esi, %esi
callq 0x20f0
movzwl 0x4(%r14), %edx
addq $0x6, %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x2150
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq %r15, %rdi
callq 0x20c0
leaq (%rax,%rbp), %rdx
addq $-0x220, %rdx           # imm = 0xFDE0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3940
movq %rbx, %rax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movzwl 0x4(%rsi), %eax
cmpq %rdx, %rax
cmovbq %rax, %r14
leaq -0x220(%rbp), %r12
movl $0x200, %edx            # imm = 0x200
movq %r12, %rdi
xorl %esi, %esi
callq 0x20f0
addq $0x6, %r15
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2150
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq %r12, %rdi
callq 0x20c0
leaq (%rax,%rbp), %rdx
addq $-0x220, %rdx           # imm = 0xFDE0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3940
movq %rbx, %rax
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movl %edi, %ebx
leaq -0x250(%rbp), %rdi
callq 0x3cb4
movl $0x10, -0x2c(%rbp)
xorps %xmm0, %xmm0
leaq -0x40(%rbp), %r14
movaps %xmm0, (%r14)
xorl %edi, %edi
movq %r14, %rsi
callq 0x2190
movq %r14, %rdi
movl $0x7d0, %esi            # imm = 0x7D0
callq 0x3834
testb %al, %al
jne 0x2fc5
leaq -0x250(%rbp), %r14
leaq -0x50(%rbp), %r15
leaq -0x2c(%rbp), %r12
leaq -0x40(%rbp), %r13
movl $0x200, %edx            # imm = 0x200
movl %ebx, %edi
movq %r14, %rsi
xorl %ecx, %ecx
movq %r15, %r8
movq %r12, %r9
callq 0x2130
testl %eax, %eax
js 0x2fa0
je 0x2fb4
cmpb $0x2, -0x250(%rbp)
jne 0x2fb4
jmp 0x2fc5
callq 0x2040
cmpl $0xb, (%rax)
jne 0x3043
movl $0x0, (%rax)
movq %r13, %rdi
movl $0x7d0, %esi            # imm = 0x7D0
callq 0x3834
testb %al, %al
je 0x2f78
movq 0x2ffc(%rip), %rbx      # 0x5fc8
leaq 0x1276(%rip), %rsi      # 0x4249
movl $0x2a, %edx
movq %rbx, %rdi
callq 0x21f0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2fa6(%rip), %rdi      # 0x5ff0
leaq 0x11a5(%rip), %rsi      # 0x41f6
callq 0x21b0
movq %rax, %rdi
callq 0x20d0
movl %ebx, %edi
callq 0x22b0
movl $0x1, %edi
callq 0x2210
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
movq %rcx, %r14
movl %edi, %ebx
movq %rsi, -0x60(%rbp)
movq %rdx, -0x58(%rbp)
leaq 0x6(%rcx), %r13
movl 0x8(%r8), %esi
movl (%r8), %ecx
movl 0x4(%r8), %edx
movq %r13, %rdi
callq 0x34c1
movl %eax, %r15d
testl %eax, %eax
jne 0x3460
movl %ebx, -0x2c(%rbp)
movq 0x2c77(%rip), %rbx      # 0x5fc8
leaq 0xe34(%rip), %rsi       # 0x418c
movl $0x12, %edx
movq %rbx, %rdi
callq 0x21f0
movzbl 0x1(%r14), %esi
movq %rbx, %rdi
callq 0x2270
leaq 0xdcb(%rip), %rsi       # 0x4144
movl $0x1, %edx
movq %rax, %rdi
callq 0x21f0
leaq 0xe12(%rip), %rsi       # 0x419f
movl $0x6, %edx
movq %rbx, %rdi
callq 0x21f0
movzwl 0x4(%r14), %eax
cmpw $0x30, %ax
movl $0x30, %ecx
cmovbl %eax, %ecx
movzwl %cx, %ebx
leaq -0x260(%rbp), %r12
movl $0x200, %edx            # imm = 0x200
movq %r12, %rdi
xorl %esi, %esi
callq 0x20f0
movq %r12, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x2150
leaq -0x40(%rbp), %r13
movq %r13, -0x10(%r13)
movq %r12, %rdi
callq 0x20c0
leaq (%rax,%rbp), %rdx
addq $-0x260, %rdx           # imm = 0xFDA0
leaq -0x50(%rbp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3940
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x2bbe(%rip), %rdi      # 0x5fc8
callq 0x21f0
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
movl -0x2c(%rbp), %ebx
je 0x3427
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21e0
movq 0x2b9a(%rip), %rdi      # 0x5fc8
leaq 0xd0e(%rip), %rsi       # 0x4143
movl $0x2, %edx
callq 0x21f0
leaq -0x60(%rbp), %r8
movl $0x200, %edx            # imm = 0x200
movl %ebx, %edi
movq %r14, %rsi
xorl %ecx, %ecx
movl $0x10, %r9d
callq 0x2060
cmpq $-0x1, %rax
je 0x3475
movl %r15d, %eax
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2b74(%rip), %rdi      # 0x5ff0
leaq 0xd23(%rip), %rsi       # 0x41a6
callq 0x21b0
movq %rax, %rdi
callq 0x20d0
movl %ebx, %edi
callq 0x22b0
movl $0x1, %edi
callq 0x2210
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x34b9
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21e0
movq %rbx, %rdi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq -0x28(%rbp), %r15
xorl %edi, %edi
movq %r15, %rsi
callq 0x2190
movq (%r15), %rax
movq 0x8(%r15), %rdx
movq (%r14), %rsi
movq 0x8(%r14), %rdi
movq %rdx, %rcx
subq %rdi, %rcx
js 0x386f
subq %rsi, %rax
jmp 0x3882
notq %rsi
addq %rsi, %rax
subq %rdi, %rdx
addq $0x3b9aca00, %rdx       # imm = 0x3B9ACA00
movq %rdx, %rcx
movl %ebx, %edx
imulq $0xf4240, %rdx, %rdx    # imm = 0xF4240
imulq $0x3b9aca00, %rax, %rax # imm = 0x3B9ACA00
addq %rcx, %rax
cmpq %rdx, %rax
seta %al
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r14d
movq %rdi, %r15
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x20f0
movb %r14b, 0x1(%r15)
movb %bl, (%r15)
movw $0x0, 0x2(%r15)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, -0x30(%rbp)
movl %ecx, -0x2c(%rbp)
movl %edx, %r12d
movq %rsi, -0x38(%rbp)
movq %rdi, %rbx
leaq 0x6(%rdi), %r14
xorl %r13d, %r13d
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x20f0
movl %r12d, %r15d
movq %r14, %rdi
movq -0x38(%rbp), %rsi
movq %r15, %rdx
callq 0x2150
movw %r12w, 0x4(%rbx)
movl -0x2c(%rbp), %eax
movb %al, 0x1(%rbx)
movl -0x30(%rbp), %eax
movb %al, (%rbx)
testl %r12d, %r12d
je 0x3d82
xorl %eax, %eax
xorl %ecx, %ecx
addb (%r14,%rax), %cl
incq %rax
cmpq %rax, %r15
jne 0x3d72
movzbl %cl, %r13d
movw %r13w, 0x2(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl 0x4(%rdi), %eax
cmpl $0x19, %eax
setae %r12b
jae 0x3efb
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3cf4
testb %al, %al
je 0x3efb
cmpb $0x1, 0x4(%r14)
jne 0x3ef0
movl (%r14), %ecx
movl 0x8(%r15), %eax
movl 0xc(%r15), %esi
subq %rax, %rcx
movl %esi, %eax
shrl %eax
addq %rcx, %rax
cqto
idivq %rsi
testq %rax, %rax
jg 0x3ed9
xorl %eax, %eax
cmpq $0x7, %rax
jl 0x3ee4
movl $0x7, %eax
incl %eax
movq %r15, %rdi
movl %eax, %esi
callq 0x3f12
cmpl $0x19, 0x4(%r15)
setae %r12b
jb 0x3ea2
movl %r12d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
testl %esi, %esi
je 0x3f4c
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
movl 0x4(%rdi), %eax
addl %esi, %eax
movl %eax, 0x4(%rdi)
cmpl $0x21, %eax
jae 0x3f4d
movl (%rbx), %eax
movl %r14d, %ecx
shll %cl, %eax
decb %r14b
movl $0x1, %edx
movl %r14d, %ecx
shll %cl, %edx
addl %eax, %edx
movl %edx, (%rbx)
popq %rbx
popq %r14
popq %rbp
retq
callq 0x22e0
jmp 0x3f30
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r14
pushq %rbx
cmpl %esi, 0x4(%rdi)
jb 0x3fa7
movl %esi, %ebx
movq %rdi, %r14
callq 0x3f62
subl %ebx, 0x4(%r14)
popq %rbx
popq %r14
popq %rbp
retq
callq 0x233e
xorl %eax, %eax
jmp 0x3fa2
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x1, 0x4(%rdi)
ja 0x41af
movq %rbx, %rdi
callq 0x3e82
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
testb %al, %al
je 0x4206
movq %rbx, %rdi
movl $0x2, %esi
callq 0x3f62
movl %eax, %r14d
cmpl $0x1, %eax
je 0x41dd
cmpl $0x3, %r14d
je 0x41f3
movl 0x7fc8(%rip), %eax      # 0xc198
addl %eax, %eax
xorl %r14d, %eax
xorl %r14d, %r14d
cmpl $0x2, %eax
jne 0x41f3
movq %rbx, %rdi
movl $0x2, %esi
callq 0x3f88
movl %r14d, 0x7fa7(%rip)     # 0xc198
jmp 0x4206
movq %rbx, %rdi
movl $0x1, %esi
callq 0x3f88
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
cmpl $0xf, 0x4(%rdi)
ja 0x4243
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3e82
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
testb %al, %al
je 0x42a7
movq %rbx, %rdi
movl $0x10, %esi
callq 0x3f62
cmpl $0x4489, %eax           # imm = 0x4489
jne 0x4276
movq %rbx, %rdi
movl $0x10, %esi
callq 0x3f88
movl $0x1, 0x7f2a(%rip)      # 0xc198
movl $0xffffff5f, %r12d      # imm = 0xFFFFFF5F
jmp 0x42a7
xorl %r12d, %r12d
movl $0x7, %r13d
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x418d
testl %eax, %eax
js 0x42a1
movl %r13d, %ecx
shll %cl, %eax
orl %eax, %r12d
addl $-0x1, %r13d
jb 0x427f
jmp 0x42a7
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
movl %edi, %eax
testq %rdx, %rdx
je 0x42ed
xorl %ecx, %ecx
leaq 0x10b3(%rip), %rdi      # 0x5380
movzwl %ax, %r8d
shrl $0x8, %r8d
movzbl (%rsi,%rcx), %r9d
xorl %r8d, %r9d
shll $0x8, %eax
xorw (%rdi,%r9,2), %ax
incq %rcx
cmpq %rcx, %rdx
jne 0x42cd
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/joncampbell123[P]floppytools/kryocomm.cpp
// Function: kryoflux_parse_stream_nv_pair(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, __gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char>>>&, __gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char>>>)
void kryoflux_parse_stream_nv_pair(std::string &name,std::string &value,std::vector<unsigned char>::iterator &mi,const std::vector<unsigned char>::iterator mend) {
    name.clear();
    value.clear();

    /* leading space */
    while (mi != mend && *mi == ' ') mi++;

    /* name */
    while (mi != mend) {
        if (*mi == 0) return; /* end of string, return now */
        if (*mi == '=') {
            mi++; /* skip it and break to next loop */
            break;
        }
        if (*mi == ',') {
            mi++; /* skip it and return */
            return;
        }

        name += *mi;
        mi++;
    }

    /* value */
    while (mi != mend) {
        if (*mi == 0) return; /* end of string, return now */
        if (*mi == ',') {
            mi++; /* skip it and return */
            return;
        }

        value += *mi;
        mi++;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
xorl %eax, %eax
movq %rax, 0x8(%rdi)
movq (%rdi), %rcx
movb %al, (%rcx)
movq %rax, 0x8(%rsi)
movq (%rsi), %rcx
movb %al, (%rcx)
movq (%rdx), %rax
cmpq %r14, %rax
je 0x4396
cmpb $0x20, (%rax)
jne 0x4396
incq %rax
movq %rax, (%rbx)
jmp 0x4384
movq (%rbx), %rax
cmpq %r14, %rax
je 0x43cb
movzbl (%rax), %ecx
testl %ecx, %ecx
je 0x43fb
cmpl $0x2c, %ecx
je 0x43f5
cmpl $0x3d, %ecx
je 0x43c5
movsbl %cl, %esi
movq %r12, %rdi
callq 0x2120
movq (%rbx), %rax
incq %rax
movq %rax, (%rbx)
jmp 0x4399
incq %rax
movq %rax, (%rbx)
movq (%rbx), %rax
cmpq %r14, %rax
je 0x43fb
movzbl (%rax), %ecx
testl %ecx, %ecx
je 0x43fb
cmpl $0x2c, %ecx
je 0x43f5
movsbl %cl, %esi
movq %r15, %rdi
callq 0x2120
movq (%rbx), %rax
incq %rax
movq %rax, (%rbx)
jmp 0x43ce
incq %rax
movq %rax, (%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, -0x30(%rbp)
leaq -0x70(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x50(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
movq (%rsi), %rax
movq %rax, -0x38(%rbp)
movq 0x8(%rsi), %rcx
cmpq %rcx, %rax
je 0x44e4
movq %rsi, %rbx
movq -0x30(%rbp), %rdx
leaq 0x28(%rdx), %rsi
movq %rsi, -0x40(%rbp)
leaq 0x20(%rdx), %r14
leaq -0x80(%rbp), %r15
leaq -0x60(%rbp), %r12
cmpb $0x0, (%rax)
je 0x44e4
movq %r15, %rdi
movq %r12, %rsi
leaq -0x38(%rbp), %rdx
callq 0x4356
movq %r15, %rdi
leaq 0x114b(%rip), %rsi      # 0x55cf
callq 0x2070
testl %eax, %eax
je 0x44cb
movq %r15, %rdi
leaq 0x113d(%rip), %rsi      # 0x55d4
callq 0x2070
movq %r14, %r13
testl %eax, %eax
je 0x44ba
movq %r15, %rdi
leaq 0x112b(%rip), %rsi      # 0x55d8
callq 0x2070
movq -0x40(%rbp), %r13
testl %eax, %eax
jne 0x44d7
movq -0x60(%rbp), %rdi
callq 0x21a0
movsd %xmm0, (%r13)
jmp 0x44d7
movq -0x30(%rbp), %rdi
movq %r12, %rsi
callq 0x20c0
movq 0x8(%rbx), %rcx
movq -0x38(%rbp), %rax
cmpq %rcx, %rax
jne 0x4466
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x44f6
callq 0x2140
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x4508
callq 0x2140
movb $0x1, %al
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x452e
callq 0x2140
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x4540
callq 0x2140
movq %rbx, %rdi
callq 0x2210
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xe0, %rsp
movl %edx, %ecx
movl %esi, %edx
movq %rdi, %rbx
leaq -0x50(%rbp), %r14
movq %r14, -0x10(%r14)
movq $0x0, -0x8(%r14)
movb $0x0, (%r14)
leaq 0xbc5(%rip), %rsi       # 0x5141
leaq -0x100(%rbp), %rdi
xorl %eax, %eax
callq 0x2050
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0x40(%rbp), %rdi
callq 0x3c5a
leaq 0xba6(%rip), %rsi       # 0x5152
leaq -0x40(%rbp), %rdi
callq 0x2230
leaq -0x40(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x2230
leaq -0x70(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x45ea
movq %rdx, -0x80(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x70(%rbp)
jmp 0x45f2
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq -0x80(%rbp), %rbx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x60(%rbp), %rdi
movq %rbx, %rsi
callq 0x2190
movq (%rbx), %rdi
cmpq %r12, %rdi
je 0x4626
callq 0x2140
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x4634
callq 0x2140
movq -0x60(%rbp), %rdi
leaq 0xb1c(%rip), %rsi       # 0x515b
callq 0x2180
movq %rax, %rbx
movq -0x60(%rbp), %rdi
cmpq %r14, %rdi
je 0x4655
callq 0x2140
movq %rbx, %rax
addq $0xe0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x466a
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x4680
callq 0x2140
jmp 0x4680
movq %rax, %rbx
movq -0x60(%rbp), %rdi
cmpq %r14, %rdi
je 0x468e
callq 0x2140
movq %rbx, %rdi
callq 0x2210
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3e82
cmpl $0x10, 0x4(%r15)
setae %r12b
movq %r15, %rdi
jb 0x46ed
movl $0x10, %esi
callq 0x3f62
cmpl $0x4489, %eax           # imm = 0x4489
je 0x4703
movq %r15, %rdi
movl $0x1, %esi
callq 0x3f88
movl 0x4(%r15), %eax
cmpl $0x10, %eax
jmp 0x46bd
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3e82
testb %al, %al
je 0x4703
cmpl $0x0, 0x4(%r15)
jne 0x46aa
movl %r12d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
callq 0x3e82
xorl %r12d, %r12d
cmpl $0x10, 0x4(%r15)
jb 0x47d9
xorl %r12d, %r12d
movq %r15, %rdi
movl $0x10, %esi
callq 0x3f62
cmpl $0x4489, %eax           # imm = 0x4489
jne 0x47d9
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x420e
cmpl $0xffffff5f, %eax       # imm = 0xFFFFFF5F
setne %cl
testl %eax, %eax
sets %al
testb %al, %cl
jne 0x47d9
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3e82
incl %r12d
cmpl $0xf, 0x4(%r15)
ja 0x478e
movl %r12d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq