LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH03_StringsVectorsAndArrays/examples/vecStrings2.cc
// Function: main
int main()
{
	vector<string> text;     // holds the input

	string s;
	while (getline(cin, s))  // read the entire input file
		text.push_back(s);   // storing each line as an element in text
	cout << "text.size: " << text.size() << endl;

	// print each line in text up to the first blank line
	for (auto it = text.cbegin(); 
	     it != text.cend() && !(*it).empty(); ++it) 
		cout << *it << endl;

	// equivalent loop using arrow to dereference it and call empty
	for (auto it = text.cbegin(); 
	     it != text.cend() && !it->empty(); ++it) 
		cout << *it << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
xorps %xmm0, %xmm0
leaq -0x30(%rbp), %rbx
andq $0x0, 0x10(%rbx)
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movaps %xmm0, (%rbx)
movb $0x0, (%rax)
movq 0x2d01(%rip), %r14      # 0x3fe0
leaq -0x50(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x1030
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x1309
movq %rbx, %rdi
movq %r15, %rsi
callq 0x13e2
jmp 0x12e3
movq 0x2cc0(%rip), %rdi      # 0x3fd0
leaq 0xced(%rip), %rsi       # 0x2004
callq 0x10e0
movq -0x28(%rbp), %rsi
subq -0x30(%rbp), %rsi
sarq $0x5, %rsi
movq %rax, %rdi
callq 0x10a0
movq %rax, %rdi
callq 0x1080
movq -0x30(%rbp), %rbx
movq 0x2c8d(%rip), %r14      # 0x3fd0
movq -0x28(%rbp), %rax
cmpq %rax, %rbx
je 0x136c
cmpq $0x0, 0x8(%rbx)
je 0x136c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10d0
movq %rax, %rdi
callq 0x1080
addq $0x20, %rbx
jmp 0x1343
movq -0x30(%rbp), %rbx
movq 0x2c59(%rip), %r14      # 0x3fd0
cmpq %rax, %rbx
je 0x13a0
cmpq $0x0, 0x8(%rbx)
je 0x13a0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10d0
movq %rax, %rdi
callq 0x1080
addq $0x20, %rbx
movq -0x28(%rbp), %rax
jmp 0x1377
leaq -0x50(%rbp), %rdi
callq 0x1070
leaq -0x30(%rbp), %rdi
callq 0x141e
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x13c5
jmp 0x13c5
jmp 0x13c5
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1070
leaq -0x30(%rbp), %rdi
callq 0x141e
movq %rbx, %rdi
callq 0x1160
// File: /workspace/github_cpp_makefile_star2_O2/vividvilla[P]hackerrank/src/pairs.cpp
// Function: getPairs(std::vector<int, std::allocator<int>>, int)
int getPairs(vector<int> v, int K) {
    int p = 0;
    int N = v.size();
    set<int> ns;

    for (int i = 0; i < N; i++)
        ns.insert(v[i]);

    for (set<int>::iterator itr = ns.begin(); itr != ns.end(); itr++)
        if (ns.find(*itr + K) != ns.end())
            p++;

    return p;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %r14
movq 0x8(%rdi), %r12
subq (%rdi), %r12
leaq 0x10(%rsp), %r13
andl $0x0, (%r13)
andq $0x0, 0x8(%r13)
movq %r13, 0x10(%r13)
movq %r13, 0x18(%r13)
andq $0x0, 0x20(%r13)
movl %esi, %ebx
shrq $0x2, %r12
xorl %ebp, %ebp
testl %r12d, %r12d
cmovlel %ebp, %r12d
shlq $0x2, %r12
leaq 0x8(%rsp), %r15
cmpq %rbp, %r12
je 0x12d1
movq (%r14), %rsi
addq %rbp, %rsi
movq %r15, %rdi
callq 0x14f0
addq $0x4, %rbp
jmp 0x12b8
xorl %ebp, %ebp
leaq 0x8(%rsp), %r14
movq 0x18(%r14), %r12
leaq 0x4(%rsp), %r15
cmpq %r13, %r12
je 0x1313
movl 0x20(%r12), %eax
addl %ebx, %eax
movl %eax, 0x4(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x1642
xorl %ecx, %ecx
cmpq %r13, %rax
setne %cl
addl %ecx, %ebp
movq %r12, %rdi
callq 0x10f0
movq %rax, %r12
jmp 0x12e1
leaq 0x8(%rsp), %rdi
callq 0x1498
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1330
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x1498
movq %rbx, %rdi
callq 0x1130
// File: /workspace/github_cpp_makefile_star2_O2/vividvilla[P]hackerrank/src/pairs.cpp
// Function: main
int main() {
    int N, K, x;
    cin >> N >> K;

    vector<int> v;
    for (int i = 0; i < N; i++) {
        cin >> x;
        v.push_back(x);
    }

    cout << getPairs(v, K) << endl;

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq 0x2c8a(%rip), %rbx      # 0x3fe0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x1090
leaq 0x4(%rsp), %rsi
movq %rax, %rdi
callq 0x1090
leaq 0x10(%rsp), %r14
andq $0x0, 0x10(%r14)
xorps %xmm0, %xmm0
movaps %xmm0, (%r14)
xorl %ebp, %ebp
leaq 0xc(%rsp), %r15
cmpl 0x8(%rsp), %ebp
jge 0x13a8
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1090
movq %r14, %rdi
movq %r15, %rsi
callq 0x1422
incl %ebp
jmp 0x1388
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x1440
movl 0x4(%rsp), %esi
leaq 0x30(%rsp), %rdi
callq 0x126c
movq 0x2c04(%rip), %rdi      # 0x3fd0
movl %eax, %esi
callq 0x1120
movq %rax, %rdi
callq 0x1070
leaq 0x30(%rsp), %rdi
callq 0x1694
leaq 0x10(%rsp), %rdi
callq 0x1694
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x140d
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x1694
jmp 0x1410
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x1694
movq %rbx, %rdi
callq 0x1130
// File: /workspace/github_cpp_makefile_star2_O2/giovannarosone[P]BCR_LCP_GSA/BCRexternalBWT.cpp
// Function: BCRexternalBWT::createFilePartialBWT()
int BCRexternalBWT::createFilePartialBWT() {
	//Creates one file (partial BWT) for each letter in the alphabet. From 1 to sizeAlpha-1
	static FILE *OutFileBWT;                  // output and input file BWT;
	char *filenameOut = new char[120];
	char *filename1 = new char[100];
	for (dataTypedimAlpha i = 0; i < sizeAlpha; i++) {
		sprintf (filename1, "bwt_%d", i);
		sprintf (filenameOut,"%s%s",filename1,ext);

		OutFileBWT = fopen(filenameOut, "wb");
		if (OutFileBWT==NULL) {
			std::cerr << "BWT file " << (unsigned int)i <<" : Error opening " << std::endl;
			exit (EXIT_FAILURE);
		}
		fclose(OutFileBWT);
	}
	delete [] filename1;
	delete [] filenameOut;



	//std::cerr << "\nPartial File name for input: " << fileOut <<" \n\n";
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
pushq $0x78
popq %rdi
callq 0x3040
movq %rax, %rbx
pushq $0x64
popq %rdi
callq 0x3040
movq %rax, %r15
leaq 0x49f8(%rip), %r12      # 0xaa2f
leaq 0x4aa3(%rip), %r13      # 0xaae1
xorl %ebp, %ebp
movzbl 0x148(%r14), %eax
cmpl %eax, %ebp
jae 0x6099
movq %r15, %rdi
leaq 0x4f4a(%rip), %rsi      # 0xafa0
movl %ebp, %edx
xorl %eax, %eax
callq 0x3060
movq %rbx, %rdi
leaq 0x4a73(%rip), %rsi      # 0xaadc
movq %r15, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x3060
movq %rbx, %rdi
movq %r13, %rsi
callq 0x32c0
movq %rax, 0xa240(%rip)      # 0x102c8
testq %rax, %rax
je 0x60bb
movq %rax, %rdi
callq 0x3280
incl %ebp
jmp 0x6040
movq %r15, %rdi
callq 0x3310
movq %rbx, %rdi
callq 0x3310
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x9f2e(%rip), %rdi      # 0xfff0
leaq 0x4b3f(%rip), %rsi      # 0xac08
callq 0x3270
movq %rax, %rdi
movl %ebp, %esi
callq 0x3330
leaq 0x4857(%rip), %rsi      # 0xa936
movq %rax, %rdi
callq 0x3270
movq %rax, %rdi
callq 0x3130
pushq $0x1
popq %rdi
callq 0x32e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/giovannarosone[P]BCR_LCP_GSA/BCRexternalBWT.cpp
// Function: BCRexternalBWT::openWriteFilePartialBWT_0()
FILE * BCRexternalBWT::openWriteFilePartialBWT_0( ) {
	static FILE *OutFileBWT;                  // output and input file BWT;
	char *filenameOut = new char[120];
	char *filename = new char[100];

	sprintf (filename, "bwt_%d",0);
	sprintf (filenameOut,"%s%s",filename,ext);

	OutFileBWT = fopen(filenameOut, "wb");
	if (OutFileBWT==NULL) {
		std::cerr << "BWT file $: Error opening: " << filenameOut << std::endl;
		exit (EXIT_FAILURE);
	}
	delete [] filenameOut;
	delete [] filename;

	return OutFileBWT;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
pushq $0x78
popq %rdi
callq 0x3040
movq %rax, %rbx
pushq $0x64
popq %rdi
callq 0x3040
movq %rax, %r14
leaq 0x4e87(%rip), %rsi      # 0xafa0
movq %rax, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0x3060
leaq 0x49b0(%rip), %rsi      # 0xaadc
leaq 0x48fc(%rip), %rcx      # 0xaa2f
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x3060
leaq 0x499a(%rip), %rsi      # 0xaae1
movq %rbx, %rdi
callq 0x32c0
movq %rax, 0xa17a(%rip)      # 0x102d0
testq %rax, %rax
je 0x617a
movq %rbx, %rdi
callq 0x3310
movq %r14, %rdi
callq 0x3310
movq 0xa15e(%rip), %rax      # 0x102d0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x9e6f(%rip), %rdi      # 0xfff0
leaq 0x4dd3(%rip), %rsi      # 0xaf5b
callq 0x3270
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3270
movq %rax, %rdi
callq 0x3130
pushq $0x1
popq %rdi
callq 0x32e0
// File: /workspace/github_cpp_makefile_star2_O2/giovannarosone[P]BCR_LCP_GSA/BCRexternalBWT.cpp
// Function: BCRexternalBWT::openFilePartialIn(unsigned char)
FILE * BCRexternalBWT::openFilePartialIn(dataTypedimAlpha currentPile) {
	static FILE *inFile;
	char *filenameIn = new char[120];
	char *filename = new char[100];
	sprintf (filename, "bwt_%d", currentPile);
	sprintf (filenameIn,"%s%s",filename,ext);
	inFile = fopen(filenameIn, "rb");
	if (inFile==NULL) {
		std::cerr << "openFilePartialIn: file currentPile=" << (unsigned int)currentPile << ": Error opening: " << filenameIn << std::endl;
		exit (EXIT_FAILURE);
	}
	delete [] filenameIn;
	delete [] filename;
	return inFile;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
pushq $0x78
popq %rdi
callq 0x3040
movq %rax, %rbx
pushq $0x64
popq %rdi
callq 0x3040
movq %rax, %r14
leaq 0x4dc1(%rip), %rsi      # 0xafa0
movq %rax, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x3060
leaq 0x48ea(%rip), %rsi      # 0xaadc
leaq 0x4836(%rip), %rcx      # 0xaa2f
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x3060
leaq 0x471e(%rip), %rsi      # 0xa92b
movq %rbx, %rdi
callq 0x32c0
movq %rax, 0xa0bc(%rip)      # 0x102d8
testq %rax, %rax
je 0x623d
movq %rbx, %rdi
callq 0x3310
movq %r14, %rdi
callq 0x3310
movq 0xa0a0(%rip), %rax      # 0x102d8
popq %rbx
popq %r14
popq %rbp
retq
movq 0x9dac(%rip), %rdi      # 0xfff0
leaq 0x4d2c(%rip), %rsi      # 0xaf77
callq 0x3270
movq %rax, %rdi
movl %ebp, %esi
callq 0x3330
leaq 0x4d04(%rip), %rsi      # 0xaf65
movq %rax, %rdi
callq 0x3270
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3270
movq %rax, %rdi
callq 0x3130
pushq $0x1
popq %rdi
callq 0x32e0
// File: /workspace/github_cpp_makefile_star2_O2/giovannarosone[P]BCR_LCP_GSA/BCRexternalBWT.cpp
// Function: BCRexternalBWT::openFilePartialOut(unsigned char)
FILE * BCRexternalBWT::openFilePartialOut(dataTypedimAlpha currentPile) {
	static FILE *outFile;
	char *filenameOut = new char[120];
	char *filename = new char[100];
	sprintf (filename, "new_bwt_%d", currentPile);
	sprintf (filenameOut,"%s%s",filename,ext);
	outFile = fopen(filenameOut, "ab");
	if (outFile==NULL) {
		std::cerr << "openFilePartialOut: file currentPile= " << (unsigned int)currentPile << ": Error opening: " << filenameOut << std::endl;
		exit (EXIT_FAILURE);
	}
	delete [] filenameOut;
	delete [] filename;
	return outFile;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
pushq $0x78
popq %rdi
callq 0x3040
movq %rax, %rbx
pushq $0x64
popq %rdi
callq 0x3040
movq %rax, %r14
leaq 0x4ce7(%rip), %rsi      # 0xaf9c
movq %rax, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x3060
leaq 0x4814(%rip), %rsi      # 0xaadc
leaq 0x4760(%rip), %rcx      # 0xaa2f
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x3060
leaq 0x4cc4(%rip), %rsi      # 0xafa7
movq %rbx, %rdi
callq 0x32c0
movq %rax, 0x9fee(%rip)      # 0x102e0
testq %rax, %rax
je 0x6313
movq %rbx, %rdi
callq 0x3310
movq %r14, %rdi
callq 0x3310
movq 0x9fd2(%rip), %rax      # 0x102e0
popq %rbx
popq %r14
popq %rbp
retq
movq 0x9cd6(%rip), %rdi      # 0xfff0
leaq 0x4c89(%rip), %rsi      # 0xafaa
callq 0x3270
movq %rax, %rdi
movl %ebp, %esi
callq 0x3330
leaq 0x4c2e(%rip), %rsi      # 0xaf65
movq %rax, %rdi
callq 0x3270
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3270
movq %rax, %rdi
callq 0x3130
pushq $0x1
popq %rdi
callq 0x32e0
// File: /workspace/github_cpp_makefile_star2_O2/giovannarosone[P]BCR_LCP_GSA/BCRexternalBWT.cpp
// Function: BCRexternalBWT::renameFilePartial(unsigned char)
int BCRexternalBWT::renameFilePartial(dataTypedimAlpha currentPile) {
	char *filenameOut = new char[120];
	char *filenameIn = new char[120];
	char *filename = new char[100];
	
	sprintf (filename, "bwt_%d", currentPile);
	sprintf (filenameIn,"%s%s",filename,ext);
	sprintf (filenameOut,"new_%s%s",filename,ext);
	//std::cerr << "Renaming - Filenames:" << filenameIn << "\t" <<filenameOut << std::endl;
	if (remove(filenameIn)!=0)
		std::cerr << filenameIn <<": Error deleting file" << std::endl;
	else
		if(rename(filenameOut,filenameIn))
			std::cerr << filenameOut <<": Error renaming " << std::endl;
	
	delete [] filenameIn;
	delete [] filename;
	delete [] filenameOut;
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
pushq $0x78
popq %r14
movq %r14, %rdi
callq 0x3040
movq %rax, %rbx
movq %r14, %rdi
callq 0x3040
movq %rax, %r14
pushq $0x64
popq %rdi
callq 0x3040
movq %rax, %r15
leaq 0x4c10(%rip), %rsi      # 0xafa0
movq %rax, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x3060
leaq 0x4739(%rip), %rsi      # 0xaadc
leaq 0x4685(%rip), %r12      # 0xaa2f
movq %r14, %rdi
movq %r15, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x3060
leaq 0x4717(%rip), %rsi      # 0xaad8
movq %rbx, %rdi
movq %r15, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x3060
movq %r14, %rdi
callq 0x3460
testl %eax, %eax
je 0x63e9
leaq 0x4bed(%rip), %r12      # 0xafd1
movq %r14, %rsi
jmp 0x6402
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3180
testl %eax, %eax
je 0x6421
leaq 0x4be8(%rip), %r12      # 0xafe7
movq %rbx, %rsi
movq 0x9be7(%rip), %rdi      # 0xfff0
callq 0x3270
movq %rax, %rdi
movq %r12, %rsi
callq 0x3270
movq %rax, %rdi
callq 0x3130
movq %r14, %rdi
callq 0x3310
movq %r15, %rdi
callq 0x3310
movq %rbx, %rdi
callq 0x3310
pushq $0x1
popq %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/giovannarosone[P]BCR_LCP_GSA/Tools.cpp
// Function: Tools::FloorLog2(unsigned long)
unsigned Tools::FloorLog2(ulong i)
{
    ulong b = 0;
    if (i == 0)
        return 0;
    while (i)
    { 
        b++; 
        i >>= 1; 
    }
    return b - 1;
}

// Assembly:
testq %rdi, %rdi
je 0x6e60
pushq $-0x1
popq %rax
testq %rdi, %rdi
je 0x6e62
shrq %rdi
incl %eax
jmp 0x6e54
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/giovannarosone[P]BCR_LCP_GSA/Tools.cpp
// Function: Tools::MakeTable()
unsigned * Tools::MakeTable()
{
    unsigned *table = new unsigned[512];
    for(unsigned i = 0; i < 9; i++)
    {
        if (i == 0)
           table[i] = 0;
        if (i >= 1 && i < (1 << 1 )) 
           table[i] = 1;
        if (i >= (1 << 1 ) && i < (1 << 2 ))
           table[i] = 2;
        if (i >= (1 << 2 ) && i < (1 << 3 ))
           table[i] = 3;
        if (i >= (1 << 3 ) && i < (1 << 4 ))
           table[i] = 4;
        if (i >= (1 << 4 ) && i < (1 << 5 ))
           table[i] = 5;
        if (i >= (1 << 5 ) && i < (1 << 6 ))
           table[i] = 6;
        if (i >= (1 << 6 ) && i < (1 << 7 ))
           table[i] = 6;
        if (i >= (1 << 7 ) && i < (1 << 8 ))
           table[i] = 7;
        if (i >= (1 << 8 ) && i < (1 << 9 ))
           table[i] = 8;
    }
        return table;
}

// Assembly:
pushq %rax
movl $0x800, %edi            # imm = 0x800
callq 0x3040
xorl %ecx, %ecx
cmpq $0x9, %rcx
je 0x6ec1
cmpl $0x1, %ecx
je 0x6e85
testl %ecx, %ecx
jne 0x6e8e
andl $0x0, (%rax)
jmp 0x6ebc
movl $0x1, (%rax,%rcx,4)
jmp 0x6ebc
movl %ecx, %edx
andl $0xe, %edx
cmpl $0x2, %edx
jne 0x6e9f
movl $0x2, (%rax,%rcx,4)
leal -0x2(%rcx), %edx
cmpl $0x2, %edx
jb 0x6ebc
cmpl $0x8, %ecx
jne 0x6eb5
movl $0x4, 0x20(%rax)
jmp 0x6ebc
movl $0x3, (%rax,%rcx,4)
incq %rcx
jmp 0x6e71
popq %rcx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/giovannarosone[P]BCR_LCP_GSA/Tools.cpp
// Function: Tools::FastFloorLog2(unsigned int)
unsigned Tools::FastFloorLog2(unsigned i)
{
    unsigned *table = MakeTable(); unsigned u;
    if (i >> 24)    u = 22 + table[ i >> 24] ;
    if (i >> 16)    u = 14 + table[ i >> 16] ;
    if (i >> 8)     u = 6 + table[ i >> 8] ;
    u =  table[i] - 1;
    delete [] table;
    return u;
}

// Assembly:
pushq %rbx
movl %edi, %ebx
callq 0x6e64
movl %ebx, %ecx
movl (%rax,%rcx,4), %ebx
movq %rax, %rdi
callq 0x3310
decl %ebx
movl %ebx, %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/giovannarosone[P]BCR_LCP_GSA/Tools.cpp
// Function: Tools::GetFileContents(char*, unsigned long)
uchar * Tools::GetFileContents(char *filename, ulong maxSize)
{
    std::ifstream::pos_type posSize;
    std::ifstream file ((char *)filename, std::ios::in|std::ios::binary|std::ios::ate);
    if (file.is_open())
    {
        posSize = file.tellg();
        ulong size = posSize;
        if (maxSize != 0 && size > maxSize)
            size = maxSize;
        char *memblock = new char [size + 1];
        file.seekg (0, std::ios::beg);
        file.read (memblock, size);
        memblock[size] = '\0';
        file.close();
	return (uchar *)memblock;
    }
    else
        return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rsi, %rbx
movq %rdi, %rsi
movq %rsp, %rdi
pushq $0xe
popq %rdx
callq 0x3470
leaq 0x78(%rsp), %rdi
callq 0x3090
testb %al, %al
je 0x6f75
movq %rsp, %rdi
callq 0x3440
cmpq %rbx, %rax
movq %rbx, %r14
cmovbq %rax, %r14
testq %rbx, %rbx
cmoveq %rax, %r14
leaq 0x1(%r14), %rdi
callq 0x3040
movq %rax, %rbx
movq %rsp, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3340
movq %rsp, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x3300
movb $0x0, (%rbx,%r14)
movq %rsp, %rdi
callq 0x3080
jmp 0x6f77
xorl %ebx, %ebx
movq %rsp, %rdi
callq 0x30a0
movq %rbx, %rax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r14
retq
jmp 0x6f8f
movq %rax, %rbx
movq %rsp, %rdi
callq 0x30a0
movq %rbx, %rdi
callq 0x3450
nop
// File: /workspace/github_cpp_makefile_star2_O2/giovannarosone[P]BCR_LCP_GSA/TransposeFasta.cpp
// Function: TransposeFasta::readln(char*, int, _IO_FILE*)
ulong TransposeFasta::readln(char* s, int n, FILE* iop) {

  register long c=0;
  register char* cs;
  register long z = 0; // count characters
  cs=s;
  while (--n > 0 && (c = getc(iop)) != EOF) {
	  //std::cerr << "n= " << n << " c= " << c << " ";
	  //printf ("%c\n", c);
	  if ((*cs++ = c) == '\n')
		break;
	z++;
  }
  if (c == EOF && z==0)
	  z = 0; // signify end of file
  *cs = '\0';
  return z;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rsi, %rbx
movl %edx, %r12d
xorl %r14d, %r14d
leal (%r12,%r14), %eax
cmpl $0x2, %eax
jl 0x878e
movq %r15, %rdi
callq 0x30c0
cmpl $-0x1, %eax
je 0x878e
movb %al, (%rbx)
incq %rbx
cmpb $0xa, %al
je 0x878e
decq %r14
jmp 0x876a
movb $0x0, (%rbx)
negq %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/MingYueRuYa[P]cprimeprimecode/memory_manager.cpp
// Function: demo02::test_call_ctor_directory()
void test_call_ctor_directory()
{
	cout << "\ntest_call_ctor_directory().......\n";
	string *pstr = new string("liushixiong like program!");
	cout << "str= " << *pstr << endl;
	//! pstr->string::string("demo2"); 
	//[Error] 'class std::basic_string<char>' has no member named 'string'
 
	pstr->~string(); //crash ----其语法语义是正确的，
					 //crash只因为上一行被remark起来[侯捷]，
					 //但是实际情况在pi环境下测试并没有crash，此处灰色地带

	A *pA = new A(1); //ctor. this=0x16d8048 id=1
	cout << pA->id << endl; // 1
	//! pA->A::A(3); //in VC6 : ctor, this0013FF60 id 3
					 //in vs2013 : ctor, this0013FF60 id 3
		 //in GCC : [Error] cannot call constructor ‘demo02::A::A’ directly

	cout << pA->id << endl; 	//in VC6 : 3
								//in GCC : 1
	pA->~A(); 					//dtor, this=0xd37048 id=1，手动调用析构函数
	cout << pA->id << endl; 	//测试内存是否被手动调用析构函数释放，\
								//但其实内存并没有释放

	delete pA;					// dtor, this=0x16d8048 id=1

	//simulate new
	void *p = ::operator new(sizeof(A));
	cout << "p=" << p << endl;		//this=000307A8
	pA = static_cast<A *>(p);
	//! pA->A(2); 					//[Error]: invalid use of ‘demo02::A::A’
	//!	pA->A::A(2);				//in VC6 : ctor. this=000307A8 id=2
									//in GCC : [Error] cannot call constructor 'demo02::A::A' directly 

	cout << pA->id << endl;			//in VC6 : 2
									//in GCC : 0

	//simulate delete
	pA->~A(); 						//dtor. this=000307A8, id=0
	::operator delete(pA);			//free();	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x4b69(%rip), %rdi      # 0x6fd0
leaq 0x1be6(%rip), %rsi      # 0x4054
callq 0x2170
pushq $0x20
popq %rdi
callq 0x2180
movq %rax, %rbx
leaq 0x1bf3(%rip), %rsi      # 0x4078
leaq -0x19(%rbp), %rdx
movq %rax, %rdi
callq 0x335a
movq 0x4b38(%rip), %rdi      # 0x6fd0
leaq 0x1bf3(%rip), %rsi      # 0x4092
callq 0x2170
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2140
movq %rax, %rdi
callq 0x2090
movq %rbx, %rdi
callq 0x2080
pushq $0x4
popq %rdi
callq 0x2180
movq %rax, %r14
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x3396
movl (%r14), %esi
movq 0x4af1(%rip), %rbx      # 0x6fd0
movq %rbx, %rdi
callq 0x2240
movq %rax, %rdi
callq 0x2090
movl (%r14), %esi
movq %rbx, %rdi
callq 0x2240
movq %rax, %rdi
callq 0x2090
movq %r14, %rdi
callq 0x33e6
movl (%r14), %esi
movq %rbx, %rdi
callq 0x2240
movq %rax, %rdi
callq 0x2090
movq %r14, %rdi
callq 0x33e6
pushq $0x4
popq %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2190
movq %r15, %rdi
callq 0x2180
movq %rax, %r14
leaq 0x1b82(%rip), %rsi      # 0x40c8
movq %rbx, %rdi
callq 0x2170
movq %rax, %rdi
movq %r14, %rsi
callq 0x2100
movq %rax, %rdi
callq 0x2090
movl (%r14), %esi
movq %rbx, %rdi
callq 0x2240
movq %rax, %rdi
callq 0x2090
movq %r14, %rdi
callq 0x33e6
movq %r14, %rdi
callq 0x2150
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
pushq $0x4
popq %rsi
movq %r14, %rdi
jmp 0x25a3
movq %rax, %r15
pushq $0x20
popq %rsi
movq %rbx, %rdi
callq 0x2190
movq %r15, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O2/MingYueRuYa[P]cprimeprimecode/memory_manager.cpp
// Function: demo04::Screen::operator new(unsigned long)
void *Screen::operator new(size_t size)
{
	Screen *p;
	if (!freeStore) {
		//linked list 是空的，所以获取一大块memory
		//以下调用的是global operator new
		size_t chunk = screenChunk*size;
		freeStore = p = reinterpret_cast<Screen *>(new char[chunk]);
		//将分配得来的一大块memory，当做linked list将小块小块串联起来
		for (; p != &freeStore[screenChunk-1]; ++p) {
			p->next = p+1;
		}
		p->next = NULL;
	}
	p = freeStore;
	freeStore = freeStore->next;
	return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x49bf(%rip), %rax      # 0x7168
testq %rax, %rax
jne 0x27e2
imulq $0x18, %rdi, %rdi
callq 0x2030
movq %rax, 0x49aa(%rip)      # 0x7168
movq %rax, %rcx
addq $0x10, %rcx
movl $0x170, %edx            # imm = 0x170
testq %rdx, %rdx
je 0x27dd
movq %rcx, -0x10(%rcx)
addq $-0x10, %rdx
addq $0x10, %rcx
jmp 0x27ca
andq $0x0, -0x10(%rcx)
movq (%rax), %rcx
movq %rcx, 0x497c(%rip)      # 0x7168
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/MingYueRuYa[P]cprimeprimecode/memory_manager.cpp
// Function: demo04::test_per_class_allocator_1()
void test_per_class_allocator_1()
{
	cout << "\ntest_per_class_allocator_1()................ \n";
	cout << sizeof(Screen) << endl;
	//pi 下N太大会造成crash
	size_t const N = 20;
	Screen *p[N];
	for (int i=0; i<N; ++i) {
		p[i] = new Screen(i);
	}
	
	//输出前10个pointers，用以比较其间隔
	for (int i=0; i<10; ++i) {
		cout << p[i] << endl;
	}
	//result: 间隔为8，中间没有cookie
		//0x114010
		//0x114018
		//0x114020
		//0x114028
		//0x114030
		//0x114038
		//0x114040
		//0x114048
		//0x114050
		//0x114058

	for (int i=0; i<N; ++i) {
		delete p[i];
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movq 0x479e(%rip), %r14      # 0x6fd0
leaq 0x1892(%rip), %rsi      # 0x40cb
movq %r14, %rdi
callq 0x2170
pushq $0x10
popq %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x20d0
movq %rax, %rdi
callq 0x2090
xorl %r14d, %r14d
cmpq $0x14, %r14
je 0x2879
movq %rbx, %rdi
callq 0x279e
movl %r14d, 0x8(%rax)
movq %rax, -0xb0(%rbp,%r14,8)
incq %r14
jmp 0x285a
xorl %r14d, %r14d
movq 0x474d(%rip), %rbx      # 0x6fd0
cmpq $0xa, %r14
je 0x28a6
movq -0xb0(%rbp,%r14,8), %rsi
movq %rbx, %rdi
callq 0x2100
movq %rax, %rdi
callq 0x2090
incq %r14
jmp 0x2883
xorl %eax, %eax
cmpq $0x14, %rax
je 0x28cc
movq -0xb0(%rbp,%rax,8), %rcx
movq 0x48ab(%rip), %rdx      # 0x7168
movq %rdx, (%rcx)
movq %rcx, 0x48a1(%rip)      # 0x7168
incq %rax
jmp 0x28a8
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/MingYueRuYa[P]cprimeprimecode/memory_manager.cpp
// Function: demo05::AirPlane::operator delete(void*, unsigned long)
void AirPlane::operator delete(void *deadObject, size_t size)
{
	if (NULL == deadObject) { return; }

	if (size != sizeof(AirPlane)) {
		::operator delete(deadObject);
		return;
	}

	//插入headOfFreeList之前，回收内存
	AirPlane *plane = static_cast<AirPlane *>(deadObject);
	plane->next = headOfFreeList;
	headOfFreeList = plane;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x2950
cmpq $0x10, %rsi
jne 0x2952
movq 0x482a(%rip), %rax      # 0x7170
movq %rax, (%rdi)
movq %rdi, 0x4820(%rip)      # 0x7170
popq %rbp
retq
popq %rbp
jmp 0x2150
// File: /workspace/github_cpp_makefile_star2_O2/MingYueRuYa[P]cprimeprimecode/memory_manager.cpp
// Function: demo05::test_per_class_allocator_2()
void test_per_class_allocator_2()
{
	cout << "\ntest_per_class_allocator_2\n";

	cout << sizeof(AirPlane) << endl;	//8

	size_t const N = 100;
	AirPlane *p[N];

	for (size_t i=0; i<N; ++i) {
		p[i] = new AirPlane();
	}

	//随机测试object是否正常
	p[1]->set(100, 'A');
	p[5]->set(10000, 'B');
	p[9]->set(1000000, 'C');

	cout << p[1] << ' ' << p[1]->getType() << ' ' << p[1]->getMiles() << endl;
	cout << p[5] << ' ' << p[5]->getType() << ' ' << p[5]->getMiles() << endl;
	cout << p[9] << ' ' << p[9]->getType() << ' ' << p[9]->getMiles() << endl;
	//result:
		//	0x85dc010 A 100
		//	0x85dc030 B 10000
		//	0x85dc050 C 1000000

	//输出前10个pointers，用以比较其间隔
	for (size_t i=0; i<10; ++i) {
		cout << p[i] << endl;
	}
	//result:	间隔为8，中间没有cookie
		//	0x85dc008
		//	0x85dc010
		//	0x85dc018
		//	0x85dc020
		//	0x85dc028
		//	0x85dc030
		//	0x85dc038
		//	0x85dc040
		//	0x85dc048
		//	0x85dc050

	for (size_t i=0; i<N; ++i) {
		delete p[i];
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x328, %rsp            # imm = 0x328
movq 0x465d(%rip), %r14      # 0x6fd0
leaq 0x1781(%rip), %rsi      # 0x40fb
movq %r14, %rdi
callq 0x2170
pushq $0x10
popq %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x20d0
movq %rax, %rdi
callq 0x2090
xorl %r14d, %r14d
cmpq $0x64, %r14
je 0x29bc
movq %rbx, %rdi
callq 0x28d8
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rax, -0x350(%rbp,%r14,8)
incq %r14
jmp 0x299b
movq -0x348(%rbp), %r13
movq $0x64, (%r13)
movb $0x41, 0x8(%r13)
movq -0x328(%rbp), %r12
movq $0x2710, (%r12)         # imm = 0x2710
movb $0x42, 0x8(%r12)
movq -0x308(%rbp), %r14
movq $0xf4240, (%r14)        # imm = 0xF4240
movb $0x43, 0x8(%r14)
movq 0x45d1(%rip), %rbx      # 0x6fd0
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2100
pushq $0x20
popq %r15
movq %rax, %rdi
movl %r15d, %esi
callq 0x21a0
movsbl 0x8(%r13), %esi
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
movl %r15d, %esi
callq 0x21a0
movq (%r13), %rsi
movq %rax, %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x2090
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2100
movq %rax, %rdi
movl %r15d, %esi
callq 0x21a0
movsbl 0x8(%r12), %esi
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
movl %r15d, %esi
callq 0x21a0
movq (%r12), %rsi
movq %rax, %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x2090
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2100
movq %rax, %rdi
movl %r15d, %esi
callq 0x21a0
movsbl 0x8(%r14), %esi
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
movl %r15d, %esi
callq 0x21a0
movq (%r14), %rsi
movq %rax, %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x2090
xorl %r14d, %r14d
cmpq $0xa, %r14
je 0x2aef
movq -0x350(%rbp,%r14,8), %rsi
movq %rbx, %rdi
callq 0x2100
movq %rax, %rdi
callq 0x2090
incq %r14
jmp 0x2acc
xorl %eax, %eax
cmpq $0x64, %rax
je 0x2b1a
movq -0x350(%rbp,%rax,8), %rcx
testq %rcx, %rcx
je 0x2b15
movq 0x4665(%rip), %rdx      # 0x7170
movq %rdx, (%rcx)
movq %rcx, 0x465b(%rip)      # 0x7170
incq %rax
jmp 0x2af1
addq $0x328, %rsp            # imm = 0x328
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/MingYueRuYa[P]cprimeprimecode/memory_manager.cpp
// Function: demo06::test_overload_operator_new_and_array_new()
void test_overload_operator_new_and_array_new()
{
	cout << "\ntest_overload_operator_new_and_array_new().......\n";

	cout << "sizeof(Foo)= " << sizeof(Foo) << endl;
	{
		Foo *p = new Foo(7);
		delete p;


		Foo *pArray = new Foo[5];	//无法给array elements 以initializer
		delete []pArray;
	}

	{
		cout << "testing global expression ::new and ::new[] \n";
		//这回绕过overload new(), delete(), new[](), delete[]();
		//当然ctor，dtor都会被正常调用
		Foo *p = ::new Foo(7);
		::delete p;

		Foo *pArray = ::new Foo[5];
		::delete [] pArray;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x4307(%rip), %rbx      # 0x6fd0
leaq 0x14cb(%rip), %rsi      # 0x419b
movq %rbx, %rdi
callq 0x2170
leaq 0x14f0(%rip), %rsi      # 0x41cf
movq %rbx, %rdi
callq 0x2170
pushq $0x30
popq %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x20d0
movq %rax, %rdi
callq 0x2090
movq %rbx, %rdi
callq 0x2b2c
movq %rax, %r14
pushq $0x7
popq %rsi
movq %rax, %rdi
callq 0x349e
movq %r14, %rdi
callq 0x3518
pushq $0x30
popq %rsi
movq %r14, %rdi
callq 0x2b86
movl $0xf8, %edi
callq 0x2bf2
movq %rax, %r14
movq $0x5, (%rax)
leaq 0x8(%rax), %rbx
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x357a
addq $-0x30, %r15
addq $0x30, %rbx
cmpq $-0xf0, %r15
jne 0x2d41
movq (%r14), %rax
imulq $0x30, %rax, %r15
leaq 0x8(%r15), %rbx
testq %rax, %rax
je 0x2d80
movq %r14, %r12
addq $-0x28, %r12
leaq (%r12,%r15), %rdi
callq 0x3518
addq $-0x30, %r15
jne 0x2d71
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2c4c
movq 0x423e(%rip), %rdi      # 0x6fd0
leaq 0x1444(%rip), %rsi      # 0x41dd
callq 0x2170
pushq $0x30
popq %rdi
callq 0x2180
movq %rax, %r14
pushq $0x7
popq %rsi
movq %rax, %rdi
callq 0x349e
movq %r14, %rdi
callq 0x3518
pushq $0x30
popq %rsi
movq %r14, %rdi
callq 0x2190
movl $0xf8, %edi
callq 0x2030
movq %rax, %r14
movq $0x5, (%rax)
leaq 0x8(%rax), %rbx
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x357a
addq $-0x30, %r15
addq $0x30, %rbx
cmpq $-0xf0, %r15
jne 0x2de2
movq (%r14), %rax
imulq $0x30, %rax, %r15
leaq 0x8(%r15), %rbx
testq %rax, %rax
je 0x2e21
movq %r14, %r12
addq $-0x28, %r12
leaq (%r12,%r15), %rdi
callq 0x3518
addq $-0x30, %r15
jne 0x2e12
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2270
movq %rax, %rbx
pushq $0x30
popq %rsi
movq %r14, %rdi
callq 0x2190
jmp 0x2eb2
movq %rax, %rbx
pushq $0x30
popq %rsi
movq %r14, %rdi
callq 0x2b86
jmp 0x2eb2
movq %rax, %rbx
testq %r15, %r15
je 0x2e75
negq %r15
movq %r14, %r12
addq $-0x28, %r12
leaq (%r12,%r15), %rdi
callq 0x3518
addq $-0x30, %r15
jne 0x2e66
movl $0xf8, %esi
movq %r14, %rdi
callq 0x2270
jmp 0x2eb2
movq %rax, %rbx
testq %r15, %r15
je 0x2ea5
negq %r15
movq %r14, %r12
addq $-0x28, %r12
leaq (%r12,%r15), %rdi
callq 0x3518
addq $-0x30, %r15
jne 0x2e96
movl $0xf8, %esi
movq %r14, %rdi
callq 0x2c4c
movq %rbx, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O2/MingYueRuYa[P]cprimeprimecode/memory_manager.cpp
// Function: global_new_delete::test_global_new_delete()
void test_global_new_delete()
{
	Foo *foo = new Foo();
	delete foo;
	foo = NULL;

	Foo *arrayfoo = new Foo[10];
	delete []arrayfoo;
	arrayfoo = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq $0x1
popq %rdi
callq 0x2180
movq %rax, %rbx
movq %rax, %rdi
callq 0x3866
movq %rbx, %rdi
callq 0x389c
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2190
pushq $0x12
popq %rdi
callq 0x2030
movq %rax, %rbx
movq $0xa, (%rax)
leaq 0x8(%rax), %r14
xorl %r15d, %r15d
movq %r14, %rdi
callq 0x3866
decq %r15
incq %r14
cmpq $-0xa, %r15
jne 0x3136
movq (%rbx), %r14
testq %r14, %r14
je 0x316a
movq %rbx, %r15
addq $0x7, %r15
movq %r14, %r12
leaq (%r15,%r12), %rdi
callq 0x389c
decq %r12
jne 0x315c
addq $0x8, %r14
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2270
movq %rax, %r14
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2190
jmp 0x31bc
movq %rax, %r14
testq %r15, %r15
je 0x31b1
negq %r15
movq %rbx, %r12
addq $0x7, %r12
leaq (%r12,%r15), %rdi
callq 0x389c
decq %r15
jne 0x31a3
pushq $0x12
popq %rsi
movq %rbx, %rdi
callq 0x2270
movq %r14, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O2/MingYueRuYa[P]cprimeprimecode/memory_manager.cpp
// Function: custom_allocator::test_custom_allocator()
void test_custom_allocator()
{
	cout << "Foo size:" << sizeof(Foo) << endl;

	Foo  *fooarray[100];
	for (int i=0; i<13; ++i) {
		fooarray[i] = new Foo();
	}

	cout << "Goo size:" << sizeof(Foo) << endl;
	Goo  *gooarray[100];
	for (int i=0; i<13; ++i) {
		gooarray[i] = new Goo();
	}

	cout << "Hoo size:" << sizeof(Foo) << endl;
	Hoo  *hooarray[100];
	for (int i=0; i<13; ++i) {
		hooarray[i] = new Hoo();
	}

//result:
	//	Foo size:4
	//	address:0x1b17008
	//	address:0x1b1700c
	//	address:0x1b17010
	//	address:0x1b17014
	//	address:0x1b17018
	//	address:0x1b17020
	//	address:0x1b17024
	//	address:0x1b17028
	//	address:0x1b1702c
	//	address:0x1b17030
	//	address:0x1b17038
	//	address:0x1b1703c
	//	address:0x1b17040
	//	Goo size:4
	//	address:0x1b17050
	//	address:0x1b17054
	//	address:0x1b17058
	//	address:0x1b1705c
	//	address:0x1b17060
	//	address:0x1b17068
	//	address:0x1b1706c
	//	address:0x1b17070
	//	address:0x1b17074
	//	address:0x1b17078
	//	address:0x1b17080
	//	address:0x1b17084
	//	address:0x1b17088
	//	Hoo size:4
	//	address:0x1b17098
	//	address:0x1b1709c
	//	address:0x1b170a0
	//	address:0x1b170a4
	//	address:0x1b170a8
	//	address:0x1b170b0
	//	address:0x1b170b4
	//	address:0x1b170b8
	//	address:0x1b170bc
	//	address:0x1b170c0
	//	address:0x1b170c8
	//	address:0x1b170cc
	//	address:0x1b170d0
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x3dfb(%rip), %rdi      # 0x6fd0
leaq 0x10e2(%rip), %rsi      # 0x42be
callq 0x2170
pushq $0x4
popq %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x20d0
movq %rax, %rdi
callq 0x2090
pushq $0xd
popq %r15
subl $0x1, %r15d
jb 0x3216
movq %rbx, %rdi
callq 0x38da
movq %rax, %r14
movq %rax, %rdi
callq 0x38ee
jmp 0x31fb
movq 0x3db3(%rip), %rdi      # 0x6fd0
leaq 0x10a4(%rip), %rsi      # 0x42c8
callq 0x2170
pushq $0x4
popq %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x20d0
movq %rax, %rdi
callq 0x2090
pushq $0xd
popq %r15
subl $0x1, %r15d
jb 0x325e
movq %rbx, %rdi
callq 0x3926
movq %rax, %r14
movq %rax, %rdi
callq 0x393a
jmp 0x3243
movq 0x3d6b(%rip), %rdi      # 0x6fd0
leaq 0x1066(%rip), %rsi      # 0x42d2
callq 0x2170
pushq $0x4
popq %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x20d0
movq %rax, %rdi
callq 0x2090
pushq $0xd
popq %r15
subl $0x1, %r15d
jb 0x32a6
movq %rbx, %rdi
callq 0x3972
movq %rax, %r14
movq %rax, %rdi
callq 0x3986
jmp 0x328b
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x3ee8(%rip), %rcx      # 0x71a0
movq %rcx, (%r14)
movq %r14, 0x3ede(%rip)      # 0x71a0
jmp 0x32e8
movq 0x3ec5(%rip), %rcx      # 0x7190
movq %rcx, (%r14)
movq %r14, 0x3ebb(%rip)      # 0x7190
jmp 0x32e8
movq 0x3ea2(%rip), %rcx      # 0x7180
movq %rcx, (%r14)
movq %r14, 0x3e98(%rip)      # 0x7180
movq %rax, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O2/MingYueRuYa[P]cprimeprimecode/memory_manager.cpp
// Function: ext_pool_allocator::test_pool_alloc()
void test_pool_alloc()
	{
		std::cout << sizeof(__gnu_cxx::__pool_alloc<int>) << std::endl;
		cookie_test(__gnu_cxx::__pool_alloc<double>(), 1);

		std::cout << sizeof(std::allocator<int>) << std::endl;
		cookie_test(std::allocator<double>(), 1);
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq 0x3cce(%rip), %r14      # 0x6fd0
pushq $0x1
popq %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x20d0
movq %rax, %rdi
callq 0x2090
leaq -0x12(%rbp), %rdi
movq %rbx, %rsi
callq 0x39be
movq %r14, %rdi
movq %rbx, %rsi
callq 0x20d0
movq %rax, %rdi
callq 0x2090
leaq -0x11(%rbp), %rdi
movq %rbx, %rsi
callq 0x3aba
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/MingYueRuYa[P]cprimeprimecode/memory_manager.cpp
// Function: void ext_pool_allocator::cookie_test<__gnu_cxx::__pool_alloc<double>>(__gnu_cxx::__pool_alloc<double>, unsigned long)
void cookie_test(Alloc alloc, size_t n)
	{
		typename Alloc::value_type *p1, *p2, *p3;

		p1 = alloc.allocate(n);
		p2 = alloc.allocate(n);
		p3 = alloc.allocate(n);

		std::cout << "p1=" << p1 << "\t" << "p2=" << p2 << "\t" << "p3=" << p3 << "\t" << std::endl;

		alloc.deallocate(p1, sizeof(typename Alloc::value_type));
		alloc.deallocate(p2, sizeof(typename Alloc::value_type));
		alloc.deallocate(p3, sizeof(typename Alloc::value_type));
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r12
movq %rdi, %rbx
xorl %edx, %edx
callq 0x3ca2
movq %rax, %r14
movq %rbx, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x3ca2
movq %rax, %r15
movq %rbx, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x3ca2
movq %rax, %r12
movq 0x35cd(%rip), %rdi      # 0x6fd0
leaq 0xacb(%rip), %rsi       # 0x44d5
callq 0x2170
movq %rax, %rdi
movq %r14, %rsi
callq 0x2100
leaq 0xab8(%rip), %r13       # 0x44d9
movq %rax, %rdi
movq %r13, %rsi
callq 0x2170
leaq 0xaa8(%rip), %rsi       # 0x44db
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
movq %r15, %rsi
callq 0x2100
movq %rax, %rdi
movq %r13, %rsi
callq 0x2170
leaq 0xa87(%rip), %rsi       # 0x44df
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
movq %r12, %rsi
callq 0x2100
movq %rax, %rdi
movq %r13, %rsi
callq 0x2170
movq %rax, %rdi
callq 0x2090
pushq $0x8
popq %r13
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x3de0
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x3de0
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3de0
// File: /workspace/github_cpp_makefile_star2_O2/MingYueRuYa[P]cprimeprimecode/memory_manager.cpp
// Function: custom_allocator::allocator::alloc(unsigned long)
void *alloc(const size_t size)
	{
		object *p = NULL;
		if (NULL == freeHead) {
			p = freeHead = (object *)malloc(chunksize*size);
			for (int i=0; i<chunksize-1; ++i) {
				p->next = (object *)((char *)p+size);
				p = p->next;
			}
			p->next = NULL; //last
		}
		p = freeHead;
		freeHead = freeHead->next;
		return p;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rax
testq %rax, %rax
jne 0x3bf1
movq %rsi, %r14
movslq (%rbx), %r15
movq %r15, %rdi
imulq %rsi, %rdi
callq 0x21e0
cmpl $0x2, %r15d
pushq $0x1
popq %rcx
cmovgel %r15d, %ecx
decl %ecx
movq %rax, %rdx
subl $0x1, %ecx
jb 0x3bed
leaq (%rdx,%r14), %rsi
movq %rsi, (%rdx)
movq %rsi, %rdx
jmp 0x3bdc
andq $0x0, (%rdx)
movq (%rax), %rcx
movq %rcx, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Azer0s[P]littl/bin/../src/tree/base/native.hpp
// Function: littl::Native::Native(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
Native(const std::string& name){
                std::regex str("^.(.*)..$");
                const char* c = name.c_str();
                std::cmatch cm;
                std::regex_match(c,cm,str,std::regex_constants::match_default);
                this->name = cm[1];
            }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rsi, %r14
leaq 0x22a21(%rip), %rax     # 0x2a560
movq %rax, (%rdi)
leaq 0x8(%rdi), %rbx
leaq 0x18(%rdi), %rax
movq %rax, 0x8(%rdi)
andq $0x0, 0x10(%rdi)
movb $0x0, 0x18(%rdi)
leaq 0x143d3(%rip), %rsi     # 0x1bf31
leaq -0x50(%rbp), %rdi
pushq $0x10
popq %rdx
callq 0x863e
movq (%r14), %rdi
xorps %xmm0, %xmm0
leaq -0x30(%rbp), %rsi
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
leaq -0x50(%rbp), %rdx
xorl %ecx, %ecx
callq 0x86a8
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rcx
subq %rsi, %rcx
je 0x7bae
pushq $0x18
popq %rdi
movq %rcx, %rax
cqto
idivq %rdi
addq $-0x5, %rax
cmpq $-0x3, %rax
ja 0x7bae
addq $0x18, %rsi
jmp 0x7bb5
addq %rcx, %rsi
addq $-0x48, %rsi
leaq -0x70(%rbp), %rdi
callq 0x14be4
leaq -0x70(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6390
movq %r14, %rdi
callq 0x6170
leaq -0x30(%rbp), %rdi
callq 0x12e8e
leaq -0x50(%rbp), %rdi
callq 0x86e0
addq $0x60, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x7bf2
movq %rax, %r14
leaq -0x30(%rbp), %rdi
callq 0x12e8e
leaq -0x50(%rbp), %rdi
callq 0x86e0
jmp 0x7c0c
movq %rax, %r14
movq %rbx, %rdi
callq 0x6170
movq %r14, %rdi
callq 0x6530
// File: /workspace/github_cpp_makefile_star2_O2/Azer0s[P]littl/bin/../src/tree/program.hpp
// Function: littl::Program::toCode[abi:cxx11]() const
virtual std::string toCode() const{
                std::string program;
                for(SyntaxTree* node : tree){
                    program += node->toCode();
                }
                return program;
            }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
movq 0x8(%rsi), %r15
movq 0x10(%rsi), %r12
leaq -0x40(%rbp), %r14
cmpq %r12, %r15
je 0x80d0
movq (%r15), %rsi
movq (%rsi), %rax
movq %r14, %rdi
callq *0x10(%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x65c0
movq %r14, %rdi
callq 0x6170
addq $0x8, %r15
jmp 0x80a6
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x80f1
movq %rax, %r14
leaq -0x40(%rbp), %rdi
callq 0x6170
movq %rbx, %rdi
callq 0x6170
movq %r14, %rdi
callq 0x6530
nop
// File: /workspace/github_cpp_makefile_star2_O2/Azer0s[P]littl/bin/../src/tree/base/variable.hpp
// Function: littl::Variable::toCode[abi:cxx11]() const
virtual std::string toCode() const{
                std::string x; 
                if(constant){
                    x = "const ";
                }else{
                    x = "var ";
                }
                x += varname->toCode() + " = " + value->toCode() + ";\n";
                return x;
            }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movq %rsi, %r14
movb $0x0, 0x10(%rdi)
leaq 0x7b64(%rip), %rax      # 0x1c815
leaq 0x7b64(%rip), %rsi      # 0x1c81c
cmpb $0x0, 0x10(%r14)
cmovneq %rax, %rsi
callq 0x65a0
movq 0x8(%r14), %rsi
movq (%rsi), %rax
leaq -0x50(%rbp), %rdi
callq *0x10(%rax)
leaq 0x7b46(%rip), %rdx      # 0x1c821
leaq -0x70(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x8276
movq 0x18(%r14), %rsi
movq (%rsi), %rax
leaq -0x30(%rbp), %rdi
callq *0x10(%rax)
leaq -0x90(%rbp), %rdi
leaq -0x70(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x837b
leaq 0x721d(%rip), %rdx      # 0x1bf2e
leaq -0xb0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x8276
leaq -0xb0(%rbp), %rsi
movq %rbx, %rdi
callq 0x65c0
leaq -0xb0(%rbp), %rdi
callq 0x6170
leaq -0x90(%rbp), %rdi
callq 0x6170
leaq -0x30(%rbp), %rdi
callq 0x6170
leaq -0x70(%rbp), %rdi
callq 0x6170
leaq -0x50(%rbp), %rdi
callq 0x6170
movq %rbx, %rax
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
leaq -0xb0(%rbp), %rdi
callq 0x6170
jmp 0x14d89
movq %rax, %r14
leaq -0x90(%rbp), %rdi
callq 0x6170
jmp 0x14d9a
movq %rax, %r14
leaq -0x30(%rbp), %rdi
callq 0x6170
jmp 0x14da8
movq %rax, %r14
leaq -0x70(%rbp), %rdi
callq 0x6170
jmp 0x14db6
movq %rax, %r14
leaq -0x50(%rbp), %rdi
callq 0x6170
jmp 0x14dc6
jmp 0x14dc3
movq %rax, %r14
movq %rbx, %rdi
callq 0x6170
movq %r14, %rdi
callq 0x6530
// File: /workspace/github_cpp_makefile_star2_O2/Azer0s[P]littl/bin/../src/tree/blocks/function.hpp
// Function: littl::Function::toCode[abi:cxx11]() const
virtual std::string toCode() const{
                std::string fName;

                if(name->toCode().compare("anonymous") == 0){
                    fName = "";
                }else{
                    fName = name->toCode();
                }

                std::string code = "function " + fName + "(" + input->toCode() + "){\n" + block->toCode() + "}\n";
                return code;
            }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movq %rsi, %r14
leaq -0x50(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movq %rdi, %rbx
movb $0x0, (%rax)
movq 0x8(%rsi), %rsi
movq (%rsi), %rax
leaq -0x40(%rbp), %rdi
callq *0x10(%rax)
leaq 0x7802(%rip), %rsi      # 0x1c83d
leaq -0x40(%rbp), %r15
movq %r15, %rdi
callq 0x60d0
movl %eax, %r12d
movq %r15, %rdi
callq 0x6170
testl %r12d, %r12d
je 0x1507b
movq 0x8(%r14), %rsi
movq (%rsi), %rax
leaq -0x40(%rbp), %rdi
callq *0x10(%rax)
leaq -0x60(%rbp), %rdi
movq %r15, %rsi
callq 0x6390
movq %r15, %rdi
callq 0x6170
jmp 0x1508b
leaq 0x6eff(%rip), %rsi      # 0x1bf81
leaq -0x60(%rbp), %rdi
callq 0x65a0
leaq 0x77b5(%rip), %rsi      # 0x1c847
leaq -0xc0(%rbp), %rdi
leaq -0x60(%rbp), %rdx
callq 0x1522b
leaq 0x77ca(%rip), %rdx      # 0x1c873
leaq -0xe0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x8276
movq 0x10(%r14), %rsi
movq (%rsi), %rax
leaq -0xa0(%rbp), %rdi
callq *0x10(%rax)
leaq -0x100(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
leaq -0xa0(%rbp), %rdx
callq 0x837b
leaq 0x7748(%rip), %rdx      # 0x1c836
leaq -0x120(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x8276
movq 0x18(%r14), %rsi
movq (%rsi), %rax
leaq -0x80(%rbp), %rdi
callq *0x10(%rax)
leaq -0x40(%rbp), %rdi
leaq -0x120(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0x837b
leaq 0x7710(%rip), %rdx      # 0x1c83a
leaq -0x40(%rbp), %rsi
movq %rbx, %rdi
callq 0x8276
leaq -0x40(%rbp), %rdi
callq 0x6170
leaq -0x80(%rbp), %rdi
callq 0x6170
leaq -0x120(%rbp), %rdi
callq 0x6170
leaq -0x100(%rbp), %rdi
callq 0x6170
leaq -0xa0(%rbp), %rdi
callq 0x6170
leaq -0xe0(%rbp), %rdi
callq 0x6170
leaq -0xc0(%rbp), %rdi
callq 0x6170
leaq -0x60(%rbp), %rdi
callq 0x6170
movq %rbx, %rax
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x15217
jmp 0x15217
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x6170
jmp 0x151b5
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x6170
jmp 0x151c3
movq %rax, %rbx
leaq -0x120(%rbp), %rdi
callq 0x6170
jmp 0x151d4
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
callq 0x6170
jmp 0x151e5
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x6170
leaq -0xe0(%rbp), %rdi
callq 0x6170
leaq -0xc0(%rbp), %rdi
callq 0x6170
jmp 0x1521a
movq %rax, %rbx
jmp 0x151f1
movq %rax, %rbx
jmp 0x151fd
jmp 0x15217
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x6170
movq %rbx, %rdi
callq 0x6530
// File: /workspace/github_cpp_makefile_star2_O2/Azer0s[P]littl/bin/../src/tree/blocks/ifElseIfElse.hpp
// Function: littl::IfElseIfElse::~IfElseIfElse()
virtual ~IfElseIfElse(){
                delete condition;
                delete block;
                delete elseIfBlock;
                delete elseBlock;
            }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x15194(%rip), %rax     # 0x2a9e0
movq %rax, (%rdi)
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x1585e
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x1586d
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x1587c
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x15891
movq (%rdi), %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmpq *0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Azer0s[P]littl/bin/../src/tree/blocks/countedFor.hpp
// Function: littl::CountedFor::~CountedFor()
virtual ~CountedFor(){
                delete var;
                delete condition;
                delete op;
                delete block;
            }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x14dc2(%rip), %rax     # 0x2aa60
movq %rax, (%rdi)
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x15cb0
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x15cbf
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x15cce
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x15ce3
movq (%rdi), %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmpq *0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq