LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/yayuntian[P]user_agent/userAgent.cpp
// Function: readUtil(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, int, char*, int&, char, bool)
void readUtil(string& ua, int ua_len, char *buf, int& index, char delimiter, bool cat) {
    int catalan = 0;
    int i = index;

    for (; i < ua_len; i++) {
        if (ua[i] == delimiter) {
            if (catalan == 0) {
                getSubStr(buf, ua, index, i);
                index = i + 1;
                return;
            }
            catalan--;
        } else if (cat && ua[i] == '(') {
            catalan++;
        }
    }
    getSubStr(buf, ua, index, i);
    index = i + 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %eax
movl (%rcx), %r12d
movq (%rdi), %rsi
cmpl %eax, %r12d
jge 0xc9dd
movslq %r12d, %rcx
negl %r12d
addq %rsi, %rcx
movl %eax, %edx
negl %edx
xorl %r10d, %r10d
movb (%rcx), %r11b
cmpb %r8b, %r11b
jne 0xc9bd
testl %r10d, %r10d
je 0xca1a
decl %r10d
jmp 0xc9cf
testb %r9b, %r9b
je 0xc9cf
xorl %ebp, %ebp
cmpb $0x28, %r11b
sete %bpl
addl %ebp, %r10d
decl %r12d
incq %rcx
cmpl %r12d, %edx
jne 0xc9ab
movl %eax, %r12d
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x8(%rdi), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xc5fa
movslq (%rbx), %rsi
movq (%r15), %r15
cmpl %esi, %r12d
je 0xca5b
movl %r12d, %eax
subl %esi, %eax
movslq %eax, %rdx
addq %r15, %rsi
movq %r14, %rdi
callq 0x61d0
jmp 0xca5b
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x8(%rdi), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0xc5fa
movslq (%rbx), %rsi
movl %esi, %eax
movq (%r15), %r15
addl %r12d, %eax
je 0xca58
leal (%rsi,%r12), %eax
negl %eax
movslq %eax, %rdx
addq %r15, %rsi
movq %r14, %rdi
callq 0x61d0
negl %r12d
cmpq %r13, %r15
je 0xca6f
movq (%r13), %rsi
incq %rsi
movq %r15, %rdi
callq 0x6340
incl %r12d
movl %r12d, (%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/yayuntian[P]user_agent/userAgent.cpp
// Function: parseProduct(Section&, char*)
void parseProduct(Section& s, char *product) {

    char *ver = NULL;
    char *ptr = strtok_r(product, "/", &ver);

    // remove json '\' character, ex: Mozilla\/5.0
    remove_rchar(product);

    s.name = product;
    if (ptr != NULL) {
        s.version = ver;
    } else {
        s.version = "";
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsp, %rdx
movq $0x0, (%rdx)
leaq 0x24f3d(%rip), %rsi     # 0x319e0
movq %r14, %rdi
callq 0x6660
movq %rax, %r15
movq %r14, %rdi
callq 0x6160
decl %eax
cltq
cmpb $0x5c, (%r14,%rax)
jne 0xcad1
addq %r14, %rax
movb $0x0, (%rax)
cmpb $0x5c, -0x1(%rax)
leaq -0x1(%rax), %rax
je 0xcac4
movq 0x8(%rbx), %r12
movq %r14, %rdi
callq 0x6160
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %r14, %rcx
movq %rax, %r8
callq 0x6550
testq %r15, %r15
je 0xcb19
movq (%rsp), %r14
movq 0x28(%rbx), %r15
addq $0x20, %rbx
movq %r14, %rdi
callq 0x6160
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %r14, %rcx
movq %rax, %r8
jmp 0xcb30
movq 0x28(%rbx), %rdx
addq $0x20, %rbx
leaq 0x2489c(%rip), %rcx     # 0x313c4
movq %rbx, %rdi
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x6550
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/yayuntian[P]user_agent/userAgent.cpp
// Function: parseSection(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, int, int&)
Section parseSection(string& ua, int ua_len, int& index) {
    char buf[512] = {0,};

    readUtil(ua, ua_len, buf, index, ' ', false);

    Section s;
    parseProduct(s, buf);

    if (index < ua_len && ua[index] == '(') {
        index++;
        memset(buf, 0, 512);
        readUtil(ua, ua_len, buf, index, ')', true);
        split_regex(s.comment, buf, boost::regex("; ")) ;
        index++;
    }

    return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x10(%rsp), %r12
xorl %r13d, %r13d
movl $0x200, %edx            # imm = 0x200
movq %r12, %rdi
xorl %esi, %esi
callq 0x6200
movq %r15, %rdi
movl %ebp, %esi
movq %r12, %rdx
movq %r14, %rcx
movl $0x20, %r8d
xorl %r9d, %r9d
callq 0xc97a
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq %r13, 0x8(%rbx)
movb %r13b, 0x10(%rbx)
leaq 0x30(%rbx), %rax
movq %rax, 0x20(%rbx)
movq %r13, 0x28(%rbx)
movb %r13b, 0x30(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rbx)
movq %r13, 0x50(%rbx)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xca84
movslq (%r14), %rax
cmpl %ebp, %eax
jge 0xcc38
movq (%r15), %rcx
cmpb $0x28, (%rcx,%rax)
jne 0xcc38
incl %eax
movl %eax, (%r14)
leaq 0x10(%rsp), %r12
movl $0x200, %edx            # imm = 0x200
movq %r12, %rdi
xorl %esi, %esi
callq 0x6200
movq %r15, %rdi
movl %ebp, %esi
movq %r12, %rdx
movq %r14, %rcx
movl $0x29, %r8d
movl $0x1, %r9d
callq 0xc97a
leaq 0x24dd4(%rip), %rsi     # 0x319e2
movq %rsp, %rdi
xorl %edx, %edx
callq 0xd392
leaq 0x40(%rbx), %rdi
leaq 0x10(%rsp), %rsi
movq %rsp, %rdx
xorl %ecx, %ecx
callq 0x1b510
leaq 0x8(%rsp), %rdi
callq 0xf590
incl (%r14)
movq %rbx, %rax
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0xf590
jmp 0xcc61
jmp 0xcc5e
movq %rax, %r14
movq %rbx, %rdi
callq 0xd3da
movq %r14, %rdi
callq 0x6630
// File: /workspace/github_cpp_makefile_star2_O3/yayuntian[P]user_agent/userAgent.cpp
// Function: initialize(UserAgent&)
void initialize(UserAgent& p) {
    p.ua = "";
    p.mozilla = "";
    p.platform = "";
    p.os = "";
    p.localization = "";
    p.browser.Engine = "";
    p.browser.EngineVersion = "";
    p.browser.Name = "";
    p.browser.Version = "";
    p.bot = false;
    p.mobile = false;
    p.undecided = false;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdx
leaq 0x24741(%rip), %r14     # 0x313c4
xorl %esi, %esi
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x6550
leaq 0x20(%rbx), %rdi
movq 0x28(%rbx), %rdx
xorl %esi, %esi
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x6550
leaq 0x40(%rbx), %rdi
movq 0x48(%rbx), %rdx
xorl %esi, %esi
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x6550
leaq 0x60(%rbx), %rdi
movq 0x68(%rbx), %rdx
xorl %esi, %esi
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x6550
leaq 0x80(%rbx), %rdi
movq 0x88(%rbx), %rdx
xorl %esi, %esi
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x6550
leaq 0xa0(%rbx), %rdi
movq 0xa8(%rbx), %rdx
xorl %esi, %esi
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x6550
leaq 0xc0(%rbx), %rdi
movq 0xc8(%rbx), %rdx
xorl %esi, %esi
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x6550
leaq 0xe0(%rbx), %rdi
movq 0xe8(%rbx), %rdx
xorl %esi, %esi
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x6550
leaq 0x100(%rbx), %rdi
movq 0x108(%rbx), %rdx
xorl %esi, %esi
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x6550
movw $0x0, 0x120(%rbx)
movb $0x0, 0x122(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/yayuntian[P]user_agent/userAgent.cpp
// Function: Parse(UserAgent&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
void Parse(UserAgent& p, string ua, const int ua_len) {

#ifdef LRU_CACHE
    if (cacheUA.exists(ua) == true) {
        p = cacheUA.get(ua);
        return;
    }
#endif
    vector<Section> sections;
    initialize(p);
    p.ua = ua;

    int index = 0;

    while (index < ua_len) {
        Section s = parseSection(ua, ua_len, index);
        if (!p.mobile && s.name == "Mobile") {
            p.mobile = true;
        }
        sections.push_back(s);
    }

    int slen = sections.size();
    if (slen > 0) {
        if (sections[0].name == "Mozilla") {
            p.mozilla = sections[0].version;
        }

        detectBrowser(p, sections, slen);
        detectOS(p, sections[0], sections[0].comment.size());

        if (p.undecided) {
            checkBot(p, sections, slen);
        }
#ifdef LRU_CACHE
        cacheUA.put(ua, p);
#endif
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
callq 0xcc71
movq %rbx, %rdi
movq %r14, %rsi
callq 0x61f0
movl $0x0, 0xc(%rsp)
testl %ebp, %ebp
jle 0xce51
leaq 0x30(%rsp), %r12
leaq 0xc(%rsp), %r13
leaq 0x10(%rsp), %r15
movq %r12, %rdi
movq %r14, %rsi
movl %ebp, %edx
movq %r13, %rcx
callq 0xcb41
cmpb $0x0, 0x121(%rbx)
jne 0xcdfa
movq %r12, %rdi
leaq 0x2843c(%rip), %rsi     # 0x35226
callq 0x60d0
testl %eax, %eax
jne 0xcdfa
movb $0x1, 0x121(%rbx)
movq %r15, %rdi
movq %r12, %rsi
callq 0xd41a
leaq 0x70(%rsp), %rdi
callq 0xd4b2
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0xce2b
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x6340
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xce47
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x6340
cmpl %ebp, 0xc(%rsp)
jl 0xcdc7
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rax
subq %rdi, %rax
shrq $0x3, %rax
imull $0xba2e8ba3, %eax, %ebp # imm = 0xBA2E8BA3
testl %ebp, %ebp
jle 0xcece
leaq 0x227a0(%rip), %rsi     # 0x2f613
callq 0x60d0
testl %eax, %eax
jne 0xce8e
movq 0x10(%rsp), %rsi
addq $0x20, %rsi
leaq 0x20(%rbx), %rdi
callq 0x61f0
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x2b574
movq 0x10(%rsp), %rsi
movq 0x48(%rsi), %rdx
subq 0x40(%rsi), %rdx
shrq $0x5, %rdx
movq %rbx, %rdi
callq 0x23b98
cmpb $0x1, 0x122(%rbx)
jne 0xcece
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x25dae
leaq 0x10(%rsp), %rdi
callq 0xd444
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xceee
jmp 0xceee
movq %rax, %rbx
jmp 0xcf00
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xd3da
leaq 0x10(%rsp), %rdi
callq 0xd444
movq %rbx, %rdi
callq 0x6630
// File: /workspace/github_cpp_makefile_star2_O3/yayuntian[P]user_agent/operatingSystem.cpp
// Function: getPlatform(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, int)
string getPlatform(vector<string>& comment, int slen) {
    if (slen > 0) {
        if (comment[0] != "compatible") {
            if (starts_with(comment[0], "Windows")) {
                return "Windows";
            } else if  (starts_with(comment[0], "Symbian")) {
                return "Symbian";
            } else if (starts_with(comment[0], "webOS")) {
                return "webOS";
            } else if (comment[0] == "BB10") {
                return "BlackBerry";
            }
            return comment[0];
        }
    }
    return "";
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %edx, %edx
jle 0x21f34
movq %rsi, %r14
movq (%rsi), %rdi
leaq 0x13294(%rip), %rsi     # 0x3515c
callq 0x60d0
testl %eax, %eax
je 0x21f34
movq (%r14), %rdi
movq 0x8(%rdi), %rdx
testq %rdx, %rdx
je 0x21fef
leaq -0x1(%rdx), %rax
cmpq $0x6, %rax
movl $0x6, %esi
cmovbq %rax, %rsi
movq (%rdi), %rcx
incq %rsi
xorl %r8d, %r8d
leaq 0x13265(%rip), %r9      # 0x35167
movb (%rcx,%r8), %r10b
cmpb (%r8,%r9), %r10b
jne 0x21f4d
incq %r8
cmpq %r8, %rsi
jne 0x21f02
cmpq $0x6, %rax
jb 0x21f56
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x1323f(%rip), %rsi     # 0x35167
leaq 0x1323f(%rip), %rdx     # 0x3516e
jmp 0x22032
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0xf482(%rip), %rdx      # 0x313c4
movq %rbx, %rdi
movq %rdx, %rsi
jmp 0x22035
testq %rdx, %rdx
je 0x21fef
cmpq $0x6, %rax
movl $0x6, %esi
cmovbq %rax, %rsi
incq %rsi
xorl %r8d, %r8d
leaq 0xed16(%rip), %r9       # 0x30c86
movb (%rcx,%r8), %r10b
cmpb (%r8,%r9), %r10b
jne 0x21fa2
incq %r8
cmpq %r8, %rsi
jne 0x21f70
cmpq $0x6, %rax
jb 0x21fa7
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0xecf0(%rip), %rsi      # 0x30c86
leaq 0xecf0(%rip), %rdx      # 0x30c8d
jmp 0x22032
testq %rdx, %rdx
je 0x21fef
cmpq $0x4, %rax
movl $0x4, %edx
cmovbq %rax, %rdx
incq %rdx
xorl %esi, %esi
leaq 0xe2a0(%rip), %r8       # 0x30260
movb (%rcx,%rsi), %r9b
cmpb (%rsi,%r8), %r9b
jne 0x21fef
incq %rsi
cmpq %rsi, %rdx
jne 0x21fc0
cmpq $0x4, %rax
jb 0x21fef
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0xe27a(%rip), %rsi      # 0x30260
leaq 0xe278(%rip), %rdx      # 0x30265
jmp 0x22032
leaq 0xe57d(%rip), %rsi      # 0x30573
callq 0x60d0
testl %eax, %eax
je 0x2201d
movq (%r14), %rax
leaq 0x10(%rbx), %rcx
movq %rcx, (%rbx)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0xc5fa
jmp 0x2203a
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0xe42e(%rip), %rsi      # 0x30459
leaq 0xe431(%rip), %rdx      # 0x30463
movq %rbx, %rdi
callq 0xc690
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/yayuntian[P]user_agent/operatingSystem.cpp
// Function: trident(UserAgent&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, int)
void trident(UserAgent& p, vector<string>& comment, int slen) {
    p.platform = "Windows";

    if (p.os == "") {
        if (slen > 2) {
            p.os = normalizeOS(comment[2]);
        } else {
            p.os = "Windows NT 4.0";
        }
    }
    for (int i = 0; i < slen; i++) {
        if (starts_with(comment[i], "IEMobile")) {
            p.mobile = true;
            return;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
addq $0x40, %rdi
movq 0x48(%rbx), %rdx
leaq 0x12641(%rip), %rcx     # 0x35167
movl $0x7, %r8d
xorl %esi, %esi
callq 0x6550
leaq 0x60(%rbx), %r15
leaq 0xe886(%rip), %rsi      # 0x313c4
movq %r15, %rdi
callq 0x60d0
testl %eax, %eax
jne 0x22be3
cmpl $0x3, %ebp
jl 0x22bc8
movq (%r14), %rax
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x40(%rax), %rsi
movq 0x48(%rax), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0xc5fa
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0x22045
leaq 0x28(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x6410
movq (%r12), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x22baf
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6340
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x22be7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6340
jmp 0x22be7
movq 0x68(%rbx), %rdx
leaq 0x12642(%rip), %rcx     # 0x35215
movl $0xe, %r8d
movq %r15, %rdi
xorl %esi, %esi
callq 0x6550
testl %ebp, %ebp
jle 0x22c4c
movq (%r14), %rax
movl %ebp, %ecx
xorl %edx, %edx
leaq 0x1262f(%rip), %rsi     # 0x35224
movq %rdx, %r8
shlq $0x5, %r8
movq 0x8(%rax,%r8), %rdi
testq %rdi, %rdi
je 0x22c3b
addq %rax, %r8
movq (%r8), %r8
decq %rdi
cmpq $0x7, %rdi
movl $0x7, %r9d
cmovbq %rdi, %r9
incq %r9
xorl %r10d, %r10d
movb (%r8,%r10), %r11b
cmpb (%r10,%rsi), %r11b
jne 0x22c3b
incq %r10
cmpq %r10, %r9
jne 0x22c23
cmpq $0x7, %rdi
jae 0x22c45
incq %rdx
cmpq %rcx, %rdx
jne 0x22bf5
jmp 0x22c4c
movb $0x1, 0x121(%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x22c75
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6340
movq %rbx, %rdi
callq 0x6630
// File: /workspace/github_cpp_makefile_star2_O3/yayuntian[P]user_agent/operatingSystem.cpp
// Function: dalvik(UserAgent&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, int)
void dalvik(UserAgent& p, vector<string>& comment, int slen) {
    if (starts_with(comment[0], "Linux")) {
        p.platform = comment[0];
        if (slen > 2) {
            p.os = comment[2];
        }
        p.mobile = true;
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq (%rsi), %rsi
movq 0x8(%rsi), %rax
testq %rax, %rax
je 0x22f0d
movl %edx, %ebp
movq %rdi, %rbx
decq %rax
cmpq $0x4, %rax
movl $0x4, %ecx
cmovbq %rax, %rcx
movq (%rsi), %rdx
incq %rcx
xorl %edi, %edi
leaq 0xc32a(%rip), %r8       # 0x2f1fa
movb (%rdx,%rdi), %r9b
cmpb (%rdi,%r8), %r9b
jne 0x22f0d
incq %rdi
cmpq %rdi, %rcx
jne 0x22ed0
cmpq $0x4, %rax
jb 0x22f0d
leaq 0x40(%rbx), %rdi
callq 0x61f0
cmpl $0x3, %ebp
jl 0x22f06
movq (%r14), %rsi
addq $0x40, %rsi
leaq 0x60(%rbx), %rdi
callq 0x61f0
movb $0x1, 0x121(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/yayuntian[P]user_agent/operatingSystem.cpp
// Function: split_v(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, int, int)
vector<string> split_v(const vector<string>& data, int start, int end)
{
    int n = end - start;
    if (n <= 0) {
        return std::vector<string>();
    }

    std::vector<string> y(n);
    for (int i = 0; i < n; i++) {
        y[i] = data[start++];
    }
    return y;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
subl %edx, %ecx
jle 0x22f69
movl %edx, %ebp
movq %rsi, %r14
movl %ecx, %r15d
leaq 0x7(%rsp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x23f4c
movslq %ebp, %r12
shlq $0x5, %r12
shlq $0x5, %r15
xorl %r13d, %r13d
movq (%r14), %rsi
addq %r12, %rsi
addq %r13, %rsi
movq (%rbx), %rdi
addq %r13, %rdi
callq 0x61f0
addq $0x20, %r13
cmpq %r13, %r15
jne 0x22f4a
jmp 0x22f77
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0xd4b2
movq %r14, %rdi
callq 0x6630
// File: /workspace/github_cpp_makefile_star2_O3/yayuntian[P]user_agent/bot.cpp
// Function: googleBot(UserAgent&)
bool googleBot(UserAgent& p) {
    if (contains(p.ua, "Googlebot")) {
        p.platform = "";
        p.undecided = true;
    }
    return p.undecided;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x25bef
movq (%rbx), %rcx
leaq (%rcx,%rax), %rdx
decq %rax
leaq 0xf78c(%rip), %rsi      # 0x35318
xorl %edi, %edi
movb (%rcx,%rdi), %r8b
cmpb (%rdi,%rsi), %r8b
jne 0x25bb0
leaq 0x1(%rdi), %r8
cmpq %rdi, %rax
je 0x25baa
cmpq $0x8, %rdi
movq %r8, %rdi
jne 0x25b8e
leaq (%rcx,%r8), %r9
jmp 0x25bb7
leaq (%rcx,%rdi), %r9
movq %rdi, %r8
cmpq $0x9, %r8
je 0x25bca
incq %rcx
decq %rax
cmpq %rdx, %rcx
jne 0x25b8c
jmp 0x25bef
cmpq %r9, %rcx
je 0x25bef
leaq 0x40(%rbx), %rdi
movq 0x48(%rbx), %rdx
leaq 0xb7e6(%rip), %rcx      # 0x313c4
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x6550
movb $0x1, 0x122(%rbx)
movb 0x122(%rbx), %al
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/yayuntian[P]user_agent/bot.cpp
// Function: setSimple(UserAgent&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool)
void setSimple(UserAgent& p, string name, string version, bool bot) {
    p.bot = bot;
    if(!bot) {
        p.mozilla = "";
    }
    p.browser.Name = replace_all_copy(name, "\\", "");
    p.browser.Version = version;
    p.browser.Engine = "";
    p.browser.EngineVersion = "";
    p.os = "";
    p.localization = "";
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movb %cl, 0x120(%rdi)
testl %ecx, %ecx
jne 0x25c2e
leaq 0x20(%rbx), %rdi
movq 0x28(%rbx), %rdx
leaq 0xb7a0(%rip), %rcx      # 0x313c4
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x6550
leaq 0xf6ed(%rip), %rax      # 0x35322
movq %rax, 0x20(%rsp)
leaq 0xf6e2(%rip), %rax      # 0x35323
movq %rax, 0x28(%rsp)
movq (%r15), %rcx
movq 0x8(%r15), %rdx
leaq (%rcx,%rdx), %rax
testq %rdx, %rdx
je 0x25c63
cmpb $0x5c, (%rcx)
je 0x25c68
incq %rcx
decq %rdx
jne 0x25c56
movq %rax, %rcx
jmp 0x25c6c
leaq 0x1(%rcx), %rax
leaq 0x58(%rsp), %r8
movq %rcx, (%r8)
movq %rax, 0x8(%r8)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0xb732(%rip), %rcx      # 0x313c4
leaq 0x38(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %rcx, %rdx
callq 0x255cc
leaq 0xe0(%rbx), %rdi
movq %r12, %rsi
callq 0x6410
movq (%r12), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x25ccf
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x6340
leaq 0xa0(%rbx), %r15
leaq 0x100(%rbx), %rdi
movq %r14, %rsi
callq 0x61f0
movq 0xa8(%rbx), %rdx
leaq 0xb6d1(%rip), %r14      # 0x313c4
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x6550
leaq 0xc0(%rbx), %rdi
movq 0xc8(%rbx), %rdx
xorl %esi, %esi
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x6550
leaq 0x60(%rbx), %rdi
movq 0x68(%rbx), %rdx
xorl %esi, %esi
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x6550
movq 0x88(%rbx), %rdx
subq $-0x80, %rbx
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x6550
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/yayuntian[P]user_agent/bot.cpp
// Function: fixOther(UserAgent&, std::vector<Section, std::allocator<Section>>&, int)
void fixOther(UserAgent& p, vector<Section>& sections, int slen) {
    if (slen > 0) {
        p.browser.Name = sections[0].name;
        p.browser.Version = sections[0].version;
        p.mozilla = "";
    }
}

// Assembly:
testl %edx, %edx
jle 0x25dad
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rsi
addq $0xe0, %rdi
callq 0x61f0
movq (%r14), %rsi
addq $0x20, %rsi
leaq 0x100(%rbx), %rdi
callq 0x61f0
movq 0x28(%rbx), %rdx
addq $0x20, %rbx
leaq 0xb62b(%rip), %rcx      # 0x313c4
movq %rbx, %rdi
xorl %esi, %esi
xorl %r8d, %r8d
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x6550
retq
// File: /workspace/github_cpp_makefile_star2_O3/shirat74[P]resample/Image.cc
// Function: Image::getPixel(int, int) const
Color
Image::getPixel (int32_t x, int32_t y) const
{
  if (x < 0) {
    while (x < 0)
      x += width;
  } else if (x >= width) {
    while (x >= width)
      x -= width;
  }
  if (y < 0) {
    while (y < 0)
      y += height;
  } else if (y >= height) {
    while (y >= height)
      y -= height;
  }
  return data[y * width + x];
}

// Assembly:
movl (%rdi), %eax
testl %esi, %esi
js 0x2a06
cmpl %esi, %eax
jg 0x2a0a
addl %eax, %esi
subl %eax, %esi
cmpl %eax, %esi
jge 0x29fe
jmp 0x2a0a
addl %eax, %esi
js 0x2a06
movl 0x4(%rdi), %ecx
testl %edx, %edx
js 0x2a1f
cmpl %edx, %ecx
jg 0x2a23
addl %ecx, %edx
subl %ecx, %edx
cmpl %ecx, %edx
jge 0x2a17
jmp 0x2a23
addl %ecx, %edx
js 0x2a1f
movq 0x10(%rdi), %rcx
imull %edx, %eax
addl %esi, %eax
cltq
leaq (%rax,%rax,2), %rdx
movq (%rcx,%rdx,4), %rax
movl 0x8(%rcx,%rdx,4), %edx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/shirat74[P]resample/Image.cc
// Function: Image::putPixel(int, int, Color)
void
Image::putPixel (int32_t x, int32_t y, Color value)
{
  if (x < 0) {
    while (x < 0)
      x += width;
  } else if (x >= width) {
    while (x >= width)
      x -= width;
  }
  if (y < 0) {
    while (y < 0)
      y += height;
  } else if (y >= height) {
    while (y >= height)
      y -= height;
  }
  data[y * width + x] = value;
}

// Assembly:
movl (%rdi), %eax
testl %esi, %esi
js 0x2a50
cmpl %esi, %eax
jg 0x2a54
addl %eax, %esi
subl %eax, %esi
cmpl %eax, %esi
jge 0x2a48
jmp 0x2a54
addl %eax, %esi
js 0x2a50
movl 0x4(%rdi), %r9d
testl %edx, %edx
js 0x2a6e
cmpl %edx, %r9d
jg 0x2a73
addl %r9d, %edx
subl %r9d, %edx
cmpl %r9d, %edx
jge 0x2a64
jmp 0x2a73
addl %r9d, %edx
js 0x2a6e
movq 0x10(%rdi), %rdi
imull %edx, %eax
addl %esi, %eax
cltq
leaq (%rax,%rax,2), %rax
movq %rcx, (%rdi,%rax,4)
movl %r8d, %ecx
shrl $0x10, %ecx
movb %cl, 0xa(%rdi,%rax,4)
movw %r8w, 0x8(%rdi,%rax,4)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/shirat74[P]resample/Image.cc
// Function: Image::getPixelBytes[abi:cxx11]() const
std::string
Image::getPixelBytes () const
{
  std::string bytes(width * height * nComps * (bpc / 8), 0);
  for (int32_t j = 0; j < height; j++) {
    for (int32_t i = 0; i < width; i++) {
      Color  pixel = getPixel(i, j);
      size_t pos   = (bpc / 8) * nComps * (j * width + i);
      for (int c = 0; c < nComps; c++) {
        if (bpc == 8) {
          bytes[pos + c] = round(255 * (pixel.v[c] / 65535.0));
        } else {
          bytes[pos+2*c]   = (pixel.v[c] >> 8) & 0xff;
          bytes[pos+2*c+1] =  pixel.v[c] & 0xff;
        }
      }
    }
  }
  return bytes;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x4(%rsi), %eax
imull (%rsi), %eax
movsbl 0x8(%rsi), %ecx
imull %eax, %ecx
movb 0x9(%rsi), %al
movl %eax, %edx
sarb $0x7, %dl
shrb $0x5, %dl
addb %al, %dl
sarb $0x3, %dl
movsbl %dl, %eax
imull %ecx, %eax
movslq %eax, %rsi
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
xorl %r15d, %r15d
xorl %edx, %edx
callq 0x2320
movl 0x4(%r14), %eax
testl %eax, %eax
jle 0x2bd5
movl (%r14), %r12d
testl %r12d, %r12d
jle 0x2bc9
movb 0x8(%r14), %r13b
xorl %ebp, %ebp
movq %r15, 0x10(%rsp)
movq %r14, %rdi
movl %ebp, %esi
movl %r15d, %edx
callq 0x29f2
movq %rax, (%rsp)
movw %dx, 0x8(%rsp)
shrl $0x10, %edx
movb %dl, 0xa(%rsp)
testb %r13b, %r13b
jle 0x2bba
movb 0x9(%r14), %al
movl %eax, %ecx
sarb $0x7, %cl
shrb $0x5, %cl
addb %al, %cl
sarb $0x3, %cl
movsbl %cl, %eax
movsbl %r13b, %ecx
imull %r15d, %r12d
addl %ebp, %r12d
imull %ecx, %r12d
imull %eax, %r12d
movslq %r12d, %r12
xorl %r15d, %r15d
cmpb $0x8, 0x9(%r14)
movzwl (%rsp,%r15,2), %eax
jne 0x2b90
movzwl %ax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x3499(%rip), %xmm0     # 0x6010
mulsd 0x3489(%rip), %xmm0     # 0x6008
callq 0x2110
cvttsd2si %xmm0, %eax
movq %r12, %rcx
movq %r15, %rdx
jmp 0x2b9f
leaq (%r12,%r15,2), %rcx
movq (%rbx), %rdx
movb %ah, (%rdx,%rcx)
movl $0x1, %edx
addq (%rbx), %rcx
movb %al, (%rdx,%rcx)
incq %r15
movsbq 0x8(%r14), %r13
cmpq %r13, %r15
jl 0x2b59
movl (%r14), %r12d
movq 0x10(%rsp), %r15
incl %ebp
cmpl %r12d, %ebp
jl 0x2b06
movl 0x4(%r14), %eax
incl %r15d
cmpl %eax, %r15d
jl 0x2af2
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/shirat74[P]resample/./Image.hh
// Function: Image::reset(int, int, signed char, signed char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void reset(int32_t width, int32_t height,
             int8_t nComps, int8_t bpc, const std::string raster)
  {
    this->width  = width;
    this->height = height;
    this->nComps = nComps;
    this->bpc    = bpc;
    delete data;
    data = data_from_string(raster, width, height, nComps, bpc);
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %r13
movl %r8d, %ebp
movl %ecx, %r14d
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %rbx
movl %esi, (%rdi)
movl %edx, 0x4(%rdi)
movb %r14b, 0x8(%rdi)
movb %bpl, 0x9(%rdi)
movq 0x10(%rdi), %rdi
movl $0xc, %esi
callq 0x22d0
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %r13
movq %r13, %rdi
callq 0x2be8
movq %r13, %rdi
movl %r12d, %esi
movl %r15d, %edx
movl %r14d, %ecx
movl %ebp, %r8d
callq 0x26f4
movq %rax, 0x10(%rbx)
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3754
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x22d0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3782
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x22d0
movq %rbx, %rdi
callq 0x2400
// File: /workspace/github_cpp_makefile_star2_O3/shirat74[P]resample/Resampler.cc
// Function: Resampler::B_spline_filter(float)
float Resampler::B_spline_filter (float t)
{
  if (t < 0.0)
    t = -t;
  if (t < 1.0) {
    return ((0.5 * t * t * t) - t * t + (2.0 / 3.0));
  } else if (t < 2) {
    t = 2 - t;
    return ((1.0 / 6.0) * (t * t * t));
  }
  return 0.0;
}

// Assembly:
movaps 0x2701(%rip), %xmm1     # 0x60b0
xorps %xmm0, %xmm1
maxss %xmm0, %xmm1
movss 0x27de(%rip), %xmm0     # 0x619c
ucomiss %xmm1, %xmm0
jbe 0x39fa
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
movsd 0x26be(%rip), %xmm2     # 0x6090
mulsd %xmm0, %xmm2
mulsd %xmm0, %xmm2
mulss %xmm1, %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm0, %xmm2
subsd %xmm1, %xmm2
addsd 0x27e6(%rip), %xmm2     # 0x61d8
xorps %xmm0, %xmm0
cvtsd2ss %xmm2, %xmm0
retq
xorps %xmm0, %xmm0
movss 0x279b(%rip), %xmm2     # 0x61a0
ucomiss %xmm1, %xmm2
jbe 0x3a29
subss %xmm1, %xmm2
movaps %xmm2, %xmm0
mulss %xmm2, %xmm0
mulss %xmm2, %xmm0
cvtss2sd %xmm0, %xmm0
mulsd 0x27ab(%rip), %xmm0     # 0x61d0
cvtsd2ss %xmm0, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O3/shirat74[P]resample/Resampler.cc
// Function: Resampler::bicubic_filter(float)
float Resampler::bicubic_filter (float t)
{
  if (t < 0.0)
    t = -t;
  if (t < 1.0)
    return ((a+2.0)*t*t*t - (a+3.0)*t*t + 1.0);
  else if (t < 2.0)
   return (a*t*t*t - 5.0*a*t*t + 8.0*a*t - 4.0*a);
  return 0.0;
}

// Assembly:
movaps 0x267f(%rip), %xmm2     # 0x60b0
xorps %xmm0, %xmm2
maxss %xmm0, %xmm2
cvtss2sd %xmm2, %xmm1
movss 0x2758(%rip), %xmm0     # 0x619c
ucomiss %xmm2, %xmm0
jbe 0x3a7e
movsd 0x27af(%rip), %xmm0     # 0x6200
mulsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
movsd 0x27a7(%rip), %xmm2     # 0x6208
mulsd %xmm1, %xmm2
mulsd %xmm1, %xmm2
mulsd %xmm1, %xmm0
addsd %xmm2, %xmm0
addsd 0x260f(%rip), %xmm0     # 0x6088
cvtsd2ss %xmm0, %xmm0
retq
xorps %xmm0, %xmm0
movss 0x2717(%rip), %xmm3     # 0x61a0
ucomiss %xmm2, %xmm3
jbe 0x3ad1
movsd 0x274a(%rip), %xmm0     # 0x61e0
mulsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
movsd 0x2742(%rip), %xmm2     # 0x61e8
mulsd %xmm1, %xmm2
mulsd %xmm1, %xmm2
mulsd %xmm1, %xmm0
addsd %xmm2, %xmm0
mulsd 0x2732(%rip), %xmm1     # 0x61f0
addsd %xmm0, %xmm1
addsd 0x272e(%rip), %xmm1     # 0x61f8
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O3/shirat74[P]resample/Resampler.cc
// Function: Resampler::Mitchell_filter(float)
float Resampler::Mitchell_filter (float t)
{
  float tt = t*t;
  if (t < 0)
    t = -t;
  if (t < 1.0) {
    t = (((12.0 - 9.0 * B - 6.0 * C) * (t * tt))
        + ((-18.0 + 12.0 * B + 6.0 * C) * tt)
        + (6.0 - 2 * B));
    return (t / 6.0);
  } else if (t < 2.0) {
    t = (((-1.0 * B - 6.0 * C) * (t * tt))
        + ((6.0 * B + 30.0 * C) * tt)
        + ((-12.0 * B - 48.0 * C) * t)
        + (8.0 * B + 24 * C));
    return (t / 6.0);
  }
  return 0.0;
}

// Assembly:
movaps 0x2511(%rip), %xmm1     # 0x60b0
xorps %xmm0, %xmm1
maxss %xmm0, %xmm1
movaps %xmm0, %xmm2
mulss %xmm0, %xmm2
movss 0x25e7(%rip), %xmm0     # 0x619c
ucomiss %xmm1, %xmm0
jbe 0x3bea
mulss %xmm2, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtss2sd %xmm2, %xmm1
mulsd 0x266c(%rip), %xmm1     # 0x6240
mulsd 0x266c(%rip), %xmm0     # 0x6248
addsd %xmm1, %xmm0
addsd 0x2668(%rip), %xmm0     # 0x6250
jmp 0x3c35
xorps %xmm0, %xmm0
movss 0x25ab(%rip), %xmm3     # 0x61a0
ucomiss %xmm1, %xmm3
jbe 0x3c41
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
mulss %xmm2, %xmm1
cvtss2sd %xmm1, %xmm1
cvtss2sd %xmm2, %xmm2
mulsd 0x260b(%rip), %xmm2     # 0x6220
mulsd 0x260b(%rip), %xmm1     # 0x6228
mulsd 0x260b(%rip), %xmm0     # 0x6230
addsd %xmm2, %xmm1
addsd %xmm1, %xmm0
addsd 0x2603(%rip), %xmm0     # 0x6238
cvtsd2ss %xmm0, %xmm0
divss 0x2567(%rip), %xmm0     # 0x61a8
retq
// File: /workspace/github_cpp_makefile_star2_O3/shirat74[P]resample/Resampler.cc
// Function: Resampler::Resampler(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
Resampler::Resampler (const std::string& filter)
{
  filter_fn = filters[0].func;
  support   = filters[0].support;
  for (int i = 0; i < NUM_FILTERS; i++) {
    if (filter == filters[i].name) {
      filter_fn = filters[i].func;
      support   = filters[i].support;
      break;
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movq $0x0, 0x20(%rdi)
leaq -0x3fa(%rip), %rax      # 0x3958
movq %rax, (%rdi)
movl $0x3f000000, 0x8(%rdi)  # imm = 0x3F000000
xorl %r15d, %r15d
leaq 0x4efa(%rip), %r12      # 0x8c60
leaq (%r12,%r15), %rsi
movq %r14, %rdi
callq 0x20c0
testl %eax, %eax
je 0x3d85
addq $0x30, %r15
cmpq $0x120, %r15            # imm = 0x120
jne 0x3d66
jmp 0x3d99
movq 0x20(%r15,%r12), %rax
movq %rax, (%rbx)
movss 0x28(%r15,%r12), %xmm0
movss %xmm0, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/shirat74[P]resample/Resampler.cc
// Function: Resampler::setupContributorForUpsample(float, int, int)
void
Resampler::setupContributorForUpsample (float   scale,
                                        int32_t dstSize,
                                        int32_t boundary)
{
  contributor.resize(dstSize);

  for (int32_t i = 0; i < dstSize; i++) {
    contributor[i].n = 0;
    std::vector<Contrib> p((int)(support * 2 + 1));
    contributor[i].p = p;
    float center = (float) i / scale;
    float left   = ceil (center - support);
    float right  = floor(center + support);
    for (int32_t j = left; j <= right; j++) {
      float   weight = (*filter_fn)(center - j);
      int32_t n = j;
      // reflect at boundary
      if (j < 0) {
        n = -j;
      } else if (j >= boundary) {
        n = (boundary - j) + boundary - 1;
      }
      int k = contributor[i].n++;
      contributor[i].p[k].pixel  = n;
      contributor[i].p[k].weight = weight;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, 0x10(%rsp)
movl %esi, %ebp
movss %xmm0, 0xc(%rsp)
movq %rdi, %r14
leaq 0x10(%rdi), %r15
movslq %esi, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x458c
testl %r12d, %r12d
jle 0x415f
movl %ebp, %eax
movq %rax, 0x18(%rsp)
movq 0x10(%rsp), %rax
leal -0x1(,%rax,2), %r13d
xorl %ebx, %ebx
movq 0x10(%r14), %rax
movq %rbx, %rbp
shlq $0x5, %rbp
movl $0x0, (%rax,%rbp)
movss 0x8(%r14), %xmm0
addss %xmm0, %xmm0
addss 0x2147(%rip), %xmm0     # 0x619c
cvttss2si %xmm0, %eax
movslq %eax, %rsi
leaq 0x28(%rsp), %r12
movq %r12, %rdi
leaq 0x7(%rsp), %rdx
callq 0x45bc
movq 0x10(%r14), %rax
leaq (%rax,%rbp), %rdi
addq $0x8, %rdi
movq %r12, %rsi
callq 0x46fa
movq %rbx, 0x20(%rsp)
xorps %xmm0, %xmm0
cvtsi2ss %ebx, %xmm0
divss 0xc(%rsp), %xmm0
movss %xmm0, 0x8(%rsp)
movss 0x8(%r14), %xmm2
movss %xmm2, (%rsp)
subss %xmm2, %xmm0
callq 0x21a0
movaps %xmm0, 0x40(%rsp)
movss (%rsp), %xmm0
addss 0x8(%rsp), %xmm0
callq 0x2100
movaps 0x40(%rsp), %xmm2
cvttps2dq %xmm2, %xmm1
cvtdq2ps %xmm1, %xmm1
movss %xmm0, (%rsp)
ucomiss %xmm1, %xmm0
jb 0x4135
cvttss2si %xmm2, %r12d
movl %r12d, %ebx
negl %ebx
movss 0x8(%rsp), %xmm0
subss %xmm1, %xmm0
callq *(%r14)
leal (%rbx,%r13), %eax
cmpl 0x10(%rsp), %r12d
cmovll %r12d, %eax
testl %r12d, %r12d
cmovsl %ebx, %eax
movq (%r15), %rcx
movslq (%rcx,%rbp), %rdx
leal 0x1(%rdx), %esi
movl %esi, (%rcx,%rbp)
movq 0x8(%rcx,%rbp), %rcx
movl %eax, (%rcx,%rdx,8)
incl %r12d
xorps %xmm1, %xmm1
cvtsi2ss %r12d, %xmm1
movss %xmm0, 0x4(%rcx,%rdx,8)
decl %ebx
movss (%rsp), %xmm0
ucomiss %xmm1, %xmm0
jae 0x40e3
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x414c
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x22d0
movq 0x20(%rsp), %rbx
incq %rbx
cmpq 0x18(%rsp), %rbx
jne 0x4031
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4170
movq %rax, %rbx
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x418a
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x22d0
movq %rbx, %rdi
callq 0x2400
// File: /workspace/github_cpp_makefile_star2_O3/shirat74[P]resample/Resampler.cc
// Function: Resampler::resampleX(Image&, Image const&) const
void
Resampler::resampleX (Image& dst, const Image& src) const
{
  for (int32_t k = 0; k < dst.getHeight(); k++) {
    for (int32_t i = 0; i < dst.getWidth(); i++) {
      Color pixel;
      for (int c = 0; c < src.getNComps(); c++) {
        float weight = 0.0;
        for (int j = 0; j < contributor[i].n; j++) {
          weight +=
            src.getPixel(contributor[i].p[j].pixel, k).v[c] *
                                        contributor[i].p[j].weight;
        }
        pixel.v[c] = (uint16_t) MAP_IN_RANGE(weight, 0, 65535u);
      }
      dst.putPixel(i, k, pixel);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, (%rsp)
movl 0x4(%rsi), %ecx
testl %ecx, %ecx
jle 0x42c2
movq %rdx, %rbx
movq %rdi, %r15
movq (%rsp), %rax
movl (%rax), %eax
xorl %r12d, %r12d
testl %eax, %eax
jle 0x42b6
xorl %r13d, %r13d
cmpb $0x0, 0x8(%rbx)
jle 0x4289
movq 0x10(%r15), %rax
movq %r13, 0x20(%rsp)
movq %r13, %rbp
shlq $0x5, %rbp
xorl %r14d, %r14d
cmpl $0x0, (%rax,%rbp)
jle 0x4266
movq 0x8(%rax,%rbp), %rcx
xorps %xmm1, %xmm1
xorl %r13d, %r13d
movss %xmm1, 0xc(%rsp)
movl (%rcx,%r13,8), %esi
movq %rbx, %rdi
movl %r12d, %edx
callq 0x29f2
movss 0xc(%rsp), %xmm1
movq %rax, 0x10(%rsp)
movw %dx, 0x18(%rsp)
shrl $0x10, %edx
movb %dl, 0x1a(%rsp)
movzwl 0x10(%rsp,%r14,2), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movq 0x10(%r15), %rax
movq 0x8(%rax,%rbp), %rcx
mulss 0x4(%rcx,%r13,8), %xmm0
addss %xmm0, %xmm1
incq %r13
movslq (%rax,%rbp), %rdx
cmpq %rdx, %r13
jl 0x41f7
xorps %xmm0, %xmm0
ucomiss %xmm1, %xmm0
jae 0x4266
minss 0x1f4c(%rip), %xmm1     # 0x61ac
cvttss2si %xmm1, %ecx
jmp 0x4268
xorl %ecx, %ecx
movw %cx, 0x28(%rsp,%r14,2)
incq %r14
movsbq 0x8(%rbx), %rcx
cmpq %rcx, %r14
jl 0x41e6
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %r13
movl 0x30(%rsp), %r8d
movq (%rsp), %r14
movq %r14, %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0x2a3c
incq %r13
movslq (%r14), %rax
cmpq %rax, %r13
jl 0x41c9
movq (%rsp), %rcx
movl 0x4(%rcx), %ecx
incl %r12d
cmpl %ecx, %r12d
jl 0x41be
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/shirat74[P]resample/Resampler.cc
// Function: Resampler::resampleY(Image&, Image const&) const
void
Resampler::resampleY (Image& dst, const Image& src) const
{
  for (int32_t k = 0; k < dst.getWidth(); k++) {
    for (int32_t i = 0; i < dst.getHeight(); i++) {
      Color pixel;
      for (int c = 0; c < src.getNComps(); c++) {
        float weight = 0.0;
        for (int j = 0; j < contributor[i].n; j++) {
          weight +=
            src.getPixel(k, contributor[i].p[j].pixel).v[c] *
                                           contributor[i].p[j].weight;
        }
        pixel.v[c] = (uint16_t) MAP_IN_RANGE(weight, 0, 65535u);
      }
      dst.putPixel(k, i, pixel);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, (%rsp)
movl (%rsi), %ecx
testl %ecx, %ecx
jle 0x4402
movq %rdx, %rbx
movq %rdi, %r15
movq (%rsp), %rax
movl 0x4(%rax), %eax
xorl %r12d, %r12d
testl %eax, %eax
jle 0x43f6
xorl %r13d, %r13d
cmpb $0x0, 0x8(%rbx)
jle 0x43c9
movq 0x10(%r15), %rax
movq %r13, 0x20(%rsp)
movq %r13, %rbp
shlq $0x5, %rbp
xorl %r14d, %r14d
cmpl $0x0, (%rax,%rbp)
jle 0x43a6
movq 0x8(%rax,%rbp), %rcx
xorps %xmm1, %xmm1
xorl %r13d, %r13d
movss %xmm1, 0xc(%rsp)
movl (%rcx,%r13,8), %edx
movq %rbx, %rdi
movl %r12d, %esi
callq 0x29f2
movss 0xc(%rsp), %xmm1
movq %rax, 0x10(%rsp)
movw %dx, 0x18(%rsp)
shrl $0x10, %edx
movb %dl, 0x1a(%rsp)
movzwl 0x10(%rsp,%r14,2), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movq 0x10(%r15), %rax
movq 0x8(%rax,%rbp), %rcx
mulss 0x4(%rcx,%r13,8), %xmm0
addss %xmm0, %xmm1
incq %r13
movslq (%rax,%rbp), %rdx
cmpq %rdx, %r13
jl 0x4337
xorps %xmm0, %xmm0
ucomiss %xmm1, %xmm0
jae 0x43a6
minss 0x1e0c(%rip), %xmm1     # 0x61ac
cvttss2si %xmm1, %ecx
jmp 0x43a8
xorl %ecx, %ecx
movw %cx, 0x28(%rsp,%r14,2)
incq %r14
movsbq 0x8(%rbx), %rcx
cmpq %rcx, %r14
jl 0x4326
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %r13
movl 0x30(%rsp), %r8d
movq (%rsp), %r14
movq %r14, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x2a3c
incq %r13
movslq 0x4(%r14), %rax
cmpq %rax, %r13
jl 0x4309
movq (%rsp), %rcx
movl (%rcx), %ecx
incl %r12d
cmpl %ecx, %r12d
jl 0x42fe
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/shirat74[P]resample/Resampler.cc
// Function: Resampler::resampleImage(Image const&, float, float)
Image
Resampler::resampleImage (const Image& src, float xsize, float ysize)
{
  float xScale, yScale;

  Image dst((uint32_t) xsize, (uint32_t) ysize, src.getNComps(), src.getBPC());

  xScale = (float) xsize / (float) src.getWidth();
  yScale = (float) ysize / (float) src.getHeight();

  // create intermediate image to hold horizontal zoom
  Image tmp(dst.getWidth(), src.getHeight(), src.getNComps(), src.getBPC());
  if (xScale < 1.0)
    setupContributorForDownsample(xScale, dst.getWidth(), src.getWidth());
  else
    setupContributorForUpsample  (xScale, dst.getWidth(), src.getWidth());
  resampleX(tmp, src);

  if (yScale < 1.0)
    setupContributorForDownsample(yScale, dst.getHeight(), src.getHeight());
  else
    setupContributorForUpsample  (yScale, dst.getHeight(), src.getHeight());
  resampleY(dst, tmp);

  return  dst;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movss %xmm0, 0xc(%rsp)
cvttss2si %xmm0, %rsi
movss %xmm1, 0x4(%rsp)
cvttss2si %xmm1, %rdx
movsbl 0x8(%r15), %ecx
movsbl 0x9(%r15), %r8d
callq 0x260c
xorps %xmm0, %xmm0
cvtsi2ssl (%r15), %xmm0
movss %xmm0, 0x8(%rsp)
movl 0x4(%r15), %ebp
movl (%rbx), %esi
movsbl 0x8(%r15), %ecx
movsbl 0x9(%r15), %r8d
leaq 0x10(%rsp), %rdi
movl %ebp, %edx
callq 0x260c
movss 0xc(%rsp), %xmm0
divss 0x8(%rsp), %xmm0
movss 0x1d14(%rip), %xmm1     # 0x619c
ucomiss %xmm0, %xmm1
movl (%rbx), %esi
movl (%r15), %edx
jbe 0x449c
movq %r14, %rdi
callq 0x3db0
jmp 0x44a4
movq %r14, %rdi
callq 0x3fe2
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x4192
xorps %xmm0, %xmm0
cvtsi2ss %ebp, %xmm0
movss 0x4(%rsp), %xmm1
divss %xmm0, %xmm1
movaps %xmm1, %xmm0
movss 0x1ccc(%rip), %xmm1     # 0x619c
ucomiss %xmm0, %xmm1
movl 0x4(%rbx), %esi
movl 0x4(%r15), %edx
jbe 0x44e6
movq %r14, %rdi
callq 0x3db0
jmp 0x44ee
movq %r14, %rdi
callq 0x3fe2
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42d2
leaq 0x10(%rsp), %rdi
callq 0x29e4
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x4528
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x29e4
movq %rbx, %rdi
callq 0x29e4
movq %r14, %rdi
callq 0x2400
// File: /workspace/github_cpp_makefile_star2_O3/akw0088[P]openssl/aes_download_reverse.cpp
// Function: aes_decrypt(unsigned char*, unsigned char*, unsigned char*, unsigned int, unsigned int&, char*, char*)
int aes_decrypt(unsigned char *key, unsigned char *iv, unsigned char *ciphertext, unsigned int size, unsigned int &decryptedtext_len, char *remote_hash, char *filename)
{

	/* Buffer for the decrypted text */
	unsigned char *decryptedtext = (unsigned char *)malloc(size);
	if (decryptedtext == NULL)
	{
		perror("malloc failed");
		return -1;
	}

	unsigned int ciphertext_len = size;

	decryptedtext_len = decrypt(ciphertext, ciphertext_len, key, iv, decryptedtext);
	decryptedtext[decryptedtext_len] = '\0';

	char new_filename[256] = {0};



	unsigned char local_hash[33] = {0};

	md5sum((char *)decryptedtext, decryptedtext_len, (char *)&local_hash[0]);


	if (strcmp(remote_hash, (char *)&local_hash[0]) == 0)
	{
		printf("MD5 Hash Pass: %s\r\n", remote_hash);
	}
	else
	{
		printf("MD5 Hash Fail: local %s != remote %s\r\n", local_hash, remote_hash);
		free((void *)decryptedtext);
		return -1;
	}


	sprintf(new_filename, "%s_decrypted", filename);

	printf("Saving decrypted file as \"%s\"\r\n", new_filename);
	write_file(new_filename, (char *)decryptedtext, decryptedtext_len);
	free((void *)decryptedtext);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %r9, -0x30(%rbp)
movq %r8, -0x38(%rbp)
movl %ecx, %r13d
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r14
movl %ecx, %edi
callq 0x2270
testq %rax, %rax
je 0x2e09
movq %rax, %rbx
movq %r12, %rdi
movl %r13d, %esi
movq %r14, %rdx
movq %r15, %rcx
movq %rax, %r8
callq 0x2c23
movl %eax, %r14d
movq -0x38(%rbp), %r13
movl %eax, (%r13)
movl %eax, %eax
xorl %r15d, %r15d
movb %r15b, (%rbx,%rax)
leaq -0x160(%rbp), %rdi
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x2140
leaq -0x60(%rbp), %r12
movb %r15b, 0x20(%r12)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%r12)
movaps %xmm0, (%r12)
movq %rbx, %rdi
movl %r14d, %esi
movq %r12, %rdx
callq 0x2467
movq -0x30(%rbp), %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x2280
testl %eax, %eax
je 0x2d9c
leaq 0x3b1(%rip), %rdi       # 0x3137
leaq -0x60(%rbp), %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2050
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x2dec
movq %r14, %rsi
movq 0x10(%rbp), %r14
leaq 0x379(%rip), %rdi       # 0x3123
xorl %eax, %eax
callq 0x2050
leaq 0x3a6(%rip), %rsi       # 0x315e
leaq -0x160(%rbp), %r12
movq %r12, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2070
leaq 0x398(%rip), %rdi       # 0x316b
movq %r12, %rsi
xorl %eax, %eax
callq 0x2050
movl (%r13), %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x25be
movq %rbx, %rdi
callq 0x2230
movl %r15d, %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x276(%rip), %rdi       # 0x3086
callq 0x21b0
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x2df4
// File: /workspace/github_cpp_makefile_star2_O3/akw0088[P]openssl/aes_download_reverse.cpp
// Function: main
int main(int argc, char *argv[])
{
	unsigned short port = 65535;
	unsigned int max_malloc_size = 0;
	unsigned char encrypted_key[256] = {0};
	char remote_hash[33] = {0};

	if (argc < 4)
	{
		printf("Usage: aes_download_reverse port max_size prikey\r\n");
		printf("Example: ./aes_download_reverse 65535 70912 id_rsa\r\n");
		return 0;
	}

	port = atoi(argv[1]);
	max_malloc_size = atoi(argv[2]);

	unsigned int prikey_size = 0;
	unsigned char *prikey = (unsigned char *)get_file(argv[3], &prikey_size);


	printf("Waiting for download file on port %d\r\n", (int)port);
	int ret = aes_file_download_reverse(port, prikey, max_malloc_size);

	delete [] prikey;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x3, %edi
jg 0x2e46
leaq 0x50a(%rip), %rdi       # 0x333d
callq 0x22a0
leaq 0x530(%rip), %rdi       # 0x336f
callq 0x22a0
jmp 0x2ea7
movq %rsi, %rbx
movq 0x8(%rsi), %rdi
callq 0x22b0
movl %eax, %r14d
movq 0x10(%rbx), %rdi
callq 0x22b0
movl %eax, %r15d
leaq -0x1c(%rbp), %rsi
movl $0x0, (%rsi)
movq 0x18(%rbx), %rdi
callq 0x250c
movq %rax, %rbx
movzwl %r14w, %r14d
leaq 0x3cf(%rip), %rdi       # 0x3251
movl %r14d, %esi
xorl %eax, %eax
callq 0x2050
movl %r14d, %edi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x263b
testq %rbx, %rbx
je 0x2ea7
movq %rbx, %rdi
callq 0x2250
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq