// File: /workspace/github_cpp_makefile_star2_O3/pranavmodx[P]modlang/src/evaluator.cpp
// Function: Evaluator::evalIndexExpression(Object*, Object*, Environment*)
Object *Evaluator::evalIndexExpression(Object *left, Object *index, Environment *env)
{
	if (left->type() == STRING_OBJ && index->type() == INTEGER_OBJ)
		return evalStringIndexExpression((String *)left, (Integer *)index);

	else if (left->type() == ARRAY_OBJ && index->type() == INTEGER_OBJ)
		return evalArrayIndexExpression((Array *)left, (Integer *)index);

	else if (left->type() == HASHMAP_OBJ)
		return evalHashMapIndexExpression((HashMap *)left, index);

	else
		return new Error("error: index operator [] not supported for -> " + left->type());
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq (%rsi), %rax
movq %rsp, %r15
movq %r15, %rdi
callq *(%rax)
movq 0x8(%r15), %rdx
cmpq 0x169a4(%rip), %rdx     # 0x38198
jne 0x2180f
testq %rdx, %rdx
je 0x21813
movq 0x1698e(%rip), %rsi     # 0x38190
movq (%rsp), %rdi
callq 0x51d0
testl %eax, %eax
je 0x21813
xorl %ebp, %ebp
jmp 0x21875
movq (%r14), %rax
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq *(%rax)
movq 0x28(%rsp), %rdx
cmpq 0x1692c(%rip), %rdx     # 0x38158
jne 0x2184f
movq 0x20(%rsp), %r15
testq %rdx, %rdx
je 0x21858
movq 0x16911(%rip), %rsi     # 0x38150
movq %r15, %rdi
callq 0x51d0
testl %eax, %eax
sete %bpl
jmp 0x2185b
movq 0x20(%rsp), %r15
xorl %ebp, %ebp
jmp 0x2185b
movb $0x1, %bpl
leaq 0x30(%rsp), %rax
cmpq %rax, %r15
je 0x21875
movq 0x30(%rsp), %rsi
incq %rsi
movq %r15, %rdi
callq 0x51c0
leaq 0x10(%rsp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0x21891
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x51c0
testb %bpl, %bpl
je 0x218a6
movq %rbx, %rsi
movq %r14, %rdx
callq 0x237e8
jmp 0x219d3
movq (%rbx), %rax
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq *(%rax)
movq 0x8(%r15), %rdx
cmpq 0x16919(%rip), %rdx     # 0x381d8
jne 0x218da
testq %rdx, %rdx
je 0x218de
movq 0x16903(%rip), %rsi     # 0x381d0
movq (%rsp), %rdi
callq 0x51d0
testl %eax, %eax
je 0x218de
xorl %ebp, %ebp
jmp 0x21940
movq (%r14), %rax
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq *(%rax)
movq 0x28(%rsp), %rdx
cmpq 0x16861(%rip), %rdx     # 0x38158
jne 0x2191a
movq 0x20(%rsp), %r15
testq %rdx, %rdx
je 0x21923
movq 0x16846(%rip), %rsi     # 0x38150
movq %r15, %rdi
callq 0x51d0
testl %eax, %eax
sete %bpl
jmp 0x21926
movq 0x20(%rsp), %r15
xorl %ebp, %ebp
jmp 0x21926
movb $0x1, %bpl
leaq 0x30(%rsp), %rax
cmpq %rax, %r15
je 0x21940
movq 0x30(%rsp), %rsi
incq %rsi
movq %r15, %rdi
callq 0x51c0
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x21956
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x51c0
testb %bpl, %bpl
je 0x21968
movq %rbx, %rsi
movq %r14, %rdx
callq 0x23ab8
jmp 0x219d3
movq (%rbx), %rax
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq *(%rax)
movq 0x8(%r15), %rdx
cmpq 0x16877(%rip), %rdx     # 0x381f8
jne 0x219a3
movq (%rsp), %r15
testq %rdx, %rdx
je 0x219ab
movq 0x1685d(%rip), %rsi     # 0x381f0
movq %r15, %rdi
callq 0x51d0
testl %eax, %eax
sete %bpl
jmp 0x219ae
movq (%rsp), %r15
xorl %ebp, %ebp
jmp 0x219ae
movb $0x1, %bpl
cmpq %r12, %r15
je 0x219c3
movq 0x10(%rsp), %rsi
incq %rsi
movq %r15, %rdi
callq 0x51c0
testb %bpl, %bpl
je 0x219e6
movq %rbx, %rsi
movq %r14, %rdx
callq 0x23cec
movq %rax, %r14
movq %r14, %rax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x28, %edi
callq 0x51b0
movq %rax, %r14
movq (%rbx), %rax
movq %rsp, %rdi
movq %rbx, %rsi
callq *(%rax)
leaq 0x81ad(%rip), %rcx      # 0x29bb2
movq %rsp, %rdi
movl $0x2e, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x51f0
leaq 0x50(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x21a3e
movq %rsi, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x21a48
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq %r15, %rsi
movq 0x8(%rax), %rdx
movq %rdx, 0x48(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x13031(%rip), %rax     # 0x34a98
movq %rax, (%r14)
leaq 0x8(%r14), %rdi
movq %r14, %rax
addq $0x18, %rax
movq %rax, 0x8(%r14)
addq %rsi, %rdx
callq 0xbdc6
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x21a98
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x51c0
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x219d6
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x51c0
jmp 0x219d6
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x21ad6
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x51c0
jmp 0x21ad6
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x21af1
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x51c0
jmp 0x21af1
movq %rax, %rbx
movl $0x28, %esi
movq %r14, %rdi
jmp 0x21b22
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
jne 0x21b1a
jmp 0x21b27
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x21b27
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x51c0
movq %rbx, %rdi
callq 0x5330
nop