// File: /workspace/github_c_makefile_star2_O1/lucvoo[P]sparse-dev/tokenize.c
// Function: eat_string
static int eat_string(int next, stream_t *stream, enum token_type type)
{
	static char buffer[MAX_STRING];
	struct string *string;
	struct token *token = stream->token;
	int len = 0;
	int escape;
	int want_hex = 0;
	char delim = type < TOKEN_STRING ? '\'' : '"';

	for (escape = 0; escape || next != delim; next = nextchar(stream)) {
		if (len < MAX_STRING)
			buffer[len] = next;
		len++;
		if (next == '\n') {
			warning(stream_pos(stream),
				"missing terminating %c character", delim);
			/* assume delimiter is lost */
			break;
		}
		if (next == EOF) {
			warning(stream_pos(stream),
				"End of file in middle of string");
			return next;
		}
		if (!escape) {
			if (want_hex && !(cclass[next + 1] & Hex))
				warning(stream_pos(stream),
					"\\x used with no following hex digits");
			want_hex = 0;
			escape = next == '\\';
		} else {
			escape = 0;
			want_hex = next == 'x';
		}
	}
	if (want_hex)
		warning(stream_pos(stream),
			"\\x used with no following hex digits");
	if (len > MAX_STRING) {
		warning(stream_pos(stream), "string too long (%d bytes, %d bytes max)", len, MAX_STRING);
		len = MAX_STRING;
	}
	if (delim == '\'' && len && len <= 4) {
		token_type(token) = type + len;
		memset(buffer + len, '\0', 4 - len);
		memcpy(token->embedded, buffer, 4);
	} else {
		token_type(token) = type;
		string = __alloc_string(len+1);
		memcpy(string->data, buffer, len);
		string->data[len] = '\0';
		string->length = len+1;
		token->string = string;
	}

	/* Pass it on.. */
	token = stream->token;
	add_token(stream);
	return nextchar(stream);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq 0x28(%rsi), %r14
xorl %eax, %eax
movq %rdx, 0x10(%rsp)
cmpl $0x10, %edx
setb %al
leal (%rax,%rax,4), %ebp
addl $0x22, %ebp
xorl %r13d, %r13d
movl $0x0, %r15d
cmpl %edi, %ebp
je 0x2f9ae
movl %edi, %r12d
movq %r14, 0x8(%rsp)
xorl %r14d, %r14d
xorl %r15d, %r15d
xorl %r13d, %r13d
cmpq $0x1ffe, %r15           # imm = 0x1FFE
ja 0x2f8a9
leaq 0x5ed7b(%rip), %rax     # 0x8e620
movb %r12b, (%r15,%rax)
cmpl $-0x1, %r12d
je 0x2fb36
cmpl $0xa, %r12d
je 0x2f95d
testb $0x1, %r14b
je 0x2f8d3
xorl %r13d, %r13d
cmpl $0x78, %r12d
sete %r13b
xorl %r14d, %r14d
jmp 0x2f93d
testl %r13d, %r13d
je 0x2f932
movl %r12d, %eax
leaq 0x199de(%rip), %rcx     # 0x492c0
testb $0x4, 0x1(%rax,%rcx)
jne 0x2f932
movl 0xc(%rbx), %eax
movl 0x14(%rbx), %ecx
shll $0x6, %ecx
movl 0x18(%rbx), %edx
andl $0x1, %edx
shll $0x14, %edx
andl $0xfffc0, %ecx          # imm = 0xFFFC0
orl %edx, %ecx
movl 0x1c(%rbx), %edx
shll $0x16, %eax
andl $0x1, %edx
shll $0x15, %edx
orl %ecx, %edx
orl %eax, %edx
movl 0x10(%rbx), %edi
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl %eax, %edi
shlq $0x20, %rdi
orq %rdx, %rdi
leaq 0x19d0e(%rip), %rsi     # 0x49639
xorl %eax, %eax
callq 0x118b4
cmpl $0x5c, %r12d
sete %r14b
xorl %r13d, %r13d
movq %rbx, %rdi
callq 0x2f4dd
movl %eax, %r12d
cmpl %ebp, %eax
setne %al
orb %r14b, %al
incq %r15
testb %al, %al
jne 0x2f895
jmp 0x2f9a9
incl %r15d
movl 0xc(%rbx), %eax
movl 0x14(%rbx), %ecx
shll $0x6, %ecx
movl 0x18(%rbx), %edx
andl $0x1, %edx
shll $0x14, %edx
andl $0xfffc0, %ecx          # imm = 0xFFFC0
orl %edx, %ecx
movl 0x1c(%rbx), %edx
shll $0x16, %eax
andl $0x1, %edx
shll $0x15, %edx
orl %ecx, %edx
orl %eax, %edx
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
andl 0x10(%rbx), %edi
shlq $0x20, %rdi
orq %rdx, %rdi
leaq 0x19c58(%rip), %rsi     # 0x495f8
movl %ebp, %edx
xorl %eax, %eax
callq 0x118b4
movq 0x8(%rsp), %r14
testl %r13d, %r13d
je 0x2f9fa
movl 0xc(%rbx), %eax
movl 0x14(%rbx), %ecx
shll $0x6, %ecx
movl 0x18(%rbx), %edx
andl $0x1, %edx
shll $0x14, %edx
andl $0xfffc0, %ecx          # imm = 0xFFFC0
orl %edx, %ecx
movl 0x1c(%rbx), %edx
shll $0x16, %eax
andl $0x1, %edx
shll $0x15, %edx
orl %ecx, %edx
orl %eax, %edx
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
andl 0x10(%rbx), %edi
shlq $0x20, %rdi
orq %rdx, %rdi
leaq 0x19c46(%rip), %rsi     # 0x49639
xorl %eax, %eax
callq 0x118b4
cmpl $0x2000, %r15d          # imm = 0x2000
movq 0x10(%rsp), %r12
jl 0x2fa5d
movl 0xc(%rbx), %eax
movl 0x14(%rbx), %ecx
shll $0x6, %ecx
movl 0x18(%rbx), %edx
andl $0x1, %edx
shll $0x14, %edx
andl $0xfffc0, %ecx          # imm = 0xFFFC0
orl %edx, %ecx
movl 0x1c(%rbx), %edx
shll $0x16, %eax
andl $0x1, %edx
shll $0x15, %edx
orl %ecx, %edx
orl %eax, %edx
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
andl 0x10(%rbx), %edi
shlq $0x20, %rdi
orq %rdx, %rdi
leaq 0x19c16(%rip), %rsi     # 0x4965e
movl %r15d, %edx
movl $0x1fff, %ecx           # imm = 0x1FFF
xorl %eax, %eax
callq 0x118b4
movl $0x1fff, %r15d          # imm = 0x1FFF
cmpl $0xf, %r12d
ja 0x2faad
testl %r15d, %r15d
je 0x2faad
cmpl $0x4, %r15d
jg 0x2faad
addl %r15d, %r12d
movq (%r14), %rax
andl $0x3f, %r12d
andq $-0x40, %rax
orq %r12, %rax
movq %rax, (%r14)
movslq %r15d, %rax
leaq 0x5eb94(%rip), %rdi     # 0x8e620
addq %rax, %rdi
movl $0x4, %eax
subl %r15d, %eax
movslq %eax, %rdx
xorl %esi, %esi
callq 0xe130
movl 0x5eb79(%rip), %eax     # 0x8e620
movl %eax, 0x10(%r14)
jmp 0x2fb03
movq (%r14), %rax
andl $0x3f, %r12d
andq $-0x40, %rax
orq %r12, %rax
movq %rax, (%r14)
leal 0x1(%r15), %ebp
movl %ebp, %edi
callq 0x300ef
movq %r14, %r12
movq %rax, %r14
leaq 0x4(%rax), %rdi
movslq %r15d, %r15
leaq 0x5eb43(%rip), %rsi     # 0x8e620
movq %r15, %rdx
callq 0xe1e0
movb $0x0, 0x4(%r14,%r15)
movl $0x80000000, %eax       # imm = 0x80000000
andl (%r14), %eax
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
orl %ebp, %eax
movl %eax, (%r14)
movq %r14, 0x10(%r12)
movq 0x28(%rbx), %rax
xorl %ecx, %ecx
movq %rcx, 0x28(%rbx)
leaq 0x8(%rax), %rdx
movq %rcx, 0x8(%rax)
movq 0x20(%rbx), %rcx
movq %rax, (%rcx)
movq %rdx, 0x20(%rbx)
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2f4dd
movl 0xc(%rbx), %eax
movl 0x14(%rbx), %ecx
shll $0x6, %ecx
movl 0x18(%rbx), %edx
andl $0x1, %edx
shll $0x14, %edx
andl $0xfffc0, %ecx          # imm = 0xFFFC0
orl %edx, %ecx
movl 0x1c(%rbx), %edx
shll $0x16, %eax
andl $0x1, %edx
shll $0x15, %edx
orl %ecx, %edx
orl %eax, %edx
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
andl 0x10(%rbx), %edi
shlq $0x20, %rdi
orq %rdx, %rdi
leaq 0x19aa3(%rip), %rsi     # 0x49619
xorl %eax, %eax
callq 0x118b4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)