// File: /workspace/github_cpp_makefile_star2_O1/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 0x7720
leaq 0x464d(%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 0x14667
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 0x146ba
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x1465d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x42d0
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0xb982(%rip), %rdi      # 0x1fff0
leaq 0x46c4(%rip), %rsi      # 0x18d39
movl $0x21, %edx
callq 0x42f0
movq 0x218(%rbx), %rsi
movq 0x220(%rbx), %rdx
movq 0xb95c(%rip), %rdi      # 0x1fff0
callq 0x42f0
movq %rax, %r14
leaq 0x403f(%rip), %rsi      # 0x186e2
movl $0xb, %edx
movq %rax, %rdi
callq 0x42f0
movq %r14, %rdi
callq 0x4130
jmp 0x14706
movq 0xb92f(%rip), %rdi      # 0x1fff0
leaq 0x457d(%rip), %rsi      # 0x18c45
movl $0x21, %edx
callq 0x42f0
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0xb90e(%rip), %rdi      # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0x3e7b(%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 0x14899
movq %rax, %r14
cmpl $0x1, %edx
jne 0x14899
movq %r14, %rdi
callq 0x4110
movq %rax, %rbx
movq 0xb8ba(%rip), %rdi      # 0x1fff0
leaq 0x452a(%rip), %rsi      # 0x18c67
movl $0x1e, %edx
callq 0x42f0
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0xb899(%rip), %rdi      # 0x1fff0
callq 0x42f0
movq %rax, %r14
leaq 0x3f88(%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 0x147ce
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0x147ce
jmp 0x147cb
movq %rax, %r14
callq 0x4480
jmp 0x14899
movq %rax, %r14
cmpl $0x1, %edx
jne 0x14899
movq %r14, %rdi
callq 0x4110
movq %rax, %r14
movq 0xb7fa(%rip), %rdi      # 0x1fff0
leaq 0x457d(%rip), %rsi      # 0x18d7a
movl $0x1d, %edx
callq 0x42f0
movq 0x218(%rbx), %rsi
movq 0x220(%rbx), %rdx
movq 0xb7d4(%rip), %rdi      # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0x3ec3(%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 0x14894
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0x14894
jmp 0x14891
movq %rax, %r14
callq 0x4480
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x148af
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x42d0
movq %r14, %rdi
callq 0x44e0
movq %rax, %rdi
callq 0x7714
nop