// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x3c0, %rsp            # imm = 0x3C0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x380(%rbp)
movl $0x38, %edi
callq 0x3240
movq %rax, %rdi
movq %rdi, -0x378(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
movq $0x0, 0x30(%rdi)
callq 0x6d20
movq -0x378(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movl $0x1, 0x78(%rax)
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x80(%rax)
movq -0x20(%rbp), %rsi
leaq -0x80(%rbp), %rdi
movq %rdi, -0x370(%rbp)
callq 0xc500
movq -0x370(%rbp), %rdi
movl $0x3c, %esi
callq 0xc990
movb %al, -0x361(%rbp)
jmp 0x5473
movb -0x361(%rbp), %al
xorb $-0x1, %al
movb %al, -0x381(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x68a0
movb -0x381(%rbp), %al
testb $0x1, %al
jne 0x5496
jmp 0x54bf
movb $0x0, -0x1(%rbp)
jmp 0x58fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x68a0
jmp 0x590b
movq -0x20(%rbp), %rsi
leaq -0xe8(%rbp), %rdi
callq 0xc500
cmpl $0x7, -0xe8(%rbp)
je 0x551d
movq -0x380(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0xbc30(%rip), %rdx      # 0x1111a
xorl %eax, %eax
callq 0x52f0
jmp 0x54f3
movb $0x0, -0x1(%rbp)
movl $0x1, -0xec(%rbp)
jmp 0x58e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x58ef
movq -0x380(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x4800
movq %rax, -0x390(%rbp)
jmp 0x5539
movq -0x390(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rsi
leaq -0x148(%rbp), %rdi
callq 0xc500
jmp 0x5559
leaq -0x148(%rbp), %rdi
movl $0x3e, %esi
callq 0xc990
movb %al, -0x391(%rbp)
jmp 0x5572
movb -0x391(%rbp), %al
xorb $-0x1, %al
movb %al, -0x392(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x68a0
movb -0x392(%rbp), %al
testb $0x1, %al
jne 0x5598
jmp 0x55ce
movb $0x0, -0x1(%rbp)
movl $0x1, -0xec(%rbp)
jmp 0x58e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x68a0
jmp 0x58ef
movq -0x20(%rbp), %rsi
leaq -0x1a0(%rbp), %rdi
callq 0xc500
jmp 0x55e0
leaq -0x1a0(%rbp), %rdi
movl $0x7b, %esi
callq 0xc990
movb %al, -0x393(%rbp)
jmp 0x55f9
movb -0x393(%rbp), %al
xorb $-0x1, %al
movb %al, -0x394(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x68a0
movb -0x394(%rbp), %al
testb $0x1, %al
jne 0x561f
jmp 0x5655
movb $0x0, -0x1(%rbp)
movl $0x1, -0xec(%rbp)
jmp 0x58e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x68a0
jmp 0x58ef
movl $0xffffffff, -0x1a4(%rbp) # imm = 0xFFFFFFFF
movq -0x20(%rbp), %rsi
leaq -0x200(%rbp), %rdi
callq 0xc500
jmp 0x5671
leaq -0xe8(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x6c90
movl (%rax), %eax
movl %eax, -0x398(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x68a0
movl -0x398(%rbp), %eax
cmpl $0x7, %eax
jne 0x58b3
leaq -0xe0(%rbp), %rsi
leaq -0x220(%rbp), %rdi
callq 0x3110
jmp 0x56bc
movq -0x20(%rbp), %rsi
leaq -0x278(%rbp), %rdi
callq 0xc500
jmp 0x56ce
leaq -0xe8(%rbp), %rdi
leaq -0x278(%rbp), %rsi
callq 0x6c90
leaq -0x278(%rbp), %rdi
callq 0x68a0
cmpl $0x3, -0xe8(%rbp)
jne 0x577a
movsbl -0xc0(%rbp), %eax
cmpl $0x3d, %eax
jne 0x577a
movq -0x20(%rbp), %rsi
leaq -0x2d0(%rbp), %rdi
callq 0xc500
jmp 0x5718
movl -0x2a4(%rbp), %eax
movl %eax, -0x1a4(%rbp)
leaq -0x2d0(%rbp), %rdi
callq 0x68a0
movq -0x20(%rbp), %rsi
leaq -0x328(%rbp), %rdi
callq 0xc500
jmp 0x5742
leaq -0xe8(%rbp), %rdi
leaq -0x328(%rbp), %rsi
callq 0x6c90
leaq -0x328(%rbp), %rdi
callq 0x68a0
jmp 0x5789
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x58a5
movl -0x1a4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1a4(%rbp)
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x3a0(%rbp)
leaq -0x350(%rbp), %rdi
leaq -0x220(%rbp), %rsi
leaq -0x1a4(%rbp), %rdx
callq 0x6d80
jmp 0x57b4
movq -0x3a0(%rbp), %rdi
leaq -0x350(%rbp), %rsi
callq 0x6d40
movb %dl, -0x3a9(%rbp)
movq %rax, -0x3a8(%rbp)
jmp 0x57d6
movb -0x3a9(%rbp), %al
movq -0x3a8(%rbp), %rcx
movq %rcx, -0x360(%rbp)
movb %al, -0x358(%rbp)
leaq -0x350(%rbp), %rdi
callq 0x6dc0
leaq 0xb92d(%rip), %rsi      # 0x11130
leaq -0xe8(%rbp), %rdi
callq 0xca90
movb %al, -0x3aa(%rbp)
jmp 0x5817
movb -0x3aa(%rbp), %al
testb $0x1, %al
jne 0x5853
jmp 0x5823
movb $0x0, -0x1(%rbp)
movl $0x1, -0xec(%rbp)
jmp 0x5875
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x350(%rbp), %rdi
callq 0x6dc0
jmp 0x58a5
movsbl -0xc0(%rbp), %eax
cmpl $0x7d, %eax
jne 0x586b
movl $0x3, -0xec(%rbp)
jmp 0x5875
movl $0x0, -0xec(%rbp)
leaq -0x220(%rbp), %rdi
callq 0x3160
movl -0xec(%rbp), %eax
movl %eax, -0x3b0(%rbp)
testl %eax, %eax
je 0x58a0
jmp 0x5893
movl -0x3b0(%rbp), %eax
subl $0x3, %eax
je 0x58b3
jmp 0x58e1
jmp 0x565f
leaq -0x220(%rbp), %rdi
callq 0x3160
jmp 0x58ef
leaq -0xe8(%rbp), %rdi
movl $0x7d, %esi
callq 0xc990
movb %al, -0x3b1(%rbp)
jmp 0x58cc
movb -0x3b1(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movl $0x1, -0xec(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x68a0
jmp 0x58fd
leaq -0xe8(%rbp), %rdi
callq 0x68a0
jmp 0x590b
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x3c0, %rsp            # imm = 0x3C0
popq %rbp
retq
movq -0x88(%rbp), %rdi
callq 0x3490
nopw (%rax,%rax)