// File: /workspace/github_c_makefile_star2_O0/haxlang[P]hax/haxParse.c
// Function: HaxParseQuotes
int
HaxParseQuotes(
    Hax_Interp *interp,		/* Interpreter to use for nested command
				 * evaluations and error messages. */
    char *string,		/* Character just after opening double-
				 * quote. */
    int termChar,		/* Character that terminates "quoted" string
				 * (usually double-quote, but sometimes
				 * right-paren or something else). */
    int flags,			/* Flags to pass to nested Hax_Eval calls. */
    char **termPtr,		/* Store address of terminating character
				 * here. */
    ParseValue *pvPtr		/* Information about where to place
				 * fully-substituted result of parse. */)
{
    char *src, *dst, c;

    src = string;
    dst = pvPtr->next;

    while (1) {
	if (dst == pvPtr->end) {
	    /*
	     * Target buffer space is about to run out.  Make more space.
	     */

	    pvPtr->next = dst;
	    (*pvPtr->expandProc)(interp, pvPtr, 1);
	    dst = pvPtr->next;
	}

	c = *src;
	src++;
	if (c == termChar) {
	    *dst = '\0';
	    pvPtr->next = dst;
	    *termPtr = src;
	    return HAX_OK;
	} else if (CHAR_TYPE(c) == HAX_NORMAL) {
	    copy:
	    *dst = c;
	    dst++;
	    continue;
	} else if (c == '$') {
	    int length;
	    char *value;

	    value = Hax_ParseVar(interp, src-1, termPtr);
	    if (value == NULL) {
		return HAX_ERROR;
	    }
	    src = *termPtr;
	    length = strlen(value);
	    if ((pvPtr->end - dst) <= length) {
		pvPtr->next = dst;
		(*pvPtr->expandProc)(interp, pvPtr, length);
		dst = pvPtr->next;
	    }
	    strcpy(dst, value);
	    dst += length;
	    continue;
	} else if (c == '[') {
	    int result;

	    pvPtr->next = dst;
	    result = HaxParseNestedCmd(interp, src, flags, termPtr, pvPtr);
	    if (result != HAX_OK) {
		return result;
	    }
	    src = *termPtr;
	    dst = pvPtr->next;
	    continue;
	} else if (c == '\\') {
	    int numRead;

	    src--;
	    *dst = Hax_Backslash(src, &numRead);
	    if (*dst != 0) {
		dst++;
	    }
	    src += numRead;
	    continue;
	} else if (c == '\0') {
	    Hax_ResetResult(interp);
	    sprintf(interp->result, "missing %c", termChar);
	    *termPtr = string-1;
	    return HAX_ERROR;
	} else {
	    goto copy;
	}
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x30(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x1547f
movq -0x40(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl $0x1, %edx
callq *%rax
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movb (%rax), %al
movb %al, -0x41(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movsbl -0x41(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jne 0x154c7
movq -0x40(%rbp), %rax
movb $0x0, (%rax)
movq -0x40(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x156b0
movsbq -0x41(%rbp), %rcx
movq 0xdae5(%rip), %rax      # 0x22fb8
movsbl 0x80(%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x154fc
jmp 0x154e2
movb -0x41(%rbp), %cl
movq -0x40(%rbp), %rax
movb %cl, (%rax)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x15442
movsbl -0x41(%rbp), %eax
cmpl $0x24, %eax
jne 0x155b4
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
addq $-0x1, %rsi
movq -0x28(%rbp), %rdx
callq 0x43e0
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x15535
movl $0x1, -0x4(%rbp)
jmp 0x156b0
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x50(%rbp), %rdi
callq 0x41b0
movl %eax, -0x48(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x40(%rbp), %rcx
subq %rcx, %rax
movslq -0x48(%rbp), %rcx
cmpq %rcx, %rax
jg 0x15591
movq -0x40(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl -0x48(%rbp), %edx
callq *%rax
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x40d0
movl -0x48(%rbp), %ecx
movq -0x40(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
jmp 0x15442
movsbl -0x41(%rbp), %eax
cmpl $0x5b, %eax
jne 0x15611
movq -0x40(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl -0x20(%rbp), %edx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0x4620
movl %eax, -0x54(%rbp)
cmpl $0x0, -0x54(%rbp)
je 0x155f5
movl -0x54(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x156b0
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x15442
movsbl -0x41(%rbp), %eax
cmpl $0x5c, %eax
jne 0x15669
movq -0x38(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x42a0
movb %al, %cl
movq -0x40(%rbp), %rax
movb %cl, (%rax)
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x15653
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movl -0x58(%rbp), %ecx
movq -0x38(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
jmp 0x15442
movsbl -0x41(%rbp), %eax
cmpl $0x0, %eax
jne 0x156ab
movq -0x10(%rbp), %rdi
callq 0x42b0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl -0x1c(%rbp), %edx
leaq 0x9b64(%rip), %rsi      # 0x1f1f0
movb $0x0, %al
callq 0x45d0
movq -0x18(%rbp), %rcx
addq $-0x1, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x156b0
jmp 0x154e2
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)