// File: /workspace/github_c_makefile_star2_O3/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
movl $0x18, %edi
callq 0x1120
movq %rax, %r14
movl $0x6e, (%rax)
movq %rbx, %rdi
callq 0x742d
movl %eax, 0x10(%r14)
cmpl $0x7, %r15d
ja 0x768c
movl %r15d, %eax
leaq 0x97b2(%rip), %rcx      # 0x10c70
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0xf, %edi
callq 0x1120
movq %rax, 0x8(%r14)
movabsq $0x206e776f6e6b6e55, %rcx # imm = 0x206E776F6E6B6E55
movq %rcx, (%rax)
movabsq $0x6c6f626d795320, %rcx # imm = 0x6C6F626D795320
movq %rcx, 0x7(%rax)
jmp 0x768c
movl $0x25, %edi
callq 0x1120
movq %rax, 0x8(%r14)
movups 0x9a04(%rip), %xmm0     # 0x10f0e
movups %xmm0, (%rax)
movups 0x9a0a(%rip), %xmm0     # 0x10f1e
movups %xmm0, 0x10(%rax)
movabsq $0x73726574636172, %rcx # imm = 0x73726574636172
jmp 0x7688
movl $0xd, %edi
callq 0x1120
movq %rax, 0x8(%r14)
movabsq $0x6465746365707845, %rcx # imm = 0x6465746365707845
movq %rcx, (%rax)
movabsq $0x273d2720646574, %rcx # imm = 0x273D2720646574
jmp 0x7630
movq %rbx, %rdi
callq 0x76b9
movl 0x28(%rbx), %ecx
movq 0x20(%rbx), %rax
cmpl 0x2c(%rbx), %ecx
je 0x756c
movl $0x1, 0x28(%rbx)
movq %rax, 0x18(%rbx)
movl 0x30(%rbx), %eax
movl %eax, 0x10(%r14)
movq %rbx, %rdi
callq 0x771f
movl $0x26, %edi
callq 0x1120
movq %rax, 0x8(%r14)
movups 0x993a(%rip), %xmm0     # 0x10ece
movups %xmm0, (%rax)
movups 0x9940(%rip), %xmm0     # 0x10ede
movups %xmm0, 0x10(%rax)
movabsq $0x746e656d6d6f63, %rcx # imm = 0x746E656D6D6F63
movq %rcx, 0x1e(%rax)
jmp 0x768c
movq %rbx, %rdi
callq 0x76b9
movl 0x28(%rbx), %ecx
movq 0x20(%rbx), %rax
cmpl 0x2c(%rbx), %ecx
je 0x75d0
movl $0x1, 0x28(%rbx)
movq %rax, 0x18(%rbx)
movl 0x30(%rbx), %eax
movl %eax, 0x10(%r14)
movq %rbx, %rdi
callq 0x771f
movl $0x19, %edi
callq 0x1120
movq %rax, 0x8(%r14)
movups 0x98bd(%rip), %xmm0     # 0x10eb5
movups %xmm0, (%rax)
movups 0x98bc(%rip), %xmm0     # 0x10ebe
movups %xmm0, 0x9(%rax)
jmp 0x768c
movl $0xd, %edi
callq 0x1120
movq %rax, 0x8(%r14)
movabsq $0x6465746365707845, %rcx # imm = 0x6465746365707845
movq %rcx, (%rax)
movabsq $0x272e2720646574, %rcx # imm = 0x272E2720646574
movq %rcx, 0x5(%rax)
jmp 0x768c
movl $0x1e, %edi
callq 0x1120
movq %rax, 0x8(%r14)
movups 0x98e8(%rip), %xmm0     # 0x10f33
movups %xmm0, (%rax)
movups 0x98ec(%rip), %xmm0     # 0x10f41
movups %xmm0, 0xe(%rax)
jmp 0x768c
movl $0x25, %edi
callq 0x1120
movq %rax, 0x8(%r14)
movups 0x98e1(%rip), %xmm0     # 0x10f51
movups %xmm0, (%rax)
movups 0x98e7(%rip), %xmm0     # 0x10f61
movups %xmm0, 0x10(%rax)
movabsq $0x7265626d756e20, %rcx # imm = 0x7265626D756E20
movq %rcx, 0x1d(%rax)
movq %rbx, %rdi
callq 0x771f
movl 0x28(%rbx), %ecx
movq 0x20(%rbx), %rax
cmpl 0x2c(%rbx), %ecx
je 0x76a7
movl $0x1, 0x28(%rbx)
movq %rax, 0x18(%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq