LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/mime.c
// Function: MIME_handle_plain
int MIME_handle_plain( FFGET_FILE *f, char *unpackdir, struct MIMEH_header_info *h, int current_recursion_level, struct SS_object *ss )
{
    /** Handle a plain text encoded data stream from *f **/
    int result = 0;
    if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_handle_plain:DEBUG: Handling plain email",FL);
    result = MIME_decode_encoding( f, unpackdir, h, ss );
    if ((result == MIME_ERROR_FFGET_EMPTY)||(result == 0))
    {
        /** Test for RFC822 content... if so, go decode it **/
        snprintf(h->scratch,sizeof(h->scratch),"%s/%s",unpackdir,h->filename);
        if (MIME_is_file_RFC822(h->scratch)==1)
        {
            /** If the file is RFC822, then decode it using MIME_unpack_single() **/
            if (glb.header_longsearch != 0) MIMEH_set_header_longsearch(glb.header_longsearch);
            result = MIME_unpack_single( unpackdir, h->scratch, current_recursion_level, ss );
            if (glb.header_longsearch != 0) MIMEH_set_header_longsearch(0);
        }
    }
    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r8, %rbx
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
cmpl $0x0, 0x1a3f1(%rip)     # 0x21300
jle 0x6f2b
leaq 0xd3a9(%rip), %rdi      # 0x142c1
leaq 0xb4c0(%rip), %rsi      # 0x123df
movl $0xa79, %edx            # imm = 0xA79
xorl %eax, %eax
callq 0xc84f
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x580c
movl %eax, %r12d
cmpl $0xf1, %eax
je 0x6f4b
testl %r12d, %r12d
jne 0x6fa9
leaq 0x5efd(%r14), %r8
leaq 0xb4b3(%rip), %rdx      # 0x1240c
movl $0x27f7, %esi           # imm = 0x27F7
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x2140
movq %r14, %rdi
callq 0x39aa
testl %eax, %eax
je 0x6fa9
movl 0x1abcf(%rip), %edi     # 0x21b4c
testl %edi, %edi
je 0x6f86
callq 0x7f6e
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
movq %rbx, %rcx
callq 0x5f1a
movl %eax, %r12d
cmpl $0x0, 0x1abac(%rip)     # 0x21b4c
je 0x6fa9
xorl %edi, %edi
callq 0x7f6e
movl %r12d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/ffget.c
// Function: FFGET_seek
int FFGET_seek( FFGET_FILE *f, long offset, int whence )
{
	int result = 0;

	/** Move to the new block location **/
	result = fseek(f->f, offset, whence);
	if (result == -1) {
		LOGGER_log("%s:%d:FFGET_seek:ERROR: While attempting to seek to offset %ld from %d - [%s]", FL, offset, whence, strerror(errno));
		return -1;
	}

	/** Read a whole new block **/
	result = FFGET_getnewblock(f);

	return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rdi
callq 0x2300
cmpl $-0x1, %eax
je 0x7886
movq %r15, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x763f
callq 0x2060
movl (%rax), %edi
callq 0x23b0
leaq 0xd919(%rip), %rdi      # 0x151b2
leaq 0xd8d1(%rip), %rsi      # 0x15171
movl $0x128, %edx            # imm = 0x128
movq %r14, %rcx
movl %ebx, %r8d
movq %rax, %r9
xorl %eax, %eax
callq 0xc84f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/MIME_headers.c
// Function: MIMEH_set_defect
int MIMEH_set_defect( struct MIMEH_header_info *hinfo, int defect )
{
    if ((defect >= 0)&&(defect < _MIMEH_DEFECT_ARRAY_SIZE))
    {
        hinfo->defects[defect]++;
        hinfo->header_defect_count++;
        DMIMEH LOGGER_log("%s:%d:MIMEH_set_defect:DEBUG: Setting defect index '%d' to '%d'",FL, defect, hinfo->defects[defect]);
    }
    return 0;
}

// Assembly:
cmpl $0x63, %esi
ja 0x7fbd
movl %esi, %ecx
movl %esi, %eax
incl 0x18b98(%rdi,%rax,4)
incl 0x18d28(%rdi)
cmpl $0x0, 0x243f8(%rip)     # 0x2c38c
jle 0x7fbd
pushq %rax
movl 0x18b98(%rdi,%rax,4), %r8d
leaq 0xd2f8(%rip), %rdi      # 0x1529e
leaq 0xd331(%rip), %rsi      # 0x152de
movl $0x25f, %edx            # imm = 0x25F
xorl %eax, %eax
callq 0xc84f
addq $0x8, %rsp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/MIME_headers.c
// Function: MIMEH_is_binary
int MIMEH_is_binary( char *fname )
{
    char buffer[1024];
    int read_count;
    FILE *f;

    f = fopen(fname,"r");
    if (!f) return 1;
    read_count = fread(buffer, 1, 1024, f);
    fclose(f);

    while (read_count)
    {
        read_count--;
        if (buffer[read_count] == 0) return 1;
    }
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
leaq 0xe526(%rip), %rsi      # 0x16504
callq 0x2340
movl $0x1, %ebx
testq %rax, %rax
je 0x802a
movq %rax, %r14
movq %rsp, %rdi
movl $0x1, %esi
movl $0x400, %edx            # imm = 0x400
movq %rax, %rcx
callq 0x20c0
movq %rax, %r15
movq %r14, %rdi
callq 0x20f0
movslq %r15d, %rax
movq %rax, %rcx
subq $0x1, %rcx
jb 0x8028
cmpb $0x0, -0x1(%rsp,%rax)
movq %rcx, %rax
jne 0x8016
jmp 0x802a
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, %r14
leaq 0xf1ef(%rip), %rsi      # 0x17240
movq %rsp, %rbx
movl $0xe, %ecx
movq %rbx, %rdi
rep  movsq (%rsi), %es:(%rdi)
movl 0x24327(%rip), %eax     # 0x2c38c
testq %r14, %r14
je 0x8155
testl %eax, %eax
jle 0x808f
leaq 0xd2ab(%rip), %rdi      # 0x15324
leaq 0xd25e(%rip), %rsi      # 0x152de
movl $0x2ba, %edx            # imm = 0x2BA
movq %r14, %rcx
xorl %eax, %eax
callq 0xc84f
movq %r14, %rdi
callq 0x23a0
testq %rax, %rax
je 0x816b
movq %rax, %r14
movq %rax, %rdi
callq 0xbeb9
movl 0x242da(%rip), %r15d    # 0x2c38c
testl %r15d, %r15d
jle 0x80db
leaq 0xd298(%rip), %rdi      # 0x15356
leaq 0xd219(%rip), %rsi      # 0x152de
movl $0x2c2, %edx            # imm = 0x2C2
movq %r14, %rcx
xorl %eax, %eax
callq 0xc84f
movl 0x242b1(%rip), %r15d    # 0x2c38c
leaq 0xd1fc(%rip), %r12      # 0x152de
xorl %r13d, %r13d
xorl %ebp, %ebp
testl %r15d, %r15d
jle 0x810f
leaq 0xd2a4(%rip), %rdi      # 0x15397
movq %r12, %rsi
movl $0x2c8, %edx            # imm = 0x2C8
movl %r13d, %ecx
movq %rbx, %r8
xorl %eax, %eax
callq 0xc84f
movl 0x2427d(%rip), %r15d    # 0x2c38c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x23c0
testq %rax, %rax
je 0x813e
cmpq %r14, %rax
jbe 0x8136
movzbl -0x1(%rax), %eax
cmpl $0xd, %eax
je 0x8132
cmpl $0xa, %eax
jne 0x813e
incl %ebp
jmp 0x813e
sete %al
movzbl %al, %eax
addl %eax, %ebp
incq %r13
addq $0x10, %rbx
cmpq $0x6, %r13
jne 0x80e7
movq %r14, %rdi
callq 0x2030
jmp 0x816d
testl %eax, %eax
jle 0x816b
leaq 0xd18d(%rip), %rdi      # 0x152ed
xorl %ebp, %ebp
xorl %eax, %eax
callq 0xc84f
jmp 0x816d
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/MIME_headers.c
// Function: MIMEH_save_doubleCR
int MIMEH_save_doubleCR( FFGET_FILE *f )
{
    //char c;
    int c;
    FILE *fo;
    struct stat st;

    // Determine a file name we can use.
    do {
        glb.doubleCR_count++;
        snprintf(glb.doubleCRname,_MIMEH_STRLEN_MAX,"%s/doubleCR.%d",glb.output_dir,glb.doubleCR_count);
    }
    while (stat(glb.doubleCRname, &st) == 0);


    fo = fopen(glb.doubleCRname,"w");
    if (!fo)
    {
        LOGGER_log("%s:%d:MIMEH_save_doubleCR:ERROR: unable to open '%s' to write (%s)", FL,glb.doubleCRname,strerror(errno));
        return -1;
    }

    if (MIMEH_DNORMAL) LOGGER_log("%s:%d:MIME_save_doubleCR:DEBUG: Saving DoubleCR header: %s\n", FL,glb.doubleCRname);
    while (1)
    {
        c = FFGET_fgetc(f);
        fprintf(fo,"%c",c);
        if ((c == EOF)||(c == '\n'))
        {
            break;
        }
    }
    fclose(fo);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
leaq 0x1c9ef(%rip), %r14     # 0x24b88
leaq 0xd23c(%rip), %r15      # 0x153dc
leaq 0x24205(%rip), %r12     # 0x2c3ac
leaq 0x8(%rsp), %r13
movl 0x241e1(%rip), %r8d     # 0x2c394
incl %r8d
movl %r8d, 0x241d7(%rip)     # 0x2c394
movl $0x27f6, %esi           # imm = 0x27F6
movq %r14, %rdi
movq %r15, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x2140
movq %r14, %rdi
movq %r13, %rsi
callq 0x2240
testl %eax, %eax
je 0x81ac
leaq 0x1c9a0(%rip), %rdi     # 0x24b88
leaq 0xad3c(%rip), %rsi      # 0x12f2b
callq 0x2340
testq %rax, %rax
je 0x8256
movq %rax, %r14
cmpl $0x0, 0x24189(%rip)     # 0x2c38c
jle 0x8226
leaq 0xd222(%rip), %rdi      # 0x1542e
leaq 0xd0cb(%rip), %rsi      # 0x152de
leaq 0x1c96e(%rip), %rcx     # 0x24b88
movl $0x2ff, %edx            # imm = 0x2FF
xorl %eax, %eax
callq 0xc84f
movq %rbx, %rdi
callq 0x78ed
movl %eax, %ebp
movsbl %al, %edi
movq %r14, %rsi
callq 0x21c0
cmpb $-0x1, %bpl
je 0x824a
movzbl %bpl, %eax
cmpl $0xa, %eax
jne 0x8226
movq %r14, %rdi
callq 0x20f0
xorl %eax, %eax
jmp 0x828b
callq 0x2060
movl (%rax), %edi
callq 0x23b0
leaq 0xd182(%rip), %rdi      # 0x153eb
leaq 0xd06e(%rip), %rsi      # 0x152de
leaq 0x1c911(%rip), %rcx     # 0x24b88
movl $0x2fb, %edx            # imm = 0x2FB
movq %rax, %r8
xorl %eax, %eax
callq 0xc84f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/MIME_headers.c
// Function: MIMEH_strcasestr
char *MIMEH_strcasestr(char *haystack, char *needle)
{
    char *hs, *ne;
    char *result = NULL;

    hs = strdup(haystack);
    PLD_strlower(hs);
    ne = strdup(needle);
    PLD_strlower(ne);

    if (hs && ne) {
        result = strstr(hs, ne);
        result = result -hs +haystack;
    }

    if (hs) free(hs);
    if (ne) free(ne);

    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
callq 0x23a0
movq %rax, %r15
movq %rax, %rdi
callq 0xbeb9
movq %r14, %rdi
callq 0x23a0
movq %rax, %r14
movq %rax, %rdi
callq 0xbeb9
testq %r15, %r15
sete %al
testq %r14, %r14
sete %cl
orb %al, %cl
jne 0x84d5
movq %r15, %rdi
movq %r14, %rsi
callq 0x23c0
subq %r15, %rax
addq %rax, %rbx
jmp 0x84dc
xorl %ebx, %ebx
testq %r15, %r15
je 0x84e4
movq %r15, %rdi
callq 0x2030
testq %r14, %r14
je 0x84f1
movq %r14, %rdi
callq 0x2030
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/MIME_headers.c
// Function: MIMEH_check_ct
int MIMEH_check_ct(char *q)
{
    char *p=q;
    p++;
    if(*p!='\0' && MIMEH_strcasestr(p,"Content-Type:")==p)return 1;
    p++;
    if(*p!='\0' && MIMEH_strcasestr(p,"Content-Type:")==p)return 1;
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x0, 0x1(%rdi)
je 0x851f
leaq 0x1(%rbx), %r14
leaq 0xd06b(%rip), %rsi      # 0x1557d
movq %r14, %rdi
callq 0x8484
cmpq %r14, %rax
je 0x8541
cmpb $0x0, 0x2(%rbx)
je 0x853d
addq $0x2, %rbx
leaq 0xd04d(%rip), %rsi      # 0x1557d
movq %rbx, %rdi
callq 0x8484
cmpq %rbx, %rax
je 0x8541
xorl %eax, %eax
jmp 0x8546
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/MIME_headers.c
// Function: MIMEH_display_info
int MIMEH_display_info( struct MIMEH_header_info *hinfo )
{
    if (hinfo)
    {
        LOGGER_log("%s:%d:MIMEH_display_info:\
                Content Type = %d\n\
                Boundary = %s\n\
                Filename = %s\n\
                name = %s\n\
                Encoding = %d\n\
                Disposit = %d\n\
                "\
                ,FL\
                ,hinfo->content_type\
                ,hinfo->boundary\
                ,hinfo->filename\
                ,hinfo->name\
                ,hinfo->content_transfer_encoding\
                ,hinfo->content_disposition);
        fflush(stdout);
    }
    return 0;

}

// Assembly:
testq %rdi, %rdi
je 0x8f19
pushq %rbx
movl 0x27f8(%rdi), %ecx
leaq 0x31fe(%rdi), %r8
leaq 0x5efd(%rdi), %r9
leaq 0x6efe(%rdi), %r10
movl 0x166f8(%rdi), %r11d
movl 0x17100(%rdi), %ebx
subq $0x8, %rsp
leaq 0xce61(%rip), %rdi      # 0x15d4e
leaq 0xc3ea(%rip), %rsi      # 0x152de
movl $0x528, %edx            # imm = 0x528
xorl %eax, %eax
pushq %rbx
pushq %r11
pushq %r10
callq 0xc84f
addq $0x20, %rsp
movq 0x170c0(%rip), %rax     # 0x1ffd0
movq (%rax), %rdi
callq 0x22c0
popq %rbx
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/MIME_headers.c
// Function: MIMEH_decode_multivalue_language_string
int MIMEH_decode_multivalue_language_string( char *input )
{
    int sq_count = 0;
    int language_set = 0;
    char *q = input;

    DMIMEH LOGGER_log("%s:%d:MIMEH_decode_multivalue_language_string:DEBUG: Decoding '%s'",FL,input);
    // Count the single-quotes
    while ((*q != '\0')&&(sq_count != 2)) if (*q++ == '\'') sq_count++;
    if (sq_count < 2)
    {
        //      LOGGER_log("%s:%d:MIMEH_decode_multivalue_language_string:WARNING: Insufficient single quotes for valid language-charset string",FL);
        q = input;
    } else {
        language_set = 1;
    }

    // q will be pointing at the 2nd single-quote, which is the end of
    // the language encoding set, so we just jump over that and start
    // reading off the data and decoding it.
    MDECODE_decode_multipart( q );

    // If the language was set, we need to move down our decoded data to the
    //      start of the input buffer
    if (language_set == 1)
    {
        while (*q != '\0') { *input = *q; input++; q++; }
        *input = '\0';
    }

    DMIMEH LOGGER_log("%s:%d:MIMEH_decode_multivalue_language_string:DEBUG: Output = '%s'",FL,q);


    return 0;

}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x23462(%rip)     # 0x2c38c
jle 0x8f49
leaq 0xcef9(%rip), %rdi      # 0x15e2c
leaq 0xc3a4(%rip), %rsi      # 0x152de
movl $0x54a, %edx            # imm = 0x54A
movq %rbx, %rcx
xorl %eax, %eax
callq 0xc84f
movb (%rbx), %al
testb %al, %al
je 0x8f92
xorl %ecx, %ecx
movq %rbx, %r14
movl %ecx, %edx
xorl %ecx, %ecx
cmpb $0x27, %al
movb 0x1(%r14), %al
leaq 0x1(%r14), %r14
sete %cl
addl %edx, %ecx
testb %al, %al
je 0x8f70
cmpl $0x2, %ecx
jne 0x8f54
cmpl $0x2, %ecx
jb 0x8f92
movq %r14, %rdi
callq 0xcccb
movb (%r14), %al
testb %al, %al
je 0x8f9c
movb %al, (%rbx)
incq %rbx
movb 0x1(%r14), %al
incq %r14
jmp 0x8f80
movq %rbx, %rdi
callq 0xcccb
jmp 0x8fa2
movb $0x0, (%rbx)
movq %r14, %rbx
cmpl $0x0, 0x233e3(%rip)     # 0x2c38c
jle 0x8fc8
leaq 0xcebd(%rip), %rdi      # 0x15e6f
leaq 0xc325(%rip), %rsi      # 0x152de
movl $0x562, %edx            # imm = 0x562
movq %rbx, %rcx
xorl %eax, %eax
callq 0xc84f
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/MIME_headers.c
// Function: MIMEH_parse_contentlocation
int MIMEH_parse_contentlocation( char *header_name, char *header_value, struct MIMEH_header_info *hinfo )
{
    char *p, *q;

    // CONTENT LOCATION -------------------------------
    // CONTENT LOCATION -------------------------------
    // CONTENT LOCATION -------------------------------

    PLD_strlower( header_name );
    p = strstr(header_name,"content-location");
    if (p)
    {
        /** 20041216-1108:PLD: Increase our sanity **/
        hinfo->sanity++;

        if (MIMEH_DNORMAL) LOGGER_log("%s:%d:MIME_parse_contentlocation:DEBUG: Content Location line found - '%s'\n", FL, header_value);


        p = q = header_value;
        while (q)
        {
            q = strpbrk(p, "\\/");
            if (q != NULL) p = q+1;
        }

        if (p)
        {
            if (MIMEH_DNORMAL) LOGGER_log("%s:%d:MIME_parse_contentlocation:DEBUG: filename = %s\n", FL, p);
            snprintf(hinfo->name, sizeof(hinfo->name),"%s",p);
            snprintf(hinfo->filename, sizeof(hinfo->filename),"%s",p);
            FNFILTER_filter(hinfo->filename, _MIMEH_FILENAMELEN_MAX);
            SS_push(&(hinfo->ss_filenames), hinfo->filename, strlen(hinfo->filename));

        }
    }

    return 0;

}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
callq 0xbeb9
leaq 0xc796(%rip), %rsi      # 0x167d2
movq %r14, %rdi
callq 0x23c0
testq %rax, %rax
je 0xa12c
incl 0x18d30(%rbx)
cmpl $0x0, 0x22332(%rip)     # 0x2c38c
jle 0xa079
leaq 0xc780(%rip), %rdi      # 0x167e3
leaq 0xb274(%rip), %rsi      # 0x152de
movl $0x8ae, %edx            # imm = 0x8AE
movq %r15, %rcx
xorl %eax, %eax
callq 0xc84f
testq %r15, %r15
je 0xa12c
leaq 0xc7a6(%rip), %r12      # 0x1682f
movq %r15, %r14
movq %r15, %rdi
movq %r12, %rsi
callq 0x22f0
leaq 0x1(%rax), %r15
testq %rax, %rax
jne 0xa089
cmpl $0x0, 0x222e5(%rip)     # 0x2c38c
jle 0xa0c6
leaq 0xc782(%rip), %rdi      # 0x16832
leaq 0xb227(%rip), %rsi      # 0x152de
movl $0x8ba, %edx            # imm = 0x8BA
movq %r14, %rcx
xorl %eax, %eax
callq 0xc84f
leaq 0x6efe(%rbx), %rdi
leaq 0xdf8c(%rip), %r15      # 0x18060
movl $0x27f7, %esi           # imm = 0x27F7
movq %r15, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x2140
leaq 0x5efd(%rbx), %r12
movl $0x1001, %esi           # imm = 0x1001
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x2140
movq %r12, %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0xe573
addq $0x15ec8, %rbx          # imm = 0x15EC8
movq %r12, %rdi
callq 0x2110
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x32eb
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/MIME_headers.c
// Function: MIMEH_parse_generic
int MIMEH_parse_generic( char *header_name, char *header_value, struct MIMEH_header_info *hinfo, char *tokenstr, char *buffer, size_t bsize )
{
    int compare_result = 0;
    int tlen;

    DMIMEH LOGGER_log("%s:%d:MIMEH_parse_generic:DEBUG: Searching for %s in %s",FL,tokenstr,header_name);
    /** Sanity check the parameters **/
    if (hinfo == NULL) return -1;
    if (tokenstr == NULL) return -1;
    if (header_name == NULL) return -1;
    if (header_value == NULL) return -1;
    if (buffer == NULL) return -1;
    if (bsize < 1) return -1;

    tlen = strlen(tokenstr);
    compare_result = strncmp( header_name, tokenstr, tlen );
    if (compare_result == 0)
    {

        switch (*(header_name +tlen)) {
            case ':':
            case ' ':
            case '\t':
            case '\0':
                DMIMEH LOGGER_log("%s:%d:MIMEH_parse_generic:DEBUG: Located! Sanity up +1",FL);
                snprintf( buffer, bsize, "%s", header_value );
                hinfo->sanity++;
                break;
        }

    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %rbx
movq %r8, %r12
movq %rcx, %rbp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r13
cmpl $0x0, 0x21d05(%rip)     # 0x2c38c
jle 0xa6a9
leaq 0xc4ad(%rip), %rdi      # 0x16b3d
leaq 0xac47(%rip), %rsi      # 0x152de
movl $0x9e4, %edx            # imm = 0x9E4
movq %rbp, %rcx
movq %r13, %r8
xorl %eax, %eax
callq 0xc84f
movq %rbp, %xmm0
movq %r14, %xmm1
punpcklqdq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0]
movq %r15, %xmm0
movq %r13, %xmm2
punpcklqdq %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0]
pxor %xmm0, %xmm0
testq %r12, %r12
sete %al
movq %rbx, 0x10(%rsp)
testq %rbx, %rbx
sete %cl
pcmpeqd %xmm0, %xmm2
pcmpeqd %xmm0, %xmm1
movdqa %xmm1, %xmm0
shufps $0xdd, %xmm2, %xmm0     # xmm0 = xmm0[1,3],xmm2[1,3]
shufps $0x88, %xmm2, %xmm1     # xmm1 = xmm1[0,2],xmm2[0,2]
andps %xmm0, %xmm1
movmskps %xmm1, %edx
testl %edx, %edx
setne %dl
orb %al, %cl
orb %dl, %cl
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jne 0xa792
movq %r14, 0x8(%rsp)
movq %rbp, %rdi
callq 0x2110
movslq %eax, %r14
movq %r13, %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x20a0
xorl %ebx, %ebx
testl %eax, %eax
jne 0xa792
movzbl (%r13,%r14), %eax
cmpq $0x3a, %rax
ja 0xa792
movabsq $0x400000100000201, %rcx # imm = 0x400000100000201
btq %rax, %rcx
movq 0x8(%rsp), %r14
jae 0xa792
cmpl $0x0, 0x21c38(%rip)     # 0x2c38c
jle 0xa770
leaq 0xc418(%rip), %rdi      # 0x16b75
leaq 0xab7a(%rip), %rsi      # 0x152de
movl $0x9f7, %edx            # imm = 0x9F7
xorl %eax, %eax
callq 0xc84f
leaq 0xd8e9(%rip), %rdx      # 0x18060
xorl %ebx, %ebx
movq %r12, %rdi
movq 0x10(%rsp), %rsi
movq %r15, %rcx
xorl %eax, %eax
callq 0x2140
incl 0x18d30(%r14)
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/MIME_headers.c
// Function: MIMEH_parse_headers
int MIMEH_parse_headers( FFGET_FILE *f, struct MIMEH_header_info *hinfo )
{
    int result = 0;
    DMIMEH LOGGER_log("%s:%d:MIMEH_parse_headers:DEBUG: Start [F=%p, hinfo=%p]\n", FL, f, hinfo);

    /** 20041216-1100:PLD: Set the header sanity to zero **/
    if ( result == 0 ) hinfo->sanity = 0;

    /** Proceed to read, process and finish headers **/
    DMIMEH LOGGER_log("%s:%d:MIMEH_parse_headers:DEBUG: Getting headers",FL);
    if ( result == 0 ) result = MIMEH_headers_get( hinfo, f );
    DMIMEH LOGGER_log("%s:%d:MIMEH_parse_headers:DEBUG: Processing headers",FL);
    if ( result == 0 ) result = MIMEH_headers_process( hinfo, glb.headerline );
    DMIMEH LOGGER_log("%s:%d:MIMEH_parse_headers:DEBUG: cleanup of headers",FL);
    if ( result == 0 ) result = MIMEH_headers_cleanup();
    if (MIMEH_DNORMAL) LOGGER_log("%s:%d:MIMEH_parse_headers:DEBUG: END [F=%p, hinfo=%p, sanity=%d]\n", FL, f, hinfo, hinfo->sanity);

    return result;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x0, 0x213a4(%rip)     # 0x2c38c
jle 0xb039
leaq 0xc007(%rip), %rdi      # 0x16ff8
leaq 0xa2e6(%rip), %rsi      # 0x152de
movl $0xc18, %edx            # imm = 0xC18
movq %r14, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0xc84f
cmpl $0x0, 0x2137b(%rip)     # 0x2c38c
movl $0x0, 0x18d30(%rbx)
jle 0xb043
leaq 0xc00d(%rip), %rdi      # 0x17031
leaq 0xa2b3(%rip), %rsi      # 0x152de
movl $0xc1e, %edx            # imm = 0xC1E
xorl %eax, %eax
callq 0xc84f
jmp 0xb043
movl $0x0, 0x18d30(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xadec
movl %eax, %ebp
cmpl $0x0, 0x21335(%rip)     # 0x2c38c
jle 0xb073
leaq 0xc002(%rip), %rdi      # 0x17062
leaq 0xa277(%rip), %rsi      # 0x152de
movl $0xc20, %edx            # imm = 0xC20
xorl %eax, %eax
callq 0xc84f
testl %ebp, %ebp
jne 0xb086
movq 0x212f2(%rip), %rsi     # 0x2c370
movq %rbx, %rdi
callq 0xa8b7
cmpl $0x0, 0x212ff(%rip)     # 0x2c38c
jle 0xb0a9
leaq 0xc000(%rip), %rdi      # 0x17096
leaq 0xa241(%rip), %rsi      # 0x152de
movl $0xc22, %edx            # imm = 0xC22
xorl %eax, %eax
callq 0xc84f
testl %ebp, %ebp
jne 0xb0b2
callq 0xaf9a
cmpl $0x0, 0x212d3(%rip)     # 0x2c38c
jle 0xb0e2
movl 0x18d30(%rbx), %r9d
leaq 0xc001(%rip), %rdi      # 0x170ca
leaq 0xa20e(%rip), %rsi      # 0x152de
movl $0xc24, %edx            # imm = 0xC24
movq %r14, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0xc84f
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/MIME_headers.c
// Function: MIMEH_dump_defects
int MIMEH_dump_defects( struct MIMEH_header_info *hinfo )
{
    int i;

    MIMEH_defect_description_array[MIMEH_DEFECT_MISSING_SEPARATORS] = strdup("Missing separators");
    MIMEH_defect_description_array[MIMEH_DEFECT_MULTIPLE_FIELD_OCCURANCE] = strdup("Multiple field occurance");
    MIMEH_defect_description_array[MIMEH_DEFECT_UNBALANCED_BOUNDARY_QUOTE] = strdup("Unbalanced boundary quote");
    MIMEH_defect_description_array[MIMEH_DEFECT_MULTIPLE_BOUNDARIES] = strdup("Multiple boundries");
    MIMEH_defect_description_array[MIMEH_DEFECT_MULTIPLE_COLON_SEPARATORS] = strdup("Multiple colon separators");
    MIMEH_defect_description_array[MIMEH_DEFECT_MULTIPLE_EQUALS_SEPARATORS] = strdup("Multiple equals separators");
    MIMEH_defect_description_array[MIMEH_DEFECT_UNBALANCED_QUOTES] = strdup("Unbalanced quotes");
    MIMEH_defect_description_array[MIMEH_DEFECT_MULTIPLE_QUOTES] = strdup("Multiple quotes");
    MIMEH_defect_description_array[MIMEH_DEFECT_MULTIPLE_NAMES] = strdup("Multiple names");
    MIMEH_defect_description_array[MIMEH_DEFECT_MULTIPLE_FILENAMES] = strdup("Multiple filenames");

    for (i = 0; i < _MIMEH_DEFECT_ARRAY_SIZE; i++)
    {
        if (hinfo->defects[i] > 0)
        {
            LOGGER_log("Header Defect: %s: %d",MIMEH_defect_description_array[i],hinfo->defects[i]);
        }

    }

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xc011(%rip), %rdi      # 0x1710c
callq 0x23a0
movq %rax, 0x23af9(%rip)     # 0x2ec00
leaq 0xc011(%rip), %rdi      # 0x1711f
callq 0x23a0
movq %rax, 0x23ade(%rip)     # 0x2ebf8
leaq 0xc017(%rip), %rdi      # 0x17138
callq 0x23a0
movq %rax, 0x23ac3(%rip)     # 0x2ebf0
leaq 0xc01e(%rip), %rdi      # 0x17152
callq 0x23a0
movq %rax, 0x23aa8(%rip)     # 0x2ebe8
leaq 0xc01e(%rip), %rdi      # 0x17165
callq 0x23a0
movq %rax, 0x23a8d(%rip)     # 0x2ebe0
leaq 0xc025(%rip), %rdi      # 0x1717f
callq 0x23a0
movq %rax, 0x23a72(%rip)     # 0x2ebd8
leaq 0xc02d(%rip), %rdi      # 0x1719a
callq 0x23a0
movq %rax, 0x23a57(%rip)     # 0x2ebd0
leaq 0xc02c(%rip), %rdi      # 0x171ac
callq 0x23a0
movq %rax, 0x23a3c(%rip)     # 0x2ebc8
leaq 0xc029(%rip), %rdi      # 0x171bc
callq 0x23a0
movq %rax, 0x23a69(%rip)     # 0x2ec08
leaq 0xc025(%rip), %rdi      # 0x171cb
callq 0x23a0
movq %rax, 0x23a5e(%rip)     # 0x2ec10
addq $0x18b98, %rbx          # imm = 0x18B98
leaq 0x23a00(%rip), %r15     # 0x2ebc0
leaq 0xc017(%rip), %r14      # 0x171de
xorl %r12d, %r12d
movl (%rbx), %edx
testl %edx, %edx
jle 0xb1de
movq (%r12,%r15), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0xc84f
addq $0x8, %r12
addq $0x4, %rbx
cmpq $0x320, %r12            # imm = 0x320
jne 0xb1ca
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/MIME_headers.c
// Function: MIMEH_read_primary_headers
int MIMEH_read_primary_headers( char *fname, struct MIMEH_header_info *hinfo )
{
    FFGET_FILE F;
    FILE *f;

    f = fopen(fname,"r");
    if (!f) {
        LOGGER_log("%s:%d:MIMEH_read_primary_headers:ERROR: Cannot open mailpack '%s' (%s)", FL, fname, strerror(errno));
        return 0;
    }
    FFGET_setstream(&F,f);

    MIMEH_parse_headers(&F, hinfo);
    fclose(f);

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x2070, %rsp           # imm = 0x2070
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xb2e7(%rip), %rsi      # 0x16504
callq 0x2340
testq %rax, %rax
je 0xb24d
movq %rax, %r15
movq %rsp, %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x77bb
movq %rbx, %rdi
movq %r14, %rsi
callq 0xafd7
movq %r15, %rdi
callq 0x20f0
jmp 0xb279
callq 0x2060
movl (%rax), %edi
callq 0x23b0
leaq 0xbf94(%rip), %rdi      # 0x171f4
leaq 0xa077(%rip), %rsi      # 0x152de
movl $0xc82, %edx            # imm = 0xC82
movq %rbx, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xc84f
xorl %eax, %eax
addq $0x2070, %rsp           # imm = 0x2070
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/tnef/tnef.c
// Function: read_32
int read_32( uint32 *value, uint8 *tsp)
{
	uint8 a,b,c,d;

	if ((tsp +4) > TNEF_glb.tnef_limit)
	{
		if ((TNEF_VERBOSE)||(TNEF_DEBUG)) LOGGER_log("%s:%d:TNEF_read_32:ERROR: Attempting to read beyond end of memory block",FL);
		return -1;
	}

	a = *tsp;
	b = *(tsp+1);
	c = *(tsp+2);
	d = *(tsp+3);

	*value =  long_little_endian(a<<24 | b<<16 | c<<8 | d);

	return 0;
}

// Assembly:
pushq %rbx
leaq 0x4(%rsi), %rax
cmpq 0x23fee(%rip), %rax     # 0x2f308
jbe 0xb34f
cmpl $0x0, 0x23bc1(%rip)     # 0x2eee4
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jg 0xb333
cmpl $0x0, 0x23bbb(%rip)     # 0x2eeec
jle 0xb355
leaq 0xbfc2(%rip), %rdi      # 0x172fc
leaq 0xc003(%rip), %rsi      # 0x17344
movl $0xfb, %edx
xorl %eax, %eax
callq 0xc84f
jmp 0xb355
movl (%rsi), %eax
movl %eax, (%rdi)
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/tnef/tnef.c
// Function: read_16
int read_16( uint16 *value, uint8 *tsp)
{
	uint8 a,b;

	if (
			((tsp +2) > TNEF_glb.tnef_limit)
//PLD-20070707-17H20, how do we even compare tsp to a negative!?		||(tsp == -1)
			)
	{
		if ((TNEF_VERBOSE)||(TNEF_DEBUG)) LOGGER_log("%s:%d:TNEF_read_16:ERROR: Attempting to read past end\n",FL);
		return -1;
	}

	//	if (TNEF_DEBUG) fprintf(stderr,"Read_16: Offset read %d\n", tsp -tnef_home);

	a = *tsp;
	b = *(tsp + 1);

	*value = little_endian(a<<8 | b);

	return 0;
}

// Assembly:
pushq %rbx
leaq 0x2(%rsi), %rax
cmpq 0x23fa3(%rip), %rax     # 0x2f308
jbe 0xb39a
cmpl $0x0, 0x23b76(%rip)     # 0x2eee4
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jg 0xb37e
cmpl $0x0, 0x23b70(%rip)     # 0x2eeec
jle 0xb3a2
leaq 0xbfc6(%rip), %rdi      # 0x1734b
leaq 0xbfb8(%rip), %rsi      # 0x17344
movl $0x119, %edx            # imm = 0x119
xorl %eax, %eax
callq 0xc84f
jmp 0xb3a2
movzwl (%rsi), %eax
movw %ax, (%rdi)
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/tnef/tnef.c
// Function: save_attach_data
int save_attach_data(char *title, uint8 *tsp, uint32 size)
{
	FILE *out;
	char filename[1024];
	size_t bc;

	snprintf(filename, sizeof(filename),"%s/%s", TNEF_glb.path, title );

	out = fopen(filename, "w");
	if (!out)
	{
		LOGGER_log("%s:%d:TNEF_save_attach_data:ERROR: Failed opening file %s for writing (%s)\n", FL, filename, strerror(errno));
		return -1;
	}

	bc = fwrite(tsp, sizeof(uint8), size, out);
	fclose(out);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r8
leaq 0x7024(%rip), %rdx      # 0x1240c
leaq 0x23b01(%rip), %rcx     # 0x2eef0
xorl %ebx, %ebx
movq %rsp, %r15
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdi
xorl %eax, %eax
callq 0x2140
leaq 0x7b21(%rip), %rsi      # 0x12f2b
movq %r15, %rdi
callq 0x2340
testq %rax, %rax
je 0xb436
movq %rax, %r15
movl %ebp, %edx
movl $0x1, %esi
movq %r14, %rdi
movq %rax, %rcx
callq 0x2390
movq %r15, %rdi
callq 0x20f0
jmp 0xb467
callq 0x2060
movl (%rax), %edi
callq 0x23b0
leaq 0xbf39(%rip), %rdi      # 0x17382
leaq 0xbef4(%rip), %rsi      # 0x17344
movq %rsp, %rcx
movl $0x154, %edx            # imm = 0x154
movq %rax, %r8
xorl %eax, %eax
callq 0xc84f
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/rawget.c
// Function: RAWGET_get
int RAWGET_get( unsigned char *buffer, int max, FILE *f )
{

	unsigned char c;					// read buffer
	int count = 0;						// How many bytes read

	// Special situation here, if we have a return from MIME_headers which indicates
	// that we have data in a MIMEH_pushback, then we need to process that first, before we
	// go back into the data file.

	//

	// Whilst we've got less bytes than the maximum availabe
	// for the buffer, we keep on reading
	//
	while (count < max)
	{
		// If we do infact read in 1 bytes...
		if (fread(&c,1,1,f)==1)
		{

			*buffer = c;		// Set the byte in the buffer
			buffer++;			// move the buffer pointer
			count++;				// Increment the byte cound

			if (c == '\n')		// If we encounter a \n (or \r)
			{
				break;			// Hop out of while loop
			}
		}
		else break;				// if we didn't read right, then jump out as well
	}

	return count;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movl %esi, %ebx
movq %rdi, %r15
xorl %r13d, %r13d
testl %esi, %esi
cmovlel %r13d, %ebx
leaq 0xf(%rsp), %r12
cmpl %r13d, %ebx
je 0xbded
movl $0x1, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %r14, %rcx
callq 0x20c0
cmpq $0x1, %rax
jne 0xbdea
movb 0xf(%rsp), %al
movb %al, (%r15,%r13)
incq %r13
cmpb $0xa, %al
jne 0xbdbb
movl %r13d, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/pldstr.c
// Function: PLD_strstr
char *PLD_strstr(char *haystack, char *needle, int insensitive)
{
    char *hs, *ne;
    char *result;

//  LOGGER_log("%s:%d:\nHS=%s\nNE=%s\nIS=%d\n",FL, haystack, needle, insensitive );

    if (insensitive > 0)
    {
        hs = strdup(haystack);
        PLD_strlower(hs);
        ne = strdup(needle);
        PLD_strlower(ne);
    } else {
        hs = haystack;
        ne = needle;
    }

    result = strstr(hs, ne);
//  if (result) LOGGER_log("%s:%d:HIT: %s",FL, result);
//  else LOGGER_log("%s:%d:MISS (looking for %s|%s)",FL, needle,ne);

    if ((result != NULL)&&(insensitive > 0))
    {
        result = result -hs +haystack;
//      free(hs);
//      free(ne);

//      LOGGER_log("%s:%d:HIT - %s",FL, result );
    }
    if (insensitive) {
        free(hs);
        free(ne);
    }

    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
testl %edx, %edx
jle 0xbe72
movq %rbx, %rdi
callq 0x23a0
movq %rax, %r15
movb (%rax), %al
testb %al, %al
je 0xbe41
leaq 0x1(%r15), %r12
movsbl %al, %edi
callq 0x2290
movb %al, -0x1(%r12)
movb (%r12), %al
incq %r12
testb %al, %al
jne 0xbe29
movq %r14, %rdi
callq 0x23a0
movq %rax, %r14
movb (%rax), %al
testb %al, %al
je 0xbe75
movq %r14, %r12
incq %r12
movsbl %al, %edi
callq 0x2290
movb %al, -0x1(%r12)
movb (%r12), %al
incq %r12
testb %al, %al
jne 0xbe58
jmp 0xbe75
movq %rbx, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x23c0
movq %rax, %r12
testl %ebp, %ebp
je 0xbe97
movq %r15, %rdi
callq 0x2030
movq %r14, %rdi
callq 0x2030
movq %r12, %rax
subq %r15, %rax
addq %rax, %rbx
testq %r12, %r12
cmoveq %r12, %rbx
testl %ebp, %ebp
cmovleq %r12, %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/pldstr.c
// Function: PLD_strncpy
char *PLD_strncpy (char *dst, const char *src, size_t len)
{
    // Thanks go to 'defrost' of #c for providing the replacement
    //      code which you now see here.  It covers the errors better
    //      than my own previous code.

    // If we have no buffer space, then it's futile attempting
    //      to copy anything, just return NULL
    if (len==0) return NULL;

    // Providing our destination pointer isn't NULL, we can
    //      commence copying data across

    if (dst)
    {
        char *dp = dst;
        // If our source string exists, start moving it to the
        //      destination string character at a time.
        if (src)
        {
            char *sp = (char *)src;
            while ((--len)&&(*sp)) { *dp=*sp; dp++; sp++; }
        }
        *dp='\0';
    }
    return dst;
}

// Assembly:
movq %rdi, %rax
testq %rdx, %rdx
sete %cl
testq %rdi, %rdi
sete %dil
orb %cl, %dil
je 0xbef6
xorl %eax, %eax
retq
testq %rsi, %rsi
sete %cl
decq %rdx
sete %dil
orb %cl, %dil
movq %rax, %rcx
jne 0xbf25
xorl %ecx, %ecx
movb (%rsi,%rcx), %dil
testb %dil, %dil
je 0xbf22
movb %dil, (%rax,%rcx)
incq %rcx
cmpq %rcx, %rdx
jne 0xbf0d
addq %rax, %rcx
movb $0x0, (%rcx)
retq
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/pldstr.c
// Function: PLD_strncat
char *PLD_strncat( char *dst, const char *src, size_t len )
{
    char *dp = dst;
    const char *sp = src;
    size_t cc;

    if (len == 0) return dst;
    len--;
    // Locate the end of the current string.
    cc = 0;
    while ((*dp)&&(cc < len)) { dp++; cc++; }
    // If we have no more buffer space, then return the destination
    if (cc >= len) return dst;

    // While we have more source, and there's more char space left in the buffer
    while ((*sp)&&(cc < len))
    {
        cc++;
        *dp = *sp;
        dp++;
        sp++;
    }

    // Terminate dst, as a gaurantee of string ending.
    *dp = '\0';
    return dst;
}

// Assembly:
movq %rdi, %rax
testq %rdx, %rdx
je 0xbfb8
cmpb $0x0, (%rax)
sete %cl
decq %rdx
setne %r8b
sete %dil
orb %cl, %dil
jne 0xbf6e
xorl %ecx, %ecx
movq %rcx, %rdi
incq %rcx
cmpq %rdx, %rcx
setb %r8b
cmpb $0x0, 0x1(%rax,%rdi)
je 0xbf66
cmpq %rdx, %rcx
jb 0xbf4d
movq %rcx, %rdi
addq %rax, %rdi
jmp 0xbf73
xorl %ecx, %ecx
movq %rax, %rdi
testb %r8b, %r8b
je 0xbfb8
movb (%rsi), %r8b
testb %r8b, %r8b
setne %r9b
cmpq %rdx, %rcx
setb %r10b
andb %r9b, %r10b
cmpb $0x1, %r10b
jne 0xbfb5
incq %rcx
incq %rsi
movb %r8b, (%rdi)
incq %rdi
movb (%rsi), %r8b
testb %r8b, %r8b
je 0xbfb5
leaq 0x1(%rcx), %r9
incq %rsi
cmpq %rdx, %rcx
movq %r9, %rcx
jb 0xbf98
movb $0x0, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/pldstr.c
// Function: PLD_strncate
char *PLD_strncate( char *dst, const char *src, size_t len, char *endpoint )
{
    char *dp = dst;
    const char *sp = src;
    size_t cc = 0;

    if (len == 0) return dst;
    len--;
    // If endpoint does not relate correctly, then force manual detection
    // of the endpoint.

    if ((!endpoint)||(endpoint == dst)||((endpoint -dst +1)>(int)len))
    {
        // Locate the end of the current string.
        cc = 0;
        while ((*dp != '\0')&&(cc < len)) { dp++; cc++; }
    }
    else {
        cc = endpoint -dst +1;
        dp = endpoint;
    }

    // If we have no more buffer space, then return the destination
    if (cc >= len) return dst;
    // While we have more source, and there's more char space left in the buffer
    while ((*sp)&&(cc < len))
    {
        cc++;
        *dp = *sp;
        dp++;
        sp++;
    }
    // Terminate dst, as a gaurantee of string ending.
    *dp = '\0';
    return dst;
}

// Assembly:
movq %rdi, %rax
testq %rdx, %rdx
je 0xc04f
decq %rdx
testq %rcx, %rcx
sete %r8b
movq %rcx, %rdi
subq %rax, %rdi
sete %r9b
orb %r8b, %r9b
jne 0xbfeb
movslq %edx, %r8
cmpq %r8, %rdi
jge 0xbfeb
incq %rdi
jmp 0xc01c
cmpb $0x0, (%rax)
sete %cl
testq %rdx, %rdx
sete %dil
orb %cl, %dil
jne 0xc017
xorl %edi, %edi
cmpb $0x0, 0x1(%rax,%rdi)
leaq 0x1(%rdi), %rdi
je 0xc00f
cmpq %rdx, %rdi
jb 0xbfff
movq %rdi, %rcx
addq %rax, %rcx
jmp 0xc01c
xorl %edi, %edi
movq %rax, %rcx
cmpq %rdx, %rdi
jae 0xc04f
movb (%rsi), %r8b
testb %r8b, %r8b
je 0xc04c
incq %rdi
incq %rsi
movb %r8b, (%rcx)
incq %rcx
movb (%rsi), %r8b
testb %r8b, %r8b
je 0xc04c
leaq 0x1(%rdi), %r9
incq %rsi
cmpq %rdx, %rdi
movq %r9, %rdi
jb 0xc02f
movb $0x0, (%rcx)
retq
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/pldstr.c
// Function: PLD_strncasecmp
int PLD_strncasecmp( char *s1, char *s2, int n )
{
    char *ds1 = s1, *ds2 = s2;
    char c1, c2;
    int result = 0;

    while(n > 0)
    {
        c1 = tolower(*ds1);
        c2 = tolower(*ds2);

        if (c1 == c2)
        {
            n--;
            ds1++;
            ds2++;
        }
        else
        {
            result = c2 - c1;
            n = 0;
        }
    }
    return result;
}

// Assembly:
testl %edx, %edx
jle 0xc090
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x23d0
movq (%rax), %rcx
movl %ebp, %edx
xorl %esi, %esi
movsbq (%r14,%rsi), %rax
movsbl (%rcx,%rax,4), %edi
movsbq (%rbx,%rsi), %rax
movsbl (%rcx,%rax,4), %eax
subl %edi, %eax
jne 0xc08b
incq %rsi
cmpl %esi, %edx
jne 0xc06c
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/pldstr.c
// Function: PLD_strreplace
char *PLD_strreplace( char **source, char *searchfor, char *replacewith, int replacenumber )
{
    struct PLD_strreplace replace_details;
    char *tmp_source;

    replace_details.source = *source;
    replace_details.searchfor = searchfor;
    replace_details.replacewith = replacewith;
    replace_details.replacenumber = replacenumber;
    replace_details.preexist = NULL;
    replace_details.postexist = NULL;
    replace_details.insensitive = 0;

    tmp_source = PLD_strreplace_general( &replace_details );

    if (tmp_source != *source) *source = tmp_source;
    return *source;
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
movq (%rdi), %rax
movq %rsp, %rdi
movq %rax, (%rdi)
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movl %ecx, 0x28(%rdi)
movl $0x0, 0x2c(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rdi)
callq 0xc14b
movq (%rbx), %rcx
cmpq %rcx, %rax
je 0xc55d
movq %rax, (%rbx)
movq %rax, %rcx
movq %rcx, %rax
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/logger.c
// Function: LOGGER_set_logfile
int LOGGER_set_logfile( char *lfname )
{
	int result = 0;

	_LOGGER_outf = fopen(lfname,"a");
	if (!_LOGGER_outf)
	{
#ifndef WIN32
		syslog(1,"LOGGER_set_logfile: ERROR - Cannot open logfile '%s' (%s)",lfname,strerror(errno));
#else
		fprintf(stderr, "LOGGER_set_logfile: ERROR - Cannot open logfile '%s' (%s)\n", lfname, strerror(errno));
#endif
		result = -1;
	}

	return result;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0xe56d(%rip), %rsi      # 0x1ac08
callq 0x2340
movq %rax, %rcx
movq %rax, 0x22e86(%rip)     # 0x2f530
xorl %eax, %eax
testq %rcx, %rcx
jne 0xc6db
callq 0x2060
movl (%rax), %edi
callq 0x23b0
leaq 0xb2d0(%rip), %rsi      # 0x17994
movl $0x1, %edi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x22e0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/logger.c
// Function: LOGGER_clean_output
int LOGGER_clean_output( char *string, char **buffer )
{
	char *newstr;
	char *p, *q;
	char *next_space;

	int pc;
	int slen = strlen( string );
	int line_size;
	int maxsize = slen *2;

	// First up, allocate maxsize bytes for a temporary new string.
	newstr = malloc(slen *2 +1); 
	if ( newstr == NULL )
	{
		// FIXME - Report an error here ... to -somewhere-
		return -1;
	}

	p = newstr;
	q = string;
	pc = 0;
	line_size = 0;

	while (slen--)
	{

		// Do we need to apply any wrapping to the output? If so then we
		//		shall embark on a journey of strange space and distance
		//		evaluations to determine if we should wrap now or later

		if ( LOGGER_glb.wrap > 0 )
		{
			if (isspace((int)*q))
			{
				next_space = strpbrk( (q+1), "\t\r\n\v " );
				if (next_space != NULL)
				{
					if ((line_size +(next_space -q)) >= LOGGER_glb.wraplength)
					{
						*p = '\n';
						p++;
						pc++;
						line_size = 0;
					}
				}
			}

			if ( line_size >= LOGGER_glb.wraplength )
			{
				*p = '\n';
				p++;
				pc++;
				line_size = 0;
			}
		}

		// If the string has a % in it, then we need to encode it as
		//	a DOUBLE % symbol.

		if (*q == '%') {
//			if (strchr("fdlsxXn",*(q+1)))
//			{
				*p = '%';
				p++;
				pc++;
//			}
		}

		// Copy the character of the string in
		*p = *q;

		// Move everything along.
		q++;
		p++;
		pc++;
		line_size++;

		if ( pc > (maxsize -1) ) {
			break;
		}
	}

	*p = '\0';

	// This will have to be deallocated later!
	if (newstr) *buffer = newstr;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2110
movq %rax, %r15
leal 0x1(,%rax,2), %eax
movslq %eax, %rdi
callq 0x22a0
testq %rax, %rax
je 0xc83b
movq %rbx, 0x20(%rsp)
leal (%r15,%r15), %ecx
movl 0x22dd7(%rip), %edx     # 0x2f538
movl %edx, 0x8(%rsp)
movslq 0x22dd0(%rip), %rdx     # 0x2f53c
movq %rdx, 0x10(%rsp)
decl %ecx
movl %ecx, 0xc(%rsp)
leaq 0x1(%r14), %r13
negq %r14
xorl %ebp, %ebp
movq %rax, 0x18(%rsp)
movq %rax, %r12
xorl %ebx, %ebx
subl $0x1, %r15d
jb 0xc825
cmpl $0x0, 0x8(%rsp)
jle 0xc7f1
callq 0x23e0
movq (%rax), %rax
movsbq -0x1(%r13), %rcx
testb $0x20, 0x1(%rax,%rcx,2)
je 0xc7df
movq %r13, %rdi
leaq 0xb215(%rip), %rsi      # 0x179ce
callq 0x22f0
testq %rax, %rax
je 0xc7df
movslq %ebx, %rcx
addq %r14, %rcx
addq %rax, %rcx
cmpq 0x10(%rsp), %rcx
jl 0xc7df
movb $0xa, (%r12)
incq %r12
incl %ebp
xorl %ebx, %ebx
cmpl 0x10(%rsp), %ebx
jl 0xc7f1
movb $0xa, (%r12)
incq %r12
incl %ebp
xorl %ebx, %ebx
movb -0x1(%r13), %al
cmpb $0x25, %al
jne 0xc807
movb $0x25, (%r12)
incq %r12
incl %ebp
movb -0x1(%r13), %al
movb %al, (%r12)
incq %r12
leal 0x1(%rbp), %eax
incl %ebx
incq %r13
decq %r14
cmpl 0xc(%rsp), %ebp
movl %eax, %ebp
jl 0xc78a
movb $0x0, (%r12)
movq 0x20(%rsp), %rax
movq 0x18(%rsp), %rcx
movq %rcx, (%rax)
xorl %eax, %eax
jmp 0xc840
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/boundary-stack.c
// Function: BS_clear
int BS_clear( void )
{
	struct BS_node *next;

	while (glb.boundarystack)
	{
		DBS LOGGER_log("%s:%d:BS_clear:DEBUG: Popping off %p",FL,glb.boundarystack);
		next = glb.boundarystack->next;
		free(glb.boundarystack->boundary);
		free(glb.boundarystack);
		glb.boundarystack = next;
	}

	glb.boundarystack = NULL;
	glb.count = 0;
	glb.smallest_length = -1;

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x2235a(%rip), %rbx     # 0x2f578
testq %rbx, %rbx
je 0xd27a
leaq 0xae66(%rip), %r14      # 0x18090
leaq 0xae84(%rip), %r15      # 0x180b5
cmpl $0x0, 0x22318(%rip)     # 0x2f550
je 0xd256
movq %r14, %rdi
movq %r15, %rsi
movl $0xc0, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0xc84f
movq 0x22322(%rip), %rbx     # 0x2f578
movq (%rbx), %rdi
movq 0x10(%rbx), %rbx
callq 0x2030
movq 0x2230f(%rip), %rdi     # 0x2f578
callq 0x2030
movq %rbx, 0x22303(%rip)     # 0x2f578
testq %rbx, %rbx
jne 0xd231
movq $0x0, 0x222f3(%rip) # 0x2f578
movl $0x0, 0x222d1(%rip)     # 0x2f560
movl $0xffffffff, 0x222d3(%rip) # imm = 0xFFFFFFFF
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/boundary-stack.c
// Function: BS_non_hyphen_length
int BS_non_hyphen_length( char *boundary )
{
	int count = 0;
	char *p = boundary;

	while (*p) { if (isalnum((int)*p)) count++; p++; };

	return count;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movb (%rdi), %bpl
testb %bpl, %bpl
je 0xd2d8
movq %rdi, %rbx
callq 0x23e0
movq (%rax), %rcx
incq %rbx
xorl %eax, %eax
movsbq %bpl, %rdx
movzwl (%rcx,%rdx,2), %edx
btl $0x3, %edx
adcl $0x0, %eax
movb (%rbx), %bpl
incq %rbx
testb %bpl, %bpl
jne 0xd2bc
jmp 0xd2da
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq