LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/Konano[P]UselessDatabase/Table.cpp
// Function: Table::printBack(unsigned int)
bool Table::printBack(uint num) {
    if (num == 0 || sel != 1) return false;
    std::vector<std::pair<std::string, int> > v;
    for (uint i = 0; i < col_num; i++) v.push_back(std::pair<std::string, int>(col_ty[i].name, std::max(col_ty[i].printLen(), (int)strlen(col_ty[i].name))));
    Print::title(v);
    for (uint it = record_num - num; it < record_num; it++) { 
        Print::row(data[it]);
    }
    Print::end();
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
testl %esi, %esi
setne %cl
cmpl $0x1, 0x9fb0(%rdi)
sete %al
andb %cl, %al
cmpb $0x1, %al
jne 0x25bbb
movq %rdi, %r14
movl %esi, 0xc(%rsp)
movb %al, 0xb(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
cmpl $0x0, 0x54(%rdi)
je 0x25b3d
leaq 0x5a(%r14), %r15
xorl %r13d, %r13d
leaq 0x30(%rsp), %r12
leaq -0x2(%r15), %rdi
callq 0x288ee
movl %eax, %ebp
movq %r15, %rdi
callq 0x51f0
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
movq %r15, %rdi
callq 0x51f0
leaq (%rax,%r15), %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0xaccc
cmpl %ebx, %ebp
cmovgl %ebp, %ebx
movl %ebx, 0x50(%rsp)
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x17cb2
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x25b2d
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x53a0
incq %r13
movl 0x54(%r14), %eax
addq $0x38, %r15
cmpq %rax, %r13
jb 0x25ac4
leaq 0x58(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x99c8
leaq 0x58(%rsp), %rdi
callq 0x1f11e
movl 0xc(%rsp), %ebp
leaq 0x58(%rsp), %rdi
callq 0x9a62
movl 0x9fa0(%r14), %ebx
subl %ebp, %ebx
jb 0x25ba8
leaq 0x70(%rsp), %r15
movl %ebx, %eax
leaq (%rax,%rax,2), %rsi
shlq $0x3, %rsi
addq 0x9fb8(%r14), %rsi
movq %r15, %rdi
callq 0xa450
movq %r15, %rdi
callq 0x1f722
movq %r15, %rdi
callq 0xa564
incl %ebx
cmpl 0x9fa0(%r14), %ebx
jb 0x25b74
callq 0x1fa62
leaq 0x10(%rsp), %rdi
callq 0x9a62
movb 0xb(%rsp), %al
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x9a62
jmp 0x25bf4
jmp 0x25bf1
jmp 0x25bf1
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0xa564
jmp 0x25bf4
jmp 0x25bf1
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x9a62
movq %rbx, %rdi
callq 0x56e0
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x25bf4
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x53a0
jmp 0x25bf4
nop
// File: /workspace/github_cpp_makefile_star2_O1/Konano[P]UselessDatabase/Table.cpp
// Function: Table::cmpRecord(Anys, Anys, enumOp)
bool Table::cmpRecord(Anys a, Anys b, enumOp op) {
    switch (op) {
    case OP_EQ: return a == b;
    case OP_NEQ: return a != b;
    case OP_LE: return a <= b;
    case OP_LS: return a < b;
    case OP_GE: return a >= b;
    case OP_GT: return a > b;
    default: return false;
    }
}

// Assembly:
pushq %rax
cmpl $0x5, %ecx
ja 0x26155
movl %ecx, %eax
leaq 0x1ba31(%rip), %rcx     # 0x41b30
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rsi, %rdi
movq %rdx, %rsi
popq %rax
jmp 0x9abe
movq %rsi, %rdi
movq %rdx, %rsi
popq %rax
jmp 0x9b3e
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x9be2
jmp 0x26145
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x9b3e
jmp 0x26145
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x9abe
xorb $0x1, %al
jmp 0x26157
movq %rsi, %rdi
movq %rdx, %rsi
popq %rax
jmp 0x9be2
xorl %eax, %eax
popq %rcx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Konano[P]UselessDatabase/Table.cpp
// Function: Table::cmpRecords(Anys, enumOp, bool, bool)
bool Table::cmpRecords(Anys data, enumOp op, bool any, bool all) {
    bool cmp;
    Anys _data;
    Pointer p(this);
    while (p.next()) {
        _data = p.get();
        cmp = cmpRecord(data, _data, op);
        if (any && cmp) return true;
        if (all && !cmp) return false;
    }
    // for (uint record_id = 0; record_id < record_num; record_id++) {
    //     if ((_data = queryRecord(record_id)).size() == 0) continue;
    //     cmp = cmpRecord(data, _data, op);
    //     if (any && cmp) return true;
    //     if (all && !cmp) return false;
    // }
    if (any) return false;
    if (all) return true;
    return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl %ecx, 0x4(%rsp)
movl %edx, 0xc(%rsp)
movq %rsi, 0x28(%rsp)
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rax
movaps %xmm0, (%rax)
movq $0x0, 0x10(%rax)
leaq 0x90(%rsp), %r13
movq %rdi, (%r13)
movl $0xffffffff, 0x8(%r13)  # imm = 0xFFFFFFFF
movl %r8d, 0x8(%rsp)
movl %r8d, %ebx
xorb $0x1, %bl
leaq 0x78(%rsp), %r12
leaq 0x60(%rsp), %r14
movq %r13, %rdi
callq 0x20038
leaq 0x48(%rsp), %r15
testb %al, %al
je 0x2627a
movq %r15, %rdi
movq %r13, %rsi
callq 0x20100
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movaps 0x10(%rsp), %xmm0
movq 0x20(%rsp), %rax
movups 0x48(%rsp), %xmm1
movaps %xmm1, 0x10(%rsp)
movq 0x58(%rsp), %rcx
movq %rcx, 0x20(%rsp)
movaps 0x30(%rsp), %xmm1
movaps %xmm0, 0x30(%rsp)
movq %rax, 0x40(%rsp)
movups %xmm1, 0x48(%rsp)
movq $0x0, 0x58(%rsp)
leaq 0x30(%rsp), %rdi
callq 0xa564
movq %r15, %rdi
callq 0xa564
movq %r12, %rdi
movq 0x28(%rsp), %rsi
callq 0xa450
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0xa450
movq %r12, %rsi
movq %r14, %rdx
movl 0xc(%rsp), %ecx
callq 0x260f0
movl %eax, %ebp
movq %r14, %rdi
callq 0xa564
movq %r12, %rdi
callq 0xa564
movl %ebp, %r15d
andb 0x4(%rsp), %r15b
orb %bl, %bpl
cmpb %bpl, %r15b
jne 0x261b4
jmp 0x26287
movl 0x4(%rsp), %eax
notb %al
andb 0x8(%rsp), %al
movl %eax, %r15d
leaq 0x10(%rsp), %rdi
callq 0xa564
movl %r15d, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x262b8
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0xa564
leaq 0x78(%rsp), %rdi
callq 0xa564
jmp 0x262c9
jmp 0x262c6
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xa564
movq %rbx, %rdi
callq 0x56e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/Konano[P]UselessDatabase/Table.cpp
// Function: Table::existentRecords()
vector<uint> Table::existentRecords() {
    vector<uint> ret;
    BufType buf;
    for (uint record_id = 0; record_id < record_num; record_id++) {
        if (record_id % record_onepg == 0) {
            buf = bpm->getPage(main_file, record_id / record_onepg);
        }
        if (exist(buf, record_id % record_onepg)) {
            ret.push_back(record_id);
        }
    }
    return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movl $0x0, 0x4(%rsp)
cmpl $0x0, 0x9fa0(%rsi)
je 0x2681f
movq %rsi, %r14
xorl %eax, %eax
leaq 0x4(%rsp), %r15
xorl %edx, %edx
divl 0x9fac(%r14)
testl %edx, %edx
jne 0x267ca
movq 0x48(%r14), %rdi
movl 0x9fa4(%r14), %esi
movl %eax, %edx
callq 0x6768
movq %rax, %r12
movl 0x4(%rsp), %ecx
movl %ecx, %eax
xorl %edx, %edx
divl 0x9fac(%r14)
movl %edx, %eax
shrl $0x3, %eax
movzbl (%r12,%rax), %eax
andl $0x7, %edx
btl %edx, %eax
jae 0x2680c
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x26801
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x2680c
movq %rbx, %rdi
movq %r15, %rdx
callq 0x1d780
movl 0x4(%rsp), %eax
incl %eax
movl %eax, 0x4(%rsp)
cmpl 0x9fa0(%r14), %eax
jb 0x267a8
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x26845
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x53a0
movq %r14, %rdi
callq 0x56e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/Konano[P]UselessDatabase/Table.cpp
// Function: Table::removeRecords(std::vector<WhereStmt, std::allocator<WhereStmt>>&)
int Table::removeRecords(vector<WhereStmt> &where) {
    vector<uint> cols = findWheres(where);
    for (auto i: cols) {
        Pointer p(this, i);
        if (checkWheres(p.get(), where)) {
            removeRecord(i);
        }
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rdx
movq %rdi, %r14
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rdx, 0x8(%rsp)
callq 0x2684e
movq (%r15), %r12
movq 0x8(%r15), %rbx
cmpq %rbx, %r12
je 0x26cc2
leaq 0x40(%rsp), %r15
movl (%r12), %ebp
movq %r14, 0x28(%rsp)
movl %ebp, 0x30(%rsp)
cmpl $-0x1, %ebp
je 0x26c82
movq 0x48(%r14), %rdi
movl 0x9fa4(%r14), %esi
movl %ebp, %eax
xorl %edx, %edx
divl 0x9fac(%r14)
movl %eax, %edx
callq 0x6768
movq %rax, 0x38(%rsp)
movq %r15, %rdi
leaq 0x28(%rsp), %rsi
callq 0x20100
movq %r14, %rdi
movq %r15, %rsi
movq 0x8(%rsp), %rdx
callq 0x26616
movl %eax, %r13d
movq %r15, %rdi
callq 0xa564
testb %r13b, %r13b
je 0x26cb9
movq %r14, %rdi
movl %ebp, %esi
callq 0x2234e
addq $0x4, %r12
cmpq %rbx, %r12
jne 0x26c4e
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x26cd9
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x53a0
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0xa564
jmp 0x26cfc
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x26d13
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x53a0
movq %rbx, %rdi
callq 0x56e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/Konano[P]UselessDatabase/./Any.h
// Function: Any& Any::operator=<int>(int const&)
Any &operator=(const ValueType &value)
    {
        Any tmp(value);
        if (_pValue)
            delete _pValue;
        _pValue = tmp._pValue;
        tmp._pValue = nullptr;
        return *this;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movl $0x10, %edi
callq 0x5390
movq %rax, %r14
leaq 0x2b27f(%rip), %rax     # 0x53a78
movq %rax, (%r14)
movl (%r15), %eax
movl %eax, 0x8(%r14)
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x28811
movq (%rdi), %rax
callq *0x8(%rax)
movq %r14, (%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Konano[P]UselessDatabase/./Key.h
// Function: Key::operator!=(Key const&)
bool operator==(const Key& b) {
        if (v_size != b.size()) return false;
        for (uint i = 0; i < v_size; i++) {
            if (v[i] != b[i]) return false;
        }
        return true;
    }

// Assembly:
movl 0x8(%rdi), %ecx
cmpl 0x8(%rsi), %ecx
jne 0x288e8
testq %rcx, %rcx
sete %al
je 0x288ea
movq 0x30(%rdi), %rax
movq 0x30(%rsi), %rdx
movl (%rax), %esi
cmpl (%rdx), %esi
jne 0x288e8
movl $0x1, %edi
movq %rdi, %rsi
cmpl %esi, %ecx
je 0x288e1
movl (%rax,%rsi,4), %r8d
movslq %esi, %r9
leaq 0x1(%rsi), %rdi
cmpl (%rdx,%r9,4), %r8d
je 0x288c9
cmpl %ecx, %esi
setae %al
jmp 0x288ea
xorl %eax, %eax
xorb $0x1, %al
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Konano[P]UselessDatabase/main.cpp
// Function: main
int main() {
    // test_0();
    // test_1();
    // test_2();
    // test_3();
    // test_4();
    // test_5();
    // test_6();
    // test_7();
    // test_8();
    // test_9();
    // import_data_csv();
    import_data_tbl();
    cout << "import finish" << endl; 
    yyparse();
    return 0;
}

// Assembly:
pushq %rbx
callq 0x2a76f
movq 0x25c2c(%rip), %rbx     # 0x53fc8
leaq 0x14082(%rip), %rsi     # 0x42425
movl $0xd, %edx
movq %rbx, %rdi
callq 0x5440
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5370
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5050
movq %rax, %rdi
callq 0x52a0
callq 0x314b0
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/ridgelab[P]Kmer-SSR/test/src/ssr.cpp
// Function: main
int main()
{
	SSR ssr1();
	SSR ssr2("ACGT", 4, 32);

	//cout << ssr2.toString() << endl;

	cout << "\n\033[0;34mSSR Test: ";

	bool pass = true;

	if (pass)
	{
		cout << "\033[0;32mOK\033[0m" << endl;
	}
	else
	{
		cout << "\033[0;31mFAIL\033[0m" << endl;
	}

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xc31(%rip), %rsi       # 0x3004
leaq 0xc2e(%rip), %rdx       # 0x3008
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x24b6
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
movl $0x4, %edx
movl $0x20, %ecx
callq 0x255e
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x2412
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2170
movq 0x2bbf(%rip), %rdi      # 0x4fd8
leaq 0xbe9(%rip), %rsi       # 0x3009
movl $0x12, %edx
callq 0x2180
movq 0x2ba7(%rip), %rbx      # 0x4fd8
leaq 0xbe4(%rip), %rsi       # 0x301c
movl $0xd, %edx
movq %rbx, %rdi
callq 0x2180
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq 0x2b75(%rip), %rdi      # 0x4fd8
callq 0x2030
movq %rax, %rdi
callq 0x20e0
leaq 0x20(%rsp), %rdi
callq 0x25b6
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
retq
jmp 0x24a1
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x24ae
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2170
jmp 0x24ae
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x25b6
movq %rbx, %rdi
callq 0x2220
// File: /workspace/github_cpp_makefile_star2_O1/ridgelab[P]Kmer-SSR/src/OutputFile.cpp
// Function: OutputFile::setUp(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void OutputFile::setUp(const string &file_name)
{
	this->setUp();

	this->out_file.open(file_name.c_str());
	
	if (!this->out_file.is_open())
	{
		exit(1);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0x200, %rdi            # imm = 0x200
xorl %esi, %esi
movl $0x1, %edx
callq 0x2140
movq (%rbx), %rsi
movq %r14, %rdi
movl $0x10, %edx
callq 0x2040
addq $0x70, %r14
movq %r14, %rdi
callq 0x2050
testb %al, %al
je 0x291b
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x1, %edi
callq 0x2190
nop
// File: /workspace/github_cpp_makefile_star2_O1/ridgelab[P]Kmer-SSR/src/OutputFile.cpp
// Function: OutputFile::writeHeaders(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&)
void OutputFile::writeHeaders(const vector<string> &headers)
{
	sem_wait(&(this->lock));
	for (uint32_t i = 0; i < headers.size(); i++)
	{
		this->out_file << headers[i];
		if ( (headers[i].size() > 0) && (headers[i].at(headers[i].size() - 1) != '\n') )
		{
			this->out_file << endl;
		}
	}
	sem_post(&(this->lock));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x200(%rdi), %r14
movq %r14, %rdi
callq 0x20c0
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x2b1a
movl $0x1, %ebp
xorl %r12d, %r12d
shlq $0x5, %r12
movq (%rax,%r12), %rsi
movq 0x8(%rax,%r12), %rdx
movq %r15, %rdi
callq 0x2180
movq (%rbx), %rax
movq 0x8(%rax,%r12), %rcx
testq %rcx, %rcx
je 0x2b02
addq %r12, %rax
movq (%rax), %rax
cmpb $0xa, -0x1(%rax,%rcx)
je 0x2b02
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20e0
movl %ebp, %r12d
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
incl %ebp
cmpq %r12, %rcx
ja 0x2aac
movq %r14, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x21e0
// File: /workspace/github_cpp_makefile_star2_O1/ridgelab[P]Kmer-SSR/src/OutputFile.cpp
// Function: OutputFile::changeFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void OutputFile::changeFile(const string &file_name)
{
	sem_wait(&(this->lock));
	if (this->out_file.is_open())
	{
		this->out_file.close();
	}
	this->out_file.open(file_name.c_str());
	if (!this->out_file.is_open())
	{
		exit(1);
	}
	sem_post(&(this->lock));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r12
movq %rdi, %r15
leaq 0x200(%rdi), %rbx
movq %rbx, %rdi
callq 0x20c0
leaq 0x70(%r15), %r14
movq %r14, %rdi
callq 0x2050
testb %al, %al
je 0x2ba3
movq %r15, %rdi
callq 0x21a0
movq (%r12), %rsi
movq %r15, %rdi
movl $0x10, %edx
callq 0x2040
movq %r14, %rdi
callq 0x2050
testb %al, %al
je 0x2bd3
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x21e0
movl $0x1, %edi
callq 0x2190
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::R3Mesh()
R3Mesh::
R3Mesh(void) 
  : vertex_block(NULL),
    edge_block(NULL),
    face_block(NULL),
    vbo_face_position_buffer(0),
    vbo_face_normal_buffer(0),
    vbo_face_texcoord_buffer(0),
    vbo_face_rgb_color_buffer(0),
    vbo_face_pick_color_buffer(0),
    vbo_vertex_position_buffer(0),
    vbo_vertex_normal_buffer(0),
    vbo_vertex_texcoord_buffer(0),
    vbo_vertex_rgb_color_buffer(0),
    vbo_vertex_pick_color_buffer(0),
    bbox(R3null_box),
    data(NULL)
{
  // Initialize name
  name[0] = '\0';

  // Just checking
  assert(IsValid());
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
leaq 0xcfe76(%rip), %rax     # 0xe1400
movq %rax, (%rdi)
leaq 0x8(%rdi), %rbx
movq %rbx, %rdi
callq 0x705ec
leaq 0x18(%r15), %r14
movq %r14, %rdi
callq 0x705ec
leaq 0x28(%r15), %r12
movq %r12, %rdi
callq 0x705ec
leaq 0xf8(%r15), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x68(%r15)
movups %xmm0, 0x58(%r15)
movups %xmm0, 0x48(%r15)
movups %xmm0, 0x38(%r15)
leaq 0xd48c2(%rip), %rsi     # 0xe5e98
callq 0x274f0
movq $0x0, 0x130(%r15)
movb $0x0, 0x78(%r15)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r15
movq %r12, %rdi
callq 0x70656
jmp 0x11607
movq %rax, %r15
movq %r14, %rdi
callq 0x70656
jmp 0x11614
movq %rax, %r15
movq %rbx, %rdi
callq 0x70656
movq %r15, %rdi
callq 0xe7e0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::Centroid() const
R3Point R3Mesh::
Centroid(void) const
{
  // Return centroid of mesh
  RNArea area = 0;
  R3Point centroid(0,0,0);
  if (NFaces() > 0) {
    for (int i = 0; i < NFaces(); i++) {
      R3MeshFace *face = Face(i);
      RNArea face_area = FaceArea(face);
      R3Point face_centroid = FaceCentroid(face);
      centroid += face_area * face_centroid;
      area += face_area;
    }
  }
  else {
    for (int i = 0; i < NVertices(); i++) {
      R3MeshVertex *vertex = Vertex(i);
      centroid += VertexPosition(vertex);
      area += 1.0;
    }
  }

  // Return centroid
  if (area == 0) return centroid;
  else return centroid / area;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movq %rdi, 0x10(%rsp)
leaq 0x20(%rsp), %rdi
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x3ca26
cmpl $0x0, 0x34(%r14)
jle 0x11bcf
cmpl $0x0, 0x34(%r14)
xorpd %xmm0, %xmm0
jle 0x11c15
xorl %ebx, %ebx
leaq 0x50(%rsp), %r15
leaq 0x38(%rsp), %r12
leaq 0x20(%rsp), %r13
movsd %xmm0, 0x8(%rsp)
movq 0x28(%r14), %rax
movq (%rax,%rbx,8), %rbp
testb $0x2, 0xa8(%rbp)
jne 0x11b80
movq (%r14), %rax
movq %r14, %rdi
movq %rbp, %rsi
callq *0x2c0(%rax)
movsd 0x90(%rbp), %xmm0
movsd %xmm0, 0x18(%rsp)
movq %r15, %rdi
movq %rbp, %rdx
callq 0x11c54
movq %r12, %rdi
movq %r15, %rsi
movsd 0x18(%rsp), %xmm0
callq 0x3d470
movq %r13, %rdi
movq %r12, %rsi
callq 0x3d366
movsd 0x8(%rsp), %xmm0
addsd 0x18(%rsp), %xmm0
incq %rbx
movslq 0x34(%r14), %rax
cmpq %rax, %rbx
jl 0x11b5a
jmp 0x11c15
cmpl $0x0, 0x14(%r14)
xorpd %xmm0, %xmm0
jle 0x11c15
xorl %ebx, %ebx
leaq 0x20(%rsp), %r15
movsd %xmm0, 0x8(%rsp)
movq 0x8(%r14), %rax
movq (%rax,%rbx,8), %rsi
addq $0x18, %rsi
movq %r15, %rdi
callq 0x3d366
movsd 0x8(%rsp), %xmm0
addsd 0x9042f(%rip), %xmm0    # 0xa2038
incq %rbx
movslq 0x14(%r14), %rax
cmpq %rax, %rbx
jl 0x11be1
xorpd %xmm1, %xmm1
leaq 0x20(%rsp), %rsi
ucomisd %xmm1, %xmm0
jne 0x11c35
jp 0x11c35
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x3ca36
jmp 0x11c42
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x3d492
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::FaceCentroid(gaps::R3MeshFace const*) const
R3Point R3Mesh::
FaceCentroid(const R3MeshFace *f) const
{
  // Return face centroid
  R3Point centroid = R3zero_point;
  centroid += f->vertex[0]->position;
  centroid += f->vertex[1]->position;
  centroid += f->vertex[2]->position;
  return centroid / 3.0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdx, %r15
movq %rdi, %rbx
leaq 0x4d4df6(%rip), %rsi    # 0x4e6a60
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x3ca36
movq 0x8(%r15), %rsi
addq $0x18, %rsi
movq %r14, %rdi
callq 0x3d366
movq 0x10(%r15), %rsi
addq $0x18, %rsi
movq %r14, %rdi
callq 0x3d366
movq 0x18(%r15), %rsi
addq $0x18, %rsi
movq %r14, %rdi
callq 0x3d366
movsd 0x90529(%rip), %xmm0    # 0xa21d8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3d492
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::Area() const
RNArea R3Mesh::
Area(void) const
{
  // Return area of mesh
  RNArea area = 0;
  for (int i = 0; i < NFaces(); i++) {
    R3MeshFace *face = Face(i);
    RNArea face_area = FaceArea(face);
    area += face_area;
  }

  // Return total area
  return area;
}

// Assembly:
cmpl $0x0, 0x34(%rdi)
jle 0x11d2d
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
xorpd %xmm0, %xmm0
xorl %r15d, %r15d
movq 0x28(%rbx), %rax
movq (%rax,%r15,8), %r14
testb $0x2, 0xa8(%r14)
jne 0x11d0e
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
movsd %xmm0, 0x8(%rsp)
callq *0x2c0(%rax)
movsd 0x8(%rsp), %xmm0
addsd 0x90(%r14), %xmm0
incq %r15
movslq 0x34(%rbx), %rax
cmpq %rax, %r15
jl 0x11ce1
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
xorps %xmm0, %xmm0
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::AverageRadius(gaps::R3Point const*) const
RNLength R3Mesh::
AverageRadius(const R3Point *center) const
{
  // Get centroid
  R3Point centroid = (center) ? *center : Centroid();

  // Check if mesh has faces
  if (NFaces() > 0) {
    // Compute average distance between a position on the surface and a center point
    RNArea area = 0;
    RNLength distance = 0;
    for (int i = 0; i < NFaces(); i++) {
      R3MeshFace *face = Face(i);
      RNArea face_area = FaceArea(face);
      R3Point face_centroid = FaceCentroid(face);
      distance += face_area * R3Distance(face_centroid, centroid);
      area += face_area;
    }

    // Return weighted average
    if (area == 0) return 0;
    else return distance / area;
  }
  else if (NVertices() > 0) {
    // Sum distances between vertices and center point
    RNLength sum = 0;
    for (int i = 0; i < NVertices(); i++) {
      R3MeshVertex *vertex = Vertex(i);
      const R3Point& position = VertexPosition(vertex);
      sum += R3Distance(position, centroid);
    }

    // Return average
    return sum / NVertices();
  }

  // Should not get here unless mesh is empty
  return 0.0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %rdi
testq %rsi, %rsi
je 0x11d53
callq 0x3ca36
jmp 0x11d5b
movq %rbx, %rsi
callq 0x11b04
cmpl $0x0, 0x34(%rbx)
jle 0x11e13
cmpl $0x0, 0x34(%rbx)
xorpd %xmm2, %xmm2
xorpd %xmm0, %xmm0
jle 0x11e00
xorl %r13d, %r13d
leaq 0x48(%rsp), %r14
leaq 0x18(%rsp), %r15
movapd %xmm2, 0x30(%rsp)
movsd %xmm0, (%rsp)
movq 0x28(%rbx), %rax
movq (%rax,%r13,8), %r12
testb $0x2, 0xa8(%r12)
jne 0x11db1
movq (%rbx), %rax
movq %rbx, %rdi
movq %r12, %rsi
callq *0x2c0(%rax)
movsd 0x90(%r12), %xmm0
movsd %xmm0, 0x10(%rsp)
movq %r14, %rdi
movq %r12, %rdx
callq 0x11c54
movq %r14, %rdi
movq %r15, %rsi
callq 0x49efc
movsd 0x10(%rsp), %xmm1
mulsd %xmm1, %xmm0
movapd 0x30(%rsp), %xmm2
addsd %xmm0, %xmm2
movsd (%rsp), %xmm0
addsd %xmm1, %xmm0
incq %r13
movslq 0x34(%rbx), %rax
cmpq %rax, %r13
jl 0x11d84
divsd %xmm0, %xmm2
xorpd %xmm1, %xmm1
cmpeqsd %xmm0, %xmm1
andnpd %xmm2, %xmm1
jmp 0x11e6b
cmpl $0x0, 0x14(%rbx)
jle 0x11e67
movl 0x14(%rbx), %eax
xorpd %xmm1, %xmm1
testl %eax, %eax
jle 0x11e5a
xorl %r15d, %r15d
leaq 0x18(%rsp), %r14
movapd %xmm1, (%rsp)
movq 0x8(%rbx), %rax
movq (%rax,%r15,8), %rdi
addq $0x18, %rdi
movq %r14, %rsi
callq 0x49efc
movapd (%rsp), %xmm1
addsd %xmm0, %xmm1
incq %r15
movslq 0x14(%rbx), %rax
cmpq %rax, %r15
jl 0x11e2c
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd %xmm0, %xmm1
jmp 0x11e6b
xorpd %xmm1, %xmm1
movapd %xmm1, %xmm0
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::AverageEdgeLength() const
RNLength R3Mesh::
AverageEdgeLength(void) const
{
  // Check number of edges
  if (NEdges() == 0) return 0;

  // Sum edge lengths
  RNLength sum = 0;
  for (int i = 0; i < NEdges(); i++) {
    R3MeshEdge *edge = Edge(i);
    sum += EdgeLength(edge);
  }

  // Return average
  return sum / NEdges();
}

// Assembly:
cmpl $0x0, 0x24(%rdi)
je 0x11f30
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl 0x24(%rdi), %eax
xorpd %xmm0, %xmm0
testl %eax, %eax
jle 0x11f1e
xorl %r15d, %r15d
movq 0x18(%rbx), %rax
movq (%rax,%r15,8), %r14
testb $0x2, 0x38(%r14)
jne 0x11f0c
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
movsd %xmm0, 0x8(%rsp)
callq *0x2b8(%rax)
movsd 0x8(%rsp), %xmm0
addsd 0x28(%r14), %xmm0
incq %r15
movslq 0x24(%rbx), %rax
cmpq %rax, %r15
jl 0x11ee2
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::AverageEdgeInteriorAngle() const
RNAngle R3Mesh::
AverageEdgeInteriorAngle(void) const
{
  // Sum dihedral angles
  int count = 0;
  RNAngle sum = 0.0;
  for (int i = 0; i < NEdges(); i++) {
    R3MeshEdge *edge = Edge(i);
    RNAngle angle = EdgeInteriorAngle(edge);
    if (RNIsZero(angle)) continue;
    sum += angle;
    count++;
  }

  // Return average
  return (count > 0) ? sum / count : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x0, 0x24(%rdi)
jle 0x11faf
movq %rdi, %rbx
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
xorl %r14d, %r14d
leaq 0xd3c41(%rip), %r15     # 0xe5b98
xorl %ebp, %ebp
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rsi
movq %rbx, %rdi
callq 0x11fe4
movsd (%r15), %xmm1
movapd %xmm0, %xmm2
cmpnlepd %xmm1, %xmm2
xorpd 0x900a1(%rip), %xmm1    # 0xa2020
cmpnlepd %xmm0, %xmm1
orpd %xmm2, %xmm1
movq %xmm1, %rax
testb $0x1, %al
je 0x11f9f
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
subl %eax, %ebp
incq %r14
movslq 0x24(%rbx), %rax
cmpq %rax, %r14
jl 0x11f59
jmp 0x11fba
xorl %ebp, %ebp
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
testl %ebp, %ebp
jg 0x11fc4
xorpd %xmm0, %xmm0
jmp 0x11fd8
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
movsd (%rsp), %xmm1
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::EGINormalizationTransformation(int, int, int) const
R3Affine R3Mesh::
EGINormalizationTransformation(RNBoolean translate, RNBoolean rotate, int scale) const
{
  // Initialize transformation
  R3Affine affine(R3identity_affine);

  // Compute center of mass
  R3Point centroid = Centroid();

  // Translate center of mass back to original (if not translating)
  if (!translate) {
    affine.Translate(centroid.Vector());
  }

  // Scale by inverse of radius
  if ((scale != 0) && (scale != 2)) {
    RNScalar radius = AverageRadius(&centroid);
    if (RNIsPositive(radius)) affine.Scale(1.0 / radius);
  }

  // Rotate to align EGI axes with XYZ
  if (rotate) {
    R3Triad triad = EGIAxes();
    affine.Transform(R3Affine(triad.InverseMatrix()));
  }

  // Translate center of mass to origin
  affine.Translate(-(centroid.Vector()));
  
  // Return transformation
  return affine;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1f8, %rsp            # imm = 0x1F8
movl %r8d, %r12d
movl %ecx, 0x4(%rsp)
movl %edx, %r13d
movq %rsi, %r15
movq %rdi, %rbx
leaq 0xcf7d8(%rip), %rax     # 0xe20e8
addq $0x10, %rax
movq %rax, (%rdi)
leaq 0x8(%rdi), %r14
leaq 0xd36de(%rip), %rbp     # 0xe6000
leaq 0x8(%rbp), %rsi
movq %r14, %rdi
callq 0x2c5ba
movl $0x88, %esi
leaq (%rbx,%rsi), %rdi
addq 0xd26a2(%rip), %rsi     # 0xe4fe0
callq 0x2c5ba
movq 0x108(%rbp), %rax
movq %rax, 0x108(%rbx)
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x11b04
testl %r13d, %r13d
jne 0x12999
movsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
leaq 0xa0(%rsp), %rdi
callq 0x3d4be
leaq 0xa0(%rsp), %rsi
movq %r14, %rdi
callq 0x2d6f4
andb $-0x3, 0x108(%rbx)
testl $0xfffffffd, %r12d      # imm = 0xFFFFFFFD
je 0x129db
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x11d32
leaq 0xd31e2(%rip), %rax     # 0xe5b98
ucomisd (%rax), %xmm0
jbe 0x129db
movsd 0x8f674(%rip), %xmm1    # 0xa2038
divsd %xmm0, %xmm1
movq %r14, %rdi
movapd %xmm1, %xmm0
callq 0x2d8a2
andb $-0x3, 0x108(%rbx)
cmpl $0x0, 0x4(%rsp)
je 0x12a47
leaq 0x8f939(%rip), %rdi     # 0xa2322
xorl %eax, %eax
callq 0x72942
leaq 0xd37c1(%rip), %rsi     # 0xe61b8
leaq 0x1b0(%rsp), %rdi
callq 0x2ad8e
leaq 0x20(%rsp), %rdi
leaq 0x1b0(%rsp), %rsi
callq 0x2af90
leaq 0xa0(%rsp), %rdi
leaq 0x20(%rsp), %rsi
xorl %edx, %edx
callq 0x2a22e
leaq 0xa0(%rsp), %rsi
movq %rbx, %rdi
callq 0x2a3ea
leaq 0xa0(%rsp), %rdi
callq 0x2a27c
movsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
leaq 0x20(%rsp), %rdi
callq 0x3d4be
leaq 0xa0(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x3e154
leaq 0xa0(%rsp), %rsi
movq %r14, %rdi
callq 0x2d6f4
andb $-0x3, 0x108(%rbx)
movq %rbx, %rax
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0xa0(%rsp), %rdi
callq 0x2a27c
jmp 0x12acd
jmp 0x12aca
jmp 0x12aca
jmp 0x12aca
jmp 0x12aca
jmp 0x12aca
movq %rax, %r14
movq %rbx, %rdi
callq 0x2a904
jmp 0x12ad5
movq %rax, %r14
movq %rbx, %rdi
callq 0x2a27c
movq %r14, %rdi
callq 0xe7e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::VertexArea(gaps::R3MeshVertex const*) const
RNArea R3Mesh::
VertexArea(const R3MeshVertex *v) const
{
  // Return 1/3 the sum of areas of attached faces
  RNLength sum = 0;
  for (int i = 0; i < VertexValence(v); i++) {
    R3MeshEdge *e = EdgeOnVertex(v, i);
    R3MeshFace *f = FaceOnEdge(e, v, RN_CCW);
    if (!f) continue;
    sum += FaceArea(f);
  }
  return sum / 3;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x0, 0x14(%rsi)
jle 0x12cce
movq %rsi, %rbx
movq %rdi, %r14
xorpd %xmm0, %xmm0
xorl %r12d, %r12d
movq 0x8(%rbx), %rax
movq (%rax,%r12,8), %rax
xorl %ecx, %ecx
cmpq %rbx, 0x8(%rax)
setne %cl
movq 0x18(%rax,%rcx,8), %r15
testq %r15, %r15
je 0x12cc0
testb $0x2, 0xa8(%r15)
jne 0x12cb7
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
movsd %xmm0, (%rsp)
callq *0x2c0(%rax)
movsd (%rsp), %xmm0
addsd 0x90(%r15), %xmm0
incq %r12
movslq 0x14(%rbx), %rax
cmpq %rax, %r12
jl 0x12c79
jmp 0x12cd2
xorpd %xmm0, %xmm0
divsd 0x8f4fe(%rip), %xmm0    # 0xa21d8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::VertexAverageEdgeLength(gaps::R3MeshVertex const*) const
RNLength R3Mesh:: 
VertexAverageEdgeLength(const R3MeshVertex *v) const
{
  // Check number of edges
  if (VertexValence(v) == 0) return 0;

  // Returns the average length of edges attached to vertex
  RNLength sum = 0;
  for (int i = 0; i < VertexValence(v); i++) {
    R3MeshEdge *e = EdgeOnVertex(v, i);
    RNLength length = EdgeLength(e);
    sum += length;
  }
  return sum / VertexValence(v);
}

// Assembly:
cmpl $0x0, 0x14(%rsi)
je 0x12d44
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl 0x14(%rsi), %eax
testl %eax, %eax
jle 0x12d48
movq %rdi, %r14
xorpd %xmm0, %xmm0
xorl %r12d, %r12d
movq 0x8(%rbx), %rax
movq (%rax,%r12,8), %r15
testb $0x2, 0x38(%r15)
jne 0x12d30
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
movsd %xmm0, (%rsp)
callq *0x2b8(%rax)
movsd (%rsp), %xmm0
addsd 0x28(%r15), %xmm0
incq %r12
movslq 0x14(%rbx), %rax
cmpq %rax, %r12
jl 0x12d08
jmp 0x12d4c
xorps %xmm0, %xmm0
retq
xorpd %xmm0, %xmm0
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::VertexGaussCurvature(gaps::R3MeshVertex const*) const
RNScalar R3Mesh::
VertexGaussCurvature(const R3MeshVertex *v) const
{
  // Sum areas and interior angles of adjacent faces
  RNArea area = 0;
  RNAngle angle = 0;
  const R3Point& p = VertexPosition(v);
  for (int i = 0; i < VertexValence(v); i++) {
    R3MeshEdge *e1 = EdgeOnVertex(v, i);
    if (!e1) { angle = 0; area = 0; break; }
    R3MeshVertex *v1 = VertexAcrossEdge(e1, v);
    R3MeshEdge *e2 = EdgeOnVertex(v, e1, RN_CCW);
    if (!e2) { angle = 0; area = 0; break; }
    R3MeshVertex *v2 = VertexAcrossEdge(e2, v);
    R3MeshFace *f = FaceOnVertex(v, e1, RN_CCW);
    if (!f) { angle = 0; area = 0; break; }
    const R3Point& p1 = VertexPosition(v1);
    const R3Point& p2 = VertexPosition(v2);
    angle += R3InteriorAngle(p1 - p, p2 - p);
    area += FaceArea(f);
  }

  // Compute curvature using Gauss-Bonet
  RNScalar curvature = (area > 0) ? 3  * (RN_TWO_PI - angle) / area : 0;

  // Return Gauss curvature
  return curvature;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, (%rsp)
cmpl $0x0, 0x14(%rsi)
xorpd %xmm1, %xmm1
xorpd %xmm3, %xmm3
jle 0x12ed1
movq %rsi, %rbx
leaq 0x18(%rsi), %rax
movq %rax, 0x10(%rsp)
xorpd %xmm0, %xmm0
xorl %r13d, %r13d
xorpd %xmm2, %xmm2
movq 0x10(%rsp), %r14
movq 0x8(%rbx), %rax
movq (%rax,%r13,8), %rax
testq %rax, %rax
je 0x12eab
movq 0x8(%rax), %rsi
movl $0x20, %ecx
cmpq %rbx, %rsi
jne 0x12dc8
movq 0x10(%rax), %rsi
movl $0x18, %ecx
movq (%rax,%rcx), %rbp
testq %rbp, %rbp
je 0x12de3
cmpq %rbx, 0x8(%rbp)
je 0x12de7
cmpq %rbx, 0x10(%rbp)
je 0x12dee
cmpq %rbx, 0x18(%rbp)
je 0x12df5
xorl %eax, %eax
jmp 0x12dff
movl $0x30, %eax
jmp 0x12dfa
movl $0x20, %eax
jmp 0x12dfa
movl $0x28, %eax
movq (%rbp,%rax), %rax
testq %rax, %rax
je 0x12eab
movq 0x8(%rax), %r12
cmpq %rbx, %r12
jne 0x12e15
movq 0x10(%rax), %r12
xorpd %xmm1, %xmm1
xorpd %xmm3, %xmm3
testq %rbp, %rbp
setne %al
je 0x12eb5
movsd %xmm2, 0x18(%rsp)
movsd %xmm0, 0x20(%rsp)
addq $0x18, %rsi
addq $0x18, %r12
leaq 0x28(%rsp), %rdi
movq %r14, %rdx
callq 0x3cc88
leaq 0x40(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x3cc88
leaq 0x28(%rsp), %rdi
movq %r15, %rsi
callq 0x4c77b
testb $0x2, 0xa8(%rbp)
jne 0x12e8f
movq (%rsp), %rdi
movq (%rdi), %rax
movq %rbp, %rsi
movsd %xmm0, 0x8(%rsp)
callq *0x2c0(%rax)
movsd 0x8(%rsp), %xmm0
movsd 0x20(%rsp), %xmm3
addsd 0x90(%rbp), %xmm3
movsd 0x18(%rsp), %xmm1
addsd %xmm0, %xmm1
movb $0x1, %al
jmp 0x12eb5
xorl %eax, %eax
xorpd %xmm1, %xmm1
xorpd %xmm3, %xmm3
testb %al, %al
je 0x12ed1
incq %r13
movslq 0x14(%rbx), %rax
movapd %xmm3, %xmm0
movapd %xmm1, %xmm2
cmpq %rax, %r13
jl 0x12da0
leaq 0x970f0(%rip), %rax     # 0xa9fc8
movsd (%rax), %xmm2
subsd %xmm1, %xmm2
mulsd 0x8f2f0(%rip), %xmm2    # 0xa21d8
divsd %xmm3, %xmm2
xorpd %xmm0, %xmm0
cmpltsd %xmm3, %xmm0
andpd %xmm2, %xmm0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::VertexMeanCurvature(gaps::R3MeshVertex const*) const
RNScalar R3Mesh::
VertexMeanCurvature(const R3MeshVertex *v) const
{
  // Compute signed length of laplacian vector projected onto normal
  RNArea area = VertexArea(v);
  if (area == 0) return 0;
  R3Vector laplacian = VertexLaplacianVector(v);
  RNScalar curvature = -1 * laplacian.Dot(VertexNormal(v));
  return curvature;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x12c5e
movapd %xmm0, %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x12f2a
jnp 0x12f64
movq %rsp, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x12f6c
testb $0x2, 0x78(%rbx)
jne 0x12f4d
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *0x2b0(%rax)
addq $0x30, %rbx
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x3d756
xorpd 0x8f0bc(%rip), %xmm0    # 0xa2020
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::EdgeDirection(gaps::R3MeshEdge const*) const
R3Vector R3Mesh:: 
EdgeDirection(const R3MeshEdge *e) const
{
  // Returns the normalized vector pointing in direction of the edge
  R3Vector vector = EdgeVector(e);
  RNLength d = EdgeLength(e);
  if (RNIsPositive(d)) vector /= d;
  return vector;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x8(%rdx), %rdx
movq 0x10(%r14), %rsi
addq $0x18, %rsi
addq $0x18, %rdx
callq 0x3cc88
testb $0x2, 0x38(%r14)
jne 0x1316f
movq (%r15), %rax
movq %r15, %rdi
movq %r14, %rsi
callq *0x2b8(%rax)
movsd 0x28(%r14), %xmm0
leaq 0xd2a1c(%rip), %rax     # 0xe5b98
ucomisd (%rax), %xmm0
jbe 0x1318a
movq %rbx, %rdi
callq 0x3e0ec
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::EdgeNormal(gaps::R3MeshEdge const*) const
R3Vector R3Mesh::
EdgeNormal(const R3MeshEdge *e) const
{
  // Return the normal to the surface at the edge
  R3Vector normal = R3zero_vector;
  R3MeshFace *f0 = FaceOnEdge(e, 0);
  R3MeshFace *f1 = FaceOnEdge(e, 1);
  if (f0) normal += FaceNormal(f0);
  if (f1) normal += FaceNormal(f1);
  normal.Normalize();
  return normal;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x95534(%rip), %rsi     # 0xa86e0
callq 0x3d4ce
movq 0x18(%r15), %r12
movq 0x20(%r15), %r15
testq %r12, %r12
je 0x131e7
testb $0x4, 0xa8(%r12)
jne 0x131d8
movq (%r14), %rax
movq %r14, %rdi
movq %r12, %rsi
callq *0x2c8(%rax)
addq $0x38, %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3deb0
testq %r15, %r15
je 0x13214
testb $0x4, 0xa8(%r15)
jne 0x13205
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x2c8(%rax)
addq $0x38, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3deb0
movq %rbx, %rdi
callq 0x3d7e0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::FaceColor(gaps::R3MeshFace const*) const
RNRgb R3Mesh:: 
FaceColor(const R3MeshFace *f) const
{
  R3MeshVertex *v0 = VertexOnFace(f, 0);
  R3MeshVertex *v1 = VertexOnFace(f, 1);
  R3MeshVertex *v2 = VertexOnFace(f, 2);
  const RNRgb& c0 = VertexColor(v0);
  const RNRgb& c1 = VertexColor(v1);
  const RNRgb& c2 = VertexColor(v2);
  return (c0 + c1 + c2) / 3.0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
movq 0x8(%rdx), %rax
movq 0x10(%rdx), %rcx
movsd 0x58(%rax), %xmm0
movsd 0x60(%rax), %xmm1
addsd 0x58(%rcx), %xmm0
addsd 0x60(%rcx), %xmm1
movq 0x18(%rdx), %r15
movsd 0x68(%rax), %xmm2
addsd 0x68(%rcx), %xmm2
movq %rsp, %r14
movq %r14, %rdi
callq 0x70460
movsd (%r14), %xmm0
movsd 0x8(%r14), %xmm1
addsd 0x58(%r15), %xmm0
addsd 0x60(%r15), %xmm1
movsd 0x10(%r14), %xmm2
addsd 0x68(%r15), %xmm2
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x70460
movsd (%r14), %xmm0
movsd 0x8(%r14), %xmm1
movsd 0x8ee30(%rip), %xmm3    # 0xa21d8
divsd %xmm3, %xmm0
divsd %xmm3, %xmm1
movsd 0x10(%r14), %xmm2
divsd %xmm3, %xmm2
movq %rbx, %rdi
callq 0x70460
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::FaceAspect(gaps::R3MeshFace const*) const
RNScalar R3Mesh:: 
FaceAspect(const R3MeshFace *f) const
{
  R3MeshEdge *e0 = EdgeOnFace(f, 0);
  R3MeshEdge *e1 = EdgeOnFace(f, 1);
  R3MeshEdge *e2 = EdgeOnFace(f, 2);
  RNLength a = EdgeLength(e0);
  if (RNIsZero(a)) return RN_INFINITY;
  RNLength b = EdgeLength(e1);
  if (RNIsZero(b)) return RN_INFINITY;
  RNLength c = EdgeLength(e2);
  if (RNIsZero(c)) return RN_INFINITY;
  RNScalar s = (a + b + c) / 2.0;
  return (a * b * c) / (8.0 * (s - a) * (s - b) * (s - c));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movq 0x20(%rsi), %r12
movq 0x28(%rsi), %r15
movq 0x30(%rsi), %rbx
testb $0x2, 0x38(%r12)
jne 0x13401
movq (%r14), %rax
movq %r14, %rdi
movq %r12, %rsi
callq *0x2b8(%rax)
movsd 0x28(%r12), %xmm4
leaq 0xd2789(%rip), %r12     # 0xe5b98
movsd (%r12), %xmm0
movapd 0x8ec03(%rip), %xmm1    # 0xa2020
xorpd %xmm0, %xmm1
ucomisd %xmm1, %xmm4
jb 0x13431
ucomisd %xmm4, %xmm0
jae 0x134c7
testb $0x2, 0x38(%r15)
jne 0x13453
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
movsd %xmm4, 0x8(%rsp)
callq *0x2b8(%rax)
movsd 0x8(%rsp), %xmm4
movsd 0x28(%r15), %xmm5
movsd (%r12), %xmm0
movapd 0x8ebb9(%rip), %xmm1    # 0xa2020
xorpd %xmm0, %xmm1
ucomisd %xmm1, %xmm5
jb 0x13477
ucomisd %xmm5, %xmm0
jae 0x134c7
testb $0x2, 0x38(%rbx)
jne 0x134a4
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
movsd %xmm4, 0x8(%rsp)
movsd %xmm5, 0x10(%rsp)
callq *0x2b8(%rax)
movsd 0x10(%rsp), %xmm5
movsd 0x8(%rsp), %xmm4
movsd 0x28(%rbx), %xmm1
movsd (%r12), %xmm0
movapd 0x8eb69(%rip), %xmm2    # 0xa2020
xorpd %xmm0, %xmm2
ucomisd %xmm2, %xmm1
jb 0x134de
ucomisd %xmm1, %xmm0
jb 0x134de
leaq 0xd26da(%rip), %rax     # 0xe5ba8
movsd (%rax), %xmm0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movapd %xmm4, %xmm2
addsd %xmm5, %xmm2
addsd %xmm1, %xmm2
mulsd 0x8eb3e(%rip), %xmm2    # 0xa2030
movapd %xmm4, %xmm0
mulsd %xmm5, %xmm0
mulsd %xmm1, %xmm0
movapd %xmm2, %xmm3
subsd %xmm4, %xmm3
mulsd 0x8ecea(%rip), %xmm3    # 0xa21f8
movapd %xmm2, %xmm4
subsd %xmm5, %xmm4
mulsd %xmm3, %xmm4
subsd %xmm1, %xmm2
mulsd %xmm4, %xmm2
divsd %xmm2, %xmm0
jmp 0x134d2
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::FacePoint(gaps::R3MeshFace const*, double*) const
R3Point R3Mesh::
FacePoint(const R3MeshFace *f, RNMagnitude barycentrics[3]) const
{
  // Return point on the face with the given barycentric coordinates
  R3Point point = R3zero_point;
  point += barycentrics[0] * f->vertex[0]->position;
  point += barycentrics[1] * f->vertex[1]->position;
  point += barycentrics[2] * f->vertex[2]->position;
  return point;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r15
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x4d351d(%rip), %rsi    # 0x4e6a60
callq 0x3ca36
movsd (%r15), %xmm0
movq 0x8(%r14), %rsi
addq $0x18, %rsi
movq %rsp, %r12
movq %r12, %rdi
callq 0x3d470
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3d366
movsd 0x8(%r15), %xmm0
movq 0x10(%r14), %rsi
addq $0x18, %rsi
movq %rsp, %r12
movq %r12, %rdi
callq 0x3d470
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3d366
movsd 0x10(%r15), %xmm0
movq 0x18(%r14), %rsi
addq $0x18, %rsi
movq %rsp, %r14
movq %r14, %rdi
callq 0x3d470
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3d366
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::FaceBarycentric(gaps::R3MeshFace const*, gaps::R3Point const&) const
R3Point R3Mesh::
FaceBarycentric(const R3MeshFace *f, const R3Point &point) const
{
  // From http://www.devmaster.net/wiki/Ray-triangle_intersection
  R3Point p0 = f->vertex[0]->position;
  R3Point p1 = f->vertex[1]->position;
  R3Point p2 = f->vertex[2]->position;
  R3Vector b = p1 - p0;
  R3Vector c = p2 - p0;
  R3Vector p = point - p0;
  RNDimension dim = f->plane.Normal().MaxDimension();
  RNDimension dim0 = (dim+1)%3;
  RNDimension dim1 = (dim+2)%3;
  RNScalar denom = b[dim1]*c[dim0] - b[dim0]*c[dim1];
  if (denom == 0) return R3zero_point;
  RNScalar b1 = (p[dim1]*c[dim0] - p[dim0]*c[dim1]) / denom;
  RNScalar b2 = (p[dim1]*b[dim0] - p[dim0]*b[dim1]) / -denom;
  RNScalar b0 = 1 - b1 - b2;
  return R3Point(b0, b1, b2);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rcx, %r15
movq %rdx, %r14
movq %rdi, %rbx
movq 0x8(%rdx), %rsi
addq $0x18, %rsi
leaq 0x80(%rsp), %r12
movq %r12, %rdi
callq 0x3ca36
movq 0x10(%r14), %rsi
addq $0x18, %rsi
leaq 0x68(%rsp), %r13
movq %r13, %rdi
callq 0x3ca36
movq 0x18(%r14), %rsi
addq $0x18, %rsi
leaq 0x50(%rsp), %rbp
movq %rbp, %rdi
callq 0x3ca36
leaq 0x38(%rsp), %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x3cc88
leaq 0x20(%rsp), %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x3cc88
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x3cc88
addq $0x38, %r14
movq %r14, %rdi
callq 0x3d652
leal 0x1(%rax), %ecx
movslq %ecx, %rcx
imulq $0x55555556, %rcx, %rcx # imm = 0x55555556
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rcx
addl %edx, %ecx
leal (%rcx,%rcx,2), %ecx
negl %ecx
addl %eax, %ecx
incl %ecx
movl %eax, %edx
addl $0x2, %edx
movslq %edx, %rdx
imulq $0x55555556, %rdx, %rdx # imm = 0x55555556
movq %rdx, %rsi
shrq $0x3f, %rsi
shrq $0x20, %rdx
addl %esi, %edx
leal (%rdx,%rdx,2), %edx
negl %edx
addl %edx, %eax
addl $0x2, %eax
cltq
movsd 0x38(%rsp,%rax,8), %xmm4
movslq %ecx, %rcx
movsd 0x20(%rsp,%rcx,8), %xmm1
movsd 0x38(%rsp,%rcx,8), %xmm2
movsd 0x20(%rsp,%rax,8), %xmm3
movapd %xmm3, %xmm5
mulsd %xmm2, %xmm5
movapd %xmm4, %xmm0
mulsd %xmm1, %xmm0
subsd %xmm5, %xmm0
xorpd %xmm5, %xmm5
ucomisd %xmm5, %xmm0
jne 0x136f1
jp 0x136f1
leaq 0x4d3379(%rip), %rsi    # 0x4e6a60
movq %rbx, %rdi
callq 0x3ca36
jmp 0x1374d
movapd 0x8e927(%rip), %xmm5    # 0xa2020
xorpd %xmm0, %xmm5
unpcklpd %xmm4, %xmm3            # xmm3 = xmm3[0],xmm4[0]
movsd 0x8(%rsp,%rcx,8), %xmm4
unpcklpd %xmm4, %xmm4            # xmm4 = xmm4[0,0]
mulpd %xmm3, %xmm4
movsd 0x8(%rsp,%rax,8), %xmm3
unpcklpd %xmm3, %xmm3            # xmm3 = xmm3[0,0]
unpcklpd %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0]
mulpd %xmm3, %xmm1
subpd %xmm4, %xmm1
unpcklpd %xmm5, %xmm0            # xmm0 = xmm0[0],xmm5[0]
divpd %xmm0, %xmm1
movsd 0x8e903(%rip), %xmm0    # 0xa2038
subsd %xmm1, %xmm0
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
subsd %xmm2, %xmm0
movq %rbx, %rdi
callq 0x3ca26
movq %rbx, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::IsVertexOnBoundary(gaps::R3MeshVertex const*) const
RNBoolean R3Mesh::
IsVertexOnBoundary(const R3MeshVertex *v) const
{
  // Return whether vertex lies on boundary
  for (int i = 0; i < VertexValence(v); i++) {
    R3MeshEdge *e = EdgeOnVertex(v, i);
    if (IsEdgeOnBoundary(e)) return TRUE;
  }

  // No adjacent edge is on boundary
  return FALSE;
}

// Assembly:
movslq 0x14(%rsi), %rcx
testq %rcx, %rcx
setg %al
jle 0x137c0
movq 0x8(%rsi), %rdx
movq (%rdx), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x137c0
movl $0x1, %esi
cmpq $0x0, 0x20(%rdi)
je 0x137c0
cmpq %rcx, %rsi
setb %al
je 0x137c0
movq (%rdx,%rsi,8), %rdi
incq %rsi
cmpq $0x0, 0x18(%rdi)
jne 0x137a3
movzbl %al, %eax
andl $0x1, %eax
retq
nop