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

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

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

	}

	try {
		_tfamFile.open(tfamName.c_str(), ios::out);
		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 output: " << error.code().message() << flush;
		perror(" ");
		exit(1);

	}

}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %r14
leaq 0x450(%rdi), %rsi
leaq 0x47d9(%rip), %rdx      # 0x14c3f
leaq 0x28(%rsp), %rdi
callq 0x5e08
leaq 0x8(%r14), %rdi
leaq 0x218(%r14), %rbx
movq 0x218(%r14), %rsi
pushq $0x10
popq %rdx
callq 0x4280
leaq 0x88(%r14), %rdi
callq 0x40b0
testb %al, %al
je 0x104d3
leaq 0x240(%r14), %rdi
movq 0x28(%rsp), %rsi
pushq $0x10
popq %rdx
callq 0x4280
addq $0x2c0, %r14            # imm = 0x2C0
movq %r14, %rdi
callq 0x40b0
testb %al, %al
je 0x1050a
leaq 0x28(%rsp), %rdi
callq 0x4558
addq $0x48, %rsp
popq %rbx
popq %r14
retq
movq 0xbb16(%rip), %rdi      # 0x1bff0
leaq 0x4858(%rip), %rsi      # 0x14d39
callq 0x42a0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4270
leaq 0x41ea(%rip), %rsi      # 0x146e2
movq %rax, %rdi
callq 0x42a0
movq %rax, %rdi
callq 0x4140
jmp 0x10541
movq 0xbadf(%rip), %rdi      # 0x1bff0
leaq 0x472d(%rip), %rsi      # 0x14c45
callq 0x42a0
leaq 0x28(%rsp), %rsi
movq %rax, %rdi
callq 0x4270
leaq 0x403b(%rip), %rsi      # 0x1456c
movq %rax, %rdi
callq 0x42a0
movq %rax, %rdi
callq 0x4140
pushq $0x2
popq %rdi
callq 0x4310
movq %rax, %r14
cmpl $0x1, %edx
jne 0x10681
movq %r14, %rdi
callq 0x4110
movq %rax, %rbx
movq 0xba89(%rip), %rdi      # 0x1bff0
leaq 0x46f9(%rip), %rsi      # 0x14c67
callq 0x42a0
leaq 0x28(%rsp), %rsi
movq %rax, %rdi
callq 0x4270
leaq 0x4167(%rip), %rsi      # 0x146ee
movq %rax, %rdi
callq 0x42a0
movq %rax, %r14
movq 0x18(%rbx), %rsi
movl 0x10(%rbx), %edx
movq (%rsi), %rax
leaq 0x8(%rsp), %rdi
callq *0x20(%rax)
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x4270
movq %rax, %rdi
callq 0x41c0
jmp 0x1064b
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x4558
jmp 0x105d2
jmp 0x105cf
movq %rax, %r14
callq 0x4470
jmp 0x10681
movq %rax, %r14
cmpl $0x1, %edx
jne 0x10681
movq %r14, %rdi
callq 0x4110
movq %rax, %r14
movq 0xb9f6(%rip), %rdi      # 0x1bff0
leaq 0x4779(%rip), %rsi      # 0x14d7a
callq 0x42a0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4270
leaq 0x40d6(%rip), %rsi      # 0x146ee
movq %rax, %rdi
callq 0x42a0
movq %rax, %rbx
movq 0x18(%r14), %rsi
movl 0x10(%r14), %edx
movq (%rsi), %rax
leaq 0x8(%rsp), %rdi
callq *0x20(%rax)
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x4270
movq %rax, %rdi
callq 0x41c0
leaq 0x8(%rsp), %rdi
callq 0x4558
leaq 0x41b6(%rip), %rdi      # 0x14812
callq 0x4250
pushq $0x1
jmp 0x10543
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x4558
jmp 0x1067c
jmp 0x10679
movq %rax, %r14
callq 0x4470
leaq 0x28(%rsp), %rdi
callq 0x4558
movq %r14, %rdi
callq 0x44d0
movq %rax, %rdi
callq 0x6194
nop