LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: therealgymmy[P]HelicopterGame/src/x_resources.h
// Function: setupGC(XInfo&, _XGC*&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
inline
void setupGC (XInfo &xinfo, GC &target, std::string color) {
    // init values for the GC
    XGCValues values;
    values.cap_style = CapButt;
    values.join_style = JoinBevel;

    // which values to check when creating the GC
    unsigned long valuemask = GCCapStyle | GCJoinStyle;

    Colormap colormap = DefaultColormap(xinfo.display_, DefaultScreen(xinfo.display_));
    XColor c;

    target = XCreateGC(xinfo.display_, xinfo.window_, valuemask, &values);

    XAllocNamedColor(xinfo.display_, colormap, color.c_str(), &c, &c);

    XSetForeground(
            xinfo.display_,
            target,
            c.pixel);

    XSetBackground(
            xinfo.display_,
            target,
            BlackPixel(xinfo.display_, xinfo.screen_));

    XSetFillStyle(xinfo.display_, target, FillSolid);

    XSetLineAttributes(
            xinfo.display_, target,
            2,              // line width
            LineSolid,      // line drawing style
            CapRound,       // cap drawing style (line'end)
            JoinRound);     // lines join style


}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdx, -0xd0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x1, -0x70(%rbp)
movl $0x2, -0x6c(%rbp)
movq $0xc0, -0xa0(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0xe8(%rax), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
movslq 0xe0(%rcx), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x50(%rax), %rax
movq %rax, -0xa8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0xa0(%rbp), %rdx
leaq -0x98(%rbp), %rcx
callq 0x3110
movq -0xd0(%rbp), %rdi
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xc8(%rbp)
movq -0xa8(%rbp), %rax
movq %rax, -0xc0(%rbp)
callq 0x30d0
movq -0xc8(%rbp), %rdi
movq -0xc0(%rbp), %rsi
movq %rax, %rdx
leaq -0xb8(%rbp), %r8
movq %r8, %rcx
callq 0x32f0
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movq -0xb8(%rbp), %rdx
callq 0x30a0
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0xe8(%rax), %rax
movq -0x8(%rbp), %rcx
movslq 0x8(%rcx), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x60(%rax), %rdx
callq 0x3300
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
xorl %edx, %edx
callq 0x3030
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movl $0x2, %r8d
xorl %ecx, %ecx
movl $0x1, %r9d
movl %r8d, %edx
callq 0x33c0
addq $0xd0, %rsp
popq %rbp
retq
nopl (%rax)
// File: therealgymmy[P]HelicopterGame/src/bomb.cpp
// Function: Bomb::draw(XInfo*, int, int)
void Bomb::draw (XInfo *xinfo, int x, int y) {
    int tx = x + (BombBtm::w() - BombTop::w()) / 2;
    int mx = x + (BombBtm::w() - BombMid::w()) / 2;
    int bx = x;

    int ty = y;
    int my = ty + BombTop::h() * 0.8;
    int by = my + BombMid::h() * 0.8;

    top_.draw<attr::BROWN>(xinfo,
                           tx / Bomb::ScaleX,
                           ty / Bomb::ScaleY);

    mid_.draw<attr::BROWN>(xinfo,
                           mx / Bomb::ScaleX,
                           my / Bomb::ScaleY);

    btm_.draw<attr::BROWN>(xinfo,
                           bx / Bomb::ScaleX,
                           by / Bomb::ScaleY);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x54(%rbp)
callq 0xa750
movl %eax, -0x58(%rbp)
callq 0xa790
movl %eax, %ecx
movl -0x58(%rbp), %eax
subl %ecx, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x54(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x1c(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x4c(%rbp)
callq 0xa750
movl %eax, -0x50(%rbp)
callq 0xa7a0
movl %eax, %ecx
movl -0x50(%rbp), %eax
subl %ecx, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x4c(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x20(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x28(%rbp)
cvtsi2sdl -0x28(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
callq 0xa760
movsd -0x48(%rbp), %xmm1
cvtsi2sd %eax, %xmm0
movsd 0x2ef6(%rip), %xmm2     # 0xd238
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x2c(%rbp)
cvtsi2sdl -0x2c(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
callq 0xa770
movsd -0x40(%rbp), %xmm1
movq -0x38(%rbp), %rdi
cvtsi2sd %eax, %xmm0
movsd 0x2ec3(%rip), %xmm2     # 0xd238
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x30(%rbp)
addq $0xc, %rdi
movq -0x10(%rbp), %rsi
cvtsi2sdl -0x1c(%rbp), %xmm0
leaq 0x8ee0(%rip), %rax      # 0x13278
divsd (%rax), %xmm0
cvttsd2si %xmm0, %edx
cvtsi2sdl -0x28(%rbp), %xmm0
leaq 0x8ed4(%rip), %rax      # 0x13280
divsd (%rax), %xmm0
cvttsd2si %xmm0, %ecx
callq 0xa7b0
movq -0x38(%rbp), %rdi
addq $0xd, %rdi
movq -0x10(%rbp), %rsi
cvtsi2sdl -0x20(%rbp), %xmm0
leaq 0x8ea7(%rip), %rax      # 0x13278
divsd (%rax), %xmm0
cvttsd2si %xmm0, %edx
cvtsi2sdl -0x2c(%rbp), %xmm0
leaq 0x8e9b(%rip), %rax      # 0x13280
divsd (%rax), %xmm0
cvttsd2si %xmm0, %ecx
callq 0xa7f0
movq -0x38(%rbp), %rdi
addq $0xe, %rdi
movq -0x10(%rbp), %rsi
cvtsi2sdl -0x24(%rbp), %xmm0
leaq 0x8e6e(%rip), %rax      # 0x13278
divsd (%rax), %xmm0
cvttsd2si %xmm0, %edx
cvtsi2sdl -0x30(%rbp), %xmm0
leaq 0x8e62(%rip), %rax      # 0x13280
divsd (%rax), %xmm0
cvttsd2si %xmm0, %ecx
callq 0xa830
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: therealgymmy[P]HelicopterGame/src/bomb.cpp
// Function: BombList::draw(XInfo*)
void BombList::draw (XInfo *xinfo) {
    for (Bombs::iterator itr = bombs_.begin();
         itr != bombs_.end();
         ++itr) {
        itr->draw(xinfo, itr->x(), itr->y());
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x28(%rbp)
callq 0x9b80
movq %rax, -0x18(%rbp)
movq -0x28(%rbp), %rdi
callq 0x9be0
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x9bb0
testb $0x1, %al
jne 0xa4b1
jmp 0xa508
leaq -0x18(%rbp), %rdi
callq 0x9c10
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x9c10
movq %rax, %rdi
callq 0x9c40
movl %eax, -0x2c(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x9c10
movq %rax, %rdi
callq 0x9c60
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl -0x2c(%rbp), %edx
movl %eax, %ecx
callq 0xa2a0
leaq -0x18(%rbp), %rdi
callq 0x9d60
jmp 0xa491
addq $0x40, %rsp
popq %rbp
retq
nop
// File: therealgymmy[P]HelicopterGame/src/bomb.cpp
// Function: BombList::move()
void BombList::move () {
    for (Bombs::iterator itr = bombs_.begin();
         itr != bombs_.end();
         ++itr) {

        if (itr->hasInertia() == Bomb::NUL) {
            itr->setX(itr->x() - Tower::speed() / 2);
        }
        else if (itr->hasInertia() == Bomb::FORWARD) {
            itr->setX(itr->x() - Tower::speed() / 3);
        }
        else {
            itr->setX(itr->x() - Tower::speed());
        }

        itr->setY(itr->y() + Bomb::speed());

        if (itr->y() > PLANE_H) {
            itr = bombs_.erase(itr);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
callq 0x9b80
movq %rax, -0x10(%rbp)
movq -0x30(%rbp), %rdi
callq 0x9be0
movq %rax, -0x18(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x9bb0
testb $0x1, %al
jne 0xa550
jmp 0xa6b3
leaq -0x10(%rbp), %rdi
callq 0x9c10
movq %rax, %rdi
callq 0xa890
cmpl $0x0, %eax
jne 0xa5a7
leaq -0x10(%rbp), %rdi
callq 0x9c10
movq %rax, -0x38(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x9c10
movq %rax, %rdi
callq 0x9c40
movl %eax, -0x3c(%rbp)
callq 0x5010
movl -0x3c(%rbp), %esi
movq -0x38(%rbp), %rdi
movl $0x2, %ecx
cltd
idivl %ecx
subl %eax, %esi
callq 0xa8b0
jmp 0xa631
leaq -0x10(%rbp), %rdi
callq 0x9c10
movq %rax, %rdi
callq 0xa890
cmpl $0x1, %eax
jne 0xa5fb
leaq -0x10(%rbp), %rdi
callq 0x9c10
movq %rax, -0x48(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x9c10
movq %rax, %rdi
callq 0x9c40
movl %eax, -0x4c(%rbp)
callq 0x5010
movl -0x4c(%rbp), %esi
movq -0x48(%rbp), %rdi
movl $0x3, %ecx
cltd
idivl %ecx
subl %eax, %esi
callq 0xa8b0
jmp 0xa62f
leaq -0x10(%rbp), %rdi
callq 0x9c10
movq %rax, -0x58(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x9c10
movq %rax, %rdi
callq 0x9c40
movl %eax, -0x5c(%rbp)
callq 0x5010
movl -0x5c(%rbp), %esi
movq -0x58(%rbp), %rdi
subl %eax, %esi
callq 0xa8b0
jmp 0xa631
leaq -0x10(%rbp), %rdi
callq 0x9c10
movq %rax, -0x68(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x9c10
movq %rax, %rdi
callq 0x9c60
movl %eax, -0x6c(%rbp)
callq 0xa910
movl -0x6c(%rbp), %esi
movq -0x68(%rbp), %rdi
addl %eax, %esi
callq 0xa8e0
leaq -0x10(%rbp), %rdi
callq 0x9c10
movq %rax, %rdi
callq 0x9c60
cmpl $0xbb8, %eax            # imm = 0xBB8
jle 0xa6a3
leaq -0x28(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x9d20
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x9cd0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0xa6a5
leaq -0x10(%rbp), %rdi
callq 0x9d60
jmp 0xa52d
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)
// File: therealgymmy[P]HelicopterGame/src/missile.cpp
// Function: MissileList::draw(XInfo*)
void MissileList::draw (XInfo *xinfo) {
    for (Missiles::iterator itr = missiles_.begin();
         itr != missiles_.end();
         ++itr) {
        int x = itr->x() / Missile::ScaleX;
        int y = itr->y() / Missile::ScaleY;
        itr->draw<attr::BLACK>(xinfo, x, y);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
callq 0x9ea0
movq %rax, -0x18(%rbp)
movq -0x30(%rbp), %rdi
callq 0x9f00
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x9ed0
testb $0x1, %al
jne 0xb0b1
jmp 0xb128
leaq -0x18(%rbp), %rdi
callq 0x9f30
movq %rax, %rdi
callq 0x9f60
cvtsi2sd %eax, %xmm0
leaq 0x81ab(%rip), %rax      # 0x13278
divsd (%rax), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x24(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x9f30
movq %rax, %rdi
callq 0x9f80
cvtsi2sd %eax, %xmm0
leaq 0x818c(%rip), %rax      # 0x13280
divsd (%rax), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x28(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x9f30
movq %rax, %rdi
movq -0x10(%rbp), %rsi
movl -0x24(%rbp), %edx
movl -0x28(%rbp), %ecx
callq 0xb2e0
leaq -0x18(%rbp), %rdi
callq 0xa130
jmp 0xb091
addq $0x30, %rsp
popq %rbp
retq
nop
// File: therealgymmy[P]HelicopterGame/src/missile.cpp
// Function: MissileList::move()
void MissileList::move () {
    for (Missiles::iterator itr = missiles_.begin();
         itr != missiles_.end();
         ++itr) {

        itr->setX(itr->x() - Tower::speed());
        itr->setY(itr->y() - Missile::speed());

        if (itr->y() < 0) {
            itr = missiles_.erase(itr);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
callq 0x9ea0
movq %rax, -0x10(%rbp)
movq -0x30(%rbp), %rdi
callq 0x9f00
movq %rax, -0x18(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x9ed0
testb $0x1, %al
jne 0xb170
jmp 0xb224
leaq -0x10(%rbp), %rdi
callq 0x9f30
movq %rax, -0x48(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x9f30
movq %rax, %rdi
callq 0x9f60
movl %eax, -0x4c(%rbp)
callq 0x5010
movl -0x4c(%rbp), %esi
movq -0x48(%rbp), %rdi
subl %eax, %esi
callq 0xb320
leaq -0x10(%rbp), %rdi
callq 0x9f30
movq %rax, -0x38(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x9f30
movq %rax, %rdi
callq 0x9f80
movl %eax, -0x3c(%rbp)
callq 0xb380
movl -0x3c(%rbp), %esi
movq -0x38(%rbp), %rdi
subl %eax, %esi
callq 0xb350
leaq -0x10(%rbp), %rdi
callq 0x9f30
movq %rax, %rdi
callq 0x9f80
cmpl $0x0, %eax
jge 0xb214
leaq -0x28(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0xa110
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xa0c0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0xb216
leaq -0x10(%rbp), %rdi
callq 0xa130
jmp 0xb14d
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: therealgymmy[P]HelicopterGame/src/explosion.cpp
// Function: ExplosionList::draw(XInfo*)
void ExplosionList::draw (XInfo *xinfo) {
    for (Explosions::iterator itr = explosions_.begin();
         itr != explosions_.end();
         ++itr) {
        itr->draw(xinfo, itr->x(), itr->y());
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x28(%rbp)
callq 0xbb30
movq %rax, -0x18(%rbp)
movq -0x28(%rbp), %rdi
callq 0xbb90
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0xbb60
testb $0x1, %al
jne 0xb951
jmp 0xb9a8
leaq -0x18(%rbp), %rdi
callq 0xbbc0
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq -0x18(%rbp), %rdi
callq 0xbbc0
movq %rax, %rdi
callq 0xbbf0
movl %eax, -0x2c(%rbp)
leaq -0x18(%rbp), %rdi
callq 0xbbc0
movq %rax, %rdi
callq 0xbc10
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl -0x2c(%rbp), %edx
movl %eax, %ecx
callq 0xb860
leaq -0x18(%rbp), %rdi
callq 0xbc30
jmp 0xb931
addq $0x40, %rsp
popq %rbp
retq
nop
// File: therealgymmy[P]HelicopterGame/src/explosion.cpp
// Function: ExplosionList::move()
void ExplosionList::move () {
    for (Explosions::iterator itr = explosions_.begin();
         itr != explosions_.end();
         ++itr) {
        itr->setX(itr->x() - Tower::speed());
        itr->inflate();
        if (itr->w() > 300 &&
            itr->h() > 300) {
            itr = explosions_.erase(itr);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
callq 0xbb30
movq %rax, -0x10(%rbp)
movq -0x30(%rbp), %rdi
callq 0xbb90
movq %rax, -0x18(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0xbb60
testb $0x1, %al
jne 0xb9f0
jmp 0xba9b
leaq -0x10(%rbp), %rdi
callq 0xbbc0
movq %rax, -0x38(%rbp)
leaq -0x10(%rbp), %rdi
callq 0xbbc0
movq %rax, %rdi
callq 0xbbf0
movl %eax, -0x3c(%rbp)
callq 0x5010
movl -0x3c(%rbp), %esi
movq -0x38(%rbp), %rdi
subl %eax, %esi
callq 0xbc50
leaq -0x10(%rbp), %rdi
callq 0xbbc0
movq %rax, %rdi
callq 0xb8f0
leaq -0x10(%rbp), %rdi
callq 0xbbc0
movq %rax, %rdi
callq 0xbc80
cmpl $0x12c, %eax            # imm = 0x12C
jle 0xba8b
leaq -0x10(%rbp), %rdi
callq 0xbbc0
movq %rax, %rdi
callq 0xbca0
cmpl $0x12c, %eax            # imm = 0x12C
jle 0xba8b
leaq -0x28(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0xbd10
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xbcc0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0xba8d
leaq -0x10(%rbp), %rdi
callq 0xbc30
jmp 0xb9cd
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: therealgymmy[P]HelicopterGame/src/misc.cpp
// Function: HealthBar::draw(XInfo*)
void HealthBar::draw (XInfo *xinfo) {
    frame_.draw<attr::BLACK>(xinfo,
                             x_ / ScaleX,
                             y_ / ScaleY);
    if (hp_ > 50) {
        Draw::draw<attr::GREEN>(xinfo,
                                (x_ + 20) / ScaleX,
                                (y_ + 20) / ScaleY);
    }
    else {
        Draw::draw<attr::RED>(xinfo,
                              (x_ + 20) / ScaleX,
                              (y_ + 20) / ScaleY);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq %rax, %rdi
addq $0x14, %rdi
movq -0x10(%rbp), %rsi
cvtsi2sdl (%rax), %xmm0
leaq 0x6f7a(%rip), %rcx      # 0x13278
divsd (%rcx), %xmm0
cvttsd2si %xmm0, %edx
cvtsi2sdl 0x4(%rax), %xmm0
leaq 0x6f6e(%rip), %rax      # 0x13280
divsd (%rax), %xmm0
cvttsd2si %xmm0, %ecx
callq 0xc720
movq -0x18(%rbp), %rax
cmpl $0x32, 0x10(%rax)
jle 0xc369
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl (%rdi), %eax
addl $0x14, %eax
cvtsi2sd %eax, %xmm0
leaq 0x6f37(%rip), %rax      # 0x13278
divsd (%rax), %xmm0
cvttsd2si %xmm0, %edx
movl 0x4(%rdi), %eax
addl $0x14, %eax
cvtsi2sd %eax, %xmm0
leaq 0x6f26(%rip), %rax      # 0x13280
divsd (%rax), %xmm0
cvttsd2si %xmm0, %ecx
callq 0xc760
jmp 0xc3a7
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl (%rdi), %eax
addl $0x14, %eax
cvtsi2sd %eax, %xmm0
leaq 0x6ef7(%rip), %rax      # 0x13278
divsd (%rax), %xmm0
cvttsd2si %xmm0, %edx
movl 0x4(%rdi), %eax
addl $0x14, %eax
cvtsi2sd %eax, %xmm0
leaq 0x6ee6(%rip), %rax      # 0x13280
divsd (%rax), %xmm0
cvttsd2si %xmm0, %ecx
callq 0xc7a0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: sunpihai-up[P]MulThreadsWordsCounter/WordsCounter-v3.cpp
// Function: isEmptyPath()
bool isEmptyPath()
{
    bool res;
    pthread_mutex_lock(&pathMutex);
    res = pathQueue.empty();
    pthread_mutex_unlock(&pathMutex);
    return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xd931(%rip), %rdi      # 0x11370
callq 0x3310
leaq 0xd88d(%rip), %rdi      # 0x112d8
callq 0x49f0
andb $0x1, %al
movb %al, -0x1(%rbp)
leaq 0xd914(%rip), %rdi      # 0x11370
callq 0x31a0
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: sunpihai-up[P]MulThreadsWordsCounter/WordsCounter-v3.cpp
// Function: producer(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void producer(const string fp)
{

    ifstream fileStream(fp);
    string line;

    while (getline(fileStream, line))
    {
        pthread_mutex_lock(&queueMutex);
        while (workQueue.size() >= maxQSize)
        {
            // Waiting for the work queue is not full
            pthread_cond_wait(&condQueue, &queueMutex);
        }

        // Add the line to end of work queue
        workQueue.push(line);

        // Wake up a waiting thread
        pthread_cond_signal(&condQueue);
        pthread_mutex_unlock(&queueMutex);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x260, %rsp            # imm = 0x260
movq %rdi, %rsi
movq %rsi, -0x8(%rbp)
leaq -0x210(%rbp), %rdi
movl $0x8, %edx
callq 0x3390
leaq -0x230(%rbp), %rdi
callq 0x32f0
leaq -0x210(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0x3090
movq %rax, -0x248(%rbp)
jmp 0x3abb
movq -0x248(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3290
movb %al, -0x249(%rbp)
jmp 0x3ad9
movb -0x249(%rbp), %al
testb $0x1, %al
jne 0x3ae8
jmp 0x3b8d
leaq 0xd8a9(%rip), %rdi      # 0x11398
callq 0x3310
leaq 0xd78d(%rip), %rdi      # 0x11288
callq 0x4a10
movq %rax, -0x258(%rbp)
jmp 0x3b09
movq -0x258(%rbp), %rax
cmpq $0x2710, %rax           # imm = 0x2710
jb 0x3b5b
leaq 0xd8c9(%rip), %rdi      # 0x113e8
leaq 0xd872(%rip), %rsi      # 0x11398
callq 0x3340
jmp 0x3b2d
jmp 0x3af4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
leaq -0x230(%rbp), %rdi
callq 0x3458
leaq -0x210(%rbp), %rdi
callq 0x30c0
jmp 0x3bae
leaq 0xd726(%rip), %rdi      # 0x11288
leaq -0x230(%rbp), %rsi
callq 0x49c0
jmp 0x3b70
leaq 0xd871(%rip), %rdi      # 0x113e8
callq 0x3030
leaq 0xd815(%rip), %rdi      # 0x11398
callq 0x31a0
jmp 0x3a9f
leaq -0x230(%rbp), %rdi
callq 0x3458
leaq -0x210(%rbp), %rdi
callq 0x30c0
addq $0x260, %rsp            # imm = 0x260
popq %rbp
retq
movq -0x238(%rbp), %rdi
callq 0x33e0
nopw (%rax,%rax)
// File: sunpihai-up[P]MulThreadsWordsCounter/WordsCounter-v3.cpp
// Function: launchProducer(void*)
void *launchProducer(void *args)
{
    producerNum++;
    string fp;
    while (!isEmptyPath())
    {
        // ! Use trylock instead of lock to avoid blocking forever
        int getLockStu = pthread_mutex_trylock(&pathMutex);
        if (getLockStu != 0)
        {
            // Didn't get the lock
            continue;
        }

        fp = pathQueue.front();
        pathQueue.pop();

        pthread_mutex_unlock(&pathMutex);
        producer(fp);
    }
    producerNum--;
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
leaq 0xd775(%rip), %rdi      # 0x11348
xorl %esi, %esi
callq 0x4a30
leaq -0x28(%rbp), %rdi
callq 0x32f0
callq 0x3a30
movb %al, -0x59(%rbp)
jmp 0x3bed
movb -0x59(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x3bfb
jmp 0x3c9d
leaq 0xd76e(%rip), %rdi      # 0x11370
callq 0x3080
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
je 0x3c23
jmp 0x3be3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x3cbc
leaq 0xd6ae(%rip), %rdi      # 0x112d8
callq 0x4ae0
movq %rax, -0x68(%rbp)
jmp 0x3c35
movq -0x68(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x3050
jmp 0x3c44
leaq 0xd68d(%rip), %rdi      # 0x112d8
callq 0x4b00
jmp 0x3c52
leaq 0xd717(%rip), %rdi      # 0x11370
callq 0x31a0
leaq -0x58(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x3120
jmp 0x3c6d
leaq -0x58(%rbp), %rdi
callq 0x3a70
jmp 0x3c78
leaq -0x58(%rbp), %rdi
callq 0x3458
jmp 0x3be3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3458
jmp 0x3cbc
leaq 0xd6a4(%rip), %rdi      # 0x11348
xorl %esi, %esi
callq 0x4b20
leaq -0x28(%rbp), %rdi
callq 0x3458
xorl %eax, %eax
addq $0x70, %rsp
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x3458
movq -0x30(%rbp), %rdi
callq 0x33e0
nop
// File: sunpihai-up[P]MulThreadsWordsCounter/WordsCounter-v3.cpp
// Function: isEmptyWork()
bool isEmptyWork()
{
    bool res;
    pthread_mutex_lock(&queueMutex);
    res = workQueue.empty();
    pthread_mutex_unlock(&queueMutex);
    return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xd5b9(%rip), %rdi      # 0x11398
callq 0x3310
leaq 0xd49d(%rip), %rdi      # 0x11288
callq 0x49f0
andb $0x1, %al
movb %al, -0x1(%rbp)
leaq 0xd59c(%rip), %rdi      # 0x11398
callq 0x31a0
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: sunpihai-up[P]MulThreadsWordsCounter/WordsCounter-v3.cpp
// Function: wordCount(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void wordCount(string line)
{
    cleanPunct(line);
    istringstream is(line);
    string word;
    while (is >> word)
    {
        toLowerCase(word);
        // Exclusive access to staREsult
        pthread_mutex_lock(&mutexMap);
        staResult[word]++;
        pthread_mutex_unlock(&mutexMap);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x200, %rsp            # imm = 0x200
movq %rdi, %rsi
movq %rsi, -0x1e0(%rbp)
movq %rsi, -0x8(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x3cd0
leaq -0x28(%rbp), %rdi
callq 0x3458
movq -0x1e0(%rbp), %rsi
leaq -0x1a8(%rbp), %rdi
movl $0x8, %edx
callq 0x33c0
leaq -0x1c8(%rbp), %rdi
callq 0x32f0
leaq -0x1a8(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x32a0
movq %rax, -0x1e8(%rbp)
jmp 0x3e7b
movq -0x1e8(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3290
movb %al, -0x1e9(%rbp)
jmp 0x3e99
movb -0x1e9(%rbp), %al
testb $0x1, %al
jne 0x3ea8
jmp 0x3f29
leaq -0x1c8(%rbp), %rdi
callq 0x3d70
jmp 0x3eb6
leaq 0xd503(%rip), %rdi      # 0x113c0
callq 0x3310
leaq 0xd387(%rip), %rdi      # 0x11250
leaq -0x1c8(%rbp), %rsi
callq 0x4cd0
movq %rax, -0x1f8(%rbp)
jmp 0x3ede
movq -0x1f8(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
leaq 0xd4cd(%rip), %rdi      # 0x113c0
callq 0x31a0
jmp 0x3e5f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1d0(%rbp)
movl %eax, -0x1d4(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x3458
leaq -0x1a8(%rbp), %rdi
callq 0x3140
jmp 0x3f4a
leaq -0x1c8(%rbp), %rdi
callq 0x3458
leaq -0x1a8(%rbp), %rdi
callq 0x3140
addq $0x200, %rsp            # imm = 0x200
popq %rbp
retq
movq -0x1d0(%rbp), %rdi
callq 0x33e0
nopw %cs:(%rax,%rax)
// File: sunpihai-up[P]MulThreadsWordsCounter/WordsCounter-v3.cpp
// Function: consumer(void*)
void *consumer(void *args)
{
    string line;
    // loop while producer is working or queue is not empty
    while (producerNum > 0 || !isEmptyWork())
    {
        pthread_mutex_lock(&queueMutex);
        while (producerNum > 0 && workQueue.empty())
        {
            // Wait for the producer to stop reading or the work queue is not empty
            pthread_cond_wait(&condQueue, &queueMutex);
        }

        if (!workQueue.empty())
        {
            // Only take strings when the work queue is not empty
            line = workQueue.front();
            workQueue.pop();
        }

        pthread_cond_signal(&condQueue); // Wake up a waiting thread
        pthread_mutex_unlock(&queueMutex);

        // Count words in this line
        wordCount(line);
    }
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x32f0
leaq 0xd3cc(%rip), %rdi      # 0x11348
callq 0x4d00
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x59(%rbp)
jg 0x3f9f
callq 0x3dd0
movb %al, -0x5a(%rbp)
jmp 0x3f97
movb -0x5a(%rbp), %al
xorb $-0x1, %al
movb %al, -0x59(%rbp)
movb -0x59(%rbp), %al
testb $0x1, %al
jne 0x3fab
jmp 0x40bb
leaq 0xd3e6(%rip), %rdi      # 0x11398
callq 0x3310
leaq 0xd38a(%rip), %rdi      # 0x11348
callq 0x4d00
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x5b(%rbp)
jle 0x3fe8
leaq 0xd2b2(%rip), %rdi      # 0x11288
callq 0x49f0
movb %al, -0x5c(%rbp)
jmp 0x3fe0
movb -0x5c(%rbp), %al
movb %al, -0x5b(%rbp)
jmp 0x3fe8
movb -0x5b(%rbp), %al
testb $0x1, %al
jne 0x3ff1
jmp 0x4019
leaq 0xd3f0(%rip), %rdi      # 0x113e8
leaq 0xd399(%rip), %rsi      # 0x11398
callq 0x3340
jmp 0x4006
jmp 0x3fb7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x40cc
leaq 0xd268(%rip), %rdi      # 0x11288
callq 0x49f0
movb %al, -0x5d(%rbp)
jmp 0x402a
movb -0x5d(%rbp), %al
testb $0x1, %al
jne 0x4064
jmp 0x4033
leaq 0xd24e(%rip), %rdi      # 0x11288
callq 0x4ae0
movq %rax, -0x68(%rbp)
jmp 0x4045
movq -0x68(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x3050
jmp 0x4054
leaq 0xd22d(%rip), %rdi      # 0x11288
callq 0x4b00
jmp 0x4062
jmp 0x4064
leaq 0xd37d(%rip), %rdi      # 0x113e8
callq 0x3030
leaq 0xd321(%rip), %rdi      # 0x11398
callq 0x31a0
leaq -0x58(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x3120
jmp 0x408b
leaq -0x58(%rbp), %rdi
callq 0x3e10
jmp 0x4096
leaq -0x58(%rbp), %rdi
callq 0x3458
jmp 0x3f75
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3458
jmp 0x40cc
leaq -0x28(%rbp), %rdi
callq 0x3458
xorl %eax, %eax
addq $0x70, %rsp
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x3458
movq -0x30(%rbp), %rdi
callq 0x33e0
nop
// File: sunpihai-up[P]MulThreadsWordsCounter/WordsCounter-v3.cpp
// Function: sortWords()
void sortWords()
{
    auto iter = staResult.begin();
    while (iter != staResult.end())
    {
        wordsRank.push(make_pair(iter->second, iter->first));
        iter++;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
leaq 0xd161(%rip), %rdi      # 0x11250
callq 0x4d90
movq %rax, -0x8(%rbp)
leaq 0xd151(%rip), %rdi      # 0x11250
callq 0x4df0
movq %rax, -0x10(%rbp)
leaq -0x8(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x4dc0
testb $0x1, %al
jne 0x411b
jmp 0x4193
leaq -0x8(%rbp), %rdi
movq %rdi, -0x68(%rbp)
callq 0x4eb0
movq -0x68(%rbp), %rdi
addq $0x20, %rax
movq %rax, -0x60(%rbp)
callq 0x4eb0
movq -0x60(%rbp), %rsi
movq %rax, %rdx
leaq -0x38(%rbp), %rdi
movq %rdi, -0x58(%rbp)
callq 0x4e70
movq -0x58(%rbp), %rsi
leaq 0xd1d0(%rip), %rdi      # 0x11328
callq 0x4e20
jmp 0x415f
leaq -0x38(%rbp), %rdi
callq 0x4ee0
leaq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x4f00
movq %rax, -0x50(%rbp)
jmp 0x40f8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x4ee0
jmp 0x4199
addq $0x70, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x33e0
nopw %cs:(%rax,%rax)
// File: sunpihai-up[P]MulThreadsWordsCounter/WordsCounter-v3.cpp
// Function: printHotWords()
void printHotWords()
{
    // Print title
    printf("%-10s%-20s%-10s\n", "RANK", "KEY WORDS", "FREQUENCY");
    for (int i = 1; i <= printNum && !wordsRank.empty(); i++)
    {
        cout << setiosflags(ios::left)
             << setw(10) << i << setw(20) << wordsRank.top().second
             << setw(10) << wordsRank.top().first << endl;
        wordsRank.pop();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
leaq 0x6ee7(%rip), %rdi      # 0xb0a6
leaq 0x6ef1(%rip), %rsi      # 0xb0b7
leaq 0x6eef(%rip), %rdx      # 0xb0bc
leaq 0x6ef2(%rip), %rcx      # 0xb0c6
movb $0x0, %al
callq 0x3060
movl $0x1, -0x4(%rbp)
xorl %eax, %eax
cmpl $0xa, -0x4(%rbp)
movb %al, -0x15(%rbp)
jg 0x41fe
leaq 0xd134(%rip), %rdi      # 0x11328
callq 0x4f30
xorb $-0x1, %al
movb %al, -0x15(%rbp)
movb -0x15(%rbp), %al
testb $0x1, %al
jne 0x420a
jmp 0x42ec
movl $0x20, %edi
callq 0x4f50
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %esi
movq 0xcd9f(%rip), %rdi      # 0x10fc0
callq 0x3430
movq %rax, -0x40(%rbp)
movl $0xa, %edi
callq 0x4f70
movq -0x40(%rbp), %rdi
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %esi
callq 0x3260
movq %rax, %rdi
movl -0x4(%rbp), %esi
callq 0x33d0
movq %rax, -0x38(%rbp)
movl $0x14, %edi
callq 0x4f70
movq -0x38(%rbp), %rdi
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %esi
callq 0x3260
movq %rax, -0x30(%rbp)
leaq 0xd0b2(%rip), %rdi      # 0x11328
callq 0x4f90
movq -0x30(%rbp), %rdi
movq %rax, %rsi
addq $0x8, %rsi
callq 0x31e0
movq %rax, -0x28(%rbp)
movl $0xa, %edi
callq 0x4f70
movq -0x28(%rbp), %rdi
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %esi
callq 0x3260
movq %rax, -0x20(%rbp)
leaq 0xd075(%rip), %rdi      # 0x11328
callq 0x4f90
movq -0x20(%rbp), %rdi
movl (%rax), %esi
callq 0x33d0
movq %rax, %rdi
movq 0xccdb(%rip), %rsi      # 0x10fa8
callq 0x3240
leaq 0xd04f(%rip), %rdi      # 0x11328
callq 0x4fb0
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x41e2
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: sunpihai-up[P]MulThreadsWordsCounter/WordsCounter-v3.cpp
// Function: threadLauncher(std::vector<unsigned long*, std::allocator<unsigned long*>>&, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void threadLauncher(std::vector<pthread_t *> &threadGroup, int cores, string &path)
{
    getFiles(path);
    for (int i = 0; i < cores / 2; i++)
    {
        threadGroup.push_back(new pthread_t);
        pthread_create(threadGroup[i], NULL, launchProducer, NULL);
    }

    for (int i = cores / 2; i < cores; i++)
    {
        threadGroup.push_back(new pthread_t);
        pthread_create(threadGroup[i], NULL, consumer, NULL);
    }

    for (int i = 0; i < threadGroup.size(); i++)
    {
        pthread_join(*threadGroup[i], NULL);
        free(threadGroup[i]);
        threadGroup[i] = NULL;
    }

    sortWords();
    printHotWords();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x38(%rbp), %rdi
movq %rdi, -0x70(%rbp)
callq 0x3120
movq -0x70(%rbp), %rdi
callq 0x36f0
jmp 0x4332
leaq -0x38(%rbp), %rdi
callq 0x3458
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x74(%rbp)
movl -0xc(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x74(%rbp), %eax
cmpl %ecx, %eax
jge 0x43c7
movq -0x8(%rbp), %rax
movq %rax, -0x80(%rbp)
movl $0x8, %edi
callq 0x3230
movq -0x80(%rbp), %rdi
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rsi
callq 0x5000
movq -0x8(%rbp), %rdi
movslq -0x48(%rbp), %rsi
callq 0x5030
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %ecx
leaq -0x7da(%rip), %rdx      # 0x3bc0
movq %rcx, %rsi
callq 0x3400
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x4342
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x3458
jmp 0x44c1
movl -0xc(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x4434
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
movl $0x8, %edi
callq 0x3230
movq -0x88(%rbp), %rdi
movq %rax, -0x60(%rbp)
leaq -0x60(%rbp), %rsi
callq 0x5000
movq -0x8(%rbp), %rdi
movslq -0x54(%rbp), %rsi
callq 0x5030
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %ecx
leaq -0x4c1(%rip), %rdx      # 0x3f60
movq %rcx, %rsi
callq 0x3400
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x43d5
movl $0x0, -0x64(%rbp)
movslq -0x64(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x8(%rbp), %rdi
callq 0x5050
movq %rax, %rcx
movq -0x90(%rbp), %rax
cmpq %rcx, %rax
jae 0x44ae
movq -0x8(%rbp), %rdi
movslq -0x64(%rbp), %rsi
callq 0x5030
movq (%rax), %rax
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x31f0
movq -0x8(%rbp), %rdi
movslq -0x64(%rbp), %rsi
callq 0x5030
movq (%rax), %rdi
callq 0x3270
movq -0x8(%rbp), %rdi
movslq -0x64(%rbp), %rsi
callq 0x5030
movq $0x0, (%rax)
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x443b
callq 0x40e0
callq 0x41b0
addq $0x90, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x33e0
nopw (%rax,%rax)
// File: mooncoincore[P]mooncoin-seeder/bitcoin.cpp
// Function: CNode::PushVersion()
void PushVersion() {
    int64 nTime = time(NULL);
    uint64 nLocalNonce = BITCOIN_SEED_NONCE;
    int64 nLocalServices = 0;
    CAddress me(CService("0.0.0.0"));
    BeginMessage("version");
    int nBestHeight = GetRequireHeight();
    string ver = "/mooncoin-seeder: v0.13.9.0-b257fcdsegwit/";
    vSend << PROTOCOL_VERSION << nLocalServices << nTime << you << me << nLocalNonce << ver << nBestHeight;
    EndMessage();
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xb0(%rbp)
xorl %eax, %eax
movl %eax, -0xb4(%rbp)
movl %eax, %edi
callq 0x44a0
movl -0xb4(%rbp), %edx
movq %rax, -0x10(%rbp)
movabsq $0x539a019ca550825, %rax # imm = 0x539A019CA550825
movq %rax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
leaq 0x2b9a4(%rip), %rsi     # 0x33024
leaq -0x60(%rbp), %rdi
callq 0x14930
movw -0x50(%rbp), %cx
movq %rsp, %rax
movw %cx, 0x10(%rax)
movups -0x60(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x48(%rbp), %rdi
movl $0x1, %esi
callq 0x189a0
movq -0xb0(%rbp), %rdi
leaq 0x2b975(%rip), %rsi     # 0x3302c
callq 0x80c0
leaq 0x42edd(%rip), %rax     # 0x4a5a0
movzbl (%rax), %edi
andl $0x1, %edi
callq 0x6b80
movl %eax, -0x64(%rbp)
leaq -0x89(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
callq 0x4800
movq -0xa8(%rbp), %rdx
leaq 0x2b942(%rip), %rsi     # 0x33034
leaq -0x88(%rbp), %rdi
callq 0x4690
jmp 0x7700
leaq -0x89(%rbp), %rdi
callq 0x4520
movq -0xb0(%rbp), %rdi
addq $0x8, %rdi
leaq 0x2bb6a(%rip), %rsi     # 0x33288
callq 0x8140
movq %rax, -0xc0(%rbp)
jmp 0x772c
movq -0xc0(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x8180
movq %rax, -0xc8(%rbp)
jmp 0x7745
movq -0xc8(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x8180
movq %rax, -0xd0(%rbp)
jmp 0x775e
movq -0xd0(%rbp), %rdi
movq -0xb0(%rbp), %rsi
addq $0xa8, %rsi
callq 0x81c0
movq %rax, -0xd8(%rbp)
jmp 0x7781
movq -0xd8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x81c0
movq %rax, -0xe0(%rbp)
jmp 0x779a
movq -0xe0(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x8200
movq %rax, -0xe8(%rbp)
jmp 0x77b3
movq -0xe8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x8240
movq %rax, -0xf0(%rbp)
jmp 0x77cf
movq -0xf0(%rbp), %rdi
leaq -0x64(%rbp), %rsi
callq 0x8140
jmp 0x77e1
movq -0xb0(%rbp), %rdi
callq 0x8280
jmp 0x77ef
leaq -0x88(%rbp), %rdi
callq 0x42f0
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x89(%rbp), %rdi
callq 0x4520
jmp 0x7842
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x42f0
movq -0x98(%rbp), %rdi
callq 0x47f0
nop
// File: helchr[P]reMap/main.cpp
// Function: allocate(unsigned long)
void* allocate(uint64_t size)
{
    auto sizeGb = size / (1024*1024*1024ULL);
    auto space = tryAllocate1Gb(size);
    auto l = mlock(space,size);
    if(space != (void*) -1 && l == 0)
    {
        std::cout << "Allocated " << sizeGb << "GB using 1GB pages" << endl;
        return space;
    }
    space = tryAllocate2Mb(size);
    l = mlock(space,size);
    if(space != (void*) -1 && l == 0)
    {
        std::cout << "Allocated " << sizeGb << "GB using 2MB pages" << endl;
        return space;
    }
    space = tryAllocate4Kb(size);
    l = mlock(space,size);
    if(space != (void*) -1 && l == 0)
    {
        std::cout << "Allocated " << sizeGb << "GB using 4KB pages" << endl;
        return space;
    }
    std::cout << "Failed to allocate " << sizeGb << "GB" << endl;
    return nullptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
shrq $0x1e, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x9210
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6710
movl %eax, -0x24(%rbp)
movq $-0x1, %rax
cmpq %rax, -0x20(%rbp)
je 0x9362
cmpl $0x0, -0x24(%rbp)
jne 0x9362
movq 0x3cc91(%rip), %rdi     # 0x45fb0
leaq 0x29d7a(%rip), %rsi     # 0x330a0
callq 0x6570
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x6540
movq %rax, %rdi
leaq 0x29d6a(%rip), %rsi     # 0x330ab
callq 0x6570
movq %rax, %rdi
movq 0x3cc18(%rip), %rsi     # 0x45f68
callq 0x65b0
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x9498
movq -0x10(%rbp), %rdi
callq 0x9250
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6710
movl %eax, -0x24(%rbp)
movq $-0x1, %rax
cmpq %rax, -0x20(%rbp)
je 0x93dc
cmpl $0x0, -0x24(%rbp)
jne 0x93dc
movq 0x3cc17(%rip), %rdi     # 0x45fb0
leaq 0x29d00(%rip), %rsi     # 0x330a0
callq 0x6570
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x6540
movq %rax, %rdi
leaq 0x29d03(%rip), %rsi     # 0x330be
callq 0x6570
movq %rax, %rdi
movq 0x3cb9e(%rip), %rsi     # 0x45f68
callq 0x65b0
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x9498
movq -0x10(%rbp), %rdi
callq 0x9290
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6710
movl %eax, -0x24(%rbp)
movq $-0x1, %rax
cmpq %rax, -0x20(%rbp)
je 0x9453
cmpl $0x0, -0x24(%rbp)
jne 0x9453
movq 0x3cb9d(%rip), %rdi     # 0x45fb0
leaq 0x29c86(%rip), %rsi     # 0x330a0
callq 0x6570
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x6540
movq %rax, %rdi
leaq 0x29c9c(%rip), %rsi     # 0x330d1
callq 0x6570
movq %rax, %rdi
movq 0x3cb24(%rip), %rsi     # 0x45f68
callq 0x65b0
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x9498
movq 0x3cb56(%rip), %rdi     # 0x45fb0
leaq 0x29c83(%rip), %rsi     # 0x330e4
callq 0x6570
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x6540
movq %rax, %rdi
leaq 0x29c7c(%rip), %rsi     # 0x330f8
callq 0x6570
movq %rax, %rdi
movq 0x3cadd(%rip), %rsi     # 0x45f68
callq 0x65b0
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: helchr[P]reMap/main.cpp
// Function: getUsedSets(std::map<unsigned long, std::vector<unsigned long, std::allocator<unsigned long>>, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, std::vector<unsigned long, std::allocator<unsigned long>>>>>)
std::vector<uint64_t> getUsedSets(AddressSet addressSet)
{
    std::vector<uint64_t> usedSets;
    for(auto list : addressSet)
    {
        if(!list.second.empty())
        {
            usedSets.push_back(list.first);
        }
    }
    return usedSets;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rsi, -0x68(%rbp)
movq %rdi, -0x78(%rbp)
movq %rdi, %rax
movq %rax, -0x70(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
callq 0xc710
movq -0x68(%rbp), %rsi
movq %rsi, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0xc730
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0xc760
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0xc790
testb $0x1, %al
jne 0x9510
jmp 0x9585
leaq -0x28(%rbp), %rdi
callq 0xc7c0
movq %rax, %rsi
leaq -0x50(%rbp), %rdi
callq 0xc7e0
jmp 0x9527
leaq -0x50(%rbp), %rdi
addq $0x8, %rdi
callq 0xc820
testb $0x1, %al
jne 0x956e
movq -0x78(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0xc860
jmp 0x9547
jmp 0x956e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x95a5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0xc8d0
jmp 0x95a5
leaq -0x50(%rbp), %rdi
callq 0xc8d0
leaq -0x28(%rbp), %rdi
callq 0xc8f0
jmp 0x94fd
movb $0x1, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
jne 0x9598
movq -0x78(%rbp), %rdi
callq 0xc920
movq -0x70(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0xc920
movq -0x58(%rbp), %rdi
callq 0x6950
nopw (%rax,%rax)
// File: helchr[P]reMap/main.cpp
// Function: getPhysicalAddr(unsigned long)
uint64_t getPhysicalAddr(uint64_t virtualAddr) {
    uint64_t value;
    off_t offset = (virtualAddr / 4096) * sizeof(value);
    int got = pread(g_pagemap_fd, &value, sizeof(value), offset);
    assert(got == 8);

    // Check the "page present" flag.
    assert(value & (1ULL << 63));
    uint64_t frame_num = frameNumberFromPagemap(value);
    return (frame_num * 4096) | (virtualAddr & (4095));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
shrq $0xc, %rax
shlq $0x3, %rax
movq %rax, -0x18(%rbp)
movl 0x3cefe(%rip), %edi     # 0x46550
movq -0x18(%rbp), %rcx
leaq -0x10(%rbp), %rsi
movl $0x8, %edx
callq 0x6690
movl %eax, -0x1c(%rbp)
cmpl $0x8, -0x1c(%rbp)
jne 0x966f
jmp 0x968e
leaq 0x29ac6(%rip), %rdi     # 0x3313c
leaq 0x29aa3(%rip), %rsi     # 0x33120
movl $0x7f, %edx
leaq 0x29abc(%rip), %rcx     # 0x33145
callq 0x63e0
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
andq -0x10(%rbp), %rax
cmpq $0x0, %rax
je 0x96a4
jmp 0x96c3
leaq 0x29abd(%rip), %rdi     # 0x33168
leaq 0x29a6e(%rip), %rsi     # 0x33120
movl $0x82, %edx
leaq 0x29a87(%rip), %rcx     # 0x33145
callq 0x63e0
movq -0x10(%rbp), %rdi
callq 0x95c0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
shlq $0xc, %rax
movq -0x8(%rbp), %rcx
andq $0xfff, %rcx            # imm = 0xFFF
orq %rcx, %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: helchr[P]reMap/main.cpp
// Function: access(unsigned long, unsigned long)
void access(uint64_t addr,size_t numAccess)
{
    volatile uint64_t *p = (volatile uint64_t *) addr;
    for (unsigned int i = 0; i < numAccess; i++)
    {
        _mm_clflush((void*)p);
        _mm_lfence();
        *p;
        _mm_lfence();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpq -0x10(%rbp), %rax
jae 0x9733
movq -0x18(%rbp), %rax
clflush (%rax)
lfence
movq -0x18(%rbp), %rax
movq (%rax), %rax
lfence
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x970b
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: helchr[P]reMap/main.cpp
// Function: perf_event_open(perf_event_attr*, int, int, int, unsigned long)
static long perf_event_open(struct perf_event_attr *hw_event, pid_t pid,
                            int cpu, int group_fd, unsigned long flags)
{
    int ret;

    ret = syscall(__NR_perf_event_open, hw_event, pid, cpu,
                  group_fd, flags);
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq %r8, -0x20(%rbp)
movq -0x8(%rbp), %rsi
movl -0xc(%rbp), %edx
movl -0x10(%rbp), %ecx
movl -0x14(%rbp), %r8d
movq -0x20(%rbp), %r9
movl $0x12a, %edi            # imm = 0x12A
movb $0x0, %al
callq 0x6080
movl %eax, -0x24(%rbp)
movslq -0x24(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: helchr[P]reMap/main.cpp
// Function: stopMeasure(int)
long long stopMeasure(int fd)
{
    long long count;
    _mm_mfence();
    ioctl(fd, PERF_EVENT_IOC_DISABLE, 0);
    read(fd, &count, sizeof(long long));
    close(fd);
    return count;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
mfence
movl -0x4(%rbp), %edi
movl $0x2401, %esi           # imm = 0x2401
xorl %edx, %edx
movb $0x0, %al
callq 0x6770
movl -0x4(%rbp), %edi
leaq -0x10(%rbp), %rsi
movl $0x8, %edx
callq 0x67b0
movl -0x4(%rbp), %edi
callq 0x6a40
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: helchr[P]reMap/main.cpp
// Function: getRandomAddress(unsigned long, unsigned long)
uint64_t getRandomAddress(uint64_t base, uint64_t size)
{
    size_t part1 = static_cast<size_t>(rand());
    size_t part2 = static_cast<size_t>(rand());
    size_t offset = ((part1 << 32ULL) | part2) % size;
    auto clSize = 64ULL;
    offset = (offset / clSize) * clSize;
    return  base + offset;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0x61a0
cltq
movq %rax, -0x18(%rbp)
callq 0x61a0
cltq
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
shlq $0x20, %rax
orq -0x20(%rbp), %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq -0x10(%rbp)
movq %rdx, -0x28(%rbp)
movq $0x40, -0x30(%rbp)
movq -0x28(%rbp), %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq -0x30(%rbp)
imulq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
addq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: helchr[P]reMap/main.cpp
// Function: getNextAddress(unsigned long, unsigned long, unsigned long)
uint64_t getNextAddress(uint64_t oldAddr, uint64_t base, uint64_t size)
{
    static const size_t MIN_SHIFT = 6;
    static size_t shift = MIN_SHIFT;
    static uint64_t baseAddr = 0;
    if(shift == MIN_SHIFT)
    {
        baseAddr = oldAddr;
    }
    auto oldPhys = getPhysicalAddr(baseAddr);
    auto addr = baseAddr ^ (1ULL << shift);
    if(addr >= base && addr < base+size)
    {
        volatile uint8_t* p;
        p = (uint8_t*) addr;
        *p;
        auto phys = getPhysicalAddr(addr);
        auto diff = std::bitset<64>(phys) ^ std::bitset<64>(oldPhys);
        if(diff.count() > 1)
        {
            //moved into a new frame
            shift = MIN_SHIFT;
            return getRandomAddress(base,size);
        }
        else
        {
            shift++;
            return addr;
        }
    }
    else
    {
        shift = MIN_SHIFT;
        return getRandomAddress(base,size);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x6, 0x3ca4c(%rip)     # 0x46558
jne 0x9b19
movq -0x10(%rbp), %rax
movq %rax, 0x3ca5f(%rip)     # 0x46578
movq 0x3ca58(%rip), %rdi     # 0x46578
callq 0x9630
movq %rax, -0x28(%rbp)
movq 0x3ca48(%rip), %rax     # 0x46578
movq 0x3ca21(%rip), %rcx     # 0x46558
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
xorq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
jb 0x9bfb
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
cmpq %rcx, %rax
jae 0x9bfb
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movb (%rax), %al
movq -0x30(%rbp), %rdi
callq 0x9630
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0xca60
movq -0x28(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0xca60
leaq -0x50(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0xca20
movq %rax, -0x48(%rbp)
leaq -0x48(%rbp), %rdi
callq 0xcab0
cmpq $0x1, %rax
jbe 0x9bdf
movq $0x6, 0x3c98c(%rip) # 0x46558
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x9a80
movq %rax, -0x8(%rbp)
jmp 0x9c17
movq 0x3c972(%rip), %rax     # 0x46558
addq $0x1, %rax
movq %rax, 0x3c967(%rip)     # 0x46558
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x9c17
movq $0x6, 0x3c952(%rip) # 0x46558
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x9a80
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)