// File: /workspace/github_c_makefile_star2_O3/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, %r14
movq %rsi, %rbx
cmpl $0x4, %edx
jne 0x96c8
movq 0x10(%r14), %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x44c0
movl $0x1, %ebp
testl %eax, %eax
jne 0x96eb
movq 0x10(%rsp), %r13
testq %r13, %r13
jns 0x9663
movq $0x0, 0x10(%rsp)
xorl %r13d, %r13d
movq 0x18(%r14), %r15
cmpb $0x65, (%r15)
jne 0x968b
movq %r15, %rdi
callq 0x41d0
leaq 0xaae0(%rip), %rsi      # 0x1415c
movq %r15, %rdi
movq %rax, %rdx
callq 0x40c0
testl %eax, %eax
je 0x9708
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x44c0
testl %eax, %eax
je 0x96fc
movq %rbx, %rdi
callq 0x42d0
movq 0x18(%r14), %rdx
leaq 0xb88d(%rip), %rsi      # 0x14f3f
leaq 0xabf6(%rip), %rcx      # 0x142af
movq %rbx, %rdi
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x4510
jmp 0x96eb
movq (%r14), %rdx
leaq 0xb18e(%rip), %rsi      # 0x14860
leaq 0xb854(%rip), %rcx      # 0x14f2d
movq %rbx, %rdi
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x4510
movl $0x1, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %r13
movq 0x8(%rsp), %rax
jmp 0x9716
movq $0xf4240, 0x8(%rsp)     # imm = 0xF4240
movl $0xf4240, %eax          # imm = 0xF4240
xorl %ebp, %ebp
cmpq %rax, %r13
jg 0x96eb
movq 0x8(%r14), %r14
movq %r14, 0x18(%rsp)
testq %r13, %r13
jle 0x9778
movl $0x1, %r15d
leaq 0x18(%rsp), %r12
movq %rbx, %rdi
movq %r14, %rsi
leaq 0x20(%rsp), %rdx
movq %r12, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x4370
testl %eax, %eax
jne 0x9819
movq 0x18(%rsp), %r14
cmpb $0x0, (%r14)
movq 0x10(%rsp), %r13
je 0x9773
leaq 0x1(%r15), %rax
cmpq %r15, %r13
movq %rax, %r15
jg 0x9736
movq 0x8(%rsp), %rax
movq %r14, (%rsp)
movslq %r13d, %r13
cmpq %r13, %rax
jl 0x97c2
decq %r13
leaq 0x20(%rsp), %r15
movq %rsp, %r12
movq (%rsp), %r14
cmpb $0x0, (%r14)
je 0x97c2
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x4370
testl %eax, %eax
jne 0x9819
incq %r13
cmpq %r13, 0x8(%rsp)
jg 0x978f
movq (%rsp), %r14
callq 0x4650
movq (%rax), %rcx
movsbq -0x1(%r14), %rdx
testb $0x20, 0x1(%rcx,%rdx,2)
je 0x97f2
decq %r14
movq %r14, (%rsp)
movq (%rax), %rcx
movsbq -0x1(%r14), %rdx
decq %r14
testb $0x20, 0x1(%rcx,%rdx,2)
jne 0x97d9
incq %r14
movb (%r14), %r15b
movb $0x0, (%r14)
movq 0x18(%rsp), %rsi
movq %rbx, %rdi
movq $-0x1, %rdx
callq 0x44f0
movq (%rsp), %rax
movb %r15b, (%rax)
jmp 0x96eb
movl %eax, %ebp
jmp 0x96eb