// File: /workspace/github_c_makefile_star2_O1/cktan[P]tomlc99/toml.c
// Function: toml_parse
toml_table_t *toml_parse(char *conf, char *errbuf, int errbufsz) {
  context_t ctx;

  // clear errbuf
  if (errbufsz <= 0)
    errbufsz = 0;
  if (errbufsz > 0)
    errbuf[0] = 0;

  // init context
  memset(&ctx, 0, sizeof(ctx));
  ctx.start = conf;
  ctx.stop = ctx.start + strlen(conf);
  ctx.errbuf = errbuf;
  ctx.errbufsz = errbufsz;

  // start with an artificial newline of length 0
  ctx.tok.tok = NEWLINE;
  ctx.tok.lineno = 1;
  ctx.tok.ptr = conf;
  ctx.tok.len = 0;

  // make a root table
  if (0 == (ctx.root = CALLOC(1, sizeof(*ctx.root)))) {
    e_outofmemory(&ctx, FLINE);
    // Do not goto fail, root table not set up yet
    return 0;
  }

  // set root as default table
  ctx.curtab = ctx.root;

  /* Scan forward until EOF */
  for (token_t tok = ctx.tok; !tok.eof; tok = ctx.tok) {
    switch (tok.tok) {

    case NEWLINE:
      if (next_token(&ctx, 1))
        goto fail;
      break;

    case STRING:
      if (parse_keyval(&ctx, ctx.curtab))
        goto fail;

      if (ctx.tok.tok != NEWLINE) {
        e_syntax(&ctx, ctx.tok.lineno, "extra chars after value");
        goto fail;
      }

      if (eat_token(&ctx, NEWLINE, 1, FLINE))
        goto fail;
      break;

    case LBRACKET: /* [ x.y.z ] or [[ x.y.z ]] */
      if (parse_select(&ctx))
        goto fail;
      break;

    default:
      e_syntax(&ctx, tok.lineno, "syntax error");
      goto fail;
    }
  }

  /* success */
  for (int i = 0; i < ctx.tpath.top; i++)
    xfree(ctx.tpath.key[i]);
  return ctx.root;

fail:
  // Something bad has happened. Free resources and return error.
  for (int i = 0; i < ctx.tpath.top; i++)
    xfree(ctx.tpath.key[i]);
  toml_free(ctx.root);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rsi, %r14
movq %rdi, %rbx
xorl %ebp, %ebp
testl %edx, %edx
cmovgl %edx, %ebp
jle 0x2184
movb $0x0, (%r14)
leaq 0x68(%rsp), %r15
movl $0x190, %edx            # imm = 0x190
movq %r15, %rdi
xorl %esi, %esi
callq 0x1110
movq %rbx, (%r15)
movq %rbx, %rdi
callq 0x10c0
addq %rbx, %rax
movq %rax, 0x8(%r15)
movq %r14, 0x10(%r15)
movl %ebp, 0x18(%r15)
movabsq $0x100000006, %rax      # imm = 0x100000006
movq %rax, 0x20(%r15)
movq %rbx, 0x28(%r15)
movl $0x0, 0x30(%r15)
movl $0x38, %edi
callq *0x6f41(%rip)           # 0x9118
testq %rax, %rax
je 0x21f2
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq $0x0, 0x30(%rax)
movq %rax, 0xa0(%rsp)
testq %rax, %rax
je 0x293a
movq %rax, 0xa8(%rsp)
cmpl $0x0, 0x9c(%rsp)
sete %r14b
jne 0x29ea
leaq 0x88(%rsp), %r12
movl (%r12), %eax
movl 0x4(%r12), %ecx
leaq 0x10c(%rsp), %r15
leaq 0x68(%rsp), %r13
cmpl $0x9, %eax
je 0x2277
cmpl $0x7, %eax
je 0x224f
cmpl $0x6, %eax
je 0x229d
jmp 0x2a36
cmpl $0x7, 0x88(%rsp)
jne 0x2b39
movq 0x90(%rsp), %rax
incq %rax
cmpq 0x70(%rsp), %rax
jae 0x22d7
cmpb $0x5b, (%rax)
sete %bl
jmp 0x22d9
movq 0xa8(%rsp), %rsi
movq %r13, %rdi
callq 0x319f
testl %eax, %eax
jne 0x29a4
cmpl $0x6, 0x88(%rsp)
jne 0x2a56
movq %r13, %rdi
movl $0x1, %esi
callq 0x2b77
testl %eax, %eax
jne 0x29a4
movl 0x88(%rsp), %eax
movl 0x8c(%rsp), %ecx
cmpl $0x0, 0x9c(%rsp)
sete %r14b
je 0x223b
jmp 0x29ea
xorl %ebx, %ebx
movq %r13, %rdi
movl $0x1, %esi
callq 0x2b77
testl %eax, %eax
jne 0x29a4
testb %bl, %bl
je 0x2315
cmpl $0x7, 0x88(%rsp)
jne 0x2b58
movq %r13, %rdi
movl $0x1, %esi
callq 0x2b77
testl %eax, %eax
jne 0x29a4
movl %ebx, 0x3c(%rsp)
movl 0x8c(%rsp), %ebp
cmpl $0x0, 0xb0(%rsp)
jle 0x235b
xorl %ebx, %ebx
movq 0xb8(%rsp,%rbx,8), %rdi
testq %rdi, %rdi
je 0x233f
callq *0x6de1(%rip)           # 0x9120
movq $0x0, 0xb8(%rsp,%rbx,8)
incq %rbx
movslq 0xb0(%rsp), %rax
cmpq %rax, %rbx
jl 0x232c
movl $0x0, 0xb0(%rsp)
cmpl $0xa, 0xb0(%rsp)
jge 0x2963
cmpl $0x9, 0x88(%rsp)
jne 0x2980
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movups (%r12), %xmm0
movups %xmm0, (%rsp)
movq %r13, %rdi
callq 0x4b42
testq %rax, %rax
je 0x2437
movslq 0xb0(%rsp), %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x10(%r12), %rdx
movq %rdx, 0x90(%r12,%rcx,8)
movups (%r12), %xmm0
movups %xmm0, 0x80(%r12,%rcx,8)
movslq 0xb0(%rsp), %rcx
movq %rax, 0xb8(%rsp,%rcx,8)
leal 0x1(%rcx), %eax
movl %eax, 0xb0(%rsp)
movl $0x1, %ebx
movq %r13, %rdi
movl $0x1, %esi
callq 0x2b77
testl %eax, %eax
jne 0x243c
movl 0x88(%rsp), %eax
cmpl $0x1, %eax
je 0x2446
movl $0x5, %ebx
cmpl $0x8, %eax
je 0x243c
movq 0x78(%rsp), %rdi
movslq 0x80(%rsp), %rsi
leaq 0x3e41(%rip), %rdx      # 0x6268
movl %ebp, %ecx
leaq 0x4076(%rip), %r8       # 0x64a6
xorl %eax, %eax
callq 0x10f0
movl $0x1, %ebx
testl %ebx, %ebx
je 0x2366
jmp 0x245c
movq %r13, %rdi
movl $0x1, %esi
callq 0x2b77
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
jmp 0x243c
cmpl $0x5, %ebx
jne 0x29a4
movslq 0xb0(%rsp), %rax
testq %rax, %rax
jle 0x2a7d
leaq (%rax,%rax,2), %rcx
movq 0x78(%r12,%rcx,8), %rdx
movq %rdx, 0x50(%rsp)
movups 0x68(%r12,%rcx,8), %xmm0
movaps %xmm0, 0x40(%rsp)
movq 0xb0(%rsp,%rax,8), %rdi
testq %rdi, %rdi
je 0x24a2
callq *0x6c7e(%rip)           # 0x9120
movb %r14b, 0x27(%rsp)
movl 0xb0(%rsp), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0xb0(%rsp)
movq 0xa0(%rsp), %r14
cmpl $0x2, %eax
setge %al
jl 0x2770
movb $0x1, 0x26(%rsp)
movq %r15, %rbp
xorl %ebx, %ebx
movq 0xb8(%rsp,%rbx,8), %r13
xorl %eax, %eax
movq %rax, 0x200(%rsp)
movq %rax, 0x60(%rsp)
movq %rax, 0x30(%rsp)
movq %r14, %rdi
movq %r13, %rsi
leaq 0x200(%rsp), %rdx
leaq 0x60(%rsp), %rcx
leaq 0x30(%rsp), %r8
callq 0x56f6
cmpl $0x76, %eax
je 0x255a
cmpl $0x74, %eax
je 0x269f
cmpl $0x61, %eax
jne 0x2585
movq 0x60(%rsp), %rax
cmpl $0x74, 0x8(%rax)
leaq 0x68(%rsp), %r13
jne 0x25e8
movslq 0x10(%rax), %rcx
testq %rcx, %rcx
je 0x26f1
movq 0x18(%rax), %rax
shlq $0x5, %rcx
movq -0x8(%rax,%rcx), %rax
movq %rax, 0x30(%rsp)
jmp 0x269f
movq %r14, 0x28(%rsp)
movl (%rbp), %ecx
movq 0x78(%rsp), %rdi
movslq 0x80(%rsp), %rsi
xorl %r14d, %r14d
leaq 0x3d38(%rip), %rdx      # 0x62b1
xorl %eax, %eax
callq 0x10f0
jmp 0x2742
movslq 0x28(%r14), %r15
movq %r14, 0x28(%rsp)
movq 0x30(%r14), %rax
movq %rax, 0x58(%rsp)
leaq 0x8(,%r15,8), %rdi
callq *0x6b73(%rip)           # 0x9118
testq %rax, %rax
movq %r15, 0x1f8(%rsp)
je 0x2610
movq %rax, %r14
movq $0x0, (%rax,%r15,8)
cmpq $0x0, 0x58(%rsp)
je 0x2613
leaq (,%r15,8), %rdx
movq %r14, %rdi
movq 0x58(%rsp), %r15
movq %r15, %rsi
callq 0x1190
movq %r15, %rdi
callq *0x6b3a(%rip)           # 0x9120
jmp 0x2613
movq %r14, 0x28(%rsp)
movq 0x78(%rsp), %rdi
movslq 0x80(%rsp), %rsi
xorl %r14d, %r14d
leaq 0x3daa(%rip), %rdx      # 0x63ae
leaq 0x3ebc(%rip), %rcx      # 0x64c7
jmp 0x2714
xorl %r14d, %r14d
leaq 0x10c(%rsp), %r15
testq %r14, %r14
je 0x26b1
movq 0x28(%rsp), %rax
movq %r14, 0x30(%rax)
movl $0x38, %edi
callq *0x6ae0(%rip)           # 0x9118
testq %rax, %rax
je 0x2653
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq $0x0, 0x30(%rax)
movq 0x1f8(%rsp), %rcx
movq %rax, (%r14,%rcx,8)
testq %rax, %rax
je 0x26d1
movq %r13, %rdi
movq %rcx, %r13
callq 0x5922
movq (%r14,%r13,8), %rcx
movq %rax, (%rcx)
testq %rax, %rax
je 0x271d
movq 0x28(%rsp), %rsi
movq 0x30(%rsi), %rax
movslq 0x28(%rsi), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x28(%rsi)
movq (%rax,%rcx,8), %rax
movq %rax, 0x30(%rsp)
movb $0x1, 0x8(%rax)
movb $0x1, %r14b
movq 0x30(%rsp), %rax
movq %rax, 0x28(%rsp)
jmp 0x2742
movq 0x78(%rsp), %rdi
movslq 0x80(%rsp), %rsi
xorl %r14d, %r14d
leaq 0x3af2(%rip), %rdx      # 0x61ba
leaq 0x3e10(%rip), %rcx      # 0x64df
jmp 0x273b
movq 0x78(%rsp), %rdi
movslq 0x80(%rsp), %rsi
xorl %r14d, %r14d
leaq 0x3ad2(%rip), %rdx      # 0x61ba
leaq 0x3dfc(%rip), %rcx      # 0x64eb
jmp 0x273b
movq %r14, 0x28(%rsp)
movq 0x78(%rsp), %rdi
movslq 0x80(%rsp), %rsi
xorl %r14d, %r14d
leaq 0x3ca1(%rip), %rdx      # 0x63ae
leaq 0x3dbf(%rip), %rcx      # 0x64d3
xorl %eax, %eax
callq 0x10f0
jmp 0x2747
movq 0x78(%rsp), %rdi
movslq 0x80(%rsp), %rsi
xorl %r14d, %r14d
leaq 0x3a86(%rip), %rdx      # 0x61ba
leaq 0x3dbc(%rip), %rcx      # 0x64f7
xorl %eax, %eax
callq 0x10f0
leaq 0x68(%rsp), %r13
testb %r14b, %r14b
je 0x2776
incq %rbx
movslq 0xb0(%rsp), %rax
addq $0x18, %rbp
cmpq %rax, %rbx
setl 0x26(%rsp)
movq 0x28(%rsp), %r14
jl 0x24d6
jmp 0x277b
movb %al, 0x26(%rsp)
jmp 0x277b
movq 0x28(%rsp), %r14
testb $0x1, 0x26(%rsp)
movl 0x3c(%rsp), %ebx
jne 0x2b0b
movq %r14, 0xa8(%rsp)
testb %bl, %bl
je 0x27d7
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x40(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r13, %rdi
callq 0x4b42
movq %rax, %r13
testq %rax, %rax
je 0x2806
movq 0xa8(%rsp), %rdi
movq %r13, %rsi
callq 0x390e
movq %rax, %r14
movq %r13, %rdi
callq *0x694b(%rip)           # 0x9120
jmp 0x2809
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x40(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r13, %rdi
movq %r14, %rsi
callq 0x4d1d
movq %rax, %r14
testq %rax, %rax
jne 0x288a
jmp 0x2b0b
xorl %r14d, %r14d
testq %r13, %r13
leaq 0x68(%rsp), %r13
je 0x2b0b
testq %r14, %r14
jne 0x2850
movq 0xa8(%rsp), %rsi
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x40(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r13, %rdi
movl $0x74, %edx
callq 0x5029
movq %rax, %r14
testq %rax, %rax
je 0x2b0b
cmpl $0x74, 0x8(%r14)
jne 0x2ae5
movq %r13, %rdi
movq %r14, %rsi
callq 0x580a
testq %rax, %rax
je 0x2b0b
movq %rax, %r14
leaq 0x3b8f(%rip), %rdi      # 0x6408
callq 0x5922
movq %rax, (%r14)
testq %rax, %rax
je 0x2b15
movq %r14, 0xa8(%rsp)
cmpl $0x8, 0x88(%rsp)
jne 0x2a9d
testb %bl, %bl
je 0x28e4
movq 0x90(%rsp), %rax
incq %rax
cmpq 0x70(%rsp), %rax
jae 0x2ac1
cmpb $0x5d, (%rax)
jne 0x2ac1
movq %r13, %rdi
movl $0x8, %esi
movl $0x1, %edx
leaq 0x3b5b(%rip), %rcx      # 0x6432
callq 0x34b1
testl %eax, %eax
jne 0x2b0b
movq %r13, %rdi
movl $0x8, %esi
movl $0x1, %edx
leaq 0x3b46(%rip), %rcx      # 0x643e
callq 0x34b1
testl %eax, %eax
jne 0x2b0b
cmpl $0x6, 0x88(%rsp)
je 0x22b2
movl 0x8c(%rsp), %ecx
movq 0x78(%rsp), %rdi
movslq 0x80(%rsp), %rsi
leaq 0x393a(%rip), %rdx      # 0x6268
leaq 0x3b15(%rip), %r8       # 0x644a
jmp 0x2b04
movq 0x78(%rsp), %rdi
movslq 0x80(%rsp), %rsi
leaq 0x386c(%rip), %rdx      # 0x61ba
leaq 0x380f(%rip), %rcx      # 0x6164
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x10f0
jmp 0x2a21
movq 0x78(%rsp), %rdi
movslq 0x80(%rsp), %rsi
leaq 0x38f1(%rip), %rdx      # 0x6268
leaq 0x3ae6(%rip), %r8       # 0x6464
jmp 0x299b
movq 0x78(%rsp), %rdi
movslq 0x80(%rsp), %rsi
leaq 0x38d4(%rip), %rdx      # 0x6268
leaq 0x3af4(%rip), %r8       # 0x648f
movl %ebp, %ecx
xorl %eax, %eax
callq 0x10f0
testb $0x1, %r14b
je 0x29ea
cmpl $0x0, 0xb0(%rsp)
jle 0x29d9
xorl %ebx, %ebx
movq 0xb8(%rsp,%rbx,8), %rdi
testq %rdi, %rdi
je 0x29c9
callq *0x6757(%rip)           # 0x9120
incq %rbx
movslq 0xb0(%rsp), %rax
cmpq %rax, %rbx
jl 0x29b6
movq 0xa0(%rsp), %rdi
callq 0x36ef
xorl %ebx, %ebx
jmp 0x2a21
cmpl $0x0, 0xb0(%rsp)
jle 0x2a19
xorl %ebx, %ebx
movq 0xb8(%rsp,%rbx,8), %rdi
testq %rdi, %rdi
je 0x2a09
callq *0x6717(%rip)           # 0x9120
incq %rbx
movslq 0xb0(%rsp), %rax
cmpq %rax, %rbx
jl 0x29f6
movq 0xa0(%rsp), %rbx
movq %rbx, %rax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x78(%rsp), %rdi
movslq 0x80(%rsp), %rsi
leaq 0x381e(%rip), %rdx      # 0x6268
leaq 0x3737(%rip), %r8       # 0x6188
jmp 0x299d
movl 0x8c(%rsp), %ecx
movq 0x78(%rsp), %rdi
movslq 0x80(%rsp), %rsi
leaq 0x37f7(%rip), %rdx      # 0x6268
leaq 0x36f8(%rip), %r8       # 0x6170
jmp 0x299d
movq 0x78(%rsp), %rdi
movslq 0x80(%rsp), %rsi
leaq 0x37d7(%rip), %rdx      # 0x6268
leaq 0x3a1a(%rip), %r8       # 0x64b2
jmp 0x299b
movl 0x8c(%rsp), %ecx
movq 0x78(%rsp), %rdi
movslq 0x80(%rsp), %rsi
leaq 0x37b0(%rip), %rdx      # 0x6268
leaq 0x395e(%rip), %r8       # 0x641d
jmp 0x2b04
movl 0x8c(%rsp), %ecx
movq 0x78(%rsp), %rdi
movslq 0x80(%rsp), %rsi
leaq 0x378c(%rip), %rdx      # 0x6268
leaq 0x3944(%rip), %r8       # 0x6427
jmp 0x2b04
movl 0x44(%rsp), %ecx
movq 0x78(%rsp), %rdi
movslq 0x80(%rsp), %rsi
leaq 0x376b(%rip), %rdx      # 0x6268
leaq 0x38f5(%rip), %r8       # 0x63f9
xorl %eax, %eax
callq 0x10f0
movb 0x27(%rsp), %r14b
jmp 0x29a4
movq 0x78(%rsp), %rdi
movslq 0x80(%rsp), %rsi
leaq 0x3691(%rip), %rdx      # 0x61ba
leaq 0x38e1(%rip), %rcx      # 0x6411
xorl %eax, %eax
callq 0x10f0
jmp 0x2b0b
leaq 0x3882(%rip), %rdi      # 0x63c2
leaq 0x36e0(%rip), %rsi      # 0x6227
leaq 0x388d(%rip), %rcx      # 0x63db
movl $0x521, %edx            # imm = 0x521
callq 0x1100
leaq 0x3863(%rip), %rdi      # 0x63c2
leaq 0x36c1(%rip), %rsi      # 0x6227
leaq 0x386e(%rip), %rcx      # 0x63db
movl $0x52c, %edx            # imm = 0x52C
callq 0x1100