// File: chrissimpkins[P]octopus/src/io.cpp
// Function: IO::get_input_stream(std::basic_ifstream<char, std::char_traits<char>>&)
ifstream& IO::get_input_stream(ifstream& infilestream){
	if (!path.empty()){
		try{
			infilestream.open(path);
			if (infilestream.good()) {
				ifstream& inr = infilestream;
				return inr;
			}
			else{
				throw runtime_error("Input File Error");
			}
		}
		catch (...) {
			print("Unable to open the input file " + path);
			exit(EXIT_FAILURE);
		}
	}
	else if (!ipath.empty()){
		try{
			infilestream.open(ipath);
			if (infilestream.good()){
				ifstream& inr = infilestream;
				return inr;
			}
			else{
				throw runtime_error("Input File Error");
			}
		}
		catch (...){
			print("Unable to open the input file " + ipath);
			exit(EXIT_FAILURE);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x80(%rbp)
callq 0x34c0
testb $0x1, %al
jne 0x10dce
movq -0x80(%rbp), %rsi
movq -0x18(%rbp), %rdi
movl $0x8, %edx
callq 0x3270
jmp 0x10cbc
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x34d0
movb %al, -0x81(%rbp)
jmp 0x10cd7
movb -0x81(%rbp), %al
testb $0x1, %al
jne 0x10ce3
jmp 0x10d06
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x10f12
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x10d62
movl $0x10, %edi
callq 0x3160
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x90(%rbp)
leaq 0x2b1f(%rip), %rsi      # 0x13843
callq 0x30f0
jmp 0x10d2b
movq -0x90(%rbp), %rdi
movq 0x72b7(%rip), %rsi      # 0x17ff0
movq 0x7270(%rip), %rdx      # 0x17fb0
callq 0x34e0
jmp 0x10f30
movq -0x90(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x3200
movq -0x20(%rbp), %rdi
callq 0x3100
movq -0x80(%rbp), %rdx
leaq 0x2a0c(%rip), %rsi      # 0x13782
leaq -0x50(%rbp), %rdi
callq 0xca10
jmp 0x10d81
leaq -0x50(%rbp), %rdi
callq 0xb550
jmp 0x10d8c
leaq -0x50(%rbp), %rdi
callq 0x31b0
movl $0x1, %edi
callq 0x33b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x10dc2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x31b0
callq 0x34b0
jmp 0x10dc9
jmp 0x10f1f
movq -0x80(%rbp), %rdi
addq $0x20, %rdi
callq 0x34c0
testb $0x1, %al
jne 0x10f0e
movq -0x80(%rbp), %rsi
movq -0x18(%rbp), %rdi
addq $0x20, %rsi
movl $0x8, %edx
callq 0x3270
jmp 0x10dfb
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x34d0
movb %al, -0x91(%rbp)
jmp 0x10e16
movb -0x91(%rbp), %al
testb $0x1, %al
jne 0x10e22
jmp 0x10e45
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x10f12
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x10ea1
movl $0x10, %edi
callq 0x3160
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xa0(%rbp)
leaq 0x29e0(%rip), %rsi      # 0x13843
callq 0x30f0
jmp 0x10e6a
movq -0xa0(%rbp), %rdi
movq 0x7178(%rip), %rsi      # 0x17ff0
movq 0x7131(%rip), %rdx      # 0x17fb0
callq 0x34e0
jmp 0x10f30
movq -0xa0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x3200
movq -0x20(%rbp), %rdi
callq 0x3100
movq -0x80(%rbp), %rdx
addq $0x20, %rdx
leaq 0x28c9(%rip), %rsi      # 0x13782
leaq -0x78(%rbp), %rdi
callq 0xca10
jmp 0x10ec4
leaq -0x78(%rbp), %rdi
callq 0xb550
jmp 0x10ecf
leaq -0x78(%rbp), %rdi
callq 0x31b0
movl $0x1, %edi
callq 0x33b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x10f05
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x31b0
callq 0x34b0
jmp 0x10f0c
jmp 0x10f1f
jmp 0x10f10
ud2
movq -0x8(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x3500
movq %rax, %rdi
callq 0xe750