// File: /workspace/github_c_makefile_star2_O0/cktan[P]tomlc99/toml.c
// Function: create_keytable_in_table
static toml_table_t *create_keytable_in_table(context_t *ctx, toml_table_t *tab,
                                              token_t keytok) {
  /* first, normalize the key to be used for lookup.
   * remember to free it if we error out.
   */
  char *newkey = normalize_key(ctx, keytok);
  if (!newkey)
    return 0;

  /* if key exists: error out */
  toml_table_t *dest = 0;
  if (check_key(tab, newkey, 0, 0, &dest)) {
    xfree(newkey); /* don't need this anymore */

    /* special case: if table exists, but was created implicitly ... */
    if (dest && dest->implicit) {
      /* we make it explicit now, and simply return it. */
      dest->implicit = false;
      return dest;
    }
    e_keyexists(ctx, keytok.lineno);
    return 0;
  }

  /* create a new table entry */
  int n = tab->ntab;
  toml_table_t **base;
  if (0 == (base = (toml_table_t **)expand_ptrarr((void **)tab->tab, n))) {
    xfree(newkey);
    e_outofmemory(ctx, FLINE);
    return 0;
  }
  tab->tab = base;

  if (0 == (base[n] = (toml_table_t *)CALLOC(1, sizeof(*base[n])))) {
    xfree(newkey);
    e_outofmemory(ctx, FLINE);
    return 0;
  }
  dest = tab->tab[tab->ntab++];

  /* save the key in the new table struct */
  dest->key = newkey;
  return dest;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
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, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x5c72
movq $0x0, -0x8(%rbp)
jmp 0x5dba
movq $0x0, -0x28(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
xorl %eax, %eax
movl %eax, %ecx
leaq -0x28(%rbp), %r8
movq %rcx, %rdx
callq 0x6620
cmpl $0x0, %eax
je 0x5ce3
movq -0x20(%rbp), %rdi
callq 0x3500
cmpq $0x0, -0x28(%rbp)
je 0x5cc6
movq -0x28(%rbp), %rax
testb $0x1, 0x8(%rax)
je 0x5cc6
movq -0x28(%rbp), %rax
movb $0x0, 0x8(%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x5dba
movq -0x40(%rbp), %rax
movq -0x10(%rbp), %rdi
movl 0x4(%rax), %esi
callq 0x67d0
movq $0x0, -0x8(%rbp)
jmp 0x5dba
movq -0x18(%rbp), %rax
movl 0x28(%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdi
movl -0x2c(%rbp), %esi
callq 0x6810
movq %rax, %rcx
movq %rcx, -0x38(%rbp)
xorl %eax, %eax
cmpq %rcx, %rax
jne 0x5d31
movq -0x20(%rbp), %rdi
callq 0x3500
movq -0x10(%rbp), %rdi
leaq 0x2684(%rip), %rsi      # 0x83a3
callq 0x2910
movq $0x0, -0x8(%rbp)
jmp 0x5dba
movq -0x38(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movl $0x1, %edi
movl $0x38, %esi
callq 0x28b0
movq %rax, %rcx
movq -0x38(%rbp), %rax
movslq -0x2c(%rbp), %rdx
movq %rcx, (%rax,%rdx,8)
xorl %eax, %eax
cmpq %rcx, %rax
jne 0x5d85
movq -0x20(%rbp), %rdi
callq 0x3500
movq -0x10(%rbp), %rdi
leaq 0x2638(%rip), %rsi      # 0x83ae
callq 0x2910
movq $0x0, -0x8(%rbp)
jmp 0x5dba
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x18(%rbp), %rdx
movl 0x28(%rdx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x28(%rdx)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)