// File: /workspace/github_cpp_makefile_star2_O1/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, %rbx
movq %rdi, %r14
leaq 0x120(%rdi), %rax
movq %rax, 0x8(%rsp)
leaq 0x121(%rdi), %r15
movq 0x1120(%rdi), %rax
cmpq $0x4, %rax
jl 0x18ab9
leaq (%r14,%rax), %r13
addq $0x11e, %r13            # imm = 0x11E
movsbl %sil, %edx
xorl %eax, %eax
movl %edx, 0x14(%rsp)
cmpb $0x22, %dl
sete %al
testl %ecx, %ecx
movl $0x2, %ecx
movl $0xc, %edx
cmovel %ecx, %edx
orl %eax, %edx
movl %edx, 0x10(%rsp)
xorl %r12d, %r12d
movq %r14, %rdi
callq 0x17b5e
cmpl $0x5c, %eax
je 0x18999
cmpl $-0x1, %eax
jne 0x189be
movl $0xe, (%rbx)
movb $0x0, (%r15)
movl 0x8(%r14), %eax
movl %eax, 0x4(%rbx)
movq %r15, %rax
subq 0x8(%rsp), %rax
movl 0xc(%r14), %ecx
subl %eax, %ecx
movl %ecx, 0x8(%rbx)
incq %rax
movl $0x1, %ecx
xorl %ebp, %ebp
cmpq 0x1120(%r14), %rax
jb 0x18aab
movl $0xb, (%rbx)
jmp 0x18aab
movq %r14, %rdi
callq 0x17b5e
movl $0x2, %ecx
cmpl $0xa, %eax
je 0x18aab
movq %r14, %rdi
movl %eax, %esi
callq 0x17bab
movl $0x5c, %eax
cmpl $0xa, %eax
jne 0x189d5
testl %r12d, %r12d
je 0x18a38
movl $0x2, %ecx
xorl %r12d, %r12d
jmp 0x18aab
xorl %ecx, %ecx
testl %r12d, %r12d
movl $0x0, %r12d
jne 0x18a94
cmpl 0x14(%rsp), %eax
jne 0x18a8a
incl 0xc(%r14)
movb %al, (%r15)
movb $0x0, 0x1(%r15)
incq %r15
movl 0x10(%rsp), %eax
movl %eax, (%rbx)
movl 0x8(%r14), %eax
movl %eax, 0x4(%rbx)
movq %r15, %rax
subq 0x8(%rsp), %rax
movl 0xc(%r14), %ecx
subl %eax, %ecx
movl %ecx, 0x8(%rbx)
incq %rax
movl $0x1, %ecx
cmpq 0x1120(%r14), %rax
jae 0x18aa0
xorl %r12d, %r12d
movl $0x1, %ebp
jmp 0x18aab
movq %r14, %rdi
movl $0xa, %esi
callq 0x17bab
movl $0xa, (%rbx)
incl 0xc(%r14)
movb $0x0, (%r15)
incq %r15
movl 0x8(%r14), %eax
movl %eax, 0x4(%rbx)
movq %r15, %rax
subq 0x8(%rsp), %rax
movl 0xc(%r14), %ecx
subl %eax, %ecx
movl %ecx, 0x8(%rbx)
incq %rax
movl $0x1, %ecx
xorl %r12d, %r12d
cmpq 0x1120(%r14), %rax
jb 0x18aa9
movl $0xb, (%rbx)
jmp 0x18aa9
xorl %r12d, %r12d
cmpl $0x5c, %eax
sete %r12b
incl 0xc(%r14)
movb %al, (%r15)
incq %r15
jmp 0x18aab
movl $0xb, (%rbx)
xorl %r12d, %r12d
xorl %ebp, %ebp
testb $0x1, %cl
jne 0x18af1
cmpq %r13, %r15
jb 0x18943
movb $0x0, 0x111f(%r14)
movl $0xb, (%rbx)
movl 0x8(%r14), %eax
movl %eax, 0x4(%rbx)
subq 0x8(%rsp), %r15
movl 0xc(%r14), %eax
subl %r15d, %eax
movl %eax, 0x8(%rbx)
incq %r15
xorl %ebp, %ebp
cmpq 0x1120(%r14), %r15
jb 0x18af1
movl $0xb, (%rbx)
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq