// File: /workspace/github_c_makefile_star2_O3/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 0x93b2
movq (%r14), %rdx
leaq 0xb4cd(%rip), %rsi      # 0x14860
leaq 0xbb69(%rip), %rcx      # 0x14f03
movq %rbx, %rdi
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x4510
movl $0x1, %r13d
jmp 0x94fe
movl %edx, %ebp
movq 0x10(%r14), %rsi
leaq 0x18(%rsp), %rdx
movq %rbx, %rdi
callq 0x44c0
movl $0x1, %r13d
testl %eax, %eax
jne 0x94fe
movl %ebp, 0x4(%rsp)
movq $0x0, 0x10(%rsp)
movq 0x8(%r14), %rax
movq %rax, 0x20(%rsp)
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x18(%rsp)
jle 0x9436
xorl %r15d, %r15d
leaq 0x8(%rsp), %r12
leaq 0x10(%rsp), %rbp
movq 0x8(%rsp), %rsi
cmpb $0x0, (%rsi)
je 0x9480
movq %rbx, %rdi
leaq 0x20(%rsp), %rdx
movq %r12, %rcx
movq %rbp, %r8
xorl %r9d, %r9d
callq 0x4370
testl %eax, %eax
jne 0x9497
incq %r15
cmpq %r15, 0x18(%rsp)
jg 0x9403
movq 0x8(%rsp), %rax
cmpb $0x0, (%rax)
je 0x9480
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %rcx
leaq (%rax,%rcx), %r15
movb (%rax,%rcx), %bpl
cmpq 0x8(%r14), %rax
je 0x949e
testb %bpl, %bpl
je 0x949c
callq 0x4650
movq (%rax), %rax
movl 0x4(%rsp), %r12d
movsbq %bpl, %rcx
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x94a3
movb 0x1(%r15), %bpl
incq %r15
testb %bpl, %bpl
jne 0x9465
xorl %ebp, %ebp
jmp 0x94a3
movq 0x8(%r14), %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0x4510
movl 0x4(%rsp), %r12d
jmp 0x94ba
movl %eax, %r13d
jmp 0x94fe
xorl %ebp, %ebp
movl 0x4(%rsp), %r12d
movb $0x0, (%r15)
movq 0x8(%r14), %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0x4510
movb %bpl, (%r15)
movl %r12d, %r15d
movl $0x3, %r12d
movq (%r14,%r12,8), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x4050
incq %r12
cmpq %r12, %r15
jne 0x94c3
movq 0x8(%rsp), %rdx
cmpb $0x0, (%rdx)
je 0x94fb
leaq 0xc74a(%rip), %rsi      # 0x15c34
xorl %r13d, %r13d
movq %rbx, %rdi
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x4510
jmp 0x94fe
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq