// File: /workspace/github_c_makefile_star2_O3/cktan[P]tomlc99/toml.c
// Function: next_token
static int next_token(context_t *ctx, int dotisspecial) {
  int lineno = ctx->tok.lineno;
  char *p = ctx->tok.ptr;
  int i;

  /* eat this tok */
  for (i = 0; i < ctx->tok.len; i++) {
    if (*p++ == '\n')
      lineno++;
  }

  /* make next tok */
  while (p < ctx->stop) {
    /* skip comment. stop just before the \n. */
    if (*p == '#') {
      for (p++; p < ctx->stop && *p != '\n'; p++)
        ;
      continue;
    }

    if (dotisspecial && *p == '.') {
      set_token(ctx, DOT, lineno, p, 1);
      return 0;
    }

    switch (*p) {
    case ',':
      set_token(ctx, COMMA, lineno, p, 1);
      return 0;
    case '=':
      set_token(ctx, EQUAL, lineno, p, 1);
      return 0;
    case '{':
      set_token(ctx, LBRACE, lineno, p, 1);
      return 0;
    case '}':
      set_token(ctx, RBRACE, lineno, p, 1);
      return 0;
    case '[':
      set_token(ctx, LBRACKET, lineno, p, 1);
      return 0;
    case ']':
      set_token(ctx, RBRACKET, lineno, p, 1);
      return 0;
    case '\n':
      set_token(ctx, NEWLINE, lineno, p, 1);
      return 0;
    case '\r':
    case ' ':
    case '\t':
      /* ignore white spaces */
      p++;
      continue;
    }

    return scan_string(ctx, p, lineno, dotisspecial);
  }

  set_eof(ctx, lineno);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %r14
movl 0x24(%rdi), %ebx
movq 0x28(%rdi), %r15
movslq 0x30(%rdi), %rax
testq %rax, %rax
jle 0x29c0
xorl %ecx, %ecx
xorl %edx, %edx
cmpb $0xa, (%r15,%rcx)
sete %dl
addl %edx, %ebx
incq %rcx
cmpl %ecx, %eax
jne 0x29aa
addq %rax, %r15
movq 0x8(%r14), %rax
cmpq %rax, %r15
jae 0x2a27
movzbl (%r15), %r13d
cmpl $0x23, %r13d
jne 0x29ed
incq %r15
movq %r15, %rcx
movq %rcx, %r15
cmpq %rax, %rcx
jae 0x29c4
leaq 0x1(%r15), %rcx
cmpb $0xa, (%r15)
jne 0x29d9
jmp 0x29c4
testl %ebp, %ebp
je 0x29fb
cmpb $0x2e, %r13b
je 0x2ae0
cmpl $0x1f, %r13d
jg 0x2a12
cmpl $0x9, %r13d
je 0x2a22
cmpl $0xd, %r13d
je 0x2a22
jmp 0x2b2f
cmpl $0x21, %r13d
jg 0x2a4a
cmpl $0x20, %r13d
jne 0x2c04
incq %r15
jmp 0x29c4
movl $0x6, 0x20(%r14)
movl %ebx, 0x24(%r14)
movq %rax, 0x28(%r14)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x30(%r14)
jmp 0x2bf3
cmpl $0x5a, %r13d
jg 0x2ab9
cmpl $0x2b, %r13d
jg 0x2aed
cmpl $0x22, %r13d
je 0x2b46
cmpl $0x27, %r13d
jne 0x2c04
cmpb $0x27, 0x1(%r15)
jne 0x2c8a
cmpb $0x27, 0x2(%r15)
jne 0x2c8a
leaq 0x3(%r15), %rdi
leaq 0x3a98(%rip), %rsi      # 0x6527
callq 0x11e0
testq %rax, %rax
je 0x2e34
movl %eax, %ecx
subl %r15d, %ecx
addl $0x2, %ecx
addq $0x3, %rax
incl %ecx
cmpb $0x27, (%rax)
leaq 0x1(%rax), %rax
je 0x2aa9
jmp 0x2ce7
cmpl $0x7a, %r13d
jg 0x2b0e
cmpl $0x5b, %r13d
je 0x2bc7
cmpl $0x5d, %r13d
jne 0x2c04
movl $0x8, 0x20(%r14)
jmp 0x2be3
movl $0x1, 0x20(%r14)
jmp 0x2be3
cmpl $0x2c, %r13d
je 0x2bd1
cmpl $0x3d, %r13d
jne 0x2c04
movl $0x3, 0x20(%r14)
jmp 0x2be3
cmpl $0x7b, %r13d
je 0x2bdb
cmpl $0x7d, %r13d
jne 0x2c04
movl $0x5, 0x20(%r14)
jmp 0x2be3
cmpl $0xa, %r13d
jne 0x2c04
movl $0x6, 0x20(%r14)
jmp 0x2be3
movzbl 0x1(%r15), %r12d
testl %r12d, %r12d
je 0x2dd4
cmpl $0x22, %r12d
jne 0x2d00
cmpb $0x22, 0x2(%r15)
jne 0x2d00
leaq 0x3(%r15), %r12
leaq 0x39d3(%rip), %rsi      # 0x6547
movq %r12, %rdi
callq 0x11e0
testq %rax, %rax
je 0x2bac
movq %rax, %r13
leaq 0x39bc(%rip), %rbp      # 0x6547
cmpb $0x5c, -0x1(%r13)
jne 0x2e4c
incq %r13
movq %r13, %rdi
movq %rbp, %rsi
callq 0x11e0
movq %rax, %r13
testq %rax, %rax
jne 0x2b8b
movq 0x10(%r14), %rdi
movslq 0x18(%r14), %rsi
leaq 0x36d1(%rip), %rdx      # 0x628c
leaq 0x3989(%rip), %r8       # 0x654b
jmp 0x2dea
movl $0x7, 0x20(%r14)
jmp 0x2be3
movl $0x2, 0x20(%r14)
jmp 0x2be3
movl $0x4, 0x20(%r14)
movl %ebx, 0x24(%r14)
movq %r15, 0x28(%r14)
movq $0x1, 0x30(%r14)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x3a81
testl %eax, %eax
je 0x2cc4
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x3b28
testl %eax, %eax
je 0x2cc4
xorl %r12d, %r12d
testb %r13b, %r13b
je 0x2dfd
movzbl %r13b, %eax
cmpl $0xa, %eax
je 0x2dfd
testl %ebp, %ebp
je 0x2c57
cmpb $0x2e, %r13b
je 0x2dfd
movl %r13d, %eax
andb $-0x21, %al
addb $-0x41, %al
cmpb $0x1a, %al
jb 0x2c80
movsbl %r13b, %esi
movl $0xf, %edx
leaq 0x39bc(%rip), %rdi      # 0x662e
callq 0x1130
testq %rax, %rax
je 0x2dfd
movb 0x1(%r15,%r12), %r13b
incq %r12
jmp 0x2c33
movl $0x1, %eax
movzbl (%r15,%rax), %ecx
testl %ecx, %ecx
je 0x2ca9
incq %rax
cmpl $0x27, %ecx
je 0x2e13
cmpl $0xa, %ecx
jne 0x2c8f
movq 0x10(%r14), %rdi
movslq 0x18(%r14), %rsi
leaq 0x35d4(%rip), %rdx      # 0x628c
leaq 0x3912(%rip), %r8       # 0x65d1
jmp 0x2dea
leaq 0x394f(%rip), %rsi      # 0x661a
movq %r15, %rdi
callq 0x1120
leal 0x1(%rax), %ecx
addq %r15, %rax
decq %rax
decl %ecx
cmpb $0x20, (%rax)
leaq -0x1(%rax), %rax
je 0x2cdc
movl $0x9, 0x20(%r14)
movl %ebx, 0x24(%r14)
movq %r15, 0x28(%r14)
movl %ecx, 0x30(%r14)
jmp 0x2e27
xorl %ecx, %ecx
movl $0x2, %ebp
xorl %r13d, %r13d
testl %ecx, %ecx
jne 0x2d38
testl %r13d, %r13d
je 0x2d75
movsbl %r12b, %esi
movl $0x11, %edx
leaq 0x3860(%rip), %rdi      # 0x6583
callq 0x1130
testq %rax, %rax
je 0x2f3a
decl %r13d
xorl %ecx, %ecx
jmp 0x2dac
movsbl %r12b, %esi
movl $0x8, %edx
leaq 0x381f(%rip), %rdi      # 0x6567
callq 0x1130
xorl %ecx, %ecx
testq %rax, %rax
jne 0x2dac
movl $0x4, %r13d
cmpb $0x75, %r12b
je 0x2dac
movzbl %r12b, %eax
cmpl $0x55, %eax
jne 0x2f1f
movl $0x8, %r13d
jmp 0x2dac
movzbl %r12b, %eax
cmpl $0x5b, %eax
jg 0x2d9f
cmpl $0x27, %eax
jne 0x2dbe
xorl %r13d, %r13d
cmpb $0x27, (%r15,%rbp)
jne 0x2d34
cmpb $0x27, 0x1(%r15,%rbp)
movl $0x0, %ecx
jne 0x2dac
jmp 0x2f8d
cmpl $0x5c, %eax
jne 0x2dcc
movl $0x1, %ecx
xorl %r13d, %r13d
movb (%r15,%rbp), %r12b
incq %rbp
testb %r12b, %r12b
jne 0x2d0a
jmp 0x2dd4
cmpl $0xa, %eax
je 0x2dd4
cmpl $0x22, %eax
je 0x2f55
xorl %r13d, %r13d
jmp 0x2d34
movq 0x10(%r14), %rdi
movslq 0x18(%r14), %rsi
leaq 0x34a9(%rip), %rdx      # 0x628c
leaq 0x381d(%rip), %r8       # 0x6607
movl %ebx, %ecx
xorl %eax, %eax
callq 0x10e0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x2bf5
movl $0x9, 0x20(%r14)
movl %ebx, 0x24(%r14)
movq %r15, 0x28(%r14)
movl %r12d, 0x30(%r14)
jmp 0x2e27
movl $0x9, 0x20(%r14)
movl %ebx, 0x24(%r14)
movq %r15, 0x28(%r14)
movl %eax, 0x30(%r14)
movl $0x0, 0x34(%r14)
jmp 0x2bf3
movq 0x10(%r14), %rdi
movslq 0x18(%r14), %rsi
leaq 0x3449(%rip), %rdx      # 0x628c
leaq 0x36e1(%rip), %r8       # 0x652b
jmp 0x2dea
movl %r13d, %ebp
subl %r15d, %ebp
addl $0x2, %ebp
decq %r13
incl %ebp
cmpb $0x22, 0x4(%r13)
leaq 0x1(%r13), %r13
je 0x2e58
cmpq %r13, %r12
jae 0x2fc7
xorl %ecx, %ecx
xorl %eax, %eax
testl %ecx, %ecx
jne 0x2ea5
testl %eax, %eax
je 0x2ece
movl %eax, (%rsp)
movsbl (%r12), %esi
movl $0x11, %edx
leaq 0x36f5(%rip), %rdi      # 0x6583
callq 0x1130
testq %rax, %rax
je 0x2f3a
movl (%rsp), %eax
decl %eax
xorl %ecx, %ecx
jmp 0x2eda
movl %eax, (%rsp)
movsbl (%r12), %esi
movl $0x8, %edx
leaq 0x36ae(%rip), %rdi      # 0x6567
movl %esi, 0x4(%rsp)
callq 0x1130
xorl %ecx, %ecx
testq %rax, %rax
je 0x2ee7
movl (%rsp), %eax
jmp 0x2eda
xorl %ecx, %ecx
cmpb $0x5c, (%r12)
sete %cl
xorl %eax, %eax
incq %r12
cmpq %r13, %r12
jb 0x2e72
jmp 0x2f6e
movzbl 0x4(%rsp), %eax
cmpl $0x75, %eax
je 0x2efd
cmpl $0x55, %eax
jne 0x2f04
movl $0x8, %eax
jmp 0x2eda
movl $0x4, %eax
jmp 0x2eda
movq %r12, %rdi
leaq 0x3661(%rip), %rsi      # 0x656f
callq 0x1120
xorl %ecx, %ecx
cmpb $0xa, (%r12,%rax)
movl (%rsp), %eax
je 0x2eda
movq 0x10(%r14), %rdi
movslq 0x18(%r14), %rsi
leaq 0x335e(%rip), %rdx      # 0x628c
leaq 0x363e(%rip), %r8       # 0x6573
jmp 0x2dea
movq 0x10(%r14), %rdi
movslq 0x18(%r14), %rsi
leaq 0x3343(%rip), %rdx      # 0x628c
leaq 0x3644(%rip), %r8       # 0x6594
jmp 0x2dea
movl $0x9, 0x20(%r14)
movl %ebx, 0x24(%r14)
movq %r15, 0x28(%r14)
movl %ebp, 0x30(%r14)
jmp 0x2e27
testl %ecx, %ecx
je 0x2fa8
movq 0x10(%r14), %rdi
movslq 0x18(%r14), %rsi
leaq 0x330b(%rip), %rdx      # 0x628c
leaq 0x361c(%rip), %r8       # 0x65a4
jmp 0x2dea
movq 0x10(%r14), %rdi
movslq 0x18(%r14), %rsi
leaq 0x32f0(%rip), %rdx      # 0x628c
leaq 0x3643(%rip), %r8       # 0x65e6
jmp 0x2dea
testl %eax, %eax
je 0x2fc7
movq 0x10(%r14), %rdi
movslq 0x18(%r14), %rsi
leaq 0x32d1(%rip), %rdx      # 0x628c
leaq 0x35f8(%rip), %r8       # 0x65ba
jmp 0x2dea
movl $0x9, 0x20(%r14)
movl %ebx, 0x24(%r14)
movq %r15, 0x28(%r14)
movl %ebp, 0x30(%r14)
jmp 0x2e27