LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/billDrett[P]Bulletin-Boards/chanel.cpp
// Function: Chanel::Chanel(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Chanel::Chanel(int Id, string Name): id(Id)
{
    ofstream messageFile;
    char buffId[12];
    name = Name;
    files = new List<string>();

    sprintf(buffId, "%d", Id);
    messageFileName = "message_";
    messageFileName.append(buffId);
    messageFile.open(messageFileName.c_str()); //dimiourgoume to arxeio gia thn apothikeush twn mhnymatwn
    messageFile.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rdx, %r13
movl %esi, %r12d
movq %rdi, %r15
movl %esi, (%rdi)
leaq 0x8(%rdi), %rbx
leaq 0x18(%rdi), %rax
movq %rax, -0x38(%rbp)
movq %rax, 0x8(%rdi)
xorl %eax, %eax
movq %rax, 0x10(%rdi)
movb %al, 0x18(%rdi)
leaq 0x28(%rdi), %r14
leaq 0x38(%rdi), %rcx
movq %rcx, -0x30(%rbp)
movq %rcx, 0x28(%rdi)
movq %rax, 0x30(%rdi)
movb %al, 0x38(%rdi)
leaq -0x250(%rbp), %rdi
movq %rbx, -0x40(%rbp)
callq 0x2390
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2170
movl $0x18, %edi
callq 0x2220
movq %rax, %r13
movq %rax, %rdi
callq 0x6a80
movq %r13, 0x48(%r15)
leaq 0xad5(%rip), %rsi       # 0x810b
leaq -0x4c(%rbp), %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0x2080
movq 0x30(%r15), %rdx
leaq 0xc9b(%rip), %rcx       # 0x82ea
movl $0x8, %r8d
movq %r14, %rdi
xorl %esi, %esi
callq 0x2360
leaq -0x4c(%rbp), %rsi
movq %r14, %rdi
callq 0x23f0
movq (%r14), %rsi
leaq -0x250(%rbp), %rdi
movl $0x10, %edx
callq 0x2050
leaq -0x250(%rbp), %rdi
callq 0x22e0
movq 0x492e(%rip), %rax      # 0xbfc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x248(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x250(%rbp,%rcx)
callq 0x21e0
leaq -0x158(%rbp), %rdi
callq 0x20e0
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
movl $0x18, %esi
movq %r13, %rdi
callq 0x2230
jmp 0x76ed
movq %rax, %r15
jmp 0x76f9
movq %rax, %r15
leaq -0x250(%rbp), %rdi
callq 0x2330
movq (%r14), %rdi
cmpq -0x30(%rbp), %rdi
je 0x7711
movq -0x30(%rbp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x2230
movq -0x40(%rbp), %rax
movq (%rax), %rdi
cmpq -0x38(%rbp), %rdi
je 0x772d
movq -0x38(%rbp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x2230
movq %r15, %rdi
callq 0x23c0
nop
// File: /workspace/github_cpp_makefile_star2_O1/billDrett[P]Bulletin-Boards/chanel.cpp
// Function: Chanel::removeAllFiles()
void Chanel::removeAllFiles()
{
    string* tmp;

    tmp = files->deleteFirstNode();
    while(tmp != NULL)
    {
        unlink(tmp->c_str());
        delete tmp;
        tmp = files->deleteFirstNode();//diagrafoume ta stoixeia tis listas
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x48(%rdi), %rdi
callq 0x6bf8
testq %rax, %rax
je 0x7816
movq %rax, %r14
movq (%r14), %rdi
callq 0x2140
movq (%r14), %rdi
leaq 0x10(%r14), %rax
cmpq %rax, %rdi
je 0x77f8
movq (%rax), %rsi
incq %rsi
callq 0x2230
movl $0x20, %esi
movq %r14, %rdi
callq 0x2230
movq 0x48(%rbx), %rdi
callq 0x6bf8
movq %rax, %r14
testq %rax, %rax
jne 0x77d9
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/billDrett[P]Bulletin-Boards/chanel.cpp
// Function: Chanel::addMessage(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void Chanel::addMessage(string& message) //apothikeuoume to onoma sto telos tou arxeiou
{
    ofstream messageFile;
    messageFile.open(messageFileName.c_str(), std::ofstream::out | std::ofstream::app);
    if(!messageFile)
    {
        perror("chanel file cant open");
        exit(3);
    }

    messageFile << message;
    messageFile.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x218(%rbp), %r15
movq %r15, %rdi
callq 0x2390
movq 0x28(%r14), %rsi
movq %r15, %rdi
movl $0x11, %edx
callq 0x2050
movq -0x218(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x1f8(%rbp,%rax)
jne 0x794a
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
leaq -0x218(%rbp), %rdi
callq 0x2280
leaq -0x218(%rbp), %rdi
callq 0x22e0
movq 0x46b3(%rip), %rax      # 0xbfc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x210(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x218(%rbp,%rcx)
callq 0x21e0
leaq -0x120(%rbp), %rdi
callq 0x20e0
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x24a8
movq %rax, %rbx
leaq -0x218(%rbp), %rdi
callq 0x2330
movq %rbx, %rdi
callq 0x23c0
// File: /workspace/github_cpp_makefile_star2_O1/zengfenfei[P]codility/src/FrogJmp.cpp
// Function: solution(int, int, int)
int solution(int X, int Y, int D) {
	int dist = Y - X;
	int steps = dist / D;
	if (dist % D > 0) {
		steps++;
	}

	return steps;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edx, %ecx
movl %esi, %eax
subl %edi, %eax
cltd
idivl %ecx
xorl %ecx, %ecx
testl %edx, %edx
setg %cl
addl %ecx, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/7shi[P]8086run/v1/main.cpp
// Function: getch()
int getch() {
    char ret;
    if (kbchar == EOF) {
        if (read(STDIN_FILENO, &ret, 1) < 1) return EOF;
    } else {
        ret = kbchar;
        kbchar = EOF;
    }
    if (ret == 10) ret = 13;
    return ret;
}

// Assembly:
pushq %rax
movl 0x7e2d(%rip), %eax      # 0x90d0
cmpl $-0x1, %eax
je 0x12b8
movb %al, 0x7(%rsp)
movl $0xffffffff, 0x7e1a(%rip) # imm = 0xFFFFFFFF
jmp 0x12ce
leaq 0x7(%rsp), %rsi
movl $0x1, %edx
xorl %edi, %edi
callq 0x1140
testq %rax, %rax
jle 0x12e6
movzbl 0x7(%rsp), %eax
cmpb $0xa, %al
movl $0xd, %ecx
cmovnel %eax, %ecx
movb %cl, 0x7(%rsp)
movsbl %cl, %eax
popq %rcx
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x12e4
// File: /workspace/github_cpp_makefile_star2_O1/7shi[P]8086run/v1/main.cpp
// Function: kbhit()
int kbhit() {
    if (kbchar != EOF) return 1;
    int f = fcntl(STDIN_FILENO, F_GETFL, 0);
    fcntl(STDIN_FILENO, F_SETFL, f | O_NONBLOCK);
    char ch;
    kbchar = read(STDIN_FILENO, &ch, 1) < 1 ? EOF : ch;
    fcntl(STDIN_FILENO, F_SETFL, f);
    return kbchar != EOF;
}

// Assembly:
movl $0x1, %eax
cmpl $-0x1, 0x7dd7(%rip)     # 0x90d0
je 0x12fc
retq
pushq %r14
pushq %rbx
pushq %rax
xorl %edi, %edi
movl $0x3, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x1050
movl %eax, %ebx
movl %eax, %edx
orl $0x800, %edx            # imm = 0x800
xorl %edi, %edi
movl $0x4, %esi
xorl %eax, %eax
callq 0x1050
leaq 0x7(%rsp), %r14
movl $0x1, %edx
xorl %edi, %edi
movq %r14, %rsi
callq 0x1140
testq %rax, %rax
movsbl (%r14), %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmovgl %eax, %ecx
movl %ecx, 0x7d7f(%rip)      # 0x90d0
xorl %edi, %edi
movl $0x4, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x1050
xorl %eax, %eax
cmpl $-0x1, 0x7d66(%rip)     # 0x90d0
setne %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/7shi[P]8086run/v1/main.cpp
// Function: inittty()
void inittty() {
    termios t;
    tcgetattr(STDIN_FILENO, &t);
    oldt = t;

    struct sigaction sa;
    memset(&sa, 0, sizeof (sa));
    sa.sa_handler = siginthandler;
    sigaction(SIGINT, &sa, NULL);
    atexit(resettty);

    t.c_lflag &= ~(ICANON | ECHO);
    tcsetattr(STDIN_FILENO, TCSANOW, &t);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
leaq 0x4(%rsp), %rbx
xorl %edi, %edi
movq %rbx, %rsi
callq 0x10c0
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups 0x20(%rbx), %xmm2
movups 0x2c(%rbx), %xmm3
movups %xmm0, 0x7db1(%rip)     # 0x9170
movups %xmm1, 0x7dba(%rip)     # 0x9180
movups %xmm2, 0x7dc3(%rip)     # 0x9190
movups %xmm3, 0x7dc8(%rip)     # 0x919c
leaq 0x40(%rsp), %r14
movl $0x98, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x1040
leaq -0x7a(%rip), %rax       # 0x1375
movq %rax, (%r14)
movl $0x2, %edi
movq %r14, %rsi
xorl %edx, %edx
callq 0x1100
leaq -0x88(%rip), %rdi       # 0x1380
callq 0x69d0
andb $-0xb, 0xc(%rbx)
xorl %edi, %edi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x1110
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/7shi[P]8086run/v1/main.cpp
// Function: debug(_IO_FILE*, bool)
void
debug(FILE *f, bool h) {
    if (h) fprintf(f, " AX   BX   CX   DX   SP   BP   SI   DI    FLAGS    ES   SS   DS   CS   IP  dump\n");
    fprintf(f,
            "%04x %04x %04x %04x-%04x %04x %04x %04x %c%c%c%c%c%c%c%c%c %04x %04x %04x %04x:%04x %02x%02x\n",
            AX, BX, CX, DX, SP, BP, SI, DI,
            "-O"[OF], "-D"[DF], "-I"[IF], "-T"[TF], "-S"[SF], "-Z"[ZF], "-A"[AF], "-P"[PF], "-C"[CF],
            *ES, *SS, *DS, *CS, IP, CS[IP], CS[IP + 1]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
testl %esi, %esi
je 0x1459
movq %rdi, %rbx
leaq 0x6154(%rip), %rdi      # 0x7598
movl $0x50, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1170
movq %rbx, %rdi
movzwl 0x127d60(%rip), %edx    # 0x1291c0
movzwl 0x127d5f(%rip), %ecx    # 0x1291c6
movzwl 0x127d53(%rip), %r8d    # 0x1291c2
movzbl 0x127d9a(%rip), %eax    # 0x129210
leaq 0x61ca(%rip), %rsi      # 0x7647
movsbl (%rax,%rsi), %eax
movq %rax, 0x60(%rsp)
movzbl 0x127d84(%rip), %eax    # 0x129211
leaq 0x61b6(%rip), %rsi      # 0x764a
movsbl (%rax,%rsi), %eax
movq %rax, 0x58(%rsp)
movzbl 0x127d6e(%rip), %eax    # 0x129212
leaq 0x61a2(%rip), %rsi      # 0x764d
movsbl (%rax,%rsi), %eax
movq %rax, 0x50(%rsp)
movzbl 0x127d58(%rip), %eax    # 0x129213
leaq 0x618e(%rip), %rsi      # 0x7650
movsbl (%rax,%rsi), %eax
movq %rax, 0x48(%rsp)
movzbl 0x127d42(%rip), %eax    # 0x129214
leaq 0x617a(%rip), %rsi      # 0x7653
movsbl (%rax,%rsi), %eax
movq %rax, 0x40(%rsp)
movzbl 0x127d2c(%rip), %eax    # 0x129215
leaq 0x6166(%rip), %rsi      # 0x7656
movsbl (%rax,%rsi), %eax
movq %rax, 0x30(%rsp)
movzbl 0x127d16(%rip), %eax    # 0x129216
leaq 0x6152(%rip), %rsi      # 0x7659
movsbl (%rax,%rsi), %eax
movq %rax, 0x18(%rsp)
movzbl 0x127d00(%rip), %eax    # 0x129217
leaq 0x613e(%rip), %rsi      # 0x765c
movsbl (%rax,%rsi), %eax
movq %rax, 0x8(%rsp)
movzbl 0x127cea(%rip), %eax    # 0x129218
leaq 0x612a(%rip), %rsi      # 0x765f
movsbl (%rax,%rsi), %r13d
movzwl 0x127c6e(%rip), %r10d   # 0x1291b0
movq 0x127de7(%rip), %rax    # 0x129330
movzbl (%rax,%r10), %r11d
movzbl 0x1(%rax,%r10), %r14d
movzwl 0x127c68(%rip), %r9d    # 0x1291c4
movzwl 0x127c65(%rip), %eax    # 0x1291c8
movq %rax, 0x38(%rsp)
movzwl 0x127c5b(%rip), %eax    # 0x1291ca
movq %rax, 0x28(%rsp)
movzwl 0x127c51(%rip), %eax    # 0x1291cc
movq %rax, 0x20(%rsp)
movzwl 0x127c47(%rip), %eax    # 0x1291ce
movq %rax, 0x10(%rsp)
movzwl 0x127d95(%rip), %ebp    # 0x129328
movzwl 0x127dad(%rip), %r15d   # 0x129348
movzwl 0x127db5(%rip), %r12d   # 0x129358
movzwl 0x127d8e(%rip), %ebx    # 0x129338
leaq 0x6038(%rip), %rsi      # 0x75e9
xorl %eax, %eax
pushq %r14
pushq %r11
pushq %r10
pushq %rbx
pushq %r12
pushq %r15
pushq %rbp
pushq %r13
pushq 0x48(%rsp)
pushq 0x60(%rsp)
pushq 0x80(%rsp)
pushq 0x98(%rsp)
pushq 0xa8(%rsp)
pushq 0xb8(%rsp)
pushq 0xc8(%rsp)
pushq 0xd8(%rsp)
pushq 0x90(%rsp)
pushq 0xa8(%rsp)
pushq 0xb8(%rsp)
pushq 0xd0(%rsp)
callq 0x1130
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/7shi[P]8086run/v1/main.cpp
// Function: dump(_IO_FILE*, SReg*, unsigned short, int)
void dump(FILE *f, SReg *seg, uint16_t addr, int len) {
    fprintf(f, "org 0x%04x:0x%04x\n", seg->v, addr);
    for (int i = 0; i < len; ++i) {
        if (i & 7) {
            fprintf(f, ", ");
        } else {
            if (i > 0) fprintf(f, "\n");
            fprintf(f, "db ");
        }
        fprintf(f, "0x%02x", (*seg)[addr + i]);
    }
    fprintf(f, "\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
movzwl 0x8(%rsi), %edx
leaq 0x601b(%rip), %rsi      # 0x7662
movl %r15d, %ecx
xorl %eax, %eax
callq 0x1130
testl %ebp, %ebp
jle 0x16ca
movzwl %r15w, %r15d
movl %ebp, %ebp
leaq 0x601a(%rip), %r12      # 0x767c
xorl %r13d, %r13d
testb $0x7, %r13b
je 0x167e
movl $0x2, %esi
movl $0x1, %edx
leaq 0x5ff9(%rip), %rdi      # 0x7675
jmp 0x16a1
testq %r13, %r13
je 0x1690
movl $0xa, %edi
movq %rbx, %rsi
callq 0x10f0
movl $0x3, %esi
movl $0x1, %edx
leaq 0x5fd7(%rip), %rdi      # 0x7678
movq %rbx, %rcx
callq 0x1170
movq (%r14), %rax
addq %r15, %rax
movzbl (%r13,%rax), %edx
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x1130
incq %r13
cmpq %r13, %rbp
jne 0x1665
movl $0xa, %edi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10f0
// File: /workspace/github_cpp_makefile_star2_O1/7shi[P]8086run/v1/main.cpp
// Function: error(char const*, ...)
void error(const char *fmt, ...) {
    IP = oldip;
    dump(stderr, &CS, IP - 0x18, 0x30);
    debug(stderr, true);
    va_list ap;
    va_start(ap, fmt);
    vfprintf(stderr, fmt, ap);
    va_end(ap);
    fputc('\n', stderr);
    exit(1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %rbx
testb %al, %al
je 0x172f
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
leaq 0x20(%rsp), %r15
movq %rsi, 0x8(%r15)
movq %rdx, 0x10(%r15)
movq %rcx, 0x18(%r15)
movq %r8, 0x20(%r15)
movq %r9, 0x28(%r15)
movzwl 0x127a63(%rip), %eax    # 0x1291b2
movw %ax, 0x127a5a(%rip)     # 0x1291b0
movq 0x7883(%rip), %r14      # 0x8fe0
movq (%r14), %rdi
addl $-0x18, %eax
movzwl %ax, %edx
leaq 0x127bc3(%rip), %rsi    # 0x129330
movl $0x30, %ecx
callq 0x1626
movq (%r14), %rdi
movl $0x1, %esi
callq 0x1428
movq %rsp, %rdx
movq %r15, 0x10(%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x1120
movq (%r14), %rsi
movl $0xa, %edi
callq 0x10f0
movl $0x1, %edi
callq 0x10e0
// File: /workspace/github_cpp_makefile_star2_O1/7shi[P]8086run/v1/main.cpp
// Function: out(unsigned short, unsigned char)
void out(uint16_t n, uint8_t v) {
    switch (n) {
        case 0x0020: // PIC 8259 (master)
            // TODO
            break;
        case 0x0021: // PIC 8259 (master) - OCW1
            // TODO
            break;
        case 0x0042: // PIT 8254 - counter 2
            // TODO
            break;
        case 0x0043: // PIT 8254 - interval, beep
            // TODO
            break;
        case 0x0061: // PPI 8255 - port B
            break;
        default:
            error("not implemented: out %04x,%02x", n, v);
    }
    io[n] = v;
}

// Assembly:
leal -0x42(%rdi), %eax
cmpl $0x1f, %eax
ja 0x17d8
movl $0x80000003, %ecx       # imm = 0x80000003
btl %eax, %ecx
jb 0x17e2
movl %edi, %eax
addl $-0x20, %eax
cmpl $0x2, %eax
jae 0x17f1
movzwl %di, %eax
leaq 0x1179c4(%rip), %rcx    # 0x1191b0
movb %sil, (%rax,%rcx)
retq
pushq %rax
movzwl %di, %eax
movzbl %sil, %edx
leaq 0x5e83(%rip), %rdi      # 0x7683
movl %eax, %esi
xorl %eax, %eax
callq 0x16e5
// File: /workspace/github_cpp_makefile_star2_O1/7shi[P]8086run/v1/main.cpp
// Function: in(unsigned short)
uint8_t in(uint16_t n) {
    switch (n) {
        case 0x0020: // PIC 8259 (master)
            // TODO
            break;
        case 0x0021: // PIC 8259 (master) - IMR
            break;
        case 0x0040: // PIT 8254 - counter 0
            // TODO
            break;
        case 0x0061: // PPI 8255 - port B (beep)
            break;
        case 0x00a1: // PIC 8259 (slave) - IMR
            break;
        case 0x03da: // CRTC 6845 - status register
            return io[n] = !io[n];
        default:
            error("not implemented: in %04x", n);
    }
    return io[n];
}

// Assembly:
cmpl $0x60, %edi
jg 0x181d
leal -0x20(%rdi), %eax
cmpl $0x2, %eax
jb 0x1848
cmpl $0x40, %edi
je 0x1848
jmp 0x1856
cmpl $0x61, %edi
je 0x1848
cmpl $0xa1, %edi
je 0x1848
cmpl $0x3da, %edi            # imm = 0x3DA
jne 0x1856
movzwl %di, %ecx
leaq 0x117974(%rip), %rdx    # 0x1191b0
cmpb $0x0, (%rcx,%rdx)
sete %al
sete (%rcx,%rdx)
retq
movzwl %di, %eax
leaq 0x11795e(%rip), %rcx    # 0x1191b0
movb (%rax,%rcx), %al
retq
pushq %rax
movzwl %di, %esi
leaq 0x5e41(%rip), %rdi      # 0x76a2
xorl %eax, %eax
callq 0x16e5
// File: /workspace/github_cpp_makefile_star2_O1/7shi[P]8086run/v1/main.cpp
// Function: intr(int)
void intr(int n) {
    uint8_t *v = &mem[n << 2];
    uint16_t cs = read16(v + 2), ip = read16(v);
    if (!cs && ip < 0x20) return bios(ip);
    push(getf());
    IF = TF = 0;
    push(*CS);
    push(IP);
    CS = cs;
    IP = ip;
}

// Assembly:
shll $0x2, %edi
movslq %edi, %rdx
leaq 0x71f3(%rip), %rcx      # 0x91b0
movzwl 0x2(%rdx,%rcx), %eax
movzwl (%rdx,%rcx), %edi
testq %rax, %rax
jne 0x1fd5
cmpw $0x1f, %di
jbe 0x1868
movzbl 0x127234(%rip), %edx    # 0x129210
shll $0xb, %edx
movzbl 0x12722b(%rip), %esi    # 0x129211
shll $0xa, %esi
orl %edx, %esi
movzbl 0x127220(%rip), %edx    # 0x129212
shll $0x9, %edx
movzbl 0x127216(%rip), %r8d    # 0x129213
shll $0x8, %r8d
orl %edx, %r8d
orl %esi, %r8d
movzbl 0x127206(%rip), %edx    # 0x129214
shll $0x7, %edx
orl %r8d, %edx
movzbl 0x1271fa(%rip), %esi    # 0x129215
shll $0x6, %esi
orl %edx, %esi
movzbl 0x1271ef(%rip), %edx    # 0x129216
shll $0x4, %edx
movzbl 0x1271e5(%rip), %r8d    # 0x129217
shll $0x2, %r8d
orl %edx, %r8d
movzbl 0x1271d8(%rip), %edx    # 0x129218
orl %r8d, %edx
orl %esi, %edx
orl $0xf002, %edx           # imm = 0xF002
movl 0x127177(%rip), %esi    # 0x1291c8
addl $-0x2, %esi
movw %si, 0x12716d(%rip)     # 0x1291c8
movq 0x1272de(%rip), %r8     # 0x129340
movl $0xffff, %r9d           # imm = 0xFFFF
andl %r9d, %esi
movw %dx, (%r8,%rsi)
xorl %edx, %edx
movb %dl, 0x12719b(%rip)     # 0x129213
movb %dl, 0x127194(%rip)     # 0x129212
movzwl 0x1272b3(%rip), %edx    # 0x129338
movl 0x12713d(%rip), %esi    # 0x1291c8
addl $-0x2, %esi
movw %si, 0x127133(%rip)     # 0x1291c8
movq 0x1272a4(%rip), %r8     # 0x129340
andl %r9d, %esi
movw %dx, (%r8,%rsi)
movzwl 0x127105(%rip), %edx    # 0x1291b0
movl 0x127117(%rip), %esi    # 0x1291c8
addl $-0x2, %esi
movw %si, 0x12710d(%rip)     # 0x1291c8
movq 0x12727e(%rip), %r8     # 0x129340
andl %r9d, %esi
movw %dx, (%r8,%rsi)
movl %eax, %edx
shll $0x4, %edx
addq %rdx, %rcx
movq %rcx, 0x127257(%rip)    # 0x129330
movw %ax, 0x127258(%rip)     # 0x129338
movw %di, 0x1270c9(%rip)     # 0x1291b0
retq
// File: /workspace/github_cpp_makefile_star2_O1/7shi[P]8086run/v1/main.cpp
// Function: Operand::u() const
inline int u() const {
        if (type == Reg) return w ? r[v] : *r8[v];
        uint8_t *p = ptr();
        if (!p) return v;
        return w ? read16(p) : *p;
    }

// Assembly:
cmpl $0x0, (%rdi)
je 0x68cd
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x68e3
movslq 0x8(%rdi), %rcx
addq (%rax), %rcx
jmp 0x68e5
movslq 0x8(%rdi), %rax
cmpb $0x1, 0x4(%rdi)
jne 0x6901
leaq 0x1228e2(%rip), %rcx    # 0x1291c0
movzwl (%rcx,%rax,2), %eax
retq
xorl %ecx, %ecx
testq %rcx, %rcx
je 0x68fd
movzbl (%rcx), %eax
cmpb $0x1, 0x4(%rdi)
jne 0x68fc
movzbl 0x1(%rcx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
retq
movl 0x8(%rdi), %eax
retq
leaq 0x1228c8(%rip), %rcx    # 0x1291d0
movq (%rcx,%rax,8), %rax
movzbl (%rax), %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/7shi[P]8086run/v1/main.cpp
// Function: Operand::operator=(int)
inline void operator=(int value) {
        if (type == Reg) {
            if (w) {
                r[v] = value;
            } else {
                *r8[v] = value;
            }
            return;
        }
        uint8_t *p = ptr();
        if (p) {
            if (w) {
                write16(p, value);
            } else {
                *p = value;
            }
        }
    }

// Assembly:
movl %esi, %eax
cmpl $0x0, (%rdi)
je 0x5bb5
movq 0x10(%rdi), %rdx
testq %rdx, %rdx
je 0x5bcb
movslq 0x8(%rdi), %rcx
addq (%rdx), %rcx
jmp 0x5bcd
movslq 0x8(%rdi), %rcx
cmpb $0x1, 0x4(%rdi)
jne 0x5be0
leaq 0x1235fa(%rip), %rdx    # 0x1291c0
movw %ax, (%rdx,%rcx,2)
retq
xorl %ecx, %ecx
testq %rcx, %rcx
je 0x5bdf
movb 0x4(%rdi), %dl
movb %al, (%rcx)
cmpb $0x1, %dl
jne 0x5bdf
movb %ah, 0x1(%rcx)
retq
leaq 0x1235e9(%rip), %rdx    # 0x1291d0
movq (%rdx,%rcx,8), %rcx
movb %al, (%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O1/7shi[P]8086run/v1/main.cpp
// Function: Operand::modrm(unsigned char*, bool, SReg*)
inline size_t modrm(uint8_t *p, bool w, SReg *seg) {
        uint8_t b = p[1], mod = b >> 6, rm = b & 7;
        switch (mod) {
            case 0:
                if (rm == 6) {
                    set(Ptr, w, read16(p + 2), seg);
                    return 4;
                }
                set(ModRM + rm, w, 0, seg);
                return 2;
            case 1:
                set(ModRM + rm, w, (int8_t) p[2], seg);
                return 3;
            case 2:
                set(ModRM + rm, w, (int16_t) read16(p + 2), seg);
                return 4;
        }
        set(Reg, w, rm, NULL);
        return 2;
    }

// Assembly:
pushq %rax
movq %rcx, %r8
movzbl 0x1(%rsi), %eax
movl %eax, %ecx
shrl $0x6, %ecx
andl $0x7, %eax
leaq 0x18a9(%rip), %r9       # 0x7524
movslq (%r9,%rcx,4), %rcx
addq %r9, %rcx
jmpq *%rcx
cmpb $0x6, %al
jne 0x5d0d
testq %r8, %r8
leaq 0x1236ba(%rip), %rax    # 0x129350
cmovneq %r8, %rax
movzwl 0x2(%rsi), %ecx
movl $0x2, (%rdi)
movb %dl, 0x4(%rdi)
movq %rax, 0x10(%rdi)
movl %ecx, 0x8(%rdi)
jmp 0x5cd2
addl $0x3, %eax
movzbl %al, %eax
movzbl 0x2(%rsi), %r9d
movzbl 0x3(%rsi), %ecx
shll $0x8, %ecx
movswl %cx, %ecx
orl %r9d, %ecx
movzbl %dl, %edx
movl %eax, %esi
callq 0x5d24
movl $0x4, %eax
jmp 0x5d21
movzbl %al, %eax
movl $0x0, (%rdi)
movb %dl, 0x4(%rdi)
movq $0x0, 0x10(%rdi)
movl %eax, 0x8(%rdi)
jmp 0x5d1c
addl $0x3, %eax
movzbl %al, %eax
movsbl 0x2(%rsi), %ecx
movzbl %dl, %edx
movl %eax, %esi
callq 0x5d24
movl $0x3, %eax
jmp 0x5d21
addl $0x3, %eax
movzbl %dl, %edx
movl %eax, %esi
xorl %ecx, %ecx
callq 0x5d24
movl $0x2, %eax
popq %rcx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/7shi[P]8086run/v1/main.cpp
// Function: Operand::set(int, bool, int, SReg*)
inline void set(int type, bool w, int v, SReg *seg) {
        this->type = type;
        this->w = w;
        switch (type) {
            case Ptr:
                this->seg = seg ? seg : &DS;
                this->v = uint16_t(v);
                break;
            case ModRM + 0:
                this->seg = seg ? seg : &DS;
                this->v = uint16_t(BX + SI + v);
                break;
            case ModRM + 1:
                this->seg = seg ? seg : &DS;
                this->v = uint16_t(BX + DI + v);
                break;
            case ModRM + 2:
                this->seg = seg ? seg : &SS;
                this->v = uint16_t(BP + SI + v);
                break;
            case ModRM + 3:
                this->seg = seg ? seg : &SS;
                this->v = uint16_t(BP + DI + v);
                break;
            case ModRM + 4:
                this->seg = seg ? seg : &DS;
                this->v = uint16_t(SI + v);
                break;
            case ModRM + 5:
                this->seg = seg ? seg : &DS;
                this->v = uint16_t(DI + v);
                break;
            case ModRM + 6:
                this->seg = seg ? seg : &SS;
                this->v = uint16_t(BP + v);
                break;
            case ModRM + 7:
                this->seg = seg ? seg : &DS;
                this->v = uint16_t(BX + v);
                break;
            default:
                this->seg = NULL;
                this->v = v;
                break;
        }
    }

// Assembly:
movl %esi, (%rdi)
movb %dl, 0x4(%rdi)
addl $-0x2, %esi
cmpl $0x8, %esi
ja 0x5e3c
leaq 0x17f8(%rip), %rax      # 0x7534
movslq (%rax,%rsi,4), %rdx
addq %rax, %rdx
jmpq *%rdx
testq %r8, %r8
leaq 0x123601(%rip), %rax    # 0x129350
cmovneq %r8, %rax
movq %rax, 0x10(%rdi)
jmp 0x5e35
testq %r8, %r8
leaq 0x1235da(%rip), %rax    # 0x129340
cmovneq %r8, %rax
movq %rax, 0x10(%rdi)
addw 0x123455(%rip), %cx     # 0x1291ca
jmp 0x5e13
testq %r8, %r8
leaq 0x1235cc(%rip), %rax    # 0x129350
cmovneq %r8, %rax
movq %rax, 0x10(%rdi)
addw 0x123433(%rip), %cx     # 0x1291c6
jmp 0x5e13
testq %r8, %r8
leaq 0x1235a1(%rip), %rax    # 0x129340
cmovneq %r8, %rax
movq %rax, 0x10(%rdi)
addw 0x12341c(%rip), %cx     # 0x1291ca
jmp 0x5df8
testq %r8, %r8
leaq 0x123586(%rip), %rax    # 0x129340
cmovneq %r8, %rax
movq %rax, 0x10(%rdi)
addw 0x123401(%rip), %cx     # 0x1291ca
jmp 0x5e35
testq %r8, %r8
leaq 0x12357b(%rip), %rax    # 0x129350
cmovneq %r8, %rax
movq %rax, 0x10(%rdi)
addw 0x1233e2(%rip), %cx     # 0x1291c6
jmp 0x5df8
testq %r8, %r8
leaq 0x123560(%rip), %rax    # 0x129350
cmovneq %r8, %rax
movq %rax, 0x10(%rdi)
addw 0x1233cd(%rip), %cx     # 0x1291cc
jmp 0x5e35
testq %r8, %r8
leaq 0x123545(%rip), %rax    # 0x129350
cmovneq %r8, %rax
movq %rax, 0x10(%rdi)
addw 0x1233b4(%rip), %cx     # 0x1291ce
jmp 0x5e35
testq %r8, %r8
leaq 0x12352a(%rip), %rax    # 0x129350
cmovneq %r8, %rax
movq %rax, 0x10(%rdi)
addw 0x123391(%rip), %cx     # 0x1291c6
movzwl %cx, %ecx
movl %ecx, 0x8(%rdi)
retq
movq $0x0, 0x10(%rdi)
jmp 0x5e38
// File: /workspace/github_cpp_makefile_star2_O1/7shi[P]8086run/v1/main.cpp
// Function: Operand::regrm(Operand*, unsigned char*, bool, bool, SReg*)
inline size_t regrm(Operand *opr, uint8_t *p, bool dir, bool w, SReg *seg) {
        if (dir) {
            set(Reg, w, (p[1] >> 3) & 7, NULL);
            return opr->modrm(p, w, seg);
        }
        opr->set(Reg, w, (p[1] >> 3) & 7, NULL);
        return modrm(p, w, seg);
    }

// Assembly:
pushq %rax
movzbl 0x1(%rdx), %eax
shrl $0x3, %eax
andl $0x7, %eax
testl %ecx, %ecx
je 0x5eb6
movl $0x0, (%rdi)
movb %r8b, 0x4(%rdi)
movq $0x0, 0x10(%rdi)
movl %eax, 0x8(%rdi)
movzbl 0x1(%rdx), %eax
movl %eax, %ecx
shrl $0x6, %ecx
andl $0x7, %eax
leaq 0x16eb(%rip), %rdi      # 0x7568
movslq (%rdi,%rcx,4), %rcx
addq %rdi, %rcx
jmpq *%rcx
cmpb $0x6, %al
jne 0x5fca
testq %r9, %r9
leaq 0x1234b8(%rip), %rax    # 0x129350
cmovneq %r9, %rax
movzwl 0x2(%rdx), %ecx
movl $0x2, (%rsi)
movb %r8b, 0x4(%rsi)
movq %rax, 0x10(%rsi)
movl %ecx, 0x8(%rsi)
jmp 0x5f59
movl $0x0, (%rsi)
movb %r8b, 0x4(%rsi)
movq $0x0, 0x10(%rsi)
movl %eax, 0x8(%rsi)
movzbl 0x1(%rdx), %esi
movl %esi, %eax
shrl $0x6, %eax
andl $0x7, %esi
leaq 0x167a(%rip), %rcx      # 0x7558
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpb $0x6, %sil
jne 0x5fd8
testq %r9, %r9
leaq 0x123455(%rip), %rax    # 0x129350
cmovneq %r9, %rax
movzwl 0x2(%rdx), %ecx
movl $0x2, (%rdi)
movb %r8b, 0x4(%rdi)
movq %rax, 0x10(%rdi)
movl %ecx, 0x8(%rdi)
jmp 0x5f59
addl $0x3, %eax
movzbl %al, %eax
movzbl 0x2(%rdx), %edi
movzbl 0x3(%rdx), %ecx
shll $0x8, %ecx
movswl %cx, %ecx
orl %edi, %ecx
movzbl %r8b, %edx
movq %rsi, %rdi
movl %eax, %esi
jmp 0x5f51
leal 0x3(%rsi), %eax
movzbl %al, %esi
movzbl 0x2(%rdx), %eax
movzbl 0x3(%rdx), %ecx
shll $0x8, %ecx
movswl %cx, %ecx
orl %eax, %ecx
movzbl %r8b, %edx
movq %r9, %r8
callq 0x5d24
movl $0x4, %eax
jmp 0x5fee
movzbl %al, %eax
movl $0x0, (%rsi)
movb %r8b, 0x4(%rsi)
movq $0x0, 0x10(%rsi)
movl %eax, 0x8(%rsi)
jmp 0x5fe9
movzbl %sil, %eax
movl $0x0, (%rdi)
movb %r8b, 0x4(%rdi)
movq $0x0, 0x10(%rdi)
movl %eax, 0x8(%rdi)
jmp 0x5fe9
addl $0x3, %eax
movzbl %al, %eax
movsbl 0x2(%rdx), %ecx
movzbl %r8b, %edx
movq %rsi, %rdi
movl %eax, %esi
jmp 0x5fbb
leal 0x3(%rsi), %eax
movzbl %al, %esi
movsbl 0x2(%rdx), %ecx
movzbl %r8b, %edx
movq %r9, %r8
callq 0x5d24
movl $0x3, %eax
jmp 0x5fee
addl $0x3, %eax
movzbl %r8b, %edx
movq %rsi, %rdi
movl %eax, %esi
jmp 0x5fdf
addl $0x3, %esi
movzbl %r8b, %edx
xorl %ecx, %ecx
movq %r9, %r8
callq 0x5d24
movl $0x2, %eax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O1/7shi[P]8086run/v1/main.cpp
// Function: setf(unsigned short)
inline void setf(uint16_t flags) {
    CF = flags & 0x001;
    PF = flags & 0x004;
    AF = flags & 0x010;
    ZF = flags & 0x040;
    SF = flags & 0x080;
    TF = flags & 0x100;
    IF = flags & 0x200;
    DF = flags & 0x400;
    OF = flags & 0x800;
}

// Assembly:
movl %edi, %eax
andb $0x1, %al
movb %al, 0x12321e(%rip)     # 0x129218
movl %edi, %eax
shrb $0x2, %al
andb $0x1, %al
movb %al, 0x123210(%rip)     # 0x129217
movl %edi, %eax
shrb $0x4, %al
andb $0x1, %al
movb %al, 0x123202(%rip)     # 0x129216
movl %edi, %eax
shrb $0x6, %al
andb $0x1, %al
movb %al, 0x1231f4(%rip)     # 0x129215
movl %edi, %eax
shrb $0x7, %al
movb %al, 0x1231e8(%rip)     # 0x129214
movl %edi, %eax
shrl $0x8, %eax
andb $0x1, %al
movb %al, 0x1231da(%rip)     # 0x129213
movl %edi, %eax
shrl $0x9, %eax
andb $0x1, %al
movb %al, 0x1231cc(%rip)     # 0x129212
movl %edi, %eax
shrl $0xa, %eax
andb $0x1, %al
movb %al, 0x1231be(%rip)     # 0x129211
shrl $0xb, %edi
andb $0x1, %dil
movb %dil, 0x1231af(%rip)    # 0x129210
retq
// File: /workspace/github_cpp_makefile_star2_O1/7shi[P]8086run/v1/main.cpp
// Function: Disk::open(char const*)
bool open(const char *img) {
        if (!(f = fopen(img, "r+b"))) return false;
        struct stat st;
        fstat(fileno(f), &st);
        switch (st.st_size / 1024) {
            case 360: // 2D
                type = 1, c = 40, h = 2, s = 9;
                break;
            case 720: // 2DD
                type = 3, c = 80, h = 2, s = 9;
                break;
            default: // 2HD
                type = 4, c = 80, h = 2, s = 18;
                break;
        }
        return true;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x90, %rsp
movq %rsi, %rax
movq %rdi, %rbx
leaq 0xe18(%rip), %rsi       # 0x7741
movq %rax, %rdi
callq 0x10d0
movq %rax, %r14
movq %rax, (%rbx)
testq %rax, %rax
je 0x69b5
movq %r14, %rdi
callq 0x10a0
movq %rsp, %r15
movl %eax, %edi
movq %r15, %rsi
callq 0x1160
movq 0x30(%r15), %rax
leaq 0x3ff(%rax), %rcx
testq %rax, %rax
cmovnsq %rax, %rcx
sarq $0xa, %rcx
movl $0x9, %eax
cmpq $0x168, %rcx            # imm = 0x168
je 0x698a
cmpq $0x2d0, %rcx            # imm = 0x2D0
jne 0x6996
movl $0x50, %ecx
movl $0x3, %edx
jmp 0x69a5
movl $0x28, %ecx
movl $0x1, %edx
jmp 0x69a5
movl $0x12, %eax
movl $0x50, %ecx
movl $0x4, %edx
movl %edx, 0x8(%rbx)
movl %ecx, 0xc(%rbx)
movl $0x2, 0x10(%rbx)
movl %eax, 0x14(%rbx)
testq %r14, %r14
setne %al
addq $0x90, %rsp
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax,%rax)
// File: /workspace/github_cpp_makefile_star2_O1/liujan[P]randomforest/Node.cpp
// Function: Node::Node()
Node::Node(){
    left = NULL;
    right = NULL;
    sum = 0;
    memset(num, 0, sizeof(num));
    attribute = 0;
    value = 0;
    depth = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x0, (%rdi)
addq $0x8, %rdi
movl $0xa0, %edx
xorl %esi, %esi
popq %rbp
jmp 0x20f0
nop
// File: /workspace/github_cpp_makefile_star2_O1/liujan[P]randomforest/Node.cpp
// Function: Node::Node(Node const&)
Node::Node(const Node &other){
    this->attribute = other.attribute;
    this->value = other.value;
    this->left = other.left;
    this->right = other.right;
    this->sum = other.sum;
    this->samples = other.samples;
    this->depth = other.depth;
    for (int i = 0; i < numOfTypes; i++)
        this->num[i] = other.num[i];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x90, %esi
leaq (%rdi,%rsi), %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x90(%rdi)
movq $0x0, 0xa0(%rdi)
movl (%rbx), %eax
movl %eax, (%rdi)
movsd 0x8(%rbx), %xmm0
movsd %xmm0, 0x8(%rdi)
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rdi)
movq 0x18(%rbx), %rax
movq %rax, 0x18(%rdi)
movl 0x20(%rbx), %eax
movl %eax, 0x20(%rdi)
addq %rbx, %rsi
movq %r15, %rdi
callq 0x25c4
movl 0x8c(%rbx), %eax
movl %eax, 0x8c(%r14)
xorl %eax, %eax
movl 0x24(%rbx,%rax,4), %ecx
movl %ecx, 0x24(%r14,%rax,4)
incq %rax
cmpq $0x1a, %rax
jne 0x2594
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r15, %rdi
callq 0x275a
movq %rbx, %rdi
callq 0x2290
// File: /workspace/github_cpp_makefile_star2_O1/liujan[P]randomforest/Tree.cpp
// Function: Tree::readSample(std::vector<std::pair<int, std::vector<double, std::allocator<double>>>, std::allocator<std::pair<int, std::vector<double, std::allocator<double>>>>>)
bool Tree::readSample(vector<pair<int, vector<double> > > all_samples){
    if (all_samples.empty()){
        cout << "[Error] all sample is empty!" << endl;
        return false;
    }
    
    if (root == NULL)
        root = new Node();
    
    double p = 0.0;
    for (int i = 0; i < all_samples.size(); i++){
        p = rand() * 1.0 / RAND_MAX;
        if (p <= 0.6) {  //每棵树用总样本的60%来训练
            root->samples.push_back(all_samples[i]);
            int type = all_samples[i].first;
            root->num[type - 1]++;
        }
    }
    root->sum = root->samples.size();

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq (%rsi), %r12
movq 0x8(%rsi), %r13
cmpq %r13, %r12
je 0x2c34
movq %rsi, %r14
movq %rdi, %rbx
cmpq $0x0, (%rdi)
jne 0x2b9d
movl $0xa8, %edi
callq 0x21a0
movq %rax, %r15
movq %rax, %rdi
callq 0x250c
movq %r15, (%rbx)
movq %r13, -0x30(%rbp)
movq %r12, -0x38(%rbp)
movq 0x8(%r14), %rax
cmpq (%r14), %rax
je 0x2c12
xorl %r15d, %r15d
movl $0x90, %r12d
xorl %r13d, %r13d
callq 0x2080
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x443a(%rip), %xmm0     # 0x7008
movsd 0x443a(%rip), %xmm1     # 0x7010
ucomisd %xmm0, %xmm1
jb 0x2bfb
movq (%rbx), %rdi
addq %r12, %rdi
movq (%r14), %rsi
addq %r15, %rsi
callq 0x395c
movq (%r14), %rax
movslq (%rax,%r15), %rax
movq (%rbx), %rcx
incl 0x20(%rcx,%rax,4)
movq 0x8(%r14), %rax
subq (%r14), %rax
incq %r13
sarq $0x5, %rax
addq $0x20, %r15
cmpq %r13, %rax
ja 0x2bba
movq (%rbx), %rax
movq 0x98(%rax), %rcx
subq 0x90(%rax), %rcx
shrq $0x5, %rcx
movl %ecx, 0x20(%rax)
movq -0x38(%rbp), %r12
movq -0x30(%rbp), %r13
jmp 0x2c76
movq 0x739d(%rip), %rbx      # 0x9fd8
leaq 0x441e(%rip), %rsi      # 0x7060
movl $0x1c, %edx
movq %rbx, %rdi
callq 0x21e0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
cmpq %r13, %r12
setne %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0xa8, %esi
movq %r15, %rdi
callq 0x21b0
movq %rbx, %rdi
callq 0x2290
nop
// File: /workspace/github_cpp_makefile_star2_O1/liujan[P]randomforest/Tree.cpp
// Function: getType(Node*)
int getType(Node *node){
    if (node == NULL)
        return 0;
    int max_value = -1000, index = 0;
    for (int i = 0; i < numOfTypes; i++){
        if (max_value <= node->num[i]){
            max_value = node->num[i];
            index = i + 1;
        }
    }
    return index;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x3600
movl $0xfffffc18, %ecx       # imm = 0xFFFFFC18
xorl %edx, %edx
xorl %eax, %eax
movl 0x24(%rdi,%rdx,4), %esi
incq %rdx
cmpl %esi, %ecx
cmovlel %esi, %ecx
cmovlel %edx, %eax
cmpq $0x1a, %rdx
jne 0x35e9
jmp 0x3602
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/liujan[P]randomforest/Tree.cpp
// Function: Tree::predict(std::vector<double, std::allocator<double>>)
int Tree::predict(vector<double> features){
    if (root == NULL){
        cout << "[Error] empty tree" << endl;
        return 0;
    }
    Node *head = root;
    while (true) {
        if (head->left == NULL && head->right == NULL){
            return getType(head);
        }
        int attr = head->attribute;
        double value = head->value;
        if (features[attr] < value){
            if (head->left == NULL)
                return getType(head);
            else
                head = head->left;
        }
        else {
            if (head->right == NULL)
                return getType(head);
            else
                head = head->right;
        }
    }
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq (%rdi), %rcx
testq %rcx, %rcx
je 0x36b6
movq 0x10(%rcx), %rdx
testq %rdx, %rdx
jne 0x362a
cmpq $0x0, 0x18(%rcx)
je 0x36fc
movslq (%rcx), %rdi
movsd 0x8(%rcx), %xmm0
movq (%rsi), %r8
ucomisd (%r8,%rdi,8), %xmm0
jbe 0x366f
movb $0x1, %dil
testq %rdx, %rdx
jne 0x36a8
movl $0xfffffc18, %edx       # imm = 0xFFFFFC18
xorl %eax, %eax
movl $0x9, %edi
movl (%rcx,%rdi,4), %r8d
leal -0x8(%rdi), %r9d
cmpl %r8d, %edx
cmovlel %r8d, %edx
cmovlel %r9d, %eax
incq %rdi
cmpq $0x23, %rdi
jne 0x3651
jmp 0x36a3
movq 0x18(%rcx), %rdx
movb $0x1, %dil
testq %rdx, %rdx
jne 0x36a8
movl $0xfffffc18, %edx       # imm = 0xFFFFFC18
xorl %eax, %eax
movl $0x9, %edi
movl (%rcx,%rdi,4), %r8d
leal -0x8(%rdi), %r9d
cmpl %r8d, %edx
cmovlel %r8d, %edx
cmovlel %r9d, %eax
incq %rdi
cmpq $0x23, %rdi
jne 0x3687
xorl %edi, %edi
movq %rcx, %rdx
movq %rdx, %rcx
testb %dil, %dil
jne 0x3616
jmp 0x371a
movq 0x691b(%rip), %rbx      # 0x9fd8
leaq 0x39e3(%rip), %rsi      # 0x70a7
movl $0x12, %edx
movq %rbx, %rdi
callq 0x21e0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
xorl %eax, %eax
jmp 0x371a
movl $0xfffffc18, %edx       # imm = 0xFFFFFC18
xorl %esi, %esi
xorl %eax, %eax
movl 0x24(%rcx,%rsi,4), %edi
incq %rsi
cmpl %edi, %edx
cmovlel %edi, %edx
cmovlel %esi, %eax
cmpq $0x1a, %rsi
jne 0x3705
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/liujan[P]randomforest/Tree.cpp
// Function: Tree::randomSelect()
vector<int> Tree::randomSelect(){
    vector<int> v;
    for (int i = 0; i < numOfFeatures; i++){
        double p = rand() * 1.0 / RAND_MAX;
        if (p <= 0.6)
            v.push_back(i);
    }
    return v;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
xorpd %xmm0, %xmm0
movupd %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq -0x14(%rbp), %r14
movl $0x0, (%r14)
callq 0x2080
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x38a9(%rip), %xmm0     # 0x7008
movsd 0x38a9(%rip), %xmm1     # 0x7010
ucomisd %xmm0, %xmm1
jb 0x3791
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x3786
movl -0x14(%rbp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x3791
movq %rbx, %rdi
movq %r14, %rdx
callq 0x4c40
movl -0x14(%rbp), %eax
leal 0x1(%rax), %ecx
movl %ecx, -0x14(%rbp)
cmpl $0x268, %eax            # imm = 0x268
jl 0x374b
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x37c4
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x21b0
movq %r14, %rdi
callq 0x2290
// File: /workspace/github_cpp_makefile_star2_O1/liujan[P]randomforest/Tree.cpp
// Function: Tree::~Tree()
Tree::~Tree(){
    Node *head = root;
    queue<Node*>q;
    q.push(head);
    while(!q.empty()){
        head = q.front();
        q.pop();
        if (head == NULL)
            continue;
        Node *left = head->left;
        Node *right = head->right;
        delete head;
        q.push(left);
        q.push(right);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x70, %rsp
movq (%rdi), %rax
movq %rax, -0x28(%rbp)
xorps %xmm0, %xmm0
leaq -0x90(%rbp), %rdi
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
xorl %esi, %esi
callq 0x3f78
movq -0x60(%rbp), %rax
movq -0x50(%rbp), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x3825
movq -0x28(%rbp), %rcx
movq %rcx, (%rax)
addq $0x8, -0x60(%rbp)
jmp 0x3835
leaq -0x90(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x4100
movq -0x80(%rbp), %rax
cmpq %rax, -0x60(%rbp)
je 0x3938
leaq -0x90(%rbp), %rbx
leaq -0x38(%rbp), %r14
leaq -0x30(%rbp), %r15
movq (%rax), %rcx
movq %rcx, -0x28(%rbp)
movq -0x70(%rbp), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x386c
addq $0x8, %rax
jmp 0x3899
movq -0x78(%rbp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x21b0
movq -0x68(%rbp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, -0x68(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x78(%rbp)
leaq 0x200(%rax), %rcx
movq %rcx, -0x70(%rbp)
movq %rax, -0x80(%rbp)
movq -0x28(%rbp), %r12
testq %r12, %r12
je 0x392a
movq 0x10(%r12), %rax
movq %rax, -0x38(%rbp)
movq 0x18(%r12), %rax
movq %rax, -0x30(%rbp)
leaq 0x90(%r12), %rdi
callq 0x275a
movl $0xa8, %esi
movq %r12, %rdi
callq 0x21b0
movq -0x60(%rbp), %rax
movq -0x50(%rbp), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x38f5
movq -0x38(%rbp), %rcx
movq %rcx, (%rax)
addq $0x8, -0x60(%rbp)
jmp 0x3900
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4100
movq -0x60(%rbp), %rax
movq -0x50(%rbp), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x391f
movq -0x30(%rbp), %rcx
movq %rcx, (%rax)
addq $0x8, -0x60(%rbp)
jmp 0x392a
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4100
movq -0x80(%rbp), %rax
cmpq %rax, -0x60(%rbp)
jne 0x3852
leaq -0x90(%rbp), %rdi
callq 0x3ba4
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3953
movq %rax, %rdi
callq 0x27b7
nop
// File: /workspace/github_cpp_makefile_star2_O1/liujan[P]randomforest/RandomForest.cpp
// Function: RandomForest::build()
void RandomForest::build(){
    if (test_samples.empty()){
        cout << "[Error] test sample is empty" << endl;
        return;
    }
    Tree *tree = new Tree();
    if (tree->readSample(this->all_samples)){
        tree->buildTree();
        for (int j = 0; j < test_samples.size(); j++){
            int id = test_samples[j].first;
            int type = tree->predict(test_samples[j].second);
            result[id][type]++;
        }
    }
    delete tree;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq 0x18(%rdi), %rax
movq %rdi, -0x30(%rbp)
cmpq 0x20(%rdi), %rax
je 0x4eb0
movl $0x8, %edi
callq 0x21a0
movq %rax, %r12
movq %rax, %rdi
callq 0x2b18
leaq -0x68(%rbp), %r15
movq %r15, %rdi
movq -0x30(%rbp), %rsi
callq 0x39a4
movq %r12, %rdi
movq %r15, %rsi
callq 0x2b58
movl %eax, %r15d
leaq -0x68(%rbp), %rdi
callq 0x275a
testb %r15b, %r15b
je 0x4e8c
movq %r12, %rdi
callq 0x2ca4
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rsi
cmpq %rsi, 0x20(%rax)
je 0x4e8c
movq -0x30(%rbp), %rax
addq $0x48, %rax
movq %rax, -0x38(%rbp)
movl $0x8, %ebx
xorl %r13d, %r13d
movslq -0x8(%rsi,%rbx), %r15
addq %rbx, %rsi
leaq -0x50(%rbp), %rdi
callq 0x2918
movq %r12, %r14
movq %r12, %rdi
leaq -0x50(%rbp), %rsi
callq 0x3604
movl %eax, %r12d
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x4e5c
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x21b0
movslq %r12d, %rax
imulq $0x6c, %r15, %rcx
addq -0x38(%rbp), %rcx
incl (%rcx,%rax,4)
incq %r13
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rsi
movq 0x20(%rax), %rax
subq %rsi, %rax
sarq $0x5, %rax
addq $0x20, %rbx
cmpq %r13, %rax
movq %r14, %r12
ja 0x4e24
movq %r12, %rdi
callq 0x37cc
movl $0x8, %esi
movq %r12, %rdi
callq 0x21b0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x5121(%rip), %rbx      # 0x9fd8
leaq 0x2262(%rip), %rsi      # 0x7120
movl $0x1c, %edx
movq %rbx, %rdi
callq 0x21e0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2120
movq %rax, %r14
leaq -0x68(%rbp), %rdi
callq 0x275a
jmp 0x4f33
movq %rax, %r14
movl $0x8, %esi
movq %r12, %rdi
jmp 0x4f2e
movq %rax, %r14
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x4f33
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x21b0
movq %r14, %rdi
callq 0x2290
nop
// File: /workspace/github_cpp_makefile_star2_O1/liujan[P]randomforest/RandomForest.cpp
// Function: RandomForest::buildTree(int)
bool RandomForest::buildTree(int num){
    if (all_samples.empty()){
        cout << "[Error] all sample is empty" << endl;
        return false;
    }
    
    for (int i = 0; i < num; i++){
        cout << i+1 << " ";
        this->build();
    }
    
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
movq %rax, -0x38(%rbp)
movq %rcx, -0x30(%rbp)
cmpq %rcx, %rax
je 0x4fbc
movl %esi, %ebx
testl %esi, %esi
jle 0x4ffe
movq %rdi, %r14
negl %ebx
movl $0x1, %r13d
movq 0x505b(%rip), %r15      # 0x9fd8
leaq 0x2252(%rip), %r12      # 0x71d6
movq %r15, %rdi
movl %r13d, %esi
callq 0x2280
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x21e0
movq %r14, %rdi
callq 0x4d92
leal (%rbx,%r13), %eax
incl %eax
movl %r13d, %ecx
incl %ecx
movl %ecx, %r13d
cmpl $0x1, %eax
jne 0x4f84
jmp 0x4ffe
movq 0x5015(%rip), %rbx      # 0x9fd8
leaq 0x2173(%rip), %rsi      # 0x713d
movl $0x1b, %edx
movq %rbx, %rdi
callq 0x21e0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
movq -0x30(%rbp), %rax
cmpq %rax, -0x38(%rbp)
setne %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/liujan[P]randomforest/main.cpp
// Function: fun()
void fun(){
    ifstream in("train.csv");
    ofstream out("train1.csv");
    
    string s;
    getline(in, s);
    out << s << endl;
    while (1){
        if (in.eof())
            break;
        getline(in, s);
        double p = rand() * 1.0 / RAND_MAX;
        if (p <= 0.1)
            out << s << endl;
        if (in.peek() == '\n')
            in.get();
    }
    in.close();
    out.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x428, %rsp            # imm = 0x428
leaq 0x14cc(%rip), %rsi      # 0x71af
leaq -0x250(%rbp), %rbx
movq %rbx, %rdi
movl $0x8, %edx
callq 0x22b0
leaq 0x1552(%rip), %rsi      # 0x7250
leaq -0x450(%rbp), %rdi
movl $0x10, %edx
callq 0x21d0
leaq -0x38(%rbp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
movq -0x250(%rbp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %edx
leaq -0x250(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x22c0
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
leaq -0x450(%rbp), %rdi
callq 0x21e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
movq -0x250(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x2, -0x230(%rbp,%rax)
jne 0x5e6c
leaq (%rax,%rbp), %rdi
addq $-0x250, %rdi           # imm = 0xFDB0
leaq -0x250(%rbp), %rbx
leaq -0x48(%rbp), %r14
leaq -0x450(%rbp), %r15
movl $0xa, %esi
callq 0x2190
movsbl %al, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x22c0
callq 0x2080
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x1219(%rip), %xmm0     # 0x7008
movsd 0x1451(%rip), %xmm1     # 0x7248
ucomisd %xmm0, %xmm1
jb 0x5e37
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %r15, %rdi
callq 0x21e0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
movq %rbx, %rdi
callq 0x20c0
cmpl $0xa, %eax
jne 0x5e4c
movq %rbx, %rdi
callq 0x2200
movq -0x250(%rbp), %rax
movq -0x18(%rax), %rax
leaq (%rax,%rbp), %rdi
addq $-0x250, %rdi           # imm = 0xFDB0
testb $0x2, 0x20(%rdi)
je 0x5dc3
leaq -0x250(%rbp), %rdi
callq 0x2050
leaq -0x450(%rbp), %rdi
callq 0x2220
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x5e99
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21b0
movq 0x4130(%rip), %rax      # 0x9fd0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x448(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x450(%rbp,%rcx)
callq 0x2170
leaq -0x358(%rbp), %rdi
callq 0x20a0
leaq -0x250(%rbp), %rdi
callq 0x2070
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x5f1a
jmp 0x5ef6
jmp 0x5ef6
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x5f0e
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21b0
leaq -0x450(%rbp), %rdi
callq 0x2240
leaq -0x250(%rbp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x2290