LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/inflex[P]ripMIME/pldstr.c
// Function: PLD_dprintf
char *PLD_dprintf(const char *format, ...)
{
    int n, size = 1024; // Assume we don't need more than 1K to start with
    char *p;
    va_list ap;

    // Attempt to allocate and then check
    p = malloc(size *sizeof(char));
    if (p == NULL) return NULL;

    while (1)
    {
        // Attempt to print out string out into the allocated space
        va_start(ap, format);
        n = vsnprintf (p, size, format, ap);
        va_end(ap);

        // If things went well, then return the new string
        if ((n > -1) && (n < size)) return p;

        // If things didn't go well, then we have to allocate more space
        //  based on which glibc we're using ( fortunately, the return codes
        //  tell us which glibc is being used! *phew*
        //
        // If n > -1, then we're being told precisely how much space we need
        // else (older glibc) we have to just guess again ...

        if (n > -1) size = n+1; // Allocate precisely what is needed
        else size *= 2;  // Double the amount allocated, note, we could just increase by 1K, but if we have a long string, we'd end up using a lot of realloc's

        // We could just realloc 'blind', but that'd be wrong and potentially cause a DoS, so
        //  instead, we'll be good and first attempt to realloc to a temp variable then, if all
        //  is well, we go ahead and update
        if (1)
        {
            char *tmp_p;

            tmp_p = realloc(p, size);
            if (tmp_p == NULL){ if (p != NULL) free(p); return NULL; }
            else p = tmp_p;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
movq %rsi, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0xc026
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movl $0x400, %edi            # imm = 0x400
callq 0x22a0
testq %rax, %rax
je 0xc0aa
movl $0x400, %r15d           # imm = 0x400
leaq 0x110(%rsp), %rbp
movabsq $0x3000000008, %r13     # imm = 0x3000000008
movq %rsp, %r12
movq %rax, %r14
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %rbp, 0x8(%rsp)
movq %r13, (%rsp)
movl %r15d, %esi
movq %r14, %rdi
movq %rbx, %rdx
movq %r12, %rcx
callq 0x20d0
testl %eax, %eax
setns %cl
cmpl %r15d, %eax
setl %dl
testb %dl, %cl
jne 0xc0ad
leal 0x1(%rax), %ecx
addl %r15d, %r15d
testl %eax, %eax
cmovnsl %ecx, %r15d
movq %r14, %rdi
movq %r15, %rsi
callq 0x2320
testq %rax, %rax
jne 0xc050
movq %r14, %rdi
callq 0x2030
xorl %r14d, %r14d
movq %r14, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/inflex[P]ripMIME/logger.c
// Function: LOGGER_set_logfile
int LOGGER_set_logfile( char *lfname )
{
	int result = 0;

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

	return result;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0xdb15(%rip), %rsi      # 0x19c08
callq 0x2350
movq %rax, %rcx
movq %rax, 0x2242e(%rip)     # 0x2e530
xorl %eax, %eax
testq %rcx, %rcx
jne 0xc12f
callq 0x2060
movl (%rax), %edi
callq 0x23c0
leaq 0xa878(%rip), %rsi      # 0x16994
pushq $0x1
popq %rdi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x22e0
pushq $-0x1
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/inflex[P]ripMIME/logger.c
// Function: LOGGER_clean_output
int LOGGER_clean_output( char *string, char **buffer )
{
	char *newstr;
	char *p, *q;
	char *next_space;

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

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

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

	while (slen--)
	{

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

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

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

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

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

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

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

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

	*p = '\0';

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

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2110
movq %rax, %r15
leal 0x1(,%rax,2), %eax
movslq %eax, %rdi
callq 0x22a0
testq %rax, %rax
je 0xc28f
movq %rbx, 0x20(%rsp)
leal (%r15,%r15), %ecx
movl 0x22383(%rip), %edx     # 0x2e538
movl %edx, 0x8(%rsp)
movslq 0x2237c(%rip), %rdx     # 0x2e53c
movq %rdx, 0x10(%rsp)
decl %ecx
movl %ecx, 0xc(%rsp)
leaq 0x1(%r14), %r13
negq %r14
xorl %ebp, %ebp
movq %rax, 0x18(%rsp)
movq %rax, %r12
xorl %ebx, %ebx
subl $0x1, %r15d
jb 0xc279
cmpl $0x0, 0x8(%rsp)
jle 0xc245
callq 0x23f0
movq (%rax), %rax
movsbq -0x1(%r13), %rcx
testb $0x20, 0x1(%rax,%rcx,2)
je 0xc233
movq %r13, %rdi
leaq 0xa7c1(%rip), %rsi      # 0x169ce
callq 0x2300
testq %rax, %rax
je 0xc233
movslq %ebx, %rcx
addq %r14, %rcx
addq %rax, %rcx
cmpq 0x10(%rsp), %rcx
jl 0xc233
movb $0xa, (%r12)
incq %r12
incl %ebp
xorl %ebx, %ebx
cmpl 0x10(%rsp), %ebx
jl 0xc245
movb $0xa, (%r12)
incq %r12
incl %ebp
xorl %ebx, %ebx
movb -0x1(%r13), %al
cmpb $0x25, %al
jne 0xc25b
movb $0x25, (%r12)
incq %r12
incl %ebp
movb -0x1(%r13), %al
movb %al, (%r12)
incq %r12
leal 0x1(%rbp), %eax
incl %ebx
incq %r13
decq %r14
cmpl 0xc(%rsp), %ebp
movl %eax, %ebp
jl 0xc1de
movb $0x0, (%r12)
movq 0x20(%rsp), %rax
movq 0x18(%rsp), %rcx
movq %rcx, (%rax)
xorl %eax, %eax
jmp 0xc292
pushq $-0x1
popq %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/inflex[P]ripMIME/boundary-stack.c
// Function: BS_clear
int BS_clear( void )
{
	struct BS_node *next;

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

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

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x2196c(%rip), %r15     # 0x2e578
leaq 0xa47d(%rip), %rbx      # 0x17090
leaq 0xa49b(%rip), %r14      # 0x170b5
testq %r15, %r15
je 0xcc65
cmpl $0x0, 0x2192a(%rip)     # 0x2e550
je 0xcc44
movq %rbx, %rdi
movq %r14, %rsi
movl $0xc0, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0xc2a1
movq 0x21934(%rip), %r15     # 0x2e578
movq (%r15), %rdi
movq 0x10(%r15), %r15
callq 0x2030
movq 0x21921(%rip), %rdi     # 0x2e578
callq 0x2030
movq %r15, 0x21915(%rip)     # 0x2e578
jmp 0xcc1a
andq $0x0, 0x2190b(%rip)     # 0x2e578
andl $0x0, 0x218ec(%rip)     # 0x2e560
orl $-0x1, 0x218f1(%rip)    # 0x2e56c
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/inflex[P]ripMIME/boundary-stack.c
// Function: BS_push
int BS_push( char *boundary )
{

	struct BS_node *node;

	if ((glb.hold_limit > 0)&&(glb.count >= glb.hold_limit)) 
	{
		DBS LOGGER_log("%s:%d:BS_push:DEBUG: Number of boundaries to hold is at limit (limit=%d)",FL,glb.hold_limit);
		return 0;
	}
  
	node	= malloc(sizeof(struct BS_node));

	DBS LOGGER_log("%s:%d:BS_push:DEBUG: head = %p, nn = %p boundary = '%s'",FL, glb.boundarystack, node, boundary);

	if (node)
	{
		node->next = glb.boundarystack;
		glb.boundarystack = node;
		glb.boundarystack->boundary = strdup(boundary);
		glb.boundarystack->boundary_length = strlen(glb.boundarystack->boundary);
		if (glb.boundarystack->boundary_length == 0) glb.have_empty_boundary = 1;
		glb.boundarystack->boundary_nhl = BS_non_hyphen_length(boundary);
		glb.count++;

		// Set the smallest length
		if (glb.smallest_length == -1) glb.smallest_length = glb.boundarystack->boundary_length;
		else if (glb.boundarystack->boundary_length < glb.smallest_length) glb.smallest_length = glb.boundarystack->boundary_length;

		DBS LOGGER_log("%s:%d:DEBUGX: smallest = %d, NHL = %d,  boundary = '%s'",FL,glb.smallest_length, node->boundary_nhl, boundary);
	}
	else
	    {
		LOGGER_log("%s:%d:BS_push:ERROR: Cannot allocate memory for boundary stack PUSH, %s", FL, strerror(errno));
	}

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x218a3(%rip), %ecx     # 0x2e568
testl %ecx, %ecx
jle 0xccfd
cmpl %ecx, 0x21891(%rip)     # 0x2e560
jl 0xccfd
cmpl $0x0, 0x21878(%rip)     # 0x2e550
je 0xce04
leaq 0xa3e1(%rip), %rdi      # 0x170c6
leaq 0xa3c9(%rip), %rsi      # 0x170b5
movl $0xff, %edx
xorl %eax, %eax
callq 0xc2a1
jmp 0xce04
pushq $0x18
popq %rdi
callq 0x22a0
movq %rax, %r14
cmpl $0x0, 0x21841(%rip)     # 0x2e550
je 0xcd38
movq 0x21860(%rip), %rcx     # 0x2e578
leaq 0xa3f0(%rip), %rdi      # 0x1710f
leaq 0xa38f(%rip), %rsi      # 0x170b5
movl $0x105, %edx            # imm = 0x105
movq %r14, %r8
movq %rbx, %r9
xorl %eax, %eax
callq 0xc2a1
testq %r14, %r14
je 0xcddb
movq 0x21830(%rip), %rax     # 0x2e578
movq %rax, 0x10(%r14)
movq %r14, 0x21825(%rip)     # 0x2e578
movq %rbx, %rdi
callq 0x23b0
movq %rax, (%r14)
movq %rax, %rdi
callq 0x2110
movq %rax, %r15
movl %r15d, 0x8(%r14)
testl %r15d, %r15d
jne 0xcd7c
movl $0x1, 0x217f4(%rip)     # 0x2e570
movq %rbx, %rdi
callq 0xcc83
incl 0x217d6(%rip)           # 0x2e560
movl %eax, 0xc(%r14)
movl 0x217d8(%rip), %ecx     # 0x2e56c
cmpl $-0x1, %ecx
setne %dl
cmpl %r15d, %ecx
setle %sil
testb %sil, %dl
jne 0xcdb0
movl %r15d, 0x217bf(%rip)    # 0x2e56c
movl %r15d, %ecx
cmpl $0x0, 0x21799(%rip)     # 0x2e550
je 0xce04
leaq 0xa387(%rip), %rdi      # 0x17147
leaq 0xa2ee(%rip), %rsi      # 0x170b5
movl $0x115, %edx            # imm = 0x115
movl %eax, %r8d
movq %rbx, %r9
xorl %eax, %eax
callq 0xc2a1
jmp 0xce04
callq 0x2060
movl (%rax), %edi
callq 0x23c0
leaq 0xa391(%rip), %rdi      # 0x1717f
leaq 0xa2c0(%rip), %rsi      # 0x170b5
movl $0x119, %edx            # imm = 0x119
movq %rax, %rcx
xorl %eax, %eax
callq 0xc2a1
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/inflex[P]ripMIME/boundary-stack.c
// Function: BS_pop
char *BS_pop( void )
{

	struct BS_node *node = glb.boundarystack;

	if (glb.boundarystack)
	{
		glb.boundarystack = glb.boundarystack->next;
		PLD_strncpy(glb.boundarystacksafe,node->boundary, BS_STRLEN_MAX);
		free(node->boundary);
		free(node);
		glb.count--;
	}

	return glb.boundarystacksafe;
}

// Assembly:
pushq %rbx
movq 0x21764(%rip), %rbx     # 0x2e578
testq %rbx, %rbx
je 0xce4e
movq 0x10(%rbx), %rax
movq %rax, 0x21754(%rip)     # 0x2e578
movq (%rbx), %rsi
leaq 0x21752(%rip), %rdi     # 0x2e580
movl $0x400, %edx            # imm = 0x400
callq 0xba3e
movq (%rbx), %rdi
callq 0x2030
movq %rbx, %rdi
callq 0x2030
decl 0x21712(%rip)           # 0x2e560
leaq 0x2172b(%rip), %rax     # 0x2e580
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/inflex[P]ripMIME/boundary-stack.c
// Function: BS_boundary_detect
int BS_boundary_detect( char *haystack, char *needle, int needle_length )
{
	int result=1;
	int current_start = glb.detect_limit;
	char *haystack_start;

	if ((glb.have_empty_boundary == 1)&&(needle_length < 1))
	{
		result = strncmp(haystack,"--",2);
		DBS LOGGER_log("%s:%d:BS_boundary_detect:DEBUG: empty-boundary test, result = %d",FL, result);
		return result;

	}

	if ((needle_length < 1)&&(glb.have_empty_boundary == 0)) return 1;


	DBS LOGGER_log("%s:%d:BS_boundary_detect: needle='%s', length=%d, haystack='%s', shift-window=%d"
			,FL
			,needle
			,needle_length
			,haystack
			,current_start
			);

	haystack_start = haystack;
	while ((current_start-- > 0)&&(*haystack_start != '\0'))
	{
		DBS LOGGER_log("%s:%d:BS_boundary_detect:DEBUG: CMP '%s' to '%s'",FL, needle, haystack_start);
		if (strncmp( needle, haystack_start, needle_length )==0)
		{
			DBS LOGGER_log("%s:%d:BS_boundary_detect:DEBUG: Hit on compare",FL);
			result = 0;  
			break; 
		}
		haystack_start++;
	}

	return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rdi, %r14
movl 0x216d2(%rip), %eax     # 0x2e570
cmpl $0x1, %eax
setne %cl
testl %edx, %edx
setg %dl
orb %cl, %dl
jne 0xcee8
leaq 0x74e0(%rip), %rsi      # 0x14394
pushq $0x2
popq %rdx
movq %r14, %rdi
callq 0x20a0
movl %eax, %ebx
cmpl $0x0, 0x21688(%rip)     # 0x2e550
je 0xcef9
leaq 0xa2f6(%rip), %rdi      # 0x171c7
leaq 0xa1dd(%rip), %rsi      # 0x170b5
movl $0x19e, %edx            # imm = 0x19E
movl %ebx, %ecx
xorl %eax, %eax
callq 0xc2a1
jmp 0xcef9
testl %ebp, %ebp
setle %cl
testl %eax, %eax
sete %al
pushq $0x1
popq %rbx
testb %al, %cl
je 0xcf0a
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %r15
movl 0x21650(%rip), %r13d    # 0x2e564
cmpl $0x0, 0x21635(%rip)     # 0x2e550
je 0xcf44
movl %r13d, (%rsp)
leaq 0xa2e0(%rip), %rdi      # 0x17208
leaq 0xa186(%rip), %rsi      # 0x170b5
movl $0x1a7, %edx            # imm = 0x1A7
movq %r15, %rcx
movl %ebp, %r8d
movq %r14, %r9
xorl %eax, %eax
callq 0xc2a1
movslq %ebp, %r12
leaq 0xa167(%rip), %rbp      # 0x170b5
testl %r13d, %r13d
jle 0xcef9
cmpb $0x0, (%r14)
je 0xcef9
cmpl $0x0, 0x215f0(%rip)     # 0x2e550
je 0xcf7e
leaq 0xa2f0(%rip), %rdi      # 0x17259
movq %rbp, %rsi
movl $0x1b1, %edx            # imm = 0x1B1
movq %r15, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0xc2a1
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x20a0
incq %r14
decl %r13d
testl %eax, %eax
jne 0xcf4e
cmpl $0x0, 0x215b3(%rip)     # 0x2e550
je 0xcfc0
leaq 0xa2e4(%rip), %rdi      # 0x1728a
leaq 0xa108(%rip), %rsi      # 0x170b5
xorl %ebx, %ebx
movl $0x1b4, %edx            # imm = 0x1B4
xorl %eax, %eax
callq 0xc2a1
jmp 0xcef9
xorl %ebx, %ebx
jmp 0xcef9
// File: /workspace/github_c_makefile_star2_O2/inflex[P]ripMIME/uuencode.c
// Function: UUENCODE_is_uuencode_header
int UUENCODE_is_uuencode_header( char *line )
{
	struct PLD_strtok tx;
	char buf[UUENCODE_STRLEN_MAX];
	char *bp,*fp;
	int result = 0;

	// If we're not supposed to be decoding UUencoded files, then return 0
	if (glb.decode == 0) return 0;

	snprintf( buf, sizeof(buf), "%s", line );

	bp = buf;

	// If you're wondering why we dont check for "begin ",it's because we dont know
	// if begin is followed by a \t or ' ' or some other white space
	// Also, check to see that we don't have a VCARD ( look to see if there's a trailing
	//		colon after the BEGIN
	//
	// 2003-08-12:PLD:Added *(bp+6) test as recommended by Bernard Fischer to ensure there's more
	//						data after the begin	

	if ((bp)&&(strncasecmp(bp,"begin",5)==0)&&(*(bp+5)!=':')&&(isspace((int)*(bp+5)))&&(*(bp+6)))
	{
		fp = NULL;
		bp = PLD_strtok(&tx, buf, " \n\r\t"); // Get the begin

		if (bp) fp = PLD_strtok(&tx, NULL, " \n\r\t"); // Get the file-permissions

		if (fp)
		{
			if (UUENCODE_DNORMAL) LOGGER_log("%s:%d:UUENCODE_is_uuencode_header:DEBUG: PERMISSIONS = %s\n", FL, fp);

			if ((atoi(fp) == 0)||(atoi(fp) > 777))   // Maximum is 777, because R+W+X = 7
			{
				result = 0;
			}
			else result = 1;

		}
		else {
			if (UUENCODE_DNORMAL)	LOGGER_log("%s:%d:UUENCODE_is_uuencode_header:WARNING: Cannot read permissions for UUENCODED data file (%s)\n", FL, line);
		}
	}


	return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x410, %rsp            # imm = 0x410
cmpl $0x0, 0x21791(%rip)     # 0x2e998
je 0xd2e5
movq %rdi, %r14
leaq 0x9e49(%rip), %rdx      # 0x17060
xorl %ebx, %ebx
leaq 0x10(%rsp), %r15
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2140
leaq 0xa151(%rip), %rsi      # 0x17388
pushq $0x5
popq %rdx
movq %r15, %rdi
callq 0x22b0
testl %eax, %eax
jne 0xd2e7
movsbq 0x15(%rsp), %r15
cmpq $0x3a, %r15
je 0xd2e7
callq 0x23f0
movq (%rax), %rax
testb $0x20, 0x1(%rax,%r15,2)
je 0xd2e7
cmpb $0x0, 0x16(%rsp)
je 0xd2e7
leaq 0x804e(%rip), %rdx      # 0x152c6
movq %rsp, %rdi
leaq 0x10(%rsp), %rsi
callq 0xbb88
testq %rax, %rax
je 0xd2f6
leaq 0x8035(%rip), %rdx      # 0x152c6
movq %rsp, %rdi
xorl %esi, %esi
callq 0xbb88
testq %rax, %rax
je 0xd2f6
movq %rax, %r15
cmpl $0x0, 0x216d6(%rip)     # 0x2e980
jle 0xd2c9
leaq 0xa0db(%rip), %rdi      # 0x1738e
leaq 0xa10f(%rip), %rsi      # 0x173c9
movl $0x110, %edx            # imm = 0x110
movq %r15, %rcx
xorl %eax, %eax
callq 0xc2a1
movq %r15, %rdi
callq 0x2360
testl %eax, %eax
setne %cl
cmpl $0x30a, %eax            # imm = 0x30A
setl %al
andb %cl, %al
movzbl %al, %ebx
jmp 0xd2e7
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x410, %rsp            # imm = 0x410
popq %rbx
popq %r14
popq %r15
retq
cmpl $0x0, 0x21683(%rip)     # 0x2e980
jle 0xd2e7
leaq 0xa0ce(%rip), %rdi      # 0x173d4
leaq 0xa0bc(%rip), %rsi      # 0x173c9
xorl %ebx, %ebx
movl $0x11a, %edx            # imm = 0x11A
movq %r14, %rcx
xorl %eax, %eax
callq 0xc2a1
jmp 0xd2e7
// File: /workspace/github_c_makefile_star2_O2/inflex[P]ripMIME/uuencode.c
// Function: UUENCODE_is_file_uuencoded
int UUENCODE_is_file_uuencoded( char *fname )
{
	int result = 0;
	int linecount = 0;
	int limit=20;
	char line[ UUENCODE_STRLEN_MAX ];
	FILE *f;

	f = fopen(fname,"r");
	if (!f)
	{
		LOGGER_log("%s:%d:UUENCODE_is_file_uuencoded:ERROR: cannot open file '%s' for reading (%s)", FL, fname,strerror(errno));
		uuencode_error = UUENCODE_STATUS_CANNOT_OPEN_FILE;
		return -1;
	}

	while ((linecount < limit)&&(fgets(line, sizeof(line), f)))
	{
		if (UUENCODE_DNORMAL) LOGGER_log("%s:%d:UUENCODE_is_file_uuencoded:DEBUG: Testing line '%s'\n", FL, line);
		if (UUENCODE_is_uuencode_header( line ))
		{
			result = 1;
			break;
		}
		linecount++;
	}

	fclose(f);

	return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rdi, %r14
leaq 0x81c9(%rip), %rsi      # 0x15504
callq 0x2350
testq %rax, %rax
je 0xd3b0
movq %rax, %rbx
pushq $0x15
popq %r13
movq %rsp, %r14
leaq 0xa12e(%rip), %r15      # 0x17484
leaq 0xa06c(%rip), %r12      # 0x173c9
xorl %ebp, %ebp
decl %r13d
je 0xd3a6
movq %r14, %rdi
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdx
callq 0x21f0
testq %rax, %rax
je 0xd3a6
cmpl $0x0, 0x21600(%rip)     # 0x2e980
jle 0xd397
movq %r15, %rdi
movq %r12, %rsi
movl $0x145, %edx            # imm = 0x145
movq %r14, %rcx
xorl %eax, %eax
callq 0xc2a1
movq %r14, %rdi
callq 0xd1f4
testl %eax, %eax
je 0xd35f
pushq $0x1
popq %rbp
movq %rbx, %rdi
callq 0x20f0
jmp 0xd3e9
callq 0x2060
movl (%rax), %edi
callq 0x23c0
leaq 0xa072(%rip), %rdi      # 0x17435
leaq 0x9fff(%rip), %rsi      # 0x173c9
movl $0x13e, %edx            # imm = 0x13E
movq %r14, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xc2a1
movl $0x65, 0x215ca(%rip)    # 0x2e9b0
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/inflex[P]ripMIME/filename-filters.c
// Function: FNFILTER_paranoid_filter
int FNFILTER_paranoid_filter( char *fname, int size )
{
    char tmp[1024];
    char *p;


    /* Scan for . and .. filenames
        ** 20040727-12H54
        ** Patch supplied by Marco Ariano
        ** Patch modified by Paul L Daniels
        **
    */
    if ((1 == size)&&('.' == *fname))
    {
        *fname = '_';
        return 0;
    } else if ((2 == size)&&(0 == strncmp(fname,"..",2))) {
        snprintf(fname,3,"__");
        return 0;
    }


    /* scan out any directory separators */

    p = strrchr(fname,'/');
    if (p)
    {
        // Check to see that this seperator isn't the -last- char in the string
        if (*(p+1) == '\0') *p = '\0';
        else
        {
            p++;
            PLD_strncpy(tmp,p,sizeof(tmp));
            PLD_strncpy(fname,tmp,size);
        }
    }
    else if ( (p = strrchr(fname,'\\')))
    {
        // Check to see that this seperator isn't the -last- char in the string
        if (*(p+1) == '\0') *p = '\0';
        else
        {
            p++;
            PLD_strncpy(tmp,p,sizeof(tmp));
            PLD_strncpy(fname,tmp,size);
        }
    }


    if ( glb.paranoid > 0 )
    {
        // If we're really paranoid, then we go along and convert anything we don't like
        //  the look of into 7-bit
        //
        //  These days we shouldn't be using this any more as there are many filenames
        //  which require > 7-bit charsets.

        while (*fname)
        {
            if( !isalnum((int)*fname) && (*fname != '.') ) *fname='_';
            if( (*fname < ' ')||(*fname > '~') ) *fname='_';
            fname++;
        }
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movl %esi, %ebp
movq %rdi, %rbx
cmpl $0x2, %esi
je 0xde4d
cmpl $0x1, %ebp
jne 0xde66
cmpb $0x2e, (%rbx)
jne 0xde66
movb $0x5f, (%rbx)
jmp 0xdef4
cmpb $0x2e, (%rbx)
jne 0xde66
cmpb $0x2e, 0x1(%rbx)
jne 0xde66
movb $0x0, 0x2(%rbx)
movw $0x5f5f, (%rbx)         # imm = 0x5F5F
jmp 0xdef4
pushq $0x2f
popq %rsi
movq %rbx, %rdi
callq 0x2150
testq %rax, %rax
jne 0xde86
pushq $0x5c
popq %rsi
movq %rbx, %rdi
callq 0x2150
testq %rax, %rax
je 0xdeb5
cmpb $0x0, 0x1(%rax)
je 0xdeb2
incq %rax
movq %rsp, %r14
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
movq %rax, %rsi
callq 0xba3e
movslq %ebp, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xba3e
jmp 0xdeb5
movb $0x0, (%rax)
cmpl $0x0, 0x20afc(%rip)     # 0x2e9b8
jle 0xdef4
movsbq (%rbx), %r14
testq %r14, %r14
je 0xdef4
callq 0x23f0
movq (%rax), %rax
movb (%rax,%r14,2), %al
shrb $0x3, %al
cmpb $0x2e, %r14b
sete %cl
orb %al, %cl
leal -0x7f(%r14), %eax
cmpb $-0x5f, %al
setae %al
testb %al, %cl
jne 0xdeef
movb $0x5f, (%rbx)
incq %rbx
jmp 0xdebe
xorl %eax, %eax
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/inflex[P]ripMIME/ripOLE/ole.c
// Function: OLE_get_miniblock
int OLE_get_miniblock( struct OLE_object *ole, int block_index, unsigned char *block_buffer )
{
	if (ole->ministream)
	{
		int offset = block_index << ole->header.mini_sector_shift;

		memcpy( block_buffer, ole->ministream +offset, ole->header.mini_sector_size);
	}

	return OLE_OK;
}

// Assembly:
movl %esi, %eax
movq 0x248(%rdi), %rsi
testq %rsi, %rsi
je 0xe546
pushq %rax
movb 0x26c(%rdi), %cl
shll %cl, %eax
cltq
addq %rax, %rsi
movl 0x270(%rdi), %eax
movq %rdx, %rdi
movq %rax, %rdx
callq 0x2260
addq $0x8, %rsp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/inflex[P]ripMIME/ripOLE/ole.c
// Function: OLE_dbstosbs
int OLE_dbstosbs( char *raw_string, size_t byte_count, char *clean_string, int clean_string_len )
{
	char *limit = raw_string +byte_count -1;

	clean_string_len--;

	while ((raw_string < limit)&&(byte_count >0)&&(byte_count--)&&(clean_string_len--))
	{
		int v = (char)*raw_string;

		if (isprint(v))
		{
			*clean_string = v;
			clean_string++;
		}

		raw_string += 2;
	}
	*clean_string = '\0';

	return OLE_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq -0x1(%rdi,%rsi), %rax
movq %rax, (%rsp)
pushq $0x1
popq %r13
subl %ecx, %r13d
negq %r14
xorl %ebp, %ebp
cmpq (%rsp), %r15
jae 0xe5a5
cmpq %rbp, %r14
je 0xe5a5
cmpl %ebp, %r13d
je 0xe5a5
movsbq (%r15), %r12
callq 0x23f0
movq (%rax), %rax
testb $0x40, 0x1(%rax,%r12,2)
je 0xe59c
movb %r12b, (%rbx)
incq %rbx
addq $0x2, %r15
decq %rbp
jmp 0xe572
movb $0x0, (%rbx)
xorl %eax, %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/ripOLE/ole.c
// Function: OLE_print_string
int OLE_print_string( char *string, size_t char_count)
{
	while (char_count--)
	{
		printf("%c",*string);
		string += 2;
	}
	return OLE_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
cmpq %r15, %rbx
je 0xe5db
movsbl (%r14,%r15,2), %edi
callq 0x2040
incq %r15
jmp 0xe5c7
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/inflex[P]ripMIME/ripOLE/ole.c
// Function: OLE_print_sector
int OLE_print_sector( struct OLE_object *ole, char *sector, unsigned int bytes)
{
	int current_byte;
	int ubytes = bytes;

	printf("\n");
	for (current_byte = 0; current_byte < ubytes; current_byte++ )
	{
		printf("%02X ", *(sector +current_byte));
		if (((current_byte+1) %32)==0) {
			int j;
			for (j = current_byte -31; j <=current_byte; j++)
			{
				if (isalnum(*(sector +j))) printf("%c",*(sector+j));
				else printf(".");
			}
			printf("\n");
		}
	}
	printf("\n");

	return OLE_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %r12d
movq %rsi, %r14
pushq $0xa
popq %rdi
callq 0x2040
xorl %eax, %eax
testl %r12d, %r12d
cmovlel %eax, %r12d
pushq $-0x1f
popq %r13
pushq $0x1
popq %rbp
pushq $0x2e
popq %r15
xorl %ebx, %ebx
movq %r12, 0x8(%rsp)
cmpq %r12, %rbx
je 0xe694
movsbl (%r14,%rbx), %esi
leaq 0x9aa5(%rip), %rdi      # 0x180d0
xorl %eax, %eax
callq 0x2130
incq %rbx
testb $0x1f, %bl
jne 0xe68d
movl %ebp, 0x4(%rsp)
movslq %ebp, %rbp
callq 0x23f0
movq %rax, %r12
movq %r13, 0x10(%rsp)
cmpq %r13, %rbp
je 0xe677
movq (%r12), %rcx
movsbl (%r14,%r13), %eax
movslq %eax, %rdx
movzwl (%rcx,%rdx,2), %ecx
movl %r15d, %edi
testb $0x8, %cl
je 0xe66d
movl %eax, %edi
callq 0x2040
incq %r13
jmp 0xe64e
pushq $0xa
popq %rdi
callq 0x2040
movq 0x8(%rsp), %r12
movq 0x10(%rsp), %r13
movl 0x4(%rsp), %ebp
incq %r13
incl %ebp
jmp 0xe61a
pushq $0xa
popq %rdi
callq 0x2040
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/inflex[P]ripMIME/ripOLE/ole.c
// Function: OLE_get_header
int OLE_get_header( struct OLE_object *ole )
{
	int result = 0;
	ole->header.sector_size = OLE_HEADER_BLOCK_SIZE;
	result = OLE_get_block( ole, -1, ole->header_block );
	if (result != 0) return result;

	if (OLE_is_file_OLE( ole ) == 0)
	{
		return OLEER_NOT_OLE_FILE;
	}

	return OLE_OK;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x200, 0x268(%rdi)     # imm = 0x200
leaq 0x48(%rdi), %rdx
pushq $-0x1
popq %rsi
callq 0xe24a
testl %eax, %eax
jne 0xe702
movq %rbx, %rdi
callq 0xe6ad
xorl %ecx, %ecx
testl %eax, %eax
pushq $0x66
popq %rax
cmovnel %ecx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/inflex[P]ripMIME/ripOLE/ole.c
// Function: OLE_print_header
int OLE_print_header( struct OLE_object *ole )
{
	unsigned int i;
	struct OLE_header *h;

	h = &(ole->header);

	printf( "Minor version = %d\n"
			"DLL version = %d\n"
			"Byte order = %d\n\n"

			"Sector shift = %d\n"
			"Sector size  = %d\n"
			"Mini Sector shift = %d\n"
			"Mini sector size  = %d\n\n"

			"FAT sector count = %d\n"
			"First FAT sector = %d\n\n"

			"Maximum ministream size = %d\n\n"

			"First MiniFAT sector = %d\n"
			"MiniFAT sector count = %d\n\n"

			"First DIF sector = %d\n"
			"DIF sector count = %d\n"
			"--------------------------------\n"
			,h->minor_version
			,h->dll_version
			,h->byte_order
			,h->sector_shift
			,h->sector_size
			,h->mini_sector_shift
			,h->mini_sector_size
			,h->fat_sector_count
			,h->directory_stream_start_sector
			,h->mini_cutoff_size
			,h->mini_fat_start
			,h->mini_fat_sector_count
			,h->dif_start_sector
			,h->dif_sector_count
			);

	// Print out the FAT chain
	for (i = 0; i < h->fat_sector_count; i++)
	{
		if (i >= OLE_HEADER_FAT_SECTOR_COUNT_LIMIT) break; // We can't read beyond the 109th sector location
		printf("FAT[%d] = %d\n", i, h->FAT[i]);
	}

	return OLE_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl 0x258(%rdi), %esi
movl 0x25c(%rdi), %edx
movl 0x260(%rdi), %ecx
movl 0x264(%rdi), %r8d
movl 0x268(%rdi), %r9d
movl 0x26c(%rdi), %eax
movq %rax, 0x10(%rsp)
movl 0x270(%rdi), %eax
movq %rax, 0x8(%rsp)
movl 0x274(%rdi), %r14d
movl 0x278(%rdi), %r15d
movl 0x27c(%rdi), %r12d
movl 0x280(%rdi), %r13d
movl 0x284(%rdi), %ebp
movl 0x288(%rdi), %r10d
movl 0x28c(%rdi), %r11d
subq $0x8, %rsp
leaq 0x97db(%rip), %rdi      # 0x180d6
xorl %eax, %eax
pushq %r11
pushq %r10
pushq %rbp
pushq %r13
pushq %r12
pushq %r15
pushq %r14
pushq 0x48(%rsp)
pushq 0x58(%rsp)
callq 0x2130
addq $0x50, %rsp
leaq 0x990a(%rip), %r14      # 0x1822c
xorl %r15d, %r15d
cmpq $0x6c, %r15
ja 0xe950
movl 0x274(%rbx), %eax
cmpq %rax, %r15
jae 0xe950
movl 0x290(%rbx,%r15,4), %edx
movq %r14, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x2130
incq %r15
jmp 0xe925
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/inflex[P]ripMIME/ripOLE/ole.c
// Function: OLE_print_directory
int OLE_print_directory( struct OLE_object *ole, struct OLE_directory_entry *dir )
{
	char element[64];
	OLE_dbstosbs( dir->element_name, dir->element_name_byte_count, element, sizeof(element) );

	printf(
			"Element Name = %s\n"
			"Element type = %d\n"
			"Element colour = %d\n"
			"Left Child = %d\n"
			"Right Child = %d\n"
			"Root = %d\n"
			"User flags = %d\n"
			"Start sector = %ld\n"
			"Stream Size = %d\n"
			,element
			,dir->element_type
			,dir->element_colour
			,dir->left_child
			,dir->right_child
			,dir->root
			,dir->userflags
			,dir->start_sector
			,dir->stream_size
			);

	return OLE_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rsi, %rbx
movslq 0x40(%rsi), %rsi
movq %rsp, %r14
pushq $0x40
popq %rcx
movq %rbx, %rdi
movq %r14, %rdx
callq 0xe549
movsbl 0x44(%rbx), %edx
movsbl 0x45(%rbx), %ecx
movl 0x48(%rbx), %r8d
movl 0x4c(%rbx), %r9d
movl 0x50(%rbx), %r10d
movl 0x64(%rbx), %r11d
movl 0x80(%rbx), %r15d
leaq 0x97bf(%rip), %rdi      # 0x18277
movq %r14, %rsi
xorl %eax, %eax
pushq %r15
pushq 0x78(%rbx)
pushq %r11
pushq %r10
callq 0x2130
addq $0x20, %rsp
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/inflex[P]ripMIME/ripOLE/ole.c
// Function: OLE_open_file
int OLE_open_file( struct OLE_object *ole, char *fullpath )
{
	struct stat st;
	int stat_result;
	FILE *f;

	stat_result = stat(fullpath, &st);
	if (stat_result != 0) {
		DOLE LOGGER_log("%s:%d:OLE_open_file:ERROR: Cannot locate file '%s' for opening (%s)",FL, fullpath, strerror(errno));
		return OLEER_BAD_INPUT_FILE;
	}

	DOLE LOGGER_log("%s:%d:OLE_open_file:DEBUG: File size of %s = %ld",FL, fullpath, st.st_size);
	if ((stat_result == 0) && (st.st_size < 512)) return OLEER_NOT_OLE_FILE;

	ole->file_size = st.st_size;

	f = fopen(fullpath,"r");
	if (f == NULL)
	{
		ole->f = NULL;
		if (ole->quiet == 0)
		{
			LOGGER_log("%s:%d:OLE_open_file:ERROR:Cannot open %s for reading (%s)\n",FL,fullpath, strerror(errno));
		}
		return -1;
	} else {
		ole->f = f;
		ole->file_size = st.st_size;
		ole->last_sector = -1;
	}
	return OLE_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x2240
movl 0x444(%r14), %ecx
testl %eax, %eax
je 0xf59e
pushq $0x65
popq %rbp
testl %ecx, %ecx
je 0xf610
callq 0x2060
movl (%rax), %edi
callq 0x23c0
leaq 0x96b4(%rip), %rdi      # 0x18c37
leaq 0x88af(%rip), %rsi      # 0x17e39
movl $0x580, %edx            # imm = 0x580
movq %rbx, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xc2a1
jmp 0xf610
movq 0x38(%rsp), %r15
testl %ecx, %ecx
je 0xf5c7
leaq 0x96cd(%rip), %rdi      # 0x18c7b
leaq 0x8884(%rip), %rsi      # 0x17e39
movl $0x584, %edx            # imm = 0x584
movq %rbx, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0xc2a1
cmpq $0x200, %r15            # imm = 0x200
jge 0xf5d5
pushq $0x66
popq %rbp
jmp 0xf610
movq %r15, 0x8(%r14)
leaq 0x5f24(%rip), %rsi      # 0x15504
movq %rbx, %rdi
callq 0x2350
testq %rax, %rax
je 0xf5fe
movq %rax, 0x20(%r14)
movq %r15, 0x8(%r14)
orl $-0x1, 0x10(%r14)
xorl %ebp, %ebp
jmp 0xf610
andq $0x0, 0x20(%r14)
pushq $-0x1
popq %rbp
cmpl $0x0, 0x44c(%r14)
je 0xf620
movl %ebp, %eax
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x2060
movl (%rax), %edi
callq 0x23c0
leaq 0x9679(%rip), %rdi      # 0x18cac
leaq 0x87ff(%rip), %rsi      # 0x17e39
movl $0x58f, %edx            # imm = 0x58F
jmp 0xf58f
// File: /workspace/github_c_makefile_star2_O2/inflex[P]ripMIME/ripOLE/ole.c
// Function: OLE_open_directory
int OLE_open_directory( struct OLE_object *ole, char *directory )
{
	int result=0;

	result = mkdir( directory, S_IRWXU );
	if ((result != 0)&&(errno != EEXIST))
	{
		LOGGER_log("%s:%d:OLE_open_directory:ERROR: %s",FL,strerror(errno));
	} else result = OLE_OK;

	return result;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rdi
movl $0x1c0, %esi            # imm = 0x1C0
callq 0x20b0
xorl %ebp, %ebp
testl %eax, %eax
je 0xf68c
movl %eax, %ebx
callq 0x2060
movl (%rax), %edi
cmpl $0x11, %edi
je 0xf68c
callq 0x23c0
leaq 0x9673(%rip), %rdi      # 0x18ce7
leaq 0x87be(%rip), %rsi      # 0x17e39
movl $0x5b2, %edx            # imm = 0x5B2
movq %rax, %rcx
xorl %eax, %eax
callq 0xc2a1
movl %ebx, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/inflex[P]ripMIME/ripOLE/ole.c
// Function: OLE_store_stream
int OLE_store_stream( struct OLE_object *ole, char *stream_name, char *directory, char *stream, size_t stream_size )
{
	char *full_path = NULL;

	full_path = PLD_dprintf("%s/%s", directory, stream_name);
	if (full_path == NULL)
	{
		LOGGER_log("%s:%d:OLE_store_stream:ERROR: Cannot compose full filename string from '%s' and '%s'", FL, directory, stream_name);
		return -1;
	} else {
		FILE *f;

		f = fopen(full_path,"w");
		if (f == NULL)
		{
			LOGGER_log("%s:%d:OLE_store_stream:ERROR: Cannot open %s for writing (%s)",FL, full_path, strerror(errno));
			if (full_path) free(full_path);
			return -1;
		} else {
			size_t written_bytes;

			written_bytes = fwrite( stream, 1, stream_size, f );
			if (written_bytes != stream_size)
			{
				LOGGER_log("%s:%d:OLE_store_stream:WARNING: Only wrote %d of %d bytes to file %s",FL,written_bytes,stream_size,full_path);
			}
			fclose(f);

			if ((OLE_VNORMAL(ole->verbose))&&(ole->filename_report_fn != NULL))
			{
				ole->filename_report_fn( stream_name );
			}
		} // if file is valid
	} // if full_path is valid

	if (full_path) free(full_path);

	return OLE_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r12
movq %rcx, %rbp
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %r15
leaq 0x1d4c(%rip), %rdi      # 0x1140c
movq %rdx, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0xbfbe
testq %rax, %rax
je 0xf75c
movq %rax, %rbx
leaq 0x284b(%rip), %rsi      # 0x11f2b
movq %rax, %rdi
callq 0x2350
testq %rax, %rax
je 0xf77e
movq %rax, %r13
pushq $0x1
popq %rsi
movq %rbp, %rdi
movq %r12, %rdx
movq %rax, %rcx
callq 0x23a0
cmpq %r12, %rax
je 0xf72d
leaq 0x968c(%rip), %rdi      # 0x18d9d
leaq 0x8721(%rip), %rsi      # 0x17e39
movl $0x5fc, %edx            # imm = 0x5FC
movq %rax, %rcx
movq %r12, %r8
movq %rbx, %r9
xorl %eax, %eax
callq 0xc2a1
movq %r13, %rdi
callq 0x20f0
cmpl $0x0, 0x448(%r15)
je 0xf750
movq 0x470(%r15), %rax
testq %rax, %rax
je 0xf750
movq %r14, %rdi
callq *%rax
movq %rbx, %rdi
callq 0x2030
xorl %eax, %eax
jmp 0xf7b5
leaq 0x95a7(%rip), %rdi      # 0x18d0a
leaq 0x86cf(%rip), %rsi      # 0x17e39
movl $0x5eb, %edx            # imm = 0x5EB
movq %r13, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0xc2a1
jmp 0xf7b2
callq 0x2060
movl (%rax), %edi
callq 0x23c0
leaq 0x95ce(%rip), %rdi      # 0x18d5f
leaq 0x86a1(%rip), %rsi      # 0x17e39
movl $0x5f3, %edx            # imm = 0x5F3
movq %rbx, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xc2a1
movq %rbx, %rdi
callq 0x2030
pushq $-0x1
popq %rax
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/ripOLE/ole.c
// Function: OLE_decode_file_done
int OLE_decode_file_done( struct OLE_object *ole )
{
	if (ole->f) fclose(ole->f);
	/** Why weren't these active? (they were commented out ) **/
	if (ole->FAT) free(ole->FAT);
	if (ole->miniFAT) free(ole->miniFAT);
	if (ole->ministream) free(ole->ministream);
	if (ole->properties) free(ole->properties);

	return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
testq %rdi, %rdi
je 0xf7d6
callq 0x20f0
movq 0x28(%rbx), %rdi
callq 0x2030
movq 0x38(%rbx), %rdi
callq 0x2030
movq 0x248(%rbx), %rdi
callq 0x2030
movq 0x250(%rbx), %rdi
callq 0x2030
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/inflex[P]ripMIME/ripOLE/olestream-unwrap.c
// Function: OLEUNWRAP_save_stream
int OLEUNWRAP_save_stream( struct OLEUNWRAP_object *oleuw, char *fname, char *decode_path, char *stream, size_t bytes )
{
	char *full_name;
	FILE *f;
	int result = 0;

	DUW LOGGER_log("%s:%d:OLEUNWRAP_save_stream:DEBUG: fname=%s, decodepath=%s, size=%ld"
			,FL
			,fname
			,decode_path
			,bytes
			);

	full_name = PLD_dprintf("%s/%s", decode_path, fname );
	if (full_name == NULL)
	{
		LOGGER_log("%s:%d:OLEUNWRAP_save_stream:ERROR: Unable to create filename string from '%s' and '%s'",FL,fname,decode_path);
		return -1;
	}

	f = fopen(full_name,"w");
	if (f != NULL)
	{
		size_t write_count;

		write_count = fwrite( stream, 1, bytes, f );
		if (write_count != bytes)
		{
			LOGGER_log("%s:%d:OLEUNWRAP_save_stream:WARNING: Only wrote %d of %d bytes to file %s\n",FL, write_count, bytes, full_name );
		}

		fclose(f);


	} else {
		LOGGER_log("%s:%d:OLEUNWRAP_save_stream:ERROR: Unable to open %s for writing (%s)\n",FL,full_name, strerror(errno));
		result = -1;
	}

	if (full_name) free(full_name);

	DUW LOGGER_log("%s:%d:OLEUNWRAP_save_stream:DEBUG: Done saving '%s'",FL, fname);

	return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r12
movq %rcx, %r13
movq %rdx, %rbp
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x0, 0x8(%rdi)
je 0x10032
leaq 0x946f(%rip), %rdi      # 0x19485
leaq 0x94ad(%rip), %rsi      # 0x194ca
movl $0x9b, %edx
movq %rbx, %rcx
movq %rbp, %r8
movq %r12, %r9
xorl %eax, %eax
callq 0xc2a1
leaq 0x13d3(%rip), %rdi      # 0x1140c
movq %rbp, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xbfbe
testq %rax, %rax
je 0x100aa
movq %rax, %r15
leaq 0x1ed6(%rip), %rsi      # 0x11f2b
movq %rax, %rdi
callq 0x2350
testq %rax, %rax
je 0x100cf
movq %rax, %rbp
pushq $0x1
popq %rsi
movq %r13, %rdi
movq %r12, %rdx
movq %rax, %rcx
callq 0x23a0
cmpq %r12, %rax
je 0x1009e
leaq 0x94b2(%rip), %rdi      # 0x19534
leaq 0x9441(%rip), %rsi      # 0x194ca
movl $0xb0, %edx
movq %rax, %rcx
movq %r12, %r8
movq %r15, %r9
xorl %eax, %eax
callq 0xc2a1
movq %rbp, %rdi
callq 0x20f0
xorl %ebp, %ebp
jmp 0x100fe
leaq 0x942c(%rip), %rdi      # 0x194dd
leaq 0x9412(%rip), %rsi      # 0x194ca
movl $0xa4, %edx
movq %rbx, %rcx
movq %rbp, %r8
xorl %eax, %eax
callq 0xc2a1
pushq $-0x1
popq %rbp
jmp 0x1012a
callq 0x2060
movl (%rax), %edi
callq 0x23c0
leaq 0x949d(%rip), %rdi      # 0x1957f
leaq 0x93e1(%rip), %rsi      # 0x194ca
movl $0xb7, %edx
movq %r15, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xc2a1
pushq $-0x1
popq %rbp
movq %r15, %rdi
callq 0x2030
cmpl $0x0, 0x8(%r14)
je 0x1012a
leaq 0x94b2(%rip), %rdi      # 0x195c6
leaq 0x93af(%rip), %rsi      # 0x194ca
movl $0xbd, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0xc2a1
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/ripOLE/olestream-unwrap.c
// Function: OLEUNWRAP_sanitize_filename
int OLEUNWRAP_sanitize_filename( char *fname )
{

	if (fname == NULL) return 0;

		while (*fname)
		{
			if( !isalnum((int)*fname) && (*fname != '.') ) *fname='_';
			if( (*fname < ' ')||(*fname > '~') ) *fname='_';
			fname++;
		}
		return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x10184
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movsbq (%rbx), %r14
testq %r14, %r14
je 0x1017d
callq 0x23f0
movq (%rax), %rax
movb (%rax,%r14,2), %al
shrb $0x3, %al
cmpb $0x2e, %r14b
sete %cl
orb %al, %cl
leal -0x7f(%r14), %eax
cmpb $-0x5f, %al
setae %al
testb %al, %cl
jne 0x10178
movb $0x5f, (%rbx)
incq %rbx
jmp 0x10147
addq $0x8, %rsp
popq %rbx
popq %r14
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/inflex[P]ripMIME/ripOLE/olestream-unwrap.c
// Function: OLEUNWRAP_seach_for_file_sig
int OLEUNWRAP_seach_for_file_sig( struct OLEUNWRAP_object *oleuw, char *block, size_t block_len )
{
	int result = -1;
	int hit = 0;
	char *p;		/** signature pointer **/
	char *bp; /** pointer in the block **/
	struct typesig sigs[]= {
		{ "\x89\x50\x4e\x47", 4, 0 }, /** PNG **/
		{ "\xff\xd8\xff", 3, 0 }, /** JPEG **/
		{ NULL, -1, -1 } /** End of array **/
	};

	bp = block;
	block_len -= 4;

	/** While there's more data in the block and we're not found a match **/
	while ((block_len > 0)&&(hit==0)) {
		struct typesig *tsp; /** Type signature pointer **/

		block_len--;

		tsp = sigs; /** tsp points to the first signature in the array **/

		/** While there's more valid signatures in the array **/
		while (tsp->length > 0) {
			int cmpresult = 0;

			p = tsp->sequence; /** set p to point to the start of the image signature sequence **/
			cmpresult = memcmp(bp, p, 3);
			if (cmpresult == 0) {
				DUW LOGGER_log("%s:%d:OLEUNWRAP_seach_for_file_sig:DEBUG: Hit at offset %d for signature %d",FL,(bp-block),(tsp -sigs));
				hit = 1;
				break;
			} /** If we had a match in the signatures **/

			tsp++; /** go to the next signature **/

		} /** While more signatures **/

		if (hit == 0) bp++; /** If we didn't get a hit, move to the next byte in the file **/

	} /** while more data in the block **/

	if (hit == 1) {
		result =  bp -block;
	} else { 
		result = -1;
	}

	return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, 0x8(%rsp)
movaps 0xec29(%rip), %xmm0     # 0x1edd0
movaps %xmm0, 0x30(%rsp)
movaps 0xec0d(%rip), %xmm0     # 0x1edc0
movaps %xmm0, 0x20(%rsp)
movaps 0xebf1(%rip), %xmm0     # 0x1edb0
movaps %xmm0, 0x10(%rsp)
addq $-0x4, %r14
pushq $0x3
popq %r13
movq %rsi, (%rsp)
movq %r12, %rbp
subq (%rsp), %rbp
movb $0x1, %bl
xorl %ecx, %ecx
testb $0x1, %bl
je 0x1024b
testq %r14, %r14
je 0x1024b
decq %r14
xorl %r15d, %r15d
cmpl $0x0, 0x18(%rsp,%r15)
jle 0x10246
movq 0x10(%rsp,%r15), %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x22f0
testl %eax, %eax
je 0x1020d
addq $0x10, %r15
jmp 0x101eb
movb $0x1, %cl
xorl %ebx, %ebx
movq 0x8(%rsp), %rax
cmpl $0x0, 0x8(%rax)
je 0x101db
sarq $0x4, %r15
xorl %ebx, %ebx
leaq 0x93da(%rip), %rdi      # 0x19603
leaq 0x929a(%rip), %rsi      # 0x194ca
movl $0x10f, %edx            # imm = 0x10F
movq %rbp, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0xc2a1
movb $0x1, %cl
jmp 0x101db
incq %r12
jmp 0x101d0
subl (%rsp), %r12d
testb $0x1, %cl
pushq $-0x1
popq %rax
cmovnel %r12d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/inflex[P]ripMIME/ripOLE/olestream-unwrap.c
// Function: OLEUNWRAP_decodestream
int OLEUNWRAP_decodestream( struct OLEUNWRAP_object *oleuw, char *element_string, char *stream, size_t stream_size, char *decode_path )
{
	int result = OLEUW_OK;

	if (strstr(element_string, OLEUW_ELEMENT_10NATIVE_STRING) != NULL) 
	{
		
		DUW LOGGER_log("%s:%d:OLEUNWRAP_decodestream:DEBUG: Debugging element '%s'",FL, element_string);
		OLEUNWRAP_decode_attachment( oleuw, stream, stream_size, decode_path );

	} else if (strstr(element_string, OLEUW_ELEMENT_DATA) != NULL)  {

		DUW LOGGER_log("%s:%d:OLEUNWRAP_decodestream:DEBUG: Debugging element '%s'",FL, element_string);
		OLEUNWRAP_decode_attachment( oleuw, stream, stream_size, decode_path );

	} else {
		DUW LOGGER_log("%s:%d:OLEUNWRAP_decode_attachment:DEBUG: Unable to decode stream with element string '%s'\n", FL, element_string);
		result = OLEUW_STREAM_NOT_DECODED;
	}

	return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
leaq 0x9451(%rip), %rsi      # 0x19bbe
movq %r12, %rdi
callq 0x23d0
testq %rax, %rax
je 0x10796
cmpl $0x0, 0x8(%r13)
je 0x107cf
leaq 0x9442(%rip), %rdi      # 0x19bca
leaq 0x8d3b(%rip), %rsi      # 0x194ca
movl $0x1dc, %edx            # imm = 0x1DC
jmp 0x107c5
leaq 0x9468(%rip), %rsi      # 0x19c05
movq %r12, %rdi
callq 0x23d0
movl 0x8(%r13), %ecx
testq %rax, %rax
je 0x107ee
testl %ecx, %ecx
je 0x107cf
leaq 0x9411(%rip), %rdi      # 0x19bca
leaq 0x8d0a(%rip), %rsi      # 0x194ca
movl $0x1e1, %edx            # imm = 0x1E1
movq %r12, %rcx
xorl %eax, %eax
callq 0xc2a1
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x10268
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
pushq $0x64
popq %rbx
testl %ecx, %ecx
je 0x107e2
leaq 0x940e(%rip), %rdi      # 0x19c0a
leaq 0x8cc7(%rip), %rsi      # 0x194ca
movl $0x1e5, %edx            # imm = 0x1E5
movq %r12, %rcx
xorl %eax, %eax
callq 0xc2a1
jmp 0x107e2
// File: /workspace/github_c_makefile_star2_O2/inflex[P]ripMIME/ripOLE/bt-int.c
// Function: BTI_add
int BTI_add( struct bti_node **n, int value )
{
	int collision = 0;
	int dir = 0;
	struct bti_node *p = NULL, *node = *n;

//	fprintf(stdout,"Adding %d to %p\n", value, *n);
	while (node != NULL)
	{
		if (value > node->data) { p = node; dir=1;  node = node->r; }
		else if (value < node->data) { p = node; dir=-1; node = node->l; }
		else if (value == node->data) 
		{
			collision = 1;
			break;
		}
	}

	if (collision == 0)
	{
		struct bti_node *leaf;

		leaf = malloc(sizeof(struct bti_node));
		if (leaf == NULL)
		{
			return -1;
		}

		leaf->data = value;
		leaf->l = leaf->r = NULL;

		if (p != NULL)
		{
			switch (dir) {
				case 1: 
					p->r = leaf;
					break;
				case -1: 
					p->l = leaf;
					break;
			}
		} else {
			*n = leaf;
		}


	}

	return collision;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
xorl %r14d, %r14d
pushq $0x1
popq %rax
pushq $0x10
popq %rcx
pushq $-0x1
popq %rdx
pushq $0x8
popq %rsi
movq %rdi, %r8
xorl %r15d, %r15d
movq (%r8), %rdi
testq %rdi, %rdi
je 0x10888
movl (%rdi), %r8d
cmpl %ebp, %r8d
jl 0x10872
jg 0x1087a
jne 0x1085f
jmp 0x108cb
movq %rcx, %r8
movl %eax, %r14d
jmp 0x10880
movq %rsi, %r8
movl %edx, %r14d
addq %rdi, %r8
movq %rdi, %r15
jmp 0x1085c
pushq $0x18
popq %rdi
callq 0x22a0
testq %rax, %rax
je 0x108ba
movq %rax, %rcx
movl %ebp, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
testq %r15, %r15
je 0x108c6
cmpl $-0x1, %r14d
je 0x108bf
xorl %eax, %eax
cmpl $0x1, %r14d
jne 0x108cb
addq $0x10, %r15
jmp 0x108c3
pushq $-0x1
popq %rax
jmp 0x108cb
addq $0x8, %r15
movq %r15, %rbx
movq %rcx, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/inflex[P]ripMIME/ripOLE/bt-int.c
// Function: BTI_dump
int BTI_dump( struct bti_node **n )
{
		struct bti_node *node;

	node = *n;
	
	if (node->l) BTI_dump(&(node->l)); 
	if (*n) { fprintf(stdout,"%d, ", node->data); }
	if (node->r) BTI_dump(&(node->r));

	return 0;

}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq (%rdi), %r12
movq 0xe6e5(%rip), %r15      # 0x1efd0
leaq 0x9373(%rip), %rbx      # 0x19c65
cmpq $0x0, 0x8(%r12)
je 0x1090a
leaq 0x8(%r12), %rdi
callq 0x108d6
cmpq $0x0, (%r14)
je 0x1091b
movq (%r15), %rdi
movl (%r12), %edx
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2210
movq %r12, %r14
movq 0x10(%r12), %rax
addq $0x10, %r14
movq %rax, %r12
testq %rax, %rax
jne 0x108f2
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq