LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/occivink[P]pyct/monocypher.cpp
// Function: remove_l(unsigned int*, unsigned int const*)
static void remove_l(u32 r[8], const u32 x[8])
{
    u64 carry = is_above_l(x);
    u32 mask  = ~(u32)carry + 1; // carry == 0 or 1
    FOR (i, 0, 8) {
        carry += (u64)x[i] + (~L[i] & mask);
        r[i]   = (u32)carry;
        carry >>= 32;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x63e4
movl %eax, %esi
negl %eax
xorl %ecx, %ecx
leaq 0x38c3(%rip), %rdx      # 0xca00
cmpq $0x20, %rcx
je 0x9164
movl (%rbx,%rcx), %edi
addq %rdi, %rsi
movl (%rcx,%rdx), %edi
notl %edi
andl %eax, %edi
addq %rsi, %rdi
movl %edi, (%r14,%rcx)
shrq $0x20, %rdi
addq $0x4, %rcx
movq %rdi, %rsi
jmp 0x913d
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/occivink[P]pyct/pyct.cpp
// Function: ask_pass[abi:cxx11](bool)
string ask_pass(bool confirm) {
    FILE* in;
    FILE* out;
    out = in = fopen("/dev/tty", "w+");
    auto close = on_scope_end([in] { fclose(in); });

    // literally caveman-tier shit
    termios t;
    tcgetattr(fileno(in), &t);
    auto show_input = on_scope_end([in, t] { tcsetattr(fileno(in), TCSANOW, &t); });
    t.c_lflag &= ~ECHO;
    tcsetattr(fileno(in), TCSANOW, &t);

    auto get_pass = [in, out](const char* prompt){
        fprintf(out, "%s", prompt);
        string s;
        while (true) {
            auto c = fgetc(in);
            if (c == '\n' or c == EOF)
                break;
            s.push_back(static_cast<char>(c));
        }
        fprintf(out, "\n");
        return s;
    };
    auto pass = get_pass("Password:");
    if (confirm) {
        auto pass2 = get_pass("Confirm password:");
        if (pass != pass2)
            throw runtime_error{"Passwords do not match"};
        crypto_wipe(&pass2[0], pass2.size());
    }
    return pass;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xc0, %rsp
movl %esi, %ebp
movq %rdi, %r14
leaq 0x3856(%rip), %rdi      # 0xd08c
leaq 0x3858(%rip), %rsi      # 0xd095
callq 0x2250
movq %rax, %rbx
movq %rax, %rdi
callq 0x2220
leaq 0x84(%rsp), %r15
movl %eax, %edi
movq %r15, %rsi
callq 0x2230
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movups 0x2c(%r15), %xmm3
movups %xmm3, 0x6c(%rsp)
movups %xmm2, 0x60(%rsp)
movups %xmm1, 0x50(%rsp)
movups %xmm0, 0x40(%rsp)
movq %rbx, 0x38(%rsp)
andb $-0x9, 0xc(%r15)
movq %rbx, %rdi
callq 0x2220
movl %eax, %edi
xorl %esi, %esi
movq %r15, %rdx
callq 0x2280
leaq 0x28(%rsp), %rsi
movq %rbx, (%rsi)
movq %rbx, 0x8(%rsi)
leaq 0x37e1(%rip), %rdx      # 0xd098
movq %r14, %rdi
callq 0x99a0
testb %bpl, %bpl
je 0x9904
leaq 0x37d7(%rip), %rdx      # 0xd0a2
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x99a0
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0xada1
testb %al, %al
jne 0x9929
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x25a4
leaq 0x8(%rsp), %rdi
callq 0x20e0
leaq 0x38(%rsp), %rdi
callq 0x9a10
movq %rbx, %rdi
callq 0x21d0
movq %r14, %rax
addq $0xc0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x2100
movq %rax, %r12
leaq 0x3779(%rip), %rsi      # 0xd0b4
movq %rax, %rdi
callq 0x2090
movq 0x86a6(%rip), %rsi      # 0x11ff0
movq 0x864f(%rip), %rdx      # 0x11fa0
movq %r12, %rdi
callq 0x2360
movq %rax, %r15
movq %r12, %rdi
callq 0x2160
jmp 0x996e
movq %rax, %r15
jmp 0x9978
movq %rax, %r15
leaq 0x8(%rsp), %rdi
callq 0x20e0
movq %r14, %rdi
callq 0x20e0
jmp 0x9985
movq %rax, %r15
leaq 0x38(%rsp), %rdi
callq 0x9a10
movq %rbx, %rdi
callq 0x21d0
movq %r15, %rdi
callq 0x2380
nop
// File: /workspace/github_cpp_makefile_star2_O2/occivink[P]pyct/pyct.cpp
// Function: hash_password(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned long, unsigned long)
Hash hash_password(string& password, const string& salt, u64 iterations, u64 work_area_size) {
    if (salt.size() < 8)
        throw invalid_argument{"Salt too small"};
    if (work_area_size < 8*1024)
        throw invalid_argument{"Work area is too small"};
    if (iterations == 0)
        throw invalid_argument{"Need at least one iteration"};

    auto rem = work_area_size % 1024;
    if (rem > 0)
        work_area_size = work_area_size - rem + 1024;
    u64 nb_blocks = work_area_size / 1024;

    vector<u8> work_area(work_area_size);

    Hash hash;
    crypto_argon2i(hash.data(), hash.size(),
                   work_area.data(), nb_blocks,
                   iterations,
                   reinterpret_cast<const u8*>(&password[0]), password.size(),
                   reinterpret_cast<const u8*>(&salt[0]), salt.size());

    crypto_wipe(&password[0], password.size());
    password = {};
    return hash;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
cmpq $0x7, 0x8(%rdx)
jbe 0x9af0
movq %r8, %r13
cmpq $0x1fff, %r8            # imm = 0x1FFF
jbe 0x9b0c
movq %rcx, %r12
testq %rcx, %rcx
je 0x9b28
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
addq $0x3ff, %r13            # imm = 0x3FF
movq %r13, %rsi
andq $-0x400, %rsi           # imm = 0xFC00
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0xadac
shrq $0xa, %r13
movq 0x8(%rsp), %rdx
movq (%r14), %r9
movl 0x8(%r14), %eax
movl 0x8(%r15), %r10d
subq $0x8, %rsp
pushq $0x20
popq %rsi
movq %rbx, %rdi
movl %r13d, %ecx
movl %r12d, %r8d
pushq %r10
pushq (%r15)
pushq %rax
callq 0x573f
addq $0x20, %rsp
movq (%r14), %rdi
movq 0x8(%r14), %rsi
callq 0x25a4
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x22a0
leaq 0x8(%rsp), %rdi
callq 0xb73e
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
pushq $0x10
popq %rdi
callq 0x2100
movq %rax, %r14
leaq 0x35c9(%rip), %rsi      # 0xd0cb
movq %rax, %rdi
callq 0x23a0
jmp 0x9b42
pushq $0x10
popq %rdi
callq 0x2100
movq %rax, %r14
leaq 0x35bc(%rip), %rsi      # 0xd0da
movq %rax, %rdi
callq 0x23a0
jmp 0x9b42
pushq $0x10
popq %rdi
callq 0x2100
movq %rax, %r14
leaq 0x35b7(%rip), %rsi      # 0xd0f1
movq %rax, %rdi
callq 0x23a0
movq 0x8487(%rip), %rsi      # 0x11fd0
movq 0x8470(%rip), %rdx      # 0x11fc0
movq %r14, %rdi
callq 0x2360
jmp 0x9b5c
jmp 0x9b5c
movq %rax, %rbx
movq %r14, %rdi
callq 0x2160
jmp 0x9b7b
movq %rax, %rbx
jmp 0x9b7b
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xb73e
movq %rbx, %rdi
callq 0x2380
// File: /workspace/github_cpp_makefile_star2_O2/occivink[P]pyct/pyct.cpp
// Function: decrypt(std::vector<unsigned char, std::allocator<unsigned char>>, std::array<unsigned char, 32ul> const&)
vector<u8> decrypt(vector<u8> input, const Hash& hash) {
    if (input.size() < (8 + 16 + 24))
        throw invalid_argument{"Not enough data"};
    size_t message_length = input.size() - 24 - 16;
    u8* message_data = input.data();
    u8* mac_data = message_data + message_length;
    u8* nonce_data = mac_data + 16;

    if (0 != crypto_unlock(message_data,
                           hash.data(),
                           nonce_data,
                           mac_data,
                           message_data, message_length))
        throw invalid_argument{"Couldn't decrypt, invalid password?"};

    u8* size_data = message_data + message_length - 8;
    u64 original_size = static_cast<u64>(size_data[7])       |
                        static_cast<u64>(size_data[6]) << 8  |
                        static_cast<u64>(size_data[5]) << 16 |
                        static_cast<u64>(size_data[4]) << 24 |
                        static_cast<u64>(size_data[3]) << 32 |
                        static_cast<u64>(size_data[2]) << 40 |
                        static_cast<u64>(size_data[1]) << 48 |
                        static_cast<u64>(size_data[0]) << 56;
    input.resize(original_size);
    return input;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rsi), %rdi
movq 0x8(%rsi), %rax
subq %rdi, %rax
cmpq $0x2f, %rax
jbe 0x9d37
movq %rsi, %r14
leaq -0x28(%rax), %r9
leaq (%rdi,%rax), %r15
addq $-0x28, %r15
leaq -0x18(%rdi,%rax), %rax
movq %rdx, %rsi
movq %rax, %rdx
movq %r15, %rcx
movq %rdi, %r8
callq 0x8a1f
testl %eax, %eax
jne 0x9d53
movq -0x8(%r15), %rsi
bswapq %rsi
movq %r14, %rdi
callq 0xadfe
movups (%r14), %xmm0
movups %xmm0, (%rbx)
movq 0x10(%r14), %rax
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
andq $0x0, 0x10(%r14)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
pushq $0x10
popq %rdi
callq 0x2100
movq %rax, %rbx
leaq 0x33e8(%rip), %rsi      # 0xd131
movq %rax, %rdi
callq 0x23a0
jmp 0x9d6d
pushq $0x10
popq %rdi
callq 0x2100
movq %rax, %rbx
leaq 0x33dc(%rip), %rsi      # 0xd141
movq %rax, %rdi
callq 0x23a0
movq 0x825c(%rip), %rsi      # 0x11fd0
movq 0x8245(%rip), %rdx      # 0x11fc0
movq %rbx, %rdi
callq 0x2360
jmp 0x9d85
movq %rax, %r14
movq %rbx, %rdi
callq 0x2160
movq %r14, %rdi
callq 0x2380
// File: /workspace/github_cpp_makefile_star2_O2/occivink[P]pyct/pyct.cpp
// Function: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> read_from_fd<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>(int)
T read_from_fd(int fd) {
    T data;
    size_t old_size = 0;
    size_t new_size = 32;
    while (true) {
        data.resize(new_size);
        size_t left_to_read = new_size - old_size;
        size_t already_read = 0;
        while (left_to_read > 0) {
            auto just_read = read(fd, &data[old_size + already_read], left_to_read);
            if (just_read < 0 or (size_t)just_read > left_to_read)
                throw runtime_error{"I/O error"};
            else if (just_read == 0) {
                data.resize(old_size + already_read);
                return data;
            }
            left_to_read -= just_read;
            already_read += just_read;
        }
        old_size = new_size;
        new_size *= 2;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movl %esi, %ebp
movb $0x0, 0x10(%rdi)
pushq $0x20
popq %r15
xorl %r13d, %r13d
movq %rbx, %rdi
movq %r15, %rsi
callq 0x22c0
movq %r15, (%rsp)
subq %r13, %r15
xorl %r14d, %r14d
testq %r15, %r15
je 0xaf81
leaq (%r14,%r13), %r12
movq (%rbx), %rsi
addq %r12, %rsi
movl %ebp, %edi
movq %r15, %rdx
callq 0x22e0
testq %rax, %rax
js 0xafab
subq %rax, %r15
jb 0xafab
testq %rax, %rax
je 0xaf8e
addq %rax, %r14
jmp 0xaf54
movq (%rsp), %rax
movq %rax, %r13
leaq (%rax,%rax), %r15
jmp 0xaf3f
movq %rbx, %rdi
movq %r12, %rsi
callq 0x22c0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x2100
movq %rax, %r15
leaq 0x29d9(%rip), %rsi      # 0xd996
movq %rax, %rdi
callq 0x2090
movq 0x7024(%rip), %rsi      # 0x11ff0
movq 0x6fcd(%rip), %rdx      # 0x11fa0
movq %r15, %rdi
callq 0x2360
jmp 0xafec
movq %rax, %r14
movq %r15, %rdi
callq 0x2160
jmp 0xafef
jmp 0xafec
movq %rax, %r14
movq %rbx, %rdi
callq 0x20e0
movq %r14, %rdi
callq 0x2380
// File: /workspace/github_cpp_makefile_star2_O2/jingdao[P]PointCloudApp/main.cpp
// Function: testEigenvalue()
void testEigenvalue() {
	int n=4;
	double A[4*4] = {0.35,0.09,-0.44,0.25,
					 0.45,0.07,-0.33,-0.32,
					 -0.14,-0.54,-0.03,-0.13,
					 -0.17,0.35,0.17,0.11};
	double lambda_real[4] = {};
	double lambda_imag[4] = {};
	double v[4*4] = {};
	Normal::eigenvalue(n,A,lambda_real,lambda_imag,v);
	printf("lambda: ");
	for (int i=0;i<n;i++)
		printf("%f+%fi ",lambda_real[i],lambda_imag[i]);
	printf("\n");
	for (int i=0;i<n;i++) {
		printf("v%d: ",i);
		for (int j=0;j<n;j++) {
			if (lambda_imag[i]==0)
				printf("%f ",v[i*n+j]);
			else if (lambda_imag[i]>0)
				printf("%f+%fi ",v[i*n+j],v[(i+1)*n+j]);
			else
				printf("%f+%fi ",v[(i-1)*n+j],-v[i*n+j]);

		}
		printf("\n");
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
leaq 0x7a5c(%rip), %rsi      # 0xa040
pushq $0x10
popq %rcx
leaq 0xc0(%rsp), %rax
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdx
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, (%rdx)
movq %rsp, %rcx
movaps %xmm0, 0x10(%rcx)
movaps %xmm0, (%rcx)
leaq 0x40(%rsp), %r8
movaps %xmm0, 0x70(%r8)
movaps %xmm0, 0x60(%r8)
movaps %xmm0, 0x50(%r8)
movaps %xmm0, 0x40(%r8)
movaps %xmm0, 0x30(%r8)
movaps %xmm0, 0x20(%r8)
movaps %xmm0, 0x10(%r8)
movaps %xmm0, (%r8)
pushq $0x4
popq %rdi
movq %rax, %rsi
callq 0x8fb2
leaq 0x7b34(%rip), %rdi      # 0xa180
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x2050
leaq 0x7b2c(%rip), %rbx      # 0xa189
cmpq $0x4, %r14
je 0x267f
movsd 0x20(%rsp,%r14,8), %xmm0
movsd (%rsp,%r14,8), %xmm1
movq %rbx, %rdi
movb $0x2, %al
callq 0x2050
incq %r14
jmp 0x265d
pushq $0xa
popq %rdi
callq 0x2290
leaq 0x60(%rsp), %rbp
pushq $-0x20
popq %r14
leaq 0x7b00(%rip), %r15      # 0xa197
leaq 0x7aeb(%rip), %r12      # 0xa189
xorl %r13d, %r13d
cmpq $0x4, %r13
je 0x272f
leaq 0x7adf(%rip), %rdi      # 0xa191
movl %r13d, %esi
xorl %eax, %eax
callq 0x2050
movq %r14, %rbx
testq %rbx, %rbx
je 0x271b
movsd (%rsp,%r13,8), %xmm0
ucomisd 0x794e(%rip), %xmm0     # 0xa020
jne 0x26e8
jp 0x26e8
movsd (%rbp,%rbx), %xmm0
movq %r15, %rdi
movb $0x1, %al
callq 0x2050
jmp 0x2715
jbe 0x26f8
movsd (%rbp,%rbx), %xmm0
movsd 0x20(%rbp,%rbx), %xmm1
jmp 0x270b
movsd -0x20(%rbp,%rbx), %xmm0
movsd (%rbp,%rbx), %xmm1
xorps 0x7905(%rip), %xmm1     # 0xa010
movq %r12, %rdi
movb $0x2, %al
callq 0x2050
addq $0x8, %rbx
jmp 0x26bf
pushq $0xa
popq %rdi
callq 0x2290
incq %r13
addq $0x20, %rbp
jmp 0x26a1
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jingdao[P]PointCloudApp/main.cpp
// Function: testSVD()
void testSVD() {
	int m=6,n=4,l=(m>n?n:m);
	double A[6*4] = {2.27,0.28,-0.48,1.07,-2.35,0.62,
					-1.54,-1.67,-3.09,1.22,2.93,-7.39,
					1.15,0.94,0.99,0.79,-1.45,1.03,
					-1.94,-0.78,-0.21,0.63,2.30,-2.57};
	double U[6*6] = {};
	double S[4] = {};
	double VT[4*4] = {};
	Normal::svd(m,n,A,U,S,VT);
	printf("S: ");
	for (int i=0;i<l;i++)
		printf("%f ",S[i]);
	printf("\n");
	for (int i=0;i<m;i++) {
		printf("u%d: ",i);
		for (int j=0;j<m;j++) {
			printf("%f ",U[i*m+j]);
		}
		printf("\n");
	}
	for (int i=0;i<n;i++) {
		printf("v%d: ",i);
		for (int j=0;j<n;j++) {
			printf("%f ",VT[i*n+j]);
		}
		printf("\n");
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
leaq 0x7967(%rip), %rsi      # 0xa0c0
leaq 0xa0(%rsp), %r15
movl $0xc0, %edx
movq %r15, %rdi
callq 0x2180
leaq 0x160(%rsp), %r14
xorl %r12d, %r12d
movl $0x120, %edx            # imm = 0x120
movq %r14, %rdi
xorl %esi, %esi
callq 0x2100
xorps %xmm0, %xmm0
movq %rsp, %r8
movaps %xmm0, 0x10(%r8)
movaps %xmm0, (%r8)
leaq 0x20(%rsp), %rbx
movaps %xmm0, 0x70(%rbx)
movaps %xmm0, 0x60(%rbx)
movaps %xmm0, 0x50(%rbx)
movaps %xmm0, 0x40(%rbx)
movaps %xmm0, 0x30(%rbx)
movaps %xmm0, 0x20(%rbx)
movaps %xmm0, 0x10(%rbx)
movaps %xmm0, (%rbx)
pushq $0x6
popq %rdi
pushq $0x4
popq %rsi
movq %r15, %rdx
movq %r14, %rcx
movq %rbx, %r9
callq 0x90b0
leaq 0x79c5(%rip), %rdi      # 0xa19b
xorl %eax, %eax
callq 0x2050
leaq 0x79b3(%rip), %r15      # 0xa197
cmpq $0x4, %r12
je 0x27ff
movsd (%rsp,%r12,8), %xmm0
movq %r15, %rdi
movb $0x1, %al
callq 0x2050
incq %r12
jmp 0x27e4
pushq $0xa
popq %rdi
callq 0x2290
leaq 0x7991(%rip), %r15      # 0xa19f
leaq 0x7982(%rip), %r12      # 0xa197
xorl %r13d, %r13d
cmpq $0x6, %r13
je 0x2859
movq %r15, %rdi
movl %r13d, %esi
xorl %eax, %eax
callq 0x2050
xorl %ebp, %ebp
cmpq $0x6, %rbp
je 0x2848
movsd (%r14,%rbp,8), %xmm0
movq %r12, %rdi
movb $0x1, %al
callq 0x2050
incq %rbp
jmp 0x282d
pushq $0xa
popq %rdi
callq 0x2290
incq %r13
addq $0x30, %r14
jmp 0x2818
leaq 0x7931(%rip), %r14      # 0xa191
pushq $0xa
popq %rbp
leaq 0x792d(%rip), %r15      # 0xa197
xorl %r12d, %r12d
cmpq $0x4, %r12
je 0x28ae
movq %r14, %rdi
movl %r12d, %esi
xorl %eax, %eax
callq 0x2050
xorl %r13d, %r13d
cmpq $0x4, %r13
je 0x289e
movsd (%rbx,%r13,8), %xmm0
movq %r15, %rdi
movb $0x1, %al
callq 0x2050
incq %r13
jmp 0x2883
movl %ebp, %edi
callq 0x2290
incq %r12
addq $0x20, %rbx
jmp 0x286d
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jingdao[P]PointCloudApp/pcd.cpp
// Function: PCD::PCD(int)
PCD::PCD(int size) {
	numFields = 4;
	data = NULL;
	float_data = (float*) malloc(size*4*sizeof(float));
	fields = NULL;
	numPoints = size;
	capacity = size;
	data_storage = ASCII;
	kdtree = NULL;
	camera = { {0,0,0,0}, {1,0,0,0}, 1};
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x4, 0x40(%rdi)
andq $0x0, 0x50(%rdi)
movl %esi, %r14d
leal (,%r14,4), %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x2280
movq %rax, 0x58(%rbx)
andq $0x0, 0x48(%rbx)
movl %r14d, 0x60(%rbx)
movl %r14d, 0x64(%rbx)
andl $0x0, 0x68(%rbx)
andq $0x0, 0x70(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x1c(%rbx)
movl $0x3f800000, 0x2c(%rbx) # imm = 0x3F800000
movabsq $0x3f80000000000000, %rax # imm = 0x3F80000000000000
movq %rax, 0x38(%rbx)
andq $0x0, 0x30(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/jingdao[P]PointCloudApp/pcd.cpp
// Function: PCD::~PCD()
PCD::~PCD() {
	if (fields) free(fields);
	if (data) free(data);
	if (float_data) free(float_data);
	if (kdtree) delete kdtree;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x48(%rdi), %rdi
callq 0x2250
movq 0x50(%rbx), %rdi
callq 0x2250
movq 0x58(%rbx), %rdi
callq 0x2250
movq 0x70(%rbx), %rbx
testq %rbx, %rbx
je 0x33da
movq %rbx, %rdi
callq 0x77b4
pushq $0x40
popq %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x2210
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/jingdao[P]PointCloudApp/pcd.cpp
// Function: PCD::expand(int)
bool PCD::expand(int size) {
	if (size < 0)
		return false;
	numPoints = size;
	if (size > capacity) {
		if (capacity == 0)
			capacity = size;
		else while (capacity < size)
			capacity *= 2;
		void* memblk  = realloc(float_data, capacity * 4 * sizeof(float));
		if (memblk) {
			float_data = (float*) memblk;
		} else {
			printf("Error: Cannot realloc %lu bytes\n",capacity * 4 * sizeof(float));
			return false;
		}
	}
	return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testl %esi, %esi
js 0x3427
movq %rdi, %r14
movl %esi, 0x60(%rdi)
movl 0x64(%rdi), %eax
movb $0x1, %bl
cmpl %esi, %eax
jge 0x3443
testl %eax, %eax
jne 0x3403
movl %esi, 0x64(%r14)
jmp 0x3409
addl %eax, %eax
movl %eax, 0x64(%r14)
cmpl %esi, %eax
jl 0x33fd
movl %eax, %esi
movq 0x58(%r14), %rdi
shll $0x2, %esi
movslq %esi, %rsi
shlq $0x2, %rsi
callq 0x2390
testq %rax, %rax
je 0x342b
movq %rax, 0x58(%r14)
jmp 0x3443
xorl %ebx, %ebx
jmp 0x3443
movslq 0x64(%r14), %rsi
shlq $0x4, %rsi
leaq 0x709d(%rip), %rdi      # 0xa4d7
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x2050
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/jingdao[P]PointCloudApp/pcd.cpp
// Function: PCD::drawLine(float, float, float, float, float, float, float, float)
void PCD::drawLine(float x1,float y1,float z1,float x2,float y2,float z2,float rgb,float interval) {
	float distance = 0;
	int offset = numPoints * 4,numSteps;
	distance += (x2-x1) * (x2-x1);
	distance += (y2-y1) * (y2-y1);
	distance += (z2-z1) * (z2-z1);
	numSteps = (int) (distance/interval/interval);
	expand(numPoints + numSteps - 1);
	float* data = float_data + offset;

	float dx = (x2-x1) / numSteps;
	float dy = (y2-y1) / numSteps;
	float dz = (z2-z1) / numSteps;
	float x = x1+dx, y = y1+dy, z = z1+dz;
	for (int i=1;i<numSteps;i++) {
		*data++ = x;
		*data++ = y;
		*data++ = z;
		*data++ = rgb;
		x += dx;
		y += dy;
		z += dz;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movss %xmm6, 0xc(%rsp)
movss %xmm2, 0x8(%rsp)
movq %rdi, %rbx
movslq 0x60(%rdi), %r14
unpcklps %xmm4, %xmm3            # xmm3 = xmm3[0],xmm4[0],xmm3[1],xmm4[1]
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movaps %xmm0, 0x30(%rsp)
subps %xmm0, %xmm3
movaps %xmm3, 0x20(%rsp)
movaps %xmm3, %xmm0
mulss %xmm3, %xmm0
xorps %xmm1, %xmm1
addss %xmm0, %xmm1
movaps %xmm3, %xmm0
shufps $0x55, %xmm3, %xmm0     # xmm0 = xmm0[1,1],xmm3[1,1]
mulss %xmm0, %xmm0
addss %xmm1, %xmm0
subss %xmm2, %xmm5
movss %xmm5, 0x4(%rsp)
mulss %xmm5, %xmm5
addss %xmm0, %xmm5
divss %xmm7, %xmm5
divss %xmm7, %xmm5
movaps %xmm5, 0x10(%rsp)
cvttss2si %xmm5, %r15d
leal (%r15,%r14), %esi
decl %esi
callq 0x33dc
movaps 0x30(%rsp), %xmm4
movaps 0x20(%rsp), %xmm3
movss 0x4(%rsp), %xmm2
movss 0xc(%rsp), %xmm1
shlq $0x4, %r14
addq 0x58(%rbx), %r14
cvttps2dq 0x10(%rsp), %xmm0
cvtdq2ps %xmm0, %xmm0
divss %xmm0, %xmm2
shufps $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
divps %xmm0, %xmm3
movss 0x8(%rsp), %xmm0
pushq $0x1
popq %rax
cmpl %r15d, %eax
jge 0x3528
addss %xmm2, %xmm0
addps %xmm3, %xmm4
movlps %xmm4, (%r14)
movss %xmm0, 0x8(%r14)
movss %xmm1, 0xc(%r14)
addq $0x10, %r14
incl %eax
jmp 0x3504
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/jingdao[P]PointCloudApp/pcd.cpp
// Function: PCD::drawAxis(float, float, float, float*, float, float)
void PCD::drawAxis(float x,float y,float z,float* R,float length,float interval) {
	float I[9] = {1,0,0,0,1,0,0,0,1}; //identity matrix
	float *rotation = R ? R : I;
	float rgb[3] = {255<<16, 255<<8, 255};

	for (int i=0;i<3;i++) { // three axes
		float x2 = x + rotation[i] * length;
		float y2 = y + rotation[i + 3] * length;
		float z2 = z + rotation[i + 6] * length;
		drawLine(x,y,z,x2,y2,z2,rgb[i],interval);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movss %xmm4, 0x1c(%rsp)
movss %xmm3, 0x18(%rsp)
movq %rsi, %rbx
movss %xmm2, 0x14(%rsp)
movss %xmm1, 0x10(%rsp)
movss %xmm0, 0xc(%rsp)
movq %rdi, %r14
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rax
movaps %xmm0, (%rax)
movaps %xmm0, 0x10(%rax)
movl $0x3f800000, %ecx       # imm = 0x3F800000
movl %ecx, (%rax)
movl %ecx, 0x10(%rax)
movl %ecx, 0x20(%rax)
testq %rsi, %rsi
cmoveq %rax, %rbx
xorl %r15d, %r15d
leaq 0x73f2(%rip), %r12      # 0xa980
cmpq $0xc, %r15
je 0x35f2
movss (%rbx,%r15), %xmm3
movss 0x18(%rsp), %xmm2
mulss %xmm2, %xmm3
movss 0xc(%rsp), %xmm0
addss %xmm0, %xmm3
movss 0xc(%rbx,%r15), %xmm4
mulss %xmm2, %xmm4
movss 0x10(%rsp), %xmm1
addss %xmm1, %xmm4
movss 0x18(%rbx,%r15), %xmm5
mulss %xmm2, %xmm5
movss 0x14(%rsp), %xmm2
addss %xmm2, %xmm5
movss (%r15,%r12), %xmm6
movq %r14, %rdi
movss 0x1c(%rsp), %xmm7
callq 0x344e
addq $0x4, %r15
jmp 0x358e
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/jingdao[P]PointCloudApp/pcd.cpp
// Function: PCD::colormap(float)
float PCD::colormap(float f) {
	unsigned char r=0,g=0,b=0;
	if (f<=0) {
		b = 128;
	} else if (f <= 0.25) {
		g = (unsigned char) f / 0.25 * 255;
		b = (unsigned char) 128 * (1 - f / 0.25);
	} else if (f <= 0.5) {
		g = 255;
		r = (unsigned char) (f - 0.25) / 0.25 * 255;
	} else if (f <= 0.75) {
		r = 255;
		g = (unsigned char) 255 + (0.5 - f) / 0.25 * 127;
	} else if (f <= 1) {
		r = 255;
		g = (unsigned char) 128 * (1 - f) / 0.25;
	} else {
		r = 255;
	}
	int res = (r<<16)|(g<<8)|b;
	return (float) res;
}

// Assembly:
xorl %eax, %eax
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
jae 0x3849
cvtss2sd %xmm0, %xmm1
movss 0x6c5c(%rip), %xmm2     # 0xa450
ucomiss %xmm0, %xmm2
jae 0x3852
movss 0x6c53(%rip), %xmm2     # 0xa454
ucomiss %xmm0, %xmm2
jae 0x387c
movss 0x6c4a(%rip), %xmm2     # 0xa458
ucomiss %xmm0, %xmm2
jae 0x3899
movl $0xff0000, %eax         # imm = 0xFF0000
xorl %ecx, %ecx
movss 0x6c36(%rip), %xmm1     # 0xa45c
ucomiss %xmm0, %xmm1
jb 0x384e
subss %xmm0, %xmm1
mulss 0x6c29(%rip), %xmm1     # 0xa460
cvtss2sd %xmm1, %xmm0
mulsd 0x6a3d(%rip), %xmm0     # 0xa280
cvttsd2si %xmm0, %edx
jmp 0x38c8
movl $0x80, %ecx
xorl %edx, %edx
jmp 0x38c8
cvttss2si %xmm0, %edx
shlb $0x2, %dl
mulsd 0x6aa7(%rip), %xmm1     # 0xa308
addsd 0x69df(%rip), %xmm1     # 0xa248
mulsd 0x6a9f(%rip), %xmm1     # 0xa310
negb %dl
cvttsd2si %xmm1, %ecx
movzbl %cl, %ecx
jmp 0x38c8
addsd 0x6a94(%rip), %xmm1     # 0xa318
cvttsd2si %xmm1, %eax
shlb $0x2, %al
negb %al
movzbl %al, %eax
shll $0x10, %eax
xorl %ecx, %ecx
movb $-0x1, %dl
jmp 0x38c8
movsd 0x6a3f(%rip), %xmm0     # 0xa2e0
subsd %xmm1, %xmm0
mulsd 0x69d3(%rip), %xmm0     # 0xa280
mulsd 0x6a6b(%rip), %xmm0     # 0xa320
addsd 0x6a6b(%rip), %xmm0     # 0xa328
cvttsd2si %xmm0, %edx
movl $0xff0000, %eax         # imm = 0xFF0000
xorl %ecx, %ecx
orl %eax, %ecx
movzbl %dl, %eax
shll $0x8, %eax
orl %ecx, %eax
cvtsi2ss %eax, %xmm0
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/jingdao[P]PointCloudApp/pcd.cpp
// Function: PCD::writeToPCD(char const*)
void PCD::writeToPCD(const char* filename) {
	if (!filename)
		return;
	FILE* f = fopen(filename, "w");
	if (!f) {
		printf("Cannot write to file: %s\n", filename);
		return;
	}
	fprintf(f,"# .PCD v0.7 - Point Cloud Data file format\n"
	"VERSION 0.7\n"
	"FIELDS x y z rgb\n"
	"SIZE 4 4 4 4\n"
	"TYPE F F F I\n"
	"COUNT 1 1 1 1\n"
	"WIDTH %d\n"
	"HEIGHT 1\n"
	"VIEWPOINT 0 0 0 1 0 0 0\n"
	"POINTS %d\n"
	"DATA ascii\n",numPoints,numPoints);
	int k=0;
	float x,y,z,rgb;
	for (int i=0;i<numPoints;i++) {
		x=float_data[k++];
		y=float_data[k++];
		z=float_data[k++];
		rgb=float_data[k++];
//		fprintf(f,"%f %f %f %f\n",x,y,z,rgb);
		fprintf(f,"%f %f %f %d\n",x,y,z,(int)rgb);
	}
	fclose(f);
	printf("Wrote %d points to %s\n",numPoints,filename);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x3996
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x6c08(%rip), %rsi      # 0xa501
movq %rbx, %rdi
callq 0x2240
testq %rax, %rax
je 0x39a5
movq %rax, %r15
movl 0x60(%r14), %ecx
leaq 0x6c05(%rip), %rsi      # 0xa51d
xorl %ebp, %ebp
movq %rax, %rdi
movl %ecx, %edx
xorl %eax, %eax
callq 0x22b0
pushq $0xc
popq %r13
leaq 0x6c9c(%rip), %r12      # 0xa5cd
cmpl 0x60(%r14), %ebp
jge 0x396b
movq 0x58(%r14), %rax
cvtss2sd -0xc(%rax,%r13), %xmm0
cvtss2sd -0x8(%rax,%r13), %xmm1
cvtss2sd -0x4(%rax,%r13), %xmm2
cvttss2si (%rax,%r13), %edx
movq %r15, %rdi
movq %r12, %rsi
movb $0x3, %al
callq 0x22b0
incl %ebp
addq $0x10, %r13
jmp 0x3931
movq %r15, %rdi
callq 0x21f0
movl 0x60(%r14), %esi
leaq 0x6c5c(%rip), %rdi      # 0xa5da
movq %rbx, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2050
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6b57(%rip), %rdi      # 0xa503
movq %rbx, %rsi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2050
// File: /workspace/github_cpp_makefile_star2_O2/jingdao[P]PointCloudApp/pcd.cpp
// Function: PCD::writeToPLY(char const*)
void PCD::writeToPLY(const char* filename) {
	if (!filename)
		return;
	FILE* f = fopen(filename, "w");
	if (!f) {
		printf("Cannot write to file: %s\n", filename);
		return;
	}
	fprintf(f,"ply\n"
	"format ascii 1.0\n"
	"element face 0\n"
	"property list uchar int vertex_indices\n"
	"element vertex %d\n"
	"property float x\n"
	"property float y\n"
	"property float z\n"
	"property uchar diffuse_red\n"
	"property uchar diffuse_green\n"
	"property uchar diffuse_blue\n"
	"end_header\n",numPoints);
	int k=0;
	float x,y,z;
	int rgb;
	for (int i=0;i<numPoints;i++) {
		x=float_data[k++];
		y=float_data[k++];
		z=float_data[k++];
		rgb=(int)float_data[k++];
		fprintf(f,"%f %f %f %d %d %d\n",x,y,z,(rgb>>16)&0xff,(rgb>>8)&0xff,rgb&0xff);
	}
	fclose(f);
	printf("Wrote %d points to %s\n",numPoints,filename);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x3a9d
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x6b1c(%rip), %rsi      # 0xa501
movq %rbx, %rdi
callq 0x2240
testq %rax, %rax
je 0x3aac
movq %rax, %r15
movq %rbx, (%rsp)
movl 0x60(%r14), %edx
leaq 0x6be9(%rip), %rsi      # 0xa5f1
xorl %ebp, %ebp
movq %rax, %rdi
xorl %eax, %eax
callq 0x22b0
pushq $0xc
popq %r13
movl $0xff, %ebx
leaq 0x6cbd(%rip), %r12      # 0xa6e1
cmpl 0x60(%r14), %ebp
jge 0x3a71
movq 0x58(%r14), %rax
cvttss2si (%rax,%r13), %r8d
cvtss2sd -0xc(%rax,%r13), %xmm0
cvtss2sd -0x8(%rax,%r13), %xmm1
cvtss2sd -0x4(%rax,%r13), %xmm2
movl %r8d, %edx
shrl $0x10, %edx
andl %ebx, %edx
movl %r8d, %ecx
shrl $0x8, %ecx
andl %ebx, %ecx
andl %ebx, %r8d
movq %r15, %rdi
movq %r12, %rsi
movb $0x3, %al
callq 0x22b0
incl %ebp
addq $0x10, %r13
jmp 0x3a24
movq %r15, %rdi
callq 0x21f0
movl 0x60(%r14), %esi
leaq 0x6b56(%rip), %rdi      # 0xa5da
movq (%rsp), %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2050
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6a50(%rip), %rdi      # 0xa503
movq %rbx, %rsi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2050
nop
// File: /workspace/github_cpp_makefile_star2_O2/jingdao[P]PointCloudApp/pcd.cpp
// Function: PCD::writeClustersToPCD(std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>*, char const*)
void PCD::writeClustersToPCD(std::vector<std::vector<int>> *indices,const char* dir) {
	char buffer[256];
	for (size_t i=0;i<indices->size();i++) {
		snprintf(buffer,256,"%s/%lu-cloud.pcd",dir,i);
		std::vector<int> currentIndices = (*indices)[i];
		PCD* subcloud = extractIndices(&currentIndices);
		subcloud->writeToPCD(buffer);
		subcloud->writeToOBJ(dir,i);
		delete subcloud;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, 0x10(%rsp)
leaq 0x30(%rsp), %rbp
leaq 0x18(%rsp), %r15
movq $0x0, 0x8(%rsp)
xorl %r12d, %r12d
movq 0x8(%rbx), %rax
subq (%rbx), %rax
cqto
pushq $0x18
popq %rcx
idivq %rcx
cmpq %rax, %r12
jae 0x3ba0
movl $0x100, %esi            # imm = 0x100
movq %rbp, %rdi
leaq 0x6bcf(%rip), %rdx      # 0xa6f4
movq %r14, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x2350
movq %rbx, %r13
movq (%rbx), %rsi
addq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x6c94
movq 0x10(%rsp), %rdi
movq %r15, %rbx
movq %r15, %rsi
callq 0x3bc8
movq %rax, %r15
movq %rax, %rdi
movq %rbp, %rsi
callq 0x38d8
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x3c6c
movq %r15, %rdi
callq 0x339e
movq %r15, %rdi
pushq $0x78
popq %rsi
callq 0x2210
movq %rbx, %r15
movq %rbx, %rdi
callq 0x2d00
incq %r12
addq $0x18, 0x8(%rsp)
movq %r13, %rbx
jmp 0x3afe
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x2d00
movq %rbx, %rdi
callq 0x23b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/jingdao[P]PointCloudApp/pcd.cpp
// Function: PCD::extractIndices(std::vector<int, std::allocator<int>>*)
PCD* PCD::extractIndices(std::vector<int> *ind) {
	PCD* p = new PCD(ind->size());
	for (size_t i=0;i<ind->size();i++) {
		p->float_data[i * 4] = float_data[(*ind)[i] * 4];
		p->float_data[i * 4 + 1] = float_data[(*ind)[i] * 4 + 1];
		p->float_data[i * 4 + 2] = float_data[(*ind)[i] * 4 + 2];
		p->float_data[i * 4 + 3] = float_data[(*ind)[i] * 4 + 3];
	}
	return p;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
pushq $0x78
popq %rdi
callq 0x2200
movq %rax, %rbx
movq (%r14), %r12
movq 0x8(%r14), %r14
subq %r12, %r14
sarq $0x2, %r14
movq %rax, %rdi
movl %r14d, %esi
callq 0x3330
movq 0x58(%r15), %rax
xorl %ecx, %ecx
subq $0x1, %r14
jb 0x3c5d
movslq (%r12,%rcx), %rdx
leaq (,%rdx,4), %rsi
shlq $0x4, %rdx
movss (%rax,%rdx), %xmm0
movq 0x58(%rbx), %rdx
movss %xmm0, (%rdx,%rcx,4)
leal 0x1(%rsi), %edi
movslq %edi, %rdi
movss (%rax,%rdi,4), %xmm0
movss %xmm0, 0x4(%rdx,%rcx,4)
leal 0x2(%rsi), %edi
movslq %edi, %rdi
movss (%rax,%rdi,4), %xmm0
movss %xmm0, 0x8(%rdx,%rcx,4)
orl $0x3, %esi
movslq %esi, %rsi
movss (%rax,%rsi,4), %xmm0
movss %xmm0, 0xc(%rdx,%rcx,4)
addq $0x4, %rcx
jmp 0x3c00
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/jingdao[P]PointCloudApp/pcd.cpp
// Function: PCD::LoadFromMatrix(char const*)
PCD* PCD::LoadFromMatrix(const char* fileName) {
	FILE* f = fopen(fileName, "r");
	if (!f) {
		printf("File not found: %s\n", fileName);
		return NULL;
	}

	int dimensions = -1;
	std::vector<float> arr;
	char buf[256];
	while (fgets(buf,255,f)) {
		char* c = buf;
		while (*c) {
			if (*c<='9'&&*c>='0') {
				float f = (float) strtod(c,&c);
				arr.push_back(f);
			} else if (dimensions<0 && *c=='}') {
				dimensions = arr.size();
			} else if (*c=='}'&&*(c+1)=='}') {
				break;
			} else c++;
		}
		if (*c=='}'&&*(c+1)=='}')
			break;
	}

	fclose(f);
	int numPoints = arr.size()/dimensions;
	PCD* p = new PCD(numPoints);
	int i,j;
	for (i=0;i<numPoints;i++) {
		for (j=0;j<dimensions;j++) {
			p->float_data[i*4+j] = arr[i*dimensions+j];
		}
		p->float_data[i*4+3] = 255.0f;
	}

	return p;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rdi, %r14
leaq 0x65a3(%rip), %rsi      # 0xa81c
callq 0x2240
testq %rax, %rax
je 0x43cc
movq %rax, %rbx
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r14
movaps %xmm0, (%r14)
andq $0x0, 0x10(%r14)
pushq $-0x1
popq %rbp
leaq 0x30(%rsp), %r15
movq %rsp, %r12
leaq 0xc(%rsp), %r13
movq %r15, %rdi
movl $0xff, %esi
movq %rbx, %rdx
callq 0x2340
testq %rax, %rax
je 0x4327
movq %r15, (%rsp)
movq %r15, %rdi
movb (%rdi), %al
leal -0x30(%rax), %ecx
movq 0x18(%rsp), %rdx
subq 0x10(%rsp), %rdx
shrq $0x2, %rdx
movl %ebp, %esi
movl %esi, %ebp
testb %al, %al
je 0x42ab
cmpb $0x9, %cl
jbe 0x4304
testl %ebp, %ebp
jns 0x42f1
movl %edx, %esi
cmpb $0x7d, %al
je 0x42dc
cmpb $0x7d, %al
jne 0x42fb
cmpb $0x7d, 0x1(%rdi)
je 0x4327
incq %rdi
movq %rdi, (%rsp)
jmp 0x42c7
movq %r12, %rsi
callq 0x2150
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xc(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x6ce2
movq (%rsp), %rdi
jmp 0x42c7
movq %rbx, %rdi
callq 0x21f0
movq 0x10(%rsp), %r15
movq 0x18(%rsp), %r14
pushq $0x78
popq %rdi
callq 0x2200
movq %rax, %rbx
movslq %ebp, %r12
subq %r15, %r14
sarq $0x2, %r14
xorl %r13d, %r13d
movq %r14, %rax
xorl %edx, %edx
divq %r12
movq %rax, %r14
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3330
testl %r12d, %r12d
movl $0x0, %eax
cmovgl %r12d, %eax
movslq %r14d, %rcx
shlq $0x2, %r12
xorl %edx, %edx
cmpq %rcx, %rdx
jge 0x43c0
leaq (,%rdx,4), %rsi
xorl %edi, %edi
cmpq %rdi, %rax
je 0x43a8
movss (%r15,%rdi,4), %xmm0
movq 0x58(%rbx), %r8
addq %r13, %r8
movss %xmm0, (%r8,%rdi,4)
incq %rdi
jmp 0x438b
movq 0x58(%rbx), %rdi
movl $0x437f0000, 0xc(%rdi,%rsi,4) # imm = 0x437F0000
incq %rdx
addq %r12, %r15
addq $0x10, %r13
jmp 0x437c
leaq 0x10(%rsp), %rdi
callq 0x6db0
jmp 0x43df
leaq 0x60a5(%rip), %rdi      # 0xa478
xorl %ebx, %ebx
movq %r14, %rsi
xorl %eax, %eax
callq 0x2050
movq %rbx, %rax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x43f6
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x6db0
movq %rbx, %rdi
callq 0x23b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/jingdao[P]PointCloudApp/pcd.cpp
// Function: PCD::translate(float, float, float)
void PCD::translate(float x, float y, float z) {
	for (int i=0;i<numPoints;i++) {
		float_data[i * 4] += x;
		float_data[i * 4 + 1] += y;
		float_data[i * 4 + 2] += z;
	}
}

// Assembly:
movl 0x60(%rdi), %eax
movq 0x58(%rdi), %rcx
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
shlq $0x4, %rax
cmpq %rdx, %rax
je 0x4c8c
movsd (%rcx,%rdx), %xmm1
addps %xmm0, %xmm1
movlps %xmm1, (%rcx,%rdx)
movss 0x8(%rcx,%rdx), %xmm1
addss %xmm2, %xmm1
movss %xmm1, 0x8(%rcx,%rdx)
addq $0x10, %rdx
jmp 0x4c65
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/jingdao[P]PointCloudApp/pcd.cpp
// Function: PCD::LoadFromPTS(char const*)
PCD* PCD::LoadFromPTS(const char* fileName) {
	FILE* f = fopen(fileName, "r");
	if (!f) {
		printf("File not found: %s\n", fileName);
		return NULL;
	}
	char buf[256];
	int pointsParsed = 0;
	PCD* pcd = new PCD(0);
	int r,g,b,d,rgb;
	while (fgets(buf, 256, f)) {
		int n = atoi(buf);
//		printf("n = %d\n",n);
		if (!pcd->expand(n + pointsParsed))
			break;
		for (int i=0;i<n;i++) {
			fgets(buf,256,f);
			if (sscanf(buf, "%f %f %f %d %d %d %d", pcd->float_data + pointsParsed * 4, pcd->float_data + pointsParsed * 4 + 1,
				pcd->float_data + pointsParsed * 4 + 2, &d, &r, &g, &b) == 7) {
				rgb = (r<<16) | (g<<8) | b;
				pcd->float_data[pointsParsed * 4 + 3] = (float) rgb;
				pointsParsed++;
			} else {
				printf("Error parsing %s\n",fileName);
				printf("Line %d: %s\n",pointsParsed,buf);
				break;
			}
		}
	}
	fclose(f);
	return pcd;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rdi, %rbx
leaq 0x5791(%rip), %rsi      # 0xa81c
callq 0x2240
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x5213
movq %rbx, 0x20(%rsp)
pushq $0x78
popq %rdi
callq 0x2200
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
callq 0x3330
leaq 0x40(%rsp), %r12
xorl %r14d, %r14d
movq %r12, %rdi
movl $0x100, %esi            # imm = 0x100
movq 0x8(%rsp), %rdx
callq 0x2340
testq %rax, %rax
je 0x5207
movq %r12, %rdi
callq 0x2330
movl %eax, %ebx
leal (%rbx,%r14), %esi
movq %r15, %rdi
callq 0x33dc
testb %al, %al
je 0x5207
testl %ebx, %ebx
movl $0x0, %eax
cmovlel %eax, %ebx
movslq %r14d, %r13
movq %r14, 0x28(%rsp)
addl %r14d, %ebx
movq %rbx, 0x30(%rsp)
movslq %ebx, %rax
movq %r13, %rbp
subq %rax, %rbp
shlq $0x4, %r13
orq $0x8, %r13
xorl %r14d, %r14d
cmpq %r14, %rbp
je 0x51c3
movq %r12, %rdi
movl $0x100, %esi            # imm = 0x100
movq 0x8(%rsp), %rdx
callq 0x2340
movq %r15, %rbx
movq 0x58(%r15), %r15
leaq (%r15,%r13), %r8
leaq (%r15,%r13), %rdx
addq $-0x8, %rdx
leaq (%r15,%r13), %rcx
addq $-0x4, %rcx
subq $0x8, %rsp
movq %r12, %rdi
leaq 0x5747(%rip), %rsi      # 0xa8b2
leaq 0x44(%rsp), %r9
xorl %eax, %eax
leaq 0x1c(%rsp), %r10
pushq %r10
leaq 0x28(%rsp), %r10
pushq %r10
leaq 0x34(%rsp), %r10
pushq %r10
callq 0x21e0
addq $0x20, %rsp
cmpl $0x7, %eax
jne 0x51cd
movl 0x1c(%rsp), %eax
shll $0x10, %eax
movl 0x18(%rsp), %ecx
shll $0x8, %ecx
orl %eax, %ecx
orl 0x14(%rsp), %ecx
cvtsi2ss %ecx, %xmm0
movss %xmm0, 0x4(%r15,%r13)
decq %r14
addq $0x10, %r13
movq %rbx, %r15
jmp 0x5127
movq 0x30(%rsp), %r14
jmp 0x50c0
movq 0x28(%rsp), %rax
subl %r14d, %eax
movq %rax, %r14
leaq 0x5651(%rip), %rdi      # 0xa830
movq 0x20(%rsp), %rsi
xorl %eax, %eax
callq 0x2050
leaq 0x5650(%rip), %rdi      # 0xa842
movl %r14d, %esi
movq %r12, %rdx
xorl %eax, %eax
callq 0x2050
movq %rbx, %r15
jmp 0x50c0
movq 0x8(%rsp), %rdi
callq 0x21f0
jmp 0x5227
leaq 0x525e(%rip), %rdi      # 0xa478
xorl %r15d, %r15d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2050
movq %r15, %rax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jingdao[P]PointCloudApp/pcd.cpp
// Function: PCD::rotate(PCD::Quaternion)
void PCD::rotate(Quaternion q) {
	for (int i=0;i<numPoints;i++) {
		Quaternion vec = {0, float_data[i*4], float_data[i*4+1], float_data[i*4+2]};
		vec = quaternionMult(quaternionMult(q, vec), quaternionInv(q));
		float_data[i * 4] = vec.i;
		float_data[i * 4 + 1] = vec.j;
		float_data[i * 4 + 2] = vec.k;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movslq 0x60(%rdi), %rbx
movq 0x58(%rdi), %r14
movaps 0x49a4(%rip), %xmm2     # 0xa3c0
movaps %xmm0, %xmm3
xorps %xmm2, %xmm3
shufps $0x1, %xmm0, %xmm3      # xmm3 = xmm3[1,0],xmm0[0,0]
movaps %xmm0, 0x20(%rsp)
shufps $0xe2, %xmm0, %xmm3     # xmm3 = xmm3[2,0],xmm0[2,3]
movaps %xmm3, 0x10(%rsp)
movaps %xmm1, 0x30(%rsp)
xorps %xmm2, %xmm1
movaps %xmm1, (%rsp)
addq $0x4, %r14
xorl %r15d, %r15d
cmpq %rbx, %r15
jge 0x5a97
movsd (%r14), %xmm3
movd -0x4(%r14), %xmm0
movq %xmm0, %xmm2            # xmm2 = xmm0[0],zero
shufps $0xe2, 0x49bd(%rip), %xmm2 # xmm2 = xmm2[2,0],mem[2,3]
movaps 0x20(%rsp), %xmm0
movaps 0x30(%rsp), %xmm1
callq 0x595e
movaps 0x10(%rsp), %xmm2
movaps (%rsp), %xmm3
callq 0x595e
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movss %xmm0, -0x4(%r14)
movlps %xmm1, (%r14)
incq %r15
addq $0x10, %r14
jmp 0x5a47
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/jingdao[P]PointCloudApp/pcd.cpp
// Function: PCD::getCentroid(std::vector<int, std::allocator<int>>*)
PCD::Quaternion PCD::getCentroid(std::vector<int> *indices) {
	float sumX=0, sumY=0, sumZ=0;
	if (indices) {
		for (size_t i=0;i<indices->size();i++) {
			sumX += float_data[(*indices)[i] * 4];
			sumY += float_data[(*indices)[i] * 4 + 1];
			sumZ += float_data[(*indices)[i] * 4 + 2];
		}
	} else {
		for (int i=0;i<numPoints;i++) {
			sumX += float_data[i * 4];
			sumY += float_data[i * 4 + 1];
			sumZ += float_data[i * 4 + 2];
		}
	}
	Quaternion q = {0, sumX / numPoints, sumY / numPoints, sumZ / numPoints};
	return q;
}

// Assembly:
testq %rsi, %rsi
je 0x5b0e
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
movq 0x58(%rdi), %rdx
xorps %xmm1, %xmm1
xorps %xmm0, %xmm0
xorl %esi, %esi
cmpq %rsi, %rcx
je 0x5af0
movslq (%rax,%rsi,4), %r8
leaq (,%r8,4), %r9
shlq $0x4, %r8
addss (%rdx,%r8), %xmm0
incl %r9d
movslq %r9d, %r8
movsd (%rdx,%r8,4), %xmm2
addps %xmm2, %xmm1
incq %rsi
jmp 0x5ac1
movl 0x60(%rdi), %eax
cvtsi2ss %eax, %xmm2
divss %xmm2, %xmm0
shufps $0x0, %xmm2, %xmm2      # xmm2 = xmm2[0,0,0,0]
divps %xmm2, %xmm1
movq %xmm0, %xmm0            # xmm0 = xmm0[0],zero
xorps %xmm2, %xmm2
shufps $0xe2, %xmm2, %xmm0     # xmm0 = xmm0[2,0],xmm2[2,3]
retq
movl 0x60(%rdi), %eax
xorl %ecx, %ecx
testl %eax, %eax
movl $0x0, %edx
cmovgl %eax, %edx
movq 0x58(%rdi), %rsi
shlq $0x4, %rdx
xorps %xmm1, %xmm1
xorps %xmm0, %xmm0
cmpq %rcx, %rdx
je 0x5af3
addss (%rsi,%rcx), %xmm0
movsd 0x4(%rsi,%rcx), %xmm2
addps %xmm2, %xmm1
addq $0x10, %rcx
jmp 0x5b2b
// File: /workspace/github_cpp_makefile_star2_O2/jingdao[P]PointCloudApp/pcd.cpp
// Function: PCD::filterPlane(std::vector<int, std::allocator<int>>*, PCD::Plane, float, bool)
void PCD::filterPlane(std::vector<int> *ind,Plane p, float threshold,bool positiveOrNegative) {
	float distanceThreshold = threshold * sqrt( p.a * p.a + p.b * p.b + p.c * p.c);
	if (positiveOrNegative) {
		for (int j=0;j<numPoints;j++) {
			if ( fabs( p.a * float_data[j * 4] +
				 p.b * float_data[j * 4 + 1] +
				 p.c * float_data[j * 4 + 2] +
				 p.d )
				 < distanceThreshold)	
				ind->push_back(j);
		}
	} else {
		for (int j=0;j<numPoints;j++) {
			if ( fabs( p.a * float_data[j * 4] +
				 p.b * float_data[j * 4 + 1] +
				 p.c * float_data[j * 4 + 2] +
				 p.d )
				 > distanceThreshold)	
				ind->push_back(j);
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movaps %xmm0, %xmm5
shufps $0x55, %xmm0, %xmm5     # xmm5 = xmm5[1,1],xmm0[1,1]
movaps %xmm5, %xmm4
mulss %xmm5, %xmm4
movaps %xmm0, %xmm3
mulss %xmm0, %xmm3
addss %xmm4, %xmm3
movaps %xmm1, %xmm4
mulss %xmm1, %xmm4
addss %xmm3, %xmm4
sqrtss %xmm4, %xmm4
mulss %xmm2, %xmm4
movaps %xmm1, %xmm6
shufps $0x55, %xmm1, %xmm6     # xmm6 = xmm6[1,1],xmm1[1,1]
testl %edx, %edx
movaps %xmm1, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm5, 0x20(%rsp)
movss %xmm4, 0x4(%rsp)
movaps %xmm6, 0x10(%rsp)
je 0x627e
xorl %eax, %eax
movaps 0x425d(%rip), %xmm7     # 0xa440
leaq 0xc(%rsp), %r15
movl %eax, 0xc(%rsp)
cmpl 0x60(%r14), %eax
jge 0x6322
movq 0x58(%r14), %rcx
leal (,%rax,4), %edx
movslq %edx, %rdx
leal 0x1(,%rax,4), %esi
movslq %esi, %rsi
movss (%rcx,%rsi,4), %xmm3
mulss %xmm5, %xmm3
movss (%rcx,%rdx,4), %xmm2
mulss %xmm0, %xmm2
addss %xmm3, %xmm2
leal 0x2(,%rax,4), %edx
movslq %edx, %rdx
movss (%rcx,%rdx,4), %xmm3
mulss %xmm1, %xmm3
addss %xmm2, %xmm3
addss %xmm6, %xmm3
andps %xmm7, %xmm3
ucomiss %xmm3, %xmm4
jbe 0x6277
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6d04
movaps 0x41e7(%rip), %xmm7     # 0xa440
movaps 0x10(%rsp), %xmm6
movss 0x4(%rsp), %xmm4
movaps 0x20(%rsp), %xmm5
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movl 0xc(%rsp), %eax
incl %eax
jmp 0x61e8
xorl %eax, %eax
movaps 0x41b9(%rip), %xmm7     # 0xa440
leaq 0x8(%rsp), %r15
movl %eax, 0x8(%rsp)
cmpl 0x60(%r14), %eax
jge 0x6322
movq 0x58(%r14), %rcx
leal (,%rax,4), %edx
movslq %edx, %rdx
leal 0x1(,%rax,4), %esi
movslq %esi, %rsi
movss (%rcx,%rsi,4), %xmm3
mulss %xmm5, %xmm3
movss (%rcx,%rdx,4), %xmm2
mulss %xmm0, %xmm2
addss %xmm3, %xmm2
leal 0x2(,%rax,4), %edx
movslq %edx, %rdx
movss (%rcx,%rdx,4), %xmm3
mulss %xmm1, %xmm3
addss %xmm2, %xmm3
addss %xmm6, %xmm3
andps %xmm7, %xmm3
ucomiss %xmm4, %xmm3
jbe 0x631b
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6d04
movaps 0x4143(%rip), %xmm7     # 0xa440
movaps 0x10(%rsp), %xmm6
movss 0x4(%rsp), %xmm4
movaps 0x20(%rsp), %xmm5
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movl 0x8(%rsp), %eax
incl %eax
jmp 0x628c
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/jingdao[P]PointCloudApp/pcd.cpp
// Function: closestBSearch(void*, void*, int, int, int (*)(void const*, void const*), bool)
void* closestBSearch(void* key,void* base,int num,int size,int (*compar)(const void*,const void*),bool lowerOrUpper) {
	char* A = (char*) base;
	int l = 0, h = num-1, mid=(l+h)/2, diff;
	if (lowerOrUpper) { //lower
		while (l < h) {
			diff = compar(key,A + mid * size);
			if (diff > 0)
				l = mid + 1;
			else if (diff <= 0)
				h = mid;
			mid = (l + h) / 2;
		}
	} else { //upper
		while (l < h - 1) {
			diff = compar(key,A + mid * size);
			if (diff >= 0)
				l = mid;
			else if (diff < 0)
				h = mid - 1;
			mid = (l + h) / 2;
		}
		if (l == h - 1) //edge case
			if (compar(key, A + h * size) >= 0)
				mid++;
	}
	return A + mid * size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r14
movl %ecx, 0x4(%rsp)
movl %edx, %r13d
movq %rsi, %rbx
movq %rdi, %r15
decl %r13d
pushq $0x2
popq %rcx
movl %r13d, %eax
cltd
idivl %ecx
movl %eax, %r12d
xorl %ebp, %ebp
testl %r9d, %r9d
jne 0x665a
leal -0x1(%r13), %eax
cmpl %eax, %ebp
jge 0x6661
movl %r12d, %eax
imull 0x4(%rsp), %eax
movslq %eax, %rsi
addq %rbx, %rsi
movq %r15, %rdi
callq *%r14
leal -0x1(%r12), %ecx
testl %eax, %eax
cmovnsl %r12d, %ebp
cmovnsl %r13d, %ecx
leal (%rcx,%rbp), %eax
cltd
pushq $0x2
popq %rsi
idivl %esi
movl %ecx, %r13d
movl %eax, %r12d
jmp 0x65ee
movl %r12d, %eax
imull 0x4(%rsp), %eax
movslq %eax, %rsi
addq %rbx, %rsi
movq %r15, %rdi
callq *%r14
leal 0x1(%r12), %ecx
testl %eax, %eax
cmovgl %ecx, %ebp
cmovlel %r12d, %r13d
leal (%rbp,%r13), %eax
cltd
pushq $0x2
popq %rcx
idivl %ecx
movl %eax, %r12d
cmpl %r13d, %ebp
jl 0x662a
jmp 0x667d
jne 0x667d
imull 0x4(%rsp), %r13d
movslq %r13d, %rsi
addq %rbx, %rsi
movq %r15, %rdi
callq *%r14
notl %eax
shrl $0x1f, %eax
addl %eax, %r12d
imull 0x4(%rsp), %r12d
movslq %r12d, %rax
addq %rax, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop