// File: /workspace/github_c_makefile_star2_O1/haxlang[P]hax/haxCmdIL.c
// Function: Hax_LrangeCmd
int
Hax_LrangeCmd(
    ClientData notUsed,			/* Not used. */
    Hax_Interp *interp,			/* Current interpreter. */
    int argc,				/* Number of arguments. */
    char **argv				/* Argument strings. */)
{
    long int first, last, result;
    char *begin, *end, c, *dummy;
    int count;

    if (argc != 4) {
	Hax_AppendResult(interp, "wrong # args: should be \"", argv[0],
		" list first last\"", (char *) NULL);
	return HAX_ERROR;
    }
    if (Hax_GetLong(interp, argv[2], &first) != HAX_OK) {
	return HAX_ERROR;
    }
    if (first < 0) {
	first = 0;
    }
    if ((*argv[3] == 'e') && (strncmp(argv[3], "end", strlen(argv[3])) == 0)) {
	last = 1000000;
    } else {
	if (Hax_GetLong(interp, argv[3], &last) != HAX_OK) {
	    Hax_ResetResult(interp);
	    Hax_AppendResult(interp,
		    "expected integer or \"end\" but got \"",
		    argv[3], "\"", (char *) NULL);
	    return HAX_ERROR;
	}
    }
    if (first > last) {
	return HAX_OK;
    }

    /*
     * Extract a range of fields.
     */

    for (count = 0, begin = argv[1]; count < first; count++) {
	result = HaxFindElement(interp, begin, &dummy, &begin,
		(long int *) NULL, (int *) NULL);
	if (result != HAX_OK) {
	    return result;
	}
	if (*begin == 0) {
	    break;
	}
    }
    for (count = first, end = begin; (count <= last) && (*end != 0);
	    count++) {
	result = HaxFindElement(interp, end, &dummy, &end, (long int *) NULL,
		(int *) NULL);
	if (result != HAX_OK) {
	    return result;
	}
    }

    /*
     * Chop off trailing spaces.
     */

    while (isspace(end[-1])) {
	end--;
    }
    c = *end;
    *end = 0;
    Hax_SetResult(interp, begin, HAX_VOLATILE);
    *end = c;
    return HAX_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r15
movq %rsi, %r14
cmpl $0x4, %edx
jne 0x9a93
movq 0x10(%r15), %rsi
movq %rsp, %rdx
movq %r14, %rdi
callq 0x44b0
movl $0x1, %ebx
testl %eax, %eax
jne 0x9ab6
cmpq $0x0, (%rsp)
jns 0x9a2d
movq $0x0, (%rsp)
movq 0x18(%r15), %r12
cmpb $0x65, (%r12)
jne 0x9a56
movq %r12, %rdi
callq 0x41d0
leaq 0xb715(%rip), %rsi      # 0x1515c
movq %r12, %rdi
movq %rax, %rdx
callq 0x40c0
testl %eax, %eax
je 0x9ac7
leaq 0x18(%rsp), %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x44b0
testl %eax, %eax
je 0x9ad0
movq %r14, %rdi
callq 0x42d0
movq 0x18(%r15), %rdx
leaq 0xc666(%rip), %rsi      # 0x160e3
leaq 0xb82b(%rip), %rcx      # 0x152af
movq %r14, %rdi
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x4500
jmp 0x9ab6
movq (%r15), %rdx
leaq 0xbdd7(%rip), %rsi      # 0x15874
leaq 0xc62d(%rip), %rcx      # 0x160d1
movq %r14, %rdi
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x4500
movl $0x1, %ebx
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq $0xf4240, 0x18(%rsp)    # imm = 0xF4240
movq (%rsp), %rax
xorl %ebx, %ebx
cmpq 0x18(%rsp), %rax
jg 0x9ab6
movq 0x8(%r15), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, (%rsp)
jle 0x9b2e
xorl %r13d, %r13d
leaq 0x20(%rsp), %r15
leaq 0x10(%rsp), %r12
movq 0x10(%rsp), %rsi
movq %r14, %rdi
movq %r15, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x4360
testl %eax, %eax
jne 0x9bd9
movq 0x10(%rsp), %rax
cmpb $0x0, (%rax)
je 0x9b2e
incq %r13
cmpq %r13, (%rsp)
jg 0x9afa
movslq (%rsp), %r13
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq %r13, 0x18(%rsp)
jl 0x9b7c
decq %r13
leaq 0x20(%rsp), %r15
leaq 0x8(%rsp), %r12
movq 0x8(%rsp), %rsi
cmpb $0x0, (%rsi)
je 0x9b7c
movq %r14, %rdi
movq %r15, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x4360
testl %eax, %eax
jne 0x9bd9
incq %r13
cmpq %r13, 0x18(%rsp)
jg 0x9b50
callq 0x4640
movq (%rax), %rdx
movq 0x8(%rsp), %rcx
movsbq -0x1(%rcx), %rsi
testb $0x20, 0x1(%rdx,%rsi,2)
je 0x9bb2
decq %rcx
movq %rcx, 0x8(%rsp)
movq (%rax), %rdx
movsbq -0x1(%rcx), %rsi
decq %rcx
testb $0x20, 0x1(%rdx,%rsi,2)
jne 0x9b98
incq %rcx
movb (%rcx), %bpl
movb $0x0, (%rcx)
movq 0x10(%rsp), %rsi
movq %r14, %rdi
movq $-0x1, %rdx
callq 0x44e0
movq 0x8(%rsp), %rax
movb %bpl, (%rax)
jmp 0x9ab6
movl %eax, %ebx
jmp 0x9ab6