// File: /workspace/github_c_makefile_star2_O1/haxlang[P]hax/haxExpr.c
// Function: ExprParseString
static int
ExprParseString(
    Hax_Interp *interp,		/* Where to store error message. */
    char *string,		/* String to turn into value. */
    Value *valuePtr		/* Where to store value information.
				 * Caller must have initialized pv field. */)
{
    Interp *iPtr = (Interp *) interp;
    char c;

    /*
     * Try to convert the string to a number.
     */

    c = *string;
    if (((c >= '0') && (c <= '9')) || (c == '-') || (c == '.')) {
	char *term;

	valuePtr->type = TYPE_LLONG;
	iPtr->internalErrno = 0;
	valuePtr->llongValue = Strtol(iPtr, string, &term, 0);
	c = *term;
	if ((c == '\0') && (iPtr->internalErrno != HAX_ERANGE)) {
	    return HAX_OK;
	}
	if ((c == '.') || (c == 'e') || (c == 'E') ||
	    (iPtr->internalErrno == HAX_ERANGE)) {
	    iPtr->internalErrno = 0;
	    valuePtr->doubleValue = Strtod(iPtr, string, &term);
	    if (iPtr->internalErrno == HAX_ERANGE) {
		Hax_ResetResult(interp);
		if (valuePtr->doubleValue == 0.0) {
		    Hax_AppendResult(interp, "floating-point value \"",
			    string, "\" too small to represent",
			    (char *) NULL);
		} else {
		    Hax_AppendResult(interp, "floating-point value \"",
			    string, "\" too large to represent",
			    (char *) NULL);
		}
		return HAX_ERROR;
	    }
	    if (*term == '\0') {
		valuePtr->type = TYPE_DOUBLE;
		return HAX_OK;
	    }
	}
    }

    /*
     * Not a valid number.  Save a string value (but don't do anything
     * if it's already the value).
     */

    valuePtr->type = TYPE_STRING;
    if (string != valuePtr->pv.buffer) {
	int length, shortfall;

	length = strlen(string);
	valuePtr->pv.next = valuePtr->pv.buffer;
	shortfall = length - (valuePtr->pv.end - valuePtr->pv.buffer);
	if (shortfall > 0) {
	    (*valuePtr->pv.expandProc)(interp, &valuePtr->pv, shortfall);
	}
	strcpy(valuePtr->pv.buffer, string);
    }
    return HAX_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movb (%rsi), %al
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setae %cl
addb $-0x2d, %al
cmpb $0x2, %al
setae %al
testb %al, %cl
jne 0xd2a7
xorl %eax, %eax
movl %eax, 0xd0(%r14)
movl %eax, 0x278(%r15)
movq %rsp, %r12
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x43c0
movq %rax, (%r14)
movq (%r12), %rax
movzbl (%rax), %ecx
leal -0x2e(%rcx), %eax
cmpl $0x37, %eax
ja 0xd228
movabsq $0x80000000800001, %rdx # imm = 0x80000000800001
btq %rax, %rdx
jae 0xd228
movl $0x0, 0x278(%r15)
movq %rsp, %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4240
movsd %xmm0, 0x8(%r14)
cmpl $0x22, 0x278(%r15)
jne 0xd263
movq %r15, %rdi
callq 0x42d0
movsd 0x8(%r14), %xmm0
xorpd %xmm1, %xmm1
leaq 0x991a(%rip), %rsi      # 0x16b31
ucomisd %xmm1, %xmm0
jne 0xd271
jp 0xd271
leaq 0x9922(%rip), %rcx      # 0x16b48
jmp 0xd278
testl %ecx, %ecx
jne 0xd253
xorl %r12d, %r12d
cmpl $0x22, 0x278(%r15)
movl $0x0, %ebp
jne 0xd2a2
cmpl $0x37, %eax
ja 0xd253
movabsq $0x80000000800001, %rcx # imm = 0x80000000800001
btq %rax, %rcx
jb 0xd1d5
cmpl $0x22, 0x278(%r15)
je 0xd1d5
jmp 0xd26c
movq (%rsp), %rax
cmpb $0x0, (%rax)
je 0xd292
movb $0x1, %r12b
jmp 0xd2a2
leaq 0x98e9(%rip), %rcx      # 0x16b61
xorl %r12d, %r12d
movq %r15, %rdi
movq %rbx, %rdx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x4500
movl $0x1, %ebp
jmp 0xd2a2
movl $0x1, 0xd0(%r14)
xorl %r12d, %r12d
xorl %ebp, %ebp
testb %r12b, %r12b
je 0xd2f0
movl $0x2, 0xd0(%r14)
movq 0x10(%r14), %r13
xorl %ebp, %ebp
cmpq %rbx, %r13
je 0xd2f0
leaq 0x10(%r14), %r12
movq %rbx, %rdi
callq 0x41d0
movq %r13, 0x18(%r14)
addl %r13d, %eax
subl 0x20(%r14), %eax
testl %eax, %eax
jle 0xd2e4
movq %r15, %rdi
movq %r12, %rsi
movl %eax, %edx
callq *0x28(%r14)
movq (%r12), %rdi
movq %rbx, %rsi
callq 0x40f0
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)