LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/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 0x17b5
movl $0x80000003, %ecx       # imm = 0x80000003
btl %eax, %ecx
jb 0x17bf
movl %edi, %eax
addl $-0x20, %eax
cmpl $0x2, %eax
jae 0x17ce
movzwl %di, %eax
leaq 0x1189e7(%rip), %rcx    # 0x11a1b0
movb %sil, (%rax,%rcx)
retq
pushq %rax
movzwl %di, %eax
movzbl %sil, %edx
leaq 0x5f0e(%rip), %rdi      # 0x76eb
movl %eax, %esi
xorl %eax, %eax
callq 0x16c2
// File: /workspace/github_cpp_makefile_star2_O3/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 0x17fa
leal -0x20(%rdi), %eax
cmpl $0x2, %eax
jb 0x1821
cmpl $0x40, %edi
je 0x1821
jmp 0x182f
cmpl $0x61, %edi
je 0x1821
cmpl $0xa1, %edi
je 0x1821
cmpl $0x3da, %edi            # imm = 0x3DA
jne 0x182f
cmpb $0x0, 0x118d74(%rip)    # 0x11a58a
sete %al
sete 0x118d6a(%rip)          # 0x11a58a
retq
movzwl %di, %eax
leaq 0x118985(%rip), %rcx    # 0x11a1b0
movb (%rax,%rcx), %al
retq
pushq %rax
movzwl %di, %esi
leaq 0x5ed0(%rip), %rdi      # 0x770a
xorl %eax, %eax
callq 0x16c2
// File: /workspace/github_cpp_makefile_star2_O3/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 0x822a(%rip), %rcx      # 0xa1b0
movzwl 0x2(%rdx,%rcx), %eax
testq %rax, %rax
setne %sil
movzwl (%rdx,%rcx), %edi
cmpl $0x20, %edi
setae %dl
orb %sil, %dl
je 0x1841
movzbl 0x128264(%rip), %edx    # 0x12a210
shll $0xb, %edx
movzbl 0x12825b(%rip), %esi    # 0x12a211
shll $0xa, %esi
orl %edx, %esi
movzbl 0x128250(%rip), %edx    # 0x12a212
shll $0x9, %edx
movzbl 0x128246(%rip), %r8d    # 0x12a213
shll $0x8, %r8d
orl %edx, %r8d
orl %esi, %r8d
movzbl 0x128236(%rip), %edx    # 0x12a214
shll $0x7, %edx
orl %r8d, %edx
movzbl 0x12822a(%rip), %esi    # 0x12a215
shll $0x6, %esi
orl %edx, %esi
movzbl 0x12821f(%rip), %edx    # 0x12a216
shll $0x4, %edx
movzbl 0x128215(%rip), %r8d    # 0x12a217
shll $0x2, %r8d
orl %edx, %r8d
movzbl 0x128208(%rip), %edx    # 0x12a218
orl %r8d, %edx
orl %esi, %edx
orl $0xf002, %edx           # imm = 0xF002
movl 0x1281a7(%rip), %esi    # 0x12a1c8
addl $-0x2, %esi
movw %si, 0x12819d(%rip)     # 0x12a1c8
movq 0x12830e(%rip), %r8     # 0x12a340
movl $0xffff, %r9d           # imm = 0xFFFF
andl %r9d, %esi
movw %dx, (%r8,%rsi)
xorl %edx, %edx
movb %dl, 0x1281cb(%rip)     # 0x12a213
movb %dl, 0x1281c4(%rip)     # 0x12a212
movzwl 0x1282e3(%rip), %edx    # 0x12a338
movl 0x12816d(%rip), %esi    # 0x12a1c8
addl $-0x2, %esi
movw %si, 0x128163(%rip)     # 0x12a1c8
movq 0x1282d4(%rip), %r8     # 0x12a340
andl %r9d, %esi
movw %dx, (%r8,%rsi)
movzwl 0x128135(%rip), %edx    # 0x12a1b0
movl 0x128147(%rip), %esi    # 0x12a1c8
addl $-0x2, %esi
movw %si, 0x12813d(%rip)     # 0x12a1c8
movq 0x1282ae(%rip), %r8     # 0x12a340
andl %r9d, %esi
movw %dx, (%r8,%rsi)
movl %eax, %edx
shll $0x4, %edx
addq %rdx, %rcx
movq %rcx, 0x128287(%rip)    # 0x12a330
movw %ax, 0x128288(%rip)     # 0x12a338
movw %di, 0x1280f9(%rip)     # 0x12a1b0
retq
// File: /workspace/github_cpp_makefile_star2_O3/7shi[P]8086run/v1/main.cpp
// Function: Operand::operator*() 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)
movl 0x8(%rdi), %eax
movslq %eax, %rcx
je 0x5e0c
movq 0x10(%rdi), %rdx
testq %rdx, %rdx
je 0x5e33
movq (%rdx), %rdx
testq %rdx, %rdx
je 0x5e33
cmpb $0x1, 0x4(%rdi)
jne 0x5e2f
movzwl (%rdx,%rcx), %eax
jmp 0x5e33
cmpb $0x1, 0x4(%rdi)
jne 0x5e1f
leaq 0x1243a7(%rip), %rax    # 0x12a1c0
movzwl (%rax,%rcx,2), %eax
jmp 0x5e33
leaq 0x1243aa(%rip), %rax    # 0x12a1d0
movq (%rax,%rcx,8), %rax
movzbl (%rax), %eax
jmp 0x5e33
movzbl (%rdx,%rcx), %eax
movswl %ax, %ecx
cmpb $0x0, 0x4(%rdi)
movsbl %al, %eax
cmovnel %ecx, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x5f26
movq 0x10(%rdi), %rcx
testq %rcx, %rcx
je 0x5f25
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x5f25
movslq 0x8(%rdi), %rdx
movb 0x4(%rdi), %sil
movb %al, (%rcx,%rdx)
cmpb $0x1, %sil
jne 0x5f25
movb %ah, 0x1(%rcx,%rdx)
retq
movslq 0x8(%rdi), %rcx
cmpb $0x1, 0x4(%rdi)
jne 0x5f3c
leaq 0x124289(%rip), %rdx    # 0x12a1c0
movw %ax, (%rdx,%rcx,2)
retq
leaq 0x12428d(%rip), %rdx    # 0x12a1d0
movq (%rdx,%rcx,8), %rcx
movb %al, (%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x154b(%rip), %r9       # 0x7514
movslq (%r9,%rcx,4), %rcx
addq %r9, %rcx
jmpq *%rcx
cmpb $0x6, %al
jne 0x604f
testq %r8, %r8
leaq 0x124370(%rip), %rax    # 0x12a350
cmovneq %r8, %rax
movzwl 0x2(%rsi), %ecx
movl $0x2, (%rdi)
movb %dl, 0x4(%rdi)
movq %rax, 0x10(%rdi)
movl %ecx, 0x8(%rdi)
jmp 0x600e
addl $0x3, %eax
movzbl %al, %eax
movswl 0x2(%rsi), %ecx
movzbl %dl, %edx
movl %eax, %esi
callq 0x6146
movl $0x4, %eax
jmp 0x6143
movzbl %al, %eax
movl $0x0, (%rdi)
movb %dl, 0x4(%rdi)
movq $0x0, 0x10(%rdi)
jmp 0x613b
addl $0x3, %eax
movzbl %al, %eax
movsbl 0x2(%rsi), %ecx
movzbl %dl, %edx
movl %eax, %esi
callq 0x6146
movl $0x3, %eax
jmp 0x6143
movl %eax, %ecx
addl $0x3, %ecx
movl %ecx, (%rdi)
movb %dl, 0x4(%rdi)
movzbl %al, %eax
leaq 0x14c1(%rip), %rcx      # 0x7524
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
testq %r8, %r8
leaq 0x1242da(%rip), %rax    # 0x12a350
cmovneq %r8, %rax
movq %rax, 0x10(%rdi)
movzwl 0x124147(%rip), %eax    # 0x12a1cc
jmp 0x60fb
testq %r8, %r8
leaq 0x1242bf(%rip), %rax    # 0x12a350
cmovneq %r8, %rax
movq %rax, 0x10(%rdi)
movzwl 0x12412c(%rip), %eax    # 0x12a1cc
jmp 0x6138
testq %r8, %r8
leaq 0x124291(%rip), %rax    # 0x12a340
cmovneq %r8, %rax
movq %rax, 0x10(%rdi)
movzwl 0x12410e(%rip), %eax    # 0x12a1cc
jmp 0x60d9
testq %r8, %r8
leaq 0x124276(%rip), %rax    # 0x12a340
cmovneq %r8, %rax
movq %rax, 0x10(%rdi)
movzwl 0x1240f5(%rip), %eax    # 0x12a1ce
addw 0x1240ea(%rip), %ax     # 0x12a1ca
jmp 0x6138
testq %r8, %r8
leaq 0x124264(%rip), %rax    # 0x12a350
cmovneq %r8, %rax
movq %rax, 0x10(%rdi)
movzwl 0x1240d3(%rip), %eax    # 0x12a1ce
addw 0x1240c4(%rip), %ax     # 0x12a1c6
jmp 0x6138
testq %r8, %r8
leaq 0x124242(%rip), %rax    # 0x12a350
cmovneq %r8, %rax
movq %rax, 0x10(%rdi)
movzwl 0x1240a9(%rip), %eax    # 0x12a1c6
jmp 0x6138
testq %r8, %r8
leaq 0x124227(%rip), %rax    # 0x12a350
cmovneq %r8, %rax
movq %rax, 0x10(%rdi)
movzwl 0x124096(%rip), %eax    # 0x12a1ce
movzwl %ax, %eax
movl %eax, 0x8(%rdi)
movl $0x2, %eax
popq %rcx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x625e
leaq 0x13e6(%rip), %rax      # 0x7544
movslq (%rax,%rsi,4), %rdx
addq %rax, %rdx
jmpq *%rdx
testq %r8, %r8
leaq 0x1241df(%rip), %rax    # 0x12a350
cmovneq %r8, %rax
movq %rax, 0x10(%rdi)
jmp 0x6257
testq %r8, %r8
leaq 0x1241b8(%rip), %rax    # 0x12a340
cmovneq %r8, %rax
movq %rax, 0x10(%rdi)
addw 0x124033(%rip), %cx     # 0x12a1ca
jmp 0x6235
testq %r8, %r8
leaq 0x1241aa(%rip), %rax    # 0x12a350
cmovneq %r8, %rax
movq %rax, 0x10(%rdi)
addw 0x124011(%rip), %cx     # 0x12a1c6
jmp 0x6235
testq %r8, %r8
leaq 0x12417f(%rip), %rax    # 0x12a340
cmovneq %r8, %rax
movq %rax, 0x10(%rdi)
addw 0x123ffa(%rip), %cx     # 0x12a1ca
jmp 0x621a
testq %r8, %r8
leaq 0x124164(%rip), %rax    # 0x12a340
cmovneq %r8, %rax
movq %rax, 0x10(%rdi)
addw 0x123fdf(%rip), %cx     # 0x12a1ca
jmp 0x6257
testq %r8, %r8
leaq 0x124159(%rip), %rax    # 0x12a350
cmovneq %r8, %rax
movq %rax, 0x10(%rdi)
addw 0x123fc0(%rip), %cx     # 0x12a1c6
jmp 0x621a
testq %r8, %r8
leaq 0x12413e(%rip), %rax    # 0x12a350
cmovneq %r8, %rax
movq %rax, 0x10(%rdi)
addw 0x123fab(%rip), %cx     # 0x12a1cc
jmp 0x6257
testq %r8, %r8
leaq 0x124123(%rip), %rax    # 0x12a350
cmovneq %r8, %rax
movq %rax, 0x10(%rdi)
addw 0x123f92(%rip), %cx     # 0x12a1ce
jmp 0x6257
testq %r8, %r8
leaq 0x124108(%rip), %rax    # 0x12a350
cmovneq %r8, %rax
movq %rax, 0x10(%rdi)
addw 0x123f6f(%rip), %cx     # 0x12a1c6
movzwl %cx, %ecx
movl %ecx, 0x8(%rdi)
retq
movq $0x0, 0x10(%rdi)
jmp 0x625a
// File: /workspace/github_cpp_makefile_star2_O3/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:
movzbl 0x1(%rdx), %eax
shrl $0x3, %eax
andl $0x7, %eax
testl %ecx, %ecx
movq %rsi, %rcx
cmovneq %rdi, %rcx
cmovneq %rsi, %rdi
movl $0x0, (%rcx)
movb %r8b, 0x4(%rcx)
movq $0x0, 0x10(%rcx)
movl %eax, 0x8(%rcx)
movq %rdx, %rsi
movl %r8d, %edx
movq %r9, %rcx
jmp 0x5fb2
// File: /workspace/github_cpp_makefile_star2_O3/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, 0x123f6c(%rip)     # 0x12a218
movl %edi, %eax
shrb $0x2, %al
andb $0x1, %al
movb %al, 0x123f5e(%rip)     # 0x12a217
movl %edi, %eax
shrb $0x4, %al
andb $0x1, %al
movb %al, 0x123f50(%rip)     # 0x12a216
movl %edi, %eax
shrb $0x6, %al
andb $0x1, %al
movb %al, 0x123f42(%rip)     # 0x12a215
movl %edi, %eax
shrb $0x7, %al
movb %al, 0x123f36(%rip)     # 0x12a214
movl %edi, %eax
shrl $0x8, %eax
andb $0x1, %al
movb %al, 0x123f28(%rip)     # 0x12a213
movl %edi, %eax
shrl $0x9, %eax
andb $0x1, %al
movb %al, 0x123f1a(%rip)     # 0x12a212
movl %edi, %eax
shrl $0xa, %eax
andb $0x1, %al
movb %al, 0x123f0c(%rip)     # 0x12a211
shrl $0xb, %edi
andb $0x1, %dil
movb %dil, 0x123efd(%rip)    # 0x12a210
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0xd8e(%rip), %rsi       # 0x77a9
movq %rax, %rdi
callq 0x10d0
movq %rax, %r14
movq %rax, (%rbx)
testq %rax, %rax
je 0x6a9f
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 0x6a7a
cmpq $0x2d0, %rcx            # imm = 0x2D0
jne 0x6a84
movsd 0xb68(%rip), %xmm0      # 0x75e0
jmp 0x6a91
movsd 0xb4e(%rip), %xmm0      # 0x75d0
jmp 0x6a91
movsd 0xb64(%rip), %xmm0      # 0x75f0
movl $0x12, %eax
movlps %xmm0, 0x8(%rbx)
movl $0x2, 0x10(%rbx)
movl %eax, 0x14(%rbx)
testq %r14, %r14
setne %al
addq $0x90, %rsp
popq %rbx
popq %r14
popq %r15
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2c74
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %r15
movq %r12, %rax
movq %r13, %rcx
testq %r15, %r15
jne 0x2be0
movl $0xa8, %edi
callq 0x21a0
movq %rax, %r15
movq %rax, %rdi
callq 0x250c
movq %r15, (%rbx)
movq (%r14), %rax
movq 0x8(%r14), %rcx
cmpq %rax, %rcx
je 0x2c5c
movq %r13, -0x30(%rbp)
movq %r12, -0x38(%rbp)
xorl %r15d, %r15d
movl $0x90, %r12d
xorl %r13d, %r13d
callq 0x2080
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x43fb(%rip), %xmm0     # 0x7008
movsd 0x43fb(%rip), %xmm1     # 0x7010
ucomisd %xmm0, %xmm1
movq (%r14), %rsi
jb 0x2c3a
movq (%rbx), %rdi
addq %r12, %rdi
addq %r15, %rsi
callq 0x39c0
movq (%r14), %rsi
movslq (%rsi,%r15), %rax
movq (%rbx), %rcx
incl 0x20(%rcx,%rax,4)
incq %r13
movq 0x8(%r14), %rax
subq %rsi, %rax
sarq $0x5, %rax
addq $0x20, %r15
cmpq %r13, %rax
ja 0x2bf9
movq (%rbx), %r15
movq -0x38(%rbp), %r12
movq -0x30(%rbp), %r13
movq 0x98(%r15), %rax
subq 0x90(%r15), %rax
shrq $0x5, %rax
movl %eax, 0x20(%r15)
jmp 0x2cb6
movq 0x735d(%rip), %rbx      # 0x9fd8
leaq 0x43de(%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_O3/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 0x3671
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 0x365a
jmp 0x3673
xorl %eax, %eax
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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), %rax
testq %rax, %rax
je 0x36ee
movq %rax, %rcx
movq 0x10(%rax), %rax
testq %rax, %rax
je 0x36b0
movslq (%rcx), %rdx
movsd 0x8(%rcx), %xmm0
movq (%rsi), %rdi
ucomisd (%rdi,%rdx,8), %xmm0
ja 0x3684
movq 0x18(%rcx), %rax
testq %rax, %rax
jne 0x3684
jmp 0x3754
movq 0x18(%rcx), %rax
testq %rax, %rax
je 0x3734
movslq (%rcx), %rdx
movsd 0x8(%rcx), %xmm0
movq (%rsi), %rdi
ucomisd (%rdi,%rdx,8), %xmm0
jbe 0x3684
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 0x36d4
jmp 0x3772
movq 0x68e3(%rip), %rbx      # 0x9fd8
leaq 0x39ab(%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 0x3772
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 0x373d
jmp 0x3772
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 0x375d
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3851(%rip), %xmm0     # 0x7008
movsd 0x3851(%rip), %xmm1     # 0x7010
ucomisd %xmm0, %xmm1
jb 0x37e9
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x37de
movl -0x14(%rbp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x37e9
movq %rbx, %rdi
movq %r14, %rdx
callq 0x4c14
movl -0x14(%rbp), %eax
leal 0x1(%rax), %ecx
movl %ecx, -0x14(%rbp)
cmpl $0x268, %eax            # imm = 0x268
jl 0x37a3
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x381c
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x21b0
movq %r14, %rdi
callq 0x2290
// File: /workspace/github_cpp_makefile_star2_O3/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), %rbx
movq %rbx, -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 0x3fa6
movq -0x60(%rbp), %rax
movq -0x50(%rbp), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x3880
movq %rbx, (%rax)
movq -0x60(%rbp), %rcx
addq $0x8, %rcx
movq %rcx, -0x60(%rbp)
jmp 0x3894
leaq -0x90(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x412e
movq -0x60(%rbp), %rcx
movq -0x80(%rbp), %rax
cmpq %rax, %rcx
je 0x399d
leaq -0x90(%rbp), %rbx
leaq -0x38(%rbp), %r14
leaq -0x30(%rbp), %r15
movq (%rax), %r12
movq %r12, -0x28(%rbp)
movq -0x70(%rbp), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x38ca
addq $0x8, %rax
jmp 0x38fb
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 -0x28(%rbp), %r12
movq %rax, -0x80(%rbp)
testq %r12, %r12
je 0x3993
movq 0x10(%r12), %rax
movq %rax, -0x38(%rbp)
movq 0x18(%r12), %rax
movq %rax, -0x30(%rbp)
leaq 0x90(%r12), %rdi
callq 0x2778
movl $0xa8, %esi
movq %r12, %rdi
callq 0x21b0
movq -0x60(%rbp), %rax
movq -0x50(%rbp), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x395a
movq -0x38(%rbp), %rcx
movq %rcx, (%rax)
movq -0x60(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x60(%rbp)
jmp 0x3969
movq %rbx, %rdi
movq %r14, %rsi
callq 0x412e
movq -0x60(%rbp), %rax
movq -0x50(%rbp), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x3984
movq -0x30(%rbp), %rcx
movq %rcx, (%rax)
addq $0x8, -0x60(%rbp)
jmp 0x398f
movq %rbx, %rdi
movq %r15, %rsi
callq 0x412e
movq -0x80(%rbp), %rax
cmpq %rax, -0x60(%rbp)
jne 0x38b0
leaq -0x90(%rbp), %rdi
callq 0x3c04
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x39b8
movq %rax, %rdi
callq 0x27db
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4e84
movl $0x8, %edi
callq 0x21a0
movq %rax, %r12
movq %rax, %rdi
callq 0x2b4c
leaq -0x68(%rbp), %r15
movq %r15, %rdi
movq -0x30(%rbp), %rsi
callq 0x3a08
movq %r12, %rdi
movq %r15, %rsi
callq 0x2b8c
movl %eax, %r15d
leaq -0x68(%rbp), %rdi
callq 0x2778
testb %r15b, %r15b
je 0x4e60
movq %r12, %rdi
callq 0x2ce4
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rsi
cmpq %rsi, 0x20(%rax)
je 0x4e60
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 0x293c
movq %r12, %r14
movq %r12, %rdi
leaq -0x50(%rbp), %rsi
callq 0x3676
movl %eax, %r12d
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x4e30
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 0x4df8
movq %r12, %rdi
callq 0x3824
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 0x514d(%rip), %rbx      # 0x9fd8
leaq 0x228e(%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 0x2778
jmp 0x4f07
movq %rax, %r14
movl $0x8, %esi
movq %r12, %rdi
jmp 0x4f02
movq %rax, %r14
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x4f07
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x21b0
movq %r14, %rdi
callq 0x2290
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4f90
movl %esi, %ebx
testl %esi, %esi
jle 0x4fd2
movq %rdi, %r14
negl %ebx
movl $0x1, %r13d
movq 0x5087(%rip), %r15      # 0x9fd8
leaq 0x227e(%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 0x4d66
leal (%rbx,%r13), %eax
incl %eax
movl %r13d, %ecx
incl %ecx
movl %ecx, %r13d
cmpl $0x1, %eax
jne 0x4f58
jmp 0x4fd2
movq 0x5041(%rip), %rbx      # 0x9fd8
leaq 0x219f(%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_O3/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 0x14ec(%rip), %rsi      # 0x71af
leaq -0x250(%rbp), %rbx
movq %rbx, %rdi
movl $0x8, %edx
callq 0x22b0
leaq 0x1572(%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 0x5e4c
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 0x1239(%rip), %xmm0     # 0x7008
movsd 0x1471(%rip), %xmm1     # 0x7248
ucomisd %xmm0, %xmm1
jb 0x5e17
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 0x5e2c
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 0x5da3
leaq -0x250(%rbp), %rdi
callq 0x2050
leaq -0x450(%rbp), %rdi
callq 0x2220
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x5e79
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21b0
movq 0x4150(%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 0x5efa
jmp 0x5ed6
jmp 0x5ed6
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x5eee
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
// File: /workspace/github_cpp_makefile_star2_O3/liujan[P]randomforest/main.cpp
// Function: main
int main(int argc, const char * argv[]) {
    // insert code here...
    std::cout << "Hello, World!\n";
    
    RandomForest forest;
    forest.readTrainSample("train.csv");
    forest.readTestSample("test.csv");
    forest.buildTree(7000);
    forest.predict();
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x29240, %rsp          # imm = 0x29240
movq 0x40b5(%rip), %rdi      # 0x9fd8
leaq 0x1331(%rip), %rsi      # 0x725b
movl $0xe, %edx
callq 0x21e0
leaq -0x29250(%rbp), %rdi
callq 0x4d54
leaq -0x40(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x1260(%rip), %rsi      # 0x71af
leaq 0x1262(%rip), %rdx      # 0x71b8
leaq -0x50(%rbp), %rdi
callq 0x6046
leaq -0x29250(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x5246
movq -0x50(%rbp), %rdi
cmpq %r14, %rdi
je 0x5f84
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21b0
leaq -0x20(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x1272(%rip), %rsi      # 0x7205
leaq 0x1273(%rip), %rdx      # 0x720d
leaq -0x30(%rbp), %rdi
callq 0x6046
leaq -0x29250(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x559a
movq -0x30(%rbp), %rdi
cmpq %r14, %rdi
je 0x5fc8
movq -0x20(%rbp), %rsi
incq %rsi
callq 0x21b0
leaq -0x29250(%rbp), %rdi
movl $0x1b58, %esi           # imm = 0x1B58
callq 0x4f10
leaq -0x29250(%rbp), %rdi
callq 0x4fec
leaq -0x29250(%rbp), %rdi
callq 0x58e8
xorl %eax, %eax
addq $0x29240, %rsp          # imm = 0x29240
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
movq -0x30(%rbp), %rdi
cmpq %r14, %rdi
je 0x6032
movq -0x20(%rbp), %rsi
jmp 0x6023
jmp 0x602f
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r14, %rdi
je 0x6032
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21b0
jmp 0x6032
jmp 0x602f
movq %rax, %rbx
leaq -0x29250(%rbp), %rdi
callq 0x58e8
movq %rbx, %rdi
callq 0x2290
// File: /workspace/github_cpp_makefile_star2_O3/mhe[P]raytracerframework_cpp/main.cpp
// Function: main
int main(int argc, char *argv[])
{
	cout << "Introduction to Computer Graphics - Raytracer" << endl << endl;
	if (argc != 3) {
		cerr << "Usage: " << argv[0] << " in-file out-file.png" << endl;
		return 1;
	}

	Raytracer raytracer;

	if (!raytracer.readScene(argv[1])) {
		cerr << "Error: reading scene from " << argv[1] << " failed - no output generated."<< endl;
		return 1;
	}
	raytracer.renderToFile(argv[2]);
	
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r14d
movq 0x22ebd(%rip), %r15     # 0x3afd0
leaq 0x182db(%rip), %rsi     # 0x303f5
movl $0x2d, %edx
movq %r15, %rdi
callq 0x4350
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x42a0
movsbl %al, %esi
movq %r15, %rdi
callq 0x4050
movq %rax, %rdi
callq 0x41e0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x42a0
movsbl %al, %esi
movq %r15, %rdi
callq 0x4050
movq %rax, %rdi
callq 0x41e0
cmpl $0x3, %r14d
jne 0x181a3
movq 0x8(%rbx), %rsi
leaq -0x20(%rbp), %rdi
callq 0x18b90
testb %al, %al
je 0x181e2
movq 0x10(%rbx), %rsi
leaq -0x20(%rbp), %rdi
callq 0x19240
xorl %eax, %eax
jmp 0x182a0
movq 0x22e46(%rip), %r14     # 0x3aff0
leaq 0x18272(%rip), %rsi     # 0x30423
movl $0x7, %edx
movq %r14, %rdi
callq 0x4350
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x18222
movq %rbx, %rdi
callq 0x4120
movq 0x22e1b(%rip), %rdi     # 0x3aff0
movq %rbx, %rsi
movq %rax, %rdx
callq 0x4350
jmp 0x1823a
movq 0x22e07(%rip), %r14     # 0x3aff0
leaq 0x18251(%rip), %rsi     # 0x30441
movl $0x1a, %edx
movq %r14, %rdi
callq 0x4350
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
je 0x18248
movq %rbx, %rdi
callq 0x4120
movq 0x22ddb(%rip), %rdi     # 0x3aff0
movq %rbx, %rsi
movq %rax, %rdx
callq 0x4350
jmp 0x18260
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x4500
leaq 0x181ea(%rip), %rsi     # 0x3042b
movl $0x15, %edx
jmp 0x1826c
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x4500
leaq 0x181f5(%rip), %rsi     # 0x3045c
movl $0x1e, %edx
movq %r14, %rdi
callq 0x4350
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x42a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x4050
movq %rax, %rdi
callq 0x41e0
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/mhe[P]raytracerframework_cpp/raytracer.cpp
// Function: operator>>(YAML::Node const&, Triple&)
void operator >> (const YAML::Node& node, Triple& t)
{
	assert(node.size()==3);
    node[0] >> t.x;
    node[1] >> t.y;
    node[2] >> t.z;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x274f8
cmpl $0x3, %eax
jne 0x18330
movq %r14, %rdi
xorl %esi, %esi
callq 0x27588
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
callq 0x27690
testb %al, %al
je 0x1834f
movq %r14, %rdi
movl $0x1, %esi
callq 0x27588
movq %rax, %r15
leaq 0x8(%rbx), %rsi
movq %rax, %rdi
callq 0x27690
testb %al, %al
je 0x1836d
movq %r14, %rdi
movl $0x2, %esi
callq 0x27588
movq %rax, %r14
addq $0x10, %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x27690
testb %al, %al
je 0x1838b
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18144(%rip), %rdi     # 0x3047b
leaq 0x1814c(%rip), %rsi     # 0x3048a
leaq 0x18153(%rip), %rcx     # 0x30498
movl $0x20, %edx
callq 0x41b0
movl $0x30, %edi
callq 0x4140
movq %rax, %rbx
movl (%r15), %esi
movl 0x4(%r15), %edx
movq %rax, %rdi
callq 0x197dc
jmp 0x183a7
movl $0x30, %edi
callq 0x4140
movq %rax, %rbx
movl (%r15), %esi
movl 0x4(%r15), %edx
movq %rax, %rdi
callq 0x197dc
jmp 0x183a7
movl $0x30, %edi
callq 0x4140
movq %rax, %rbx
movl (%r14), %esi
movl 0x4(%r14), %edx
movq %rax, %rdi
callq 0x197dc
leaq 0x22382(%rip), %rsi     # 0x3a730
leaq 0x144d(%rip), %rdx      # 0x19802
movq %rbx, %rdi
callq 0x4510
jmp 0x183c1
jmp 0x183c1
movq %rax, %r14
movq %rbx, %rdi
callq 0x4230
movq %r14, %rdi
callq 0x4550
// File: /workspace/github_cpp_makefile_star2_O3/mhe[P]raytracerframework_cpp/raytracer.cpp
// Function: parseTriple(YAML::Node const&)
Triple parseTriple(const YAML::Node& node)
{
	Triple t;
    node[0] >> t.x;
    node[1] >> t.y;
    node[2] >> t.z;	
	return t;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq %rsi, %rdi
xorl %esi, %esi
callq 0x27588
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
callq 0x27690
testb %al, %al
je 0x18461
leaq 0x8(%rbx), %r12
movq %r14, %rdi
movl $0x1, %esi
callq 0x27588
movq %rax, %r15
movq %rax, %rdi
movq %r12, %rsi
callq 0x27690
testb %al, %al
je 0x1847f
leaq 0x10(%rbx), %r15
movq %r14, %rdi
movl $0x2, %esi
callq 0x27588
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0x27690
testb %al, %al
je 0x1849d
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x30, %edi
callq 0x4140
movq %rax, %rbx
movl (%r15), %esi
movl 0x4(%r15), %edx
movq %rax, %rdi
callq 0x197dc
jmp 0x184b9
movl $0x30, %edi
callq 0x4140
movq %rax, %rbx
movl (%r15), %esi
movl 0x4(%r15), %edx
movq %rax, %rdi
callq 0x197dc
jmp 0x184b9
movl $0x30, %edi
callq 0x4140
movq %rax, %rbx
movl (%r14), %esi
movl 0x4(%r14), %edx
movq %rax, %rdi
callq 0x197dc
leaq 0x22270(%rip), %rsi     # 0x3a730
leaq 0x133b(%rip), %rdx      # 0x19802
movq %rbx, %rdi
callq 0x4510
jmp 0x184d3
jmp 0x184d3
movq %rax, %r14
movq %rbx, %rdi
callq 0x4230
movq %r14, %rdi
callq 0x4550
// File: /workspace/github_cpp_makefile_star2_O3/mhe[P]raytracerframework_cpp/raytracer.cpp
// Function: Raytracer::parseLight(YAML::Node const&)
Light* Raytracer::parseLight(const YAML::Node& node)
{
	Point position;
	node["position"] >> position;
	Color color;
	node["color"] >> color;
	return new Light(position,color);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x17a47(%rip), %rsi     # 0x304e1
leaq 0x17a48(%rip), %rdx     # 0x304e9
leaq -0x38(%rbp), %r14
movq %r14, %rdi
callq 0x1973e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x193ea
movq %rax, %r14
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x18ad0
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x42d0
leaq -0x50(%rbp), %rsi
movq %r14, %rdi
callq 0x182ac
xorps %xmm0, %xmm0
movaps %xmm0, -0x70(%rbp)
movq $0x0, -0x60(%rbp)
leaq -0x38(%rbp), %r14
movq %r15, (%r14)
leaq 0x179cd(%rip), %rsi     # 0x304c6
leaq 0x179cb(%rip), %rdx     # 0x304cb
movq %r14, %rdi
callq 0x1973e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x193ea
movq %rax, %rbx
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x18b2b
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x42d0
leaq -0x70(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x182ac
movl $0x30, %edi
callq 0x42c0
movaps -0x50(%rbp), %xmm0
movups %xmm0, (%rax)
movq -0x40(%rbp), %rcx
movq %rcx, 0x10(%rax)
movaps (%r14), %xmm0
movups %xmm0, 0x18(%rax)
movq 0x10(%r14), %rcx
movq %rcx, 0x28(%rax)
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x18b70
movq %rax, %rbx
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x18b88
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x42d0
movq %rbx, %rdi
callq 0x4550
// File: /workspace/github_cpp_makefile_star2_O3/mhe[P]raytracerframework_cpp/raytracer.cpp
// Function: Raytracer::renderToFile(char*)
void Raytracer::renderToFile(char* outputFilename)
{
	Image img(400,400);
	cout << "Tracing..." << endl;
	scene->render(img);
	cout << "Writing image to " << outputFilename << "..." << endl;
	img.write_png(outputFilename);
	cout << "Done." << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorps %xmm0, %xmm0
leaq -0x30(%rbp), %rdi
movaps %xmm0, (%rdi)
movl $0x190, %esi            # imm = 0x190
movl $0x190, %edx            # imm = 0x190
callq 0x1992c
movq 0x21d5d(%rip), %r15     # 0x3afd0
leaq 0x1739d(%rip), %rsi     # 0x30617
movl $0xa, %edx
movq %r15, %rdi
callq 0x4350
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x42a0
movsbl %al, %esi
movq 0x21d2b(%rip), %rdi     # 0x3afd0
callq 0x4050
movq %rax, %rdi
callq 0x41e0
movq (%r14), %rdi
leaq -0x30(%rbp), %rsi
callq 0x24692
movq 0x21d0b(%rip), %r14     # 0x3afd0
leaq 0x17356(%rip), %rsi     # 0x30622
movl $0x11, %edx
movq %r14, %rdi
callq 0x4350
testq %rbx, %rbx
je 0x192fa
movq %rbx, %rdi
callq 0x4120
movq 0x21ce3(%rip), %rdi     # 0x3afd0
movq %rbx, %rsi
movq %rax, %rdx
callq 0x4350
jmp 0x19312
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x4500
movq 0x21cb7(%rip), %r14     # 0x3afd0
leaq 0x172fe(%rip), %rsi     # 0x3061e
movl $0x3, %edx
movq %r14, %rdi
callq 0x4350
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x42a0
movsbl %al, %esi
movq 0x21c85(%rip), %rdi     # 0x3afd0
callq 0x4050
movq %rax, %rdi
callq 0x41e0
leaq -0x30(%rbp), %rdi
movq %rbx, %rsi
callq 0x199b4
movq 0x21c65(%rip), %rbx     # 0x3afd0
leaq 0x172c2(%rip), %rsi     # 0x30634
movl $0x5, %edx
movq %rbx, %rdi
callq 0x4350
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x42a0
movsbl %al, %esi
movq 0x21c33(%rip), %rdi     # 0x3afd0
callq 0x4050
movq %rax, %rdi
callq 0x41e0
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x193b8
callq 0x43e0
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x193d4
callq 0x43e0
movq %rbx, %rdi
callq 0x4550
// File: /workspace/github_cpp_makefile_star2_O3/mhe[P]raytracerframework_cpp/./yaml/node.h
// Function: YAML::Node const& YAML::Node::GetValue<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
inline const Node& Node::GetValue(const T& key) const
	{
		if(!m_pContent)
			throw BadDereference();

		for(Iterator it=begin();it!=end();++it) {
			T t;
			if(YAML::Read(it.first(), t)) {
				if(key == t)
					return it.second();
			}
		}

		throw KeyNotFound(m_line, m_column);
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, -0x38(%rbp)
cmpq $0x0, 0x48(%rdi)
je 0x1952a
movq %rdi, %rbx
leaq -0x30(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x27398
leaq -0x48(%rbp), %r14
leaq -0x58(%rbp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x27448
movq %r15, %rdi
movq %r12, %rsi
callq 0x25b95
movl %eax, %r13d
movq %r12, %rdi
callq 0x25956
testb %r13b, %r13b
je 0x194f1
movq %r14, -0x58(%rbp)
movq $0x0, -0x50(%rbp)
movb $0x0, -0x48(%rbp)
movq %r15, %rdi
callq 0x25aa8
movq %rax, %rdi
movq %r12, %rsi
callq 0x27600
movb $0x1, %r13b
testb %al, %al
je 0x194ae
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdx
cmpq -0x50(%rbp), %rdx
jne 0x194ae
testq %rdx, %rdx
je 0x1949f
movq -0x58(%rbp), %rsi
movq -0x38(%rbp), %rax
movq (%rax), %rdi
callq 0x42f0
testl %eax, %eax
jne 0x194ae
movq %r15, %rdi
callq 0x25b02
movq %rax, -0x60(%rbp)
xorl %r13d, %r13d
movq -0x58(%rbp), %rdi
cmpq %r14, %rdi
je 0x194c3
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x42d0
testb %r13b, %r13b
je 0x194d5
movq %r15, %rdi
callq 0x25968
jmp 0x19424
leaq -0x30(%rbp), %rdi
callq 0x25956
movq -0x60(%rbp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x25956
movl $0x30, %edi
callq 0x4140
movq %rax, %r14
movl (%rbx), %esi
movl 0x4(%rbx), %edx
movq %rax, %rdi
callq 0x195c6
leaq 0x21185(%rip), %rsi     # 0x3a6a0
leaq 0x2e0(%rip), %rdx       # 0x19802
movq %r14, %rdi
callq 0x4510
movl $0x30, %edi
callq 0x4140
movq %rax, %r14
movq %rax, %rdi
callq 0x19596
leaq 0x21142(%rip), %rsi     # 0x3a688
jmp 0x1951b
jmp 0x1954a
movq %rax, %rbx
movq %r14, %rdi
callq 0x4230
jmp 0x1958d
jmp 0x19559
movq %rax, %rbx
jmp 0x19584
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x25956
jmp 0x19584
movq %rax, %rbx
movq -0x58(%rbp), %rdi
cmpq %r14, %rdi
je 0x19584
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x42d0
leaq -0x30(%rbp), %rdi
callq 0x25956
movq %rbx, %rdi
callq 0x4550
nop
// File: /workspace/github_cpp_makefile_star2_O3/mhe[P]raytracerframework_cpp/sphere.cpp
// Function: Sphere::intersect(Ray const&, double*)
bool Sphere::intersect(const Ray &ray, double *t)
{
	/****************************************************
	* RT1.1: INTERSECTION CALCULATION
	*
	* Given: ray, position, r
	* Sought: intersects? if true: *t
	* 
	* Insert calculation of ray/sphere intersection here. 
	*
	* You have the sphere's center (C) and radius (r) as well as
	* the ray's origin (ray.O) and direction (ray.D).
	*
	* If the ray does not intersect the sphere, return false.
	* Otherwise, return true and place the distance of the
	* intersection point from the ray origin in *t (see example).
	****************************************************/

	// place holder for actual intersection calculation

	Vector OC = (position - ray.O).normalized();
	if (OC.dot(ray.D) > 0.999) {
		*t = 1000;
		return true;
	}

	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movsd 0x10(%rdi), %xmm0
movsd 0x18(%rdi), %xmm1
subsd (%rsi), %xmm0
subsd 0x8(%rsi), %xmm1
movsd 0x20(%rdi), %xmm3
subsd 0x10(%rsi), %xmm3
movapd %xmm1, %xmm2
mulsd %xmm1, %xmm2
movapd %xmm0, %xmm4
mulsd %xmm0, %xmm4
addsd %xmm2, %xmm4
movapd %xmm3, %xmm2
mulsd %xmm3, %xmm2
addsd %xmm4, %xmm2
xorps %xmm4, %xmm4
sqrtsd %xmm2, %xmm4
movsd 0x16e48(%rip), %xmm2    # 0x306f8
divsd %xmm4, %xmm2
mulsd %xmm2, %xmm0
mulsd %xmm2, %xmm1
mulsd 0x20(%rsi), %xmm1
mulsd 0x18(%rsi), %xmm0
mulsd %xmm3, %xmm2
addsd %xmm1, %xmm0
mulsd 0x28(%rsi), %xmm2
addsd %xmm0, %xmm2
ucomisd 0x16e21(%rip), %xmm2    # 0x30700
jbe 0x198ee
movabsq $0x408f400000000000, %rax # imm = 0x408F400000000000
movq %rax, (%rdx)
ucomisd 0x16e0a(%rip), %xmm2    # 0x30700
seta %al
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/mhe[P]raytracerframework_cpp/image.cpp
// Function: Image::set_extent(int, int)
bool Image::set_extent(int width, int height)
{
	_width = width;
	_height = height;
	if (_pixel) delete[] _pixel;
	_pixel = size() > 0 ? new Color[size()] : 0;
	return _pixel != 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %esi, 0x8(%rdi)
movl %edx, 0xc(%rdi)
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x19952
callq 0x43e0
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
imull %esi, %edx
testl %edx, %edx
jle 0x1999d
movl %edx, %r15d
shlq $0x3, %r15
leaq (%r15,%r15,2), %rdi
callq 0x4040
movq %rax, %r14
leaq (%r15,%r15,2), %rax
addq $-0x18, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rcx
shrq $0x4, %rdx
leaq (%rdx,%rdx,2), %rax
leaq 0x18(,%rax,8), %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x4170
jmp 0x199a0
xorl %r14d, %r14d
movq %r14, (%rbx)
testq %r14, %r14
setne %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq