LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/ivanzamanov[P]kmeans/src/common/utils.cpp
// Function: writeToken(char const*, int)
void writeToken(const char* buffer, int fd) {
	int len = strlen(buffer);
	int bytesWritten = write(fd, buffer, len);
	if(len != bytesWritten) {
		printf("Error writing token\n");
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
callq 0x1060
movslq %eax, %r15
movl %ebx, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1050
cmpl %eax, %r15d
jne 0x1f86
popq %rbx
popq %r14
popq %r15
retq
leaq 0x12b9(%rip), %rdi      # 0x3246
popq %rbx
popq %r14
popq %r15
jmp 0x10c0
// File: /workspace/github_cpp_makefile_star2_O3/ivanzamanov[P]kmeans/src/common/utils.cpp
// Function: lowercaseToken(char*)
void lowercaseToken(char* token) {
	char* str = token;
	while(*str != '\0') {
		char c = *str;
		if(c >= 'A' && c <= 'Z') {
			*str = c + DIFF;
		}		
		str++;
	}
}

// Assembly:
movb (%rdi), %al
testb %al, %al
je 0x1fb6
incq %rdi
leal -0x41(%rax), %ecx
cmpb $0x19, %cl
ja 0x1fad
orb $0x20, %al
movb %al, -0x1(%rdi)
movb (%rdi), %al
incq %rdi
testb %al, %al
jne 0x1fa0
retq
// File: /workspace/github_cpp_makefile_star2_O3/ivanzamanov[P]kmeans/src/common/utils.cpp
// Function: readToken(char const*, int&, char*, int)
bool readToken(const char* data, int& offset, char* buffer, int buffLength) {
	const char* str = data + offset;
	if(*str == '\0')
		return false;
	int leading = 0;
	while(!isAlphanumeric(*str) && *str != '\0') {
		str++;
		leading++;
	}

	int i = 0;
	while(shouldRead(*str) && i < buffLength) {
		*(buffer + i) = *str;
		i++;
		str++;
	}

	offset = offset + leading + i;
	buffer[i] = 0;
	return i > 0;
}

// Assembly:
movslq (%rsi), %r9
movb (%rdi,%r9), %r8b
xorl %eax, %eax
testb %r8b, %r8b
je 0x20c3
pushq %rbp
pushq %rbx
addq %r9, %rdi
movl %r8d, %r10d
andb $-0x21, %r10b
addb $-0x41, %r10b
cmpb $0x1a, %r10b
setb %bl
leal -0x30(%r8), %r11d
cmpb $0xa, %r11b
setb %bpl
orb %bl, %bpl
jne 0x2050
xorl %eax, %eax
movb 0x1(%rdi,%rax), %r8b
movl %r8d, %r10d
andb $-0x21, %r10b
addb $-0x41, %r10b
leal -0x30(%r8), %r11d
incq %rax
testb %r8b, %r8b
je 0x204d
cmpb $0xa, %r11b
jb 0x204d
cmpb $0x1a, %r10b
jae 0x2025
addq %rax, %rdi
cmpb $0x1a, %r10b
setae %r10b
cmpb $0xa, %r11b
setae %r11b
andb %r10b, %r11b
testl %ecx, %ecx
setle %r10b
orb %r11b, %r10b
jne 0x20ad
movl %ecx, %r9d
xorl %ecx, %ecx
movb %r8b, (%rdx,%rcx)
movb 0x1(%rdi,%rcx), %r8b
incq %rcx
movl %r8d, %r10d
andb $-0x21, %r10b
addb $-0x41, %r10b
cmpb $0x1a, %r10b
setae %r10b
leal -0x30(%r8), %r11d
cmpb $0xa, %r11b
setae %r11b
testb %r10b, %r11b
jne 0x20a8
cmpq %r9, %rcx
jb 0x2073
movl (%rsi), %r9d
jmp 0x20af
xorl %ecx, %ecx
addl %ecx, %eax
addl %r9d, %eax
movl %eax, (%rsi)
movl %ecx, %eax
movb $0x0, (%rdx,%rax)
testl %ecx, %ecx
setne %al
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ivanzamanov[P]kmeans/src/common/utils.cpp
// Function: readFullData(int, char**)
int readFullData(int fd, char** data) {
	const int BUFF_SIZE = 4096 * 1024;
	char* buffer = new char[BUFF_SIZE];
	int bytes = 1;
	bytes = read(fd, buffer, BUFF_SIZE);
	if(bytes >= 0)
		buffer[bytes] = 0;
	*data = buffer;
	return bytes;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
movl $0x400000, %edi         # imm = 0x400000
callq 0x1030
movq %rax, %r14
movl $0x400000, %edx         # imm = 0x400000
movl %ebp, %edi
movq %rax, %rsi
callq 0x10b0
testl %eax, %eax
js 0x20fa
movl %eax, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movb $0x0, (%r14,%rcx)
movq %r14, (%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jpcima[P]faustmd/./thirdparty/gsl-lite.hpp
// Function: gsl::span<char>::subspan(unsigned long, unsigned long) const
span subspan( index_type offset, index_type count ) const gsl_noexcept
    {
        Expects(
            0 <= offset && offset <= this->size() &&
            0 <= count  && count <= this->size() - offset );
        return span( this->data() + offset, count );
    }

// Assembly:
pushq %rax
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
subq %rax, %rcx
subq %rsi, %rcx
jb 0x7a73
cmpq %rdx, %rcx
jb 0x7a73
testq %rdx, %rdx
sete %cl
testq %rax, %rax
setne %dil
orb %cl, %dil
je 0x7a73
addq %rsi, %rax
addq %rax, %rdx
popq %rcx
retq
callq 0x50e0
// File: /workspace/github_cpp_makefile_star2_O3/jpcima[P]faustmd/./thirdparty/gsl-lite.hpp
// Function: std::ostream& gsl::detail::write_to_stream<std::ostream, gsl::basic_string_span<char>>(std::ostream&, gsl::basic_string_span<char> const&)
gsl_api Stream & write_to_stream( Stream & os, Span const & spn )
{
    typename Stream::sentry sentry( os );

    if ( !os )
        return os;

    const std::streamsize length = narrow<std::streamsize>( spn.length() );

    // Whether, and how, to pad
    const bool pad = ( length < os.width() );
    const bool left_pad = pad && ( os.flags() & std::ios_base::adjustfield ) == std::ios_base::right;

    if ( left_pad )
        write_padding( os, os.width() - length );

    // Write span characters
    os.rdbuf()->sputn( spn.begin(), length );

    if ( pad && !left_pad )
        write_padding( os, os.width() - length );

    // Reset output stream width
    os.width(0);

    return os;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x52f0
movq (%rbx), %rax
movq -0x18(%rax), %rcx
testb $0x5, 0x20(%rbx,%rcx)
jne 0x7d85
movq (%r15), %rsi
movq 0x8(%r15), %r14
subq %rsi, %r14
js 0x7d9d
movq 0x10(%rbx,%rcx), %r12
movq %r12, %rax
subq %r14, %rax
jle 0x7d40
movl $0xb0, %edx
andl 0x18(%rbx,%rcx), %edx
cmpl $0x80, %edx
jne 0x7d40
movq %rbx, %rdi
movq %rax, %rsi
callq 0x7db5
movq (%rbx), %rax
movq -0x18(%rax), %rcx
movq (%r15), %rsi
movb $0x1, %bpl
jmp 0x7d42
xorl %ebp, %ebp
movq 0xe8(%rbx,%rcx), %rdi
movq (%rdi), %rax
movq %r14, %rdx
callq *0x60(%rax)
cmpq %r14, %r12
setle %al
orb %bpl, %al
jne 0x7d75
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq 0x10(%rbx,%rax), %rsi
subq %r14, %rsi
movq %rbx, %rdi
callq 0x7db5
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq $0x0, 0x10(%rbx,%rax)
movq %rsp, %rdi
callq 0x5720
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x50e0
movq %rax, %rbx
movq %rsp, %rdi
callq 0x5720
movq %rbx, %rdi
callq 0x56d0
// File: /workspace/github_cpp_makefile_star2_O3/jpcima[P]faustmd/call_faust.cpp
// Function: parse_cstrlit(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, gsl::basic_string_span<char const>)
static bool parse_cstrlit(std::string &dst, const gsl::cstring_span src)
{
    size_t n = src.size();
    if (src.size() < 2 || src[0] != '"' || src[n - 1] != '"')
        return false;

    for (size_t i = 1; i < n - 1; ++i) {
        char c = src[i];
        if (c != '\\')
            dst.push_back(c);
        else {
            if (++i == n - 1)
                return false;
            c = src[i];
            switch (c) {
            case '0': dst.push_back('\0'); break;
            case 'a': dst.push_back('\a'); break;
            case 'b': dst.push_back('\b'); break;
            case 't': dst.push_back('\t'); break;
            case 'n': dst.push_back('\n'); break;
            case 'v': dst.push_back('\v'); break;
            case 'f': dst.push_back('\f'); break;
            case 'r': dst.push_back('\r'); break;
            default: dst.push_back(c); break;
            }
        }
    }

    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
subq %rsi, %r14
cmpq $0x2, %r14
jb 0x9a69
movq %rsi, %r15
cmpb $0x22, (%rsi)
jne 0x9a69
cmpb $0x22, -0x1(%r15,%r14)
jne 0x9a69
movb $0x1, %bl
cmpq $0x2, %r14
je 0x9a6b
movq %rdi, %r12
decq %r14
movl $0x1, %r13d
leaq 0x247f8(%rip), %rbp     # 0x2e1ec
movb (%r15,%r13), %al
cmpb $0x5c, %al
jne 0x9a54
incq %r13
cmpq %r14, %r13
je 0x9a69
movb (%r15,%r13), %al
movzbl %al, %ecx
cmpl $0x65, %ecx
jg 0x9a23
cmpl $0x30, %ecx
je 0x9a39
cmpl $0x61, %ecx
je 0x9a3d
cmpl $0x62, %ecx
jne 0x9a54
movb $0x8, %al
jmp 0x9a54
leal -0x6e(%rcx), %edx
cmpl $0x8, %edx
ja 0x9a41
movslq (%rbp,%rdx,4), %rcx
addq %rbp, %rcx
jmpq *%rcx
movb $0xa, %al
jmp 0x9a54
xorl %eax, %eax
jmp 0x9a54
movb $0x7, %al
jmp 0x9a54
cmpl $0x66, %ecx
jne 0x9a54
movb $0xc, %al
jmp 0x9a54
movb $0xb, %al
jmp 0x9a54
movb $0xd, %al
jmp 0x9a54
movb $0x9, %al
movsbl %al, %esi
movq %r12, %rdi
callq 0x5310
incq %r13
cmpq %r14, %r13
jb 0x99f4
jmp 0x9a6b
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jpcima[P]faustmd/metadata.cpp
// Function: cstrlit[abi:cxx11](gsl::basic_string_span<char const>)
static const std::string cstrlit(gsl::cstring_span text)
{
    std::string lit;
    lit.push_back('u');
    lit.push_back('8');
    lit.push_back('"');

    for (char c : text) {
        switch (c) {
        case '\a': lit.push_back('\\'); lit.push_back('a'); break;
        case '\b': lit.push_back('\\'); lit.push_back('b'); break;
        case '\t': lit.push_back('\\'); lit.push_back('t'); break;
        case '\n': lit.push_back('\\'); lit.push_back('n'); break;
        case '\v': lit.push_back('\\'); lit.push_back('v'); break;
        case '\f': lit.push_back('\\'); lit.push_back('f'); break;
        case '\r': lit.push_back('\\'); lit.push_back('r'); break;
        case '"': case '\\': lit.push_back('\\'); lit.push_back(c); break;
        default: lit.push_back(c); break;
        }
    }

    lit.push_back('"');
    return lit;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x10(%rdi), %r12
movq %r12, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
movl $0x75, %esi
callq 0x5310
movq %rbx, %rdi
movl $0x38, %esi
callq 0x5310
movq %rbx, %rdi
movl $0x22, %esi
callq 0x5310
cmpq %r14, %r15
je 0x19159
leaq 0x16230(%rip), %r13     # 0x2f2c0
movb (%r15), %bpl
movzbl %bpl, %eax
leal -0x7(%rax), %ecx
cmpl $0x6, %ecx
ja 0x190be
movslq (%r13,%rcx,4), %rax
addq %r13, %rax
jmpq *%rax
movb $0x61, %bpl
movq %rbx, %rdi
movl $0x5c, %esi
callq 0x5310
jmp 0x19141
cmpl $0x22, %eax
je 0x190c8
cmpl $0x5c, %eax
jne 0x19141
movq %rbx, %rdi
movl $0x5c, %esi
callq 0x5310
jmp 0x19141
movb $0x76, %bpl
movq %rbx, %rdi
movl $0x5c, %esi
callq 0x5310
jmp 0x19141
movb $0x74, %bpl
movq %rbx, %rdi
movl $0x5c, %esi
callq 0x5310
jmp 0x19141
movb $0x6e, %bpl
movq %rbx, %rdi
movl $0x5c, %esi
callq 0x5310
jmp 0x19141
movb $0x62, %bpl
movq %rbx, %rdi
movl $0x5c, %esi
callq 0x5310
jmp 0x19141
movb $0x66, %bpl
movq %rbx, %rdi
movl $0x5c, %esi
callq 0x5310
jmp 0x19141
movb $0x72, %bpl
movq %rbx, %rdi
movl $0x5c, %esi
callq 0x5310
movsbl %bpl, %esi
movq %rbx, %rdi
callq 0x5310
incq %r15
cmpq %r14, %r15
jne 0x19090
movq %rbx, %rdi
movl $0x22, %esi
callq 0x5310
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x19177
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r12, %rdi
je 0x1918e
movq (%r12), %rsi
incq %rsi
callq 0x5380
movq %r14, %rdi
callq 0x56d0
// File: /workspace/github_cpp_makefile_star2_O3/jpcima[P]faustmd/metadata.cpp
// Function: Metadata::Widget::type_from_name(gsl::basic_string_span<char const>)
Metadata::Widget::Type Metadata::Widget::type_from_name(gsl::cstring_span name)
{
    Metadata::Widget::Type t = (Metadata::Widget::Type)-1;

    if (name == "button")
        t = Type::Button;
    else if (name == "checkbox")
        t = Type::CheckBox;
    else if (name == "vslider")
        t = Type::VSlider;
    else if (name == "hslider")
        t = Type::HSlider;
    else if (name == "nentry")
        t = Type::NEntry;
    else if (name == "vbargraph")
        t = Type::VBarGraph;
    else if (name == "hbargraph")
        t = Type::HBarGraph;

    return t;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
movq %rsi, %rax
subq %rdi, %rax
addq $-0x6, %rax
cmpq $0x3, %rax
ja 0x1a59d
leaq 0x14df9(%rip), %rcx     # 0x2f2dc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %eax, %eax
cmpq %rdi, %rsi
je 0x1a5b6
movl $0x74747562, %ecx       # imm = 0x74747562
xorl (%rdi), %ecx
movzwl 0x4(%rdi), %edx
xorl $0x6e6f, %edx           # imm = 0x6E6F
orl %ecx, %edx
je 0x1a5b6
movl $0x746e656e, %eax       # imm = 0x746E656E
xorl (%rdi), %eax
movzwl 0x4(%rdi), %ecx
xorl $0x7972, %ecx           # imm = 0x7972
orl %eax, %ecx
jne 0x1a59d
movl $0x4, %eax
jmp 0x1a5b6
movl $0x1, %eax
cmpq %rdi, %rsi
je 0x1a5b6
movabsq $0x786f626b63656863, %rcx # imm = 0x786F626B63656863
cmpq %rcx, (%rdi)
jne 0x1a59d
jmp 0x1a5b6
movl $0x5, %eax
cmpq %rdi, %rsi
je 0x1a5b6
movabsq $0x7061726772616276, %rcx # imm = 0x7061726772616276
xorq (%rdi), %rcx
movzbl 0x8(%rdi), %edx
xorq $0x68, %rdx
orq %rcx, %rdx
jne 0x1a59d
jmp 0x1a5b6
movl $0x2, %eax
cmpq %rdi, %rsi
je 0x1a5b6
movl $0x696c7376, %edx       # imm = 0x696C7376
xorl (%rdi), %edx
movl $0x72656469, %ecx       # imm = 0x72656469
movl 0x3(%rdi), %esi
xorl %ecx, %esi
orl %edx, %esi
je 0x1a5b6
movl $0x696c7368, %eax       # imm = 0x696C7368
xorl (%rdi), %eax
xorl 0x3(%rdi), %ecx
orl %eax, %ecx
je 0x1a5bb
leaq 0x1515f(%rip), %rsi     # 0x2f703
leaq 0x8(%rsp), %rdi
callq 0x1a7f2
movzbl %al, %eax
decl %eax
orl $0x6, %eax
addq $0x18, %rsp
retq
movl $0x3, %eax
jmp 0x1a5b6
// File: /workspace/github_cpp_makefile_star2_O3/jpcima[P]faustmd/metadata.cpp
// Function: operator<<(std::ostream&, Metadata::Widget::Type)
std::ostream &operator<<(std::ostream &o, Metadata::Widget::Type t)
{
    switch (t) {
    case Metadata::Widget::Type::Button: return o << "button";
    case Metadata::Widget::Type::CheckBox: return o << "checkbox";
    case Metadata::Widget::Type::VSlider: return o << "vslider";
    case Metadata::Widget::Type::HSlider: return o << "hslider";
    case Metadata::Widget::Type::NEntry: return o << "nentry";
    case Metadata::Widget::Type::VBarGraph: return o << "vbargraph";
    case Metadata::Widget::Type::HBarGraph: return o << "hbargraph";
    }

    assert(false);
    return o;
}

// Assembly:
pushq %rbx
cmpl $0x6, %esi
ja 0x1a687
movq %rdi, %rbx
movl %esi, %eax
leaq 0x14ccc(%rip), %rcx     # 0x2f2ec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x150a2(%rip), %rsi     # 0x2f6d2
jmp 0x1a639
leaq 0x150b9(%rip), %rsi     # 0x2f6f2
movl $0x6, %edx
jmp 0x1a67a
leaq 0x1509b(%rip), %rsi     # 0x2f6e2
jmp 0x1a650
leaq 0x1509a(%rip), %rsi     # 0x2f6ea
movl $0x7, %edx
jmp 0x1a67a
leaq 0x1507b(%rip), %rsi     # 0x2f6d9
movl $0x8, %edx
jmp 0x1a67a
leaq 0x1508d(%rip), %rsi     # 0x2f6f9
jmp 0x1a675
leaq 0x1508e(%rip), %rsi     # 0x2f703
movl $0x9, %edx
movq %rbx, %rdi
callq 0x53f0
movq %rbx, %rax
popq %rbx
retq
leaq 0x15087(%rip), %rdi     # 0x2f715
leaq 0x15086(%rip), %rsi     # 0x2f71b
leaq 0x1508c(%rip), %rcx     # 0x2f728
movl $0x1b8, %edx            # imm = 0x1B8
callq 0x5260
// File: /workspace/github_cpp_makefile_star2_O3/jpcima[P]faustmd/metadata.cpp
// Function: operator<<(std::ostream&, Metadata::Widget::Scale)
std::ostream &operator<<(std::ostream &o, Metadata::Widget::Scale s)
{
    switch (s) {
    case Metadata::Widget::Scale::Linear: return o << "linear";
    case Metadata::Widget::Scale::Log: return o << "log";
    case Metadata::Widget::Scale::Exp: return o << "exp";
    }

    assert(false);
    return o;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $0x2, %esi
je 0x1a6cf
cmpl $0x1, %esi
je 0x1a6c6
testl %esi, %esi
jne 0x1a6e8
leaq 0x150aa(%rip), %rsi     # 0x2f769
movl $0x6, %edx
jmp 0x1a6db
leaq 0x15040(%rip), %rsi     # 0x2f70d
jmp 0x1a6d6
leaq 0x1503b(%rip), %rsi     # 0x2f711
movl $0x3, %edx
movq %rbx, %rdi
callq 0x53f0
movq %rbx, %rax
popq %rbx
retq
leaq 0x15026(%rip), %rdi     # 0x2f715
leaq 0x15025(%rip), %rsi     # 0x2f71b
leaq 0x15073(%rip), %rcx     # 0x2f770
movl $0x1c4, %edx            # imm = 0x1C4
callq 0x5260
// File: /workspace/github_cpp_makefile_star2_O3/jpcima[P]faustmd/metadata.cpp
// Function: mangle[abi:cxx11](gsl::basic_string_span<char const>)
static const std::string mangle(gsl::cstring_span name)
{
    std::string id;
    size_t n = name.size();
    id.reserve(n);

    for (size_t i = 0; i < n; ++i) {
        char c = name[i];
        bool al = (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
        bool num = c >= '0' && c <= '9';
        c = (!al && (!num || i == 0)) ? '_' : c;
        id.push_back(c);
    }

    return id;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %r13
movq %r13, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
movq %rdx, %r15
subq %rsi, %r15
movq %r15, %rsi
callq 0x55f0
cmpq %r14, %r12
je 0x1a785
cmpq $0x1, %r15
adcq $0x0, %r15
xorl %r12d, %r12d
movb (%r14,%r12), %al
movl %eax, %ecx
andb $-0x21, %cl
addb $-0x41, %cl
cmpb $0x1a, %cl
jb 0x1a770
leal -0x3a(%rax), %ecx
cmpb $-0xa, %cl
setb %cl
testq %r12, %r12
sete %dl
orb %cl, %dl
movb $0x5f, %cl
jne 0x1a772
movl %eax, %ecx
movsbl %cl, %esi
movq %rbx, %rdi
callq 0x5310
incq %r12
cmpq %r12, %r15
jne 0x1a74a
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x1a791
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r13, %rdi
je 0x1a7a8
movq (%r13), %rsi
incq %rsi
callq 0x5380
movq %r14, %rdi
callq 0x56d0
// File: /workspace/github_cpp_makefile_star2_O3/lns[P]team-tactic-topic-model/./lda.cpp
// Function: LDA<unsigned int, unsigned int, unsigned char>::read_data(char const*)
void read_data(const char * filename)
	{
		FILE * f = fopen(filename,"r");
		if(!f)
			printf("Cannot open %s for reading.\n",filename);
		uint32_t d;
		word_t w;
		player_t p;
		float x,y;
		while(true) {
			if(5>fscanf(f,"%u %u %u %f %f\n",&d,&w,&p,&x,&y))
				return;
			n_word = n_word>w?n_word:(w+1);
			n_player = n_player>p?n_player:(p+1);
			while(dat.size()<=d)
				dat.push_back(vector<Token>());
			dat[d].push_back({w,p,0,x,y});
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x28cb(%rip), %rsi      # 0x4274
movq %r15, %rdi
callq 0x1110
movq %rax, %r14
testq %rax, %rax
jne 0x19ca
leaq 0x273d(%rip), %rdi      # 0x40fd
movq %r15, %rsi
xorl %eax, %eax
callq 0x1040
leaq 0x18(%rsp), %rax
movq %rax, (%rsp)
leaq 0x2740(%rip), %rsi      # 0x411a
leaq 0x14(%rsp), %rdx
leaq 0x10(%rsp), %rcx
leaq 0xc(%rsp), %r8
leaq 0x1c(%rsp), %r9
movq %r14, %rdi
xorl %eax, %eax
callq 0x11b0
cmpl $0x5, %eax
jl 0x1b3a
leaq 0x58(%rbx), %r15
movabsq $-0x5555555555555555, %rbp # imm = 0xAAAAAAAAAAAAAAAB
leaq 0x20(%rsp), %r12
leaq 0x1c(%rsp), %r13
movl 0x10(%rsp), %eax
leal 0x1(%rax), %ecx
movl 0x4(%rbx), %edx
cmpl %eax, %edx
cmoval %edx, %ecx
movl 0x8(%rbx), %esi
movl %ecx, 0x4(%rbx)
movl 0xc(%rsp), %edx
leal 0x1(%rdx), %ecx
cmpl %edx, %esi
cmoval %esi, %ecx
movl %ecx, 0x8(%rbx)
movq 0x60(%rbx), %rdi
movq 0x58(%rbx), %rcx
subq %rcx, %rdi
sarq $0x3, %rdi
imulq %rbp, %rdi
movl 0x14(%rsp), %esi
cmpq %rsi, %rdi
ja 0x1ab0
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x2462
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1a8c
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x10f0
movq 0x58(%rbx), %rcx
movq 0x60(%rbx), %rax
subq %rcx, %rax
sarq $0x3, %rax
imulq %rbp, %rax
movl 0x14(%rsp), %esi
cmpq %rsi, %rax
jbe 0x1a59
movl 0x10(%rsp), %eax
movl 0xc(%rsp), %edx
leaq (%rsi,%rsi,2), %rsi
leaq (%rcx,%rsi,8), %rdi
movl %eax, 0x20(%rsp)
movl %edx, 0x24(%rsp)
movb $0x0, 0x28(%rsp)
movss 0x1c(%rsp), %xmm0
movss %xmm0, 0x2c(%rsp)
movss 0x18(%rsp), %xmm0
movss %xmm0, 0x30(%rsp)
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x1afd
movl 0x30(%rsp), %eax
movl %eax, 0x10(%rsi)
movups 0x20(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x14, 0x8(%rdi)
jmp 0x1b05
movq %r12, %rdx
callq 0x2662
leaq 0x18(%rsp), %rax
movq %rax, (%rsp)
movq %r14, %rdi
leaq 0x2602(%rip), %rsi      # 0x411a
leaq 0x14(%rsp), %rdx
leaq 0x10(%rsp), %rcx
leaq 0xc(%rsp), %r8
movq %r13, %r9
xorl %eax, %eax
callq 0x11b0
cmpl $0x5, %eax
jge 0x1a19
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1b63
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x10f0
movq %rbx, %rdi
callq 0x1180
nop
// File: /workspace/github_cpp_makefile_star2_O3/lns[P]team-tactic-topic-model/./lda.cpp
// Function: LDA<unsigned int, unsigned int, unsigned char>::set_K(unsigned char)
void set_K(topic_t K)
	{
		topic.clear();
		topic.resize(K);
		theta.clear();
		for(topic_t k=0;k<K;k++) {
			theta.push_back(vector<uint32_t>());
			theta[k].resize(dat.size());
			topic[k].make(n_word,n_player);
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x70(%rdi), %r15
movq 0x70(%rdi), %r12
movq 0x78(%rdi), %r13
cmpq %r12, %r13
je 0x1ba8
movq %r12, %r14
movq %r14, %rdi
callq 0x23e8
addq $0x40, %r14
cmpq %r13, %r14
jne 0x1b93
movq %r12, 0x78(%rbx)
movzbl %bpl, %r14d
movq %r15, %rdi
movq %r14, %rsi
callq 0x27d8
leaq 0x88(%rbx), %r15
movq 0x88(%rbx), %rsi
movq %r15, %rdi
callq 0x2b38
testb %r14b, %r14b
je 0x1c60
xorl %r13d, %r13d
movq %rsp, %r12
movabsq $-0x5555555555555555, %rbp # imm = 0xAAAAAAAAAAAAAAAB
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x2b82
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1c17
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x10f0
leaq (,%r13,2), %rdi
addq %r13, %rdi
shlq $0x3, %rdi
addq 0x88(%rbx), %rdi
movq 0x60(%rbx), %rsi
subq 0x58(%rbx), %rsi
sarq $0x3, %rsi
imulq %rbp, %rsi
callq 0x2844
movq %r13, %rdi
shlq $0x6, %rdi
addq 0x70(%rbx), %rdi
movl 0x4(%rbx), %esi
movl 0x8(%rbx), %edx
callq 0x2876
incq %r13
cmpq %r14, %r13
jne 0x1be6
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1c88
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x10f0
movq %rbx, %rdi
callq 0x1180
// File: /workspace/github_cpp_makefile_star2_O3/lns[P]team-tactic-topic-model/./lda.cpp
// Function: LDA<unsigned int, unsigned int, unsigned char>::config(Prior const&, unsigned int)
void config(const Prior& p, uint32_t buffer_size)
	{
		prior = p;
		pct_log_a.make(buffer_size,log,prior.alpha);
		pct_log_b.make(buffer_size,log,prior.beta);
		pct_log_Nb.make(buffer_size,log,n_word*prior.beta);
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rdi, %r14
addq $0x10, %rdi
movl $0x9, %ecx
rep  movsq (%rsi), %es:(%rdi)
leaq 0xa0(%r14), %rdi
movsd 0x10(%r14), %xmm0
movq 0x5326(%rip), %r15      # 0x6fe0
movl %edx, %esi
movq %r15, %rdx
callq 0x2ef0
leaq 0xc0(%r14), %rdi
movsd 0x18(%r14), %xmm0
movl %ebx, %esi
movq %r15, %rdx
callq 0x2ef0
leaq 0xe0(%r14), %rdi
movl 0x4(%r14), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x18(%r14), %xmm0
movl %ebx, %esi
movq %r15, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x2ef0
nop
// File: /workspace/github_cpp_makefile_star2_O3/lns[P]team-tactic-topic-model/./lda.cpp
// Function: LDA<unsigned int, unsigned int, unsigned char>::gibbs(bool)
void gibbs(bool first_run=false)
	{
		static vector<uint32_t> x;
		if(x.size()!=dat.size()) {
			x.clear();
			for(uint32_t d=0;d<dat.size();d++)
				x.push_back(d);
		}
		shuffle(&(x[0]),dat.size());
		for(uint32_t d=0;d<dat.size();d++)
			for(uint32_t i=0;i<dat[x[d]].size();i++)
				reassign(x[d],i,first_run);
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movb 0x5406(%rip), %al       # 0x7120
testb %al, %al
je 0x1e9e
movq 0x53e7(%rip), %rsi      # 0x7110
movq 0x53d8(%rip), %rdi      # 0x7108
movq %rsi, %r8
subq %rdi, %r8
sarq $0x2, %r8
movq 0x58(%rbx), %rcx
movq 0x60(%rbx), %rdx
movq %rdx, %rax
subq %rcx, %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %r12 # imm = 0xAAAAAAAAAAAAAAAB
imulq %r12, %rax
cmpq %rax, %r8
je 0x1df6
cmpq %rdi, %rsi
je 0x1d72
movq %rdi, 0x53a1(%rip)      # 0x7110
movq %rdi, %rsi
movl $0x0, 0x4(%rsp)
xorl %r8d, %r8d
cmpq %rcx, %rdx
je 0x1df4
movq 0x538f(%rip), %rdi      # 0x7118
leaq 0x5378(%rip), %r14      # 0x7108
leaq 0x4(%rsp), %r15
cmpq %rdi, %rsi
je 0x1daa
movl %r8d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x5368(%rip)      # 0x7110
jmp 0x1dcb
movq %r14, %rdi
movq %r15, %rdx
callq 0x38bc
movq 0x5354(%rip), %rsi      # 0x7110
movq 0x5355(%rip), %rdi      # 0x7118
movq 0x58(%rbx), %rcx
movq 0x60(%rbx), %rdx
movl 0x4(%rsp), %r8d
incl %r8d
movl %r8d, 0x4(%rsp)
movq %rdx, %rax
subq %rcx, %rax
sarq $0x3, %rax
imulq %r12, %rax
cmpq %r8, %rax
ja 0x1d95
movq 0x5316(%rip), %rdi      # 0x7108
jmp 0x1df6
xorl %eax, %eax
movl %eax, %esi
callq 0x3018
movq 0x58(%rbx), %rax
movq 0x60(%rbx), %rdx
cmpq %rax, %rdx
je 0x1e8f
xorl %r15d, %r15d
movq 0x52f0(%rip), %rcx      # 0x7108
movzbl %bpl, %ebp
movabsq $-0x3333333333333333, %r13 # imm = 0xCCCCCCCCCCCCCCCD
movl (%rcx,%r15,4), %esi
leaq (%rsi,%rsi,2), %rdi
movq 0x8(%rax,%rdi,8), %r8
cmpq (%rax,%rdi,8), %r8
je 0x1e79
xorl %r14d, %r14d
movq %rbx, %rdi
movl %r14d, %edx
movl %ebp, %ecx
callq 0x3072
movq 0x52b8(%rip), %rcx      # 0x7108
movl (%rcx,%r15,4), %esi
movq 0x58(%rbx), %rax
leaq (%rsi,%rsi,2), %rdx
movq 0x8(%rax,%rdx,8), %rdi
subq (%rax,%rdx,8), %rdi
incl %r14d
sarq $0x2, %rdi
imulq %r13, %rdi
cmpq %r14, %rdi
ja 0x1e3c
movq 0x60(%rbx), %rdx
incl %r15d
movq %rdx, %rsi
subq %rax, %rsi
sarq $0x3, %rsi
imulq %r12, %rsi
cmpq %r15, %rsi
ja 0x1e26
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x11d0
jmp 0x1d22
// File: /workspace/github_cpp_makefile_star2_O3/lns[P]team-tactic-topic-model/./lda.cpp
// Function: Topic::destroy()
void destroy()
	{
		delete[] c;
		delete[] n;
		delete[] x;
		delete[] y;
		delete[] xx;
		delete[] xy;
		delete[] yy;
		memset(this,0,sizeof(*this));
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x23fa
callq 0x1130
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x2408
callq 0x1130
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x2416
callq 0x1130
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x2424
callq 0x1130
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x2432
callq 0x1130
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x2440
callq 0x1130
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x244e
callq 0x1130
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/lns[P]team-tactic-topic-model/./pct.cpp
// Function: PCT::make(unsigned int, double (*)(double), double)
void make(uint32_t _len, double (*_func)(double), double _delta)
	{
		len = _len;
		func = _func;
		delta = _delta;
		destroy();
		x = new double[len];
		for(uint32_t i=0;i<len;i++)
			x[i] = i + delta;
		for(uint32_t i=0;i<len;i++)
			x[i] = func(x[i]);
	}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movl %esi, (%rdi)
movq %rdx, 0x8(%rdi)
movsd %xmm0, 0x10(%rdi)
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x2f1c
callq 0x1130
movq $0x0, 0x18(%rbx)
movl (%rbx), %ebp
movl %ebp, %r14d
leaq (,%r14,8), %rdi
callq 0x1030
movq %rax, 0x18(%rbx)
testl %ebp, %ebp
je 0x3013
movsd 0x10(%rbx), %xmm0
leaq 0x1(%r14), %rcx
andq $-0x2, %rcx
leaq -0x1(%r14), %rdx
movq %rdx, %xmm1
pshufd $0x44, %xmm1, %xmm1     # xmm1 = xmm1[0,1,0,1]
movdqa 0x10d5(%rip), %xmm2     # 0x4030
xorl %edx, %edx
movdqa 0x10db(%rip), %xmm3     # 0x4040
pxor %xmm3, %xmm1
pcmpeqd %xmm4, %xmm4
movdqa 0x10db(%rip), %xmm5     # 0x4050
movdqa %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm1, %xmm7
pcmpeqd %xmm1, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %esi
notl %esi
testb $0x1, %sil
je 0x2fbd
movl %edx, %esi
xorps %xmm7, %xmm7
cvtsi2sd %rsi, %xmm7
addsd %xmm0, %xmm7
movsd %xmm7, (%rax,%rdx,8)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %esi
testb $0x1, %sil
je 0x2fe1
leal 0x1(%rdx), %esi
xorps %xmm6, %xmm6
cvtsi2sd %rsi, %xmm6
addsd %xmm0, %xmm6
movsd %xmm6, 0x8(%rax,%rdx,8)
addq $0x2, %rdx
paddq %xmm5, %xmm2
cmpq %rdx, %rcx
jne 0x2f75
testq %r14, %r14
je 0x3013
xorl %r14d, %r14d
movsd (%rax,%r14,8), %xmm0
callq *0x8(%rbx)
movq 0x18(%rbx), %rax
movsd %xmm0, (%rax,%r14,8)
incq %r14
movl (%rbx), %ecx
cmpq %rcx, %r14
jb 0x2ff6
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lns[P]team-tactic-topic-model/./rng.cpp
// Function: void shuffle<unsigned int>(unsigned int*, unsigned int)
void shuffle(T* x, uint32_t len)
{
	for(uint32_t i=0;i<len-1;i++)
	{
		uint32_t j = i+lcg64()%(len-1-i);
		// swap x[i] & x[j]
		T t = x[i];
		x[i] = x[j];
		x[j] = t;
	}
}

// Assembly:
decl %esi
je 0x3070
movq 0x40dd(%rip), %rcx      # 0x7100
movl %esi, %esi
movl $0x1, %r8d
xorl %r9d, %r9d
movabsq $-0x42e60443a3f800b, %r10 # imm = 0xFBD19FBBC5C07FF5
imulq %r10, %rcx
incq %rcx
movl %esi, %r11d
movq %rcx, %rax
xorl %edx, %edx
divq %r11
addl %r9d, %edx
movl -0x4(%rdi,%r8,4), %eax
movl (%rdi,%rdx,4), %r11d
movl %r11d, -0x4(%rdi,%r8,4)
movl %eax, (%rdi,%rdx,4)
incq %r9
incq %r8
decq %rsi
jne 0x3038
movq %rcx, 0x4090(%rip)      # 0x7100
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/wenzhelu[P]RUDP/Listener.cpp
// Function: Listener::getTimeout(int)
void Listener::getTimeout(int ack)
{
    tp end=std::chrono::system_clock::now();
    tp start;
    if(master->startTimes.find(ack)==master->startTimes.end()) {
        return;
    }
    else
    {
        start=master->startTimes.at(ack);
        master->startTimes.erase(master->startTimes.begin(),++master->startTimes.find(ack));
    }
    
    
    this->sRTT=ms((end - start).count()/1000000);
    int u,phi,delta;
    u=1;
    phi=4;
    delta=2;
    this->eRTT=this->eRTT+std::chrono::milliseconds((this->sRTT.count()-this->eRTT.count())/delta);
    this->deviation=this->deviation+std::chrono::milliseconds(abs(this->sRTT.count()-this->eRTT.count())/delta-this->deviation.count());
    master->TimeOut=u*this->eRTT.count()+phi*this->deviation.count();
    master->RTT=this->eRTT.count();
//    debug_print("Timeout: %u, RTT: %u, sRTT: %u, all in ms\n", master->TimeOut, master->RTT, sRTT.count());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %r15d
movq %rdi, %rbx
callq 0x2060
movq %rax, %r14
movq 0x20(%rbx), %rax
movq 0x30(%rax), %rcx
testq %rcx, %rcx
je 0x295b
leaq 0x20(%rax), %rdi
addq $0x28, %rax
movq %rax, %rdx
xorl %esi, %esi
cmpl %r15d, 0x20(%rcx)
setb %sil
cmovaeq %rcx, %rdx
movq 0x10(%rcx,%rsi,8), %rcx
testq %rcx, %rcx
jne 0x2865
cmpq %rax, %rdx
je 0x295b
cmpl %r15d, 0x20(%rdx)
ja 0x295b
leaq -0x34(%rbp), %rsi
movl %r15d, (%rsi)
callq 0x2aa4
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq 0x20(%rbx), %rdi
leaq 0x20(%rdi), %r12
movq 0x30(%rdi), %rax
movq 0x38(%rdi), %r13
addq $0x28, %rdi
testq %rax, %rax
je 0x28e3
movq %rdi, %rcx
xorl %edx, %edx
cmpl %r15d, 0x20(%rax)
setb %dl
cmovaeq %rax, %rcx
movq 0x10(%rax,%rdx,8), %rax
testq %rax, %rax
jne 0x28bf
cmpq %rdi, %rcx
je 0x28e3
cmpl %r15d, 0x20(%rcx)
cmovbeq %rcx, %rdi
callq 0x2160
movq %r12, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x2b8c
subq -0x30(%rbp), %r14
movabsq $0x431bde82d7b634db, %rcx # imm = 0x431BDE82D7B634DB
movq %r14, %rax
imulq %rcx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x12, %rdx
addq %rax, %rdx
movq %rdx, 0x10(%rbx)
movq 0x8(%rbx), %rax
movq 0x20(%rbx), %rcx
movq %rdx, %rsi
subq %rax, %rsi
movq %rsi, %rdi
shrq $0x3f, %rdi
addq %rsi, %rdi
sarq %rdi
addq %rax, %rdi
movq %rdi, 0x8(%rbx)
subq %rdi, %rdx
movq %rdx, %rax
negq %rax
cmovsq %rdx, %rax
shrq %rax
movq %rax, 0x18(%rbx)
leal (%rdi,%rax,4), %eax
movl %eax, 0x18(%rcx)
movl %edi, 0x14(%rcx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/wenzhelu[P]RUDP/Listener.cpp
// Function: Listener::update(unsigned int)
void Listener::update(unsigned int ack)
{
    if(master->status==statusEnum::SLOW_START)
    {
        //        master->slowStartNum++;
        if(ack==master->sendBase)
        {
            this->duplicateACK+=1;
            if(this->duplicateACK==3)
                this->fastRecovery();
        }
        else
        {
            this->index(ack);
            if(master->cWnd>=master->throughput)
                master->status=statusEnum::CONG_AVOID;
        }
    }
    else if(master->status==statusEnum::FAST_REC)
    {
        if(ack==master->sendBase)
            ;
        else
        {
            
            master->status=statusEnum::CONG_AVOID;
            this->linear(ack);
        }
        
    }
    else
    {
        //        master->congestNum++;
        if(ack==master->sendBase)
        {
            this->duplicateACK+=1;
            if(this->duplicateACK==3)
                this->fastRecovery();
        }
        else
        {
            this->linear(ack);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x20(%rdi), %rcx
movl (%rcx), %eax
movl 0xc(%rcx), %edx
cmpl $0x1, %edx
je 0x29ab
testl %edx, %edx
jne 0x29ba
movl %esi, %edx
subl %eax, %edx
je 0x29c0
addl 0x10(%rcx), %edx
movl 0x4(%rcx), %eax
cmpl %eax, %edx
cmovael %eax, %edx
movl %edx, 0x10(%rcx)
movl %esi, (%rcx)
movq 0x20(%rdi), %rax
movl 0x10(%rax), %ecx
cmpl 0x8(%rax), %ecx
jb 0x2a1c
movl $0x2, 0xc(%rax)
jmp 0x2a1c
movl %esi, %edx
subl %eax, %edx
je 0x2a1c
movl $0x2, 0xc(%rcx)
jmp 0x29f0
movl %esi, %edx
subl %eax, %edx
jne 0x29f0
movl (%rdi), %eax
incl %eax
movl %eax, (%rdi)
cmpl $0x3, %eax
jne 0x2a1c
movl $0x0, (%rdi)
movl 0x10(%rcx), %eax
shrl %eax
movl %eax, 0x8(%rcx)
movl %eax, 0x10(%rcx)
movl $0x1, 0xc(%rcx)
movq 0x610(%rcx), %rax
movb $0x1, 0x39(%rax)
jmp 0x2a1c
addl 0x4(%rdi), %edx
imull $0x5b4, %edx, %eax      # imm = 0x5B4
movl 0x4(%rcx), %r8d
movl 0x10(%rcx), %r9d
xorl %edx, %edx
divl %r9d
addl %r9d, %eax
cmpl %r8d, %eax
cmovael %r8d, %eax
movl %eax, 0x10(%rcx)
movl $0x0, 0x4(%rdi)
movl %esi, (%rcx)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/wenzhelu[P]RUDP/RUDP.cpp
// Function: RUDP::init(unsigned int, char const*, char const*, char const*)
void RUDP::init(uint window, const char *port, const char *remoteIp, const char *remotePort) {
    srand(time(nullptr));   // set random seed
    memset(buff, 0, PACKET_SIZE + HEADER_LEN);
    this->sendBase = 0;
    // make the sequence number in the buffer the same with send base
    *(uint *)(this->buff) = this->sendBase;
    this->winSize = window;
    this->status = SLOW_START;
    this->cWnd = PACKET_SIZE;
    this->close = false;
    this->RTT = 500;
    this->TimeOut = 3000;
    this->throughput = 100000000;
    this->congestNum = 0;
    this->slowStartNum = 0;
    
    this->sock = new Usock();
    this->sock->init(port, remoteIp, remotePort);
    this->sender = new Sender(this);
    this->listener = new Listener(this);
    
    th_sender = new thread(&Sender::sending, sender);
    th_listener = new thread(&Listener::recAns, listener);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movl %esi, %r13d
movq %rdi, %rbx
xorl %edi, %edi
callq 0x21e0
movl %eax, %edi
callq 0x2200
leaq 0x50(%rbx), %rdi
movl $0x0, (%rbx)
movl $0x5c0, %edx            # imm = 0x5C0
xorl %esi, %esi
callq 0x2120
movl %r13d, 0x4(%rbx)
movl $0x5b4, 0x10(%rbx)      # imm = 0x5B4
movb $0x0, 0x620(%rbx)
movabsq $0xbb8000001f4, %rax    # imm = 0xBB8000001F4
movq %rax, 0x14(%rbx)
movq $0x5f5e100, 0x8(%rbx)   # imm = 0x5F5E100
movq $0x0, 0x640(%rbx)
movl $0x24, %edi
callq 0x2220
movq %rax, %r13
movq %rax, %rdi
callq 0x3940
movq %r13, 0x628(%rbx)
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x3946
movl $0x68, %edi
callq 0x2220
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3054
leaq 0x610(%rbx), %r15
movq %r14, 0x610(%rbx)
movl $0x30, %edi
callq 0x2220
movl $0x0, 0x28(%rax)
xorl %r12d, %r12d
movq %r12, (%rax)
movq %rbx, 0x20(%rax)
movq %rax, 0x618(%rbx)
movl $0x8, %edi
callq 0x2220
movq %rax, %r14
leaq 0x6a6(%rip), %rax       # 0x3458
leaq -0x38(%rbp), %rsi
movq %rax, (%rsi)
movq %r12, 0x8(%rsi)
movq %r14, %rdi
movq %r15, %rdx
callq 0x2ece
leaq 0x618(%rbx), %r15
movq %r14, 0x638(%rbx)
movl $0x8, %edi
callq 0x2220
movq %rax, %r14
leaq -0x822(%rip), %rax      # 0x25c8
leaq -0x38(%rbp), %rsi
movq %rax, (%rsi)
movq $0x0, 0x8(%rsi)
movq %r14, %rdi
movq %r15, %rdx
callq 0x2f50
movq %r14, 0x630(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2e1e
jmp 0x2e1e
movq %rax, %rbx
movq %r14, %rdi
jmp 0x2e2c
movq %rax, %rbx
movq %r13, %rdi
callq 0x21f0
movq %rbx, %rdi
callq 0x2350
nop
// File: /workspace/github_cpp_makefile_star2_O3/wenzhelu[P]RUDP/RUDP.cpp
// Function: RUDP::cleanUp()
void RUDP::cleanUp() {
    // release resources like socket and heap memory
    sock->closeSock();
    delete th_listener;
    delete th_sender;
    delete sender;
    delete listener;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x628(%rdi), %rdi
callq 0x3a34
movq 0x630(%rbx), %rdi
testq %rdi, %rdi
je 0x2e8f
cmpq $0x0, (%rdi)
jne 0x2ec9
callq 0x21f0
movq 0x638(%rbx), %rdi
testq %rdi, %rdi
je 0x2ea6
cmpq $0x0, (%rdi)
jne 0x2ec9
callq 0x21f0
movq 0x610(%rbx), %rdi
callq 0x21f0
movq 0x618(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x21f0
callq 0x20e0
// File: /workspace/github_cpp_makefile_star2_O3/wenzhelu[P]RUDP/sender.cpp
// Function: Sender::beginTask()
void Sender::beginTask() {
    diff = master->sendBase;
    curPtr = master->sendBase;
    timerBase = master->sendBase;
    sendTime = system_clock::now();
    th_timer = new thread(&Sender::timing, this);
    pending = true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movq 0x48(%rdi), %rax
movl (%rax), %eax
movl %eax, 0x40(%rdi)
movl %eax, 0x3c(%rdi)
movl %eax, 0x58(%rdi)
callq 0x2060
movq %rax, 0x60(%rbx)
movl $0x8, %edi
callq 0x2220
movq %rax, %r14
leaq 0x42(%rip), %rax        # 0x3126
leaq -0x28(%rbp), %rsi
movq %rax, (%rsi)
movq $0x0, 0x8(%rsi)
leaq -0x18(%rbp), %rdx
movq %rbx, (%rdx)
movq %r14, %rdi
callq 0x3654
movq %r14, 0x50(%rbx)
movb $0x1, 0x38(%rbx)
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x21f0
movq %rbx, %rdi
callq 0x2350
// File: /workspace/github_cpp_makefile_star2_O3/wenzhelu[P]RUDP/sender.cpp
// Function: Sender::timing()
void Sender::timing() {
    // timer loop in this function
    while (pending) {
        tp cur = system_clock::now();
        if (getDurMs(sendTime, cur) >= master->TimeOut) {
            // time to check sendBase
            // aggressive mode:
            // set up a begin send time before sending the file
            // then every send time later on is set by timer.
            // we continuously check timerBase and sendBase every RTT
            // if sendBase larger than sendBase, we have a time out.
            // Why called aggressive mode? we make timer very active and
            // not rely on "send" behavior to avoid stuck in sending.
//            debug_print("timerBase: %u, sendBase: %u\n", timerBase, master->sendBase);
            if (timerBase >= master->sendBase) {
                // data loss timeout!
                master->status = SLOW_START;
                master->throughput = master->cWnd >> 1;
                master->cWnd = RUDP::PACKET_SIZE;
//                debug_print("Timeout! Send base: %u, cWnd: %u, throughput: %u\n", master->sendBase, master->cWnd, master->throughput);
                resend = true;
            } else {
                timerBase = master->sendBase;
                sendTime = cur;
            }
        }
        this_thread::sleep_for(milliseconds(master->TimeOut)); // experimental sleep time
    }
}

// Assembly:
cmpb $0x1, 0x38(%rdi)
jne 0x31fe
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movabsq $0x431bde82d7b634db, %r15 # imm = 0x431BDE82D7B634DB
leaq -0x30(%rbp), %r14
movabsq $0x5b400000000, %r12    # imm = 0x5B400000000
callq 0x2060
movq %rax, %rcx
subq 0x60(%rbx), %rax
imulq %r15
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0x12, %rdx
addl %eax, %edx
movq 0x48(%rbx), %rsi
movl 0x18(%rsi), %eax
cmpl %edx, %eax
ja 0x31a8
movl (%rsi), %edx
cmpl %edx, 0x58(%rbx)
jae 0x3194
movl %edx, 0x58(%rbx)
movq %rcx, 0x60(%rbx)
movl 0x18(%rsi), %eax
jmp 0x31a4
movl 0x10(%rsi), %ecx
movq %r12, 0xc(%rsi)
shrl %ecx
movl %ecx, 0x8(%rsi)
movb $0x1, 0x39(%rbx)
testl %eax, %eax
je 0x31e8
movl %eax, %eax
imulq $0x10624dd3, %rax, %rcx # imm = 0x10624DD3
shrq $0x26, %rcx
imulq $-0x3e8, %rcx, %rdx     # imm = 0xFC18
addq %rax, %rdx
imulq $0xf4240, %rdx, %rax    # imm = 0xF4240
movq %rcx, -0x30(%rbp)
movq %rax, -0x28(%rbp)
movq %r14, %rdi
movq %r14, %rsi
callq 0x20f0
cmpl $-0x1, %eax
jne 0x31e8
callq 0x2050
cmpl $0x4, (%rax)
je 0x31ce
cmpb $0x0, 0x38(%rbx)
jne 0x315a
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/wenzhelu[P]RUDP/sender.cpp
// Function: Sender::endTask()
void Sender::endTask() {
    // all buffer received
    // no data pending to send
    // unlock busy
    pending = false;
    delete [] userBuff;
    userBuff = nullptr;
    userDataLen = 0;
    diff = 0;
    master->startTimes.clear();
    th_timer->join();   // must wait for thread ends before deleting
    delete th_timer;
    // sending finish signal
    master->setDataBit(0);
    master->setFinBit(1);
    master->sock->write(master->buff, RUDP::PACKET_SIZE);
    master->setFinBit(0);
    busy.unlock();
    debug_print("send one file end\n", nullptr);
    debug_print("RTT: %u\n, slow start packets: %u, congestion avoidance packets: %u\n", master->RTT, master->slowStartNum, master->congestNum);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb $0x0, 0x38(%rdi)
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x321a
callq 0x2290
movq $0x0, (%rbx)
xorl %eax, %eax
movl %eax, 0x8(%rbx)
movl %eax, 0x40(%rbx)
movq 0x48(%rbx), %rdi
addq $0x20, %rdi
callq 0x2c0e
movq 0x50(%rbx), %rdi
callq 0x2340
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x324e
cmpq $0x0, (%rdi)
jne 0x32a2
callq 0x21f0
movq 0x48(%rbx), %rdi
xorl %esi, %esi
callq 0x2c48
movq 0x48(%rbx), %rdi
movl $0x1, %esi
callq 0x2c74
movq 0x48(%rbx), %rsi
movq 0x628(%rsi), %rdi
addq $0x50, %rsi
movl $0x5b4, %edx            # imm = 0x5B4
callq 0x3a1a
movq 0x48(%rbx), %rdi
xorl %esi, %esi
callq 0x2c74
addq $0x10, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2180
callq 0x20e0
nop
// File: /workspace/github_cpp_makefile_star2_O3/wenzhelu[P]RUDP/sender.cpp
// Function: Sender::send(char const*)
void Sender::send(const char *file) {
    busy.lock();
    std::fstream fs(file);
    struct stat st;
    stat(file, &st);
    userBuff = new char[st.st_size];
    size_t pt = 0;

    while (fs.good()) {
        fs.read(userBuff + pt, 4096);
        pt += fs.gcount();
    }

    if (!fs.eof())
        std::cout << "read file error" << std::endl;

    userDataLen = st.st_size;
    fs.close();
    
    // after data copying
    beginTask();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x2a0, %rsp            # imm = 0x2A0
movq %rsi, %r14
movq %rdi, %rbx
addq $0x10, %rdi
callq 0x22f0
testl %eax, %eax
jne 0x33df
leaq -0x230(%rbp), %rdi
movq %r14, %rsi
movl $0x18, %edx
callq 0x22b0
leaq -0x2c0(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x21c0
movq 0x30(%r15), %r15
testq %r15, %r15
movq $-0x1, %rdi
cmovnsq %r15, %rdi
callq 0x2030
movq %rax, (%rbx)
movq -0x230(%rbp), %rax
movq -0x18(%rax), %rax
movl -0x210(%rbp,%rax), %eax
testl %eax, %eax
jne 0x3361
xorl %r12d, %r12d
leaq -0x230(%rbp), %r14
movq (%rbx), %rsi
addq %r12, %rsi
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rdi
callq 0x2280
addq -0x228(%rbp), %r12
movq -0x230(%rbp), %rax
movq -0x18(%rax), %rax
movl -0x210(%rbp,%rax), %eax
testl %eax, %eax
je 0x3331
testb $0x2, %al
jne 0x33ab
movq 0x2c6c(%rip), %r14      # 0x5fd8
leaq 0xd87(%rip), %rsi       # 0x40fa
movl $0xf, %edx
movq %r14, %rdi
callq 0x2250
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq 0x2c3a(%rip), %rdi      # 0x5fd8
callq 0x2040
movq %rax, %rdi
callq 0x2150
movl %r15d, 0x8(%rbx)
leaq -0x230(%rbp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x30aa
leaq -0x230(%rbp), %rdi
callq 0x20b0
addq $0x2a0, %rsp            # imm = 0x2A0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x2140
jmp 0x33ea
jmp 0x33ea
movq %rax, %rbx
leaq -0x230(%rbp), %rdi
callq 0x20b0
movq %rbx, %rdi
callq 0x2350
nop
// File: /workspace/github_cpp_makefile_star2_O3/wenzhelu[P]RUDP/sender.cpp
// Function: Sender::send(char const*, unsigned long)
void Sender::send(const char *buffer, size_t len) {
    busy.lock();
    userBuff = new char[len];
    memcpy(userBuff, buffer, len);
    userDataLen = len;
    
    // after data copying
    beginTask();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
addq $0x10, %rdi
callq 0x22f0
testl %eax, %eax
jne 0x3451
movq %rbx, %rdi
callq 0x2030
movq %rax, (%r14)
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x21a0
movl %ebx, 0x8(%r14)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x30aa
movl %eax, %edi
callq 0x2140
// File: /workspace/github_cpp_makefile_star2_O3/eschwabe[P]interview-practice/src/zeromatrix.cpp
// Function: PropogateZeros(int**, int, int)
void PropogateZeros(int* matrix[], int M, int N) {
    bool* zrows = new bool[M];
    bool* zcols = new bool[N];
    for(int row = 0; row < M; row++) {
        for(int col = 0; col < N; col++) {
            if(matrix[row][col] == 0) {
                zrows[row] = true;
                zcols[col] = true;
            }
        }
    }

    // zero rows
    for(int row = 0; row < M; row++) {
        if(zrows[row]) {
            for(int col = 0; col < N; col++) {
                matrix[row][col] = 0;
            }
        }
    }

    // zero cols
    for(int col = 0; col < N; col++) {
        if(zcols[col]) {
            for(int row = 0; row < M; row++) {
                matrix[row][col] = 0;
            }
        }
    }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movl %esi, %ebx
movq %rdi, %r14
movslq %esi, %rdi
movq %rdi, 0x8(%rsp)
callq 0x1030
movq %rax, %r12
movslq %ebp, %rdi
callq 0x1030
movl %ebp, %r8d
movq %rax, %r15
movl %ebx, 0x4(%rsp)
movl %ebx, %r13d
movl %ebp, %ebx
cmpl $0x0, 0x8(%rsp)
jle 0x12a1
xorl %eax, %eax
movb $0x1, %cl
movl 0x4(%rsp), %edi
testl %r8d, %r8d
jle 0x1258
movq (%r14,%rax,8), %rdx
xorl %esi, %esi
cmpl $0x0, (%rdx,%rsi,4)
jne 0x1250
movb %cl, (%r12,%rax)
movb %cl, (%r15,%rsi)
incq %rsi
cmpq %rsi, %rbx
jne 0x1242
incq %rax
cmpq %r13, %rax
jne 0x1237
testl %edi, %edi
jle 0x12a1
leaq (,%rbx,4), %rax
movq %rax, 0x8(%rsp)
xorl %ebp, %ebp
movl %r8d, 0x14(%rsp)
testl %r8d, %r8d
jle 0x1299
cmpb $0x0, (%r12,%rbp)
je 0x1299
movq (%r14,%rbp,8), %rdi
xorl %esi, %esi
movq 0x8(%rsp), %rdx
callq 0x1050
movl 0x14(%rsp), %r8d
incq %rbp
cmpq %rbp, %r13
jne 0x1278
testl %r8d, %r8d
movl 0x4(%rsp), %esi
jle 0x12d4
xorl %eax, %eax
testl %esi, %esi
jle 0x12cc
cmpb $0x0, (%r15,%rax)
je 0x12cc
xorl %ecx, %ecx
movq (%r14,%rcx,8), %rdx
movl $0x0, (%rdx,%rax,4)
incq %rcx
cmpq %rcx, %r13
jne 0x12b9
incq %rax
cmpq %rbx, %rax
jne 0x12ac
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/eschwabe[P]interview-practice/src/zeromatrix.cpp
// Function: PrintMatrix(int**, int, int)
void PrintMatrix(int* matrix[], int M, int N) {
    for(int row = 0; row < M; row++) {
        for(int col = 0; col < N; col++) {
            cout << setw(3) << matrix[row][col] << " ";
        }
        cout << endl;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, 0xc(%rsp)
testl %esi, %esi
jle 0x138e
movq %rdi, %r14
movl %esi, %eax
movq %rax, 0x10(%rsp)
movl 0xc(%rsp), %ebp
xorl %ebx, %ebx
movq 0x2cc4(%rip), %r15      # 0x3fd8
leaq 0xd35(%rip), %r12       # 0x2050
cmpl $0x0, 0xc(%rsp)
jle 0x135d
xorl %r13d, %r13d
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0x3, 0x10(%r15,%rax)
movq (%r14,%rbx,8), %rax
movl (%rax,%r13,4), %esi
movq %r15, %rdi
callq 0x10b0
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x1090
incq %r13
cmpq %r13, %rbp
jne 0x1325
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x1080
movsbl %al, %esi
movq %r15, %rdi
callq 0x1040
movq %rax, %rdi
callq 0x1060
incq %rbx
cmpq 0x10(%rsp), %rbx
jne 0x131b
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq