LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/t0mm4rx[P]piscine_cpp/day01/ex04/exo04.cpp
// Function: main
int main()
{
	std::string str = "HI THIS IS BRAIN";
	std::string *ptr = &str;
	std::string &ref = str;

	std::cout << "String:    " << str << std::endl;
	std::cout << "Pointer:   " << *ptr << std::endl;
	std::cout << "Reference: " << ref << std::endl;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xde1(%rip), %rsi       # 0x2004
leaq 0xdea(%rip), %rdx       # 0x2014
leaq 0x8(%rsp), %rdi
callq 0x1380
movq 0x2d9d(%rip), %rdi      # 0x3fd8
leaq 0xdd3(%rip), %rsi       # 0x2015
movl $0xb, %edx
callq 0x10a0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x2d7b(%rip), %rdi      # 0x3fd8
callq 0x10a0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1080
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1040
movq 0x2d45(%rip), %rdi      # 0x3fd8
leaq 0xd87(%rip), %rsi       # 0x2021
movl $0xb, %edx
callq 0x10a0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x2d23(%rip), %rdi      # 0x3fd8
callq 0x10a0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1080
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1040
movq 0x2ced(%rip), %rdi      # 0x3fd8
leaq 0xd3b(%rip), %rsi       # 0x202d
movl $0xb, %edx
callq 0x10a0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x2ccb(%rip), %rdi      # 0x3fd8
callq 0x10a0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1080
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1040
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x1353
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x1090
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x1377
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x1090
movq %rbx, %rdi
callq 0x10c0
nop
// File: /workspace/github_cpp_makefile_star2_O1/lns[P]team-tactic-topic-model/./lda.cpp
// Function: LDA<unsigned int, unsigned int, unsigned char>::read_data(char const*)
void read_data(const char * filename)
	{
		FILE * f = fopen(filename,"r");
		if(!f)
			printf("Cannot open %s for reading.\n",filename);
		uint32_t d;
		word_t w;
		player_t p;
		float x,y;
		while(true) {
			if(5>fscanf(f,"%u %u %u %f %f\n",&d,&w,&p,&x,&y))
				return;
			n_word = n_word>w?n_word:(w+1);
			n_player = n_player>p?n_player:(p+1);
			while(dat.size()<=d)
				dat.push_back(vector<Token>());
			dat[d].push_back({w,p,0,x,y});
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x288b(%rip), %rsi      # 0x4234
movq %r15, %rdi
callq 0x1110
movq %rax, %r14
testq %rax, %rax
jne 0x19ca
leaq 0x26fd(%rip), %rdi      # 0x40bd
movq %r15, %rsi
xorl %eax, %eax
callq 0x1040
leaq 0x18(%rsp), %rax
movq %rax, (%rsp)
leaq 0x2700(%rip), %rsi      # 0x40da
leaq 0x14(%rsp), %rdx
leaq 0x10(%rsp), %rcx
leaq 0xc(%rsp), %r8
leaq 0x1c(%rsp), %r9
movq %r14, %rdi
xorl %eax, %eax
callq 0x11b0
cmpl $0x5, %eax
jl 0x1b28
leaq 0x58(%rbx), %r15
movabsq $-0x5555555555555555, %rbp # imm = 0xAAAAAAAAAAAAAAAB
leaq 0x20(%rsp), %r12
leaq 0x1c(%rsp), %r13
movl 0x10(%rsp), %eax
leal 0x1(%rax), %ecx
movl 0x4(%rbx), %edx
cmpl %eax, %edx
cmoval %edx, %ecx
movl 0x8(%rbx), %eax
movl %ecx, 0x4(%rbx)
movl 0xc(%rsp), %ecx
leal 0x1(%rcx), %edx
cmpl %ecx, %eax
cmoval %eax, %edx
movl %edx, 0x8(%rbx)
movq 0x60(%rbx), %rdx
movq 0x58(%rbx), %rax
subq %rax, %rdx
sarq $0x3, %rdx
imulq %rbp, %rdx
movl 0x14(%rsp), %ecx
cmpq %rcx, %rdx
ja 0x1a96
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x240e
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1a8c
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x10f0
movq 0x58(%rbx), %rax
movq 0x60(%rbx), %rdx
jmp 0x1a45
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rdi
movl 0x10(%rsp), %eax
movl %eax, 0x20(%rsp)
movl 0xc(%rsp), %eax
movl %eax, 0x24(%rsp)
movb $0x0, 0x28(%rsp)
movss 0x1c(%rsp), %xmm0
movss %xmm0, 0x2c(%rsp)
movss 0x18(%rsp), %xmm0
movss %xmm0, 0x30(%rsp)
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x1aeb
movl 0x30(%rsp), %eax
movl %eax, 0x10(%rsi)
movups 0x20(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x14, 0x8(%rdi)
jmp 0x1af3
movq %r12, %rdx
callq 0x2626
leaq 0x18(%rsp), %rax
movq %rax, (%rsp)
movq %r14, %rdi
leaq 0x25d4(%rip), %rsi      # 0x40da
leaq 0x14(%rsp), %rdx
leaq 0x10(%rsp), %rcx
leaq 0xc(%rsp), %r8
movq %r13, %r9
xorl %eax, %eax
callq 0x11b0
cmpl $0x5, %eax
jge 0x1a19
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1b51
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x10f0
movq %rbx, %rdi
callq 0x1180
nop
// File: /workspace/github_cpp_makefile_star2_O1/lns[P]team-tactic-topic-model/./lda.cpp
// Function: LDA<unsigned int, unsigned int, unsigned char>::set_K(unsigned char)
void set_K(topic_t K)
	{
		topic.clear();
		topic.resize(K);
		theta.clear();
		for(topic_t k=0;k<K;k++) {
			theta.push_back(vector<uint32_t>());
			theta[k].resize(dat.size());
			topic[k].make(n_word,n_player);
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x70(%rdi), %r15
movq 0x70(%rdi), %r12
movq 0x78(%rdi), %r13
cmpq %r12, %r13
je 0x1b96
movq %r12, %r14
movq %r14, %rdi
callq 0x2394
addq $0x40, %r14
cmpq %r13, %r14
jne 0x1b81
movq %r12, 0x78(%rbx)
movzbl %bpl, %r14d
movq %r15, %rdi
movq %r14, %rsi
callq 0x279c
leaq 0x88(%rbx), %r15
movq 0x88(%rbx), %rsi
movq %r15, %rdi
callq 0x2af2
testb %r14b, %r14b
je 0x1c4e
xorl %r13d, %r13d
movq %rsp, %r12
movabsq $-0x5555555555555555, %rbp # imm = 0xAAAAAAAAAAAAAAAB
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x2b3c
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1c05
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x10f0
leaq (,%r13,2), %rdi
addq %r13, %rdi
shlq $0x3, %rdi
addq 0x88(%rbx), %rdi
movq 0x60(%rbx), %rsi
subq 0x58(%rbx), %rsi
sarq $0x3, %rsi
imulq %rbp, %rsi
callq 0x2808
movq %r13, %rdi
shlq $0x6, %rdi
addq 0x70(%rbx), %rdi
movl 0x4(%rbx), %esi
movl 0x8(%rbx), %edx
callq 0x283a
incq %r13
cmpq %r14, %r13
jne 0x1bd4
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1c76
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x10f0
movq %rbx, %rdi
callq 0x1180
// File: /workspace/github_cpp_makefile_star2_O1/lns[P]team-tactic-topic-model/./lda.cpp
// Function: LDA<unsigned int, unsigned int, unsigned char>::config(Prior const&, unsigned int)
void config(const Prior& p, uint32_t buffer_size)
	{
		prior = p;
		pct_log_a.make(buffer_size,log,prior.alpha);
		pct_log_b.make(buffer_size,log,prior.beta);
		pct_log_Nb.make(buffer_size,log,n_word*prior.beta);
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rdi, %r14
addq $0x10, %rdi
movl $0x9, %ecx
rep  movsq (%rsi), %es:(%rdi)
leaq 0xa0(%r14), %rdi
movsd 0x10(%r14), %xmm0
movq 0x5338(%rip), %r15      # 0x6fe0
movl %edx, %esi
movq %r15, %rdx
callq 0x2ebc
leaq 0xc0(%r14), %rdi
movsd 0x18(%r14), %xmm0
movl %ebx, %esi
movq %r15, %rdx
callq 0x2ebc
leaq 0xe0(%r14), %rdi
movl 0x4(%r14), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x18(%r14), %xmm0
movl %ebx, %esi
movq %r15, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x2ebc
nop
// File: /workspace/github_cpp_makefile_star2_O1/lns[P]team-tactic-topic-model/./lda.cpp
// Function: LDA<unsigned int, unsigned int, unsigned char>::gibbs(bool)
void gibbs(bool first_run=false)
	{
		static vector<uint32_t> x;
		if(x.size()!=dat.size()) {
			x.clear();
			for(uint32_t d=0;d<dat.size();d++)
				x.push_back(d);
		}
		shuffle(&(x[0]),dat.size());
		for(uint32_t d=0;d<dat.size();d++)
			for(uint32_t i=0;i<dat[x[d]].size();i++)
				reassign(x[d],i,first_run);
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movb 0x5418(%rip), %al       # 0x7120
testb %al, %al
je 0x1e7a
movq 0x53f9(%rip), %rcx      # 0x7110
movq 0x53ea(%rip), %rax      # 0x7108
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x2, %rdx
movq 0x60(%rbx), %rsi
subq 0x58(%rbx), %rsi
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %r12 # imm = 0xAAAAAAAAAAAAAAAB
imulq %r12, %rsi
cmpq %rsi, %rdx
je 0x1dbc
cmpq %rax, %rcx
je 0x1d53
movq %rax, 0x53bd(%rip)      # 0x7110
movl $0x0, 0x4(%rsp)
movq 0x60(%rbx), %rax
cmpq 0x58(%rbx), %rax
je 0x1dbc
xorl %eax, %eax
leaq 0x539a(%rip), %r14      # 0x7108
leaq 0x4(%rsp), %r15
movq 0x5396(%rip), %rsi      # 0x7110
cmpq 0x5397(%rip), %rsi      # 0x7118
je 0x1d92
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x5380(%rip)      # 0x7110
jmp 0x1d9d
movq %r14, %rdi
movq %r15, %rdx
callq 0x37cc
movl 0x4(%rsp), %eax
incl %eax
movl %eax, 0x4(%rsp)
movq 0x60(%rbx), %rcx
subq 0x58(%rbx), %rcx
sarq $0x3, %rcx
imulq %r12, %rcx
cmpq %rax, %rcx
ja 0x1d73
movq 0x5345(%rip), %rdi      # 0x7108
movq 0x60(%rbx), %rax
subq 0x58(%rbx), %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %esi # imm = 0xAAAAAAAB
callq 0x2f50
movq 0x60(%rbx), %rax
cmpq 0x58(%rbx), %rax
je 0x1e6b
xorl %r15d, %r15d
movzbl %bpl, %ebp
movabsq $-0x3333333333333333, %r13 # imm = 0xCCCCCCCCCCCCCCCD
movq 0x5308(%rip), %rax      # 0x7108
movl (%rax,%r15,4), %esi
movq 0x58(%rbx), %rax
leaq (%rsi,%rsi,2), %rcx
movq 0x8(%rax,%rcx,8), %rdx
cmpq (%rax,%rcx,8), %rdx
je 0x1e53
xorl %r14d, %r14d
movq %rbx, %rdi
movl %r14d, %edx
movl %ebp, %ecx
callq 0x2faa
movq 0x52da(%rip), %rax      # 0x7108
movl (%rax,%r15,4), %esi
movq 0x58(%rbx), %rax
leaq (%rsi,%rsi,2), %rcx
movq 0x8(%rax,%rcx,8), %rdx
subq (%rax,%rcx,8), %rdx
incl %r14d
sarq $0x2, %rdx
imulq %r13, %rdx
cmpq %r14, %rdx
ja 0x1e1a
movq 0x60(%rbx), %rax
subq 0x58(%rbx), %rax
incl %r15d
sarq $0x3, %rax
imulq %r12, %rax
cmpq %r15, %rax
ja 0x1df9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x11d0
jmp 0x1d10
// File: /workspace/github_cpp_makefile_star2_O1/lns[P]team-tactic-topic-model/./lda.cpp
// Function: Topic::destroy()
void destroy()
	{
		delete[] c;
		delete[] n;
		delete[] x;
		delete[] y;
		delete[] xx;
		delete[] xy;
		delete[] yy;
		memset(this,0,sizeof(*this));
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x23a6
callq 0x1130
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x23b4
callq 0x1130
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x23c2
callq 0x1130
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x23d0
callq 0x1130
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x23de
callq 0x1130
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x23ec
callq 0x1130
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x23fa
callq 0x1130
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/lns[P]team-tactic-topic-model/./lda.cpp
// Function: Topic::make(unsigned int, unsigned int)
void make(uint32_t n_word, uint32_t n_player)
	{
		destroy();
		c_sum = 0;
		c = new uint32_t[n_word]();
		n = new uint32_t[n_player]();
		x = new float[n_player]();
		y = new float[n_player]();
		xx= new float[n_player]();
		xy= new float[n_player]();
		yy= new float[n_player]();
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
callq 0x2394
movl $0x0, (%rbx)
movl %r14d, %r14d
shlq $0x2, %r14
movq %r14, %rdi
callq 0x1030
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x1070
movq %r15, 0x8(%rbx)
movl %ebp, %r14d
shlq $0x2, %r14
movq %r14, %rdi
callq 0x1030
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x1070
movq %r15, 0x10(%rbx)
movq %r14, %rdi
callq 0x1030
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x1070
movq %r15, 0x18(%rbx)
movq %r14, %rdi
callq 0x1030
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x1070
movq %r15, 0x20(%rbx)
movq %r14, %rdi
callq 0x1030
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x1070
movq %r15, 0x28(%rbx)
movq %r14, %rdi
callq 0x1030
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x1070
movq %r15, 0x30(%rbx)
movq %r14, %rdi
callq 0x1030
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x1070
movq %r15, 0x38(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lns[P]team-tactic-topic-model/./pct.cpp
// Function: PCT::make(unsigned int, double (*)(double), double)
void make(uint32_t _len, double (*_func)(double), double _delta)
	{
		len = _len;
		func = _func;
		delta = _delta;
		destroy();
		x = new double[len];
		for(uint32_t i=0;i<len;i++)
			x[i] = i + delta;
		for(uint32_t i=0;i<len;i++)
			x[i] = func(x[i]);
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %esi, (%rdi)
movq %rdx, 0x8(%rdi)
movsd %xmm0, 0x10(%rdi)
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x2ee4
callq 0x1130
movq $0x0, 0x18(%rbx)
movl (%rbx), %r14d
leaq (,%r14,8), %rdi
callq 0x1030
movq %rax, 0x18(%rbx)
testq %r14, %r14
je 0x2f1f
movsd 0x10(%rbx), %xmm0
xorl %ecx, %ecx
movl %ecx, %edx
xorps %xmm1, %xmm1
cvtsi2sd %rdx, %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rax,%rcx,8)
incq %rcx
cmpq %rcx, %r14
jne 0x2f04
cmpl $0x0, (%rbx)
je 0x2f48
xorl %r14d, %r14d
movq 0x18(%rbx), %rax
movsd (%rax,%r14,8), %xmm0
callq *0x8(%rbx)
movq 0x18(%rbx), %rax
movsd %xmm0, (%rax,%r14,8)
incq %r14
movl (%rbx), %eax
cmpq %rax, %r14
jb 0x2f27
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/lns[P]team-tactic-topic-model/./rng.cpp
// Function: void shuffle<unsigned int>(unsigned int*, unsigned int)
void shuffle(T* x, uint32_t len)
{
	for(uint32_t i=0;i<len-1;i++)
	{
		uint32_t j = i+lcg64()%(len-1-i);
		// swap x[i] & x[j]
		T t = x[i];
		x[i] = x[j];
		x[j] = t;
	}
}

// Assembly:
decl %esi
je 0x2fa8
movq 0x41a5(%rip), %rcx      # 0x7100
movl %esi, %esi
movl $0x1, %r8d
xorl %r9d, %r9d
movabsq $-0x42e60443a3f800b, %r10 # imm = 0xFBD19FBBC5C07FF5
imulq %r10, %rcx
incq %rcx
movl %esi, %r11d
movq %rcx, %rax
xorl %edx, %edx
divq %r11
addl %r9d, %edx
movl -0x4(%rdi,%r8,4), %eax
movl (%rdi,%rdx,4), %r11d
movl %r11d, -0x4(%rdi,%r8,4)
movl %eax, (%rdi,%rdx,4)
incq %r9
incq %r8
decq %rsi
jne 0x2f70
movq %rcx, 0x4158(%rip)      # 0x7100
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/wenzhelu[P]RUDP/Listener.cpp
// Function: Listener::getTimeout(int)
void Listener::getTimeout(int ack)
{
    tp end=std::chrono::system_clock::now();
    tp start;
    if(master->startTimes.find(ack)==master->startTimes.end()) {
        return;
    }
    else
    {
        start=master->startTimes.at(ack);
        master->startTimes.erase(master->startTimes.begin(),++master->startTimes.find(ack));
    }
    
    
    this->sRTT=ms((end - start).count()/1000000);
    int u,phi,delta;
    u=1;
    phi=4;
    delta=2;
    this->eRTT=this->eRTT+std::chrono::milliseconds((this->sRTT.count()-this->eRTT.count())/delta);
    this->deviation=this->deviation+std::chrono::milliseconds(abs(this->sRTT.count()-this->eRTT.count())/delta-this->deviation.count());
    master->TimeOut=u*this->eRTT.count()+phi*this->deviation.count();
    master->RTT=this->eRTT.count();
//    debug_print("Timeout: %u, RTT: %u, sRTT: %u, all in ms\n", master->TimeOut, master->RTT, sRTT.count());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %r15d
movq %rdi, %rbx
callq 0x2060
movq 0x20(%rbx), %rdi
movq 0x30(%rdi), %rdx
leaq 0x28(%rdi), %r8
movq %r8, %rcx
testq %rdx, %rdx
je 0x287f
movq %r8, %rcx
xorl %esi, %esi
cmpl %r15d, 0x20(%rdx)
setb %sil
cmovaeq %rdx, %rcx
movq 0x10(%rdx,%rsi,8), %rdx
testq %rdx, %rdx
jne 0x2867
movq %r8, %rdx
cmpq %r8, %rcx
je 0x2892
cmpl %r15d, 0x20(%rcx)
cmovaq %r8, %rcx
movq %rcx, %rdx
cmpq %r8, %rdx
je 0x2971
movq %rax, -0x30(%rbp)
addq $0x20, %rdi
leaq -0x34(%rbp), %rsi
movl %r15d, (%rsi)
callq 0x2ac2
movq 0x20(%rbx), %r12
movq 0x30(%r12), %rdx
leaq 0x28(%r12), %rdi
movq %rdi, %rcx
testq %rdx, %rdx
je 0x28e0
movq %rdi, %rcx
xorl %esi, %esi
cmpl %r15d, 0x20(%rdx)
setb %sil
cmovaeq %rdx, %rcx
movq 0x10(%rdx,%rsi,8), %rdx
testq %rdx, %rdx
jne 0x28c8
movq (%rax), %r14
movq 0x38(%r12), %r13
addq $0x20, %r12
cmpq %rdi, %rcx
je 0x28f9
cmpl %r15d, 0x20(%rcx)
cmovbeq %rcx, %rdi
callq 0x2160
movq %r12, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x2bac
movq -0x30(%rbp), %rax
subq %r14, %rax
movabsq $0x431bde82d7b634db, %rcx # imm = 0x431BDE82D7B634DB
imulq %rcx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x12, %rdx
addq %rax, %rdx
movq %rdx, 0x10(%rbx)
movq 0x8(%rbx), %rax
movq 0x20(%rbx), %rcx
movq %rdx, %rsi
subq %rax, %rsi
movq %rsi, %rdi
shrq $0x3f, %rdi
addq %rsi, %rdi
sarq %rdi
addq %rax, %rdi
movq %rdi, 0x8(%rbx)
subq %rdi, %rdx
movq %rdx, %rax
negq %rax
cmovsq %rdx, %rax
shrq %rax
movq %rax, 0x18(%rbx)
leal (%rdi,%rax,4), %eax
movl %eax, 0x18(%rcx)
movl %edi, 0x14(%rcx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/wenzhelu[P]RUDP/Listener.cpp
// Function: Listener::update(unsigned int)
void Listener::update(unsigned int ack)
{
    if(master->status==statusEnum::SLOW_START)
    {
        //        master->slowStartNum++;
        if(ack==master->sendBase)
        {
            this->duplicateACK+=1;
            if(this->duplicateACK==3)
                this->fastRecovery();
        }
        else
        {
            this->index(ack);
            if(master->cWnd>=master->throughput)
                master->status=statusEnum::CONG_AVOID;
        }
    }
    else if(master->status==statusEnum::FAST_REC)
    {
        if(ack==master->sendBase)
            ;
        else
        {
            
            master->status=statusEnum::CONG_AVOID;
            this->linear(ack);
        }
        
    }
    else
    {
        //        master->congestNum++;
        if(ack==master->sendBase)
        {
            this->duplicateACK+=1;
            if(this->duplicateACK==3)
                this->fastRecovery();
        }
        else
        {
            this->linear(ack);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x20(%rdi), %rcx
movl (%rcx), %eax
movl 0xc(%rcx), %edx
cmpl $0x1, %edx
je 0x29c1
testl %edx, %edx
jne 0x29d0
movl %esi, %edx
subl %eax, %edx
je 0x29d6
addl 0x10(%rcx), %edx
movl 0x4(%rcx), %eax
cmpl %eax, %edx
cmovael %eax, %edx
movl %edx, 0x10(%rcx)
movl %esi, (%rcx)
movq 0x20(%rdi), %rax
movl 0x10(%rax), %ecx
cmpl 0x8(%rax), %ecx
jb 0x2a35
movl $0x2, 0xc(%rax)
jmp 0x2a35
movl %esi, %edx
subl %eax, %edx
je 0x2a35
movl $0x2, 0xc(%rcx)
jmp 0x2a06
movl %esi, %edx
subl %eax, %edx
jne 0x2a06
movl (%rdi), %eax
incl %eax
movl %eax, (%rdi)
cmpl $0x3, %eax
jne 0x2a35
movl $0x0, (%rdi)
movl 0x10(%rcx), %eax
shrl %eax
movl %eax, 0x8(%rcx)
movl %eax, 0x10(%rcx)
movl $0x1, 0xc(%rcx)
movq 0x610(%rcx), %rax
movb $0x1, 0x39(%rax)
jmp 0x2a35
addl 0x4(%rdi), %edx
movl %edx, 0x4(%rdi)
imull $0x5b4, %edx, %eax      # imm = 0x5B4
movl 0x4(%rcx), %r8d
movl 0x10(%rcx), %r9d
xorl %edx, %edx
divl %r9d
addl %r9d, %eax
cmpl %r8d, %eax
cmovael %r8d, %eax
movl %eax, 0x10(%rcx)
movl $0x0, 0x4(%rdi)
movl %esi, (%rcx)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/wenzhelu[P]RUDP/Listener.cpp
// Function: Listener::fastRecovery()
void Listener::fastRecovery()
{
    this->duplicateACK=0;
    master->throughput=master->cWnd/2;
    master->cWnd=master->throughput;
    master->status=statusEnum::FAST_REC;
    master->sender->resend = true;
    debug_print("Duplicate ACK happens\n", nullptr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x0, (%rdi)
movq 0x20(%rdi), %rax
movl 0x10(%rax), %ecx
shrl %ecx
movl %ecx, 0x8(%rax)
movl %ecx, 0x10(%rax)
movl $0x1, 0xc(%rax)
movq 0x610(%rax), %rax
movb $0x1, 0x39(%rax)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/wenzhelu[P]RUDP/Listener.cpp
// Function: Listener::linear(unsigned int)
void Listener::linear(unsigned int ack)
{
    this->ACKcwnd+=(ack-master->sendBase);
    master->cWnd+=(ACKcwnd*master->PACKET_SIZE)/master->cWnd;
    if(master->cWnd>master->winSize)
        master->cWnd=master->winSize;
    this->ACKcwnd=0;
    master->sendBase=ack;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x20(%rdi), %rcx
movl %esi, %eax
subl (%rcx), %eax
addl 0x4(%rdi), %eax
movl %eax, 0x4(%rdi)
imull $0x5b4, %eax, %eax      # imm = 0x5B4
movl 0x4(%rcx), %r8d
movl 0x10(%rcx), %r9d
xorl %edx, %edx
divl %r9d
addl %r9d, %eax
cmpl %r8d, %eax
cmovael %r8d, %eax
movl %eax, 0x10(%rcx)
movl $0x0, 0x4(%rdi)
movl %esi, (%rcx)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/wenzhelu[P]RUDP/RUDP.cpp
// Function: RUDP::init(unsigned int, char const*, char const*, char const*)
void RUDP::init(uint window, const char *port, const char *remoteIp, const char *remotePort) {
    srand(time(nullptr));   // set random seed
    memset(buff, 0, PACKET_SIZE + HEADER_LEN);
    this->sendBase = 0;
    // make the sequence number in the buffer the same with send base
    *(uint *)(this->buff) = this->sendBase;
    this->winSize = window;
    this->status = SLOW_START;
    this->cWnd = PACKET_SIZE;
    this->close = false;
    this->RTT = 500;
    this->TimeOut = 3000;
    this->throughput = 100000000;
    this->congestNum = 0;
    this->slowStartNum = 0;
    
    this->sock = new Usock();
    this->sock->init(port, remoteIp, remotePort);
    this->sender = new Sender(this);
    this->listener = new Listener(this);
    
    th_sender = new thread(&Sender::sending, sender);
    th_listener = new thread(&Listener::recAns, listener);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %r13
movl %esi, %r14d
movq %rdi, %rbx
xorl %edi, %edi
callq 0x21e0
movl %eax, %edi
callq 0x2200
leaq 0x50(%rbx), %rdi
movl $0x0, (%rbx)
movl $0x5c0, %edx            # imm = 0x5C0
xorl %esi, %esi
callq 0x2120
movl %r14d, 0x4(%rbx)
movl $0x5b4, 0x10(%rbx)      # imm = 0x5B4
movb $0x0, 0x620(%rbx)
movabsq $0xbb8000001f4, %rax    # imm = 0xBB8000001F4
movq %rax, 0x14(%rbx)
movq $0x5f5e100, 0x8(%rbx)   # imm = 0x5F5E100
movq $0x0, 0x640(%rbx)
movl $0x24, %edi
callq 0x2220
movq %rax, %r14
movq %rax, %rdi
callq 0x39b8
movq %r14, 0x628(%rbx)
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
callq 0x39be
movl $0x68, %edi
callq 0x2220
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x309c
leaq 0x610(%rbx), %r15
movq %r14, 0x610(%rbx)
movl $0x30, %edi
callq 0x2220
movl $0x0, 0x28(%rax)
xorl %r12d, %r12d
movq %r12, (%rax)
movq %rbx, 0x20(%rax)
movq %rax, 0x618(%rbx)
movl $0x8, %edi
callq 0x2220
movq %rax, %r14
leaq 0x6d4(%rip), %rax       # 0x34a6
leaq -0x38(%rbp), %rsi
movq %rax, (%rsi)
movq %r12, 0x8(%rsi)
movq %r14, %rdi
movq %r15, %rdx
callq 0x2ef6
leaq 0x618(%rbx), %r15
movq %r14, 0x638(%rbx)
movl $0x8, %edi
callq 0x2220
movq %rax, %r14
leaq -0x842(%rip), %rax      # 0x25c8
leaq -0x38(%rbp), %rsi
movq %rax, (%rsi)
movq $0x0, 0x8(%rsi)
movq %r14, %rdi
movq %r15, %rdx
callq 0x2f88
movq %r14, 0x630(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2e40
jmp 0x2e40
jmp 0x2e40
movq %rax, %rbx
movq %r14, %rdi
callq 0x21f0
movq %rbx, %rdi
callq 0x2350
nop
// File: /workspace/github_cpp_makefile_star2_O1/wenzhelu[P]RUDP/RUDP.cpp
// Function: RUDP::shutdown()
void RUDP::shutdown() {
    // stop protocol running
    close = true;
    th_sender->join();
    th_listener->join();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb $0x1, 0x620(%rdi)
movq 0x638(%rdi), %rdi
callq 0x2340
movq 0x630(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2340
// File: /workspace/github_cpp_makefile_star2_O1/wenzhelu[P]RUDP/RUDP.cpp
// Function: RUDP::cleanUp()
void RUDP::cleanUp() {
    // release resources like socket and heap memory
    sock->closeSock();
    delete th_listener;
    delete th_sender;
    delete sender;
    delete listener;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x628(%rdi), %rdi
callq 0x3aac
movq 0x630(%rbx), %rdi
testq %rdi, %rdi
je 0x2eae
cmpq $0x0, (%rdi)
jne 0x2ef0
callq 0x21f0
movq 0x638(%rbx), %rdi
testq %rdi, %rdi
je 0x2ec5
cmpq $0x0, (%rdi)
jne 0x2ef0
callq 0x21f0
movq 0x610(%rbx), %rdi
testq %rdi, %rdi
je 0x2ed6
callq 0x21f0
movq 0x618(%rbx), %rdi
addq $0x8, %rsp
testq %rdi, %rdi
je 0x2eed
popq %rbx
popq %rbp
jmp 0x21f0
popq %rbx
popq %rbp
retq
callq 0x20e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/wenzhelu[P]RUDP/sender.cpp
// Function: Sender::beginTask()
void Sender::beginTask() {
    diff = master->sendBase;
    curPtr = master->sendBase;
    timerBase = master->sendBase;
    sendTime = system_clock::now();
    th_timer = new thread(&Sender::timing, this);
    pending = true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movq 0x48(%rdi), %rax
movl (%rax), %eax
movl %eax, 0x40(%rdi)
movl %eax, 0x3c(%rdi)
movl %eax, 0x58(%rdi)
callq 0x2060
movq %rax, 0x60(%rbx)
movl $0x8, %edi
callq 0x2220
movq %rax, %r14
leaq 0x42(%rip), %rax        # 0x316e
leaq -0x28(%rbp), %rsi
movq %rax, (%rsi)
movq $0x0, 0x8(%rsi)
leaq -0x18(%rbp), %rdx
movq %rbx, (%rdx)
movq %r14, %rdi
callq 0x36b2
movq %r14, 0x50(%rbx)
movb $0x1, 0x38(%rbx)
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x21f0
movq %rbx, %rdi
callq 0x2350
// File: /workspace/github_cpp_makefile_star2_O1/wenzhelu[P]RUDP/sender.cpp
// Function: Sender::timing()
void Sender::timing() {
    // timer loop in this function
    while (pending) {
        tp cur = system_clock::now();
        if (getDurMs(sendTime, cur) >= master->TimeOut) {
            // time to check sendBase
            // aggressive mode:
            // set up a begin send time before sending the file
            // then every send time later on is set by timer.
            // we continuously check timerBase and sendBase every RTT
            // if sendBase larger than sendBase, we have a time out.
            // Why called aggressive mode? we make timer very active and
            // not rely on "send" behavior to avoid stuck in sending.
//            debug_print("timerBase: %u, sendBase: %u\n", timerBase, master->sendBase);
            if (timerBase >= master->sendBase) {
                // data loss timeout!
                master->status = SLOW_START;
                master->throughput = master->cWnd >> 1;
                master->cWnd = RUDP::PACKET_SIZE;
//                debug_print("Timeout! Send base: %u, cWnd: %u, throughput: %u\n", master->sendBase, master->cWnd, master->throughput);
                resend = true;
            } else {
                timerBase = master->sendBase;
                sendTime = cur;
            }
        }
        this_thread::sleep_for(milliseconds(master->TimeOut)); // experimental sleep time
    }
}

// Assembly:
cmpb $0x1, 0x38(%rdi)
jne 0x324c
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movabsq $0x431bde82d7b634db, %r15 # imm = 0x431BDE82D7B634DB
movabsq $0x4189374bc6a7f0, %r12 # imm = 0x4189374BC6A7F0
leaq -0x38(%rbp), %r14
movabsq $0x5b400000000, %r13    # imm = 0x5B400000000
callq 0x2060
movq %rax, %rcx
subq 0x60(%rbx), %rax
imulq %r15
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0x12, %rdx
addl %eax, %edx
movq 0x48(%rbx), %rax
cmpl %edx, 0x18(%rax)
ja 0x31f3
movl (%rax), %edx
cmpl %edx, 0x58(%rbx)
jae 0x31e3
movl %edx, 0x58(%rbx)
movq %rcx, 0x60(%rbx)
jmp 0x31f3
movl 0x10(%rax), %ecx
movq %r13, 0xc(%rax)
shrl %ecx
movl %ecx, 0x8(%rax)
movb $0x1, 0x39(%rbx)
movl 0x18(%rax), %ecx
testq %rcx, %rcx
je 0x3234
movq %rcx, %rax
mulq %r12
imulq $-0x3e8, %rdx, %rax     # imm = 0xFC18
addq %rcx, %rax
imulq $0xf4240, %rax, %rax    # imm = 0xF4240
movq %rdx, -0x38(%rbp)
movq %rax, -0x30(%rbp)
movq %r14, %rdi
movq %r14, %rsi
callq 0x20f0
cmpl $-0x1, %eax
jne 0x3234
callq 0x2050
cmpl $0x4, (%rax)
je 0x321a
cmpb $0x0, 0x38(%rbx)
jne 0x31ae
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/wenzhelu[P]RUDP/sender.cpp
// Function: Sender::endTask()
void Sender::endTask() {
    // all buffer received
    // no data pending to send
    // unlock busy
    pending = false;
    delete [] userBuff;
    userBuff = nullptr;
    userDataLen = 0;
    diff = 0;
    master->startTimes.clear();
    th_timer->join();   // must wait for thread ends before deleting
    delete th_timer;
    // sending finish signal
    master->setDataBit(0);
    master->setFinBit(1);
    master->sock->write(master->buff, RUDP::PACKET_SIZE);
    master->setFinBit(0);
    busy.unlock();
    debug_print("send one file end\n", nullptr);
    debug_print("RTT: %u\n, slow start packets: %u, congestion avoidance packets: %u\n", master->RTT, master->slowStartNum, master->congestNum);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb $0x0, 0x38(%rdi)
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x3268
callq 0x2290
movq $0x0, (%rbx)
xorl %eax, %eax
movl %eax, 0x8(%rbx)
movl %eax, 0x40(%rbx)
movq 0x48(%rbx), %rdi
addq $0x20, %rdi
callq 0x2c2e
movq 0x50(%rbx), %rdi
callq 0x2340
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x32a1
cmpq $0x0, (%rdi)
jne 0x32f0
callq 0x21f0
movq 0x48(%rbx), %rdi
xorl %esi, %esi
callq 0x2c68
movq 0x48(%rbx), %rdi
movl $0x1, %esi
callq 0x2c94
movq 0x48(%rbx), %rsi
movq 0x628(%rsi), %rdi
addq $0x50, %rsi
movl $0x5b4, %edx            # imm = 0x5B4
callq 0x3a92
movq 0x48(%rbx), %rdi
xorl %esi, %esi
callq 0x2c94
addq $0x10, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2180
callq 0x20e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/wenzhelu[P]RUDP/sender.cpp
// Function: Sender::send(char const*)
void Sender::send(const char *file) {
    busy.lock();
    std::fstream fs(file);
    struct stat st;
    stat(file, &st);
    userBuff = new char[st.st_size];
    size_t pt = 0;

    while (fs.good()) {
        fs.read(userBuff + pt, 4096);
        pt += fs.gcount();
    }

    if (!fs.eof())
        std::cout << "read file error" << std::endl;

    userDataLen = st.st_size;
    fs.close();
    
    // after data copying
    beginTask();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x2a0, %rsp            # imm = 0x2A0
movq %rsi, %r14
movq %rdi, %rbx
addq $0x10, %rdi
callq 0x22f0
testl %eax, %eax
jne 0x342d
leaq -0x230(%rbp), %rdi
movq %r14, %rsi
movl $0x18, %edx
callq 0x22b0
leaq -0x2c0(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x21c0
movq 0x30(%r15), %r15
testq %r15, %r15
movq $-0x1, %rdi
cmovnsq %r15, %rdi
callq 0x2030
movq %rax, (%rbx)
movq -0x230(%rbp), %rax
movq -0x18(%rax), %rax
movl -0x210(%rbp,%rax), %eax
testl %eax, %eax
jne 0x33af
xorl %r12d, %r12d
leaq -0x230(%rbp), %r14
movq (%rbx), %rsi
addq %r12, %rsi
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rdi
callq 0x2280
addq -0x228(%rbp), %r12
movq -0x230(%rbp), %rax
movq -0x18(%rax), %rax
movl -0x210(%rbp,%rax), %eax
testl %eax, %eax
je 0x337f
testb $0x2, %al
jne 0x33f9
movq 0x2c1e(%rip), %r14      # 0x5fd8
leaq 0xd39(%rip), %rsi       # 0x40fa
movl $0xf, %edx
movq %r14, %rdi
callq 0x2250
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq 0x2bec(%rip), %rdi      # 0x5fd8
callq 0x2040
movq %rax, %rdi
callq 0x2150
movl %r15d, 0x8(%rbx)
leaq -0x230(%rbp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x30f2
leaq -0x230(%rbp), %rdi
callq 0x20b0
addq $0x2a0, %rsp            # imm = 0x2A0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x2140
jmp 0x3438
jmp 0x3438
movq %rax, %rbx
leaq -0x230(%rbp), %rdi
callq 0x20b0
movq %rbx, %rdi
callq 0x2350
nop
// File: /workspace/github_cpp_makefile_star2_O1/wenzhelu[P]RUDP/sender.cpp
// Function: Sender::send(char const*, unsigned long)
void Sender::send(const char *buffer, size_t len) {
    busy.lock();
    userBuff = new char[len];
    memcpy(userBuff, buffer, len);
    userDataLen = len;
    
    // after data copying
    beginTask();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
addq $0x10, %rdi
callq 0x22f0
testl %eax, %eax
jne 0x349f
movq %rbx, %rdi
callq 0x2030
movq %rax, (%r14)
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x21a0
movl %ebx, 0x8(%r14)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x30f2
movl %eax, %edi
callq 0x2140
// File: /workspace/github_cpp_makefile_star2_O1/wenzhelu[P]RUDP/UDPSock.cpp
// Function: Usock::init(char const*, char const*, char const*)
int Usock::init(const char *localPort, const char *remoteIp, const char *remotePort) {
    
    // init of the usock do three things:
    // 1.setup socket
    // 2.bind socket to certain port
    // 3.initialize remote information
    
    if ((socket_fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
        printf("socket setup error\n");
        return -1;
    }
    
    local.sin_addr.s_addr = INADDR_ANY;
    local.sin_family = AF_INET;
    local.sin_port = htons(atoi(localPort));
    if (bind(socket_fd, (struct sockaddr *) &local, sizeof(local)) < 0) {
        printf("server binding error\n");
        return -1;
    }
    
    remote.sin_addr.s_addr = inet_addr(remoteIp);
    remote.sin_family = AF_INET;
    remote.sin_port = htons(atoi(remotePort));
    
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movl $0x2, %edi
movl $0x2, %esi
movl $0x11, %edx
callq 0x20c0
movl %eax, (%rbx)
testl %eax, %eax
js 0x3a54
movl %eax, %r13d
movq %r14, -0x30(%rbp)
leaq 0x4(%rbx), %r14
movl $0x0, 0x8(%rbx)
movw $0x2, 0x4(%rbx)
movq %r12, %rdi
callq 0x2320
rolw $0x8, %ax
movw %ax, 0x6(%rbx)
movl %r13d, %edi
movq %r14, %rsi
movl $0x10, %edx
callq 0x2090
testl %eax, %eax
js 0x3a5d
movq %r15, %rdi
callq 0x2230
movl %eax, 0x18(%rbx)
movw $0x2, 0x14(%rbx)
movq -0x30(%rbp), %rdi
callq 0x2320
rolw $0x8, %ax
movw %ax, 0x16(%rbx)
xorl %eax, %eax
jmp 0x3a6e
leaq 0x6c5(%rip), %rdi       # 0x4120
jmp 0x3a64
leaq 0x6a7(%rip), %rdi       # 0x410b
callq 0x2310
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/eschwabe[P]interview-practice/src/zeromatrix.cpp
// Function: PropogateZeros(int**, int, int)
void PropogateZeros(int* matrix[], int M, int N) {
    bool* zrows = new bool[M];
    bool* zcols = new bool[N];
    for(int row = 0; row < M; row++) {
        for(int col = 0; col < N; col++) {
            if(matrix[row][col] == 0) {
                zrows[row] = true;
                zcols[col] = true;
            }
        }
    }

    // zero rows
    for(int row = 0; row < M; row++) {
        if(zrows[row]) {
            for(int col = 0; col < N; col++) {
                matrix[row][col] = 0;
            }
        }
    }

    // zero cols
    for(int col = 0; col < N; col++) {
        if(zcols[col]) {
            for(int row = 0; row < M; row++) {
                matrix[row][col] = 0;
            }
        }
    }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movslq %esi, %rdi
movq %rdi, 0x8(%rsp)
callq 0x1030
movq %rax, %r12
movslq %ebx, %rdi
callq 0x1030
movl %ebx, %edi
movq %rax, %r15
movl %ebp, %ebx
movl %edi, %r13d
cmpl $0x0, 0x8(%rsp)
jle 0x1256
xorl %eax, %eax
movb $0x1, %cl
testl %edi, %edi
jle 0x124e
movq (%r14,%rax,8), %rdx
xorl %esi, %esi
cmpl $0x0, (%rdx,%rsi,4)
jne 0x1246
movb %cl, (%r12,%rax)
movb %cl, (%r15,%rsi)
incq %rsi
cmpq %rsi, %r13
jne 0x1238
incq %rax
cmpq %rbx, %rax
jne 0x122e
movl %ebp, 0x10(%rsp)
testl %ebp, %ebp
jle 0x1298
leaq (,%r13,4), %rax
movq %rax, 0x8(%rsp)
xorl %ebp, %ebp
movl %edi, 0x14(%rsp)
testl %edi, %edi
jle 0x1290
cmpb $0x0, (%r12,%rbp)
je 0x1290
movq (%r14,%rbp,8), %rdi
xorl %esi, %esi
movq 0x8(%rsp), %rdx
callq 0x1050
movl 0x14(%rsp), %edi
incq %rbp
cmpq %rbp, %rbx
jne 0x1271
testl %edi, %edi
movl 0x10(%rsp), %esi
jle 0x12ca
xorl %eax, %eax
testl %esi, %esi
jle 0x12c2
cmpb $0x0, (%r15,%rax)
je 0x12c2
xorl %ecx, %ecx
movq (%r14,%rcx,8), %rdx
movl $0x0, (%rdx,%rax,4)
incq %rcx
cmpq %rcx, %rbx
jne 0x12af
incq %rax
cmpq %r13, %rax
jne 0x12a2
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/eschwabe[P]interview-practice/src/zeromatrix.cpp
// Function: PrintMatrix(int**, int, int)
void PrintMatrix(int* matrix[], int M, int N) {
    for(int row = 0; row < M; row++) {
        for(int col = 0; col < N; col++) {
            cout << setw(3) << matrix[row][col] << " ";
        }
        cout << endl;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, 0xc(%rsp)
testl %esi, %esi
jle 0x1384
movq %rdi, %r14
movl %esi, %eax
movq %rax, 0x10(%rsp)
movl 0xc(%rsp), %ebp
xorl %ebx, %ebx
movq 0x2cce(%rip), %r15      # 0x3fd8
leaq 0xcf3(%rip), %r12       # 0x2004
cmpl $0x0, 0xc(%rsp)
jle 0x1353
xorl %r13d, %r13d
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0x3, 0x10(%r15,%rax)
movq (%r14,%rbx,8), %rax
movl (%rax,%r13,4), %esi
movq %r15, %rdi
callq 0x10b0
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x1090
incq %r13
cmpq %r13, %rbp
jne 0x131b
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x1080
movsbl %al, %esi
movq %r15, %rdi
callq 0x1040
movq %rax, %rdi
callq 0x1060
incq %rbx
cmpq 0x10(%rsp), %rbx
jne 0x1311
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/eschwabe[P]interview-practice/src/zeromatrix.cpp
// Function: main
int main()
{
    // allocate matrix
    const int ROWS = 10;
    const int COLS = 7;
    int* matrix[ROWS];
    for(int r = 0; r < ROWS; r++) {
        matrix[r] = new int[COLS];
    }

    // initialize matrix
    for(int r = 0; r < ROWS; r++) {
        for(int c = 0; c < COLS; c++) {
            matrix[r][c] = r+c;
        }
    }
    matrix[ROWS/2][COLS/2+2] = 0;

    // print and set zeros
    PrintMatrix(matrix, ROWS, COLS);
    PropogateZeros(matrix, ROWS, COLS);
    PrintMatrix(matrix, ROWS, COLS);

    return 0;
}

// Assembly:
pushq %rbx
subq $0x50, %rsp
xorl %ebx, %ebx
movl $0x1c, %edi
callq 0x1030
movq %rax, (%rsp,%rbx,8)
incq %rbx
cmpq $0xa, %rbx
jne 0x139a
xorl %eax, %eax
movq (%rsp,%rax,8), %rcx
xorl %edx, %edx
leal (%rax,%rdx), %esi
movl %esi, (%rcx,%rdx,4)
incq %rdx
cmpq $0x7, %rdx
jne 0x13b9
incq %rax
cmpq $0xa, %rax
jne 0x13b3
movq %rsp, %rbx
movq 0x28(%rbx), %rax
movl $0x0, 0x14(%rax)
movq %rbx, %rdi
movl $0xa, %esi
movl $0x7, %edx
callq 0x12d9
movq %rbx, %rdi
movl $0xa, %esi
movl $0x7, %edx
callq 0x11ec
movq %rbx, %rdi
movl $0xa, %esi
movl $0x7, %edx
callq 0x12d9
xorl %eax, %eax
addq $0x50, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/zheng-ji[P]lruCache/example.cpp
// Function: Process(int, int&)
int Process(int32_t iKey, int32_t & iValue) 
{
    static LRUCache<int32_t, int32_t> tCache(100000, 3600);
    if (tCache.GetCache(iKey, iValue) > 0)
        return 1;
    iValue = random(); // δ����cache�����в�ѯ�������õ���������cache
    tCache.UpdateCache(iKey, iValue);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movl %edi, -0x14(%rbp)
movb 0x2d6d(%rip), %al       # 0x51d0
testb %al, %al
je 0x24b2
leaq 0x2cda(%rip), %rdi      # 0x5148
leaq -0x14(%rbp), %rsi
movl $0x1, %r14d
movq %rbx, %rdx
movl $0x1, %ecx
callq 0x274c
testl %eax, %eax
jg 0x24a6
callq 0x2090
movl %eax, (%rbx)
leaq 0x2cb1(%rip), %rdi      # 0x5148
leaq -0x14(%rbp), %rsi
movq %rbx, %rdx
callq 0x28a0
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
callq 0x2250
jmp 0x2467
// File: /workspace/github_cpp_makefile_star2_O1/zheng-ji[P]lruCache/example.cpp
// Function: TestCacheUpdateThread()
void TestCacheUpdateThread() 
{
    int iCnt = 10000;
    int iHit = 0;
    for (auto i = 0; i < iCnt; i++) 
    {
        int32_t iKey = random() % 200000;
        int32_t iValue = 0;
        if (Process(iKey, iValue) > 0) 
        {
            iHit++;
        }
    }
    std::cout << "Process cnt:" << iCnt << " hitcache:" << iHit << std::endl;;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
xorl %ebx, %ebx
movl $0x2710, %r15d          # imm = 0x2710
movabsq $0x29f16b11c6d1e109, %r12 # imm = 0x29F16B11C6D1E109
leaq -0x24(%rbp), %r14
callq 0x2090
movq %rax, %rdi
imulq %r12
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0xf, %rdx
addl %eax, %edx
imull $0x30d40, %edx, %eax    # imm = 0x30D40
subl %eax, %edi
movl $0x0, -0x24(%rbp)
movq %r14, %rsi
callq 0x244c
addl %eax, %ebx
decl %r15d
jne 0x24de
movq 0x2abd(%rip), %r14      # 0x4fd8
leaq 0xae2(%rip), %rsi       # 0x3004
movl $0xc, %edx
movq %r14, %rdi
callq 0x2180
movq %r14, %rdi
movl $0x2710, %esi           # imm = 0x2710
callq 0x2210
movq %rax, %r14
leaq 0xacb(%rip), %rsi       # 0x3011
movl $0xa, %edx
movq %rax, %rdi
callq 0x2180
movq %r14, %rdi
movl %ebx, %esi
callq 0x2210
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/zheng-ji[P]lruCache/example.cpp
// Function: main
int main(int argc, char ** argv) 
{
    struct timeval tStart;
    gettimeofday(&tStart, NULL);

    srand(time(NULL));

    std::thread threads[50];

    for (auto i = 0; i < 50; i++) 
    {
        threads[i] = std::thread(TestCacheUpdateThread);
    }

    for (auto & th : threads) 
    {
        th.join();
    }

    struct timeval tEnd;
    gettimeofday(&tEnd, NULL);
    std::cout << "cost" << 1000*(tEnd.tv_sec-tStart.tv_sec) + (tEnd.tv_usec-tStart.tv_usec)/1000 << " ms" << std::endl;

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
xorl %r15d, %r15d
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
callq 0x21d0
xorl %edi, %edi
callq 0x2120
movl %eax, %edi
callq 0x2150
leaq -0x1d0(%rbp), %rdi
movl $0x190, %edx            # imm = 0x190
xorl %esi, %esi
callq 0x20a0
leaq -0x121(%rip), %rbx      # 0x24b9
leaq -0x28(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2ab4
cmpq $0x0, -0x1d0(%rbp,%r15,8)
jne 0x2716
movq -0x28(%rbp), %rax
movq %rax, -0x1d0(%rbp,%r15,8)
incq %r15
cmpq $0x32, %r15
jne 0x25de
xorl %ebx, %ebx
leaq (%rbx,%rbp), %rdi
addq $-0x1d0, %rdi           # imm = 0xFE30
callq 0x2200
addq $0x8, %rbx
cmpq $0x190, %rbx            # imm = 0x190
jne 0x260f
leaq -0x28(%rbp), %rdi
xorl %esi, %esi
callq 0x21d0
movq 0x299a(%rip), %rdi      # 0x4fd8
leaq 0x9d7(%rip), %rsi       # 0x301c
movl $0x4, %edx
callq 0x2180
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %rax
subq -0x38(%rbp), %rcx
imulq $0x3e8, %rcx, %rcx      # imm = 0x3E8
subq -0x30(%rbp), %rax
movabsq $0x20c49ba5e353f7cf, %rdx # imm = 0x20C49BA5E353F7CF
imulq %rdx
movq %rdx, %rsi
shrq $0x3f, %rsi
sarq $0x7, %rdx
addq %rdx, %rsi
addq %rcx, %rsi
movq 0x294d(%rip), %rdi      # 0x4fd8
callq 0x2140
movq %rax, %rbx
leaq 0x987(%rip), %rsi       # 0x3021
movl $0x3, %edx
movq %rax, %rdi
callq 0x2180
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movl $0x190, %eax            # imm = 0x190
cmpq $0x0, -0x1d8(%rbp,%rax)
jne 0x2716
addq $-0x8, %rax
jne 0x26d3
xorl %eax, %eax
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x26f8
jmp 0x26f8
movl $0x190, %ecx            # imm = 0x190
cmpq $0x0, -0x1d8(%rbp,%rcx)
jne 0x2716
addq $-0x8, %rcx
jne 0x26fd
movq %rax, %rdi
callq 0x2220
callq 0x2050
nop
// File: /workspace/github_cpp_makefile_star2_O1/zheng-ji[P]lruCache/./lrucache.h
// Function: LRUCache<int, int>::GetCache(int const&, int&, bool)
int GetCache(const T & t, Value & value, bool bUpdate = true) 
        {
            std::lock_guard<std::mutex> lck(mt);
            HashMapIter mapIter = m_LRUCache.find(t);

            if (mapIter == m_LRUCache.end())
                return -1;

            mapIter = m_LRUCache.find(t);

            if (mapIter != m_LRUCache.end()) 
            {
                if (m_iTimeLimit > 0) 
                {
                    time_t tNow = time(NULL);
                    if (tNow - mapIter->second.updatetime > m_iTimeLimit) 
                    {
                        return -2;
                    }
                }

                value = mapIter->second.value;

                if (bUpdate) 
                {
                    m_List.erase(mapIter->second.listiter);
                    m_List.push_front(t);
                    mapIter->second.listiter = m_List.begin();
                }

                return m_iCacheSize;
            }

            return -3;
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r12d
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %r14
leaq 0x60(%rdi), %rbx
movq %rbx, %rdi
callq 0x21b0
testl %eax, %eax
jne 0x2884
movq %r13, -0x38(%rbp)
movl %r12d, -0x2c(%rbp)
leaq 0x18(%r14), %r12
movslq (%r15), %rcx
movq %rcx, %rax
xorl %edx, %edx
divq 0x20(%r14)
movq %r12, %rdi
movq %rdx, %rsi
movq %r15, %rdx
callq 0x2bbc
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x286a
cmpq $0x0, (%rax)
je 0x286a
movslq (%r15), %rcx
movq %rcx, %rax
xorl %edx, %edx
divq 0x20(%r14)
movq %r12, %rdi
movq %rdx, %rsi
movq %r15, %rdx
callq 0x2bbc
testq %rax, %rax
je 0x27e0
movq (%rax), %r12
jmp 0x27e3
xorl %r12d, %r12d
testq %r12, %r12
je 0x2864
cmpl $0x0, 0x5c(%r14)
jle 0x280a
xorl %edi, %edi
callq 0x2120
subq 0x20(%r12), %rax
movslq 0x5c(%r14), %rcx
movl $0xfffffffe, %r13d      # imm = 0xFFFFFFFE
cmpq %rcx, %rax
jg 0x286a
movl 0x10(%r12), %eax
movq -0x38(%rbp), %rcx
movl %eax, (%rcx)
cmpb $0x0, -0x2c(%rbp)
je 0x285e
movq 0x18(%r12), %r13
decq 0x10(%r14)
movq %r13, %rdi
callq 0x21e0
movq %r13, %rdi
callq 0x2130
movq (%r14), %r13
movl $0x18, %edi
callq 0x2170
movl (%r15), %ecx
movl %ecx, 0x10(%rax)
movq %rax, %rdi
movq %r13, %rsi
callq 0x2040
incq 0x10(%r14)
movq (%r14), %rax
movq %rax, 0x18(%r12)
movl 0x50(%r14), %r13d
jmp 0x286a
movl $0xfffffffd, %r13d      # imm = 0xFFFFFFFD
movq %rbx, %rdi
callq 0x20e0
movl %r13d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x20c0
jmp 0x288d
movq %rax, %r14
movq %rbx, %rdi
callq 0x20e0
movq %r14, %rdi
callq 0x2220
// File: /workspace/github_cpp_makefile_star2_O1/logicx24[P]RayTracer/raytracer.cpp
// Function: transformNormal(vec3&, Polygon*)
vec3 transformNormal(vec3 &normal, Polygon *poly) {
	vec4 tmpNormal = vec4(normal, 1.0f);
	tmpNormal = tmpNormal * poly->inverseTranspose;
	vec3 retNormal = vec3(tmpNormal);
	return retNormal;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movsd (%rsi), %xmm1
movsd 0x8(%rsi), %xmm2
movsd 0x10(%rsi), %xmm0
movsd 0x190(%rdx), %xmm3
mulsd %xmm2, %xmm3
movsd 0x170(%rdx), %xmm4
mulsd %xmm1, %xmm4
addsd %xmm3, %xmm4
movsd 0x1b0(%rdx), %xmm3
mulsd %xmm0, %xmm3
addsd %xmm4, %xmm3
addsd 0x1d0(%rdx), %xmm3
movsd 0x198(%rdx), %xmm4
mulsd %xmm2, %xmm4
movsd 0x178(%rdx), %xmm5
mulsd %xmm1, %xmm5
addsd %xmm4, %xmm5
movsd 0x1b8(%rdx), %xmm4
mulsd %xmm0, %xmm4
addsd %xmm5, %xmm4
addsd 0x1d8(%rdx), %xmm4
movsd 0x1a0(%rdx), %xmm5
mulsd %xmm2, %xmm5
movsd 0x180(%rdx), %xmm6
mulsd %xmm1, %xmm6
addsd %xmm5, %xmm6
movsd 0x1c0(%rdx), %xmm5
mulsd %xmm0, %xmm5
addsd %xmm6, %xmm5
addsd 0x1e0(%rdx), %xmm5
mulsd 0x1a8(%rdx), %xmm2
mulsd 0x188(%rdx), %xmm1
mulsd 0x1c8(%rdx), %xmm0
addsd %xmm2, %xmm1
addsd %xmm1, %xmm0
addsd 0x1e8(%rdx), %xmm0
movq %rdi, %rax
divsd %xmm0, %xmm3
movsd %xmm3, (%rdi)
divsd %xmm0, %xmm4
movsd %xmm4, 0x8(%rdi)
divsd %xmm0, %xmm5
movsd %xmm5, 0x10(%rdi)
popq %rbp
retq