// File: AshOlogn[P]ash-language-interpreter/src/exceptions.cpp
// Function: OutOfBoundsException::what() const
const char* OutOfBoundsException::what() const throw() {

	std::string str = "";

	if(startLine == endLine) {
		str.append("OutOfBoundsException on line ");
		str.append(std::to_string(startLine));
	} else {
		str.append("OutOfBoundsException from line ");
		str.append(std::to_string(startLine));
		str.append(" to ");
		str.append(std::to_string(endLine));
	}

	str.append(":\n\t");
	str.append(context);

	//error message
	str.append("The index ");
	str.append(std::to_string(index));
	str.append(" is out of bounds in ");
	str.append((isArray) ? "array" : "string");
	str.append(" of length ");
	str.append(std::to_string(length));

	return copyString(str.c_str());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xf0(%rbp)
leaq -0x29(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x4430
movq -0xe8(%rbp), %rdx
leaq 0x37dad(%rip), %rsi     # 0x3f035
leaq -0x28(%rbp), %rdi
callq 0x4350
jmp 0x7293
leaq -0x29(%rbp), %rdi
callq 0x4290
movq -0xf0(%rbp), %rcx
movl 0x1c(%rcx), %eax
cmpl 0x20(%rcx), %eax
jne 0x7338
leaq 0x38113(%rip), %rsi     # 0x3f3c9
leaq -0x28(%rbp), %rdi
callq 0x4460
jmp 0x72c1
movq -0xf0(%rbp), %rax
movl 0x1c(%rax), %esi
leaq -0x60(%rbp), %rdi
callq 0x6e40
jmp 0x72d6
leaq -0x28(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x4470
jmp 0x72e5
leaq -0x60(%rbp), %rdi
callq 0x4170
jmp 0x73f8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x29(%rbp), %rdi
callq 0x4290
jmp 0x755a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x7551
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x4170
jmp 0x7551
leaq 0x380a8(%rip), %rsi     # 0x3f3e7
leaq -0x28(%rbp), %rdi
callq 0x4460
jmp 0x734a
movq -0xf0(%rbp), %rax
movl 0x1c(%rax), %esi
leaq -0x80(%rbp), %rdi
callq 0x6e40
jmp 0x735f
leaq -0x28(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x4470
jmp 0x736e
leaq -0x80(%rbp), %rdi
callq 0x4170
leaq 0x3d610(%rip), %rsi     # 0x4498e
leaq -0x28(%rbp), %rdi
callq 0x4460
jmp 0x7389
movq -0xf0(%rbp), %rax
movl 0x20(%rax), %esi
leaq -0xa0(%rbp), %rdi
callq 0x6e40
jmp 0x73a1
leaq -0x28(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x4470
jmp 0x73b3
leaq -0xa0(%rbp), %rdi
callq 0x4170
jmp 0x73f8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x4170
jmp 0x7551
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x4170
jmp 0x7551
leaq 0x37c33(%rip), %rsi     # 0x3f032
leaq -0x28(%rbp), %rdi
callq 0x4460
jmp 0x740a
movq -0xf0(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x28(%rbp), %rdi
callq 0x4460
jmp 0x7420
leaq 0x37fe0(%rip), %rsi     # 0x3f407
leaq -0x28(%rbp), %rdi
callq 0x4460
jmp 0x7432
movq -0xf0(%rbp), %rax
movl 0x18(%rax), %esi
leaq -0xc0(%rbp), %rdi
callq 0x7570
jmp 0x744a
leaq -0x28(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x4470
jmp 0x745c
leaq -0xc0(%rbp), %rdi
callq 0x4170
leaq 0x37fa3(%rip), %rsi     # 0x3f412
leaq -0x28(%rbp), %rdi
callq 0x4460
jmp 0x747a
movq -0xf0(%rbp), %rax
movb 0x10(%rax), %cl
leaq 0x37f9d(%rip), %rax     # 0x3f428
leaq 0x37f9c(%rip), %rsi     # 0x3f42e
testb $0x1, %cl
cmovneq %rax, %rsi
leaq -0x28(%rbp), %rdi
callq 0x4460
jmp 0x74a4
leaq 0x37f8a(%rip), %rsi     # 0x3f435
leaq -0x28(%rbp), %rdi
callq 0x4460
jmp 0x74b6
movq -0xf0(%rbp), %rax
movl 0x14(%rax), %esi
leaq -0xe0(%rbp), %rdi
callq 0x7570
jmp 0x74ce
leaq -0x28(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x4470
jmp 0x74e0
leaq -0xe0(%rbp), %rdi
callq 0x4170
leaq -0x28(%rbp), %rdi
callq 0x40e0
movq %rax, %rdi
callq 0x2fb10
movq %rax, -0xf8(%rbp)
jmp 0x7506
leaq -0x28(%rbp), %rdi
callq 0x4170
movq -0xf8(%rbp), %rax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x4170
jmp 0x7551
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x4170
leaq -0x28(%rbp), %rdi
callq 0x4170
movq -0x38(%rbp), %rdi
callq 0x42e0
nopw %cs:(%rax,%rax)
nopl (%rax)