// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
cmpl $0x4, -0x1c(%rbp)
jge 0xbdce
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rdx
leaq 0x11bc5(%rip), %rsi     # 0x1d974
leaq 0x1220b(%rip), %rcx     # 0x1dfc1
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0x4500
movl $0x1, -0x4(%rbp)
jmp 0xbfa4
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rsi
leaq -0x50(%rbp), %rdx
callq 0x44b0
cmpl $0x0, %eax
je 0xbdf4
movl $0x1, -0x4(%rbp)
jmp 0xbfa4
movq $0x0, -0x58(%rbp)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x44(%rbp)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movslq -0x44(%rbp), %rcx
xorl %eax, %eax
cmpq -0x50(%rbp), %rcx
movb %al, -0x61(%rbp)
jge 0xbe3a
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x61(%rbp)
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0xbe43
jmp 0xbe82
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq -0x38(%rbp), %rdx
leaq -0x30(%rbp), %rcx
leaq -0x58(%rbp), %r8
xorl %eax, %eax
movl %eax, %r9d
callq 0x4350
movl %eax, -0x48(%rbp)
cmpl $0x0, -0x48(%rbp)
je 0xbe75
movl -0x48(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xbfa4
jmp 0xbe77
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0xbe1b
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xbeaa
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rsi
xorl %eax, %eax
movl %eax, %edx
movb $0x0, %al
callq 0x4500
jmp 0xbf46
movq -0x38(%rbp), %rax
addq -0x58(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x38(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq 0x8(%rcx), %rax
je 0xbf16
jmp 0xbec6
movq -0x60(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x62(%rbp)
je 0xbefd
callq 0x4630
movq (%rax), %rax
movq -0x60(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x62(%rbp)
movb -0x62(%rbp), %al
testb $0x1, %al
jne 0xbf06
jmp 0xbf14
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0xbec6
jmp 0xbf16
movq -0x60(%rbp), %rax
movb (%rax), %al
movb %al, -0x39(%rbp)
movq -0x60(%rbp), %rax
movb $0x0, (%rax)
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rsi
xorl %eax, %eax
movl %eax, %edx
movb $0x0, %al
callq 0x4500
movb -0x39(%rbp), %cl
movq -0x60(%rbp), %rax
movb %cl, (%rax)
movl $0x3, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0xbf77
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
xorl %edx, %edx
callq 0x4040
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0xbf4d
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0xbf9d
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq 0x12ede(%rip), %rsi     # 0x1ee70
xorl %eax, %eax
movl %eax, %ecx
movb $0x0, %al
callq 0x4500
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)