// File: brunokeymolen[P]ssdp/src/ssdpmessage.cpp
// Function: SSDPMessage::CanProcess(std::vector<SSDP_HTTP_HEADER*, std::allocator<SSDP_HTTP_HEADER*>>)
u8 SSDPMessage::CanProcess(std::vector<SSDP_HTTP_HEADER*> msgheaders){
    u8 ret = 0;
    SSDP_HTTP_HEADER* hdrsig;
    SSDP_HTTP_HEADER* hdrmsg;
    u8 found = 0;
    u32 ftel = 0;
    std::vector<SSDP_HTTP_HEADER*>::const_iterator itsig;
    std::vector<SSDP_HTTP_HEADER*>::const_iterator itmsg;
    if(mHeaderSignature.size()<=0 || msgheaders.size() <= 0){
        goto EXIT;
    }
    for(itsig=mHeaderSignature.begin();itsig<mHeaderSignature.end();itsig++){
        hdrsig = (SSDP_HTTP_HEADER*)*itsig;
        found = 0;
        for(itmsg=msgheaders.begin();itmsg<msgheaders.end();itmsg++){
            hdrmsg = (SSDP_HTTP_HEADER*)*itmsg;
            if(caseinstringcmp(hdrmsg->fieldname, hdrmsg->fieldnamelen, hdrsig->fieldname, hdrsig->fieldnamelen) == 0 &&
               ( hdrsig->fieldvaluelen == 0 || (hdrmsg->fieldvaluelen == hdrsig->fieldvaluelen && memcmp(hdrmsg->fieldvalue, hdrsig->fieldvalue, hdrsig->fieldvaluelen) == 0) ))
            {
                found = 1;
                break;
            }
        }
        if(found==1){
            ftel++;
        }
    }
    if(ftel == mHeaderSignature.size()){
        //All found
        ret = 1;
    }
EXIT:
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rsi, -0x90(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
movb $0x0, -0x11(%rbp)
movb $0x0, -0x29(%rbp)
movl $0x0, -0x30(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xa950
leaq -0x40(%rbp), %rdi
callq 0xa950
movq -0x88(%rbp), %rdi
addq $0x8, %rdi
callq 0xa970
cmpq $0x0, %rax
jbe 0xa41e
movq -0x90(%rbp), %rdi
callq 0xa970
cmpq $0x0, %rax
ja 0xa423
jmp 0xa5bb
movq -0x88(%rbp), %rdi
addq $0x8, %rdi
callq 0xa6e0
movq %rax, -0x50(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0xa990
movq -0x48(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x88(%rbp), %rdi
addq $0x8, %rdi
callq 0xa750
movq %rax, -0x58(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0xa9d0
testb $0x1, %al
jne 0xa476
jmp 0xa58c
leaq -0x38(%rbp), %rdi
callq 0xaa10
movq -0x90(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movb $0x0, -0x29(%rbp)
callq 0xa6e0
movq %rax, -0x68(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0xa990
movq -0x60(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x90(%rbp), %rdi
callq 0xa750
movq %rax, -0x70(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xa9d0
testb $0x1, %al
jne 0xa4d5
jmp 0xa564
leaq -0x40(%rbp), %rdi
callq 0xaa10
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rax
movl 0x8(%rax), %esi
movq -0x20(%rbp), %rax
movq (%rax), %rdx
movq -0x20(%rbp), %rax
movl 0x8(%rax), %ecx
callq 0x39b0
cmpl $0x0, %eax
jne 0xa54e
movq -0x20(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0xa548
movq -0x28(%rbp), %rax
movl 0x18(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jne 0xa54e
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x20(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, %edx
callq 0x3120
cmpl $0x0, %eax
jne 0xa54e
movb $0x1, -0x29(%rbp)
jmp 0xa564
jmp 0xa550
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
callq 0xaa30
movq %rax, -0x78(%rbp)
jmp 0xa4af
movzbl -0x29(%rbp), %eax
cmpl $0x1, %eax
jne 0xa576
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0xa578
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
callq 0xaa30
movq %rax, -0x80(%rbp)
jmp 0xa44c
movq -0x88(%rbp), %rdi
movl -0x30(%rbp), %eax
movq %rax, -0x98(%rbp)
addq $0x8, %rdi
callq 0xa970
movq %rax, %rcx
movq -0x98(%rbp), %rax
cmpq %rcx, %rax
jne 0xa5b9
movb $0x1, -0x11(%rbp)
jmp 0xa5bb
movb -0x11(%rbp), %al
addq $0xa0, %rsp
popq %rbp
retq
nopw (%rax,%rax)