LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/akw0088[P]openssl/rabinkarp.c
// Function: rk_hash
unsigned int rk_hash(unsigned char *data, unsigned int length)
{
	unsigned int hash = 0;
	for(int i = 0; i < length; i++)
	{
		hash += ((int)(data[i] * mpow(BASE_RK, length - i - 1))) % MOD_RK;
	}

	return hash % MOD_RK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, -0x30(%rbp)
movl %esi, %r12d
negq %r12
decl %ebx
xorl %r13d, %r13d
xorl %r15d, %r15d
movq %r12, %rax
addq %r13, %rax
je 0x122b
movq -0x30(%rbp), %rax
movzbl (%rax,%r13), %r14d
movl $0x100, %edi            # imm = 0x100
movl %ebx, %esi
callq 0x11bc
imull %r14d, %eax
cltd
pushq $0x65
popq %rcx
idivl %ecx
addl %edx, %r15d
incq %r13
decl %ebx
jmp 0x11fa
movl %r15d, %eax
xorl %edx, %edx
pushq $0x65
popq %rcx
divl %ecx
movl %edx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/akw0088[P]openssl/rabinkarp.c
// Function: main
int main(int argc, char** argv)
{
	if (argc < 2)
	{
		printf("Usage: rabinkarp file\r\n");
		return -1;
	}

	unsigned int length = 0;
	char *data = get_file(argv[1], &length);
	if (data == NULL)
	{
		printf("Unable to open %s\r\n", argv[1]);
	}
	
	unsigned int hash = 0;
	hash = rk_hash((unsigned char *)data, length);
	printf("%08X\r\n", hash);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
cmpl $0x1, %edi
jg 0x1358
leaq 0xcd4(%rip), %rdi       # 0x2022
callq 0x1040
pushq $-0x1
popq %rbx
jmp 0x13a2
movq %rsi, %rbx
leaq -0x14(%rbp), %rsi
andl $0x0, (%rsi)
movq 0x8(%rbx), %rdi
callq 0x1289
movq %rax, %r14
testq %rax, %rax
jne 0x1385
movq 0x8(%rbx), %rsi
leaq 0xc89(%rip), %rdi       # 0x2007
xorl %eax, %eax
callq 0x1070
movl -0x14(%rbp), %esi
movq %r14, %rdi
callq 0x11d8
leaq 0xc84(%rip), %rdi       # 0x201b
xorl %ebx, %ebx
movl %eax, %esi
xorl %eax, %eax
callq 0x1070
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/dannye[P]jed/src/encoder.cpp
// Function: getInt(std::basic_ifstream<char, std::char_traits<char>>&)
uint getInt(std::ifstream& inFile) {
    return (inFile.get() <<  0)
         + (inFile.get() <<  8)
         + (inFile.get() << 16)
         + (inFile.get() << 24);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x2140
movl %eax, %ebp
movq %rbx, %rdi
callq 0x2140
movl %eax, %r14d
shll $0x8, %r14d
addl %ebp, %r14d
movq %rbx, %rdi
callq 0x2140
movl %eax, %ebp
shll $0x10, %ebp
movq %rbx, %rdi
callq 0x2140
shll $0x18, %eax
addl %ebp, %eax
addl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/dannye[P]jed/src/encoder.cpp
// Function: RGBToYCbCrBlock(Block&)
void RGBToYCbCrBlock(Block& block) {
    for (uint y = 0; y < 8; ++y) {
        for (uint x = 0; x < 8; ++x) {
            const uint pixel = y * 8 + x;
            int y  =  0.2990 * block.r[pixel] + 0.5870 * block.g[pixel] + 0.1140 * block.b[pixel] - 128;
            int cb = -0.1687 * block.r[pixel] - 0.3313 * block.g[pixel] + 0.5000 * block.b[pixel];
            int cr =  0.5000 * block.r[pixel] - 0.4187 * block.g[pixel] - 0.0813 * block.b[pixel];
            if (y  < -128) y  = -128;
            if (y  >  127) y  =  127;
            if (cb < -128) cb = -128;
            if (cb >  127) cb =  127;
            if (cr < -128) cr = -128;
            if (cr >  127) cr =  127;
            block.y[pixel]  = y;
            block.cb[pixel] = cb;
            block.cr[pixel] = cr;
        }
    }
}

// Assembly:
addq $0x200, %rdi            # imm = 0x200
xorl %eax, %eax
movsd 0x18ac(%rip), %xmm0     # 0x4008
movsd 0x18ac(%rip), %xmm1     # 0x4010
movsd 0x18ac(%rip), %xmm2     # 0x4018
movsd 0x18ac(%rip), %xmm3     # 0x4020
movsd 0x18ac(%rip), %xmm4     # 0x4028
movsd 0x18ac(%rip), %xmm5     # 0x4030
movsd 0x18ac(%rip), %xmm6     # 0x4038
movsd 0x18ac(%rip), %xmm7     # 0x4040
movsd 0x18ab(%rip), %xmm8     # 0x4048
movsd 0x18aa(%rip), %xmm9     # 0x4050
cmpq $0x8, %rax
je 0x28c0
xorl %ecx, %ecx
cmpq $0x8, %rcx
je 0x28b4
cvtsi2sdl -0x200(%rdi,%rcx,4), %xmm10
cvtsi2sdl -0x100(%rdi,%rcx,4), %xmm11
movapd %xmm11, %xmm12
mulsd %xmm0, %xmm12
movapd %xmm10, %xmm13
mulsd %xmm1, %xmm13
addsd %xmm12, %xmm13
cvtsi2sdl (%rdi,%rcx,4), %xmm12
movapd %xmm12, %xmm14
mulsd %xmm2, %xmm14
addsd %xmm13, %xmm14
addsd %xmm3, %xmm14
movapd %xmm3, %xmm13
maxsd %xmm14, %xmm13
movapd %xmm4, %xmm14
minsd %xmm13, %xmm14
cvttsd2si %xmm14, %edx
movsbl %dl, %edx
movapd %xmm11, %xmm13
mulsd %xmm5, %xmm13
movapd %xmm10, %xmm14
mulsd %xmm6, %xmm14
addsd %xmm13, %xmm14
movapd %xmm12, %xmm13
mulsd %xmm7, %xmm13
addsd %xmm14, %xmm13
movapd %xmm3, %xmm14
maxsd %xmm13, %xmm14
movapd %xmm4, %xmm13
minsd %xmm14, %xmm13
cvttsd2si %xmm13, %esi
movsbl %sil, %esi
mulsd %xmm8, %xmm11
mulsd %xmm7, %xmm10
addsd %xmm11, %xmm10
mulsd %xmm9, %xmm12
addsd %xmm10, %xmm12
movapd %xmm3, %xmm10
maxsd %xmm12, %xmm10
movapd %xmm4, %xmm11
minsd %xmm10, %xmm11
cvttsd2si %xmm11, %r8d
movsbl %r8b, %r8d
movl %edx, -0x200(%rdi,%rcx,4)
movl %esi, -0x100(%rdi,%rcx,4)
movl %r8d, (%rdi,%rcx,4)
incq %rcx
jmp 0x27b2
incq %rax
addq $0x20, %rdi
jmp 0x27a6
retq
// File: /workspace/github_cpp_makefile_star2_O2/dannye[P]jed/src/encoder.cpp
// Function: forwardDCT(BMPImage const&)
void forwardDCT(const BMPImage& image) {
    for (uint y = 0; y < image.blockHeight; ++y) {
        for (uint x = 0; x < image.blockWidth; ++x) {
            for (uint i = 0; i < 3; ++i) {
                forwardDCTBlockComponent(image.blocks[y * image.blockWidth + x][i]);
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %ebp, %ebp
cmpl 0x10(%rbx), %ebp
jae 0x2d63
xorl %r14d, %r14d
cmpl 0x14(%rbx), %r14d
jae 0x2d5f
xorl %r15d, %r15d
cmpl $0x3, %r15d
je 0x2d5a
movl 0x14(%rbx), %eax
imull %ebp, %eax
addl %r14d, %eax
imulq $0x300, %rax, %rdi      # imm = 0x300
addq 0x8(%rbx), %rdi
testl %r15d, %r15d
je 0x2d50
cmpl $0x2, %r15d
jne 0x2d49
addq $0x200, %rdi            # imm = 0x200
jmp 0x2d50
addq $0x100, %rdi            # imm = 0x100
callq 0x28fe
incl %r15d
jmp 0x2d1b
incl %r14d
jmp 0x2d12
incl %ebp
jmp 0x2d0a
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/dannye[P]jed/src/encoder.cpp
// Function: quantize(BMPImage const&)
void quantize(const BMPImage& image) {
    for (uint y = 0; y < image.blockHeight; ++y) {
        for (uint x = 0; x < image.blockWidth; ++x) {
            for (uint i = 0; i < 3; ++i) {
                quantizeBlockComponent(*qTables100[i], image.blocks[y * image.blockWidth + x][i]);
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
leaq 0x14a2(%rip), %r15      # 0x4240
cmpl 0x10(%rbx), %r14d
jae 0x2e04
xorl %ebp, %ebp
cmpl 0x14(%rbx), %ebp
jae 0x2dff
movq %r15, %r12
xorl %r13d, %r13d
cmpq $0x3, %r13
je 0x2dfb
movl 0x14(%rbx), %eax
imull %r14d, %eax
addl %ebp, %eax
imulq $0x300, %rax, %rsi      # imm = 0x300
addq 0x8(%rbx), %rsi
testl %r13d, %r13d
je 0x2de6
cmpl $0x2, %r13d
jne 0x2ddf
addq $0x200, %rsi            # imm = 0x200
jmp 0x2de6
addq $0x100, %rsi            # imm = 0x100
movslq (%r12), %rdi
addq %r15, %rdi
callq 0x2d6e
incq %r13
addq $0x4, %r12
jmp 0x2db1
incl %ebp
jmp 0x2da6
incl %r14d
jmp 0x2d9e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/dannye[P]jed/src/encoder.cpp
// Function: generateCodes(HuffmanTable&)
void generateCodes(HuffmanTable& hTable) {
    uint code = 0;
    for (uint i = 0; i < 16; ++i) {
        for (uint j = hTable.offsets[i]; j < hTable.offsets[i + 1]; ++j) {
            hTable.codes[j] = code;
            code += 1;
        }
        code <<= 1;
    }
}

// Assembly:
xorl %eax, %eax
xorl %ecx, %ecx
cmpq $0x10, %rax
je 0x2e46
movzbl (%rdi,%rax), %edx
incq %rax
leal (%rcx,%rcx), %esi
movzbl (%rdi,%rax), %r8d
cmpq %r8, %rdx
jae 0x2e42
movl %ecx, 0xc4(%rdi,%rdx,4)
incl %ecx
incq %rdx
addl $0x2, %esi
jmp 0x2e27
movl %esi, %ecx
jmp 0x2e17
retq
// File: /workspace/github_cpp_makefile_star2_O2/dannye[P]jed/src/encoder.cpp
// Function: bitLength(int)
uint bitLength(int v) {
    uint length = 0;
    while (v > 0) {
        v >>= 1;
        length += 1;
    }
    return length;
}

// Assembly:
xorl %eax, %eax
testl %edi, %edi
jle 0x2e53
shrl %edi
incl %eax
jmp 0x2e49
retq
// File: /workspace/github_cpp_makefile_star2_O2/dannye[P]jed/src/encoder.cpp
// Function: getCode(HuffmanTable const&, unsigned char, unsigned int&, unsigned int&)
bool getCode(const HuffmanTable& hTable, byte symbol, uint& code, uint& codeLength) {
    for (uint i = 0; i < 16; ++i) {
        for (uint j = hTable.offsets[i]; j < hTable.offsets[i + 1]; ++j) {
            if (symbol == hTable.symbols[j]) {
                code = hTable.codes[j];
                codeLength = i + 1;
                return true;
            }
        }
    }
    return false;
}

// Assembly:
xorl %eax, %eax
cmpq $0x10, %rax
je 0x2e92
movzbl (%rdi,%rax), %r9d
leaq 0x1(%rax), %r8
movzbl 0x1(%rdi,%rax), %r10d
cmpq %r10, %r9
jae 0x2e80
leaq 0x1(%r9), %r11
cmpb %sil, 0x11(%rdi,%r9)
movq %r11, %r9
jne 0x2e6b
jmp 0x2e85
movq %r8, %rax
jmp 0x2e56
movl 0xc0(%rdi,%r11,4), %esi
movl %esi, (%rdx)
movl %r8d, (%rcx)
cmpq $0x10, %rax
setb %al
retq
// File: /workspace/github_cpp_makefile_star2_O2/dannye[P]jed/src/encoder.cpp
// Function: encodeHuffmanData(BMPImage const&)
std::vector<byte> encodeHuffmanData(const BMPImage& image) {
    std::vector<byte> huffmanData;
    BitWriter bitWriter(huffmanData);

    int previousDCs[3] = { 0 };

    for (uint i = 0; i < 3; ++i) {
        if (!dcTables[i]->set) {
            generateCodes(*dcTables[i]);
            dcTables[i]->set = true;
        }
        if (!acTables[i]->set) {
            generateCodes(*acTables[i]);
            acTables[i]->set = true;
        }
    }

    for (uint y = 0; y < image.blockHeight; ++y) {
        for (uint x = 0; x < image.blockWidth; ++x) {
            for (uint i = 0; i < 3; ++i) {
                if (!encodeBlockComponent(
                        bitWriter,
                        image.blocks[y * image.blockWidth + x][i],
                        previousDCs[i],
                        *dcTables[i],
                        *acTables[i])) {
                    return std::vector<byte>();
                }
            }
        }
    }

    return huffmanData;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rax
andq $0x0, 0x10(%rax)
movaps %xmm0, (%rax)
andl $0x0, 0x18(%rsp)
movb $0x0, 0x38(%rsp)
andq $0x0, 0x10(%rsp)
movq %rax, 0x40(%rsp)
xorl %ebx, %ebx
leaq 0x3c27(%rip), %r12      # 0x6d70
leaq 0x3c40(%rip), %r13      # 0x6d90
cmpq $0x18, %rbx
je 0x3198
movq (%rbx,%r12), %r15
cmpb $0x0, 0x384(%r15)
jne 0x3174
movq %r15, %rdi
callq 0x2e13
movb $0x1, 0x384(%r15)
movq (%rbx,%r13), %r15
cmpb $0x0, 0x384(%r15)
jne 0x3192
movq %r15, %rdi
callq 0x2e13
movb $0x1, 0x384(%r15)
addq $0x8, %rbx
jmp 0x3150
xorl %r13d, %r13d
leaq 0x10(%rsp), %r12
cmpl 0x10(%r14), %r13d
jae 0x3260
xorl %r15d, %r15d
cmpl 0x14(%r14), %r15d
jae 0x3229
xorl %ebp, %ebp
xorl %ebx, %ebx
cmpq $0x18, %rbx
je 0x321f
movl 0x14(%r14), %eax
imull %r13d, %eax
addl %r15d, %eax
imulq $0x300, %rax, %rsi      # imm = 0x300
addq 0x8(%r14), %rsi
testl %ebp, %ebp
je 0x31ec
cmpl $0x2, %ebp
jne 0x31e5
addq $0x200, %rsi            # imm = 0x200
jmp 0x31ec
addq $0x100, %rsi            # imm = 0x100
leaq 0x3b7d(%rip), %rax      # 0x6d70
movq (%rbx,%rax), %rcx
leaq 0x3b92(%rip), %rax      # 0x6d90
movq (%rbx,%rax), %r8
leaq 0x38(%rsp), %rdi
movq %r12, %rdx
callq 0x2e9a
addq $0x8, %rbx
incl %ebp
addq $0x4, %r12
testb %al, %al
jne 0x31b7
jmp 0x3231
incl %r15d
leaq 0x10(%rsp), %r12
jmp 0x31ad
incl %r13d
jmp 0x31a0
movq 0x8(%rsp), %rbx
movq %rbx, %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
andq $0x0, 0x10(%rax)
leaq 0x20(%rsp), %rdi
callq 0x3b20
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movaps 0x20(%rsp), %xmm0
movq 0x8(%rsp), %rbx
movups %xmm0, (%rbx)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rbx)
leaq 0x20(%rsp), %rax
jmp 0x3239
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x3b20
movq %rbx, %rdi
callq 0x21f0
// File: /workspace/github_cpp_makefile_star2_O2/dannye[P]jed/src/encoder.cpp
// Function: writeQuantizationTable(std::basic_ofstream<char, std::char_traits<char>>&, unsigned char, QuantizationTable const&)
void writeQuantizationTable(std::ofstream& outFile, byte tableID, const QuantizationTable& qTable) {
    outFile.put(0xFF);
    outFile.put(DQT);
    putShort(outFile, 67);
    outFile.put(tableID);
    for (uint i = 0; i < 64; ++i) {
        outFile.put(qTable.table[zigZagMap[i]]);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
pushq $-0x1
popq %rsi
callq 0x2030
pushq $-0x25
popq %rsi
movq %r14, %rdi
callq 0x2030
pushq $0x43
popq %rsi
movq %r14, %rdi
callq 0x3292
movsbl %bpl, %esi
movq %r14, %rdi
callq 0x2030
xorl %r15d, %r15d
leaq 0xf52(%rip), %r12       # 0x4250
cmpq $0x40, %r15
je 0x331a
movzbl (%r15,%r12), %eax
movsbl (%rbx,%rax,4), %esi
movq %r14, %rdi
callq 0x2030
incq %r15
jmp 0x32fe
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/dannye[P]jed/src/encoder.cpp
// Function: writeStartOfFrame(std::basic_ofstream<char, std::char_traits<char>>&, BMPImage const&)
void writeStartOfFrame(std::ofstream& outFile, const BMPImage& image) {
    outFile.put(0xFF);
    outFile.put(SOF0);
    putShort(outFile, 17);
    outFile.put(8);
    putShort(outFile, image.height);
    putShort(outFile, image.width);
    outFile.put(3);
    for (uint i = 1; i <= 3; ++i) {
        outFile.put(i);
        outFile.put(0x11);
        outFile.put(i == 1 ? 0 : 1);
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
pushq $-0x1
popq %rsi
callq 0x2030
pushq $-0x40
popq %rsi
movq %rbx, %rdi
callq 0x2030
pushq $0x11
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3292
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0x2030
movl (%r14), %esi
movq %rbx, %rdi
callq 0x3292
movl 0x4(%r14), %esi
movq %rbx, %rdi
callq 0x3292
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x2030
pushq $-0x3
popq %r14
testl %r14d, %r14d
je 0x33b3
leal 0x4(%r14), %eax
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2030
xorl %esi, %esi
cmpl $-0x3, %r14d
setne %sil
movq %rbx, %rdi
callq 0x2030
incl %r14d
jmp 0x337e
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/dannye[P]jed/src/encoder.cpp
// Function: writeHuffmanTable(std::basic_ofstream<char, std::char_traits<char>>&, unsigned char, unsigned char, HuffmanTable const&)
void writeHuffmanTable(std::ofstream& outFile, byte acdc, byte tableID, const HuffmanTable& hTable) {
    outFile.put(0xFF);
    outFile.put(DHT);
    putShort(outFile, 19 + hTable.offsets[16]);
    outFile.put(acdc << 4 | tableID);
    for (uint i = 0; i < 16; ++i) {
        outFile.put(hTable.offsets[i + 1] - hTable.offsets[i]);
    }
    for (uint i = 0; i < 16; ++i) {
        for (uint j = hTable.offsets[i]; j < hTable.offsets[i + 1]; ++j) {
            outFile.put(hTable.symbols[j]);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movl %edx, %r15d
movl %esi, %ebp
movq %rdi, %r14
pushq $-0x1
popq %rsi
callq 0x2030
pushq $-0x3c
popq %rsi
movq %r14, %rdi
callq 0x2030
movzbl 0x10(%rbx), %esi
addl $0x13, %esi
movq %r14, %rdi
callq 0x3292
shlb $0x4, %bpl
orb %r15b, %bpl
xorl %r15d, %r15d
movsbl %bpl, %esi
movq %r14, %rdi
callq 0x2030
cmpq $0x10, %r15
je 0x3417
movb 0x1(%rbx,%r15), %bpl
subb (%rbx,%r15), %bpl
incq %r15
jmp 0x33f7
xorl %r15d, %r15d
cmpq $0x10, %r15
je 0x3445
movzbl (%rbx,%r15), %r12d
incq %r15
movzbl (%rbx,%r15), %eax
cmpq %rax, %r12
jae 0x341a
movsbl 0x11(%rbx,%r12), %esi
movq %r14, %rdi
callq 0x2030
incq %r12
jmp 0x3428
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/dannye[P]jed/src/encoder.cpp
// Function: writeStartOfScan(std::basic_ofstream<char, std::char_traits<char>>&)
void writeStartOfScan(std::ofstream& outFile) {
    outFile.put(0xFF);
    outFile.put(SOS);
    putShort(outFile, 12);
    outFile.put(3);
    for (uint i = 1; i <= 3; ++i) {
        outFile.put(i);
        outFile.put(i == 1 ? 0x00 : 0x11);
    }
    outFile.put(0);
    outFile.put(63);
    outFile.put(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $-0x1
popq %rsi
callq 0x2030
pushq $-0x26
popq %rsi
movq %rbx, %rdi
callq 0x2030
pushq $0xc
popq %rsi
movq %rbx, %rdi
callq 0x3292
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x2030
pushq $-0x3
popq %r14
xorl %ebp, %ebp
pushq $0x11
popq %r15
testl %r14d, %r14d
je 0x34b6
leal 0x4(%r14), %eax
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
cmpl $-0x3, %r14d
movl %r15d, %esi
cmovel %ebp, %esi
movq %rbx, %rdi
callq 0x2030
incl %r14d
jmp 0x348b
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2030
pushq $0x3f
popq %rsi
movq %rbx, %rdi
callq 0x2030
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2030
// File: /workspace/github_cpp_makefile_star2_O2/dannye[P]jed/src/encoder.cpp
// Function: writeAPP0(std::basic_ofstream<char, std::char_traits<char>>&)
void writeAPP0(std::ofstream& outFile) {
    outFile.put(0xFF);
    outFile.put(APP0);
    putShort(outFile, 16);
    outFile.put('J');
    outFile.put('F');
    outFile.put('I');
    outFile.put('F');
    outFile.put(0);
    outFile.put(1);
    outFile.put(2);
    outFile.put(0);
    putShort(outFile, 100);
    putShort(outFile, 100);
    outFile.put(0);
    outFile.put(0);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $-0x1
popq %rsi
callq 0x2030
pushq $-0x20
popq %rsi
movq %rbx, %rdi
callq 0x2030
pushq $0x10
popq %rsi
movq %rbx, %rdi
callq 0x3292
pushq $0x4a
popq %rsi
movq %rbx, %rdi
callq 0x2030
pushq $0x46
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2030
pushq $0x49
popq %rsi
movq %rbx, %rdi
callq 0x2030
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2030
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2030
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2030
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x2030
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2030
pushq $0x64
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3292
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3292
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2030
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2030
// File: /workspace/github_cpp_makefile_star2_O2/dannye[P]jed/src/encoder.cpp
// Function: main
int main(int argc, char** argv) {
    // validate arguments
    if (argc < 2) {
        std::cout << "Error - Invalid arguments\n";
        return 1;
    }

    for (int i = 1; i < argc; ++i) {
        const std::string filename(argv[i]);

        // read image
        BMPImage image = readBMP(filename);
        // validate image
        if (image.blocks == nullptr) {
            continue;
        }

        // color conversion
        RGBToYCbCr(image);

        // Forward Discrete Cosine Transform
        forwardDCT(image);

        // quantize DCT coefficients
        quantize(image);

        // write JPG file
        const std::size_t pos = filename.find_last_of('.');
        const std::string outFilename = (pos == std::string::npos) ?
            (filename + ".jpg") :
            (filename.substr(0, pos) + ".jpg");
        writeJPG(image, outFilename);

        delete[] image.blocks;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, 0x8(%rsp)
cmpl $0x2, %edi
jge 0x3792
movq 0x3852(%rip), %rdi      # 0x6fd0
leaq 0xa7c(%rip), %rsi       # 0x4201
callq 0x2100
pushq $0x1
popq %rax
jmp 0x388d
movl %edi, %eax
movq %rax, (%rsp)
pushq $0x1
popq %rbx
leaq 0x68(%rsp), %r15
leaq 0x48(%rsp), %rdx
leaq 0x28(%rsp), %r12
cmpq %rbx, (%rsp)
je 0x388b
movq 0x8(%rsp), %rax
movq (%rax,%rbx,8), %rsi
movq %r15, %rdi
movq %rdx, %r13
callq 0x2090
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x243f
movq 0x18(%rsp), %rbp
testq %rbp, %rbp
je 0x3878
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x28c1
movq %r14, %rdi
callq 0x2cfe
movq %r14, %rdi
callq 0x2d86
movq %r15, %rdi
pushq $0x2e
popq %rsi
pushq $-0x1
popq %rdx
callq 0x2220
cmpq $-0x1, %rax
je 0x3846
movq %r12, %r14
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x2130
movq %r13, %rdi
movq %r14, %rsi
leaq 0x9e8(%rip), %rdx       # 0x421c
callq 0x3946
movq %r14, %rdi
callq 0x20b0
movq %r13, %r14
jmp 0x385b
movq %r13, %r14
movq %r13, %rdi
movq %r15, %rsi
leaq 0x9c6(%rip), %rdx       # 0x421c
callq 0x390e
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x358b
movq %rbp, %rdi
callq 0x2150
movq %r14, %rdi
callq 0x20b0
movq %r15, %rdi
callq 0x20b0
incq %rbx
movq %r13, %rdx
jmp 0x37aa
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x38bc
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
jmp 0x38b5
jmp 0x38bc
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x20b0
jmp 0x38bf
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x20b0
movq %rbx, %rdi
callq 0x21f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/dannye[P]jed/src/encoder.cpp
// Function: BitWriter::writeBit(unsigned int)
void writeBit(uint bit) {
        if (nextBit == 0) {
            data.push_back(0);
        }
        data.back() |= (bit & 1) << (7 - nextBit);
        nextBit = (nextBit + 1) % 8;
        if (nextBit == 0 && data.back() == 0xFF) {
            data.push_back(0);
        }
    }

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movb (%rdi), %al
testb %al, %al
jne 0x3987
movq 0x8(%rbx), %rdi
leaq 0x7(%rsp), %rsi
movb $0x0, (%rsi)
callq 0x39c8
movb (%rbx), %al
andl $0x1, %ebp
movb $0x7, %cl
subb %al, %cl
shll %cl, %ebp
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rax
orb %bpl, -0x1(%rax)
movb (%rbx), %al
incb %al
andb $0x7, %al
movb %al, (%rbx)
jne 0x39c1
movq 0x8(%rbx), %rdi
movq 0x8(%rdi), %rax
cmpb $-0x1, -0x1(%rax)
jne 0x39c1
leaq 0x6(%rsp), %rsi
movb $0x0, (%rsi)
callq 0x39c8
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/sflview/sflview.cpp
// Function: GLUTStop()
void GLUTStop(void)
{
  // Terminate viewer
  if (viewer) viewer->Terminate();

  // Close scene
  if (scene) CloseScene(scene);

  // Destroy window 
  // glutDestroyWindow(GLUTwindow);

  // Exit
  exit(0);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq 0x181f86(%rip), %rdi    # 0x1ac9a0
testq %rdi, %rdi
je 0x2aa25
movq (%rdi), %rax
callq *0x18(%rax)
movq 0x181f7c(%rip), %rbx    # 0x1ac9a8
testq %rbx, %rbx
je 0x2ab5e
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0xd051a
movq %r14, %rdi
callq 0x2baa4
cmpb $0x1, 0x181f97(%rip)    # 0x1ac9e8
jne 0x2ab43
leaq 0xef8b1(%rip), %rdi     # 0x11a30f
callq 0x27f30
leaq 0x8(%rsp), %rdi
callq 0xd0554
leaq 0xef659(%rip), %rdi     # 0x11a0cd
movb $0x1, %al
callq 0x27080
movl 0x1c(%rbx), %esi
leaq 0xef65f(%rip), %rdi     # 0x11a0e4
xorl %eax, %eax
callq 0x27080
movl 0x2c(%rbx), %esi
leaq 0xef660(%rip), %rdi     # 0x11a0f6
xorl %eax, %eax
callq 0x27080
movl 0x7c(%rbx), %esi
leaq 0xef660(%rip), %rdi     # 0x11a107
xorl %eax, %eax
callq 0x27080
movl 0xac(%rbx), %esi
leaq 0xef662(%rip), %rdi     # 0x11a11d
xorl %eax, %eax
callq 0x27080
movl 0x8c(%rbx), %esi
leaq 0xef661(%rip), %rdi     # 0x11a130
xorl %eax, %eax
callq 0x27080
movl 0x9c(%rbx), %esi
leaq 0xef65d(%rip), %rdi     # 0x11a140
xorl %eax, %eax
callq 0x27080
movq 0x8(%rbx), %rax
movl 0x24(%rax), %esi
leaq 0xef659(%rip), %rdi     # 0x11a151
xorl %eax, %eax
callq 0x27080
movq 0x8(%rbx), %rdi
callq 0x2baac
leaq 0xef652(%rip), %rdi     # 0x11a161
movl %eax, %esi
xorl %eax, %eax
callq 0x27080
movq 0x8(%rbx), %rdi
xorl %esi, %esi
callq 0x2bace
leaq 0xef648(%rip), %rdi     # 0x11a172
movq %rax, %rsi
xorl %eax, %eax
callq 0x27080
movq 0x17c385(%rip), %rax    # 0x1a6ec0
movq (%rax), %rdi
callq 0x27af0
movq (%rbx), %rax
movq %rbx, %rdi
xorl %esi, %esi
callq *0xf8(%rax)
testl %eax, %eax
jne 0x2ab5e
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
xorl %edi, %edi
callq 0x27b50
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/sflview/sflview.cpp
// Function: GLUTRedraw()
void GLUTRedraw(void)
{
  // Redraw with viewer
  if (viewer->Redraw()) {
    glutPostRedisplay();
  }

  // Draw stuff
  DrawModel();

  // Swap buffers 
  glutSwapBuffers();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq 0x181e26(%rip), %rdi    # 0x1ac9a0
movq (%rdi), %rax
callq *0x20(%rax)
testl %eax, %eax
je 0x2ab89
callq 0x10d110
cmpq $0x0, 0x181e3f(%rip)    # 0x1ac9d0
je 0x2acbc
cmpl $0x0, 0x17ce6a(%rip)    # 0x1a7a08
je 0x2abda
movl $0xb50, %edi            # imm = 0xB50
callq 0x27870
movsd 0xef456(%rip), %xmm0    # 0x11a008
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
callq 0x27ef0
movq 0x181e0a(%rip), %rdi    # 0x1ac9d0
movl $0x772, %esi            # imm = 0x772
callq 0x5cd98
movl $0xb50, %edi            # imm = 0xB50
callq 0x27220
cmpl $0x0, 0x181dcf(%rip)    # 0x1ac9b0
je 0x2acbc
movl $0xb50, %edi            # imm = 0xB50
callq 0x27220
movss 0xef447(%rip), %xmm0    # 0x11a040
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
callq 0x28390
xorl %ebp, %ebp
leaq 0x18(%rsp), %rbx
leaq 0xf9644(%rip), %r14     # 0x124258
movq %rsp, %r15
leaq 0x30(%rsp), %r12
movq 0x181dad(%rip), %rax    # 0x1ac9d0
movslq 0x14(%rax), %rcx
cmpq %rcx, %rbp
jge 0x2acbc
movq 0x8(%rax), %rax
movq (%rax,%rbp,8), %r13
cmpq $0x0, 0x1a0(%r13)
je 0x2acb4
cmpl $0x0, 0x2c(%r13)
jne 0x2acb4
movq %r13, %rdi
callq 0x6d0d6
movq %rax, %rdi
callq 0x2bb24
testl %eax, %eax
jne 0x2acb4
movq %rbx, %rdi
movq %r13, %rsi
callq 0x6d236
movq %r13, %rdi
callq 0x6d0d6
movsd 0x30(%rax), %xmm0
subsd 0x18(%rax), %xmm0
mulsd 0xef38e(%rip), %xmm0    # 0x11a010
mulsd 0xef38e(%rip), %xmm0    # 0x11a018
movq %r15, %rdi
movq %r14, %rsi
callq 0xb31d6
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0xb25e7
movq 0x1a0(%r13), %rsi
movq %r12, %rdi
xorl %edx, %edx
callq 0x2bb4f
incq %rbp
jmp 0x2ac1c
callq 0x10d162
addq $0x48, %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/sflview/sflview.cpp
// Function: GLUTResize(int, int)
void GLUTResize(int w, int h)
{
  // Remember window dimensions
  GLUTwindow_width = w;
  GLUTwindow_height = h;

  // Resize viewer
  if (viewer->Resize(w, h)) {
    glutPostRedisplay();
  }
}

// Assembly:
pushq %rax
movl %esi, %edx
movl %edi, %esi
movl %edi, 0x17cd25(%rip)    # 0x1a7a00
movl %edx, 0x17cd23(%rip)    # 0x1a7a04
movq 0x181cb8(%rip), %rdi    # 0x1ac9a0
movq (%rdi), %rax
callq *0x28(%rax)
testl %eax, %eax
je 0x2acf8
popq %rax
jmp 0x10d110
popq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/sflview/sflview.cpp
// Function: GLUTMouseButton(int, int, int, int)
void GLUTMouseButton(int button, int state, int x, int y)
{
  // Invert y coordinate
  y = GLUTwindow_height - y;
  
  // Determine button
  int b = button;
  if (button == GLUT_LEFT_BUTTON) b = 0;
  else if (button == GLUT_MIDDLE_BUTTON) b = 1;
  else if (button == GLUT_RIGHT_BUTTON) b = 2;

  // Determinte state
  int s = (state == GLUT_DOWN) ? 1 : 0;

  // Determine modifiers
  int modifiers = glutGetModifiers();
  int shift = (modifiers & GLUT_ACTIVE_SHIFT);
  int ctrl = (modifiers & GLUT_ACTIVE_CTRL);
  int alt = (modifiers & GLUT_ACTIVE_ALT);

  // Send mouse event to viewer
  if (viewer->MouseButton(x, y, b, s, shift, ctrl, alt)) {
    glutPostRedisplay();
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %edi, %ebp
movl 0x17ccd2(%rip), %r14d   # 0x1a7a04
subl %ecx, %r14d
xorl %r15d, %r15d
testl %esi, %esi
sete %r15b
callq 0x111bae
movl %eax, %r9d
andl $0x1, %r9d
movl %eax, %r10d
andl $0x2, %r10d
andl $0x4, %eax
movq 0x181c45(%rip), %rdi    # 0x1ac9a0
movq (%rdi), %r11
subq $0x8, %rsp
movl %ebx, %esi
movl %r14d, %edx
movl %ebp, %ecx
movl %r15d, %r8d
pushq $0x1
pushq %rax
pushq %r10
callq *0x38(%r11)
addq $0x20, %rsp
addq $0x8, %rsp
testl %eax, %eax
je 0x2ad8c
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x10d110
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/sflview/sflview.cpp
// Function: GLUTInit(int*, char**)
void GLUTInit(int *argc, char **argv)
{
  // Open window
  glutInit(argc, argv);
  glutInitWindowPosition(100, 100);
  glutInitWindowSize(GLUTwindow_width, GLUTwindow_height);
  glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH | GLUT_ALPHA);
  GLUTwindow = glutCreateWindow("Surfel Viewer");

  // Initialize grfx (after create context because calls glewInit)
  RNInitGrfx();

  // Initialize GLUT callback functions
  glutDisplayFunc(GLUTRedraw);
  glutReshapeFunc(GLUTResize);
  glutKeyboardFunc(GLUTKeyboard);
  glutSpecialFunc(GLUTSpecial);
  glutMouseFunc(GLUTMouseButton);
  glutMotionFunc(GLUTMouseMotion);
  atexit(GLUTStop);

  // Initialize viewer
  viewer->Initialize();
}

// Assembly:
pushq %rax
callq 0x10dcf1
pushq $0x64
popq %rdi
movl %edi, %esi
callq 0x10e1ec
movl 0x17c943(%rip), %edi    # 0x1a7a00
movl 0x17c941(%rip), %esi    # 0x1a7a04
callq 0x10e202
pushq $0x1a
popq %rdi
callq 0x10e221
leaq 0xeefe8(%rip), %rdi     # 0x11a0bf
callq 0x112d48
callq 0xd05d4
leaq -0x583(%rip), %rdi      # 0x2ab65
callq 0x10c810
leaq -0x424(%rip), %rdi      # 0x2acd0
callq 0x10c865
leaq -0x22c(%rip), %rdi      # 0x2aed4
callq 0x10c8a7
leaq -0x379(%rip), %rdi      # 0x2ad93
callq 0x10c8ef
leaq -0x3f8(%rip), %rdi      # 0x2ad20
callq 0x10cc36
leaq -0x42a(%rip), %rdi      # 0x2acfa
callq 0x10ccc6
leaq -0x724(%rip), %rdi      # 0x2aa0c
callq 0x1191c0
movq 0x181864(%rip), %rdi    # 0x1ac9a0
movq (%rdi), %rax
popq %rcx
jmpq *0x10(%rax)
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/sflview/sflview.cpp
// Function: GLUTMainLoop()
void GLUTMainLoop(void)
{
  // Set background color
  viewer->SetBackgroundColor(background_color);

  // Set camera 
  if (initial_camera) {
    R3Camera camera(initial_camera_eye, initial_camera_towards, initial_camera_up, 0.4, 0.4, 0.01, 100000.0);
    viewer->SetCamera(camera);
  }

  // Set world origin
  if (initial_world_origin != R3Point(-1, -1, -1)) {
    viewer->SetCenterPoint(initial_world_origin);
  }

  // Run main loop -- never returns
  glutMainLoop();
}

// Assembly:
pushq %rbx
subq $0x90, %rsp
movq 0x18184e(%rip), %rdi    # 0x1ac9a0
movq (%rdi), %rax
leaq 0x1817cc(%rip), %rsi    # 0x1ac928
callq *0x168(%rax)
cmpb $0x1, 0x18184b(%rip)    # 0x1ac9b4
jne 0x2b1b6
leaq 0x1817ce(%rip), %rsi    # 0x1ac940
leaq 0x1817df(%rip), %rdx    # 0x1ac958
leaq 0x1817f0(%rip), %rcx    # 0x1ac970
movq %rsp, %rbx
movsd 0xeee95(%rip), %xmm0    # 0x11a020
movsd 0xeee95(%rip), %xmm2    # 0x11a028
movsd 0xeee95(%rip), %xmm3    # 0x11a030
movq %rbx, %rdi
movaps %xmm0, %xmm1
callq 0x700ee
movq 0x1817f3(%rip), %rdi    # 0x1ac9a0
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x58(%rax)
movq %rsp, %rbx
movsd 0xeee77(%rip), %xmm0    # 0x11a038
movq %rbx, %rdi
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
callq 0xb2320
leaq 0x1817b2(%rip), %rdi    # 0x1ac988
movq %rbx, %rsi
callq 0xb2416
testl %eax, %eax
je 0x2b1f9
movq 0x1817b7(%rip), %rdi    # 0x1ac9a0
movq (%rdi), %rax
leaq 0x181795(%rip), %rsi    # 0x1ac988
callq *0x80(%rax)
callq 0x110103
addq $0x90, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/sflview/../../pkgs/R3Surfels/R3SurfelTree.h
// Function: gaps::R3SurfelTree::NBlocks() const
inline int R3SurfelTree::
NBlocks(void) const
{
  // Return number of blocks in tree
  long long n = 0;
  for (int i = 0; i < NNodes(); i++) {
    R3SurfelNode *node = Node(i);
    n += node->NBlocks();
  }
  return n;
}

// Assembly:
movl 0x24(%rdi), %ecx
movq 0x18(%rdi), %rdx
xorl %esi, %esi
testl %ecx, %ecx
cmovlel %esi, %ecx
xorl %eax, %eax
cmpq %rsi, %rcx
je 0x2bacd
movq (%rdx,%rsi,8), %rdi
addl 0x4c(%rdi), %eax
incq %rsi
jmp 0x2babc
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Utils/R3SurfelViewer.cpp
// Function: gaps::R3SurfelViewer::~R3SurfelViewer()
R3SurfelViewer::
~R3SurfelViewer(void)
{
  // Delete selected image texture
  if (selected_image_texture_id > 0) glDeleteTextures(1, &selected_image_texture_id);

#if (R3_SURFEL_VIEWER_DRAW_METHOD == R3_SURFEL_VIEWER_DRAW_WITH_VBO)
  // Delete VBO buffers
  if (vbo_position_buffer > 0) glDeleteBuffers(1, &vbo_position_buffer);
  if (vbo_normal_buffer > 0) glDeleteBuffers(1, &vbo_normal_buffer);
  if (vbo_color_buffer > 0) glDeleteBuffers(1, &vbo_color_buffer);
#endif
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x172b3f(%rip), %rax    # 0x19eb00
movq %rax, (%rdi)
cmpl $0x0, 0x5e8(%rdi)
je 0x2bfdc
leaq 0x5e8(%rbx), %rsi
pushq $0x1
popq %rdi
callq 0x27d00
cmpl $0x0, 0x5f8(%rbx)
je 0x2bff8
leaq 0x5f8(%rbx), %rsi
movq 0x17afbd(%rip), %rax    # 0x1a6fb0
pushq $0x1
popq %rdi
callq *(%rax)
cmpl $0x0, 0x5fc(%rbx)
je 0x2c014
leaq 0x5fc(%rbx), %rsi
movq 0x17afa1(%rip), %rax    # 0x1a6fb0
pushq $0x1
popq %rdi
callq *(%rax)
cmpl $0x0, 0x600(%rbx)
je 0x2c030
leaq 0x600(%rbx), %rsi
movq 0x17af85(%rip), %rax    # 0x1a6fb0
pushq $0x1
popq %rdi
callq *(%rax)
leaq 0x5c8(%rbx), %rdi
callq 0xcad90
leaq 0x4f8(%rbx), %rdi
callq 0xba93c
leaq 0x340(%rbx), %rdi
callq 0x33292
leaq 0x168(%rbx), %rdi
callq 0x9eb12
leaq 0x120(%rbx), %rdi
callq 0x9eb12
leaq 0x78(%rbx), %rdi
callq 0x6e8e6
addq $0x10, %rbx
movq %rbx, %rdi
popq %rbx
jmp 0x3e156
movq %rax, %rdi
callq 0x32908
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Utils/R3SurfelViewer.cpp
// Function: gaps::R3SurfelViewer::ObjectVisibility(gaps::R3SurfelObject*) const
int R3SurfelViewer::
ObjectVisibility(R3SurfelObject *object) const
{
  // Check if any part is visible
  for (int i = 0; i < object->NParts(); i++) {
    R3SurfelObject *part = object->Part(i);
    if (ObjectVisibility(part)) return 1;
  }

  // Check if any node is visible
  for (int i = 0; i < object->NNodes(); i++) {
    R3SurfelNode *node = object->Node(i);
    if (NodeVisibility(node)) return 1;
  }

  // Not visible
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
pushq $0x1
popq %rbp
movslq 0x2c(%rbx), %rax
cmpq %rax, %r15
jge 0x2c0fc
movq 0x20(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x2c0c6
incq %r15
testl %eax, %eax
je 0x2c0da
jmp 0x2c12b
xorl %ecx, %ecx
movq %rcx, %r15
movslq 0x6c(%rbx), %r12
cmpq %r12, %rcx
jge 0x2c122
movq 0x60(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x2c136
leaq 0x1(%r15), %rcx
testl %eax, %eax
je 0x2c0fe
xorl %ebp, %ebp
cmpq %r12, %r15
setl %bpl
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Utils/R3SurfelViewer.cpp
// Function: gaps::R3SurfelViewer::LabelVisibility(int) const
int R3SurfelViewer::
LabelVisibility(int label_index) const
{
  // Check label index
  if (label_index < 0) return FALSE;
  if (label_index >= scene->NLabels()) return FALSE;

  // Label is visible if not in list
  if (label_visibilities.size() <= (unsigned int) label_index) 
    return TRUE;

  // Return whether label is visible
  return label_visibilities[label_index];
}

// Assembly:
xorl %eax, %eax
testl %esi, %esi
js 0x2c2ec
movq 0x8(%rdi), %rcx
cmpl %esi, 0x2c(%rcx)
jle 0x2c2ec
movq 0x340(%rdi), %rax
movq 0x348(%rdi), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
movl %esi, %ecx
cmpq %rcx, %rdx
jbe 0x2c2ed
movl (%rax,%rcx,4), %eax
retq
pushq $0x1
popq %rax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Utils/R3SurfelViewer.cpp
// Function: gaps::R3SurfelViewer::SetLabelVisibility(int, int)
void R3SurfelViewer::
SetLabelVisibility(int label_index, int visibility)
{
  // Check label index
  if (label_index == -1) {
    if (visibility == 1) {
      // Turn all visibilities on
      label_visibilities.clear();
    }
    else {
      // Set all visibilities
      for (int i = 0; i < scene->NLabels(); i++) {
        SetLabelVisibility(i, visibility);
      }
    }
  }
  else {
    // Check label index
    if (label_index < 0) return;
    if (label_index >= scene->NLabels()) return;

    // Add label visibilities
    while (label_visibilities.size() <= (unsigned int) label_index) {
      label_visibilities.push_back(1);
    }

    // Set visibility
    if (visibility == -1) label_visibilities[label_index] = 1 - label_visibilities[label_index];
    else if (visibility == 0) label_visibilities[label_index] = 0;
    else label_visibilities[label_index] = 1;
  }

  // Invalidate VBO buffers
  InvalidateVBO();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebp
movq %rdi, %rbx
cmpl $-0x1, %esi
je 0x2c35b
testl %esi, %esi
js 0x2c3cd
movq 0x8(%rbx), %rax
cmpl %esi, 0x2c(%rax)
jle 0x2c3cd
leaq 0x340(%rbx), %r14
movl %esi, %r12d
leaq 0xc(%rsp), %r15
movq 0x340(%rbx), %rax
movq 0x348(%rbx), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r12, %rcx
ja 0x2c379
movl $0x1, 0xc(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x332c6
jmp 0x2c32c
cmpl $0x1, %ebp
jne 0x2c38f
movq 0x340(%rbx), %rax
cmpq %rax, 0x348(%rbx)
je 0x2c3c1
movq %rax, 0x348(%rbx)
jmp 0x2c3c1
testl %ebp, %ebp
je 0x2c3b2
cmpl $-0x1, %ebp
jne 0x2c3b9
pushq $0x1
popq %rcx
subl (%rax,%r12,4), %ecx
movl %ecx, (%rax,%r12,4)
jmp 0x2c3c1
xorl %r14d, %r14d
movq 0x8(%rbx), %rax
cmpl 0x2c(%rax), %r14d
jge 0x2c3c1
movq (%rbx), %rax
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq *0x148(%rax)
incl %r14d
jmp 0x2c392
andl $0x0, (%rax,%r12,4)
jmp 0x2c3c1
movl $0x1, (%rax,%r12,4)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x378(%rax)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Utils/R3SurfelViewer.cpp
// Function: gaps::R3SurfelViewer::SetAttributeVisibility(gaps::RNFlags, int)
void R3SurfelViewer::
SetAttributeVisibility(RNFlags attribute_flags, int visibility)
{
  // Check if changing all flags
  if (attribute_flags == 0) attribute_flags = 0xFFFFFFFF;

  // Update attribute visibility flags
  if (visibility == -1) attribute_visibility_flags.XOR(attribute_flags);
  else if (!visibility) attribute_visibility_flags.Remove(attribute_flags);
  else attribute_visibility_flags.Add(attribute_flags);

  // Invalidate VBO buffers
  InvalidateVBO();
}

// Assembly:
testq %rsi, %rsi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovneq %rsi, %rax
testl %edx, %edx
je 0x2c3f8
cmpl $-0x1, %edx
jne 0x2c404
xorq 0x358(%rdi), %rax
jmp 0x2c40b
notq %rax
andq 0x358(%rdi), %rax
jmp 0x2c40b
orq 0x358(%rdi), %rax
movq %rax, 0x358(%rdi)
movq (%rdi), %rax
jmpq *0x378(%rax)
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Utils/R3SurfelViewer.cpp
// Function: gaps::R3SurfelViewer::CreateColor(unsigned char*, double) const
void R3SurfelViewer::
CreateColor(unsigned char *color, double value) const
{
  // Compute rgb based on blue-green-red heatmap
  if (value <= 0) {
    color[0] = 0;
    color[1] = 0;
    color[2] = 255;
  }
  else if (value < 0.1) {
    value *= 10 * 255;
    color[0] = 0;
    color[1] = value;
    color[2] = 255;
  }
  else if (value < 0.5) {
    value = (value - 0.1) * 2.5 * 255;
    color[0] = 0;
    color[1] = 255;
    color[2] = 255 - value;
  }
  else if (value < 0.9) {
    value = (value - 0.5) * 2.5 * 255;
    color[0] = value;
    color[1] = 255;
    color[2] = 0;
  }
  else if (value < 1) {
    value = (value - 0.9) * 10 * 255;
    color[0] = 255;
    color[1] = 255 - value;
    color[2] = 0;
  }
  else {
    color[0] = 255;
    color[1] = 0;
    color[2] = 0;
  }
}

// Assembly:
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jae 0x2c476
movsd 0xedef4(%rip), %xmm1    # 0x11a350
ucomisd %xmm0, %xmm1
jbe 0x2c480
mulsd 0xedf2e(%rip), %xmm0    # 0x11a398
movb $0x0, (%rsi)
cvttsd2si %xmm0, %eax
movb %al, 0x1(%rsi)
jmp 0x2c47a
andw $0x0, (%rsi)
movb $-0x1, %al
movb %al, 0x2(%rsi)
retq
movsd 0xedb88(%rip), %xmm1    # 0x11a010
ucomisd %xmm0, %xmm1
jbe 0x2c4b9
addsd 0xedef2(%rip), %xmm0    # 0x11a388
mulsd 0xedef2(%rip), %xmm0    # 0x11a390
movsd 0xedeca(%rip), %xmm1    # 0x11a370
mulsd %xmm1, %xmm0
movw $0xff00, (%rsi)         # imm = 0xFF00
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
jmp 0x2c47c
movsd 0xede97(%rip), %xmm1    # 0x11a358
ucomisd %xmm0, %xmm1
jbe 0x2c4eb
addsd 0xedea9(%rip), %xmm0    # 0x11a378
mulsd 0xedea9(%rip), %xmm0    # 0x11a380
mulsd 0xede91(%rip), %xmm0    # 0x11a370
cvttsd2si %xmm0, %eax
movb %al, (%rsi)
movb $-0x1, 0x1(%rsi)
jmp 0x2c52a
movsd 0xedb15(%rip), %xmm1    # 0x11a008
ucomisd %xmm0, %xmm1
jbe 0x2c525
addsd 0xede5f(%rip), %xmm0    # 0x11a360
mulsd 0xede5f(%rip), %xmm0    # 0x11a368
movsd 0xede5f(%rip), %xmm1    # 0x11a370
mulsd %xmm1, %xmm0
movb $-0x1, (%rsi)
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movb %al, 0x1(%rsi)
jmp 0x2c52a
movw $0xff, (%rsi)
xorl %eax, %eax
jmp 0x2c47c
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Utils/R3SurfelViewer.cpp
// Function: gaps::R3SurfelViewer::DrawViewingExtent() const
void R3SurfelViewer::
DrawViewingExtent(void) const
{
  // Check extent visibility
  if (!viewing_extent_visibility) return;
  
  // Check extent
  const R3Box& bbox = scene->BBox();  
  const R3Box& extent = ViewingExtent();
  if (extent.IsEmpty() || R3Contains(extent, bbox)) return;

  // Draw extent
  glDisable(GL_LIGHTING);
  RNLoadRgb(0.5, 0.5, 0.5);
  extent.Outline();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x0, 0x338(%rdi)
je 0x2c97c
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x32960
movq %rax, %r14
addq $0x120, %rbx            # imm = 0x120
movq %rbx, %rdi
callq 0x2bb24
testl %eax, %eax
jne 0x2c97c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7ee2e
testl %eax, %eax
je 0x2c984
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0xb50, %edi            # imm = 0xB50
callq 0x27220
movsd 0xed67a(%rip), %xmm0    # 0x11a010
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
callq 0x27ef0
movq (%rbx), %rax
movq 0xb0(%rax), %rax
pushq $0x1
popq %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rax
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Utils/R3SurfelViewer.cpp
// Function: gaps::R3SurfelViewer::EnableViewingExtent() const
void R3SurfelViewer::
EnableViewingExtent(void) const
{
  // Check clip planes extent
  const R3Box& bbox = scene->BBox();  
  const R3Box& extent = ViewingExtent();
  if (extent.IsEmpty() || R3Contains(extent, bbox)) {
    DisableViewingExtent();
    return;
  }

  // Load lo clip planes
  for (int dim = RN_X; dim <= RN_Z; dim++) {
    if (extent[RN_LO][dim] > bbox[RN_LO][dim]) {
      GLdouble plane_equation[4] = { 0, 0, 0, 0 };
      plane_equation[dim] = 1.0;
      plane_equation[3] = -extent[RN_LO][dim];
      glClipPlane(GL_CLIP_PLANE0 + dim, plane_equation);
      glEnable(GL_CLIP_PLANE0 + dim);
    }
  }

  // Load hi clip planes
  for (int dim = RN_X; dim <= RN_Z; dim++) {
    if (extent[RN_HI][dim] < bbox[RN_HI][dim]) {
      GLdouble plane_equation[4] = { 0, 0, 0, 0 };
      plane_equation[dim] = -1.0;
      plane_equation[3] = extent[RN_HI][dim];
      glClipPlane(GL_CLIP_PLANE0 + 3 + dim, plane_equation);
      glEnable(GL_CLIP_PLANE0 + 3 + dim);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x32960
movq %rax, %r14
leaq 0x120(%rbx), %r15
movq %r15, %rdi
callq 0x2bb24
testl %eax, %eax
jne 0x2c9f9
movq %r15, %rdi
movq %r14, %rsi
callq 0x7ee2e
testl %eax, %eax
je 0x2ca13
movq (%rbx), %rax
movq %rbx, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *0x238(%rax)
xorl %r12d, %r12d
movabsq $0x3ff0000000000000, %r13 # imm = 0x3FF0000000000000
movq %rsp, %r15
cmpq $0x3, %r12
je 0x2ca7c
movsd 0x128(%rbx,%r12,8), %xmm0
ucomisd 0x8(%r14,%r12,8), %xmm0
jbe 0x2ca77
xorpd %xmm1, %xmm1
movapd %xmm1, 0x10(%rsp)
movapd %xmm1, (%rsp)
movq %r13, (%rsp,%r12,8)
xorpd 0xeda39(%rip), %xmm0    # 0x11a490
movlpd %xmm0, 0x18(%rsp)
movl %r12d, %ebp
orl $0x3000, %ebp           # imm = 0x3000
movl %ebp, %edi
movq %r15, %rsi
callq 0x27380
movl %ebp, %edi
callq 0x27870
incq %r12
jmp 0x2ca23
xorl %r12d, %r12d
movabsq $-0x4010000000000000, %r13 # imm = 0xBFF0000000000000
movq %rsp, %r15
cmpq $0x3, %r12
je 0x2cae0
movsd 0x140(%rbx,%r12,8), %xmm0
movsd 0x20(%r14,%r12,8), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x2cadb
xorpd %xmm1, %xmm1
movapd %xmm1, 0x10(%rsp)
movapd %xmm1, (%rsp)
movq %r13, (%rsp,%r12,8)
movsd %xmm0, 0x18(%rsp)
leal 0x3003(%r12), %ebp
movl %ebp, %edi
movq %r15, %rsi
callq 0x27380
movl %ebp, %edi
callq 0x27870
incq %r12
jmp 0x2ca8c
addq $0x28, %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/R3Utils/R3SurfelViewer.cpp
// Function: gaps::R3SurfelViewer::UpdateViewingFrustum()
void R3SurfelViewer::
UpdateViewingFrustum(void)
{
  // Update viewing frustum
  const R3Camera& camera = viewer.Camera();
  viewing_frustum = R3Frustum(camera.Origin(), camera.Towards(), camera.Up(),
    camera.XFOV(), camera.YFOV(), camera.Near(), camera.Far());
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movq %rdi, %rbx
leaq 0x80(%rdi), %r14
leaq 0xc8(%rdi), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xb3446
leaq 0xb0(%rbx), %rcx
movsd 0xe0(%rbx), %xmm0
movsd 0xe8(%rbx), %xmm1
movsd 0xf0(%rbx), %xmm2
movsd 0xf8(%rbx), %xmm3
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x9adfe
addq $0x168, %rbx            # imm = 0x168
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3296a
leaq 0x20(%rsp), %rdi
callq 0x9eb12
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x9eb12
movq %rbx, %rdi
callq 0x28140
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Utils/R3SurfelViewer.cpp
// Function: gaps::R3SurfelViewer::UpdateSelectedImageColorPixels()
void R3SurfelViewer::
UpdateSelectedImageColorPixels(void)
{
  // Check stuff
  if (!selected_image) return;
  if (selected_image == previous_color_image) return;

  // Get color image
  selected_image_color_pixels = selected_image->ColorChannels();
  if ((selected_image_color_pixels.Width() <= 0) ||
      (selected_image_color_pixels.Height() <= 0) ||
      (selected_image_color_pixels.Depth() != 3)) {
    selected_image_color_pixels = R2Image();
  }

  // Remember last selected image
  previous_color_image = selected_image;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq 0x2d0(%rdi), %rsi
testq %rsi, %rsi
je 0x2cfb9
movq %rdi, %rbx
cmpq 0x5e0(%rdi), %rsi
je 0x2cfb9
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x40a18
leaq 0x5c8(%rbx), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0xcae2e
leaq 0x8(%rsp), %rdi
callq 0xcad90
cmpl $0x0, 0x5c8(%rbx)
jle 0x2cf89
cmpl $0x0, 0x5cc(%rbx)
jle 0x2cf89
cmpl $0x3, 0x5d0(%rbx)
je 0x2cfab
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xca844
movq %r14, %rdi
movq %r15, %rsi
callq 0xcae2e
leaq 0x8(%rsp), %rdi
callq 0xcad90
movq 0x2d0(%rbx), %rax
movq %rax, 0x5e0(%rbx)
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x2cfc5
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xcad90
movq %rbx, %rdi
callq 0x28140