// File: /workspace/github_cpp_makefile_star2_O2/Luthaf[P]zeopp/networkio.cc
// Function: writeToXYZ(char*, VORONOI_NETWORK*, double)
bool writeToXYZ(char *filename, VORONOI_NETWORK *vornet, double minRad){
    fstream output;
    output.open(filename, fstream::out);
    if(!output.is_open()){
        cerr << "Error: Failed to open .net2 output file " << filename << "\n";
        return false;
    }
    else{
        cout << "Writing Voronoi network information to " << filename << "\n";

        // Write Voronoi node information
        //Compute the # of nodes to be written
        int i = 0;
        for (vector<VOR_NODE>::const_iterator iter = vornet->nodes.begin();
                iter != vornet->nodes.end(); iter++)
            if (iter->rad_stat_sphere > minRad){
                i++;
            }
        output << i << "\n\n";
        for (vector<VOR_NODE>::const_iterator iter = vornet->nodes.begin();
                iter != vornet->nodes.end(); iter++)
            if (iter->rad_stat_sphere > minRad)
                output << "X  " << iter->x << " " << iter->y << " "
                       << iter->z << " " << iter->rad_stat_sphere << "\n";
    }
    output.close();
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movsd %xmm0, 0x10(%rsp)
movq %rsi, %r14
movq %rdi, %r15
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x4540
pushq $0x10
popq %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4410
leaq 0x98(%rsp), %rdi
callq 0x4130
movl %eax, %ebx
testb %al, %al
je 0x23016
movq 0x12cff7(%rip), %rdi    # 0x14ffc0
leaq 0xda6d2(%rip), %rsi     # 0xfd6a2
callq 0x4480
movq %rax, %rdi
movq %r15, %rsi
callq 0x4480
leaq 0xdf597(%rip), %rsi     # 0x10257e
movq %rax, %rdi
callq 0x4480
movq 0x48(%r14), %rax
movq 0x50(%r14), %rcx
xorl %esi, %esi
cmpq %rcx, %rax
je 0x23048
movsd 0x18(%rax), %xmm0
xorl %edx, %edx
ucomisd 0x10(%rsp), %xmm0
seta %dl
addl %edx, %esi
addq $0x40, %rax
jmp 0x22ff9
movq 0x12cfd3(%rip), %rdi    # 0x14fff0
leaq 0xda655(%rip), %rsi     # 0xfd679
callq 0x4480
movq %rax, %rdi
movq %r15, %rsi
callq 0x4480
leaq 0xdf543(%rip), %rsi     # 0x10257e
movq %rax, %rdi
callq 0x4480
jmp 0x23119
movb %bl, 0xf(%rsp)
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0x4760
leaq 0xe0f3b(%rip), %rsi     # 0x103f9b
movq %rax, %rdi
callq 0x4480
movq 0x48(%r14), %rbx
leaq 0xda676(%rip), %r12     # 0xfd6e9
leaq 0xe1498(%rip), %r13     # 0x104512
leaq 0xdf4fd(%rip), %rbp     # 0x10257e
cmpq 0x50(%r14), %rbx
je 0x2310b
movsd 0x18(%rbx), %xmm0
ucomisd 0x10(%rsp), %xmm0
jbe 0x23102
movq %r15, %rdi
movq %r12, %rsi
callq 0x4480
movsd (%rbx), %xmm0
movq %rax, %rdi
callq 0x46c0
movq %rax, %rdi
movq %r13, %rsi
callq 0x4480
movsd 0x8(%rbx), %xmm0
movq %rax, %rdi
callq 0x46c0
movq %rax, %rdi
movq %r13, %rsi
callq 0x4480
movsd 0x10(%rbx), %xmm0
movq %rax, %rdi
callq 0x46c0
movq %rax, %rdi
movq %r13, %rsi
callq 0x4480
movsd 0x18(%rbx), %xmm0
movq %rax, %rdi
callq 0x46c0
movq %rax, %rdi
movq %rbp, %rsi
callq 0x4480
addq $0x40, %rbx
jmp 0x23081
leaq 0x18(%rsp), %rdi
callq 0x4080
movb 0xf(%rsp), %bl
leaq 0x18(%rsp), %rdi
callq 0x4120
movl %ebx, %eax
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2313b
jmp 0x2313b
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x4120
movq %rbx, %rdi
callq 0x4780