LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: jaldhar[P]Lets-Build-a-Simple-Interpreter/calc6.cc
// Function: Interpreter::expression()
long Interpreter::expression() {
    long result = term();

    while (_current_token.type == TOKENTYPE::PLUS ||
    _current_token.type == TOKENTYPE::MINUS) {
        Token token = _current_token;
        if (token.type == TOKENTYPE::PLUS) {
            eat(TOKENTYPE::PLUS);
            result += term();
        } else if (token.type == TOKENTYPE::MINUS) {
            eat(TOKENTYPE::MINUS);
            result -= term();
        }
    }

    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x28(%rbp)
callq 0x2d20
movq %rax, -0x10(%rbp)
movq -0x28(%rbp), %rcx
movb $0x1, %al
cmpl $0x2, 0x8(%rcx)
movb %al, -0x29(%rbp)
je 0x2c9a
movq -0x28(%rbp), %rax
cmpl $0x3, 0x8(%rax)
sete %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0x2ca3
jmp 0x2d10
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rcx
movq %rcx, -0x20(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
cmpl $0x2, -0x20(%rbp)
jne 0x2cde
movq -0x28(%rbp), %rdi
movl $0x2, %esi
callq 0x2e20
movq -0x28(%rbp), %rdi
callq 0x2d20
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x2d0b
cmpl $0x3, -0x20(%rbp)
jne 0x2d09
movq -0x28(%rbp), %rdi
movl $0x3, %esi
callq 0x2e20
movq -0x28(%rbp), %rdi
callq 0x2d20
movq %rax, %rcx
movq -0x10(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x10(%rbp)
jmp 0x2d0b
jmp 0x2c7d
movq -0x10(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: jaldhar[P]Lets-Build-a-Simple-Interpreter/calc6.cc
// Function: Interpreter::term()
long Interpreter::term() {
    long result = factor();
                                                                      
    while (_current_token.type == TOKENTYPE::MUL
    || _current_token.type == TOKENTYPE::DIV) {
        Token token = _current_token;
        if (token.type == TOKENTYPE::MUL) {
            eat(TOKENTYPE::MUL);
            result *= factor();
        } else if (token.type == TOKENTYPE::DIV) {
            eat(TOKENTYPE::DIV);
            long rhs = factor();
            if (rhs == 0) {
                throw("Division by zero");
            }
            result /= rhs;
        }
    }

    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
callq 0x2fa0
movq %rax, -0x10(%rbp)
movq -0x30(%rbp), %rcx
movb $0x1, %al
cmpl $0x4, 0x8(%rcx)
movb %al, -0x31(%rbp)
je 0x2d5a
movq -0x30(%rbp), %rax
cmpl $0x5, 0x8(%rax)
sete %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x2d66
jmp 0x2e09
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rcx
movq %rcx, -0x20(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
cmpl $0x4, -0x20(%rbp)
jne 0x2da2
movq -0x30(%rbp), %rdi
movl $0x4, %esi
callq 0x2e20
movq -0x30(%rbp), %rdi
callq 0x2fa0
imulq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x2e04
cmpl $0x5, -0x20(%rbp)
jne 0x2e02
movq -0x30(%rbp), %rdi
movl $0x5, %esi
callq 0x2e20
movq -0x30(%rbp), %rdi
callq 0x2fa0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x2df1
movl $0x8, %edi
callq 0x20c0
movq %rax, %rdi
leaq 0x12e7(%rip), %rax      # 0x40c5
movq %rax, (%rdi)
movq 0x31c8(%rip), %rsi      # 0x5fb0
xorl %eax, %eax
movl %eax, %edx
callq 0x22a0
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
cqto
idivq %rcx
movq %rax, -0x10(%rbp)
jmp 0x2e04
jmp 0x2d3d
movq -0x10(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jaldhar[P]Lets-Build-a-Simple-Interpreter/calc6.cc
// Function: Interpreter::eat(TOKENTYPE)
void Interpreter::eat(TOKENTYPE token_type) {
    if (_current_token.type == token_type) {
        _current_token = _lexer.get_next_token();
    } else {
        ostringstream out;
        out << "Error parsing input. Wanted: " << token_type;
        throw(out.str().c_str());
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1f0, %rsp            # imm = 0x1F0
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1d8(%rbp)
movl 0x8(%rax), %eax
cmpl -0xc(%rbp), %eax
jne 0x2e79
movq -0x1d8(%rbp), %rax
movq (%rax), %rdi
callq 0x2650
movl %eax, %ecx
movq -0x1d8(%rbp), %rax
movl %ecx, -0x20(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x20(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rcx
movq %rcx, 0x10(%rax)
jmp 0x2f86
leaq -0x198(%rbp), %rdi
movq %rdi, -0x1e8(%rbp)
callq 0x2220
movq -0x1e8(%rbp), %rdi
leaq 0x11e3(%rip), %rsi      # 0x407d
callq 0x2180
movq %rax, -0x1e0(%rbp)
jmp 0x2ea8
movq -0x1e0(%rbp), %rdi
leaq -0xc(%rbp), %rsi
callq 0x2450
jmp 0x2eba
movb $0x1, -0x1c9(%rbp)
movl $0x8, %edi
callq 0x20c0
movq %rax, -0x1f0(%rbp)
leaq -0x1c8(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x2190
jmp 0x2ee7
leaq -0x1c8(%rbp), %rdi
callq 0x20a0
movq -0x1f0(%rbp), %rdi
movq %rax, (%rdi)
movb $0x0, -0x1c9(%rbp)
movq 0x30a5(%rip), %rsi      # 0x5fb0
xorl %eax, %eax
movl %eax, %edx
callq 0x22a0
jmp 0x2f9b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
jmp 0x2f78
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
jmp 0x2f5f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x20e0
testb $0x1, -0x1c9(%rbp)
jne 0x2f6a
jmp 0x2f76
movq -0x1f0(%rbp), %rdi
callq 0x2120
jmp 0x2f78
leaq -0x198(%rbp), %rdi
callq 0x2070
jmp 0x2f8f
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbp
retq
movq -0x1a0(%rbp), %rdi
callq 0x22b0
nopl (%rax,%rax)
// File: jaldhar[P]Lets-Build-a-Simple-Interpreter/calc6.cc
// Function: Interpreter::factor()
long Interpreter::factor() {
    Token token = _current_token;
    
    if (token.type == TOKENTYPE::INTEGER) {
        eat(TOKENTYPE::INTEGER);
        return token.value;
    } else if (token.type == TOKENTYPE::LPAREN) {
        eat(TOKENTYPE::LPAREN);
        long result = expression();
        eat(TOKENTYPE::RPAREN);
        return result;
    } else {
        ostringstream out;
        out << "Error parsing input. Wanted: Integer or (";
        throw(out.str().c_str());
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1f0, %rsp            # imm = 0x1F0
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x1e0(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x20(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
cmpl $0x1, -0x20(%rbp)
jne 0x2fee
movq -0x1e0(%rbp), %rdi
movl $0x1, %esi
callq 0x2e20
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x3127
cmpl $0x6, -0x20(%rbp)
jne 0x3033
movq -0x1e0(%rbp), %rdi
movl $0x6, %esi
callq 0x2e20
movq -0x1e0(%rbp), %rdi
callq 0x2c60
movq -0x1e0(%rbp), %rdi
movq %rax, -0x28(%rbp)
movl $0x7, %esi
callq 0x2e20
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x3127
leaq -0x1a0(%rbp), %rdi
movq %rdi, -0x1e8(%rbp)
callq 0x2220
movq -0x1e8(%rbp), %rdi
leaq 0x1047(%rip), %rsi      # 0x409b
callq 0x2180
jmp 0x305b
movb $0x1, -0x1d1(%rbp)
movl $0x8, %edi
callq 0x20c0
movq %rax, -0x1f0(%rbp)
leaq -0x1d0(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x2190
jmp 0x3088
leaq -0x1d0(%rbp), %rdi
callq 0x20a0
movq -0x1f0(%rbp), %rdi
movq %rax, (%rdi)
movb $0x0, -0x1d1(%rbp)
movq 0x2f04(%rip), %rsi      # 0x5fb0
xorl %eax, %eax
movl %eax, %edx
callq 0x22a0
jmp 0x3140
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a8(%rbp)
movl %eax, -0x1ac(%rbp)
jmp 0x3119
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a8(%rbp)
movl %eax, -0x1ac(%rbp)
jmp 0x3100
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a8(%rbp)
movl %eax, -0x1ac(%rbp)
leaq -0x1d0(%rbp), %rdi
callq 0x20e0
testb $0x1, -0x1d1(%rbp)
jne 0x310b
jmp 0x3117
movq -0x1f0(%rbp), %rdi
callq 0x2120
jmp 0x3119
leaq -0x1a0(%rbp), %rdi
callq 0x2070
jmp 0x3134
movq -0x8(%rbp), %rax
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbp
retq
movq -0x1a8(%rbp), %rdi
callq 0x22b0
// File: git-kale[P]CppContainer/container.cpp
// Function: stack_memory()
char *stack_memory()
{
    const int stackSize = 65536;
    auto *stack = new (std::nothrow) char[stackSize];

    if (stack == nullptr)
    { // Can't allocate memory from heap hence `new` will return null pointer
        printf("Memory allocation failed !! \n");
        exit(1);
    }

    return stack + stackSize; // As stack grows backward so we have to start from end of stack   {(end of stack)| *stack|-------> stackSize(start of stack)}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x10000, -0x4(%rbp)    # imm = 0x10000
movl $0x10000, %edi          # imm = 0x10000
movq 0x2d3d(%rip), %rsi      # 0x3fc8
callq 0x1100
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x12b3
leaq 0xd62(%rip), %rdi       # 0x2004
movb $0x0, %al
callq 0x1030
movl $0x1, %edi
callq 0x1090
movq -0x10(%rbp), %rax
addq $0x10000, %rax          # imm = 0x10000
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: git-kale[P]CppContainer/container.cpp
// Function: jail(void*)
int jail(void *args)
{

    printf("Namastey from JAIL \n");
    printf("jail pid : %d\n", getpid());
    sethostname("Devil's Nest", 13);
    setup_vars();

    setup_root("./root");

    mount("proc", "/proc", "proc", 0, 0);

    auto runThis = [](void *args) -> int { run("/bin/sh"); };

    clone_process(runThis, SIGCHLD);

    umount("/proc");
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
leaq 0xd3f(%rip), %rdi       # 0x2022
movb $0x0, %al
callq 0x1030
callq 0x10c0
movl %eax, %esi
leaq 0xd3f(%rip), %rdi       # 0x2037
movb $0x0, %al
callq 0x1030
leaq 0xd40(%rip), %rdi       # 0x2046
movl $0xd, %esi
callq 0x1040
callq 0x1370
leaq 0xd37(%rip), %rdi       # 0x2053
callq 0x13b0
leaq 0xd33(%rip), %rdx       # 0x205b
leaq 0xd2b(%rip), %rsi       # 0x205a
xorl %eax, %eax
movl %eax, %r8d
movq %rdx, %rdi
movq %r8, %rcx
callq 0x1120
leaq -0x9(%rbp), %rdi
movl $0x11, %esi
callq 0x13e0
leaq 0xd06(%rip), %rdi       # 0x205a
callq 0x10b0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: git-kale[P]CppContainer/container.cpp
// Function: main
int main(int argc, char **argv)
{

    printf("Namastey from main(), Waiting for JAIL.....\n");
    printf("parent pid : %d\n", getpid());

    clone_process(jail, CLONE_NEWPID | CLONE_NEWUTS | SIGCHLD);
    printf("Exitting from container.... \n");

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0xc4d(%rip), %rdi       # 0x209a
movb $0x0, %al
callq 0x1030
callq 0x10c0
movl %eax, %esi
leaq 0xc65(%rip), %rdi       # 0x20c7
movb $0x0, %al
callq 0x1030
leaq -0x1a0(%rip), %rdi      # 0x12d0
movl $0x24000011, %esi       # imm = 0x24000011
callq 0x14f0
leaq 0xc57(%rip), %rdi       # 0x20d8
movb $0x0, %al
callq 0x1030
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
// File: nmmmnu[P]HM3/test/test_glob.cc
// Function: main
int main(int argc, char **argv){
	if (argc < 2){
		print_usage(argv[0]);
		return 1;
	}

	const char *path = argv[1];

	MyGlob gl = getGlobSimulateMove(path);

	for(const StringRef &s : gl.getData())
		std::cout << s << '\n';

	return 0;
}

// Assembly:
subq $0xb8, %rsp
movl $0x0, 0xb4(%rsp)
movl %edi, 0xb0(%rsp)
movq %rsi, 0xa8(%rsp)
cmpl $0x2, 0xb0(%rsp)
jge 0x136b
movq 0xa8(%rsp), %rax
movq (%rax), %rdi
callq 0x1460
movl $0x1, 0xb4(%rsp)
jmp 0x1446
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0xa0(%rsp)
movq 0xa0(%rsp), %rsi
leaq 0x38(%rsp), %rdi
callq 0x1290
leaq 0x38(%rsp), %rdi
callq 0x1540
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rdi
callq 0x1550
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %rdi
callq 0x1580
movq %rax, 0x20(%rsp)
leaq 0x28(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x15b0
testb $0x1, %al
jne 0x13d3
jmp 0x1431
leaq 0x28(%rsp), %rdi
callq 0x15f0
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rsi
movq 0x3bea(%rip), %rdi      # 0x4fd8
callq 0x1600
movq %rax, (%rsp)
jmp 0x13f9
movq (%rsp), %rdi
movl $0xa, %esi
callq 0x1110
jmp 0x1409
jmp 0x140b
leaq 0x28(%rsp), %rdi
callq 0x1650
jmp 0x13be
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x10(%rsp)
movl %eax, 0xc(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x1510
jmp 0x1455
movl $0x0, 0xb4(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x1510
movl 0xb4(%rsp), %eax
addq $0xb8, %rsp
retq
movq 0x10(%rsp), %rdi
callq 0x1140
nop
// File: nmmmnu[P]HM3/common/myglob.cc
// Function: MyGlob::swap(MyGlob&)
void MyGlob::swap(MyGlob &other){
	using std::swap;

	swap(globresults_,	other.globresults_	);
	swap(isOpen_,		other.isOpen_		);
	swap(data_,		other.data_		);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, (%rsp)
movq 0x8(%rsp), %rsi
callq 0x1d80
movq (%rsp), %rdi
addq $0x48, %rdi
movq 0x8(%rsp), %rsi
addq $0x48, %rsi
callq 0x1dd0
movq (%rsp), %rdi
addq $0x50, %rdi
movq 0x8(%rsp), %rsi
addq $0x50, %rsi
callq 0x1e10
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: nmmmnu[P]HM3/common/myglob.cc
// Function: MyGlob::open(StringRef const&)
bool MyGlob::open(const StringRef &path) noexcept{
	if (isOpen_)
		close();


	data_.clear();

	if (open_(path.data(), globresults_) == false)
		return false;

	isOpen_ = true;



	size_t i;
	for(i = 0; i < globresults_.gl_pathc; ++i){
		const char *filename = globresults_.gl_pathv[i];

		if (checkFile_( filename ))
			data_.push_back(filename);
	}



	return i > 0;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
testb $0x1, 0x48(%rax)
je 0x1b48
movq 0x8(%rsp), %rdi
callq 0x1c30
movq 0x8(%rsp), %rdi
addq $0x50, %rdi
callq 0x1e40
movq 0x30(%rsp), %rdi
callq 0x19d0
movq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x1c80
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x1b81
movb $0x0, 0x47(%rsp)
jmp 0x1c1a
movq 0x8(%rsp), %rax
movb $0x1, 0x48(%rax)
movq $0x0, 0x28(%rsp)
movq 0x8(%rsp), %rcx
movq 0x28(%rsp), %rax
cmpq (%rcx), %rax
jae 0x1c0b
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
callq 0x1ce0
testb $0x1, %al
jne 0x1bc9
jmp 0x1bf9
movq 0x8(%rsp), %rax
addq $0x50, %rax
movq %rax, (%rsp)
movq 0x20(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x14c0
jmp 0x1be7
movq (%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x1e60
jmp 0x1bf7
jmp 0x1bf9
jmp 0x1bfb
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x1b93
cmpq $0x0, 0x28(%rsp)
seta %al
andb $0x1, %al
movb %al, 0x47(%rsp)
movb 0x47(%rsp), %al
andb $0x1, %al
addq $0x48, %rsp
retq
movq %rax, %rdi
callq 0x1870
nopl (%rax)
// File: nmmmnu[P]HM3/common/myglob.cc
// Function: MyGlob::close()
void MyGlob::close() noexcept{
	if (! isOpen_)
		return;

	globfree(& globresults_);
	data_.clear();

	isOpen_ = false;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
testb $0x1, 0x48(%rax)
jne 0x1c4b
jmp 0x1c6c
movq 0x8(%rsp), %rdi
callq 0x1040
movq 0x8(%rsp), %rdi
addq $0x50, %rdi
callq 0x1e40
movq 0x8(%rsp), %rax
movb $0x0, 0x48(%rax)
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: nmmmnu[P]HM3/common/myglob.cc
// Function: MyGlob::open_(char const*, glob_t&)
bool MyGlob::open_(const char *path, glob_t &globresults) noexcept{
	int const result = glob(path, 0, nullptr, & globresults);

	if (result != 0)
		return false;

	if (result == GLOB_NOMATCH)
		return false;

	return true;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rcx
xorl %esi, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x1100
movl %eax, 0xc(%rsp)
cmpl $0x0, 0xc(%rsp)
je 0x1cb5
movb $0x0, 0x27(%rsp)
jmp 0x1cc8
cmpl $0x3, 0xc(%rsp)
jne 0x1cc3
movb $0x0, 0x27(%rsp)
jmp 0x1cc8
movb $0x1, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: nmmmnu[P]HM3/common/myglob.cc
// Function: MyGlob::checkFile_(char const*)
bool MyGlob::checkFile_(const char *filename) noexcept{
	struct stat s;
	stat(filename, & s);

	if (s.st_mode & S_IFREG)	// file
		return true;

	if (s.st_mode & S_IFLNK)	// symlink
		return true;

	return false;
}

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0x98(%rsp)
movq 0x98(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x10d0
movl 0x20(%rsp), %eax
andl $0x8000, %eax           # imm = 0x8000
cmpl $0x0, %eax
je 0x1d19
movb $0x1, 0xa7(%rsp)
jmp 0x1d39
movl 0x20(%rsp), %eax
andl $0xa000, %eax           # imm = 0xA000
cmpl $0x0, %eax
je 0x1d31
movb $0x1, 0xa7(%rsp)
jmp 0x1d39
movb $0x0, 0xa7(%rsp)
movb 0xa7(%rsp), %al
andb $0x1, %al
addq $0xa8, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/apps/conf2conf/conf2conf.cpp
// Function: ReadOrientedBoxFile(gaps::RGBDConfiguration*, char const*)
static int
ReadOrientedBoxFile(RGBDConfiguration *configuration, const char *filename) 
{
  // Start statistics
  RNTime start_time;
  start_time.Read();

  // Read segmentation file
  if (!configuration->ReadOrientedBoxFile(filename)) return 0;
  
  // Print statistics
  if (print_verbose) {
    printf("Read oriented boxes from %s ...\n", filename);
    printf("  Time = %.2f seconds\n", start_time.Elapsed());
    printf("  # Images = %d\n", configuration->NImages());
    printf("  # Surfaces = %d\n", configuration->NSurfaces());
    fflush(stdout);
  }

  // Return success
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq %rsp, %rdi
callq 0xdaa10
movq %rsp, %rdi
callq 0x19c20
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq (%rdi), %rax
callq *0x90(%rax)
cmpl $0x0, %eax
jne 0x175a0
movl $0x0, 0x24(%rsp)
jmp 0x1761d
cmpl $0x0, 0x19aa41(%rip)    # 0x1b1fe8
je 0x17615
movq 0x10(%rsp), %rsi
leaq 0x14ee07(%rip), %rdi    # 0x1663bc
movb $0x0, %al
callq 0x12090
movq %rsp, %rdi
callq 0xdaad0
leaq 0x14ed27(%rip), %rdi    # 0x1662f2
movb $0x1, %al
callq 0x12090
movq 0x18(%rsp), %rdi
callq 0x19c40
movl %eax, %esi
leaq 0x14ed24(%rip), %rdi    # 0x166309
movb $0x0, %al
callq 0x12090
movq 0x18(%rsp), %rdi
callq 0x19c60
movl %eax, %esi
leaq 0x14ed1b(%rip), %rdi    # 0x16631a
movb $0x0, %al
callq 0x12090
movq 0x199983(%rip), %rax    # 0x1b0f90
movq (%rax), %rdi
callq 0x12850
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/apps/conf2conf/conf2conf.cpp
// Function: ReadSegmentationFile(gaps::RGBDConfiguration*, char const*)
static int
ReadSegmentationFile(RGBDConfiguration *configuration, const char *filename) 
{
  // Start statistics
  RNTime start_time;
  start_time.Read();

  // Read segmentation file
  if (!configuration->ReadSegmentationFile(filename)) return 0;
  
  // Print statistics
  if (print_verbose) {
    printf("Read segmentation from %s ...\n", filename);
    printf("  Time = %.2f seconds\n", start_time.Elapsed());
    printf("  # Images = %d\n", configuration->NImages());
    printf("  # Surfaces = %d\n", configuration->NSurfaces());
    fflush(stdout);
  }

  // Return success
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq %rsp, %rdi
callq 0xdaa10
movq %rsp, %rdi
callq 0x19c20
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq (%rdi), %rax
callq *0x88(%rax)
cmpl $0x0, %eax
jne 0x17670
movl $0x0, 0x24(%rsp)
jmp 0x176ed
cmpl $0x0, 0x19a971(%rip)    # 0x1b1fe8
je 0x176e5
movq 0x10(%rsp), %rsi
leaq 0x14ed58(%rip), %rdi    # 0x1663dd
movb $0x0, %al
callq 0x12090
movq %rsp, %rdi
callq 0xdaad0
leaq 0x14ec57(%rip), %rdi    # 0x1662f2
movb $0x1, %al
callq 0x12090
movq 0x18(%rsp), %rdi
callq 0x19c40
movl %eax, %esi
leaq 0x14ec54(%rip), %rdi    # 0x166309
movb $0x0, %al
callq 0x12090
movq 0x18(%rsp), %rdi
callq 0x19c60
movl %eax, %esi
leaq 0x14ec4b(%rip), %rdi    # 0x16631a
movb $0x0, %al
callq 0x12090
movq 0x1998b3(%rip), %rax    # 0x1b0f90
movq (%rax), %rdi
callq 0x12850
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/apps/conf2conf/conf2conf.cpp
// Function: NegateYZ(gaps::RGBDConfiguration*)
static int
NegateYZ(RGBDConfiguration *configuration)
{
  // Start statistics
  RNTime start_time;
  start_time.Read();
  if (print_verbose) {
    printf("Negating Y and Z ...\n");
    fflush(stdout);
  }

  // Create transformation
  R3Affine transformation = R3identity_affine;
  transformation.YScale(-1);
  transformation.ZScale(-1);
  
  // Negate Y and Z in camera coordinate system
  for (int i = 0; i < configuration->NImages(); i++) {
    RGBDImage *image = configuration->Image(i);
    image->Transform(transformation);
  }

  // Print statistics
  if (print_verbose) {
    printf("  Time = %.2f seconds\n", start_time.Elapsed());
    printf("  # Images = %d\n", configuration->NImages());
    fflush(stdout);
  }

  // Return success
  return 1;
}

// Assembly:
subq $0x168, %rsp            # imm = 0x168
movq %rdi, 0x160(%rsp)
leaq 0x150(%rsp), %rdi
callq 0xdaa10
leaq 0x150(%rsp), %rdi
callq 0x19c20
cmpl $0x0, 0x19a6b8(%rip)    # 0x1b1fe8
je 0x1794f
leaq 0x14eb58(%rip), %rdi    # 0x166491
movb $0x0, %al
callq 0x12090
movq 0x199649(%rip), %rax    # 0x1b0f90
movq (%rax), %rdi
callq 0x12850
leaq 0x19ad3a(%rip), %rsi    # 0x1b2690
leaq 0x40(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x1a4e0
movq 0x20(%rsp), %rdi
movsd 0x14e6a6(%rip), %xmm0   # 0x166018
callq 0x1a590
jmp 0x17979
leaq 0x40(%rsp), %rdi
movsd 0x14e692(%rip), %xmm0   # 0x166018
callq 0x1a5d0
jmp 0x1798d
movl $0x0, 0x30(%rsp)
movl 0x30(%rsp), %eax
movl %eax, 0x1c(%rsp)
movq 0x160(%rsp), %rdi
callq 0x19c40
movl %eax, %ecx
movl 0x1c(%rsp), %eax
cmpl %ecx, %eax
jge 0x17a17
movq 0x160(%rsp), %rdi
movl 0x30(%rsp), %esi
callq 0x19c90
movq %rax, 0x10(%rsp)
jmp 0x179cc
movq 0x10(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rdi
movq (%rdi), %rax
movq 0x88(%rax), %rax
leaq 0x40(%rsp), %rsi
callq *%rax
jmp 0x179ee
jmp 0x179f0
movl 0x30(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
jmp 0x17995
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x7fc50
jmp 0x17a94
cmpl $0x0, 0x19a5ca(%rip)    # 0x1b1fe8
je 0x17a7d
leaq 0x150(%rsp), %rdi
callq 0xdaad0
movsd %xmm0, 0x8(%rsp)
jmp 0x17a35
movsd 0x8(%rsp), %xmm0
leaq 0x14e8b0(%rip), %rdi    # 0x1662f2
movb $0x1, %al
callq 0x12090
jmp 0x17a4b
movq 0x160(%rsp), %rdi
callq 0x19c40
movl %eax, %esi
leaq 0x14e8a8(%rip), %rdi    # 0x166309
xorl %eax, %eax
callq 0x12090
jmp 0x17a6a
movq 0x19951f(%rip), %rax    # 0x1b0f90
movq (%rax), %rdi
callq 0x12850
jmp 0x17a7b
jmp 0x17a7d
leaq 0x40(%rsp), %rdi
callq 0x7fc50
movl $0x1, %eax
addq $0x168, %rsp            # imm = 0x168
retq
movq 0x38(%rsp), %rdi
callq 0x12c20
nop
// File: tomfunkhouser[P]gaps/apps/conf2conf/conf2conf.cpp
// Function: ResetTransformations(gaps::RGBDConfiguration*)
static int
ResetTransformations(RGBDConfiguration *configuration)
{
  // Start statistics
  RNTime start_time;
  start_time.Read();
  if (print_verbose) {
    printf("Reseting transformations to identity ...\n");
    fflush(stdout);
  }

  // Reset transformations
  for (int i = 0; i < configuration->NImages(); i++) {
    RGBDImage *image = configuration->Image(i);
    image->SetCameraToWorld(R3identity_affine);
  }

  // Print statistics
  if (print_verbose) {
    printf("  Time = %.2f seconds\n", start_time.Elapsed());
    printf("  # Images = %d\n", configuration->NImages());
    fflush(stdout);
  }

  // Return success
  return 1;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
leaq 0x20(%rsp), %rdi
callq 0xdaa10
leaq 0x20(%rsp), %rdi
callq 0x19c20
cmpl $0x0, 0x19a524(%rip)    # 0x1b1fe8
je 0x17ae3
leaq 0x14e9da(%rip), %rdi    # 0x1664a7
movb $0x0, %al
callq 0x12090
movq 0x1994b5(%rip), %rax    # 0x1b0f90
movq (%rax), %rdi
callq 0x12850
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x30(%rsp), %rdi
callq 0x19c40
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jge 0x17b39
movq 0x30(%rsp), %rdi
movl 0x1c(%rsp), %esi
callq 0x19c90
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq (%rdi), %rax
leaq 0x19ab67(%rip), %rsi    # 0x1b2690
callq *0x68(%rax)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x17aeb
cmpl $0x0, 0x19a4a8(%rip)    # 0x1b1fe8
je 0x17b83
leaq 0x20(%rsp), %rdi
callq 0xdaad0
leaq 0x14e79f(%rip), %rdi    # 0x1662f2
movb $0x1, %al
callq 0x12090
movq 0x30(%rsp), %rdi
callq 0x19c40
movl %eax, %esi
leaq 0x14e79c(%rip), %rdi    # 0x166309
movb $0x0, %al
callq 0x12090
movq 0x199415(%rip), %rax    # 0x1b0f90
movq (%rax), %rdi
callq 0x12850
movl $0x1, %eax
addq $0x38, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/apps/conf2conf/conf2conf.cpp
// Function: WriteConfigurationFile(gaps::RGBDConfiguration*, char const*)
static int
WriteConfigurationFile(RGBDConfiguration *configuration, const char *filename) 
{
  // Start statistics
  RNTime start_time;
  start_time.Read();
  if (print_verbose) {
    printf("Writing configuration to %s ...\n", filename);
    fflush(stdout);
  }

  // Set output directories if specified on command line
  if (output_depth_directory) configuration->SetDepthDirectory(output_depth_directory);
  if (output_color_directory) configuration->SetColorDirectory(output_color_directory);
  if (output_texture_directory) configuration->SetTextureDirectory(output_texture_directory);

  // Write file
  if (!configuration->WriteFile(filename, write_every_kth_image)) return 0;

  // Print statistics
  if (print_verbose) {
    printf("  Time = %.2f seconds\n", start_time.Elapsed());
    printf("  # Images = %d\n", configuration->NImages());
    printf("  # Surfaces = %d\n", configuration->NSurfaces());
    fflush(stdout);
  }

  // Return success
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq %rsp, %rdi
callq 0xdaa10
movq %rsp, %rdi
callq 0x19c20
cmpl $0x0, 0x199eb3(%rip)    # 0x1b1fe8
je 0x18159
movq 0x10(%rsp), %rsi
leaq 0x14e3ec(%rip), %rdi    # 0x16652f
movb $0x0, %al
callq 0x12090
movq 0x198e3f(%rip), %rax    # 0x1b0f90
movq (%rax), %rdi
callq 0x12850
cmpq $0x0, 0x199ea7(%rip)    # 0x1b2008
je 0x18175
movq 0x18(%rsp), %rdi
movq 0x199e99(%rip), %rsi    # 0x1b2008
movq (%rdi), %rax
callq *0x48(%rax)
cmpq $0x0, 0x199e93(%rip)    # 0x1b2010
je 0x18191
movq 0x18(%rsp), %rdi
movq 0x199e85(%rip), %rsi    # 0x1b2010
movq (%rdi), %rax
callq *0x40(%rax)
cmpq $0x0, 0x199e7f(%rip)    # 0x1b2018
je 0x181ad
movq 0x18(%rsp), %rdi
movq 0x199e71(%rip), %rsi    # 0x1b2018
movq (%rdi), %rax
callq *0x60(%rax)
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl 0x19954b(%rip), %edx    # 0x1b1708
movq (%rdi), %rax
callq *0x98(%rax)
cmpl $0x0, %eax
jne 0x181d5
movl $0x0, 0x24(%rsp)
jmp 0x1823f
cmpl $0x0, 0x199e0c(%rip)    # 0x1b1fe8
je 0x18237
movq %rsp, %rdi
callq 0xdaad0
leaq 0x14e105(%rip), %rdi    # 0x1662f2
movb $0x1, %al
callq 0x12090
movq 0x18(%rsp), %rdi
callq 0x19c40
movl %eax, %esi
leaq 0x14e102(%rip), %rdi    # 0x166309
movb $0x0, %al
callq 0x12090
movq 0x18(%rsp), %rdi
callq 0x19c60
movl %eax, %esi
leaq 0x14e0f9(%rip), %rdi    # 0x16631a
movb $0x0, %al
callq 0x12090
movq 0x198d61(%rip), %rax    # 0x1b0f90
movq (%rax), %rdi
callq 0x12850
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/apps/conf2conf/conf2conf.cpp
// Function: RGBDComputeSurfaceTextures(gaps::RGBDConfiguration*)
static int
RGBDComputeSurfaceTextures(RGBDConfiguration *configuration)
{
  // Check if should bother
  if (configuration->NSurfaces() == 0) return 1;

  // Read all channels
  configuration->ReadChannels();

  // Compute color textures for all surfaces
  for (int i = 0; i < configuration->NSurfaces(); i++) {
    RGBDSurface *surface = configuration->Surface(i);
    if (!RGBDComputeSurfaceTexture(surface)) return 0;
  }

  // Release all channels
  configuration->ReleaseChannels();

  // Return success
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rdi
callq 0x19c60
cmpl $0x0, %eax
jne 0x188c5
movl $0x1, 0x24(%rsp)
jmp 0x18948
movq 0x18(%rsp), %rdi
movq (%rdi), %rax
callq *0xd8(%rax)
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
movl %eax, 0x4(%rsp)
movq 0x18(%rsp), %rdi
callq 0x19c60
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x18932
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
callq 0x19f70
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rdi
callq 0x18960
cmpl $0x0, %eax
jne 0x18923
movl $0x0, 0x24(%rsp)
jmp 0x18948
jmp 0x18925
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x188db
movq 0x18(%rsp), %rdi
movq (%rdi), %rax
callq *0xe0(%rax)
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/apps/conf2conf/conf2conf.cpp
// Function: TextureScore(gaps::RGBDImage*, gaps::RGBDSurface*, gaps::R2Point const&, gaps::R2Point const&, gaps::RNRgb const&)
static RNScalar
TextureScore(RGBDImage *image, RGBDSurface *surface,
  const R2Point& image_position, const R2Point& texture_position,
  const RNRgb& color)
{
  // Get convenient variables
  R3Point E = image->WorldViewpoint();
  R3Point P = surface->TexelWorldPosition(texture_position);
  R3Vector N = surface->TexelWorldNormal(texture_position);
  R3Vector T = -(image->WorldTowards());
  R3Vector V = E - P; 
  RNLength d = V.Length();
  if (RNIsZero(d)) return 0.0;
  else V /= d;

  // Consider viewing angles
  RNScalar ndotv = N.Dot(V);
  if (RNIsNegativeOrZero(ndotv)) return 0;
  RNScalar tdotv = T.Dot(V);
  if (RNIsNegativeOrZero(tdotv)) return 0;
  RNScalar invdd = (d > 1.0) ? 1.0 / (d*d) : 1.0;
  
  // Compute score
  RNScalar score = 1.0;
  score *= ndotv;
  // score *= tdotv;
  score *= invdd;

  // Return score
  return score * score * score * score;
}

// Assembly:
subq $0xf8, %rsp
movq %rdi, 0xe8(%rsp)
movq %rsi, 0xe0(%rsp)
movq %rdx, 0xd8(%rsp)
movq %rcx, 0xd0(%rsp)
movq %r8, 0xc8(%rsp)
movq 0xe8(%rsp), %rsi
leaq 0xb0(%rsp), %rdi
callq 0x19db0
movq 0xe0(%rsp), %rsi
movq 0xd0(%rsp), %rdx
leaq 0x98(%rsp), %rdi
callq 0x24670
movq 0xe0(%rsp), %rsi
movq 0xd0(%rsp), %rdx
leaq 0x80(%rsp), %rdi
callq 0x24750
movq 0xe8(%rsp), %rsi
leaq 0x50(%rsp), %rdi
callq 0x1a320
leaq 0x68(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x8cdf0
leaq 0x38(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
leaq 0x98(%rsp), %rdx
callq 0x8ad00
leaq 0x38(%rsp), %rdi
callq 0x8bce0
movsd %xmm0, 0x30(%rsp)
movsd 0x30(%rsp), %xmm0
leaq 0x19849a(%rip), %rax    # 0x1b1ec0
movsd (%rax), %xmm1
callq 0x1a370
cmpl $0x0, %eax
je 0x19a45
xorps %xmm0, %xmm0
movsd %xmm0, 0xf0(%rsp)
jmp 0x19b7d
movsd 0x30(%rsp), %xmm0
leaq 0x38(%rsp), %rdi
callq 0x8cd10
leaq 0x80(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x8c110
movsd %xmm0, 0x28(%rsp)
movsd 0x28(%rsp), %xmm0
leaq 0x198446(%rip), %rax    # 0x1b1ec0
movsd (%rax), %xmm1
callq 0x1a3d0
cmpl $0x0, %eax
je 0x19a99
xorps %xmm0, %xmm0
movsd %xmm0, 0xf0(%rsp)
jmp 0x19b7d
leaq 0x68(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x8c110
movsd %xmm0, 0x20(%rsp)
movsd 0x20(%rsp), %xmm0
leaq 0x198405(%rip), %rax    # 0x1b1ec0
movsd (%rax), %xmm1
callq 0x1a3d0
cmpl $0x0, %eax
je 0x19ada
xorps %xmm0, %xmm0
movsd %xmm0, 0xf0(%rsp)
jmp 0x19b7d
movsd 0x30(%rsp), %xmm0
movsd 0x14c548(%rip), %xmm1   # 0x166030
ucomisd %xmm1, %xmm0
jbe 0x19b0e
movsd 0x30(%rsp), %xmm1
mulsd 0x30(%rsp), %xmm1
movsd 0x14c52e(%rip), %xmm0   # 0x166030
divsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
jmp 0x19b1e
movsd 0x14c51a(%rip), %xmm0   # 0x166030
movsd %xmm0, 0x8(%rsp)
jmp 0x19b1e
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x14c4fe(%rip), %xmm0   # 0x166030
movsd %xmm0, 0x10(%rsp)
movsd 0x28(%rsp), %xmm0
mulsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x18(%rsp), %xmm0
mulsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x10(%rsp), %xmm0
mulsd 0x10(%rsp), %xmm0
mulsd 0x10(%rsp), %xmm0
mulsd 0x10(%rsp), %xmm0
movsd %xmm0, 0xf0(%rsp)
movsd 0xf0(%rsp), %xmm0
addq $0xf8, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDTransform.cpp
// Function: gaps::RGBDTransformTextureToWorld(gaps::R2Point const&, gaps::R3Point&, gaps::RGBDSurface const*)
int RGBDTransformTextureToWorld(const R2Point& texture_position, R3Point& world_position, const RGBDSurface *surface)
{
  // Transform from position in texture coordinates to world coordinates
  R2Point surface_position;
  if (!RGBDTransformTextureToSurface(texture_position, surface_position, surface)) return 0;
  if (!RGBDTransformSurfaceToWorld(surface_position, world_position, surface)) return 0;
  return 1;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
leaq 0x8(%rsp), %rdi
callq 0xcfd70
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rdx
leaq 0x8(%rsp), %rsi
callq 0x1a700
cmpl $0x0, %eax
jne 0x1a770
movl $0x0, 0x34(%rsp)
jmp 0x1a79b
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdx
leaq 0x8(%rsp), %rdi
callq 0x1a7b0
cmpl $0x0, %eax
jne 0x1a793
movl $0x0, 0x34(%rsp)
jmp 0x1a79b
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDTransform.cpp
// Function: gaps::RGBDTransformTextureToCamera(gaps::R2Point const&, gaps::R3Point&, gaps::RGBDSurface const*, gaps::RGBDImage const*)
int RGBDTransformTextureToCamera(const R2Point& texture_position, R3Point& camera_position, const RGBDSurface *surface, const RGBDImage *image)
{
  // Transform from position in texture coordinates to camera coordinates
  R3Point world_position;
  if (!RGBDTransformTextureToWorld(texture_position, world_position, surface)) return 0;
  if (!RGBDTransformWorldToCamera(world_position, camera_position, image)) return 0;
  return 1;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
leaq 0x8(%rsp), %rdi
callq 0x8a990
movq 0x38(%rsp), %rdi
movq 0x28(%rsp), %rdx
leaq 0x8(%rsp), %rsi
callq 0x1a730
cmpl $0x0, %eax
jne 0x1a825
movl $0x0, 0x44(%rsp)
jmp 0x1a850
movq 0x30(%rsp), %rsi
movq 0x20(%rsp), %rdx
leaq 0x8(%rsp), %rdi
callq 0x1a860
cmpl $0x0, %eax
jne 0x1a848
movl $0x0, 0x44(%rsp)
jmp 0x1a850
movl $0x1, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDTransform.cpp
// Function: gaps::RGBDTransformTextureToImage(gaps::R2Point const&, gaps::R2Point&, gaps::RGBDSurface const*, gaps::RGBDImage const*)
int RGBDTransformTextureToImage(const R2Point& texture_position, R2Point& image_position, const RGBDSurface *surface, const RGBDImage *image)
{
  // Transform from position in texture coordinates to image coordinates
  R3Point world_position;
  if (!RGBDTransformTextureToWorld(texture_position, world_position, surface)) return 0;
  if (!RGBDTransformWorldToImage(world_position, image_position, image)) return 0;
  return 1;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
leaq 0x8(%rsp), %rdi
callq 0x8a990
movq 0x38(%rsp), %rdi
movq 0x28(%rsp), %rdx
leaq 0x8(%rsp), %rsi
callq 0x1a730
cmpl $0x0, %eax
jne 0x1a8d5
movl $0x0, 0x44(%rsp)
jmp 0x1a900
movq 0x30(%rsp), %rsi
movq 0x20(%rsp), %rdx
leaq 0x8(%rsp), %rdi
callq 0x1a910
cmpl $0x0, %eax
jne 0x1a8f8
movl $0x0, 0x44(%rsp)
jmp 0x1a900
movl $0x1, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDTransform.cpp
// Function: gaps::RGBDTransformWorldToImage(gaps::R3Point const&, gaps::R2Point&, gaps::RGBDImage const*)
int RGBDTransformWorldToImage(const R3Point& world_position, R2Point& image_position, const RGBDImage *image)
{
  // Transform from position in world coordinates to image coordinates
  R3Point camera_position;
  if (!RGBDTransformWorldToCamera(world_position, camera_position, image)) return 0;
  if (!RGBDTransformCameraToImage(camera_position, image_position, image)) return 0;
  return 1;

  // Return success
  return 1;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq %rsp, %rdi
callq 0x8a990
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rdx
movq %rsp, %rsi
callq 0x1a860
cmpl $0x0, %eax
jne 0x1a94c
movl $0x0, 0x34(%rsp)
jmp 0x1a975
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %rsp, %rdi
callq 0x1ab60
cmpl $0x0, %eax
jne 0x1a96d
movl $0x0, 0x34(%rsp)
jmp 0x1a975
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDTransform.cpp
// Function: gaps::RGBDTransformSurfaceToCamera(gaps::R2Point const&, gaps::R3Point&, gaps::RGBDSurface const*, gaps::RGBDImage const*)
int RGBDTransformSurfaceToCamera(const R2Point& surface_position, R3Point& camera_position, const RGBDSurface *surface, const RGBDImage *image)
{
  // Transform from position in surface coordinates to camera coordinates
  R3Point world_position;
  if (!RGBDTransformSurfaceToWorld(surface_position, world_position, surface)) return 0;
  if (!RGBDTransformWorldToCamera(world_position, camera_position, image)) return 0;
  return 1;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
leaq 0x8(%rsp), %rdi
callq 0x8a990
movq 0x38(%rsp), %rdi
movq 0x28(%rsp), %rdx
leaq 0x8(%rsp), %rsi
callq 0x1a7b0
cmpl $0x0, %eax
jne 0x1a9f5
movl $0x0, 0x44(%rsp)
jmp 0x1aa20
movq 0x30(%rsp), %rsi
movq 0x20(%rsp), %rdx
leaq 0x8(%rsp), %rdi
callq 0x1a860
cmpl $0x0, %eax
jne 0x1aa18
movl $0x0, 0x44(%rsp)
jmp 0x1aa20
movl $0x1, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDTransform.cpp
// Function: gaps::RGBDTransformSurfaceToImage(gaps::R2Point const&, gaps::R2Point&, gaps::RGBDSurface const*, gaps::RGBDImage const*)
int RGBDTransformSurfaceToImage(const R2Point& surface_position, R2Point& image_position, const RGBDSurface *surface, const RGBDImage *image)
{
  // Transform from position in surface coordinates to image coordinates
  R3Point world_position;
  if (!RGBDTransformSurfaceToWorld(surface_position, world_position, surface)) return 0;
  if (!RGBDTransformWorldToImage(world_position, image_position, image)) return 0;
  return 1;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
leaq 0x8(%rsp), %rdi
callq 0x8a990
movq 0x38(%rsp), %rdi
movq 0x28(%rsp), %rdx
leaq 0x8(%rsp), %rsi
callq 0x1a7b0
cmpl $0x0, %eax
jne 0x1aa75
movl $0x0, 0x44(%rsp)
jmp 0x1aaa0
movq 0x30(%rsp), %rsi
movq 0x20(%rsp), %rdx
leaq 0x8(%rsp), %rdi
callq 0x1a910
cmpl $0x0, %eax
jne 0x1aa98
movl $0x0, 0x44(%rsp)
jmp 0x1aaa0
movl $0x1, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDTransform.cpp
// Function: gaps::RGBDTransformWorldToTexture(gaps::R3Point const&, gaps::R2Point&, gaps::RGBDSurface const*)
int RGBDTransformWorldToTexture(const R3Point& world_position, R2Point& texture_position, const RGBDSurface *surface)
{
  // Transform from position in world coordinates to texture coordinates
  R2Point surface_position;
  if (!RGBDTransformWorldToSurface(world_position, surface_position, surface)) return 0;
  if (!RGBDTransformSurfaceToTexture(surface_position, texture_position, surface)) return 0;
  return 1;

  // Return success
  return 1;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
leaq 0x8(%rsp), %rdi
callq 0xcfd70
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rdx
leaq 0x8(%rsp), %rsi
callq 0x1ab30
cmpl $0x0, %eax
jne 0x1aaf0
movl $0x0, 0x34(%rsp)
jmp 0x1ab1b
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdx
leaq 0x8(%rsp), %rdi
callq 0x1a980
cmpl $0x0, %eax
jne 0x1ab13
movl $0x0, 0x34(%rsp)
jmp 0x1ab1b
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDTransform.cpp
// Function: gaps::RGBDTransformCameraToImage(gaps::R3Point const&, gaps::R2Point&, gaps::RGBDImage const*)
int RGBDTransformCameraToImage(const R3Point& camera_position, R2Point& image_position, const RGBDImage *image)
{
  // Transform from position in camera coordinates to image coordinates
  if (!image->TransformCameraToImage(camera_position, image_position)) return 0;

  // Check pixel position
  int image_ix = (int) (image_position.X() + 0.5);
  if ((image_ix < 0) || (image_ix >= image->NPixels(RN_X))) return 0;
  int image_iy = (int) (image_position.Y() + 0.5);
  if ((image_iy < 0) || (image_iy >= image->NPixels(RN_Y))) return 0;

#if 0
  // Get/check point depth
  RNScalar point_depth = -camera_position[2];
  if (RNIsNegativeOrZero(point_depth)) return 0;

  // Check depth
  RNScalar image_depth = image->PixelDepth(image_ix, image_iy);
  if ((image_depth == R2_GRID_UNKNOWN_VALUE) || (image_depth == 0)) return 0;

  // If depth is not within 10% of image depth, then probably not 
  if (image_depth < 0.9 * point_depth) return 0;
  if (image_depth > 1.1 * point_depth) return 0;
#endif
  
  // Return success
  return 1;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq (%rdi), %rax
callq *0x98(%rax)
cmpl $0x0, %eax
jne 0x1ab9d
movl $0x0, 0x34(%rsp)
jmp 0x1ac42
movq 0x20(%rsp), %rdi
callq 0x1af20
movsd 0x14b479(%rip), %xmm1   # 0x166028
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0x14(%rsp)
cmpl $0x0, 0x14(%rsp)
jl 0x1abe0
movl 0x14(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0x1af30
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jl 0x1abea
movl $0x0, 0x34(%rsp)
jmp 0x1ac42
movq 0x20(%rsp), %rdi
callq 0x1af70
movsd 0x14b42c(%rip), %xmm1   # 0x166028
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0x10(%rsp)
cmpl $0x0, 0x10(%rsp)
jl 0x1ac30
movl 0x10(%rsp), %eax
movl %eax, 0x8(%rsp)
movq 0x18(%rsp), %rdi
movl $0x1, %esi
callq 0x1af30
movl %eax, %ecx
movl 0x8(%rsp), %eax
cmpl %ecx, %eax
jl 0x1ac3a
movl $0x0, 0x34(%rsp)
jmp 0x1ac42
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDTransform.cpp
// Function: gaps::RGBDTransformCameraToTexture(gaps::R3Point const&, gaps::R2Point&, gaps::RGBDImage const*, gaps::RGBDSurface const*)
int RGBDTransformCameraToTexture(const R3Point& camera_position, R2Point& texture_position, const RGBDImage *image, const RGBDSurface *surface)
{
  // Transform from position in camera coordinates to texture coordinates
  R3Point world_position;
  if (!RGBDTransformCameraToWorld(camera_position, world_position, image)) return 0;
  if (!RGBDTransformWorldToTexture(world_position, texture_position, surface)) return 0;
  return 1;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
leaq 0x8(%rsp), %rdi
callq 0x8a990
movq 0x38(%rsp), %rdi
movq 0x28(%rsp), %rdx
leaq 0x8(%rsp), %rsi
callq 0x1acd0
cmpl $0x0, %eax
jne 0x1ac95
movl $0x0, 0x44(%rsp)
jmp 0x1acc0
movq 0x30(%rsp), %rsi
movq 0x20(%rsp), %rdx
leaq 0x8(%rsp), %rdi
callq 0x1aab0
cmpl $0x0, %eax
jne 0x1acb8
movl $0x0, 0x44(%rsp)
jmp 0x1acc0
movl $0x1, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDTransform.cpp
// Function: gaps::RGBDTransformCameraToSurface(gaps::R3Point const&, gaps::R2Point&, gaps::RGBDImage const*, gaps::RGBDSurface const*)
int RGBDTransformCameraToSurface(const R3Point& camera_position, R2Point& surface_position, const RGBDImage *image, const RGBDSurface *surface)
{
  // Transform from position in camera coordinates to surface coordinates
  R3Point world_position;
  if (!RGBDTransformCameraToWorld(camera_position, world_position, image)) return 0;
  if (!RGBDTransformWorldToSurface(world_position, surface_position, surface)) return 0;
  return 1;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
leaq 0x8(%rsp), %rdi
callq 0x8a990
movq 0x38(%rsp), %rdi
movq 0x28(%rsp), %rdx
leaq 0x8(%rsp), %rsi
callq 0x1acd0
cmpl $0x0, %eax
jne 0x1ad45
movl $0x0, 0x44(%rsp)
jmp 0x1ad70
movq 0x30(%rsp), %rsi
movq 0x20(%rsp), %rdx
leaq 0x8(%rsp), %rdi
callq 0x1ab30
cmpl $0x0, %eax
jne 0x1ad68
movl $0x0, 0x44(%rsp)
jmp 0x1ad70
movl $0x1, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDTransform.cpp
// Function: gaps::RGBDTransformImageToTexture(gaps::R2Point const&, gaps::R2Point&, gaps::RGBDImage const*, gaps::RGBDSurface const*)
int RGBDTransformImageToTexture(const R2Point& image_position, R2Point& texture_position, const RGBDImage *image, const RGBDSurface *surface)
{
  // Transform from position in image coordinates to texture coordinates
  R3Point world_position;
  if (!RGBDTransformImageToWorld(image_position, world_position, image)) return 0;
  if (!RGBDTransformWorldToTexture(world_position, texture_position, surface)) return 0;
  return 1;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
leaq 0x8(%rsp), %rdi
callq 0x8a990
movq 0x38(%rsp), %rdi
movq 0x28(%rsp), %rdx
leaq 0x8(%rsp), %rsi
callq 0x1ae00
cmpl $0x0, %eax
jne 0x1adc5
movl $0x0, 0x44(%rsp)
jmp 0x1adf0
movq 0x30(%rsp), %rsi
movq 0x20(%rsp), %rdx
leaq 0x8(%rsp), %rdi
callq 0x1aab0
cmpl $0x0, %eax
jne 0x1ade8
movl $0x0, 0x44(%rsp)
jmp 0x1adf0
movl $0x1, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDTransform.cpp
// Function: gaps::RGBDTransformImageToWorld(gaps::R2Point const&, gaps::R3Point&, gaps::RGBDImage const*)
int RGBDTransformImageToWorld(const R2Point& image_position, R3Point& world_position, const RGBDImage *image)
{
  // Transform from position in image coordinates to world coordinates
  R3Point camera_position;
  if (!RGBDTransformImageToCamera(image_position, camera_position, image)) return 0;
  if (!RGBDTransformCameraToWorld(camera_position, world_position, image)) return 0;
  return 1;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq %rsp, %rdi
callq 0x8a990
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rdx
movq %rsp, %rsi
callq 0x1aef0
cmpl $0x0, %eax
jne 0x1ae3c
movl $0x0, 0x34(%rsp)
jmp 0x1ae65
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %rsp, %rdi
callq 0x1acd0
cmpl $0x0, %eax
jne 0x1ae5d
movl $0x0, 0x34(%rsp)
jmp 0x1ae65
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDTransform.cpp
// Function: gaps::RGBDTransformImageToSurface(gaps::R2Point const&, gaps::R2Point&, gaps::RGBDImage const*, gaps::RGBDSurface const*)
int RGBDTransformImageToSurface(const R2Point& image_position, R2Point& surface_position, const RGBDImage *image, const RGBDSurface *surface)
{
  // Transform from position in image coordinates to surface coordinates
  R3Point world_position;
  if (!RGBDTransformImageToWorld(image_position, world_position, image)) return 0;
  if (!RGBDTransformWorldToSurface(world_position, surface_position, surface)) return 0;
  return 1;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
leaq 0x8(%rsp), %rdi
callq 0x8a990
movq 0x38(%rsp), %rdi
movq 0x28(%rsp), %rdx
leaq 0x8(%rsp), %rsi
callq 0x1ae00
cmpl $0x0, %eax
jne 0x1aeb5
movl $0x0, 0x44(%rsp)
jmp 0x1aee0
movq 0x30(%rsp), %rsi
movq 0x20(%rsp), %rdx
leaq 0x8(%rsp), %rdi
callq 0x1ab30
cmpl $0x0, %eax
jne 0x1aed8
movl $0x0, 0x44(%rsp)
jmp 0x1aee0
movl $0x1, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopl (%rax)