// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/tokenizer.c
// Function: get_string
static int get_string(struct tokenizer *t, char quote_char, struct token* out, int wide) {
	char *s = t->buf+1;
	int escaped = 0;
	char *end = t->buf + t->bufsize - 2;
	while(s < end) {
		int c = tokenizer_getc(t);
		if(c == EOF) {
			out->type = TT_EOF;
			*s = 0;
			return apply_coords(t, out, s, 0);
		}
		if(c == '\\') {
			c = tokenizer_getc(t);
			if(c == '\n') continue;
			tokenizer_ungetc(t, c);
			c = '\\';
		}
		if(c == '\n') {
			if(escaped) {
				escaped = 0;
				continue;
			}
			tokenizer_ungetc(t, c);
			out->type = TT_UNKNOWN;
			s = assign_bufchar(t, s, 0);
			return apply_coords(t, out, s, 0);
		}
		if(!escaped) {
			if(c == quote_char) {
				s = assign_bufchar(t, s, c);
				*s = 0;
				//s = assign_bufchar(t, s, 0);
				if(!wide)
					out->type = (quote_char == '"'? TT_DQSTRING_LIT : TT_SQSTRING_LIT);
				else
					out->type = (quote_char == '"'? TT_WIDESTRING_LIT : TT_WIDECHAR_LIT);
				return apply_coords(t, out, s, 1);
			}
			if(c == '\\') escaped = 1;
		} else {
			escaped = 0;
		}
		s = assign_bufchar(t, s, c);
	}
	t->buf[MAX_TOK_LEN-1] = 0;
	out->type = TT_OVERFLOW;
	return apply_coords(t, out, s, 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, (%rsp)
movq %rdi, %r14
leaq 0x120(%rdi), %rbp
leaq 0x121(%rdi), %r13
movq 0x1120(%rdi), %rax
cmpq $0x4, %rax
jl 0x186d0
movl %ecx, 0x10(%rsp)
leaq (%r14,%rax), %r15
addq $0x11e, %r15            # imm = 0x11E
movl %esi, 0xc(%rsp)
movsbl %sil, %eax
movl %eax, 0x14(%rsp)
xorl %ebx, %ebx
movq %r14, %rdi
callq 0x17901
cmpl $0xa, %eax
je 0x1868f
movl %eax, %r12d
cmpl $0x5c, %eax
je 0x1867e
cmpl $-0x1, %r12d
jne 0x186a4
jmp 0x18704
movq %r14, %rdi
callq 0x17901
cmpl $0xa, %eax
jne 0x1869a
movl %ebx, %eax
jmp 0x186c9
xorl %eax, %eax
testl %ebx, %ebx
jne 0x186c9
jmp 0x1872c
movq %r14, %rdi
movl %eax, %esi
callq 0x17957
xorl %eax, %eax
testl %ebx, %ebx
jne 0x186be
cmpl 0x14(%rsp), %r12d
je 0x18771
xorl %eax, %eax
cmpl $0x5c, %r12d
sete %al
incl 0xc(%r14)
movb %r12b, (%r13)
incq %r13
movl %eax, %ebx
cmpq %r15, %r13
jb 0x1865e
movb $0x0, 0x111f(%r14)
movq (%rsp), %rcx
movl $0xb, (%rcx)
movl 0x8(%r14), %eax
movl %eax, 0x4(%rcx)
subl %r13d, %ebp
addl 0xc(%r14), %ebp
movl %ebp, 0x8(%rcx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rcx
movl $0xe, (%rcx)
movb $0x0, (%r13)
movl 0x8(%r14), %eax
movl %eax, 0x4(%rcx)
subq %rbp, %r13
movl 0xc(%r14), %eax
subl %r13d, %eax
movl %eax, 0x8(%rcx)
incq %r13
jmp 0x18766
movq %r14, %rdi
movl $0xa, %esi
callq 0x17957
movq (%rsp), %rcx
movl $0xa, (%rcx)
incl 0xc(%r14)
movb $0x0, (%r13)
movl 0x8(%r14), %eax
movl %eax, 0x4(%rcx)
subq %rbp, %r13
movl %r13d, %eax
notl %eax
addl 0xc(%r14), %eax
movl %eax, 0x8(%rcx)
addq $0x2, %r13
cmpq 0x1120(%r14), %r13
jb 0x186f3
jmp 0x187d0
incl 0xc(%r14)
movl 0xc(%rsp), %ecx
movb %cl, (%r13)
movb $0x0, 0x1(%r13)
incq %r13
xorl %eax, %eax
cmpb $0x22, %cl
sete %al
cmpl $0x0, 0x10(%rsp)
movl $0x2, %ecx
movl $0xc, %edx
cmovel %ecx, %edx
orl %eax, %edx
movq (%rsp), %rcx
movl %edx, (%rcx)
movl 0x8(%r14), %eax
movl %eax, 0x4(%rcx)
subq %rbp, %r13
movl 0xc(%r14), %eax
subl %r13d, %eax
movl %eax, 0x8(%rcx)
incq %r13
movl $0x1, %eax
cmpq 0x1120(%r14), %r13
jb 0x186f5
movl $0xb, (%rcx)
jmp 0x186f3