// File: /workspace/github_cpp_makefile_star2_O2/chrissimpkins[P]octopus/src/io.cpp
// Function: IO::is_file_good()
bool IO::is_file_good() {
	//if the path variable is assigned in constructor
	if (!path.empty()){
		try{
			ifstream infile(path);
			if (infile.good()){
				infile.close();
				return true;
			}
			else{
				throw runtime_error("Unable to open the file " + path);
			}
		}
		catch(...){
			print_error("Unable to open the file '" + path + "'. Please confirm that it exists.");
			exit(EXIT_FAILURE);
		}
	}
	//otherwise use the ipath from constructor
	else if (!ipath.empty()) {
		try{
			ifstream infile(ipath);
			if (infile.good()){
				infile.close();
				return true;
			}
			else{
				throw runtime_error("Unable to open the file " + path);
			}
		}
		catch (...){
			print_error("Unable to open the file '" + ipath + "'. Please confirm that it exists.");
			exit(EXIT_FAILURE);
		}
	}
	else{
		throw runtime_error("Missing a file path for the file.");
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movq %rdi, %rbx
cmpq $0x0, 0x8(%rdi)
je 0x96a2
leaq 0x60(%rsp), %rdi
pushq $0x8
popq %rdx
movq %rbx, %rsi
callq 0x3370
movq 0x60(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x80(%rsp,%rax)
jne 0x96fc
leaq 0x60(%rsp), %rdi
callq 0x3050
jmp 0x96e2
cmpq $0x0, 0x28(%rbx)
je 0x9741
leaq 0x20(%rbx), %r14
leaq 0x60(%rsp), %rdi
pushq $0x8
popq %rdx
movq %r14, %rsi
callq 0x3370
movq 0x60(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x80(%rsp,%rax)
jne 0x9771
leaq 0x60(%rsp), %rdi
callq 0x3050
leaq 0x60(%rsp), %rdi
callq 0x3070
movb $0x1, %al
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x3130
movq %rax, %r14
leaq 0x2ffd(%rip), %rsi      # 0xc70b
movq %rsp, %rdi
movq %rbx, %rdx
callq 0x81b2
movb $0x1, %bpl
movq %rsp, %rsi
movq %r14, %rdi
callq 0x3380
xorl %ebp, %ebp
movq 0x68c0(%rip), %rsi      # 0xfff0
movq 0x6889(%rip), %rdx      # 0xffc0
movq %r14, %rdi
callq 0x33a0
jmp 0x97b4
pushq $0x10
popq %rdi
callq 0x3130
movq %rax, %r14
leaq 0x300d(%rip), %rsi      # 0xc760
movq %rax, %rdi
callq 0x30c0
movq 0x688e(%rip), %rsi      # 0xfff0
movq 0x6857(%rip), %rdx      # 0xffc0
movq %r14, %rdi
callq 0x33a0
pushq $0x10
popq %rdi
callq 0x3130
movq %rax, %r15
leaq 0x2f88(%rip), %rsi      # 0xc70b
movq %rsp, %rdi
movq %rbx, %rdx
callq 0x81b2
movb $0x1, %bpl
movq %rsp, %rsi
movq %r15, %rdi
callq 0x3380
xorl %ebp, %ebp
movq 0x684b(%rip), %rsi      # 0xfff0
movq 0x6814(%rip), %rdx      # 0xffc0
movq %r15, %rdi
callq 0x33a0
movq %rax, %rbx
movq %rsp, %rdi
callq 0x3100
testb %bpl, %bpl
jne 0x97c9
jmp 0x980b
movq %rax, %rbx
movq %r15, %rdi
callq 0x3180
jmp 0x980b
movq %rax, %rbx
movq %r14, %rdi
callq 0x3180
jmp 0x9918
movq %rax, %r15
movq %rsp, %rdi
callq 0x3100
testb %bpl, %bpl
jne 0x97fb
jmp 0x988b
movq %rax, %r15
movq %r14, %rdi
callq 0x3180
jmp 0x988b
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x3070
jmp 0x981a
movq %rax, %rbx
movq %rbx, %rdi
callq 0x30d0
leaq 0x2efb(%rip), %rsi      # 0xc724
leaq 0x60(%rsp), %rdi
movq %r14, %rdx
callq 0x81b2
leaq 0x2f01(%rip), %rdx      # 0xc73e
leaq 0x20(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x8193
leaq 0x20(%rsp), %rdi
callq 0x817a
leaq 0x20(%rsp), %rdi
jmp 0x98db
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x3100
jmp 0x986f
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x3100
jmp 0x987e
movq %rax, %rbx
callq 0x3390
jmp 0x9918
movq %rax, %r15
leaq 0x60(%rsp), %rdi
callq 0x3070
jmp 0x989a
movq %rax, %r15
movq %r15, %rdi
callq 0x30d0
leaq 0x2e7b(%rip), %rsi      # 0xc724
leaq 0x60(%rsp), %rdi
movq %rbx, %rdx
callq 0x81b2
leaq 0x2e81(%rip), %rdx      # 0xc73e
leaq 0x40(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x8193
leaq 0x40(%rsp), %rdi
callq 0x817a
leaq 0x40(%rsp), %rdi
callq 0x3100
leaq 0x60(%rsp), %rdi
callq 0x3100
pushq $0x1
popq %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x3100
jmp 0x9904
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x3100
jmp 0x9913
movq %rax, %rbx
callq 0x3390
movq %rbx, %rdi
callq 0x33b0
movq %rax, %rdi
callq 0x8d11