LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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 0x22279(%rip), %ecx     # 0x2f568
testl %ecx, %ecx
jle 0xd327
cmpl %ecx, 0x22267(%rip)     # 0x2f560
jl 0xd327
cmpl $0x0, 0x2224e(%rip)     # 0x2f550
je 0xd430
leaq 0xadb7(%rip), %rdi      # 0x180c6
leaq 0xad9f(%rip), %rsi      # 0x180b5
movl $0xff, %edx
xorl %eax, %eax
callq 0xc84f
jmp 0xd430
movl $0x18, %edi
callq 0x22a0
movq %rax, %r14
cmpl $0x0, 0x22215(%rip)     # 0x2f550
je 0xd364
movq 0x22234(%rip), %rcx     # 0x2f578
leaq 0xadc4(%rip), %rdi      # 0x1810f
leaq 0xad63(%rip), %rsi      # 0x180b5
movl $0x105, %edx            # imm = 0x105
movq %r14, %r8
movq %rbx, %r9
xorl %eax, %eax
callq 0xc84f
testq %r14, %r14
je 0xd407
movq 0x22204(%rip), %rax     # 0x2f578
movq %rax, 0x10(%r14)
movq %r14, 0x221f9(%rip)     # 0x2f578
movq %rbx, %rdi
callq 0x23a0
movq %rax, (%r14)
movq %rax, %rdi
callq 0x2110
movq %rax, %r15
movl %r15d, 0x8(%r14)
testl %r15d, %r15d
jne 0xd3a8
movl $0x1, 0x221c8(%rip)     # 0x2f570
movq %rbx, %rdi
callq 0xd2a1
incl 0x221aa(%rip)           # 0x2f560
movl %eax, 0xc(%r14)
movl 0x221ac(%rip), %ecx     # 0x2f56c
cmpl $-0x1, %ecx
setne %dl
cmpl %r15d, %ecx
setle %sil
testb %sil, %dl
jne 0xd3dc
movl %r15d, 0x22193(%rip)    # 0x2f56c
movl %r15d, %ecx
cmpl $0x0, 0x2216d(%rip)     # 0x2f550
je 0xd430
leaq 0xad5b(%rip), %rdi      # 0x18147
leaq 0xacc2(%rip), %rsi      # 0x180b5
movl $0x115, %edx            # imm = 0x115
movl %eax, %r8d
movq %rbx, %r9
xorl %eax, %eax
callq 0xc84f
jmp 0xd430
callq 0x2060
movl (%rax), %edi
callq 0x23b0
leaq 0xad65(%rip), %rdi      # 0x1817f
leaq 0xac94(%rip), %rsi      # 0x180b5
movl $0x119, %edx            # imm = 0x119
movq %rax, %rcx
xorl %eax, %eax
callq 0xc84f
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/boundary-stack.c
// Function: BS_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 0x22138(%rip), %rbx     # 0x2f578
testq %rbx, %rbx
je 0xd47a
movq 0x10(%rbx), %rax
movq %rax, 0x22128(%rip)     # 0x2f578
movq (%rbx), %rsi
leaq 0x22126(%rip), %rdi     # 0x2f580
movl $0x400, %edx            # imm = 0x400
callq 0xbede
movq (%rbx), %rdi
callq 0x2030
movq %rbx, %rdi
callq 0x2030
decl 0x220e6(%rip)           # 0x2f560
leaq 0x220ff(%rip), %rax     # 0x2f580
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x220a6(%rip), %eax     # 0x2f570
cmpl $0x1, %eax
setne %cl
testl %edx, %edx
setg %dl
orb %cl, %dl
jne 0xd51d
leaq 0x7eb4(%rip), %rsi      # 0x15394
movl $0x2, %edx
movq %r14, %rdi
callq 0x20a0
movl %eax, %ebx
cmpl $0x0, 0x2205a(%rip)     # 0x2f550
je 0xd5f8
leaq 0xacc4(%rip), %rdi      # 0x181c7
leaq 0xabab(%rip), %rsi      # 0x180b5
movl $0x19e, %edx            # imm = 0x19E
movl %ebx, %ecx
xorl %eax, %eax
callq 0xc84f
jmp 0xd5f8
testl %ebp, %ebp
setle %cl
testl %eax, %eax
sete %al
movl $0x1, %ebx
testb %al, %cl
jne 0xd5f8
movq %rsi, %r15
movl 0x22026(%rip), %r13d    # 0x2f564
cmpl $0x0, 0x2200b(%rip)     # 0x2f550
je 0xd56e
movl %r13d, (%rsp)
leaq 0xacb6(%rip), %rdi      # 0x18208
leaq 0xab5c(%rip), %rsi      # 0x180b5
movl $0x1a7, %edx            # imm = 0x1A7
movq %r15, %rcx
movl %ebp, %r8d
movq %r14, %r9
xorl %eax, %eax
callq 0xc84f
testl %r13d, %r13d
jle 0xd5f8
movslq %ebp, %r12
incl %r13d
leaq 0xab31(%rip), %rbp      # 0x180b5
cmpb $0x0, (%r14)
je 0xd5f8
cmpl $0x0, 0x21fbf(%rip)     # 0x2f550
je 0xd5af
leaq 0xacbf(%rip), %rdi      # 0x18259
movq %rbp, %rsi
movl $0x1b1, %edx            # imm = 0x1B1
movq %r15, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0xc84f
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x20a0
testl %eax, %eax
je 0xd5cf
incq %r14
decl %r13d
cmpl $0x2, %r13d
jae 0xd584
jmp 0xd5f8
cmpl $0x0, 0x21f7a(%rip)     # 0x2f550
je 0xd5f6
leaq 0xacab(%rip), %rdi      # 0x1828a
leaq 0xaacf(%rip), %rsi      # 0x180b5
xorl %ebx, %ebx
movl $0x1b4, %edx            # imm = 0x1B4
xorl %eax, %eax
callq 0xc84f
jmp 0xd5f8
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_O3/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, 0x22153(%rip)     # 0x2f998
je 0xd925
movq %rdi, %r14
leaq 0xa80b(%rip), %rdx      # 0x18060
xorl %ebx, %ebx
leaq 0x10(%rsp), %r15
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2140
leaq 0xab13(%rip), %rsi      # 0x18388
movl $0x5, %edx
movq %r15, %rdi
callq 0x22b0
testl %eax, %eax
jne 0xd927
movsbq 0x15(%rsp), %r15
cmpq $0x3a, %r15
je 0xd927
callq 0x23e0
movq (%rax), %rax
testb $0x20, 0x1(%rax,%r15,2)
je 0xd927
cmpb $0x0, 0x16(%rsp)
je 0xd927
leaq 0x8a0e(%rip), %rdx      # 0x162c6
movq %rsp, %rdi
leaq 0x10(%rsp), %rsi
callq 0xc093
testq %rax, %rax
je 0xd936
leaq 0x89f5(%rip), %rdx      # 0x162c6
movq %rsp, %rdi
xorl %esi, %esi
callq 0xc093
testq %rax, %rax
je 0xd936
movq %rax, %r15
cmpl $0x0, 0x22096(%rip)     # 0x2f980
jle 0xd909
leaq 0xaa9b(%rip), %rdi      # 0x1838e
leaq 0xaacf(%rip), %rsi      # 0x183c9
movl $0x110, %edx            # imm = 0x110
movq %r15, %rcx
xorl %eax, %eax
callq 0xc84f
movq %r15, %rdi
callq 0x2350
testl %eax, %eax
setne %cl
cmpl $0x30a, %eax            # imm = 0x30A
setl %al
andb %cl, %al
movzbl %al, %ebx
jmp 0xd927
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x410, %rsp            # imm = 0x410
popq %rbx
popq %r14
popq %r15
retq
cmpl $0x0, 0x22043(%rip)     # 0x2f980
jle 0xd927
leaq 0xaa8e(%rip), %rdi      # 0x183d4
leaq 0xaa7c(%rip), %rsi      # 0x183c9
xorl %ebx, %ebx
movl $0x11a, %edx            # imm = 0x11A
movq %r14, %rcx
xorl %eax, %eax
callq 0xc84f
jmp 0xd927
// File: /workspace/github_c_makefile_star2_O3/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 0x8b89(%rip), %rsi      # 0x16504
callq 0x2340
testq %rax, %rax
je 0xd9e7
movq %rax, %rbx
movl $0x14, %r13d
movq %rsp, %r14
leaq 0xaaec(%rip), %r15      # 0x18484
leaq 0xaa2a(%rip), %r12      # 0x183c9
xorl %ebp, %ebp
movq %r14, %rdi
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdx
callq 0x21f0
testq %rax, %rax
je 0xda29
cmpl $0x0, 0x21fc3(%rip)     # 0x2f980
jle 0xd9d4
movq %r15, %rdi
movq %r12, %rsi
movl $0x145, %edx            # imm = 0x145
movq %r14, %rcx
xorl %eax, %eax
callq 0xc84f
movq %r14, %rdi
callq 0xd832
testl %eax, %eax
jne 0xda24
decl %r13d
jne 0xd9a1
jmp 0xda29
callq 0x2060
movl (%rax), %edi
callq 0x23b0
leaq 0xaa3b(%rip), %rdi      # 0x18435
leaq 0xa9c8(%rip), %rsi      # 0x183c9
movl $0x13e, %edx            # imm = 0x13E
movq %r14, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xc84f
movl $0x65, 0x21f93(%rip)    # 0x2f9b0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0xda31
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_O3/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 0xe4ac
cmpl $0x1, %ebp
jne 0xe4c5
cmpb $0x2e, (%rbx)
jne 0xe4c5
movb $0x5f, (%rbx)
jmp 0xe565
cmpb $0x2e, (%rbx)
jne 0xe4c5
cmpb $0x2e, 0x1(%rbx)
jne 0xe4c5
movb $0x0, 0x2(%rbx)
movw $0x5f5f, (%rbx)         # imm = 0x5F5F
jmp 0xe565
movq %rbx, %rdi
movl $0x2f, %esi
callq 0x2150
testq %rax, %rax
jne 0xe4e9
movq %rbx, %rdi
movl $0x5c, %esi
callq 0x2150
testq %rax, %rax
je 0xe518
cmpb $0x0, 0x1(%rax)
je 0xe515
incq %rax
movq %rsp, %r14
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
movq %rax, %rsi
callq 0xbede
movslq %ebp, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbede
jmp 0xe518
movb $0x0, (%rax)
cmpl $0x0, 0x21499(%rip)     # 0x2f9b8
jle 0xe565
movb (%rbx), %bpl
testb %bpl, %bpl
je 0xe565
callq 0x23e0
incq %rbx
movq (%rax), %rcx
movsbq %bpl, %rdx
movb (%rcx,%rdx,2), %cl
shrb $0x3, %cl
cmpb $0x2e, %dl
sete %sil
orb %cl, %sil
addb $-0x7f, %dl
cmpb $-0x5f, %dl
setae %cl
testb %cl, %sil
jne 0xe55a
movb $0x5f, -0x1(%rbx)
movb (%rbx), %bpl
incq %rbx
testb %bpl, %bpl
jne 0xe531
xorl %eax, %eax
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xeb9a
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_O3/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 0xec0c
movq %rsi, %r14
movq %rdi, %r15
movl %ecx, %eax
movq %rax, (%rsp)
addq $0x2, %r15
movl $0x1, %ebp
cmpl %ebp, (%rsp)
je 0xec0c
movsbq -0x2(%r15), %r13
callq 0x23e0
movq (%rax), %rax
testb $0x40, 0x1(%rax,%r13,2)
je 0xebf7
movb %r13b, (%rbx)
incq %rbx
cmpq %r12, %r15
jae 0xec0c
leaq 0x1(%rbp), %rax
addq $0x2, %r15
cmpq %rbp, %r14
movq %rax, %rbp
jne 0xebd7
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_O3/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 0xec4a
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 0xec33
popq %rbx
popq %r14
popq %r15
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xece7
movl %ebp, %r15d
leaq 0xa45b(%rip), %r14      # 0x190d0
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 0xecdf
movq %r14, %rbx
movq $-0x20, %r14
callq 0x23e0
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 0xecc4
movl %eax, %edi
callq 0x2040
incq %r14
jne 0xeca8
movl $0xa, %edi
callq 0x2040
movq %rbx, %r14
movq (%rsp), %r15
incq %r13
cmpq %r15, %rbp
jne 0xec7e
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_O3/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 0xe895
testl %eax, %eax
jne 0xed5a
movq %rbx, %rdi
callq 0xed02
xorl %ecx, %ecx
testl %eax, %eax
movl $0x66, %eax
cmovnel %ecx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xa177(%rip), %rdi      # 0x190d6
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 0xefbb
leaq 0xa29d(%rip), %r14      # 0x1922c
xorl %r15d, %r15d
movl 0x290(%rbx,%r15,4), %edx
movq %r14, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x2130
cmpq $0x6b, %r15
ja 0xefbb
movl 0x274(%rbx), %eax
incq %r15
cmpq %rax, %r15
jb 0xef92
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_O3/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 0xeb9d
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 0xa152(%rip), %rdi      # 0x19277
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_O3/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 0xfc2e
movl $0x65, %ebp
testl %ecx, %ecx
je 0xfca8
callq 0x2060
movl (%rax), %edi
callq 0x23b0
leaq 0xa024(%rip), %rdi      # 0x19c37
leaq 0x921f(%rip), %rsi      # 0x18e39
movl $0x580, %edx            # imm = 0x580
movq %rbx, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xc84f
jmp 0xfca8
movq 0x38(%rsp), %r15
testl %ecx, %ecx
je 0xfc57
leaq 0xa03d(%rip), %rdi      # 0x19c7b
leaq 0x91f4(%rip), %rsi      # 0x18e39
movl $0x584, %edx            # imm = 0x584
movq %rbx, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0xc84f
movl $0x66, %ebp
cmpq $0x200, %r15            # imm = 0x200
jl 0xfca8
movq %r15, 0x8(%r14)
leaq 0x6894(%rip), %rsi      # 0x16504
movq %rbx, %rdi
callq 0x2340
testq %rax, %rax
je 0xfc91
movq %rax, 0x20(%r14)
movq %r15, 0x8(%r14)
movl $0xffffffff, 0x10(%r14) # imm = 0xFFFFFFFF
xorl %ebp, %ebp
jmp 0xfca8
movq $0x0, 0x20(%r14)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x0, 0x44c(%r14)
je 0xfcb8
movl %ebp, %eax
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x2060
movl (%rax), %edi
callq 0x23b0
leaq 0x9fe1(%rip), %rdi      # 0x19cac
leaq 0x9167(%rip), %rsi      # 0x18e39
movl $0x58f, %edx            # imm = 0x58F
jmp 0xfc1f
// File: /workspace/github_c_makefile_star2_O3/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 0xfd24
movl %eax, %ebx
callq 0x2060
movl (%rax), %edi
cmpl $0x11, %edi
je 0xfd24
callq 0x23b0
leaq 0x9fdb(%rip), %rdi      # 0x19ce7
leaq 0x9126(%rip), %rsi      # 0x18e39
movl $0x5b2, %edx            # imm = 0x5B2
movq %rax, %rcx
xorl %eax, %eax
callq 0xc84f
movl %ebx, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x26b4(%rip), %rdi      # 0x1240c
movq %rdx, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0xc566
testq %rax, %rax
je 0xfdf6
movq %rax, %rbx
leaq 0x31b3(%rip), %rsi      # 0x12f2b
movq %rax, %rdi
callq 0x2340
testq %rax, %rax
je 0xfe18
movq %rax, %r13
movl $0x1, %esi
movq %rbp, %rdi
movq %r12, %rdx
movq %rax, %rcx
callq 0x2390
cmpq %r12, %rax
je 0xfdc7
leaq 0x9ff2(%rip), %rdi      # 0x19d9d
leaq 0x9087(%rip), %rsi      # 0x18e39
movl $0x5fc, %edx            # imm = 0x5FC
movq %rax, %rcx
movq %r12, %r8
movq %rbx, %r9
xorl %eax, %eax
callq 0xc84f
movq %r13, %rdi
callq 0x20f0
cmpl $0x0, 0x448(%r15)
je 0xfdea
movq 0x470(%r15), %rax
testq %rax, %rax
je 0xfdea
movq %r14, %rdi
callq *%rax
movq %rbx, %rdi
callq 0x2030
xorl %eax, %eax
jmp 0xfe51
leaq 0x9f0d(%rip), %rdi      # 0x19d0a
leaq 0x9035(%rip), %rsi      # 0x18e39
movl $0x5eb, %edx            # imm = 0x5EB
movq %r13, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0xc84f
jmp 0xfe4c
callq 0x2060
movl (%rax), %edi
callq 0x23b0
leaq 0x9f34(%rip), %rdi      # 0x19d5f
leaq 0x9007(%rip), %rsi      # 0x18e39
movl $0x5f3, %edx            # imm = 0x5F3
movq %rbx, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xc84f
movq %rbx, %rdi
callq 0x2030
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_O3/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 0xfe72
callq 0x20f0
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0xfe80
callq 0x2030
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0xfe8e
callq 0x2030
movq 0x248(%rbx), %rdi
testq %rdi, %rdi
je 0xfe9f
callq 0x2030
movq 0x250(%rbx), %rdi
testq %rdi, %rdi
je 0xfeb0
callq 0x2030
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x106fa
leaq 0x9da7(%rip), %rdi      # 0x1a485
leaq 0x9de5(%rip), %rsi      # 0x1a4ca
movl $0x9b, %edx
movq %rbx, %rcx
movq %rbp, %r8
movq %r12, %r9
xorl %eax, %eax
callq 0xc84f
leaq 0x1d0b(%rip), %rdi      # 0x1240c
movq %rbp, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xc566
testq %rax, %rax
je 0x10774
movq %rax, %r15
leaq 0x280e(%rip), %rsi      # 0x12f2b
movq %rax, %rdi
callq 0x2340
testq %rax, %rax
je 0x1079b
movq %rax, %rbp
movl $0x1, %esi
movq %r13, %rdi
movq %r12, %rdx
movq %rax, %rcx
callq 0x2390
cmpq %r12, %rax
je 0x10768
leaq 0x9de8(%rip), %rdi      # 0x1a534
leaq 0x9d77(%rip), %rsi      # 0x1a4ca
movl $0xb0, %edx
movq %rax, %rcx
movq %r12, %r8
movq %r15, %r9
xorl %eax, %eax
callq 0xc84f
movq %rbp, %rdi
callq 0x20f0
xorl %ebp, %ebp
jmp 0x107cc
leaq 0x9d62(%rip), %rdi      # 0x1a4dd
leaq 0x9d48(%rip), %rsi      # 0x1a4ca
movl $0xa4, %edx
movq %rbx, %rcx
movq %rbp, %r8
xorl %eax, %eax
callq 0xc84f
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x107f8
callq 0x2060
movl (%rax), %edi
callq 0x23b0
leaq 0x9dd1(%rip), %rdi      # 0x1a57f
leaq 0x9d15(%rip), %rsi      # 0x1a4ca
movl $0xb7, %edx
movq %r15, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xc84f
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %r15, %rdi
callq 0x2030
cmpl $0x0, 0x8(%r14)
je 0x107f8
leaq 0x9de4(%rip), %rdi      # 0x1a5c6
leaq 0x9ce1(%rip), %rsi      # 0x1a4ca
movl $0xbd, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0xc84f
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_O3/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 0x1085e
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb (%rdi), %bpl
testb %bpl, %bpl
je 0x10858
callq 0x23e0
incq %rbx
movq (%rax), %rcx
movsbq %bpl, %rdx
movb (%rcx,%rdx,2), %cl
shrb $0x3, %cl
cmpb $0x2e, %dl
sete %sil
orb %cl, %sil
addb $-0x7f, %dl
cmpb $-0x5f, %dl
setae %cl
testb %cl, %sil
jne 0x1084d
movb $0x5f, -0x1(%rbx)
movb (%rbx), %bpl
incq %rbx
testb %bpl, %bpl
jne 0x10824
addq $0x8, %rsp
popq %rbx
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
subq $0x38, %rsp
movaps 0xf561(%rip), %xmm0     # 0x1fdd0
movaps %xmm0, 0x20(%rsp)
movaps 0xf545(%rip), %xmm0     # 0x1fdc0
movaps %xmm0, 0x10(%rsp)
movaps 0xf529(%rip), %xmm0     # 0x1fdb0
movaps %xmm0, (%rsp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $-0x4, %rdx
je 0x1090e
movq %rsi, %rbx
movl 0x8(%rsp), %ecx
movq %rsi, %r14
testl %ecx, %ecx
jle 0x108d1
xorl %r8d, %r8d
movq (%rsp,%r8), %rsi
movzwl (%r14), %r9d
xorw (%rsi), %r9w
movb 0x2(%r14), %r10b
xorb 0x2(%rsi), %r10b
movzbl %r10b, %esi
orw %r9w, %si
je 0x108de
cmpl $0x0, 0x18(%rsp,%r8)
leaq 0x10(%r8), %r8
jg 0x108a7
decq %rdx
incq %r14
testq %rdx, %rdx
jne 0x108a0
jmp 0x1090e
cmpl $0x0, 0x8(%rdi)
je 0x10908
movq %r14, %rcx
subq %rbx, %rcx
sarq $0x4, %r8
leaq 0x9d0e(%rip), %rdi      # 0x1a603
leaq 0x9bce(%rip), %rsi      # 0x1a4ca
movl $0x10f, %edx            # imm = 0x10F
xorl %eax, %eax
callq 0xc84f
subl %ebx, %r14d
movl %r14d, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x9d96(%rip), %rsi      # 0x1abbe
movq %r12, %rdi
callq 0x23c0
testq %rax, %rax
je 0x10e51
cmpl $0x0, 0x8(%r13)
je 0x10e8a
leaq 0x9d87(%rip), %rdi      # 0x1abca
leaq 0x9680(%rip), %rsi      # 0x1a4ca
movl $0x1dc, %edx            # imm = 0x1DC
jmp 0x10e80
leaq 0x9dad(%rip), %rsi      # 0x1ac05
movq %r12, %rdi
callq 0x23c0
movl 0x8(%r13), %ecx
testq %rax, %rax
je 0x10ea9
testl %ecx, %ecx
je 0x10e8a
leaq 0x9d56(%rip), %rdi      # 0x1abca
leaq 0x964f(%rip), %rsi      # 0x1a4ca
movl $0x1e1, %edx            # imm = 0x1E1
movq %r12, %rcx
xorl %eax, %eax
callq 0xc84f
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x10916
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movl $0x64, %ebx
testl %ecx, %ecx
je 0x10e9d
leaq 0x9d51(%rip), %rdi      # 0x1ac0a
leaq 0x960a(%rip), %rsi      # 0x1a4ca
movl $0x1e5, %edx            # imm = 0x1E5
movq %r12, %rcx
xorl %eax, %eax
callq 0xc84f
jmp 0x10e9d
// File: /workspace/github_c_makefile_star2_O3/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
movq (%rdi), %rax
testq %rax, %rax
je 0x10f46
xorl %r15d, %r15d
xorl %r14d, %r14d
movl (%rax), %ecx
cmpl %ebp, %ecx
jge 0x10f27
movl $0x1, %r14d
movl $0x10, %ecx
jmp 0x10f34
jle 0x10f3d
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl $0x8, %ecx
movq %rax, %r15
movq (%rax,%rcx), %rax
jmp 0x10f3f
je 0x10f84
testq %rax, %rax
jne 0x10f14
jmp 0x10f4c
xorl %r14d, %r14d
xorl %r15d, %r15d
movl $0x18, %edi
callq 0x22a0
testq %rax, %rax
je 0x10f7d
movl %ebp, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
testq %r15, %r15
je 0x10f92
cmpl $-0x1, %r14d
je 0x10f8b
xorl %ecx, %ecx
cmpl $0x1, %r14d
jne 0x10f97
addq $0x10, %r15
jmp 0x10f8f
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
jmp 0x10f97
movl $0x1, %ecx
jmp 0x10f97
addq $0x8, %r15
movq %r15, %rbx
movq %rax, (%rbx)
xorl %ecx, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xf017(%rip), %r15      # 0x1ffd0
leaq 0x9ca5(%rip), %rbx      # 0x1ac65
cmpq $0x0, 0x8(%r12)
je 0x10fd8
leaq 0x8(%r12), %rdi
callq 0x10fa4
cmpq $0x0, (%r14)
je 0x10fe9
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 0x10fc0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/ripOLE/bt-int.c
// Function: BTI_done
int BTI_done( struct bti_node **n )
{
	struct bti_node *node;

	if (n == NULL) return 0;
	if (*n == NULL) return 0;

	node = *n;
	
	if (node->l) BTI_done(&(node->l)); 
	if (node->r) BTI_done(&(node->r));
	if (*n) { free(*n); *n = NULL; }

	return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x1105d
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r14
testq %r14, %r14
je 0x11056
cmpq $0x0, 0x8(%r14)
je 0x1102f
leaq 0x8(%r14), %rdi
callq 0x1100b
cmpq $0x0, 0x10(%r14)
je 0x11042
addq $0x10, %r14
movq %r14, %rdi
callq 0x1100b
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x11056
callq 0x2030
movq $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/antonblanchard[P]will-it-scale/tests/writeseek3.c
// Function: testcase_prepare
void testcase_prepare(unsigned long nr_tasks)
{
	char buf[BUFLEN];
	int fd = mkstemp(tmpfile);
	unsigned long left = getpagesize() * nr_tasks;

	memset(buf, 0, sizeof(buf));
	assert(fd >= 0);

	while (left > 0) {
		int n = write(fd, buf, sizeof(buf));
		assert(n > 0);
		left -= n;
	}
	close(fd);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq %rdi, %r14
leaq 0x24e6(%rip), %rdi      # 0x5190
callq 0x21e0
movl %eax, %ebx
movq %rsp, %rdi
movl $0x1000, %edx           # imm = 0x1000
xorl %esi, %esi
callq 0x2140
testl %ebx, %ebx
js 0x2d27
callq 0x2290
movslq %eax, %r15
imulq %r14, %r15
testq %r15, %r15
je 0x2cf5
movq %rsp, %r14
movl $0x1000, %edx           # imm = 0x1000
movl %ebx, %edi
movq %r14, %rsi
callq 0x20d0
testl %eax, %eax
jle 0x2d08
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subq %rax, %r15
jne 0x2cd8
movl %ebx, %edi
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r14
popq %r15
jmp 0x2150
leaq 0x603(%rip), %rdi       # 0x3312
leaq 0x5c4(%rip), %rsi       # 0x32da
leaq 0x5d0(%rip), %rcx       # 0x32ed
movl $0x18, %edx
callq 0x2130
leaq 0x5a4(%rip), %rdi       # 0x32d2
leaq 0x5a5(%rip), %rsi       # 0x32da
leaq 0x5b1(%rip), %rcx       # 0x32ed
movl $0x14, %edx
callq 0x2130
// File: /workspace/github_c_makefile_star2_O3/antonblanchard[P]will-it-scale/tests/writeseek3.c
// Function: testcase
void testcase(unsigned long long *iterations, unsigned long nr)
{
	char buf[BUFLEN];
	int fd = open(tmpfile, O_RDWR);
	unsigned long offset = getpagesize() * nr;

	assert(fd >= 0);

	while (1) {
		lseek(fd, offset, SEEK_SET);
		assert(write(fd, buf, BUFLEN) == BUFLEN);

		(*iterations)++;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x2430(%rip), %rdi      # 0x5190
movl $0x2, %esi
xorl %eax, %eax
callq 0x2220
movl %eax, %ebp
callq 0x2290
testl %ebp, %ebp
js 0x2de9
movslq %eax, %r14
imulq %r15, %r14
movl %ebp, %edi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2120
movq %rsp, %rsi
movl $0x1000, %edx           # imm = 0x1000
movl %ebp, %edi
callq 0x20d0
cmpq $0x1000, %rax           # imm = 0x1000
jne 0x2dca
movq %rsp, %r15
incq (%rbx)
movl %ebp, %edi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2120
movl $0x1000, %edx           # imm = 0x1000
movl %ebp, %edi
movq %r15, %rsi
callq 0x20d0
cmpq $0x1000, %rax           # imm = 0x1000
je 0x2da4
leaq 0x57a(%rip), %rdi       # 0x334b
leaq 0x502(%rip), %rsi       # 0x32da
leaq 0x539(%rip), %rcx       # 0x3318
movl $0x28, %edx
callq 0x2130
leaq 0x4e2(%rip), %rdi       # 0x32d2
leaq 0x4e3(%rip), %rsi       # 0x32da
leaq 0x51a(%rip), %rcx       # 0x3318
movl $0x24, %edx
callq 0x2130
// File: /workspace/github_c_makefile_star2_O3/stefpant[P]TCPserver/PantoulasStefanosProject2/trie/input_parse.c
// Function: read_doc
int read_doc(char *name,char ***map,int *lines){
	char c,pr_c;
	FILE* fp;
	*lines = 0;
	int counter = 0;//byte counter here
	if((fp=fopen(name,"r"))==NULL){
		printf("Given file doesn't exists!\n");
		return -1;
	}
	if(fp == NULL ){fclose(fp); return -1;}//error
	while((c=getc(fp)) != EOF){//1st parsing to find the lines
		if(c == '\n' && pr_c != '\n') (*lines)++;
		pr_c = c;
	}
	if(!(*lines)){printf("Empty input file!\n");fclose(fp);return -2;}
	//printf("Read %d folders!\n",*lines);
	*map = malloc((*lines)*sizeof(char*));
	if(fseek(fp,0L,SEEK_SET) !=0) {fclose(fp); return -2;}
	for(int i=0;i<(*lines);i++){
		fscanf(fp,"%m[^\n]s",&(*map)[i]);//read and save line
		getc(fp);//skip the remaining '\n'
		counter += strlen((*map)[i]) + 1;//the '+1' for '\n'
	}
	fclose(fp);
	return counter;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r15
movq %rsi, %r13
movl $0x0, (%rdx)
leaq 0x4d2e(%rip), %rsi      # 0x71ee
callq 0x2280
testq %rax, %rax
je 0x25bc
movq %rax, %rbx
movq %rax, %rdi
callq 0x2320
movl %eax, %ecx
shll $0x18, %ecx
cmpl $0xff000000, %ecx       # imm = 0xFF000000
je 0x2518
xorl %r14d, %r14d
cmpl $0xa000000, %ecx        # imm = 0xA000000
setne %cl
cmpb $0xa, %r14b
movl %eax, %r14d
sete %al
orb %cl, %al
jne 0x2503
incl (%r15)
movq %rbx, %rdi
callq 0x2320
movl %eax, %ecx
shll $0x18, %ecx
cmpl $0xff000000, %ecx       # imm = 0xFF000000
jne 0x24e9
movslq (%r15), %rdi
testq %rdi, %rdi
je 0x25d0
shlq $0x3, %rdi
callq 0x2210
movq %rax, (%r13)
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2220
testl %eax, %eax
jne 0x25dc
cmpl $0x0, (%r15)
movq %r13, -0x30(%rbp)
jle 0x25b2
movq %r15, %rcx
movq -0x30(%rbp), %rax
movq (%rax), %r13
xorl %r15d, %r15d
xorl %r14d, %r14d
xorl %r12d, %r12d
movq %rcx, -0x38(%rbp)
addq %r15, %r13
movq %rbx, %rdi
leaq 0x4a8e(%rip), %rsi      # 0x7004
movq %r13, %rdx
xorl %eax, %eax
callq 0x2090
movq %rbx, %rdi
callq 0x2320
movq -0x30(%rbp), %rax
movq (%rax), %r13
movq (%r13,%r15), %rdi
callq 0x2120
movq -0x38(%rbp), %rcx
addl %eax, %r12d
incl %r12d
incq %r14
movslq (%rcx), %rax
addq $0x8, %r15
cmpq %rax, %r14
jl 0x2569
movq %rbx, %rdi
callq 0x2100
jmp 0x25ea
leaq 0x4a63(%rip), %rdi      # 0x7026
callq 0x20a0
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
jmp 0x25ea
leaq 0x4a3d(%rip), %rdi      # 0x7014
callq 0x20a0
movq %rbx, %rdi
callq 0x2100
movl $0xfffffffe, %r12d      # imm = 0xFFFFFFFE
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/stefpant[P]TCPserver/PantoulasStefanosProject2/trie/postingList.c
// Function: postingList1Destruct
void postingList1Destruct(postingList1* self){//recursive destruction
	if(self==NULL) return;
	postingList2Destruct(self->pl);
	postingList1Destruct(self->next);
	self->name = NULL;
	self->last = NULL;
	free(self);
	return;
}

// Assembly:
testq %rdi, %rdi
je 0x2905
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
callq 0x2906
movq 0x18(%rbx), %rdi
callq 0x28d7
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2030
retq