// File: /workspace/github_c_makefile_star2_O3/lucvoo[P]sparse-dev/tokenize.c
// Function: show_token
const char *show_token(const struct token *token)
{
	static char buffer[256];

	if (!token)
		return "<no token>";
	switch (token_type(token)) {
	case TOKEN_ERROR:
		return "syntax error";

	case TOKEN_EOF:
		return "end-of-input";

	case TOKEN_IDENT:
	case TOKEN_ZERO_IDENT:
		return show_ident(token->ident);

	case TOKEN_NUMBER:
		return token->number;

	case TOKEN_SPECIAL:
		return show_special(token->special);

	case TOKEN_CHAR: 
		return show_char(token->string->data,
			token->string->length - 1, 0, '\'');
	case TOKEN_CHAR_EMBEDDED_0 ... TOKEN_CHAR_EMBEDDED_3:
		return show_char(token->embedded,
			token_type(token) - TOKEN_CHAR, 0, '\'');
	case TOKEN_WIDE_CHAR: 
		return show_char(token->string->data,
			token->string->length - 1, 'L', '\'');
	case TOKEN_WIDE_CHAR_EMBEDDED_0 ... TOKEN_WIDE_CHAR_EMBEDDED_3:
		return show_char(token->embedded,
			token_type(token) - TOKEN_WIDE_CHAR, 'L', '\'');
	case TOKEN_STRING: 
		return show_char(token->string->data,
			token->string->length - 1, 0, '"');
	case TOKEN_WIDE_STRING: 
		return show_char(token->string->data,
			token->string->length - 1, 'L', '"');

	case TOKEN_STREAMBEGIN:
		sprintf(buffer, "<beginning of '%s'>", stream_name(token->pos.stream));
		return buffer;

	case TOKEN_STREAMEND:
		sprintf(buffer, "<end of '%s'>", stream_name(token->pos.stream));
		return buffer;

	case TOKEN_UNTAINT:
		sprintf(buffer, "<untaint>");
		return buffer;

	case TOKEN_ARG_COUNT:
		sprintf(buffer, "<argcnt>");
		return buffer;

	default:
		sprintf(buffer, "unhandled token type '%d' ", token_type(token));
		return buffer;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2dff1
movq %rdi, %rsi
movq (%rdi), %r14
movl %r14d, %edx
andl $0x3f, %edx
cmpl $0x1b, %edx
ja 0x2e143
leaq 0x1a0ab(%rip), %rax     # 0x48060
movslq (%rax,%rdx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
addq $0x10, %rsi
andl $0x3f, %r14d
leaq -0x6(%r14), %rdx
movb $0x27, 0x5862f(%rip)    # 0x86600
leaq 0x58628(%rip), %rbx     # 0x86600
leaq 0x58622(%rip), %rdi     # 0x86601
callq 0xe1e0
movw $0x27, -0x5(%r14,%rbx)
jmp 0x2e28d
leaq 0x1a43c(%rip), %rbx     # 0x48434
jmp 0x2e28d
addq $0x10, %rsi
andl $0x3f, %r14d
leaq -0xb(%r14), %rdx
movw $0x274c, 0x585ee(%rip)  # imm = 0x274C
leaq 0x585e7(%rip), %rbx     # 0x86600
leaq 0x585e2(%rip), %rdi     # 0x86602
callq 0xe1e0
movw $0x27, -0x9(%r14,%rbx)
jmp 0x2e28d
movq 0x10(%rsi), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2de35
shrl $0x6, %r14d
andl $0x3fff, %r14d          # imm = 0x3FFF
cmpl %r14d, 0x3ff4c(%rip)    # 0x6dfa0
jge 0x2e239
leaq 0x1a3af(%rip), %rdx     # 0x48410
jmp 0x2e24f
movabsq $0x3e746e636772613c, %rax # imm = 0x3E746E636772613C
movq %rax, 0x48359(%rip)     # 0x763d0
movb $0x0, 0x4835a(%rip)     # 0x763d8
jmp 0x2e230
movq 0x10(%rsi), %rsi
movl (%rsi), %r14d
addq $0x4, %rsi
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
leaq -0x1(%r14), %rdx
movw $0x274c, 0x5855e(%rip)  # imm = 0x274C
leaq 0x58557(%rip), %rbx     # 0x86600
leaq 0x58552(%rip), %rdi     # 0x86602
callq 0xe1e0
movw $0x27, 0x1(%r14,%rbx)
jmp 0x2e28d
movq 0x10(%rsi), %rsi
movl (%rsi), %r14d
addq $0x4, %rsi
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
leaq -0x1(%r14), %rdx
movb $0x27, 0x58521(%rip)    # 0x86600
leaq 0x5851a(%rip), %rbx     # 0x86600
leaq 0x58514(%rip), %rdi     # 0x86601
callq 0xe1e0
movw $0x27, (%r14,%rbx)
jmp 0x2e28d
leaq 0x1a347(%rip), %rbx     # 0x4844c
jmp 0x2e28d
leaq 0x1a32e(%rip), %rbx     # 0x4843f
jmp 0x2e28d
shrl $0x6, %r14d
andl $0x3fff, %r14d          # imm = 0x3FFF
cmpl %r14d, 0x3fe78(%rip)    # 0x6dfa0
jge 0x2e25f
leaq 0x1a2db(%rip), %rdx     # 0x48410
jmp 0x2e275
movq 0x10(%rsi), %rbx
jmp 0x2e28d
leaq 0x48286(%rip), %rbx     # 0x763d0
leaq 0x1a33d(%rip), %rsi     # 0x4848e
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe2c0
jmp 0x2e28d
movq 0x10(%rsi), %rsi
movl (%rsi), %r14d
addq $0x4, %rsi
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
leaq -0x1(%r14), %rdx
movb $0x22, 0x58483(%rip)    # 0x86600
leaq 0x5847c(%rip), %rbx     # 0x86600
leaq 0x58476(%rip), %rdi     # 0x86601
callq 0xe1e0
movw $0x22, (%r14,%rbx)
jmp 0x2e28d
movl 0x10(%rsi), %eax
movb %al, 0x3fe0b(%rip)      # 0x6dfb0
movb $0x0, 0x3fe05(%rip)     # 0x6dfb1
cmpl $0x100, %eax            # imm = 0x100
jl 0x2e298
addl $0xffffff00, %eax       # imm = 0xFFFFFF00
leaq 0x3669d(%rip), %rcx     # 0x64860
leaq (%rcx,%rax,4), %rsi
leaq 0x3fde2(%rip), %rdi     # 0x6dfb0
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe090
movq 0x10(%rsi), %rsi
movl (%rsi), %r14d
addq $0x4, %rsi
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
leaq -0x1(%r14), %rdx
movw $0x224c, 0x58407(%rip)  # imm = 0x224C
leaq 0x58400(%rip), %rbx     # 0x86600
leaq 0x583fb(%rip), %rdi     # 0x86602
callq 0xe1e0
movw $0x22, 0x1(%r14,%rbx)
jmp 0x2e28d
movabsq $0x746e6961746e753c, %rax # imm = 0x746E6961746E753C
movq %rax, 0x481a9(%rip)     # 0x763d0
movw $0x3e, 0x481a8(%rip)    # 0x763d8
leaq 0x48199(%rip), %rax     # 0x763d0
jmp 0x2e290
movq 0x3fd68(%rip), %rax     # 0x6dfa8
movl %r14d, %ecx
leaq (%rcx,%rcx,4), %rcx
shll $0x4, %ecx
movq 0x8(%rax,%rcx), %rdx
leaq 0x4817a(%rip), %rbx     # 0x763d0
leaq 0x1a1fc(%rip), %rsi     # 0x48459
jmp 0x2e283
movq 0x3fd42(%rip), %rax     # 0x6dfa8
movl %r14d, %ecx
leaq (%rcx,%rcx,4), %rcx
shll $0x4, %ecx
movq 0x8(%rax,%rcx), %rdx
leaq 0x48154(%rip), %rbx     # 0x763d0
leaq 0x1a1ea(%rip), %rsi     # 0x4846d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe2c0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x3fd11(%rip), %rbx     # 0x6dfb0
jmp 0x2e28d