// File: /workspace/github_cpp_makefile_star2_O1/Nallantli[P]Rossa/main/rossa/operation/operation.cpp
// Function: operation::index(object_t const*, symbol_t const&, symbol_t const&, token_t const*, std::vector<std::pair<token_t, function_t>, std::allocator<std::pair<token_t, function_t>>>&)
const symbol_t operation::index(const object_t *scope, const symbol_t &evalA, const symbol_t &evalB, const token_t *token, trace_t &stack_trace)
{
	switch (COMP(evalA.getValueType(), evalB.getValueType()))
	{
	case COMP(value_type_enum::DICTIONARY, value_type_enum::STRING):
		return evalA.indexDict(evalB.getString(token, stack_trace));
	case COMP(value_type_enum::ARRAY, value_type_enum::NUMBER):
	{
		auto num = evalB.getNumber(token, stack_trace);
		if (num.type != number_t::LONG_NUM)
			throw rossa_error_t(util::format("Cannot index with non integral value: {0}", {num.toCodeString()}), *token, stack_trace);
		return evalA.indexVector(evalB.getNumber(token, stack_trace).getLong(), token, stack_trace);
	}
	case value_type_enum::OBJECT:
	{
		const auto &o = evalA.getObject(token, stack_trace);
		if (o->hasValue(parser_t::HASH_INDEX))
			return o->getVariable(parser_t::HASH_INDEX, token, stack_trace).call({evalB}, token, stack_trace);
	}
	default:
		if (scope != NULL)
			return scope->getVariable(parser_t::HASH_INDEX, token, stack_trace).call({evalA, evalB}, token, stack_trace);
	}

	throw rossa_error_t(util::format(_UNDECLARED_OPERATOR_ERROR_, {"[]"}), *token, stack_trace);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %r9, %r14
movq %r8, %r15
movq %rcx, %r13
movq %rdx, %r12
movq %rsi, %rbp
movq %rdi, 0x10(%rsp)
movq %rdx, %rdi
callq 0x41262
movl $0xfffffff8, %ecx       # imm = 0xFFFFFFF8
cmpl $-0x8, %eax
je 0x79c34
movq %r12, %rdi
callq 0x41262
movl %eax, %ebx
shll $0x18, %ebx
negl %ebx
sarl $0x14, %ebx
movq %r13, %rdi
callq 0x41262
negb %al
movsbl %al, %ecx
orl %ebx, %ecx
cmpl $-0x8, %ecx
je 0x79d02
cmpl $0x52, %ecx
je 0x79c9d
cmpl $0x74, %ecx
jne 0x79d9f
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x41004
movq %r12, %rdi
movq %rbx, %rsi
callq 0x419e8
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x404c8
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x79e44
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x79e44
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x40b0c
movups (%rax), %xmm0
movaps %xmm0, 0x80(%rsp)
cmpl $0x1, 0x88(%rsp)
jne 0x79f19
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x40b0c
movq %rax, %rdi
callq 0x479d4
leaq 0x18(%rsp), %rsi
movq %rax, (%rsi)
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x40d76
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x404c8
jmp 0x79e44
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x411a4
movq %rax, %rbx
leaq 0x3dc9e(%rip), %rsi     # 0xb79b8
movq %rax, %rdi
callq 0x3d498
testb %al, %al
je 0x79d9f
movb %al, 0x58(%rsp)
leaq 0x3dc87(%rip), %rsi     # 0xb79b8
movq %rbx, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x3d502
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
movq %r13, %rsi
callq 0x404c8
leaq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x60(%rsp), %rcx
movl $0x1, %edx
callq 0x43e3c
leaq 0x18(%rsp), %rdx
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
movq %r15, %rcx
movq %r14, %r8
callq 0x42736
leaq 0x18(%rsp), %rdi
callq 0x20a84
leaq 0x38(%rsp), %rdi
callq 0x404da
cmpb $0x0, 0x58(%rsp)
jne 0x79e44
testq %rbp, %rbp
je 0x79e5b
leaq 0x3dc09(%rip), %rsi     # 0xb79b8
movq %rbp, %rdi
movq %r15, 0x58(%rsp)
movq %r15, %rdx
movq %r14, %r15
movq %r14, %rcx
callq 0x3d502
movq %rax, %rbp
leaq 0x18(%rsp), %r14
movq %r14, %rbx
movq %r14, %rdi
movq %r12, %rsi
callq 0x404c8
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x404c8
leaq 0x38(%rsp), %rdi
leaq 0x18(%rsp), %rsi
leaq 0x60(%rsp), %rcx
movl $0x2, %edx
callq 0x43e3c
leaq 0x38(%rsp), %rdx
movq 0x10(%rsp), %rdi
movq %rbp, %rsi
movq 0x58(%rsp), %rcx
movq %r15, %r8
callq 0x42736
leaq 0x38(%rsp), %rdi
callq 0x20a84
movl $0x10, %ebx
leaq (%rsp,%rbx), %rdi
addq $0x18, %rdi
callq 0x404da
addq $-0x10, %rbx
cmpq $-0x10, %rbx
jne 0x79e2d
movq 0x10(%rsp), %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %r13
movq %r14, %r12
movl $0xa8, %edi
callq 0x101e0
movq %rax, %r15
leaq 0x48(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0xea2d(%rip), %rsi      # 0x888ab
leaq 0xea58(%rip), %rdx      # 0x888dd
leaq 0x38(%rsp), %rdi
callq 0x1e7ca
leaq 0x70(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xa9c1(%rip), %rsi      # 0x84860
leaq 0xa9bc(%rip), %rdx      # 0x84862
leaq 0x60(%rsp), %rdi
callq 0x1e7ca
leaq 0x90(%rsp), %rdi
leaq 0x60(%rsp), %rsi
leaq 0x80(%rsp), %rcx
movl $0x1, %edx
callq 0x20c5e
leaq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x48694
movb $0x1, %bpl
leaq 0x18(%rsp), %rsi
movq %r15, %rdi
movq %r13, %rdx
movq %r12, %rcx
callq 0x476dc
xorl %ebp, %ebp
leaq 0x38ddb(%rip), %rsi     # 0xb2ce0
leaq -0x42758(%rip), %rdx    # 0x377b4
movq %r15, %rdi
callq 0x106d0
jmp 0x79fc0
movq %r15, %r13
movq %r14, %r12
movl $0xa8, %edi
callq 0x101e0
movq %rax, %r15
leaq 0x48(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xe945(%rip), %rsi      # 0x88881
leaq 0xe967(%rip), %rdx      # 0x888aa
leaq 0x38(%rsp), %rdi
callq 0x1e7ca
leaq 0x60(%rsp), %rbx
leaq 0x80(%rsp), %rsi
movq %rbx, %rdi
callq 0x483c8
leaq 0x90(%rsp), %rdi
leaq 0xf(%rsp), %rcx
movl $0x1, %edx
movq %rbx, %rsi
callq 0x20c5e
leaq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x48694
movb $0x1, %bl
leaq 0x18(%rsp), %rsi
movq %r15, %rdi
movq %r13, %rdx
movq %r12, %rcx
callq 0x476dc
xorl %ebx, %ebx
leaq 0x38d2f(%rip), %rsi     # 0xb2ce0
leaq -0x42804(%rip), %rdx    # 0x377b4
movq %r15, %rdi
callq 0x106d0
movq %rax, %r12
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x79fe6
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x79fe6
movq %rax, %r12
movb $0x1, %bpl
leaq 0x90(%rsp), %rdi
callq 0x1dca2
jmp 0x7a02f
movq %rax, %r12
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7a01a
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x7a01a
movq %rax, %r12
movb $0x1, %bl
leaq 0x90(%rsp), %rdi
callq 0x1dca2
jmp 0x7a04d
movq %rax, %r12
movb $0x1, %bpl
movq 0x60(%rsp), %rdi
cmpq %r14, %rdi
je 0x7a087
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x7a087
movq %rax, %r12
movb $0x1, %bl
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7a068
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x103d0
movq 0x38(%rsp), %rdi
cmpq %r14, %rdi
je 0x7a0c6
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x7a0c6
movq %rax, %r12
movb $0x1, %bpl
movq 0x38(%rsp), %rdi
cmpq %rbx, %rdi
je 0x7a0dd
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x7a0dd
movq %rax, %r12
leaq 0x18(%rsp), %rdi
callq 0x20a84
jmp 0x7a0b2
movq %rax, %r12
leaq 0x38(%rsp), %rdi
callq 0x404da
jmp 0x7a15a
movq %rax, %r12
movb $0x1, %bl
testb %bl, %bl
jne 0x7a0e2
jmp 0x7a15a
movq %rax, %r12
jmp 0x7a15a
movq %rax, %r12
movb $0x1, %bpl
testb %bpl, %bpl
je 0x7a15a
movq %r15, %rdi
callq 0x102d0
jmp 0x7a15a
movq %rax, %r12
leaq 0x38(%rsp), %rdi
callq 0x20a84
jmp 0x7a0fe
movq %rax, %r12
movl $0x10, %ebx
leaq (%rsp,%rbx), %rdi
addq $0x18, %rdi
callq 0x404da
addq $-0x10, %rbx
cmpq $-0x10, %rbx
jne 0x7a103
jmp 0x7a15a
movq %rax, %r12
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7a15a
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x7a15a
movq %rax, %r12
cmpq %rbx, %r14
je 0x7a15a
leaq 0x18(%rsp), %r14
addq $-0x10, %rbx
movq %rbx, %rdi
callq 0x404da
cmpq %r14, %rbx
jne 0x7a149
movq %r12, %rdi
callq 0x106f0