// File: /workspace/github_c_makefile_star2_O2/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 0x1208(%rip), %rsi      # 0x5014
movq %r15, %rdi
callq 0x10c0
pushq $0x4
popq %r12
testl %eax, %eax
je 0x3f9e
leaq 0x1221(%rip), %rsi      # 0x5048
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x3f9e
leaq 0x15d2(%rip), %rsi      # 0x5410
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x3f9e
leaq 0x11b5(%rip), %rsi      # 0x500a
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x3f9e
leaq 0x1198(%rip), %rsi      # 0x5004
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x3f9e
leaq 0x118c(%rip), %rsi      # 0x500f
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x3f9e
leaq 0x1181(%rip), %rsi      # 0x501b
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x3f9e
leaq 0x1566(%rip), %rsi      # 0x5417
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x3f7a
leaq 0x1554(%rip), %rsi      # 0x541c
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x3f7e
movb (%r15), %r12b
cmpb $0x69, %r12b
jne 0x3ef3
cmpb $0x66, 0x1(%r15)
jne 0x3ef3
cmpb $0x0, 0x2(%r15)
je 0x3f8e
leaq 0x1526(%rip), %rsi      # 0x5420
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x3f82
leaq 0x1518(%rip), %rsi      # 0x5425
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x3f86
leaq 0x150b(%rip), %rsi      # 0x542b
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x3f8a
cmpb $0x61, %r12b
jne 0x3f40
cmpb $0x73, 0x1(%r15)
jne 0x3f40
cmpb $0x0, 0x2(%r15)
je 0x3f9a
leaq 0x14ec(%rip), %rsi      # 0x5433
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x3f92
leaq 0x14e2(%rip), %rsi      # 0x543c
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x3f96
movl 0xc(%r14), %esi
movq %r14, %rdi
callq 0x30d2
cmpb $0x28, %al
jne 0x3fa1
pushq $0x1c
jmp 0x3f9c
pushq $0x2f
jmp 0x3f9c
pushq $0xb
jmp 0x3f9c
pushq $0x13
jmp 0x3f9c
pushq $0x1d
jmp 0x3f9c
pushq $0x1e
jmp 0x3f9c
pushq $0x12
jmp 0x3f9c
pushq $0x30
jmp 0x3f9c
pushq $0x11
jmp 0x3f9c
pushq $0x1f
popq %r12
movl %r12d, (%rbx)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)