// File: /workspace/github_cpp_makefile_star2_O3/pranavmodx[P]modlang/src/evaluator.cpp
// Function: Evaluator::evalStringIndexExpression(String*, Integer*)
Object *Evaluator::evalStringIndexExpression(String *string, Integer *index)
{
	int i = index->value;
	auto arr = string->value;

	if (arr.size() <= i)
		return new Error("error: index " + index->inspect() + " out of range");

	return new String(std::string(1, arr[i]));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa0, %rsp
movq %rdx, %r14
movslq 0x8(%rdx), %r12
leaq 0x70(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x8(%rsi), %rax
movq 0x10(%rsi), %rdx
addq %rax, %rdx
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0xbdc6
cmpq %r12, 0x8(%rbx)
jbe 0x23898
movl $0x28, %edi
callq 0x51b0
movq %rax, %rbx
movq 0x60(%rsp), %rax
movsbl (%rax,%r12), %edx
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq %rsp, %rdi
movl $0x1, %esi
callq 0x5210
leaq 0x1131a(%rip), %rax     # 0x34b78
movq %rax, (%rbx)
leaq 0x8(%rbx), %rdi
movq %rbx, %rax
addq $0x18, %rax
movq %rax, 0x8(%rbx)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
callq 0xbdc6
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x239e6
movq 0x10(%rsp), %rsi
jmp 0x239de
movl $0x28, %edi
callq 0x51b0
movq %rax, %rbx
movq (%r14), %rax
leaq 0x80(%rsp), %rdi
movq %r14, %rsi
callq *0x8(%rax)
leaq 0x6324(%rip), %rcx      # 0x29be1
leaq 0x80(%rsp), %rdi
movl $0xd, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x51f0
leaq 0x30(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x238fc
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x23904
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq 0x20(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x5c84(%rip), %rsi      # 0x295ab
callq 0x5360
leaq 0x50(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x23953
movq %rsi, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x2395e
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq %r13, %rsi
movq 0x8(%rax), %rdx
movq %rdx, 0x48(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x1111b(%rip), %rax     # 0x34a98
movq %rax, (%rbx)
leaq 0x8(%rbx), %rdi
movq %rbx, %rax
addq $0x18, %rax
movq %rax, 0x8(%rbx)
addq %rsi, %rdx
callq 0xbdc6
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0x239ae
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x51c0
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x239c5
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x51c0
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x239e6
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x51c0
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0x239fd
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x51c0
movq %rbx, %rax
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r14
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0x23a30
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x51c0
jmp 0x23a30
movq %rax, %r14
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x23a4c
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x51c0
jmp 0x23a4c
movq %rax, %r14
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x23a87
movq 0x90(%rsp), %rsi
jmp 0x23a78
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x23a87
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x51c0
jmp 0x23a87
jmp 0x23a84
movq %rax, %r14
movl $0x28, %esi
movq %rbx, %rdi
callq 0x51c0
jmp 0x23a99
movq %rax, %r14
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0x23ab0
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x51c0
movq %r14, %rdi
callq 0x5330