// File: tonymugen[P]sampleSNPs/varfiles.cpp
// Function: sampFiles::TpedFileI::open()
void TpedFileI::open(){
	string tfamName = _fileStub + ".tfam";

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

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

	}

	try {
		_tfamFile.open(tfamName.c_str(), ios::in);
		if (!_tfamFile.is_open()) {
			cerr << "ERROR: failed to open .tfam file " << tfamName << " for input" << endl;
			exit(2);
		}

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

	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x98(%rbp)
addq $0x450, %rsi            # imm = 0x450
leaq 0x9abf(%rip), %rdx      # 0x23c27
leaq -0x28(%rbp), %rdi
callq 0x7920
movq -0x98(%rbp), %rdi
movq %rdi, %rax
addq $0x8, %rax
movq %rax, -0x90(%rbp)
addq $0x218, %rdi            # imm = 0x218
callq 0x4140
movq -0x90(%rbp), %rdi
movq %rax, %rsi
movl $0x8, %edx
callq 0x42f0
jmp 0x1a1a8
movq -0x98(%rbp), %rdi
addq $0x8, %rdi
callq 0x45e0
movb %al, -0x99(%rbp)
jmp 0x1a1c0
movb -0x99(%rbp), %al
testb $0x1, %al
jne 0x1a334
jmp 0x1a1d0
movq 0x11e19(%rip), %rdi     # 0x2bff0
leaq 0x9b43(%rip), %rsi      # 0x23d21
callq 0x4310
movq %rax, -0xa8(%rbp)
jmp 0x1a1ec
movq -0xa8(%rbp), %rdi
movq -0x98(%rbp), %rsi
addq $0x218, %rsi            # imm = 0x218
callq 0x42e0
movq %rax, -0xb0(%rbp)
jmp 0x1a20f
movq -0xb0(%rbp), %rdi
leaq 0x9337(%rip), %rsi      # 0x23554
callq 0x4310
movq %rax, -0xb8(%rbp)
jmp 0x1a22b
movq -0xb8(%rbp), %rdi
movq 0x11d77(%rip), %rsi     # 0x2bfb0
callq 0x4350
jmp 0x1a240
movl $0x2, %edi
callq 0x4400
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x1a55f
movq -0x30(%rbp), %rdi
callq 0x4130
movq %rax, -0x40(%rbp)
movq 0x11d76(%rip), %rdi     # 0x2bff0
leaq 0x9ae1(%rip), %rsi      # 0x23d62
callq 0x4310
movq %rax, -0xc0(%rbp)
jmp 0x1a28f
movq -0xc0(%rbp), %rdi
movq -0x98(%rbp), %rsi
addq $0x218, %rsi            # imm = 0x218
callq 0x42e0
movq %rax, -0xc8(%rbp)
jmp 0x1a2b2
movq -0xc8(%rbp), %rdi
leaq 0x9725(%rip), %rsi      # 0x239e5
callq 0x4310
movq %rax, -0xd0(%rbp)
jmp 0x1a2ce
movq -0x40(%rbp), %rdi
callq 0x1ee90
movq %rax, %rsi
leaq -0x60(%rbp), %rdi
callq 0x1eeb0
jmp 0x1a2e5
movq -0xd0(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x42e0
movq %rax, -0xd8(%rbp)
jmp 0x1a2fe
movq -0xd8(%rbp), %rdi
movq 0x11cbc(%rip), %rsi     # 0x2bfc8
callq 0x4350
jmp 0x1a313
leaq -0x60(%rbp), %rdi
callq 0x46d8
leaq 0x94d7(%rip), %rdi      # 0x237fa
callq 0x42a0
jmp 0x1a32a
movl $0x1, %edi
callq 0x4400
jmp 0x1a365
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x1a359
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x46d8
callq 0x4580
jmp 0x1a360
jmp 0x1a55f
movq -0x98(%rbp), %rax
addq $0x240, %rax            # imm = 0x240
movq %rax, -0xe0(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x4140
movq -0xe0(%rbp), %rdi
movq %rax, %rsi
movl $0x8, %edx
callq 0x42f0
jmp 0x1a398
movq -0x98(%rbp), %rdi
addq $0x240, %rdi            # imm = 0x240
callq 0x45e0
movb %al, -0xe1(%rbp)
jmp 0x1a3b3
movb -0xe1(%rbp), %al
testb $0x1, %al
jne 0x1a51c
jmp 0x1a3c3
movq 0x11c26(%rip), %rdi     # 0x2bff0
leaq 0x985c(%rip), %rsi      # 0x23c2d
callq 0x4310
movq %rax, -0xf0(%rbp)
jmp 0x1a3df
movq -0xf0(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x42e0
movq %rax, -0xf8(%rbp)
jmp 0x1a3f8
movq -0xf8(%rbp), %rdi
leaq 0x914e(%rip), %rsi      # 0x23554
callq 0x4310
movq %rax, -0x100(%rbp)
jmp 0x1a414
movq -0x100(%rbp), %rdi
movq 0x11b8e(%rip), %rsi     # 0x2bfb0
callq 0x4350
jmp 0x1a429
movl $0x2, %edi
callq 0x4400
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x1a55f
movq -0x30(%rbp), %rdi
callq 0x4130
movq %rax, -0x68(%rbp)
movq 0x11b8d(%rip), %rdi     # 0x2bff0
leaq 0x97e5(%rip), %rsi      # 0x23c4f
callq 0x4310
movq %rax, -0x108(%rbp)
jmp 0x1a478
movq -0x108(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x42e0
movq %rax, -0x110(%rbp)
jmp 0x1a491
movq -0x110(%rbp), %rdi
leaq 0x9546(%rip), %rsi      # 0x239e5
callq 0x4310
movq %rax, -0x118(%rbp)
jmp 0x1a4ad
movq -0x68(%rbp), %rdi
callq 0x1ee90
movq %rax, %rsi
leaq -0x88(%rbp), %rdi
callq 0x1eeb0
jmp 0x1a4c7
movq -0x118(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x42e0
movq %rax, -0x120(%rbp)
jmp 0x1a4e3
movq -0x120(%rbp), %rdi
movq 0x11ad7(%rip), %rsi     # 0x2bfc8
callq 0x4350
jmp 0x1a4f8
leaq -0x88(%rbp), %rdi
callq 0x46d8
leaq 0x92ef(%rip), %rdi      # 0x237fa
callq 0x42a0
jmp 0x1a512
movl $0x1, %edi
callq 0x4400
jmp 0x1a54d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x1a544
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x46d8
callq 0x4580
jmp 0x1a54b
jmp 0x1a55f
leaq -0x28(%rbp), %rdi
callq 0x46d8
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x46d8
movq -0x30(%rbp), %rdi
callq 0x4610
movq %rax, %rdi
callq 0x82c0
nopl (%rax)