// File: /workspace/github_c_makefile_star2_O0/inflex[P]ripMIME/MIME_headers.c
// Function: MIMEH_are_headers_RFC822
int MIMEH_are_headers_RFC822( char *headers )
{
    char conditions[7][16] = { "received", "from", "subject", "date", "content",  "boundary" };
    int hitcount = 0;
    int condition_item;
    char *lc_headers = NULL;

    if (headers == NULL)
    {
        DMIMEH LOGGER_log("%s:%d:MIMEH_are_headers_RFC822:DEBUG: Headers are NULL");
        return 0;
    }

    DMIMEH LOGGER_log("%s:%d:MIMEH_are_headers_RFC822:DEBUG:----\n%s\n----",FL,headers);

    lc_headers = strdup(headers);
    if (lc_headers == NULL) return 0;

    //PLD_strlower((unsigned char *)lc_headers);
    PLD_strlower(lc_headers);

    DMIMEH LOGGER_log("%s:%d:MIMEH_are_headers_RFC822:DEBUG:----(lowercase)----\n%s\n----",FL,lc_headers);

    for (condition_item=0; condition_item < 6; condition_item++)
    {
        char *p;

        DMIMEH LOGGER_log("%s:%d:MIMEH_are_headers_RFC822:DEBUG: Condition test item[%d] = '%s'",FL,condition_item,conditions[condition_item]);
        p = strstr(lc_headers, conditions[condition_item]);
        if (p != NULL)
        {
            if (p > lc_headers)
            {
                if ((*(p-1) == '\n')||(*(p-1) == '\r'))
                    hitcount++;
            } else if (p == lc_headers) hitcount++;
        }
    }

    if (lc_headers != NULL) free(lc_headers);

    return hitcount;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
leaq -0x80(%rbp), %rdi
leaq 0x11be6(%rip), %rsi     # 0x1c3a0
movl $0x70, %edx
callq 0x2250
movl $0x0, -0x84(%rbp)
movq $0x0, -0x90(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0xa803
cmpl $0x1, 0x27f95(%rip)     # 0x3277c
jl 0xa7f7
leaq 0x11c8d(%rip), %rdi     # 0x1c47d
movb $0x0, %al
callq 0x117c0
movl $0x0, -0x4(%rbp)
jmp 0xa9a0
cmpl $0x1, 0x27f72(%rip)     # 0x3277c
jl 0xa82a
movq -0x10(%rbp), %rcx
leaq 0x11c9d(%rip), %rdi     # 0x1c4b4
leaq 0x11c50(%rip), %rsi     # 0x1c46e
movl $0x2ba, %edx            # imm = 0x2BA
movb $0x0, %al
callq 0x117c0
movq -0x10(%rbp), %rdi
callq 0x2390
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x90(%rbp)
jne 0xa850
movl $0x0, -0x4(%rbp)
jmp 0xa9a0
movq -0x90(%rbp), %rdi
callq 0x105f0
cmpl $0x1, 0x27f19(%rip)     # 0x3277c
jl 0xa886
movq -0x90(%rbp), %rcx
leaq 0x11c73(%rip), %rdi     # 0x1c4e6
leaq 0x11bf4(%rip), %rsi     # 0x1c46e
movl $0x2c2, %edx            # imm = 0x2C2
movb $0x0, %al
callq 0x117c0
movl $0x0, -0x88(%rbp)
cmpl $0x6, -0x88(%rbp)
jge 0xa981
cmpl $0x1, 0x27ed8(%rip)     # 0x3277c
jl 0xa8d8
movl -0x88(%rbp), %ecx
movslq -0x88(%rbp), %rax
leaq -0x80(%rbp), %r8
shlq $0x4, %rax
addq %rax, %r8
leaq 0x11c62(%rip), %rdi     # 0x1c527
leaq 0x11ba2(%rip), %rsi     # 0x1c46e
movl $0x2c8, %edx            # imm = 0x2C8
movb $0x0, %al
callq 0x117c0
movq -0x90(%rbp), %rdi
movslq -0x88(%rbp), %rax
leaq -0x80(%rbp), %rsi
shlq $0x4, %rax
addq %rax, %rsi
callq 0x23b0
movq %rax, -0x98(%rbp)
cmpq $0x0, -0x98(%rbp)
je 0xa96b
movq -0x98(%rbp), %rax
cmpq -0x90(%rbp), %rax
jbe 0xa948
movq -0x98(%rbp), %rax
movsbl -0x1(%rax), %eax
cmpl $0xa, %eax
je 0xa937
movq -0x98(%rbp), %rax
movsbl -0x1(%rax), %eax
cmpl $0xd, %eax
jne 0xa946
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0xa969
movq -0x98(%rbp), %rax
cmpq -0x90(%rbp), %rax
jne 0xa967
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0xa969
jmp 0xa96b
jmp 0xa96d
movl -0x88(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x88(%rbp)
jmp 0xa890
cmpq $0x0, -0x90(%rbp)
je 0xa997
movq -0x90(%rbp), %rdi
callq 0x2030
movl -0x84(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)