// File: /workspace/github_c_makefile_star2_O1/sebbekarlsson[P]cola/src/parse_id.c
// Function: parse_id
token* parse_id(lex_state* state, token* token) {
    if (
        strcmp(token->value, "string") == 0 ||
        strcmp(token->value, "int") == 0 ||
        strcmp(token->value, "struct") == 0 ||
        strcmp(token->value, "void") == 0 ||
        strcmp(token->value, "float") == 0 ||
        strcmp(token->value, "char") == 0 ||
        strcmp(token->value, "vector") == 0
    ) {
        token->type = _DATA_TYPE;
    } else if (strcmp(token->value, "comp") == 0) {
        token->type = _TYPE_COMPONENT;
    } else if (strcmp(token->value, "use") == 0) {
        token->type = _USE;
    } else if (strcmp(token->value, "if") == 0) {
        token->type = _IF;
    } else if (strcmp(token->value, "else") == 0) {
        token->type = _ELSE;
    } else if (strcmp(token->value, "while") == 0) {
        token->type = _WHILE;
    } else if (strcmp(token->value, "foreach") == 0) {
        token->type = _FOREACH;
    } else if (strcmp(token->value, "as") == 0) {
        token->type = _AS;
    } else if (strcmp(token->value, "function") == 0) {
        token->type = _TYPE_FUNCTION;
    } else if (strcmp(token->value, "return") == 0) {
        token->type = _RETURN;
    } else if (lex_peek_next(state, state->pos) == '(') {
        token->type = _FUNCTION_CALL;
    } 

    return token;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rsi), %r15
leaq 0xa80(%rip), %rsi       # 0x5014
movq %r15, %rdi
callq 0x10c0
movl $0x4, %r12d
testl %eax, %eax
je 0x4751
leaq 0xa97(%rip), %rsi       # 0x5048
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x4751
leaq 0xe58(%rip), %rsi       # 0x5420
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x4751
leaq 0xa2b(%rip), %rsi       # 0x500a
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x4751
leaq 0xa0e(%rip), %rsi       # 0x5004
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x4751
leaq 0xa02(%rip), %rsi       # 0x500f
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x4751
leaq 0x9f7(%rip), %rsi       # 0x501b
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x4751
leaq 0xdec(%rip), %rsi       # 0x5427
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x470b
leaq 0xdda(%rip), %rsi       # 0x542c
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x4713
leaq 0xdc7(%rip), %rsi       # 0x5430
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x471b
leaq 0xdb3(%rip), %rsi       # 0x5433
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x4723
leaq 0xda1(%rip), %rsi       # 0x5438
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x472b
leaq 0xd90(%rip), %rsi       # 0x543e
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x4733
leaq 0xd85(%rip), %rsi       # 0x5446
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x473b
leaq 0xd75(%rip), %rsi       # 0x5449
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x4743
leaq 0xd6b(%rip), %rsi       # 0x5452
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x474b
movl 0xc(%r14), %esi
movq %r14, %rdi
callq 0x3780
movl $0x1c, %r12d
cmpb $0x28, %al
je 0x4751
jmp 0x4754
movl $0x2f, %r12d
jmp 0x4751
movl $0xb, %r12d
jmp 0x4751
movl $0x12, %r12d
jmp 0x4751
movl $0x13, %r12d
jmp 0x4751
movl $0x1d, %r12d
jmp 0x4751
movl $0x1e, %r12d
jmp 0x4751
movl $0x1f, %r12d
jmp 0x4751
movl $0x30, %r12d
jmp 0x4751
movl $0x11, %r12d
movl %r12d, (%rbx)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq