// File: /workspace/github_c_makefile_star2_O1/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 0x9792
movq (%r14), %rdx
leaq 0xc101(%rip), %rsi      # 0x15874
leaq 0xc92d(%rip), %rcx      # 0x160a7
movq %rbx, %rdi
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x4500
movl $0x1, %r13d
jmp 0x98d1
movl %edx, %ebp
movq 0x10(%r14), %rsi
leaq 0x18(%rsp), %rdx
movq %rbx, %rdi
callq 0x44b0
movl $0x1, %r13d
testl %eax, %eax
jne 0x98d1
movq $0x0, 0x10(%rsp)
movq 0x8(%r14), %rax
movq %rax, 0x20(%rsp)
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x18(%rsp)
jle 0x980e
xorl %r12d, %r12d
leaq 0x10(%rsp), %r15
movq 0x8(%rsp), %rsi
cmpb $0x0, (%rsi)
je 0x980e
movq %rbx, %rdi
leaq 0x20(%rsp), %rdx
leaq 0x8(%rsp), %rcx
movq %r15, %r8
xorl %r9d, %r9d
callq 0x4360
testl %eax, %eax
jne 0x98ce
incq %r12
cmpq %r12, 0x18(%rsp)
jg 0x97da
movq 0x8(%rsp), %rax
cmpb $0x0, (%rax)
je 0x986e
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %r15
addq %rax, %r15
cmpq 0x8(%r14), %rax
je 0x9852
movb (%r15), %r12b
testb %r12b, %r12b
je 0x9852
callq 0x4640
movq (%rax), %rax
movsbq %r12b, %rcx
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x9852
movb 0x1(%r15), %r12b
incq %r15
testb %r12b, %r12b
jne 0x983b
movb (%r15), %r12b
movb $0x0, (%r15)
movq 0x8(%r14), %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0x4500
movb %r12b, (%r15)
jmp 0x987e
movq 0x8(%r14), %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0x4500
cmpl $0x5, %ebp
movl $0x4, %r15d
cmovgel %ebp, %r15d
movl $0x3, %r12d
movq (%r14,%r12,8), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x4050
incq %r12
cmpq %r12, %r15
jne 0x9891
movq 0x8(%rsp), %rdx
cmpb $0x0, (%rdx)
je 0x98c9
leaq 0xd678(%rip), %rsi      # 0x16f30
xorl %r13d, %r13d
movq %rbx, %rdi
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x4500
jmp 0x98d1
xorl %r13d, %r13d
jmp 0x98d1
movl %eax, %r13d
movl %r13d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq