// File: /workspace/github_c_makefile_star2_O1/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 0xe2e4
movl 0xd8(%rbx), %eax
movl %eax, 0xc(%rsp)
movq %rbx, %r14
movl 0xc(%rsp), %eax
testl %eax, %eax
jle 0xe2dd
movl 0xe8(%r14), %esi
addl 0xd8(%r14), %esi
subl 0xc(%rsp), %esi
incl %esi
leaq 0x8d5b(%rip), %r13      # 0x16f33
leaq 0x8d53(%rip), %r15      # 0x16f32
xorl %edi, %edi
movl 0xd8(%r14), %ecx
cmpl %ecx, %esi
movl $0x0, %edx
cmovll %edx, %ecx
subl %ecx, %esi
movq 0xe0(%r14), %rcx
movslq %esi, %rdx
shlq $0x4, %rdx
movq (%rcx,%rdx), %rbp
cmpb $0x0, (%rbp)
je 0xe2cd
movl %esi, 0x10(%rsp)
movl 0xec(%r14), %ecx
movl %edi, 0x1c(%rsp)
movl %edi, %edx
subl %eax, %edx
addl %ecx, %edx
incl %edx
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
leaq 0x8cf6(%rip), %rsi      # 0x16f2c
xorl %eax, %eax
callq 0x45d0
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x4500
movq %rbp, %rdi
movl $0xa, %esi
callq 0x4250
testq %rax, %rax
je 0xe2a5
movq %rax, %r14
movq (%rsp), %rbx
leaq 0x1(%r14), %r13
movb 0x1(%r14), %r12b
movb $0x0, 0x1(%r14)
movq %rbx, %rdi
movq %rbp, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x4500
movb %r12b, 0x1(%r14)
movq %r13, %rdi
movl $0xa, %esi
callq 0x4250
movq %rax, %r14
movq %r13, %rbp
testq %rax, %rax
jne 0xe268
jmp 0xe2ac
movq %rbp, %r13
movq (%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x4500
leaq 0x72db(%rip), %r13      # 0x1559d
movq %rbx, %r14
movl 0x10(%rsp), %esi
movl 0x1c(%rsp), %edi
incl %edi
incl %esi
movl 0xc(%rsp), %eax
cmpl %eax, %edi
jl 0xe1e1
xorl %ebp, %ebp
jmp 0xe800
movq %rcx, %r14
movl %edx, %r12d
movq 0x280(%rbx), %rbx
movq 0x8(%rcx), %r13
movzbl (%r13), %r15d
movq %r13, %rdi
callq 0x41d0
movq %rax, %rbp
leal -0x61(%r15), %eax
cmpl $0x12, %eax
ja 0xe64d
leaq 0x8a27(%rip), %rcx      # 0x16d40
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movslq %ebp, %rdx
leaq 0x8b81(%rip), %rsi      # 0x16ead
movq %r13, %rdi
callq 0x40c0
testl %eax, %eax
je 0xe3a8
leal -0x63(%r15), %eax
cmpl $0x10, %eax
ja 0xe64d
leaq 0x8a40(%rip), %rcx      # 0x16d8c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movslq %ebp, %rdx
leaq 0x8b8d(%rip), %rsi      # 0x16eec
movq %r13, %rdi
callq 0x40c0
testl %eax, %eax
je 0xe388
leal -0x69(%r15), %eax
cmpl $0xe, %eax
ja 0xe49a
leaq 0x8a51(%rip), %rcx      # 0x16dd0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leal -0x5(%r12), %eax
cmpl $-0x3, %eax
ja 0xe3cc
movq (%r14), %rdx
leaq 0x74d8(%rip), %rsi      # 0x15874
leaq 0x8b50(%rip), %rcx      # 0x16ef3
jmp 0xe7ed
leal -0x5(%r12), %eax
cmpl $-0x3, %eax
ja 0xe450
movq (%r14), %rdx
leaq 0x74b4(%rip), %rsi      # 0x15874
leaq 0x8aea(%rip), %rcx      # 0x16eb1
jmp 0xe7ed
cmpl $0x3, %r12d
jne 0xe91b
movq %rbx, %rbp
movq (%rsp), %rax
movslq 0xe8(%rax), %r12
shlq $0x4, %r12
addq 0xe0(%rax), %r12
incl 0x100(%rax)
movq 0xf0(%rax), %rbx
testq %rbx, %rbx
je 0xe988
leaq 0x8a8c(%rip), %r13      # 0x16e98
movq (%rsp), %r15
movq 0x10(%rbx), %rsi
movq %rbp, %rdi
movq %r13, %rdx
movl $0x131, %ecx            # imm = 0x131
callq 0x4280
movq 0xf0(%r15), %rsi
movq 0x18(%rsi), %rbx
movq %rbp, %rdi
movq %r13, %rdx
movl $0x133, %ecx            # imm = 0x133
callq 0x4280
movq %rbx, 0xf0(%r15)
testq %rbx, %rbx
jne 0xe410
jmp 0xe98c
cmpl $0x4, %r12d
jne 0xe938
movq 0x18(%r14), %r15
movq %r15, %rdi
callq 0x41d0
leaq 0x8a57(%rip), %rsi      # 0x16ec4
movq %r15, %rdi
movq %rax, %rdx
callq 0x40c0
testl %eax, %eax
movq (%rsp), %rdi
je 0xe9b5
leaq 0x8a3e(%rip), %rsi      # 0x16ec9
leaq 0x8a46(%rip), %rcx      # 0x16ed8
movq %r15, %rdx
jmp 0xe7f1
cmpl $0x65, %r15d
jne 0xe669
movslq %ebp, %rdx
leaq 0x8bc3(%rip), %rsi      # 0x17071
movq %r13, %rdi
callq 0x40c0
testl %eax, %eax
je 0xe52a
leal -0x69(%r15), %eax
cmpl $0xe, %eax
ja 0xe669
leaq 0x893e(%rip), %rcx      # 0x16e0c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movslq %ebp, %rdx
leaq 0x8261(%rip), %rsi      # 0x16742
movq %r13, %rdi
callq 0x40c0
testl %eax, %eax
je 0xe50a
leal -0x6e(%r15), %eax
cmpl $0x9, %eax
ja 0xe5a4
leaq 0x8947(%rip), %rcx      # 0x16e48
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leal -0x4(%r12), %eax
cmpl $-0x3, %eax
ja 0xe546
movq (%r14), %rdx
leaq 0x7356(%rip), %rsi      # 0x15874
leaq 0x89f8(%rip), %rcx      # 0x16f1d
jmp 0xe7ed
cmpl $0x4, %r12d
jl 0xe58e
movq (%r14), %rdx
leaq 0x733a(%rip), %rsi      # 0x15874
leaq 0x89cc(%rip), %rcx      # 0x16f0d
jmp 0xe7ed
cmpl $0x3, %r12d
movq (%rsp), %rbx
jne 0xe1a4
movq 0x10(%r14), %rsi
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
callq 0x41c0
movl $0x1, %ebp
testl %eax, %eax
jne 0xe800
movq %rbx, %r14
movl 0xd8(%rbx), %eax
cmpl %eax, 0xc(%rsp)
jle 0xe1b1
movl %eax, 0xc(%rsp)
jmp 0xe1b1
cmpl $0x2, %r12d
jne 0xe8dd
leaq 0x7d8d(%rip), %rsi      # 0x1632c
jmp 0xe8e1
cmpl $0x6b, %r15d
jne 0xe669
movslq %ebp, %rdx
leaq 0x897c(%rip), %rsi      # 0x16f34
movq %r13, %rdi
callq 0x40c0
testl %eax, %eax
je 0xe72a
leal -0x6e(%r15), %eax
cmpl $0x9, %eax
ja 0xe669
leaq 0x8894(%rip), %rcx      # 0x16e70
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movslq %ebp, %rdx
leaq 0x896d(%rip), %rsi      # 0x16f5c
movq %r13, %rdi
callq 0x40c0
testl %eax, %eax
je 0xe6fc
cmpl $0x77, %r15d
je 0xe653
cmpl $0x73, %r15d
je 0xe637
cmpl $0x72, %r15d
jne 0xe669
movslq %ebp, %rdx
leaq 0x8951(%rip), %rsi      # 0x16f6c
movq %r13, %rdi
callq 0x40c0
testl %eax, %eax
je 0xe6dc
cmpl $0x77, %r15d
je 0xe653
cmpl $0x73, %r15d
jne 0xe669
movslq %ebp, %rdx
leaq 0x893f(%rip), %rsi      # 0x16f80
movq %r13, %rdi
callq 0x40c0
testl %eax, %eax
je 0xe6b8
cmpl $0x77, %r15d
jne 0xe669
movslq %ebp, %rdx
leaq 0x89b0(%rip), %rsi      # 0x1700d
movq %r13, %rdi
callq 0x40c0
testl %eax, %eax
je 0xe694
leaq 0x70ad(%rip), %rsi      # 0x1571d
leaq 0x894d(%rip), %rcx      # 0x16fc4
leaq 0x897a(%rip), %r8       # 0x16ff8
movq (%rsp), %rdi
movq %r13, %rdx
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x4500
jmp 0xe7fb
leal -0x5(%r12), %eax
cmpl $-0x3, %eax
ja 0xe78e
movq (%r14), %rdx
leaq 0x71c8(%rip), %rsi      # 0x15874
leaq 0x88f5(%rip), %rcx      # 0x16fa8
jmp 0xe7ed
leal -0x6(%r12), %eax
cmpl $-0x3, %eax
ja 0xe79d
movq (%r14), %rdx
leaq 0x71a4(%rip), %rsi      # 0x15874
leaq 0x88b4(%rip), %rcx      # 0x16f8b
jmp 0xe7ed
cmpl $0x4, %r12d
jl 0xe7b3
movq (%r14), %rdx
leaq 0x7184(%rip), %rsi      # 0x15874
leaq 0x887a(%rip), %rcx      # 0x16f71
jmp 0xe7ed
cmpl $0x2, %r12d
jne 0xe7c9
movq (%rsp), %rax
movq (%rax), %rdi
movl 0xec(%rax), %edx
incl %edx
leaq 0x6bf7(%rip), %rsi      # 0x15313
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x45d0
jmp 0xe800
cmpl $0x3, %r12d
jne 0xe7dc
movq %rbx, %r12
movq 0x10(%r14), %rsi
leaq 0x20(%rsp), %rdx
movq (%rsp), %rbx
movq %rbx, %rdi
callq 0x41c0
movl $0x1, %ebp
testl %eax, %eax
jne 0xe800
movl 0x20(%rsp), %esi
movl $0xfffffc17, %eax       # imm = 0xFFFFFC17
leal (%rsi,%rax), %ecx
cmpl %eax, %ecx
ja 0xe947
movq 0x10(%r14), %rdx
leaq 0x87cf(%rip), %rsi      # 0x16f47
leaq 0x6b30(%rip), %rcx      # 0x152af
movq %rbx, %rdi
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x4500
jmp 0xe800
cmpl $0x3, %r12d
jne 0xe811
leaq 0x7b91(%rip), %rsi      # 0x1632c
jmp 0xe815
cmpl $0x4, %r12d
jne 0xe860
leaq 0x7b7e(%rip), %rsi      # 0x1632c
jmp 0xe864
cmpl $0x2, %r12d
jne 0xe896
leaq 0x7b68(%rip), %rsi      # 0x1632c
jmp 0xe89a
movq (%r14), %rdx
leaq 0x70a1(%rip), %rsi      # 0x15874
leaq 0x8789(%rip), %rcx      # 0x16f63
jmp 0xe7ed
movq (%r14), %rdx
leaq 0x708e(%rip), %rsi      # 0x15874
leaq 0x874c(%rip), %rcx      # 0x16f39
movq (%rsp), %rdi
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x4500
movl $0x1, %ebp
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%r14), %rsi
movq (%rsp), %rbx
movq %rbx, %rdi
callq 0xee42
movl $0x1, %ebp
testq %rax, %rax
je 0xe800
movq (%rax), %rsi
movq 0x10(%r14), %rdx
movq %rbx, %rdi
callq 0xf2f5
testq %rax, %rax
je 0xe800
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0xefa1
movq %r14, (%rbx)
movq 0xd749(%rip), %rax      # 0x1bfa0
movq %rax, 0x8(%rbx)
jmp 0xe2dd
movq 0x20(%r14), %rsi
movq (%rsp), %rbx
movq %rbx, %rdi
callq 0xee42
testq %rax, %rax
je 0xe7fb
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 0xf149
movq 0x10(%r14), %rsi
movq (%rsp), %rbx
movq %rbx, %rdi
callq 0xee42
testq %rax, %rax
je 0xe7fb
movq %rax, %r14
movq (%rax), %rsi
movq %rbx, %rdi
callq 0xf098
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 0x45b0
movq 0x10(%r14), %rsi
movq (%rsp), %rbx
movq %rbx, %rdi
callq 0xee42
testq %rax, %rax
je 0xe7fb
movq %rax, %r14
movq (%rax), %rsi
movq %rbx, %rdi
callq 0xefa1
movq (%r14), %rsi
movq %rbx, %rdi
movq $-0x1, %rdx
callq 0x44e0
jmp 0xe2dd
movq 0x18(%r14), %rsi
movq (%rsp), %r15
movq %r15, %rdi
callq 0xee42
movq %rax, %r12
testq %rax, %rax
jne 0xe98c
jmp 0xe7fb
movq 0x10(%r14), %rsi
movq (%rsp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
jmp 0xe9bb
shlq $0x4, %rsi
leaq 0x8546(%rip), %rdx      # 0x16e98
movq %r12, %rdi
movl $0x19d, %ecx            # imm = 0x19D
callq 0x44c0
movq %rax, 0x10(%rsp)
movl 0x20(%rsp), %ecx
movl 0xd8(%rbx), %eax
movl 0xe8(%rbx), %ebx
cmpl %eax, %ecx
jge 0xe9ce
subl %ecx, %ebx
leal 0x1(%rbx), %ecx
sarl $0x1f, %ecx
andl %eax, %ecx
addl %ecx, %ebx
incl %ebx
jmp 0xe9d0
movq (%rsp), %r15
movq 0x10(%r14), %rdi
callq 0x41d0
leal 0x1(%rax), %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0xedea
movq (%r12), %rdi
movq 0x10(%r14), %rsi
callq 0x40f0
jmp 0xe2dd
movq 0x10(%r14), %rsi
xorl %edx, %edx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4190
incl %ebx
cmpl $0x0, 0x20(%rsp)
jle 0xea61
xorl %r15d, %r15d
leaq 0x84b3(%rip), %r14      # 0x16e98
movq 0x10(%rsp), %r13
xorl %ebp, %ebp
movq (%rsp), %rdx
movslq 0xd8(%rdx), %rax
cmpl %eax, %ebx
cmovgel %r15d, %ebx
cmpq %rax, %rbp
jge 0xea2a
movq 0xe0(%rdx), %rax
movslq %ebx, %rcx
shlq $0x4, %rcx
movups (%rax,%rcx), %xmm0
movups %xmm0, (%r13)
movq 0xe0(%rdx), %rax
movq $0x0, (%rax,%rcx)
jmp 0xea4e
movl $0x28, %esi
movq %r12, %rdi
movq %r14, %rdx
movl $0x1ae, %ecx            # imm = 0x1AE
callq 0x44c0
movq %rax, (%r13)
movb $0x0, (%rax)
movl $0x28, 0x8(%r13)
incq %rbp
incl %ebx
movslq 0x20(%rsp), %rax
addq $0x10, %r13
cmpq %rax, %rbp
jl 0xe9ec
movq (%rsp), %r13
cmpl $0x0, 0xd8(%r13)
jle 0xeab2
xorl %ebx, %ebx
leaq 0x8420(%rip), %r14      # 0x16e98
xorl %r15d, %r15d
movq 0xe0(%r13), %rax
movq (%rax,%rbx), %rsi
testq %rsi, %rsi
je 0xea9b
movq %r12, %rdi
movq %r14, %rdx
movl $0x1bb, %ecx            # imm = 0x1BB
callq 0x4280
incq %r15
movq (%rsp), %r13
movslq 0xd8(%r13), %rax
addq $0x10, %rbx
cmpq %rax, %r15
jl 0xea7b
movq 0xe0(%r13), %rsi
leaq 0x83d8(%rip), %rdx      # 0x16e98
movq %r12, %rdi
movl $0x1be, %ecx            # imm = 0x1BE
callq 0x4280
movq 0x10(%rsp), %rax
movq %rax, 0xe0(%r13)
movl 0x20(%rsp), %eax
movl 0xd8(%r13), %ecx
cmpl %ecx, %eax
cmovll %eax, %ecx
decl %ecx
movl %ecx, 0xe8(%r13)
movl %eax, 0xd8(%r13)
jmp 0xe2dd