LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/Sweet-john[P]Linux_bash/OS3.cpp
// Function: stp_sig_handler(int)
void stp_sig_handler(int sig)
{
	bool check = false;
	int sus;
	kill(pid,SIGSTOP);
	
	for (int i=0; i<jobList.size();i++)
	{
		if (pid!=jobList[i].id)
			continue;
		else
			{check = true; jobList[i].status = SUSPEND; sus = i+1; break;}
	}
	
	if (check == false)	
	{
		job temp;
		temp.id = pid;
		temp.status = SUSPEND;
		jobList.push_back(temp);
		sus = jobList.size();
	}
	printf("[%d] Suspend\n",sus);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0xcb74(%rip), %rbx      # 0xfe50
movl (%rbx), %edi
movl $0x13, %esi
callq 0x21e0
movq 0xcbf9(%rip), %rsi      # 0xfee8
movq 0xcbea(%rip), %rax      # 0xfee0
movq %rsi, %rdx
subq %rax, %rdx
setne %cl
je 0x334f
sarq $0x3, %rdx
movl (%rbx), %r8d
cmpq $0x1, %rdx
movq %rdx, %r9
adcq $0x0, %r9
cmpl (%rax), %r8d
jne 0x331c
xorl %edi, %edi
jmp 0x333c
movl $0x1, %ecx
cmpq %rcx, %r9
je 0x3349
leaq 0x1(%rcx), %rdi
cmpl (%rax,%rcx,8), %r8d
movq %rdi, %rcx
jne 0x3321
decq %rdi
cmpq %rdi, %rdx
seta %cl
movl $0x2, 0x4(%rax,%rdi,8)
leal 0x1(%rdi), %eax
jmp 0x334f
cmpq %rcx, %rdx
seta %cl
testb %cl, %cl
jne 0x339b
movl (%rbx), %eax
movl %eax, -0x10(%rbp)
movl $0x2, -0xc(%rbp)
cmpq 0xcb8a(%rip), %rsi      # 0xfef0
je 0x3379
movq -0x10(%rbp), %rax
movq %rax, (%rsi)
addq $0x8, 0xcb71(%rip)      # 0xfee8
jmp 0x3389
leaq 0xcb60(%rip), %rdi      # 0xfee0
leaq -0x10(%rbp), %rdx
callq 0x350c
movq 0xcb58(%rip), %rax      # 0xfee8
subq 0xcb49(%rip), %rax      # 0xfee0
shrq $0x3, %rax
leaq 0xd1d(%rip), %rdi       # 0x40bf
movl %eax, %esi
xorl %eax, %eax
callq 0x2030
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Sweet-john[P]Linux_bash/OS3.cpp
// Function: cont(char*)
void cont(char *arg)
{
	int i = atoi(arg);
	
	if (jobList[i-1].status == SUSPEND)
	{
	
	kill(jobList[i-1].id,SIGCONT);
	pid = jobList[i-1].id;
	jobList[i-1].status = RUN;
	
	waitid(P_PID,jobList[i-1].id,&info,WEXITED|WSTOPPED);
	
	if (info.si_code == CLD_STOPPED)
	jobList[i-1].status = SUSPEND;
	else if (info.si_code == CLD_EXITED || info.si_code == CLD_KILLED)
	jobList[i-1].status = TERMINATE;
	
	}
	else
	printf("Not a suspend job!\n");	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
callq 0x2240
movslq %eax, %r14
movq 0xcb18(%rip), %rax      # 0xfee0
cmpl $0x2, -0x4(%rax,%r14,8)
jne 0x3435
decq %r14
movl (%rax,%r14,8), %edi
movl $0x12, %esi
callq 0x21e0
movq 0xcaf8(%rip), %rax      # 0xfee0
movl (%rax,%r14,8), %ecx
leaq 0xca5d(%rip), %rdx      # 0xfe50
movl %ecx, (%rdx)
movl $0x1, 0x4(%rax,%r14,8)
movl (%rax,%r14,8), %esi
leaq 0xca4f(%rip), %rbx      # 0xfe58
movl $0x1, %edi
movq %rbx, %rdx
movl $0x6, %ecx
callq 0x2050
movl 0x8(%rbx), %eax
cmpl $0x5, %eax
jne 0x3445
movq 0xcab6(%rip), %rax      # 0xfee0
movl $0x2, 0x4(%rax,%r14,8)
jmp 0x345c
leaq 0xce9(%rip), %rdi       # 0x4125
popq %rbx
popq %r14
popq %rbp
jmp 0x2230
decl %eax
cmpl $0x1, %eax
ja 0x345c
movq 0xca8d(%rip), %rax      # 0xfee0
movl $0x3, 0x4(%rax,%r14,8)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/s0sasaki[P]ExecutableBlockchain/compiler.cpp
// Function: Compiler::read(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, char const*) const
void Compiler::read(std::vector<std::string> &strtable, const char *src_data) const{
    int32_t c;
    int32_t idx = 0;
    char buf[256];
    bool iscomment = false;
    while((c = *src_data++)) {
        c = toupper(c);
        if(isSep(c, (char *)" \t\r\n()")) {
            if(c == '(') iscomment = true;
            if(c == ')') iscomment = false;
            if(!idx) continue;
            buf[idx] = 0;
            strtable.push_back(buf);
            idx = 0;
            continue;
        }
        if(!iscomment) buf[idx++] = c;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movb (%rdx), %al
testb %al, %al
je 0x2ce6
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x450c(%rip), %r13      # 0x7127
xorl %r15d, %r15d
xorl %r12d, %r12d
movsbl %al, %edi
callq 0x2300
movq %r13, %rdx
movb (%rdx), %cl
cmpb %al, %cl
je 0x2c39
incq %rdx
testb %cl, %cl
jne 0x2c2c
incq %rbx
testb %cl, %cl
jne 0x2c5e
testb $0x1, %r15b
jne 0x2c53
movslq %r12d, %rcx
incl %r12d
movb %al, -0x150(%rbp,%rcx)
movb (%rbx), %al
testb %al, %al
jne 0x2c21
jmp 0x2ce6
cmpl $0x28, %eax
movzbl %r15b, %r15d
movl $0x1, %ecx
cmovel %ecx, %r15d
cmpl $0x29, %eax
movl $0x0, %eax
cmovel %eax, %r15d
testl %r12d, %r12d
je 0x2cdc
movslq %r12d, %rax
movb $0x0, -0x150(%rbp,%rax)
leaq -0x38(%rbp), %r12
movq %r12, -0x48(%rbp)
movq %r14, %r12
leaq -0x150(%rbp), %r14
movq %r14, %rdi
callq 0x20d0
leaq (%rax,%rbp), %rdx
addq $-0x150, %rdx           # imm = 0xFEB0
leaq -0x48(%rbp), %rdi
movq %r14, %rsi
movq %r12, %r14
callq 0x3d02
movq %r12, %rdi
leaq -0x48(%rbp), %rsi
callq 0x3a98
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2cdc
callq 0x21d0
movb (%rbx), %al
testb %al, %al
jne 0x2c1e
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2d0d
callq 0x21d0
movq %rbx, %rdi
callq 0x22e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/s0sasaki[P]ExecutableBlockchain/block.cpp
// Function: Block::Block(int const (&) [1024])
Block::Block(const int32_t (&data)[DATA_SIZE]){
    nonce = 0;
    timestamp = time(nullptr);
    for(int32_t i=0; i<sizeof(data)/sizeof(int32_t); i++) 
        this->data[i] = data[i];
    hash = calculateHash();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
xorl %r13d, %r13d
movq %r13, 0x8(%rdi)
movb %r13b, 0x10(%rdi)
leaq 0x30(%rdi), %r12
movq %r12, 0x20(%rdi)
movq %r13, 0x28(%rdi)
movb %r13b, 0x30(%rdi)
movl $0x0, 0x1040(%rdi)
xorl %edi, %edi
callq 0x21c0
movq %rax, 0x1048(%rbx)
movl (%r14,%r13,4), %eax
movl %eax, 0x40(%rbx,%r13,4)
incq %r13
cmpq $0x400, %r13            # imm = 0x400
jne 0x4789
leaq -0x48(%rbp), %rdi
movq %rbx, %rsi
callq 0x49c6
leaq -0x48(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2250
movq (%r14), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x47ca
callq 0x21d0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0x20(%rbx), %rdi
cmpq %r12, %rdi
je 0x47ea
callq 0x21d0
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x47f7
callq 0x21d0
movq %r14, %rdi
callq 0x22e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/s0sasaki[P]ExecutableBlockchain/block.cpp
// Function: Block::mineBlock(unsigned int const&)
void Block::mineBlock(const uint32_t &difficulty){
    char cstr[difficulty + 1];
    for (uint32_t i = 0; i < difficulty; ++i)
        cstr[i] = '0';
    cstr[difficulty] = '\0';
    std::string str(cstr);

    //std::cout << "Mining block... " << std::flush;
    do{
        nonce++;
        hash = calculateHash();
    }while (hash.substr(0, difficulty) != str);
    //std::cout << hash << std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movl (%rsi), %r12d
leal 0x1(%r12), %eax
movq %rsp, %r15
addq $0xf, %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
testq %r12, %r12
je 0x4845
movq %r15, %rdi
movl $0x30, %esi
movq %r12, %rdx
callq 0x2110
movb $0x0, (%r15,%r12)
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
movq %r15, %rdi
callq 0x20d0
leaq (%rax,%r15), %rdx
leaq -0x48(%rbp), %rdi
movq %r15, %rsi
callq 0x3d02
leaq -0x58(%rbp), %r13
leaq -0x68(%rbp), %r15
incl 0x1040(%r14)
movq %r15, %rdi
movq %r14, %rsi
callq 0x49c6
movq %r14, %rdi
movq %r15, %rsi
callq 0x2250
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x489d
callq 0x21d0
movl (%rbx), %ecx
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2220
movq -0x60(%rbp), %rdx
movb $0x1, %r12b
cmpq -0x40(%rbp), %rdx
jne 0x48d6
testq %rdx, %rdx
je 0x48d3
movq -0x48(%rbp), %rsi
movq -0x68(%rbp), %rdi
callq 0x2210
testl %eax, %eax
setne %r12b
jmp 0x48d6
xorl %r12d, %r12d
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x48e4
callq 0x21d0
testb %r12b, %r12b
jne 0x4872
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x48fb
callq 0x21d0
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x490c
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x4921
callq 0x21d0
movq %rbx, %rdi
callq 0x22e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/s0sasaki[P]ExecutableBlockchain/block.cpp
// Function: Block::calculateHash[abi:cxx11]() const
inline std::string Block::calculateHash() const{
    std::stringstream ss;
    ss << prev_hash << timestamp << nonce;
    for(uint32_t i=0; i<DATA_SIZE; i++)
        ss << data[i];
    return sha256(ss.str());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x1c8(%rbp), %rdi
callq 0x2160
leaq -0x1b8(%rbp), %r15
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
movq %r15, %rdi
callq 0x2240
movq 0x1048(%r14), %rsi
movq %rax, %rdi
callq 0x21e0
movl 0x1040(%r14), %esi
movq %rax, %rdi
callq 0x2130
xorl %r12d, %r12d
movl 0x40(%r14,%r12,4), %esi
movq %r15, %rdi
callq 0x22d0
incq %r12
cmpq $0x400, %r12            # imm = 0x400
jne 0x4a22
leaq -0x1b0(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x22b0
leaq -0x40(%rbp), %rsi
movq %rbx, %rdi
callq 0x5744
leaq -0x30(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4a69
callq 0x21d0
movq 0x5550(%rip), %rsi      # 0x9fc0
leaq -0x1c8(%rbp), %rdi
callq 0x2180
leaq -0x148(%rbp), %rdi
callq 0x20a0
movq %rbx, %rax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x30(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4ab7
callq 0x21d0
jmp 0x4ab7
jmp 0x4ab4
movq %rax, %rbx
movq 0x5502(%rip), %rsi      # 0x9fc0
leaq -0x1c8(%rbp), %rdi
callq 0x2180
leaq -0x148(%rbp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x22e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/s0sasaki[P]ExecutableBlockchain/blockchain.cpp
// Function: Blockchain::Blockchain()
Blockchain::Blockchain(){
    int32_t genesis_data[Block::DATA_SIZE];
    Block genesis_block(genesis_data);
    genesis_block.mineBlock(difficulty);
    chain.emplace_back(genesis_block);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x2050, %rsp           # imm = 0x2050
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movl $0x3, 0x18(%rdi)
leaq -0x1060(%rbp), %rdi
leaq -0x2060(%rbp), %rsi
callq 0x4738
leaq 0x18(%rbx), %rsi
leaq -0x1060(%rbp), %rdi
callq 0x4800
leaq -0x1060(%rbp), %rsi
movq %rbx, %rdi
callq 0x4e24
leaq -0x1030(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4b4d
callq 0x21d0
leaq -0x1050(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4b62
callq 0x21d0
addq $0x2050, %rsp           # imm = 0x2050
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
jmp 0x4b82
movq %rax, %r14
leaq -0x1060(%rbp), %rdi
callq 0x2a5c
movq %rbx, %rdi
callq 0x2b74
movq %r14, %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O1/s0sasaki[P]ExecutableBlockchain/blockchain.cpp
// Function: Blockchain::isValid() const
bool Blockchain::isValid() const{
    for (auto block: chain)
        if(!block.isValid(difficulty)) return false;
    std::string prev_hash = chain.front().hash;
    for(uint32_t i=1; i<chain.size(); i++){
        if(prev_hash != chain[i].prev_hash) return false;
        prev_hash = chain[i].hash;
    }
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1068, %rsp           # imm = 0x1068
movq (%rdi), %r15
movq %rdi, -0x30(%rbp)
movq 0x8(%rdi), %rax
movq %rax, -0x38(%rbp)
cmpq %rax, %r15
sete %r13b
je 0x4c95
movq -0x30(%rbp), %rax
leaq 0x18(%rax), %r12
leaq -0x1088(%rbp), %r14
leaq -0x1078(%rbp), %rax
movq %rax, -0x1088(%rbp)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x39fe
leaq -0x1058(%rbp), %rax
movq %rax, -0x1068(%rbp)
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdx
addq %rsi, %rdx
leaq -0x1068(%rbp), %rdi
callq 0x39fe
leaq 0x40(%r15), %rsi
movl $0x1010, %edx           # imm = 0x1010
leaq -0x1048(%rbp), %rdi
callq 0x21a0
movq %r14, %rbx
movq %r14, %rdi
movq %r12, %rsi
callq 0x492a
movl %eax, %r14d
movq -0x1068(%rbp), %rdi
leaq -0x1058(%rbp), %rax
cmpq %rax, %rdi
je 0x4c54
callq 0x21d0
movq -0x1088(%rbp), %rdi
leaq -0x1078(%rbp), %rax
cmpq %rax, %rdi
je 0x4c6c
callq 0x21d0
testb %r14b, %r14b
je 0x4c8b
addq $0x1050, %r15           # imm = 0x1050
cmpq -0x38(%rbp), %r15
sete %r13b
movq %rbx, %r14
jne 0x4bd1
jmp 0x4c95
testb $0x1, %r13b
je 0x4d96
movq -0x30(%rbp), %rbx
movq (%rbx), %rax
leaq -0x1078(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x1088(%rbp), %rdi
callq 0x39fe
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
movabsq $0x77a9af922545a3cd, %rbx # imm = 0x77A9AF922545A3CD
imulq %rbx, %rcx
cmpq $0x2, %rcx
setb %r14b
jb 0x4d7c
movq -0x1080(%rbp), %rdx
cmpq 0x1078(%rax), %rdx
jne 0x4d7c
leaq 0x1050(%rax), %r12
addq $0x1070, %rax           # imm = 0x1070
movl $0x2, %r13d
leaq -0x1088(%rbp), %r15
testq %rdx, %rdx
je 0x4d2d
movq (%rax), %rsi
movq -0x1088(%rbp), %rdi
callq 0x2210
testl %eax, %eax
jne 0x4d7c
movq %r15, %rdi
movq %r12, %rsi
callq 0x2100
movl %r13d, %eax
movq -0x30(%rbp), %rdx
movq (%rdx), %rcx
movq 0x8(%rdx), %rdx
subq %rcx, %rdx
sarq $0x4, %rdx
imulq %rbx, %rdx
cmpq %rax, %rdx
setbe %r14b
jbe 0x4d7c
imulq $0x1050, %rax, %rax     # imm = 0x1050
leaq (%rcx,%rax), %r12
addq %rcx, %rax
addq $0x20, %rax
movq -0x1080(%rbp), %rdx
incl %r13d
cmpq 0x8(%rax), %rdx
je 0x4d15
movq -0x1088(%rbp), %rdi
leaq -0x1078(%rbp), %rax
cmpq %rax, %rdi
je 0x4d99
callq 0x21d0
jmp 0x4d99
xorl %r14d, %r14d
andb $0x1, %r14b
movl %r14d, %eax
addq $0x1068, %rsp           # imm = 0x1068
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4db4
movq %rax, %rbx
movq -0x1088(%rbp), %rdi
leaq -0x1078(%rbp), %rax
cmpq %rax, %rdi
je 0x4de0
callq 0x21d0
jmp 0x4de0
movq %rax, %rbx
leaq -0x1088(%rbp), %rdi
callq 0x2a5c
movq %rbx, %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O1/s0sasaki[P]ExecutableBlockchain/sha256.cpp
// Function: SHA256::update(unsigned char const*, unsigned int)
void SHA256::update(const unsigned char *message, unsigned int len)
{
    unsigned int block_nb;
    unsigned int new_len, rem_len, tmp_len;
    const unsigned char *shifted_message;
    tmp_len = SHA224_256_BLOCK_SIZE - m_len;
    rem_len = len < tmp_len ? len : tmp_len;
    memcpy(&m_block[m_len], message, rem_len);
    if (m_len + len < SHA224_256_BLOCK_SIZE) {
        m_len += len;
        return;
    }
    new_len = len - rem_len;
    block_nb = new_len / SHA224_256_BLOCK_SIZE;
    shifted_message = message + rem_len;
    transform(m_block, 1);
    transform(shifted_message, block_nb);
    rem_len = new_len % SHA224_256_BLOCK_SIZE;
    memcpy(m_block, &shifted_message[block_nb << 6], rem_len);
    m_len = rem_len;
    m_tot_len += (block_nb + 1) << 6;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
movl 0x4(%rdi), %eax
movl $0x40, %r12d
subl %eax, %r12d
cmpl %edx, %r12d
cmovael %edx, %r12d
addq %rax, %rdi
addq $0x8, %rdi
movq %r12, %rdx
callq 0x21a0
movl 0x4(%rbx), %eax
addl %r14d, %eax
cmpl $0x3f, %eax
ja 0x55eb
movl %eax, 0x4(%rbx)
jmp 0x5644
leaq 0x8(%rbx), %rsi
movq %rsi, -0x30(%rbp)
subl %r12d, %r14d
movl %r14d, %r13d
shrl $0x6, %r13d
addq %r12, %r15
movq %rbx, %rdi
movl $0x1, %edx
callq 0x538c
movq %rbx, %rdi
movq %r15, %rsi
movl %r13d, %edx
callq 0x538c
movl %r14d, %r12d
andl $0x3f, %r12d
andl $-0x40, %r14d
leaq (%r14,%r15), %rsi
movq -0x30(%rbp), %rdi
movq %r12, %rdx
callq 0x21a0
movl %r12d, 0x4(%rbx)
movl (%rbx), %eax
addl %r14d, %eax
addl $0x40, %eax
movl %eax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/s0sasaki[P]ExecutableBlockchain/sha256.cpp
// Function: SHA256::final(unsigned char*)
void SHA256::final(unsigned char *digest)
{
    unsigned int block_nb;
    unsigned int pm_len;
    unsigned int len_b;
    int i;
    block_nb = (1 + ((SHA224_256_BLOCK_SIZE - 9)
                     < (m_len % SHA224_256_BLOCK_SIZE)));
    len_b = (m_tot_len + m_len) << 3;
    pm_len = block_nb << 6;
    memset(m_block + m_len, 0, pm_len - m_len);
    m_block[m_len] = 0x80;
    SHA2_UNPACK32(len_b, m_block + pm_len - 4);
    transform(m_block, block_nb);
    for (i = 0 ; i < 8; i++) {
        SHA2_UNPACK32(m_h[i], &digest[i << 2]);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movl 0x4(%rdi), %eax
movl %eax, %ecx
notl %ecx
andl $0x38, %ecx
xorl %r13d, %r13d
cmpl $0x1, %ecx
movl $0x0, %ecx
adcl $0x1, %ecx
movl %ecx, -0x30(%rbp)
movl (%rdi), %r12d
addl %eax, %r12d
leal (,%r12,8), %edx
movl %edx, -0x2c(%rbp)
movl %ecx, %r15d
shll $0x6, %r15d
leaq 0x8(%rdi), %rcx
movq %rcx, -0x38(%rbp)
addq %rax, %rdi
addq $0x8, %rdi
movl %r15d, %edx
subl %eax, %edx
xorl %esi, %esi
callq 0x2110
movl 0x4(%r14), %eax
movb $-0x80, 0x8(%r14,%rax)
movl -0x2c(%rbp), %eax
movb %al, 0x7(%r14,%r15)
movl %r12d, %eax
shrl $0x5, %eax
movb %al, 0x6(%r14,%r15)
movl %r12d, %eax
shrl $0xd, %eax
movb %al, 0x5(%r14,%r15)
shrl $0x15, %r12d
movb %r12b, 0x4(%r14,%r15)
movq %r14, %rdi
movq -0x38(%rbp), %rsi
movl -0x30(%rbp), %edx
callq 0x538c
movb 0x88(%r14,%r13,4), %al
movb %al, 0x3(%rbx,%r13,4)
movb 0x89(%r14,%r13,4), %al
movb %al, 0x2(%rbx,%r13,4)
movb 0x8a(%r14,%r13,4), %al
movb %al, 0x1(%rbx,%r13,4)
movb 0x8b(%r14,%r13,4), %al
movb %al, (%rbx,%r13,4)
incq %r13
cmpq $0x8, %r13
jne 0x56f9
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/s0sasaki[P]ExecutableBlockchain/sha256.cpp
// Function: sha256(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::string sha256(std::string input)
{
    unsigned char digest[SHA256::DIGEST_SIZE];
    memset(digest,0,SHA256::DIGEST_SIZE);

    SHA256 ctx = SHA256();
    ctx.init();
    ctx.update( (unsigned char*)input.c_str(), input.length());
    ctx.final(digest);

    char buf[2*SHA256::DIGEST_SIZE+1];
    buf[2*SHA256::DIGEST_SIZE] = 0;
    for (int i = 0; i < SHA256::DIGEST_SIZE; i++)
        sprintf(buf+i*2, "%02x", digest[i]);
    return std::string(buf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x120, %rsp            # imm = 0x120
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq -0x40(%rbp), %r15
movaps %xmm0, 0x10(%r15)
movaps %xmm0, (%r15)
leaq -0x138(%rbp), %r12
movl $0xa8, %edx
movq %r12, %rdi
xorl %esi, %esi
callq 0x2110
movaps 0x1a57(%rip), %xmm0     # 0x71e0
movups %xmm0, 0x88(%r12)
movaps 0x1a57(%rip), %xmm0     # 0x71f0
movups %xmm0, 0x98(%r12)
movq $0x0, (%r12)
movq (%r14), %rsi
movl 0x8(%r14), %edx
movq %r12, %rdi
callq 0x55a2
movq %r12, %rdi
movq %r15, %rsi
callq 0x5654
leaq -0x90(%rbp), %r14
movb $0x0, 0x40(%r14)
leaq 0x1b29(%rip), %r15      # 0x7300
xorl %r12d, %r12d
movzbl -0x40(%rbp,%r12), %edx
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
incq %r12
addq $0x2, %r14
cmpq $0x20, %r12
jne 0x57da
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq -0x90(%rbp), %r14
movq %r14, %rdi
callq 0x20d0
leaq (%rax,%rbp), %rdx
addq $-0x90, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3d02
movq %rbx, %rax
addq $0x120, %rsp            # imm = 0x120
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/s0sasaki[P]ExecutableBlockchain/vm.cpp
// Function: VM::funcOpRet()
void VM::funcOpRet () { 
    if(rsp == 0) is_halt = true; 
    ip = return_stack[rsp--];  
    ib = return_stack[rsp--];  
    load();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movslq 0x8(%rdi), %rax
testq %rax, %rax
jne 0x5a4d
movb $0x1, 0x10(%rdi)
leal -0x1(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl 0x3020(%rdi,%rax,4), %ecx
movl %ecx, 0x4(%rdi)
leal -0x2(%rax), %ecx
movl %ecx, 0x8(%rdi)
movslq 0x301c(%rdi,%rax,4), %rcx
movl %ecx, (%rdi)
movq 0x18(%rdi), %rax
movq (%rax), %rdx
movq 0x8(%rax), %rax
subq %rdx, %rax
sarq $0x4, %rax
movabsq $0x77a9af922545a3cd, %rsi # imm = 0x77A9AF922545A3CD
imulq %rax, %rsi
leaq 0x1020(%rdi), %rax
imulq $0x1050, %rcx, %r8      # imm = 0x1050
addq $0x20, %rdi
cmpq %rcx, %rsi
leaq 0x40(%rdx,%r8), %rsi
cmovbeq %rdi, %rsi
movl $0x1000, %edx           # imm = 0x1000
movq %rax, %rdi
popq %rbp
jmp 0x21a0
nop
// File: /workspace/github_cpp_makefile_star2_O1/s0sasaki[P]ExecutableBlockchain/vm.cpp
// Function: VM::funcOpCall()
void VM::funcOpCall() { 
    return_stack[++rsp] = ib; 
    return_stack[++rsp] = ip + 2; 
    ib = mem[ip++];  
    ip = mem[ip];  
    load();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl (%rdi), %eax
movslq 0x8(%rdi), %rcx
leaq 0x1(%rcx), %rdx
movl %edx, 0x8(%rdi)
movl %eax, 0x3024(%rdi,%rcx,4)
movl 0x4(%rdi), %eax
addl $0x2, %eax
movslq 0x8(%rdi), %rcx
leaq 0x1(%rcx), %rdx
movl %edx, 0x8(%rdi)
movl %eax, 0x3024(%rdi,%rcx,4)
movslq 0x4(%rdi), %rax
leaq 0x1(%rax), %rcx
movl %ecx, 0x4(%rdi)
movslq 0x1020(%rdi,%rax,4), %rcx
movl %ecx, (%rdi)
movl 0x1024(%rdi,%rax,4), %eax
movl %eax, 0x4(%rdi)
movq 0x18(%rdi), %rax
movq (%rax), %rdx
movq 0x8(%rax), %rax
subq %rdx, %rax
sarq $0x4, %rax
movabsq $0x77a9af922545a3cd, %rsi # imm = 0x77A9AF922545A3CD
imulq %rax, %rsi
imulq $0x1050, %rcx, %rax     # imm = 0x1050
leaq 0x20(%rdi), %r8
cmpq %rcx, %rsi
leaq 0x40(%rdx,%rax), %rsi
cmovbeq %r8, %rsi
addq $0x1020, %rdi           # imm = 0x1020
movl $0x1000, %edx           # imm = 0x1000
popq %rbp
jmp 0x21a0
// File: /workspace/github_cpp_makefile_star2_O1/s0sasaki[P]ExecutableBlockchain/vm.cpp
// Function: VM::exec(int const*, Blockchain const&)
void VM::exec(const int32_t *bin_data, const Blockchain &blockchain) {
    refresh(bin_data, blockchain);
    while(is_halt == false) {
#ifdef DEBUG
        displayState();
#endif
        (this->*func_table[mem[ip++]])();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdx), %rax
subq (%rdx), %rax
shrq $0x4, %rax
imull $0x2545a3cd, %eax, %eax # imm = 0x2545A3CD
movl %eax, (%rdi)
xorl %eax, %eax
movq %rax, 0x4(%rdi)
movq %rax, 0x9(%rdi)
movq %rdx, 0x18(%rdi)
addq $0x1020, %rdi           # imm = 0x1020
movl $0x1000, %edx           # imm = 0x1000
callq 0x21a0
leaq 0x20(%rbx), %rdi
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rsi
callq 0x21a0
leaq 0x3020(%rbx), %rdi
movl $0x2000, %edx           # imm = 0x2000
xorl %esi, %esi
callq 0x2110
cmpb $0x0, 0x10(%rbx)
jne 0x5ec2
leaq 0x5020(%rbx), %r14
movslq 0x4(%rbx), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x4(%rbx)
movslq 0x1020(%rbx,%rax,4), %rcx
shlq $0x4, %rcx
movq (%r14,%rcx), %rax
movq 0x8(%r14,%rcx), %rdi
addq %rbx, %rdi
testb $0x1, %al
je 0x5eba
movq (%rdi), %rcx
movq -0x1(%rcx,%rax), %rax
callq *%rax
cmpb $0x0, 0x10(%rbx)
je 0x5e8c
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/s0sasaki[P]ExecutableBlockchain/vm.cpp
// Function: VM::refresh(int const*, Blockchain const&)
void VM::refresh(const int32_t *latest_data, const Blockchain &blockchain){
    ib      = blockchain.chain.size();
    ip      = 0;
    rsp     = 0;
    psp     = 0;
    is_halt = false;
    pblockchain = &blockchain;
    std::memcpy(mem,      latest_data, sizeof mem);
    std::memcpy(bin_data, latest_data, sizeof mem);
    std::memset(return_stack, 0, sizeof return_stack);
    std::memset(data_stack, 0, sizeof data_stack);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdx), %rax
subq (%rdx), %rax
shrq $0x4, %rax
imull $0x2545a3cd, %eax, %eax # imm = 0x2545A3CD
movl %eax, (%rdi)
xorl %eax, %eax
movq %rax, 0x4(%rdi)
movq %rax, 0x9(%rdi)
movq %rdx, 0x18(%rdi)
addq $0x1020, %rdi           # imm = 0x1020
movl $0x1000, %edx           # imm = 0x1000
callq 0x21a0
leaq 0x20(%rbx), %rdi
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rsi
callq 0x21a0
addq $0x3020, %rbx           # imm = 0x3020
movl $0x2000, %edx           # imm = 0x2000
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x2110
// File: /workspace/github_cpp_makefile_star2_O1/s0sasaki[P]ExecutableBlockchain/vm.cpp
// Function: VM::displayOp(int const&) const
void VM::displayOp(const int32_t &idx) const{
    switch(idx) {
        case OP_RET    : std::cout << "OP_RET  " << std::endl; break;
        case OP_CALL   : std::cout << "OP_CALL " << std::endl; break;
        case OP_JMP    : std::cout << "OP_JMP  " << std::endl; break;
        case OP_JZ     : std::cout << "OP_JZ   " << std::endl; break;
        case OP_EQ     : std::cout << "OP_EQ   " << std::endl; break;
        case OP_GE     : std::cout << "OP_GE   " << std::endl; break;
        case OP_LE     : std::cout << "OP_LE   " << std::endl; break;
        case OP_GNE    : std::cout << "OP_GNE  " << std::endl; break;
        case OP_LNE    : std::cout << "OP_LNE  " << std::endl; break;
        case OP_PUSH   : std::cout << "OP_PUSH " << std::endl; break;
        case OP_POP    : std::cout << "OP_POP  " << std::endl; break;
        case OP_DUP    : std::cout << "OP_DUP  " << std::endl; break;
        case OP_OVER   : std::cout << "OP_OVER " << std::endl; break;
        case OP_SWAP   : std::cout << "OP_SWAP " << std::endl; break;
        case OP_DROP   : std::cout << "OP_DROP " << std::endl; break;
        case OP_ADD    : std::cout << "OP_ADD  " << std::endl; break;
        case OP_SUB    : std::cout << "OP_SUB  " << std::endl; break;
        case OP_MUL    : std::cout << "OP_MUL  " << std::endl; break;
        case OP_DIV    : std::cout << "OP_DIV  " << std::endl; break;
        case OP_NOP    : std::cout << "OP_NOP  " << std::endl; break;
        case OP_DOT    : std::cout << "OP_DOT  " << std::endl; break;
        case OP_HALT   : std::cout << "OP_HALT " << std::endl; break;
        case OP_LOAD   : std::cout << "OP_LOAD " << std::endl; break;
        case OP_STORE  : std::cout << "OP_STORE" << std::endl; break;
        default        : std::cout << "UNKNOWN " << std::endl; break;
    }
}

// Assembly:
movl (%rsi), %eax
cmpq $0x17, %rax
ja 0x5f5c
leaq 0x14b1(%rip), %rcx      # 0x7404
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
jmp 0x5f63
leaq 0x147a(%rip), %rsi      # 0x73dd
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x4068(%rip), %rbx      # 0x9fd8
movl $0x8, %edx
movq %rbx, %rdi
callq 0x2240
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2140
// File: /workspace/github_cpp_makefile_star2_O1/big-data-lab-team[P]OrpailleCC/main.cpp
// Function: main
int main(){
	CoarseMondrianForest<double, funct, KappaMetrics<LABEL_COUNT>, FEATURE_COUNT, LABEL_COUNT, 6000> classifier(0.6, 0.0001, 0.0, 10);
	//CoarseMondrianForest<double, funct, ErrorMetrics<FEATURE_COUNT, LABEL_COUNT>, FEATURE_COUNT, LABEL_COUNT, 6000> classifier(0.6, 0.0001, 0.0, 10);
	classifier.train(dt[0], labels[0]);
	classifier.train(dt[2], labels[2]);

	double scores[2];
	int result = classifier.predict(dt[0], scores);
#ifdef DEBUG
	cout << "Prediction: " << result << endl;
	cout << "True Label: " << labels[0] << endl;
#endif
	//result = classifier.predict(dt[2], scores);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x1858, %rsp           # imm = 0x1858
xorl %eax, %eax
movl $0x1, %r10d
leaq 0x10(%rsp), %rbx
movsd 0x4ded(%rip), %xmm0     # 0x6008
movsd 0x4ded(%rip), %xmm1     # 0x6010
movsd 0x4ded(%rip), %xmm3     # 0x6018
xorps %xmm2, %xmm2
movq %rbx, %rdi
movl $0xa, %esi
movl $0x0, %edx
movl $0x1, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movl $0x0, %r9d
movaps %xmm3, %xmm4
movaps %xmm3, %xmm5
movaps %xmm3, %xmm6
pushq %rax
pushq %rax
pushq %rax
pushq %r10
pushq %r10
pushq %rax
pushq %rax
pushq %rax
callq 0x12b6
addq $0x40, %rsp
movl 0x6fd2(%rip), %edx      # 0x8240
leaq 0x6e0b(%rip), %r14      # 0x8080
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1526
movl 0x6fc2(%rip), %edx      # 0x8248
leaq 0x6e33(%rip), %rsi      # 0x80c0
movq %rbx, %rdi
callq 0x1526
movq %rsp, %rdx
movq %rbx, %rdi
movq %r14, %rsi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x16e4
xorl %eax, %eax
addq $0x1858, %rsp           # imm = 0x1858
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/big-data-lab-team[P]OrpailleCC/./src/mondrian_coarse.hpp
// Function: CoarseMondrianForest<double, funct, KappaMetrics<2, false>, 4, 2, 6000>::predict(double const*, double*, int)
int predict(feature_type const* features, double* scores = nullptr, int tree_to_use = -1){
	if(tree_to_use < 0)
		tree_to_use = tree_count;
	//Update internal count
	//NOTE uncomment for bound and trim, just to be safer
	#ifndef UNBOUND_OPTIMIZE
	if(extend_type != EXTEND_GHOST)
		update_posterior_count();
	#endif
	//The posterior mean of the forest will be the average posterior means over all trees
	//We start by computing the sum
	double tree_used = 0;
	double sum_posterior_mean[label_count] = {0};
	for(int i = 0; i < tree_to_use; ++i){
		double posterior_mean[label_count];
		//Get the  posterior means of the leaf of the data point in tree *i*
		predict_tree(features, i, posterior_mean);
		tree_used += 1;
		//Update the sum of posterior means
		for(int k = 0; k < label_count; ++k)
			sum_posterior_mean[k] += posterior_mean[k];
	}
	//Then we divide by the number trees.
	for(int k = 0; k < label_count; ++k)
		sum_posterior_mean[k] /= tree_used;

	//Finally, we look for the best label
	return Utils::index_max(sum_posterior_mean, label_count);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movl %ecx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
testl %ecx, %ecx
jns 0x1703
movl 0x17dc(%r14), %ebp
cmpl $0x2, 0x3c(%r14)
je 0x1712
movq %r14, %rdi
callq 0x1c8a
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
xorpd %xmm1, %xmm1
testl %ebp, %ebp
jle 0x1779
xorl %r15d, %r15d
leaq 0x20(%rsp), %r12
movsd %xmm1, 0x18(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
movl %r15d, %edx
movq %r12, %rcx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
callq 0x1cdc
xorl %eax, %eax
movsd 0x20(%rsp,%rax,8), %xmm0
addsd (%rsp,%rax,8), %xmm0
movsd %xmm0, (%rsp,%rax,8)
incq %rax
cmpq $0x1, %rax
je 0x174a
movsd 0x18(%rsp), %xmm1
addsd 0x48a7(%rip), %xmm1     # 0x6018
incl %r15d
cmpl %ebp, %r15d
jne 0x172b
xorl %eax, %eax
movsd (%rsp,%rax,8), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, (%rsp,%rax,8)
incq %rax
cmpq $0x1, %rax
je 0x177b
movsd 0x8(%rsp), %xmm0
xorl %eax, %eax
ucomisd (%rsp), %xmm0
seta %al
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/big-data-lab-team[P]OrpailleCC/./src/mondrian_coarse.hpp
// Function: CoarseMondrianForest<double, funct, KappaMetrics<2, false>, 4, 2, 6000>::tree_trim()
void tree_trim(){
	if(trim_type == TRIM_NONE)
		return;
	for(int i = 0; i < tree_count; ++i){
		int id = tree_trim(i);
		if(tree_bases()[i].root != id && id >= 0 && id < node_count) //Can't cut the root
			cut_block(id, i);
	}
}

// Assembly:
cmpl $0x0, 0x40(%rdi)
je 0x1a76
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x17dc(%rdi)
jle 0x1a71
leaq 0x17bc(%rbx), %r15
xorl %r14d, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x2118
testl %eax, %eax
js 0x1a5e
movslq 0x17dc(%rbx), %rcx
imulq $-0x38, %rcx, %rcx
cmpl %eax, (%r15,%rcx)
je 0x1a5e
cmpl 0x17d4(%rbx), %eax
jge 0x1a5e
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %edx
callq 0x22c8
incq %r14
movslq 0x17dc(%rbx), %rax
addq $0x38, %r15
cmpq %rax, %r14
jl 0x1a29
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/big-data-lab-team[P]OrpailleCC/./src/mondrian_coarse.hpp
// Function: CoarseMondrianForest<double, funct, KappaMetrics<2, false>, 4, 2, 6000>::update_posterior_count(int)
void update_posterior_count(int const node_id){
	Node& node = nodes()[node_id];
	if(node.is_leaf()){
		//A leaf should already has its count right
		return;
	}
	else{ //This is an internal node
		//Compute the posterior count for the two children
		update_posterior_count(node.child_left);
		update_posterior_count(node.child_right);
	}
	//Update each count
	for(int i = 0; i < label_count; ++i){
		int const c_left = Utils::min(1, nodes()[node.child_left].counters[i]);
		int const c_right = Utils::min(1, nodes()[node.child_right].counters[i]);
		node.counters[i] = c_left + c_right;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movslq %esi, %r14
shlq $0x7, %r14
cmpl $-0x1, 0x44(%rdi,%r14)
je 0x1f80
movq %rdi, %rbx
leaq (%rdi,%r14), %r15
addq $0x44, %r15
movl 0x50(%r15), %esi
callq 0x1f0c
movl 0x54(%r15), %esi
movq %rbx, %rdi
callq 0x1f0c
addq $0xac, %rbx
movl $0x1, %eax
movl $0x1, %ecx
movslq 0x50(%r15), %rdx
shlq $0x7, %rdx
movl (%rbx,%rdx), %edx
testl %edx, %edx
cmovgl %ecx, %edx
movslq 0x54(%r15), %rsi
shlq $0x7, %rsi
movl (%rbx,%rsi), %esi
testl %esi, %esi
cmovgl %ecx, %esi
addl %edx, %esi
movl %esi, (%rbx,%r14)
addq $0x4, %rbx
decq %rax
je 0x1f51
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/big-data-lab-team[P]OrpailleCC/./src/mondrian_coarse.hpp
// Function: CoarseMondrianForest<double, funct, KappaMetrics<2, false>, 4, 2, 6000>::compute_posterior_mean(MondrianNode<4, 2> const&, double*) const
void compute_posterior_mean(Node const& node, double *posterior_mean) const{
	//posterior_mean start with the parent posterior_mean and the function updates to the current node
	double const parent_tau = node.parent >= 0 ? nodes()[node.parent].tau : 0; //The tau value of the parent of the root is 0
	double const node_discount = func::exp(discount_factor * (node.tau - parent_tau));
	double sum_counters = 0;
	double sum_tab = 0;
	double tab[label_count];
	//Compute sum_counters and sum_tab, and set tab
	for(int i = 0; i < label_count; ++i){
		sum_counters += node.counters[i];
		tab[i] = Utils::min(node.counters[i], 1);
		sum_tab += tab[i];
	}
	//For each label with a counter higher than zero, compute the posterior mean. Otherwise it is simply the posterior mean of the parent
	for(int i = 0; i < label_count; ++i){
		if(node.counters[i] > 0){
			double const a = node.counters[i] - node_discount * tab[i];
			double const b = node_discount * sum_tab * posterior_mean[i];
			posterior_mean[i] = (a / sum_counters) + (b /sum_counters);
		}
	}
}

// Assembly:
xorpd %xmm0, %xmm0
xorl %eax, %eax
movl $0x1, %ecx
xorpd %xmm1, %xmm1
movl 0x68(%rsi,%rax,4), %edi
xorps %xmm2, %xmm2
cvtsi2sd %edi, %xmm2
addsd %xmm2, %xmm0
testl %edi, %edi
cmovgl %ecx, %edi
xorps %xmm2, %xmm2
cvtsi2sd %edi, %xmm2
movsd %xmm2, -0x18(%rsp,%rax,8)
addsd %xmm2, %xmm1
incq %rax
cmpq $0x1, %rax
je 0x1f95
xorpd %xmm2, %xmm2
mulsd %xmm2, %xmm1
xorl %eax, %eax
movsd 0x404b(%rip), %xmm2     # 0x6020
movl 0x68(%rsi,%rax,4), %ecx
testl %ecx, %ecx
jle 0x200c
xorps %xmm3, %xmm3
cvtsi2sd %ecx, %xmm3
movsd -0x18(%rsp,%rax,8), %xmm4
mulsd %xmm2, %xmm4
addsd %xmm3, %xmm4
movsd (%rdx,%rax,8), %xmm3
mulsd %xmm1, %xmm3
divsd %xmm0, %xmm4
divsd %xmm0, %xmm3
addsd %xmm4, %xmm3
movsd %xmm3, (%rdx,%rax,8)
incq %rax
cmpq $0x1, %rax
je 0x1fd5
retq
// File: /workspace/github_cpp_makefile_star2_O1/big-data-lab-team[P]OrpailleCC/./src/mondrian_coarse.hpp
// Function: int CoarseMondrianForest<double, funct, KappaMetrics<2, false>, 4, 2, 6000>::tree_fade_counts<100>(int)
int tree_fade_counts(int const tree_id){
	TreeBase const& base = tree_bases()[tree_id];
	int const root_id = base.root;

	//Initialize an array to keep track of where we have to go at each tree level.
	//The max depth expected is MAX_DEPTH.
	int stack[max_stack_size];
	for(int i = 0; i < max_stack_size; ++i)
		stack[i] = -1;

	//Start at the root, then dive inside the tree
	int node_id = root_id;
	int depth = 0;
	double smallest_count = -1;
	int smallest_id = 0;
	//a for loop instead of a while to avoid infinite loops. Since we don't expect to do more turn than node_count
	int i = 0;
	double leaf_count = 0;
	double sum_count_leaves = 0;
	while(i < node_count && node_id >= 0){
		Node& node = nodes()[node_id];
		if(!node.is_leaf()){  //Internal node
			if (stack[depth] == -1){ //Go right
				stack[depth] = 0;
				depth += 1;
				node_id = node.child_right;
			}
			else if (stack[depth] == 0){ //Go left
				stack[depth] = 1;
				depth += 1;
				node_id = node.child_left;
			}
			else if (stack[depth] == 1){ //Go up
				stack[depth] = -1; //Reset to -1
				depth -= 1;
				i += 1;
				node_id = node.parent;
			}
		}
		else{ //Leaf
			stack[depth] = -1; //Reset to -1
			depth -= 1;
			i += 1;
			node.fading_score = node.fading_score * nodes_fading_f;
			node_id = node.parent;
		}
		if(depth >= max_stack_size)
			return -1;
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rdi, %rbx
movslq 0x17dc(%rdi), %rax
imulq $-0x38, %rax, %rax
addq %rdi, %rax
movslq %esi, %rcx
imulq $0x38, %rcx, %rcx
movl 0x17bc(%rcx,%rax), %ebp
movq %rsp, %rdi
movl $0x190, %edx            # imm = 0x190
movl $0xff, %esi
callq 0x1040
movl 0x17d4(%rbx), %ecx
movsd 0x1830(%rbx), %xmm0
addq $0x44, %rbx
xorl %eax, %eax
xorl %edi, %edi
xorl %edx, %edx
cmpl %ecx, %edx
jge 0x210d
testl %ebp, %ebp
js 0x210d
movl %ebp, %r8d
shlq $0x7, %r8
leaq (%rbx,%r8), %rsi
cmpl $-0x1, (%rbx,%r8)
movslq %edi, %r8
je 0x20b5
movl (%rsp,%r8,4), %r9d
cmpl $0x1, %r9d
je 0x20e5
testl %r9d, %r9d
je 0x20d2
cmpl $-0x1, %r9d
jne 0x20ff
movl $0x0, (%rsp,%r8,4)
incl %r8d
movl $0x54, %r9d
jmp 0x20f8
movl $0xffffffff, (%rsp,%r8,4) # imm = 0xFFFFFFFF
decl %r8d
incl %edx
movsd 0x78(%rsi), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, 0x78(%rsi)
jmp 0x20f2
movl $0x1, (%rsp,%r8,4)
incl %r8d
movl $0x50, %r9d
jmp 0x20f8
movl $0xffffffff, (%rsp,%r8,4) # imm = 0xFFFFFFFF
decl %r8d
incl %edx
movl $0x58, %r9d
movl %r8d, %edi
movl (%rsi,%r9), %ebp
cmpl $0x64, %edi
jl 0x2068
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/big-data-lab-team[P]OrpailleCC/./src/mondrian_coarse.hpp
// Function: CoarseMondrianForest<double, funct, KappaMetrics<2, false>, 4, 2, 6000>::cut_block(int, int)
void cut_block(int const node_id, int const tree_id){
	Node& node = nodes()[node_id];
	Node& parent = nodes()[node.parent];
	int sibling_id;
	if(parent.child_right == node_id)
		sibling_id = parent.child_left;
	else
		sibling_id = parent.child_right;
	Node& sibling = nodes()[sibling_id];

	if(parent.parent == -1){ //Place the other sibling as root (behead)
		parent.reset();
		node_available += 1;
		node_reset(node_id);
		//Cut off node and everything below
		tree_bases()[tree_id].root = sibling_id;
		sibling.parent = Node::EMPTY_NODE;
		return;
	}
	Node& grandparent = nodes()[parent.parent];
	int rem_count_id = parent.parent;
	if(grandparent.child_right == node.parent)
		grandparent.child_right = sibling_id;
	else
		grandparent.child_left = sibling_id;
	sibling.parent = parent.parent;
	node_available += 1;
	parent.reset();
	//TODO remove the counters?
	node_reset(node_id);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rdi, %rbx
leaq 0x44(%rdi), %rcx
movslq %esi, %rdi
movq %rdi, %rax
shlq $0x7, %rax
movslq 0x9c(%rbx,%rax), %rdx
movq %rdx, %rax
shlq $0x7, %rax
addq %rbx, %rax
addq $0x44, %rax
movl 0x54(%rax), %r14d
cmpl %edi, %r14d
jne 0x2306
movl 0x50(%rax), %r14d
movslq %r14d, %r15
shlq $0x7, %r15
addq %rcx, %r15
movslq 0x58(%rax), %rdi
cmpq $-0x1, %rdi
je 0x2398
movq %rdi, %r8
shlq $0x7, %r8
leaq (%rcx,%r8), %r9
xorl %r10d, %r10d
cmpl %edx, 0x54(%rcx,%r8)
sete %r10b
movl %r14d, 0x50(%r9,%r10,4)
movl %edi, 0x58(%r15)
incl 0x17d8(%rbx)
xorl %ecx, %ecx
movq %rcx, 0x68(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
movq $-0x1, 0x50(%rax)
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %edx, (%rax)
movq %rcx, 0x8(%rax)
movabsq $-0x4010000000000000, %rdi # imm = 0xBFF0000000000000
movq %rdi, 0x60(%rax)
movl %edx, 0x58(%rax)
movl $0x0, 0x70(%rax)
movq %rcx, 0x78(%rax)
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x241c
xorl %ecx, %ecx
movq %rcx, 0x68(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
movq $-0x1, 0x50(%rax)
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movl %r12d, (%rax)
movq %rcx, 0x8(%rax)
movabsq $-0x4010000000000000, %rdx # imm = 0xBFF0000000000000
movq %rdx, 0x60(%rax)
movl %r12d, 0x58(%rax)
movl $0x0, 0x70(%rax)
movq %rcx, 0x78(%rax)
incl 0x17d8(%rbx)
movq %rbx, %rdi
callq 0x241c
movslq 0x17dc(%rbx), %rax
imulq $-0x38, %rax, %rax
addq %rbx, %rax
movslq %ebp, %rcx
imulq $0x38, %rcx, %rcx
movl %r14d, 0x17bc(%rcx,%rax)
movl %r12d, 0x58(%r15)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/big-data-lab-team[P]OrpailleCC/./src/mondrian_coarse.hpp
// Function: CoarseMondrianForest<double, funct, KappaMetrics<2, false>, 4, 2, 6000>::available_node() const
int available_node(void) const{
	if(node_available == 0)
		return -1;
	static int last_returned_node = 0;
	for(int i = 0; i < node_count; ++i){
		int const node_id = (i + last_returned_node) % node_count;
		if(nodes()[node_id].available()){
			last_returned_node = node_id;
			return node_id;
		}
	}
	return -1;
}

// Assembly:
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl $0x0, 0x17d8(%rdi)
je 0x2663
movl 0x17d4(%rdi), %esi
testl %esi, %esi
jle 0x2663
movl 0x5c65(%rip), %r9d      # 0x8284
addq $0x44, %rdi
xorl %r8d, %r8d
xorpd %xmm0, %xmm0
leal (%r9,%r8), %eax
cltd
idivl %esi
movslq %edx, %rax
shlq $0x7, %rax
movsd 0x60(%rdi,%rax), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x2650
movl %edx, 0x5c3a(%rip)      # 0x8284
movl %edx, %r9d
movl %edx, %r10d
ucomisd %xmm1, %xmm0
ja 0x2660
incl %r8d
cmpl %r8d, %esi
jne 0x262a
jmp 0x2663
movl %r10d, %ecx
movl %ecx, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/big-data-lab-team[P]OrpailleCC/./src/mondrian_coarse.hpp
// Function: int CoarseMondrianForest<double, funct, KappaMetrics<2, false>, 4, 2, 6000>::node_depth<100>(int, int*) const
int node_depth(int const start_id, int* tree_node_count) const{
	//Initialize an array to keep track of where we have to go at each tree level.
	//The max depth expected is MAX_DEPTH.
	int stack[max_stack_size];
	for(int i = 0; i < max_stack_size; ++i)
		stack[i] = -1;

	int node_id = start_id;
	int depth = 0, max_depth = 0;

	//a for loop instead of a while to avoid infinite loops. Since we don't expect to do more turn than node_count
	//*i* count the number of node deleted.
	int i = 0;
	int depth_id = start_id;
	while(i < node_count && depth >= 0){
		Node const& node = nodes()[node_id];
		if (node.is_leaf()){
			i += 1;
			//acknowledge the depth
			if(depth > max_depth){
				max_depth = depth;
				depth_id = node_id;
			}

			node_id = node.parent;
			depth -= 1;
		}
		else{ //Internal Node
			if (stack[depth] == -1){ //going right
				stack[depth] = 0;
				depth += 1;
				node_id = node.child_right;
			}
			else if (stack[depth] == 0){ //Go left
				stack[depth] = 1;
				depth += 1;
				node_id = node.child_left;
			}
			else if (stack[depth] == 1){ //Go up
				i += 1;
				stack[depth] = -1; //Reset to -1
				depth -= 1;
				node_id = node.parent;
			}
			#ifdef DEBUG
			else{
				cout << __FILE__ << ":" << __LINE__ << " CoarseMondrianForest::node_depth: stack[" << depth << "] == " << stack[depth] << " (should be -1, 0, or 1)" << endl;
			}
			#endif
		}
	}
	if(tree_node_count != nullptr)
		*tree_node_count = i;
	return max_depth+1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movq %rsp, %rdi
movl $0x190, %edx            # imm = 0x190
movl $0xff, %esi
callq 0x1040
movl 0x17d4(%r14), %edx
testl %edx, %edx
jle 0x3df5
addq $0x44, %r14
xorl %ecx, %ecx
xorl %eax, %eax
xorl %esi, %esi
movslq %ebp, %r8
shlq $0x7, %r8
leaq (%r14,%r8), %rdi
cmpl $-0x1, (%r14,%r8)
je 0x3dbd
movl %esi, %r8d
movl (%rsp,%r8,4), %r9d
cmpl $0x1, %r9d
je 0x3dda
testl %r9d, %r9d
je 0x3dcb
cmpl $-0x1, %r9d
jne 0x3de9
movl $0x0, (%rsp,%r8,4)
incl %esi
movl 0x54(%rdi), %ebp
jmp 0x3de9
incl %ecx
cmpl %eax, %esi
cmovgl %esi, %eax
movl 0x58(%rdi), %ebp
decl %esi
jmp 0x3de9
movl $0x1, (%rsp,%r8,4)
incl %esi
movl 0x50(%rdi), %ebp
jmp 0x3de9
incl %ecx
movl $0xffffffff, (%rsp,%r8,4) # imm = 0xFFFFFFFF
decl %esi
movl 0x58(%rdi), %ebp
cmpl %edx, %ecx
jge 0x3df1
testl %esi, %esi
jns 0x3d84
incl %eax
jmp 0x3dfc
xorl %ecx, %ecx
movl $0x1, %eax
testq %rbx, %rbx
je 0x3e03
movl %ecx, (%rbx)
addq $0x190, %rsp            # imm = 0x190
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/big-data-lab-team[P]OrpailleCC/./src/mondrian_coarse.hpp
// Function: CoarseMondrianForest<double, funct, KappaMetrics<2, false>, 4, 2, 6000>::pass_data_point_down(int, double const*, int)
int pass_data_point_down(int const start_id, feature_type const* features, int const label){
	int node_id = start_id;

	//Loop to find the leaf
	while(true){
		Node& node = nodes()[node_id];
		//Update box size
		for(int i = 0; i < feature_count; ++i){
			double const lower = Utils::min(node.bound_lower[i], features[i]);
			double const upper = Utils::max(node.bound_upper[i], features[i]);
			node.bound_lower[i] = lower;
			node.bound_upper[i] = upper;
		}
		if(node.is_leaf())
			break;
		//Choose a direction
		if(features[node.split_dimension] > node.split_value)
			node_id = node.child_right;
		else
			node_id = node.child_left;
	}
	Node& node = nodes()[node_id];
	node.counters[label] += 1;
	node.fading_score += 1; //fading_score is decreased later
	return node_id;
}

// Assembly:
addq $0x44, %rdi
movslq %esi, %rax
shlq $0x7, %rax
addq %rdi, %rax
xorl %r8d, %r8d
movsd (%rdx,%r8,8), %xmm0
movsd 0x10(%rax,%r8,8), %xmm1
movsd 0x30(%rax,%r8,8), %xmm2
minsd %xmm0, %xmm1
maxsd %xmm0, %xmm2
movsd %xmm1, 0x10(%rax,%r8,8)
movsd %xmm2, 0x30(%rax,%r8,8)
incq %r8
cmpq $0x4, %r8
jne 0x5307
movslq (%rax), %r8
cmpq $-0x1, %r8
je 0x5358
movsd (%rdx,%r8,8), %xmm0
xorl %esi, %esi
ucomisd 0x8(%rax), %xmm0
seta %sil
movl 0x50(%rax,%rsi,4), %esi
cmpl $-0x1, %r8d
jne 0x52fa
movslq %esi, %rax
movq %rax, %rdx
shlq $0x7, %rdx
leaq (%rdi,%rdx), %rsi
movslq %ecx, %rcx
incl 0x68(%rsi,%rcx,4)
movsd 0x78(%rdi,%rdx), %xmm0
addsd 0xc97(%rip), %xmm0      # 0x6018
movsd %xmm0, 0x78(%rdi,%rdx)
retq
// File: /workspace/github_cpp_makefile_star2_O1/ef-gy[P]libefgy/include/ef.gy/polar.h
// Function: efgy::math::vector<double, 3u, efgy::math::format::polar>::operator efgy::math::vector<double, 3u, efgy::math::format::cartesian>() const
operator vector<F, n, format::cartesian>() const {
    vector<F, n, format::cartesian> v;

    for (unsigned int i = 0; i < n; i++) {
      v[i] = (*this)[0];
    }

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wtautological-compare"
    for (unsigned int i = 0; i < (n - 1); i++)
#pragma clang diagnostic pop
    {
      const unsigned int p = i + 1;

      v[i] *= math::cosine((*this)[p], spaceTag.precision);

      for (unsigned int j = p; j < n; j++) {
        v[j] *= math::sine((*this)[p], spaceTag.precision);
      }
    }

    return v;
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movsd (%rsi), %xmm0
xorl %eax, %eax
movsd %xmm0, (%rbx,%rax,8)
incq %rax
cmpq $0x3, %rax
jne 0x5487
xorl %r15d, %r15d
movq %r15, %r12
incq %r15
movsd 0x8(%r14,%r12,8), %xmm0
callq 0x4430
mulsd (%rbx,%r12,8), %xmm0
movsd %xmm0, (%rbx,%r12,8)
movq %r12, %r13
movsd (%r14,%r15,8), %xmm0
callq 0x4060
mulsd 0x8(%rbx,%r13,8), %xmm0
movsd %xmm0, 0x8(%rbx,%r13,8)
incq %r13
cmpq $0x2, %r13
jne 0x54b9
testq %r12, %r12
je 0x5498
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq