// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x70(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x60(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x4b42
testq %rax, %rax
je 0x4d94
movq %rax, %r15
leaq 0x20(%rsp), %r8
movq $0x0, (%r8)
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x56f6
testl %eax, %eax
je 0x4dc2
movq %r15, %rdi
callq *0x43a7(%rip)           # 0x9120
movq 0x20(%rsp), %r14
testq %r14, %r14
je 0x4d9c
cmpb $0x1, 0x8(%r14)
jne 0x4d9c
movb $0x0, 0x8(%r14)
jmp 0x4eb1
xorl %r14d, %r14d
jmp 0x4eb1
leaq 0x60(%rsp), %rax
movl 0x4(%rax), %ecx
movq 0x10(%rbx), %rdi
movslq 0x18(%rbx), %rsi
leaq 0x14fe(%rip), %rdx      # 0x62b1
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x10f0
jmp 0x4eb1
movslq 0x28(%r14), %rbp
movq 0x30(%r14), %r13
leaq 0x8(,%rbp,8), %rdi
callq *0x4340(%rip)           # 0x9118
testq %rax, %rax
je 0x4e0b
movq %rax, %r12
movq $0x0, (%rax,%rbp,8)
testq %r13, %r13
je 0x4e0e
leaq (,%rbp,8), %rdx
movq %r12, %rdi
movq %r13, %rsi
callq 0x1190
movq %r13, %rdi
callq *0x4317(%rip)           # 0x9120
jmp 0x4e0e
xorl %r12d, %r12d
testq %r12, %r12
je 0x4e63
movq %r12, 0x30(%r14)
movl $0x38, %edi
callq *0x42f6(%rip)           # 0x9118
testq %rax, %rax
je 0x4e84
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq $0x0, 0x30(%rax)
movq %rax, (%r12,%rbp,8)
movq 0x30(%r14), %rax
movslq 0x28(%r14), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x28(%r14)
movq (%rax,%rcx,8), %rax
movq %rax, 0x20(%rsp)
movq %r15, (%rax)
movq 0x20(%rsp), %r14
jmp 0x4eb1
movq %r15, %rdi
callq *0x42b4(%rip)           # 0x9120
movq 0x10(%rbx), %rdi
movslq 0x18(%rbx), %rsi
leaq 0x133f(%rip), %rdx      # 0x61ba
leaq 0x1419(%rip), %rcx      # 0x629b
jmp 0x4ea7
movq %rax, (%r12,%rbp,8)
movq %r15, %rdi
callq *0x428f(%rip)           # 0x9120
movq 0x10(%rbx), %rdi
movslq 0x18(%rbx), %rsi
leaq 0x131a(%rip), %rdx      # 0x61ba
leaq 0x13ff(%rip), %rcx      # 0x62a6
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x10f0
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq