// File: /workspace/github_c_makefile_star2_O0/chgzm[P]minic/tokenizer.c
// Function: read_directive
static Token* read_directive(const char* p, int* pos) {
    ++(*pos);

    int len = 0;
    while (p[*pos + len] != ' ' && p[*pos + len] != '\n') {
        ++len;
    }

    Token* token  = calloc(1, sizeof(Token));
    token->type   = TK_HASH;
    token->strlen = len;
    token->str    = malloc(sizeof(char) * token->strlen + 1);
    strncpy(token->str, &p[*pos], token->strlen);
    token->str[token->strlen] = '\0';

    *pos += len; 

    int a = 0;
    while (p[*pos + a] == ' ') {
        ++a;
    }

    while (isalpha(p[*pos + a]) || p[*pos + a] == '_' || isdigit(p[*pos +a])) {
        ++a;
    }

    while (p[*pos + a] == ' ') {
        ++a;
    }

    if (p[*pos + a] != '\n') {
        token->has_value = true;
    }

    return token;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movl $0x0, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
addl -0x14(%rbp), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x20, %ecx
movb %al, -0x25(%rbp)
je 0xcf0d
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
addl -0x14(%rbp), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0xa, %eax
setne %al
movb %al, -0x25(%rbp)
movb -0x25(%rbp), %al
testb $0x1, %al
jne 0xcf16
jmp 0xcf21
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xced2
movl $0x1, %edi
movl $0x18, %esi
callq 0x10b0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl $0x2f, (%rax)
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x20(%rbp), %rax
movslq 0x10(%rax), %rdi
shlq $0x0, %rdi
addq $0x1, %rdi
callq 0x10f0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rax
movslq (%rax), %rax
addq %rax, %rsi
movq -0x20(%rbp), %rax
movslq 0x10(%rax), %rdx
callq 0x1050
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
movslq 0x10(%rcx), %rcx
movb $0x0, (%rax,%rcx)
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
movl $0x0, -0x24(%rbp)
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
addl -0x24(%rbp), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x20, %eax
jne 0xcfd5
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xcfb1
jmp 0xcfd7
callq 0x1180
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rdx
movl (%rdx), %edx
addl -0x24(%rbp), %edx
movslq %edx, %rdx
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %ecx
andl $0x400, %ecx            # imm = 0x400
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x26(%rbp)
jne 0xd059
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
addl -0x24(%rbp), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %ecx
movb $0x1, %al
cmpl $0x5f, %ecx
movb %al, -0x26(%rbp)
je 0xd059
callq 0x1180
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rdx
movl (%rdx), %edx
addl -0x24(%rbp), %edx
movslq %edx, %rdx
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
setne %al
movb %al, -0x26(%rbp)
movb -0x26(%rbp), %al
testb $0x1, %al
jne 0xd062
jmp 0xd070
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xcfd7
jmp 0xd072
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
addl -0x24(%rbp), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x20, %eax
jne 0xd096
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xd072
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
addl -0x24(%rbp), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0xa, %eax
je 0xd0b7
movq -0x20(%rbp), %rax
movb $0x1, 0x14(%rax)
movq -0x20(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)