// File: /workspace/github_c_makefile_star2_O3/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), %r12
xorl %eax, %eax
cmpl $0x10, %edx
setb %al
leal (%rax,%rax,4), %eax
addl $0x22, %eax
xorl %ebp, %ebp
movl %eax, 0x4(%rsp)
cmpl %edi, %eax
je 0x2f40d
movl %edi, %r13d
movq %rdx, 0x8(%rsp)
movq %r12, 0x10(%rsp)
movabsq $0x100000000, %rax      # imm = 0x100000000
xorl %ecx, %ecx
xorl %ebp, %ebp
xorl %r12d, %r12d
movq %rcx, %r15
movq %rax, %r14
cmpq $0x1ffe, %rcx           # imm = 0x1FFE
ja 0x2f246
leaq 0x5e3de(%rip), %rax     # 0x8d620
movb %r13b, (%r15,%rax)
cmpl $-0x1, %r13d
je 0x2f495
cmpl $0xa, %r13d
je 0x2f309
testb $0x1, %bpl
je 0x2f26f
xorl %r12d, %r12d
cmpl $0x78, %r13d
sete %r12b
xorl %ebp, %ebp
jmp 0x2f2d9
testl %r12d, %r12d
je 0x2f2ce
movl %r13d, %eax
leaq 0x18fa2(%rip), %rcx     # 0x48220
testb $0x4, 0x1(%rax,%rcx)
jne 0x2f2ce
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 0x192e2(%rip), %rsi     # 0x485a9
xorl %eax, %eax
callq 0x118fc
cmpl $0x5c, %r13d
sete %bpl
xorl %r12d, %r12d
movq %rbx, %rdi
callq 0x2ee53
movl %eax, %r13d
cmpl 0x4(%rsp), %eax
setne %dl
orb %bpl, %dl
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %r14, %rax
leaq 0x1(%r15), %rcx
testb %dl, %dl
jne 0x2f22c
jmp 0x2f354
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 0x1921f(%rip), %rsi     # 0x48568
movl 0x4(%rsp), %edx
xorl %eax, %eax
callq 0x118fc
leaq 0x1(%r15), %rbp
testl %r12d, %r12d
je 0x2f3a4
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 0x1920c(%rip), %rsi     # 0x485a9
xorl %eax, %eax
callq 0x118fc
cmpl $0x2000, %ebp           # imm = 0x2000
movq 0x10(%rsp), %r12
jl 0x2f4f0
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 0x191d9(%rip), %rsi     # 0x485ce
movl %ebp, %edx
movl $0x1fff, %ecx           # imm = 0x1FFF
xorl %eax, %eax
callq 0x118fc
movl $0x1fff, %ebp           # imm = 0x1FFF
movq 0x8(%rsp), %rdx
movq (%r12), %rax
andl $0x3f, %edx
andq $-0x40, %rax
orq %rdx, %rax
movq %rax, (%r12)
movq %rbp, %r15
incl %ebp
movl %ebp, %edi
callq 0x2fabb
movq %rax, %r14
leaq 0x4(%rax), %rdi
movslq %r15d, %r15
leaq 0x5e1e4(%rip), %rsi     # 0x8d620
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 0x2ee53
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 0x190b4(%rip), %rsi     # 0x48589
xorl %eax, %eax
callq 0x118fc
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rdx
cmpl $0xf, %edx
ja 0x2f40d
cmpl $-0x1, %r15d
je 0x2f40d
cmpl $0x5, %ebp
jge 0x2f40d
leal (%rdx,%r15), %eax
incl %eax
movq (%r12), %rcx
andl $0x3f, %eax
andq $-0x40, %rcx
orq %rax, %rcx
movq %rcx, (%r12)
sarq $0x20, %r14
leaq 0x5e0ec(%rip), %rdi     # 0x8d620
addq %r14, %rdi
movl $0x3, %edx
subl %r15d, %edx
xorl %esi, %esi
callq 0xe130
movl 0x5e0d4(%rip), %eax     # 0x8d620
movl %eax, 0x10(%r12)
jmp 0x2f462
nop