// File: /workspace/github_c_makefile_star2_O2/haxlang[P]hax/haxCmdIL.c
// Function: Hax_LinsertCmd
int
Hax_LinsertCmd(
    ClientData dummy,			/* Not used. */
    Hax_Interp *interp,			/* Current interpreter. */
    int argc,				/* Number of arguments. */
    char **argv				/* Argument strings. */)
{
    char *p, *element, savedChar;
    int i, count, result;
    long int index, size;

    if (argc < 4) {
	Hax_AppendResult(interp, "wrong # args: should be \"", argv[0],
		" list index element ?element ...?\"", (char *) NULL);
	return HAX_ERROR;
    }
    if (Hax_GetLong(interp, argv[2], &index) != HAX_OK) {
	return HAX_ERROR;
    }

    /*
     * Skip over the first "index" elements of the list, then add
     * all of those elements to the result.
     */

    size = 0;
    element = argv[1];
    for (count = 0, p = argv[1]; (count < index) && (*p != 0); count++) {
	result = HaxFindElement(interp, p, &element, &p, &size, (int *) NULL);
	if (result != HAX_OK) {
	    return result;
	}
    }
    if (*p == 0) {
	Hax_AppendResult(interp, argv[1], (char *) NULL);
    } else {
	char *end;

	end = element+size;
	if (element != argv[1]) {
	    while ((*end != 0) && !isspace(*end)) {
		end++;
	    }
	}
	savedChar = *end;
	*end = 0;
	Hax_AppendResult(interp, argv[1], (char *) NULL);
	*end = savedChar;
    }

    /*
     * Add the new list elements.
     */

    for (i = 3; i < argc; i++) {
	Hax_AppendElement(interp, argv[i], 0);
    }

    /*
     * Append the remainder of the original list.
     */

    if (*p != 0) {
	Hax_AppendResult(interp, " ", p, (char *) NULL);
    }
    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 $0x3, %edx
jg 0x8ce2
movq (%r14), %rdx
leaq 0xab94(%rip), %rsi      # 0x13860
leaq 0xb230(%rip), %rcx      # 0x13f03
movq %rbx, %rdi
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x4520
jmp 0x8cf9
movl %edx, %ebp
movq 0x10(%r14), %rsi
leaq 0x18(%rsp), %rdx
movq %rbx, %rdi
callq 0x44d0
testl %eax, %eax
je 0x8d0d
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ebp, 0x4(%rsp)
leaq 0x8(%rsp), %rax
andq $0x0, (%rax)
movq 0x8(%r14), %rax
leaq 0x20(%rsp), %r12
movq %rax, (%r12)
leaq 0x10(%rsp), %r13
movq %rax, (%r13)
pushq $-0x1
popq %r15
movq 0x10(%rsp), %rsi
movb (%rsi), %al
incq %r15
cmpq %r15, 0x18(%rsp)
jle 0x8d67
testb %al, %al
je 0x8da0
movq %rbx, %rdi
movq %r12, %rdx
movq %r13, %rcx
leaq 0x8(%rsp), %r8
xorl %r9d, %r9d
callq 0x4380
testl %eax, %eax
je 0x8d34
movl %eax, %ebp
jmp 0x8cfc
testb %al, %al
je 0x8da0
movq 0x20(%rsp), %rax
movq 0x8(%rsp), %r15
addq %rax, %r15
cmpq 0x8(%r14), %rax
je 0x8db6
movl 0x4(%rsp), %ebp
movsbq (%r15), %r12
testq %r12, %r12
je 0x8dbf
callq 0x4660
movq (%rax), %rax
testb $0x20, 0x1(%rax,%r12,2)
jne 0x8dc2
incq %r15
jmp 0x8d82
movq 0x8(%r14), %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0x4520
movl 0x4(%rsp), %ebp
jmp 0x8dd9
movb (%r15), %r12b
movl 0x4(%rsp), %ebp
jmp 0x8dc2
xorl %r12d, %r12d
movb $0x0, (%r15)
movq 0x8(%r14), %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0x4520
movb %r12b, (%r15)
movl %ebp, %r15d
pushq $0x3
popq %r12
cmpq %r15, %r12
jae 0x8df8
movq (%r14,%r12,8), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x4050
incq %r12
jmp 0x8de0
movq 0x10(%rsp), %rdx
cmpb $0x0, (%rdx)
je 0x8e1c
leaq 0xbdfb(%rip), %rsi      # 0x14c04
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x4520
jmp 0x8cfc
xorl %ebp, %ebp
jmp 0x8cfc