// File: /workspace/github_c_makefile_star2_O3/haxlang[P]hax/haxHistory.c
// Function: Hax_HistoryCmd
int
Hax_HistoryCmd(
    ClientData dummy,			/* Not used. */
    Hax_Interp *interp,			/* Current interpreter. */
    int argc,				/* Number of arguments. */
    char **argv				/* Argument strings. */)
{
    Interp *iPtr = (Interp *) interp;
    Hax_Memoryp *memoryp = iPtr->memoryp;
    HistoryEvent *eventPtr;
    int length;
    char c;

    /*
     * If no arguments, treat the same as "history info".
     */

    if (argc == 1) {
	goto infoCmd;
    }

    c = argv[1][0];
    length = strlen(argv[1]);

    if ((c == 'a') && (strncmp(argv[1], "add", length)) == 0) {
	if ((argc != 3) && (argc != 4)) {
	    Hax_AppendResult(interp, "wrong # args: should be \"", argv[0],
		    " add event ?exec?\"", (char *) NULL);
	    return HAX_ERROR;
	}
	if (argc == 4) {
	    if (strncmp(argv[3], "exec", strlen(argv[3])) != 0) {
		Hax_AppendResult(interp, "bad argument \"", argv[3],
			"\": should be \"exec\"", (char *) NULL);
		return HAX_ERROR;
	    }
	    return Hax_RecordAndEval(interp, argv[2], 0);
	}
	return Hax_RecordAndEval(interp, argv[2], HAX_NO_EVAL);
    } else if ((c == 'c') && (strncmp(argv[1], "change", length)) == 0) {
	if ((argc != 3) && (argc != 4)) {
	    Hax_AppendResult(interp, "wrong # args: should be \"", argv[0],
		    " change newValue ?event?\"", (char *) NULL);
	    return HAX_ERROR;
	}
	if (argc == 3) {
	    eventPtr = &iPtr->events[iPtr->curEvent];
	    iPtr->revDisables += 1;
	    while (iPtr->revPtr != NULL) {
		HistoryRev *nextPtr;

		ckfree(memoryp, iPtr->revPtr->newBytes);
		nextPtr = iPtr->revPtr->nextPtr;
		ckfree(memoryp, (char *) iPtr->revPtr);
		iPtr->revPtr = nextPtr;
	    }
	} else {
	    eventPtr = GetEvent(iPtr, argv[3]);
	    if (eventPtr == NULL) {
		return HAX_ERROR;
	    }
	}
	MakeSpace(iPtr, eventPtr, strlen(argv[2]) + 1);
	strcpy(eventPtr->command, argv[2]);
	return HAX_OK;
    } else if ((c == 'e') && (strncmp(argv[1], "event", length)) == 0) {
	if (argc > 3) {
	    Hax_AppendResult(interp, "wrong # args: should be \"", argv[0],
		    " event ?event?\"", (char *) NULL);
	    return HAX_ERROR;
	}
	eventPtr = GetEvent(iPtr, argc==2 ? (char *) "-1" : argv[2]);
	if (eventPtr == NULL) {
	    return HAX_ERROR;
	}
	RevResult(iPtr, eventPtr->command);
	Hax_SetResult(interp, eventPtr->command, HAX_VOLATILE);
	return HAX_OK;
    } else if ((c == 'i') && (strncmp(argv[1], "info", length)) == 0) {
	int count, indx, i;
	const char *newline;

	if ((argc != 2) && (argc != 3)) {
	    Hax_AppendResult(interp, "wrong # args: should be \"", argv[0],
		    " info ?count?\"", (char *) NULL);
	    return HAX_ERROR;
	}
	infoCmd:
	if (argc == 3) {
	    if (Hax_GetInt(interp, argv[2], &count) != HAX_OK) {
		return HAX_ERROR;
	    }
	    if (count > iPtr->numEvents) {
		count = iPtr->numEvents;
	    }
	} else {
	    count = iPtr->numEvents;
	}
	newline = "";
	for (i = 0, indx = iPtr->curEvent + 1 + iPtr->numEvents - count;
		i < count; i++, indx++) {
	    char *cur, *next, savedChar;
	    char serial[20];

	    if (indx >= iPtr->numEvents) {
		indx -= iPtr->numEvents;
	    }
	    cur = iPtr->events[indx].command;
	    if (*cur == '\0') {
		continue;		/* No command recorded here. */
	    }
	    sprintf(serial, "%6d  ", iPtr->curEventNum + 1 - (count - i));
	    Hax_AppendResult(interp, newline, serial, (char *) NULL);
	    newline = "\n";

	    /*
	     * Tricky formatting here:  for multi-line commands, indent
	     * the continuation lines.
	     */

	    while (1) {
		next = strchr(cur, '\n');
		if (next == NULL) {
		    break;
		}
		next++;
		savedChar = *next;
		*next = 0;
		Hax_AppendResult(interp, cur, "\t", (char *) NULL);
		*next = savedChar;
		cur = next;
	    }
	    Hax_AppendResult(interp, cur, (char *) NULL);
	}
	return HAX_OK;
    } else if ((c == 'k') && (strncmp(argv[1], "keep", length)) == 0) {
	int count, i, src;
	HistoryEvent *events;

	if (argc != 3) {
	    Hax_AppendResult(interp, "wrong # args: should be \"", argv[0],
		    " keep number\"", (char *) NULL);
	    return HAX_ERROR;
	}
	if (Hax_GetInt(interp, argv[2], &count) != HAX_OK) {
	    return HAX_ERROR;
	}
	if ((count <= 0) || (count > 1000)) {
	    Hax_AppendResult(interp, "illegal keep count \"", argv[2],
		    "\"", (char *) NULL);
	    return HAX_ERROR;
	}

	/*
	 * Create a new history array and copy as much existing history
	 * as possible from the old array.
	 */

	events = (HistoryEvent *)
		ckalloc(memoryp, (unsigned) (count * sizeof(HistoryEvent)));
	if (count < iPtr->numEvents) {
	    src = iPtr->curEvent + 1 - count;
	    if (src < 0) {
		src += iPtr->numEvents;
	    }
	} else {
	    src = iPtr->curEvent + 1;
	}
	for (i = 0; i < count; i++, src++) {
	    if (src >= iPtr->numEvents) {
		src = 0;
	    }
	    if (i < iPtr->numEvents) {
		events[i] = iPtr->events[src];
		iPtr->events[src].command = NULL;
	    } else {
		events[i].command = (char *) ckalloc(memoryp, INITIAL_CMD_SIZE);
		events[i].command[0] = 0;
		events[i].bytesAvl = INITIAL_CMD_SIZE;
	    }
	}

	/*
	 * Throw away everything left in the old history array, and
	 * substitute the new one for the old one.
	 */

	for (i = 0; i < iPtr->numEvents; i++) {
	    if (iPtr->events[i].command != NULL) {
		ckfree(memoryp, iPtr->events[i].command);
	    }
	}
	ckfree(memoryp, (char *) iPtr->events);
	iPtr->events = events;
	if (count < iPtr->numEvents) {
	    iPtr->curEvent = count-1;
	} else {
	    iPtr->curEvent = iPtr->numEvents-1;
	}
	iPtr->numEvents = count;
	return HAX_OK;
    } else if ((c == 'n') && (strncmp(argv[1], "nextid", length)) == 0) {
	if (argc != 2) {
	    Hax_AppendResult(interp, "wrong # args: should be \"", argv[0],
		    " nextid\"", (char *) NULL);
	    return HAX_ERROR;
	}
	sprintf(iPtr->result, "%d", iPtr->curEventNum+1);
	return HAX_OK;
    } else if ((c == 'r') && (strncmp(argv[1], "redo", length)) == 0) {
	if (argc > 3) {
	    Hax_AppendResult(interp, "wrong # args: should be \"", argv[0],
		    " redo ?event?\"", (char *) NULL);
	    return HAX_ERROR;
	}
	eventPtr = GetEvent(iPtr, argc==2 ? (char *) "-1" : argv[2]);
	if (eventPtr == NULL) {
	    return HAX_ERROR;
	}
	RevCommand(iPtr, eventPtr->command);
	return Hax_Eval(interp, NULL, eventPtr->command, 0, (char **) NULL);
    } else if ((c == 's') && (strncmp(argv[1], "substitute", length)) == 0) {
	if ((argc > 5) || (argc < 4)) {
	    Hax_AppendResult(interp, "wrong # args: should be \"", argv[0],
		    " substitute old new ?event?\"", (char *) NULL);
	    return HAX_ERROR;
	}
	eventPtr = GetEvent(iPtr, argc==4 ? (char *) "-1" : argv[4]);
	if (eventPtr == NULL) {
	    return HAX_ERROR;
	}
	return SubsAndEval(iPtr, eventPtr->command, argv[2], argv[3]);
    } else if ((c == 'w') && (strncmp(argv[1], "words", length)) == 0) {
	char *words;

	if ((argc != 3) && (argc != 4)) {
	    Hax_AppendResult(interp, "wrong # args: should be \"", argv[0],
		    " words num-num/pat ?event?\"", (char *) NULL);
	    return HAX_ERROR;
	}
	eventPtr = GetEvent(iPtr, argc==3 ? (char *) "-1" : argv[3]);
	if (eventPtr == NULL) {
	    return HAX_ERROR;
	}
	words = GetWords(iPtr, eventPtr->command, argv[2]);
	if (words == NULL) {
	    return HAX_ERROR;
	}
	RevResult(iPtr, words);
	iPtr->result = words;
	iPtr->freeProc = (Hax_FreeProc *) free;
	return HAX_OK;
    }

    Hax_AppendResult(interp, "bad option \"", argv[1],
	    "\": must be add, change, event, info, keep, nextid, ",
	    "redo, substitute, or words", (char *) NULL);
    return HAX_ERROR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
cmpl $0x1, %edx
movq %rsi, (%rsp)
jne 0xdd37
movl 0xd8(%rbx), %esi
movl %esi, 0xc(%rsp)
movl %esi, %eax
testl %eax, %eax
jle 0xdd30
addl 0xe8(%rbx), %esi
subl %eax, %esi
incl %esi
leaq 0x800a(%rip), %r13      # 0x15c37
leaq 0x8002(%rip), %r15      # 0x15c36
xorl %edi, %edi
movl 0xd8(%rbx), %ecx
cmpl %ecx, %esi
movl $0x0, %edx
cmovll %edx, %ecx
subl %ecx, %esi
movq 0xe0(%rbx), %rcx
movslq %esi, %rdx
shlq $0x4, %rdx
movq (%rcx,%rdx), %rbp
cmpb $0x0, (%rbp)
je 0xdcf6
movl %esi, 0x10(%rsp)
incl %edi
movl %edi, 0x1c(%rsp)
movl %edi, %edx
subl %eax, %edx
addl 0xec(%rbx), %edx
leaq 0x20(%rsp), %r14
movq %r14, %rdi
leaq 0x7fa9(%rip), %rsi      # 0x15c30
xorl %eax, %eax
callq 0x45e0
movq %rbx, %rdi
movq %r13, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x4510
movq %rbp, %rdi
movl $0xa, %esi
callq 0x4250
testq %rax, %rax
je 0xdcfa
movq %rax, %r14
movq (%rsp), %r12
leaq 0x1(%r14), %r13
movb 0x1(%r14), %bl
movb $0x0, 0x1(%r14)
movq %r12, %rdi
movq %rbp, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x4510
movb %bl, 0x1(%r14)
movq %r13, %rdi
movl $0xa, %esi
callq 0x4250
movq %rax, %r14
movq %r13, %rbp
testq %rax, %rax
jne 0xdcb9
jmp 0xdd01
incl %edi
jmp 0xdd26
movq %rbp, %r13
movq (%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x4510
movl 0xc(%rsp), %eax
leaq 0x6882(%rip), %r13      # 0x1459d
movq %r12, %rbx
movl 0x10(%rsp), %esi
movl 0x1c(%rsp), %edi
incl %esi
cmpl %eax, %edi
jl 0xdc36
xorl %ebp, %ebp
jmp 0xe150
movq %rcx, %r14
movl %edx, %r12d
movq 0x280(%rbx), %r15
movq 0x8(%rcx), %r13
movzbl (%r13), %ebx
movq %r13, %rdi
callq 0x41d0
leal -0x61(%rbx), %ecx
cmpl $0x12, %ecx
ja 0xddaf
leaq 0x7dec(%rip), %rdx      # 0x15b50
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movslq %eax, %rdx
leaq 0x7e3a(%rip), %rsi      # 0x15bb1
movq %r13, %rdi
callq 0x40c0
testl %eax, %eax
jne 0xdfcc
leal -0x5(%r12), %eax
cmpl $-0x3, %eax
movq (%rsp), %rbx
ja 0xe0e7
movq (%r14), %rdx
leaq 0x6abd(%rip), %rsi      # 0x14860
leaq 0x7e0b(%rip), %rcx      # 0x15bb5
jmp 0xe13e
cmpl $0x77, %ebx
jne 0xdfcc
movslq %eax, %rdx
leaq 0x7f4f(%rip), %rsi      # 0x15d11
movq %r13, %rdi
callq 0x40c0
testl %eax, %eax
jne 0xdfcc
leal -0x5(%r12), %eax
cmpl $-0x3, %eax
movq (%rsp), %rbx
ja 0xe1b2
movq (%r14), %rdx
leaq 0x6a72(%rip), %rsi      # 0x14860
leaq 0x7eb7(%rip), %rcx      # 0x15cac
jmp 0xe13e
movslq %eax, %rdx
leaq 0x7e80(%rip), %rsi      # 0x15c84
movq %r13, %rdi
callq 0x40c0
testl %eax, %eax
jne 0xdfcc
leal -0x6(%r12), %eax
cmpl $-0x3, %eax
movq (%rsp), %rbx
ja 0xe025
movq (%r14), %rdx
leaq 0x6a30(%rip), %rsi      # 0x14860
leaq 0x7e58(%rip), %rcx      # 0x15c8f
jmp 0xe13e
movslq %eax, %rdx
leaq 0x7e2a(%rip), %rsi      # 0x15c70
movq %r13, %rdi
callq 0x40c0
testl %eax, %eax
jne 0xdfcc
cmpl $0x4, %r12d
movq (%rsp), %rbx
jl 0xe03b
movq (%r14), %rdx
leaq 0x69f2(%rip), %rsi      # 0x14860
leaq 0x7e00(%rip), %rcx      # 0x15c75
jmp 0xe13e
movslq %eax, %rdx
leaq 0x7ef1(%rip), %rsi      # 0x15d75
movq %r13, %rdi
callq 0x40c0
testl %eax, %eax
jne 0xdfcc
cmpl $0x4, %r12d
movq (%rsp), %rbx
jl 0xe051
movq (%r14), %rdx
leaq 0x69b4(%rip), %rsi      # 0x14860
leaq 0x7d5e(%rip), %rcx      # 0x15c11
jmp 0xe13e
movslq %eax, %rdx
leaq 0x7d2e(%rip), %rsi      # 0x15bf0
movq %r13, %rdi
callq 0x40c0
testl %eax, %eax
jne 0xdfcc
leal -0x5(%r12), %eax
cmpl $-0x3, %eax
movq (%rsp), %rbx
ja 0xe067
movq (%r14), %rdx
leaq 0x6972(%rip), %rsi      # 0x14860
leaq 0x7d02(%rip), %rcx      # 0x15bf7
jmp 0xe13e
movslq %eax, %rdx
leaq 0x7d34(%rip), %rsi      # 0x15c38
movq %r13, %rdi
callq 0x40c0
testl %eax, %eax
jne 0xdfcc
cmpl $0x3, %r12d
movq (%rsp), %rbx
jne 0xe12d
movq 0x10(%r14), %rsi
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x41c0
movl $0x1, %ebp
testl %eax, %eax
jne 0xe150
movl 0x20(%rsp), %esi
movl $0xfffffc17, %eax       # imm = 0xFFFFFC17
leal (%rsi,%rax), %ecx
cmpl %eax, %ecx
ja 0xe341
movq 0x10(%r14), %rdx
leaq 0x7cec(%rip), %rsi      # 0x15c4b
leaq 0x6349(%rip), %rcx      # 0x142af
movq %rbx, %rdi
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x4510
jmp 0xe150
movslq %eax, %rdx
leaq 0x75cc(%rip), %rsi      # 0x1554e
movq %r13, %rdi
callq 0x40c0
testl %eax, %eax
jne 0xdfcc
leal -0x4(%r12), %eax
cmpl $-0x3, %eax
movq (%rsp), %rbx
ja 0xe161
movq (%r14), %rdx
leaq 0x68b6(%rip), %rsi      # 0x14860
leaq 0x7c70(%rip), %rcx      # 0x15c21
jmp 0xe13e
movslq %eax, %rdx
leaq 0x7ca0(%rip), %rsi      # 0x15c60
movq %r13, %rdi
callq 0x40c0
testl %eax, %eax
je 0xdff7
leaq 0x674a(%rip), %rsi      # 0x1471d
leaq 0x7cee(%rip), %rcx      # 0x15cc8
leaq 0x7d1b(%rip), %r8       # 0x15cfc
movq (%rsp), %rdi
movq %r13, %rdx
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x4510
jmp 0xe14b
cmpl $0x2, %r12d
movq (%rsp), %rax
jne 0xe19c
movq (%rax), %rdi
movl 0xec(%rax), %edx
incl %edx
leaq 0x62fc(%rip), %rsi      # 0x14313
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x45e0
jmp 0xe150
cmpl $0x4, %r12d
jne 0xe1c8
leaq 0x7102(%rip), %rsi      # 0x15138
jmp 0xe1cc
cmpl $0x2, %r12d
jne 0xe1fe
leaq 0x70ec(%rip), %rsi      # 0x15138
jmp 0xe202
cmpl $0x2, %r12d
jne 0xe241
leaq 0x70d6(%rip), %rsi      # 0x15138
jmp 0xe245
cmpl $0x3, %r12d
jne 0xe27b
movslq 0xe8(%rbx), %r12
shlq $0x4, %r12
addq 0xe0(%rbx), %r12
incl 0x100(%rbx)
movq 0xf0(%rbx), %rbx
testq %rbx, %rbx
je 0xe2f8
leaq 0x7afc(%rip), %r13      # 0x15b9c
movq (%rsp), %rbp
movq 0x10(%rbx), %rsi
movq %r15, %rdi
movq %r13, %rdx
movl $0x131, %ecx            # imm = 0x131
callq 0x4280
movq 0xf0(%rbp), %rsi
movq 0x18(%rsi), %rbx
movq %r15, %rdi
movq %r13, %rdx
movl $0x133, %ecx            # imm = 0x133
callq 0x4280
movq %rbx, 0xf0(%rbp)
testq %rbx, %rbx
jne 0xe0a4
movq %rbp, %rbx
jmp 0xe2fc
cmpl $0x4, %r12d
jne 0xe294
movq 0x18(%r14), %r15
movq %r15, %rdi
callq 0x41d0
leaq 0x7ac4(%rip), %rsi      # 0x15bc8
movq %r15, %rdi
movq %rax, %rdx
callq 0x40c0
testl %eax, %eax
je 0xe325
leaq 0x7aaf(%rip), %rsi      # 0x15bcd
leaq 0x7ab7(%rip), %rcx      # 0x15bdc
movq %rbx, %rdi
movq %r15, %rdx
jmp 0xe141
movq (%r14), %rdx
leaq 0x6729(%rip), %rsi      # 0x14860
leaq 0x7aff(%rip), %rcx      # 0x15c3d
movq %rbx, %rdi
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x4510
movl $0x1, %ebp
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x3, %r12d
jne 0xdc08
movq 0x10(%r14), %rsi
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
callq 0x41c0
movl $0x1, %ebp
testl %eax, %eax
jne 0xe150
movl 0xc(%rsp), %eax
movl 0xd8(%rbx), %esi
cmpl %esi, %eax
jg 0xdc0e
jmp 0xdc14
movq (%r14), %rdx
leaq 0x66ba(%rip), %rsi      # 0x14860
leaq 0x7aba(%rip), %rcx      # 0x15c67
movq %rax, %rdi
jmp 0xe141
cmpl $0x3, %r12d
jne 0xe2a5
leaq 0x6f75(%rip), %rsi      # 0x15138
jmp 0xe2a9
movq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0xe7ef
testq %rax, %rax
je 0xe14b
movq (%rax), %rsi
movq 0x10(%r14), %rdx
movq 0x18(%r14), %rcx
movq %rbx, %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xeaec
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0xe7ef
testq %rax, %rax
je 0xe14b
movq %rax, %r14
movq (%rax), %rsi
movq %rbx, %rdi
callq 0xea3b
movq (%r14), %rdx
movq %rbx, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x45c0
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0xe7ef
testq %rax, %rax
je 0xe14b
movq %rax, %r14
movq (%rax), %rsi
movq %rbx, %rdi
callq 0xe944
movq (%r14), %rsi
movq %rbx, %rdi
movq $-0x1, %rdx
callq 0x44f0
jmp 0xdd30
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0xe7ef
movq %rax, %r12
testq %rax, %rax
jne 0xe2fc
jmp 0xe14b
movq 0x10(%r14), %rsi
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
jmp 0xe32e
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0xe7ef
movl $0x1, %ebp
testq %rax, %rax
je 0xe150
movq (%rax), %rsi
movq 0x10(%r14), %rdx
movq %rbx, %rdi
callq 0xec93
testq %rax, %rax
je 0xe150
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0xe944
movq %r14, (%rbx)
movq 0xccb1(%rip), %rax      # 0x1afa0
movq %rax, 0x8(%rbx)
jmp 0xdd30
movq (%rsp), %rbx
movq 0x10(%r14), %rdi
callq 0x41d0
leal 0x1(%rax), %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0xe797
movq (%r12), %rdi
movq 0x10(%r14), %rsi
callq 0x40f0
jmp 0xdd30
movq 0x10(%r14), %rsi
movq %rbx, %rdi
xorl %edx, %edx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4190
shlq $0x4, %rsi
leaq 0x7850(%rip), %rdx      # 0x15b9c
movq %r15, %rdi
movl $0x19d, %ecx            # imm = 0x19D
callq 0x44d0
movq %rax, %rbp
movl 0x20(%rsp), %eax
movl 0xd8(%rbx), %ecx
movl 0xe8(%rbx), %ebx
cmpl %ecx, %eax
jge 0xe380
subl %eax, %ebx
leal 0x1(%rbx), %edx
sarl $0x1f, %edx
andl %ecx, %edx
addl %edx, %ebx
incl %ebx
jmp 0xe382
incl %ebx
testl %eax, %eax
jle 0xe420
xorl %r13d, %r13d
leaq 0x7808(%rip), %r12      # 0x15b9c
movq %rbp, 0x10(%rsp)
xorl %r14d, %r14d
movq (%rsp), %rsi
movslq 0xd8(%rsi), %rcx
cmpl %ecx, %ebx
cmovgel %r13d, %ebx
cmpq %rcx, %r14
jge 0xe3d9
movq 0xe0(%rsi), %rcx
movslq %ebx, %rdx
shlq $0x4, %rdx
movups (%rcx,%rdx), %xmm0
movups %xmm0, (%rbp)
movq 0xe0(%rsi), %rcx
movq $0x0, (%rcx,%rdx)
jmp 0xe400
movl $0x28, %esi
movq %r15, %rdi
movq %r12, %rdx
movl $0x1ae, %ecx            # imm = 0x1AE
callq 0x44d0
movq %rax, (%rbp)
movb $0x0, (%rax)
movl $0x28, 0x8(%rbp)
movl 0x20(%rsp), %eax
incq %r14
incl %ebx
movslq %eax, %rcx
addq $0x10, %rbp
cmpq %rcx, %r14
jl 0xe39c
movq (%rsp), %rax
movl 0xd8(%rax), %ecx
movq 0x10(%rsp), %rbp
testl %ecx, %ecx
jle 0xe46a
xorl %ebx, %ebx
leaq 0x776f(%rip), %r12      # 0x15b9c
xorl %r14d, %r14d
movq (%rsp), %r13
movq 0xe0(%r13), %rax
movq (%rax,%rbx), %rsi
testq %rsi, %rsi
je 0xe45b
movq %r15, %rdi
movq %r12, %rdx
movl $0x1bb, %ecx            # imm = 0x1BB
callq 0x4280
movl 0xd8(%r13), %ecx
incq %r14
movslq %ecx, %rax
addq $0x10, %rbx
cmpq %rax, %r14
jl 0xe434
movq (%rsp), %rbx
movq 0xe0(%rbx), %rsi
leaq 0x7720(%rip), %rdx      # 0x15b9c
movq %r15, %rdi
movl $0x1be, %ecx            # imm = 0x1BE
callq 0x4280
movq %rbp, 0xe0(%rbx)
movl 0x20(%rsp), %eax
movl 0xd8(%rbx), %ecx
cmpl %ecx, %eax
cmovll %eax, %ecx
decl %ecx
movl %ecx, 0xe8(%rbx)
movl %eax, 0xd8(%rbx)
jmp 0xdd30