LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH16_TemplatesAndGenericProgramming/examples/qm.cc
// Function: main
int main() {

	Blob<string> sa1, sa2; // instantiation will appear elsewhere

	// Blob<int> and its initializer_list constructor 
	// are instantiated in this file
	Blob<int> a1 = {0,1,2,3,4,5,6,7,8,9}; 
	Blob<int> a2(a1);  // copy constructor instantiated in this file

	int i = compare(a1[0], a2[0]); // instantiation will appear elsewhere

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x58, %rsp
leaq -0x38(%rbp), %rdi
callq 0x2922
leaq -0x28(%rbp), %rdi
callq 0x2922
movups 0x2cf6(%rip), %xmm0     # 0x5014
leaq -0x60(%rbp), %rsi
movaps %xmm0, 0x10(%rsi)
movups 0x2cd7(%rip), %xmm0     # 0x5004
movaps %xmm0, (%rsi)
movabsq $0x900000008, %rax      # imm = 0x900000008
movq %rax, 0x20(%rsi)
leaq -0x18(%rbp), %rdi
pushq $0xa
popq %rdx
callq 0x23e4
leaq -0x60(%rbp), %rdi
leaq -0x18(%rbp), %rbx
movq %rbx, %rsi
callq 0x2474
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2406
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
callq 0x2406
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2908
leaq -0x58(%rbp), %rdi
callq 0x24c0
leaq -0x10(%rbp), %rdi
callq 0x24c0
leaq -0x20(%rbp), %rdi
callq 0x24c0
leaq -0x30(%rbp), %rdi
callq 0x24c0
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
jmp 0x23c9
movq %rax, %rbx
jmp 0x23d2
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x24c0
leaq -0x10(%rbp), %rdi
callq 0x24c0
leaq -0x20(%rbp), %rdi
callq 0x24c0
leaq -0x30(%rbp), %rdi
callq 0x24c0
movq %rbx, %rdi
callq 0x2180
nop
// File: /workspace/github_cpp_makefile_star2_O2/liujan[P]multi_thread_randomforest/RandomForest.cpp
// Function: RandomForest::buildTree(int)
bool RandomForest::buildTree(int num){
	if (all_samples.empty()){
		cout << "[Error] all sample is empty" << endl;
		return false;
	}

	memset(result, 0, sizeof(result));
	memset(r, 0, sizeof(r));

	for (int i = 0; i < num; i+=numOfThread){
		pthread_t thread[numOfThread];
		M *m = new M[numOfThread];
		//memset(flag, false, sizeof(flag));
		for (int j = 0; j < numOfThread; j++){
			m[j].rf = this;
			m[j].i = j;
			pthread_create(&thread[j], NULL, build, &(m[j]));
		}
		for (int j = 0; j < numOfThread; j++)
			pthread_join(thread[j], NULL);
		
		delete[] m;
	}
	

	for (int i = 0; i < numOfTest; i++){
		for (int j = 0; j < numOfTypes + 1; j++){
			for (int k = 0; k < numOfThread; k++){
				r[i][j] += result[k][i][j];
			}
		}
	}
	
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %esi, -0x2c(%rbp)
movq (%rdi), %rbx
movq 0x8(%rdi), %r14
cmpq %r14, %rbx
je 0x50b6
movq %rdi, %r12
movq %r14, -0x40(%rbp)
movq %rbx, -0x48(%rbp)
leaq 0x5224(%rip), %rdi      # 0xa1d0
xorl %ebx, %ebx
movl $0x148da0, %edx         # imm = 0x148DA0
xorl %esi, %esi
callq 0x2120
leaq 0x30(%r12), %rdi
movl $0x291b4, %edx          # imm = 0x291B4
movq %rdi, -0x38(%rbp)
xorl %esi, %esi
callq 0x2120
leaq -0x1e4(%rip), %r13      # 0x4df2
cmpl -0x2c(%rbp), %ebx
jge 0x5052
movq %rbx, -0x58(%rbp)
movl $0x80, %edi
callq 0x2030
movq %rax, %r14
movq %rax, -0x50(%rbp)
leaq -0xa0(%rbp), %rbx
xorl %r15d, %r15d
cmpq $0x8, %r15
je 0x5024
movq %r12, (%r14)
movl %r15d, 0x8(%r14)
movq %rbx, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r14, %rcx
callq 0x2300
incq %r15
addq $0x8, %rbx
addq $0x10, %r14
jmp 0x4ffa
xorl %ebx, %ebx
cmpq $0x8, %rbx
je 0x5040
movq -0xa0(%rbp,%rbx,8), %rdi
xorl %esi, %esi
callq 0x21c0
incq %rbx
jmp 0x5026
movq -0x50(%rbp), %rdi
callq 0x2250
movq -0x58(%rbp), %rbx
addl $0x8, %ebx
jmp 0x4fd6
xorl %eax, %eax
movq -0x48(%rbp), %rbx
movq -0x40(%rbp), %r14
leaq 0x516d(%rip), %r10      # 0xa1d0
movq -0x38(%rbp), %r11
cmpq $0x617, %rax            # imm = 0x617
je 0x50d1
imulq $0x6c, %rax, %rcx
addq %r11, %rcx
movq %r10, %rdx
xorl %esi, %esi
cmpq $0x1b, %rsi
je 0x50ad
leaq (%rcx,%rsi,4), %rdi
movl (%rdi), %r8d
xorl %r9d, %r9d
cmpq $0x148da0, %r9          # imm = 0x148DA0
je 0x50a4
addl (%rdx,%r9), %r8d
movl %r8d, (%rdi)
addq $0x291b4, %r9           # imm = 0x291B4
jmp 0x508b
incq %rsi
addq $0x4, %rdx
jmp 0x507b
incq %rax
addq $0x6c, %r10
jmp 0x5067
movq 0x4f1b(%rip), %rdi      # 0x9fd8
leaq 0x107c(%rip), %rsi      # 0x6140
callq 0x21e0
movq %rax, %rdi
callq 0x2100
cmpq %r14, %rbx
setne %al
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/liujan[P]multi_thread_randomforest/RandomForest.cpp
// Function: RandomForest::predict()
void RandomForest::predict(){
	if (this->test_samples.empty()){
		cout << "[Error] test sample is empty" << endl;
		return;
	}
	ofstream out("result.csv");
	if (!out.is_open()){
		cout << "[Error] failed to open file result.csv" << endl;
		return;
	}
	cout << "predicting ..." << endl;
	out << "Id,label" << "\n";

	for (int i = 0; i < numOfTest; i++){
		int max_value = -1000, index = 0;
		for (int j = 1; j < numOfTypes + 1; j++){
			if (r[i][j] > max_value){
				max_value = r[i][j];
				index = j;
			}
		}
		out << i << "," << index << "\n";
	}

	out.close();
	cout << "predicting completed" << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq 0x18(%rdi), %rax
cmpq 0x20(%rdi), %rax
je 0x51ee
movq %rdi, %rbx
leaq 0x1066(%rip), %rsi      # 0x6178
leaq -0x228(%rbp), %rdi
pushq $0x10
popq %rdx
callq 0x2220
leaq -0x1b8(%rbp), %rdi
callq 0x2070
testb %al, %al
je 0x521a
movq 0x4e9c(%rip), %rdi      # 0x9fd8
leaq 0x1040(%rip), %rsi      # 0x6183
callq 0x21e0
movq %rax, %rdi
callq 0x2100
leaq 0x103b(%rip), %rsi      # 0x6192
leaq -0x228(%rbp), %rdi
callq 0x21e0
leaq 0x1031(%rip), %rsi      # 0x619b
movq %rax, %rdi
callq 0x21e0
addq $0x34, %rbx
xorl %r14d, %r14d
leaq 0x101d(%rip), %r12      # 0x619d
leaq 0x1014(%rip), %r13      # 0x619b
cmpq $0x617, %r14            # imm = 0x617
je 0x5223
xorl %eax, %eax
movl $0xfffffc18, %ecx       # imm = 0xFFFFFC18
xorl %r15d, %r15d
cmpq $0x1a, %rax
je 0x51b5
movl (%rbx,%rax,4), %edx
incq %rax
cmpl %ecx, %edx
cmovgl %edx, %ecx
cmovgl %eax, %r15d
jmp 0x519e
leaq -0x228(%rbp), %rdi
movl %r14d, %esi
callq 0x22d0
movq %rax, %rdi
movq %r12, %rsi
callq 0x21e0
movq %rax, %rdi
movl %r15d, %esi
callq 0x22d0
movq %rax, %rdi
movq %r13, %rsi
callq 0x21e0
incq %r14
addq $0x6c, %rbx
jmp 0x5187
movq 0x4de3(%rip), %rdi      # 0x9fd8
leaq 0xf24(%rip), %rsi       # 0x6120
callq 0x21e0
movq %rax, %rdi
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2100
leaq 0xf3b(%rip), %rsi       # 0x615c
jmp 0x5236
leaq -0x228(%rbp), %rdi
callq 0x2270
leaq 0xf69(%rip), %rsi       # 0x619f
movq 0x4d9b(%rip), %rdi      # 0x9fd8
callq 0x21e0
movq %rax, %rdi
callq 0x2100
leaq -0x228(%rbp), %rdi
callq 0x2290
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x526a
movq %rax, %rbx
leaq -0x228(%rbp), %rdi
callq 0x2290
movq %rbx, %rdi
callq 0x22e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/liujan[P]multi_thread_randomforest/main.cpp
// Function: fun()
void fun(){
	ifstream in("train.csv");
	ofstream out("train1.csv");

	string s;
	getline(in, s);
	out << s << endl;
	while (1){
		if (in.eof())
			break;
		getline(in, s);
		double p = rand() * 1.0 / RAND_MAX;
		if (p <= 0.1)
			out << s << endl;
		if (in.peek() == '\n')
			in.get();
	}
	in.close();
	out.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x428, %rsp            # imm = 0x428
leaq 0x825(%rip), %rsi       # 0x61b4
leaq -0x240(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x2310
leaq 0x8b3(%rip), %rsi       # 0x6258
leaq -0x440(%rbp), %rdi
pushq $0x10
popq %rdx
callq 0x2220
leaq -0x28(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x240(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x2050
leaq -0x440(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x21b0
movq %rax, %rdi
callq 0x2100
leaq -0x240(%rbp), %rbx
leaq -0x38(%rbp), %r14
leaq -0x440(%rbp), %r15
movq -0x240(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x2, -0x220(%rbp,%rax)
jne 0x5a67
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2050
callq 0x2090
cvtsi2sd %eax, %xmm0
divsd 0x5d9(%rip), %xmm0      # 0x6008
movsd 0x819(%rip), %xmm1      # 0x6250
ucomisd %xmm0, %xmm1
jb 0x5a50
movq %r15, %rdi
movq %r14, %rsi
callq 0x21b0
movq %rax, %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x20c0
cmpl $0xa, %eax
jne 0x59fe
movq %rbx, %rdi
callq 0x2240
jmp 0x59fe
leaq -0x240(%rbp), %rdi
callq 0x2060
leaq -0x440(%rbp), %rdi
callq 0x2270
leaq -0x38(%rbp), %rdi
callq 0x20f0
leaq -0x440(%rbp), %rdi
callq 0x2290
leaq -0x240(%rbp), %rdi
callq 0x2080
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x5acf
jmp 0x5ab7
jmp 0x5ab7
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x20f0
leaq -0x440(%rbp), %rdi
callq 0x2290
leaq -0x240(%rbp), %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O2/liujan[P]multi_thread_randomforest/main.cpp
// Function: main
int main(int argc,  char * argv[]) {
	// insert code here...
	
	clock_t start, end;
	start = clock();

	RandomForest forest;
	forest.readTrainSample("train.csv");
	forest.readTestSample("test.csv");
	forest.buildTree(120);
	forest.predict();
	end = clock();
	cout << "runint time is " << (end - start) / CLOCKS_PER_SEC << " second" <<  endl;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x29230, %rsp          # imm = 0x29230
callq 0x2150
movq %rax, %rbx
leaq -0x29240(%rbp), %rdi
callq 0x4dcc
leaq 0x6a8(%rip), %rsi       # 0x61b4
leaq -0x58(%rbp), %rdi
leaq -0x11(%rbp), %rdx
callq 0x5c14
leaq -0x29240(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x5282
leaq -0x58(%rbp), %rdi
callq 0x20f0
leaq 0x6d1(%rip), %rsi       # 0x620a
leaq -0x38(%rbp), %rdi
leaq -0x11(%rbp), %rdx
callq 0x5c14
leaq -0x29240(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x54b2
leaq -0x38(%rbp), %rdi
callq 0x20f0
leaq -0x29240(%rbp), %rdi
pushq $0x78
popq %rsi
callq 0x4f76
leaq -0x29240(%rbp), %rdi
callq 0x50e6
callq 0x2150
movq %rax, %r14
movq 0x444f(%rip), %rdi      # 0x9fd8
leaq 0x6d3(%rip), %rsi       # 0x6263
callq 0x21e0
movq %rax, %rdi
subq %rbx, %r14
movl $0xf4240, %ecx          # imm = 0xF4240
movq %r14, %rax
cqto
idivq %rcx
movq %rax, %rsi
callq 0x21d0
leaq 0x6bc(%rip), %rsi       # 0x6273
movq %rax, %rdi
callq 0x21e0
movq %rax, %rdi
callq 0x2100
leaq -0x29240(%rbp), %rdi
callq 0x56d8
xorl %eax, %eax
addq $0x29230, %rsp          # imm = 0x29230
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
jmp 0x5bf3
jmp 0x5bfc
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x20f0
jmp 0x5bff
jmp 0x5bfc
movq %rax, %rbx
leaq -0x29240(%rbp), %rdi
callq 0x56d8
movq %rbx, %rdi
callq 0x22e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/ariannagavioli[P]ALU/AluModule.cpp
// Function: AluModule::AluModule(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
AluModule::AluModule(string name, int priority):module(name, priority) {
	string Alu = "Alu";
	
	//This module is the one which triggers the whole system, so it creates a message in its constructor
	if(getName() == Alu){
		message* myMessage = new message();
		myMessage->valid = 1;
		myMessage->timestamp = getTime();
		strcpy(myMessage->source, getName().c_str());
		strcpy(myMessage->dest, "Fetch");
		myMessage->magic_struct = NULL;
		
		sendWithDelay(myMessage, 10);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movl %edx, %ebp
movq %rdi, %rbx
leaq 0x48(%rsp), %r14
movq %r14, %rdi
callq 0x2160
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x40bc
leaq 0x48(%rsp), %rdi
callq 0x2080
leaq 0x59aa(%rip), %rax      # 0x7d40
movq %rax, (%rbx)
leaq 0x2d5f(%rip), %rsi      # 0x50ff
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x2050
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x4130
leaq 0x8(%rsp), %r14
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x31c3
movl %eax, %ebp
movq %r14, %rdi
callq 0x2080
testb %bpl, %bpl
je 0x2451
pushq $0x30
popq %rdi
callq 0x2140
movq %rax, %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, 0x10(%rax)
movb $0x1, 0x4(%rax)
movq %rbx, %rdi
callq 0x41b2
movl %eax, 0x8(%r14)
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x4130
movq %r14, %rdi
addq $0xc, %rdi
leaq 0x8(%rsp), %r15
movq (%r15), %rsi
callq 0x2110
movq %r15, %rdi
callq 0x2080
movw $0x68, 0x1a(%r14)
movl $0x63746546, 0x16(%r14) # imm = 0x63746546
andq $0x0, 0x20(%r14)
pushq $0xa
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x41b6
leaq 0x28(%rsp), %rdi
callq 0x2080
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x247e
jmp 0x247e
movq %rax, %r14
jmp 0x248b
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0x2080
jmp 0x2493
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x31e6
movq %r14, %rdi
callq 0x21d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/ariannagavioli[P]ALU/AluModule.cpp
// Function: AluModule::onNotify(message*)
void AluModule::onNotify(message* m) {
	//Don't forget to check if the message was for me since we are in a broadcast environment
	if(m->dest == getName()){
		string Alu = "Alu";
		
		
		// cout << "Message " << m->id << ": Sent at " << m->timestamp << ", current timestamp " << getTime() << ". My name is " << getName() << "." << endl;
		
		//Send some test messages
		if(m->timestamp < 50) {
			if(getName() == Alu){
				message* myMessage = new message();
				myMessage->valid = 1;
				myMessage->timestamp = getTime();
				strcpy(myMessage->source, getName().c_str());
				strcpy(myMessage->dest, "Fetch");

				/*** OUR CODE ***/
				operate();

				myMessage->magic_struct = NULL;
				
				sendWithDelay(myMessage, delay);
			}
			else{
				message* myMessage = new message();
				myMessage->valid = 1;
				myMessage->timestamp = getTime();
				strcpy(myMessage->source, getName().c_str());
				strcpy(myMessage->dest, "Alu");
				myMessage->magic_struct = NULL;
				
				sendWithDelay(myMessage, 10);
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x16(%rsi), %r15
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4130
movq %r15, %rdi
movq %r12, %rsi
callq 0x320a
movl %eax, %ebp
movq %r12, %rdi
callq 0x2080
testb %bpl, %bpl
je 0x2616
leaq 0x2c18(%rip), %rsi      # 0x50ff
leaq 0x20(%rsp), %rdi
movq %rsp, %rdx
callq 0x2050
cmpl $0x31, 0x8(%r14)
jg 0x260c
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x4130
movq %rsp, %r14
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x31c3
movl %eax, %ebp
movq %r14, %rdi
callq 0x2080
testb %bpl, %bpl
je 0x25a3
pushq $0x30
popq %rdi
callq 0x2140
movq %rax, %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, 0x10(%rax)
movb $0x1, 0x4(%rax)
movq %rbx, %rdi
callq 0x41b2
movl %eax, 0x8(%r14)
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x4130
movq %r14, %rdi
addq $0xc, %rdi
movq %rsp, %r15
movq (%r15), %rsi
callq 0x2110
movq %r15, %rdi
callq 0x2080
movw $0x68, 0x1a(%r14)
movl $0x63746546, 0x16(%r14) # imm = 0x63746546
movq %rbx, %rdi
callq 0x2640
andq $0x0, 0x20(%r14)
movl 0x64(%rbx), %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x41b6
jmp 0x260c
pushq $0x30
popq %rdi
callq 0x2140
movq %rax, %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, 0x10(%rax)
movb $0x1, 0x4(%rax)
movq %rbx, %rdi
callq 0x41b2
movl %eax, 0x8(%r14)
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x4130
movq %r14, %rdi
addq $0xc, %rdi
movq %rsp, %r15
movq (%r15), %rsi
callq 0x2110
movq %r15, %rdi
callq 0x2080
movl $0x756c41, 0x16(%r14)   # imm = 0x756C41
andq $0x0, 0x20(%r14)
pushq $0xa
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x41b6
leaq 0x20(%rsp), %rdi
callq 0x2080
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x262b
jmp 0x262b
jmp 0x262b
jmp 0x262b
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x21d0
// File: /workspace/github_cpp_makefile_star2_O2/ariannagavioli[P]ALU/ExampleModule.cpp
// Function: ExampleModule::ExampleModule(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
ExampleModule::ExampleModule(string name, int priority):module(name, priority) {
	string Fetch = "Fetch";
	
	//This module is the one which triggers the whole system, so it creates a message in its constructor
	if(getName() == Fetch){
		message* myMessage = new message();
		myMessage->valid = 1;
		myMessage->timestamp = getTime();
		strcpy(myMessage->source, getName().c_str());
		strcpy(myMessage->dest, "Alu");
		myMessage->magic_struct = NULL;
		
		sendWithDelay(myMessage, 10);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movl %edx, %ebp
movq %rdi, %rbx
leaq 0x48(%rsp), %r14
movq %r14, %rdi
callq 0x2160
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x40bc
leaq 0x48(%rsp), %rdi
callq 0x2080
leaq 0x49de(%rip), %rax      # 0x7d98
movq %rax, (%rbx)
leaq 0x1d3f(%rip), %rsi      # 0x5103
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x2050
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x4130
leaq 0x8(%rsp), %r14
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x31c3
movl %eax, %ebp
movq %r14, %rdi
callq 0x2080
testb %bpl, %bpl
je 0x346e
pushq $0x30
popq %rdi
callq 0x2140
movq %rax, %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, 0x10(%rax)
movb $0x1, 0x4(%rax)
movq %rbx, %rdi
callq 0x41b2
movl %eax, 0x8(%r14)
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x4130
movq %r14, %rdi
addq $0xc, %rdi
leaq 0x8(%rsp), %r15
movq (%r15), %rsi
callq 0x2110
movq %r15, %rdi
callq 0x2080
movl $0x756c41, 0x16(%r14)   # imm = 0x756C41
andq $0x0, 0x20(%r14)
pushq $0xa
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x41b6
leaq 0x28(%rsp), %rdi
callq 0x2080
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x349b
jmp 0x349b
movq %rax, %r14
jmp 0x34a8
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0x2080
jmp 0x34b0
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x31e6
movq %r14, %rdi
callq 0x21d0
// File: /workspace/github_cpp_makefile_star2_O2/ariannagavioli[P]ALU/ExampleModule.cpp
// Function: ExampleModule::onNotify(message*)
void ExampleModule::onNotify(message* m) {
	//Don't forget to check if the message was for me since we are in a broadcast environment
	if(m->dest == getName()){
		string Fetch = "Fetch";
		
		// cout << "Message " << m->id << ": Sent at " << m->timestamp << ", current timestamp " << getTime() << ". My name is " << getName() << "." << endl;
		
		//Send some test messages
		if(m->timestamp < 50) {
			if(getName() == Fetch){
				message* myMessage = new message();
				myMessage->valid = 1;
				myMessage->timestamp = getTime();
				strcpy(myMessage->source, getName().c_str());
				strcpy(myMessage->dest, "Alu");
				myMessage->magic_struct = NULL;
				
				sendWithDelay(myMessage, 10);
			}
			else{
				message* myMessage = new message();
				myMessage->valid = 1;
				myMessage->timestamp = getTime();
				strcpy(myMessage->source, getName().c_str());
				strcpy(myMessage->dest, "Fetch");
				myMessage->magic_struct = NULL;
				
				sendWithDelay(myMessage, 10);
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x16(%rsi), %r15
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4130
movq %r15, %rdi
movq %r12, %rsi
callq 0x320a
movl %eax, %ebp
movq %r12, %rdi
callq 0x2080
testb %bpl, %bpl
je 0x362a
leaq 0x1c00(%rip), %rsi      # 0x5103
leaq 0x20(%rsp), %rdi
movq %rsp, %rdx
callq 0x2050
cmpl $0x31, 0x8(%r14)
jg 0x3620
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x4130
movq %rsp, %r14
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x31c3
movl %eax, %ebp
movq %r14, %rdi
callq 0x2080
testb %bpl, %bpl
je 0x35b0
pushq $0x30
popq %rdi
callq 0x2140
movq %rax, %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, 0x10(%rax)
movb $0x1, 0x4(%rax)
movq %rbx, %rdi
callq 0x41b2
movl %eax, 0x8(%r14)
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x4130
movq %r14, %rdi
addq $0xc, %rdi
movq %rsp, %r15
movq (%r15), %rsi
callq 0x2110
movq %r15, %rdi
callq 0x2080
movl $0x756c41, 0x16(%r14)   # imm = 0x756C41
andq $0x0, 0x20(%r14)
pushq $0xa
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x41b6
jmp 0x3620
pushq $0x30
popq %rdi
callq 0x2140
movq %rax, %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, 0x10(%rax)
movb $0x1, 0x4(%rax)
movq %rbx, %rdi
callq 0x41b2
movl %eax, 0x8(%r14)
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x4130
movq %r14, %rdi
addq $0xc, %rdi
movq %rsp, %r15
movq (%r15), %rsi
callq 0x2110
movq %r15, %rdi
callq 0x2080
movw $0x68, 0x1a(%r14)
movl $0x63746546, 0x16(%r14) # imm = 0x63746546
andq $0x0, 0x20(%r14)
pushq $0xa
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x41b6
leaq 0x20(%rsp), %rdi
callq 0x2080
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x363f
jmp 0x363f
jmp 0x363f
jmp 0x363f
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x21d0
// File: /workspace/github_cpp_makefile_star2_O2/ariannagavioli[P]ALU/System.cpp
// Function: System::notify_all(event*)
vector<event*> System::notify_all(event* e) {
	vector<event*> tempEvents;
	vector<event*> newEvents;
	
	//Notify all the modules while the message is valid (A message can become invalid if it was intercepted and digested. E.g.: A message from CPU to MEMORY intercepted by the CACHE)
	for(int i=0; i<modules.size() && e->m != NULL && e->m->valid; i++){
		tempEvents = modules[i]->notify(e);
		while(tempEvents.size() > 0){
			newEvents.push_back(tempEvents.back());//back() because std::vector does not support front pop
			tempEvents.pop_back();
		}
	}
	
	return newEvents;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rsp, %r12
andq $0x0, 0x10(%r12)
xorps %xmm0, %xmm0
andq $0x0, 0x10(%rdi)
movaps %xmm0, (%r12)
movups %xmm0, (%rdi)
xorl %ebp, %ebp
leaq 0x20(%rsp), %r13
movq (%r15), %rax
movq 0x8(%r15), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rbp, %rcx
jbe 0x37a5
movq 0x8(%r14), %rcx
testq %rcx, %rcx
je 0x37a5
cmpb $0x1, 0x4(%rcx)
jne 0x37a5
movq (%rax,%rbp,8), %rsi
movq %r13, %rdi
movq %r14, %rdx
callq 0x4172
movq %r12, %rdi
movq %r13, %rsi
callq 0x3e64
movq %r13, %rdi
callq 0x32ea
movq 0x8(%rsp), %rsi
cmpq (%rsp), %rsi
je 0x37a0
addq $-0x8, %rsi
movq %rbx, %rdi
callq 0x3ca0
movq 0x8(%rsp), %rsi
addq $-0x8, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x377e
incq %rbp
jmp 0x3735
movq %rsp, %rdi
callq 0x32ea
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x37c1
movq %rax, %r14
movq %rbx, %rdi
callq 0x32ea
movq %rsp, %rdi
callq 0x32ea
movq %r14, %rdi
callq 0x21d0
// File: /workspace/github_cpp_makefile_star2_O2/ariannagavioli[P]ALU/System.cpp
// Function: System::run()
void System::run() {
	vector<event*> tempEvents;
	for(int i=0; i<modules.size(); i++){
		tempEvents = modules[i]->initialize();
		while(tempEvents.size() > 0){
			insert(tempEvents.back());//back() because std::vector does not support front pop
			tempEvents.pop_back();
		}
	}
	
	while(!this->queue.empty()){
		tick();
	}
	//If there are no more events, the program terminates
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq %rsp, %r14
andq $0x0, 0x10(%r14)
xorps %xmm0, %xmm0
movaps %xmm0, (%r14)
xorl %r12d, %r12d
leaq 0x20(%rsp), %r15
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r12, %rcx
jbe 0x3867
movq (%rax,%r12,8), %rsi
movq %r15, %rdi
callq 0x4146
movq %r14, %rdi
movq %r15, %rsi
callq 0x3e64
movq %r15, %rdi
callq 0x32ea
movq 0x8(%rsp), %rax
cmpq (%rsp), %rax
je 0x385a
movq -0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x36e4
movq 0x8(%rsp), %rax
addq $-0x8, %rax
movq %rax, 0x8(%rsp)
jmp 0x3838
incq %r12
jmp 0x3801
movq %rbx, %rdi
callq 0x389c
movq 0x18(%rbx), %rax
cmpq 0x20(%rbx), %rax
jne 0x385f
movq %rsp, %rdi
callq 0x32ea
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x3889
jmp 0x3889
movq %rax, %rbx
movq %rsp, %rdi
callq 0x32ea
movq %rbx, %rdi
callq 0x21d0
// File: /workspace/github_cpp_makefile_star2_O2/ariannagavioli[P]ALU/System.cpp
// Function: System::tick()
void System::tick() {
	this->currentTime = this->queue.top()->time;
	//Notify all the modules about the next event and remove it from the queue
	vector<event*> result = notify_all(this->queue.top());
	//Deallocate the message and the event
	delete this->queue.top()->m;
	delete this->queue.top();
	this->queue.pop();
	
	//Schedule all the events generated in this tick
	while (result.size() > 0) {
		this->insert(result.back());//back() because std::vector does not support front pop
		result.pop_back();
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x18(%rdi), %r14
movq 0x18(%rdi), %rax
movq (%rax), %rdx
movl (%rdx), %eax
movl %eax, 0x38(%rdi)
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x36fe
movq 0x18(%rbx), %rax
movq (%rax), %rax
movq 0x8(%rax), %rdi
callq 0x2120
movq 0x18(%rbx), %rax
movq (%rax), %rdi
callq 0x2120
movq %r14, %rdi
callq 0x3cbe
movq 0x8(%rsp), %rax
cmpq (%rsp), %rax
je 0x390c
movq -0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x36e4
movq 0x8(%rsp), %rax
addq $-0x8, %rax
movq %rax, 0x8(%rsp)
jmp 0x38ea
movq %rsp, %rdi
callq 0x32ea
addq $0x18, %rsp
popq %rbx
popq %r14
retq
jmp 0x391e
movq %rax, %rbx
movq %rsp, %rdi
callq 0x32ea
movq %rbx, %rdi
callq 0x21d0
// File: /workspace/github_cpp_makefile_star2_O2/ariannagavioli[P]ALU/module.cpp
// Function: module::module(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
module::module(string name, int priority){//Default priority is 0. Higher the value, higher the priority. Negative values are allowed. Modules with higher priority are notified first.
	_name = name;
	_priority = priority;
	_currentTime = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rdi, %r14
leaq 0x3cb0(%rip), %rax      # 0x7d80
movq %rax, (%rdi)
leaq 0x18(%rdi), %rax
movq %rax, 0x8(%rdi)
andq $0x0, 0x10(%rdi)
leaq 0x8(%rdi), %r15
movb $0x0, 0x18(%rdi)
leaq 0x30(%rdi), %r12
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rdi)
andq $0x0, 0x40(%rdi)
movq %r15, %rdi
callq 0x20b0
movl %ebx, 0x28(%r14)
andl $0x0, 0x2c(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %r12, %rdi
callq 0x32ea
movq %r15, %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x21d0
// File: /workspace/github_cpp_makefile_star2_O2/ariannagavioli[P]ALU/module.cpp
// Function: module::notify(event*)
vector<event*> module::notify(event* e){
	_currentTime = e->time;
	onNotify(e->m);
	vector<event*> result = events;
	events.clear();
	return result;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl (%rdx), %eax
movl %eax, 0x2c(%rsi)
movq 0x8(%rdx), %rsi
movq (%r14), %rax
movq %r14, %rdi
callq *(%rax)
leaq 0x30(%r14), %rsi
movq %rbx, %rdi
callq 0x420e
movq 0x30(%r14), %rax
cmpq %rax, 0x38(%r14)
je 0x41a7
movq %rax, 0x38(%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/ariannagavioli[P]ALU/module.cpp
// Function: module::sendWithDelay(message*, int)
void module::sendWithDelay(message* m, int delay){
	if(delay < 0)
		return;
	
	m->id = ++_messageId;
	event* e = new event();
	e->time = getTime() + delay;
	e->m = m;
	events.push_back(e);
}

// Assembly:
testl %edx, %edx
js 0x420d
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x3f54(%rip), %eax      # 0x8124
incl %eax
movl %eax, 0x3f4c(%rip)      # 0x8124
movl %eax, (%rsi)
pushq $0x10
popq %rdi
callq 0x2140
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
addl 0x2c(%rbx), %ebp
movl %ebp, (%rax)
movq %r14, 0x8(%rax)
addq $0x30, %rbx
movq %rbx, %rdi
callq 0x3ca0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ruippeixotog[P]algo-lib/segment-tree.cpp
// Function: main
int main() {
  int n = 100;
  SegTree<Node, Op> tree(n, arr);

  char code; int st, end, arg;
  cout << "> ";
  while(cin >> code >> st >> end >> arg) {
    switch(code) {
      case 's':
      case 'a':
        tree.update(st, end, Op(code, arg));
        break;
      case 'm':
        cout << tree.query(st, end).minVal << endl;
        break;
      case 'M':
        cout << tree.query(st, end).maxVal << endl;
        break;
      default:
        cout << "Invalid command." << endl;
    }
    cout << "> ";
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
leaq 0x3e4f(%rip), %rdx      # 0x50f0
leaq 0x18(%rsp), %rdi
pushq $0x64
popq %rsi
callq 0x140a
movq 0x3d1b(%rip), %rdi      # 0x4fd0
leaq 0x1d48(%rip), %rsi      # 0x3004
callq 0x10d0
leaq 0xb(%rsp), %r14
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %r12
leaq 0x14(%rsp), %r13
movq 0x3cf4(%rip), %rbp      # 0x4fd0
leaq 0x1d21(%rip), %rbx      # 0x3004
movq 0x3cf6(%rip), %rdi      # 0x4fe0
movq %r14, %rsi
callq 0x10f0
movq %rax, %rdi
movq %r15, %rsi
callq 0x1090
movq %rax, %rdi
movq %r12, %rsi
callq 0x1090
movq %rax, %rdi
movq %r13, %rsi
callq 0x1090
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x13d4
movzbl 0xb(%rsp), %eax
cmpl $0x4d, %eax
je 0x1383
cmpl $0x61, %eax
je 0x133e
cmpl $0x6d, %eax
je 0x135d
cmpl $0x73, %eax
jne 0x13ad
movl 0x10(%rsp), %esi
movl 0xc(%rsp), %edx
movl 0x14(%rsp), %ecx
shlq $0x20, %rcx
orq %rax, %rcx
leaq 0x18(%rsp), %rdi
callq 0x1440
jmp 0x13c4
movl 0x10(%rsp), %esi
movl 0xc(%rsp), %edx
leaq 0x18(%rsp), %rdi
callq 0x145e
movq %rbp, %rdi
movl %eax, %esi
callq 0x1140
movq %rax, %rdi
callq 0x1060
jmp 0x13c4
movl 0x10(%rsp), %esi
movl 0xc(%rsp), %edx
leaq 0x18(%rsp), %rdi
callq 0x145e
shrq $0x20, %rax
movq %rbp, %rdi
movl %eax, %esi
callq 0x1140
movq %rax, %rdi
callq 0x1060
jmp 0x13c4
movq %rbp, %rdi
leaq 0x1c50(%rip), %rsi      # 0x3007
callq 0x10d0
movq %rax, %rdi
callq 0x1060
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x10d0
jmp 0x12e3
leaq 0x18(%rsp), %rdi
callq 0x1472
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x13f5
jmp 0x13f5
jmp 0x13f5
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x1472
movq %rbx, %rdi
callq 0x1150
// File: /workspace/github_cpp_makefile_star2_O2/ruippeixotog[P]algo-lib/segment-tree.cpp
// Function: SegTree<Node, Op>::SegTree(int)
SegTree(int n) {
    size = n;
    tree.resize(4 * n + 1);
    hasPending.resize(4 * n + 1);
    pending.resize(4 * n + 1);
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x8(%rdi), %rbx
andq $0x0, 0x30(%rdi)
leaq 0x20(%rdi), %r14
andl $0x0, 0x38(%rdi)
leaq 0x48(%rdi), %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movups %xmm0, 0x18(%rdi)
andl $0x0, 0x28(%rdi)
movups %xmm0, 0x40(%rdi)
movups %xmm0, 0x50(%rdi)
movl %esi, (%rdi)
leal 0x1(,%rsi,4), %eax
movslq %eax, %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x159a
movq %r14, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x15cc
movq %r15, %rdi
movq %r12, %rsi
callq 0x163a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r12
movq %r15, %rdi
callq 0x14b2
movq %r14, %rdi
callq 0x1496
movq %rbx, %rdi
callq 0x14ea
movq %r12, %rdi
callq 0x1150
// File: /workspace/github_cpp_makefile_star2_O2/ruippeixotog[P]algo-lib/segment-tree.cpp
// Function: SegTree<Node, Op>::build(int*, int, int, int)
void build(int* arr, int node, int st, int end) {
    if (st == end) { tree[node] = Node(st, arr[st]); return; }

    build(arr, left(node), st, (st + end) / 2);
    build(arr, right(node), (st + end) / 2 + 1, end);
    tree[node] = tree[left(node)].join(tree[right(node)]);
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r12
movq %rdi, %r14
cmpl %r8d, %ecx
jne 0x1f86
movslq %ecx, %rax
movl (%r12,%rax,4), %eax
movslq %ebx, %rcx
movq 0x8(%r14), %rdx
movq %rax, %rsi
shlq $0x20, %rsi
orq %rax, %rsi
movq %rsi, (%rdx,%rcx,8)
jmp 0x1fff
movl %r8d, %r15d
leal (%rbx,%rbx), %r8d
movl %r8d, 0x4(%rsp)
leal (%r15,%rcx), %eax
pushq $0x2
popq %rsi
cltd
idivl %esi
movl %eax, %r13d
movq %r14, %rdi
movq %r12, %rsi
movl %r8d, %edx
movl %eax, %r8d
callq 0x1f50
leal 0x1(,%rbx,2), %ebp
incl %r13d
movq %r14, %rdi
movq %r12, %rsi
movl %ebp, %edx
movl %r13d, %ecx
movl %r15d, %r8d
callq 0x1f50
movslq 0x4(%rsp), %rax
movq 0x8(%r14), %rcx
movslq %ebp, %rdx
movl (%rcx,%rax,8), %esi
movl 0x4(%rcx,%rax,8), %eax
movl (%rcx,%rdx,8), %edi
cmpl %esi, %edi
cmovll %edi, %esi
movl 0x4(%rcx,%rdx,8), %edx
cmpl %edx, %eax
cmovgl %eax, %edx
shlq $0x20, %rdx
orq %rdx, %rsi
movslq %ebx, %rax
movq %rsi, (%rcx,%rax,8)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ruippeixotog[P]algo-lib/segment-tree.cpp
// Function: SegTree<Node, Op>::update(int, int, int, int, int, Op)
void update(int node, int st, int end, int i, int j, Op op) {
    if (j < st || i > end) return;
    if (st == end) { op.apply(tree[node], st, end); return; }
    if (st >= i && end <= j) {
      op.apply(tree[node], st, end);
      pending[node] = hasPending[node] ? pending[node].merge(op, st, end) : op;
      hasPending[node] = true;
      return;
    }
    applyPending(node, st, end);
    if(i <= (st + end) / 2) update(left(node), st, (st + end) / 2, i, j, op);
    if(j > (st + end) / 2) update(right(node), (st + end) / 2 + 1, end, i, j, op);
    tree[node] = tree[left(node)].join(tree[right(node)]);
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r14d
cmpl %edx, %r9d
setl %al
cmpl %ecx, %r8d
setg %cl
orb %al, %cl
jne 0x219f
movl %edx, %r12d
movl %esi, %r15d
movq %rdi, %rbx
cmpl %r14d, %edx
jne 0x2061
movslq %r15d, %rsi
shlq $0x3, %rsi
addq 0x8(%rbx), %rsi
leaq 0x50(%rsp), %rdi
movl %r12d, %edx
movl %r12d, %ecx
callq 0x21ae
jmp 0x219f
movl %r9d, %ebp
movl %r8d, %r13d
cmpl %r8d, %r12d
setl %al
cmpl %r9d, %r14d
setg %cl
orb %al, %cl
je 0x2135
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
movl %r15d, %esi
movl %r12d, %edx
movl %r14d, %ecx
callq 0x222c
leal (%r14,%r12), %eax
pushq $0x2
popq %rcx
cltd
idivl %ecx
movl %eax, %ecx
cmpl %r13d, %eax
jl 0x20cb
leal (%r15,%r15), %esi
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %rbx, %rdi
movl %r12d, %edx
movl %ecx, %r12d
movl %r13d, %r8d
movl %ebp, %r9d
callq 0x200e
movl %r12d, %ecx
leal (%r15,%r15), %eax
leal 0x1(,%r15,2), %r12d
cmpl %ebp, %ecx
jge 0x2104
incl %ecx
movl %eax, 0xc(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %rbx, %rdi
movl %r12d, %esi
movl %ecx, %edx
movl %r14d, %ecx
movl %r13d, %r8d
movl %ebp, %r9d
callq 0x200e
movl 0xc(%rsp), %eax
cltq
movq 0x8(%rbx), %rcx
movslq %r12d, %rdx
movl (%rcx,%rax,8), %esi
movl 0x4(%rcx,%rax,8), %eax
movl (%rcx,%rdx,8), %edi
cmpl %esi, %edi
cmovll %edi, %esi
movl 0x4(%rcx,%rdx,8), %edx
cmpl %edx, %eax
cmovgl %eax, %edx
shlq $0x20, %rdx
orq %rdx, %rsi
movslq %r15d, %rax
movq %rsi, (%rcx,%rax,8)
jmp 0x219f
movslq %r15d, %r15
leaq (,%r15,8), %rbp
movq 0x8(%rbx), %rsi
addq %rbp, %rsi
leaq 0x50(%rsp), %rdi
movl %r12d, %edx
movl %r14d, %ecx
callq 0x21ae
leaq 0x20(%rbx), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x21dc
testq %rdx, (%rax)
je 0x2184
addq 0x48(%rbx), %rbp
leaq 0x50(%rsp), %rsi
movq %rbp, %rdi
movl %r12d, %edx
movl %r14d, %ecx
callq 0x21fa
jmp 0x2189
movq 0x50(%rsp), %rax
movq 0x48(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
movq %r13, %rdi
movq %r15, %rsi
callq 0x21dc
orq %rdx, (%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ruippeixotog[P]algo-lib/segment-tree.cpp
// Function: SegTree<Node, Op>::applyPending(int, int, int)
void applyPending(int node, int st, int end) {
    if(hasPending[node]) {
      update(left(node), st, (st + end) / 2, st, end, pending[node]);
      update(right(node), (st + end) / 2 + 1, end, st, end, pending[node]);
      hasPending[node] = false;
    }
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r15d
movl %edx, %r12d
movq %rdi, %r13
leaq 0x20(%rdi), %rbx
movslq %esi, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21dc
testq %rdx, (%rax)
je 0x22c0
leal (%r14,%r14), %esi
leal (%r15,%r12), %eax
pushq $0x2
popq %rcx
cltd
idivl %ecx
movl %eax, %ebp
movq 0x48(%r13), %rax
movq (%rax,%r14,8), %rax
movq %rax, (%rsp)
movq %r13, %rdi
movl %r12d, %edx
movl %ebp, %ecx
movl %r12d, %r8d
movl %r15d, %r9d
callq 0x200e
leal 0x1(,%r14,2), %esi
incl %ebp
movq 0x48(%r13), %rax
movq (%rax,%r14,8), %rax
movq %rax, (%rsp)
movq %r13, %rdi
movl %ebp, %edx
movl %r15d, %ecx
movl %r12d, %r8d
movl %r15d, %r9d
callq 0x200e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21dc
notq %rdx
andq %rdx, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ruippeixotog[P]algo-lib/segment-tree.cpp
// Function: SegTree<Node, Op>::query(int, int, int, int, int)
Node query(int node, int st, int end, int i, int j) {
    if (j < st || i > end) return Node();
    if (st >= i && end <= j) return tree[node];

    applyPending(node, st, end);
    Node p1 = query(left(node), st, (st + end) / 2, i, j);
    Node p2 = query(right(node), (st + end) / 2 + 1, end, i, j);
    return p1.join(p2);
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r14d
cmpl %edx, %r9d
setl %al
cmpl %ecx, %r8d
setg %cl
orb %al, %cl
je 0x2311
movl $0xc4653600, %ecx       # imm = 0xC4653600
movl $0x3b9aca00, %r13d      # imm = 0x3B9ACA00
jmp 0x23c3
movl %r9d, %ebx
movl %r8d, %ebp
movl %edx, %r13d
movl %esi, %r12d
cmpl %r8d, %edx
setl %al
cmpl %r9d, %r14d
setg %cl
orb %al, %cl
je 0x23b1
movq %rdi, 0x8(%rsp)
movl %r12d, %esi
movl %r13d, %edx
movl %r14d, %ecx
callq 0x222c
leal (%r12,%r12), %esi
leal (%r14,%r13), %eax
pushq $0x2
popq %rcx
cltd
idivl %ecx
movl %eax, %r15d
movq 0x8(%rsp), %rdi
movl %r13d, %edx
movl %eax, %ecx
movl %ebp, %r8d
movl %ebx, %r9d
callq 0x22e0
movq %rax, %r13
shrq $0x20, %rax
movq %rax, 0x10(%rsp)
leal 0x1(,%r12,2), %esi
incl %r15d
movq 0x8(%rsp), %rdi
movl %r15d, %edx
movl %r14d, %ecx
movl %ebp, %r8d
movl %ebx, %r9d
callq 0x22e0
movq %rax, %rcx
shrq $0x20, %rcx
cmpl %r13d, %eax
cmovll %eax, %r13d
movq 0x10(%rsp), %rax
cmpl %ecx, %eax
cmovgl %eax, %ecx
jmp 0x23c3
movslq %r12d, %rax
movq 0x8(%rdi), %rcx
movq (%rcx,%rax,8), %r13
movq %r13, %rcx
shrq $0x20, %rcx
shlq $0x20, %rcx
movl %r13d, %eax
orq %rcx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/wichtounet[P]articles/src/threads/part3/timed_mutex.cpp
// Function: work()
void work(){
    std::chrono::milliseconds timeout(100);

    while(true){
        if(mutex.try_lock_for(timeout)){
            std::cout << std::this_thread::get_id() << ": do work with the mutex" << std::endl;

            std::chrono::milliseconds sleepDuration(250);
            std::this_thread::sleep_for(sleepDuration);

            mutex.unlock();

            std::this_thread::sleep_for(sleepDuration);
        } else {
            std::cout << std::this_thread::get_id() << ": do work without mutex" << std::endl;

            std::chrono::milliseconds sleepDuration(100);
            std::this_thread::sleep_for(sleepDuration);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x2d47(%rip), %r15      # 0x3fd8
leaq 0x10(%rsp), %rbx
leaq 0x2e33(%rip), %r14      # 0x40d0
leaq 0x8(%rsp), %r13
leaq 0xd74(%rip), %rbp       # 0x201d
movq $0x64, (%rbx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1478
movl %eax, %r12d
callq 0x10b0
movq %r15, %rdi
movq %rax, %rsi
callq 0x139a
movq %rax, %rdi
testb %r12b, %r12b
je 0x1305
leaq 0xd27(%rip), %rsi       # 0x2004
callq 0x10e0
movq %rax, %rdi
callq 0x1070
movq %r13, %rdi
movq $0xfa, 0x8(%rsp)
callq 0x13af
movq %r14, %rdi
callq 0x1090
jmp 0x131e
movq %rbp, %rsi
callq 0x10e0
movq %rax, %rdi
callq 0x1070
movq $0x64, 0x8(%rsp)
movq %r13, %rdi
callq 0x13af
jmp 0x12b0
// File: /workspace/github_cpp_makefile_star2_O2/wichtounet[P]articles/src/threads/part3/timed_mutex.cpp
// Function: main
int main(){
    std::thread t1(work);
    std::thread t2(work);

    t1.join();
    t2.join();

    return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq -0xb8(%rip), %rbx       # 0x127c
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x1404
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x1404
leaq 0x8(%rsp), %rdi
callq 0x1130
movq %rsp, %rdi
callq 0x1130
movq %rsp, %rdi
callq 0x146a
leaq 0x8(%rsp), %rdi
callq 0x146a
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
movq %rax, %rbx
jmp 0x1388
movq %rsp, %rdi
movq %rax, %rbx
callq 0x146a
leaq 0x8(%rsp), %rdi
callq 0x146a
movq %rbx, %rdi
callq 0x1140
// File: /workspace/github_cpp_makefile_star2_O2/craigbarstow[P]cmd-line-text-editor/text_editor.cc
// Function: Show_Commands()
void Show_Commands() { //display all available commands
 cout << "h                        Show this list" << endl;
 cout << "g <name>                 Get a file" << endl;
 cout << "n                        Toggle line numbering" << endl;
 cout << "q                        Quit without saving file" << endl;
 cout << "x [name]                 Save file and exit" << endl;
 cout << "s [name]                 Save file" << endl;
 cout << "a [N]                    Add lines after line N" << endl;
 cout << "t [M [N]]                Type lines M through N" << endl;
 cout << "d M [N]                  Delete lines M through N" << endl;
 cout << "m M [N] L                Move lines M through N to follow line L" << endl;
 cout << "c M [N] L                Copy lines M through N to follow line L" << endl;
 cout << "f [M [N]] /word/         Type lines M through N containing word" << endl;
 cout << "r [M [N]] /word1/word2/  Replace word1 by word2 on lines M through N" << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x6b9f(%rip), %rbx      # 0x8fc8
leaq 0x3cb4(%rip), %rsi      # 0x60e4
movq %rbx, %rdi
callq 0x2190
movq %rax, %rdi
callq 0x20f0
leaq 0x3cc5(%rip), %rsi      # 0x610c
movq %rbx, %rdi
callq 0x2190
movq %rax, %rdi
callq 0x20f0
leaq 0x3cd2(%rip), %rsi      # 0x6130
movq %rbx, %rdi
callq 0x2190
movq %rax, %rdi
callq 0x20f0
leaq 0x3cea(%rip), %rsi      # 0x615f
movq %rbx, %rdi
callq 0x2190
movq %rax, %rdi
callq 0x20f0
leaq 0x3d05(%rip), %rsi      # 0x6191
movq %rbx, %rdi
callq 0x2190
movq %rax, %rdi
callq 0x20f0
leaq 0x3d1a(%rip), %rsi      # 0x61bd
movq %rbx, %rdi
callq 0x2190
movq %rax, %rdi
callq 0x20f0
leaq 0x3d26(%rip), %rsi      # 0x61e0
movq %rbx, %rdi
callq 0x2190
movq %rax, %rdi
callq 0x20f0
leaq 0x3d3f(%rip), %rsi      # 0x6210
movq %rbx, %rdi
callq 0x2190
movq %rax, %rdi
callq 0x20f0
leaq 0x3d58(%rip), %rsi      # 0x6240
movq %rbx, %rdi
callq 0x2190
movq %rax, %rdi
callq 0x20f0
leaq 0x3d73(%rip), %rsi      # 0x6272
movq %rbx, %rdi
callq 0x2190
movq %rax, %rdi
callq 0x20f0
leaq 0x3d9d(%rip), %rsi      # 0x62b3
movq %rbx, %rdi
callq 0x2190
movq %rax, %rdi
callq 0x20f0
leaq 0x3dc7(%rip), %rsi      # 0x62f4
movq %rbx, %rdi
callq 0x2190
movq %rax, %rdi
callq 0x20f0
leaq 0x3df0(%rip), %rsi      # 0x6334
movq %rbx, %rdi
callq 0x2190
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x20f0
// File: /workspace/github_cpp_makefile_star2_O2/craigbarstow[P]cmd-line-text-editor/text_editor.cc
// Function: get_file(text_ed&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool get_file(text_ed & T, string cl) { //load file to be edited
 string filename;
 string::size_type start,end;
 start = cl.find_first_not_of(' ',1); //find start of filename substring starting after the 'g' command
 if (start == string::npos) { //if string not found return false
   return false;
 }
 end = cl.find(' ',start);
 if ( end == string::npos ) { //if end of filename substring cant be found, set it equal to the end of the string
   end = cl.size();
 }
 filename = cl.substr(start,end-start);
 return T.load_file(filename); //load the file 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x48(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
pushq $0x20
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0x2180
cmpq $-0x1, %rax
je 0x2601
movq %rax, %r15
pushq $0x20
popq %rsi
movq %r14, %rdi
movq %rax, %rdx
callq 0x21d0
cmpq $-0x1, %rax
jne 0x25ac
movq 0x8(%r14), %rax
subq %r15, %rax
leaq -0x78(%rbp), %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rax, %rcx
callq 0x21a0
leaq -0x58(%rbp), %r14
leaq -0x78(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x21c0
movq %r15, %rdi
callq 0x20d0
leaq -0x38(%rbp), %rdi
movq %r14, %rsi
callq 0x21e0
leaq -0x38(%rbp), %rsi
movq %rbx, %rdi
callq 0x518c
movl %eax, %ebx
leaq -0x38(%rbp), %rdi
callq 0x20d0
jmp 0x2603
xorl %ebx, %ebx
leaq -0x58(%rbp), %rdi
callq 0x20d0
movl %ebx, %eax
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x20d0
jmp 0x262c
jmp 0x2629
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x20d0
movq %rbx, %rdi
callq 0x2260
// File: /workspace/github_cpp_makefile_star2_O2/craigbarstow[P]cmd-line-text-editor/text_editor.cc
// Function: main
int main (int argc, char** argv) {
 bool toggle=true;  //initiate with line numbering on
 text_ed T;
 if (argc > 1) {
   if (!T.load_file(argv[1]))
     cerr << "Could not open file \"" << argv[1] << "\"." << endl;
 }
 bool keep_going;
 do {
   keep_going = Do_Command(T,toggle);
 } while (keep_going);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x70, %rsp
movq %rsi, %rbx
movl %edi, %r14d
movb $0x1, -0x11(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x4ef8
cmpl $0x1, %r14d
jle 0x4b0b
movq 0x8(%rbx), %rsi
leaq -0x38(%rbp), %rdi
leaq -0x12(%rbp), %rdx
callq 0x4b56
leaq -0x78(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x518c
movl %eax, %r14d
leaq -0x38(%rbp), %rdi
callq 0x20d0
testb %r14b, %r14b
jne 0x4b0b
movq 0x4514(%rip), %rdi      # 0x8ff0
leaq 0x196f(%rip), %rsi      # 0x6452
callq 0x2190
movq 0x8(%rbx), %rsi
movq %rax, %rdi
callq 0x2190
leaq 0x189e(%rip), %rsi      # 0x6399
movq %rax, %rdi
callq 0x2190
movq %rax, %rdi
callq 0x20f0
leaq -0x78(%rbp), %rdi
leaq -0x11(%rbp), %rsi
callq 0x462f
testb %al, %al
jne 0x4b0b
leaq -0x78(%rbp), %rdi
callq 0x50b2
xorl %eax, %eax
addq $0x70, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x20d0
jmp 0x4b45
jmp 0x4b42
jmp 0x4b42
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x50b2
movq %rbx, %rdi
callq 0x2260
// File: /workspace/github_cpp_makefile_star2_O2/craigbarstow[P]cmd-line-text-editor/document.cc
// Function: text_ed::copy_to_buffer(int, int)
bool text_ed::copy_to_buffer(int start, int end) {  // Copy lines start through end to the buffer.
  int buff_capacity=end-start+1;
  int i,j,k;
  buffer= new string [buff_capacity+1]; 
  for (i=start,j=0; i<=end; i++,j++) { //copy document contents into buffer
    buffer[j]=document[i];
  }
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %rbx
movl %edx, %eax
subl %esi, %eax
leal 0x2(%rax), %ecx
movslq %ecx, %r13
movq %r13, %r12
shlq $0x5, %r12
leaq 0x8(%r12), %rcx
cmpl $-0x2, %eax
pushq $-0x1
popq %rdi
cmovgeq %rcx, %rdi
callq 0x2030
movq %r13, (%rax)
leaq 0x8(%rax), %rcx
testl %r13d, %r13d
je 0x4c92
addq $0x18, %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
addq $0x20, %rax
addq $-0x20, %r12
jne 0x4c7c
movq %rcx, 0x8(%rbx)
movslq %r15d, %r15
movslq %r14d, %r14
movq %r15, %r12
shlq $0x5, %r12
xorl %r13d, %r13d
cmpq %r14, %r15
jg 0x4cc9
movq (%rbx), %rsi
addq %r12, %rsi
addq %r13, %rsi
movq 0x8(%rbx), %rdi
addq %r13, %rdi
callq 0x2110
incq %r15
addq $0x20, %r13
jmp 0x4ca6
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq