LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/inflex[P]ripMIME/mime.c
// Function: MIME_set_verbosity
int MIME_set_verbosity( int level )
{
    glb.verbosity = level;
    MIMEH_set_verbosity( level );
    TNEF_set_verbosity( level );
    FNFILTER_set_verbose( level );
    UUENCODE_set_verbosity( level );
    MDECODE_set_verbose( level );
    BS_set_verbose( level );
    return 0;
}

// Assembly:
pushq %rbx
movl %edi, %ebx
movl %edi, 0x1de08(%rip)     # 0x212ec
callq 0x7fab
movl %ebx, %edi
callq 0xb377
movl %ebx, %edi
callq 0xe5b4
movl %ebx, %edi
callq 0xd9a0
movl %ebx, %edi
callq 0xcb30
movl %ebx, %edi
callq 0xd378
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/inflex[P]ripMIME/mime.c
// Function: MIME_set_verbosity_contenttype
int MIME_set_verbosity_contenttype( int level )
{
    glb.verbosity_contenttype = level;
    MIMEH_set_verbosity_contenttype( level );
    UUENCODE_set_verbosity_contenttype( level );
    TNEF_set_verbosity_contenttype( level );
    return glb.verbosity_contenttype;
}

// Assembly:
pushq %rbx
movl %edi, %ebx
movl %edi, 0x1dd12(%rip)     # 0x212f4
callq 0x7fb4
movl %ebx, %edi
callq 0xd9a9
movl %ebx, %edi
callq 0xb380
movl 0x1dcf9(%rip), %eax     # 0x212f4
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/inflex[P]ripMIME/mime.c
// Function: MIME_set_filename_report_fn
int MIME_set_filename_report_fn( int (*ptr_to_fn)(char *, char *) )
{
    glb.filename_decoded_reporter = ptr_to_fn;
    UUENCODE_set_filename_report_fn( ptr_to_fn );
    TNEF_set_filename_report_fn( ptr_to_fn );

    return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq %rdi, 0x20d3e(%rip)     # 0x24358
callq 0xd9c4
movq %rbx, %rdi
callq 0xb389
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/inflex[P]ripMIME/mime.c
// Function: get_random_value
int get_random_value(void) {
    int randval;
    FILE *fp;
    fp = fopen("/dev/urandom", "r");
    fread(&randval, sizeof(randval), 1, fp);
    fclose(fp);
    if (randval < 0) { randval = randval *( -1); };
    return randval;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0xf0ec(%rip), %rdi      # 0x127da
leaq 0x12ddf(%rip), %rsi     # 0x164d4
callq 0x2350
movq %rax, %rbx
leaq 0x4(%rsp), %r14
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rdi
movq %rax, %rcx
callq 0x20c0
movq %rbx, %rdi
callq 0x20f0
movl (%r14), %eax
testl %eax, %eax
jns 0x372c
negl %eax
movl %eax, 0x4(%rsp)
movl 0x4(%rsp), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/inflex[P]ripMIME/mime.c
// Function: MIME_decode_TNEF
int MIME_decode_TNEF( char *unpackdir, struct MIMEH_header_info *hinfo, int keep )
{
    int result=0;
    char fullpath[1024];

    snprintf(fullpath,sizeof(fullpath),"%s/%s",unpackdir,hinfo->filename);
    TNEF_set_path(unpackdir);
    result = TNEF_main( fullpath );

    if (result >= 0)
    {
        //      result = remove( fullpath );
        if (result == -1)
        {
            if (MIME_VERBOSE) LOGGER_log("%s:%d:MIME_decode_TNEF: Removing %s failed (%s)",FL,fullpath,strerror(errno));
        }
    }
    return result;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rdi, %rbx
leaq 0x5efd(%rsi), %r8
leaq 0xe786(%rip), %rdx      # 0x1240c
movq %rsp, %r14
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2140
movq %rbx, %rdi
callq 0xb355
movq %r14, %rdi
callq 0xbc33
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/inflex[P]ripMIME/mime.c
// Function: MIME_decode_OLE
int MIME_decode_OLE( char *unpackdir, struct MIMEH_header_info *hinfo, int keep )
{
    struct OLE_object ole;
    char fullpath[1024];
    int result;

    snprintf(fullpath,sizeof(fullpath),"%s/%s",unpackdir,hinfo->filename);

    OLE_init(&ole);
    OLE_set_quiet(&ole,glb.quiet);
    OLE_set_verbose(&ole,glb.verbosity);
    OLE_set_debug(&ole,glb.debug);
    OLE_set_save_unknown_streams(&ole,0);
    OLE_set_filename_report_fn(&ole, MIME_report_filename_decoded_RIPOLE );

    if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_OLE:DEBUG: Starting OLE Decode",FL);
    result = OLE_decode_file(&ole, fullpath, unpackdir );
    if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_OLE:DEBUG: Decode done, cleaning up.",FL);
    OLE_decode_file_done(&ole);

    if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_OLE:DEBUG: Decode returned with code = %d",FL,result);
    return result;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x888, %rsp            # imm = 0x888
movq %rdi, %rbx
leaq 0x5efd(%rsi), %r8
leaq 0xe725(%rip), %rdx      # 0x1240c
leaq 0x480(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2140
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0xe8e8
movl 0x1d5f3(%rip), %esi     # 0x21304
movq %r14, %rdi
callq 0xe964
movl 0x1d5cd(%rip), %esi     # 0x212ec
movq %r14, %rdi
callq 0xe95b
movl 0x1d5d3(%rip), %esi     # 0x21300
movq %r14, %rdi
callq 0xe978
movq %r14, %rdi
xorl %esi, %esi
callq 0xe9a6
leaq -0x90(%rip), %rsi       # 0x3cb6
movq %r14, %rdi
callq 0xfeed
cmpl $0x0, 0x1d5ab(%rip)     # 0x21300
jle 0x3d71
leaq 0xeccd(%rip), %rdi      # 0x12a2b
leaq 0xe67a(%rip), %rsi      # 0x123df
movl $0x4c8, %edx            # imm = 0x4C8
xorl %eax, %eax
callq 0xc960
leaq 0x8(%rsp), %rdi
leaq 0x480(%rsp), %rsi
movq %rbx, %rdx
callq 0x103bb
movl %eax, %ebx
cmpl $0x0, 0x1d571(%rip)     # 0x21300
jle 0x3dab
leaq 0xecc4(%rip), %rdi      # 0x12a5c
leaq 0xe640(%rip), %rsi      # 0x123df
movl $0x4ca, %edx            # imm = 0x4CA
xorl %eax, %eax
callq 0xc960
leaq 0x8(%rsp), %rdi
callq 0x10029
cmpl $0x0, 0x1d544(%rip)     # 0x21300
jle 0x3dda
leaq 0xecce(%rip), %rdi      # 0x12a93
leaq 0xe613(%rip), %rsi      # 0x123df
movl $0x4cd, %edx            # imm = 0x4CD
movl %ebx, %ecx
xorl %eax, %eax
callq 0xc960
movl %ebx, %eax
addq $0x888, %rsp            # imm = 0x888
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/inflex[P]ripMIME/mime.c
// Function: MIME_decode_64_cleanup
int MIME_decode_64_cleanup( FFGET_FILE *f, char *unpackdir, struct MIMEH_header_info *hinfo)
{
    int result = 0;
    char buffer[128];

    while (FFGET_fgets(buffer, sizeof(buffer), f))
    {
        if (FFGET_feof(f) != 0) break;
        if (BS_cmp(buffer,strlen(buffer)) > 0) break;
    }
    return result;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rdi
movl $0x80, %esi
movq %rbx, %rdx
callq 0x7a09
testq %rax, %rax
je 0x4edc
movq %rbx, %rdi
callq 0x7918
testl %eax, %eax
jne 0x4edc
movq %r14, %rdi
callq 0x2110
movq %r14, %rdi
movl %eax, %esi
callq 0xd799
testl %eax, %eax
jle 0x4ea5
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/inflex[P]ripMIME/mime.c
// Function: MIME_postdecode_cleanup
int MIME_postdecode_cleanup( char *unpackdir, struct SS_object *ss )
{
    char fullpath[256];
    int result;
    result = 0;
    do {
        char *filename;
        if (MIME_DNORMAL) LOGGER_log("%s:%d: Popping file...",FL);
        filename = SS_pop(ss);
        if (filename == NULL) break;
        if (MIME_DNORMAL) LOGGER_log("%s:%d: Popped file '%s'",FL, filename);
        if ( strncmp( glb.blankfileprefix, filename, strlen( glb.blankfileprefix ) ) == 0 )
        {
            snprintf( fullpath, sizeof(fullpath), "%s/%s", unpackdir, filename );
            result = unlink( fullpath );
            if (MIME_VERBOSE)
            {
                if (result == -1) LOGGER_log("Error removing '%s'; %s", fullpath, strerror(errno));
                else LOGGER_log("Removed %s [status = %d]\n", fullpath, result );
            }
        }
    } while (1);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xc20c(%rip), %r12      # 0x123df
leaq 0x1ad0e(%rip), %rbp     # 0x20ee8
movq %rsp, %r13
cmpl $0x0, 0x1b11c(%rip)     # 0x21300
jle 0x61fc
leaq 0xdd24(%rip), %rdi      # 0x13f11
movq %r12, %rsi
movl $0x9cb, %edx            # imm = 0x9CB
xorl %eax, %eax
callq 0xc960
movq %rbx, %rdi
callq 0x33c8
testq %rax, %rax
je 0x62bc
movq %rax, %r15
cmpl $0x0, 0x1b0e9(%rip)     # 0x21300
jle 0x6232
leaq 0xdd08(%rip), %rdi      # 0x13f28
movq %r12, %rsi
movl $0x9ce, %edx            # imm = 0x9CE
movq %r15, %rcx
xorl %eax, %eax
callq 0xc960
movq %rbp, %rdi
callq 0x2110
movq %rbp, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x20a0
testl %eax, %eax
je 0x6253
testq %r15, %r15
jne 0x61dd
jmp 0x62bc
movl $0x100, %esi            # imm = 0x100
movq %r13, %rdi
leaq 0xc1aa(%rip), %rdx      # 0x1240c
movq %r14, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x2140
movq %r13, %rdi
callq 0x2070
cmpl $0x0, 0x1b06e(%rip)     # 0x212ec
jle 0x624c
cmpl $-0x1, %eax
je 0x629a
leaq 0xdccc(%rip), %rdi      # 0x13f58
movq %r13, %rsi
movl %eax, %edx
xorl %eax, %eax
callq 0xc960
jmp 0x624c
callq 0x2060
movl (%rax), %edi
callq 0x23c0
leaq 0xdc93(%rip), %rdi      # 0x13f40
movq %r13, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xc960
jmp 0x624c
xorl %eax, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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, 0x1a339(%rip)     # 0x21300
jle 0x6fe3
leaq 0xd2c1(%rip), %rdi      # 0x14291
leaq 0xb408(%rip), %rsi      # 0x123df
movl $0xa79, %edx            # imm = 0xA79
xorl %eax, %eax
callq 0xc960
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x5888
movl %eax, %r12d
cmpl $0xf1, %eax
je 0x7003
testl %r12d, %r12d
jne 0x7061
leaq 0x5efd(%r14), %r8
leaq 0xb3fb(%rip), %rdx      # 0x1240c
movl $0x27f7, %esi           # imm = 0x27F7
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x2140
movq %r14, %rdi
callq 0x39e8
testl %eax, %eax
je 0x7061
movl 0x1ab17(%rip), %edi     # 0x21b4c
testl %edi, %edi
je 0x703e
callq 0x8026
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
movq %rbx, %rcx
callq 0x5fde
movl %eax, %r12d
cmpl $0x0, 0x1aaf4(%rip)     # 0x21b4c
je 0x7061
xorl %edi, %edi
callq 0x8026
movl %r12d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inflex[P]ripMIME/ffget.c
// Function: FFGET_presetbuffer
int FFGET_presetbuffer( FFGET_FILE *f, char *buffer, int size )
{
	if (size > FFGET_BUFFER_MAX) size = FFGET_BUFFER_MAX;

	memcpy(f->buffer,buffer,size);
	f->startpoint = buffer;
	f->endpoint = buffer +size;
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0x2000, %eax           # imm = 0x2000
cmpl %eax, %edx
cmovll %edx, %eax
addq $0x8, %rdi
movslq %eax, %r15
movq %r15, %rdx
callq 0x2270
movq %rbx, 0x2010(%r14)
addq %r15, %rbx
movq %rbx, 0x2018(%r14)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/inflex[P]ripMIME/ffget.c
// Function: FFGET_setstream
int FFGET_setstream( FFGET_FILE *f, FILE *fi )
{

//	memset(f,0,sizeof(FFGET_FILE)); // be pedantic - clear the struct

	f->f = fi;
	f->bytes = 0;
	f->linecount = 0;
	f->endpoint = f->buffer;
	f->startpoint = f->endpoint +1;
	f->buffer_end = f->buffer +FFGET_BUFFER_MAX +FFGET_BUFFER_PADDING;
	f->trueblank = 0;
	f->ungetcset = 0;
	f->lastchar = '\0';
	memset(f->buffer,'\0',FFGET_BUFFER_MAX +FFGET_BUFFER_PADDING);
	f->c = '\0';
	f->FFEOF = 0;
	f->FILEEND = 0;
	f->last_block_read_from = -1;
	f->linebreak = FFGET_LINEBREAK_NONE;
	f->lastbreak[0] = '\0';
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsi, (%rdi)
addq $0x8, %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x2040(%rbx)
movq %rdi, 0x2018(%rbx)
leaq 0x9(%rbx), %rax
movq %rax, 0x2010(%rbx)
leaq 0x2009(%rbx), %rax
movq %rax, 0x2020(%rbx)
xorl %r14d, %r14d
movl $0x2001, %edx           # imm = 0x2001
xorl %esi, %esi
callq 0x2170
movq %r14, 0x2030(%rbx)
movb %r14b, 0x2038(%rbx)
movq %r14, 0x2050(%rbx)
movb %r14b, 0x2058(%rbx)
movq $-0x1, 0x2028(%rbx)
movl $0x0, 0x205c(%rbx)
movb %r14b, 0x2060(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x2310
cmpl $-0x1, %eax
je 0x7946
movq %r15, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x76ff
callq 0x2060
movl (%rax), %edi
callq 0x23c0
leaq 0xd829(%rip), %rdi      # 0x15182
leaq 0xd7e1(%rip), %rsi      # 0x15141
movl $0x128, %edx            # imm = 0x128
movq %r14, %rcx
movl %ebx, %r8d
movq %rax, %r9
xorl %eax, %eax
callq 0xc960
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x8075
movl %esi, %ecx
movl %esi, %eax
incl 0x18b98(%rdi,%rax,4)
incl 0x18d28(%rdi)
cmpl $0x0, 0x24340(%rip)     # 0x2c38c
jle 0x8075
pushq %rax
movl 0x18b98(%rdi,%rax,4), %r8d
leaq 0xd210(%rip), %rdi      # 0x1526e
leaq 0xd249(%rip), %rsi      # 0x152ae
movl $0x25f, %edx            # imm = 0x25F
xorl %eax, %eax
callq 0xc960
addq $0x8, %rsp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xe43e(%rip), %rsi      # 0x164d4
callq 0x2350
movl $0x1, %ebx
testq %rax, %rax
je 0x80e2
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 0x80e0
cmpb $0x0, -0x1(%rsp,%rax)
movq %rcx, %rax
jne 0x80ce
jmp 0x80e2
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xf107(%rip), %rsi      # 0x17210
movq %rsp, %rbx
movl $0xe, %ecx
movq %rbx, %rdi
rep  movsq (%rsi), %es:(%rdi)
movl 0x2426f(%rip), %eax     # 0x2c38c
testq %r14, %r14
je 0x8203
testl %eax, %eax
jle 0x8147
leaq 0xd1c3(%rip), %rdi      # 0x152f4
leaq 0xd176(%rip), %rsi      # 0x152ae
movl $0x2ba, %edx            # imm = 0x2BA
movq %r14, %rcx
xorl %eax, %eax
callq 0xc960
movq %r14, %rdi
callq 0x23b0
testq %rax, %rax
je 0x8219
movq %rax, %r14
movq %rax, %rdi
callq 0xbf91
cmpl $0x0, 0x24222(%rip)     # 0x2c38c
jle 0x8189
leaq 0xd1b3(%rip), %rdi      # 0x15326
leaq 0xd134(%rip), %rsi      # 0x152ae
movl $0x2c2, %edx            # imm = 0x2C2
movq %r14, %rcx
xorl %eax, %eax
callq 0xc960
leaq 0xd1d7(%rip), %r15      # 0x15367
leaq 0xd117(%rip), %r12      # 0x152ae
xorl %r13d, %r13d
xorl %ebp, %ebp
cmpl $0x0, 0x241e9(%rip)     # 0x2c38c
jle 0x81bd
movq %r15, %rdi
movq %r12, %rsi
movl $0x2c8, %edx            # imm = 0x2C8
movl %r13d, %ecx
movq %rbx, %r8
xorl %eax, %eax
callq 0xc960
movq %r14, %rdi
movq %rbx, %rsi
callq 0x23d0
testq %rax, %rax
je 0x81ec
cmpq %r14, %rax
jbe 0x81e4
movzbl -0x1(%rax), %eax
cmpl $0xd, %eax
je 0x81e0
cmpl $0xa, %eax
jne 0x81ec
incl %ebp
jmp 0x81ec
sete %al
movzbl %al, %eax
addl %eax, %ebp
incq %r13
addq $0x10, %rbx
cmpq $0x6, %r13
jne 0x819c
movq %r14, %rdi
callq 0x2030
jmp 0x821b
testl %eax, %eax
jle 0x8219
leaq 0xd0af(%rip), %rdi      # 0x152bd
xorl %ebp, %ebp
xorl %eax, %eax
callq 0xc960
jmp 0x821b
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_O1/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 0x1c941(%rip), %r14     # 0x24b88
leaq 0xd15e(%rip), %r15      # 0x153ac
leaq 0x24157(%rip), %r12     # 0x2c3ac
leaq 0x8(%rsp), %r13
movl 0x24133(%rip), %r8d     # 0x2c394
incl %r8d
movl %r8d, 0x24129(%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 0x2250
testl %eax, %eax
je 0x825a
leaq 0x1c8f2(%rip), %rdi     # 0x24b88
leaq 0xac5e(%rip), %rsi      # 0x12efb
callq 0x2350
testq %rax, %rax
je 0x8304
movq %rax, %r14
cmpl $0x0, 0x240db(%rip)     # 0x2c38c
jle 0x82d4
leaq 0xd144(%rip), %rdi      # 0x153fe
leaq 0xcfed(%rip), %rsi      # 0x152ae
leaq 0x1c8c0(%rip), %rcx     # 0x24b88
movl $0x2ff, %edx            # imm = 0x2FF
xorl %eax, %eax
callq 0xc960
movq %rbx, %rdi
callq 0x79ad
movl %eax, %ebp
movsbl %al, %edi
movq %r14, %rsi
callq 0x21c0
cmpb $-0x1, %bpl
je 0x82f8
movzbl %bpl, %eax
cmpl $0xa, %eax
jne 0x82d4
movq %r14, %rdi
callq 0x20f0
xorl %eax, %eax
jmp 0x8339
callq 0x2060
movl (%rax), %edi
callq 0x23c0
leaq 0xd0a4(%rip), %rdi      # 0x153bb
leaq 0xcf90(%rip), %rsi      # 0x152ae
leaq 0x1c863(%rip), %rcx     # 0x24b88
movl $0x2fb, %edx            # imm = 0x2FB
movq %rax, %r8
xorl %eax, %eax
callq 0xc960
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_O1/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, %r15
movq %rdi, %rbx
callq 0x23b0
movq %rax, %r14
movq %rax, %rdi
callq 0xbf91
movq %r15, %rdi
callq 0x23b0
movq %rax, %r15
movq %rax, %rdi
callq 0xbf91
testq %r14, %r14
sete %al
testq %r15, %r15
sete %cl
orb %al, %cl
jne 0x85f1
movq %r14, %rdi
movq %r15, %rsi
callq 0x23d0
subq %r14, %rax
addq %rax, %rbx
jmp 0x85f3
xorl %ebx, %ebx
testq %r14, %r14
je 0x8600
movq %r14, %rdi
callq 0x2030
testq %r15, %r15
je 0x860d
movq %r15, %rdi
callq 0x2030
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x863b
leaq 0x1(%rbx), %r14
leaq 0xcf1f(%rip), %rsi      # 0x1554d
movq %r14, %rdi
callq 0x85a0
cmpq %r14, %rax
je 0x865d
cmpb $0x0, 0x2(%rbx)
je 0x8659
addq $0x2, %rbx
leaq 0xcf01(%rip), %rsi      # 0x1554d
movq %rbx, %rdi
callq 0x85a0
cmpq %rbx, %rax
je 0x865d
xorl %eax, %eax
jmp 0x8662
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x9059
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 0xccf1(%rip), %rdi      # 0x15d1e
leaq 0xc27a(%rip), %rsi      # 0x152ae
movl $0x528, %edx            # imm = 0x528
xorl %eax, %eax
pushq %rbx
pushq %r11
pushq %r10
callq 0xc960
addq $0x20, %rsp
movq 0x16f80(%rip), %rax     # 0x1ffd0
movq (%rax), %rdi
callq 0x22d0
popq %rbx
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x23322(%rip)     # 0x2c38c
jle 0x9089
leaq 0xcd89(%rip), %rdi      # 0x15dfc
leaq 0xc234(%rip), %rsi      # 0x152ae
movl $0x54a, %edx            # imm = 0x54A
movq %rbx, %rcx
xorl %eax, %eax
callq 0xc960
movb (%rbx), %al
xorl %ebp, %ebp
movq %rbx, %r14
testb %al, %al
je 0x90b8
movl %ebp, %ecx
xorl %ebp, %ebp
cmpb $0x27, %al
movb 0x1(%r14), %al
leaq 0x1(%r14), %r14
sete %bpl
addl %ecx, %ebp
testb %al, %al
je 0x90b1
cmpl $0x2, %ebp
jne 0x9094
cmpl $0x2, %ebp
setae %bpl
testb %bpl, %bpl
cmoveq %rbx, %r14
movq %r14, %rdi
callq 0xce43
testb %bpl, %bpl
je 0x90e4
movb (%r14), %al
testb %al, %al
je 0x90e1
movb %al, (%rbx)
incq %rbx
movb 0x1(%r14), %al
incq %r14
jmp 0x90cf
movb $0x0, (%rbx)
cmpl $0x0, 0x232a1(%rip)     # 0x2c38c
jle 0x910a
leaq 0xcd4b(%rip), %rdi      # 0x15e3f
leaq 0xc1b3(%rip), %rsi      # 0x152ae
movl $0x562, %edx            # imm = 0x562
movq %r14, %rcx
xorl %eax, %eax
callq 0xc960
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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, %r14
movq %rdi, %r15
callq 0xbf91
leaq 0xc69e(%rip), %rsi      # 0x167a2
movq %r15, %rdi
callq 0x23d0
testq %rax, %rax
je 0xa1fa
incl 0x18d30(%rbx)
cmpl $0x0, 0x2226a(%rip)     # 0x2c38c
jle 0xa141
leaq 0xc688(%rip), %rdi      # 0x167b3
leaq 0xb17c(%rip), %rsi      # 0x152ae
movl $0x8ae, %edx            # imm = 0x8AE
movq %r14, %rcx
xorl %eax, %eax
callq 0xc960
testq %r14, %r14
je 0xa165
leaq 0xc6b2(%rip), %r15      # 0x167ff
movq %r14, %rdi
movq %r15, %rsi
callq 0x2300
leaq 0x1(%rax), %rcx
testq %rax, %rax
cmovneq %rcx, %r14
jne 0xa14d
testq %r14, %r14
je 0xa1fa
cmpl $0x0, 0x22217(%rip)     # 0x2c38c
jle 0xa194
leaq 0xc684(%rip), %rdi      # 0x16802
leaq 0xb129(%rip), %rsi      # 0x152ae
movl $0x8ba, %edx            # imm = 0x8BA
movq %r14, %rcx
xorl %eax, %eax
callq 0xc960
leaq 0x6efe(%rbx), %rdi
leaq 0xdeeb(%rip), %r15      # 0x1808d
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 0xe6c5
addq $0x15ec8, %rbx          # imm = 0x15EC8
movq %r12, %rdi
callq 0x2110
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x331f
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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, %r14
movq %r8, %r12
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, 0x8(%rsp)
movq %rdi, %r13
cmpl $0x0, 0x21c1f(%rip)     # 0x2c38c
jle 0xa78f
leaq 0xc397(%rip), %rdi      # 0x16b0d
leaq 0xab31(%rip), %rsi      # 0x152ae
movl $0x9e4, %edx            # imm = 0x9E4
movq %rbx, %rcx
movq %r13, %r8
xorl %eax, %eax
callq 0xc960
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %r14, %r14
je 0xa856
testq %r12, %r12
je 0xa856
cmpq $0x0, 0x8(%rsp)
je 0xa856
testq %r13, %r13
je 0xa856
testq %r15, %r15
je 0xa856
movq %r15, 0x10(%rsp)
testq %rbx, %rbx
je 0xa856
movq %rbx, %rdi
callq 0x2110
movslq %eax, %r15
movq %r13, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x20a0
xorl %ebp, %ebp
testl %eax, %eax
jne 0xa856
movzbl (%r13,%r15), %eax
cmpq $0x3a, %rax
ja 0xa856
movabsq $0x400000100000201, %rcx # imm = 0x400000100000201
btq %rax, %rcx
jae 0xa856
cmpl $0x0, 0x21b78(%rip)     # 0x2c38c
jle 0xa830
leaq 0xc328(%rip), %rdi      # 0x16b45
leaq 0xaa8a(%rip), %rsi      # 0x152ae
movl $0x9f7, %edx            # imm = 0x9F7
xorl %eax, %eax
callq 0xc960
leaq 0xd856(%rip), %rdx      # 0x1808d
xorl %ebp, %ebp
movq %r12, %rdi
movq %r14, %rsi
movq 0x8(%rsp), %rcx
xorl %eax, %eax
callq 0x2140
movq 0x10(%rsp), %rax
incl 0x18d30(%rax)
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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, 0x2130b(%rip)     # 0x2c38c
jle 0xb0a3
leaq 0xbf3e(%rip), %rdi      # 0x16fc8
leaq 0xa21d(%rip), %rsi      # 0x152ae
movl $0xc18, %edx            # imm = 0xC18
movq %r14, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0xc960
movl $0x0, 0x18d30(%rbx)
cmpl $0x0, 0x212d8(%rip)     # 0x2c38c
jle 0xb0d0
leaq 0xbf44(%rip), %rdi      # 0x17001
leaq 0xa1ea(%rip), %rsi      # 0x152ae
movl $0xc1e, %edx            # imm = 0xC1E
xorl %eax, %eax
callq 0xc960
movq %rbx, %rdi
movq %r14, %rsi
callq 0xae87
movl %eax, %ebp
cmpl $0x0, 0x212a8(%rip)     # 0x2c38c
jle 0xb100
leaq 0xbf45(%rip), %rdi      # 0x17032
leaq 0xa1ba(%rip), %rsi      # 0x152ae
movl $0xc20, %edx            # imm = 0xC20
xorl %eax, %eax
callq 0xc960
testl %ebp, %ebp
jne 0xb115
movq 0x21265(%rip), %rsi     # 0x2c370
movq %rbx, %rdi
callq 0xa97b
xorl %ebp, %ebp
cmpl $0x0, 0x21270(%rip)     # 0x2c38c
jle 0xb138
leaq 0xbf41(%rip), %rdi      # 0x17066
leaq 0xa182(%rip), %rsi      # 0x152ae
movl $0xc22, %edx            # imm = 0xC22
xorl %eax, %eax
callq 0xc960
testl %ebp, %ebp
jne 0xb143
callq 0xb033
xorl %ebp, %ebp
cmpl $0x0, 0x21242(%rip)     # 0x2c38c
jle 0xb173
movl 0x18d30(%rbx), %r9d
leaq 0xbf40(%rip), %rdi      # 0x1709a
leaq 0xa14d(%rip), %rsi      # 0x152ae
movl $0xc24, %edx            # imm = 0xC24
movq %r14, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0xc960
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xbf50(%rip), %rdi      # 0x170dc
callq 0x23b0
movq %rax, 0x23a68(%rip)     # 0x2ec00
leaq 0xbf50(%rip), %rdi      # 0x170ef
callq 0x23b0
movq %rax, 0x23a4d(%rip)     # 0x2ebf8
leaq 0xbf56(%rip), %rdi      # 0x17108
callq 0x23b0
movq %rax, 0x23a32(%rip)     # 0x2ebf0
leaq 0xbf5d(%rip), %rdi      # 0x17122
callq 0x23b0
movq %rax, 0x23a17(%rip)     # 0x2ebe8
leaq 0xbf5d(%rip), %rdi      # 0x17135
callq 0x23b0
movq %rax, 0x239fc(%rip)     # 0x2ebe0
leaq 0xbf64(%rip), %rdi      # 0x1714f
callq 0x23b0
movq %rax, 0x239e1(%rip)     # 0x2ebd8
leaq 0xbf6c(%rip), %rdi      # 0x1716a
callq 0x23b0
movq %rax, 0x239c6(%rip)     # 0x2ebd0
leaq 0xbf6b(%rip), %rdi      # 0x1717c
callq 0x23b0
movq %rax, 0x239ab(%rip)     # 0x2ebc8
leaq 0xbf68(%rip), %rdi      # 0x1718c
callq 0x23b0
movq %rax, 0x239d8(%rip)     # 0x2ec08
leaq 0xbf64(%rip), %rdi      # 0x1719b
callq 0x23b0
movq %rax, 0x239cd(%rip)     # 0x2ec10
addq $0x18b98, %rbx          # imm = 0x18B98
leaq 0x2396f(%rip), %r15     # 0x2ebc0
leaq 0xbf56(%rip), %r14      # 0x171ae
xorl %r12d, %r12d
movl (%rbx), %edx
testl %edx, %edx
jle 0xb26f
movq (%r12,%r15), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0xc960
addq $0x8, %r12
addq $0x4, %rbx
cmpq $0x320, %r12            # imm = 0x320
jne 0xb25b
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xb226(%rip), %rsi      # 0x164d4
callq 0x2350
testq %rax, %rax
je 0xb2de
movq %rax, %r15
movq %rsp, %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x787b
movq %rbx, %rdi
movq %r14, %rsi
callq 0xb070
movq %r15, %rdi
callq 0x20f0
jmp 0xb30a
callq 0x2060
movl (%rax), %edi
callq 0x23c0
leaq 0xbed3(%rip), %rdi      # 0x171c4
leaq 0x9fb6(%rip), %rsi      # 0x152ae
movl $0xc82, %edx            # imm = 0xC82
movq %rbx, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xc960
xorl %eax, %eax
addq $0x2070, %rsp           # imm = 0x2070
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/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 0x6f90(%rip), %rdx      # 0x1240c
leaq 0x23a6d(%rip), %rcx     # 0x2eef0
xorl %ebx, %ebx
movq %rsp, %r15
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdi
xorl %eax, %eax
callq 0x2140
leaq 0x7a5d(%rip), %rsi      # 0x12efb
movq %r15, %rdi
callq 0x2350
testq %rax, %rax
je 0xb4ca
movq %rax, %r15
movl %ebp, %edx
movl $0x1, %esi
movq %r14, %rdi
movq %rax, %rcx
callq 0x23a0
movq %r15, %rdi
callq 0x20f0
jmp 0xb4fb
callq 0x2060
movl (%rax), %edi
callq 0x23c0
leaq 0xbe75(%rip), %rdi      # 0x17352
leaq 0xbe30(%rip), %rsi      # 0x17314
movq %rsp, %rcx
movl $0x154, %edx            # imm = 0x154
movq %rax, %r8
xorl %eax, %eax
callq 0xc960
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_O1/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 0xbec5
movl $0x1, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %r14, %rcx
callq 0x20c0
cmpq $0x1, %rax
jne 0xbec2
movb 0xf(%rsp), %al
movb %al, (%r15,%r13)
incq %r13
cmpb $0xa, %al
jne 0xbe93
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_O1/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 0xbf4a
movq %rbx, %rdi
callq 0x23b0
movq %rax, %r15
movb (%rax), %al
testb %al, %al
je 0xbf19
leaq 0x1(%r15), %r12
movsbl %al, %edi
callq 0x22a0
movb %al, -0x1(%r12)
movb (%r12), %al
incq %r12
testb %al, %al
jne 0xbf01
movq %r14, %rdi
callq 0x23b0
movq %rax, %r14
movb (%rax), %al
testb %al, %al
je 0xbf4d
movq %r14, %r12
incq %r12
movsbl %al, %edi
callq 0x22a0
movb %al, -0x1(%r12)
movb (%r12), %al
incq %r12
testb %al, %al
jne 0xbf30
jmp 0xbf4d
movq %rbx, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x23d0
movq %rax, %r12
testl %ebp, %ebp
je 0xbf6f
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_O1/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 0xc088
cmpb $0x0, (%rax)
sete %cl
decq %rdx
setne %r8b
sete %dil
orb %cl, %dil
jne 0xc03e
xorl %ecx, %ecx
movq %rcx, %rdi
incq %rcx
cmpq %rdx, %rcx
setb %r8b
cmpb $0x0, 0x1(%rax,%rdi)
je 0xc036
cmpq %rdx, %rcx
jb 0xc01d
movq %rcx, %rdi
addq %rax, %rdi
jmp 0xc043
xorl %ecx, %ecx
movq %rax, %rdi
testb %r8b, %r8b
je 0xc088
movb (%rsi), %r8b
testb %r8b, %r8b
setne %r9b
cmpq %rdx, %rcx
setb %r10b
andb %r9b, %r10b
cmpb $0x1, %r10b
jne 0xc085
incq %rcx
incq %rsi
movb %r8b, (%rdi)
incq %rdi
movb (%rsi), %r8b
testb %r8b, %r8b
je 0xc085
leaq 0x1(%rcx), %r9
incq %rsi
cmpq %rdx, %rcx
movq %r9, %rcx
jb 0xc068
movb $0x0, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xc11f
decq %rdx
testq %rcx, %rcx
sete %r8b
movq %rcx, %rdi
subq %rax, %rdi
sete %r9b
orb %r8b, %r9b
jne 0xc0bb
movslq %edx, %r8
cmpq %r8, %rdi
jge 0xc0bb
incq %rdi
jmp 0xc0ec
cmpb $0x0, (%rax)
sete %cl
testq %rdx, %rdx
sete %dil
orb %cl, %dil
jne 0xc0e7
xorl %edi, %edi
cmpb $0x0, 0x1(%rax,%rdi)
leaq 0x1(%rdi), %rdi
je 0xc0df
cmpq %rdx, %rdi
jb 0xc0cf
movq %rdi, %rcx
addq %rax, %rcx
jmp 0xc0ec
xorl %edi, %edi
movq %rax, %rcx
cmpq %rdx, %rdi
jae 0xc11f
movb (%rsi), %r8b
testb %r8b, %r8b
je 0xc11c
incq %rdi
incq %rsi
movb %r8b, (%rcx)
incq %rcx
movb (%rsi), %r8b
testb %r8b, %r8b
je 0xc11c
leaq 0x1(%rdi), %r9
incq %rsi
cmpq %rdx, %rdi
movq %r9, %rdi
jb 0xc0ff
movb $0x0, (%rcx)
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xc165
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x23e0
movq (%rax), %rcx
xorl %eax, %eax
movsbq (%r14), %rdx
movsbl (%rcx,%rdx,4), %esi
movsbq (%rbx), %rdx
movsbl (%rcx,%rdx,4), %edx
subl %esi, %edx
jne 0xc158
decl %ebp
incq %r14
incq %rbx
jmp 0xc15c
xorl %ebp, %ebp
movl %edx, %eax
testl %ebp, %ebp
jg 0xc13a
popq %rbx
popq %r14
popq %rbp
retq
xorl %eax, %eax
retq