// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x450(%rdi), %rsi
movq 0x458(%rdi), %rdx
addq %rsi, %rdx
movq %rsp, %r14
movq %r14, %rdi
callq 0x76e4
leaq 0x47f7(%rip), %rsi      # 0x18c3f
movq %r14, %rdi
callq 0x4530
leaq 0x8(%rbx), %rdi
movq 0x218(%rbx), %rsi
movl $0x10, %edx
callq 0x4270
leaq 0x88(%rbx), %rdi
callq 0x40a0
testb %al, %al
je 0x144bd
leaq 0x240(%rbx), %rdi
movq (%rsp), %rsi
movl $0x10, %edx
callq 0x4270
addq $0x2c0, %rbx            # imm = 0x2C0
movq %rbx, %rdi
callq 0x40a0
testb %al, %al
je 0x14510
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x144b3
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x42d0
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0xbb2c(%rip), %rdi      # 0x1fff0
leaq 0x486e(%rip), %rsi      # 0x18d39
movl $0x21, %edx
callq 0x42f0
movq 0x218(%rbx), %rsi
movq 0x220(%rbx), %rdx
movq 0xbb06(%rip), %rdi      # 0x1fff0
callq 0x42f0
movq %rax, %r14
leaq 0x41e9(%rip), %rsi      # 0x186e2
movl $0xb, %edx
movq %rax, %rdi
callq 0x42f0
movq %r14, %rdi
callq 0x4130
jmp 0x1455c
movq 0xbad9(%rip), %rdi      # 0x1fff0
leaq 0x4727(%rip), %rsi      # 0x18c45
movl $0x21, %edx
callq 0x42f0
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0xbab8(%rip), %rdi      # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0x4025(%rip), %rsi      # 0x1856c
movl $0xa, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
movl $0x2, %edi
callq 0x4320
movq %rax, %r14
jmp 0x146ef
movq %rax, %r14
cmpl $0x1, %edx
jne 0x146ef
movq %r14, %rdi
callq 0x4110
movq %rax, %rbx
movq 0xba64(%rip), %rdi      # 0x1fff0
leaq 0x46d4(%rip), %rsi      # 0x18c67
movl $0x1e, %edx
callq 0x42f0
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0xba43(%rip), %rdi      # 0x1fff0
callq 0x42f0
movq %rax, %r14
leaq 0x4132(%rip), %rsi      # 0x186ee
movl $0xd, %edx
movq %rax, %rdi
callq 0x42f0
movq 0x18(%rbx), %rsi
movl 0x10(%rbx), %edx
movq (%rsi), %rax
leaq 0x20(%rsp), %rdi
callq *0x20(%rax)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq %r14, %rdi
callq 0x42f0
movq %rax, %rdi
callq 0x41b0
leaq 0x20(%rsp), %rdi
callq 0x4a9f
movq %rax, %r14
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x14624
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0x14624
jmp 0x14621
movq %rax, %r14
callq 0x4480
jmp 0x146ef
movq %rax, %r14
cmpl $0x1, %edx
jne 0x146ef
movq %r14, %rdi
callq 0x4110
movq %rax, %r14
movq 0xb9a4(%rip), %rdi      # 0x1fff0
leaq 0x4727(%rip), %rsi      # 0x18d7a
movl $0x1d, %edx
callq 0x42f0
movq 0x218(%rbx), %rsi
movq 0x220(%rbx), %rdx
movq 0xb97e(%rip), %rdi      # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0x406d(%rip), %rsi      # 0x186ee
movl $0xd, %edx
movq %rax, %rdi
callq 0x42f0
movq 0x18(%r14), %rsi
movl 0x10(%r14), %edx
movq (%rsi), %rax
leaq 0x20(%rsp), %rdi
callq *0x20(%rax)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x42f0
movq %rax, %rdi
callq 0x41b0
leaq 0x20(%rsp), %rdi
callq 0x4a85
movq %rax, %r14
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x146ea
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0x146ea
jmp 0x146e7
movq %rax, %r14
callq 0x4480
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x14705
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x42d0
movq %r14, %rdi
callq 0x44e0
movq %rax, %rdi
callq 0x76d8
nop