// File: /workspace/github_c_makefile_star2_O3/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 0x487c
testq %rax, %rax
je 0x4ace
movq %rax, %r15
leaq 0x20(%rsp), %r8
movq $0x0, (%r8)
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x53fd
testl %eax, %eax
je 0x4afc
movq %r15, %rdi
callq *0x4665(%rip)           # 0x9118
movq 0x20(%rsp), %r14
testq %r14, %r14
je 0x4ad6
cmpb $0x1, 0x8(%r14)
jne 0x4ad6
movb $0x0, 0x8(%r14)
jmp 0x4be5
xorl %r14d, %r14d
jmp 0x4be5
leaq 0x60(%rsp), %rax
movl 0x4(%rax), %ecx
movq 0x10(%rbx), %rdi
movslq 0x18(%rbx), %rsi
leaq 0x17e8(%rip), %rdx      # 0x62d5
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x10e0
jmp 0x4be5
movslq 0x28(%r14), %rbp
movq 0x30(%r14), %r13
leaq 0x8(,%rbp,8), %rdi
callq *0x45fe(%rip)           # 0x9110
testq %rax, %rax
je 0x4b93
movq %rax, %r12
movq $0x0, (%rax,%rbp,8)
testq %r13, %r13
je 0x4b43
leaq (,%rbp,8), %rdx
movq %r12, %rdi
movq %r13, %rsi
callq 0x1180
movq %r13, %rdi
callq *0x45d5(%rip)           # 0x9118
movq %r12, 0x30(%r14)
movl $0x38, %edi
callq *0x45be(%rip)           # 0x9110
testq %rax, %rax
je 0x4bb4
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 0x4be5
movq %r15, %rdi
callq *0x457c(%rip)           # 0x9118
movq 0x10(%rbx), %rdi
movslq 0x18(%rbx), %rsi
leaq 0x1633(%rip), %rdx      # 0x61de
leaq 0x170d(%rip), %rcx      # 0x62bf
jmp 0x4bdb
movq $0x0, (%r12,%rbp,8)
movq %r15, %rdi
callq *0x4553(%rip)           # 0x9118
movq 0x10(%rbx), %rdi
movslq 0x18(%rbx), %rsi
leaq 0x160a(%rip), %rdx      # 0x61de
leaq 0x16ef(%rip), %rcx      # 0x62ca
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x10e0
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq