// File: tomfunkhouser[P]gaps/pkgs/RNBasics/json.cpp
// Function: Json::Path::makePath(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<Json::PathArgument const*, std::allocator<Json::PathArgument const*>> const&)
void Path::makePath(const std::string& path, const InArgs& in) {
  const char* current = path.c_str();
  const char* end = current + path.length();
  InArgs::const_iterator itInArg = in.begin();
  while (current != end) {
    if (*current == '[') {
      ++current;
      if (*current == '%')
        addPathInArg(path, in, itInArg, PathArgument::kindIndex);
      else {
        ArrayIndex index = 0;
        for (; current != end && *current >= '0' && *current <= '9'; ++current)
          index = index * 10 + ArrayIndex(*current - '0');
        args_.push_back(index);
      }
      if (current == end || *current++ != ']')
        invalidPath(path, int(current - path.c_str()));
    } else if (*current == '%') {
      addPathInArg(path, in, itInArg, PathArgument::kindKey);
      ++current;
    } else if (*current == '.') {
      ++current;
    } else {
      const char* beginName = current;
      while (current != end && !strchr("[.", *current))
        ++current;
      args_.push_back(std::string(beginName, current));
    }
  }
}

// Assembly:
subq $0x128, %rsp            # imm = 0x128
movq %rdi, 0x120(%rsp)
movq %rsi, 0x118(%rsp)
movq %rdx, 0x110(%rsp)
movq 0x120(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x118(%rsp), %rdi
callq 0x12280
movq %rax, 0x108(%rsp)
movq 0x108(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x118(%rsp), %rdi
callq 0x12a90
movq %rax, %rcx
movq 0x58(%rsp), %rax
addq %rcx, %rax
movq %rax, 0x100(%rsp)
movq 0x110(%rsp), %rdi
callq 0xfa960
movq %rax, 0xf8(%rsp)
movq 0x108(%rsp), %rax
cmpq 0x100(%rsp), %rax
je 0xf25b1
movq 0x108(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x5b, %eax
jne 0xf23c6
movq 0x108(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x108(%rsp)
movq 0x108(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
jne 0xf225e
movq 0x50(%rsp), %rdi
movq 0x118(%rsp), %rsi
movq 0x110(%rsp), %rdx
leaq 0xf8(%rsp), %rcx
movl $0x1, %r8d
callq 0xf25d0
jmp 0xf234d
movl $0x0, 0xf4(%rsp)
movq 0x108(%rsp), %rcx
xorl %eax, %eax
cmpq 0x100(%rsp), %rcx
movb %al, 0x4f(%rsp)
je 0xf22ac
movq 0x108(%rsp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x30, %ecx
movb %al, 0x4f(%rsp)
jl 0xf22ac
movq 0x108(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x39, %eax
setle %al
movb %al, 0x4f(%rsp)
movb 0x4f(%rsp), %al
testb $0x1, %al
jne 0xf22b6
jmp 0xf22ee
imull $0xa, 0xf4(%rsp), %eax
movq 0x108(%rsp), %rcx
movsbl (%rcx), %ecx
subl $0x30, %ecx
addl %ecx, %eax
movl %eax, 0xf4(%rsp)
movq 0x108(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x108(%rsp)
jmp 0xf2269
movl 0xf4(%rsp), %esi
leaq 0xc8(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0xf1eb0
movq 0x50(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0xfa990
jmp 0xf2318
leaq 0xc8(%rsp), %rdi
callq 0xfa9c0
jmp 0xf234d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0xfa9c0
jmp 0xf25b9
movq 0x108(%rsp), %rax
cmpq 0x100(%rsp), %rax
je 0xf237e
movq 0x108(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x108(%rsp)
movsbl (%rax), %eax
cmpl $0x5d, %eax
je 0xf23c1
movq 0x118(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x108(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x118(%rsp), %rdi
callq 0x12280
movq 0x50(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq %rax, %rcx
movq 0x38(%rsp), %rax
subq %rcx, %rax
movl %eax, %edx
callq 0xf2660
jmp 0xf25ac
movq 0x108(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
jne 0xf2417
movq 0x50(%rsp), %rdi
movq 0x118(%rsp), %rsi
movq 0x110(%rsp), %rdx
leaq 0xf8(%rsp), %rcx
movl $0x2, %r8d
callq 0xf25d0
movq 0x108(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x108(%rsp)
jmp 0xf25aa
movq 0x108(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0xf2440
movq 0x108(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x108(%rsp)
jmp 0xf25a8
movq 0x108(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0x108(%rsp), %rcx
xorl %eax, %eax
cmpq 0x100(%rsp), %rcx
movb %al, 0x2f(%rsp)
je 0xf248c
movq 0x108(%rsp), %rax
movsbl (%rax), %esi
leaq 0x78745(%rip), %rdi     # 0x16abbf
callq 0x12240
cmpq $0x0, %rax
setne %al
xorb $-0x1, %al
movb %al, 0x2f(%rsp)
movb 0x2f(%rsp), %al
testb $0x1, %al
jne 0xf2496
jmp 0xf24ac
movq 0x108(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x108(%rsp)
jmp 0xf2450
movq 0x50(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x108(%rsp), %rax
movq %rax, 0x18(%rsp)
leaq 0x67(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x12c30
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rcx
leaq 0x68(%rsp), %rdi
callq 0xf9320
jmp 0xf24fa
leaq 0x88(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0xf1f80
jmp 0xf250e
movq 0x8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0xfa990
jmp 0xf2522
leaq 0x88(%rsp), %rdi
callq 0xfa9c0
leaq 0x68(%rsp), %rdi
callq 0x12430
leaq 0x67(%rsp), %rdi
callq 0x12760
jmp 0xf25a8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
jmp 0xf259c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
jmp 0xf2592
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
leaq 0x88(%rsp), %rdi
callq 0xfa9c0
leaq 0x68(%rsp), %rdi
callq 0x12430
leaq 0x67(%rsp), %rdi
callq 0x12760
jmp 0xf25b9
jmp 0xf25aa
jmp 0xf25ac
jmp 0xf21e3
addq $0x128, %rsp            # imm = 0x128
retq
movq 0xc0(%rsp), %rdi
callq 0x12c20
nopw %cs:(%rax,%rax)