LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/Marcos30004347[P]JSS-with-VNS/main.cpp
// Function: opt_2(std::vector<unsigned int, std::allocator<unsigned int>>)
solution opt_2(solution s) {
  unsigned i = rand() % s.size();
  unsigned j = rand() % s.size();
  unsigned tmp = s[i];

  s[i] = s[j];
  s[j] = tmp;

  return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2060
cltq
movq 0x8(%rbx), %rcx
subq (%rbx), %rcx
sarq $0x2, %rcx
xorl %edx, %edx
divq %rcx
movq %rdx, %r15
callq 0x2060
cltq
movq (%rbx), %rcx
movq 0x8(%rbx), %rsi
movq %rsi, %rdi
subq %rcx, %rdi
sarq $0x2, %rdi
xorl %edx, %edx
divq %rdi
movl %r15d, %eax
movl (%rcx,%rax,4), %edi
movl %edx, %edx
movl (%rcx,%rdx,4), %r8d
movl %r8d, (%rcx,%rax,4)
movl %edi, (%rcx,%rdx,4)
movq %rcx, (%r14)
movq %rsi, 0x8(%r14)
movq 0x10(%rbx), %rax
movq %rax, 0x10(%r14)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Marcos30004347[P]JSS-with-VNS/main.cpp
// Function: sequential_neighborhood_change_step(std::vector<unsigned int, std::allocator<unsigned int>>&, std::vector<unsigned int, std::allocator<unsigned int>>&, unsigned int&)
void sequential_neighborhood_change_step(solution &s, solution &s_, unsigned &k) {
  if(total_cost(s_) < total_cost(s)) {
    s = s_;
    k = 1;
  } else
    k = k + 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq -0x58(%rbp), %r12
movq %r12, %rdi
callq 0x3e06
movq %r12, %rdi
callq 0x24ed
movl %eax, %r12d
leaq -0x40(%rbp), %rdi
movq %r15, %rsi
callq 0x3e06
leaq -0x40(%rbp), %rdi
callq 0x24ed
movl %eax, %r13d
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x3172
movq -0x30(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x3187
movq -0x48(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
cmpl %r13d, %r12d
jae 0x319e
movq %r15, %rdi
movq %r14, %rsi
callq 0x3e86
movl $0x1, %eax
jmp 0x31a2
movl (%rbx), %eax
incl %eax
movl %eax, (%rbx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x31d0
movq -0x30(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
jmp 0x31d0
movq %rax, %rbx
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x31e5
movq -0x48(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
movq %rbx, %rdi
callq 0x21d0
// File: /workspace/github_cpp_makefile_star2_O1/Marcos30004347[P]JSS-with-VNS/main.cpp
// Function: vnd_best_improvement(std::vector<unsigned int, std::allocator<unsigned int>>&, unsigned int, unsigned int&, unsigned int)
solution vnd_best_improvement(solution &s, unsigned l_max, unsigned& k, unsigned p) {
    unsigned l;
    bool stop;
    solution s_;

    do {
      stop = false;
      l = 1;
      s_ = s;
      do {
        solution s__ = argmin(s, k, p);
        sequential_neighborhood_change_step(s, s__, l);
      } while(l != l_max);
  
      if(total_cost(s_) <= total_cost(s))
        stop = true;
    
    } while(!stop);
    return s_;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %r8d, -0x44(%rbp)
movq %rcx, %r15
movl %edx, %r12d
movq %rsi, %r13
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rdi, -0x38(%rbp)
movq $0x0, 0x10(%rdi)
leaq -0x90(%rbp), %rbx
leaq -0xa8(%rbp), %r14
movl $0x1, -0x2c(%rbp)
movq -0x38(%rbp), %rdi
movq %r13, %rsi
callq 0x3e86
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3e06
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movl -0x44(%rbp), %ecx
callq 0x2e79
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x3275
movq -0x80(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
movq %r13, %rdi
movq %r14, %rsi
leaq -0x2c(%rbp), %rdx
callq 0x3114
movq -0xa8(%rbp), %rdi
testq %rdi, %rdi
je 0x329f
movq -0x98(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
cmpl %r12d, -0x2c(%rbp)
jne 0x3241
leaq -0x78(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x3e06
leaq -0x78(%rbp), %rdi
callq 0x24ed
movl %eax, -0x40(%rbp)
leaq -0x60(%rbp), %rdi
movq %r13, %rsi
callq 0x3e06
leaq -0x60(%rbp), %rdi
callq 0x24ed
movl %eax, -0x3c(%rbp)
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x32eb
movq -0x50(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x3300
movq -0x68(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
movl -0x3c(%rbp), %eax
cmpl %eax, -0x40(%rbp)
ja 0x322e
movq -0x38(%rbp), %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x333f
movq -0x50(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
jmp 0x333f
movq %rax, %rbx
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x3388
movq -0x68(%rbp), %rsi
jmp 0x3380
jmp 0x3365
movq %rax, %rbx
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x3388
movq -0x80(%rbp), %rsi
jmp 0x3380
movq %rax, %rbx
jmp 0x3388
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
testq %rdi, %rdi
je 0x3388
movq -0x98(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
movq -0x38(%rbp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x33a0
movq 0x10(%rax), %rsi
subq %rdi, %rsi
callq 0x2140
movq %rbx, %rdi
callq 0x21d0
// File: /workspace/github_cpp_makefile_star2_O1/Marcos30004347[P]JSS-with-VNS/main.cpp
// Function: general_vns(std::vector<unsigned int, std::allocator<unsigned int>>)
solution general_vns(solution s) {
	unsigned it = 0, k = 0;
  ///TODO tirar daqui
  unsigned k_max = 2;
  unsigned l_max = 2;

	do {
    k = 1;
    while(k <= k_max) {
      solution s_ = permutate(s);
      solution s__ = vnd_best_improvement(s_, l_max, k, NEIGHBORHOOD_SIZE);
      sequential_neighborhood_change_step(s, s__, k);
    }
    it++;
	} while (it < it_max);
  
  return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, -0x38(%rbp)
leaq -0x2c(%rbp), %r15
movl $0x0, (%r15)
xorl %r14d, %r14d
leaq -0x68(%rbp), %r12
leaq -0x50(%rbp), %r13
movl $0x1, -0x2c(%rbp)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x26a5
movq %r13, %rdi
movq %r12, %rsi
movl $0x2, %edx
movq %r15, %rcx
movl $0xf, %r8d
callq 0x31ed
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x3114
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x3424
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x3439
movq -0x58(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
cmpl $0x3, -0x2c(%rbp)
jb 0x33dd
incl %r14d
cmpl 0x3d17(%rip), %r14d     # 0x7160
jb 0x33d6
movq (%rbx), %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
movq 0x8(%rbx), %rcx
movq %rcx, 0x8(%rax)
movq 0x10(%rbx), %rcx
movq %rcx, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x349f
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
jmp 0x349f
movq %rax, %rbx
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x34b4
movq -0x58(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
movq %rbx, %rdi
callq 0x21d0
// File: /workspace/github_cpp_makefile_star2_O1/Marcos30004347[P]JSS-with-VNS/main.cpp
// Function: build_cost_matrix(std::vector<std::vector<op, std::allocator<op>>, std::allocator<std::vector<op, std::allocator<op>>>>&)
vector<vector<unsigned>> build_cost_matrix(vector<job> &ops) {
  vector<vector<unsigned>> costs;

  for(job j : ops){
    job j_sorted = sort_by(j);
    
    vector<unsigned> j_cost;

    for(op o : j_sorted)
      j_cost.push_back(o.cost);

    costs.push_back(j_cost);
  }
  return costs;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rdi, -0x30(%rbp)
movq $0x0, 0x10(%rdi)
movq (%rsi), %r14
movq 0x8(%rsi), %rax
movq %rax, -0x60(%rbp)
cmpq %rax, %r14
je 0x37de
leaq -0x90(%rbp), %r15
leaq -0x78(%rbp), %r12
leaq -0x50(%rbp), %rbx
movq %r15, %rdi
movq %r14, %rsi
callq 0x3f66
movq %r12, %rdi
movq %r15, %rsi
callq 0x3f66
leaq -0xa8(%rbp), %rdi
movq %r12, %rsi
callq 0x34cb
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x371a
movq -0x68(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
movq -0xa8(%rbp), %r15
movq -0xa0(%rbp), %r13
movq %r15, %r12
cmpq %r13, %r15
je 0x3775
movq (%r12), %rax
movq %rax, -0x58(%rbp)
movq -0x48(%rbp), %rsi
cmpq -0x40(%rbp), %rsi
je 0x3760
movl -0x54(%rbp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x48(%rbp)
jmp 0x376c
movq %rbx, %rdi
leaq -0x54(%rbp), %rdx
callq 0x408a
addq $0x8, %r12
cmpq %r13, %r12
jne 0x373f
movq -0x30(%rbp), %rdi
movq %rbx, %rsi
callq 0x3fe6
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
leaq -0x78(%rbp), %r12
je 0x379a
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
testq %r15, %r15
je 0x37b1
movq -0x98(%rbp), %rsi
subq %r15, %rsi
movq %r15, %rdi
callq 0x2140
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x37c9
movq -0x80(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
addq $0x18, %r14
cmpq -0x60(%rbp), %r14
leaq -0x90(%rbp), %r15
jne 0x36e0
movq -0x30(%rbp), %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x385c
movq %rax, %rbx
jmp 0x3844
movq %rax, %rbx
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x3844
movq -0x68(%rbp), %rsi
subq %rdi, %rsi
jmp 0x383f
jmp 0x3815
movq %rax, %rbx
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x382d
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
testq %r15, %r15
je 0x3844
movq -0x98(%rbp), %rsi
subq %r15, %rsi
movq %r15, %rdi
callq 0x2140
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x385c
movq -0x80(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
movq -0x30(%rbp), %rdi
callq 0x3cc6
movq %rbx, %rdi
callq 0x21d0
// File: /workspace/github_cpp_makefile_star2_O1/chinmayachaudhry[P]Branch-Predictor/btb.cpp
// Function: btb::btb(long long, long long)
btb :: btb(ll index_bits, ll btb_assoc)
{
	this->index_bits = (int)index_bits;
	this->btb_assoc = (int)btb_assoc;
//	std::cout << "I: " << index_bits << " A: " << btb_assoc << std::endl;
	sets = (ll)pow(2.0, index_bits);
	mispredictions = branch_count = 0;
	index_mask = mask(index_bits + 2);
	tag_mask = mask(64);			// Assuming the pc address can be upto 64 bits long

	cacheline = new btb_cacheline*[sets];
	for(ll i = 0; i<sets; i++)
		cacheline[i] = new btb_cacheline[btb_assoc];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movl %r15d, 0x20(%rdi)
movl %ebx, 0x24(%rdi)
cvtsi2sd %rsi, %xmm0
callq 0x2130
cvttsd2si %xmm0, %rax
movq %rax, 0x18(%r14)
leal 0x2(%r15), %ecx
xorpd %xmm0, %xmm0
movupd %xmm0, 0x28(%r14)
xorl %edx, %edx
testl %ecx, %ecx
jle 0x3546
leaq 0x1(,%rdx,2), %rdx
decl %ecx
jne 0x353a
movq %rdx, 0x8(%r14)
movq $-0x1, 0x10(%r14)
movq %rax, %rcx
shrq $0x3d, %rcx
shlq $0x3, %rax
xorl %edi, %edi
negq %rcx
sbbq %rdi, %rdi
orq %rax, %rdi
callq 0x2030
movq %rax, (%r14)
cmpq $0x0, 0x18(%r14)
jle 0x35f1
movl $0x38, %ecx
movq %rbx, %rax
mulq %rcx
seto %dl
addq $0x8, %rax
movq $-0x1, %rcx
cmovbq %rcx, %rax
testb %dl, %dl
cmovneq %rcx, %rax
movq %rax, (%rsp)
imulq $-0x38, %rbx, %rbp
xorl %r15d, %r15d
movq (%rsp), %rdi
callq 0x2030
movq %rax, %r12
movq %rbx, (%rax)
testq %rbx, %rbx
je 0x35dd
movl $0x8, %r13d
leaq (%r12,%r13), %rdi
callq 0x3c04
leaq 0x38(,%r13), %rax
addq %rbp, %rax
addq $0x38, %r13
cmpq $0x8, %rax
jne 0x35bf
addq $0x8, %r12
movq (%r14), %rax
movq %r12, (%rax,%r15,8)
incq %r15
cmpq 0x18(%r14), %r15
jl 0x35a5
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
cmpq $0x8, %r13
je 0x3614
movq %r13, %rdi
movq %r12, %rsi
callq 0x22a0
movq %r12, %rdi
movq (%rsp), %rsi
callq 0x2280
movq %rbx, %rdi
callq 0x2260
// File: /workspace/github_cpp_makefile_star2_O1/chinmayachaudhry[P]Branch-Predictor/btb.cpp
// Function: btb::find_cacheline(long long)
btb_cacheline * btb :: find_cacheline(ll address)
{
	ll tag = calcTag(address);
	ll index = calcIndex(address);

	for(int i = 0; i<(int)btb_assoc; i++)
	{
		if((cacheline[index][i].getTag() == tag) && (cacheline[index][i].getValidity() == "Valid"))
			return (&cacheline[index][i]);
	}	
	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x10(%rdi), %rbp
andq %rsi, %rbp
movb 0x20(%rdi), %cl
addb $0x2, %cl
sarq %cl, %rbp
cmpl $0x0, 0x24(%rdi)
jle 0x3743
movq %rdi, %r14
andq 0x8(%rdi), %rsi
sarq $0x2, %rsi
xorl %r13d, %r13d
xorl %r15d, %r15d
movq %rsi, (%rsp)
movq (%r14), %rax
movq (%rax,%rsi,8), %rcx
movq 0x8(%rcx,%r13), %r12
cmpq %rbp, %r12
jne 0x3704
movq (%rax,%rsi,8), %rax
leaq 0x18(%rsp), %rcx
movq %rcx, 0x8(%rsp)
movq 0x18(%rax,%r13), %rsi
movq 0x20(%rax,%r13), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x3c6e
movq %rbx, %rdi
leaq 0x39aa(%rip), %rsi      # 0x709e
callq 0x2070
movq (%rsp), %rsi
testl %eax, %eax
sete %bl
jmp 0x3706
xorl %ebx, %ebx
cmpq %rbp, %r12
jne 0x372b
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x372b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2170
movq (%rsp), %rsi
testb %bl, %bl
jne 0x3747
incq %r15
movslq 0x24(%r14), %rax
addq $0x38, %r13
cmpq %rax, %r15
jl 0x36b1
xorl %eax, %eax
jmp 0x3751
movq (%r14), %rax
addq (%rax,%rsi,8), %r13
movq %r13, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chinmayachaudhry[P]Branch-Predictor/btb.cpp
// Function: btb::replace_cacheline(long long)
void btb :: replace_cacheline(ll address)
{
	ll tag = calcTag(address);
	ll index = calcIndex(address);
	btb_cacheline *evicted_cacheline = cacheline_to_replace(index);

	evicted_cacheline->setAddress(address);
	evicted_cacheline->setTag(tag);
	evicted_cacheline->setSequence_num(branch_count);
	evicted_cacheline->setValidity("Valid");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rdi), %r12
andq %rsi, %r12
movb 0x20(%rdi), %cl
addb $0x2, %cl
sarq %cl, %r12
movq 0x8(%rdi), %rsi
andq %rbx, %rsi
sarq $0x2, %rsi
callq 0x381c
movq %rax, %r15
movq %rbx, (%rax)
movq %r12, 0x8(%rax)
movq 0x30(%r14), %rax
movq %rax, 0x10(%r15)
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x38eb(%rip), %rsi      # 0x709e
leaq 0x38e9(%rip), %rdx      # 0x70a3
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x3cfe
addq $0x18, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x20c0
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x37ed
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2170
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x3813
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2170
movq %rbx, %rdi
callq 0x2260
nop
// File: /workspace/github_cpp_makefile_star2_O1/chinmayachaudhry[P]Branch-Predictor/btb.cpp
// Function: btb::cacheline_to_replace(long long)
btb_cacheline * btb :: cacheline_to_replace(ll index)
{
	btb_cacheline * cacheline_invalid = invalid_cacheline(index);
	ll minimum = branch_count;
	int assoc_to_replace = 0;
	if(cacheline_invalid == NULL)
	{
		for(int i = 0; i<(int)btb_assoc; i++)
		{
			if(cacheline[index][i].getSequence_num() < minimum)
			{
				assoc_to_replace = i;
				minimum = cacheline[index][i].getSequence_num();
//				cacheline_invalid = &cacheline[index][i];
			}
		}
		return (&cacheline[index][assoc_to_replace]);
	}
	return cacheline_invalid;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x387a
testq %rax, %rax
jne 0x3872
movslq 0x24(%r14), %rcx
xorl %eax, %eax
testq %rcx, %rcx
jle 0x3867
movq (%r14), %rsi
movq 0x30(%r14), %rdx
movq (%rsi,%rbx,8), %rsi
addq $0x10, %rsi
xorl %edi, %edi
movq (%rsi), %r8
cmpq %rdx, %r8
cmovlq %r8, %rdx
cmovll %edi, %eax
incq %rdi
addq $0x38, %rsi
cmpq %rdi, %rcx
jne 0x384c
cltq
movq (%r14), %rcx
imulq $0x38, %rax, %rax
addq (%rcx,%rbx,8), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/chinmayachaudhry[P]Branch-Predictor/btb.cpp
// Function: btb::invalid_cacheline(long long)
btb_cacheline * btb :: invalid_cacheline(ll index)
{
	for(int i = 0; i<(int)btb_assoc; i++)
	{
		if(cacheline[index][i].getValidity() == "Invalid")
			return (&cacheline[index][i]);
	}
	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, (%rsp)
cmpl $0x0, 0x24(%rdi)
jle 0x3905
movq %rdi, %r15
leaq 0x8(%rsp), %r12
xorl %r13d, %r13d
xorl %ebx, %ebx
movq (%r15), %rax
movq (%rsp), %rcx
movq (%rax,%rcx,8), %rax
leaq 0x18(%rsp), %r14
movq %r14, 0x8(%rsp)
movq 0x18(%rax,%r13), %rsi
movq 0x20(%rax,%r13), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x3c6e
movq %r12, %rdi
leaq 0x37d1(%rip), %rsi      # 0x70a4
callq 0x2070
movl %eax, %ebp
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x38f1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2170
testl %ebp, %ebp
je 0x3909
incq %rbx
movslq 0x24(%r15), %rax
addq $0x38, %r13
cmpq %rax, %rbx
jl 0x389f
xorl %eax, %eax
jmp 0x3917
movq (%r15), %rax
movq (%rsp), %rcx
addq (%rax,%rcx,8), %r13
movq %r13, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chinmayachaudhry[P]Branch-Predictor/bimodal.cpp
// Function: bimodal::bimodal(long long, btb*)
bimodal :: bimodal(ll index_bits, btb * branch_buffer)
{
	predictions = mispredictions = true_predictions = 0;
	index_mask = mask(index_bits + 2);				// 4-Byte instruction. Hence lowest 2 bits are always 0 for address. Hence ignored
	sets = (ll)pow(2.0, index_bits);
	for(ll i = 0; i<sets; i++)
		predictor_table.push_back(2);				// Initialize 'Weakly Taken' i.e 2

	this->branch_buffer = branch_buffer;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movups %xmm0, 0x38(%rdi)
movups %xmm0, 0x48(%rdi)
cmpq $-0x1, %rsi
jl 0x3dea
leaq 0x2(%rsi), %rcx
xorl %eax, %eax
leaq 0x1(,%rax,2), %rax
decq %rcx
jne 0x3ddb
jmp 0x3dec
xorl %eax, %eax
movq %rax, 0x18(%rbx)
xorps %xmm0, %xmm0
cvtsi2sd %rsi, %xmm0
callq 0x2130
cvttsd2si %xmm0, %rax
movq %rax, 0x30(%rbx)
testq %rax, %rax
jle 0x3e4d
leaq 0x38(%rbx), %r15
xorl %r13d, %r13d
leaq 0xc(%rsp), %r12
movl $0x2, 0xc(%rsp)
movq 0x40(%rbx), %rsi
cmpq 0x48(%rbx), %rsi
je 0x3e39
movl $0x2, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x40(%rbx)
jmp 0x3e44
movq %r15, %rdi
movq %r12, %rdx
callq 0x448e
incq %r13
cmpq 0x30(%rbx), %r13
jl 0x3e17
movq %r14, 0x58(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%r15), %rdi
testq %rdi, %rdi
je 0x3e76
movq 0x48(%rbx), %rsi
subq %rdi, %rsi
callq 0x2170
movq %r14, %rdi
callq 0x2260
// File: /workspace/github_cpp_makefile_star2_O1/chinmayachaudhry[P]Branch-Predictor/bimodal.cpp
// Function: bimodal::update_prediction_table(long long, int, char)
void bimodal :: update_prediction_table(ll address, int predicted_branch, char actual_branch)
{
	ll index = calc_Index(address);
	if(actual_branch == 't')
	{
		if(predictor_table.at(index) < 3)
			predictor_table.at(index) = predictor_table.at(index) + 1;
		if(predicted_branch == 0)
			mispredictions++;
		else
			true_predictions++;
	}		
	else if(actual_branch == 'n')
	{	
		if(predictor_table.at(index) > 0)
			predictor_table.at(index) = predictor_table.at(index) - 1;
		if(predicted_branch == 1)
			mispredictions++;
		else
			true_predictions++;
	}

}

// Assembly:
pushq %rax
andq 0x18(%rdi), %rsi
sarq $0x2, %rsi
cmpl $0x6e, %ecx
je 0x3eec
cmpl $0x74, %ecx
jne 0x3f21
movq 0x38(%rdi), %rcx
movq 0x40(%rdi), %rax
subq %rcx, %rax
sarq $0x2, %rax
cmpq %rsi, %rax
jbe 0x3f23
movl (%rcx,%rsi,4), %r8d
xorl %eax, %eax
cmpl $0x2, %r8d
jg 0x3f15
incl %r8d
jmp 0x3f11
movq 0x38(%rdi), %rcx
movq 0x40(%rdi), %rax
subq %rcx, %rax
sarq $0x2, %rax
cmpq %rsi, %rax
jbe 0x3f23
movl (%rcx,%rsi,4), %r8d
movl $0x1, %eax
testl %r8d, %r8d
jle 0x3f15
decl %r8d
movl %r8d, (%rcx,%rsi,4)
xorl %ecx, %ecx
cmpl %edx, %eax
setne %cl
incq 0x8(%rdi,%rcx,8)
popq %rax
retq
leaq 0x3324(%rip), %rdi      # 0x724e
movq %rax, %rdx
xorl %eax, %eax
callq 0x21f0
// File: /workspace/github_cpp_makefile_star2_O1/chinmayachaudhry[P]Branch-Predictor/bimodal.cpp
// Function: bimodal::display_table()
void bimodal :: display_table()
{
	if(branch_buffer != NULL)
		branch_buffer->display();
	
	cout << endl << "Final Bimodal Table Contents:" << endl;
	for(it = predictor_table.begin(); it != predictor_table.end(); it++)
	{
		int index = distance(predictor_table.begin(), it); 
		cout << "table[" << index << "]: " << predictor_table.at(index) << endl;	
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x58(%rdi), %rdi
testq %rdi, %rdi
je 0x3f80
callq 0x3926
movq 0x6051(%rip), %r14      # 0x9fd8
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movq %rax, %r14
leaq 0x3164(%rip), %rsi      # 0x711c
movl $0x1d, %edx
movq %rax, %rdi
callq 0x2190
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movq 0x38(%rbx), %r13
movq %r13, 0x50(%rbx)
cmpq 0x40(%rbx), %r13
je 0x40ab
movq 0x5fd3(%rip), %r14      # 0x9fd8
leaq 0x32e3(%rip), %r15      # 0x72ef
leaq 0x3127(%rip), %r12      # 0x713a
subq 0x38(%rbx), %r13
shrq $0x2, %r13
movl $0x6, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2190
movq %r14, %rdi
movl %r13d, %esi
callq 0x2250
movq %rax, %rbp
movl $0x3, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2190
movslq %r13d, %rsi
movq 0x38(%rbx), %rax
movq 0x40(%rbx), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %rsi, %rdx
jbe 0x40ba
movl (%rax,%rsi,4), %esi
movq %rbp, %rdi
callq 0x2250
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r13, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movq 0x50(%rbx), %r13
addq $0x4, %r13
movq %r13, 0x50(%rbx)
cmpq 0x40(%rbx), %r13
jne 0x4013
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x318d(%rip), %rdi      # 0x724e
xorl %eax, %eax
callq 0x21f0
// File: /workspace/github_cpp_makefile_star2_O1/chinmayachaudhry[P]Branch-Predictor/gshare.cpp
// Function: gshare::gshare(long long, long long, btb*)
gshare :: gshare(ll index_bits, ll ghr_bits, btb * branch_buffer)
{
	predictions = mispredictions = true_predictions = 0;
	this->index_bits = index_bits;
	this->ghr_bits = ghr_bits;
	index_mask = mask(index_bits + 2);				// 4-Byte instruction. Hence lowest 2 bits are always 0 for address. Hence ignored
	sets = (ll)pow(2.0, index_bits);
	for(ll i = 0; i<sets; i++)
		predictor_table.push_back(2);				// Initialize 'Weakly Taken' i.e 2
	
	ghr_register = 0;

	this->branch_buffer = branch_buffer;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movups %xmm0, 0x60(%rdi)
movups %xmm0, 0x70(%rdi)
movq %rsi, 0x28(%rdi)
movq %rdx, 0x30(%rdi)
cmpq $-0x1, %rsi
jl 0x462e
leaq 0x2(%rsi), %rcx
xorl %eax, %eax
leaq 0x1(,%rax,2), %rax
decq %rcx
jne 0x461f
jmp 0x4630
xorl %eax, %eax
movq %rax, 0x18(%rbx)
xorps %xmm0, %xmm0
cvtsi2sd %rsi, %xmm0
callq 0x2130
cvttsd2si %xmm0, %rax
movq %rax, 0x58(%rbx)
testq %rax, %rax
jle 0x4691
leaq 0x60(%rbx), %r15
xorl %r13d, %r13d
leaq 0xc(%rsp), %r12
movl $0x2, 0xc(%rsp)
movq 0x68(%rbx), %rsi
cmpq 0x70(%rbx), %rsi
je 0x467d
movl $0x2, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x68(%rbx)
jmp 0x4688
movq %r15, %rdi
movq %r12, %rdx
callq 0x448e
incq %r13
cmpq 0x58(%rbx), %r13
jl 0x465b
movq $0x0, 0x38(%rbx)
movq %r14, 0x80(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%r15), %rdi
testq %rdi, %rdi
je 0x46c5
movq 0x70(%rbx), %rsi
subq %rdi, %rsi
callq 0x2170
movq %r14, %rdi
callq 0x2260
nop
// File: /workspace/github_cpp_makefile_star2_O1/chinmayachaudhry[P]Branch-Predictor/gshare.cpp
// Function: gshare::update_prediction_table(long long, int, char)
void gshare :: update_prediction_table(ll address, int predicted_branch, char actual_branch)
{
	if(actual_branch == 't')
	{
		if(predictor_table.at(index) < 3)
			predictor_table.at(index) = predictor_table.at(index) + 1;
		if(predicted_branch == 0)
			mispredictions++;
		else
			true_predictions++;
	}		
	else if(actual_branch == 'n')
	{	
		if(predictor_table.at(index) > 0)
			predictor_table.at(index) = predictor_table.at(index) - 1;
		if(predicted_branch == 1)
			mispredictions++;
		else
			true_predictions++;
	}
	
	update_ghr_register(actual_branch);
}

// Assembly:
pushq %rax
cmpl $0x6e, %ecx
je 0x475c
cmpl $0x74, %ecx
jne 0x4796
movq 0x40(%rdi), %rsi
movq 0x60(%rdi), %r8
movq 0x68(%rdi), %rax
subq %r8, %rax
sarq $0x2, %rax
cmpq %rsi, %rax
jbe 0x479f
movl (%r8,%rsi,4), %r9d
xorl %eax, %eax
cmpl $0x2, %r9d
jg 0x4789
incl %r9d
jmp 0x4785
movq 0x40(%rdi), %rsi
movq 0x60(%rdi), %r8
movq 0x68(%rdi), %rax
subq %r8, %rax
sarq $0x2, %rax
cmpq %rsi, %rax
jbe 0x479f
movl (%r8,%rsi,4), %r9d
movl $0x1, %eax
testl %r9d, %r9d
jle 0x4789
decl %r9d
movl %r9d, (%r8,%rsi,4)
xorl %esi, %esi
cmpl %edx, %eax
setne %sil
incq 0x8(%rdi,%rsi,8)
movsbl %cl, %esi
popq %rax
jmp 0x47b0
leaq 0x2aa8(%rip), %rdi      # 0x724e
movq %rax, %rdx
xorl %eax, %eax
callq 0x21f0
// File: /workspace/github_cpp_makefile_star2_O1/chinmayachaudhry[P]Branch-Predictor/gshare.cpp
// Function: gshare::update_ghr_register(char)
void gshare :: update_ghr_register(char actual_branch)
{
	if(ghr_bits != 0)
	{
		ghr_register = ghr_register >> 1;
		if(actual_branch == 't')
			ghr_register |= (1U << (ghr_bits - 1));
		else if(actual_branch == 'n')
			ghr_register &= ~(1U << (ghr_bits - 1));
	}
}

// Assembly:
movq 0x30(%rdi), %rcx
testq %rcx, %rcx
je 0x47e9
movq 0x38(%rdi), %rax
sarq %rax
movq %rax, 0x38(%rdi)
movsbl %sil, %edx
cmpl $0x6e, %edx
je 0x47e0
cmpl $0x74, %edx
jne 0x47e9
decb %cl
movl $0x1, %edx
shll %cl, %edx
orq %rdx, %rax
jmp 0x47e5
decb %cl
btrl %ecx, %eax
movq %rax, 0x38(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/chinmayachaudhry[P]Branch-Predictor/hybrid.cpp
// Function: hybrid::hybrid(long long, long long, long long, long long, btb*)
hybrid :: hybrid(ll bimodal_index_bits, ll ghr_index_bits, ll ghr_bits, ll chooser_table_index_bits, btb * branch_buffer)
{
	predictions = mispredictions = true_predictions = 0;
	index_mask = mask(chooser_table_index_bits + 2);				// 4-Byte instruction. Hence lowest 2 bits are always 0 for address. Hence ignored
	sets = (ll)pow(2.0, chooser_table_index_bits);
	for(ll i = 0; i<sets; i++)
		chooser_table.push_back(1);						// Initialize to choose GShare Prediction

	this->branch_buffer = branch_buffer;
	
	b = new bimodal(bimodal_index_bits, NULL);
	g = new gshare(ghr_index_bits, ghr_bits, NULL); 
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %rbp
movq %rcx, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq %rsi, %r13
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movups %xmm0, 0x40(%rdi)
movups %xmm0, 0x50(%rdi)
cmpq $-0x1, %r8
jl 0x4ec8
leaq 0x2(%r8), %rcx
xorl %eax, %eax
leaq 0x1(,%rax,2), %rax
decq %rcx
jne 0x4eb9
jmp 0x4eca
xorl %eax, %eax
leaq 0x40(%rbx), %r14
movq %rax, 0x18(%rbx)
xorps %xmm0, %xmm0
cvtsi2sd %r8, %xmm0
callq 0x2130
cvttsd2si %xmm0, %rax
movq %rax, 0x38(%rbx)
testq %rax, %rax
jle 0x4f2b
xorl %r12d, %r12d
leaq 0x4(%rsp), %r15
movl $0x1, 0x4(%rsp)
movq 0x48(%rbx), %rsi
cmpq 0x50(%rbx), %rsi
je 0x4f17
movl $0x1, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x48(%rbx)
jmp 0x4f22
movq %r14, %rdi
movq %r15, %rdx
callq 0x448e
incq %r12
cmpq 0x38(%rbx), %r12
jl 0x4ef5
movq %rbp, 0x60(%rbx)
movl $0x60, %edi
callq 0x2160
movq %rax, %rbp
movq %rax, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x3da6
movq %rbp, 0x68(%rbx)
movl $0x88, %edi
callq 0x2160
movq %rax, %r13
movq %rax, %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
xorl %ecx, %ecx
callq 0x45e2
movq %r13, 0x70(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
movl $0x88, %esi
movq %r13, %rdi
jmp 0x4f99
movq %rax, %r15
movl $0x60, %esi
movq %rbp, %rdi
callq 0x2170
jmp 0x4fa5
jmp 0x4fa2
movq %rax, %r15
movq (%r14), %rdi
testq %rdi, %rdi
je 0x4fb9
movq 0x50(%rbx), %rsi
subq %rdi, %rsi
callq 0x2170
movq %r15, %rdi
callq 0x2260
nop
// File: /workspace/github_cpp_makefile_star2_O1/chinmayachaudhry[P]Branch-Predictor/hybrid.cpp
// Function: hybrid::update_chooser_table(long long, int, char)
void hybrid :: update_chooser_table(ll address, int chooser_table_prediction, char actual_branch)
{
	//ll index = calc_Index(address);

	if(actual_branch == 't')
	{
		if(gshare_prediction == 1 && bimodal_prediction == 0)
		{
			if(chooser_table.at(chooser_table_index) < 3)
				chooser_table.at(chooser_table_index) = chooser_table.at(chooser_table_index) + 1;
		}
		else if(bimodal_prediction == 1 && gshare_prediction == 0)
		{
			if(chooser_table.at(chooser_table_index) > 0)
				chooser_table.at(chooser_table_index) = chooser_table.at(chooser_table_index) - 1;

		}
		if(chooser_table_prediction == 0)
			mispredictions++;
		else
			true_predictions++;
	}		
	else if(actual_branch == 'n')
	{	
		if(gshare_prediction == 0 && bimodal_prediction == 1)
		{
			if(chooser_table.at(chooser_table_index) < 3)
				chooser_table.at(chooser_table_index) = chooser_table.at(chooser_table_index) + 1;
		}
		else if(bimodal_prediction == 0 && gshare_prediction == 1)
		{
			if(chooser_table.at(chooser_table_index) > 0)
				chooser_table.at(chooser_table_index) = chooser_table.at(chooser_table_index) - 1;

		}	

		if(chooser_table_prediction == 1)
			mispredictions++;
		else
			true_predictions++;
	}

}

// Assembly:
pushq %rax
cmpl $0x6e, %ecx
je 0x5040
cmpl $0x74, %ecx
jne 0x50be
movl 0x28(%rdi), %eax
movl 0x2c(%rdi), %esi
movl %esi, %ecx
xorl $0x1, %ecx
orl %eax, %ecx
jne 0x5079
movslq 0x20(%rdi), %rsi
movq 0x40(%rdi), %r8
movq 0x48(%rdi), %rax
subq %r8, %rax
sarq $0x2, %rax
cmpq %rsi, %rax
jbe 0x50c0
movl (%r8,%rsi,4), %eax
xorl %ecx, %ecx
jmp 0x5070
movl 0x28(%rdi), %eax
movl 0x2c(%rdi), %esi
movl %eax, %ecx
xorl $0x1, %ecx
orl %esi, %ecx
jne 0x5080
movslq 0x20(%rdi), %rsi
movq 0x40(%rdi), %r8
movq 0x48(%rdi), %rax
subq %r8, %rax
sarq $0x2, %rax
cmpq %rsi, %rax
jbe 0x50c0
movl (%r8,%rsi,4), %eax
movl $0x1, %ecx
cmpl $0x2, %eax
jg 0x50b2
incl %eax
jmp 0x50ae
xorl $0x1, %eax
xorl %ecx, %ecx
jmp 0x5088
xorl $0x1, %esi
movl $0x1, %ecx
orl %eax, %esi
jne 0x50b2
movslq 0x20(%rdi), %rsi
movq 0x40(%rdi), %r8
movq 0x48(%rdi), %rax
subq %r8, %rax
sarq $0x2, %rax
cmpq %rsi, %rax
jbe 0x50c0
movl (%r8,%rsi,4), %eax
testl %eax, %eax
jle 0x50b2
decl %eax
movl %eax, (%r8,%rsi,4)
xorl %eax, %eax
cmpl %edx, %ecx
setne %al
incq 0x8(%rdi,%rax,8)
popq %rax
retq
leaq 0x2187(%rip), %rdi      # 0x724e
movq %rax, %rdx
xorl %eax, %eax
callq 0x21f0
nop
// File: /workspace/github_cpp_makefile_star2_O1/chinmayachaudhry[P]Branch-Predictor/hybrid.cpp
// Function: hybrid::access(long long, char)
void hybrid :: access(ll address, char actual_branch)
{
	predictions++;
	this->choosen_predictor = predict(address, actual_branch);
	this->bimodal_prediction = b->predict(address, actual_branch);
	this->gshare_prediction = g->predict(address, actual_branch);
	if(choosen_predictor == 1)
	{
		g->update_prediction_table(address, gshare_prediction, actual_branch);	
		update_chooser_table(address, gshare_prediction, actual_branch);
	}
	else
	{
		update_chooser_table(address, bimodal_prediction, actual_branch);
		b->update_prediction_table(address, bimodal_prediction, actual_branch);
		g->update_ghr_register(actual_branch);
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
incq (%rdi)
xorl %edx, %edx
callq 0x4fc2
movl %eax, 0x24(%rbx)
movq 0x68(%rbx), %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x3e7e
movl %eax, 0x28(%rbx)
movq 0x70(%rbx), %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x46ce
movl %eax, 0x2c(%rbx)
cmpl $0x1, 0x24(%rbx)
jne 0x5138
movq 0x70(%rbx), %rdi
movsbl %bpl, %ebp
movq %r14, %rsi
movl %eax, %edx
movl %ebp, %ecx
callq 0x4728
movl 0x2c(%rbx), %edx
movq %rbx, %rdi
movl %ebp, %ecx
popq %rbx
popq %r14
popq %rbp
jmp 0x4ffe
movl 0x28(%rbx), %edx
movsbl %bpl, %ebp
movq %rbx, %rdi
movl %ebp, %ecx
callq 0x4ffe
movq 0x68(%rbx), %rdi
movl 0x28(%rbx), %edx
movq %r14, %rsi
movl %ebp, %ecx
callq 0x3eb4
movq 0x70(%rbx), %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x47b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/chinmayachaudhry[P]Branch-Predictor/hybrid.cpp
// Function: hybrid::display_table()
void hybrid :: display_table()
{
	if(branch_buffer != NULL)
		branch_buffer->display();
	
	b->display_table();
	g->display_table();

	cout << endl << "Final Chooser Table Contents:" << endl;
	for(it = chooser_table.begin(); it != chooser_table.end(); it++)
	{
		int index = distance(chooser_table.begin(), it); 
		cout << "Choice table[" << index << "]: " << chooser_table.at(index) << endl;	
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x60(%rdi), %rdi
testq %rdi, %rdi
je 0x5186
callq 0x3926
movq 0x68(%rbx), %rdi
callq 0x3f64
movq 0x70(%rbx), %rdi
callq 0x4814
movq 0x4e39(%rip), %r14      # 0x9fd8
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movq %rax, %r14
leaq 0x20fa(%rip), %rsi      # 0x72ca
movl $0x1d, %edx
movq %rax, %rdi
callq 0x2190
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movq 0x40(%rbx), %r13
movq %r13, 0x58(%rbx)
cmpq 0x48(%rbx), %r13
je 0x52c3
movq 0x4dbb(%rip), %r14      # 0x9fd8
leaq 0x20c4(%rip), %r15      # 0x72e8
leaq 0x1f0f(%rip), %r12      # 0x713a
subq 0x40(%rbx), %r13
shrq $0x2, %r13
movl $0xd, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2190
movq %r14, %rdi
movl %r13d, %esi
callq 0x2250
movq %rax, %rbp
movl $0x3, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2190
movslq %r13d, %rsi
movq 0x40(%rbx), %rax
movq 0x48(%rbx), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %rsi, %rdx
jbe 0x52d2
movl (%rax,%rsi,4), %esi
movq %rbp, %rdi
callq 0x2250
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r13, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movq 0x58(%rbx), %r13
addq $0x4, %r13
movq %r13, 0x58(%rbx)
cmpq 0x48(%rbx), %r13
jne 0x522b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1f75(%rip), %rdi      # 0x724e
xorl %eax, %eax
callq 0x21f0
// File: /workspace/github_cpp_makefile_star2_O1/chinmayachaudhry[P]Branch-Predictor/yehpatt.cpp
// Function: yehpatt::yehpatt(long long, long long, btb*)
yehpatt :: yehpatt(ll history_index_bits, ll predictor_index_bits, btb * branch_buffer)
{
	predictions = mispredictions = true_predictions = 0;
	this->history_index_bits = history_index_bits;
	this->predictor_index_bits = predictor_index_bits;

	index_mask = mask(history_index_bits + 2);				// 4-Byte instruction. Hence lowest 2 bits are always 0 for address. Hence ignored
	sets = (ll)pow(2.0, predictor_index_bits);
	for(ll i = 0; i<sets; i++)
		predictor_table.push_back(2);				// Initialize 'Weakly Taken' i.e 2

	history_sets = pow(2.0, history_index_bits);
	for(ll i = 0; i<history_sets; i++)
		history_table.push_back(0);
	
	this->branch_buffer = branch_buffer;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x10(%rsp)
movq %rsi, %r13
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
xorl %eax, %eax
movq %rax, 0x10(%rdi)
movups %xmm0, 0x58(%rdi)
movups %xmm0, 0x68(%rdi)
movups %xmm0, 0x78(%rdi)
movq %rax, 0x88(%rdi)
movq %rsi, 0x20(%rdi)
movq %rdx, 0x28(%rdi)
cmpq $-0x1, %rsi
jl 0x5717
leaq 0x2(%r13), %rcx
xorl %eax, %eax
leaq 0x1(,%rax,2), %rax
decq %rcx
jne 0x570a
leaq 0x58(%rbx), %r15
leaq 0x70(%rbx), %r12
movq %rax, 0x18(%rbx)
xorps %xmm0, %xmm0
cvtsi2sd %rdx, %xmm0
callq 0x2130
cvttsd2si %xmm0, %rax
movq %rax, 0x48(%rbx)
testq %rax, %rax
jle 0x577c
xorl %r14d, %r14d
leaq 0xc(%rsp), %rbp
movl $0x2, 0xc(%rsp)
movq 0x60(%rbx), %rsi
cmpq 0x68(%rbx), %rsi
je 0x5768
movl $0x2, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x60(%rbx)
jmp 0x5773
movq %r15, %rdi
movq %rbp, %rdx
callq 0x448e
incq %r14
cmpq 0x48(%rbx), %r14
jl 0x5746
xorps %xmm0, %xmm0
cvtsi2sd %r13, %xmm0
callq 0x2130
cvttsd2si %xmm0, %rax
movq %rax, 0x50(%rbx)
testq %rax, %rax
jle 0x57d8
xorl %r14d, %r14d
leaq 0x8(%rsp), %r13
movl $0x0, 0x8(%rsp)
movq 0x78(%rbx), %rsi
cmpq 0x80(%rbx), %rsi
je 0x57c4
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x78(%rbx)
jmp 0x57cf
movq %r12, %rdi
movq %r13, %rdx
callq 0x448e
incq %r14
cmpq 0x50(%rbx), %r14
jl 0x579f
movq 0x10(%rsp), %rax
movq %rax, 0x90(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x57f5
movq %rax, %r14
movq (%r12), %rdi
testq %rdi, %rdi
je 0x5810
movq 0x80(%rbx), %rsi
subq %rdi, %rsi
callq 0x2170
movq (%r15), %rdi
testq %rdi, %rdi
je 0x5824
movq 0x68(%rbx), %rsi
subq %rdi, %rsi
callq 0x2170
movq %r14, %rdi
callq 0x2260
// File: /workspace/github_cpp_makefile_star2_O1/chinmayachaudhry[P]Branch-Predictor/yehpatt.cpp
// Function: yehpatt::predict(long long, char)
int yehpatt :: predict(ll address, char actual_branch)
{	
	this->history_table_index = calc_Index(address);
	this->predictor_table_index = history_table.at(history_table_index);

	if(predictor_table.at(predictor_table_index) >= 2)
		return 1;
	else
		return 0;
}

// Assembly:
pushq %rax
andq 0x18(%rdi), %rsi
sarq $0x2, %rsi
movl %esi, 0x38(%rdi)
movslq %esi, %rsi
movq 0x70(%rdi), %rax
movq 0x78(%rdi), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %rsi, %rdx
jbe 0x5875
movslq (%rax,%rsi,4), %rsi
movl %esi, 0x34(%rdi)
movq 0x58(%rdi), %rcx
movq 0x60(%rdi), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
cmpq %rsi, %rdx
jbe 0x5875
xorl %eax, %eax
cmpl $0x2, (%rcx,%rsi,4)
setge %al
popq %rcx
retq
leaq 0x19d2(%rip), %rdi      # 0x724e
xorl %eax, %eax
callq 0x21f0
nop
// File: /workspace/github_cpp_makefile_star2_O1/chinmayachaudhry[P]Branch-Predictor/yehpatt.cpp
// Function: yehpatt::update(int, char)
void yehpatt :: update(int predicted_branch, char actual_branch)
{
//	ll index = calc_Index(address);
	history_table.at(history_table_index) = history_table.at(history_table_index) >> 1;
	if(actual_branch == 't')
	{
		if(predictor_table.at(predictor_table_index) < 3)
			predictor_table.at(predictor_table_index) = predictor_table.at(predictor_table_index) + 1;
		if(predicted_branch == 0)
			mispredictions++;
		else
			true_predictions++;
		history_table.at(history_table_index) |= (1U << (predictor_index_bits -1));
	}		
	else if(actual_branch == 'n')
	{	
		if(predictor_table.at(predictor_table_index) > 0)
			predictor_table.at(predictor_table_index) = predictor_table.at(predictor_table_index) - 1;
		if(predicted_branch == 1)
			mispredictions++;
		else
			true_predictions++;
		history_table.at(history_table_index) &= ~(1U << (predictor_index_bits -1));
	}


}

// Assembly:
pushq %rax
movl %edx, %ecx
movslq 0x38(%rdi), %rax
movq 0x70(%rdi), %r8
movq 0x78(%rdi), %rdx
subq %r8, %rdx
sarq $0x2, %rdx
cmpq %rax, %rdx
jbe 0x5958
sarl (%r8,%rax,4)
movsbl %cl, %eax
cmpl $0x6e, %eax
je 0x590a
cmpl $0x74, %eax
jne 0x5956
movslq 0x34(%rdi), %rax
movq 0x58(%rdi), %r9
movq 0x60(%rdi), %rcx
subq %r9, %rcx
sarq $0x2, %rcx
cmpq %rax, %rcx
jbe 0x5964
movl (%r9,%rax,4), %ecx
cmpl $0x2, %ecx
jg 0x58e3
incl %ecx
movl %ecx, (%r9,%rax,4)
xorl %eax, %eax
testl %esi, %esi
setne %al
incq 0x8(%rdi,%rax,8)
movslq 0x38(%rdi), %rsi
cmpq %rsi, %rdx
jbe 0x5973
movb 0x28(%rdi), %cl
decb %cl
movl $0x1, %eax
shll %cl, %eax
orl %eax, (%r8,%rsi,4)
jmp 0x5956
movslq 0x34(%rdi), %rax
movq 0x58(%rdi), %r9
movq 0x60(%rdi), %rcx
subq %r9, %rcx
sarq $0x2, %rcx
cmpq %rax, %rcx
jbe 0x5964
movl (%r9,%rax,4), %ecx
testl %ecx, %ecx
jle 0x5930
decl %ecx
movl %ecx, (%r9,%rax,4)
xorl %eax, %eax
cmpl $0x1, %esi
setne %al
incq 0x8(%rdi,%rax,8)
movslq 0x38(%rdi), %rsi
cmpq %rsi, %rdx
jbe 0x5973
movb 0x28(%rdi), %cl
decb %cl
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
roll %cl, %eax
andl %eax, (%r8,%rsi,4)
popq %rax
retq
leaq 0x18ef(%rip), %rdi      # 0x724e
movq %rax, %rsi
jmp 0x597a
leaq 0x18e3(%rip), %rdi      # 0x724e
movq %rax, %rsi
movq %rcx, %rdx
jmp 0x597a
leaq 0x18d4(%rip), %rdi      # 0x724e
xorl %eax, %eax
callq 0x21f0
nop
// File: /workspace/github_cpp_makefile_star2_O1/trigrass2[P]giveda_gobject_ansi_cpp/gObject.cpp
// Function: GObject::destructAsSender()
void GObject::destructAsSender()
{
    list<GObject*>::iterator it = m_priv->receiverLstInSender.begin();
    while(it != m_priv->receiverLstInSender.end() )
    {
        GObject* receiver = *it;
        receiver->m_priv->spLstInReceiver.remove_if( Sender_Is(this) );
        ++it;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x8(%rdi), %rax
movq 0x40(%rax), %r14
addq $0x40, %rax
cmpq %rax, %r14
je 0x12f6
movq %rdi, %rbx
movq 0x10(%r14), %rax
movq 0x8(%rax), %rdi
addq $0x28, %rdi
movq %rbx, %rsi
callq 0x193c
movq (%r14), %r14
movq 0x8(%rbx), %rax
addq $0x40, %rax
cmpq %rax, %r14
jne 0x12d2
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/trigrass2[P]giveda_gobject_ansi_cpp/gObject.cpp
// Function: GObject::destructAsReceiver()
void GObject::destructAsReceiver()
{
    list<SenderPair >::iterator it = m_priv->spLstInReceiver.begin();
    while(it != m_priv->spLstInReceiver.end() )
    {
        it->signal->remove_if( Receiver_Is(this) );
        it->sender->m_priv->receiverLstInSender.remove_if( Receiver_Is(this) );
        ++it;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x8(%rdi), %rax
movq 0x28(%rax), %r14
addq $0x28, %rax
cmpq %rax, %r14
je 0x1346
movq %rdi, %rbx
movq 0x18(%r14), %rdi
movq %rbx, %rsi
callq 0x1820
movq 0x10(%r14), %rax
movq 0x8(%rax), %rdi
addq $0x40, %rdi
movq %rbx, %rsi
callq 0x18ae
movq (%r14), %r14
movq 0x8(%rbx), %rax
addq $0x28, %rax
cmpq %rax, %r14
jne 0x1316
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/trigrass2[P]giveda_gobject_ansi_cpp/gObject.cpp
// Function: GObject::privConnect(GObject*, std::__cxx11::list<Slot<void*>, std::allocator<Slot<void*>>>*, GObject*, void*)
int GObject::privConnect(GObject* sender, SIGNAL_POINTER(void*) signal, GObject* receiver, void* slot)
{
    if ( sender == 0 || receiver == 0 || signal == 0 || slot == 0 )
    {
        WARNING ( "can not connect %s::%p to %s::%p\n",
                  sender ? sender->name() : "(null)",
                  signal,
                  receiver ? receiver->name() : "(null)",
                  slot );
        return -1;
    }

    Slot<void*>  vslot(receiver, (void*)slot);
    SIGNAL_TYPE_ITERATOR(void*)  it = std::find(signal->begin(), signal->end(), vslot );
    if(it != signal->end() )
    {
        return 0;
    }

    signal->push_back( vslot );

    sender->saveReceiver(receiver);
    
    receiver->saveSenderPair( sender, signal );

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r12
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
testq %rdi, %rdi
je 0x14a4
testq %r14, %r14
je 0x14a4
testq %rbx, %rbx
je 0x14a4
testq %r12, %r12
je 0x14a4
movq (%rbx), %rax
cmpq %rbx, %rax
je 0x1426
cmpq %r14, 0x10(%rax)
jne 0x1421
cmpq %r12, 0x18(%rax)
je 0x1426
movq (%rax), %rax
jmp 0x1410
xorl %ebp, %ebp
cmpq %rbx, %rax
jne 0x14e1
movl $0x20, %edi
callq 0x10b0
movq %r14, 0x10(%rax)
movq %r12, 0x18(%rax)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1040
incq 0x10(%rbx)
movq 0x8(%r15), %r13
leaq 0x40(%r13), %r12
movl $0x18, %edi
callq 0x10b0
movq %r14, 0x10(%rax)
movq %rax, %rdi
movq %r12, %rsi
callq 0x1040
incq 0x50(%r13)
movq 0x8(%r14), %r12
leaq 0x28(%r12), %r14
movl $0x20, %edi
callq 0x10b0
movq %r15, 0x10(%rax)
movq %rbx, 0x18(%rax)
movq %rax, %rdi
movq %r14, %rsi
callq 0x1040
incq 0x38(%r12)
jmp 0x14e1
leaq 0xb7b(%rip), %rcx       # 0x2026
movq %rcx, %rsi
testq %r15, %r15
je 0x14bb
movq 0x8(%r15), %rax
movq 0x8(%rax), %rsi
testq %r14, %r14
je 0x14c8
movq 0x8(%r14), %rax
movq 0x8(%rax), %rcx
leaq 0xb35(%rip), %rdi       # 0x2004
movq %rbx, %rdx
movq %r12, %r8
xorl %eax, %eax
callq 0x1030
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/trigrass2[P]giveda_gobject_ansi_cpp/gObject.cpp
// Function: GObject::deleteReceiver(GObject*)
void GObject::deleteReceiver(GObject *receiver)
{
    list<GObject*>::iterator it = std::find(m_priv->receiverLstInSender.begin(), m_priv->receiverLstInSender.end(), receiver );
    if(it == m_priv->receiverLstInSender.end() )
    {
        return ;
    }

    m_priv->receiverLstInSender.erase(it);
}

// Assembly:
pushq %rbx
movq 0x8(%rdi), %rax
leaq 0x40(%rax), %rcx
movq 0x40(%rax), %rbx
cmpq %rcx, %rbx
je 0x154d
cmpq %rsi, 0x10(%rbx)
je 0x154d
movq (%rbx), %rbx
jmp 0x153d
cmpq %rcx, %rbx
je 0x156c
decq 0x50(%rax)
movq %rbx, %rdi
callq 0x10e0
movl $0x18, %esi
movq %rbx, %rdi
popq %rbx
jmp 0x10c0
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/trigrass2[P]giveda_gobject_ansi_cpp/gObject.cpp
// Function: GObject::privDisconnect(GObject*, std::__cxx11::list<Slot<void*>, std::allocator<Slot<void*>>>*, GObject*, void*)
int GObject::privDisconnect(GObject* sender, SIGNAL_POINTER(void*) signal, GObject* receiver, void* slot)
{
    if ( sender == 0 || receiver == 0 || signal == 0 || slot == 0 )
    {
        WARNING ( "can not disconnect sender %s::%p from receiver %s::%p\n",
                  sender ? sender->name() : "(null)",
                  signal,
                  receiver ? receiver->name() : "(null)",
                  slot );
        return -1;
    }
    
    Slot<void*>  vslot(receiver, (void*)slot);
    SIGNAL_TYPE_ITERATOR(void*)  it = std::find(signal->begin(), signal->end(), vslot );
    if(it == signal->end() )
    {
        return 0;
    }

    signal->remove( vslot );

    sender->deleteReceiver(receiver);
    
    receiver->deleteSenderPair( sender, signal );

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rcx, %r8
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
testq %rdi, %rdi
je 0x15f1
testq %r14, %r14
je 0x15f1
testq %rbx, %rbx
je 0x15f1
testq %r8, %r8
je 0x15f1
movq %r14, (%rsp)
movq %r8, 0x8(%rsp)
movq (%rbx), %rax
cmpq %rbx, %rax
je 0x15b9
cmpq %r14, 0x10(%rax)
jne 0x15b4
cmpq %r8, 0x18(%rax)
je 0x15b9
movq (%rax), %rax
jmp 0x15a3
cmpq %rbx, %rax
je 0x15ed
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x19ca
movq %r15, %rdi
movq %r14, %rsi
callq 0x1530
movq 0x8(%r14), %rdi
addq $0x28, %rdi
leaq 0x10(%rsp), %rsi
movq %r15, (%rsi)
movq %rbx, 0x8(%rsi)
callq 0x1784
xorl %eax, %eax
jmp 0x162b
leaq 0xa2e(%rip), %rcx       # 0x2026
movq %rcx, %rsi
testq %r15, %r15
je 0x1608
movq 0x8(%r15), %rax
movq 0x8(%rax), %rsi
testq %r14, %r14
je 0x1615
movq 0x8(%r14), %rax
movq 0x8(%rax), %rcx
leaq 0xa11(%rip), %rdi       # 0x202d
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1030
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop