LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/inflex[P]ripMIME/pldstr.c
// Function: PLD_strtok
char *PLD_strtok( struct PLD_strtok *st, char *line, char *delimeters )
{
    char *stop;
    char *dc;
    char *result = NULL;

    if ( line )
    {
        st->start = line;
    }

    //Strip off any leading delimeters
    dc = delimeters;
    while ((st->start)&&(*dc != '\0'))
    {
        if (*dc == *(st->start))
        {
            st->start++;
            dc = delimeters;
        }
        else dc++;
    }

    // Where we are left, is the start of our token.
    result = st->start;
    if ((st->start)&&(*(st->start) != '\0'))
    {
        stop = strpbrk( st->start, delimeters ); /* locate our next delimeter */
        // If we found a delimeter, then that is good.  We must now break the string here
        // and don't forget to store the character which we stopped on.  Very useful bit
        // of information for programs which process expressions.
        if (stop)
        {
            // Store our delimeter.
            st->delimeter = *stop;
            // Terminate our token.
            *stop = '\0';

            // Because we're emulating strtok() behaviour here, we have to
            // absorb all the concurrent delimeters, that is, unless we
            // reach the end of the string, we cannot return a string with
            // no chars.

            stop++;
            dc = delimeters;
            while (*dc != '\0')
            {
                if (*dc == *stop)
                {
                    stop++;
                    dc = delimeters;
                }
                else dc++;
            } // While

            if (*stop == '\0') st->start = NULL;
            else st->start = stop;
        }
        else {
            st->start = NULL;
            st->delimeter = '\0';
        }
    }
    else  {
        st->start = NULL;
        result = NULL;
    }
    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r15
movq %rdi, %r14
testq %rsi, %rsi
je 0xc17b
movq %rsi, (%r14)
movq (%r14), %rbx
testq %rbx, %rbx
sete %al
je 0xc1fb
movb (%r15), %cl
testb %cl, %cl
je 0xc1aa
movq %r15, %rax
cmpb (%rbx), %cl
jne 0xc19f
incq %rbx
movq %rbx, (%r14)
movq %r15, %rax
jmp 0xc1a2
incq %rax
movb (%rax), %cl
testb %cl, %cl
jne 0xc190
xorl %eax, %eax
testb %al, %al
jne 0xc1fb
cmpb $0x0, (%rbx)
je 0xc1fb
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2300
testq %rax, %rax
je 0xc20d
movb (%rax), %cl
movb %cl, 0x8(%r14)
movb $0x0, (%rax)
incq %rax
movb (%r15), %dl
testb %dl, %dl
je 0xc1f1
movq %r15, %rcx
incq %rcx
xorl %esi, %esi
cmpb (%rax), %dl
cmoveq %r15, %rcx
sete %sil
addq %rsi, %rax
movb (%rcx), %dl
testb %dl, %dl
jne 0xc1d9
cmpb $0x0, (%rax)
je 0xc21b
movq %rax, (%r14)
jmp 0xc204
movq $0x0, (%r14)
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
movq $0x0, (%r14)
movb $0x0, 0x8(%r14)
jmp 0xc204
movq $0x0, (%r14)
jmp 0xc204
// File: /workspace/github_c_makefile_star2_O1/inflex[P]ripMIME/pldstr.c
// Function: PLD_strreplace
char *PLD_strreplace( char **source, char *searchfor, char *replacewith, int replacenumber )
{
    struct PLD_strreplace replace_details;
    char *tmp_source;

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

    tmp_source = PLD_strreplace_general( &replace_details );

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

// Assembly:
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
movq (%rdi), %rax
movq %rsp, %rdi
movq %rax, (%rdi)
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movl %ecx, 0x28(%rdi)
movl $0x0, 0x2c(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rdi)
callq 0xc224
cmpq (%rbx), %rax
je 0xc663
movq %rax, (%rbx)
movq (%rbx), %rax
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xc6d4
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 0x22b0
testq %rax, %rax
je 0xc76a
movq %rax, %r14
movl $0x400, %r15d           # imm = 0x400
movabsq $0x3000000008, %rbp     # imm = 0x3000000008
movq %rsp, %r12
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x110(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %rbp, (%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 0xc76d
leal 0x1(%rax), %ecx
addl %r15d, %r15d
testl %eax, %eax
cmovnsl %ecx, %r15d
movq %r14, %rdi
movq %r15, %rsi
callq 0x2320
movq %rax, %r13
testq %rax, %rax
jne 0xc762
movq %r14, %rdi
callq 0x2030
movq %r14, %rax
movq %rax, %r14
testq %r13, %r13
jne 0xc6fd
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_O1/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 0xe465(%rip), %rsi      # 0x1ac18
callq 0x2350
movq %rax, %rcx
movq %rax, 0x22d6e(%rip)     # 0x2f530
xorl %eax, %eax
testq %rcx, %rcx
jne 0xc7f3
callq 0x2060
movl (%rax), %edi
callq 0x23c0
leaq 0xb188(%rip), %rsi      # 0x17964
movl $0x1, %edi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x22f0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x22b0
testq %rax, %rax
je 0xc94c
movq %rbx, 0x20(%rsp)
leal (%r15,%r15), %ecx
movl 0x22cc5(%rip), %edx     # 0x2f538
movl %edx, 0x8(%rsp)
movslq 0x22cbe(%rip), %rdx     # 0x2f53c
movq %rdx, 0x10(%rsp)
decl %ecx
movl %ecx, 0xc(%rsp)
leaq 0x1(%r14), %r13
negq %r14
xorl %ebp, %ebp
movq %rax, 0x18(%rsp)
movq %rax, %r12
xorl %ebx, %ebx
subl $0x1, %r15d
jb 0xc936
cmpl $0x0, 0x8(%rsp)
jle 0xc903
callq 0x23f0
movq (%rax), %rax
movsbq -0x1(%r13), %rcx
testb $0x20, 0x1(%rax,%rcx,2)
je 0xc8f1
movq %r13, %rdi
leaq 0xb0d3(%rip), %rsi      # 0x1799e
callq 0x2300
testq %rax, %rax
je 0xc8f1
movslq %ebx, %rcx
addq %r14, %rcx
addq %rax, %rcx
cmpq 0x10(%rsp), %rcx
jl 0xc8f1
movb $0xa, (%r12)
incq %r12
incl %ebp
xorl %ebx, %ebx
cmpl 0x10(%rsp), %ebx
jl 0xc903
movb $0xa, (%r12)
incq %r12
incl %ebp
xorl %ebx, %ebx
cmpb $0x25, -0x1(%r13)
jne 0xc914
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 0xc89c
movb $0x0, (%r12)
movq 0x20(%rsp), %rax
movq 0x18(%rsp), %rcx
movq %rcx, (%rax)
xorl %eax, %eax
jmp 0xc951
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x221cb(%rip), %r15     # 0x2f578
testq %r15, %r15
je 0xd409
leaq 0xace7(%rip), %rbx      # 0x180a0
leaq 0xad05(%rip), %r14      # 0x180c5
cmpl $0x0, 0x22189(%rip)     # 0x2f550
je 0xd3de
movq %rbx, %rdi
movq %r14, %rsi
movl $0xc0, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0xc960
movq 0x22193(%rip), %rax     # 0x2f578
movq (%rax), %rdi
movq 0x10(%rax), %r15
callq 0x2030
movq 0x22180(%rip), %rdi     # 0x2f578
callq 0x2030
movq %r15, 0x22174(%rip)     # 0x2f578
testq %r15, %r15
jne 0xd3c0
movq $0x0, 0x22164(%rip) # 0x2f578
movl $0x0, 0x22142(%rip)     # 0x2f560
movl $0xffffffff, 0x22144(%rip) # imm = 0xFFFFFFFF
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/inflex[P]ripMIME/boundary-stack.c
// Function: BS_non_hyphen_length
int BS_non_hyphen_length( char *boundary )
{
	int count = 0;
	char *p = boundary;

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

	return count;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movb (%rdi), %bpl
testb %bpl, %bpl
je 0xd467
movq %rdi, %rbx
callq 0x23f0
movq (%rax), %rcx
incq %rbx
xorl %eax, %eax
movsbq %bpl, %rdx
movzwl (%rcx,%rdx,2), %edx
btl $0x3, %edx
adcl $0x0, %eax
movb (%rbx), %bpl
incq %rbx
testb %bpl, %bpl
jne 0xd44b
jmp 0xd469
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x220ea(%rip), %ecx     # 0x2f568
testl %ecx, %ecx
jle 0xd4b6
cmpl %ecx, 0x220d8(%rip)     # 0x2f560
jl 0xd4b6
cmpl $0x0, 0x220bf(%rip)     # 0x2f550
je 0xd5c0
leaq 0xac38(%rip), %rdi      # 0x180d6
leaq 0xac20(%rip), %rsi      # 0x180c5
movl $0xff, %edx
xorl %eax, %eax
callq 0xc960
jmp 0xd5c0
movl $0x18, %edi
callq 0x22b0
movq %rax, %r14
cmpl $0x0, 0x22086(%rip)     # 0x2f550
je 0xd4f3
movq 0x220a5(%rip), %rcx     # 0x2f578
leaq 0xac45(%rip), %rdi      # 0x1811f
leaq 0xabe4(%rip), %rsi      # 0x180c5
movl $0x105, %edx            # imm = 0x105
movq %r14, %r8
movq %rbx, %r9
xorl %eax, %eax
callq 0xc960
testq %r14, %r14
je 0xd597
movq 0x22075(%rip), %rax     # 0x2f578
movq %rax, 0x10(%r14)
movq %r14, 0x2206a(%rip)     # 0x2f578
movq %rbx, %rdi
callq 0x23b0
movq %rax, (%r14)
movq %rax, %rdi
callq 0x2110
movq %rax, %r15
movl %r15d, 0x8(%r14)
testl %r15d, %r15d
jne 0xd537
movl $0x1, 0x22039(%rip)     # 0x2f570
movq %rbx, %rdi
callq 0xd430
incl 0x2201b(%rip)           # 0x2f560
movl %eax, 0xc(%r14)
movl 0x2201d(%rip), %ecx     # 0x2f56c
cmpl $-0x1, %ecx
setne %dl
cmpl %r15d, %ecx
setle %cl
testb %cl, %dl
jne 0xd566
movl %r15d, 0x22006(%rip)    # 0x2f56c
cmpl $0x0, 0x21fe3(%rip)     # 0x2f550
je 0xd5c0
movl 0x21ff7(%rip), %ecx     # 0x2f56c
leaq 0xabdb(%rip), %rdi      # 0x18157
leaq 0xab42(%rip), %rsi      # 0x180c5
movl $0x115, %edx            # imm = 0x115
movl %eax, %r8d
movq %rbx, %r9
xorl %eax, %eax
callq 0xc960
jmp 0xd5c0
callq 0x2060
movl (%rax), %edi
callq 0x23c0
leaq 0xabe5(%rip), %rdi      # 0x1818f
leaq 0xab14(%rip), %rsi      # 0x180c5
movl $0x119, %edx            # imm = 0x119
movq %rax, %rcx
xorl %eax, %eax
callq 0xc960
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x21fa8(%rip), %rbx     # 0x2f578
testq %rbx, %rbx
je 0xd60a
movq 0x10(%rbx), %rax
movq %rax, 0x21f98(%rip)     # 0x2f578
movq (%rbx), %rsi
leaq 0x21f96(%rip), %rdi     # 0x2f580
movl $0x400, %edx            # imm = 0x400
callq 0xbfb6
movq (%rbx), %rdi
callq 0x2030
movq %rbx, %rdi
callq 0x2030
decl 0x21f56(%rip)           # 0x2f560
leaq 0x21f6f(%rip), %rax     # 0x2f580
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x21f16(%rip), %eax     # 0x2f570
cmpl $0x1, %eax
setne %cl
testl %edx, %edx
setg %dl
orb %cl, %dl
jne 0xd6ad
leaq 0x7cf4(%rip), %rsi      # 0x15364
movl $0x2, %edx
movq %r14, %rdi
callq 0x20a0
movl %eax, %ebx
cmpl $0x0, 0x21eca(%rip)     # 0x2f550
je 0xd788
leaq 0xab44(%rip), %rdi      # 0x181d7
leaq 0xaa2b(%rip), %rsi      # 0x180c5
movl $0x19e, %edx            # imm = 0x19E
movl %ebx, %ecx
xorl %eax, %eax
callq 0xc960
jmp 0xd788
testl %ebp, %ebp
setle %cl
testl %eax, %eax
sete %al
movl $0x1, %ebx
testb %al, %cl
jne 0xd788
movq %rsi, %r15
movl 0x21e96(%rip), %r13d    # 0x2f564
cmpl $0x0, 0x21e7b(%rip)     # 0x2f550
je 0xd6fe
movl %r13d, (%rsp)
leaq 0xab36(%rip), %rdi      # 0x18218
leaq 0xa9dc(%rip), %rsi      # 0x180c5
movl $0x1a7, %edx            # imm = 0x1A7
movq %r15, %rcx
movl %ebp, %r8d
movq %r14, %r9
xorl %eax, %eax
callq 0xc960
testl %r13d, %r13d
jle 0xd788
movslq %ebp, %r12
incl %r13d
leaq 0xa9b1(%rip), %rbp      # 0x180c5
cmpb $0x0, (%r14)
je 0xd788
cmpl $0x0, 0x21e2f(%rip)     # 0x2f550
je 0xd73f
leaq 0xab3f(%rip), %rdi      # 0x18269
movq %rbp, %rsi
movl $0x1b1, %edx            # imm = 0x1B1
movq %r15, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0xc960
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x20a0
testl %eax, %eax
je 0xd75f
incq %r14
decl %r13d
cmpl $0x2, %r13d
jge 0xd714
jmp 0xd788
cmpl $0x0, 0x21dea(%rip)     # 0x2f550
je 0xd786
leaq 0xab2b(%rip), %rdi      # 0x1829a
leaq 0xa94f(%rip), %rsi      # 0x180c5
xorl %ebx, %ebx
movl $0x1b4, %edx            # imm = 0x1B4
xorl %eax, %eax
callq 0xc960
jmp 0xd788
xorl %ebx, %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_O1/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 %rbp
pushq %r14
pushq %rbx
subq $0x410, %rsp            # imm = 0x410
cmpl $0x0, 0x21fb8(%rip)     # 0x2f998
je 0xdaf3
movq %rdi, %rbx
leaq 0xa69d(%rip), %rdx      # 0x1808d
xorl %ebp, %ebp
leaq 0x10(%rsp), %r14
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2140
leaq 0xa988(%rip), %rsi      # 0x18398
movl $0x5, %edx
movq %r14, %rdi
callq 0x22c0
testl %eax, %eax
jne 0xdaf5
movsbq 0x15(%rsp), %r14
cmpq $0x3a, %r14
je 0xdaf5
callq 0x23f0
movq (%rax), %rax
testb $0x20, 0x1(%rax,%r14,2)
je 0xdaf5
cmpb $0x0, 0x16(%rsp)
je 0xdaf5
leaq 0x883b(%rip), %rdx      # 0x16296
movq %rsp, %rdi
leaq 0x10(%rsp), %rsi
callq 0xc168
testq %rax, %rax
je 0xda83
leaq 0x8822(%rip), %rdx      # 0x16296
movq %rsp, %rdi
xorl %esi, %esi
callq 0xc168
movq %rax, %r14
jmp 0xda86
xorl %r14d, %r14d
movl 0x21ef4(%rip), %eax     # 0x2f980
testq %r14, %r14
je 0xdace
testl %eax, %eax
jle 0xdab2
leaq 0xa902(%rip), %rdi      # 0x1839e
leaq 0xa936(%rip), %rsi      # 0x183d9
movl $0x110, %edx            # imm = 0x110
movq %r14, %rcx
xorl %eax, %eax
callq 0xc960
movq %r14, %rdi
callq 0x2360
testl %eax, %eax
setne %cl
cmpl $0x30a, %eax            # imm = 0x30A
setl %al
andb %cl, %al
movzbl %al, %ebp
jmp 0xdaf5
testl %eax, %eax
jle 0xdaf3
leaq 0xa90b(%rip), %rdi      # 0x183e4
leaq 0xa8f9(%rip), %rsi      # 0x183d9
xorl %ebp, %ebp
movl $0x11a, %edx            # imm = 0x11A
movq %rbx, %rcx
xorl %eax, %eax
callq 0xc960
jmp 0xdaf5
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x410, %rsp            # imm = 0x410
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x89b6(%rip), %rsi      # 0x164d4
callq 0x2350
testq %rax, %rax
je 0xdb8a
movq %rax, %rbx
movl $0x14, %r13d
movq %rsp, %r14
leaq 0xa959(%rip), %r15      # 0x18494
leaq 0xa897(%rip), %r12      # 0x183d9
xorl %ebp, %ebp
movq %r14, %rdi
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdx
callq 0x21f0
testq %rax, %rax
je 0xdbcc
cmpl $0x0, 0x21e20(%rip)     # 0x2f980
jle 0xdb77
movq %r15, %rdi
movq %r12, %rsi
movl $0x145, %edx            # imm = 0x145
movq %r14, %rcx
xorl %eax, %eax
callq 0xc960
movq %r14, %rdi
callq 0xd9ce
testl %eax, %eax
jne 0xdbc7
decl %r13d
jne 0xdb44
jmp 0xdbcc
callq 0x2060
movl (%rax), %edi
callq 0x23c0
leaq 0xa8a8(%rip), %rdi      # 0x18445
leaq 0xa835(%rip), %rsi      # 0x183d9
movl $0x13e, %edx            # imm = 0x13E
movq %r14, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xc960
movl $0x65, 0x21df0(%rip)    # 0x2f9b0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0xdbd4
movl $0x1, %ebp
movq %rbx, %rdi
callq 0x20f0
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_O1/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 0xe5f5
cmpl $0x1, %ebp
jne 0xe611
cmpb $0x2e, (%rbx)
jne 0xe5f0
movb $0x5f, (%rbx)
jmp 0xe6b7
cmpl $0x2, %ebp
jne 0xe611
leaq 0x5929(%rip), %rsi      # 0x13f25
movl $0x2, %edx
movq %rbx, %rdi
callq 0x20a0
testl %eax, %eax
je 0xe6ae
movq %rbx, %rdi
movl $0x2f, %esi
callq 0x2150
testq %rax, %rax
jne 0xe635
movq %rbx, %rdi
movl $0x5c, %esi
callq 0x2150
testq %rax, %rax
je 0xe664
cmpb $0x0, 0x1(%rax)
je 0xe661
incq %rax
movq %rsp, %r14
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
movq %rax, %rsi
callq 0xbfb6
movslq %ebp, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbfb6
jmp 0xe664
movb $0x0, (%rax)
cmpl $0x0, 0x2134d(%rip)     # 0x2f9b8
jle 0xe6b7
movb (%rbx), %bpl
testb %bpl, %bpl
je 0xe6b7
callq 0x23f0
cmpb $0x2e, %bpl
je 0xe693
movq (%rax), %rcx
movsbq %bpl, %rdx
movzwl (%rcx,%rdx,2), %ecx
andl $0x8, %ecx
jne 0xe693
movb $0x5f, (%rbx)
movb (%rbx), %cl
addb $-0x7f, %cl
cmpb $-0x60, %cl
ja 0xe6a0
movb $0x5f, (%rbx)
movb 0x1(%rbx), %bpl
incq %rbx
testb %bpl, %bpl
jne 0xe67a
jmp 0xe6b7
movb $0x0, 0x2(%rbx)
movw $0x5f5f, (%rbx)         # imm = 0x5F5F
xorl %eax, %eax
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xeca3
pushq %rax
movb 0x26c(%rdi), %cl
shll %cl, %eax
cltq
addq %rax, %rsi
movl 0x270(%rdi), %eax
movq %rdx, %rdi
movq %rax, %rdx
callq 0x2270
addq $0x8, %rsp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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
leaq (%rdi,%rsi), %r12
decq %r12
cmpq %rdi, %r12
setbe %al
movq %rdx, %rbx
testq %rsi, %rsi
sete %dl
orb %al, %dl
jne 0xed15
movq %rsi, %r14
movq %rdi, %r15
movl %ecx, %eax
movq %rax, (%rsp)
addq $0x2, %r15
movl $0x1, %ebp
cmpl %ebp, (%rsp)
je 0xed15
movsbq -0x2(%r15), %r13
callq 0x23f0
movq (%rax), %rax
testb $0x40, 0x1(%rax,%r13,2)
je 0xed00
movb %r13b, (%rbx)
incq %rbx
cmpq %r12, %r15
jae 0xed15
leaq 0x1(%rbp), %rax
addq $0x2, %r15
cmpq %rbp, %r14
movq %rax, %rbp
jne 0xece0
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_O1/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:
testq %rsi, %rsi
je 0xed53
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
movsbl (%r14,%r15,2), %edi
callq 0x2040
incq %r15
cmpq %r15, %rbx
jne 0xed3c
popq %rbx
popq %r14
popq %r15
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %rax
movl %edx, %ebp
movq %rsi, %r12
movl $0xa, %edi
callq 0x2040
testl %ebp, %ebp
jle 0xedf0
movl %ebp, %r15d
leaq 0xa362(%rip), %r14      # 0x190e0
movq %r12, %r13
xorl %ebp, %ebp
movq %r15, (%rsp)
movsbl (%r12,%rbp), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x2130
incq %rbp
testb $0x1f, %bpl
jne 0xede8
movq %r14, %rbx
movq $-0x20, %r14
callq 0x23f0
movq %rax, %r15
movq (%r15), %rcx
movsbl 0x1(%r13,%r14), %eax
movslq %eax, %rdx
movzwl (%rcx,%rdx,2), %ecx
movl $0x2e, %edi
testb $0x8, %cl
je 0xedcd
movl %eax, %edi
callq 0x2040
incq %r14
jne 0xedb1
movl $0xa, %edi
callq 0x2040
movq %rbx, %r14
movq (%rsp), %r15
incq %r13
cmpq %r15, %rbp
jne 0xed87
movl $0xa, %edi
callq 0x2040
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_O1/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
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9bd
testl %eax, %eax
jne 0xee63
movq %rbx, %rdi
callq 0xee0b
xorl %ecx, %ecx
testl %eax, %eax
movl $0x66, %eax
cmovnel %ecx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/inflex[P]ripMIME/ripOLE/ole.c
// Function: OLE_header_sanity_check
int OLE_header_sanity_check( struct OLE_object *ole )
{
	int insanity=0;
	int max_sectors;
	struct OLE_header *h;

	h = &(ole->header);

	max_sectors = ole->file_size / h->sector_size;

	if (h->sector_shift > 20) insanity++;
	if (h->mini_sector_shift > 10) insanity++;
	if (h->fat_sector_count < 0) insanity++;
	if (h->fat_sector_count > max_sectors) insanity++;
	if (h->directory_stream_start_sector > max_sectors) insanity++;

	return insanity;
}

// Assembly:
movq 0x8(%rdi), %rax
movl 0x268(%rdi), %ecx
xorl %edx, %edx
divq %rcx
xorl %ecx, %ecx
cmpl $0x15, 0x264(%rdi)
setae %cl
leal 0x1(%rcx), %edx
cmpl $0xb, 0x26c(%rdi)
cmovbl %ecx, %edx
xorl %ecx, %ecx
cmpl %eax, 0x274(%rdi)
seta %cl
cmpl 0x278(%rdi), %eax
adcl %edx, %ecx
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xa07e(%rip), %rdi      # 0x190e6
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
cmpl $0x0, 0x274(%rbx)
je 0xf0c4
leaq 0xa1a4(%rip), %r14      # 0x1923c
xorl %r15d, %r15d
movl 0x290(%rbx,%r15,4), %edx
movq %r14, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x2130
cmpq $0x6b, %r15
ja 0xf0c4
movl 0x274(%rbx), %eax
incq %r15
cmpq %rax, %r15
jb 0xf09b
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_O1/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
movq %rbx, %rdi
movq %r14, %rdx
movl $0x40, %ecx
callq 0xeca6
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 0xa059(%rip), %rdi      # 0x19287
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_O1/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 0x2250
movl 0x444(%r14), %ecx
testl %eax, %eax
je 0xfdec
movl $0x65, %ebp
testl %ecx, %ecx
je 0xfe68
callq 0x2060
movl (%rax), %edi
callq 0x23c0
leaq 0x9e76(%rip), %rdi      # 0x19c47
leaq 0x9071(%rip), %rsi      # 0x18e49
movl $0x580, %edx            # imm = 0x580
movq %rbx, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xc960
jmp 0xfe68
testl %ecx, %ecx
je 0xfe12
movq 0x38(%rsp), %r8
leaq 0x9e8f(%rip), %rdi      # 0x19c8b
leaq 0x9046(%rip), %rsi      # 0x18e49
movl $0x584, %edx            # imm = 0x584
movq %rbx, %rcx
xorl %eax, %eax
callq 0xc960
movq 0x38(%rsp), %r15
movl $0x66, %ebp
cmpq $0x200, %r15            # imm = 0x200
jl 0xfe68
movq %r15, 0x8(%r14)
leaq 0x66a4(%rip), %rsi      # 0x164d4
movq %rbx, %rdi
callq 0x2350
testq %rax, %rax
je 0xfe51
movq %rax, 0x20(%r14)
movq %r15, 0x8(%r14)
movl $0xffffffff, 0x10(%r14) # imm = 0xFFFFFFFF
xorl %ebp, %ebp
jmp 0xfe68
movq $0x0, 0x20(%r14)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x0, 0x44c(%r14)
je 0xfe78
movl %ebp, %eax
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x2060
movl (%rax), %edi
callq 0x23c0
leaq 0x9e31(%rip), %rdi      # 0x19cbc
leaq 0x8fb7(%rip), %rsi      # 0x18e49
movl $0x58f, %edx            # imm = 0x58F
jmp 0xfddd
// File: /workspace/github_c_makefile_star2_O1/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 0xfee4
movl %eax, %ebx
callq 0x2060
movl (%rax), %edi
cmpl $0x11, %edi
je 0xfee4
callq 0x23c0
leaq 0x9e2b(%rip), %rdi      # 0x19cf7
leaq 0x8f76(%rip), %rsi      # 0x18e49
movl $0x5b2, %edx            # imm = 0x5B2
movq %rax, %rcx
xorl %eax, %eax
callq 0xc960
movl %ebx, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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, %r13
movq %rcx, %rbp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %r12
leaq 0x24f4(%rip), %rdi      # 0x1240c
movq %rdx, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0xc66c
testq %rax, %rax
je 0xffae
movq %rax, %rbx
leaq 0x2fc3(%rip), %rsi      # 0x12efb
movq %rax, %rdi
callq 0x2350
movq %rax, %r15
testq %rax, %rax
je 0xffd0
movl $0x1, %esi
movq %rbp, %rdi
movq %r13, %rdx
movq %r15, %rcx
callq 0x23a0
cmpq %r13, %rax
je 0xff87
leaq 0x9e42(%rip), %rdi      # 0x19dad
leaq 0x8ed7(%rip), %rsi      # 0x18e49
movl $0x5fc, %edx            # imm = 0x5FC
movq %rax, %rcx
movq %r13, %r8
movq %rbx, %r9
xorl %eax, %eax
callq 0xc960
movq %r15, %rdi
callq 0x20f0
cmpl $0x0, 0x448(%r12)
je 0x10004
movq 0x470(%r12), %rax
testq %rax, %rax
je 0x10004
movq %r14, %rdi
callq *%rax
jmp 0x10004
leaq 0x9d65(%rip), %rdi      # 0x19d1a
leaq 0x8e8d(%rip), %rsi      # 0x18e49
movl $0x5eb, %edx            # imm = 0x5EB
movq %r15, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0xc960
jmp 0x10015
callq 0x2060
movl (%rax), %edi
callq 0x23c0
leaq 0x9d8c(%rip), %rdi      # 0x19d6f
leaq 0x8e5f(%rip), %rsi      # 0x18e49
movl $0x5f3, %edx            # imm = 0x5F3
movq %rbx, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xc960
movq %rbx, %rdi
callq 0x2030
testq %r15, %r15
je 0x10015
movq %rbx, %rdi
callq 0x2030
xorl %eax, %eax
jmp 0x1001a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1003b
callq 0x20f0
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x10049
callq 0x2030
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x10057
callq 0x2030
movq 0x248(%rbx), %rdi
testq %rdi, %rdi
je 0x10068
callq 0x2030
movq 0x250(%rbx), %rdi
testq %rdi, %rdi
je 0x10079
callq 0x2030
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x108e6
leaq 0x9bcb(%rip), %rdi      # 0x1a495
leaq 0x9c09(%rip), %rsi      # 0x1a4da
movl $0x9b, %edx
movq %rbx, %rcx
movq %rbp, %r8
movq %r12, %r9
xorl %eax, %eax
callq 0xc960
leaq 0x1b1f(%rip), %rdi      # 0x1240c
movq %rbp, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xc66c
testq %rax, %rax
je 0x10960
movq %rax, %r15
leaq 0x25f2(%rip), %rsi      # 0x12efb
movq %rax, %rdi
callq 0x2350
testq %rax, %rax
je 0x10987
movq %rax, %rbp
movl $0x1, %esi
movq %r13, %rdi
movq %r12, %rdx
movq %rax, %rcx
callq 0x23a0
cmpq %r12, %rax
je 0x10954
leaq 0x9c0c(%rip), %rdi      # 0x1a544
leaq 0x9b9b(%rip), %rsi      # 0x1a4da
movl $0xb0, %edx
movq %rax, %rcx
movq %r12, %r8
movq %r15, %r9
xorl %eax, %eax
callq 0xc960
movq %rbp, %rdi
callq 0x20f0
xorl %ebp, %ebp
jmp 0x109b8
leaq 0x9b86(%rip), %rdi      # 0x1a4ed
leaq 0x9b6c(%rip), %rsi      # 0x1a4da
movl $0xa4, %edx
movq %rbx, %rcx
movq %rbp, %r8
xorl %eax, %eax
callq 0xc960
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x109e4
callq 0x2060
movl (%rax), %edi
callq 0x23c0
leaq 0x9bf5(%rip), %rdi      # 0x1a58f
leaq 0x9b39(%rip), %rsi      # 0x1a4da
movl $0xb7, %edx
movq %r15, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xc960
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %r15, %rdi
callq 0x2030
cmpl $0x0, 0x8(%r14)
je 0x109e4
leaq 0x9c08(%rip), %rdi      # 0x1a5d6
leaq 0x9b05(%rip), %rsi      # 0x1a4da
movl $0xbd, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0xc960
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_O1/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 0x10a45
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb (%rdi), %bpl
testb %bpl, %bpl
je 0x10a3f
callq 0x23f0
cmpb $0x2e, %bpl
je 0x10a26
movq (%rax), %rcx
movsbq %bpl, %rdx
movzwl (%rcx,%rdx,2), %ecx
andl $0x8, %ecx
jne 0x10a26
movb $0x5f, (%rbx)
movb (%rbx), %cl
addb $-0x7f, %cl
cmpb $-0x60, %cl
ja 0x10a33
movb $0x5f, (%rbx)
movb 0x1(%rbx), %bpl
incq %rbx
testb %bpl, %bpl
jne 0x10a0d
addq $0x8, %rsp
popq %rbx
popq %rbp
xorl %eax, %eax
retq