// File: /workspace/github_c_makefile_star2_O2/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 $0x68, %rsp
movq %rsi, %r12
cmpl $0x1, %edx
movq %rsi, (%rsp)
jne 0xd147
movl 0xd8(%r12), %eax
movl %eax, 0x24(%rsp)
movl %eax, %esi
addl 0xe8(%r12), %esi
subl %eax, %esi
incl %esi
leaq 0x7bb8(%rip), %r14      # 0x14c07
movq $0x0, 0x8(%rsp)
pushq $0xa
popq %rbp
leaq 0x7ba4(%rip), %r13      # 0x14c06
xorl %edi, %edi
cmpl %eax, %edi
jge 0xd3dc
movl 0xd8(%r12), %ecx
cmpl %ecx, %esi
movl $0x0, %edx
cmovll %edx, %ecx
subl %ecx, %esi
movq 0xe0(%r12), %rcx
movslq %esi, %rdx
shlq $0x4, %rdx
movq (%rcx,%rdx), %rbx
cmpb $0x0, (%rbx)
je 0xd13e
movl %esi, 0x10(%rsp)
incl %edi
movl %edi, 0x18(%rsp)
movl %edi, %edx
subl %eax, %edx
addl 0xec(%r12), %edx
leaq 0x30(%rsp), %r15
movq %r15, %rdi
leaq 0x7b3f(%rip), %rsi      # 0x14c00
xorl %eax, %eax
callq 0x45f0
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x4520
movq %rbx, %rdi
movl %ebp, %esi
callq 0x4250
testq %rax, %rax
je 0xd116
movq %rax, %r14
movq %rax, %r15
incq %r15
movb 0x1(%rax), %r12b
movb $0x0, 0x1(%rax)
movq (%rsp), %rdi
movq %rbx, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x4520
movb %r12b, 0x1(%r14)
movq %r15, %rbx
jmp 0xd0da
movq (%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x4520
movl 0x24(%rsp), %eax
leaq 0x6469(%rip), %r14      # 0x1359d
movl 0x10(%rsp), %esi
movl 0x18(%rsp), %edi
jmp 0xd140
incl %edi
incl %esi
jmp 0xd064
movq %rcx, %r15
movl %edx, %r13d
movq 0x280(%r12), %r12
movq 0x8(%rcx), %rbp
movzbl (%rbp), %ebx
movq %rbp, %rdi
callq 0x41d0
leal -0x61(%rbx), %ecx
pushq $0x1
popq %rdx
movq %rdx, 0x8(%rsp)
cmpl $0x12, %ecx
ja 0xd1c2
leaq 0x79a4(%rip), %rdx      # 0x14b20
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movslq %eax, %rdx
leaq 0x79f2(%rip), %rsi      # 0x14b81
movq %rbp, %rdi
callq 0x40c0
testl %eax, %eax
jne 0xd3b6
leal -0x5(%r13), %eax
cmpl $-0x3, %eax
ja 0xd4ea
movq (%r15), %rdx
leaq 0x66aa(%rip), %rsi      # 0x13860
leaq 0x79c8(%rip), %rcx      # 0x14b85
jmp 0xd5ba
cmpl $0x77, %ebx
jne 0xd3b6
movslq %eax, %rdx
leaq 0x7b0c(%rip), %rsi      # 0x14ce1
movq %rbp, %rdi
callq 0x40c0
testl %eax, %eax
jne 0xd3b6
leal -0x5(%r13), %eax
cmpl $-0x3, %eax
ja 0xd5cd
movq (%r15), %rdx
leaq 0x6664(%rip), %rsi      # 0x13860
leaq 0x7a79(%rip), %rcx      # 0x14c7c
jmp 0xd5ba
movslq %eax, %rdx
leaq 0x7a42(%rip), %rsi      # 0x14c54
movq %rbp, %rdi
callq 0x40c0
testl %eax, %eax
jne 0xd3b6
leal -0x6(%r13), %eax
cmpl $-0x3, %eax
ja 0xd422
movq (%r15), %rdx
leaq 0x6627(%rip), %rsi      # 0x13860
leaq 0x7a1f(%rip), %rcx      # 0x14c5f
jmp 0xd5ba
movslq %eax, %rdx
leaq 0x79f1(%rip), %rsi      # 0x14c40
movq %rbp, %rdi
callq 0x40c0
testl %eax, %eax
jne 0xd3b6
cmpl $0x4, %r13d
jl 0xd43c
movq (%r15), %rdx
leaq 0x65ed(%rip), %rsi      # 0x13860
leaq 0x79cb(%rip), %rcx      # 0x14c45
jmp 0xd5ba
movslq %eax, %rdx
leaq 0x7abc(%rip), %rsi      # 0x14d45
movq %rbp, %rdi
callq 0x40c0
testl %eax, %eax
jne 0xd3b6
cmpl $0x4, %r13d
jl 0xd456
movq (%r15), %rdx
leaq 0x65b3(%rip), %rsi      # 0x13860
leaq 0x792d(%rip), %rcx      # 0x14be1
jmp 0xd5ba
movslq %eax, %rdx
leaq 0x78fd(%rip), %rsi      # 0x14bc0
movq %rbp, %rdi
callq 0x40c0
testl %eax, %eax
jne 0xd3b6
leal -0x5(%r13), %eax
cmpl $-0x3, %eax
ja 0xd470
movq (%r15), %rdx
leaq 0x6576(%rip), %rsi      # 0x13860
leaq 0x78d6(%rip), %rcx      # 0x14bc7
jmp 0xd5ba
movslq %eax, %rdx
leaq 0x7908(%rip), %rsi      # 0x14c08
movq %rbp, %rdi
callq 0x40c0
testl %eax, %eax
jne 0xd3b6
cmpl $0x3, %r13d
jne 0xd537
movq 0x10(%r15), %rsi
leaq 0x30(%rsp), %rdx
movq (%rsp), %rdi
callq 0x41c0
pushq $0x1
popq %rcx
movq %rcx, 0x8(%rsp)
testl %eax, %eax
jne 0xd3dc
movl 0x30(%rsp), %esi
movl $0xfffffc17, %eax       # imm = 0xFFFFFC17
leal (%rsi,%rax), %ecx
cmpl %eax, %ecx
ja 0xd8c2
movq 0x10(%r15), %rdx
leaq 0x78c0(%rip), %rsi      # 0x14c1b
leaq 0x5f4d(%rip), %rcx      # 0x132af
jmp 0xd5ba
movslq %eax, %rdx
leaq 0x71b1(%rip), %rsi      # 0x14522
movq %rbp, %rdi
callq 0x40c0
testl %eax, %eax
jne 0xd3b6
leal -0x4(%r13), %eax
cmpl $-0x3, %eax
ja 0xd563
movq (%r15), %rdx
leaq 0x64cc(%rip), %rsi      # 0x13860
leaq 0x7856(%rip), %rcx      # 0x14bf1
jmp 0xd5ba
movslq %eax, %rdx
leaq 0x7886(%rip), %rsi      # 0x14c30
movq %rbp, %rdi
callq 0x40c0
testl %eax, %eax
je 0xd3f0
leaq 0x6360(%rip), %rsi      # 0x1371d
leaq 0x78d4(%rip), %rcx      # 0x14c98
leaq 0x7901(%rip), %r8       # 0x14ccc
movq (%rsp), %rdi
movq %rbp, %rdx
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x4520
movq 0x8(%rsp), %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x2, %r13d
jne 0xd5a9
movq (%rsp), %rax
movq (%rax), %rdi
movl 0xec(%rax), %edx
incl %edx
leaq 0x5f03(%rip), %rsi      # 0x13313
movq $0x0, 0x8(%rsp)
xorl %eax, %eax
callq 0x45f0
jmp 0xd3dc
cmpl $0x4, %r13d
movq (%rsp), %rbx
jne 0xd5e7
leaq 0x6cd5(%rip), %rsi      # 0x1410c
jmp 0xd5eb
cmpl $0x2, %r13d
movq (%rsp), %rbx
jne 0xd6e6
leaq 0x6cbb(%rip), %rsi      # 0x1410c
jmp 0xd6ea
cmpl $0x2, %r13d
movq (%rsp), %rbx
jne 0xd729
leaq 0x6ca1(%rip), %rsi      # 0x1410c
jmp 0xd72d
cmpl $0x3, %r13d
jne 0xd75c
movq (%rsp), %rax
movq 0xe0(%rax), %r14
movq 0xf0(%rax), %rbp
movslq 0xe8(%rax), %rcx
movq %rcx, 0x10(%rsp)
incl 0x100(%rax)
leaq 0x76c7(%rip), %r13      # 0x14b6c
movq (%rsp), %rbx
testq %rbp, %rbp
je 0xd779
movq 0x10(%rbp), %rsi
movq %r12, %rdi
movq %r13, %rdx
movl $0x131, %ecx            # imm = 0x131
callq 0x4280
movq 0xf0(%rbx), %rsi
movq 0x18(%rsi), %rbp
movq %r12, %rdi
movq %r13, %rdx
movl $0x133, %ecx            # imm = 0x133
callq 0x4280
movq %rbp, 0xf0(%rbx)
jmp 0xd4a9
cmpl $0x4, %r13d
movq (%rsp), %rbx
jne 0xd7ba
movq 0x18(%r15), %r14
movq %r14, %rdi
callq 0x41d0
leaq 0x768d(%rip), %rsi      # 0x14b98
movq %r14, %rdi
movq %rax, %rdx
callq 0x40c0
testl %eax, %eax
je 0xd8a6
leaq 0x7678(%rip), %rsi      # 0x14b9d
leaq 0x7680(%rip), %rcx      # 0x14bac
movq %rbx, %rdi
movq %r14, %rdx
jmp 0xd5be
movq (%r15), %rdx
leaq 0x631f(%rip), %rsi      # 0x13860
leaq 0x76c5(%rip), %rcx      # 0x14c0d
movq (%rsp), %rdi
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x4520
pushq $0x1
popq %rax
movq %rax, 0x8(%rsp)
jmp 0xd3dc
cmpl $0x3, %r13d
movq (%rsp), %r12
jne 0xd02e
movq 0x10(%r15), %rsi
leaq 0x24(%rsp), %rdx
movq %r12, %rdi
callq 0x41c0
testl %eax, %eax
jne 0xd3dc
movl 0x24(%rsp), %eax
movl 0xd8(%r12), %esi
cmpl %esi, %eax
jle 0xd03c
movl %esi, 0x24(%rsp)
movl %esi, %eax
jmp 0xd03c
movq (%r15), %rdx
leaq 0x62ad(%rip), %rsi      # 0x13860
leaq 0x767d(%rip), %rcx      # 0x14c37
movq (%rsp), %rdi
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x4520
jmp 0xd3dc
cmpl $0x3, %r13d
movq (%rsp), %rbx
jne 0xd81c
leaq 0x6b2a(%rip), %rsi      # 0x1410c
jmp 0xd820
movq 0x20(%r15), %rsi
movq %rbx, %rdi
callq 0xdfe1
testq %rax, %rax
je 0xd3dc
pushq $-0x1
popq %r14
movq (%rax), %r13
movq 0x10(%r15), %r12
movq 0x18(%r15), %r15
movq 0x280(%rbx), %rax
movq %rax, 0x28(%rsp)
movq %r12, %rdi
callq 0x41d0
movq %rax, %rbp
movq %r15, 0x10(%rsp)
movq %r15, %rdi
callq 0x41d0
movslq %ebp, %rbx
movl %ebx, %ebp
movq %rax, 0x18(%rsp)
subl %eax, %ebp
xorl %r15d, %r15d
movq %r13, %rax
movq %rax, %rdi
movq %r12, %rsi
callq 0x4630
testq %rax, %rax
je 0xd65c
addq %rbx, %rax
addl %ebp, %r14d
decl %r15d
jmp 0xd641
testl %r15d, %r15d
je 0xd86e
movq %r13, %rdi
callq 0x41d0
subl %r14d, %eax
leaq 0x74f5(%rip), %rdx      # 0x14b6c
movq 0x28(%rsp), %rdi
movq %rax, %rsi
movl $0x3b3, %ecx            # imm = 0x3B3
callq 0x44e0
movq %rax, %r15
movslq 0x18(%rsp), %rcx
movq %rcx, 0x18(%rsp)
movq %rax, 0x8(%rsp)
movq %r13, %rdi
movq %r12, %rsi
callq 0x4630
testq %rax, %rax
je 0xd7c9
movq %rax, %r14
movq %rax, %rbp
subq %r13, %rbp
movq %r15, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x40a0
addq %r15, %rbp
movq %rbp, %rdi
movq 0x10(%rsp), %rsi
callq 0x40f0
addq 0x18(%rsp), %rbp
addq %rbx, %r14
movq %rbp, %r15
movq %r14, %r13
jmp 0xd69b
movq 0x10(%r15), %rsi
movq %rbx, %rdi
callq 0xdfe1
testq %rax, %rax
je 0xd3dc
movq %rax, %r14
movq (%rax), %rsi
movq %rbx, %rdi
callq 0xe227
movq (%r14), %rdx
movq %rbx, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x45d0
movq 0x10(%r15), %rsi
movq %rbx, %rdi
callq 0xdfe1
testq %rax, %rax
je 0xd3dc
movq %rax, %r14
movq (%rax), %rsi
movq %rbx, %rdi
callq 0xe136
movq (%r14), %rsi
pushq $-0x1
popq %rdx
movq %rbx, %rdi
callq 0x4500
jmp 0xd7ac
movq 0x18(%r15), %rsi
movq (%rsp), %rbx
movq %rbx, %rdi
callq 0xdfe1
movq %rax, %r14
testq %rax, %rax
jne 0xd789
jmp 0xd3dc
movq 0x10(%rsp), %rax
shlq $0x4, %rax
addq %rax, %r14
movq (%rsp), %rbx
movq 0x10(%r15), %rdi
callq 0x41d0
leal 0x1(%rax), %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xdf89
movq (%r14), %rdi
movq 0x10(%r15), %rsi
callq 0x40f0
movq $0x0, 0x8(%rsp)
jmp 0xd3dc
movq 0x10(%r15), %rsi
pushq $-0x1
popq %rdx
movq %rbx, %rdi
jmp 0xd8af
movq %r15, %rdi
movq %r13, %rsi
callq 0x40f0
movq (%rsp), %rbx
movq %rbx, %rdi
movq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0xe227
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x45d0
movl %eax, %ebx
leaq 0x7369(%rip), %rdx      # 0x14b6c
movq 0x28(%rsp), %rdi
movq %r14, %rsi
movl $0x3c4, %ecx            # imm = 0x3C4
callq 0x4280
movl %ebx, %eax
jmp 0xd3e1
movq 0x18(%r15), %rsi
movq %rbx, %rdi
callq 0xdfe1
testq %rax, %rax
je 0xd3dc
movq (%rax), %r12
movq 0x10(%r15), %r15
movq 0x280(%rbx), %rbp
movsbq (%r15), %rbx
cmpq $0x24, %rbx
jne 0xd888
cmpb $0x0, 0x1(%r15)
je 0xda6e
leaq 0x750f(%rip), %rsi      # 0x14d6a
leaq 0x751c(%rip), %rcx      # 0x14d7e
movq (%rsp), %rdi
movq %r15, %rdx
jmp 0xd5be
leaq 0x5a3a(%rip), %rsi      # 0x132af
leaq 0x74b5(%rip), %rcx      # 0x14d31
movq (%rsp), %rdi
movq %r12, %rdx
jmp 0xd5be
callq 0x4660
movq %rax, %r14
movq (%rax), %rax
testb $0x8, 0x1(%rax,%rbx,2)
jne 0xd905
movq %r15, 0x28(%rsp)
xorl %ebx, %ebx
jmp 0xda88
movq 0x10(%r15), %rsi
movq %rbx, %rdi
xorl %edx, %edx
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4190
shlq $0x4, %rsi
leaq 0x729f(%rip), %rdx      # 0x14b6c
movq %r12, %rdi
movl $0x19d, %ecx            # imm = 0x19D
callq 0x44e0
movq %rax, %r14
movl 0x30(%rsp), %edi
movq (%rsp), %rdx
movl 0xd8(%rdx), %ecx
movl 0xe8(%rdx), %ebx
cmpl %ecx, %edi
jge 0xd95e
subl %edi, %ebx
leal 0x1(%rbx), %edx
sarl $0x1f, %edx
andl %ecx, %edx
addl %edx, %ebx
incl %ebx
jmp 0xd960
leaq 0x30(%rsp), %r13
xorl %edi, %edi
movq %r15, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x4370
movq %rax, %rbx
movq (%r13), %rdx
movzbl (%rdx), %ecx
testl %ecx, %ecx
je 0xda71
cmpl $0x2d, %ecx
jne 0xda7f
leaq 0x1(%rdx), %rsi
movq %rsi, 0x30(%rsp)
movsbq 0x1(%rdx), %rcx
cmpq $0x24, %rcx
jne 0xdc5d
addq $0x2, %rdx
movq %rdx, 0x30(%rsp)
pushq $-0x1
popq %r14
jmp 0xdc82
incl %ebx
xorl %ebp, %ebp
pushq $0x28
popq %r13
movq %r14, 0x10(%rsp)
xorl %r15d, %r15d
movslq %edi, %rcx
cmpq %rcx, %r15
jge 0xd9e3
movq (%rsp), %rsi
movslq 0xd8(%rsi), %rcx
cmpl %ecx, %ebx
cmovgel %ebp, %ebx
cmpq %rcx, %r15
jge 0xd9af
movq 0xe0(%rsi), %rcx
movslq %ebx, %rdx
shlq $0x4, %rdx
movups (%rcx,%rdx), %xmm0
movups %xmm0, (%r14)
movq 0xe0(%rsi), %rcx
andq $0x0, (%rcx,%rdx)
jmp 0xd9d8
movq %r12, %rdi
movq %r13, %rsi
leaq 0x71b0(%rip), %rdx      # 0x14b6c
movl $0x1ae, %ecx            # imm = 0x1AE
callq 0x44e0
movq %rax, (%r14)
movb $0x0, (%rax)
movl $0x28, 0x8(%r14)
movl 0x30(%rsp), %edi
incq %r15
incl %ebx
addq $0x10, %r14
jmp 0xd96e
xorl %ebx, %ebx
leaq 0x7180(%rip), %r15      # 0x14b6c
xorl %r14d, %r14d
movq (%rsp), %rcx
movslq 0xd8(%rcx), %rax
movq 0xe0(%rcx), %rsi
cmpq %rax, %r14
jge 0xda28
movq (%rsi,%rbx), %rsi
testq %rsi, %rsi
je 0xda1f
movq %r12, %rdi
movq %r15, %rdx
movl $0x1bb, %ecx            # imm = 0x1BB
callq 0x4280
incq %r14
addq $0x10, %rbx
jmp 0xd9ef
leaq 0x713d(%rip), %rdx      # 0x14b6c
movq %r12, %rdi
movl $0x1be, %ecx            # imm = 0x1BE
callq 0x4280
movq (%rsp), %rdx
movq 0x10(%rsp), %rax
movq %rax, 0xe0(%rdx)
movl 0x30(%rsp), %eax
movl 0xd8(%rdx), %ecx
cmpl %ecx, %eax
cmovll %eax, %ecx
decl %ecx
movl %ecx, 0xe8(%rdx)
movl %eax, 0xd8(%rdx)
jmp 0xd7ac
pushq $-0x1
popq %rbx
movq $0x0, 0x28(%rsp)
movl %ebx, %r14d
jmp 0xda8c
movq $0x0, 0x28(%rsp)
pushq $-0x1
popq %r14
movq %r15, 0x60(%rsp)
movq %r12, %rdi
callq 0x41d0
leal 0x1(%rax), %esi
leaq 0x70c9(%rip), %rdx      # 0x14b6c
movq %rbp, 0x58(%rsp)
movq %rbp, %rdi
movl $0x41c, %ecx            # imm = 0x41C
callq 0x44e0
movq %rax, 0x18(%rsp)
callq 0x4660
movq %rax, %rbp
movq (%rax), %rcx
decq %r12
movsbq 0x1(%r12), %rax
incq %r12
testb $0x20, 0x1(%rcx,%rax,2)
jne 0xdac8
xorl %r15d, %r15d
movq 0x18(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movq %rbp, 0x50(%rsp)
testb %al, %al
je 0xdbe4
movq %r12, 0x30(%rsp)
movq %r12, %rdi
xorl %esi, %esi
callq 0x41b0
movq %rax, %r13
cmpb $0x0, (%rax)
je 0xdb28
movq %r13, %rax
incq %rax
movq (%rbp), %rcx
movsbq 0x1(%r13), %rdx
incq %r13
testb $0x20, 0x1(%rcx,%rdx,2)
jne 0xdb13
movq %r13, %r12
movq %rax, %r13
cmpl %r15d, %ebx
jg 0xdbd8
cmpl $-0x1, %ebx
je 0xdb4c
cmpl $-0x1, %r14d
setne %al
cmpl %r15d, %r14d
setl %cl
testb %cl, %al
je 0xdb64
jmp 0xdbd8
cmpl $-0x1, %r14d
setne %al
cmpl %r15d, %r14d
setl %cl
cmpb $0x0, (%r12)
jne 0xdbd8
andb %cl, %al
jne 0xdbd8
movq %r14, %rbp
movq 0x28(%rsp), %rsi
testq %rsi, %rsi
je 0xdb92
movq %rbx, %r14
movb (%r13), %bl
movb $0x0, (%r13)
movq 0x30(%rsp), %rdi
callq 0x4480
movb %bl, (%r13)
movq %r14, %rbx
testl %eax, %eax
je 0xdbd0
movq 0x18(%rsp), %rax
movq %rax, %r14
movq 0x10(%rsp), %rcx
cmpq %rax, %rcx
je 0xdbb0
movq %rcx, %rax
movb $0x20, (%rcx)
incq %rax
movq %rax, %r14
movq 0x30(%rsp), %rsi
movq %r13, %rdx
subq %rsi, %rdx
movq %r14, %rdi
callq 0x40a0
subq 0x30(%rsp), %r13
addq %r14, %r13
movq %r13, 0x10(%rsp)
movq %rbp, %r14
movq 0x50(%rsp), %rbp
incl %r15d
movb (%r12), %al
jmp 0xdaea
movq 0x10(%rsp), %rax
movb $0x0, (%rax)
cmpl %r15d, %r14d
jge 0xdc26
cmpl %r15d, %ebx
jge 0xdc26
movq 0x18(%rsp), %r14
testq %r14, %r14
movq (%rsp), %rbx
je 0xd3dc
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe136
movq %r14, (%rbx)
movq 0xd383(%rip), %rax      # 0x1afa0
movq %rax, 0x8(%rbx)
jmp 0xd7ac
leaq 0x6f3f(%rip), %rdx      # 0x14b6c
movq 0x58(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl $0x449, %ecx            # imm = 0x449
callq 0x4280
leaq 0x7126(%rip), %rsi      # 0x14d6e
leaq 0x70fc(%rip), %rcx      # 0x14d4b
movq (%rsp), %rdi
movq 0x60(%rsp), %rdx
jmp 0xd5be
movq (%r14), %rax
testb $0x8, 0x1(%rax,%rcx,2)
je 0xd854
leaq 0x30(%rsp), %r14
xorl %edi, %edi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x4370
movq (%r14), %rdx
movq %rax, %r14
cmpb $0x0, (%rdx)
jne 0xd854
cmpl %ebx, %r14d
setl %al
cmpl $-0x1, %r14d
setne %cl
testb %cl, %al
jne 0xd854
movq $0x0, 0x28(%rsp)
jmp 0xda8c