// File: tonymugen[P]sampleSNPs/varfiles.cpp
// Function: sampFiles::GbinFileI::_numLines()
uint64_t GbinFileI::_numLines(){

    if (_varFile.is_open()) {
        _varFile.close();
    }
    try {
        _varFile.open(_fileName.c_str(), ios::in | ios::binary | ios::ate);
		if (!_varFile.is_open()) {
			cerr << "ERROR: failed to open file " << _fileName << " for input" << endl;
			exit(2);
		}

    } catch (system_error &error) {
        cerr << "ERROR: cannot open binary file " << _fileName << " for input: " << error.code().message() << flush;
        perror(" ");
        exit(1);

    }
    size_t Ntot = _varFile.tellg();
    _varFile.close();
    if (Ntot % (_elemSize*_nCols)) {
        throw string("Number of elements not divisible by row size");
    }
    return Ntot/(_elemSize*_nCols);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x68(%rbp)
addq $0x8, %rdi
callq 0x45e0
testb $0x1, %al
jne 0x9e06
jmp 0x9e13
movq -0x68(%rbp), %rdi
addq $0x8, %rdi
callq 0x4060
movq -0x68(%rbp), %rdi
movq %rdi, %rax
addq $0x8, %rax
movq %rax, -0x80(%rbp)
addq $0x218, %rdi            # imm = 0x218
callq 0x4140
movq %rax, -0x78(%rbp)
movl $0x8, %edi
movl $0x4, %esi
callq 0x1ee70
movl %eax, -0x6c(%rbp)
jmp 0x9e46
movl -0x6c(%rbp), %edi
movl $0x2, %esi
callq 0x1ee70
movl %eax, -0x84(%rbp)
jmp 0x9e5b
movl -0x84(%rbp), %edx
movq -0x78(%rbp), %rsi
movq -0x80(%rbp), %rdi
callq 0x42f0
jmp 0x9e70
movq -0x68(%rbp), %rdi
addq $0x8, %rdi
callq 0x45e0
movb %al, -0x85(%rbp)
jmp 0x9e85
movb -0x85(%rbp), %al
testb $0x1, %al
jne 0x9ff3
jmp 0x9e95
movq 0x22154(%rip), %rdi     # 0x2bff0
leaq 0x19695(%rip), %rsi     # 0x23538
callq 0x4310
movq %rax, -0x90(%rbp)
jmp 0x9eb1
movq -0x90(%rbp), %rdi
movq -0x68(%rbp), %rsi
addq $0x218, %rsi            # imm = 0x218
callq 0x42e0
movq %rax, -0x98(%rbp)
jmp 0x9ed1
movq -0x98(%rbp), %rdi
leaq 0x19675(%rip), %rsi     # 0x23554
callq 0x4310
movq %rax, -0xa0(%rbp)
jmp 0x9eed
movq -0xa0(%rbp), %rdi
movq 0x220b5(%rip), %rsi     # 0x2bfb0
callq 0x4350
jmp 0x9f02
movl $0x2, %edi
callq 0x4400
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0xa131
movq -0x10(%rbp), %rdi
callq 0x4130
movq %rax, -0x20(%rbp)
movq 0x220b4(%rip), %rdi     # 0x2bff0
leaq 0x1961c(%rip), %rsi     # 0x2355f
callq 0x4310
movq %rax, -0xa8(%rbp)
jmp 0x9f51
movq -0xa8(%rbp), %rdi
movq -0x68(%rbp), %rsi
addq $0x218, %rsi            # imm = 0x218
callq 0x42e0
movq %rax, -0xb0(%rbp)
jmp 0x9f71
movq -0xb0(%rbp), %rdi
leaq 0x19a66(%rip), %rsi     # 0x239e5
callq 0x4310
movq %rax, -0xb8(%rbp)
jmp 0x9f8d
movq -0x20(%rbp), %rdi
callq 0x1ee90
movq %rax, %rsi
leaq -0x40(%rbp), %rdi
callq 0x1eeb0
jmp 0x9fa4
movq -0xb8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x42e0
movq %rax, -0xc0(%rbp)
jmp 0x9fbd
movq -0xc0(%rbp), %rdi
movq 0x21ffd(%rip), %rsi     # 0x2bfc8
callq 0x4350
jmp 0x9fd2
leaq -0x40(%rbp), %rdi
callq 0x46d8
leaq 0x19818(%rip), %rdi     # 0x237fa
callq 0x42a0
jmp 0x9fe9
movl $0x1, %edi
callq 0x4400
jmp 0xa024
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
jmp 0xa018
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x46d8
callq 0x4580
jmp 0xa01f
jmp 0xa131
movq -0x68(%rbp), %rdi
addq $0x8, %rdi
callq 0x45f0
movq %rax, -0x58(%rbp)
movq %rdx, -0x50(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x1ef00
movq -0x68(%rbp), %rdi
movq %rax, -0x48(%rbp)
addq $0x8, %rdi
callq 0x4060
movq -0x68(%rbp), %rdx
movq -0x48(%rbp), %rax
movq 0x240(%rdx), %rcx
imulq 0x238(%rdx), %rcx
xorl %edx, %edx
divq %rcx
cmpq $0x0, %rdx
je 0xa10c
movb $0x1, -0x5a(%rbp)
movl $0x20, %edi
callq 0x4180
movq %rax, -0xd0(%rbp)
movq %rax, -0xd8(%rbp)
leaq -0x59(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x4620
movq -0xd0(%rbp), %rdi
movq -0xc8(%rbp), %rdx
leaq 0x194c5(%rip), %rsi     # 0x2357f
callq 0x7470
jmp 0xa0c1
movq -0xd8(%rbp), %rdi
movb $0x0, -0x5a(%rbp)
leaq 0x217bd(%rip), %rsi     # 0x2b890
movq 0x21ede(%rip), %rdx     # 0x2bfb8
callq 0x45c0
jmp 0xa142
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
leaq -0x59(%rbp), %rdi
callq 0x4380
testb $0x1, -0x5a(%rbp)
jne 0xa0fe
jmp 0xa10a
movq -0xd8(%rbp), %rdi
callq 0x4250
jmp 0xa131
movq -0x68(%rbp), %rdx
movq -0x48(%rbp), %rax
movq 0x240(%rdx), %rcx
imulq 0x238(%rdx), %rcx
xorl %edx, %edx
divq %rcx
addq $0xe0, %rsp
popq %rbp
retq
movq -0x10(%rbp), %rdi
callq 0x4610
movq %rax, %rdi
callq 0x82c0
nopw %cs:(%rax,%rax)