// File: /workspace/github_c_makefile_star2_O2/mrkite[P]regs/docmaker/parser.cc
// Function: Parser::parseEnum(Symbol*, File*)
bool Parser::parseEnum(Symbol *s, File *f) {
  Enum *e = new Enum();
  s->kind = isEnum;
  s->asEnum = e;
  if (!f->token().expect('<')) {
    return false;
  }
  Token token = f->token();
  if (token.type != VAR) {
    error(f, "Expected a type name\n");
    return false;
  }
  e->type = find(token);
  if (!f->token().expect('>')) {
    return false;
  }
  if (!f->token().expect('{')) {
    return false;
  }
  int32_t prevVal = -1;
  while ((token = f->token()).type == VAR) {
    std::string key = token.asStr;
    token = f->token();
    if (token.type == SYMBOL && token.asSym == '=') {
      prevVal = f->token().asNum;
      token = f->token();
    } else {
      prevVal++;
    }
    e->entries.insert(std::pair<std::string, int32_t>(key, prevVal));
    if (!token.expect(",}")) {
      return false;
    }
    if (token.asSym == '}') {
      break;
    }
  }
  return token.expect('}');
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r15
pushq $0x38
popq %rdi
callq 0x21d0
movq %rax, %r14
addq $0x10, %rax
xorps %xmm0, %xmm0
movaps %xmm0, (%r14)
movaps %xmm0, 0x10(%r14)
movq %rax, 0x20(%r14)
movq %rax, 0x28(%r14)
andq $0x0, 0x30(%r14)
movl $0x1, 0x78(%r12)
movq %r14, 0x80(%r12)
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x54d6
pushq $0x3c
popq %rsi
movq %r12, %rdi
callq 0x5716
movl %eax, %ebp
leaq 0x8(%rsp), %rdi
callq 0x3d0a
testb %bpl, %bpl
je 0x32b4
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x54d6
cmpl $0x7, (%r12)
jne 0x32b8
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x2a12
movq %rax, (%r14)
leaq 0x60(%rsp), %rdi
movq %rbx, %rsi
callq 0x54d6
leaq 0x60(%rsp), %rdi
pushq $0x3e
popq %rsi
callq 0x5716
movl %eax, %ebp
leaq 0x60(%rsp), %rdi
callq 0x3d0a
testb %bpl, %bpl
je 0x32cd
leaq 0x60(%rsp), %rdi
movq %rbx, %rsi
callq 0x54d6
leaq 0x60(%rsp), %rdi
pushq $0x7b
popq %rsi
callq 0x5716
movl %eax, %ebp
leaq 0x60(%rsp), %rdi
callq 0x3d0a
testb %bpl, %bpl
je 0x32cd
addq $0x8, %r14
pushq $-0x1
popq %r15
leaq 0x60(%rsp), %r12
leaq 0x8(%rsp), %r13
movq %r12, %rdi
movq %rbx, %rsi
callq 0x54d6
movq %r13, %rdi
movq %r12, %rsi
callq 0x3e8e
movl (%rax), %ebp
movq %r12, %rdi
callq 0x3d0a
cmpl $0x7, %ebp
jne 0x32a3
leaq 0xb8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x22a0
movq %r12, %rdi
movq %rbx, %rsi
callq 0x54d6
movq %r13, %rdi
movq %r12, %rsi
callq 0x3e8e
movq %r12, %rdi
callq 0x3d0a
cmpl $0x3, 0x8(%rsp)
jne 0x3234
cmpb $0x3d, 0x30(%rsp)
jne 0x3234
movq %r12, %rdi
movq %rbx, %rsi
callq 0x54d6
movl 0x8c(%rsp), %r15d
movq %r12, %rdi
callq 0x3d0a
movq %r12, %rdi
movq %rbx, %rsi
callq 0x54d6
movq %r13, %rdi
movq %r12, %rsi
callq 0x3e8e
movq %r12, %rdi
callq 0x3d0a
jmp 0x3237
incl %r15d
movq %r12, %rdi
leaq 0xb8(%rsp), %rsi
callq 0x22a0
movl %r15d, 0x80(%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x450e
movq %r12, %rdi
callq 0x2100
movq %r13, %rdi
leaq 0x3ec4(%rip), %rsi      # 0x7130
callq 0x57b8
xorl %ecx, %ecx
cmpb $0x7d, 0x30(%rsp)
sete %dl
testb %al, %al
jne 0x3284
pushq $0x1
popq %rbp
jmp 0x3289
movb %dl, %cl
leal (%rcx,%rcx,2), %ebp
leaq 0xb8(%rsp), %rdi
callq 0x2100
testl %ebp, %ebp
je 0x3192
cmpl $0x3, %ebp
jne 0x32cd
leaq 0x8(%rsp), %rdi
pushq $0x7d
popq %rsi
callq 0x5716
movl %eax, %ebp
jmp 0x32cf
xorl %ebp, %ebp
jmp 0x32d9
leaq 0x3e5b(%rip), %rdx      # 0x711a
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2fbe
jmp 0x32cf
xorl %ebp, %ebp
leaq 0x8(%rsp), %rdi
callq 0x3d0a
movl %ebp, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3333
jmp 0x32f3
jmp 0x3333
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x3d0a
jmp 0x3336
jmp 0x3333
jmp 0x3333
jmp 0x331f
jmp 0x331f
jmp 0x3333
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x2100
jmp 0x3322
jmp 0x331f
jmp 0x331f
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x2100
jmp 0x3336
jmp 0x3333
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3d0a
movq %rbx, %rdi
callq 0x23a0