// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/lexer.c
// Function: lexer_parse_first
void lexer_parse_first(LexerContext *ctx) {
	assert(ctx);
	assert(ctx->matchers[0].name != NULL);

	const LexerTokenMatcher *matchers = ctx->matchers;

	while (ctx->index < ctx->len - 1) {
		LexerToken *token = NULL;
		int abandon = 0;
		int last_line = 0, last_column = -1;
		bool finded = false;
		for (const LexerTokenMatcher *matcher = matchers; !finded && matcher->name != NULL;matcher++) {
			_store_char_context(ctx);
			int a;
			token = matcher->match(ctx, &a);
			if (token != NULL) {
				abandon = a;
				last_line = ctx->line;
				last_column = ctx->column;
				finded = true;
			}
			_resume_char_context(ctx);
		}

		if (token != NULL) {
			ctx->index += token->len;
			ctx->line = last_line;
			ctx->column = last_column;
			if (!abandon) {
				_add_token(ctx, token);
			}
		} else {
			lexer_next_char(ctx);
			ctx->invalid_token(ctx);
		}
	}

	lexer_reset_token(ctx, 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xc275
jmp 0xc294
leaq 0x418e5(%rip), %rdi     # 0x4db61
leaq 0x40110(%rip), %rsi     # 0x4c393
movl $0x17a, %edx            # imm = 0x17A
leaq 0x3a66e(%rip), %rcx     # 0x468fd
callq 0xa0b0
movq -0x8(%rbp), %rax
movq 0x2078(%rax), %rax
cmpq $0x0, (%rax)
je 0xc2a7
jmp 0xc2c6
leaq 0x3a631(%rip), %rdi     # 0x468df
leaq 0x400de(%rip), %rsi     # 0x4c393
movl $0x17b, %edx            # imm = 0x17B
leaq 0x3a63c(%rip), %rcx     # 0x468fd
callq 0xa0b0
movq -0x8(%rbp), %rax
movq 0x2078(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0x34(%rax), %eax
movq -0x8(%rbp), %rcx
movl 0x30(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0xc3f4
movq $0x0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl $0xffffffff, -0x24(%rbp) # imm = 0xFFFFFFFF
movb $0x0, -0x25(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
xorl %eax, %eax
testb $0x1, -0x25(%rbp)
movb %al, -0x35(%rbp)
jne 0xc330
movq -0x30(%rbp), %rax
cmpq $0x0, (%rax)
setne %al
movb %al, -0x35(%rbp)
movb -0x35(%rbp), %al
testb $0x1, %al
jne 0xc339
jmp 0xc394
movq -0x8(%rbp), %rdi
callq 0xc020
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq *%rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xc37d
movl -0x34(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movl 0x3c(%rax), %eax
movl %eax, -0x24(%rbp)
movb $0x1, -0x25(%rbp)
movq -0x8(%rbp), %rdi
callq 0xc090
movq -0x30(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x30(%rbp)
jmp 0xc317
cmpq $0x0, -0x18(%rbp)
je 0xc3d5
movq -0x18(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x8(%rbp), %rax
addl 0x34(%rax), %ecx
movl %ecx, 0x34(%rax)
movl -0x20(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x38(%rax)
movl -0x24(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x3c(%rax)
cmpl $0x0, -0x1c(%rbp)
jne 0xc3d3
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xc100
jmp 0xc3ef
movq -0x8(%rbp), %rdi
callq 0xb6d0
movq -0x8(%rbp), %rax
movq 0x2088(%rax), %rax
movq -0x8(%rbp), %rdi
callq *%rax
jmp 0xc2d5
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0xb8e0
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)