// File: tomfunkhouser[P]gaps/pkgs/RNBasics/json.cpp
// Function: Json::Value::removeIndex(unsigned int, Json::Value*)
bool Value::removeIndex(ArrayIndex index, Value* removed) {
  if (type_ != arrayValue) {
    return false;
  }
  CZString key(index);
  ObjectValues::iterator it = value_.map_->find(key);
  if (it == value_.map_->end()) {
    return false;
  }
  *removed = it->second;
  ArrayIndex oldSize = size();
  // shift left all items left, into the place of the "removed"
  for (ArrayIndex i = index; i < (oldSize - 1); ++i){
    CZString keey(i);
    (*value_.map_)[keey] = (*this)[i + 1];
  }
  // erase the last one ("leftover")
  CZString keyLast(oldSize - 1);
  ObjectValues::iterator itLast = value_.map_->find(keyLast);
  value_.map_->erase(itLast);
  return true;
}

// Assembly:
subq $0x128, %rsp            # imm = 0x128
movq %rdi, 0x118(%rsp)
movl %esi, 0x114(%rsp)
movq %rdx, 0x108(%rsp)
movq 0x118(%rsp), %rax
movq %rax, 0x38(%rsp)
movw 0x8(%rax), %ax
andw $0xff, %ax
movzwl %ax, %eax
cmpl $0x6, %eax
je 0xf13d8
movb $0x0, 0x127(%rsp)
jmp 0xf16c0
movl 0x114(%rsp), %esi
leaq 0xf8(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0xec840
movq 0x38(%rsp), %rax
movq 0x28(%rsp), %rsi
movq (%rax), %rdi
callq 0xfa4a0
movq %rax, 0x30(%rsp)
jmp 0xf140a
movq 0x38(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rcx, 0xf0(%rsp)
movq (%rax), %rdi
callq 0xfa2a0
movq %rax, 0xd8(%rsp)
leaq 0xf0(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0xf9f70
testb $0x1, %al
jne 0xf1447
jmp 0xf1478
movb $0x0, 0x127(%rsp)
movl $0x1, 0xd4(%rsp)
jmp 0xf16a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe8(%rsp)
movl %eax, 0xe4(%rsp)
jmp 0xf16b1
leaq 0xf0(%rsp), %rdi
callq 0xf9ed0
movq %rax, %rsi
addq $0x10, %rsi
leaq 0xa8(%rsp), %rdi
callq 0xed200
jmp 0xf149b
movq 0x108(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0xe3700
jmp 0xf14b2
leaq 0xa8(%rsp), %rdi
callq 0xed680
movq 0x38(%rsp), %rdi
callq 0xeb340
movl %eax, 0xa4(%rsp)
movl 0x114(%rsp), %eax
movl %eax, 0xa0(%rsp)
movl 0xa0(%rsp), %eax
movl 0xa4(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jae 0xf15fe
movl 0xa0(%rsp), %esi
leaq 0x90(%rsp), %rdi
callq 0xec840
jmp 0xf150d
movq 0x38(%rsp), %rdi
movl 0xa0(%rsp), %esi
incl %esi
callq 0xefce0
movq %rax, 0x20(%rsp)
jmp 0xf1527
movq 0x20(%rsp), %rsi
leaq 0x68(%rsp), %rdi
callq 0xed200
jmp 0xf1538
movq 0x38(%rsp), %rax
movq (%rax), %rdi
leaq 0x90(%rsp), %rsi
callq 0xfa530
movq %rax, 0x18(%rsp)
jmp 0xf1554
movq 0x18(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0xe3700
jmp 0xf1565
leaq 0x68(%rsp), %rdi
callq 0xed680
leaq 0x90(%rsp), %rdi
callq 0xec9f0
movl 0xa0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa0(%rsp)
jmp 0xf14de
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe8(%rsp)
movl %eax, 0xe4(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0xed680
jmp 0xf16b1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe8(%rsp)
movl %eax, 0xe4(%rsp)
jmp 0xf15ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe8(%rsp)
movl %eax, 0xe4(%rsp)
leaq 0x68(%rsp), %rdi
callq 0xed680
leaq 0x90(%rsp), %rdi
callq 0xec9f0
jmp 0xf16b1
movl 0xa4(%rsp), %esi
decl %esi
leaq 0x58(%rsp), %rdi
callq 0xec840
jmp 0xf1613
movq 0x38(%rsp), %rax
movq (%rax), %rdi
leaq 0x58(%rsp), %rsi
callq 0xfa4a0
movq %rax, 0x10(%rsp)
jmp 0xf162c
movq 0x38(%rsp), %rax
movq 0x10(%rsp), %rcx
movq %rcx, 0x50(%rsp)
movq (%rax), %rdi
movq 0x50(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rsi
callq 0xfa4f0
movq %rax, 0x8(%rsp)
jmp 0xf1659
movq 0x8(%rsp), %rax
movq %rax, 0x40(%rsp)
movb $0x1, 0x127(%rsp)
movl $0x1, 0xd4(%rsp)
leaq 0x58(%rsp), %rdi
callq 0xec9f0
jmp 0xf16a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe8(%rsp)
movl %eax, 0xe4(%rsp)
leaq 0x58(%rsp), %rdi
callq 0xec9f0
jmp 0xf16b1
leaq 0xf8(%rsp), %rdi
callq 0xec9f0
jmp 0xf16c0
leaq 0xf8(%rsp), %rdi
callq 0xec9f0
jmp 0xf16d1
movb 0x127(%rsp), %al
andb $0x1, %al
addq $0x128, %rsp            # imm = 0x128
retq
movq 0xe8(%rsp), %rdi
callq 0x12c20
nop