LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/crossassemblers/macro1/macro1.c
// Function: nextfiodec
int
nextfiodec(int *ccase, int delim)
{
    unsigned char c;

    for (;;) {
	if (cc >= maxcc) {
	    if (delim == -1)
		return -1;

	    /* XXX MUST NOT BE IN A REPEAT!! */
	    readLine();			/* danger will robinson! */
	    if (end_of_input)
		return -1;
	}
	c = line[cc];
	switch (c) {
	case '\n':
	    c = '\r';
	    break;
	case '\r':
	    continue;
	}
	break;
    }

    if (delim != -1 && c == delim) {
	if (*ccase == LC) {
	    cc++;			/* eat delim */
	    return -1;
	}
	*ccase = LC;
	return CONCISE_LC;		/* shift down first */
    }

    if (c > 0177) {			/* non-ascii */
	errorMessage( &illegal_character, cc );
	c = 0;				/* space?! */
    }

    c = ascii_to_fiodec[c&0177];
    if (c == BAD) {
	errorMessage( &illegal_character, cc );
	c = 0;				/* space?! */
    }

    if (!(c & *ccase)) {		/* char not in current case? */
	*ccase ^= BC;			/* switch case */
	if (*ccase == LC)
	    return CONCISE_LC;		/* shift down */
	else
	    return CONCISE_UC;		/* shift up */
    }
    cc++;
    return c & CHARBITS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
movl 0x79d9(%rip), %esi      # 0xc0b8
movl 0x7a4f(%rip), %ecx      # 0xc134
leaq 0x7964(%rip), %r15      # 0xc050
pushq $-0x1
popq %rbp
cmpl %ecx, %esi
jl 0x471b
cmpl $-0x1, %r14d
je 0x47bd
callq 0x4379
cmpb $0x0, 0x7a27(%rip)      # 0xc130
jne 0x47bd
movl 0x7a1f(%rip), %ecx      # 0xc134
movl 0x799d(%rip), %esi      # 0xc0b8
movslq %esi, %rax
movzbl (%rax,%r15), %eax
cmpl $0xd, %eax
je 0x46ef
cmpl $0xa, %eax
jne 0x4737
movb $0xd, %al
cmpl $0xd, %r14d
je 0x473c
jmp 0x4760
cmpl %r14d, %eax
jne 0x474e
cmpl $0x80, (%rbx)
jne 0x4799
incl %esi
movl %esi, 0x796c(%rip)      # 0xc0b8
jmp 0x47bd
testb %al, %al
jns 0x4760
leaq 0x5337(%rip), %rdi      # 0x9a90
callq 0x45ba
xorl %eax, %eax
movzbl %al, %eax
leaq 0x54f6(%rip), %rcx      # 0x9c60
movb (%rax,%rcx), %al
cmpb $0xc, %al
jne 0x4785
movl 0x7941(%rip), %esi      # 0xc0b8
leaq 0x5312(%rip), %rdi      # 0x9a90
callq 0x45ba
xorl %eax, %eax
movzbl %al, %ebp
movl (%rbx), %eax
testl %ebp, %eax
je 0x47a4
incl 0x7924(%rip)            # 0xc0b8
andl $0x3f, %ebp
jmp 0x47bd
movl $0x80, (%rbx)
pushq $0x3a
popq %rbp
jmp 0x47bd
movl %eax, %ecx
xorl $0xc0, %ecx
movl %ecx, (%rbx)
xorl %ecx, %ecx
cmpl $0x40, %eax
setne %cl
leal 0x3a(,%rcx,2), %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/crossassemblers/macro1/macro1.c
// Function: flex
WORD32 flex()
{
    WORD32 w;
    int shift;
    int ccase;

    if (line[lexstart] == ' ')		/* always? */
	next(0);

    /* original version appears to take next 3 characters,
     * REGARDLESS of what they are (tab, newline, space?)!
     */
    w = 0;
    ccase = LC;				/* current case */
    for (shift = 12; shift >= 0; shift -= 6) {
	unsigned char c;
	if( lexstart >= maxcc )
	    break;

	c = line[lexstart];
	if (c == '\t' || c == '\n') {
	    if (ccase == LC)
		break;
	    c = CONCISE_LC;			/* shift down first */
	}
	else {
	    if (c > 0177) {		/* non-ascii */
		errorMessage( &illegal_character, lexstart );
		c = 0;
	    }

	    c = ascii_to_fiodec[c&0177];
	    if (c == BAD) {
		errorMessage( &illegal_character, lexstart );
		c = 0;
	    }

	    if (!(c & ccase)) {		/* char not in current case? */
		ccase ^= BC;		/* switch case */
		if (ccase == LC)
		    c = CONCISE_LC;	/* shift down */
		else
		    c = CONCISE_UC;	/* shift up */
	    }
	    else
		lexstart++;
	}
	w |= (c & CHARBITS) << shift;
    }
    /* error to get here w/ case == UC? nah. shift down could be next */
    return w;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movslq 0x78d4(%rip), %rax      # 0xc0b0
leaq 0x786d(%rip), %r15      # 0xc050
cmpb $0x20, (%rax,%r15)
jne 0x47f1
xorl %edi, %edi
callq 0x3575
movl $0x80, %r12d
pushq $0xc
popq %rbp
xorl %ebx, %ebx
pushq $0x3a
popq %r13
leaq 0x5459(%rip), %r14      # 0x9c60
testl %ebp, %ebp
js 0x48a7
movslq 0x789a(%rip), %rsi      # 0xc0b0
cmpl 0x7918(%rip), %esi      # 0xc134
jge 0x48a7
movb (%rsi,%r15), %al
leal -0x9(%rax), %ecx
cmpb $0x1, %cl
ja 0x483c
movl %r13d, %eax
cmpl $0x80, %r12d
jne 0x4899
jmp 0x48a7
testb %al, %al
jns 0x484e
leaq 0x5249(%rip), %rdi      # 0x9a90
callq 0x45ba
xorl %eax, %eax
movzbl %al, %eax
movb (%rax,%r14), %al
cmpb $0xc, %al
jne 0x486d
movl 0x7851(%rip), %esi      # 0xc0b0
leaq 0x522a(%rip), %rdi      # 0x9a90
callq 0x45ba
xorl %eax, %eax
movzbl %al, %ecx
testl %ecx, %r12d
je 0x4882
incl 0x7835(%rip)            # 0xc0b0
andb $0x3f, %al
movzbl %al, %eax
jmp 0x4899
xorl %eax, %eax
cmpl $0x40, %r12d
setne %al
xorl $0xc0, %r12d
leal 0x3a(,%rax,2), %eax
movl %ebp, %ecx
shll %cl, %eax
orl %eax, %ebx
addl $-0x6, %ebp
jmp 0x4807
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/crossassemblers/macro1/macro1.c
// Function: getChar
WORD32 getChar()
{
    unsigned char c, pos;

    if( cc >= maxcc )
	return 0;			/* XXX error? */
    pos = line[cc++];
    if (pos != 'l' && pos != 'm' && pos != 'r') {
	errorMessage( &illegal_character, lexstart );
	return 0;
    }

    if( cc >= maxcc )
	return 0;			/* XXX error? */

    c = line[cc++];
    if (c > 0177) {
	errorMessage( &illegal_character, lexstart );
	c = 0;
    }

    c = ascii_to_fiodec[c];
    if (c == BAD) {
	errorMessage( &illegal_character, lexstart );
	c = 0;
    }

    if (!(c & LC)) {			/* upper case only char? */
	c = CONCISE_UC;			/* take a shift up */
	cc--;				/* and leave char for next luser */
    }

    c &= CHARBITS;
    switch (pos) {
    case 'l': return c << 12;
    case 'm': return c << 6;
    case 'r': return c;
    }
    /* should not happen */
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movslq 0x77f5(%rip), %rax      # 0xc0b8
movl 0x786b(%rip), %edx      # 0xc134
xorl %ebx, %ebx
cmpl %edx, %eax
jge 0x4996
movq %rax, %rcx
incq %rcx
movl %ecx, 0x77d9(%rip)      # 0xc0b8
leaq 0x776a(%rip), %rsi      # 0xc050
movzbl (%rax,%rsi), %r14d
leal -0x6c(%r14), %edi
cmpl $0x6, %edi
ja 0x494f
pushq $0x43
popq %r8
btl %edi, %r8d
jae 0x494f
cmpl %edx, %ecx
jge 0x4996
addl $0x2, %eax
movl %eax, 0x77a9(%rip)      # 0xc0b8
movb (%rcx,%rsi), %al
testb %al, %al
jns 0x492a
movl 0x7794(%rip), %esi      # 0xc0b0
leaq 0x516d(%rip), %rdi      # 0x9a90
callq 0x45ba
xorl %eax, %eax
movzbl %al, %eax
leaq 0x532c(%rip), %rcx      # 0x9c60
movb (%rax,%rcx), %al
cmpb $0xc, %al
jne 0x4963
movl 0x776f(%rip), %esi      # 0xc0b0
leaq 0x5148(%rip), %rdi      # 0x9a90
callq 0x45ba
jmp 0x4967
movl 0x775b(%rip), %esi      # 0xc0b0
leaq 0x5134(%rip), %rdi      # 0x9a90
callq 0x45ba
jmp 0x4996
testb %al, %al
js 0x496f
decl 0x774b(%rip)            # 0xc0b8
movb $0x3c, %al
andb $0x3f, %al
cmpl $0x72, %r14d
je 0x4993
cmpl $0x6d, %r14d
je 0x498b
cmpl $0x6c, %r14d
jne 0x4996
movzbl %al, %ebx
shll $0xc, %ebx
jmp 0x4996
movzbl %al, %ebx
shll $0x6, %ebx
jmp 0x4996
movzbl %al, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/crossassemblers/macro1/macro1.c
// Function: literal
WORD32
literal( WORD32 value )
{
    int i;

    if (nconst >= MAX_CONSTANTS) {
	fprintf(stderr, "too many 'constants'; increase MAX_CONSTANTS\n");
	exit(1);
    }

    if (pass == 1) {
	if (++lit_count[nconst] == MAX_LITERALS) {
	    fprintf(stderr, "too many literals; increase MAX_LITERALS\n");
	    exit(1);
	}
	return lit_count[nconst];
    }

#if 1
    /*
     * pool constants; makes for a shorter tape
     * (but "middle" constants blocks can't shrink)
     */
    for (i = 0; i < nlit; i++)
	if (litter[i] == value)
	    return lit_loc[nconst] + i;
#endif

    /* paranoia */
    if (nlit == MAX_LITERALS) {
	fprintf(stderr, "too many literals; increase MAX_LITERALS\n");
	exit(1);
    }

    /* not found, save it */
    litter[nlit] = value;

    /* use base for this block, determined on pass1 */
    return lit_loc[nconst] + nlit++;
}

// Assembly:
pushq %rax
movslq 0x74f8(%rip), %rcx      # 0xc14c
cmpq $0xa, %rcx
jge 0x4ce6
cmpl $0x1, 0x511b(%rip)      # 0x9d80
jne 0x4c7f
leaq 0x7752(%rip), %rdx      # 0xc3c0
movl (%rdx,%rcx,4), %eax
incl %eax
movl %eax, (%rdx,%rcx,4)
cmpl $0x3e8, %eax            # imm = 0x3E8
jne 0x4ce4
jmp 0x4cfb
movslq 0x522a(%rip), %rdx      # 0x9eb0
xorl %esi, %esi
testl %edx, %edx
movl $0x0, %eax
cmovgl %edx, %eax
negq %rax
leaq 0x7754(%rip), %r8       # 0xc3f0
cmpq %rsi, %rax
je 0x4caf
cmpl %edi, (%r8)
je 0x4cd8
decq %rsi
addq $0x4, %r8
jmp 0x4c9c
cmpl $0x3e8, %edx            # imm = 0x3E8
je 0x4cfb
leaq 0x7732(%rip), %rax      # 0xc3f0
movl %edi, (%rax,%rdx,4)
leaq 0x86c8(%rip), %rax      # 0xd390
leal 0x1(%rdx), %esi
movl %esi, 0x51df(%rip)      # 0x9eb0
movl (%rax,%rcx,4), %eax
addl %edx, %eax
jmp 0x4ce4
leaq 0x86b1(%rip), %rax      # 0xd390
movl (%rax,%rcx,4), %eax
subl %esi, %eax
popq %rcx
retq
movq 0x430b(%rip), %rax      # 0x8ff8
movq (%rax), %rcx
leaq 0x1aa0(%rip), %rdi      # 0x6797
pushq $0x2d
jmp 0x4d0e
movq 0x42f6(%rip), %rax      # 0x8ff8
movq (%rax), %rcx
leaq 0x1ab9(%rip), %rdi      # 0x67c5
pushq $0x29
popq %rsi
pushq $0x1
popq %rdx
callq 0x2180
pushq $0x1
popq %rdi
callq 0x2170
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/crossassemblers/macro1/macro1.c
// Function: punchLocObject
void punchLocObject( WORD32 loc, WORD32 val )
{
    if (!rim_mode) {
	if ((loc & LOADERBUFMASK) == 0 || /* full/force alignment */
	    loaderbufcount > 0 &&
	    loc != loaderbufstart + loaderbufcount) /* disjoint */
	    flushLoader();
	if (loaderbufcount == 0)
	    loaderbufstart = loc;
	loaderbuf[loaderbufcount++] = val;
    }
    else
	punchLocObjectRIM( loc, val );
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %ebp
cmpb $0x0, 0x4dc6(%rip)      # 0x9d62
je 0x4fad
movl %ebp, %edi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x4ffc
testb $0x3f, %bpl
je 0x4fc9
movl 0x72f7(%rip), %eax      # 0xc2b0
testl %eax, %eax
jle 0x4fd4
movl 0x72f1(%rip), %ecx      # 0xc2b4
addl %eax, %ecx
cmpl %ebp, %ecx
je 0x4fe0
callq 0x5012
movl 0x72dc(%rip), %eax      # 0xc2b0
testl %eax, %eax
jne 0x4fe0
movl %ebp, 0x72d6(%rip)      # 0xc2b4
xorl %eax, %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x72c7(%rip)      # 0xc2b0
cltq
leaq 0x72ce(%rip), %rcx      # 0xc2c0
movl %ebx, (%rcx,%rax,4)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/crossassemblers/macro1/macro1.c
// Function: flushLoader
void
flushLoader() {
    WORD32 sum;
    int i;

    if (loaderbufcount == 0)
	return;

    sum = 0;
    PW( DIO | loaderbufstart );
    PW( DIO | loaderbufstart + loaderbufcount );
    for (i = 0; i < loaderbufcount; i++)
	PW( loaderbuf[i] );

    /* roll over all the overflows at once */
    if (sum & ~0777777)
	sum = (sum & 0777777) + (sum >> 18);
    if (sum & 01000000)			/* one more time */
	sum++;
    PW( sum );

    punchLeader(5);
    loaderbufcount = 0;
}

// Assembly:
cmpl $0x0, 0x7297(%rip)      # 0xc2b0
je 0x50b4
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl $0x1a000, %ebp          # imm = 0x1A000
movl 0x7283(%rip), %ebx      # 0xc2b4
orl %ebp, %ebx
movl %ebx, %edi
callq 0x4f56
movl 0x7270(%rip), %edi      # 0xc2b0
addl 0x726e(%rip), %edi      # 0xc2b4
orl %ebp, %edi
addl %edi, %ebx
callq 0x4f56
leaq 0x726a(%rip), %r14      # 0xc2c0
xorl %r15d, %r15d
movslq 0x7250(%rip), %rax      # 0xc2b0
cmpq %rax, %r15
jge 0x5078
movl (%r14), %edi
addl %edi, %ebx
callq 0x4f56
incq %r15
addq $0x4, %r14
jmp 0x5059
movl %ebx, %eax
andl $0x3ffff, %eax          # imm = 0x3FFFF
movl %ebx, %edi
sarl $0x12, %edi
addl %eax, %edi
cmpl $0x40000, %ebx          # imm = 0x40000
cmovbl %ebx, %edi
btl $0x12, %edi
adcl $0x0, %edi
callq 0x4f56
pushq $0x5
popq %rdi
callq 0x2b78
andl $0x0, 0x7206(%rip)      # 0xc2b0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/crossassemblers/macro1/macro1.c
// Function: isLexSymbol
BOOL isLexSymbol()
{
    int ix;

    /* XXX alpha within first 4? 3?? */
    for( ix = lexstart; ix < lexterm; ix++ )
	if(isalpha(line[ix]))
	    return TRUE;			/* any position will do! */
    return FALSE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movslq 0x6fe2(%rip), %rbx      # 0xc0b0
movslq 0x7067(%rip), %r14      # 0xc13c
leaq 0x6f74(%rip), %r15      # 0xc050
cmpq %r14, %rbx
jge 0x50fc
callq 0x21b0
movq (%rax), %rax
movsbq (%rbx,%r15), %rcx
incq %rbx
testb $0x4, 0x1(%rax,%rcx,2)
je 0x50dc
movb $0x1, %al
jmp 0x50fe
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/crossassemblers/macro1/macro1.c
// Function: variables
void
variables() {
    /* XXX error if "variables" already seen (in this pass) */
    /* XXX error if different address on pass 2 */
    if (pass == 2)
	printLine( line, clc, 0, LINE_LOC );
    vars_addr = clc;
    vars_end = clc = (clc + nvars) & ADDRESS_FIELD;
    if (pass == 2)
	printLine( line, clc, 0, LINE_LOC);
}

// Assembly:
cmpl $0x2, 0x492e(%rip)      # 0x9d80
jne 0x547c
pushq %rax
movl 0x6c59(%rip), %esi      # 0xc0b4
leaq 0x6bee(%rip), %rdi      # 0xc050
pushq $0x4
popq %rcx
xorl %edx, %edx
callq 0x3ae0
cmpl $0x2, 0x490d(%rip)      # 0x9d80
sete %al
addq $0x8, %rsp
jmp 0x547e
xorl %eax, %eax
movl 0x6c30(%rip), %esi      # 0xc0b4
movl %esi, 0x7f32(%rip)      # 0xd3bc
addl 0x6cc0(%rip), %esi      # 0xc150
andl $0xfff, %esi            # imm = 0xFFF
movl %esi, 0x6c18(%rip)      # 0xc0b4
movl %esi, 0x7f26(%rip)      # 0xd3c8
testb %al, %al
je 0x54b7
leaq 0x6ba3(%rip), %rdi      # 0xc050
pushq $0x4
popq %rcx
xorl %edx, %edx
jmp 0x3ae0
retq
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/crossassemblers/macro1/macro1.c
// Function: text
void
text(void)
{
    char delim;
    WORD32 w;
    int count;
    int ccase;
    /* XXX error in repeat!! */
    do {
	if (cc == maxcc) {
	    /* XXX EOL before delim found!!! */
	    fprintf(stderr, "FIX ME!\n");
	    return;
	}
	delim = line[cc++];
    } while (delim == ' ');		/* others? NL */

    w = count = 0;
    ccase = LC;
    for (;;) {
	int c = nextfiodec(&ccase, delim);
	if (c == -1)
	    break;
	w |= c << ((2-count)*6);
	if (++count == 3) {
	    punchOutObject(clc, w);	/* punch it! */
	    incrementClc();
	    count = w = 0;
	}
    }
    if (count > 0) {
	punchOutObject(clc, w);		/* punch remainder */
	incrementClc();
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movslq 0x6c6e(%rip), %rax      # 0xc134
movslq 0x6beb(%rip), %rcx      # 0xc0b8
leal 0x1(%rcx), %edx
leaq 0x6b79(%rip), %rsi      # 0xc050
cmpq %rcx, %rax
je 0x557e
movl %edx, 0x6bd2(%rip)      # 0xc0b8
movsbl (%rcx,%rsi), %ebx
incq %rcx
incl %edx
cmpl $0x20, %ebx
je 0x54d7
leaq 0x4(%rsp), %r14
movl $0x80, (%r14)
xorl %r15d, %r15d
xorl %ebp, %ebp
movq %r14, %rdi
movl %ebx, %esi
callq 0x46cc
cmpl $-0x1, %eax
je 0x554e
movb $0x2, %cl
subb %r15b, %cl
movzbl %cl, %ecx
imull $0x6, %ecx, %ecx
shll %cl, %eax
orl %eax, %ebp
incl %r15d
cmpl $0x3, %r15d
jne 0x5505
movl 0x6b82(%rip), %edi      # 0xc0b4
movl %ebp, %esi
callq 0x433c
movl 0x6b75(%rip), %eax      # 0xc0b4
incl %eax
andl $0xfff, %eax            # imm = 0xFFF
movl %eax, 0x6b68(%rip)      # 0xc0b4
jmp 0x5500
testl %r15d, %r15d
jle 0x5573
movl 0x6b5b(%rip), %edi      # 0xc0b4
movl %ebp, %esi
callq 0x433c
movl 0x6b4e(%rip), %eax      # 0xc0b4
incl %eax
andl $0xfff, %eax            # imm = 0xFFF
movl %eax, 0x6b41(%rip)      # 0xc0b4
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x3a73(%rip), %rax      # 0x8ff8
movq (%rax), %rcx
leaq 0x1332(%rip), %rdi      # 0x68c1
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2180
// File: /workspace/github_c_makefile_star2_O2/zhou-yuxin[P]redis-aof-no-cow/deps/jemalloc/src/prof.c
// Function: prof_tdata_should_destroy
static bool
prof_tdata_should_destroy_unlocked(prof_tdata_t *tdata, bool even_if_attached)
{

	if (tdata->attached && !even_if_attached)
		return (false);
	if (ckh_count(&tdata->bt2tctx) != 0)
		return (false);
	return (true);
}

// Assembly:
movb 0x20(%rdi), %al
xorb $0x1, %al
orb %sil, %al
cmpb $0x1, %al
jne 0xa6a78
pushq %rax
addq $0x40, %rdi
callq 0xae8d3
testq %rax, %rax
sete %al
addq $0x8, %rsp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/OstCollector[P]config2c/config2c.c
// Function: make_message
const char *make_message(const char *fmt, ...)
{
	int size = 0;
	char *p = NULL;
	va_list ap;

	/* Determine required size */

	va_start(ap, fmt);
	size = vsnprintf(p, size, fmt, ap);
	va_end(ap);

	if (size < 0)
		return NULL;

	size++;		    /* For '\0' */
	p = malloc(size);
	if (p == NULL)
		return NULL;

	va_start(ap, fmt);
	size = vsnprintf(p, size, fmt, ap);
	if (size < 0) {
		free(p);
		return NULL;
	}
	va_end(ap);

	return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %rbx
leaq -0xf0(%rbp), %r12
movq %rsi, 0x8(%r12)
movq %rdx, 0x10(%r12)
movq %rcx, 0x18(%r12)
movq %r8, 0x20(%r12)
movq %r9, 0x28(%r12)
testb %al, %al
je 0x2323
movaps %xmm0, -0xc0(%rbp)
movaps %xmm1, -0xb0(%rbp)
movaps %xmm2, -0xa0(%rbp)
movaps %xmm3, -0x90(%rbp)
movaps %xmm4, -0x80(%rbp)
movaps %xmm5, -0x70(%rbp)
movaps %xmm6, -0x60(%rbp)
movaps %xmm7, -0x50(%rbp)
leaq -0x40(%rbp), %rcx
movq %r12, 0x10(%rcx)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000008, %r13     # imm = 0x3000000008
movq %r13, (%rcx)
xorl %r14d, %r14d
xorl %edi, %edi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x2080
testl %eax, %eax
js 0x2399
movl %eax, %r15d
incl %r15d
movq %r15, %rdi
callq 0x2150
testq %rax, %rax
je 0x2396
movq %rax, %r14
leaq -0x40(%rbp), %rcx
movq %r12, 0x10(%rcx)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%rcx)
movq %r13, (%rcx)
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x2080
testl %eax, %eax
jns 0x2399
movq %r14, %rdi
callq 0x2030
xorl %r14d, %r14d
movq %r14, %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/OstCollector[P]config2c/config2c.c
// Function: copy_file
void copy_file(FILE *dst, FILE *src)
{
	int c;
	while (1) {
		c = fgetc(src);
		if (c == EOF) {
			break;
		}
		if (putc(c, dst) == EOF) {
			ERR("failed to write to file.\n");
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rbx, %rdi
callq 0x20d0
cmpl $-0x1, %eax
je 0x271f
movl %eax, %edi
movq %r14, %rsi
callq 0x20f0
cmpl $-0x1, %eax
jne 0x26d0
movq 0xe8fd(%rip), %rbx      # 0x10ff0
movq (%rbx), %rcx
leaq 0x91d8(%rip), %rdi      # 0xb8d5
pushq $0x19
popq %rsi
pushq $0x1
popq %rdx
callq 0x2190
movq (%rbx), %rsi
movq 0xeb1e(%rip), %rdi      # 0x11230
callq 0x20c0
pushq $0x1
popq %rdi
callq 0x2180
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/OstCollector[P]config2c/config2c.c
// Function: make_test_default
void make_test_default()
{
	const struct node_type_def_list *list;
	const struct node_member_list *memb;
	long id, im;

	out_src("%s", test_main_prelude);

	for (list = ast, id = 0; list; list = list->next, ++id) {
		if (list->type != NODE_TYPE_DEF_STRUCT) {
			continue;
		}
		for (memb = list->struct_def.members, im = 0; memb; 
				memb = memb->next, ++im) {
			if (!memb->default_val) {
				continue;
			}
			make_test_default_memb(list, id, memb, im);
		}
	}

	osi(0, "int main()\n");
	osi(0, "{\n");
	for (list = ast, id = 0; list; list = list->next, ++id) {
		if (list->type != NODE_TYPE_DEF_STRUCT) {
			continue;
		}
		for (memb = list->struct_def.members, im = 0; memb; 
				memb = memb->next, ++im) {
			if (!memb->default_val) {
				continue;
			}
			osi(1, "test_default_%ld_%ld();\n", id, im);
		}
	}
	osi(1, "return 0;\n");
	osi(0, "}\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0xcca1(%rip), %rdi      # 0x112a0
movq 0xcc32(%rip), %rdx      # 0x11238
leaq 0xa148(%rip), %rsi      # 0xe755
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
js 0x4761
leaq 0xcc85(%rip), %rbx      # 0x112a8
xorl %r14d, %r14d
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x4665
cmpl $0x1, 0x8(%rbx)
jne 0x4660
leaq 0x18(%rbx), %r15
xorl %r12d, %r12d
movq (%r15), %r15
testq %r15, %r15
je 0x4660
cmpq $0x0, 0x38(%r15)
je 0x465b
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x2724
incq %r12
jmp 0x463b
incq %r14
jmp 0x4626
xorl %edi, %edi
callq 0x4593
movq 0xcc2d(%rip), %rdi      # 0x112a0
leaq 0x77ca(%rip), %rsi      # 0xbe44
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
js 0x4761
xorl %edi, %edi
callq 0x4593
movq 0xcc09(%rip), %rdi      # 0x112a0
leaq 0x90fb(%rip), %rsi      # 0xd799
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
js 0x4761
leaq 0xcbf4(%rip), %r13      # 0x112a8
leaq 0x7795(%rip), %r14      # 0xbe50
xorl %r15d, %r15d
movq (%r13), %r13
testq %r13, %r13
je 0x4711
cmpl $0x1, 0x8(%r13)
jne 0x470c
leaq 0x18(%r13), %rbx
xorl %r12d, %r12d
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x470c
cmpq $0x0, 0x38(%rbx)
je 0x4707
pushq $0x1
popq %rdi
callq 0x4593
movq 0xcbad(%rip), %rdi      # 0x112a0
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
js 0x4761
incq %r12
jmp 0x46d5
incq %r15
jmp 0x46be
pushq $0x1
popq %rdi
callq 0x4593
movq 0xcb80(%rip), %rdi      # 0x112a0
leaq 0x7742(%rip), %rsi      # 0xbe69
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
js 0x4761
xorl %edi, %edi
callq 0x4593
movq 0xcb60(%rip), %rdi      # 0x112a0
leaq 0x76fa(%rip), %rsi      # 0xbe41
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
js 0x4761
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xc888(%rip), %rax      # 0x10ff0
movq (%rax), %rdi
leaq 0x71c6(%rip), %rsi      # 0xb938
leaq 0x71d7(%rip), %rdx      # 0xb950
xorl %eax, %eax
callq 0x2100
pushq $0x1
popq %rdi
callq 0x2180
// File: /workspace/github_c_makefile_star2_O2/OstCollector[P]config2c/config2c.c
// Function: decl_elem
static void decl_elem(const char *name, const struct node_vec_def *vec)
{
	switch (vec->type) {
	case NODE_TYPE_SCALE:
		out_hdr("%s;\n", name);
		break;
	case NODE_TYPE_FIX_INT:
		out_hdr("%s[%ld];\n", name, vec->len_int);
		break;
	case NODE_TYPE_FIX_STR:
		out_hdr("%s[%s];\n", name, vec->len_str);
		break;
	case NODE_TYPE_VAR_ARR:
		out_hdr("*%s;\n", name);
		break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl (%rsi), %eax
cmpq $0x3, %rax
ja 0x6514
movq %rdi, %rdx
leaq 0x4c79(%rip), %rcx      # 0xb12c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0xadfd(%rip), %rdi      # 0x112c0
leaq 0x62af(%rip), %rsi      # 0xc779
jmp 0x64ee
movq 0xaded(%rip), %rdi      # 0x112c0
movq 0x8(%rsi), %rcx
leaq 0x6164(%rip), %rsi      # 0xc642
jmp 0x6509
movq 0xadd9(%rip), %rdi      # 0x112c0
leaq 0x615d(%rip), %rsi      # 0xc64b
xorl %eax, %eax
callq 0x2100
jmp 0x6510
movq 0xadc2(%rip), %rdi      # 0x112c0
movq 0x8(%rsi), %rcx
leaq 0x612f(%rip), %rsi      # 0xc638
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
js 0x6516
popq %rbp
retq
movq 0xaad3(%rip), %rax      # 0x10ff0
movq (%rax), %rdi
leaq 0x5411(%rip), %rsi      # 0xb938
leaq 0x5422(%rip), %rdx      # 0xb950
xorl %eax, %eax
callq 0x2100
pushq $0x1
popq %rdi
callq 0x2180
// File: /workspace/github_c_makefile_star2_O2/OstCollector[P]config2c/config2c.c
// Function: decl_elem_post
static void decl_elem_post(const struct node_vec_def *vec, int l)
{
	switch (vec->type) {
	case NODE_TYPE_VAR_ARR:
		ohi(l, "long %s;\n", vec->len_str);
		break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
cmpl $0x3, (%rdi)
jne 0x656f
movq %rdi, %rbx
movl %esi, %edi
callq 0x6410
movq 0xad67(%rip), %rdi      # 0x112c0
movq 0x8(%rbx), %rdx
leaq 0x60ed(%rip), %rsi      # 0xc651
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
js 0x6576
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq 0xaa73(%rip), %rax      # 0x10ff0
movq (%rax), %rdi
leaq 0x53b1(%rip), %rsi      # 0xb938
leaq 0x53c2(%rip), %rdx      # 0xb950
xorl %eax, %eax
callq 0x2100
pushq $0x1
popq %rdi
callq 0x2180
// File: /workspace/github_c_makefile_star2_O2/OstCollector[P]config2c/config2c.c
// Function: lookup_union
static const struct node_type_def_list *lookup_union(const char *name)
{
	const struct node_type_def_list *l;
	for (l = ast; l; l = l->next) {
		if (l->type == NODE_TYPE_DEF_UNION &&
				!strcmp(name, l->union_def.name)) {
			return l;
		}
	}
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0xacfa(%rip), %rbx      # 0x112a8
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x65cc
cmpl $0x2, 0x8(%rbx)
jne 0x65ae
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x20e0
testl %eax, %eax
jne 0x65ae
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/OstCollector[P]config2c/config2c.c
// Function: out_str_list
static void out_str_list(int is_hdr, string prefix, string postfix,
		const struct string_list *list)
{
	for (; list; list = list->next) {
		if (list->next) {
			if (is_hdr) {
				out_hdr("%s%s%s, ", prefix, list->str, postfix);
			} else {
				out_src("%s%s%s, ", prefix, list->str, postfix);
			}
		} else {
			if (is_hdr) {
				out_hdr("%s%s%s", prefix, list->str, postfix);
			} else {
				out_src("%s%s%s", prefix, list->str, postfix);
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x52dc(%rip), %r15      # 0xcd80
leaq 0x51d8(%rip), %r12      # 0xcc83
leaq 0x52c5(%rip), %r13      # 0xcd77
testq %rbx, %rbx
je 0x7ae7
cmpq $0x0, 0x8(%rbx)
movq 0x97dd(%rip), %rdi      # 0x112a0
movq (%rbx), %rcx
je 0x7acd
movq %r13, %rsi
jmp 0x7ad0
movq %r15, %rsi
movq %r12, %rdx
movq %r14, %r8
xorl %eax, %eax
callq 0x2100
testl %eax, %eax
js 0x7af6
movq 0x8(%rbx), %rbx
jmp 0x7ab2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x94f3(%rip), %rax      # 0x10ff0
movq (%rax), %rdi
leaq 0x3e31(%rip), %rsi      # 0xb938
leaq 0x3e42(%rip), %rdx      # 0xb950
xorl %eax, %eax
callq 0x2100
pushq $0x1
popq %rdi
callq 0x2180
// File: /workspace/github_c_makefile_star2_O2/OstCollector[P]config2c/config2c.c
// Function: lookup_enum
static const struct node_type_def_list *lookup_enum(const char *name)
{
	const struct node_type_def_list *l;
	for (l = ast; l; l = l->next) {
		if (l->type == NODE_TYPE_DEF_ENUM && 
				!strcmp(name, l->enum_def.name)) {
			return l;
		}
	}
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0x8fe8(%rip), %rbx      # 0x112a8
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x82de
cmpl $0x0, 0x8(%rbx)
jne 0x82c0
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x20e0
testl %eax, %eax
jne 0x82c0
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/OstCollector[P]config2c/config2c.c
// Function: lookup_struct
static const struct node_type_def_list *lookup_struct(const char *name)
{
	const struct node_type_def_list *l;
	for (l = ast; l; l = l->next) {
		if (l->type == NODE_TYPE_DEF_STRUCT && 
				!strcmp(name, l->struct_def.name)) {
			return l;
		}
	}
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0x8fb1(%rip), %rbx      # 0x112a8
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x8315
cmpl $0x1, 0x8(%rbx)
jne 0x82f7
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x20e0
testl %eax, %eax
jne 0x82f7
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/OstCollector[P]config2c/config2cy.tab.c
// Function: yytnamerr
static YYPTRDIFF_T
yytnamerr (char *yyres, const char *yystr)
{
  if (*yystr == '"')
    {
      YYPTRDIFF_T yyn = 0;
      char const *yyp = yystr;
      for (;;)
        switch (*++yyp)
          {
          case '\'':
          case ',':
            goto do_not_strip_quotes;

          case '\\':
            if (*++yyp != '\\')
              goto do_not_strip_quotes;
            else
              goto append;

          append:
          default:
            if (yyres)
              yyres[yyn] = *yyp;
            yyn++;
            break;

          case '"':
            if (yyres)
              yyres[yyn] = '\0';
            return yyn;
          }
    do_not_strip_quotes: ;
    }

  if (yyres)
    return yystpcpy (yyres, yystr) - yyres;
  else
    return yystrlen (yystr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpb $0x22, (%rsi)
jne 0xa78f
xorl %eax, %eax
movq %rsi, %rcx
movzbl 0x1(%rcx), %edx
cmpl $0x5c, %edx
je 0xa778
cmpl $0x22, %edx
je 0xa7b8
cmpl $0x27, %edx
je 0xa78f
cmpl $0x2c, %edx
je 0xa78f
incq %rcx
jmp 0xa782
cmpb $0x5c, 0x2(%rcx)
jne 0xa78f
addq $0x2, %rcx
testq %rdi, %rdi
je 0xa78a
movb %dl, (%rdi,%rax)
incq %rax
jmp 0xa75b
testq %rdi, %rdi
je 0xa7af
movabsq $-0x1, %rax
movb 0x1(%rsi,%rax), %cl
movb %cl, 0x1(%rdi,%rax)
incq %rax
testb %cl, %cl
jne 0xa79e
popq %rbp
retq
movq %rsi, %rdi
popq %rbp
jmp 0x2090
testq %rdi, %rdi
je 0xa7ad
movb $0x0, (%rdi,%rax)
jmp 0xa7ad
// File: /workspace/github_c_makefile_star2_O2/DrYerzinia[P]C_DigiMode/src/net/forward.c
// Function: open_udp_socket
int open_udp_socket(char *hostname, char *port){

	memset(&hints, 0, sizeof(struct addrinfo));
	hints.ai_family = AF_UNSPEC;    /* Allow IPv4 or IPv6 */
	hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */
	hints.ai_flags = 0;
	hints.ai_protocol = 0;


	//Create the socket
	int error = getaddrinfo(hostname, port, &hints, &result);
	if(error != 0){
		perror("Failed to create socket");
		return -1;
	}

	for(rp = result; rp != NULL; rp = rp->ai_next){
		sock = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol);
		if(sock == -1)
			continue;

		if(connect(sock, rp->ai_addr, rp->ai_addrlen) == 0)
			break;                  /* Success */

		close(sock);

	}

	if(rp == NULL){
		perror("Bind failed");
		return -1;
	}

	freeaddrinfo(result);

	return 0;

}

// Assembly:
pushq %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x2e89(%rip)     # 0x40a0
movups %xmm0, 0x2ea2(%rip)     # 0x40c0
movups %xmm0, 0x2e8b(%rip)     # 0x40b0
leaq 0x2e74(%rip), %rdx      # 0x40a0
movq $0x2, 0x2e71(%rip) # 0x40a8
leaq 0x2e92(%rip), %rbx      # 0x40d0
movq %rbx, %rcx
callq 0x10d0
testl %eax, %eax
jne 0x12c6
movq (%rbx), %rax
movq %rax, 0x2e84(%rip)      # 0x40d8
testq %rax, %rax
je 0x12bd
movl 0x4(%rax), %edi
movl 0x8(%rax), %esi
movl 0xc(%rax), %edx
callq 0x1100
movl %eax, 0x2e73(%rip)      # 0x40e0
cmpl $-0x1, %eax
je 0x1296
movq 0x2e5f(%rip), %rcx      # 0x40d8
movq 0x18(%rcx), %rsi
movl 0x10(%rcx), %edx
movl %eax, %edi
callq 0x10b0
testl %eax, %eax
je 0x12a3
movl 0x2e4f(%rip), %edi      # 0x40e0
callq 0x1070
movq 0x2e3b(%rip), %rbx      # 0x40d8
addq $0x28, %rbx
jmp 0x124a
cmpq $0x0, 0x2e2d(%rip)      # 0x40d8
je 0x12bd
movq 0x2e1c(%rip), %rdi      # 0x40d0
callq 0x10f0
xorl %eax, %eax
popq %rbx
retq
leaq 0xd58(%rip), %rdi       # 0x201c
jmp 0x12cd
leaq 0xd37(%rip), %rdi       # 0x2004
callq 0x10a0
pushq $-0x1
popq %rax
jmp 0x12bb
// File: /workspace/github_c_makefile_star2_O2/DrYerzinia[P]C_DigiMode/src/net/forward.c
// Function: send_data
int send_data(int len, char* data){

	//send the message to server
	int bytesSent = write(sock, data, len);
	if(bytesSent != len){
		perror("Mismatch in number of bytes sent");
		fprintf(stderr, "Send %d bytes\n", bytesSent);
		return -1;
	}

	return 0;

}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl 0x2def(%rip), %eax      # 0x40e0
movslq %edi, %r14
movl %eax, %edi
movq %r14, %rdx
callq 0x1050
movq %rax, %rbx
xorl %eax, %eax
cmpl %r14d, %ebx
jne 0x1310
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xd11(%rip), %rdi       # 0x2028
callq 0x10a0
movq 0x2cd5(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0xd1c(%rip), %rsi       # 0x2049
movl %ebx, %edx
xorl %eax, %eax
callq 0x1080
pushq $-0x1
popq %rax
jmp 0x1308
// File: /workspace/github_c_makefile_star2_O2/DrYerzinia[P]C_DigiMode/src/net/forward.c
// Function: main
int main(int argc, char **argv){

	if(argc < 3){
		printf("Usage: %s hostname port\n", argv[0]);
		return -1;
	}

	char buffer[1000];

	bool running = true;

	// Hostname, Port
	if(open_udp_socket(argv[1], argv[2]) == -1){
		perror("Error creating socket");
		return -1;
	}

	while(running){

		char len1, len2;
		len1 = getc(stdin);
		len2 = getc(stdin);

		if(feof(stdin)){
			printf("stdin closed\n");
			break;
		}

		unsigned short len;

		int count;

		len = (((unsigned char)len1)<<8) + ((unsigned char)len2);

		if(len > 1000){
			fprintf(stderr, "Buffer to small for packet!\n");
			break;
		}

		fread(buffer, sizeof(char), len, stdin);
		/*
		int i;
		for(i = 0; i < len; i++){
			int byte = getc(stdin);
			buffer[i] = (unsigned char)byte;
		}*/

		// Standard log
		fprintf(stdout, "Sending Packet Length: %d\n", ((int)len));

		if(send_data(len, buffer) == -1){
			fprintf(stderr, "Failed to send data to client via udp\n");
			break;
		}

	}

	close_udp_socket();

	return 0;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3e8, %rsp            # imm = 0x3E8
cmpl $0x2, %edi
jg 0x136a
movq (%rsi), %rsi
leaq 0xcfd(%rip), %rdi       # 0x2058
xorl %eax, %eax
callq 0x1060
pushq $-0x1
popq %rax
jmp 0x1427
movq 0x8(%rsi), %rdi
movq 0x10(%rsi), %rsi
callq 0x120c
cmpl $-0x1, %eax
je 0x1439
movq 0x2c51(%rip), %r13      # 0x3fd8
movq %rsp, %rbx
movq 0x2c3f(%rip), %r14      # 0x3fd0
leaq 0xd0c(%rip), %r15       # 0x20a4
movq (%r13), %rdi
callq 0x10e0
movl %eax, %ebp
movq (%r13), %rdi
callq 0x10e0
movl %eax, %r12d
movq (%r13), %rdi
callq 0x1090
testl %eax, %eax
jne 0x1414
shll $0x8, %ebp
movzbl %r12b, %eax
movzwl %bp, %ebp
orl %eax, %ebp
cmpl $0x3e9, %ebp            # imm = 0x3E9
jae 0x144a
movl %ebp, %edx
movq (%r13), %rcx
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0x1040
movq (%r14), %rdi
movq %r15, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x1080
movl %ebp, %edi
movq %rbx, %rsi
callq 0x12e7
cmpl $-0x1, %eax
jne 0x1398
movq 0x2bf2(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xcaf(%rip), %rdi       # 0x20bf
pushq $0x26
jmp 0x145d
leaq 0xccb(%rip), %rdi       # 0x20e6
callq 0x1030
callq 0x12d7
xorl %eax, %eax
addq $0x3e8, %rsp            # imm = 0x3E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc31(%rip), %rdi       # 0x2071
callq 0x10a0
jmp 0x1362
movq 0x2ba7(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xc2c(%rip), %rdi       # 0x2087
pushq $0x1c
popq %rsi
pushq $0x1
popq %rdx
callq 0x10c0
jmp 0x1420
// File: /workspace/github_c_makefile_star2_O2/agraf[P]kvmbench/tsc.c
// Function: setup_tsc
void setup_tsc(void)
{
    uint64_t before, after;
    uint64_t before_tod, after_tod;

    before_tod = get_us_gettimeofday();
    before = rdtsc();

    usleep(10);

    after_tod = get_us_gettimeofday();
    after = rdtsc();

    tsc_per_sec = ((after - before) * 1000000ULL) / (after_tod - before_tod);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
callq 0x131d
movq %rax, %rbx
rdtsc
movl %edx, %r14d
movl %eax, %r15d
negl %r14d
shlq $0x20, %r14
pushq $0xa
popq %rdi
callq 0x1060
callq 0x131d
movq %rax, %rcx
rdtsc
movl %eax, %eax
shlq $0x20, %rdx
addq %rax, %rdx
subq %r15, %r14
addq %rdx, %r14
imulq $0xf4240, %r14, %rax    # imm = 0xF4240
subq %rbx, %rcx
xorl %edx, %edx
divq %rcx
movq %rax, 0x2d39(%rip)      # 0x4050
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/mcxiaoke[P]dsaac/ch4/bst/bst.c
// Function: bst_create
void bst_create(BST *ptree) {
	printf("Data: \t  ");
	srand((unsigned) time(NULL ));
//	srand(100);
	int data[100];
	for (int i = 0; i < 100; i++) {
		data[i] = i;
	}
	for (int i = 0; i < 100; i++) {
		int j = rand() % 100;
		int tmp = data[i];
		data[i] = data[j];
		data[j] = tmp;
	}
	for (int i = 0; i < BST_MAX; ++i) {
		int x = data[i];
		bst_insert(x, ptree);
		printf("%3d ", x);
	}
	printf("\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rdi, %rbx
leaq 0xe11(%rip), %rdi       # 0x2004
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x1060
xorl %edi, %edi
callq 0x1090
movl %eax, %edi
callq 0x1080
cmpq $0x64, %r14
je 0x121a
movl %r14d, (%rsp,%r14,4)
incq %r14
jmp 0x120b
xorl %r14d, %r14d
pushq $0x64
popq %rbp
cmpq $0x64, %r14
je 0x1244
callq 0x10d0
cltd
idivl %ebp
movl (%rsp,%r14,4), %eax
movslq %edx, %rcx
movl (%rsp,%rcx,4), %edx
movl %edx, (%rsp,%r14,4)
movl %eax, (%rsp,%rcx,4)
incq %r14
jmp 0x1220
leaq 0xdc3(%rip), %r14       # 0x200e
xorl %r15d, %r15d
cmpq $0xa, %r15
je 0x1273
movl (%rsp,%r15,4), %ebp
movl %ebp, %edi
movq %rbx, %rsi
callq 0x1288
movq %r14, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x1060
incq %r15
jmp 0x124e
pushq $0xa
popq %rdi
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O2/mcxiaoke[P]dsaac/ch4/bst/bst.c
// Function: bst_insert
BST bst_insert(int value, BST *ptree) {
	assert(ptree!=NULL);

	if (*ptree == NULL ) {
		*ptree = makeNode(value);
//		printf("Insert \t%4d\n", (*ptree)->value, *ptree);
		return *ptree;
	}

	BST tree = *ptree;
	if (value < tree->value) {
		return bst_insert(value, &(tree->left));
	} else if (value > tree->value) {
		return bst_insert(value, &(tree->right));
	} else {
		return NULL ;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebx
pushq $0x8
popq %rcx
pushq $0x10
popq %rdx
xorl %eax, %eax
testq %r14, %r14
je 0x12db
movq (%r14), %rsi
testq %rsi, %rsi
je 0x12ba
movq %rcx, %rdi
cmpl %ebx, (%rsi)
jg 0x12b2
movq %rdx, %rdi
jge 0x12d3
addq %rdi, %rsi
movq %rsi, %r14
jmp 0x1299
pushq $0x20
popq %rdi
callq 0x10a0
testq %rax, %rax
je 0x12d0
movl %ebx, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq %rax, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xd31(%rip), %rdi       # 0x2013
leaq 0xd36(%rip), %rsi       # 0x201f
leaq 0xd35(%rip), %rcx       # 0x2025
pushq $0x59
popq %rdx
callq 0x1070
// File: /workspace/github_c_makefile_star2_O2/mcxiaoke[P]dsaac/ch4/bst/bst.c
// Function: bst_clear
void bst_clear(BST tree) {
	if (tree != NULL ) {
		bst_clear(tree->left);
		bst_clear(tree->right);
		free(tree);
	}
}

// Assembly:
testq %rdi, %rdi
je 0x131c
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x12f8
movq 0x10(%rbx), %rdi
callq 0x12f8
movq %rbx, %rdi
popq %rbx
jmp 0x1030
retq
// File: /workspace/github_c_makefile_star2_O2/mcxiaoke[P]dsaac/ch4/bst/bst.c
// Function: bst_delete
TreeNode* bst_delete(int value, BST tree) {
	TreeNode *tmpNode;
	if (tree == NULL ) {
		return NULL;
	}
	if (value < tree->value) {
		tree->left = bst_delete(value, tree->left);
	} else if (value > tree->value) {
		tree->right = bst_delete(value, tree->right);
	} else if (tree->left && tree->right) {
		tmpNode = bst_findMin(tree->right);
		tree->value = tmpNode->value;
		tree->right = bst_delete(tree->value, tree->right);
	} else {
		tmpNode = tree;
		if (tree->left == NULL ) {
			tree = tree->right;
		} else if (tree->right == NULL ) {
			tree = tree->left;
		}
		free(tmpNode);
	}
	return tree;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rsi, %rsi
je 0x1342
movq %rsi, %rbx
cmpl %edi, (%rsi)
jle 0x1346
movq 0x8(%rbx), %rsi
callq 0x1322
movq %rax, 0x8(%rbx)
jmp 0x1388
xorl %ebx, %ebx
jmp 0x1388
jge 0x134e
movq 0x10(%rbx), %rsi
jmp 0x136f
movq 0x8(%rbx), %r15
movq 0x10(%rbx), %r14
testq %r15, %r15
je 0x137a
testq %r14, %r14
je 0x137d
movq %r14, %rdi
callq 0x1391
movl (%rax), %edi
movl %edi, (%rbx)
movq %r14, %rsi
callq 0x1322
movq %rax, 0x10(%rbx)
jmp 0x1388
movq %r14, %r15
movq %rbx, %rdi
callq 0x1030
movq %r15, %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/mcxiaoke[P]dsaac/ch4/bst/bst.c
// Function: bst_findMin
TreeNode* bst_findMin(BST tree) {
	if (tree != NULL ) {
		while (tree->left != NULL ) {
			tree = tree->left;
		}
	}
	return tree;
}

// Assembly:
testq %rdi, %rdi
je 0x13a3
movq %rdi, %rax
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
jne 0x1396
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/mcxiaoke[P]dsaac/ch4/bst/bst.c
// Function: bst_depth
int bst_depth(BST tree) {
	if (tree == NULL ) {
		return 0;
	}
	int lh, rh;
	lh = bst_depth(tree->left);
	rh = bst_depth(tree->right);
	return (lh > rh ? lh : rh) + 1;
}

// Assembly:
testq %rdi, %rdi
je 0x13d3
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x13a6
movl %eax, %ebp
movq 0x10(%rbx), %rdi
callq 0x13a6
cmpl %eax, %ebp
cmovgl %ebp, %eax
incl %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/mcxiaoke[P]dsaac/ch4/bst/bst.c
// Function: bst_search
TreeNode* bst_search(int value, BST tree) {
	if (tree == NULL ) {
		return NULL ;
	} else if (value == tree->value) {
		return tree;
	} else if (value < tree->value) {
		return bst_search(value, tree->left);
	} else {
		return bst_search(value, tree->right);
	}
}

// Assembly:
movq %rsi, %rax
testq %rax, %rax
je 0x141a
cmpl %edi, (%rax)
je 0x141a
setle %cl
movzbl %cl, %ecx
movq 0x8(%rax,%rcx,8), %rax
jmp 0x1404
retq
// File: /workspace/github_c_makefile_star2_O2/mcxiaoke[P]dsaac/ch4/bst/bst.c
// Function: bst_find
TreeNode* bst_find(int value, BST tree) {
//	return bst_search(value, tree);
	while (tree != NULL && value != tree->value) {
		if (value < tree->value) {
			tree = tree->left;
		} else {
			tree = tree->right;
		}
	}
	return tree;
}

// Assembly:
movq %rsi, %rax
testq %rax, %rax
je 0x1434
cmpl %edi, (%rax)
je 0x1434
setle %cl
movzbl %cl, %ecx
movq 0x8(%rax,%rcx,8), %rax
jmp 0x141e
retq
// File: /workspace/github_c_makefile_star2_O2/mcxiaoke[P]dsaac/ch4/bst/bst.c
// Function: bst_successor
TreeNode* bst_successor(BST node) {
	assert(node!=NULL);
	if (node->right != NULL ) {
		return bst_findMin(node);
	}
	// 后继必须存在parent指针才能查找
	TreeNode* t = node->parent;
	while (t != NULL && node == t->right) {
		node = t;
		t = t->parent;
	}
	return t ;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x145e
cmpq $0x0, 0x10(%rdi)
je 0x1451
popq %rax
jmp 0x1391
cmpq 0x10(%rax), %rdi
movq %rax, %rdi
jne 0x145c
movq 0x18(%rdi), %rax
testq %rax, %rax
jne 0x1448
xorl %eax, %eax
popq %rcx
retq
leaq 0xbdb(%rip), %rdi       # 0x2040
leaq 0xbb3(%rip), %rsi       # 0x201f
leaq 0xbd8(%rip), %rcx       # 0x204b
movl $0xb5, %edx
callq 0x1070
// File: /workspace/github_c_makefile_star2_O2/mcxiaoke[P]dsaac/ch4/bst/bst.c
// Function: bst_preOrder
void bst_preOrder(BST tree) {
	if (tree != NULL ) {
		show(tree);
		bst_preOrder(tree->left);
		bst_preOrder(tree->right);
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testq %rbx, %rbx
je 0x14af
movq %rbx, %rdi
callq 0x14b1
movq 0x8(%rbx), %rdi
callq 0x148f
movq 0x10(%rbx), %rbx
jmp 0x1493
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/mcxiaoke[P]dsaac/ch4/bst/bst.c
// Function: bst_inOrder
void bst_inOrder(BST tree) {
	if (tree != NULL ) {
		bst_inOrder(tree->left);
		show(tree);
		bst_inOrder(tree->right);
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testq %rbx, %rbx
je 0x14e7
movq 0x8(%rbx), %rdi
callq 0x14c7
movq %rbx, %rdi
callq 0x14b1
movq 0x10(%rbx), %rbx
jmp 0x14cb
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/mcxiaoke[P]dsaac/ch4/bst/bst.c
// Function: bst_postOrder
void bst_postOrder(BST tree) {
	if (tree != NULL ) {
		bst_postOrder(tree->left);
		bst_postOrder(tree->right);
		show(tree);
	}
}

// Assembly:
testq %rdi, %rdi
je 0x150a
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x14e9
movq 0x10(%rbx), %rdi
callq 0x14e9
movq %rbx, %rdi
popq %rbx
jmp 0x14b1
retq
// File: /workspace/github_c_makefile_star2_O2/mcxiaoke[P]dsaac/ch4/bst/bst.c
// Function: bst_preOrderIter
void bst_preOrderIter(BST tree) {
	Stack s = stack_create(STATCK_MAX);
	while (tree != NULL || !stack_isEmpty(s)) {
		if (tree != NULL ) {
			show(tree);
			stack_push(tree, s);
			tree = tree->left;
		} else {
			tree = (BST) stack_top(s);
			stack_pop(s);
			tree = tree->right;
		}
	}
	stack_destroy(s);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
pushq $0x14
popq %rdi
callq 0x17b4
movq %rax, %rbx
testq %r14, %r14
je 0x153b
movq %r14, %rdi
callq 0x14b1
movq %r14, %rdi
movq %rbx, %rsi
callq 0x187b
addq $0x8, %r14
jmp 0x155e
movq %rbx, %rdi
callq 0x1839
testl %eax, %eax
jne 0x1563
movq %rbx, %rdi
callq 0x18b5
movq %rax, %r14
movq %rbx, %rdi
callq 0x1844
addq $0x10, %r14
movq (%r14), %r14
jmp 0x151d
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x17ee
// File: /workspace/github_c_makefile_star2_O2/mcxiaoke[P]dsaac/ch4/bst/bst.c
// Function: bst_postOrderIter
void bst_postOrderIter(BST tree) {
	Stack s = stack_create(STATCK_MAX);
	BST p = tree;
	BST q = NULL;
	while (p != NULL || !stack_isEmpty(s))  //栈空时结束
	{
		while (p != NULL ) {
			stack_push(p, s);
			p = p->left;
		}
		p = stack_top(s);
		if (p->right == NULL || p->right == q) {
			show(p);
			q = stack_top(s);
			stack_pop(s);
			p = NULL;
		} else {
			p = p->right;
		}
	}
	stack_destroy(s);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r15
pushq $0x14
popq %rdi
callq 0x17b4
movq %rax, %rbx
xorl %r14d, %r14d
testq %r15, %r15
jne 0x1611
movq %rbx, %rdi
callq 0x1839
testl %eax, %eax
je 0x1611
jmp 0x164c
movq %r15, %rdi
movq %rbx, %rsi
callq 0x187b
movq 0x8(%r15), %r15
testq %r15, %r15
jne 0x1602
movq %rbx, %rdi
callq 0x18b5
movq 0x10(%rax), %r15
testq %r15, %r15
je 0x162c
cmpq %r14, %r15
jne 0x15ef
movq %rax, %rdi
callq 0x14b1
movq %rbx, %rdi
callq 0x18b5
movq %rax, %r14
movq %rbx, %rdi
callq 0x1844
xorl %r15d, %r15d
jmp 0x15ef
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x17ee
// File: /workspace/github_c_makefile_star2_O2/mcxiaoke[P]dsaac/ch4/bst/bst.c
// Function: bst_levelOrderIter
void bst_levelOrderIter(BST tree) {
	assert(tree!=NULL);
	Queue queue = queue_create(STATCK_MAX);
	queue_enqueue(tree, queue);
	while (!queue_isEmpty(queue)) {
		BST p = queue_dequeue(queue);
		show(p);
		if (p->left != NULL ) {
			queue_enqueue(p->left, queue);
		}
		if (p->right != NULL ) {
			queue_enqueue(p->right, queue);
		}
	}
	queue_destroy(queue);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x16c5
movq %rdi, %r14
pushq $0x14
popq %rdi
callq 0x19a5
movq %rax, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1ada
movq %rbx, %rdi
callq 0x1960
testl %eax, %eax
jne 0x16b6
movq %rbx, %rdi
callq 0x1b33
movq %rax, %r14
movq %rax, %rdi
callq 0x14b1
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x16ab
movq %rbx, %rsi
callq 0x1ada
movq 0x10(%r14), %r14
testq %r14, %r14
je 0x167b
jmp 0x1670
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1a03
leaq 0x948(%rip), %rdi       # 0x2014
leaq 0x94c(%rip), %rsi       # 0x201f
leaq 0x98e(%rip), %rcx       # 0x2068
movl $0x12f, %edx            # imm = 0x12F
callq 0x1070
// File: /workspace/github_c_makefile_star2_O2/mcxiaoke[P]dsaac/ch4/bst/bst.c
// Function: main
int main(int argc, char **argv) {
	// 强制刷新缓冲区
	setvbuf(stdout, 0, _IONBF, 0);
	BST tree=NULL;
	bst_create(&tree);
	printf("\nPreOrder Rec: ");
	bst_preOrder(tree);
	printf("\nPreOrder Cir: ");
	bst_preOrderIter(tree);
	printf("\n\nInOrder Rec:  ");
	bst_inOrder(tree);
	printf("\nInOrder Cir:  ");
	bst_inOrderIter(tree);
	printf("\n\nPostOrder Rec:");
	bst_postOrder(tree);
	printf("\nPostOrder Cir:");
	bst_postOrderIter(tree);
	printf("\nLevelOrder:   ");
	bst_levelOrderIter(tree);
	return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq 0x28f0(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
pushq $0x2
popq %rdx
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x10b0
leaq 0x8(%rsp), %rbx
andq $0x0, (%rbx)
movq %rbx, %rdi
callq 0x11dc
leaq 0x96e(%rip), %rdi       # 0x2085
xorl %eax, %eax
callq 0x1060
movq (%rbx), %rdi
callq 0x148f
leaq 0x968(%rip), %rdi       # 0x2095
xorl %eax, %eax
callq 0x1060
movq (%rbx), %rdi
callq 0x150b
leaq 0x962(%rip), %rdi       # 0x20a5
xorl %eax, %eax
callq 0x1060
movq (%rbx), %rdi
callq 0x14c7
leaq 0x95d(%rip), %rdi       # 0x20b6
xorl %eax, %eax
callq 0x1060
movq (%rbx), %rdi
callq 0x1572
leaq 0x957(%rip), %rdi       # 0x20c6
xorl %eax, %eax
callq 0x1060
movq (%rbx), %rdi
callq 0x14e9
leaq 0x952(%rip), %rdi       # 0x20d7
xorl %eax, %eax
callq 0x1060
movq (%rbx), %rdi
callq 0x15d9
leaq 0x94c(%rip), %rdi       # 0x20e7
xorl %eax, %eax
callq 0x1060
movq (%rbx), %rdi
callq 0x1659
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
nop