// File: /workspace/github_cpp_makefile_star2_O3/swxlion[P]swxJson/src/swxJson.cpp
// Function: swxJson::Json::operator[](int)
Json& Json::operator [] (int index)
{
	if (_type == JSON_Uninit)
		setArray();

	if (_type != JSON_Array)
		throw JSON_ERROR_MSG(JsonNodeTypeMissMatchError, "Current node is not an array.");

	std::list<JsonPtr>* data = (std::list<JsonPtr>*)_data;
	auto it = data->begin();
	int i = 0;
	for (; it != data->end(); it++, i++)
	{
		if (i == index)
		{
			JsonPtr node = *it;
			return *(node.get());
		}
	}

	for (; i < index; i++)
	{
		JsonPtr node(new Json());
		pushNode(node);
	}

	JsonPtr node(new Json());
	pushNode(node);
	return *(node.get());
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movl (%rdi), %eax
cmpl $0x8, %eax
jne 0x1b4cc
movq %rbx, %rdi
callq 0x18322
movl (%rbx), %eax
cmpl $0x1, %eax
jne 0x1b641
movq 0x8(%rbx), %rdx
movq (%rdx), %rax
xorl %ecx, %ecx
cmpq %rdx, %rax
je 0x1b4f2
cmpl %ecx, %ebp
je 0x1b5da
incl %ecx
movq (%rax), %rax
jmp 0x1b4de
subl %ecx, %ebp
jle 0x1b587
leaq 0x8(%rsp), %r14
leaq 0x30(%rsp), %r15
movq 0xcac5(%rip), %r12      # 0x27fd0
movl $0x10, %edi
callq 0xb250
movl $0x8, (%rax)
movq $0x0, 0x8(%rax)
movq %rax, (%rsp)
movq %r14, %rdi
movq %rax, %rsi
callq 0x16778
movq (%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x30(%rsp)
movq %rax, 0x38(%rsp)
testq %rax, %rax
je 0x1b55a
cmpb $0x0, (%r12)
je 0x1b556
incl 0x8(%rax)
jmp 0x1b55a
lock
incl 0x8(%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x18376
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x1b574
callq 0x16c72
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1b583
callq 0x16c72
decl %ebp
jne 0x1b50b
movl $0x10, %edi
callq 0xb250
movl $0x8, (%rax)
movq $0x0, 0x8(%rax)
leaq 0x8(%rsp), %r14
movq %rax, -0x8(%r14)
movq %r14, %rdi
movq %rax, %rsi
callq 0x16778
movq -0x8(%r14), %rcx
movq (%r14), %rax
movq %rcx, 0x20(%rsp)
movq %rax, 0x28(%rsp)
testq %rax, %rax
je 0x1b5fc
movq 0xca00(%rip), %rcx      # 0x27fd0
cmpb $0x0, (%rcx)
je 0x1b5f8
incl 0x8(%rax)
jmp 0x1b5fc
movq 0x10(%rax), %rbx
movq 0x18(%rax), %rdi
testq %rdi, %rdi
je 0x1b62b
movq 0xc9e2(%rip), %rax      # 0x27fd0
cmpb $0x0, (%rax)
je 0x1b63b
incl 0x8(%rdi)
jmp 0x1b626
lock
incl 0x8(%rax)
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x18376
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x1b618
callq 0x16c72
movq (%rsp), %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1b62b
callq 0x16c72
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
lock
incl 0x8(%rdi)
jmp 0x1b626
movl $0x60, %edi
callq 0xb0f0
movq %rax, %rbx
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x523e(%rip), %rsi      # 0x2089c
leaq 0x5254(%rip), %rdx      # 0x208b9
movq %rsp, %rdi
callq 0x16fe4
movb $0x1, %bpl
leaq 0x5033(%rip), %rsi      # 0x206aa
leaq 0x5213(%rip), %rdx      # 0x20891
movq %rsp, %r8
movq %rbx, %rdi
movl $0x532, %ecx            # imm = 0x532
callq 0x1eb2c
leaq 0xc66b(%rip), %rax      # 0x27d00
addq $0x10, %rax
movq %rax, (%rbx)
xorl %ebp, %ebp
leaq 0xc613(%rip), %rsi      # 0x27cb8
leaq 0xef2(%rip), %rdx       # 0x1c59e
movq %rbx, %rdi
callq 0xb390
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x1b6cd
movq 0x10(%rsp), %rsi
incq %rsi
callq 0xb260
testb %bpl, %bpl
jne 0x1b6d7
jmp 0x1b70c
movq %rax, %r14
movq %rbx, %rdi
callq 0xb1c0
jmp 0x1b70c
movq %rax, %r14
movq 0x28(%rsp), %rdi
jmp 0x1b6f3
movq %rax, %r14
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x1b6fd
callq 0x16c72
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1b70c
callq 0x16c72
movq %r14, %rdi
callq 0xb3b0