LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/CHEN-Zhihan[P]Compiler/Node.cpp
// Function: ExprNode::checkArray(std::vector<int, std::allocator<int>>&, int, std::shared_ptr<Node> const&) const
void ExprNode::checkArray(vector<int>& sList, int functionID, const shared_ptr<Node>& t) const {
    auto e = dynamic_pointer_cast<VarNode>(t);
    if (e == nullptr) {
        return;
    }
    if (!e->matched) {
        if (e != nullptr and e->getDimensions() != sizeMap[{e->getDefinitionScope(sList, functionID), e->getID()}].size()) {
            cerr << "Invalid operation on array " << reverseLookup[e->getID()] << endl;
            exit(-1);
        }
    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebx
movq %rsi, %r14
leaq -0x28(%rbp), %r15
movq %r15, %rdi
movq %rcx, %rsi
callq 0x67f2
movq (%r15), %rdi
testq %rdi, %rdi
je 0xbc2c
cmpb $0x0, 0xd(%rdi)
jne 0xbc2c
movq 0x18(%rdi), %r15
subq 0x10(%rdi), %r15
movq %r14, %rsi
movl %ebx, %edx
callq 0xbcac
movq -0x28(%rbp), %rcx
movl 0x8(%rcx), %ecx
leaq -0x30(%rbp), %rsi
movl %eax, (%rsi)
movl %ecx, 0x4(%rsi)
leaq 0x118a0(%rip), %rdi     # 0x1d4b0
callq 0xeb8a
shrq $0x4, %r15
movslq %r15d, %rcx
movq 0x8(%rax), %rdx
subq (%rax), %rdx
sarq $0x2, %rdx
cmpq %rcx, %rdx
jne 0xbc40
leaq -0x20(%rbp), %rdi
callq 0x6b76
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x113a1(%rip), %rdi     # 0x1cfe8
leaq 0x7b9d(%rip), %rsi      # 0x137eb
callq 0x31e0
movq -0x28(%rbp), %rcx
movslq 0x8(%rcx), %rsi
leaq 0x116b6(%rip), %rcx     # 0x1d318
shlq $0x5, %rsi
addq (%rcx), %rsi
movq %rax, %rdi
callq 0x31c0
movq %rax, %rdi
callq 0x3130
pushq $-0x1
popq %rdi
callq 0x3260
jmp 0xbc85
jmp 0xbc85
movq %rax, %rbx
leaq -0x20(%rbp), %rdi
callq 0x6b76
movq %rbx, %rdi
callq 0x3390
nop
// File: /workspace/github_cpp_makefile_star2_O2/CHEN-Zhihan[P]Compiler/Node.cpp
// Function: VarNode::getDefinitionScope(std::vector<int, std::allocator<int>> const&, int) const
int VarNode::getDefinitionScope(const vector<int>& sList, int functionID) const {
    if (global) {
        return GLOBAL;
    }
    for (auto j = sList.size() - 1; j != -1; --j) {
        if (variableTable[sList[j]].count(i) != 0) {
            return sList[j];
        }
        if (sList[j] == functionID) {
            return NOT_FOUND;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpb $0x0, 0xc(%rdi)
je 0xbcc9
leaq 0x117e5(%rip), %rsi     # 0x1d4ac
jmp 0xbd1f
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movq (%rsi), %rsi
movq 0x8(%r14), %r13
subq %rsi, %r13
addq $0x8, %r15
addq $-0x4, %r13
leaq 0x1169e(%rip), %r12     # 0x1d388
addq %r13, %rsi
movq %r12, %rdi
callq 0xa758
movq %rax, %rdi
movq %r15, %rsi
callq 0x1021c
movq (%r14), %rsi
testq %rax, %rax
jne 0xbd1c
leaq -0x4(%r13), %rax
cmpl %ebx, (%rsi,%r13)
movq %rax, %r13
jne 0xbcea
movl $0x7d0, %eax            # imm = 0x7D0
jmp 0xbd21
addq %r13, %rsi
movl (%rsi), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/CHEN-Zhihan[P]Compiler/Node.cpp
// Function: ExprNode::check(std::vector<int, std::allocator<int>>&, int)
void ExprNode::check(vector<int>& sList, int functionID) {
    if (oper != '=') {
        op[0]->check(sList, functionID);
    } else {
        op[1]->check(sList, functionID);
        dynamic_pointer_cast<VarNode>(op[0])->assign(sList, functionID);
        return;
    }
    checkArray(sList, functionID, op[0]);
    unordered_set<int> uniOp{NOT, INTEGER, STRING, CHARACTER, BOOL, VAR, UMINUS, CALL, POSINC, POSDEC, PREINC, PREDEC, CALL};
    if (uniOp.count(oper) == 0) {
        checkArray(sList, functionID, op[1]);
        op[1]->check(sList, functionID);
    }
    if (oper == POSINC or oper == POSDEC or oper == PREINC or oper == PREDEC) {
        if (dynamic_pointer_cast<VarNode>(op[0]) == nullptr) {
            cerr << "Invalid increment/decrement operation" << endl;
            exit(-1);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %r12
leaq 0x18(%rdi), %rbx
cmpl $0x3d, 0x8(%rdi)
jne 0xbd9e
movq 0x28(%r12), %rdi
movq (%rdi), %rax
movq %r15, %rsi
movl %r14d, %edx
callq *0x8(%rax)
leaq -0x68(%rbp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x67f2
movq (%r12), %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0xbeda
leaq -0x60(%rbp), %rdi
callq 0x6b76
jmp 0xbe7e
movq (%rbx), %rdi
movq (%rdi), %rax
movq %r15, %rsi
movl %r14d, %edx
callq *0x8(%rax)
movq %r15, %rsi
movl %r14d, %edx
movq %rbx, %rcx
callq 0xbbb8
movups 0x799a(%rip), %xmm0     # 0x1375c
leaq -0x6c(%rbp), %rdx
movaps %xmm0, -0x14(%rdx)
movups 0x797b(%rip), %xmm0     # 0x1374c
movaps %xmm0, -0x24(%rdx)
movups 0x7960(%rip), %xmm0     # 0x1373c
movaps %xmm0, -0x34(%rdx)
movl $0xfffffffd, -0x4(%rdx) # imm = 0xFFFFFFFD
leaq -0x29(%rbp), %rax
movq %rax, (%rsp)
leaq -0x68(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0x2b(%rbp), %r8
leaq -0x2a(%rbp), %r9
xorl %ecx, %ecx
callq 0x10158
leaq 0x8(%r12), %r13
leaq -0x68(%rbp), %rdi
movq %r13, %rsi
callq 0x1021c
testq %rax, %rax
jne 0xbe41
addq $0x28, %r12
movq %r15, %rsi
movl %r14d, %edx
movq %r12, %rcx
callq 0xbbb8
movq (%r12), %rdi
movq (%rdi), %rax
movq %r15, %rsi
movl %r14d, %edx
callq *0x8(%rax)
movl $0xfffffeee, %eax       # imm = 0xFFFFFEEE
addl (%r13), %eax
cmpl $0x3, %eax
ja 0xbe75
leaq -0xa0(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x67f2
movq (%r14), %rbx
leaq -0x98(%rbp), %rdi
callq 0x6b76
testq %rbx, %rbx
je 0xbe90
leaq -0x68(%rbp), %rdi
callq 0x96f6
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x11151(%rip), %rdi     # 0x1cfe8
leaq 0x7969(%rip), %rsi      # 0x13807
callq 0x31e0
movq %rax, %rdi
callq 0x3130
pushq $-0x1
popq %rdi
callq 0x3260
movq %rax, %rbx
jmp 0xbed2
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x6b76
jmp 0xbed2
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x96f6
movq %rbx, %rdi
callq 0x3390
// File: /workspace/github_cpp_makefile_star2_O2/CHEN-Zhihan[P]Compiler/Node.cpp
// Function: VarNode::getDimension() const
vector<int> VarNode::getDimension() const {
    if (subscriptions.size() == 0) {
        return {};
    }
    auto result = vector<int>(subscriptions.size());
    transform(subscriptions.begin(), subscriptions.end(), result.begin(), [this] (shared_ptr<ExprNode> node) -> int {
        if (node != nullptr) {
            node->evaluate();
            if (!node->isKnown()) {
                cerr << "Invalid size of array " << reverseLookup[i] << endl;
                exit(-1);
            }
            return node->getValue();
        }
        return 0;
    });
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18(%rsi), %rsi
subq 0x10(%rbx), %rsi
je 0xd6e1
sarq $0x4, %rsi
leaq -0x48(%rbp), %r12
movq %r14, %rdi
movq %r12, %rdx
callq 0xeece
movq 0x10(%rbx), %r13
movq %rbx, -0x38(%rbp)
movq 0x18(%rbx), %rbx
movq %r14, -0x30(%rbp)
movq (%r14), %r15
leaq -0x40(%rbp), %r14
cmpq %rbx, %r13
je 0xd6db
movq %r12, %rdi
movq %r13, %rsi
callq 0xf570
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0xd6c4
callq 0xc294
movq -0x48(%rbp), %rax
cmpb $0x0, 0x14(%rax)
je 0xd6ff
movl 0x10(%rax), %eax
jmp 0xd6c6
xorl %eax, %eax
movl %eax, (%r15)
movq %r14, %rdi
callq 0x6b76
addq $0x10, %r13
addq $0x4, %r15
jmp 0xd697
movq -0x30(%rbp), %rax
jmp 0xd6f0
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
andq $0x0, 0x10(%r14)
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xf8e2(%rip), %rdi      # 0x1cfe8
leaq 0x63d6(%rip), %rsi      # 0x13ae3
callq 0x31e0
movq -0x38(%rbp), %rcx
movslq 0x8(%rcx), %rsi
leaq 0xfbf7(%rip), %rcx      # 0x1d318
shlq $0x5, %rsi
addq (%rcx), %rsi
movq %rax, %rdi
callq 0x31c0
movq %rax, %rdi
callq 0x3130
pushq $-0x1
popq %rdi
callq 0x3260
jmp 0xd742
movq %rax, %r15
movq %r14, %rdi
callq 0x6b76
movq -0x30(%rbp), %rdi
callq 0xa21e
movq %r15, %rdi
callq 0x3390
// File: /workspace/github_cpp_makefile_star2_O2/CHEN-Zhihan[P]Compiler/Node.cpp
// Function: CallNode::ex(std::vector<int, std::allocator<int>>&, int, int, int) const
void CallNode::ex(vector<int>& sList, int function, int blbl, int clbl) const {
    if (i < 3) {
        cout << "\t" << reverseLookup[i] << "\n";
    } else if (i < 9) {
        arguments.back()->ex(sList, function, blbl, clbl);
        cout << "\t" << reverseLookup[i] << "\n";
    } else {
        for (const auto& i: arguments) {
            i->ex(sList, function, blbl, clbl);
        }
        printf("\tcall\tL%03d, %d\n", functionLabel[i], (int)arguments.size());
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, -0x2c(%rbp)
leaq 0x8(%rdi), %rbx
movl 0x8(%rdi), %eax
cmpl $0x2, %eax
jg 0xd7dd
movq 0xf7f4(%rip), %rdi      # 0x1cfc0
leaq 0x6016(%rip), %rsi      # 0x137e9
callq 0x31e0
movslq (%rbx), %rsi
jmp 0xd81f
movl %ecx, %r12d
movl %edx, %r13d
movq %rsi, %r15
movq %rdi, %r14
cmpl $0x8, %eax
ja 0xd852
movq 0x18(%r14), %rax
movq -0x10(%rax), %rdi
movq (%rdi), %rax
movq %r15, %rsi
movl %r13d, %edx
movl %r12d, %ecx
movl -0x2c(%rbp), %r8d
callq *(%rax)
movq 0xf7b1(%rip), %rdi      # 0x1cfc0
leaq 0x5fd3(%rip), %rsi      # 0x137e9
callq 0x31e0
movslq 0x8(%r14), %rsi
leaq 0xfaf2(%rip), %rcx      # 0x1d318
shlq $0x5, %rsi
addq (%rcx), %rsi
movq %rax, %rdi
callq 0x31c0
leaq 0x59b9(%rip), %rsi      # 0x131f5
movq %rax, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x31e0
movq %rbx, -0x38(%rbp)
movq 0x10(%r14), %rbx
movq %r14, -0x40(%rbp)
movq 0x18(%r14), %r14
cmpq %r14, %rbx
je 0xd882
movq (%rbx), %rdi
movq (%rdi), %rax
movq %r15, %rsi
movl %r13d, %edx
movl %r12d, %ecx
movl -0x2c(%rbp), %r8d
callq *(%rax)
addq $0x10, %rbx
jmp 0xd862
leaq 0xfb6f(%rip), %rdi      # 0x1d3f8
movq -0x38(%rbp), %rsi
callq 0x10ea2
movl (%rax), %esi
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rdx
subq 0x10(%rax), %rdx
shrq $0x4, %rdx
leaq 0x609a(%rip), %rdi      # 0x13945
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3040
// File: /workspace/github_cpp_makefile_star2_O2/CHEN-Zhihan[P]Compiler/Node.cpp
// Function: VarNode::ex(std::vector<int, std::allocator<int>>&, int, int, int) const
void VarNode::ex(vector<int>& sList, int functionID, int blbl, int clbl) const {
    int definitionScope = getDefinitionScope(sList, functionID);
    if (sizeMap[{definitionScope, i}].size() != 0 and subscriptions.size() == 0) { // pass by reference
        int address = addressTable[functionID].second[definitionScope][i];
        if (address < 0) { // is parameter
            printf("\tpush\tfp[%d]\n", address);
        } else {
            if (global) {
                printf("\tpush\t%d\n", addressTable[GLOBAL].second[GLOBAL][i]);
            } else if (functionID == GLOBAL) {
                auto address = addressTable[GLOBAL].second[getDefinitionScope(sList, functionID)][i];
                printf("\tpush\t%d\n", address);
            } else {
                printf("\tpush\t%d\n", addressTable[functionID].second[definitionScope][i]);
                printf("\tpush\tfp\n");
                printf("\tadd\n");
            }
        }
    } else {
        push(sList, functionID);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movl %edx, -0x24(%rbp)
callq 0xbcac
movl %eax, -0x28(%rbp)
leaq -0x30(%rbp), %rsi
movl %eax, (%rsi)
movl 0x8(%r15), %eax
movl %eax, 0x4(%rsi)
leaq 0xf1e0(%rip), %rdi      # 0x1d4b0
callq 0xeb8a
movq 0x8(%rax), %rcx
cmpq (%rax), %rcx
je 0xe2e8
movq 0x18(%r15), %rax
cmpq 0x10(%r15), %rax
je 0xe2fa
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0xbba8
jmp 0xe3b9
leaq 0x8(%r15), %rbx
leaq 0xf163(%rip), %rdi      # 0x1d468
leaq -0x24(%rbp), %rsi
callq 0x9d9e
leaq 0x8(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0xf958
movq %rax, %rdi
movq %rbx, %rsi
callq 0x10ea2
movl (%rax), %esi
testl %esi, %esi
js 0xe357
cmpb $0x1, 0xc(%r15)
jne 0xe360
leaq 0xf12e(%rip), %rdi      # 0x1d468
leaq 0xf16b(%rip), %r14      # 0x1d4ac
movq %r14, %rsi
callq 0x9d9e
leaq 0x8(%rax), %rdi
movq %r14, %rsi
callq 0xf958
jmp 0xe39e
leaq 0x567b(%rip), %rdi      # 0x139d9
jmp 0xe3b2
movl -0x24(%rbp), %eax
cmpl 0xf143(%rip), %eax      # 0x1d4ac
jne 0xe3c6
leaq 0xf0f6(%rip), %rdi      # 0x1d468
leaq 0xf133(%rip), %rsi      # 0x1d4ac
callq 0x9d9e
leaq 0x8(%rax), %r12
movl -0x24(%rbp), %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0xbcac
leaq -0x30(%rbp), %rsi
movl %eax, (%rsi)
movq %r12, %rdi
callq 0x10fb0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x10ea2
movl (%rax), %esi
leaq 0x5250(%rip), %rdi      # 0x13602
xorl %eax, %eax
callq 0x3040
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xf09b(%rip), %rdi      # 0x1d468
leaq -0x24(%rbp), %rsi
callq 0x9d9e
leaq 0x8(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0xf958
movq %rax, %rdi
movq %rbx, %rsi
callq 0x10ea2
movl (%rax), %esi
leaq 0x520b(%rip), %rdi      # 0x13602
xorl %eax, %eax
callq 0x3040
leaq 0x5714(%rip), %rdi      # 0x13b19
callq 0x3310
leaq 0x5247(%rip), %rdi      # 0x13658
callq 0x3310
jmp 0xe3b9
// File: /workspace/github_cpp_makefile_star2_O2/CHEN-Zhihan[P]Compiler/Node.cpp
// Function: VarNode::check(std::vector<int, std::allocator<int>>&, int)
void VarNode::check(vector<int>& sList, int functionID) {
    if (global) {
        if (variableTable[GLOBAL].count(i) == 0) {
            cerr << "Undefined reference to global variable: " << reverseLookup[i] << endl;
            exit(-1);
        }
        if (functionID == GLOBAL) {
            cerr << "Refer to a global variable: " << reverseLookup[i] << " in the global scope" << endl;
            exit(-1);
        }
    } else {
        auto s = getDefinitionScope(sList, functionID);
        if (s == NOT_FOUND) {
            cerr << "Undefined reference to variable " << reverseLookup[i] << endl;
            exit(-1);
        }
    }
    for (auto & i : subscriptions) {
        i->check(sList, functionID);
        i->evaluate();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
cmpb $0x1, 0xc(%rdi)
jne 0xe8bf
leaq 0xeb36(%rip), %rdi      # 0x1d388
leaq 0xec53(%rip), %rsi      # 0x1d4ac
callq 0xa758
leaq 0x8(%r15), %r12
movq %rax, %rdi
movq %r12, %rsi
callq 0x1021c
testq %rax, %rax
je 0xe907
cmpl %ebx, 0xec30(%rip)      # 0x1d4ac
jne 0xe8d3
movq 0xe763(%rip), %rdi      # 0x1cfe8
leaq 0x5210(%rip), %rsi      # 0x13a9c
callq 0x31e0
movslq (%r12), %rsi
leaq 0xea7c(%rip), %rcx      # 0x1d318
shlq $0x5, %rsi
addq (%rcx), %rsi
movq %rax, %rdi
callq 0x31c0
leaq 0x4ffc(%rip), %rsi      # 0x138ae
movq %rax, %rdi
callq 0x31e0
jmp 0xe94d
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0xbcac
cmpl $0x7d0, %eax            # imm = 0x7D0
je 0xe920
movq 0x10(%r15), %r12
movq 0x18(%r15), %r15
cmpq %r15, %r12
je 0xe8fe
movq (%r12), %rdi
movq (%rdi), %rax
movq %r14, %rsi
movl %ebx, %edx
callq *0x8(%rax)
movq (%r12), %rdi
callq 0xc294
addq $0x10, %r12
jmp 0xe8db
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0xe6da(%rip), %rdi      # 0x1cfe8
leaq 0x515e(%rip), %rsi      # 0x13a73
callq 0x31e0
movslq (%r12), %rsi
jmp 0xe937
movq 0xe6c1(%rip), %rdi      # 0x1cfe8
leaq 0x518b(%rip), %rsi      # 0x13ab9
callq 0x31e0
movslq 0x8(%r15), %rsi
leaq 0xe9da(%rip), %rcx      # 0x1d318
shlq $0x5, %rsi
addq (%rcx), %rsi
movq %rax, %rdi
callq 0x31c0
movq %rax, %rdi
callq 0x3130
pushq $-0x1
popq %rdi
callq 0x3260
nop
// File: /workspace/github_cpp_makefile_star2_O2/CHEN-Zhihan[P]Compiler/Node.cpp
// Function: DeclareNode::ex(std::vector<int, std::allocator<int>>&, int, int, int) const
void DeclareNode::ex(vector<int>& sList, int functionID, int blbl, int clbl) const {
    if (initializer != nullptr) {
        auto dimension = sizeMap[{sList.back(), variable->getID()}];
        int address = addressTable[functionID].second[variable->getDefinitionScope(sList, functionID)][variable->getID()];        
        int size = accumulate(dimension.begin(), dimension.end(), 1, multiplies<int>());
        string base =(variable->isGlobal() or functionID == GLOBAL) ? "sb" : "fp";
        for (int i = 0; i != size; ++i) {
            initializer->ex(sList, functionID, blbl, clbl);
            cout << "\tpop\t" << base << "[" << address + i << "]\n";
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r8d, -0x34(%rbp)
movl %ecx, -0x30(%rbp)
movl %edx, -0x2c(%rbp)
cmpq $0x0, 0x18(%rdi)
je 0xeb0a
movq %rsi, %r14
movq %rdi, %r12
movq 0x8(%rsi), %rax
movq 0x8(%rdi), %rcx
movl 0x8(%rcx), %ecx
movl -0x4(%rax), %eax
leaq -0x70(%rbp), %rsi
movl %eax, (%rsi)
movl %ecx, 0x4(%rsi)
leaq 0xead4(%rip), %rdi      # 0x1d4b0
callq 0xeb8a
leaq -0x50(%rbp), %rdi
movq %rax, %rsi
callq 0xebf4
leaq 0xea74(%rip), %rdi      # 0x1d468
leaq -0x2c(%rbp), %rsi
callq 0x9d9e
movq %rax, %rbx
movq 0x8(%r12), %rdi
movl -0x2c(%rbp), %edx
movq %r14, %rsi
callq 0xbcac
addq $0x8, %rbx
leaq -0x70(%rbp), %rsi
movl %eax, (%rsi)
movq %rbx, %rdi
callq 0x10fb0
movq 0x8(%r12), %rcx
movl 0x8(%rcx), %ecx
leaq -0x38(%rbp), %rsi
movl %ecx, (%rsi)
movq %rax, %rdi
callq 0x10a2a
movl (%rax), %r13d
movq -0x50(%rbp), %rax
movq -0x48(%rbp), %rcx
pushq $0x1
popq %r15
cmpq %rcx, %rax
je 0xea56
imull (%rax), %r15d
addq $0x4, %rax
jmp 0xea47
movq 0x8(%r12), %rax
movl 0xea4b(%rip), %ecx      # 0x1d4ac
cmpl %ecx, -0x2c(%rbp)
leaq 0x506f(%rip), %rcx      # 0x13ada
leaq 0x50ad(%rip), %rsi      # 0x13b1f
cmoveq %rcx, %rsi
cmpb $0x0, 0xc(%rax)
cmovneq %rcx, %rsi
leaq -0x70(%rbp), %rdi
leaq -0x38(%rbp), %rdx
callq 0x30e0
leaq 0x4f5b(%rip), %rbx      # 0x139ed
subl $0x1, %r15d
jb 0xeaf8
movq 0x18(%r12), %rdi
movl -0x2c(%rbp), %edx
movq (%rdi), %rax
movq %r14, %rsi
movl -0x30(%rbp), %ecx
movl -0x34(%rbp), %r8d
callq *(%rax)
movq 0xe50a(%rip), %rdi      # 0x1cfc0
leaq 0x5020(%rip), %rsi      # 0x13add
callq 0x31e0
movq %rax, %rdi
leaq -0x70(%rbp), %rsi
callq 0x31c0
movq %rax, %rdi
leaq 0x4ef8(%rip), %rsi      # 0x139d0
callq 0x31e0
movq %rax, %rdi
movl %r13d, %esi
callq 0x3370
movq %rax, %rdi
movq %rbx, %rsi
callq 0x31e0
incl %r13d
jmp 0xea92
leaq -0x70(%rbp), %rdi
callq 0x3120
leaq -0x50(%rbp), %rdi
callq 0xa21e
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xeb1f
jmp 0xeb1f
jmp 0xeb1f
movq %rax, %rbx
jmp 0xeb30
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x3120
leaq -0x50(%rbp), %rdi
callq 0xa21e
movq %rbx, %rdi
callq 0x3390
nop
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH03_StringsVectorsAndArrays/examples/word_echo.cc
// Function: main
int main() 
{
	string word;
	while (cin >> word)       // read until end-of-file 
		cout << word << endl; // write each word followed by a new line
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
leaq -0x28(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x2de0(%rip), %rbx      # 0x3fe0
leaq -0x38(%rbp), %r14
movq 0x2dc5(%rip), %r15      # 0x3fd0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1070
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x1239
movq %r15, %rdi
movq %r14, %rsi
callq 0x1060
movq %rax, %rdi
callq 0x1040
jmp 0x120b
leaq -0x38(%rbp), %rdi
callq 0x1030
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1090
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH10_GenericAlgorithms/examples/inserters.cc
// Function: print(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::list<int, std::allocator<int>> const&)
void print(const string &label, const list<int> &lst)
{
	cout << label << endl;
	for (auto iter : lst)
        cout << iter << " ";
    cout << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %rsi
movq 0x2d34(%rip), %r14      # 0x3fd8
movq %r14, %rdi
callq 0x10d0
movq %rax, %rdi
callq 0x1090
leaq 0xd75(%rip), %r15       # 0x2030
movq %rbx, %r12
movq (%r12), %r12
cmpq %rbx, %r12
je 0x12e1
movl 0x10(%r12), %esi
movq %r14, %rdi
callq 0x1130
movq %rax, %rdi
movq %r15, %rsi
callq 0x10e0
jmp 0x12be
movq 0x2cf0(%rip), %rdi      # 0x3fd8
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1090
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/msh2df/msh2df.cpp
// Function: IsManifold(gaps::R3Mesh*)
static RNBoolean
IsManifold(R3Mesh *mesh)
{
  // Check for boundary edges
  for (int i = 0; i < mesh->NEdges(); i++) {
    R3MeshEdge *edge = mesh->Edge(i);
    if (mesh->IsEdgeOnBoundary(edge)) return FALSE;
  }

  // Check connected components
  int ncomponents = mesh->ConnectedComponents();
  if (ncomponents != 1) return FALSE;

  // Passed all tests
  return TRUE;
}

// Assembly:
pushq %rax
movl 0x24(%rdi), %ecx
xorl %edx, %edx
testl %ecx, %ecx
cmovlel %edx, %ecx
cmpq %rdx, %rcx
je 0x1354e
movq 0x18(%rdi), %rax
movq (%rax,%rdx,8), %rsi
xorl %eax, %eax
cmpq $0x0, 0x18(%rsi)
je 0x1355d
incq %rdx
cmpq $0x0, 0x20(%rsi)
jne 0x1352c
jmp 0x1355d
callq 0x21df4
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x1, %ecx
sete %al
popq %rcx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/msh2df/../../pkgs/R3Shapes/R3Kdtree.cpp
// Function: gaps::R3Kdtree<Point*>::R3Kdtree(gaps::RNArray<Point*> const&, int)
R3Kdtree<PtrType>::
R3Kdtree(const RNArray<PtrType>& points, int position_offset)
  : position_offset(position_offset),
    position_callback(NULL),
    position_callback_data(NULL),
    npoints(points.NEntries()),
    nnodes(1)
{
  // Create root node
  root = new R3KdtreeNode<PtrType>(NULL);
  assert(root);

  // Determine bounding box 
  bbox = R3null_box;
  for (int i = 0; i < points.NEntries(); i++) {
    bbox.Union(Position(points[i]));
  }

  // Allocate copy of points array (so that it can be sorted)
  PtrType *copy = new PtrType [ points.NEntries() ];
  assert(copy);

  // Copy points
  for (int i = 0; i < points.NEntries(); i++) 
    copy[i] = points[i];

  // Insert points into root
  InsertPoints(root, bbox, copy, points.NEntries());

  // Delete copy of points array
  delete [] copy;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x35c5a
movl %ebp, 0x38(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rbx)
movl 0xc(%r14), %eax
movl %eax, 0x58(%rbx)
movl $0x1, 0x5c(%rbx)
movl $0x130, %edi            # imm = 0x130
callq 0xe450
andl $0x0, 0x128(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
andl $0x0, 0x20(%rax)
movq %rax, 0x50(%rbx)
leaq 0xd0889(%rip), %rsi     # 0xe40d8
movq %rbx, %rdi
callq 0x1358c
xorl %r13d, %r13d
movq %rsp, %r12
movslq 0xc(%r14), %r15
cmpq %r15, %r13
jge 0x13888
movq (%r14), %rax
movq (%rax,%r13,8), %rdx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x13a9a
movq %rbx, %rdi
movq %r12, %rsi
callq 0x36604
incq %r13
jmp 0x1385d
leaq (,%r15,8), %rax
testl %r15d, %r15d
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
callq 0xe030
movq %rax, %r12
movq (%r14), %rax
xorl %ecx, %ecx
testl %r15d, %r15d
movl $0x0, %edx
cmovgl %r15d, %edx
cmpq %rcx, %rdx
je 0x138c5
movq (%rax,%rcx,8), %rsi
movq %rsi, (%r12,%rcx,8)
incq %rcx
jmp 0x138b3
movq 0x50(%rbx), %rsi
movq %rbx, %rdi
movq %rbx, %rdx
movq %r12, %rcx
movl %r15d, %r8d
callq 0x13aee
movq %r12, %rdi
callq 0xe5d0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x138f5
jmp 0x138f5
movq %rax, %r14
movq %rbx, %rdi
callq 0x36966
movq %r14, %rdi
callq 0xe820
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/msh2df/../../pkgs/R3Shapes/R3Kdtree.cpp
// Function: gaps::R3Kdtree<Point*>::FindClosest(gaps::R3Point const&, double, double, int, gaps::RNArray<Point*>&, double*) const
int R3Kdtree<PtrType>::
FindClosest(const R3Point& query_position, RNScalar min_distance, RNScalar max_distance, int max_points, 
  RNArray<PtrType>& points, RNLength *distances) const
{
  // Check root
  if (!root) return 0;

  // Use squared distances for efficiency
  if (max_distance < 0) return 0;
  if (min_distance < 0) min_distance = 0;
  RNLength min_distance_squared = min_distance * min_distance;
  RNLength max_distance_squared = max_distance * max_distance;

  // Allocate temporary array of squared distances to max_points closest points
  RNLength *distances_squared = new RNLength [ max_points ];

  // Search nodes recursively
  FindClosest(root, bbox, 
    NULL, query_position, 
    min_distance_squared, max_distance_squared, max_points, 
    NULL, NULL, 
    points, distances_squared);

  // Update return distances
  if (distances) {
    for (int i = 0; i < points.NEntries(); i++) {
      distances[i] = sqrt(distances_squared[i]);
    }
  }

  // Delete temporary array of squared distances
  delete [] distances_squared;

  // Return number of points
  return points.NEntries();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %rbx
movl %edx, %ebp
movq 0x50(%rdi), %r12
testq %r12, %r12
sete %cl
xorpd %xmm2, %xmm2
ucomisd %xmm1, %xmm2
seta %dl
xorl %eax, %eax
orb %cl, %dl
jne 0x139f1
movq %r8, %r14
movq %rdi, %r13
maxsd %xmm0, %xmm2
mulsd %xmm2, %xmm2
movsd %xmm2, 0x28(%rsp)
mulsd %xmm1, %xmm1
movsd %xmm1, 0x30(%rsp)
movl %ebp, %eax
shlq $0x3, %rax
testl %ebp, %ebp
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
movq %rsi, 0x20(%rsp)
callq 0xe030
movq %rax, %r15
movq %rax, 0x18(%rsp)
movq %rbx, 0x10(%rsp)
xorpd %xmm0, %xmm0
movupd %xmm0, (%rsp)
movq %r13, %rdi
movq %r12, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
movq 0x20(%rsp), %r8
movsd 0x28(%rsp), %xmm0
movsd 0x30(%rsp), %xmm1
movl %ebp, %r9d
callq 0x13e62
testq %r14, %r14
je 0x139e6
xorl %r12d, %r12d
xorpd %xmm1, %xmm1
movslq 0xc(%rbx), %rax
cmpq %rax, %r12
jge 0x139e6
movsd (%r15,%r12,8), %xmm0
ucomisd %xmm1, %xmm0
jb 0x139d2
sqrtsd %xmm0, %xmm0
jmp 0x139db
callq 0xe350
xorpd %xmm1, %xmm1
movsd %xmm0, (%r14,%r12,8)
incq %r12
jmp 0x139b7
movq %r15, %rdi
callq 0xe5d0
movl 0xc(%rbx), %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/msh2df/../../pkgs/R3Shapes/R3Kdtree.cpp
// Function: gaps::R3Kdtree<Point*>::~R3Kdtree()
R3Kdtree<PtrType>::
~R3Kdtree(void)
{
  // Check root
  if (!root) return;

  // Traverse tree deleting nodes
  RNArray<R3KdtreeNode<PtrType> *> stack;
  stack.InsertTail(root);
  while (!stack.IsEmpty()) {
    R3KdtreeNode<PtrType> *node = stack.Tail();
    stack.RemoveTail();
    if (node->children[0]) stack.Insert(node->children[0]);
    if (node->children[1]) stack.Insert(node->children[1]);
    delete node;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cmpq $0x0, 0x50(%rdi)
je 0x13a7e
movq %rsp, %rdi
callq 0x6ceee
movq 0x50(%rbx), %rsi
movq %rsp, %rdi
callq 0x1378a
movq %rsp, %r14
movslq 0xc(%rsp), %rax
testq %rax, %rax
je 0x13a76
movq (%rsp), %rcx
movq -0x8(%rcx,%rax,8), %r15
movq %r14, %rdi
callq 0x13780
movq 0x8(%r15), %rsi
testq %rsi, %rsi
je 0x13a56
movq %r14, %rdi
callq 0x1378a
movq 0x10(%r15), %rsi
testq %rsi, %rsi
je 0x13a67
movq %r14, %rdi
callq 0x1378a
movl $0x130, %esi            # imm = 0x130
movq %r15, %rdi
callq 0xe460
jmp 0x13a2a
movq %rsp, %rdi
callq 0x6cf5c
movq %rbx, %rdi
callq 0x36966
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x13a92
movq %rax, %rdi
callq 0x14308
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/msh2df/../../pkgs/R3Shapes/R3Kdtree.cpp
// Function: gaps::R3Kdtree<Point*>::FindClosest(gaps::R3Point const&, double, double, double*) const
PtrType R3Kdtree<PtrType>::
FindClosest(const R3Point& query_position, 
  RNScalar min_distance, RNScalar max_distance, 
  RNScalar *closest_distance) const
{
  // Check root
  if (!root) return NULL;

  // Use squared distances for efficiency
  if (max_distance < 0) return NULL;
  if (min_distance < 0) min_distance = 0;
  RNLength min_distance_squared = min_distance * min_distance;
  RNLength max_distance_squared = max_distance * max_distance;

  // Initialize nearest point 
  PtrType nearest_point = NULL;
  RNLength nearest_distance_squared = max_distance_squared;

  // Search nodes recursively
  FindClosest(root, bbox, 
    NULL, query_position, 
    min_distance_squared, max_distance_squared, 
    NULL, NULL, 
    nearest_point, nearest_distance_squared);

  // Return closest distance
  if (closest_distance) *closest_distance = sqrt(nearest_distance_squared);

  // Return closest point
  return nearest_point;
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
movq %rdx, %rbx
movapd %xmm0, %xmm2
movq 0x50(%rdi), %rax
testq %rax, %rax
sete %cl
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
seta %dl
orb %cl, %dl
je 0x143dd
xorl %eax, %eax
jmp 0x14446
movq %rsi, %r8
maxsd %xmm2, %xmm0
leaq 0x28(%rsp), %rcx
andq $0x0, (%rcx)
mulsd %xmm0, %xmm0
mulsd %xmm1, %xmm1
leaq 0x20(%rsp), %rdx
movsd %xmm1, (%rdx)
movq %rdx, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
andq $0x0, (%rsp)
movq %rax, %rsi
movq %rdi, %rdx
xorl %ecx, %ecx
xorl %r9d, %r9d
callq 0x14468
testq %rbx, %rbx
je 0x14441
movsd 0x20(%rsp), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x14438
sqrtsd %xmm0, %xmm0
jmp 0x1443d
callq 0xe350
movsd %xmm0, (%rbx)
movq 0x28(%rsp), %rax
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshSearchTree.cpp
// Function: gaps::R3MeshSearchTree::R3MeshSearchTree(gaps::R3Mesh*)
R3MeshSearchTree::
R3MeshSearchTree(R3Mesh *mesh)
  : mesh(mesh),
    nnodes(1),
    mark(1)
{
  // Create root 
  root = new R3MeshSearchTreeNode(NULL);
  assert(root);

  // Insert faces into tree
  for (int i = 0; i < mesh->NFaces(); i++) {
    R3MeshFace *face = mesh->Face(i);
    InsertFace(face);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, (%rdi)
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x10(%rdi)
pushq $0x48
popq %rdi
callq 0xe450
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
callq 0x17a26
movq %r15, 0x8(%r14)
xorl %r15d, %r15d
movslq 0x34(%rbx), %rax
cmpq %rax, %r15
jge 0x1497a
movq 0x28(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x14996
incq %r15
jmp 0x1495c
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
pushq $0x48
popq %rsi
movq %r15, %rdi
callq 0xe460
movq %rbx, %rdi
callq 0xe820
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshSearchTree.cpp
// Function: gaps::R3MeshSearchTree::InsertFace(gaps::R3MeshFace*)
void R3MeshSearchTree::
InsertFace(R3MeshFace *face)
{
  // Check if face intersects box
  if (!R3Intersects(mesh, face, BBox())) return;

  // Create container
  R3MeshSearchTreeFace *face_container = new R3MeshSearchTreeFace(mesh, face);
  assert(face_container);

  // Insert face into root
  InsertFace(face_container, root, BBox(), 0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rdi
leaq 0xf8(%rdi), %rdx
callq 0x14a26
testl %eax, %eax
je 0x149ec
pushq $0x18
popq %rdi
callq 0xe450
movq %rax, %r15
movq (%rbx), %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0x17a70
movq 0x8(%rbx), %rdx
movl $0xf8, %ecx
addq (%rbx), %rcx
movq %rbx, %rdi
movq %r15, %rsi
xorl %r8d, %r8d
popq %rbx
popq %r14
popq %r15
jmp 0x14d76
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
pushq $0x18
popq %rsi
movq %r15, %rdi
callq 0xe460
movq %rbx, %rdi
callq 0xe820
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshSearchTree.cpp
// Function: gaps::R3MeshSearchTree::Empty(gaps::R3MeshSearchTreeNode*)
void R3MeshSearchTree::
Empty(R3MeshSearchTreeNode *node)
{
  // Delete children
  if (node->children[0]) {
    Empty(node->children[0]);
    delete node->children[0];
    node->children[0] = NULL;
  }
  if (node->children[1]) {
    Empty(node->children[1]);
    delete node->children[1];
    node->children[1] = NULL;
  }

  // Delete small face containers
  for (int i = 0; i < node->small_faces.NEntries(); i++) {
    R3MeshSearchTreeFace *face = node->small_faces[i];
    assert(face->reference_count > 0);
    if (--(face->reference_count) == 0) delete face;
  }

  // Delete big face containers
  for (int i = 0; i < node->big_faces.NEntries(); i++) {
    R3MeshSearchTreeFace *face = node->big_faces[i];
    assert(face->reference_count > 0);
    if (--(face->reference_count) == 0) delete face;
  }

  // Empty face containers
  node->small_faces.Empty();
  node->big_faces.Empty();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rsi), %rsi
testq %rsi, %rsi
je 0x15025
movq %r14, %rdi
callq 0x14fe4
movq 0x8(%rbx), %r15
testq %r15, %r15
je 0x15015
movq %r15, %rdi
callq 0x17a8e
pushq $0x48
popq %rsi
movq %r15, %rdi
callq 0xe460
andq $0x0, 0x8(%rbx)
movq 0x10(%rbx), %rsi
testq %rsi, %rsi
je 0x15057
movq %r14, %rdi
callq 0x14fe4
movq 0x10(%rbx), %r14
testq %r14, %r14
je 0x15047
movq %r14, %rdi
callq 0x17a8e
pushq $0x48
popq %rsi
movq %r14, %rdi
callq 0xe460
andq $0x0, 0x10(%rbx)
leaq 0x38(%rbx), %r14
xorl %r12d, %r12d
pushq $0x18
popq %r15
movslq 0x44(%rbx), %rax
cmpq %rax, %r12
jge 0x15084
movq (%r14), %rax
movq (%rax,%r12,8), %rdi
decl 0x10(%rdi)
jne 0x1507f
movq %r15, %rsi
callq 0xe460
incq %r12
jmp 0x15062
leaq 0x28(%rbx), %r15
xorl %r13d, %r13d
pushq $0x18
popq %r12
movslq 0x34(%rbx), %rax
cmpq %rax, %r13
jge 0x150b1
movq (%r15), %rax
movq (%rax,%r13,8), %rdi
decl 0x10(%rdi)
jne 0x150ac
movq %r12, %rsi
callq 0xe460
incq %r13
jmp 0x1508f
movq %r14, %rdi
xorl %esi, %esi
callq 0x6d10c
movq %r15, %rdi
xorl %esi, %esi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x6d10c
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshSearchTree.cpp
// Function: gaps::R3MeshSearchTree::DistanceSquared(gaps::R3Point const&, gaps::R3Box const&, double) const
RNScalar R3MeshSearchTree::
DistanceSquared(const R3Point& query_position, const R3Box& box, RNScalar max_distance_squared) const
{
  // Find and check axial distances from face to node box
  RNScalar dx, dy, dz;
  if (query_position.X() > box.XMax()) dx = query_position.X() - box.XMax();
  else if (query_position.X() < box.XMin()) dx = box.XMin()- query_position.X();
  else dx = 0.0;
  RNScalar dx_squared = dx * dx;
  if (dx_squared >= max_distance_squared) return dx_squared;
  if (query_position.Y() > box.YMax()) dy = query_position.Y() - box.YMax();
  else if (query_position.Y() < box.YMin()) dy = box.YMin()- query_position.Y();
  else dy = 0.0;
  RNScalar dy_squared = dy * dy;
  if (dy_squared >= max_distance_squared) return dy_squared;
  if (query_position.Z() > box.ZMax()) dz = query_position.Z() - box.ZMax();
  else if (query_position.Z() < box.ZMin()) dz = box.ZMin()- query_position.Z();
  else dz = 0.0;
  RNScalar dz_squared = dz * dz;
  if (dz_squared >= max_distance_squared) return dz_squared;
    
  // Find and check actual distance from face to node box
  RNScalar distance_squared = 0;
  if ((dy == 0.0) && (dz == 0.0)) distance_squared = dx_squared;
  else if ((dx == 0.0) && (dz == 0.0)) distance_squared = dy_squared;
  else if ((dx == 0.0) && (dy == 0.0)) distance_squared = dz_squared;
  else distance_squared = dx_squared + dy_squared + dz_squared;

  // Return distance squared
  return distance_squared;
}

// Assembly:
movapd %xmm0, %xmm1
movsd (%rsi), %xmm0
movsd 0x20(%rdx), %xmm2
ucomisd %xmm2, %xmm0
jbe 0x15b03
subsd %xmm2, %xmm0
movapd %xmm0, %xmm2
jmp 0x15b1a
movsd 0x8(%rdx), %xmm3
xorpd %xmm2, %xmm2
ucomisd %xmm0, %xmm3
jbe 0x15b1a
subsd %xmm0, %xmm3
movapd %xmm3, %xmm2
movapd %xmm2, %xmm0
mulsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jae 0x15bbe
movsd 0x8(%rsi), %xmm4
movsd 0x28(%rdx), %xmm3
ucomisd %xmm3, %xmm4
jbe 0x15b46
subsd %xmm3, %xmm4
movapd %xmm4, %xmm3
jmp 0x15b5d
movsd 0x10(%rdx), %xmm5
xorpd %xmm3, %xmm3
ucomisd %xmm4, %xmm5
jbe 0x15b5d
subsd %xmm4, %xmm5
movapd %xmm5, %xmm3
movapd %xmm3, %xmm4
mulsd %xmm3, %xmm4
ucomisd %xmm1, %xmm4
jae 0x15bcf
movsd 0x10(%rsi), %xmm5
movsd 0x30(%rdx), %xmm6
ucomisd %xmm6, %xmm5
jbe 0x15b85
subsd %xmm6, %xmm5
movapd %xmm5, %xmm6
jmp 0x15b9c
movsd 0x18(%rdx), %xmm7
xorpd %xmm6, %xmm6
ucomisd %xmm5, %xmm7
jbe 0x15b9c
subsd %xmm5, %xmm7
movapd %xmm7, %xmm6
movapd %xmm6, %xmm5
mulsd %xmm6, %xmm5
ucomisd %xmm1, %xmm5
jae 0x15be4
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm3
jne 0x15bbf
jp 0x15bbf
ucomisd %xmm1, %xmm6
jne 0x15bbf
jp 0x15bbf
retq
ucomisd %xmm1, %xmm2
jne 0x15bd4
jp 0x15bd4
ucomisd %xmm1, %xmm6
jne 0x15bd4
jp 0x15bd4
movapd %xmm4, %xmm0
retq
ucomisd %xmm1, %xmm2
jne 0x15be9
jp 0x15be9
ucomisd %xmm1, %xmm3
jne 0x15be9
jp 0x15be9
movapd %xmm5, %xmm0
retq
addsd %xmm4, %xmm0
addsd %xmm5, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshSearchTree.cpp
// Function: gaps::R3MeshSearchTree::FindIntersection(gaps::R3Ray const&, gaps::R3MeshIntersection&, double, double&, int (*)(gaps::R3Point const&, gaps::R3Vector const&, gaps::R3Mesh*, gaps::R3MeshFace*, void*), void*, gaps::R3MeshFace*) const
void R3MeshSearchTree::
FindIntersection(const R3Ray& ray, R3MeshIntersection& closest, 
  RNScalar min_t, RNScalar& max_t, 
  int (*IsCompatible)(const R3Point&, const R3Vector&, R3Mesh *, R3MeshFace *, void *), void *compatible_data,
  R3MeshFace *face) const
{
  // Check compatibility 
  if (IsCompatible) {
    if (!(*IsCompatible)(ray.Start(), ray.Vector(), mesh, face, compatible_data)) return;
  }


  // Check face
  R3Vector normal = mesh->FaceNormal(face);
  if (RNIsZero(normal.Dot(normal))) return;

  // Check intersection with plane (this is redundant, but allows checking min_t and max_t)
  RNScalar plane_t;
  R3Plane plane = mesh->FacePlane(face);
  if (!R3Intersects(ray, plane, NULL, &plane_t)) return;
  if (plane_t >= max_t) return;
  if (plane_t < min_t) return;
  
  // Check intersection with face
  R3MeshIntersection face_intersection;
  if (!mesh->Intersection(ray, face, &face_intersection)) return;
  if (face_intersection.t >= max_t) return;
  if (face_intersection.t < min_t) return;

  // Update closest intersection
  closest.type = R3_MESH_FACE_TYPE;
  closest.face = face;
  closest.point = face_intersection.point;
  closest.t = face_intersection.t;
  max_t = face_intersection.t;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rcx, %rbx
movsd %xmm0, (%rsp)
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r13
movq 0xc0(%rsp), %r15
testq %r8, %r8
je 0x17382
movq %r8, %rax
leaq 0x18(%r12), %rsi
movq (%r13), %rdx
movq %r12, %rdi
movq %r15, %rcx
movq %r9, %r8
callq *%rax
testl %eax, %eax
je 0x17480
movq (%r13), %rdi
movq %r15, %rsi
callq 0x1375e
leaq 0x50(%rsp), %rbp
movq %rbp, %rdi
movq %rax, %rsi
callq 0x493b0
movq %rbp, %rdi
movq %rbp, %rsi
callq 0x4961a
leaq 0xcc818(%rip), %rax     # 0xe3bc8
movsd (%rax), %xmm1
movapd 0x82cb4(%rip), %xmm2    # 0x9a070
xorpd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
jb 0x173d0
ucomisd %xmm0, %xmm1
jae 0x17480
movq (%r13), %rdi
movq %r15, %rsi
callq 0x1375e
leaq 0x68(%rsp), %rbp
movq %rbp, %rdi
movq %rax, %rsi
callq 0x477b4
leaq 0x8(%rsp), %rcx
movq %r12, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x18a1e
testl %eax, %eax
je 0x17480
movsd 0x8(%rsp), %xmm0
movsd (%rsp), %xmm1
ucomisd %xmm0, %xmm1
ja 0x17480
ucomisd (%rbx), %xmm0
jae 0x17480
leaq 0x30(%rsp), %rbp
movq %rbp, %rdi
callq 0x48bde
movq (%r13), %rdi
movq (%rdi), %rax
leaq 0x10(%rsp), %rcx
movq %r12, %rsi
movq %r15, %rdx
callq *0x178(%rax)
testl %eax, %eax
je 0x17480
movsd 0x48(%rsp), %xmm0
movsd (%rsp), %xmm1
ucomisd %xmm0, %xmm1
ja 0x17480
ucomisd (%rbx), %xmm0
jae 0x17480
movl $0x3, (%r14)
movq %r15, 0x18(%r14)
leaq 0x20(%r14), %rdi
movq %rbp, %rsi
callq 0x48eca
movsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x38(%r14)
movsd %xmm0, (%rbx)
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshSearchTree.cpp
// Function: gaps::R3MeshSearchTree::FindIntersection(gaps::R3Ray const&, gaps::R3MeshIntersection&, double, double, int (*)(gaps::R3Point const&, gaps::R3Vector const&, gaps::R3Mesh*, gaps::R3MeshFace*, void*), void*)
void R3MeshSearchTree::
FindIntersection(const R3Ray& ray, R3MeshIntersection& closest,
  RNScalar min_t, RNScalar max_t, 
  int (*IsCompatible)(const R3Point&, const R3Vector&, R3Mesh *, R3MeshFace *, void *), void *compatible_data)
{
  // Initialize result
  closest.type = R3_MESH_NULL_TYPE;
  closest.vertex = NULL;
  closest.edge = NULL;
  closest.face = NULL;
  closest.point = R3zero_point;
  closest.t = 0;

  // Check root
  if (!root) return;

  // Update mark (used to avoid checking same face twice)
  mark++;

  // Search nodes recursively
  FindIntersection(ray, closest,
    min_t, max_t,
    IsCompatible, compatible_data, 
    root, BBox());
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %r8, %rbx
movq %rcx, %r14
movsd %xmm0, (%rsp)
movq %rdx, %r15
movsd %xmm1, 0x8(%rsp)
andl $0x0, (%rdx)
movq %rsi, %r12
movq %rdi, %r13
leaq 0x20(%rdx), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdx)
andq $0x0, 0x18(%rdx)
leaq 0x4cd58f(%rip), %rsi    # 0x4e4d80
callq 0x48eca
andq $0x0, 0x38(%r15)
movq 0x8(%r13), %rax
testq %rax, %rax
je 0x17835
incl 0x14(%r13)
movl $0xf8, %r10d
addq (%r13), %r10
leaq 0x8(%rsp), %rcx
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movsd (%rsp), %xmm0
movq %r14, %r8
movq %rbx, %r9
pushq %r10
pushq %rax
callq 0x17492
popq %rax
popq %rcx
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshSearchTree.cpp
// Function: gaps::R3MeshSearchTree::Outline(gaps::R3MeshSearchTreeNode*, gaps::R3Box const&) const
void R3MeshSearchTree::
Outline(R3MeshSearchTreeNode *node, const R3Box& node_box) const
{
  // Draw kdtree nodes recursively
  if (node->children[0]) {
    assert(node->children[1]);
    assert(node->split_coordinate >= node_box[RN_LO][node->split_dimension]);
    assert(node->split_coordinate <= node_box[RN_HI][node->split_dimension]);
    R3Box child0_box(node_box);
    R3Box child1_box(node_box);
    child0_box[RN_HI][node->split_dimension] = node->split_coordinate;
    child1_box[RN_LO][node->split_dimension] = node->split_coordinate;
    Outline(node->children[0], child0_box);
    Outline(node->children[1], child1_box);
  }
  else {
    node_box.Outline();
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x70, %rsp
movq %rdx, %r15
cmpq $0x0, 0x8(%rsi)
je 0x178c7
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x38(%rsp), %rdi
movq %r15, %rsi
callq 0x35c9e
movq %rsp, %rdi
movq %r15, %rsi
callq 0x35c9e
movsd 0x18(%r14), %xmm0
movslq 0x20(%r14), %rax
movsd %xmm0, 0x58(%rsp,%rax,8)
movsd %xmm0, 0x8(%rsp,%rax,8)
movq 0x8(%r14), %rsi
leaq 0x38(%rsp), %rdx
movq %rbx, %rdi
callq 0x17844
movq 0x10(%r14), %rsi
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x17844
movq %rsp, %rdi
callq 0x36966
leaq 0x38(%rsp), %rdi
callq 0x36966
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq (%r15), %rax
movq 0xb0(%rax), %rax
pushq $0x1
popq %rsi
movq %r15, %rdi
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
jmpq *%rax
movq %rax, %rbx
jmp 0x178f2
movq %rax, %rbx
movq %rsp, %rdi
callq 0x36966
leaq 0x38(%rsp), %rdi
callq 0x36966
movq %rbx, %rdi
callq 0xe820
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshSearchTree.cpp
// Function: gaps::R3MeshSearchTree::Print(gaps::R3MeshSearchTreeNode*, int) const
int R3MeshSearchTree::
Print(R3MeshSearchTreeNode *node, int depth) const
{
  // Check node
  if (!node) return 0;

  // Initialize number of decendents
  int ndecendents0 = 0;
  int ndecendents1 = 0;

  // Process interior node
  if (node->children[0] && node->children[1]) {
    // Print balance of children
    ndecendents0 = Print(node->children[0], depth+1);
    ndecendents1 = Print(node->children[1], depth+1);

    // Print balance of this node
    printf("%d", depth);
    for (int i = 0; i <= depth; i++) printf("  ");
    printf("I %d : %d %d %g\n", node->big_faces.NEntries(), ndecendents0, ndecendents1, (double) ndecendents0 / (double) ndecendents1);
  }
  else {
    printf("%d", depth);
    for (int i = 0; i <= depth; i++) printf("  ");
    printf("L %d \n", node->small_faces.NEntries());
  }

  // Return number of nodes rooted in this subtree
  return 1 + ndecendents0 + ndecendents1;
}

// Assembly:
testq %rsi, %rsi
je 0x179d8
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %rbx
movq 0x8(%rsi), %rsi
testq %rsi, %rsi
je 0x17995
cmpq $0x0, 0x10(%rbx)
je 0x17995
movq %rdi, %r12
leal 0x1(%r14), %ebp
movl %ebp, %edx
callq 0x1791c
movl %eax, %r15d
movq 0x10(%rbx), %rsi
movq %r12, %rdi
movl %ebp, %edx
callq 0x1791c
movl %eax, %r12d
leaq 0x8c16b(%rip), %rdi     # 0xa3ada
movl %r14d, %esi
xorl %eax, %eax
callq 0xe070
leaq 0x8a705(%rip), %r13     # 0xa2085
xorl %ebp, %ebp
cmpl %r14d, %ebp
jg 0x179db
movq %r13, %rdi
xorl %eax, %eax
callq 0xe070
incl %ebp
jmp 0x17982
leaq 0x8c13e(%rip), %rdi     # 0xa3ada
movl %r14d, %esi
xorl %eax, %eax
callq 0xe070
leaq 0x8a6d8(%rip), %r15     # 0xa2085
xorl %ebp, %ebp
cmpl %r14d, %ebp
jg 0x179c2
movq %r15, %rdi
xorl %eax, %eax
callq 0xe070
incl %ebp
jmp 0x179af
movl 0x44(%rbx), %esi
leaq 0x82bfd(%rip), %rdi     # 0x9a5c9
xorl %eax, %eax
callq 0xe070
pushq $0x1
popq %rax
jmp 0x17a06
xorl %eax, %eax
retq
cvtsi2sd %r15d, %xmm0
movl 0x34(%rbx), %esi
cvtsi2sd %r12d, %xmm1
divsd %xmm1, %xmm0
leaq 0x82bc5(%rip), %rdi     # 0x9a5b8
movl %r15d, %edx
movl %r12d, %ecx
movb $0x1, %al
callq 0xe070
leal (%r15,%r12), %eax
incl %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/./R3Mesh.h
// Function: gaps::R3Mesh::FaceOnVertex(gaps::R3MeshVertex const*) const
inline R3MeshFace *R3Mesh:: 
FaceOnVertex(const R3MeshVertex *v) const
{
  // Returns any face connected to vertex
  for (int i = 0; i < VertexValence(v); i++) {
    R3MeshEdge *e = EdgeOnVertex(v, i);
    R3MeshFace *f = FaceOnEdge(e);
    if (f) return f;
  }

  // No face found
  return NULL;
}

// Assembly:
movl 0x14(%rsi), %ecx
xorl %edx, %edx
testl %ecx, %ecx
cmovlel %edx, %ecx
cmpq %rdx, %rcx
je 0x17ad5
movq 0x8(%rsi), %rax
movq (%rax,%rdx,8), %rdi
movq 0x20(%rdi), %rax
testq %rax, %rax
jne 0x17ad4
movq 0x18(%rdi), %rax
incq %rdx
testq %rax, %rax
je 0x17ab2
retq
xorl %eax, %eax
retq