LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/5hubh4m[P]snake-ncurses/score.cpp
// Function: Score::showscores()
void Score::showscores(void) {
  sortscore();
  erase();
  int ch;
  int t=(23-head-1)/2;
  if(head>-1) {
    for(int i=head, j=0; i>=0; i--,  j++) {
      mvprintw(t+j, 36, "%2d. %2u", j+1, scores[i]);
    }
  }
  attron(A_STANDOUT);
  mvprintw(23, 25, "PRESS 'Q' to EXIT BACK TO MENU.");
  attroff(A_STANDOUT);
  refresh();
  while((ch=getch())!='q');
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0x398c
callq 0x21d0
movslq 0x38(%rbx), %rax
testq %rax, %rax
js 0x3a7b
movl $0x16, %ecx
subl %eax, %ecx
movl %ecx, %r15d
shrl $0x1f, %r15d
addl %ecx, %r15d
sarl %r15d
leaq (%rbx,%rax,4), %r12
leal 0x1(%rax), %ebp
leaq 0x1632(%rip), %rbx      # 0x5084
xorl %r14d, %r14d
leal (%r15,%r14), %edi
incl %r14d
movl (%r12), %r8d
movl $0x24, %esi
movq %rbx, %rdx
movl %r14d, %ecx
xorl %eax, %eax
callq 0x2240
addq $-0x4, %r12
cmpl %r14d, %ebp
jne 0x3a55
movq 0x4556(%rip), %rbx      # 0x7fd8
movq (%rbx), %rdi
movl $0x10000, %esi          # imm = 0x10000
xorl %edx, %edx
callq 0x2100
leaq 0x15f5(%rip), %rdx      # 0x508d
movl $0x17, %edi
movl $0x19, %esi
xorl %eax, %eax
callq 0x2240
movq (%rbx), %rdi
movl $0x10000, %esi          # imm = 0x10000
xorl %edx, %edx
callq 0x2230
callq 0x22e0
movq (%rbx), %rdi
callq 0x20d0
cmpl $0x71, %eax
jne 0x3abd
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/5hubh4m[P]snake-ncurses/snake_ncurses.cpp
// Function: print_snake()
void print_snake(void) {
	mvprintw(0, 14, " $$$$$$\\  $$\\   $$\\  $$$$$$\\  $$\\   $$\\ $$$$$$$$\\\n");
	mvprintw(1, 14, "$$  __$$\\ $$$\\  $$ |$$  __$$\\ $$ | $$  |$$  _____|\n");
	mvprintw(2, 14, "$$ /  \\__|$$$$\\ $$ |$$ /  $$ |$$ |$$  / $$ |\n");
	mvprintw(3, 14, "\\$$$$$$\\  $$ $$\\$$ |$$$$$$$$ |$$$$$  /  $$$$$\\\n");
	mvprintw(4, 14, " \\____$$\\ $$ \\$$$$ |$$  __$$ |$$  $$<   $$  __|\n");
	mvprintw(5, 14, "$$\\   $$ |$$ |\\$$$ |$$ |  $$ |$$ |\\$$\\  $$ |\n");
	mvprintw(6, 14, "\\$$$$$$  |$$ | \\$$ |$$ |  $$ |$$ | \\$$\\ $$$$$$$$\\\n");
	mvprintw(7, 14, " \\______/ \\__|  \\__|\\__|  \\__|\\__|  \\__|\\________|\n");
}

// Assembly:
pushq %rax
leaq 0x1607(%rip), %rdx      # 0x50e7
xorl %edi, %edi
movl $0xe, %esi
xorl %eax, %eax
callq 0x2240
leaq 0x1625(%rip), %rdx      # 0x511a
movl $0x1, %edi
movl $0xe, %esi
xorl %eax, %eax
callq 0x2240
leaq 0x1641(%rip), %rdx      # 0x514e
movl $0x2, %edi
movl $0xe, %esi
xorl %eax, %eax
callq 0x2240
leaq 0x1657(%rip), %rdx      # 0x517c
movl $0x3, %edi
movl $0xe, %esi
xorl %eax, %eax
callq 0x2240
leaq 0x166f(%rip), %rdx      # 0x51ac
movl $0x4, %edi
movl $0xe, %esi
xorl %eax, %eax
callq 0x2240
leaq 0x1688(%rip), %rdx      # 0x51dd
movl $0x5, %edi
movl $0xe, %esi
xorl %eax, %eax
callq 0x2240
leaq 0x169e(%rip), %rdx      # 0x520b
movl $0x6, %edi
movl $0xe, %esi
xorl %eax, %eax
callq 0x2240
leaq 0x16b9(%rip), %rdx      # 0x523e
movl $0x7, %edi
movl $0xe, %esi
xorl %eax, %eax
popq %rcx
jmp 0x2240
// File: /workspace/github_cpp_makefile_star2_O3/5hubh4m[P]snake-ncurses/snake_ncurses.cpp
// Function: classic_game()
int classic_game(void) {
	Classic_Snake S;
	int ch, d;
	initscr();
	keypad(stdscr, TRUE);
	noecho();
	timeout(TIMEOUT);
	curs_set(0);
	while(1) {
		ch=getch();
		if(ch=='q') {
			return S.getscore();
		}
		else if(ch==KEY_UP || ch==KEY_DOWN || ch==KEY_RIGHT || ch==KEY_LEFT) {
			switch(ch) {
				case KEY_UP:
					d=UP;
					break;
				case KEY_DOWN:
					d=DOWN;
					break;
				case KEY_RIGHT:
					d=RIGHT;
					break;
				case KEY_LEFT:
					d=LEFT;
					break;
			}
			if(diff(S.getfdir(), d)!=2 && d!=S.getfdir()) {
				S.createNode(d);
			}
		}
		S.movesnake();
		S.render();
		if(S.getcoll()) {
			timeout(TIMEOUT_LONG);
			getch();
			show_gameover(S.getscore());
			return S.getscore();
		}
		attron(A_STANDOUT);
		mvprintw(23, 25, "PRESS 'Q' to EXIT BACK TO MENU.");
		attroff(A_STANDOUT);
		refresh();
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xd0, %rsp
leaq 0x8(%rsp), %rdi
callq 0x2854
callq 0x2290
movq 0x3ea5(%rip), %r15      # 0x7fd8
movq (%r15), %rdi
movl $0x1, %esi
callq 0x20e0
callq 0x21f0
movq (%r15), %rdi
movl $0x64, %esi
callq 0x2200
xorl %edi, %edi
callq 0x2140
leaq 0x8(%rsp), %rbx
leaq 0xf28(%rip), %r14       # 0x508d
leaq 0xf54(%rip), %r12       # 0x50c0
movq (%r15), %rdi
callq 0x20d0
leal -0x102(%rax), %ecx
cmpl $0x3, %ecx
ja 0x418f
movslq (%r12,%rcx,4), %rax
addq %r12, %rax
jmpq *%rax
movl $0x2, %ebp
jmp 0x41a9
cmpl $0x71, %eax
jne 0x41d3
jmp 0x424e
movl $0x3, %ebp
jmp 0x41a9
movl $0x1, %ebp
jmp 0x41a9
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x2844
subl %ebp, %eax
addl $0x2, %eax
testl $0xfffffffb, %eax       # imm = 0xFFFFFFFB
je 0x41d3
movq %rbx, %rdi
callq 0x2844
cmpl %eax, %ebp
je 0x41d3
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2672
movq %rbx, %rdi
callq 0x2904
movq %rbx, %rdi
callq 0x2aa2
movq %rbx, %rdi
callq 0x2b4a
movq (%r15), %rdi
testl %eax, %eax
jne 0x422b
movl $0x10000, %esi          # imm = 0x10000
xorl %edx, %edx
callq 0x2100
movl $0x17, %edi
movl $0x19, %esi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2240
movq (%r15), %rdi
movl $0x10000, %esi          # imm = 0x10000
xorl %edx, %edx
callq 0x2230
callq 0x22e0
jmp 0x416c
movl $0x2710, %esi           # imm = 0x2710
callq 0x2200
movq (%r15), %rdi
callq 0x20d0
leaq 0x8(%rsp), %rdi
callq 0x2b52
movl %eax, %edi
callq 0x3f1a
leaq 0x8(%rsp), %rdi
callq 0x2b52
movl %eax, %ebx
leaq 0x3ac7(%rip), %rax      # 0x7d28
addq $0x10, %rax
leaq 0x60(%rsp), %rdi
movq %rax, -0x58(%rdi)
callq 0x306a
leaq 0x10(%rsp), %rdi
callq 0x3012
movl %ebx, %eax
addq $0xd0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4291
movq %rax, %rbx
leaq 0x3a8d(%rip), %rax      # 0x7d28
addq $0x10, %rax
leaq 0x60(%rsp), %rdi
movq %rax, -0x58(%rdi)
callq 0x306a
leaq 0x10(%rsp), %rdi
callq 0x3012
movq %rbx, %rdi
callq 0x22f0
// File: /workspace/github_cpp_makefile_star2_O3/5hubh4m[P]snake-ncurses/snake_ncurses.cpp
// Function: fun_snake_game()
void fun_snake_game(void) {
	Snake S;
	int ch, d;
	initscr();
	keypad(stdscr, TRUE);
	noecho();
	timeout(TIMEOUT);
	curs_set(0);
	while(1) {
		ch=getch();
		if(ch=='q') {
			return;
		}
		else if(ch==KEY_UP || ch==KEY_DOWN || ch==KEY_RIGHT || ch==KEY_LEFT) {
			switch(ch) {
				case KEY_UP:
					d=UP;
					break;
				case KEY_DOWN:
					d=DOWN;
					break;
				case KEY_RIGHT:
					d=RIGHT;
					break;
				case KEY_LEFT:
					d=LEFT;
					break;
			}
			if(diff(S.getfdir(), d)!=2 && d!=S.getfdir()) {
				S.createNode(d);
			}
		}
		S.movesnake();
		S.render();
		attron(A_STANDOUT);
		mvprintw(23, 25, "PRESS 'Q' to EXIT BACK TO MENU.");
		attroff(A_STANDOUT);
		refresh();
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xb0, %rsp
movq %rsp, %rdi
movl $0x19, %esi
callq 0x2530
callq 0x2290
movq 0x3ce7(%rip), %r15      # 0x7fd8
movq (%r15), %rdi
movl $0x1, %esi
callq 0x20e0
callq 0x21f0
movq (%r15), %rdi
movl $0x64, %esi
callq 0x2200
xorl %edi, %edi
callq 0x2140
movq %rsp, %rbx
leaq 0xd6c(%rip), %r14       # 0x508d
leaq 0xda8(%rip), %r12       # 0x50d0
movq (%r15), %rdi
callq 0x20d0
leal -0x102(%rax), %ecx
cmpl $0x3, %ecx
ja 0x434b
movslq (%r12,%rcx,4), %rax
addq %r12, %rax
jmpq *%rax
movl $0x2, %ebp
jmp 0x4365
cmpl $0x71, %eax
jne 0x438f
jmp 0x43db
movl $0x3, %ebp
jmp 0x4365
movl $0x1, %ebp
jmp 0x4365
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x2844
subl %ebp, %eax
addl $0x2, %eax
testl $0xfffffffb, %eax       # imm = 0xFFFFFFFB
je 0x438f
movq %rbx, %rdi
callq 0x2844
cmpl %eax, %ebp
je 0x438f
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2672
movq %rbx, %rdi
callq 0x274a
movq %rbx, %rdi
callq 0x26d0
movq (%r15), %rdi
movl $0x10000, %esi          # imm = 0x10000
xorl %edx, %edx
callq 0x2100
movl $0x17, %edi
movl $0x19, %esi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2240
movq (%r15), %rdi
movl $0x10000, %esi          # imm = 0x10000
xorl %edx, %edx
callq 0x2230
callq 0x22e0
jmp 0x4328
leaq 0x3946(%rip), %rax      # 0x7d28
addq $0x10, %rax
leaq 0x58(%rsp), %rdi
movq %rax, -0x58(%rdi)
callq 0x306a
leaq 0x8(%rsp), %rdi
callq 0x3012
addq $0xb0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4410
movq %rax, %rbx
leaq 0x390e(%rip), %rax      # 0x7d28
addq $0x10, %rax
leaq 0x58(%rsp), %rdi
movq %rax, -0x58(%rdi)
callq 0x306a
leaq 0x8(%rsp), %rdi
callq 0x3012
movq %rbx, %rdi
callq 0x22f0
// File: /workspace/github_cpp_makefile_star2_O3/5hubh4m[P]snake-ncurses/snake_ncurses.cpp
// Function: rand_point(std::deque<Cell, std::allocator<Cell>>)
Point rand_point(std::deque<Cell> cells) {
	Point p;
	int flag;
	srand(time(NULL));
	do {
		flag=0;
		p.row=rand()%(MAX_ROW+1);
		p.col=rand()%(MAX_COL+1);
		for(std::deque<Cell>::iterator it=cells.begin(); it!=cells.end(); ++it){
			if(p.row==it->p.row && p.col==it->p.col) {
				flag=1;
			}
		}
	}while(flag);
	return p;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %edi, %edi
callq 0x2170
movl %eax, %edi
callq 0x2180
movl $0x1, %ebp
callq 0x2070
movslq %eax, %r14
imulq $0x6bca1af3, %r14, %rax # imm = 0x6BCA1AF3
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x23, %rax
addl %ecx, %eax
leal (%rax,%rax,8), %ecx
leal (%rax,%rcx,2), %eax
subl %eax, %r14d
callq 0x2070
movslq %eax, %rcx
imulq $0x66666667, %rcx, %rax # imm = 0x66666667
movq %rax, %rdx
shrq $0x3f, %rdx
sarq $0x25, %rax
addl %edx, %eax
shll $0x4, %eax
leal (%rax,%rax,4), %eax
subl %eax, %ecx
movq 0x10(%rbx), %rdx
movq 0x30(%rbx), %rax
cmpq %rax, %rdx
je 0x44e8
movq 0x20(%rbx), %r8
movq 0x28(%rbx), %rdi
xorl %esi, %esi
cmpl (%rdx), %r14d
jne 0x44c3
cmpl 0x4(%rdx), %ecx
cmovel %ebp, %esi
addq $0xc, %rdx
cmpq %r8, %rdx
jne 0x44db
movq 0x8(%rdi), %rdx
addq $0x8, %rdi
leaq 0x1f8(%rdx), %r8
cmpq %rax, %rdx
jne 0x44b8
testl %esi, %esi
jne 0x4458
shlq $0x20, %rcx
movl %r14d, %eax
orq %rcx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/attractivechaos[P]udb2/unordered_dense/./unordered_dense.h
// Function: ankerl::unordered_dense::v4_1_2::detail::table<unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int, unsigned int>>, ankerl::unordered_dense::v4_1_2::bucket_type::standard, false>::erase(__gnu_cxx::__normal_iterator<std::pair<unsigned int, unsigned int>*, std::vector<std::pair<unsigned int, unsigned int>, std::allocator<std::pair<unsigned int, unsigned int>>>>)
auto erase(iterator it) -> iterator {
        auto hash = mixed_hash(get_key(*it));
        auto bucket_idx = bucket_idx_from_hash(hash);

        auto const value_idx_to_remove = static_cast<value_idx_type>(it - cbegin());
        while (at(m_buckets, bucket_idx).m_value_idx != value_idx_to_remove) {
            bucket_idx = next(bucket_idx);
        }

        do_erase(bucket_idx);
        return begin() + static_cast<difference_type>(value_idx_to_remove);
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl (%rsi), %eax
movabsq $-0x61c8864680b583eb, %rcx # imm = 0x9E3779B97F4A7C15
mulq %rcx
xorq %rax, %rdx
movb 0x36(%rdi), %cl
shrq %cl, %rdx
subq (%rdi), %r14
sarq $0x3, %r14
movq 0x18(%rdi), %rax
movl %edx, %ecx
cmpl %r14d, 0x4(%rax,%rcx,8)
je 0x1785
movq 0x20(%rbx), %rcx
xorl %esi, %esi
incl %edx
cmpq %rdx, %rcx
cmovel %esi, %edx
cmpl %r14d, 0x4(%rax,%rdx,8)
jne 0x1776
movq %rbx, %rdi
movl %edx, %esi
callq 0x1cec
movl %r14d, %eax
shlq $0x3, %rax
addq (%rbx), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/zkl94[P]distributed-key-value-store/MP1Node.cpp
// Function: MP1Node::nodeStart(char*, short)
void MP1Node::nodeStart(char *servaddrstr, short servport) {
    // join address is the address of the introducer
    Address joinaddr;
    joinaddr = getJoinAddress();

    Address *my_addr = &this->memberNode->addr;

    // Self booting routines
    if( initThisNode(my_addr) == -1 ) {
#ifdef DEBUGLOG
        log->LOG(&memberNode->addr, "init_thisnode failed. Exit.");
#endif
        exit(1);
    }

    if( !introduceSelfToGroup(&joinaddr) ) {
        finishUpThisNode();
#ifdef DEBUGLOG
        log->LOG(&memberNode->addr, "Unable to join self to group. Exiting.");
#endif
        exit(1);
    }

    return;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rsi
movl $0x1, (%rsi)
movw $0x0, 0x4(%rsi)
leaq 0x2(%rsp), %rdi
callq 0xd02a
movq 0x20(%rbx), %rax
movb $0x0, 0x10(%rax)
movw $0x1, 0xe(%rax)
movl $0x0, 0x14(%rax)
movq $0x0, 0x18(%rax)
movabsq $-0xfffffffb, %rcx      # imm = 0xFFFFFFFF00000005
movq %rcx, 0x20(%rax)
movq 0x28(%rax), %rcx
cmpq %rcx, 0x30(%rax)
je 0x3bde
movq %rcx, 0x30(%rax)
leaq 0x2(%rsp), %rsi
movq %rbx, %rdi
callq 0x3c3e
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/zkl94[P]distributed-key-value-store/MP1Node.cpp
// Function: MP1Node::introduceSelfToGroup(Address*)
int MP1Node::introduceSelfToGroup(Address *joinaddr) {
    MessageHdr *msg;
#ifdef DEBUGLOG
    static char s[1024];
#endif

    if ( 0 == memcmp((char *)&(memberNode->addr.addr), (char *)&(joinaddr->addr), sizeof(memberNode->addr.addr))) {
        // I am the group booter (first process to join the group). Boot up the group
#ifdef DEBUGLOG
        log->LOG(&memberNode->addr, "Starting up group...");
#endif
        memberNode->inGroup = true;
    }
    else {

        // member node in group only after receiving JOINREP

        size_t msgsize = sizeof(MessageHdr) + sizeof(joinaddr->addr) + sizeof(long);
        msg = (MessageHdr *) malloc(msgsize * sizeof(char));

        // create JOINREQ message: format of data is {struct Address myaddr}
        msg->msgType = JOINREQ;
        memcpy((char *)(msg+1), &memberNode->addr.addr, sizeof(memberNode->addr.addr));
        memcpy((char *)(msg+1) + sizeof(memberNode->addr.addr), &memberNode->heartbeat, sizeof(long));

#ifdef DEBUGLOG
        sprintf(s, "Trying to join...");
        log->LOG(&memberNode->addr, s);
#endif

        // send JOINREQ message to introducer member
        emulNet->ENsend(&memberNode->addr, joinaddr, (char *)msg, msgsize);

        free(msg);
    }

    // add self to memberlist; self is ALWAYS the first member
    int id = 0;
    short port;
    memcpy(&id, &(memberNode->addr.addr[0]), sizeof(int));
    memcpy(&port, &(memberNode->addr.addr[4]), sizeof(short));
    MemberListEntry *newEntry = new MemberListEntry(id, port, 0, par->getcurrtime());
    memberNode->memberList.push_back(*newEntry);

    return 1;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %r13
movl 0x8(%r13), %eax
xorl (%rsi), %eax
movzwl 0xc(%r13), %ecx
xorw 0x4(%rsi), %cx
movzwl %cx, %ecx
orl %eax, %ecx
je 0x3cc2
movq %rsi, %r14
leaq 0x8(%r13), %r15
movl $0x12, %edi
callq 0x3350
movq %rax, %r12
movl $0x0, (%rax)
movl (%r15), %eax
movl %eax, 0x4(%r12)
movzwl 0x4(%r15), %eax
movw %ax, 0x8(%r12)
movq 0x18(%r13), %rax
movq %rax, 0xa(%r12)
movq 0x8(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r12, %rcx
movl $0x12, %r8d
callq 0x6e4c
movq %r12, %rdi
callq 0x3320
movq 0x20(%rbx), %r13
jmp 0x3cc7
movb $0x1, 0xf(%r13)
movl 0x8(%r13), %ebp
movzwl 0xc(%r13), %r15d
movl $0x18, %edi
callq 0x3270
movq %rax, %r14
movq 0x18(%rbx), %rdi
callq 0xd00e
movslq %eax, %r8
movswl %r15w, %edx
movq %r14, %rdi
movl %ebp, %esi
xorl %ecx, %ecx
callq 0xd050
movq 0x20(%rbx), %rdi
addq $0x28, %rdi
movq %r14, %rsi
callq 0x629a
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x18, %esi
movq %r14, %rdi
callq 0x3280
movq %rbx, %rdi
callq 0x3450
nop
// File: /workspace/github_cpp_makefile_star2_O3/zkl94[P]distributed-key-value-store/MP1Node.cpp
// Function: MP1Node::recvCallBack(void*, char*, int)
bool MP1Node::recvCallBack(void *env, char *data, int size) {

    // for introduction:
    // two message types: JOINREQ, JOINREP
    // 1. when introducer receives JOINREQ, add the node to member list, and return JOINREP with cluster member list
    // 2. when cluster member receives JOINREP, add the cluster member list

    // for membership:
    // one message type: MEMBERLIST
    // 1. when receive MEMBERLIST, update you own member list accordingly

    MsgTypes msgType = ((MessageHdr *)data)->msgType;

    switch (msgType) {
        case JOINREQ:
            handleJOINREQ(env, data, size);
            break;
        case JOINREP:
            handleJOINREP(env, data, size);
            break;
        case MEMBERLIST:
            handleMEMBERLIST(env, data, size);
            break;
        default:
            cout << "unknown message type" <<endl;
            break;
    }

    return false;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl (%rdx), %eax
cmpl $0x2, %eax
je 0x4ee8
cmpl $0x1, %eax
je 0x4ed6
testl %eax, %eax
jne 0x4ef2
movq %rbx, %rdi
callq 0x52f4
jmp 0x4f34
movq %rbx, %rdi
callq 0x5ba2
movq 0x20(%rbx), %rax
movb $0x1, 0xf(%rax)
jmp 0x4f34
movq %rbx, %rdi
callq 0x5ba2
jmp 0x4f34
movq 0x1a0d7(%rip), %rbx     # 0x1efd0
leaq 0x12104(%rip), %rsi     # 0x17004
movl $0x14, %edx
movq %rbx, %rdi
callq 0x32d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31a0
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/zkl94[P]distributed-key-value-store/MP1Node.cpp
// Function: MP1Node::handleMEMBERLIST(void*, char*, int)
void MP1Node::handleMEMBERLIST(void *env, char *data, int size) {
    #ifdef DEBUG_MEMBERLIST
        cout << "just got a member list" << endl;
    #endif

    int entry_num = (size - 4)/ (6+8);
    int currentOffset = 4;
    char addr[6];
    int id = 0;
    short port;
    long heartbeat = 0;

    MessageHdr *msg = (MessageHdr *)data;

    // if, during the process of to be deleted, a heartbeat from that node is received,
    // the node entry should be removed from to be deleted map and member list entry
    // should be re-activated
    // how to tell: the first entry in message is the node's source
    memcpy(&addr, (char *)(msg)+currentOffset, 6);
    memcpy(&id, &addr[0], sizeof(int));
    if (this->tobedeleted->count(id) != 0) {
        std::map<int, int>::iterator it = this->tobedeleted->begin();
    
        while(it != this->tobedeleted->end()) {
            if (it->first == id) {
                this->tobedeleted->erase(it);
                break;
            }
            ++it;
        }
    } // then updateEntry will do the normal update

    // for every addr and heartbeat in the incoming member list
    for (int i = 0; i < entry_num; ++i)
    {
        // extract id and port
        memcpy(&addr, (char *)(msg)+currentOffset, 6);
        currentOffset += 6;
        memcpy(&id, &addr[0], sizeof(int));
        memcpy(&port, &addr[4], sizeof(short));
        
        // heartbeat
        memcpy(&heartbeat, (char *)(msg)+currentOffset, 8);
        currentOffset += 8;

        updateEntry(memberNode, id, port, heartbeat);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r15d
movq %rdx, %rbx
movq %rdi, %r14
movq 0x38(%rdi), %r12
movq 0x10(%r12), %rax
testq %rax, %rax
je 0x5c13
movl 0x4(%rbx), %ebp
leaq 0x8(%r12), %r13
movq %r13, %rcx
xorl %edx, %edx
cmpl %ebp, 0x20(%rax)
setl %dl
cmovgeq %rax, %rcx
movq 0x10(%rax,%rdx,8), %rax
testq %rax, %rax
jne 0x5bcf
cmpq %r13, %rcx
je 0x5c13
cmpl 0x20(%rcx), %ebp
jl 0x5c13
movq 0x18(%r12), %rax
cmpq %r13, %rax
je 0x5c13
cmpl %ebp, 0x20(%rax)
je 0x5c08
movq %rax, %rdi
callq 0x31b0
jmp 0x5bf4
movq %r12, %rdi
movq %rax, %rsi
callq 0x6a64
cmpl $0x12, %r15d
jl 0x5c67
leal -0x4(%r15), %eax
cltq
imulq $-0x6db6db6d, %rax, %rax # imm = 0x92492493
shrq $0x20, %rax
addl %r15d, %eax
addl $-0x4, %eax
movl %eax, %ecx
shrl $0x1f, %ecx
sarl $0x3, %eax
addl %ecx, %eax
cmpl $0x2, %eax
movl $0x1, %ebp
cmovgel %eax, %ebp
addq $0xa, %rbx
movl -0x6(%rbx), %edx
movswl -0x2(%rbx), %ecx
movq (%rbx), %r8
movq 0x20(%r14), %rsi
movq %r14, %rdi
callq 0x5c76
addq $0xe, %rbx
decl %ebp
jne 0x5c49
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/zkl94[P]distributed-key-value-store/MP1Node.cpp
// Function: MP1Node::updateEntry(Member*, int, short, long)
void MP1Node::updateEntry(Member *memberNode, int id, short port, long heartbeat) {
    // if this node (with id) is already in to be deleted map, just ignore it
    auto alreadyintobedeletedlist = this->tobedeleted->count(id);
    if (alreadyintobedeletedlist != 0) {
        // already in to be deleted map
        // cout << "already in tobedeleted map, ignore the update" <<endl;
        return;
    }

    // if it is not to be deleted, then update/insert normally
    bool found = false;
    for (MemberListEntry memberListEntry: memberNode->memberList) {
        if (memberListEntry.getid() == id && memberListEntry.getport() == port) {
            found = true;
            // the incoming heartbeat is more latest
            if (memberListEntry.getheartbeat() < heartbeat) {
                // cout << "doing heartbeat update for " << id <<endl;
                memberListEntry.setheartbeat(heartbeat);
                memberListEntry.settimestamp(par->getcurrtime());
            }
            break;
        }
    }

    if (!found) {
        MemberListEntry *newEntry = new MemberListEntry(id, port, heartbeat, par->getcurrtime());
        memberNode->memberList.push_back(*newEntry);

        logNodeAddWrapper(memberNode, id, port);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, %r12d
movl %edx, %ebp
movq %rsi, %r15
movq 0x38(%rdi), %rax
movq 0x10(%rax), %rcx
testq %rcx, %rcx
je 0x5cc5
addq $0x8, %rax
movq %rax, %rdx
xorl %esi, %esi
cmpl %ebp, 0x20(%rcx)
setl %sil
cmovgeq %rcx, %rdx
movq 0x10(%rcx,%rsi,8), %rcx
testq %rcx, %rcx
jne 0x5ca0
cmpq %rax, %rdx
je 0x5cc5
cmpl %ebp, 0x20(%rdx)
jle 0x5d5d
movq %r8, 0x8(%rsp)
movq %rdi, (%rsp)
movq 0x28(%r15), %r13
movq 0x30(%r15), %rbx
cmpq %rbx, %r13
je 0x5d0e
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0xd068
movq %r14, %rdi
callq 0xd09e
cmpl %ebp, %eax
jne 0x5d05
movq %r14, %rdi
callq 0xd0a2
cmpw %r12w, %ax
je 0x5d6c
addq $0x18, %r13
cmpq %rbx, %r13
jne 0x5ce0
movl $0x18, %edi
callq 0x3270
movq %rax, %r13
movq (%rsp), %rbx
movq 0x18(%rbx), %rdi
callq 0xd00e
movslq %eax, %r8
movswl %r12w, %r14d
movq %r13, %rdi
movl %ebp, %esi
movl %r14d, %edx
movq 0x8(%rsp), %rcx
callq 0xd050
leaq 0x28(%r15), %rdi
movq %r13, %rsi
callq 0x629a
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
movl %r14d, %ecx
callq 0x4f38
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10(%rsp), %rdi
callq 0xd0a8
movq 0x8(%rsp), %rsi
cmpq %rsi, %rax
jge 0x5d5d
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0xd0be
movq (%rsp), %rax
movq 0x18(%rax), %rdi
callq 0xd00e
movslq %eax, %rsi
movq %r14, %rdi
callq 0xd0c4
jmp 0x5d5d
movq %rax, %rbx
movl $0x18, %esi
movq %r13, %rdi
callq 0x3280
movq %rbx, %rdi
callq 0x3450
// File: /workspace/github_cpp_makefile_star2_O3/zkl94[P]distributed-key-value-store/MP1Node.cpp
// Function: isEntryInvalid(Member*, MemberListEntry&)
bool isEntryInvalid(Member *memberNode, MemberListEntry& memberListEntry) {
    long entry_timestamp = memberListEntry.gettimestamp();
    long node_timestamp = memberNode->memberList[0].gettimestamp();

    if (node_timestamp - entry_timestamp > TFAIL) {
        return true;
    }
    return false;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsi, %rdi
callq 0xd0ae
movq %rax, %r14
movq 0x28(%rbx), %rdi
callq 0xd0ae
subq %r14, %rax
cmpq $0x6, %rax
setge %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/zkl94[P]distributed-key-value-store/Application.cpp
// Function: Application::run()
int Application::run()
{
	int i;
	int timeWhenAllNodesHaveJoined = 0;
	// boolean indicating if all nodes have joined
	bool allNodesJoined = false;
	srand(time(NULL));

	// As time runs along
	for( par->globaltime = 0; par->globaltime < TOTAL_RUNNING_TIME; ++par->globaltime ) {
		// Run the membership protocol
		mp1Run();

		// Wait for all nodes to join
		if ( par->allNodesJoined == nodeCount && !allNodesJoined ) {
			timeWhenAllNodesHaveJoined = par->getcurrtime();
			allNodesJoined = true;
		}
		if ( par->getcurrtime() > timeWhenAllNodesHaveJoined + 50 ) {
			// Call the KV store functionalities
			mp2Run();
		}
		// Fail some nodes
		//fail();
	}

	// Clean up
	en->ENcleanup();
	en1->ENcleanup();

	for(i=0;i<=par->EN_GPSZ-1;i++) {
		 mp1[i]->finishUpThisNode();
	}

	return SUCCESS;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x3210
movl %eax, %edi
callq 0x3230
movq 0x50(%rbx), %rax
movl $0x0, 0x28(%rax)
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x785a
movq 0x50(%rbx), %rdi
movl 0x2c(%rdi), %eax
cmpl 0x17e24(%rip), %eax     # 0x1f278
setne %al
orb %r15b, %al
testb $0x1, %al
jne 0x746d
callq 0xd00e
movl %eax, %r14d
movq 0x50(%rbx), %rdi
movb $0x1, %r15b
callq 0xd00e
leal 0x32(%r14), %ecx
cmpl %ecx, %eax
jle 0x7482
movq %rbx, %rdi
callq 0x7a44
movq 0x50(%rbx), %rax
movl 0x28(%rax), %ecx
leal 0x1(%rcx), %edx
movl %edx, 0x28(%rax)
cmpl $0x2bb, %ecx            # imm = 0x2BB
jl 0x743f
movq 0x28(%rbx), %rdi
callq 0x7142
movq 0x30(%rbx), %rdi
callq 0x7142
movq 0x50(%rbx), %rax
cmpl $0x0, 0x18(%rax)
jle 0x74d3
xorl %r14d, %r14d
movq 0x40(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3d36
incq %r14
movq 0x50(%rbx), %rax
movslq 0x18(%rax), %rax
cmpq %rax, %r14
jl 0x74b6
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/zkl94[P]distributed-key-value-store/Application.cpp
// Function: Application::~Application()
Application::~Application() {
	delete log;
	delete en;
	delete en1;
	for ( int i = 0; i < par->EN_GPSZ; i++ ) {
		delete mp1[i];
		delete mp2[i];
	}
	free(mp1);
	free(mp2);
	delete par;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x17541(%rip), %rax     # 0x1ecd0
movq %rax, (%rdi)
movq 0x38(%rdi), %rdi
testq %rdi, %rdi
je 0x77a1
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x77b0
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x77bf
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x50(%rbx), %rax
cmpl $0x0, 0x18(%rax)
jle 0x7811
xorl %r15d, %r15d
movq 0x40(%rbx), %rax
movq (%rax,%r15,8), %rdi
testq %rdi, %rdi
je 0x77df
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x48(%rbx), %rax
movq (%rax,%r15,8), %r14
testq %r14, %r14
je 0x77f4
movq %r14, %rdi
callq 0xec6e
movl $0xc0, %esi
movq %r14, %rdi
callq 0x3280
incq %r15
movq 0x50(%rbx), %rax
movslq 0x18(%rax), %rax
cmpq %rax, %r15
jl 0x77cc
movq 0x40(%rbx), %rdi
callq 0x3320
movq 0x48(%rbx), %rdi
callq 0x3320
movq 0x50(%rbx), %rdi
movl $0x38, %esi
callq 0x3280
addq $0x58, %rbx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xbd46
// File: /workspace/github_cpp_makefile_star2_O3/zkl94[P]distributed-key-value-store/Application.cpp
// Function: Application::findARandomNodeThatIsAlive()
int Application::findARandomNodeThatIsAlive() {
	int number;
	do {
		number = (rand()%par->EN_GPSZ);
	}while (mp2[number]->getMemberNode()->bFailed);
	return number;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x30a0
movq 0x48(%rbx), %rcx
movq 0x50(%rbx), %rsi
cltd
idivl 0x18(%rsi)
movslq %edx, %rax
movq (%rcx,%rax,8), %rax
movq 0x50(%rax), %rax
cmpb $0x0, 0x10(%rax)
jne 0xb472
movl %edx, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/zkl94[P]distributed-key-value-store/Log.cpp
// Function: Log::logCreateSuccess(Address*, bool, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Log::logCreateSuccess(Address * address, bool isCoordinator, int transID, string key, string value){
	static char stdstring[100];
	string str;
	if (isCoordinator)
		str = "coordinator";
	else
		str = "server";
	sprintf(stdstring, "%s: create success at time %d, transID=%d, key=%s, value=%s", str.c_str(), par->getcurrtime(), transID, key.c_str(), value.c_str());
    LOG(address, stdstring);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %r15
movq %r8, %r12
movl %ecx, %ebp
movq %rsi, 0x10(%rsp)
movq %rdi, %r14
leaq 0x28(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq $0x0, -0x8(%rbx)
movb $0x0, (%rbx)
leaq 0xb1b2(%rip), %rax      # 0x1793f
leaq 0xb1b7(%rip), %rcx      # 0x1794b
testl %edx, %edx
cmovneq %rax, %rcx
movl %edx, %eax
leaq (%rax,%rax,4), %r8
addq $0x6, %r8
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x33f0
movq 0x18(%rsp), %r13
movq 0x8(%r14), %rdi
callq 0xd00e
movq (%r12), %r9
movq (%r15), %rcx
movq %rcx, (%rsp)
leaq 0x1a11e(%rip), %r15     # 0x268f0
leaq 0xb179(%rip), %rsi      # 0x17952
movq %r15, %rdi
movq %r13, %rdx
movl %eax, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x3080
movq %r14, %rdi
movq 0x10(%rsp), %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0xc3a4
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0xc814
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3280
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0xc83d
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3280
movq %r14, %rdi
callq 0x3450
nop
// File: /workspace/github_cpp_makefile_star2_O3/zkl94[P]distributed-key-value-store/Log.cpp
// Function: Log::logReadSuccess(Address*, bool, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Log::logReadSuccess(Address * address, bool isCoordinator, int transID, string key, string value){
    static char stdstring[100];
	string str;
	if (isCoordinator)
		str = "coordinator";
	else
		str = "server";
	sprintf(stdstring, "%s: read success at time %d, transID=%d, key=%s, value=%s", str.c_str(), par->getcurrtime(), transID, key.c_str(), value.c_str());
    LOG(address, stdstring);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %r15
movq %r8, %r12
movl %ecx, %ebp
movq %rsi, 0x10(%rsp)
movq %rdi, %r14
leaq 0x28(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq $0x0, -0x8(%rbx)
movb $0x0, (%rbx)
leaq 0xb0c0(%rip), %rax      # 0x1793f
leaq 0xb0c5(%rip), %rcx      # 0x1794b
testl %edx, %edx
cmovneq %rax, %rcx
movl %edx, %eax
leaq (%rax,%rax,4), %r8
addq $0x6, %r8
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x33f0
movq 0x18(%rsp), %r13
movq 0x8(%r14), %rdi
callq 0xd00e
movq (%r12), %r9
movq (%r15), %rcx
movq %rcx, (%rsp)
leaq 0x1a09c(%rip), %r15     # 0x26960
leaq 0xb0c3(%rip), %rsi      # 0x1798e
movq %r15, %rdi
movq %r13, %rdx
movl %eax, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x3080
movq %r14, %rdi
movq 0x10(%rsp), %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0xc3a4
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0xc906
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3280
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0xc92f
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3280
movq %r14, %rdi
callq 0x3450
nop
// File: /workspace/github_cpp_makefile_star2_O3/zkl94[P]distributed-key-value-store/Log.cpp
// Function: Log::logUpdateSuccess(Address*, bool, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Log::logUpdateSuccess(Address * address, bool isCoordinator, int transID, string key, string newValue){
    static char stdstring[100];
	string str;
	if (isCoordinator)
		str = "coordinator";
	else
		str = "server";
	sprintf(stdstring, "%s: update success at time %d, transID=%d, key=%s, value=%s", str.c_str(), par->getcurrtime(), transID, key.c_str(), newValue.c_str());
    LOG(address, stdstring);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %r15
movq %r8, %r12
movl %ecx, %ebp
movq %rsi, 0x10(%rsp)
movq %rdi, %r14
leaq 0x28(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq $0x0, -0x8(%rbx)
movb $0x0, (%rbx)
leaq 0xafce(%rip), %rax      # 0x1793f
leaq 0xafd3(%rip), %rcx      # 0x1794b
testl %edx, %edx
cmovneq %rax, %rcx
movl %edx, %eax
leaq (%rax,%rax,4), %r8
addq $0x6, %r8
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x33f0
movq 0x18(%rsp), %r13
movq 0x8(%r14), %rdi
callq 0xd00e
movq (%r12), %r9
movq (%r15), %rcx
movq %rcx, (%rsp)
leaq 0x1a01a(%rip), %r15     # 0x269d0
leaq 0xb00b(%rip), %rsi      # 0x179c8
movq %r15, %rdi
movq %r13, %rdx
movl %eax, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x3080
movq %r14, %rdi
movq 0x10(%rsp), %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0xc3a4
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0xc9f8
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3280
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0xca21
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3280
movq %r14, %rdi
callq 0x3450
nop
// File: /workspace/github_cpp_makefile_star2_O3/zkl94[P]distributed-key-value-store/Log.cpp
// Function: Log::logDeleteSuccess(Address*, bool, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Log::logDeleteSuccess(Address * address, bool isCoordinator, int transID, string key){
    static char stdstring[100];
	string str;
	if (isCoordinator)
		str = "coordinator";
	else
		str = "server";
	sprintf(stdstring, "%s: delete success at time %d, transID=%d, key=%s", str.c_str(), par->getcurrtime(), transID, key.c_str());
    LOG(address, stdstring);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %r15
movl %ecx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
leaq 0xaedf(%rip), %rax      # 0x1793f
leaq 0xaee4(%rip), %rcx      # 0x1794b
testl %edx, %edx
cmovneq %rax, %rcx
movl %edx, %eax
leaq (%rax,%rax,4), %r8
addq $0x6, %r8
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x33f0
movq 0x8(%rsp), %r12
movq 0x8(%r14), %rdi
callq 0xd00e
movq (%r15), %r9
leaq 0x19fa3(%rip), %r15     # 0x26a40
leaq 0xaf60(%rip), %rsi      # 0x17a04
movq %r15, %rdi
movq %r12, %rdx
movl %eax, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x3080
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0xc3a4
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0xcadd
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3280
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0xcb06
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3280
movq %rbx, %rdi
callq 0x3450
// File: /workspace/github_cpp_makefile_star2_O3/zkl94[P]distributed-key-value-store/Log.cpp
// Function: Log::logCreateFail(Address*, bool, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Log::logCreateFail(Address * address, bool isCoordinator, int transID, string key, string value){
	static char stdstring[100];
	string str;
	if (isCoordinator)
		str = "coordinator";
	else
		str = "server";
	sprintf(stdstring, "%s: create fail at time %d, transID=%d, key=%s, value=%s", str.c_str(), par->getcurrtime(), transID, key.c_str(), value.c_str());
    LOG(address, stdstring);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %r15
movq %r8, %r12
movl %ecx, %ebp
movq %rsi, 0x10(%rsp)
movq %rdi, %r14
leaq 0x28(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq $0x0, -0x8(%rbx)
movb $0x0, (%rbx)
leaq 0xadf8(%rip), %rax      # 0x1793f
leaq 0xadfd(%rip), %rcx      # 0x1794b
testl %edx, %edx
cmovneq %rax, %rcx
movl %edx, %eax
leaq (%rax,%rax,4), %r8
addq $0x6, %r8
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x33f0
movq 0x18(%rsp), %r13
movq 0x8(%r14), %rdi
callq 0xd00e
movq (%r12), %r9
movq (%r15), %rcx
movq %rcx, (%rsp)
leaq 0x19f24(%rip), %r15     # 0x26ab0
leaq 0xaea3(%rip), %rsi      # 0x17a36
movq %r15, %rdi
movq %r13, %rdx
movl %eax, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x3080
movq %r14, %rdi
movq 0x10(%rsp), %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0xc3a4
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0xcbce
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3280
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0xcbf7
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3280
movq %r14, %rdi
callq 0x3450
nop
// File: /workspace/github_cpp_makefile_star2_O3/zkl94[P]distributed-key-value-store/Log.cpp
// Function: Log::logReadFail(Address*, bool, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Log::logReadFail(Address * address, bool isCoordinator, int transID, string key){
    static char stdstring[100];
	string str;
	if (isCoordinator)
		str = "coordinator";
	else
		str = "server";
	sprintf(stdstring, "%s: read fail at time %d, transID=%d, key=%s", str.c_str(), par->getcurrtime(), transID, key.c_str());
    LOG(address, stdstring);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %r15
movl %ecx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
leaq 0xad09(%rip), %rax      # 0x1793f
leaq 0xad0e(%rip), %rcx      # 0x1794b
testl %edx, %edx
cmovneq %rax, %rcx
movl %edx, %eax
leaq (%rax,%rax,4), %r8
addq $0x6, %r8
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x33f0
movq 0x8(%rsp), %r12
movq 0x8(%r14), %rdi
callq 0xd00e
movq (%r15), %r9
leaq 0x19ead(%rip), %r15     # 0x26b20
leaq 0xadf5(%rip), %rsi      # 0x17a6f
movq %r15, %rdi
movq %r12, %rdx
movl %eax, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x3080
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0xc3a4
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0xccb3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3280
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0xccdc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3280
movq %rbx, %rdi
callq 0x3450
// File: /workspace/github_cpp_makefile_star2_O3/zkl94[P]distributed-key-value-store/Log.cpp
// Function: Log::logUpdateFail(Address*, bool, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Log::logUpdateFail(Address * address, bool isCoordinator, int transID, string key, string newValue){
    static char stdstring[100];
	string str;
	if (isCoordinator)
		str = "coordinator";
	else
		str = "server";
	sprintf(stdstring, "%s: update fail at time %d, transID=%d, key=%s, value=%s", str.c_str(), par->getcurrtime(), transID, key.c_str(), newValue.c_str());
    LOG(address, stdstring);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %r15
movq %r8, %r12
movl %ecx, %ebp
movq %rsi, 0x10(%rsp)
movq %rdi, %r14
leaq 0x28(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq $0x0, -0x8(%rbx)
movb $0x0, (%rbx)
leaq 0xac22(%rip), %rax      # 0x1793f
leaq 0xac27(%rip), %rcx      # 0x1794b
testl %edx, %edx
cmovneq %rax, %rcx
movl %edx, %eax
leaq (%rax,%rax,4), %r8
addq $0x6, %r8
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x33f0
movq 0x18(%rsp), %r13
movq 0x8(%r14), %rdi
callq 0xd00e
movq (%r12), %r9
movq (%r15), %rcx
movq %rcx, (%rsp)
leaq 0x19e2e(%rip), %r15     # 0x26b90
leaq 0xad33(%rip), %rsi      # 0x17a9c
movq %r15, %rdi
movq %r13, %rdx
movl %eax, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x3080
movq %r14, %rdi
movq 0x10(%rsp), %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0xc3a4
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0xcda4
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3280
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0xcdcd
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3280
movq %r14, %rdi
callq 0x3450
nop
// File: /workspace/github_cpp_makefile_star2_O3/zkl94[P]distributed-key-value-store/Log.cpp
// Function: Log::logDeleteFail(Address*, bool, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Log::logDeleteFail(Address * address, bool isCoordinator, int transID, string key){
    static char stdstring[100];
	string str;
	if (isCoordinator)
		str = "coordinator";
	else
		str = "server";
	sprintf(stdstring, "%s: delete fail at time %d, transID=%d, key=%s", str.c_str(), par->getcurrtime(), transID, key.c_str());
    LOG(address, stdstring);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %r15
movl %ecx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
leaq 0xab33(%rip), %rax      # 0x1793f
leaq 0xab38(%rip), %rcx      # 0x1794b
testl %edx, %edx
cmovneq %rax, %rcx
movl %edx, %eax
leaq (%rax,%rax,4), %r8
addq $0x6, %r8
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x33f0
movq 0x8(%rsp), %r12
movq 0x8(%r14), %rdi
callq 0xd00e
movq (%r15), %r9
leaq 0x19db7(%rip), %r15     # 0x26c00
leaq 0xac85(%rip), %rsi      # 0x17ad5
movq %r15, %rdi
movq %r12, %rdx
movl %eax, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x3080
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0xc3a4
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0xce89
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3280
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0xceb2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3280
movq %rbx, %rdi
callq 0x3450
nop
// File: /workspace/github_cpp_makefile_star2_O3/zkl94[P]distributed-key-value-store/Params.cpp
// Function: Params::setparams(char*)
void Params::setparams(char *config_file) {
	//trace.funcEntry("Params::setparams");
	char CRUD[10];
	FILE *fp = fopen(config_file,"r");

	fscanf(fp,"MAX_NNB: %d", &MAX_NNB);
	fscanf(fp,"\nSINGLE_FAILURE: %d", &SINGLE_FAILURE);
	fscanf(fp,"\nDROP_MSG: %d", &DROP_MSG);
	fscanf(fp,"\nMSG_DROP_PROB: %lf", &MSG_DROP_PROB);
	fscanf(fp,"\nCRUD_TEST: %s", CRUD);

	if ( 0 == strcmp(CRUD, "CREATE") ) {
		this->CRUDTEST = CREATE_TEST;
	}
	else if ( 0 == strcmp(CRUD, "READ") ) {
		this->CRUDTEST = READ_TEST;
	}
	else if ( 0 == strcmp(CRUD, "UPDATE") ) {
		this->CRUDTEST = UPDATE_TEST;
	}
	else if ( 0 == strcmp(CRUD, "DELETE") ) {
		this->CRUDTEST = DELETE_TEST;
	}

	//printf("Parameters of the test case: %d %d %d %lf\n", MAX_NNB, SINGLE_FAILURE, DROP_MSG, MSG_DROP_PROB);

	EN_GPSZ = MAX_NNB;
	STEP_RATE=.25;
	MAX_MSG_SIZE = 4000;
	globaltime = 0;
	dropmsg = 0;
	allNodesJoined = 0;
	for ( unsigned int i = 0; i < EN_GPSZ; i++ ) {
		allNodesJoined += i;
	}
	fclose(fp);
	//trace.funcExit("Params::setparams", SUCCESS);
	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rax
movq %rdi, %rbx
leaq 0xaa75(%rip), %rsi      # 0x17950
movq %rax, %rdi
callq 0x3310
movq %rax, %r14
leaq 0xac1c(%rip), %rsi      # 0x17b09
xorl %ebp, %ebp
movq %rax, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3470
leaq 0x4(%rbx), %rdx
leaq 0xac0e(%rip), %rsi      # 0x17b15
movq %r14, %rdi
xorl %eax, %eax
callq 0x3470
leaq 0x20(%rbx), %rdx
leaq 0xac0d(%rip), %rsi      # 0x17b29
movq %r14, %rdi
xorl %eax, %eax
callq 0x3470
leaq 0x8(%rbx), %rdx
leaq 0xac06(%rip), %rsi      # 0x17b37
movq %r14, %rdi
xorl %eax, %eax
callq 0x3470
leaq 0xac09(%rip), %rsi      # 0x17b4b
leaq 0xe(%rsp), %r15
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3470
movl $0x41455243, %eax       # imm = 0x41455243
xorl (%r15), %eax
movl $0x455441, %ecx         # imm = 0x455441
xorl 0x3(%r15), %ecx
orl %eax, %ecx
je 0xcfba
movl $0x44414552, %eax       # imm = 0x44414552
xorl 0xe(%rsp), %eax
movzbl 0x12(%rsp), %ecx
orl %eax, %ecx
je 0xcfae
movl $0x41445055, %eax       # imm = 0x41445055
xorl 0xe(%rsp), %eax
movl $0x455441, %ecx         # imm = 0x455441
xorl 0x11(%rsp), %ecx
orl %eax, %ecx
je 0xcfb5
movl $0x454c4544, %eax       # imm = 0x454C4544
xorl 0xe(%rsp), %eax
movl $0x455445, %ecx         # imm = 0x455445
xorl 0x11(%rsp), %ecx
orl %eax, %ecx
jne 0xcfbd
movl $0x3, %ebp
jmp 0xcfba
movl $0x1, %ebp
jmp 0xcfba
movl $0x2, %ebp
movl %ebp, 0x34(%rbx)
movl (%rbx), %eax
movl %eax, 0x18(%rbx)
movabsq $0x3fd0000000000000, %rcx # imm = 0x3FD0000000000000
movq %rcx, 0x10(%rbx)
movl $0xfa0, 0x1c(%rbx)      # imm = 0xFA0
movq $0x0, 0x24(%rbx)
testl %eax, %eax
je 0xcff6
leal -0x1(%rax), %ecx
leal -0x2(%rax), %edx
imulq %rcx, %rdx
shrq %rdx
addl %edx, %eax
decl %eax
jmp 0xcff8
xorl %eax, %eax
movl %eax, 0x2c(%rbx)
movq %r14, %rdi
callq 0x3260
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/zkl94[P]distributed-key-value-store/MP2Node.cpp
// Function: MP2Node::MP2Node(Member*, Params*, EmulNet*, Log*, Address*)
MP2Node::MP2Node(Member *memberNode, Params *par, EmulNet *emulNet, Log *log, Address *address) {
    this->memberNode = memberNode;
    this->par = par;
    this->emulNet = emulNet;
    this->log = log;
    ht = new HashTable();
    this->memberNode->addr = *address;
    this->lowestTransID = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r9, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x70(%rdi)
xorl %eax, %eax
movq %rax, 0x80(%rdi)
addq $0x98, %rdi
movl $0x0, 0x98(%rbx)
movq %rax, 0xa0(%rbx)
movups %xmm0, (%rbx)
movups %xmm0, 0x10(%rbx)
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x30(%rbx)
movq %rax, 0x40(%rbx)
movq %rdi, 0xa8(%rbx)
movq %rdi, 0xb0(%rbx)
movq %rax, 0xb8(%rbx)
movq %rsi, 0x50(%rbx)
movq %rdx, 0x58(%rbx)
movq %rcx, 0x60(%rbx)
movq %r8, 0x68(%rbx)
movl $0x38, %edi
callq 0x3270
movq %rax, %r15
movq %rax, %rdi
callq 0x141a8
movq %r15, 0x48(%rbx)
movq 0x50(%rbx), %rdi
addq $0x8, %rdi
movq %r14, %rsi
callq 0xd02a
movl $0x0, 0x88(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r14
movl $0x38, %esi
movq %r15, %rdi
callq 0x3280
jmp 0xec2d
movq %rax, %r14
leaq 0x70(%rbx), %r15
leaq 0x30(%rbx), %r12
leaq 0x18(%rbx), %r13
leaq 0x90(%rbx), %rdi
callq 0x12edc
movq %r15, %rdi
callq 0xbaf6
movq %r12, %rdi
callq 0xbaf6
movq %r13, %rdi
callq 0xbaf6
movq %rbx, %rdi
callq 0xbaf6
movq %r14, %rdi
callq 0x3450
nop