// File: /workspace/github_c_makefile_star2_O2/cktan[P]tomlc99/toml_cat.c
// Function: print_table
static void print_table(toml_table_t *curtab) {
  toml_datum_t d;
  int i;
  const char *key;
  toml_array_t *arr;
  toml_table_t *tab;

  for (i = 0; 0 != (key = toml_key_in(curtab, i)); i++) {

    if (0 != (arr = toml_array_in(curtab, key))) {
      prindent();
      printf("%s = [\n", key);
      indent++;
      print_array(arr);
      indent--;
      prindent();
      printf("],\n");
      continue;
    }

    if (0 != (tab = toml_table_in(curtab, key))) {
      stack[stacktop].key = key;
      stack[stacktop].tab = tab;
      stacktop++;
      prindent();
      printf("%s = {\n", key);
      indent++;
      print_table(tab);
      indent--;
      prindent();
      printf("},\n");
      stacktop--;
      continue;
    }

    d = toml_string_in(curtab, key);
    if (d.ok) {
      prindent();
      printf("%s = ", key);
      print_string(d.u.s);
      printf(",\n");
      free(d.u.s);
      continue;
    }

    d = toml_bool_in(curtab, key);
    if (d.ok) {
      prindent();
      printf("%s = %s,\n", key, d.u.b ? "true" : "false");
      continue;
    }

    d = toml_int_in(curtab, key);
    if (d.ok) {
      prindent();
      printf("%s = %" PRId64 ",\n", key, d.u.i);
      continue;
    }

    d = toml_double_in(curtab, key);
    if (d.ok) {
      prindent();
      printf("%s = %f,\n", key, d.u.d);
      continue;
    }

    d = toml_timestamp_in(curtab, key);
    if (d.ok) {
      prindent();
      printf("%s = ", key);
      print_timestamp(d);
      printf(",\n");
      free(d.u.ts);
      continue;
    }

    fflush(stdout);
    fprintf(stderr, "ERROR: unable to decode value in table\n");
    exit(1);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x3be8(%rip), %rbp      # 0x5042
leaq 0x3cc5(%rip), %r14      # 0x5126
xorl %r15d, %r15d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x30c6
testq %rax, %rax
je 0x1659
movq %rax, %r12
movq %rbx, %rdi
movq %rax, %rsi
callq 0x31fd
testq %rax, %rax
je 0x14c6
movq %rax, %r13
callq 0x1a83
movq %rbp, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x10d0
incl 0x6c8e(%rip)            # 0x8134
movq %r13, %rdi
callq 0x169b
decl 0x6c80(%rip)            # 0x8134
callq 0x1a83
movq %r14, %rdi
callq 0x1060
jmp 0x15ec
movq %rbx, %rdi
movq %r12, %rsi
callq 0x324b
testq %rax, %rax
je 0x1543
movq %rax, %r13
movslq 0x6c50(%rip), %rax      # 0x8130
leal 0x1(%rax), %ecx
shlq $0x4, %rax
leaq 0x6c52(%rip), %rdx      # 0x8140
movq %r12, (%rax,%rdx)
movq %r13, 0x8(%rax,%rdx)
movl %ecx, 0x6c33(%rip)      # 0x8130
callq 0x1a83
leaq 0x3b41(%rip), %rdi      # 0x504a
movq %r12, %rsi
xorl %eax, %eax
callq 0x10d0
incl 0x6c1b(%rip)            # 0x8134
movq %r13, %rdi
callq 0x1445
decl 0x6c0d(%rip)            # 0x8134
callq 0x1a83
leaq 0x3bee(%rip), %rdi      # 0x5121
callq 0x1060
decl 0x6bf2(%rip)            # 0x8130
jmp 0x15ec
movq %rbx, %rdi
movq %r12, %rsi
callq 0x405c
testl %eax, %eax
je 0x1589
movq %rdx, %r13
callq 0x1a83
leaq 0x3af1(%rip), %rdi      # 0x5052
movq %r12, %rsi
xorl %eax, %eax
callq 0x10d0
movq %r13, %rdi
callq 0x188d
leaq 0x3bad(%rip), %rdi      # 0x5127
callq 0x1060
movq %r13, %rdi
callq 0x1030
jmp 0x15ec
movq %rbx, %rdi
movq %r12, %rsi
callq 0x409a
testl %eax, %eax
je 0x15c1
movq %rdx, %r13
callq 0x1a83
testl %r13d, %r13d
leaq 0x3ab8(%rip), %rdx      # 0x5062
leaq 0x3ab6(%rip), %rax      # 0x5067
cmoveq %rax, %rdx
leaq 0x3a9c(%rip), %rdi      # 0x5058
movq %r12, %rsi
jmp 0x15e5
movq %rbx, %rdi
movq %r12, %rsi
callq 0x40cd
testl %eax, %eax
je 0x15f4
movq %rdx, %r13
callq 0x1a83
leaq 0x3a8e(%rip), %rdi      # 0x506d
movq %r12, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x10d0
incl %r15d
jmp 0x1464
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4100
testl %eax, %eax
je 0x1624
movq %rdx, (%rsp)
callq 0x1a83
leaq 0x3a65(%rip), %rdi      # 0x5078
movq %r12, %rsi
movsd (%rsp), %xmm0
movb $0x1, %al
callq 0x10d0
jmp 0x15ec
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4133
testl %eax, %eax
je 0x1668
movq %rdx, %r13
callq 0x1a83
leaq 0x3a10(%rip), %rdi      # 0x5052
movq %r12, %rsi
xorl %eax, %eax
callq 0x10d0
movq %r13, %rdi
callq 0x19eb
jmp 0x1573
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x6961(%rip), %rax      # 0x7fd0
movq (%rax), %rdi
callq 0x1190
movq 0x697a(%rip), %rax      # 0x7ff8
movq (%rax), %rcx
leaq 0x39fa(%rip), %rdi      # 0x5082
pushq $0x27
popq %rsi
pushq $0x1
popq %rdx
callq 0x11c0
pushq $0x1
popq %rdi
callq 0x11b0