LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: brunokeymolen[P]ssdp/src/ssdp.cpp
// Function: SSDP::Stop()
int SSDP::Stop(){
    mReadLoop = 0;
    //@TODO: leave multicast groups
    if (mMulticastSocket > 0) {
        close(mMulticastSocket);
        mMulticastSocket = INVALID_SOCKET;
        close(mUnicastSocket);
        mUnicastSocket = INVALID_SOCKET;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movb $0x0, 0x68(%rax)
cmpl $0x0, 0x8(%rax)
jle 0x3fa8
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edi
callq 0x3510
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movl 0xc(%rax), %edi
callq 0x3510
movq -0x10(%rbp), %rax
movl $0xffffffff, 0xc(%rax)  # imm = 0xFFFFFFFF
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
// File: brunokeymolen[P]ssdp/src/ssdp.cpp
// Function: SSDP::NotifyAlive()
int SSDP::NotifyAlive(){
    const char *os=mOS.c_str();
    const char *product=mProduct.c_str();

    char buf[20048];

    sprintf(buf, "NOTIFY * HTTP/1.1\r\nHOST: 239.255.255.250:1900\r\nCACHE-CONTROL: max-age=100\r\nNT: upnp:rootdevice\r\nNTS: ssdp:alive\r\nSERVER: %s/14.0.0, %s, UPnP/1.1\r\nX-User-Agent: fkuehne-upnpx\r\n\r\n", os, product);

    if(mMulticastSocket != INVALID_SOCKET)
        sendto(mMulticastSocket, buf, strlen(buf), 0, (struct sockaddr*)&mDstaddr , sizeof(struct sockaddr));
    else
        printf("invalid socket\n");

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4e90, %rsp           # imm = 0x4E90
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x4e78(%rbp)
addq $0x200, %rdi            # imm = 0x200
callq 0x3100
movq -0x4e78(%rbp), %rdi
movq %rax, -0x10(%rbp)
addq $0x220, %rdi            # imm = 0x220
callq 0x3100
movq %rax, -0x18(%rbp)
leaq -0x4e70(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
leaq 0xb7ee(%rip), %rsi      # 0x10105
movb $0x0, %al
callq 0x30a0
movq -0x4e78(%rbp), %rax
cmpl $-0x1, 0x8(%rax)
je 0x497f
movq -0x4e78(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x4e84(%rbp)
leaq -0x4e70(%rbp), %rax
movq %rax, -0x4e80(%rbp)
leaq -0x4e70(%rbp), %rdi
callq 0x3110
movq -0x4e78(%rbp), %r8
movl -0x4e84(%rbp), %edi
movq -0x4e80(%rbp), %rsi
movq %rax, %rdx
addq $0x20, %r8
xorl %ecx, %ecx
movl $0x10, %r9d
callq 0x3070
jmp 0x498d
leaq 0xb831(%rip), %rdi      # 0x101b7
movb $0x0, %al
callq 0x3040
xorl %eax, %eax
addq $0x4e90, %rsp           # imm = 0x4E90
popq %rbp
retq
nopl (%rax,%rax)
// File: brunokeymolen[P]ssdp/src/ssdp.cpp
// Function: SSDP::NotifyByeBye()
int SSDP::NotifyByeBye(){
    const char *os=mOS.c_str();
    const char *product=mProduct.c_str();

    char buf[20048];

    sprintf(buf, "NOTIFY * HTTP/1.1\r\nHOST: 239.255.255.250:1900\r\nCACHE-CONTROL: max-age=100\r\nNT: upnp:rootdevice\r\nNTS: ssdp:byebye\r\nSERVER: %s, %s, UPnP/1.1\r\nX-User-Agent: fkuehne-upnpx\r\n\r\n", os, product);

    if(mMulticastSocket != INVALID_SOCKET)
        sendto(mMulticastSocket, buf, strlen(buf), 0, (struct sockaddr*)&mDstaddr , sizeof(struct sockaddr));
    else
        printf("invalid socket\n");

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4e90, %rsp           # imm = 0x4E90
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x4e78(%rbp)
addq $0x200, %rdi            # imm = 0x200
callq 0x3100
movq -0x4e78(%rbp), %rdi
movq %rax, -0x10(%rbp)
addq $0x220, %rdi            # imm = 0x220
callq 0x3100
movq %rax, -0x18(%rbp)
leaq -0x4e70(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
leaq 0xb7d0(%rip), %rsi      # 0x101c7
movb $0x0, %al
callq 0x30a0
movq -0x4e78(%rbp), %rax
cmpl $-0x1, 0x8(%rax)
je 0x4a5f
movq -0x4e78(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x4e84(%rbp)
leaq -0x4e70(%rbp), %rax
movq %rax, -0x4e80(%rbp)
leaq -0x4e70(%rbp), %rdi
callq 0x3110
movq -0x4e78(%rbp), %r8
movl -0x4e84(%rbp), %edi
movq -0x4e80(%rbp), %rsi
movq %rax, %rdx
addq $0x20, %r8
xorl %ecx, %ecx
movl $0x10, %r9d
callq 0x3070
jmp 0x4a6d
leaq 0xb751(%rip), %rdi      # 0x101b7
movb $0x0, %al
callq 0x3040
xorl %eax, %eax
addq $0x4e90, %rsp           # imm = 0x4E90
popq %rbp
retq
nopl (%rax,%rax)
// File: brunokeymolen[P]ssdp/src/ssdp.cpp
// Function: SSDP::RemoveObserver(SSDPObserver*)
int SSDP::RemoveObserver(SSDPObserver* observer){
    u8 found = 0;
    int tel = 0;
    std::vector<SSDPObserver*>::iterator it;
    for(it=mObservers.begin();it<mObservers.end();it++){
        if(observer == *it){
            //Remove this one and stop
            found = 1;
            break;
        }
        tel++;
    }
    if(found){
        mObservers.erase(mObservers.begin()+tel);
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movb $0x0, -0x11(%rbp)
movl $0x0, -0x18(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x5930
movq -0x60(%rbp), %rdi
addq $0x50, %rdi
callq 0x5950
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x60(%rbp), %rdi
addq $0x50, %rdi
callq 0x59c0
movq %rax, -0x30(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x5980
testb $0x1, %al
jne 0x4f09
jmp 0x4f46
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x59f0
movq %rax, %rcx
movq -0x68(%rbp), %rax
cmpq (%rcx), %rax
jne 0x4f2c
movb $0x1, -0x11(%rbp)
jmp 0x4f46
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x5a10
movq %rax, -0x38(%rbp)
jmp 0x4ee5
cmpb $0x0, -0x11(%rbp)
je 0x4f97
movq -0x60(%rbp), %rdi
movq %rdi, %rax
addq $0x50, %rax
movq %rax, -0x70(%rbp)
addq $0x50, %rdi
callq 0x5950
movq %rax, -0x50(%rbp)
movslq -0x18(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x5ac0
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x5b00
movq -0x70(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x5a50
movq %rax, -0x58(%rbp)
xorl %eax, %eax
addq $0x70, %rsp
popq %rbp
retq
nop
// File: brunokeymolen[P]ssdp/src/ssdp.cpp
// Function: SSDP::IncommingMessage(sockaddr*, unsigned char*, unsigned int)
int SSDP::IncommingMessage(struct sockaddr* sender, u8* buf, u32 len){
//    u8 *address;
    u16 port;

//    address = (u8*)sender->sa_data+2;
    memcpy(&port, sender->sa_data, 2);
    port = ntohs(port);

//    printf("receive from: %d.%d.%d.%d, port %d\n", address[0], address[1], address[2], address[3] , port);

    mParser->ReInit();
    mParser->Parse(sender, buf, len);

    //We have the type and all headers, check the mandatory headers for Advertisement & Search

    //Inform the observer(s)
    std::vector<SSDPObserver*>::const_iterator it;
    for(it=mObservers.begin();it<mObservers.end();it++){
        ((SSDPObserver*)*it)->SSDPMessage(mParser);
    }

    //hexdump(buf, len);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movw 0x2(%rax), %ax
movw %ax, -0x1e(%rbp)
movzwl -0x1e(%rbp), %edi
callq 0x3500
movw %ax, %cx
movq -0x50(%rbp), %rax
movw %cx, -0x1e(%rbp)
movq 0x240(%rax), %rdi
callq 0xc6c0
movq -0x50(%rbp), %rax
movq 0x240(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %ecx
callq 0xc800
leaq -0x28(%rbp), %rdi
callq 0x5b40
movq -0x50(%rbp), %rdi
addq $0x50, %rdi
callq 0x5950
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x5b00
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x50(%rbp), %rdi
addq $0x50, %rdi
callq 0x59c0
movq %rax, -0x40(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x5b60
testb $0x1, %al
jne 0x5719
jmp 0x5749
leaq -0x28(%rbp), %rdi
callq 0x5ba0
movq %rax, %rcx
movq -0x50(%rbp), %rax
movq (%rcx), %rdi
movq 0x240(%rax), %rsi
movq (%rdi), %rax
callq *(%rax)
leaq -0x28(%rbp), %rdi
xorl %esi, %esi
callq 0x5bc0
movq %rax, -0x48(%rbp)
jmp 0x56f5
xorl %eax, %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: brunokeymolen[P]ssdp/src/ssdpdb.cpp
// Function: SSDPDB::SSDPDB()
SSDPDB::SSDPDB(){
    int ret;

    ret = pthread_mutexattr_init(&mMutexAccessAttr);
    STAT(ret);
    ret = pthread_mutexattr_settype(&mMutexAccessAttr, PTHREAD_MUTEX_RECURSIVE);
    STAT(ret);
    ret = pthread_mutex_init(&mMutexAccess, &mMutexAccessAttr);
     STAT(ret);



EXIT:
    if(ret != 0){
        printf("SSDPDB Error\n");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x28(%rbp)
callq 0x79c0
movq -0x28(%rbp), %rdi
addq $0x18, %rdi
movq %rdi, -0x30(%rbp)
callq 0x79e0
movq -0x28(%rbp), %rdi
addq $0x30, %rdi
callq 0x3050
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x6cc4
movl -0xc(%rbp), %eax
movl %eax, -0x34(%rbp)
callq 0x3030
movl -0x34(%rbp), %esi
movl (%rax), %ecx
leaq 0x97d5(%rip), %rdx      # 0x1044c
movq %rsp, %rax
movq %rdx, (%rax)
leaq 0x9426(%rip), %rdi      # 0x100aa
leaq 0x97b2(%rip), %r9       # 0x1043d
xorl %edx, %edx
movb %dl, %al
movl $0x2a, %r8d
callq 0x3040
jmp 0x6c9c
jmp 0x6d7a
movq -0x30(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x7a00
movq -0x28(%rbp), %rdi
callq 0x7a60
jmp 0x6d98
movq -0x28(%rbp), %rdi
addq $0x30, %rdi
movl $0x1, %esi
callq 0x3410
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x6d1d
movl -0xc(%rbp), %eax
movl %eax, -0x38(%rbp)
callq 0x3030
movl -0x38(%rbp), %esi
movl (%rax), %ecx
leaq 0x9756(%rip), %rdx      # 0x1044c
movq %rsp, %rax
movq %rdx, (%rax)
leaq 0x93a7(%rip), %rdi      # 0x100aa
leaq 0x9733(%rip), %r9       # 0x1043d
xorl %edx, %edx
movb %dl, %al
movl $0x2c, %r8d
callq 0x3040
jmp 0x6d1b
jmp 0x6d7a
movq -0x28(%rbp), %rsi
movq %rsi, %rdi
addq $0x38, %rdi
addq $0x30, %rsi
callq 0x3430
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x6d78
movl -0xc(%rbp), %eax
movl %eax, -0x3c(%rbp)
callq 0x3030
movl -0x3c(%rbp), %esi
movl (%rax), %ecx
leaq 0x96fb(%rip), %rdx      # 0x1044c
movq %rsp, %rax
movq %rdx, (%rax)
leaq 0x934c(%rip), %rdi      # 0x100aa
leaq 0x96d8(%rip), %r9       # 0x1043d
xorl %edx, %edx
movb %dl, %al
movl $0x2e, %r8d
callq 0x3040
jmp 0x6d76
jmp 0x6d7a
jmp 0x6d7a
cmpl $0x0, -0xc(%rbp)
je 0x6d92
leaq 0x96cc(%rip), %rdi      # 0x10453
xorl %eax, %eax
callq 0x3040
jmp 0x6d90
jmp 0x6d92
addq $0x50, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x34b0
nopw %cs:(%rax,%rax)
// File: brunokeymolen[P]ssdp/src/ssdpdb.cpp
// Function: SSDPDB::Start()
int SSDPDB::Start(){
    int ret = 0;
    pthread_attr_t  attr;

    //Start the cache control thread
    ret = pthread_attr_init(&attr);
    STAT(ret);
    ret = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
    STAT(ret);
    ret = pthread_create(&mCacheControlThread, &attr, SSDPDB::sCacheControlLoop, (void*)this);
    pthread_attr_destroy(&attr);
EXIT:
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movl $0x0, -0xc(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x3380
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x6e67
movl -0xc(%rbp), %eax
movl %eax, -0x54(%rbp)
callq 0x3030
movl -0x54(%rbp), %esi
movl (%rax), %ecx
leaq 0x9266(%rip), %rdi      # 0x100aa
xorl %edx, %edx
movl $0x44, %r8d
leaq 0x95ea(%rip), %r9       # 0x1043d
leaq 0x924a(%rip), %rax      # 0x100a4
movq %rax, (%rsp)
movb $0x0, %al
callq 0x3040
jmp 0x6edf
leaq -0x48(%rbp), %rdi
movl $0x1, %esi
callq 0x33a0
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x6eb8
movl -0xc(%rbp), %eax
movl %eax, -0x58(%rbp)
callq 0x3030
movl -0x58(%rbp), %esi
movl (%rax), %ecx
leaq 0x9215(%rip), %rdi      # 0x100aa
xorl %edx, %edx
movl $0x46, %r8d
leaq 0x9599(%rip), %r9       # 0x1043d
leaq 0x91f9(%rip), %rax      # 0x100a4
movq %rax, (%rsp)
movb $0x0, %al
callq 0x3040
jmp 0x6edf
movq -0x50(%rbp), %rcx
movq %rcx, %rdi
addq $0x60, %rdi
leaq -0x48(%rbp), %rsi
leaq 0x22(%rip), %rdx        # 0x6ef0
callq 0x34f0
movl %eax, -0xc(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x3490
movl -0xc(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: brunokeymolen[P]ssdp/src/ssdpdb.cpp
// Function: SSDPDB::InsertDevice(unsigned char*, unsigned int)
SSDPDBDevice* SSDPDB::InsertDevice(u8* usn, u32 usnlen){
    SSDPDBDevice* thisdevice = new SSDPDBDevice();
    thisdevice->usn.assign((const char*)usn, (size_t)usnlen);

    Lock();
    mDevices.push_back(thisdevice);
    Unlock();

    return thisdevice;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movl $0x150, %edi            # imm = 0x150
callq 0x32d0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x38(%rbp)
callq 0x9ff0
jmp 0x6fb6
movq -0x38(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
addq $0x48, %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %eax
movl %eax, %edx
callq 0x33c0
movq -0x40(%rbp), %rdi
callq 0x6f40
movq -0x40(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x7ac0
movq -0x40(%rbp), %rdi
callq 0x6f60
movq -0x20(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
movl $0x150, %esi            # imm = 0x150
callq 0x32f0
movq -0x28(%rbp), %rdi
callq 0x34b0
// File: brunokeymolen[P]ssdp/src/ssdpdb.cpp
// Function: SSDPDB::DeleteDevice(unsigned char*, unsigned int)
int SSDPDB::DeleteDevice(u8* usn, u32 usnlen){
    int tel = 0;
    SSDPDBDevice* thisdevice = NULL;
    int updated = 0;

    Lock();
    unsigned int i=0;
    while(i<mDevices.size()){
        thisdevice = mDevices[i];
        if( (thisdevice->usn.length() == usnlen &&  memcmp(thisdevice->usn.c_str(), usn, usnlen) == 0) ){
            mDevices.erase(mDevices.begin()+i);
            delete(thisdevice);
            updated++;
        }else{
            i++;
        }
    }
    Unlock();

    if(updated > 0){
        DeviceUpdate(NULL);
    }

    return tel;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x50(%rbp)
movl $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
callq 0x6f40
movl $0x0, -0x28(%rbp)
movq -0x50(%rbp), %rdi
movl -0x28(%rbp), %eax
movq %rax, -0x58(%rbp)
callq 0x7b30
movq %rax, %rcx
movq -0x58(%rbp), %rax
cmpq %rcx, %rax
jae 0x7149
movq -0x50(%rbp), %rdi
movl -0x28(%rbp), %eax
movl %eax, %esi
callq 0x7b50
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
addq $0x48, %rdi
callq 0x3440
movl -0x14(%rbp), %ecx
cmpq %rcx, %rax
jne 0x713b
movq -0x20(%rbp), %rdi
addq $0x48, %rdi
callq 0x3100
movq %rax, %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %eax
movl %eax, %edx
callq 0x3120
cmpl $0x0, %eax
jne 0x713b
movq -0x50(%rbp), %rdi
callq 0x7be0
movq %rax, -0x40(%rbp)
movl -0x28(%rbp), %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0x7c10
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x7c50
movq -0x50(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x7b70
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x60(%rbp)
cmpq $0x0, %rax
je 0x7130
movq -0x60(%rbp), %rdi
callq 0xa1c0
movq -0x60(%rbp), %rdi
movl $0x150, %esi            # imm = 0x150
callq 0x32f0
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x7144
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x705d
movq -0x50(%rbp), %rdi
callq 0x6f60
cmpl $0x0, -0x24(%rbp)
jle 0x7165
movq -0x50(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x7170
movl -0x18(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nop
// File: brunokeymolen[P]ssdp/src/ssdpdb.cpp
// Function: SSDPDB::DeviceUpdate(SSDPDBDevice*)
void SSDPDB::DeviceUpdate(SSDPDBDevice* device){
    SSDPDBMsg msg;
    std::vector<SSDPDBObserver*>::iterator it;
    msg.type = SSDPDBMsg_DeviceUpdate;
    for(it=mObservers.begin();it<mObservers.end();it++){
        ((SSDPDBObserver*)*it)->SSDPDBMessage(&msg);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x7e90
movq -0x40(%rbp), %rdi
movl $0x1, -0x14(%rbp)
addq $0x18, %rdi
callq 0x7eb0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x40(%rbp), %rdi
addq $0x18, %rdi
callq 0x7f20
movq %rax, -0x30(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x7ee0
testb $0x1, %al
jne 0x71d5
jmp 0x71fb
leaq -0x20(%rbp), %rdi
callq 0x7f50
movq (%rax), %rdi
movq (%rdi), %rax
leaq -0x14(%rbp), %rsi
callq *(%rax)
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x7f70
movq %rax, -0x38(%rbp)
jmp 0x71b1
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: brunokeymolen[P]ssdp/src/ssdpdb.cpp
// Function: SSDPDB::DeleteDevicesByUuid(unsigned char*, unsigned int)
int SSDPDB::DeleteDevicesByUuid(u8* uuid, u32 uuidlen){
    int tel = 0;
    SSDPDBDevice* thisdevice = NULL;
    int updated = 0;

    Lock();
    unsigned int i=0;
    while(i<mDevices.size()){
        thisdevice = mDevices[i];
        if( (thisdevice->uuid.length() == uuidlen &&  memcmp(thisdevice->uuid.c_str(), uuid, uuidlen) == 0) ){
            mDevices.erase(mDevices.begin()+i);
            delete(thisdevice);
            updated++;
        }else{
            i++;
        }
    }
    Unlock();

    if(updated > 0){
        DeviceUpdate(NULL);
    }

    return tel;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x50(%rbp)
movl $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
callq 0x6f40
movl $0x0, -0x28(%rbp)
movq -0x50(%rbp), %rdi
movl -0x28(%rbp), %eax
movq %rax, -0x58(%rbp)
callq 0x7b30
movq %rax, %rcx
movq -0x58(%rbp), %rax
cmpq %rcx, %rax
jae 0x7339
movq -0x50(%rbp), %rdi
movl -0x28(%rbp), %eax
movl %eax, %esi
callq 0x7b50
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
callq 0x3440
movl -0x14(%rbp), %ecx
cmpq %rcx, %rax
jne 0x732b
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
callq 0x3100
movq %rax, %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %eax
movl %eax, %edx
callq 0x3120
cmpl $0x0, %eax
jne 0x732b
movq -0x50(%rbp), %rdi
callq 0x7be0
movq %rax, -0x40(%rbp)
movl -0x28(%rbp), %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0x7c10
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x7c50
movq -0x50(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x7b70
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x60(%rbp)
cmpq $0x0, %rax
je 0x7320
movq -0x60(%rbp), %rdi
callq 0xa1c0
movq -0x60(%rbp), %rdi
movl $0x150, %esi            # imm = 0x150
callq 0x32f0
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x7334
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x724d
movq -0x50(%rbp), %rdi
callq 0x6f60
cmpl $0x0, -0x24(%rbp)
jle 0x7355
movq -0x50(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x7170
movl -0x18(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nop
// File: brunokeymolen[P]ssdp/src/ssdpdb.cpp
// Function: SSDPDB::GetDevice(unsigned char*, unsigned int)
SSDPDBDevice* SSDPDB::GetDevice(u8* usn, u32 usnlen){
    SSDPDBDevice *result = NULL;
    SSDPDBDevice *thisdevice = NULL;

    if(mDevices.size() <= 0){
        return NULL;
    }

    vector<SSDPDBDevice*>::const_iterator it;
    it=mDevices.begin();
    while(it < mDevices.end()){
        thisdevice = *it;
        if( (thisdevice->usn.length() == usnlen &&  memcmp(thisdevice->usn.c_str(), usn, usnlen) == 0) ){
            result = thisdevice;
            break;
        }
        it++;
    }

    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x60(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
callq 0x7b30
cmpq $0x0, %rax
ja 0x73a3
movq $0x0, -0x8(%rbp)
jmp 0x745c
leaq -0x38(%rbp), %rdi
callq 0x7c90
movq -0x60(%rbp), %rdi
callq 0x7be0
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x7c50
movq -0x40(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x60(%rbp), %rdi
callq 0x7cf0
movq %rax, -0x50(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x7cb0
testb $0x1, %al
jne 0x73ee
jmp 0x7454
leaq -0x38(%rbp), %rdi
callq 0x7d20
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
addq $0x48, %rdi
callq 0x3440
movl -0x1c(%rbp), %ecx
cmpq %rcx, %rax
jne 0x7440
movq -0x30(%rbp), %rdi
addq $0x48, %rdi
callq 0x3100
movq %rax, %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %eax
movl %eax, %edx
callq 0x3120
cmpl $0x0, %eax
jne 0x7440
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x7454
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
callq 0x7d40
movq %rax, -0x58(%rbp)
jmp 0x73ce
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: brunokeymolen[P]ssdp/src/ssdpdb.cpp
// Function: SSDPDB::RemoveAllDevices()
void SSDPDB::RemoveAllDevices() {
    printf("SSDPDB::RemoveAllDevices\n");
    Lock();
    mDevices.clear();
    Unlock();

    SSDPDBMsg msg;
    std::vector<SSDPDBObserver*>::iterator it;
    msg.type = SSDPDBMsg_DeviceUpdate;
    for(it=mObservers.begin();it<mObservers.end();it++){
        ((SSDPDBObserver*)*it)->SSDPDBMessage(&msg);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq 0x8fa6(%rip), %rdi      # 0x10461
movb $0x0, %al
callq 0x3040
movq -0x38(%rbp), %rdi
callq 0x6f40
movq -0x38(%rbp), %rdi
callq 0x7e70
movq -0x38(%rbp), %rdi
callq 0x6f60
leaq -0x18(%rbp), %rdi
callq 0x7e90
movq -0x38(%rbp), %rdi
movl $0x1, -0xc(%rbp)
addq $0x18, %rdi
callq 0x7eb0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x38(%rbp), %rdi
addq $0x18, %rdi
callq 0x7f20
movq %rax, -0x28(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x7ee0
testb $0x1, %al
jne 0x752a
jmp 0x7550
leaq -0x18(%rbp), %rdi
callq 0x7f50
movq (%rax), %rdi
movq (%rdi), %rax
leaq -0xc(%rbp), %rsi
callq *(%rax)
leaq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x7f70
movq %rax, -0x30(%rbp)
jmp 0x7506
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: brunokeymolen[P]ssdp/src/ssdpdb.cpp
// Function: SSDPDB::RemoveObserver(SSDPDBObserver*)
int SSDPDB::RemoveObserver(SSDPDBObserver* observer){
    u8 found = 0;
    int tel = 0;
    std::vector<SSDPDBObserver*>::iterator it;
    for(it=mObservers.begin();it<mObservers.end();it++){
        if(observer == *it){
            //Remove this one and stop
            found = 1;
            break;
        }
        tel++;
    }
    if(found){
        mObservers.erase(mObservers.begin()+tel);
    }
    return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movb $0x0, -0x11(%rbp)
movl $0x0, -0x18(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x7e90
movq -0x60(%rbp), %rdi
addq $0x18, %rdi
callq 0x7eb0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x60(%rbp), %rdi
addq $0x18, %rdi
callq 0x7f20
movq %rax, -0x30(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x7ee0
testb $0x1, %al
jne 0x7609
jmp 0x7646
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x7f50
movq %rax, %rcx
movq -0x68(%rbp), %rax
cmpq (%rcx), %rax
jne 0x762c
movb $0x1, -0x11(%rbp)
jmp 0x7646
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x7f70
movq %rax, -0x38(%rbp)
jmp 0x75e5
cmpb $0x0, -0x11(%rbp)
je 0x7697
movq -0x60(%rbp), %rdi
movq %rdi, %rax
addq $0x18, %rax
movq %rax, -0x70(%rbp)
addq $0x18, %rdi
callq 0x7eb0
movq %rax, -0x50(%rbp)
movslq -0x18(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x8090
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x80d0
movq -0x70(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x8020
movq %rax, -0x58(%rbp)
xorl %eax, %eax
addq $0x70, %rsp
popq %rbp
retq
nop
// File: brunokeymolen[P]ssdp/src/ssdpdb.cpp
// Function: SSDPDB::ServiceUpdate(SSDPDBDevice*)
void SSDPDB::ServiceUpdate(SSDPDBDevice* service){
    SSDPDBMsg msg;
    std::vector<SSDPDBObserver*>::iterator it;
    msg.type = SSDPDBMsg_ServiceUpdate;
    for(it=mObservers.begin();it<mObservers.end();it++){
        ((SSDPDBObserver*)*it)->SSDPDBMessage(&msg);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x7e90
movq -0x40(%rbp), %rdi
movl $0x2, -0x14(%rbp)
addq $0x18, %rdi
callq 0x7eb0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x40(%rbp), %rdi
addq $0x18, %rdi
callq 0x7f20
movq %rax, -0x30(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x7ee0
testb $0x1, %al
jne 0x7705
jmp 0x772b
leaq -0x20(%rbp), %rdi
callq 0x7f50
movq (%rax), %rdi
movq (%rdi), %rax
leaq -0x14(%rbp), %rsi
callq *(%rax)
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x7f70
movq %rax, -0x38(%rbp)
jmp 0x76e1
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: brunokeymolen[P]ssdp/src/ssdpdb.cpp
// Function: SSDPDB::UpdateCacheControl(unsigned char*, unsigned int, int)
int SSDPDB::UpdateCacheControl(u8* uuid, u32 uuidlen, int cachecontrol){
    int tel = 0;
    SSDPDBDevice* thisdevice = NULL;

    Lock();
    vector<SSDPDBDevice*>::const_iterator it;
    it=mDevices.begin();
    while(it < mDevices.end()){
        thisdevice = *it;
        if( (thisdevice->uuid.length() == uuidlen &&  memcmp(thisdevice->uuid.c_str(), uuid, uuidlen) == 0) ){
            thisdevice->cachecontrol = cachecontrol;
            thisdevice->lastupdate = systimeinseconds;
            tel++;
        }
        it++;
    }
    Unlock();

    return tel;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x58(%rbp)
movl $0x0, -0x1c(%rbp)
movq $0x0, -0x28(%rbp)
callq 0x6f40
leaq -0x30(%rbp), %rdi
callq 0x7c90
movq -0x58(%rbp), %rdi
callq 0x7be0
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x7c50
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x58(%rbp), %rdi
callq 0x7cf0
movq %rax, -0x48(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x7cb0
testb $0x1, %al
jne 0x77c0
jmp 0x7849
leaq -0x30(%rbp), %rdi
callq 0x7d20
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
addq $0x8, %rdi
callq 0x3440
movl -0x14(%rbp), %ecx
cmpq %rcx, %rax
jne 0x7835
movq -0x28(%rbp), %rdi
addq $0x8, %rdi
callq 0x3100
movq %rax, %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %eax
movl %eax, %edx
callq 0x3120
cmpl $0x0, %eax
jne 0x7835
movl -0x18(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x140(%rax)
xorl %eax, %eax
movl %eax, %edi
callq 0x3280
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x148(%rax)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0x7d40
movq %rax, -0x50(%rbp)
jmp 0x779d
movq -0x58(%rbp), %rdi
callq 0x6f60
movl -0x1c(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: brunokeymolen[P]ssdp/src/ssdpdb.cpp
// Function: SSDPDB::CacheControlLoop()
int SSDPDB::CacheControlLoop(){
    mRun = 1;
    SSDPDBDevice* thisdevice = NULL;
    vector<SSDPDBDevice*>::iterator it;
    time_t nows;
    u8 updated;
    while(mRun){
        sleep(CACHE_CONTROL_TIMEOUT);

        Lock();
        updated = 0;
        nows = time(NULL);
        unsigned int i=0;
        while(i<mDevices.size()){
            thisdevice = mDevices[i];
            if((time_t)(thisdevice->lastupdate + thisdevice->cachecontrol) <= nows){
                mDevices.erase(mDevices.begin()+i);
                delete(thisdevice);
                updated++;
            }else{
                i++;
            }
        }
        Unlock();

        if(updated > 0){
            DeviceUpdate(NULL);
        }
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movb $0x1, 0x68(%rax)
movq $0x0, -0x10(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x8110
movq -0x50(%rbp), %rax
cmpb $0x0, 0x68(%rax)
je 0x79b3
movl $0x1e, %edi
callq 0x31d0
movq -0x50(%rbp), %rdi
callq 0x6f40
movb $0x0, -0x21(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x3280
movq %rax, -0x20(%rbp)
movl $0x0, -0x28(%rbp)
movq -0x50(%rbp), %rdi
movl -0x28(%rbp), %eax
movq %rax, -0x58(%rbp)
callq 0x7b30
movq %rax, %rcx
movq -0x58(%rbp), %rax
cmpq %rcx, %rax
jae 0x798f
movq -0x50(%rbp), %rdi
movl -0x28(%rbp), %eax
movl %eax, %esi
callq 0x7b50
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x148(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x140(%rcx), %ecx
addq %rcx, %rax
cmpq -0x20(%rbp), %rax
jg 0x7981
movq -0x50(%rbp), %rdi
callq 0x7be0
movq %rax, -0x40(%rbp)
movl -0x28(%rbp), %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0x7c10
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x7c50
movq -0x50(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x7b70
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
cmpq $0x0, %rax
je 0x7977
movq -0x60(%rbp), %rdi
callq 0xa1c0
movq -0x60(%rbp), %rdi
movl $0x150, %esi            # imm = 0x150
callq 0x32f0
movb -0x21(%rbp), %al
addb $0x1, %al
movb %al, -0x21(%rbp)
jmp 0x798a
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x78c2
movq -0x50(%rbp), %rdi
callq 0x6f60
movzbl -0x21(%rbp), %eax
cmpl $0x0, %eax
jle 0x79ae
movq -0x50(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x7170
jmp 0x7889
xorl %eax, %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: brunokeymolen[P]ssdp/src/ssdpdbdevice.cpp
// Function: SSDPDBDevice::SSDPDBDevice()
SSDPDBDevice::SSDPDBDevice(){
    isroot=0;
    isservice=0;
    isdevice=0;  
    uuid = "";
    urn="";
    type="";
    version="";
    host="";
    usn="";
    lastupdate=0;
    cachecontrol=0;
    ip=0;
    port=0;
    memset(&parsedusn, 0, sizeof(ssdpuuid));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x28(%rbp)
addq $0x8, %rdi
movq %rdi, -0x20(%rbp)
callq 0x33e0
movq -0x28(%rbp), %rdi
addq $0x28, %rdi
movq %rdi, -0x58(%rbp)
callq 0x33e0
movq -0x28(%rbp), %rdi
addq $0x48, %rdi
movq %rdi, -0x50(%rbp)
callq 0x33e0
movq -0x28(%rbp), %rdi
addq $0xb8, %rdi
movq %rdi, -0x48(%rbp)
callq 0x33e0
movq -0x28(%rbp), %rdi
addq $0xd8, %rdi
movq %rdi, -0x40(%rbp)
callq 0x33e0
movq -0x28(%rbp), %rdi
addq $0xf8, %rdi
movq %rdi, -0x38(%rbp)
callq 0x33e0
movq -0x28(%rbp), %rdi
addq $0x118, %rdi            # imm = 0x118
movq %rdi, -0x30(%rbp)
callq 0x33e0
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rdi
movb $0x0, 0x1(%rax)
movb $0x0, 0x2(%rax)
movb $0x0, (%rax)
leaq 0x6355(%rip), %rsi      # 0x103f2
callq 0x33d0
jmp 0xa0a4
movq -0x28(%rbp), %rdi
addq $0x28, %rdi
leaq 0x633f(%rip), %rsi      # 0x103f2
callq 0x33d0
jmp 0xa0ba
movq -0x28(%rbp), %rdi
addq $0xb8, %rdi
leaq 0x6326(%rip), %rsi      # 0x103f2
callq 0x33d0
jmp 0xa0d3
movq -0x28(%rbp), %rdi
addq $0xd8, %rdi
leaq 0x630d(%rip), %rsi      # 0x103f2
callq 0x33d0
jmp 0xa0ec
movq -0x28(%rbp), %rdi
addq $0xf8, %rdi
leaq 0x62f4(%rip), %rsi      # 0x103f2
callq 0x33d0
jmp 0xa105
movq -0x28(%rbp), %rdi
addq $0x48, %rdi
leaq 0x62de(%rip), %rsi      # 0x103f2
callq 0x33d0
jmp 0xa11b
movq -0x28(%rbp), %rdi
movq $0x0, 0x148(%rdi)
movl $0x0, 0x140(%rdi)
movl $0x0, 0x138(%rdi)
movw $0x0, 0x13c(%rdi)
addq $0x68, %rdi
xorl %esi, %esi
movl $0x50, %edx
callq 0x3160
addq $0x60, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
callq 0x3548
movq -0x38(%rbp), %rdi
callq 0x3548
movq -0x40(%rbp), %rdi
callq 0x3548
movq -0x48(%rbp), %rdi
callq 0x3548
movq -0x50(%rbp), %rdi
callq 0x3548
movq -0x58(%rbp), %rdi
callq 0x3548
movq -0x20(%rbp), %rdi
callq 0x3548
movq -0x10(%rbp), %rdi
callq 0x34b0
nopw %cs:(%rax,%rax)
// File: brunokeymolen[P]ssdp/src/ssdpmessage.cpp
// Function: SSDPMessage::~SSDPMessage()
SSDPMessage::~SSDPMessage(){
    std::vector<SSDP_HTTP_HEADER*>::iterator it;
    for(it=mHeaderSignature.begin();it<mHeaderSignature.end();it++){
        free(*it);
    }
    mHeaderSignature.clear();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq 0xd68d(%rip), %rcx      # 0x17968
addq $0x10, %rcx
movq %rcx, (%rax)
leaq -0x10(%rbp), %rdi
callq 0xa6c0
movq -0x30(%rbp), %rdi
addq $0x8, %rdi
callq 0xa6e0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x30(%rbp), %rdi
addq $0x8, %rdi
callq 0xa750
movq %rax, -0x20(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0xa710
testb $0x1, %al
jne 0xa328
jmp 0xa34a
leaq -0x10(%rbp), %rdi
callq 0xa780
movq (%rax), %rdi
callq 0x3360
leaq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0xa7a0
movq %rax, -0x28(%rbp)
jmp 0xa304
movq -0x30(%rbp), %rdi
addq $0x8, %rdi
callq 0xa7e0
movq -0x30(%rbp), %rdi
addq $0x8, %rdi
callq 0xa800
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: brunokeymolen[P]ssdp/src/ssdpmessage.cpp
// Function: SSDPMessage::AddSignatureHeader(char*, char*)
int SSDPMessage::AddSignatureHeader(char* fieldname, char* fieldvalue){
    SSDP_HTTP_HEADER *thisHeader = (SSDP_HTTP_HEADER*)malloc(sizeof(SSDP_HTTP_HEADER));
    thisHeader->fieldname = (u8*)fieldname;
    thisHeader->fieldnamelen = (unsigned int)strlen(fieldname);
    thisHeader->fieldvalue = (u8*)fieldvalue;
    thisHeader->fieldvaluelen = (unsigned int)strlen(fieldvalue);
    mHeaderSignature.push_back(thisHeader);
    return (int)mHeaderSignature.size();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x28, %edi
callq 0x33b0
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
callq 0x3110
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rdi
callq 0x3110
movq -0x28(%rbp), %rdi
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x18(%rax)
addq $0x8, %rdi
leaq -0x20(%rbp), %rsi
callq 0xaa70
movq -0x28(%rbp), %rdi
addq $0x8, %rdi
callq 0xa970
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: brunokeymolen[P]ssdp/src/ssdpnotifyalive.cpp
// Function: SSDPNotifyAlive::SSDPNotifyAlive()
SSDPNotifyAlive::SSDPNotifyAlive(){
    AddSignatureHeader((char*)"HOST", (char*)"");
    AddSignatureHeader((char*)"CACHE-CONTROL", (char*)"");
    AddSignatureHeader((char*)"LOCATION", (char*)"");
    AddSignatureHeader((char*)"NT", (char*)"");
    AddSignatureHeader((char*)"NTS", (char*)"ssdp:alive");
    AddSignatureHeader((char*)"SERVER", (char*)"");
    AddSignatureHeader((char*)"USN", (char*)"");
    /* Disabled because some devices don't send it
    AddSignatureHeader("BOOTID.UPNP.ORG", "");
    AddSignatureHeader("CONFIGID.UPNP.ORG", "");
    */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
callq 0xbf00
movq -0x20(%rbp), %rdi
leaq 0xc15c(%rip), %rax      # 0x17ac0
movq %rax, (%rdi)
leaq 0x4b40(%rip), %rsi      # 0x104ae
leaq 0x4a7d(%rip), %rdx      # 0x103f2
callq 0xa5d0
jmp 0xb97c
movq -0x20(%rbp), %rdi
leaq 0x4b2c(%rip), %rsi      # 0x104b3
leaq 0x4a64(%rip), %rdx      # 0x103f2
callq 0xa5d0
jmp 0xb995
movq -0x20(%rbp), %rdi
leaq 0x4b21(%rip), %rsi      # 0x104c1
leaq 0x4a4b(%rip), %rdx      # 0x103f2
callq 0xa5d0
jmp 0xb9ae
movq -0x20(%rbp), %rdi
leaq 0x4b11(%rip), %rsi      # 0x104ca
leaq 0x4a32(%rip), %rdx      # 0x103f2
callq 0xa5d0
jmp 0xb9c7
movq -0x20(%rbp), %rdi
leaq 0x4afb(%rip), %rsi      # 0x104cd
leaq 0x4af8(%rip), %rdx      # 0x104d1
callq 0xa5d0
jmp 0xb9e0
movq -0x20(%rbp), %rdi
leaq 0x4af1(%rip), %rsi      # 0x104dc
leaq 0x4a00(%rip), %rdx      # 0x103f2
callq 0xa5d0
jmp 0xb9f9
movq -0x20(%rbp), %rdi
leaq 0x4adf(%rip), %rsi      # 0x104e3
leaq 0x49e7(%rip), %rdx      # 0x103f2
callq 0xa5d0
jmp 0xba12
addq $0x20, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
callq 0xb910
movq -0x10(%rbp), %rdi
callq 0x34b0
nopw %cs:(%rax,%rax)
// File: brunokeymolen[P]ssdp/src/ssdpnotifybye.cpp
// Function: SSDPNotifyBye::SSDPNotifyBye()
SSDPNotifyBye::SSDPNotifyBye(){
    AddSignatureHeader((char*)"HOST", (char*)"");
    AddSignatureHeader((char*)"NT", (char*)"");
    AddSignatureHeader((char*)"NTS", (char*)"ssdp:byebye");
    AddSignatureHeader((char*)"USN", (char*)"");
    /*
    AddSignatureHeader("BOOTID.UPNP.ORG", "");
    AddSignatureHeader("CONFIGID.UPNP.ORG", "");
    */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
callq 0xbf00
movq -0x20(%rbp), %rdi
leaq 0xbb7c(%rip), %rax      # 0x17b30
movq %rax, (%rdi)
leaq 0x44f0(%rip), %rsi      # 0x104ae
leaq 0x442d(%rip), %rdx      # 0x103f2
callq 0xa5d0
jmp 0xbfcc
movq -0x20(%rbp), %rdi
leaq 0x44f3(%rip), %rsi      # 0x104ca
leaq 0x4414(%rip), %rdx      # 0x103f2
callq 0xa5d0
jmp 0xbfe5
movq -0x20(%rbp), %rdi
leaq 0x44dd(%rip), %rsi      # 0x104cd
leaq 0x4567(%rip), %rdx      # 0x1055e
callq 0xa5d0
jmp 0xbffe
movq -0x20(%rbp), %rdi
leaq 0x44da(%rip), %rsi      # 0x104e3
leaq 0x43e2(%rip), %rdx      # 0x103f2
callq 0xa5d0
jmp 0xc017
addq $0x20, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
callq 0xb910
movq -0x10(%rbp), %rdi
callq 0x34b0
nopl (%rax,%rax)
// File: brunokeymolen[P]ssdp/src/ssdpnotifybye.cpp
// Function: SSDPNotifyBye::Process(sockaddr*, std::vector<SSDP_HTTP_HEADER*, std::allocator<SSDP_HTTP_HEADER*>>)
int SSDPNotifyBye::Process(struct sockaddr* sender, std::vector<SSDP_HTTP_HEADER*> msgheaders){
    int ret = 0;
    u8* usn;
    int usnlen;
    ssdpuuid uuid;

    //Get the Device USN (Unique Service Name)
    ret=GetHeaderValueFromCollection(msgheaders, (u8*)"USN", 3, &usn, &usnlen);
    if(ret != 0 || usnlen<=0){
        ret = -1;
        goto EXIT;
    }

    ret = ParseUSN(usn, usnlen, &uuid);
    if(ret < 0){
        goto EXIT;//Unknown format
    }

    //Delete the UUID
    //Specs : If a control point has received at least one ssdp:byebye message of a root device, any of its embedded devices or any of its
    //        services then the control point can assume that all are no longer available.
    mDB->DeleteDevicesByUuid(uuid.uuid, uuid.uuidlen);



EXIT:
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdx, -0xc0(%rbp)
movq %rsi, %rax
movq -0xc0(%rbp), %rsi
movq %rdi, -0x8(%rbp)
movq %rax, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movl $0x0, -0x1c(%rbp)
leaq -0x98(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0xa860
movq -0xb0(%rbp), %rdi
leaq 0x4438(%rip), %rsi      # 0x104e3
movl $0x3, %edx
leaq -0x28(%rbp), %rcx
leaq -0x2c(%rbp), %r8
callq 0xe230
movl %eax, -0xa8(%rbp)
jmp 0xc0c5
movl -0xa8(%rbp), %eax
movl %eax, -0x1c(%rbp)
leaq -0x98(%rbp), %rdi
callq 0xa800
cmpl $0x0, -0x1c(%rbp)
jne 0xc0e6
cmpl $0x0, -0x2c(%rbp)
jg 0xc10f
movl $0xffffffff, -0x1c(%rbp) # imm = 0xFFFFFFFF
jmp 0xc141
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0x98(%rbp), %rdi
callq 0xa800
jmp 0xc14d
movq -0x28(%rbp), %rdi
movl -0x2c(%rbp), %esi
leaq -0x80(%rbp), %rdx
callq 0xe350
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jge 0xc12a
jmp 0xc141
movq -0xb8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x80(%rbp), %rsi
movl -0x78(%rbp), %edx
callq 0x7210
movl -0x1c(%rbp), %eax
addq $0xc0, %rsp
popq %rbp
retq
movq -0xa0(%rbp), %rdi
callq 0x34b0
nopl (%rax)
// File: brunokeymolen[P]ssdp/src/ssdpnotifyupdate.cpp
// Function: SSDPNotifyUpdate::SSDPNotifyUpdate()
SSDPNotifyUpdate::SSDPNotifyUpdate(){
    AddSignatureHeader((char*)"HOST", (char*)"");
    AddSignatureHeader((char*)"LOCATION", (char*)"");
    AddSignatureHeader((char*)"NT", (char*)"");
    AddSignatureHeader((char*)"NTS", (char*)"ssdp:update");
    AddSignatureHeader((char*)"USN", (char*)"");
    /*
    AddSignatureHeader("BOOTID.UPNP.ORG", "");
    AddSignatureHeader("CONFIGID.UPNP.ORG", "");
    AddSignatureHeader("NEXTBOOTID.UPNP.ORG", "");
    */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
callq 0xbf00
movq -0x20(%rbp), %rdi
leaq 0xb9cc(%rip), %rax      # 0x17ba0
movq %rax, (%rdi)
leaq 0x42d0(%rip), %rsi      # 0x104ae
leaq 0x420d(%rip), %rdx      # 0x103f2
callq 0xa5d0
jmp 0xc1ec
movq -0x20(%rbp), %rdi
leaq 0x42ca(%rip), %rsi      # 0x104c1
leaq 0x41f4(%rip), %rdx      # 0x103f2
callq 0xa5d0
jmp 0xc205
movq -0x20(%rbp), %rdi
leaq 0x42ba(%rip), %rsi      # 0x104ca
leaq 0x41db(%rip), %rdx      # 0x103f2
callq 0xa5d0
jmp 0xc21e
movq -0x20(%rbp), %rdi
leaq 0x42a4(%rip), %rsi      # 0x104cd
leaq 0x434a(%rip), %rdx      # 0x1057a
callq 0xa5d0
jmp 0xc237
movq -0x20(%rbp), %rdi
leaq 0x42a1(%rip), %rsi      # 0x104e3
leaq 0x41a9(%rip), %rdx      # 0x103f2
callq 0xa5d0
jmp 0xc250
addq $0x20, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
callq 0xb910
movq -0x10(%rbp), %rdi
callq 0x34b0
nopw %cs:(%rax,%rax)
// File: brunokeymolen[P]ssdp/src/ssdpparser.cpp
// Function: SSDPParser::~SSDPParser()
SSDPParser::~SSDPParser(){
    std::vector<SSDP_HTTP_HEADER*>::iterator it;
    for(it=mHeaders.begin();it<mHeaders.end();it++){
        free(*it);
    }
    mHeaders.clear();

    std::vector<SSDPMessage*>::iterator itmsg;
    for(itmsg=mMessages.begin();itmsg<mMessages.end();itmsg++){
        delete(*itmsg);
    }
    mMessages.clear();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x10(%rbp), %rdi
callq 0xa6c0
movq -0x50(%rbp), %rdi
addq $0x8, %rdi
callq 0xa6e0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x50(%rbp), %rdi
addq $0x8, %rdi
callq 0xa750
movq %rax, -0x20(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0xa710
testb $0x1, %al
jne 0xc5ea
jmp 0xc60c
leaq -0x10(%rbp), %rdi
callq 0xa780
movq (%rax), %rdi
callq 0x3360
leaq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0xa7a0
movq %rax, -0x28(%rbp)
jmp 0xc5c6
movq -0x50(%rbp), %rdi
addq $0x8, %rdi
callq 0xa7e0
leaq -0x30(%rbp), %rdi
callq 0xce60
movq -0x50(%rbp), %rdi
addq $0x20, %rdi
callq 0xce80
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x50(%rbp), %rdi
addq $0x20, %rdi
callq 0xcef0
movq %rax, -0x40(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0xceb0
testb $0x1, %al
jne 0xc65f
jmp 0xc692
leaq -0x30(%rbp), %rdi
callq 0xcf20
movq (%rax), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, %rax
je 0xc67f
movq -0x58(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0xc681
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0xcf40
movq %rax, -0x48(%rbp)
jmp 0xc63b
movq -0x50(%rbp), %rdi
addq $0x20, %rdi
callq 0xcf80
movq -0x50(%rbp), %rdi
addq $0x20, %rdi
callq 0xce00
movq -0x50(%rbp), %rdi
addq $0x8, %rdi
callq 0xa800
addq $0x60, %rsp
popq %rbp
retq
nop
// File: brunokeymolen[P]ssdp/src/ssdpparser.cpp
// Function: SSDPParser::ReInit()
int SSDPParser::ReInit(){
    //Clear all headers of previous session (if any)
    if(mHeaders.size() > 0){
        std::vector<SSDP_HTTP_HEADER*>::iterator it;
        for(it=mHeaders.begin();it<mHeaders.end();it++){
            free(*it);
        }
        mHeaders.clear();
    }


    //ReInit all messages
    if(mMessages.size() > 0){
        std::vector<SSDPMessage*>::const_iterator itmsg;
        for(itmsg=mMessages.begin();itmsg<mMessages.end();itmsg++){
            ((SSDPMessage*)*itmsg)->ReInit();
        }
    }

    //Clear all members
    mType = SSDP_TYPE_UNKNOWN;


    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x58(%rbp)
addq $0x8, %rdi
callq 0xa970
cmpq $0x0, %rax
jbe 0xc758
leaq -0x10(%rbp), %rdi
callq 0xa6c0
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
callq 0xa6e0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
callq 0xa750
movq %rax, -0x20(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0xa710
testb $0x1, %al
jne 0xc729
jmp 0xc74b
leaq -0x10(%rbp), %rdi
callq 0xa780
movq (%rax), %rdi
callq 0x3360
leaq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0xa7a0
movq %rax, -0x28(%rbp)
jmp 0xc705
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
callq 0xa7e0
movq -0x58(%rbp), %rdi
addq $0x20, %rdi
callq 0xcfa0
cmpq $0x0, %rax
jbe 0xc7e3
leaq -0x30(%rbp), %rdi
callq 0xcfc0
movq -0x58(%rbp), %rdi
addq $0x20, %rdi
callq 0xce80
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0xcfe0
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x58(%rbp), %rdi
addq $0x20, %rdi
callq 0xcef0
movq %rax, -0x48(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0xd020
testb $0x1, %al
jne 0xc7be
jmp 0xc7e1
leaq -0x30(%rbp), %rdi
callq 0xd060
movq (%rax), %rdi
movq (%rdi), %rax
callq *0x30(%rax)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0xd080
movq %rax, -0x50(%rbp)
jmp 0xc79a
jmp 0xc7e3
movq -0x58(%rbp), %rax
movl $0x0, (%rax)
xorl %eax, %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: brunokeymolen[P]ssdp/src/ssdpparser.cpp
// Function: SSDPParser::ReadLine(unsigned char*, unsigned int, unsigned char**, unsigned int*)
int SSDPParser::ReadLine(u8 *buf, u32 len, u8 **restbuf, u32 *restlen){
    int ret = 0;

    // If len is <2 it's not possible that we're going to find \r\n
    if (len < 2) {
        return -1;
    }

    //Search the \r\n
    u8 *pos = (u8 *)strnstr((char*)buf, "\r\n", len);
    if( !pos )
        return -1;
    // \r\n or eof
    *restlen = len - (u32)(pos + 2 - buf);

    if( *restlen == 0 ){
        ret = -1;//eof
    }else{
        *restbuf = pos + 2;
        ret = len - *restlen - 2;
    }

    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
cmpl $0x2, -0x1c(%rbp)
jae 0xcc21
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xcc9a
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %eax
movl %eax, %edx
leaq 0x37bf(%rip), %rsi      # 0x103f0
callq 0xccc0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0xcc4a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xcc9a
movl -0x1c(%rbp), %ecx
movq -0x40(%rbp), %rax
addq $0x2, %rax
movq -0x18(%rbp), %rdx
subq %rdx, %rax
subl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
jne 0xcc76
movl $0xffffffff, -0x34(%rbp) # imm = 0xFFFFFFFF
jmp 0xcc94
movq -0x40(%rbp), %rcx
addq $0x2, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movl -0x1c(%rbp), %eax
movq -0x30(%rbp), %rcx
subl (%rcx), %eax
subl $0x2, %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: brunokeymolen[P]ssdp/src/ssdpparser.cpp
// Function: strnstr(char*, char const*, unsigned long)
char *strnstr(char *str, const char *substr, size_t n)
{
    char *p = str, *pEnd = str+n;
    size_t substr_len = strlen(substr);

    if(0 == substr_len)
        return str; // the empty string is contained everywhere.

    pEnd -= (substr_len - 1);
    for(;p < pEnd; ++p)
    {
        if(0 == strncmp(p, substr, substr_len))
            return p;
    }
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3110
movq %rax, -0x38(%rbp)
xorl %eax, %eax
cmpq -0x38(%rbp), %rax
jne 0xcd07
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xcd64
movq -0x38(%rbp), %rdx
subq $0x1, %rdx
movq -0x30(%rbp), %rax
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0xcd5c
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x3130
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0xcd4c
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xcd64
jmp 0xcd4e
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0xcd1f
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop