// File: /workspace/github_c_makefile_star2_O0/cktan[P]tomlc99/toml.c
// Function: fill_tabpath
static int fill_tabpath(context_t *ctx) {
  int lineno = ctx->tok.lineno;
  int i;

  /* clear tpath */
  for (i = 0; i < ctx->tpath.top; i++) {
    char **p = &ctx->tpath.key[i];
    xfree(*p);
    *p = 0;
  }
  ctx->tpath.top = 0;

  for (;;) {
    if (ctx->tpath.top >= 10)
      return e_syntax(ctx, lineno,
                      "table path is too deep; max allowed is 10.");

    if (ctx->tok.tok != STRING)
      return e_syntax(ctx, lineno, "invalid or missing key");

    char *key = normalize_key(ctx, ctx->tok);
    if (!key)
      return -1;
    ctx->tpath.tok[ctx->tpath.top] = ctx->tok;
    ctx->tpath.key[ctx->tpath.top] = key;
    ctx->tpath.top++;

    if (next_token(ctx, 1))
      return -1;

    if (ctx->tok.tok == RBRACKET)
      break;

    if (ctx->tok.tok != DOT)
      return e_syntax(ctx, lineno, "invalid key");

    if (next_token(ctx, 1))
      return -1;
  }

  if (ctx->tpath.top <= 0)
    return e_syntax(ctx, lineno, "empty table selector");

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x24(%rax), %eax
movl %eax, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x48(%rcx), %eax
jge 0x6d76
movq -0x10(%rbp), %rax
addq $0x48, %rax
addq $0x8, %rax
movslq -0x18(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x3500
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x6d2d
movq -0x10(%rbp), %rax
movl $0x0, 0x48(%rax)
movq -0x10(%rbp), %rax
cmpl $0xa, 0x48(%rax)
jl 0x6da6
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq 0x1802(%rip), %rdx      # 0x859b
callq 0x3010
movl %eax, -0x4(%rbp)
jmp 0x6ef8
movq -0x10(%rbp), %rax
cmpl $0x9, 0x20(%rax)
je 0x6dcb
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq 0x1808(%rip), %rdx      # 0x85c6
callq 0x3010
movl %eax, -0x4(%rbp)
jmp 0x6ef8
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
addq $0x20, %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x59c0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x6e0c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x6ef8
movq -0x10(%rbp), %rax
addq $0x48, %rax
addq $0x58, %rax
movq -0x10(%rbp), %rcx
movslq 0x48(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
movq 0x20(%rcx), %rdx
movq %rdx, (%rax)
movq 0x28(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x30(%rcx), %rcx
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rdx
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x48(%rcx), %rcx
movq %rdx, 0x50(%rax,%rcx,8)
movq -0x10(%rbp), %rax
movl 0x48(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x48(%rax)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x2950
cmpl $0x0, %eax
je 0x6e80
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x6ef8
movq -0x10(%rbp), %rax
cmpl $0x8, 0x20(%rax)
jne 0x6e8c
jmp 0x6ecf
movq -0x10(%rbp), %rax
cmpl $0x1, 0x20(%rax)
je 0x6eae
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq 0x1739(%rip), %rdx      # 0x85dd
callq 0x3010
movl %eax, -0x4(%rbp)
jmp 0x6ef8
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x2950
cmpl $0x0, %eax
je 0x6eca
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x6ef8
jmp 0x6d81
movq -0x10(%rbp), %rax
cmpl $0x0, 0x48(%rax)
jg 0x6ef1
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq 0x1702(%rip), %rdx      # 0x85e9
callq 0x3010
movl %eax, -0x4(%rbp)
jmp 0x6ef8
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)