// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/lexer.c
// Function: lexer_new_context
LexerContext * lexer_new_context(
	const char *file,
	const char *source,
	int len,
	LexerTokenMatcher *matchers
) {
	assert(file);
	assert(source);
	assert(len >= 0);
	assert(matchers[0].name != NULL);

	LexerContext *ctx = (LexerContext *)malloc(sizeof(LexerContext));
	if (ctx == NULL) {
		return NULL;
	}

	ctx->file = file;
	rarr_init(&(ctx->rarr_file), sizeof(char *));
	
	ctx->source = source;
	ctx->len = len;
	ctx->index = -1;
	ctx->line = 1;
	ctx->column = 0;

	ctx->stored_index = -1;
	ctx->stored_line = 1;
	ctx->stored_column = 0;

	ctx->head = NULL;
	ctx->tail = NULL;
	ctx->current = NULL;

	ctx->tokens = NULL;

	ctx->curstack_top = -1;

	ctx->matchers = matchers;

	ctx->data = NULL;

	ctx->invalid_token = _default_invalid_token;
	ctx->alloc_mem_error = _default_alloc_mem_error;

	return ctx;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xb190
jmp 0xb1af
leaq 0x3b8d7(%rip), %rdi     # 0x46a6e
leaq 0x411f5(%rip), %rsi     # 0x4c393
movl $0x67, %edx
leaq 0x3b39b(%rip), %rcx     # 0x46545
callq 0xa0b0
cmpq $0x0, -0x18(%rbp)
je 0xb1b8
jmp 0xb1d7
leaq 0x3b3dc(%rip), %rdi     # 0x4659b
leaq 0x411cd(%rip), %rsi     # 0x4c393
movl $0x68, %edx
leaq 0x3b373(%rip), %rcx     # 0x46545
callq 0xa0b0
cmpl $0x0, -0x1c(%rbp)
jl 0xb1df
jmp 0xb1fe
leaq 0x3b3bc(%rip), %rdi     # 0x465a2
leaq 0x411a6(%rip), %rsi     # 0x4c393
movl $0x69, %edx
leaq 0x3b34c(%rip), %rcx     # 0x46545
callq 0xa0b0
movq -0x28(%rbp), %rax
cmpq $0x0, (%rax)
je 0xb20a
jmp 0xb229
leaq 0x3b6d3(%rip), %rdi     # 0x468e4
leaq 0x4117b(%rip), %rsi     # 0x4c393
movl $0x6a, %edx
leaq 0x3b321(%rip), %rcx     # 0x46545
callq 0xa0b0
movl $0x2098, %edi           # imm = 0x2098
callq 0xa130
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0xb24b
movq $0x0, -0x8(%rbp)
jmp 0xb345
movq -0x10(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rdi
addq $0x8, %rdi
movl $0x8, %esi
callq 0xa2b0
movq -0x18(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x28(%rax)
movl -0x1c(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x30(%rbp), %rax
movl $0xffffffff, 0x34(%rax) # imm = 0xFFFFFFFF
movq -0x30(%rbp), %rax
movl $0x1, 0x38(%rax)
movq -0x30(%rbp), %rax
movl $0x0, 0x3c(%rax)
movq -0x30(%rbp), %rax
movl $0xffffffff, 0x40(%rax) # imm = 0xFFFFFFFF
movq -0x30(%rbp), %rax
movl $0x1, 0x44(%rax)
movq -0x30(%rbp), %rax
movl $0x0, 0x48(%rax)
movq -0x30(%rbp), %rax
movq $0x0, 0x50(%rax)
movq -0x30(%rbp), %rax
movq $0x0, 0x58(%rax)
movq -0x30(%rbp), %rax
movq $0x0, 0x60(%rax)
movq -0x30(%rbp), %rax
movq $0x0, 0x68(%rax)
movq -0x30(%rbp), %rax
movl $0xffffffff, 0x70(%rax) # imm = 0xFFFFFFFF
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x2078(%rax)
movq -0x30(%rbp), %rax
movq $0x0, 0x2080(%rax)
movq -0x30(%rbp), %rax
leaq 0x2c(%rip), %rcx        # 0xb350
movq %rcx, 0x2088(%rax)
movq -0x30(%rbp), %rax
leaq 0x1ba(%rip), %rcx       # 0xb4f0
movq %rcx, 0x2090(%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop