// File: /workspace/github_cpp_makefile_star2_O1/zkl94[P]distributed-key-value-store/MP1Node.cpp
// Function: MP1Node::nodeLoopOps()
void MP1Node::nodeLoopOps() {

    // 0. update self heartbeat and tiemstamp
    // 1. Check if any node hasn't responded within a timeout period and then delete the nodes
    // 2. Propagate your membership list to every other member (MEMBERLIST)

    // update self heartbeat
    memberNode->heartbeat++;

    // update the entry of self in self memberlist
    memberNode->memberList[0].setheartbeat(memberNode->heartbeat);
    memberNode->memberList[0].settimestamp(par->getcurrtime());

    memberNode->myPos = memberNode->memberList.begin();
    while (memberNode->myPos != memberNode->memberList.end()) {
        if(isEntryInvalid(memberNode, *memberNode->myPos)) {
            int id = memberNode->myPos->getid();
            short port = memberNode->myPos->getport();
            Address address;
            string _address = to_string(id) + ":" + to_string(port);
            address = Address(_address);

            // cout << "found invalid entry with id " << id <<endl;

            if (this->tobedeleted->count(id) == 0) {
                // may have already added to tobedeleted map
                this->tobedeleted->insert(std::make_pair(id, 0));
            }

            // can't remove it at once although we are using tobedeleted map
            // because we still have to send broadcast to it
            // memberNode->myPos = memberNode->memberList.erase(memberNode->myPos);
        }
        ++memberNode->myPos;
    }

    this->updateToBeDeletedMap();

    // construct MEMBERLIST message
    int entry_num = memberNode->memberList.size();
    int currentOffset = 0; 
    // allocate maximum space possibly needed
    size_t memberListMsgSize = sizeof(MessageHdr) + (6 + sizeof(long)) * entry_num;
    MessageHdr *memberListMsg;
    memberListMsg = (MessageHdr *) malloc(memberListMsgSize * sizeof(char));
    memberListMsg->msgType = MEMBERLIST;
    currentOffset += sizeof(int);

    // send / construct two kinds of messages
    for (MemberListEntry memberListEntry: memberNode->memberList) {
        // if it is to be deleted, don't add it to member list messages
        if (this->tobedeleted->count(memberListEntry.getid()) != 0) {
            continue;
        }

        Address address;
        string _address = to_string(memberListEntry.getid()) + ":" + to_string(memberListEntry.getport());
        address = Address(_address);

        // add to MEMBERLIST
        memcpy((char *)(memberListMsg) + currentOffset, &address.addr, sizeof(address.addr));
        currentOffset += sizeof(address.addr);
        memcpy((char *)(memberListMsg) + currentOffset, &memberListEntry.heartbeat, sizeof(long));
        currentOffset += sizeof(long);
    }


    // Propagate your membership list; it is sent to even nodes (entries) to be deleted
    broadcast++;
    // decide whether broadcast or unicast
    if (broadcast >= BROADCAST_INTERVAL) {
        // broadcast
        for (MemberListEntry memberListEntry: memberNode->memberList) {
            Address address;
            string _address = to_string(memberListEntry.getid()) + ":" + to_string(memberListEntry.getport());
            address = Address(_address);
            emulNet->ENsend(&memberNode->addr, &address, (char *)memberListMsg, currentOffset);
        }
        broadcast = 0;
    } else {
        // unicast
        int member_num = memberNode->memberList.size();
        int index = rand() % member_num;
        Address address;
        string _address = to_string(memberNode->memberList.at(index).getid()) + ":" + to_string(memberNode->memberList.at(index).getport());
        address = Address(_address);
        emulNet->ENsend(&memberNode->addr, &address, (char *)memberListMsg, currentOffset);
    }

    #ifdef DEBUGLOG
        log->LOG(&memberNode->addr, "sent member list message");
    #endif

    free(memberListMsg);

    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rdi, %rbp
movq 0x20(%rdi), %rax
movq 0x18(%rax), %rsi
movq 0x28(%rax), %rdi
incq %rsi
movq %rsi, 0x18(%rax)
callq 0xd212
movq 0x18(%rbp), %rdi
movq 0x20(%rbp), %rax
movq 0x28(%rax), %r14
callq 0xd162
movslq %eax, %rsi
movq %r14, %rdi
callq 0xd218
movq 0x20(%rbp), %rax
movq 0x28(%rax), %rcx
movq %rcx, 0x40(%rax)
movq 0x20(%rbp), %r15
movq 0x40(%r15), %rdi
cmpq 0x30(%r15), %rdi
movq %rbp, 0x90(%rsp)
je 0x41bc
callq 0xd202
movq %rax, %r14
movq 0x28(%r15), %rdi
callq 0xd202
subq %r14, %rax
cmpq $0x6, %rax
jl 0x41a2
movq 0x20(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0xd1f2
movl %eax, %r14d
movq 0x20(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0xd1f6
movl %eax, %r12d
movl %r14d, %r15d
negl %r15d
cmovsl %r14d, %r15d
movl $0x1, %ebp
cmpl $0xa, %r15d
jb 0x3ebd
movl $0x4, %ebp
movl %r15d, %eax
movl $0xd1b71759, %edx       # imm = 0xD1B71759
cmpl $0x63, %eax
jbe 0x3eb6
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x3ebb
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x3ebd
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %ebp
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x3e88
addl $-0x3, %ebp
jmp 0x3ebd
addl $-0x2, %ebp
jmp 0x3ebd
decl %ebp
movl %r14d, %r13d
shrl $0x1f, %r13d
leal (%rbp,%r13), %esi
leaq 0x80(%rsp), %rax
movq %rax, 0x70(%rsp)
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
movl $0x2d, %edx
callq 0x32f0
addq 0x70(%rsp), %r13
movq %r13, %rdi
movl %ebp, %esi
movl %r15d, %edx
callq 0x67a3
movq %rbx, %rdi
leaq 0x13e09(%rip), %rsi     # 0x17d0d
callq 0x3480
leaq 0x38(%rsp), %r13
movq %r13, 0x28(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3f31
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x3f39
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movswl %r12w, %r12d
movl %r12d, %ebp
negl %ebp
cmovsl %r12d, %ebp
movl $0x1, %r15d
cmpl $0xa, %ebp
jb 0x3f92
movl $0x2, %r15d
cmpl $0x64, %ebp
jb 0x3f92
movl $0x3, %r15d
cmpl $0x3e8, %ebp            # imm = 0x3E8
jb 0x3f92
cmpl $0x2710, %ebp           # imm = 0x2710
movl $0x5, %r15d
sbbl $0x0, %r15d
shrl $0x1f, %r12d
leal (%r15,%r12), %esi
leaq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
leaq 0x48(%rsp), %rdi
movl $0x2d, %edx
callq 0x32f0
movl %r12d, %edi
addq 0x48(%rsp), %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x67a3
movq 0x28(%rsp), %rcx
movl $0xf, %esi
cmpq %r13, %rcx
je 0x3fd9
movq 0x38(%rsp), %rsi
movq 0x30(%rsp), %r8
movq 0x50(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rsi, %rax
leaq 0x18(%rsp), %r15
movq 0x90(%rsp), %rbp
leaq 0x138(%rsp), %rbx
leaq 0x28(%rsp), %r12
jbe 0x4021
movl $0xf, %esi
leaq 0x58(%rsp), %rdi
cmpq %rdi, 0x48(%rsp)
je 0x401c
movq 0x58(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x4030
movq 0x48(%rsp), %rsi
movq %r12, %rdi
callq 0x30d0
jmp 0x403e
leaq 0x48(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x32c0
movq %r15, 0x8(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x405e
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x4065
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x409e
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x40b5
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
leaq 0x128(%rsp), %r13
je 0x40df
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x3280
movq %rbx, 0x128(%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x6810
movq %r12, %rdi
movq %r13, %rsi
callq 0x634c
leaq 0xb0(%rsp), %rdi
movq %r12, %rsi
callq 0xd17e
movq 0x128(%rsp), %rdi
cmpq %rbx, %rdi
je 0x4134
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x38(%rbp), %rdi
movq 0x10(%rdi), %rdx
leaq 0x8(%rdi), %rax
movq %rax, %rcx
testq %rdx, %rdx
je 0x4163
movq %rax, %rcx
xorl %esi, %esi
cmpl %r14d, 0x20(%rdx)
setl %sil
cmovgeq %rdx, %rcx
movq 0x10(%rdx,%rsi,8), %rdx
testq %rdx, %rdx
jne 0x414b
movq %rax, %rdx
cmpq %rax, %rcx
je 0x4176
cmpl 0x20(%rcx), %r14d
cmovlq %rax, %rcx
movq %rcx, %rdx
cmpq %rax, %rdx
jne 0x418b
movl %r14d, %eax
movq %rax, 0x28(%rsp)
movq %r12, %rsi
callq 0x6b80
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x41a2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x20(%rbp), %r15
movq 0x40(%r15), %rdi
addq $0x18, %rdi
movq %rdi, 0x40(%r15)
cmpq 0x30(%r15), %rdi
jne 0x3e28
movq %rbp, %rdi
callq 0x5e6e
movq 0x20(%rbp), %rax
movq 0x28(%rax), %r15
movq 0x30(%rax), %r13
movq %r13, %rax
subq %r15, %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
movslq %eax, %rdi
leaq (%rdi,%rdi), %rax
shlq $0x4, %rdi
subq %rax, %rdi
addq $0x4, %rdi
callq 0x3350
movq %rax, 0xa8(%rsp)
movl $0x2, (%rax)
cmpq %r15, %r13
je 0x45e5
movl $0x4, 0x6c(%rsp)
leaq 0x28(%rsp), %rbx
movq %r13, 0xa0(%rsp)
leaq 0xb0(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0xd1bc
movq 0x38(%rbp), %r14
movq %r12, %rdi
callq 0xd1f2
movq 0x10(%r14), %rdx
addq $0x8, %r14
movq %r14, %rcx
testq %rdx, %rdx
je 0x426c
movq %r14, %rcx
xorl %esi, %esi
cmpl %eax, 0x20(%rdx)
setl %sil
cmovgeq %rdx, %rcx
movq 0x10(%rdx,%rsi,8), %rdx
testq %rdx, %rdx
jne 0x4255
movq %r14, %rdx
cmpq %r14, %rcx
je 0x427e
cmpl 0x20(%rcx), %eax
cmovlq %r14, %rcx
movq %rcx, %rdx
cmpq %r14, %rdx
jne 0x45d6
leaq 0xb0(%rsp), %rdi
callq 0xd1f2
movl %eax, %ebp
movl %eax, %r13d
negl %r13d
cmovsl %eax, %r13d
movl $0x1, %r14d
cmpl $0xa, %r13d
jb 0x42f3
movl $0x4, %r14d
movl %r13d, %eax
movl $0xd1b71759, %edx       # imm = 0xD1B71759
cmpl $0x63, %eax
jbe 0x42ea
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x42f0
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x42f3
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r14d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x42ba
addl $-0x3, %r14d
jmp 0x42f3
addl $-0x2, %r14d
jmp 0x42f3
decl %r14d
shrl $0x1f, %ebp
leal (%r14,%rbp), %esi
leaq 0x80(%rsp), %rax
movq %rax, 0x70(%rsp)
leaq 0x70(%rsp), %r12
movq %r12, %rdi
movl $0x2d, %edx
callq 0x32f0
addq 0x70(%rsp), %rbp
movq %rbp, %rdi
movl %r14d, %esi
movl %r13d, %edx
callq 0x67a3
movq %r12, %rdi
leaq 0x139d7(%rip), %rsi     # 0x17d0d
callq 0x3480
leaq 0x38(%rsp), %rsi
movq %rsi, 0x28(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4363
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x4369
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xb0(%rsp), %rdi
callq 0xd1f6
movswl %ax, %r13d
movl %r13d, %ebp
negl %ebp
cmovsl %r13d, %ebp
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0x43cf
movl $0x2, %r14d
cmpl $0x64, %ebp
jb 0x43cf
movl $0x3, %r14d
cmpl $0x3e8, %ebp            # imm = 0x3E8
jb 0x43cf
cmpl $0x2710, %ebp           # imm = 0x2710
movl $0x5, %r14d
sbbl $0x0, %r14d
shrl $0x1f, %r13d
leal (%r14,%r13), %esi
leaq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
leaq 0x48(%rsp), %rdi
movl $0x2d, %edx
callq 0x32f0
movl %r13d, %edi
addq 0x48(%rsp), %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x67a3
movq 0x28(%rsp), %rcx
movl $0xf, %esi
leaq 0x38(%rsp), %rax
cmpq %rax, %rcx
je 0x441b
movq 0x38(%rsp), %rsi
movq 0x30(%rsp), %r8
movq 0x50(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rsi, %rax
movq 0x90(%rsp), %rbp
movq 0xa0(%rsp), %r13
leaq 0x118(%rsp), %r12
leaq 0x108(%rsp), %r14
jbe 0x4469
movl $0xf, %esi
leaq 0x58(%rsp), %rdi
cmpq %rdi, 0x48(%rsp)
je 0x4464
movq 0x58(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x4478
movq 0x48(%rsp), %rsi
movq %rbx, %rdi
callq 0x30d0
jmp 0x4486
leaq 0x48(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x32c0
leaq 0x18(%rsp), %rsi
movq %rsi, 0x8(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x44ab
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x44b1
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x44ea
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x4506
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x4528
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x3280
movq %r12, 0x108(%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x6810
movq %r14, %rsi
movq %rbx, %r14
movq %rbx, %rdi
callq 0x634c
leaq 0x9a(%rsp), %rdi
movq %r14, %rsi
callq 0xd17e
movq 0x108(%rsp), %rdi
cmpq %r12, %rdi
je 0x4580
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x3280
movslq 0x6c(%rsp), %rax
movzwl 0x9e(%rsp), %ecx
movq 0xa8(%rsp), %rdx
movw %cx, 0x4(%rdx,%rax)
movl 0x9a(%rsp), %ecx
movl %ecx, (%rdx,%rax)
addl $0x6, %eax
cltq
movq 0xb8(%rsp), %rcx
movq %rcx, (%rdx,%rax)
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x45d1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3280
addl $0xe, 0x6c(%rsp)
addq $0x18, %r15
cmpq %r13, %r15
jne 0x4223
jmp 0x45ed
movl $0x4, 0x6c(%rsp)
movl 0x30(%rbp), %ecx
leal 0x1(%rcx), %eax
movl %eax, 0x30(%rbp)
movq 0x20(%rbp), %rax
cmpl $0x2, %ecx
jle 0x497a
movq 0x28(%rax), %r15
movq 0x30(%rax), %rax
movq %rax, 0xa0(%rsp)
cmpq %rax, %r15
je 0x496e
leaq 0xf8(%rsp), %r13
movq %r13, %r12
leaq 0xb0(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0xd1bc
movq %r14, %rdi
callq 0xd1f2
movl %eax, %r14d
movl %eax, %ebp
negl %ebp
cmovsl %eax, %ebp
movl $0x1, %r13d
cmpl $0xa, %ebp
jb 0x469d
movl $0x4, %r13d
movl %ebp, %eax
movl $0xd1b71759, %edx       # imm = 0xD1B71759
cmpl $0x63, %eax
jbe 0x4694
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x469a
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x469d
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r13d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x4664
addl $-0x3, %r13d
jmp 0x469d
addl $-0x2, %r13d
jmp 0x469d
decl %r13d
shrl $0x1f, %r14d
leal (%r14,%r13), %esi
leaq 0x80(%rsp), %rax
movq %rax, 0x70(%rsp)
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
movl $0x2d, %edx
callq 0x32f0
addq 0x70(%rsp), %r14
movq %r14, %rdi
movl %r13d, %esi
movl %ebp, %edx
callq 0x67a3
movq %rbx, %rdi
leaq 0x1362d(%rip), %rsi     # 0x17d0d
callq 0x3480
leaq 0x38(%rsp), %rsi
movq %rsi, 0x28(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x470d
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x4713
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xb0(%rsp), %rdi
callq 0xd1f6
movswl %ax, %r13d
movl %r13d, %ebp
negl %ebp
cmovsl %r13d, %ebp
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0x4779
movl $0x2, %r14d
cmpl $0x64, %ebp
jb 0x4779
movl $0x3, %r14d
cmpl $0x3e8, %ebp            # imm = 0x3E8
jb 0x4779
cmpl $0x2710, %ebp           # imm = 0x2710
movl $0x5, %r14d
sbbl $0x0, %r14d
shrl $0x1f, %r13d
leal (%r14,%r13), %esi
leaq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
leaq 0x48(%rsp), %rdi
movl $0x2d, %edx
callq 0x32f0
movl %r13d, %edi
addq 0x48(%rsp), %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x67a3
movq 0x28(%rsp), %rcx
movl $0xf, %esi
leaq 0x38(%rsp), %rax
cmpq %rax, %rcx
je 0x47c5
movq 0x38(%rsp), %rsi
movq 0x30(%rsp), %r8
movq 0x50(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rsi, %rax
movq 0x90(%rsp), %rbp
leaq 0x18(%rsp), %rbx
movq %r12, %r13
leaq 0x28(%rsp), %r14
leaq 0xe8(%rsp), %r12
jbe 0x4810
movl $0xf, %esi
leaq 0x58(%rsp), %rdi
cmpq %rdi, 0x48(%rsp)
je 0x480b
movq 0x58(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x481f
movq 0x48(%rsp), %rsi
movq %r14, %rdi
callq 0x30d0
jmp 0x482d
leaq 0x48(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x32c0
movq %rbx, 0x8(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x484d
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x4853
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x488c
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x48a8
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x48ca
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x3280
movq %r13, 0xe8(%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x6810
movq %r14, %rdi
movq %r12, %rsi
callq 0x634c
leaq 0x9a(%rsp), %rdi
movq %r14, %rsi
callq 0xd17e
movq 0xe8(%rsp), %rdi
cmpq %r13, %rdi
je 0x491f
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x8(%rbp), %rdi
movq 0x20(%rbp), %rsi
addq $0x8, %rsi
leaq 0x9a(%rsp), %rdx
movq 0xa8(%rsp), %rcx
movl 0x6c(%rsp), %r8d
callq 0x6ed0
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x495c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3280
addq $0x18, %r15
cmpq 0xa0(%rsp), %r15
jne 0x4624
movl $0x0, 0x30(%rbp)
jmp 0x4d1f
movq 0x30(%rax), %rcx
subq 0x28(%rax), %rcx
shrq $0x3, %rcx
imull $0xaaaaaaab, %ecx, %ebp # imm = 0xAAAAAAAB
callq 0x30a0
cltd
idivl %ebp
movq 0x90(%rsp), %rax
movq 0x20(%rax), %rcx
movslq %edx, %r15
movq 0x28(%rcx), %rax
movq 0x30(%rcx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rbx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rbx, %rdx
cmpq %r15, %rdx
jbe 0x4d3e
leaq (%r15,%r15,2), %rcx
movq %rcx, 0xa0(%rsp)
leaq (%rax,%rcx,8), %rdi
callq 0xd1f2
movl %eax, %r13d
movl %eax, %r12d
negl %r12d
cmovsl %eax, %r12d
movl $0x1, %r14d
cmpl $0xa, %r12d
jb 0x4a41
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r12d, %ecx
cmpl $0x63, %ecx
jbe 0x4a38
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x4a3e
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x4a41
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x4a05
addl $-0x3, %r14d
jmp 0x4a41
addl $-0x2, %r14d
jmp 0x4a41
decl %r14d
shrl $0x1f, %r13d
leal (%r14,%r13), %esi
leaq 0x80(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x70(%rsp), %rbp
movq %rbp, %rdi
movl $0x2d, %edx
callq 0x32f0
addq (%rbp), %r13
movq %r13, %rdi
movl %r14d, %esi
movl %r12d, %edx
callq 0x67a3
leaq 0x1328d(%rip), %rsi     # 0x17d0d
movq %rbp, %rdi
callq 0x3480
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
movq 0x90(%rsp), %rsi
je 0x4ab8
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x4ac0
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x20(%rsi), %rcx
movq 0x28(%rcx), %rax
movq 0x30(%rcx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
imulq %rbx, %rdx
cmpq %r15, %rdx
jbe 0x4d4f
movq 0xa0(%rsp), %rcx
leaq (%rax,%rcx,8), %rdi
callq 0xd1f6
movswl %ax, %r13d
movl %r13d, %ebp
negl %ebp
cmovsl %r13d, %ebp
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0x4b4a
movl $0x2, %r14d
cmpl $0x64, %ebp
jb 0x4b4a
movl $0x3, %r14d
cmpl $0x3e8, %ebp            # imm = 0x3E8
jb 0x4b4a
cmpl $0x2710, %ebp           # imm = 0x2710
movl $0x5, %r14d
sbbl $0x0, %r14d
shrl $0x1f, %r13d
leal (%r14,%r13), %esi
leaq 0x58(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x48(%rsp), %rdi
movl $0x2d, %edx
callq 0x32f0
movl %r13d, %edi
addq 0x48(%rsp), %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x67a3
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %r8
movq 0x50(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r12, %rcx
je 0x4b9e
movq 0x38(%rsp), %rsi
cmpq %rsi, %rax
movq 0x90(%rsp), %rbx
jbe 0x4bc1
movl $0xf, %esi
cmpq %r15, 0x48(%rsp)
je 0x4bbc
movq 0x58(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x4bd2
movq 0x48(%rsp), %rsi
leaq 0x28(%rsp), %rdi
callq 0x30d0
jmp 0x4be0
leaq 0x48(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x32c0
leaq 0x18(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x4c04
movq %rsi, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x4c0a
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x4c3e
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x4c55
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x4c77
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x3280
leaq 0xd8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0xc8(%rsp), %rdi
callq 0x6810
leaq 0x28(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x634c
leaq 0xb0(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0xd17e
movq 0xc8(%rsp), %rdi
cmpq %r14, %rdi
je 0x4cde
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x8(%rbx), %rdi
movq 0x20(%rbx), %rsi
addq $0x8, %rsi
leaq 0xb0(%rsp), %rdx
movq 0xa8(%rsp), %rcx
movl 0x6c(%rsp), %r8d
callq 0x6ed0
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4d1f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0xa8(%rsp), %rdi
callq 0x3320
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x123a6(%rip), %rdi     # 0x170eb
movq %r15, %rsi
xorl %eax, %eax
callq 0x33c0
leaq 0x12395(%rip), %rdi     # 0x170eb
movq %r15, %rsi
xorl %eax, %eax
callq 0x33c0
jmp 0x4d62
movq %rax, %r13
jmp 0x4da5
movq %rax, %r13
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x4db6
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x4db6
jmp 0x4ddc
movq %rax, %r13
movq 0xc8(%rsp), %rdi
cmpq %r14, %rdi
je 0x4da5
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x3280
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x4ea4
movq %rax, %r13
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
jne 0x4e34
jmp 0x4e41
jmp 0x4dd4
jmp 0x4dd4
jmp 0x4ddc
jmp 0x4de1
jmp 0x4ddc
jmp 0x4de1
jmp 0x4dd4
jmp 0x4dd4
jmp 0x4e22
movq %rax, %r13
jmp 0x4e9a
movq %rax, %r13
jmp 0x4e41
movq %rax, %r13
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x4e25
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x4e25
movq %rax, %r13
movq 0x108(%rsp), %rdi
cmpq %r12, %rdi
je 0x4e9a
movq 0x118(%rsp), %rsi
jmp 0x4e92
jmp 0x4e22
movq %rax, %r13
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x4e41
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x4eb6
movq 0x80(%rsp), %rsi
jmp 0x4eae
movq %r13, %rcx
movq %rax, %r13
movq 0xe8(%rsp), %rdi
cmpq %rcx, %rdi
je 0x4e9a
movq 0xf8(%rsp), %rsi
jmp 0x4e92
movq %rax, %r13
movq 0x128(%rsp), %rdi
cmpq %rbx, %rdi
je 0x4e9a
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x4eb6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3280
movq %r13, %rdi
callq 0x3450