LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/overfl0[P]iojack/processes.cpp
// Function: processInfo::readStrncpy(char*, unsigned long, unsigned int)
char *processInfo::readStrncpy(char *dest, unsigned long remoteAddr, unsigned int n)
{
    unsigned int i = 0;
    while(i < n)
    {
        //printf("Reading at %lx...\n", remoteAddr + i);
        unsigned long retval = ptrace(PTRACE_PEEKDATA, pid, remoteAddr + i, 0);
        if(retval == (unsigned long)-1 && errno != 0)
        {
            perror("readMemcpy - ptrace read");
            goto end; //FIXME: throw an exception or sumtin'
        }

        for(unsigned int j = 0; j < sizeof(unsigned long); j++, i++)
        {
            if(i >= n)
                goto end;

            *dest = ((char *)&retval)[j];
            if(*dest++ == '\0')
                goto end;
        }
    }

    end:
    for(;i < n; i++)
        *dest++ = '\0';

    return dest;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %r12
pushq $0x2
popq %rbp
xorl %r13d, %r13d
cmpl %ebx, %r13d
jae 0x43df
movl (%r12), %esi
movl %r13d, %edx
addq %r15, %rdx
movl %ebp, %edi
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x2140
movq %rax, (%rsp)
cmpq $-0x1, %rax
jne 0x4388
callq 0x2030
cmpl $0x0, (%rax)
jne 0x43c7
leaq 0x8(%r13), %rcx
xorl %eax, %eax
cmpq $0x8, %rax
je 0x43ac
leaq (%rax,%r13), %rdx
cmpl %ebx, %edx
jae 0x43b4
movb (%rsp,%rax), %dl
movb %dl, (%r14,%rax)
testb %dl, %dl
je 0x43bc
incq %rax
jmp 0x438e
addq %rax, %r14
movq %rcx, %r13
jmp 0x4356
addq %rax, %r14
movl %ebx, %r13d
jmp 0x43df
addq %rax, %r14
incq %r14
addl %eax, %r13d
jmp 0x43df
leaq 0x3590(%rip), %rdi      # 0x795e
callq 0x2130
jmp 0x43df
movb $0x0, (%r14)
incq %r14
incl %r13d
cmpl %ebx, %r13d
jb 0x43d5
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/overfl0[P]iojack/processes.cpp
// Function: processInfo::closeFileDescriptor(unsigned int)
void processInfo::closeFileDescriptor(unsigned int fd)
{
    if(isStdin(fd))
        stdin.erase(fd);

    if(isStdout(fd))
        stdout.erase(fd);

    if(isStderr(fd))
        stderr.erase(fd);
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
callq 0x4790
testb %al, %al
je 0x441d
leaq 0xf0(%rbx), %rdi
leaq 0x14(%rsp), %rsi
movl %ebp, (%rsi)
callq 0x4878
movq %rbx, %rdi
movl %ebp, %esi
callq 0x47c2
testb %al, %al
je 0x443e
leaq 0x120(%rbx), %rdi
leaq 0x10(%rsp), %rsi
movl %ebp, (%rsi)
callq 0x4878
movq %rbx, %rdi
movl %ebp, %esi
callq 0x47f4
testb %al, %al
je 0x4462
addq $0x150, %rbx            # imm = 0x150
leaq 0xc(%rsp), %rsi
movl %ebp, (%rsi)
movq %rbx, %rdi
callq 0x4878
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/overfl0[P]iojack/processes.cpp
// Function: processInfo::duplicateFileDescriptor(unsigned int, unsigned int)
void processInfo::duplicateFileDescriptor(unsigned int oldfd, unsigned int newfd)
{
    //printf("[%d] Duplicating descriptor: %u -> %u\n", pid, oldfd, newfd);
    if(isStdin(oldfd))
        stdin.insert(newfd);

    if(isStdout(oldfd))
        stdout.insert(newfd);

    if(isStderr(oldfd))
        stderr.insert(newfd);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
callq 0x4790
testb %al, %al
je 0x4495
leaq 0xf0(%r14), %rdi
leaq 0xc(%rsp), %rsi
movl %ebx, (%rsi)
callq 0x49fc
movq %r14, %rdi
movl %ebp, %esi
callq 0x47c2
testb %al, %al
je 0x44b6
leaq 0x120(%r14), %rdi
leaq 0x8(%rsp), %rsi
movl %ebx, (%rsi)
callq 0x49fc
movq %r14, %rdi
movl %ebp, %esi
callq 0x47f4
testb %al, %al
je 0x44da
addq $0x150, %r14            # imm = 0x150
leaq 0x4(%rsp), %rsi
movl %ebx, (%rsi)
movq %r14, %rdi
callq 0x49fc
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/overfl0[P]iojack/processes.cpp
// Function: processInfo::detachProcess()
void processInfo::detachProcess()
{
    printf("Detaching %d... ", pid);
    int retval = ptrace(PTRACE_DETACH, pid, NULL, NULL);
    if(retval == -1)
    {
        printf("Failed! ");
        printPtraceError(errno);
        perror("Detach failed");
    }
    else
    {
        printf("OK!\n");
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %esi
leaq 0x34f4(%rip), %rdi      # 0x79e5
xorl %eax, %eax
callq 0x2040
movl (%rbx), %esi
pushq $0x11
popq %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x2140
cmpl $-0x1, %eax
je 0x451a
leaq 0x358e(%rip), %rdi      # 0x7aa2
popq %rbx
jmp 0x22c0
leaq 0x34d5(%rip), %rdi      # 0x79f6
xorl %eax, %eax
callq 0x2040
callq 0x2030
movl (%rax), %edi
callq 0x4541
leaq 0x34c4(%rip), %rdi      # 0x79ff
popq %rbx
jmp 0x2130
// File: /workspace/github_cpp_makefile_star2_O2/overfl0[P]iojack/syscalls.cpp
// Function: fakedReadHook(processInfo*, user_regs_struct&, int&, int&)
void fakedReadHook(processInfo *pi, user_regs_struct &regs, int &saveRegs, int &unused)
{
    //ssize_t read(int fd, void *buf, size_t count);
    //eax read(ebx fd, ecx *buf, edx count);
    unsigned int len = inputBuffer.lockedSize();
    if(regs.ARG3 < len)
        len = regs.ARG3;

    inputBuffer.lock();
    for(unsigned int i = 0; i < len; i++)
    {
        char c = inputBuffer.get();
        pi->writeChar(regs.ARG2 + i, c);
    }
    inputBuffer.unlock();
    regs.RAX = len;

    saveRegs = 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x6626(%rip), %r12      # 0xb280
movq %r12, %rdi
callq 0x3b5c
movq 0x60(%r14), %r13
movl %eax, %ecx
cmpq %rcx, %r13
cmovael %eax, %r13d
movq %r12, %rdi
callq 0x3a9e
xorl %ebp, %ebp
cmpq %rbp, %r13
je 0x4c9d
movq %r12, %rdi
callq 0x3b8c
movq 0x68(%r14), %rsi
addq %rbp, %rsi
movzbl %al, %edx
movq %r15, %rdi
callq 0x4160
incq %rbp
jmp 0x4c79
leaq 0x65dc(%rip), %rdi      # 0xb280
callq 0x3aa8
movq %r13, 0x50(%r14)
movl $0x1, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/overfl0[P]iojack/syscalls.cpp
// Function: preWriteHook(processInfo*, user_regs_struct&, int&, int&)
void preWriteHook(processInfo *pi, user_regs_struct &regs, int &saveRegs, int &fakeSyscall)
{
    // ssize_t write(int fd, const void *buf, size_t count);
    //ssize_t retval = write(regs.ARG1, regs.ARG2, regs.ARG3);
    //write(stdout, regs.ARG2, regs.ARG3);
    dprintf("Got a write syscall!\n");
    dprintf("fd = %d\n", (int)regs.ARG1);
    if(pi->isStdout(regs.ARG1) || pi->isStderr(regs.ARG1))
    {
        for(unsigned int i = 0; i < regs.ARG3; i++)
        {
            unsigned long c = pi->getValue(regs.ARG2 + i);
            dprintf("Wrote letter: ");
            printf("%c", (int)c);
            //printf("0x%02x (%c)\n", (unsigned char)c, (unsigned char)c);
            dprintf("\n");
        }
        fflush(stdout);
    }

    //return retval;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl 0x70(%rsi), %esi
callq 0x47c2
testb %al, %al
jne 0x4ce8
movl 0x70(%rbx), %esi
movq %r14, %rdi
callq 0x47f4
testb %al, %al
je 0x4d23
xorl %eax, %eax
movl %eax, %r15d
cmpq %r15, 0x60(%rbx)
jbe 0x4d0f
movq %r15, %rsi
addq 0x68(%rbx), %rsi
movq %r14, %rdi
callq 0x40b4
movl %eax, %edi
callq 0x2240
leal 0x1(%r15), %eax
jmp 0x4cea
movq 0x62b2(%rip), %rax      # 0xafc8
movq (%rax), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x21e0
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/overfl0[P]iojack/syscalls.cpp
// Function: preSelectHook(processInfo*, user_regs_struct&, int&, int&)
void preSelectHook(processInfo *pi, user_regs_struct &regs, int &saveRegs, int &fakeSyscall)
{
    //int maxDwords = sizeof(fd_set) / sizeof(__fd_mask);
    //printf("MaxDwords: %d\n", maxDwords);
    fd_set inSet;
    if(regs.ARG2 && inputBuffer.lockedSize() && pi->stdin.size())
    {
        pi->readMemcpy(&inSet, regs.ARG2, sizeof(fd_set));
        foreach(pi->stdin, it)
            if(FD_ISSET(*it, &inSet))
            {
                fakeSyscall = 1;
                return;
            }
    }
}

// Assembly:
cmpq $0x0, 0x68(%rsi)
je 0x4dc0
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rcx, %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x652f(%rip), %rdi      # 0xb280
callq 0x3b5c
testl %eax, %eax
je 0x4db3
cmpq $0x0, 0x118(%r14)
je 0x4db3
movq 0x68(%r15), %rdx
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
movl $0x80, %ecx
callq 0x4192
movq 0x108(%r14), %rdi
addq $0xf8, %r14
pushq $0x40
popq %rbp
cmpq %r14, %rdi
je 0x4db3
movl 0x20(%rdi), %eax
cltd
idivl %ebp
cltq
movq 0x8(%rsp,%rax,8), %rax
btq %rdx, %rax
jb 0x4dad
callq 0x21d0
movq %rax, %rdi
jmp 0x4d8b
movl $0x1, (%rbx)
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/overfl0[P]iojack/syscalls.cpp
// Function: prePollHook(processInfo*, user_regs_struct&, int&, int&)
void prePollHook(processInfo *pi, user_regs_struct &regs, int &saveRegs, int &fakeSyscall)
{
    // int poll(struct pollfd *fds, nfds_t nfds, int timeout);
    if(regs.ARG2 && inputBuffer.lockedSize() && pi->stdin.size())
    {
        pollfd fds[regs.ARG2];
        pi->readMemcpy(&fds, regs.ARG1, regs.ARG2 * sizeof(pollfd));

        for(unsigned int i = 0; i < regs.ARG2; i++)
        {
            if(pi->isStdin(fds[i].fd) && (fds[i].events & POLLIN))
            {
                fakeSyscall = 1;
                return;
            }
        }
    }
}

// Assembly:
cmpq $0x0, 0x68(%rsi)
je 0x5030
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x62d7(%rip), %rdi      # 0xb280
callq 0x3b5c
testl %eax, %eax
je 0x5022
cmpq $0x0, 0x118(%r15)
je 0x5022
movq %rsp, -0x30(%rbp)
movq 0x68(%r14), %rax
movq %rsp, %r12
leaq 0xf(,%rax,8), %rax
andq $-0x10, %rax
subq %rax, %r12
movq %r12, %rsp
movq 0x70(%r14), %rdx
movl 0x68(%r14), %ecx
shll $0x3, %ecx
movq %r15, %rdi
movq %r12, %rsi
callq 0x4192
xorl %r13d, %r13d
movl %r13d, %r13d
cmpq %r13, 0x68(%r14)
jbe 0x501e
movl (%r12,%r13,8), %esi
movq %r15, %rdi
callq 0x4790
testb %al, %al
je 0x5013
testb $0x1, 0x4(%r12,%r13,8)
jne 0x5018
incl %r13d
jmp 0x4ff2
movl $0x1, (%rbx)
movq -0x30(%rbp), %rsp
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/overfl0[P]iojack/syscalls.cpp
// Function: fakePollHook(processInfo*, user_regs_struct&, int&, int&)
void fakePollHook(processInfo *pi, user_regs_struct &regs, int &saveRegs, int &unused)
{
    regs.RAX = 0;

    if(regs.ARG2 && inputBuffer.lockedSize())
    {
        pollfd fds[regs.ARG2];
        pi->readMemcpy(&fds, regs.ARG1, regs.ARG2 * sizeof(pollfd));

        for(unsigned int i = 0; i < regs.ARG2; i++)
        {
            fds[i].revents = 0;

            if(pi->isStdin(fds[i].fd) && (fds[i].events & POLLIN))
            {
                fds[i].revents = POLLIN;
                regs.RAX += 1;
                // Maybe force all other revents to 0 now that we've found one valid stdin fd?
            }
        }

        pi->writeMemcpy(regs.ARG1, &fds, regs.ARG2 * sizeof(pollfd));
    }

    saveRegs = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
andq $0x0, 0x50(%rsi)
movq %rdx, %rbx
cmpq $0x0, 0x68(%rsi)
je 0x50f4
movq %rsi, %r15
movq %rdi, %r14
leaq 0x6221(%rip), %rdi      # 0xb280
callq 0x3b5c
testl %eax, %eax
je 0x50f4
movq %rsp, -0x30(%rbp)
movq 0x68(%r15), %rax
movq %rsp, %r12
leaq 0xf(,%rax,8), %rax
andq $-0x10, %rax
subq %rax, %r12
movq %r12, %rsp
movq 0x70(%r15), %rdx
movl 0x68(%r15), %ecx
shll $0x3, %ecx
movq %r14, %rdi
movq %r12, %rsi
callq 0x4192
xorl %r13d, %r13d
movl %r13d, %r13d
movq 0x68(%r15), %rcx
cmpq %r13, %rcx
jbe 0x50de
andw $0x0, 0x6(%r12,%r13,8)
movl (%r12,%r13,8), %esi
movq %r14, %rdi
callq 0x4790
testb %al, %al
je 0x50d9
testb $0x1, 0x4(%r12,%r13,8)
je 0x50d9
movw $0x1, 0x6(%r12,%r13,8)
incq 0x50(%r15)
incl %r13d
jmp 0x50a2
movq 0x70(%r15), %rsi
shll $0x3, %ecx
movq %r14, %rdi
movq %r12, %rdx
callq 0x425a
movq -0x30(%rbp), %rsp
movl $0x1, (%rbx)
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/overfl0[P]iojack/syscalls.cpp
// Function: postDup2Hook(processInfo*, user_regs_struct&, int&, int&)
void postDup2Hook(processInfo *pi, user_regs_struct &regs, int &saveRegs, int &unused)
{
    //printf("[%d] Got dup2(%lu, %lu) syscall! (returned: %d)\n", pi->pid, pi->orig_regs.ARG1, pi->orig_regs.ARG2, (int)regs.RAX);
    if((int)regs.RAX == -1)
        return;

    if(pi->orig_regs.ARG1 == pi->orig_regs.ARG2)
        return; // Do nothing as per the man page

    pi->closeFileDescriptor(pi->orig_regs.ARG2);

    //TODO: check the man for FD_CLOEXEC
    pi->duplicateFileDescriptor(pi->orig_regs.ARG1, pi->orig_regs.ARG2);
}

// Assembly:
pushq %rbx
cmpl $-0x1, 0x50(%rsi)
je 0x5149
movq %rdi, %rbx
movq 0x80(%rdi), %rsi
cmpq %rsi, 0x88(%rdi)
jne 0x514b
popq %rbx
retq
movq %rbx, %rdi
callq 0x43f6
movl 0x80(%rbx), %edx
movl 0x88(%rbx), %esi
movq %rbx, %rdi
popq %rbx
jmp 0x446a
// File: /workspace/github_cpp_makefile_star2_O2/overfl0[P]iojack/syscalls.cpp
// Function: postOpenHook(processInfo*, user_regs_struct&, int&, int&)
void postOpenHook(processInfo *pi, user_regs_struct &regs, int &saveRegs, int &unused)
{
    //printf("[%d] Got open(%lx, %lu, %lu) syscall! (returned: %d)\n", pi->pid, pi->orig_regs.ARG1, pi->orig_regs.ARG2, pi->orig_regs.ARG3, (int)regs.RAX);
    if((int)regs.RAX < 0)
        return;

    #define MAX_FILE_LEN 100
    char fileName[MAX_FILE_LEN + 1];
    pi->readStrncpy(fileName, pi->orig_regs.ARG1, MAX_FILE_LEN);
    fileName[MAX_FILE_LEN] = '\0';
    #undef MAX_FILE_LEN

    //printf("[%d] open(%s) = %d\n", pi->pid, fileName, (int)regs.RAX);

    // Check if opening a terminal
    if(!strncmp(fileName, "/dev/pts/", strlen("/dev/pts/"))
    || !strncmp(fileName, "/dev/tty",  strlen("/dev/tty")))
    {
        if((pi->orig_regs.ARG2 & 3) == O_RDONLY || (pi->orig_regs.ARG2 & 3) == O_RDWR)
        {
            pi->stdin.insert(regs.RAX);
        }

        if((pi->orig_regs.ARG2 & 3) == O_WRONLY || (pi->orig_regs.ARG2 & 3) == O_RDWR)
        {
            pi->stdout.insert(regs.RAX);
            pi->stderr.insert(regs.RAX);
        }
    }
}

// Assembly:
testb $-0x80, 0x53(%rsi)
jne 0x5296
pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x88(%rdi), %rdx
leaq 0x10(%rsp), %r15
pushq $0x64
popq %rcx
movq %r15, %rsi
callq 0x433a
movb $0x0, 0x64(%r15)
leaq 0x2830(%rip), %rsi      # 0x7a2f
pushq $0x9
popq %rdx
movq %r15, %rdi
callq 0x2190
testl %eax, %eax
je 0x521f
movabsq $0x7974742f7665642f, %rax # imm = 0x7974742F7665642F
cmpq %rax, 0x10(%rsp)
jne 0x528a
movq 0x80(%rbx), %rax
testb $0x1, %al
jne 0x5248
leaq 0xf0(%rbx), %rdi
movl 0x50(%r14), %eax
leaq 0xc(%rsp), %rsi
movl %eax, (%rsi)
callq 0x49fc
movq 0x80(%rbx), %rax
andl $0x3, %eax
decq %rax
cmpq $0x1, %rax
ja 0x528a
leaq 0x120(%rbx), %rdi
movl 0x50(%r14), %eax
leaq 0xc(%rsp), %r15
movl %eax, (%r15)
movq %r15, %rsi
callq 0x49fc
addq $0x150, %rbx            # imm = 0x150
movl 0x50(%r14), %eax
movl %eax, (%r15)
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x49fc
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/overfl0[P]iojack/syscalls.cpp
// Function: initSyscallHooks()
void initSyscallHooks()
{
    setPreHook  (SYS_write,    preWriteHook);
    setPreHook  (SYS_read,     preReadHook);
    setFakedHook(SYS_read,     fakedReadHook);
    setPreHook(SYS_select,     preSelectHook);
    setFakedHook(SYS_select,   fakeSelectHook);
    setPreHook(SYS_pselect6,   preSelectHook);  // like select() but atomically sets and
    setFakedHook(SYS_pselect6, fakeSelectHook); // unsets sigprocmask() before and after select()
    setPreHook  (SYS_poll,     prePollHook);
    setFakedHook(SYS_poll,     fakePollHook);
    setPostHook (SYS_close,    postCloseHook);
    setPostHook (SYS_dup,      postDupHook);
    setPostHook (SYS_dup2,     postDup2Hook);
    setPostHook (SYS_dup3,     postDup3Hook);
    setPostHook (SYS_fcntl,    postFcntlHook);
    setPostHook (SYS_open,     postOpenHook);
    setPostHook (SYS_ioctl,    postIoctlHook);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
leaq -0x664(%rip), %rsi      # 0x4cc2
pushq $0x1
popq %rdi
callq 0x4ba8
leaq -0x730(%rip), %rsi      # 0x4c05
xorl %edi, %edi
callq 0x4ba8
leaq -0x704(%rip), %rsi      # 0x4c3f
xorl %edi, %edi
callq 0x4bb9
leaq -0x628(%rip), %rbx      # 0x4d29
pushq $0x17
popq %rbp
movl %ebp, %edi
movq %rbx, %rsi
callq 0x4ba8
leaq -0x5a4(%rip), %r14      # 0x4dc1
movl %ebp, %edi
movq %r14, %rsi
callq 0x4bb9
movl $0x10e, %edi            # imm = 0x10E
movq %rbx, %rsi
callq 0x4ba8
movl $0x10e, %edi            # imm = 0x10E
movq %r14, %rsi
callq 0x4bb9
leaq -0x410(%rip), %rsi      # 0x4f80
pushq $0x7
popq %rbx
movl %ebx, %edi
callq 0x4ba8
leaq -0x370(%rip), %rsi      # 0x5031
movl %ebx, %edi
callq 0x4bb9
leaq -0x2a6(%rip), %rsi      # 0x5109
pushq $0x3
popq %rdi
callq 0x4bca
leaq -0x2a3(%rip), %rsi      # 0x511b
pushq $0x20
popq %rdi
callq 0x4bca
leaq -0x29e(%rip), %rsi      # 0x512f
pushq $0x21
popq %rdi
callq 0x4bca
leaq -0x274(%rip), %rsi      # 0x5168
movl $0x124, %edi            # imm = 0x124
callq 0x4bca
leaq -0x25a(%rip), %rsi      # 0x5193
pushq $0x48
popq %rdi
callq 0x4bca
leaq -0x23c(%rip), %rsi      # 0x51c0
pushq $0x2
popq %rdi
callq 0x4bca
leaq -0x174(%rip), %rsi      # 0x5297
pushq $0x10
popq %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x4bca
nop
// File: /workspace/github_cpp_makefile_star2_O2/overfl0[P]iojack/syscalls.cpp
// Function: setHook(std::vector<void (*)(processInfo*, user_regs_struct&, int&, int&), std::allocator<void (*)(processInfo*, user_regs_struct&, int&, int&)>>&, int, void (*)(processInfo*, user_regs_struct&, int&, int&))
inline void setHook(vector<hookPtr> &v, int syscall, hookPtr ptr)
{
    if(syscall < 0)
        return; // Fail silently. Who told you to hook negative syscalls?

    if(v.size() <= (unsigned int)syscall)
    {
        v.resize(syscall + 1, NULL);
    }
    v[syscall] = ptr;
}

// Assembly:
testl %esi, %esi
js 0x5469
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rdi, %r14
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movl %esi, %r15d
cmpq %r15, %rcx
ja 0x545c
incl %esi
leaq 0x8(%rsp), %rdx
andq $0x0, (%rdx)
movq %r14, %rdi
callq 0x548c
movq (%r14), %rax
movq %rbx, (%rax,%r15,8)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/overfl0[P]iojack/syscalls.cpp
// Function: getHook(std::vector<void (*)(processInfo*, user_regs_struct&, int&, int&), std::allocator<void (*)(processInfo*, user_regs_struct&, int&, int&)>>&, int)
inline hookPtr getHook(vector<hookPtr> &v, int syscall)
{
    if(syscall < 0 || v.size() <= (unsigned int)syscall)
        return NULL;
    return v[syscall];
    /* This version, while pretty, REALLY sucks performance-wise!
    try
    {
        return v.at(syscall);
    } catch(std::out_of_range e)
    {
        return NULL;
    }*/
}

// Assembly:
testl %esi, %esi
js 0x5488
movq (%rdi), %rax
movq 0x8(%rdi), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movl %esi, %ecx
cmpq %rcx, %rdx
jbe 0x5488
movq (%rax,%rcx,8), %rax
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH15_ObjectOrientedProgramming/examples/virtualsNscope.cc
// Function: main
int main()
{
    D1 dobj, *dp = &dobj;
    dp->fcn(42); // ok: static call to D1::fcn(int)

    Base bobj;  D1 d1obj; D2 d2obj;

    Base *bp1 = &bobj, *bp2 = &d1obj, *bp3 = &d2obj;
    bp1->fcn(); // virtual call, will call Base::fcn at run time
    bp2->fcn(); // virtual call, will call Base::fcn at run time
    bp3->fcn(); // virtual call, will call D2::fcn at run time

	D1 *d1p = &d1obj; D2 *d2p = &d2obj;
	d1p->f2(); // virtual call, will call D1::f2() at run time
	d2p->f2(); // virtual call, will call D2::f2() at run time
	Base *p1 = &d2obj; D1 *p2 = &d2obj; D2 *p3 =  &d2obj;
	p2->fcn(42);  // statically bound, calls D1::fcn(int)
	p3->fcn(42);  // statically bound, calls D2::fcn(int)

    Base* bp = &d1obj; D1 *dp1 = &d2obj; D2 *dp2 = &d2obj;
    dp1->fcn(10); // static call to D1::fcn(int)
    dp2->fcn(10); // static call to D2::fcn(int)
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
callq 0x11d0
leaq 0x2aca(%rip), %rax      # 0x3d58
leaq -0x10(%rbp), %rbx
movq %rax, (%rbx)
callq 0x11ac
callq 0x11ac
callq 0x1238
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
callq 0x125c
callq 0x11d0
callq 0x1214
callq 0x11d0
callq 0x1214
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/syzcch[P]FEC_C_version/fec_rdp.cpp
// Function: main
int main() {

	const int NUM = 6;
	int err[NUM];

	printf("starting");
	rdp *rdpItem = new rdp();

	rdpItem->setData();
	rdpItem->encoding();
	rdpItem->outputData();
	
	for(int i=0;i<NUM;i++){
		err[i] = 0;
	}

	err[5]=1;

	rdpItem->setErrData(err);
	
	// testing one error, error disk sequence number is 3, r checkout disk is not broken
//		rdpItem->decoding(1, 3, -1, false);
//		rdpItem->outputOrigin();
	
	// testing one error, error disk sequence number is 1, r checkout disk is  broken
//	rdpItem->decoding(1, 2, -1, false);
	rdpItem->decoding();
	rdpItem->outputOrigin();
	
	// testing 2 error, the error disks sequence number is 0 and 3, r checkout disk is not broken
//	rdpItem->decoding(2, 1, 3, true);
//	rdpItem->outputOrigin();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
leaq 0x1dc6(%rip), %rdi      # 0x3004
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x1030
pushq $0x40
popq %rdi
callq 0x1090
movq %rax, %rbx
movq %rax, %rdi
callq 0x12b8
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x30(%rax)
cmpq $0x6, %r14
je 0x1287
andl $0x0, -0x30(%rbp,%r14,4)
incq %r14
jmp 0x1276
leaq -0x30(%rbp), %rsi
movl $0x1, 0x14(%rsi)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x28(%rax)
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Cristian-Castillo[P]Multithreaded-HTTP-Server/./httpserver_definitions.cpp
// Function: f_getopt(int, char**, command_line_inputs*)
void f_getopt(int argc, char *argv[], struct command_line_inputs *configs){

    int option;
    /* Make sure the -N flag followed by a number is utitlized correctly and only once */
    int Nflag = 0; 
    /* Make sure the -r flag is utlizied correctly and only once */
    int Rflag = 0; 

    configs->N_threads = 4;
    configs->Redundancy = 0;
    while((option = getopt(argc, argv, "rN:")) != -1){

        switch(option){
            case 'N':
                if(Nflag == 1){
                    fprintf(stderr, "Error: same flag used twice.\n");
                    exit(EXIT_FAILURE);
                }
                else{
                    if(atoi(optarg) == 0){
                        fprintf(stderr, "Usage: (-N <integer>).\n");
                        exit(EXIT_FAILURE);
                    }
                    configs->N_threads = atoi(optarg);
                    Nflag += 1;
                }
                continue;
            case 'r':
                if(Rflag == 1){
                    fprintf(stderr, "Error: same flag used twice.\n");
                    exit(EXIT_FAILURE);
                }
                else{
                    configs->Redundancy = 1;
                    Rflag += 1;
                }
                
                continue;
            default: /* '?' */
                fprintf(stderr, "Options:(-r) or (-N <integer>). \n");
                exit(EXIT_FAILURE);
        }
    }
    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
movq $0x4, (%rdx)
xorl %r12d, %r12d
movb $0x1, %al
movl %eax, 0x4(%rsp)
leaq 0xe852(%rip), %r15      # 0x130f8
pushq $0x1
popq %r13
movl %ebp, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x40a0
cmpl $0x72, %eax
jne 0x48cd
testl %r12d, %r12d
jne 0x490c
movl $0x1, 0x4(%rbx)
movl %r13d, %r12d
jmp 0x48aa
cmpl $-0x1, %eax
je 0x48fd
cmpl $0x4e, %eax
jne 0x4921
testb $0x1, 0x4(%rsp)
je 0x490c
movq 0x1a6bb(%rip), %rax     # 0x1efa0
movq (%rax), %rdi
callq 0x45c0
testl %eax, %eax
je 0x4945
movl %eax, (%rbx)
movl $0x0, 0x4(%rsp)
jmp 0x48aa
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1a6b5(%rip), %rax     # 0x1efc8
movq (%rax), %rcx
leaq 0xe7df(%rip), %rdi      # 0x130fc
pushq $0x1d
jmp 0x4934
movq 0x1a6a0(%rip), %rax     # 0x1efc8
movq (%rax), %rcx
leaq 0xe800(%rip), %rdi      # 0x13132
pushq $0x21
popq %rsi
pushq $0x1
popq %rdx
callq 0x46f0
pushq $0x1
popq %rdi
callq 0x4450
movq 0x1a67c(%rip), %rax     # 0x1efc8
movq (%rax), %rcx
leaq 0xe7c4(%rip), %rdi      # 0x1311a
pushq $0x17
jmp 0x4934
// File: /workspace/github_cpp_makefile_star2_O2/Cristian-Castillo[P]Multithreaded-HTTP-Server/./httpserver_definitions.cpp
// Function: f_bool_check_vitality(char*, char*, char*, int)
bool f_bool_check_vitality(char *file_name,char *protocol,char *request,int client_connect){

        /* Do you have rights to the goods ? */
        bool check_file_access = f_bool_permissions(file_name);
        /* Check length of file must be = 10 ASCII */
        bool check_file_length = f_bool_check_file_len(file_name);
        /* Checking valid resource names A-Z/a-z/0-9 */
        bool check_file_format = f_bool_check_file(file_name);
        /* Check file permissions */
        bool check_request = f_bool_check_request(request);
        /* Check HTTP/1.1 version */
        bool check_protocol = check_http_protocol(protocol);

        if(check_file_access == false){
            f_void_client_error_forbid(client_connect);
            return false;
        }
        else if(check_file_length == false){
            f_void_400(client_connect);
            return false;
        }
        else if(check_file_format == false){
            f_void_400(client_connect);
            return false;
        }
        else if(check_request == false){
            f_void_400(client_connect);
            return false;
        }
        else if(check_protocol == false){
            f_void_400(client_connect);
            return false;
        }
        else {return true;}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
callq 0x49dd
movl %eax, %r13d
movq %r14, %rdi
callq 0x4a0d
movl %eax, %ebp
movq %r14, %rdi
callq 0x4a33
movl %eax, %r14d
movq %r15, %rdi
callq 0x4a80
movl %eax, %r15d
movq %r12, %rdi
callq 0x4aaf
testb %r13b, %r13b
je 0x49c5
testb %bpl, %bpl
je 0x49bc
testb %r14b, %r14b
je 0x49bc
testb %r15b, %r15b
je 0x49bc
movl %eax, %ecx
movb $0x1, %al
testb %cl, %cl
jne 0x49ce
movl %ebx, %edi
callq 0x4ad1
jmp 0x49cc
movl %ebx, %edi
callq 0x4ac3
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Cristian-Castillo[P]Multithreaded-HTTP-Server/./httpserver_definitions.cpp
// Function: f_bool_permissions(char*)
bool f_bool_permissions(char *file_name){

    struct stat is_file_allowed;
    stat(file_name,&is_file_allowed);

    if(errno != ENOENT && (is_file_allowed.st_mode & S_IWUSR) != S_IWUSR ){ return false;}
    else{ return true;}
}

// Assembly:
subq $0x98, %rsp
leaq 0x8(%rsp), %rsi
callq 0x4340
callq 0x4050
cmpl $0x2, (%rax)
je 0x4a03
testb $-0x80, 0x20(%rsp)
jne 0x4a03
xorl %eax, %eax
jmp 0x4a05
movb $0x1, %al
addq $0x98, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Cristian-Castillo[P]Multithreaded-HTTP-Server/./httpserver_definitions.cpp
// Function: f_bool_check_file(char*)
bool f_bool_check_file(char *parseFile){
    for(size_t i = 0; i < strlen(parseFile); i++){
        if((parseFile[i] >= 'A' && parseFile[i] <= 'Z') || (parseFile[i] >= 'a' && parseFile[i] <= 'z') || (parseFile[i] <= '9' && parseFile[i] >= '0')){continue;}
        else{
            perror("Invalid file format name. Try accepted file format range: A-Z, a-z, 0-9.\n");
            return false;
        }
    }
    return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
callq 0x4190
movq %rax, %rbx
xorl %eax, %eax
movq %rax, %r15
cmpq %rax, %rbx
je 0x4a74
movb (%r14,%r15), %cl
leal -0x30(%rcx), %edx
leaq 0x1(%r15), %rax
cmpb $0xa, %dl
jb 0x4a45
andb $-0x21, %cl
addb $-0x41, %cl
cmpb $0x1a, %cl
jb 0x4a45
leaq 0xe6ed(%rip), %rdi      # 0x1315c
callq 0x4310
cmpq %rbx, %r15
setae %al
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Cristian-Castillo[P]Multithreaded-HTTP-Server/./httpserver_definitions.cpp
// Function: f_void_socket_error(int)
void f_void_socket_error(int int_socket){

    if(int_socket < 0){

        if(errno == ENOTCONN){
        /* Socket is not connected */
            fprintf(stderr, "Socket not connected: %s\n", strerror(errno));
            close(int_socket);
            exit(EXIT_FAILURE);

        }
        else if(errno == EINTR){
        /* interrupted sytem call */
            fprintf(stderr, "Interrupted system call: %s\n", strerror(errno));
            close(int_socket);
            exit(EXIT_FAILURE);
        }
        else if(errno == ENOTSOCK){
        /* Not a socket */
            fprintf(stderr, "Not a socket: %s\n", strerror(errno));
            close(int_socket);
            exit(EXIT_FAILURE);
        }
        else if(errno == EOPNOTSUPP){
        /*Operation not supported on socket */
            fprintf(stderr, "Operation not supported on socket: %s\n", strerror(errno));
            close(int_socket);
            exit(EXIT_FAILURE);
        }
        else{
        perror("Socket operation failed\n");
        close(int_socket);
        exit(EXIT_FAILURE);
        }
    }
    else{
        perror("Socket operation failed\n");
        close(int_socket);
        exit(EXIT_FAILURE);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
testl %edi, %edi
jns 0x4b34
callq 0x4050
movl (%rax), %eax
cmpl $0x4, %eax
je 0x4b78
cmpl $0x58, %eax
je 0x4b42
cmpl $0x5f, %eax
je 0x4b5d
cmpl $0x6b, %eax
jne 0x4b34
movq 0x1a4a8(%rip), %rax     # 0x1efc8
movq (%rax), %r14
pushq $0x6b
popq %rdi
callq 0x4110
leaq 0xe73f(%rip), %rsi      # 0x13271
jmp 0x4b91
leaq 0xe7a6(%rip), %rdi      # 0x132e1
callq 0x4310
jmp 0x4b9e
movq 0x1a47f(%rip), %rax     # 0x1efc8
movq (%rax), %r14
pushq $0x58
popq %rdi
callq 0x4110
leaq 0xe74d(%rip), %rsi      # 0x132a8
jmp 0x4b91
movq 0x1a464(%rip), %rax     # 0x1efc8
movq (%rax), %r14
pushq $0x5f
popq %rdi
callq 0x4110
leaq 0xe744(%rip), %rsi      # 0x132ba
jmp 0x4b91
movq 0x1a449(%rip), %rax     # 0x1efc8
movq (%rax), %r14
pushq $0x4
popq %rdi
callq 0x4110
leaq 0xe6fa(%rip), %rsi      # 0x1328b
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x4540
movl %ebx, %edi
callq 0x4700
pushq $0x1
popq %rdi
callq 0x4450
// File: /workspace/github_cpp_makefile_star2_O2/Cristian-Castillo[P]Multithreaded-HTTP-Server/./httpserver_definitions.cpp
// Function: f_void_setsocket_error(int)
void f_void_setsocket_error(int int_setsocket){

    if(int_setsocket < 0){

        if(errno == EBADF){
            fprintf(stderr, "Argument socket is not a valid descriptor.: %s\n", strerror(errno));
            close(int_setsocket);
            exit(EXIT_FAILURE);
        }
        else if(errno == ENOTSOCK){
            fprintf(stderr, "Argument sockfd is a file, not a socket.: %s\n", strerror(errno));
            close(int_setsocket);
            exit(EXIT_FAILURE);
        }
        else{
            perror("Set Socket operation failure\n");
            close(int_setsocket);
            exit(EXIT_FAILURE);
        }
    }
    else{
        perror("Set Socket operation failure\n");
        close(int_setsocket);
        exit(EXIT_FAILURE);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
testl %edi, %edi
jns 0x4be3
callq 0x4050
movl (%rax), %eax
cmpl $0x58, %eax
je 0x4bf1
cmpl $0x9, %eax
jne 0x4be3
movq 0x1a3f9(%rip), %rax     # 0x1efc8
movq (%rax), %r14
pushq $0x9
popq %rdi
callq 0x4110
leaq 0xe719(%rip), %rsi      # 0x132fa
jmp 0x4c0a
leaq 0xe76e(%rip), %rdi      # 0x13358
callq 0x4310
jmp 0x4c17
movq 0x1a3d0(%rip), %rax     # 0x1efc8
movq (%rax), %r14
pushq $0x58
popq %rdi
callq 0x4110
leaq 0xe720(%rip), %rsi      # 0x1332a
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x4540
movl %ebx, %edi
callq 0x4700
pushq $0x1
popq %rdi
callq 0x4450
// File: /workspace/github_cpp_makefile_star2_O2/Cristian-Castillo[P]Multithreaded-HTTP-Server/./httpserver_definitions.cpp
// Function: f_void_bind_error(int)
void f_void_bind_error(int bind){

    if(bind < 0){

        if(errno == EADDRINUSE){
            fprintf(stderr, "The given address is already in use.: %s\n", strerror(errno));
            close(bind);
            exit(EXIT_FAILURE);
        }
        else if(errno == EBADF){
            fprintf(stderr, "Socket is not a valid file descriptor: %s\n", strerror(errno));
            close(bind);
            exit(EXIT_FAILURE);
        }
        else if(errno == ENOTSOCK){
            fprintf(stderr, "The file descriptor sockfd does not refer to a socket.: %s\n", strerror(errno));
            close(bind);
            exit(EXIT_FAILURE);
        }
        else if(errno == EINVAL){
            fprintf(stderr, "The socket is already bound to an address.: %s\n", strerror(errno));
            close(bind);
            exit(EXIT_FAILURE);
        }
        else{
            perror("Socket failed to bind\n");
            close(bind);
            exit(EXIT_FAILURE);
        }
    }
    else{
        perror("Socket failed to bind\n");
        close(bind);
        exit(EXIT_FAILURE);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
testl %edi, %edi
jns 0x4c66
callq 0x4050
movl (%rax), %eax
cmpl $0x9, %eax
je 0x4caa
cmpl $0x16, %eax
je 0x4c74
cmpl $0x58, %eax
je 0x4c8f
cmpl $0x62, %eax
jne 0x4c66
movq 0x1a376(%rip), %rax     # 0x1efc8
movq (%rax), %r14
pushq $0x62
popq %rdi
callq 0x4110
leaq 0xe712(%rip), %rsi      # 0x13376
jmp 0x4cc3
leaq 0xe7ca(%rip), %rdi      # 0x13437
callq 0x4310
jmp 0x4cd0
movq 0x1a34d(%rip), %rax     # 0x1efc8
movq (%rax), %r14
pushq $0x16
popq %rdi
callq 0x4110
leaq 0xe77a(%rip), %rsi      # 0x13407
jmp 0x4cc3
movq 0x1a332(%rip), %rax     # 0x1efc8
movq (%rax), %r14
pushq $0x58
popq %rdi
callq 0x4110
leaq 0xe723(%rip), %rsi      # 0x133cb
jmp 0x4cc3
movq 0x1a317(%rip), %rax     # 0x1efc8
movq (%rax), %r14
pushq $0x9
popq %rdi
callq 0x4110
leaq 0xe6dd(%rip), %rsi      # 0x133a0
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x4540
movl %ebx, %edi
callq 0x4700
pushq $0x1
popq %rdi
callq 0x4450
// File: /workspace/github_cpp_makefile_star2_O2/Cristian-Castillo[P]Multithreaded-HTTP-Server/./httpserver_definitions.cpp
// Function: f_void_listen_error(int)
void f_void_listen_error(int socket_listen){

    if(socket_listen < 0){

        if(errno == EADDRINUSE){
            fprintf(stderr, "Another socket is listening on same port: %s\n", strerror(errno));
            close(socket_listen);
            exit(EXIT_FAILURE);
        }
        else if(errno == EBADF){
            fprintf(stderr, "Socket is not a valid file descriptor: %s\n", strerror(errno));
            close(socket_listen);
            exit(EXIT_FAILURE);
        }
        else if(errno == EOPNOTSUPP){
            fprintf(stderr, "The socket is not of a type that supports the listen() operation.: %s\n", strerror(errno));
            close(socket_listen);
            exit(EXIT_FAILURE);
        }
        else{
            perror("Server failed to start listenting\n");
            close(socket_listen);
            exit(EXIT_FAILURE);
        }
    }
    else{
        perror("Server failed to start listenting\n");
        close(socket_listen);
        exit(EXIT_FAILURE);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
testl %edi, %edi
jns 0x4d1a
callq 0x4050
movl (%rax), %eax
cmpl $0x9, %eax
je 0x4d43
cmpl $0x5f, %eax
je 0x4d28
cmpl $0x62, %eax
jne 0x4d1a
movq 0x1a2c2(%rip), %rax     # 0x1efc8
movq (%rax), %r14
pushq $0x62
popq %rdi
callq 0x4110
leaq 0xe736(%rip), %rsi      # 0x1344e
jmp 0x4d5c
leaq 0xe7a2(%rip), %rdi      # 0x134c3
callq 0x4310
jmp 0x4d69
movq 0x1a299(%rip), %rax     # 0x1efc8
movq (%rax), %r14
pushq $0x5f
popq %rdi
callq 0x4110
leaq 0xe73b(%rip), %rsi      # 0x1347c
jmp 0x4d5c
movq 0x1a27e(%rip), %rax     # 0x1efc8
movq (%rax), %r14
pushq $0x9
popq %rdi
callq 0x4110
leaq 0xe644(%rip), %rsi      # 0x133a0
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x4540
movl %ebx, %edi
callq 0x4700
pushq $0x1
popq %rdi
callq 0x4450
// File: /workspace/github_cpp_makefile_star2_O2/Cristian-Castillo[P]Multithreaded-HTTP-Server/./httpserver_definitions.cpp
// Function: f_void_getaddrinfo_error(int, addrinfo*)
void f_void_getaddrinfo_error(int status,struct addrinfo *res){

    if(status < 0){

        if(errno == EAI_AGAIN){
            fprintf(stderr,"The name server returned a temporary failure indication. Try again later: %s\n",strerror(errno));
            freeaddrinfo(res);
            exit(EXIT_FAILURE);
        }
        else if(errno == EAI_SOCKTYPE){
            fprintf(stderr,"The requested socket type is not supported: %s\n",strerror(errno));
            freeaddrinfo(res);
            exit(EXIT_FAILURE);
        }
        else if(errno == EAI_BADFLAGS){
            fprintf(stderr,"hints.ai_flags contains invalid flags: %s\n",strerror(errno));
            freeaddrinfo(res);
            exit(EXIT_FAILURE);
        }
        else if(errno == EAI_SOCKTYPE){
            fprintf(stderr,"Other system error, check errno for details: %s\n",strerror(errno));
            freeaddrinfo(res);
            exit(EXIT_FAILURE);
        }
        else{
            perror("Failed on getaddrinfo.\n");
            freeaddrinfo(res);
            exit(EXIT_FAILURE);
        } 
    }
    else{
        perror("Failed to translate server socket.\n");
        freeaddrinfo(res);
        exit(EXIT_FAILURE);
    } 
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
testl %edi, %edi
jns 0x4df5
callq 0x4050
movl (%rax), %eax
cmpl $-0x7, %eax
je 0x4e1e
cmpl $-0x1, %eax
je 0x4e03
cmpl $-0x3, %eax
jne 0x4e54
movq 0x1a1e7(%rip), %rax     # 0x1efc8
movq (%rax), %r14
pushq $-0x3
popq %rdi
callq 0x4110
leaq 0xe7e5(%rip), %rsi      # 0x135d8
jmp 0x4e37
leaq 0xe89d(%rip), %rdi      # 0x13699
callq 0x4310
jmp 0x4e44
movq 0x1a1be(%rip), %rax     # 0x1efc8
movq (%rax), %r14
pushq $-0x1
popq %rdi
callq 0x4110
leaq 0xe83a(%rip), %rsi      # 0x13656
jmp 0x4e37
movq 0x1a1a3(%rip), %rax     # 0x1efc8
movq (%rax), %r14
pushq $-0x7
popq %rdi
callq 0x4110
leaq 0xe7ef(%rip), %rsi      # 0x13626
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x4540
movq %rbx, %rdi
callq 0x44d0
pushq $0x1
popq %rdi
callq 0x4450
leaq 0xe826(%rip), %rdi      # 0x13681
jmp 0x4dfc
// File: /workspace/github_cpp_makefile_star2_O2/Cristian-Castillo[P]Multithreaded-HTTP-Server/./httpserver_definitions.cpp
// Function: f_client_req_found(int, int)
void f_client_req_found(int fetch_file_fd,int clientSocket){
    
    struct stat buf;
    fstat(fetch_file_fd,&buf);

    int int_ch_content = buf.st_size;
    char server_length[10];

    char msg200[] = "HTTP/1.1 200 OK\r\n";
    char msgContent[] = "Content-Length: ";
    char term[] = "\r\n\r\n";

    sprintf(server_length,"%d",int_ch_content);

    write(clientSocket,msg200,strlen(msg200));
    write(clientSocket,msgContent,strlen(msgContent));
    write(clientSocket,server_length,strlen(server_length));
    write(clientSocket,term,strlen(term));
    return;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xa8, %rsp
movl %esi, %ebx
leaq 0x18(%rsp), %r14
movq %r14, %rsi
callq 0x4610
movl 0x30(%r14), %edx
leaq 0xe961(%rip), %rsi      # 0x137f4
leaq 0xe(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x4080
leaq 0xf387(%rip), %rsi      # 0x14230
pushq $0x11
popq %rdx
movl %ebx, %edi
callq 0x4130
leaq 0xf396(%rip), %rsi      # 0x14250
pushq $0x10
popq %rdx
movl %ebx, %edi
callq 0x4130
movq %r14, %rdi
callq 0x4190
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
callq 0x4130
leaq 0xe692(%rip), %rsi      # 0x13572
pushq $0x4
popq %rdx
movl %ebx, %edi
addq $0xa8, %rsp
popq %rbx
popq %r14
jmp 0x4130
// File: /workspace/github_cpp_makefile_star2_O2/Cristian-Castillo[P]Multithreaded-HTTP-Server/./httpserver_definitions.cpp
// Function: f_regex_overkill_parse(char*, char*, char*)
bool f_regex_overkill_parse(char *request, char *file,char *protocol){

    char buffer_for_regex[80]; 

        strcpy (buffer_for_regex,request);
        strcat (buffer_for_regex,file);
        strcat (buffer_for_regex,protocol);

        std::regex ea("(GET|PUT)[/]?[a-zA-Z0-9]{10}HTTP/1.1"); 
        bool matcha = regex_match(buffer_for_regex, ea);
        return matcha;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x70, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %rsi
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x4360
movq %r15, %rdi
movq %r14, %rsi
callq 0x4660
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4660
leaq 0xe7aa(%rip), %rsi      # 0x136ea
movq %rsp, %rbx
pushq $0x10
popq %rdx
movq %rbx, %rdi
callq 0x6442
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x64a8
movl %eax, %ebx
movq %rsp, %rdi
callq 0x64d0
movl %ebx, %eax
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x64d0
movq %rbx, %rdi
callq 0x4650
// File: /workspace/github_cpp_makefile_star2_O2/Cristian-Castillo[P]Multithreaded-HTTP-Server/./httpserver_definitions.cpp
// Function: create_worker(unsigned long*, int*, command_line_inputs*)
void create_worker(pthread_t *workerArr, int *thread_array,struct command_line_inputs *configs){
                                       
    size_t s1;                                                           
    pthread_attr_t attr;                                                            
    char msg[100];
    int index,ret,rc;       
    int numWorker = configs->N_threads;
    free(&configs);                                               
                                                                                
   rc = pthread_attr_init(&attr);                                               
   
   if(rc == -1){                                                              
      perror("error in pthread_attr_init");                                     
      exit(1);                                                                  
   }                                                                            
    /* Make thread safe set stack size attributes */                                                               
   s1 = 4096;                                                                   
   rc = pthread_attr_setstacksize(&attr, s1);                                   
   
   if(rc == -1){                                                              
      perror("error in pthread_attr_setstacksize");                             
      exit(2);                                                                  
   } 
    /* Dispatcher - N Thread Pool */
	for(index = 0; index < numWorker; index++){
        
        thread_array[index] = index;
        ret = pthread_create(&workerArr[index],&attr, worker_thread, &thread_array[index]);
        
        if(ret){
			sprintf(msg, "Failed on pthread_create()%d\n", ret);
            exit(EXIT_FAILURE); 
		}		
	}
    free(&thread_array); 
    free(&workerArr);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movl (%rdx), %r13d
movq %rsp, %rdi
callq 0x4430
leaq 0x18(%rsp), %rdi
callq 0x4460
cmpl $-0x1, %eax
je 0x5e12
leaq 0x18(%rsp), %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0x4500
cmpl $-0x1, %eax
je 0x5e20
xorl %ebp, %ebp
testl %r13d, %r13d
cmovlel %ebp, %r13d
leaq 0x8d(%rip), %r15        # 0x5e30
leaq 0x18(%rsp), %r12
cmpq %rbp, %r13
je 0x5dec
movl %ebp, (%rbx)
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x46b0
incq %rbp
addq $0x8, %r14
addq $0x4, %rbx
testl %eax, %eax
je 0x5da8
leaq 0xda5f(%rip), %rsi      # 0x13835
leaq 0x50(%rsp), %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x4080
pushq $0x1
popq %rdi
callq 0x4450
leaq 0x8(%rsp), %rdi
callq 0x4430
leaq 0x10(%rsp), %rdi
callq 0x4430
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd9de(%rip), %rdi      # 0x137f7
callq 0x4310
jmp 0x5de4
leaq 0xd9eb(%rip), %rdi      # 0x13812
callq 0x4310
pushq $0x2
jmp 0x5de6
// File: /workspace/github_cpp_makefile_star2_O2/patmorin[P]rotate/rotatetest.cpp
// Function: void rotate_gcd<unsigned int, unsigned long>(unsigned int*, unsigned long, unsigned long)
void rotate_gcd(T *a, I n, I r) {
    I g = gcd(n, r);
    I m = n / g;
    for (I k = 0; k < g; k++) {
        I i = k;
        T t = a[i];
        for (I j = 0; j < m; j++) {
            I inxt = (i+r);
						inxt = inxt >= n ? inxt-n : inxt; // avoid mod in favour of cmov
            T t2 = a[inxt];
            a[inxt] = t;
            t = t2;
            i = inxt;
        }
    }
}

// Assembly:
movq %rdx, %rcx
movq %rsi, %rax
movq %rdx, %r8
xorl %edx, %edx
divq %r8
movq %r8, %rax
testq %rdx, %rdx
jne 0x1690
pushq %rbx
movq %rsi, %rax
xorl %edx, %edx
divq %r8
xorl %r9d, %r9d
cmpq %r8, %r9
je 0x16e6
movl (%rdi,%r9,4), %r10d
movq %r9, %rdx
xorl %r11d, %r11d
cmpq %rax, %r11
jae 0x16e1
addq %rcx, %rdx
cmpq %rsi, %rdx
jb 0x16cd
movq %rsi, %rbx
jmp 0x16cf
xorl %ebx, %ebx
subq %rbx, %rdx
incq %r11
movl (%rdi,%rdx,4), %ebx
movl %r10d, (%rdi,%rdx,4)
movl %ebx, %r10d
jmp 0x16bb
incq %r9
jmp 0x16ac
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/patmorin[P]rotate/rotatetest.cpp
// Function: void speed_test<unsigned int, unsigned long>(unsigned int*, unsigned long, unsigned long, void (*)(unsigned int*, unsigned long, unsigned long))
void speed_test(T *a, I n, I r, void(*rot)(T*,I,I)) {
    auto start = std::chrono::high_resolution_clock::now();
    rot(a, n, r);
    auto stop =  std::chrono::high_resolution_clock::now();
    std::chrono::duration<double> elapsed = stop - start;
    std::cout << elapsed.count() << std::endl;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
callq 0x1040
movq %rax, %r13
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq *%rbx
callq 0x1040
subq %r13, %rax
movq 0x283d(%rip), %rdi      # 0x3fd0
vcvtsi2sd %rax, %xmm0, %xmm0
vdivsd 0x868(%rip), %xmm0, %xmm0 # 0x2008
callq 0x1100
movq %rax, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x1080