LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Cache.h
// Function: ramulator::CacheSystem::CacheSystem(ramulator::Config const&, std::function<bool (ramulator::Request)>)
CacheSystem(const Config& configs, std::function<bool(Request)> send_memory):
    send_memory(send_memory) {
      if (configs.has_core_caches()) {
        first_level = Cache::Level::L1;
      } else if (configs.has_l3_cache()) {
        first_level = Cache::Level::L3;
      } else {
        last_level = Cache::Level::MAX; // no cache
      }

      if (configs.has_l3_cache()) {
        last_level = Cache::Level::L3;
      } else if (configs.has_core_caches()) {
        last_level = Cache::Level::L2;
      } else {
        last_level = Cache::Level::MAX; // no cache
      }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r12
movq %rdi, %rbx
movq %rdi, 0x8(%rdi)
movq %rdi, (%rdi)
xorl %eax, %eax
movq %rax, 0x10(%rdi)
leaq 0x18(%rdi), %r14
movq %r14, 0x20(%rdi)
movq %r14, 0x18(%rdi)
movq %rax, 0x28(%rdi)
leaq 0x30(%rdi), %r15
movq %r15, %rdi
movq %rdx, %rsi
callq 0x12e8fe
movq $0x0, 0x50(%rbx)
movq %r12, %rdi
callq 0x12e6e6
testb %al, %al
je 0x12e9b3
movl $0x0, 0x58(%rbx)
jmp 0x12e9cf
movq %r12, %rdi
callq 0x12e7f2
testb %al, %al
je 0x12e9c8
movl $0x2, 0x58(%rbx)
jmp 0x12e9cf
movl $0x3, 0x5c(%rbx)
movq %r12, %rdi
callq 0x12e7f2
testb %al, %al
je 0x12e9e4
movl $0x2, 0x5c(%rbx)
jmp 0x12ea00
movq %r12, %rdi
callq 0x12e6e6
testb %al, %al
je 0x12e9f9
movl $0x1, 0x5c(%rbx)
jmp 0x12ea00
movl $0x3, 0x5c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r12
jmp 0x12ea2a
movq %rax, %r12
movq 0x40(%rbx), %rax
testq %rax, %rax
je 0x12ea2a
movq %r15, %rdi
movq %r15, %rsi
movl $0x3, %edx
callq *%rax
movq %r14, %rdi
callq 0x12ed6a
movq %rbx, %rdi
callq 0x12ed6a
movq %r12, %rdi
callq 0xb510
movq %rax, %rdi
callq 0x171a3
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Refresh.cpp
// Function: ramulator::Refresh<ramulator::DSARP>::tick_ref()
void Refresh<DSARP>::tick_ref() {
  clk++;

  bool b_ref_rank = ctrl->channel->spec->b_ref_rank;
  int refresh_interval =
      (b_ref_rank) ?
          ctrl->channel->spec->speed_entry.nREFI :
          ctrl->channel->spec->speed_entry.nREFIpb;

  // DARP
  if (ctrl->channel->spec->type == DSARP::Type::DARP ||
    ctrl->channel->spec->type == DSARP::Type::DSARP) {
    // Write-Refresh Parallelization. Issue refreshes when the controller enters writeback mode
    if (!ctrl_write_mode && ctrl->write_mode)
      wrp();
    // Record write mode
    ctrl_write_mode = ctrl->write_mode;
    // Inject early to pull in some refreshes during read mode
    early_inject_refresh();
  }

  // Time to schedule a refresh and also try to skip some refreshes
  if ((clk - refreshed) >= refresh_interval)
    inject_refresh(b_ref_rank);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movq 0x10(%rdi), %rcx
incq %rcx
movq %rcx, 0x10(%rdi)
movq 0x1098(%rax), %rdx
movq 0x390(%rdx), %rdx
movzbl 0x31f8(%rdx), %ebp
movl %ebp, %esi
xorl $0x1, %esi
movslq 0x31cc(%rdx,%rsi,4), %r14
movl (%rdx), %edx
cmpl $0x4, %edx
je 0x13046e
cmpl $0x2, %edx
jne 0x1304a4
cmpb $0x0, 0x90(%rbx)
jne 0x13048c
cmpb $0x1, 0x1190(%rax)
jne 0x13048c
movq %rbx, %rdi
callq 0x12ffd8
movq 0x8(%rbx), %rax
movb 0x1190(%rax), %al
movb %al, 0x90(%rbx)
movq %rbx, %rdi
callq 0x12f932
movq 0x10(%rbx), %rcx
subq 0x18(%rbx), %rcx
cmpq %r14, %rcx
jge 0x1304b2
popq %rbx
popq %r14
popq %rbp
retq
movzbl %bpl, %esi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x12fd8e
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/STTMRAM.cpp
// Function: ramulator::STTMRAM::init_speed()
void STTMRAM::init_speed()
{
    // nRRD, nFAW
    int page = (org_entry.dq * org_entry.count[int(Level::Column)]) >> 13;
    switch (speed_entry.rate) {
          case 1600: speed_entry.nRRD = ceil(speed_entry.nRRD  * ((page==1) ? 5 : 6) /10.0); speed_entry.nFAW = ceil(speed_entry.nFAW *((page==1) ? 24 : 32)/10.0); break;
        default: assert(false);
    }

    // nRFC, nXS
    int chip = org_entry.size;
    switch (speed_entry.rate) {
        case 1600: speed_entry.nRFC = 1; break;
        default: assert(false);
    }
    switch (speed_entry.rate) {
          case 1600: speed_entry.nXS  = ceil(speed_entry.nXS * ((chip==512) ? 80  : (chip==1<<10) ? 96  : (chip==1<<11) ? 136 : (chip==1<<12) ? 216 : 288) /10.0); break;
        default: assert(false);
    }
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x28, %rsp
cmpl $0x640, 0x2898(%rdi)    # imm = 0x640
jne 0x1379f4
movq %rdi, %rbx
movl 0x2724(%rdi), %ebp
movl 0x273c(%rdi), %eax
imull 0x2728(%rdi), %eax
andl $0xffffe000, %eax       # imm = 0xFFFFE000
xorl %ecx, %ecx
cmpl $0x2000, %eax           # imm = 0x2000
sete %cl
movq 0x28e0(%rdi), %xmm0
movd %ecx, %xmm1
pshufd $0x50, %xmm1, %xmm1     # xmm1 = xmm1[0,0,1,1]
pslld $0x1f, %xmm1
psrad $0x1f, %xmm1
movdqa %xmm1, %xmm2
pandn 0x24db6(%rip), %xmm2    # 0x15c6d0
pand 0x24dbe(%rip), %xmm1    # 0x15c6e0
por %xmm2, %xmm1
pshufd $0xf5, %xmm1, %xmm2     # xmm2 = xmm1[1,1,3,3]
pmuludq %xmm0, %xmm1
pshufd $0xf5, %xmm0, %xmm0     # xmm0 = xmm0[1,1,3,3]
pmuludq %xmm2, %xmm0
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
cvtdq2pd %xmm1, %xmm0
divpd 0x24da8(%rip), %xmm0    # 0x15c6f0
movapd %xmm0, (%rsp)
callq 0xb0b0
movapd %xmm0, 0x10(%rsp)
movapd (%rsp), %xmm0
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
callq 0xb0b0
movapd 0x10(%rsp), %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
cvttpd2dq %xmm1, %xmm0
movlpd %xmm0, 0x28e0(%rbx)
movl $0x1, 0x28e8(%rbx)
movl 0x2900(%rbx), %eax
cmpl $0x200, %ebp            # imm = 0x200
je 0x1379b2
cmpl $0x400, %ebp            # imm = 0x400
je 0x1379ab
cmpl $0x800, %ebp            # imm = 0x800
jne 0x1379b9
movl $0x88, %ecx
jmp 0x1379cc
movl $0x60, %ecx
jmp 0x1379cc
movl $0x50, %ecx
jmp 0x1379cc
cmpl $0x1000, %ebp           # imm = 0x1000
movl $0xd8, %edx
movl $0x120, %ecx            # imm = 0x120
cmovel %edx, %ecx
imull %eax, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
divsd 0x24d22(%rip), %xmm0    # 0x15c700
callq 0xb0b0
cvttsd2si %xmm0, %eax
movl %eax, 0x2900(%rbx)
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
leaq 0x1299e(%rip), %rdi     # 0x14a399
leaq 0x24e19(%rip), %rsi     # 0x15c81b
leaq 0x24e22(%rip), %rcx     # 0x15c82b
movl $0x44, %edx
callq 0xb200
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/STTMRAM.cpp
// Function: ramulator::STTMRAM::init_rowopen()
void STTMRAM::init_rowopen()
{
    // RD
    rowopen[int(Level::Bank)][int(Command::RD)] = [] (DRAM<STTMRAM>* node, Command cmd, int id) {
        switch (int(node->state)) {
            case int(State::Closed): return false;
            case int(State::Opened): return true;
            default: assert(false);
        }};

    // WR
    rowopen[int(Level::Bank)][int(Command::WR)] = rowopen[int(Level::Bank)][int(Command::RD)];
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movups 0x1440(%rdi), %xmm0
movaps %xmm0, (%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x1440(%rdi)
movq 0x1450(%rdi), %rax
movq %rax, 0x10(%rsp)
leaq 0x23fc(%rip), %rcx      # 0x13a0da
movq %rcx, 0x1450(%rdi)
movq 0x1458(%rdi), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x23aa(%rip), %rcx      # 0x13a0a2
movq %rcx, 0x1458(%rdi)
testq %rax, %rax
je 0x137d11
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x1440(%rbx), %rsi
addq $0x1460, %rbx           # imm = 0x1460
movq %rbx, %rdi
callq 0x13a5ac
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rdi
callq 0x171a3
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/StatType.cpp
// Function: Stats::Histogram::grow_convert()
void
Histogram::grow_convert()
{
    int size = cvec.size();
    int half = (size + 1) / 2; // round up!
    //bool even = (size & 1) == 0;

    int pair = size - 1;
    for (int i = size - 1; i >= half; --i) {
        cvec[i] = cvec[pair];
        if (pair - 1 >= 0)
            cvec[i] += cvec[pair - 1];
        pair -= 2;
    }

    for (int i = half - 1; i >= 0; i--)
        cvec[i] = Counter();

    min_bucket = -max_bucket;// - (even ? bucket_size : 0);
    bucket_size *= 2;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0xb0(%rdi), %rax
movq 0xb8(%rdi), %r9
subq %rax, %r9
movq %r9, %rdx
shrq $0x3, %rdx
leal 0x1(%rdx), %ecx
shrl $0x1f, %ecx
addl %edx, %ecx
incl %ecx
sarl %ecx
cmpl %edx, %ecx
jge 0x13b6e9
shlq $0x1d, %r9
movslq %edx, %rsi
movslq %ecx, %rdi
movabsq $-0x100000000, %r8      # imm = 0xFFFFFFFF00000000
addq %r9, %r8
sarq $0x20, %r8
movsd (%rax,%r8,8), %xmm0
movsd %xmm0, -0x8(%rax,%rsi,8)
testq %r8, %r8
jle 0x13b6dd
addsd -0x8(%rax,%r8,8), %xmm0
movsd %xmm0, -0x8(%rax,%rsi,8)
decq %rsi
addq $-0x2, %r8
cmpq %rdi, %rsi
jg 0x13b6bf
testl %edx, %edx
jle 0x13b712
leal -0x1(%rcx), %edx
testl %ecx, %ecx
movl $0x1, %esi
cmovlel %ecx, %esi
subl %esi, %ecx
subq %rcx, %rdx
leaq (%rax,%rdx,8), %rdi
leaq 0x8(,%rcx,8), %rdx
xorl %esi, %esi
callq 0xb1d0
movsd 0x80(%rbx), %xmm0
xorps 0x218bf(%rip), %xmm0    # 0x15cfe0
movlps %xmm0, 0x78(%rbx)
movsd 0x88(%rbx), %xmm0
addsd %xmm0, %xmm0
movsd %xmm0, 0x88(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/StatType.cpp
// Function: Stats::Histogram::grow_up()
void
Histogram::grow_up()
{
    int size = cvec.size();
    int half = (size + 1) / 2; // round up!

    int pair = 0;
    for (int i = 0; i < half; i++) {
        cvec[i] = cvec[pair];
        if (pair + 1 < size)
            cvec[i] += cvec[pair + 1];
        pair += 2;
    }
    assert(pair == size || pair == size + 1);

    for (int i = half; i < size; i++)
        cvec[i] = Counter();

    max_bucket *= 2;
    bucket_size *= 2;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0xb0(%rdi), %rcx
movq 0xb8(%rdi), %rax
subq %rcx, %rax
shrq $0x3, %rax
leal 0x1(%rax), %esi
movl %esi, %edx
shrl $0x1f, %edx
addl %eax, %edx
incl %edx
sarl %edx
testl %eax, %eax
jle 0x13b7af
movl %eax, %edi
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
cmpl $0x2, %edx
movl $0x1, %r9d
cmovgel %edx, %r9d
addl %r9d, %r9d
xorl %r8d, %r8d
movsd (%rcx,%r8,8), %xmm0
movsd %xmm0, (%rcx,%r8,4)
leaq 0x1(%r8), %r10
cmpq %rdi, %r10
jae 0x13b7a4
addsd 0x8(%rcx,%r8,8), %xmm0
movsd %xmm0, (%rcx,%r8,4)
addq $0x2, %r8
cmpq %r8, %r9
jne 0x13b782
jmp 0x13b7b2
xorl %r8d, %r8d
cmpl %eax, %r8d
setne %dil
cmpl %esi, %r8d
setne %sil
testb %sil, %dil
jne 0x13b7f9
cmpl %eax, %edx
jge 0x13b7e3
movslq %edx, %rsi
leaq (%rcx,%rsi,8), %rdi
notl %edx
addl %eax, %edx
leaq 0x8(,%rdx,8), %rdx
xorl %esi, %esi
callq 0xb1d0
movupd 0x80(%rbx), %xmm0
addpd %xmm0, %xmm0
movupd %xmm0, 0x80(%rbx)
popq %rbx
retq
leaq 0x21880(%rip), %rdi     # 0x15d080
leaq 0x2181b(%rip), %rsi     # 0x15d022
leaq 0x21893(%rip), %rcx     # 0x15d0a1
movl $0x5b, %edx
callq 0xb200
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/StatType.cpp
// Function: Stats::Histogram::sample(double, int)
void
Histogram::sample(Counter val, int number)
{
    assert(min_bucket < max_bucket);
    if (val < min_bucket) {
        if (min_bucket == 0)
            grow_convert();

        while (val < min_bucket)
            grow_out();
    } else if (val >= max_bucket + bucket_size) {
        if (min_bucket == 0) {
            while (val >= max_bucket + bucket_size)
                grow_up();
        } else {
            while (val >= max_bucket + bucket_size)
                grow_out();
        }
    }

    size_type index =
        (int64_t)std::floor((val - min_bucket) / bucket_size);

    assert(index >= 0 && index < size());
    cvec[index] += number;

    sum += val * number;
    squares += val * val * number;
    logs += log(val) * number;
    samples += number;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movsd 0x78(%rdi), %xmm2
movsd 0x80(%rdi), %xmm1
ucomisd %xmm2, %xmm1
jbe 0x13bad0
movl %esi, %ebp
movq %rdi, %rbx
ucomisd %xmm0, %xmm2
movsd %xmm0, (%rsp)
jbe 0x13b9af
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm2
jne 0x13b98f
jp 0x13b98f
movq %rbx, %rdi
callq 0x13b678
movsd (%rsp), %xmm0
movsd 0x78(%rbx), %xmm2
ucomisd %xmm0, %xmm2
jbe 0x13ba11
movq %rbx, %rdi
callq 0x13b4c2
movsd (%rsp), %xmm0
movsd 0x78(%rbx), %xmm1
ucomisd %xmm0, %xmm1
ja 0x13b995
jmp 0x13ba11
addsd 0x88(%rbx), %xmm1
ucomisd %xmm1, %xmm0
jb 0x13ba11
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm2
jne 0x13b9ee
jp 0x13b9ee
movq %rbx, %rdi
callq 0x13b73c
movsd (%rsp), %xmm0
movsd 0x80(%rbx), %xmm1
addsd 0x88(%rbx), %xmm1
ucomisd %xmm1, %xmm0
jae 0x13b9c9
jmp 0x13ba11
movq %rbx, %rdi
callq 0x13b4c2
movsd (%rsp), %xmm0
movsd 0x80(%rbx), %xmm1
addsd 0x88(%rbx), %xmm1
ucomisd %xmm1, %xmm0
jae 0x13b9ee
subsd 0x78(%rbx), %xmm0
divsd 0x88(%rbx), %xmm0
callq 0xb4b0
cvttsd2si %xmm0, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
cmpl %r14d, %eax
jbe 0x13baef
xorps %xmm2, %xmm2
cvtsi2sd %ebp, %xmm2
movsd %xmm2, 0x8(%rsp)
movl %r14d, %eax
movq 0xb0(%rbx), %rcx
movsd (%rcx,%rax,8), %xmm0
addsd %xmm2, %xmm0
movsd %xmm0, (%rcx,%rax,8)
movsd (%rsp), %xmm0
movapd %xmm0, %xmm1
mulsd %xmm2, %xmm1
addsd 0x90(%rbx), %xmm1
movsd %xmm1, 0x90(%rbx)
movapd %xmm0, %xmm1
mulsd %xmm0, %xmm1
mulsd %xmm2, %xmm1
addsd 0xa0(%rbx), %xmm1
movsd %xmm1, 0xa0(%rbx)
callq 0xb260
movsd 0x8(%rsp), %xmm1
mulsd %xmm1, %xmm0
addsd 0x98(%rbx), %xmm0
movsd %xmm0, 0x98(%rbx)
addsd 0xa8(%rbx), %xmm1
movsd %xmm1, 0xa8(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x21640(%rip), %rdi     # 0x15d117
leaq 0x21544(%rip), %rsi     # 0x15d022
leaq 0x2164a(%rip), %rcx     # 0x15d12f
movl $0x7c, %edx
callq 0xb200
leaq 0x102ab(%rip), %rdi     # 0x14bda1
leaq 0x21525(%rip), %rsi     # 0x15d022
leaq 0x2162b(%rip), %rcx     # 0x15d12f
movl $0x90, %edx
callq 0xb200
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/TLDRAM.cpp
// Function: ramulator::TLDRAM::init_rowhit()
void TLDRAM::init_rowhit()
{
    // RD
    rowhit[int(Level::Bank)][int(Command::RD)] = [] (DRAM<TLDRAM>* node, Command cmd, int id) {
        switch (int(node->state)) {
            case int(State::Closed): return false;
            case int(State::Opened):
                if (node->row_state.find(id) != node->row_state.end())
                    return true;
                return false;
            default: assert(false);
        }};

    // WR
    rowhit[int(Level::Bank)][int(Command::WR)] = rowhit[int(Level::Bank)][int(Command::RD)];
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movups 0x11d8(%rdi), %xmm0
movaps %xmm0, (%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x11d8(%rdi)
movq 0x11e8(%rdi), %rax
movq %rax, 0x10(%rsp)
leaq 0x3e28(%rip), %rcx      # 0x1406bc
movq %rcx, 0x11e8(%rdi)
movq 0x11f0(%rdi), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x3d8c(%rip), %rcx      # 0x14063a
movq %rcx, 0x11f0(%rdi)
testq %rax, %rax
je 0x13c8c7
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x11d8(%rbx), %rsi
addq $0x11f8, %rbx           # imm = 0x11F8
movq %rbx, %rdi
callq 0x140d52
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rdi
callq 0x171a3
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/TLDRAM.cpp
// Function: ramulator::TLDRAM::init_rowopen()
void TLDRAM::init_rowopen()
{
    // RD
    rowopen[int(Level::Bank)][int(Command::RD)] = [] (DRAM<TLDRAM>* node, Command cmd, int id) {
        switch (int(node->state)) {
            case int(State::Closed): return false;
            case int(State::Opened): return true;
            default: assert(false);
        }};

    // WR
    rowopen[int(Level::Bank)][int(Command::WR)] = rowopen[int(Level::Bank)][int(Command::RD)];
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movups 0x1c78(%rdi), %xmm0
movaps %xmm0, (%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x1c78(%rdi)
movq 0x1c88(%rdi), %rax
movq %rax, 0x10(%rsp)
leaq 0x3df0(%rip), %rcx      # 0x14070c
movq %rcx, 0x1c88(%rdi)
movq 0x1c90(%rdi), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x3d9e(%rip), %rcx      # 0x1406d4
movq %rcx, 0x1c90(%rdi)
testq %rax, %rax
je 0x13c94f
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x1c78(%rbx), %rsi
addq $0x1c98, %rbx           # imm = 0x1C98
movq %rbx, %rdi
callq 0x140d52
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rdi
callq 0x171a3
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/WideIO.cpp
// Function: ramulator::WideIO::init_speed()
void WideIO::init_speed()
{
    const static int RFC_TABLE[int(Speed::MAX)][int(Org::MAX)] = {
        {18, 26, 26, 42},
        {24, 35, 35, 56}
    };
    const static int REFI_TABLE[int(Speed::MAX)][int(Org::MAX)] = {
        {3120, 1560, 780, 780},
        {4160, 2080, 1040, 520}
    };
    int speed = 0, density = 0;
    switch(speed_entry.rate){
        case 200: speed = 0; break;
        case 266: speed = 1; break;
        default: assert(false);
    }
    switch(org_entry.size >> 8){
        case 1: density = 0; break;
        case 2: density = 1; break;
        case 4: density = 2; break;
        case 8: density = 3; break;
        default: assert(false);
    }
    speed_entry.nRFC = RFC_TABLE[speed][density];
    speed_entry.nREFI = REFI_TABLE[speed][density];
}

// Assembly:
pushq %rax
movl 0x26f8(%rdi), %eax
cmpl $0xc8, %eax
je 0x1420f2
cmpl $0x10a, %eax            # imm = 0x10A
jne 0x142165
movl $0x1, %eax
jmp 0x1420f4
xorl %eax, %eax
movl 0x25f0(%rdi), %ecx
sarl $0x8, %ecx
decl %ecx
cmpl $0x8, %ecx
jae 0x142146
movl $0x8b, %edx
btl %ecx, %edx
jae 0x142146
movl %ecx, %ecx
leaq 0x1c8e9(%rip), %rdx     # 0x15ea00
movq (%rdx,%rcx,8), %rcx
shll $0x4, %eax
leaq 0x1c91b(%rip), %rdx     # 0x15ea40
addq %rax, %rdx
movl (%rdx,%rcx,4), %edx
movl %edx, 0x274c(%rdi)
leaq 0x1c928(%rip), %rdx     # 0x15ea60
addq %rax, %rdx
movl (%rdx,%rcx,4), %eax
movl %eax, 0x2750(%rdi)
popq %rax
retq
leaq 0x824c(%rip), %rdi      # 0x14a399
leaq 0x1c20e(%rip), %rsi     # 0x15e362
leaq 0x1c2a6(%rip), %rcx     # 0x15e401
movl $0x4a, %edx
callq 0xb200
leaq 0x822d(%rip), %rdi      # 0x14a399
leaq 0x1c1ef(%rip), %rsi     # 0x15e362
leaq 0x1c287(%rip), %rcx     # 0x15e401
movl $0x43, %edx
callq 0xb200
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/WideIO2.cpp
// Function: ramulator::WideIO2::init_rowopen()
void WideIO2::init_rowopen()
{
    // RD
    rowopen[int(Level::Bank)][int(Command::RD)] = [] (DRAM<WideIO2>* node, Command cmd, int id) {
        switch (int(node->state)) {
            case int(State::Closed): return false;
            case int(State::Opened): return true;
            default: assert(false);
        }};

    // WR
    rowopen[int(Level::Bank)][int(Command::WR)] = rowopen[int(Level::Bank)][int(Command::RD)];
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movups 0x15e0(%rdi), %xmm0
movaps %xmm0, (%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x15e0(%rdi)
movq 0x15f0(%rdi), %rax
movq %rax, 0x10(%rsp)
leaq 0x318(%rip), %rcx       # 0x148392
movq %rcx, 0x15f0(%rdi)
movq 0x15f8(%rdi), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x2c6(%rip), %rcx       # 0x14835a
movq %rcx, 0x15f8(%rdi)
testq %rax, %rax
je 0x1480ad
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x15e0(%rbx), %rsi
addq $0x1600, %rbx           # imm = 0x1600
movq %rbx, %rdi
callq 0x148816
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rdi
callq 0x171a3
nop
// File: /workspace/github_cpp_makefile_star2_O3/fanchenxinok[P]gtest-lcov/myListeners/listener12.cpp
// Function: listener1::onListener()
void listener1::onListener()
{
	while(1){
		pthread_mutex_lock(&mutex);
		pthread_cond_wait(&cond,&mutex);
		EVENT_MSG eventMsg = lisQueue.front();
		switch(eventMsg.eventID)
		{
			case L1_FUN1:
			{
				l1_fun1();
				MY_INFO *myinfo = new MY_INFO();
				msgDataUnPack(eventMsg.msgData, sizeof(MY_INFO), myinfo, -1);
				//cout << "name : " << myinfo.name;
				LOGOUT_COLOR(WHITE, GREEN, "name:%s; age:%d; sex:%c\n",
					myinfo->name.c_str(), myinfo->age, myinfo->sex);
				break;
			}
			case L1_FUN2:
			{
				int sum;
				msgDataUnPack(eventMsg.msgData, sizeof(int), &sum, -1);
				l1_fun2(sum);
				break;
			}
			default:
				break;
		}
		lisQueue.pop();
		pthread_mutex_unlock(&mutex);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
leaq 0x38(%rdi), %r14
leaq 0x8(%rdi), %r15
leaq 0x60(%rdi), %r12
leaq 0x4(%rsp), %rbp
movq %r14, %rdi
callq 0x21a0
movq %r15, %rdi
movq %r14, %rsi
callq 0x21b0
movq 0x70(%rbx), %rsi
movl $0x84, %edx
movq %rbp, %rdi
callq 0x20f0
movl 0x4(%rsp), %eax
cmpl $0x1, %eax
je 0x277d
testl %eax, %eax
jne 0x27ab
leaq 0x199f(%rip), %rdi      # 0x40aa
xorl %eax, %eax
callq 0x30e3
movl $0x28, %edi
callq 0x2160
movq %rax, %r13
addq $0x10, %rax
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%r13)
xorl %ecx, %ecx
movq %rcx, 0x20(%r13)
movq %rax, (%r13)
movq %rcx, 0x8(%r13)
movl $0x28, %edx
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
movq %r13, %rcx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0x2230
movq (%r13), %rcx
movl 0x20(%r13), %r8d
movsbl 0x24(%r13), %r9d
movl $0x7, %edi
movl $0x2, %esi
leaq 0x1999(%rip), %rdx      # 0x410d
xorl %eax, %eax
callq 0x3343
jmp 0x27ab
movl $0x4, %edx
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
movq %rsp, %rcx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0x2230
movl (%rsp), %esi
leaq 0x193f(%rip), %rdi      # 0x40e3
xorl %eax, %eax
callq 0x30e3
movq %r12, %rdi
callq 0x291a
movq %r14, %rdi
callq 0x20e0
jmp 0x26cb
// File: /workspace/github_cpp_makefile_star2_O3/fanchenxinok[P]gtest-lcov/myListeners/listener12.cpp
// Function: listener2::onListener()
void listener2::onListener()
{
	while(1){
		pthread_mutex_lock(&mutex);
		pthread_cond_wait(&cond,&mutex);
		EVENT_MSG eventMsg = lisQueue.front();
		switch(eventMsg.eventID)
		{
			case L2_FUN1:
				double res;
				msgDataUnPack(eventMsg.msgData, sizeof(double), &res, -1);
				l2_fun1(res);
				break;
			case L2_FUN2:
				int sum;
				msgDataUnPack(eventMsg.msgData, sizeof(int), &sum, -1);
				l2_fun2(sum);
				break;
			default:
				break;
		}
		lisQueue.pop();
		pthread_mutex_unlock(&mutex);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
leaq 0x38(%rdi), %r14
leaq 0x8(%rdi), %r15
leaq 0x60(%rdi), %r12
leaq 0x18(%rsp), %r13
leaq 0x14(%rsp), %rbp
movq %r14, %rdi
callq 0x21a0
movq %r15, %rdi
movq %r14, %rsi
callq 0x21b0
movq 0x70(%rbx), %rsi
movl $0x84, %edx
movq %rbp, %rdi
callq 0x20f0
movl 0x14(%rsp), %eax
cmpl $0x3, %eax
je 0x28d5
cmpl $0x2, %eax
jne 0x2904
movl $0x8, %edx
movq %rbx, %rdi
movq %r13, %rsi
leaq 0x8(%rsp), %rcx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0x2230
movsd 0x8(%rsp), %xmm0
leaq 0x1864(%rip), %rdi      # 0x4130
movb $0x1, %al
callq 0x2fc4
jmp 0x2904
movl $0x4, %edx
movq %rbx, %rdi
movq %r13, %rsi
leaq 0x4(%rsp), %rcx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0x2230
movl 0x4(%rsp), %esi
leaq 0x1864(%rip), %rdi      # 0x4161
xorl %eax, %eax
callq 0x2fc4
movq %r12, %rdi
callq 0x291a
movq %r14, %rdi
callq 0x20e0
jmp 0x2870
nop
// File: /workspace/github_cpp_makefile_star2_O3/fanchenxinok[P]gtest-lcov/myResponsers/responser12.cpp
// Function: responser1::onResponser()
void responser1::onResponser()
{
	while(1){
		pthread_mutex_lock(&mutex);
		pthread_cond_wait(&cond,&mutex);
		switch(eventMsg.eventID)
		{
			case R1_FUN1:
			{
				r1_fun1();
				/* ������Ϣ�������������ؽ��� */
				MSG_INFO msgInfo;
				msgInfo.resType = RES1;
				msgInfo.msg.eventID = L1_FUN1;
				/* ������new �����ڴ�����ΪMY_INFO �ṹ��
				    ����string ��Ա��ֻ����new ���ܵ�����
				    ���캯����*/
				MY_INFO* myinfo = new MY_INFO(); 
				myinfo->name = "fanchenxin";
				myinfo->age = 27;
				myinfo->sex = 'm';
				msgDataPack(msgInfo.msg.msgData, sizeof(MY_INFO), myinfo, -1);
				sendMsgToListener(msgInfo);
				break;
			}
			case R1_FUN2:
			{
				int a, b;
				msgDataUnPack(eventMsg.msgData, sizeof(int), &a,
					sizeof(int), &b, -1);
				int sum = r1_fun2(a, b);
				cout << "(1)The sum = " << sum << endl;

				/* ������Ϣ�������������ؽ��� */
				MSG_INFO msgInfo;
				msgInfo.resType = RES1;
				msgInfo.msg.eventID = L1_FUN2;
				msgDataPack(msgInfo.msg.msgData, sizeof(int), &sum, -1);
				sendMsgToListener(msgInfo);
				break;
			}
			default:
				break;
		}
		
		pthread_mutex_unlock(&mutex);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rdi, %rbx
leaq 0xc0(%rdi), %r14
leaq 0x90(%rdi), %r15
leaq 0xc(%rdi), %rax
movq %rax, 0x98(%rsp)
movq 0x3531(%rip), %r13      # 0x5fd8
leaq 0xa0(%rsp), %rbp
movq %r14, %rdi
callq 0x21a0
movq %r15, %rdi
movq %r14, %rsi
callq 0x21b0
movl 0x8(%rbx), %eax
cmpl $0x1, %eax
je 0x2b5a
testl %eax, %eax
jne 0x2c45
callq 0x29da
movw $0x0, 0xa0(%rsp)
movl $0x0, 0xa4(%rsp)
movl $0x28, %edi
callq 0x2160
movq %rax, %r12
addq $0x10, %rax
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%r12)
xorl %ecx, %ecx
movq %rcx, 0x20(%r12)
movq %rax, (%r12)
movq %rcx, 0x8(%r12)
movl $0xa, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x16bb(%rip), %rcx      # 0x41e9
callq 0x21d0
movl $0x1b, 0x20(%r12)
movb $0x6d, 0x24(%r12)
movl $0x28, %edx
movq %rbx, %rdi
leaq 0xa8(%rsp), %rsi
movq %r12, %rcx
jmp 0x2c22
movl $0xffffffff, (%rsp)     # imm = 0xFFFFFFFF
movl $0x4, %edx
movl $0x4, %r8d
movq %rbx, %rdi
movq 0x98(%rsp), %rsi
leaq 0x94(%rsp), %rcx
leaq 0x90(%rsp), %r9
xorl %eax, %eax
callq 0x2220
movl 0x94(%rsp), %esi
movl 0x90(%rsp), %edx
callq 0x2a1e
movl %eax, 0x8c(%rsp)
movl $0xd, %edx
movq %r13, %rdi
leaq 0x163d(%rip), %rsi      # 0x41f4
callq 0x2180
movl 0x8c(%rsp), %esi
movq %r13, %rdi
callq 0x2210
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movw $0x0, 0xa0(%rsp)
movl $0x1, 0xa4(%rsp)
movl $0x4, %edx
movq %rbx, %rdi
leaq 0xa8(%rsp), %rsi
leaq 0x8c(%rsp), %rcx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0x2200
movl $0x11, %ecx
movq %rsp, %rdi
movq %rbp, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %rbx, %rdi
callq 0x2130
movq %r14, %rdi
callq 0x20e0
jmp 0x2aaf
// File: /workspace/github_cpp_makefile_star2_O3/fanchenxinok[P]gtest-lcov/myResponsers/responser12.cpp
// Function: responser2::onResponser()
void responser2::onResponser()
{
	while(1){
		pthread_mutex_lock(&mutex);
		pthread_cond_wait(&cond,&mutex);
		switch(eventMsg.eventID)
		{
			case R2_FUN1:
			{
				double a, b;
				msgDataUnPack(eventMsg.msgData, sizeof(double), &a,
					sizeof(double), &b, -1);
				double res = r2_fun1(a, b);

				/* ������Ϣ�������� */
				MSG_INFO msgInfo;
				msgInfo.resType = RES2;
				msgInfo.msg.eventID = L2_FUN1;
				msgDataPack(msgInfo.msg.msgData, sizeof(double), &res, -1);
				sendMsgToListener(msgInfo);
				break;
			}
			case R2_FUN2:
			{
				int c, d;
				msgDataUnPack(eventMsg.msgData, sizeof(int), &c,
					sizeof(int), &d, -1);
				int sum = r2_fun2(c, d);
				cout << "(2)The sum is " << sum << endl;

				/* ������Ϣ�������� */
				MSG_INFO msgInfo;
				msgInfo.resType = RES2;
				msgInfo.msg.eventID = L2_FUN2;
				msgDataPack(msgInfo.msg.msgData, sizeof(int), &sum, -1);
				sendMsgToListener(msgInfo);
				break;
			}
			default:
				break;
		}
		
		pthread_mutex_unlock(&mutex);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rdi, %rbx
leaq 0xc0(%rdi), %r14
leaq 0x90(%rdi), %rbp
leaq 0xc(%rdi), %rax
movq %rax, 0x98(%rsp)
leaq 0xa0(%rsp), %r12
leaq 0x88(%rsp), %r15
leaq 0xb0(%rsp), %r13
movq %r14, 0xa8(%rsp)
movq %r14, %rdi
callq 0x21a0
movq %rbp, %rdi
movq %r14, %rsi
callq 0x21b0
movl 0x8(%rbx), %eax
cmpl $0x3, %eax
je 0x2ea4
cmpl $0x2, %eax
jne 0x2fb4
movl $0xffffffff, (%rsp)     # imm = 0xFFFFFFFF
movl $0x8, %edx
movl $0x8, %r8d
movq %rbx, %rdi
movq 0x98(%rsp), %rsi
leaq 0x90(%rsp), %rcx
movq %r12, %r9
xorl %eax, %eax
callq 0x2220
movsd 0x90(%rsp), %xmm0
movsd 0xa0(%rsp), %xmm1
callq 0x2cbc
movsd %xmm0, 0x88(%rsp)
movw $0x1, 0xb0(%rsp)
movl $0x2, 0xb4(%rsp)
movl $0x8, %edx
jmp 0x2f83
movl $0xffffffff, (%rsp)     # imm = 0xFFFFFFFF
movl $0x4, %edx
movl $0x4, %r8d
movq %rbx, %rdi
movq %r15, %r13
movq 0x98(%rsp), %rsi
leaq 0x90(%rsp), %rcx
movq %r12, %r15
movq %r12, %r9
xorl %eax, %eax
callq 0x2220
movl 0x90(%rsp), %esi
movl 0xa0(%rsp), %edx
callq 0x2d70
movl %eax, 0x88(%rsp)
movl $0xe, %edx
movq 0x30d9(%rip), %r12      # 0x5fd8
movq %r12, %rdi
leaq 0x1340(%rip), %rsi      # 0x4249
callq 0x2180
movl 0x88(%rsp), %esi
movq %r12, %rdi
callq 0x2210
movq %rbx, %r14
movq %rbp, %rbx
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbp, %rdi
movq %r15, %r12
movq %r13, %r15
leaq 0xb0(%rsp), %r13
movq %rbx, %rbp
movq %r14, %rbx
movq 0xa8(%rsp), %r14
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movw $0x1, 0xb0(%rsp)
movl $0x3, 0xb4(%rsp)
movl $0x4, %edx
movq %rbx, %rdi
leaq 0xb8(%rsp), %rsi
movq %r15, %rcx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0x2200
movl $0x11, %ecx
movq %rsp, %rdi
movq %r13, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %rbx, %rdi
callq 0x2130
movq %r14, %rdi
callq 0x20e0
jmp 0x2e12
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/fanchenxinok[P]gtest-lcov/logout/log_out.c
// Function: LOGOUT_NOTICE
void LOGOUT_NOTICE(char* log_format, ...)
{
	struct timespec ts;
	clock_gettime(CLOCK_MONOTONIC, &ts);

	char chLog[1024];
	va_list	w_arg;
	va_start( w_arg, log_format );
	snprintf( chLog, 34, "\033[1;33;42m[%4u:%09u] <N>:  ",  ts.tv_sec, ts.tv_nsec);		
	vsnprintf( chLog+33, 1024 - 34, log_format, w_arg);
	va_end( w_arg );

       int len = strlen(chLog);
       if(chLog[len - 1] == '\n')
            chLog[len - 1] = '\0';

	printf( "%s\033[0m\n", chLog);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x4e8, %rsp            # imm = 0x4E8
movq %rdi, %rbx
leaq 0x30(%rsp), %r12
movq %rsi, 0x8(%r12)
movq %rdx, 0x10(%r12)
movq %rcx, 0x18(%r12)
movq %r8, 0x20(%r12)
movq %r9, 0x28(%r12)
testb %al, %al
je 0x3031
movaps %xmm0, 0x60(%rsp)
movaps %xmm1, 0x70(%rsp)
movaps %xmm2, 0x80(%rsp)
movaps %xmm3, 0x90(%rsp)
movaps %xmm4, 0xa0(%rsp)
movaps %xmm5, 0xb0(%rsp)
movaps %xmm6, 0xc0(%rsp)
movaps %xmm7, 0xd0(%rsp)
movq %rsp, %r14
movl $0x1, %edi
movq %r14, %rsi
callq 0x2120
leaq 0x10(%rsp), %r15
movq %r12, 0x10(%r15)
leaq 0x510(%rsp), %rax
movq %rax, 0x8(%r15)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%r15)
movq (%r14), %rcx
movq 0x8(%r14), %r8
leaq 0x120c(%rip), %rdx      # 0x427d
leaq 0xe0(%rsp), %r14
movl $0x22, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x21e0
leaq 0x101(%rsp), %rdi
movl $0x3de, %esi            # imm = 0x3DE
movq %rbx, %rdx
movq %r15, %rcx
callq 0x20a0
movq %r14, %rdi
callq 0x2090
decl %eax
cltq
cmpb $0xa, 0xe0(%rsp,%rax)
jne 0x30be
movb $0x0, 0xe0(%rsp,%rax)
leaq 0x11d4(%rip), %rdi      # 0x4299
leaq 0xe0(%rsp), %rsi
xorl %eax, %eax
callq 0x2040
addq $0x4e8, %rsp            # imm = 0x4E8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/fanchenxinok[P]gtest-lcov/logout/log_out.c
// Function: LOGOUT_WARNING
void LOGOUT_WARNING(char* log_format, ...)
{
	struct timespec ts;
	clock_gettime(CLOCK_MONOTONIC, &ts);

	char chLog[1024];
	va_list	w_arg;
	va_start( w_arg, log_format );
	snprintf( chLog, 34, "\033[1;31;47m[%4u:%09u] <W>:  ",  ts.tv_sec, ts.tv_nsec);		
	vsnprintf( chLog+33, 1024 - 34, log_format, w_arg);
	va_end( w_arg );

       int len = strlen(chLog);
       if(chLog[len - 1] == '\n')
            chLog[len - 1] = '\0';

	printf( "%s\033[0m\n", chLog);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x4e8, %rsp            # imm = 0x4E8
movq %rdi, %rbx
leaq 0x30(%rsp), %r12
movq %rsi, 0x8(%r12)
movq %rdx, 0x10(%r12)
movq %rcx, 0x18(%r12)
movq %r8, 0x20(%r12)
movq %r9, 0x28(%r12)
testb %al, %al
je 0x3150
movaps %xmm0, 0x60(%rsp)
movaps %xmm1, 0x70(%rsp)
movaps %xmm2, 0x80(%rsp)
movaps %xmm3, 0x90(%rsp)
movaps %xmm4, 0xa0(%rsp)
movaps %xmm5, 0xb0(%rsp)
movaps %xmm6, 0xc0(%rsp)
movaps %xmm7, 0xd0(%rsp)
movq %rsp, %r14
movl $0x1, %edi
movq %r14, %rsi
callq 0x2120
leaq 0x10(%rsp), %r15
movq %r12, 0x10(%r15)
leaq 0x510(%rsp), %rax
movq %rax, 0x8(%r15)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%r15)
movq (%r14), %rcx
movq 0x8(%r14), %r8
leaq 0x1111(%rip), %rdx      # 0x42a1
leaq 0xe0(%rsp), %r14
movl $0x22, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x21e0
leaq 0x101(%rsp), %rdi
movl $0x3de, %esi            # imm = 0x3DE
movq %rbx, %rdx
movq %r15, %rcx
callq 0x20a0
movq %r14, %rdi
callq 0x2090
decl %eax
cltq
cmpb $0xa, 0xe0(%rsp,%rax)
jne 0x31dd
movb $0x0, 0xe0(%rsp,%rax)
leaq 0x10b5(%rip), %rdi      # 0x4299
leaq 0xe0(%rsp), %rsi
xorl %eax, %eax
callq 0x2040
addq $0x4e8, %rsp            # imm = 0x4E8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/fanchenxinok[P]gtest-lcov/logout/log_out.c
// Function: LOGOUT_COLOR
void LOGOUT_COLOR(
    LOG_COLOR forground_color,
    LOG_COLOR background_color,
    char* log_format, ...)
{
	struct timespec ts;
	clock_gettime(CLOCK_MONOTONIC, &ts);

	char chLog[1024];
       char forColValue[3] = {'\0'};
       char backColValue[3] = {'\0'};
       getColorValueStr(background_color, BACKGROUND, backColValue);
       getColorValueStr(forground_color, FORGROUND, forColValue);
	va_list	w_arg;
	va_start( w_arg, log_format );
       snprintf(chLog, 30, "\033[1;%s;%sm[%4u:%09u]   ",
                    forColValue, backColValue,
                    ts.tv_sec, ts.tv_nsec);	
	vsnprintf( chLog+29, 1024 - 30, log_format, w_arg);
	va_end( w_arg );

       int len = strlen(chLog);
       if(chLog[len - 1] == '\n')
            chLog[len - 1] = '\0';

	printf( "%s\033[0m\n", chLog);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4f0, %rsp            # imm = 0x4F0
movq %rdx, %rbx
movl %esi, %r12d
movl %edi, %r15d
leaq 0x40(%rsp), %r13
movq %rcx, 0x18(%r13)
movq %r8, 0x20(%r13)
movq %r9, 0x28(%r13)
testb %al, %al
je 0x33ae
movaps %xmm0, 0x70(%rsp)
movaps %xmm1, 0x80(%rsp)
movaps %xmm2, 0x90(%rsp)
movaps %xmm3, 0xa0(%rsp)
movaps %xmm4, 0xb0(%rsp)
movaps %xmm5, 0xc0(%rsp)
movaps %xmm6, 0xd0(%rsp)
movaps %xmm7, 0xe0(%rsp)
leaq 0x10(%rsp), %r14
movl $0x1, %edi
movq %r14, %rsi
callq 0x2120
leaq 0xa(%rsp), %r8
movb $0x34, (%r8)
leal 0x30(%r12), %eax
cmpl $0x8, %r12d
movzbl %al, %eax
movl $0x30, %edx
cmovael %edx, %eax
movb %al, 0x1(%r8)
xorl %eax, %eax
movb %al, 0x2(%r8)
leaq 0xd(%rsp), %rcx
movb $0x33, (%rcx)
leal 0x30(%r15), %esi
cmpl $0x8, %r15d
movzbl %sil, %esi
cmovael %edx, %esi
movb %sil, 0x1(%rcx)
movb %al, 0x2(%rcx)
leaq 0x20(%rsp), %r15
movq %r13, 0x10(%r15)
leaq 0x520(%rsp), %rax
movq %rax, 0x8(%r15)
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, (%r15)
movq (%r14), %r9
movq 0x8(%r14), %rax
movq %rax, (%rsp)
leaq 0xea0(%rip), %rdx       # 0x42d9
leaq 0xf0(%rsp), %r14
movl $0x1e, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x21e0
leaq 0x10d(%rsp), %rdi
movl $0x3e2, %esi            # imm = 0x3E2
movq %rbx, %rdx
movq %r15, %rcx
callq 0x20a0
movq %r14, %rdi
callq 0x2090
decl %eax
cltq
cmpb $0xa, 0xf0(%rsp,%rax)
jne 0x3486
movb $0x0, 0xf0(%rsp,%rax)
leaq 0xe0c(%rip), %rdi       # 0x4299
leaq 0xf0(%rsp), %rsi
xorl %eax, %eax
callq 0x2040
addq $0x4f0, %rsp            # imm = 0x4F0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/olahol[P]cpp-csp/examples/interleave.cpp
// Function: main
int main() {
  csp::Channel<int> chan;
  csp::Scheduler scheduler;

  scheduler.spawn([&]() {
    for (int i = 1; i < 11; i++) {
      std::cout << "put " << i << std::endl;
      chan.put(i);
    }
    chan.put(0);
  });

  scheduler.spawn([&]() {
    while (true) {
      auto i = chan.get();
      if (i == 0) break;
      std::cout << "get " << i << std::endl;
    }
  });

  scheduler.join();

  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xe0, %rsp
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %r14
movaps %xmm0, 0x40(%r14)
movaps %xmm0, 0x30(%r14)
movaps %xmm0, 0x20(%r14)
movaps %xmm0, 0x10(%r14)
movaps %xmm0, (%r14)
xorl %r15d, %r15d
movq %r14, %rdi
xorl %esi, %esi
callq 0x270a
movl $0x0, 0x50(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x58(%r14)
movups %xmm0, 0x68(%r14)
movq %r15, 0x78(%r14)
leaq 0xb0(%rsp), %rbx
movq %rbx, %rdi
callq 0x2140
movq %r15, 0x20(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movl $0x8, %edi
callq 0x2110
movq %rax, %r15
movq $0x0, (%rax)
movl $0x10, %edi
callq 0x2110
leaq 0x2978(%rip), %rcx      # 0x4d48
movq %rcx, (%rax)
movq %r14, 0x8(%rax)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %r15, %rdi
xorl %edx, %edx
callq 0x20f0
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x23f9
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x28(%rsp), %rsi
movq %r15, (%rsi)
leaq 0x10(%rsp), %rdi
callq 0x2880
movl $0x8, %edi
callq 0x2110
movq %rax, %r15
movq $0x0, (%rax)
movl $0x10, %edi
callq 0x2110
leaq 0x2958(%rip), %rcx      # 0x4d88
movq %rcx, (%rax)
movq %r14, 0x8(%rax)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %r15, %rdi
xorl %edx, %edx
callq 0x20f0
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x2459
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x28(%rsp), %rsi
movq %r15, (%rsi)
leaq 0x10(%rsp), %rdi
callq 0x2880
movq 0x10(%rsp), %r14
movq 0x18(%rsp), %r15
cmpq %r15, %r14
je 0x248e
movq (%r14), %rdi
cmpq $0x0, (%rdi)
je 0x2488
callq 0x21b0
addq $0x8, %r14
jmp 0x2475
leaq 0x10(%rsp), %rdi
callq 0x264a
movq %rbx, %rdi
callq 0x21e0
leaq 0x30(%rsp), %rdi
callq 0x26b2
xorl %eax, %eax
addq $0xe0, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x24bd
jmp 0x24d2
movq %rax, %r14
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x24d5
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x24d5
movq %rax, %r14
movl $0x8, %esi
movq %r15, %rdi
callq 0x2120
jmp 0x24e9
jmp 0x24e6
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x264a
movq %rbx, %rdi
callq 0x21e0
leaq 0x30(%rsp), %rdi
callq 0x26b2
movq %r14, %rdi
callq 0x21d0
nop
// File: /workspace/github_cpp_makefile_star2_O3/olahol[P]cpp-csp/examples/../csp.hpp
// Function: csp::Channel<int>::put(int)
void put(TItem t) {
      std::unique_lock<std::mutex> lock(m);

      cv.wait(lock, [&]() { return (state == 0); });

      queue.push(t);
      state = 1;
      cv.notify_all();

      cv.wait(lock, [&]() { return (state == 2); });

      state = 0;
      cv.notify_all();
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movl %esi, 0x4(%rsp)
leaq 0x58(%rdi), %rax
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movb $0x0, 0x8(%r14)
movq %r14, %rdi
callq 0x29b0
movb $0x1, 0x8(%r14)
leaq 0x80(%rbx), %r14
cmpl $0x0, 0x50(%rbx)
je 0x290c
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2050
cmpl $0x0, 0x50(%rbx)
jne 0x28fb
movq 0x30(%rbx), %rax
movq 0x40(%rbx), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x2929
movl %ebp, (%rax)
addq $0x4, %rax
movq %rax, 0x30(%rbx)
jmp 0x2936
leaq 0x4(%rsp), %rsi
movq %rbx, %rdi
callq 0x29ec
movl $0x1, 0x50(%rbx)
movq %r14, %rdi
callq 0x21a0
cmpl $0x2, 0x50(%rbx)
je 0x2961
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2050
cmpl $0x2, 0x50(%rbx)
jne 0x2950
movl $0x0, 0x50(%rbx)
movq %r14, %rdi
callq 0x21a0
leaq 0x8(%rsp), %rdi
callq 0x299a
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x299a
movq %rbx, %rdi
callq 0x21d0
// File: /workspace/github_cpp_makefile_star2_O3/olahol[P]cpp-csp/examples/../csp.hpp
// Function: csp::Channel<int>::get()
TItem get() {
      std::unique_lock<std::mutex> lock(m);
      cv.wait(lock, [&]() { return (state == 1); });

      TItem e = queue.front();
      queue.pop();
      state = 2;
      cv.notify_all();

      return e;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x58(%rdi), %rax
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movb $0x0, 0x8(%r14)
movq %r14, %rdi
callq 0x29b0
movb $0x1, 0x8(%r14)
leaq 0x80(%rbx), %r14
cmpl $0x1, 0x50(%rbx)
je 0x2db2
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2050
cmpl $0x1, 0x50(%rbx)
jne 0x2da1
movq 0x10(%rbx), %rax
movl (%rax), %ebp
movq %rbx, %rdi
callq 0x2de6
movl $0x2, 0x50(%rbx)
movq %r14, %rdi
callq 0x21a0
leaq 0x8(%rsp), %rdi
callq 0x299a
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/bonetblai[P]mdp-engine/puzzle/./puzzle.h
// Function: state_t::set_goal(unsigned int, unsigned int)
void set_goal(unsigned rows, unsigned cols) {
        d0_ = d1_ = d2_ = 0;
        d0_ |= (rows<<4);
        d0_ |= (cols<<8);
        set_blank(0);
        for( unsigned t = 0; t < rows*cols; ++t )
            set_tile(t, 1+t);
    }

// Assembly:
movl %edx, %eax
imull %esi, %edx
shll $0x4, %esi
shll $0x8, %eax
orl %esi, %eax
movl %eax, (%rdi)
movq $0x0, 0x4(%rdi)
testl %edx, %edx
je 0x64e3
xorl %esi, %esi
movl $0x4, %eax
leal 0x1(%rsi), %r8d
leal -0x20(%rax), %ecx
xorl %r9d, %r9d
cmpl $0x7, %esi
setae %r9b
movzbl %cl, %ecx
cmovbl %eax, %ecx
movl $0xf, %r10d
shll %cl, %r10d
notl %r10d
andl 0x4(%rdi,%r9,4), %r10d
shll %cl, %esi
orl %r10d, %esi
movl %esi, 0x4(%rdi,%r9,4)
addl $0x4, %eax
movl %r8d, %esi
cmpl %r8d, %edx
jne 0x64a6
retq
// File: /workspace/github_cpp_makefile_star2_O3/bonetblai[P]mdp-engine/puzzle/./puzzle.h
// Function: state_t::random_moves(unsigned int, unsigned int, unsigned int)
void random_moves(unsigned rows, unsigned cols, unsigned n = 0) {
        for( unsigned i = 0; i < n; ++i ) {
            unsigned m = Random::random(4);
            if( m == 0 )
                up(rows, cols);
            else if( m == 1 )
                right(rows, cols);
            else if( m == 2 )
                down(rows, cols);
            else
                left(rows, cols);
        }
    }

// Assembly:
testl %ecx, %ecx
je 0x6558
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebx
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %r15
leaq 0x1ebdf(%rip), %r12     # 0x250e0
callq 0x5190
andl $0x3, %eax
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
movq %r15, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x8a5a
jmp 0x654c
movq %r15, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x8b7e
jmp 0x654c
movq %r15, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x8c10
jmp 0x654c
movq %r15, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x8aea
decl %ebx
jne 0x6501
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/bonetblai[P]mdp-engine/puzzle/./puzzle.h
// Function: state_t::right(unsigned int, unsigned int)
void right(unsigned rows, unsigned cols) {
        unsigned b = blank();
        if( b%cols < cols-1 ) {
            unsigned p = b+1, t = tile(p);
            set_tile(t, b);
            set_blank(p);
        }
    }

// Assembly:
movl %edx, %ecx
movl (%rdi), %r8d
movl %r8d, %esi
andl $0xf, %esi
movl %esi, %eax
xorl %edx, %edx
divl %ecx
decl %ecx
cmpl %ecx, %edx
jae 0x8b7d
pushq %rbx
leal 0x4(,%rsi,4), %ecx
leal -0x20(%rcx), %eax
xorl %edx, %edx
cmpl $0x7, %esi
setae %dl
movl 0x4(%rdi,%rdx,4), %r9d
movzbl %al, %eax
cmovbl %ecx, %eax
movl %eax, %ecx
shrl %cl, %r9d
leal 0x1(%rsi), %r10d
andl $0xf, %r9d
leal (,%rsi,4), %r11d
leal -0x20(%r11), %ecx
xorl %ebx, %ebx
cmpl $0x8, %esi
setae %bl
movzbl %cl, %ecx
cmovbl %r11d, %ecx
movl $0xf, %esi
movl $0xf, %r11d
shll %cl, %r11d
notl %r11d
andl 0x4(%rdi,%rbx,4), %r11d
shll %cl, %r9d
orl %r11d, %r9d
movl %r9d, 0x4(%rdi,%rbx,4)
andl $-0x10, %r8d
orl %r10d, %r8d
movl %r8d, (%rdi)
movl %eax, %ecx
shll %cl, %esi
notl %esi
andl %esi, 0x4(%rdi,%rdx,4)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/bonetblai[P]mdp-engine/puzzle/./puzzle.h
// Function: state_t::left(unsigned int, unsigned int)
void left(unsigned rows, unsigned cols) {
        unsigned b = blank();
        if( b%cols > 0 ) {
            unsigned p = b-1,
            t = tile(p);
            set_tile(t, b);
            set_blank(p);
        }
    }

// Assembly:
movl %edx, %ecx
movl (%rdi), %r8d
movl %r8d, %esi
andl $0xf, %esi
movl %esi, %eax
xorl %edx, %edx
divl %ecx
testl %edx, %edx
je 0x8ca3
pushq %rbx
leal -0x1(%rsi), %edx
leal -0x4(,%rsi,4), %ecx
leal -0x20(%rcx), %eax
xorl %r9d, %r9d
cmpl $0x8, %edx
setae %r9b
movl 0x4(%rdi,%r9,4), %r10d
movzbl %al, %eax
cmovbl %ecx, %eax
movl %eax, %ecx
shrl %cl, %r10d
andl $0xf, %r10d
leal (,%rsi,4), %r11d
leal -0x20(%r11), %ecx
xorl %ebx, %ebx
cmpl $0x8, %esi
setae %bl
movzbl %cl, %ecx
cmovbl %r11d, %ecx
movl $0xf, %esi
movl $0xf, %r11d
shll %cl, %r11d
notl %r11d
andl 0x4(%rdi,%rbx,4), %r11d
shll %cl, %r10d
orl %r11d, %r10d
movl %r10d, 0x4(%rdi,%rbx,4)
andl $-0x10, %r8d
orl %edx, %r8d
movl %r8d, (%rdi)
movl %eax, %ecx
shll %cl, %esi
notl %esi
andl %esi, 0x4(%rdi,%r9,4)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/bonetblai[P]mdp-engine/puzzle/./puzzle.h
// Function: problem_t::next(state_t const&, int, std::vector<std::pair<state_t, float>, std::allocator<std::pair<state_t, float>>>&) const
virtual void next(const state_t &s, Problem::action_t a, std::vector<std::pair<state_t, float> > &outcomes) const {
        ++expansions_;
        outcomes.clear();
        outcomes.reserve(2);
        if( p_ > 0 ) {
            outcomes.push_back(std::make_pair(s, p_));
            if( a == ::up ) {
                outcomes.back().first.up(rows_, cols_);
            } else if( a == ::right ) {
                outcomes.back().first.right(rows_, cols_);
            } else if( a == ::down ) {
                outcomes.back().first.down(rows_, cols_);
            } else {
                outcomes.back().first.left(rows_, cols_);
            }
        }
        if( 1-p_ > 0 ) {
            outcomes.push_back(std::make_pair(s, 1 - p_));
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movl %edx, %ebp
movq %rdi, %r15
incq 0x10(%rdi)
movq %rsi, %r14
movq (%rcx), %rax
cmpq %rax, 0x8(%rcx)
je 0x8d34
movq %rax, 0x8(%rbx)
movl $0x2, %esi
movq %rbx, %rdi
callq 0x8e4c
movss 0x20(%r15), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
jae 0x8dac
movq (%r14), %rax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movl 0x8(%r14), %eax
movl %eax, 0x8(%rsi)
movss %xmm0, 0xc(%rsi)
movq %rbx, %rdi
callq 0x8f44
movq 0x8(%rbx), %rdi
addq $-0x10, %rdi
movl 0x18(%r15), %esi
movl 0x1c(%r15), %edx
cmpl $0x3, %ebp
je 0x8d9a
cmpl $0x2, %ebp
je 0x8d93
testl %ebp, %ebp
jne 0x8da1
callq 0x8a5a
jmp 0x8da6
callq 0x8b7e
jmp 0x8da6
callq 0x8aea
jmp 0x8da6
callq 0x8c10
movss 0x20(%r15), %xmm0
ucomiss 0x1c311(%rip), %xmm0    # 0x250c4
jae 0x8de0
movss 0x1c307(%rip), %xmm1    # 0x250c4
subss %xmm0, %xmm1
movq (%r14), %rax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movl 0x8(%r14), %eax
movl %eax, 0x8(%rsi)
movss %xmm1, 0xc(%rsi)
movq %rbx, %rdi
callq 0x8f44
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/bonetblai[P]mdp-engine/puzzle/./puzzle.h
// Function: state_t::applicable(unsigned int, unsigned int, int) const
bool applicable(unsigned rows, unsigned cols, Problem::action_t a) const {
        switch( a ) {
            case ::up: return blank() >= cols;
            case ::right: return blank() % cols < cols-1;
            case ::down: return blank() + cols < rows*cols;
            case ::left: return blank() % cols > 0;
        }
        return false;
    }

// Assembly:
cmpl $0x3, %ecx
ja 0x8e48
movl %edx, %r8d
movl %ecx, %eax
leaq 0x1c2f1(%rip), %rcx     # 0x250f0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl (%rdi), %eax
andl $0xf, %eax
cmpl %r8d, %eax
setae %al
retq
movl (%rdi), %eax
andl $0xf, %eax
addl %r8d, %eax
imull %r8d, %esi
cmpl %esi, %eax
jmp 0x8e34
movl (%rdi), %eax
andl $0xf, %eax
xorl %edx, %edx
divl %r8d
decl %r8d
cmpl %r8d, %edx
setb %al
retq
movl (%rdi), %eax
andl $0xf, %eax
xorl %edx, %edx
divl %r8d
testl %edx, %edx
setne %al
retq
xorl %eax, %eax
retq
nop