// File: /workspace/github_c_makefile_star2_O3/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 %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movb (%rsi), %al
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setae %cl
addb $-0x2d, %al
cmpb $0x2, %al
setae %al
testb %al, %cl
jne 0xcdc5
xorl %eax, %eax
movl %eax, 0xd0(%r15)
movl %eax, 0x278(%r14)
leaq 0x8(%rsp), %r12
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x43d0
movq %rax, (%r15)
movq (%r12), %rax
movzbl (%rax), %eax
leal -0x2e(%rax), %ecx
cmpl $0x37, %ecx
ja 0xcda1
movabsq $0x80000000800001, %rdx # imm = 0x80000000800001
btq %rcx, %rdx
jae 0xcda1
movl $0x0, 0x278(%r14)
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4240
movsd %xmm0, 0x8(%r15)
cmpl $0x22, 0x278(%r14)
jne 0xcd85
movq %r14, %rdi
callq 0x42d0
movsd 0x8(%r15), %xmm0
xorpd %xmm1, %xmm1
leaq 0x8bd8(%rip), %rsi      # 0x15941
ucomisd %xmm1, %xmm0
jne 0xce10
jp 0xce10
leaq 0x8bd8(%rip), %rcx      # 0x15958
jmp 0xce17
movq 0x8(%rsp), %rax
cmpb $0x0, (%rax)
jne 0xcdc5
movl $0x1, 0xd0(%r15)
xorl %ebp, %ebp
jmp 0xce2c
testl %eax, %eax
jne 0xcdb7
xorl %ebp, %ebp
cmpl $0x22, 0x278(%r14)
je 0xcd25
jmp 0xce2c
cmpl $0x22, 0x278(%r14)
je 0xcd25
movl $0x2, 0xd0(%r15)
movq 0x10(%r15), %r12
xorl %ebp, %ebp
cmpq %rbx, %r12
je 0xce2c
movq %rbx, %rdi
callq 0x41d0
movq %r12, 0x18(%r15)
addl %r12d, %eax
subl 0x20(%r15), %eax
testl %eax, %eax
jle 0xce03
leaq 0x10(%r15), %rsi
movq %r14, %rdi
movl %eax, %edx
callq *0x28(%r15)
movq 0x10(%r15), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x40f0
jmp 0xce2c
leaq 0x8b5a(%rip), %rcx      # 0x15971
movq %r14, %rdi
movq %rbx, %rdx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x4510
movl $0x1, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop