// File: /workspace/github_c_makefile_star2_O2/anuwu[P]ERPLAG-Compiler/lexer.c
// Function: handleLexError
token *handleLexError (DFAError err, twinBuffer *twinBuf)
{
	token *tk = (token *) malloc (sizeof(token)) ;
	tk->id = TK_LEXERROR ;
	tk->lineNumber = getLexemeLineNumber (twinBuf) ;
 
	switch (err)
	{
		case UNKNOWN_SYMBOL :
			tk->lexeme = (char *) malloc (sizeof(char) * (strlen("Unknown Symbol") + 1)) ;
			strcpy (tk->lexeme, "Unknown Symbol") ;
			break ;
 
		case EOF_WHILE_LEXING :
			retract (twinBuf) ;
			resetBeginPointer (twinBuf) ;
			tk->lineNumber = twinBuf->lineNumber ;
			nextChar (twinBuf) ;

			tk->lexeme = (char *) malloc (sizeof(char) * (strlen("Reached EOF while lexing") + 1)) ;
			strcpy (tk->lexeme, "Reached EOF while lexing") ;
			break ;
 
		case EOF_COMMENT :
			retract (twinBuf) ;
			resetBeginPointer (twinBuf) ;
			tk->lineNumber = twinBuf->lineNumber ;
			nextChar (twinBuf) ;

			tk->lexeme = (char *) malloc (sizeof(char) * (strlen("EOF encountered before end of comment") + 1)) ;
			strcpy (tk->lexeme , "EOF encountered before end of comment") ;
			break ;
 
		case RANGEOP_ERR :
			tk->lexeme = (char *) malloc (sizeof(char) * (strlen("Expected '.'")+1)) ;
			strcpy (tk->lexeme, "Expected '.'") ;
			break ;
 
		case EQ_EXPECTED :
			tk->lexeme = (char *) malloc (sizeof(char) * (strlen("Expected '='") + 1)) ;
			strcpy (tk->lexeme, "Expected '='") ;
			break ;
 
		case TOO_LONG_ID :
			tk->lexeme = (char *) malloc (sizeof(char) * (strlen("Identifier longer than 20 characters") + 1)) ;
			strcpy (tk->lexeme, "Identifier longer than 20 characters") ;
			break ;
 
		case RNUM_DIG_EXPECTED :
			tk->lexeme = (char *) malloc (sizeof(char) * (strlen("Digit expected in real number") + 1)) ;
			strcpy (tk->lexeme, "Digit expected in real number") ;
			break ;
 
		case RNUM_DIGORSIGN_EXPECTED :
			tk->lexeme = (char *) malloc (sizeof(char) * (strlen("Digit or +/- expected in real number") + 1)) ;
			strcpy (tk->lexeme, "Digit or +/- expected in real number") ;
			break ;
	}

	nextChar (twinBuf) ;
	resetBeginPointer (twinBuf) ;
 
	return tk ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r15d
pushq $0x18
popq %rdi
callq 0x1110
movq %rax, %r14
movl $0x6e, (%rax)
movq %rbx, %rdi
callq 0x6e90
movl %eax, 0x10(%r14)
cmpl $0x7, %r15d
ja 0x70da
movl %r15d, %eax
leaq 0x8d51(%rip), %rcx      # 0xfc70
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
pushq $0xf
popq %rdi
callq 0x1110
movq %rax, 0x8(%r14)
movabsq $0x206e776f6e6b6e55, %rcx # imm = 0x206E776F6E6B6E55
movq %rcx, (%rax)
movabsq $0x6c6f626d795320, %rcx # imm = 0x6C6F626D795320
movq %rcx, 0x7(%rax)
jmp 0x70da
pushq $0x25
popq %rdi
callq 0x1110
movq %rax, 0x8(%r14)
movups 0x8fa7(%rip), %xmm0     # 0xff0e
movups %xmm0, (%rax)
movups 0x8fad(%rip), %xmm0     # 0xff1e
movups %xmm0, 0x10(%rax)
movabsq $0x73726574636172, %rcx # imm = 0x73726574636172
jmp 0x70d6
pushq $0xd
popq %rdi
callq 0x1110
movq %rax, 0x8(%r14)
movabsq $0x6465746365707845, %rcx # imm = 0x6465746365707845
movq %rcx, (%rax)
movabsq $0x273d2720646574, %rcx # imm = 0x273D2720646574
jmp 0x7082
movq %rbx, %rdi
callq 0x7107
movl 0x28(%rbx), %ecx
movq 0x20(%rbx), %rax
cmpl 0x2c(%rbx), %ecx
je 0x6fc7
movl $0x1, 0x28(%rbx)
movq %rax, 0x18(%rbx)
movl 0x30(%rbx), %eax
movl %eax, 0x10(%r14)
movq %rbx, %rdi
callq 0x716a
pushq $0x26
popq %rdi
callq 0x1110
movq %rax, 0x8(%r14)
movups 0x8ee1(%rip), %xmm0     # 0xfece
movups %xmm0, (%rax)
movups 0x8ee7(%rip), %xmm0     # 0xfede
movups %xmm0, 0x10(%rax)
movabsq $0x746e656d6d6f63, %rcx # imm = 0x746E656D6D6F63
movq %rcx, 0x1e(%rax)
jmp 0x70da
movq %rbx, %rdi
callq 0x7107
movl 0x28(%rbx), %ecx
movq 0x20(%rbx), %rax
cmpl 0x2c(%rbx), %ecx
je 0x7029
movl $0x1, 0x28(%rbx)
movq %rax, 0x18(%rbx)
movl 0x30(%rbx), %eax
movl %eax, 0x10(%r14)
movq %rbx, %rdi
callq 0x716a
pushq $0x19
popq %rdi
callq 0x1110
movq %rax, 0x8(%r14)
movups 0x8e66(%rip), %xmm0     # 0xfeb5
movups %xmm0, (%rax)
movups 0x8e65(%rip), %xmm0     # 0xfebe
movups %xmm0, 0x9(%rax)
jmp 0x70da
pushq $0xd
popq %rdi
callq 0x1110
movq %rax, 0x8(%r14)
movabsq $0x6465746365707845, %rcx # imm = 0x6465746365707845
movq %rcx, (%rax)
movabsq $0x272e2720646574, %rcx # imm = 0x272E2720646574
movq %rcx, 0x5(%rax)
jmp 0x70da
pushq $0x1e
popq %rdi
callq 0x1110
movq %rax, 0x8(%r14)
movups 0x8e98(%rip), %xmm0     # 0xff33
movups %xmm0, (%rax)
movups 0x8e9c(%rip), %xmm0     # 0xff41
movups %xmm0, 0xe(%rax)
jmp 0x70da
pushq $0x25
popq %rdi
callq 0x1110
movq %rax, 0x8(%r14)
movups 0x8e93(%rip), %xmm0     # 0xff51
movups %xmm0, (%rax)
movups 0x8e99(%rip), %xmm0     # 0xff61
movups %xmm0, 0x10(%rax)
movabsq $0x7265626d756e20, %rcx # imm = 0x7265626D756E20
movq %rcx, 0x1d(%rax)
movq %rbx, %rdi
callq 0x716a
movl 0x28(%rbx), %ecx
movq 0x20(%rbx), %rax
cmpl 0x2c(%rbx), %ecx
je 0x70f5
movl $0x1, 0x28(%rbx)
movq %rax, 0x18(%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq