LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0xd8f3(%rip), %rdx      # 0x1140c
movq %rsp, %r14
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2140
movq %rbx, %rdi
callq 0xaede
movq %r14, %rdi
callq 0xb719
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xd892(%rip), %rdx      # 0x1140c
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 0xe170
movl 0x1c760(%rip), %esi     # 0x20304
movq %r14, %rdi
callq 0xe1f4
movl 0x1c73a(%rip), %esi     # 0x202ec
movq %r14, %rdi
callq 0xe1eb
movl 0x1c740(%rip), %esi     # 0x20300
movq %r14, %rdi
callq 0xe205
movq %r14, %rdi
xorl %esi, %esi
callq 0xe233
leaq -0x90(%rip), %rsi       # 0x3b49
movq %r14, %rdi
callq 0xf695
cmpl $0x0, 0x1c718(%rip)     # 0x20300
jle 0x3c04
leaq 0xde6a(%rip), %rdi      # 0x11a5b
leaq 0xd7e7(%rip), %rsi      # 0x113df
movl $0x4c8, %edx            # imm = 0x4C8
xorl %eax, %eax
callq 0xc2a1
leaq 0x8(%rsp), %rdi
leaq 0x480(%rsp), %rsi
movq %rbx, %rdx
callq 0xfb3c
movl %eax, %ebx
cmpl $0x0, 0x1c6de(%rip)     # 0x20300
jle 0x3c3e
leaq 0xde61(%rip), %rdi      # 0x11a8c
leaq 0xd7ad(%rip), %rsi      # 0x113df
movl $0x4ca, %edx            # imm = 0x4CA
xorl %eax, %eax
callq 0xc2a1
leaq 0x8(%rsp), %rdi
callq 0xf7c4
cmpl $0x0, 0x1c6b1(%rip)     # 0x20300
jle 0x3c6d
leaq 0xde6b(%rip), %rdi      # 0x11ac3
leaq 0xd780(%rip), %rsi      # 0x113df
movl $0x4cd, %edx            # imm = 0x4CD
movl %ebx, %ecx
xorl %eax, %eax
callq 0xc2a1
movl %ebx, %eax
addq $0x888, %rsp            # imm = 0x888
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x76f2
testq %rax, %rax
je 0x4cf2
movq %rbx, %rdi
callq 0x7606
testl %eax, %eax
jne 0x4cf2
movq %r14, %rdi
callq 0x2110
movq %r14, %rdi
movl %eax, %esi
callq 0xcfc7
testl %eax, %eax
jle 0x4cbb
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xb4bf(%rip), %r12      # 0x113df
leaq 0x19fc1(%rip), %rbp     # 0x1fee8
movq %rsp, %r13
cmpl $0x0, 0x1a3cf(%rip)     # 0x20300
jle 0x5f49
leaq 0xd007(%rip), %rdi      # 0x12f41
movq %r12, %rsi
movl $0x9cb, %edx            # imm = 0x9CB
xorl %eax, %eax
callq 0xc2a1
movq %rbx, %rdi
callq 0x3269
testq %rax, %rax
je 0x600c
movq %rax, %r15
cmpl $0x0, 0x1a39c(%rip)     # 0x20300
jle 0x5f7f
leaq 0xcfeb(%rip), %rdi      # 0x12f58
movq %r12, %rsi
movl $0x9ce, %edx            # imm = 0x9CE
movq %r15, %rcx
xorl %eax, %eax
callq 0xc2a1
movq %rbp, %rdi
callq 0x2110
movq %rbp, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x20a0
testl %eax, %eax
jne 0x5f2a
movl $0x100, %esi            # imm = 0x100
movq %r13, %rdi
leaq 0xb464(%rip), %rdx      # 0x1140c
movq %r14, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x2140
movq %r13, %rdi
callq 0x2070
cmpl $0x0, 0x1a328(%rip)     # 0x202ec
jle 0x5f2a
cmpl $-0x1, %eax
je 0x5fe7
leaq 0xcfb2(%rip), %rdi      # 0x12f88
movq %r13, %rsi
movl %eax, %edx
xorl %eax, %eax
callq 0xc2a1
jmp 0x5f2a
callq 0x2060
movl (%rax), %edi
callq 0x23c0
leaq 0xcf76(%rip), %rdi      # 0x12f70
movq %r13, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xc2a1
jmp 0x5f2a
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_O2/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, 0x19603(%rip)     # 0x20300
jle 0x6d19
leaq 0xc5bb(%rip), %rdi      # 0x132c1
leaq 0xa6d2(%rip), %rsi      # 0x113df
movl $0xa79, %edx            # imm = 0xA79
xorl %eax, %eax
callq 0xc2a1
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x561f
movl %eax, %r12d
cmpl $0xf1, %eax
je 0x6d39
testl %r12d, %r12d
jne 0x6d97
leaq 0x5efd(%r14), %r8
leaq 0xa6c5(%rip), %rdx      # 0x1140c
movl $0x27f7, %esi           # imm = 0x27F7
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x2140
movq %r14, %rdi
callq 0x3874
testl %eax, %eax
je 0x6d97
movl 0x19de1(%rip), %edi     # 0x20b4c
testl %edi, %edi
je 0x6d74
callq 0x7cff
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
movq %rbx, %rcx
callq 0x5d29
movl %eax, %r12d
cmpl $0x0, 0x19dbe(%rip)     # 0x20b4c
je 0x6d97
xorl %edi, %edi
callq 0x7cff
movl %r12d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x2260
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_O2/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 %rbp
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 %ebp, %ebp
movl $0x2001, %edx           # imm = 0x2001
xorl %esi, %esi
callq 0x2170
andq $0x0, 0x2030(%rbx)
movb %bpl, 0x2038(%rbx)
andq $0x0, 0x2050(%rbx)
movb %bpl, 0x2058(%rbx)
orq $-0x1, 0x2028(%rbx)
andl $0x0, 0x205c(%rbx)
movb %bpl, 0x2060(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x7634
movq %r15, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x73f7
callq 0x2060
movl (%rax), %edi
callq 0x23c0
leaq 0xcb6b(%rip), %rdi      # 0x141b2
leaq 0xcb23(%rip), %rsi      # 0x14171
movl $0x128, %edx            # imm = 0x128
movq %r14, %rcx
movl %ebx, %r8d
movq %rax, %r9
xorl %eax, %eax
callq 0xc2a1
pushq $-0x1
popq %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x7d4e
movl %esi, %ecx
movl %esi, %eax
incl 0x18b98(%rdi,%rax,4)
incl 0x18d28(%rdi)
cmpl $0x0, 0x23667(%rip)     # 0x2b38c
jle 0x7d4e
pushq %rax
movl 0x18b98(%rdi,%rax,4), %r8d
leaq 0xc567(%rip), %rdi      # 0x1429e
leaq 0xc5a0(%rip), %rsi      # 0x142de
movl $0x25f, %edx            # imm = 0x25F
xorl %eax, %eax
callq 0xc2a1
addq $0x8, %rsp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xd795(%rip), %rsi      # 0x15504
callq 0x2350
pushq $0x1
popq %rbx
testq %rax, %rax
je 0x7db7
movq %rax, %r14
movq %rsp, %rdi
pushq $0x1
popq %rsi
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 0x7db5
cmpb $0x0, -0x1(%rsp,%rax)
movq %rcx, %rax
jne 0x7da3
jmp 0x7db7
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xe462(%rip), %rsi      # 0x16240
pushq $0xe
popq %rcx
movq %rsp, %rbx
movq %rbx, %rdi
rep  movsq (%rsi), %es:(%rdi)
movl 0x2359c(%rip), %eax     # 0x2b38c
testq %r14, %r14
je 0x7ed8
testl %eax, %eax
jle 0x7e1a
leaq 0xc520(%rip), %rdi      # 0x14324
leaq 0xc4d3(%rip), %rsi      # 0x142de
movl $0x2ba, %edx            # imm = 0x2BA
movq %r14, %rcx
xorl %eax, %eax
callq 0xc2a1
movq %r14, %rdi
callq 0x23b0
testq %rax, %rax
je 0x7eee
movq %rax, %r14
movq %rax, %rdi
callq 0xba23
cmpl $0x0, 0x2354f(%rip)     # 0x2b38c
jle 0x7e5c
leaq 0xc510(%rip), %rdi      # 0x14356
leaq 0xc491(%rip), %rsi      # 0x142de
movl $0x2c2, %edx            # imm = 0x2C2
movq %r14, %rcx
xorl %eax, %eax
callq 0xc2a1
leaq 0xc534(%rip), %r15      # 0x14397
leaq 0xc474(%rip), %r12      # 0x142de
xorl %r13d, %r13d
xorl %ebp, %ebp
cmpq $0x6, %r13
je 0x7ece
cmpl $0x0, 0x23510(%rip)     # 0x2b38c
jle 0x7e96
movq %r15, %rdi
movq %r12, %rsi
movl $0x2c8, %edx            # imm = 0x2C8
movl %r13d, %ecx
movq %rbx, %r8
xorl %eax, %eax
callq 0xc2a1
movq %r14, %rdi
movq %rbx, %rsi
callq 0x23d0
testq %rax, %rax
je 0x7ec5
cmpq %r14, %rax
jbe 0x7ebd
movzbl -0x1(%rax), %eax
cmpl $0xd, %eax
je 0x7eb9
cmpl $0xa, %eax
jne 0x7ec5
incl %ebp
jmp 0x7ec5
sete %al
movzbl %al, %eax
addl %eax, %ebp
incq %r13
addq $0x10, %rbx
jmp 0x7e6f
movq %r14, %rdi
callq 0x2030
jmp 0x7ef0
testl %eax, %eax
jle 0x7eee
leaq 0xc40a(%rip), %rdi      # 0x142ed
xorl %ebp, %ebp
xorl %eax, %eax
callq 0xc2a1
jmp 0x7ef0
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_O2/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 0x1bc6c(%rip), %r14     # 0x23b88
leaq 0xc4b9(%rip), %r15      # 0x143dc
leaq 0x23482(%rip), %r12     # 0x2b3ac
leaq 0x8(%rsp), %r13
movl 0x2345e(%rip), %r8d     # 0x2b394
incl %r8d
movl %r8d, 0x23454(%rip)     # 0x2b394
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 0x7f2f
leaq 0x1bc1d(%rip), %rdi     # 0x23b88
leaq 0x9fb9(%rip), %rsi      # 0x11f2b
callq 0x2350
testq %rax, %rax
je 0x7fd9
movq %rax, %r14
cmpl $0x0, 0x23406(%rip)     # 0x2b38c
jle 0x7fa9
leaq 0xc49f(%rip), %rdi      # 0x1442e
leaq 0xc348(%rip), %rsi      # 0x142de
leaq 0x1bbeb(%rip), %rcx     # 0x23b88
movl $0x2ff, %edx            # imm = 0x2FF
xorl %eax, %eax
callq 0xc2a1
movq %rbx, %rdi
callq 0x7699
movl %eax, %ebp
movsbl %al, %edi
movq %r14, %rsi
callq 0x21c0
cmpb $-0x1, %bpl
je 0x7fcd
movzbl %bpl, %eax
cmpl $0xa, %eax
jne 0x7fa9
movq %r14, %rdi
callq 0x20f0
xorl %eax, %eax
jmp 0x800c
callq 0x2060
movl (%rax), %edi
callq 0x23c0
leaq 0xc3ff(%rip), %rdi      # 0x143eb
leaq 0xc2eb(%rip), %rsi      # 0x142de
leaq 0x1bb8e(%rip), %rcx     # 0x23b88
movl $0x2fb, %edx            # imm = 0x2FB
movq %rax, %r8
xorl %eax, %eax
callq 0xc2a1
pushq $-0x1
popq %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xba23
movq %r15, %rdi
callq 0x23b0
movq %rax, %r15
movq %rax, %rdi
callq 0xba23
testq %r14, %r14
sete %al
testq %r15, %r15
sete %cl
orb %al, %cl
jne 0x82ca
movq %r14, %rdi
movq %r15, %rsi
callq 0x23d0
subq %r14, %rax
addq %rax, %rbx
jmp 0x82cc
xorl %ebx, %ebx
movq %r14, %rdi
callq 0x2030
movq %r15, %rdi
callq 0x2030
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
cmpb $0x0, 0x1(%rdi)
pushq $0x1
popq %rbx
je 0x830e
leaq 0x1(%r14), %r15
leaq 0xc27c(%rip), %rsi      # 0x1457d
movq %r15, %rdi
callq 0x8279
cmpq %r15, %rax
je 0x832f
cmpb $0x0, 0x2(%r14)
je 0x832d
addq $0x2, %r14
leaq 0xc25d(%rip), %rsi      # 0x1457d
movq %r14, %rdi
callq 0x8279
cmpq %r14, %rax
je 0x832f
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x8d13
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 0xc067(%rip), %rdi      # 0x14d4e
leaq 0xb5f0(%rip), %rsi      # 0x142de
movl $0x528, %edx            # imm = 0x528
xorl %eax, %eax
pushq %rbx
pushq %r11
pushq %r10
callq 0xc2a1
addq $0x20, %rsp
movq 0x162c6(%rip), %rax     # 0x1efd0
movq (%rax), %rdi
callq 0x22c0
popq %rbx
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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, 0x22668(%rip)     # 0x2b38c
jle 0x8d43
leaq 0xc0ff(%rip), %rdi      # 0x14e2c
leaq 0xb5aa(%rip), %rsi      # 0x142de
movl $0x54a, %edx            # imm = 0x54A
movq %rbx, %rcx
xorl %eax, %eax
callq 0xc2a1
xorl %ebp, %ebp
movq %rbx, %r14
movb (%r14), %al
testb %al, %al
je 0x8d62
cmpl $0x2, %ebp
je 0x8d62
incq %r14
xorl %ecx, %ecx
cmpb $0x27, %al
sete %cl
addl %ecx, %ebp
jmp 0x8d48
cmpl $0x2, %ebp
movq %rbx, %rdi
cmovaeq %r14, %rdi
callq 0xc6fb
cmpl $0x2, %ebp
jb 0x8d87
movb (%r14), %al
testb %al, %al
je 0x8d8c
movb %al, (%rbx)
incq %rbx
incq %r14
jmp 0x8d76
movq %rbx, %r14
jmp 0x8d8f
movb $0x0, (%rbx)
cmpl $0x0, 0x225f6(%rip)     # 0x2b38c
jle 0x8db5
leaq 0xc0d0(%rip), %rdi      # 0x14e6f
leaq 0xb538(%rip), %rsi      # 0x142de
movl $0x562, %edx            # imm = 0x562
movq %r14, %rcx
xorl %eax, %eax
callq 0xc2a1
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xba23
leaq 0xba68(%rip), %rsi      # 0x157d2
movq %r15, %rdi
callq 0x23d0
testq %rax, %rax
je 0x9e63
incl 0x18d30(%rbx)
cmpl $0x0, 0x21604(%rip)     # 0x2b38c
jle 0x9da7
leaq 0xba52(%rip), %rdi      # 0x157e3
leaq 0xa546(%rip), %rsi      # 0x142de
movl $0x8ae, %edx            # imm = 0x8AE
movq %r14, %rcx
xorl %eax, %eax
callq 0xc2a1
leaq 0xba81(%rip), %r15      # 0x1582f
movq %r14, %rax
testq %rax, %rax
je 0x9dce
movq %r14, %rdi
movq %r15, %rsi
callq 0x2300
leaq 0x1(%rax), %rcx
testq %rax, %rax
cmovneq %rcx, %r14
jmp 0x9db1
testq %r14, %r14
je 0x9e63
cmpl $0x0, 0x215ae(%rip)     # 0x2b38c
jle 0x9dfd
leaq 0xba4b(%rip), %rdi      # 0x15832
leaq 0xa4f0(%rip), %rsi      # 0x142de
movl $0x8ba, %edx            # imm = 0x8BA
movq %r14, %rcx
xorl %eax, %eax
callq 0xc2a1
leaq 0x6efe(%rbx), %rdi
leaq 0xd255(%rip), %r15      # 0x17060
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 0xdf02
addq $0x15ec8, %rbx          # imm = 0x15EC8
movq %r12, %rdi
callq 0x2110
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x31c2
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq %rax
movq %r9, %r14
movq %r8, %r12
movq %rcx, %rbp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r13
cmpl $0x0, 0x20fce(%rip)     # 0x2b38c
jle 0xa3e0
leaq 0xb776(%rip), %rdi      # 0x15b3d
leaq 0x9f10(%rip), %rsi      # 0x142de
movl $0x9e4, %edx            # imm = 0x9E4
movq %rbp, %rcx
movq %r13, %r8
xorl %eax, %eax
callq 0xc2a1
movq %rbp, %xmm0
movq %rbx, %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
testq %r14, %r14
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
je 0xa439
pushq $-0x1
popq %rbp
jmp 0xa4be
movq %rbx, (%rsp)
movq %rbp, %rdi
callq 0x2110
movslq %eax, %rbx
movq %r13, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x20a0
xorl %ebp, %ebp
testl %eax, %eax
jne 0xa4be
movzbl (%r13,%rbx), %eax
cmpq $0x3a, %rax
ja 0xa4be
movabsq $0x400000100000201, %rcx # imm = 0x400000100000201
btq %rax, %rcx
jae 0xa4be
cmpl $0x0, 0x20f0d(%rip)     # 0x2b38c
jle 0xa49b
leaq 0xb6ed(%rip), %rdi      # 0x15b75
leaq 0x9e4f(%rip), %rsi      # 0x142de
movl $0x9f7, %edx            # imm = 0x9F7
xorl %eax, %eax
callq 0xc2a1
leaq 0xcbbe(%rip), %rdx      # 0x17060
xorl %ebp, %ebp
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rcx
xorl %eax, %eax
callq 0x2140
movq (%rsp), %rax
incl 0x18d30(%rax)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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, 0x20781(%rip)     # 0x2b38c
jle 0xac5a
leaq 0xb3e4(%rip), %rdi      # 0x15ff8
leaq 0x96c3(%rip), %rsi      # 0x142de
movl $0xc18, %edx            # imm = 0xC18
movq %r14, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0xc2a1
movl 0x20759(%rip), %eax     # 0x2b38c
andl $0x0, 0x18d30(%rbx)
testl %eax, %eax
jle 0xac61
leaq 0xb3ec(%rip), %rdi      # 0x16031
leaq 0x9692(%rip), %rsi      # 0x142de
movl $0xc1e, %edx            # imm = 0xC1E
xorl %eax, %eax
callq 0xc2a1
jmp 0xac61
andl $0x0, 0x18d30(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xaa21
movl %eax, %ebp
cmpl $0x0, 0x20717(%rip)     # 0x2b38c
jle 0xac91
leaq 0xb3e4(%rip), %rdi      # 0x16062
leaq 0x9659(%rip), %rsi      # 0x142de
movl $0xc20, %edx            # imm = 0xC20
xorl %eax, %eax
callq 0xc2a1
testl %ebp, %ebp
jne 0xaca4
movq 0x206d4(%rip), %rsi     # 0x2b370
movq %rbx, %rdi
callq 0xa5e3
cmpl $0x0, 0x206e1(%rip)     # 0x2b38c
jle 0xacc7
leaq 0xb3e2(%rip), %rdi      # 0x16096
leaq 0x9623(%rip), %rsi      # 0x142de
movl $0xc22, %edx            # imm = 0xC22
xorl %eax, %eax
callq 0xc2a1
testl %ebp, %ebp
jne 0xacd0
callq 0xabc3
cmpl $0x0, 0x206b5(%rip)     # 0x2b38c
jle 0xad00
movl 0x18d30(%rbx), %r9d
leaq 0xb3e3(%rip), %rdi      # 0x160ca
leaq 0x95f0(%rip), %rsi      # 0x142de
movl $0xc24, %edx            # imm = 0xC24
movq %r14, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0xc2a1
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xb3f3(%rip), %rdi      # 0x1610c
callq 0x23b0
movq %rax, 0x22edb(%rip)     # 0x2dc00
leaq 0xb3f3(%rip), %rdi      # 0x1611f
callq 0x23b0
movq %rax, 0x22ec0(%rip)     # 0x2dbf8
leaq 0xb3f9(%rip), %rdi      # 0x16138
callq 0x23b0
movq %rax, 0x22ea5(%rip)     # 0x2dbf0
leaq 0xb400(%rip), %rdi      # 0x16152
callq 0x23b0
movq %rax, 0x22e8a(%rip)     # 0x2dbe8
leaq 0xb400(%rip), %rdi      # 0x16165
callq 0x23b0
movq %rax, 0x22e6f(%rip)     # 0x2dbe0
leaq 0xb407(%rip), %rdi      # 0x1617f
callq 0x23b0
movq %rax, 0x22e54(%rip)     # 0x2dbd8
leaq 0xb40f(%rip), %rdi      # 0x1619a
callq 0x23b0
movq %rax, 0x22e39(%rip)     # 0x2dbd0
leaq 0xb40e(%rip), %rdi      # 0x161ac
callq 0x23b0
movq %rax, 0x22e1e(%rip)     # 0x2dbc8
leaq 0xb40b(%rip), %rdi      # 0x161bc
callq 0x23b0
movq %rax, 0x22e4b(%rip)     # 0x2dc08
leaq 0xb407(%rip), %rdi      # 0x161cb
callq 0x23b0
movq %rax, 0x22e40(%rip)     # 0x2dc10
addq $0x18b98, %rbx          # imm = 0x18B98
leaq 0x22de2(%rip), %r15     # 0x2dbc0
leaq 0xb3f9(%rip), %r14      # 0x161de
xorl %r12d, %r12d
cmpq $0x320, %r12            # imm = 0x320
je 0xae0f
movl (%rbx), %edx
testl %edx, %edx
jle 0xae05
movq (%r12,%r15), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0xc2a1
addq $0x8, %r12
addq $0x4, %rbx
jmp 0xade8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xa6c7(%rip), %rsi      # 0x15504
callq 0x2350
testq %rax, %rax
je 0xae6d
movq %rax, %r15
movq %rsp, %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x7573
movq %rbx, %rdi
movq %r14, %rsi
callq 0xabfa
movq %r15, %rdi
callq 0x20f0
jmp 0xae99
callq 0x2060
movl (%rax), %edi
callq 0x23c0
leaq 0xb374(%rip), %rdi      # 0x161f4
leaq 0x9457(%rip), %rsi      # 0x142de
movl $0xc82, %edx            # imm = 0xC82
movq %rbx, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xc2a1
xorl %eax, %eax
addq $0x2070, %rsp           # imm = 0x2070
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x233d1(%rip), %rax     # 0x2e308
jbe 0xaf6a
cmpl $0x0, 0x22fa4(%rip)     # 0x2dee4
pushq $-0x1
popq %rbx
jg 0xaf4e
cmpl $0x0, 0x22fa0(%rip)     # 0x2deec
jle 0xaf70
leaq 0xb3a7(%rip), %rdi      # 0x162fc
leaq 0xb3e8(%rip), %rsi      # 0x16344
movl $0xfb, %edx
xorl %eax, %eax
callq 0xc2a1
jmp 0xaf70
movl (%rsi), %eax
movl %eax, (%rdi)
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x23388(%rip), %rax     # 0x2e308
jbe 0xafb3
cmpl $0x0, 0x22f5b(%rip)     # 0x2dee4
pushq $-0x1
popq %rbx
jg 0xaf97
cmpl $0x0, 0x22f57(%rip)     # 0x2deec
jle 0xafbb
leaq 0xb3ad(%rip), %rdi      # 0x1634b
leaq 0xb39f(%rip), %rsi      # 0x16344
movl $0x119, %edx            # imm = 0x119
xorl %eax, %eax
callq 0xc2a1
jmp 0xafbb
movzwl (%rsi), %eax
movw %ax, (%rdi)
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x640b(%rip), %rdx      # 0x1140c
leaq 0x22ee8(%rip), %rcx     # 0x2def0
xorl %ebx, %ebx
movq %rsp, %r15
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdi
xorl %eax, %eax
callq 0x2140
leaq 0x6f08(%rip), %rsi      # 0x11f2b
movq %r15, %rdi
callq 0x2350
testq %rax, %rax
je 0xb04d
movq %rax, %r15
movl %ebp, %edx
pushq $0x1
popq %rsi
movq %r14, %rdi
movq %rax, %rcx
callq 0x23a0
movq %r15, %rdi
callq 0x20f0
jmp 0xb07c
callq 0x2060
movl (%rax), %edi
callq 0x23c0
leaq 0xb322(%rip), %rdi      # 0x16382
leaq 0xb2dd(%rip), %rsi      # 0x16344
movq %rsp, %rcx
movl $0x154, %edx            # imm = 0x154
movq %rax, %r8
xorl %eax, %eax
callq 0xc2a1
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %ebx
movq %rdi, %r15
xorl %ebp, %ebp
testl %esi, %esi
cmovlel %ebp, %ebx
leaq 0x7(%rsp), %r12
pushq $0x1
popq %r13
cmpl %ebp, %ebx
je 0xb98f
movq %r12, %rdi
movq %r13, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x20c0
cmpq $0x1, %rax
jne 0xb98d
movb 0x7(%rsp), %al
movb %al, (%r15,%rbp)
incq %rbp
cmpb $0xa, %al
jne 0xb963
movl %ebp, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xb9dc
movq %rbx, %rdi
callq 0x23b0
movq %rax, %r15
movq %rax, %rdi
callq 0xba23
movq %r14, %rdi
callq 0x23b0
movq %rax, %r14
movq %rax, %rdi
callq 0xba23
jmp 0xb9df
movq %rbx, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x23d0
movq %rax, %r12
testl %ebp, %ebp
je 0xba01
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_O2/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 0xbac9
decq %rdx
xorl %ecx, %ecx
cmpb $0x0, (%rax,%rcx)
je 0xba9e
cmpq %rdx, %rcx
jae 0xba9e
incq %rcx
jmp 0xba8e
cmpq %rdx, %rcx
jae 0xbac9
xorl %edi, %edi
leaq (%rax,%rdi), %r8
movb (%rsi,%rdi), %r9b
testb %r9b, %r9b
je 0xbac4
leaq (%rcx,%rdi), %r10
cmpq %rdx, %r10
jae 0xbac4
movb %r9b, (%r8,%rcx)
incq %rdi
jmp 0xbaa5
movb $0x0, (%rcx,%r8)
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xbb36
decq %rdx
testq %rcx, %rcx
sete %r8b
movq %rcx, %rdi
subq %rax, %rdi
sete %r9b
orb %r8b, %r9b
jne 0xbaf8
movslq %edx, %r8
cmpq %r8, %rdi
jge 0xbaf8
incq %rdi
jmp 0xbb0e
xorl %edi, %edi
cmpb $0x0, (%rax,%rdi)
je 0xbb0a
cmpq %rdx, %rdi
jae 0xbb0a
incq %rdi
jmp 0xbafa
leaq (%rax,%rdi), %rcx
cmpq %rdx, %rdi
jae 0xbb36
xorl %r8d, %r8d
movb (%rsi,%r8), %r9b
testb %r9b, %r9b
je 0xbb31
leaq (%rdi,%r8), %r10
cmpq %rdx, %r10
jae 0xbb31
movb %r9b, (%rcx,%r8)
incq %r8
jmp 0xbb16
movb $0x0, (%rcx,%r8)
retq
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
testl %ebp, %ebp
jle 0xbb7a
callq 0x23e0
movq (%rax), %rax
movsbq (%r14), %rcx
movsbl (%rax,%rcx,4), %ecx
movsbq (%rbx), %rdx
movsbl (%rax,%rdx,4), %eax
subl %ecx, %eax
jne 0xbb73
decl %ebp
incq %r14
incq %rbx
jmp 0xbb49
xorl %ebp, %ebp
movl %eax, %r15d
jmp 0xbb49
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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)
andl $0x0, 0x2c(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rdi)
callq 0xbc2e
movq (%rbx), %rcx
cmpq %rcx, %rax
je 0xbfb5
movq %rax, (%rbx)
movq %rax, %rcx
movq %rcx, %rax
addq $0x30, %rsp
popq %rbx
retq