// File: karel-brinda[P]ococo/ext/htslib/cram/rANS_static.c
// Function: rans_compress_O1
unsigned char *rans_compress_O1(unsigned char *in, unsigned int in_size,
				unsigned int *out_size) {
    unsigned char *out_buf = NULL, *out_end, *cp;
    unsigned int last_i, tab_size, rle_i, rle_j;
    RansEncSymbol (*syms)[256] = NULL;  /* syms[256][256] */
    int (*F)[256] = NULL;               /* F[256][256]    */
    int *T = NULL;                      /* T[256]         */
    int i, j;
    unsigned char c;

    if (in_size < 4)
	return rans_compress_O0(in, in_size, out_size);

    syms = malloc(256 * sizeof(*syms));
    if (!syms) goto cleanup;
    F = calloc(256, sizeof(*F));
    if (!F) goto cleanup;
    T = calloc(256, sizeof(*T));
    if (!T) goto cleanup;
    out_buf = malloc(1.05*in_size + 257*257*3 + 9);
    if (!out_buf) goto cleanup;

    out_end = out_buf + (int)(1.05*in_size) + 257*257*3 + 9;
    cp = out_buf+9;

    //for (last = 0, i=in_size-1; i>=0; i--) {
    //	F[last][c = in[i]]++;
    //	T[last]++;
    //	last = c;
    //}

    for (last_i=i=0; i<in_size; i++) {
	F[last_i][c = in[i]]++;
	T[last_i]++;
	last_i = c;
    }
    F[0][in[1*(in_size>>2)]]++;
    F[0][in[2*(in_size>>2)]]++;
    F[0][in[3*(in_size>>2)]]++;
    T[0]+=3;

    // Normalise so T[i] == TOTFREQ
    for (rle_i = i = 0; i < 256; i++) {
	int t2, m, M;
	unsigned int x;

	if (T[i] == 0)
	    continue;

	//uint64_t p = (TOTFREQ * TOTFREQ) / t;
	double p = ((double)TOTFREQ)/T[i];
	for (t2 = m = M = j = 0; j < 256; j++) {
	    if (!F[i][j])
		continue;

	    if (m < F[i][j])
		m = F[i][j], M = j;

	    //if ((F[i][j] = (F[i][j] * p) / TOTFREQ) == 0)
	    if ((F[i][j] *= p) == 0)
		F[i][j] = 1;
	    t2 += F[i][j];
	}

	t2++;
	if (t2 < TOTFREQ)
	    F[i][M] += TOTFREQ-t2;
	else
	    F[i][M] -= t2-TOTFREQ;

	// Store frequency table
	// i
	if (rle_i) {
	    rle_i--;
	} else {
	    *cp++ = i;
	    // FIXME: could use order-0 statistics to observe which alphabet
	    // symbols are present and base RLE on that ordering instead.
	    if (i && T[i-1]) {
		for(rle_i=i+1; rle_i<256 && T[rle_i]; rle_i++)
		    ;
		rle_i -= i+1;
		*cp++ = rle_i;
	    }
	}

	int *F_i_ = F[i];
	x = 0;
	rle_j = 0;
	for (j = 0; j < 256; j++) {
	    if (F_i_[j]) {
		//fprintf(stderr, "F[%d][%d]=%d, x=%d\n", i, j, F_i_[j], x);

		// j
		if (rle_j) {
		    rle_j--;
		} else {
		    *cp++ = j;
		    if (!rle_j && j && F_i_[j-1]) {
			for(rle_j=j+1; rle_j<256 && F_i_[rle_j]; rle_j++)
			    ;
			rle_j -= j+1;
			*cp++ = rle_j;
		    }
		}

		// F_i_[j]
		if (F_i_[j]<128) {
		    *cp++ = F_i_[j];
		} else {
		    *cp++ = 128 | (F_i_[j]>>8);
		    *cp++ = F_i_[j]&0xff;
		}

		RansEncSymbolInit(&syms[i][j], x, F_i_[j], TF_SHIFT);
		x += F_i_[j];
	    }
	}
	*cp++ = 0;
    }
    *cp++ = 0;

    //write(1, out_buf+4, cp-(out_buf+4));
    tab_size = cp - out_buf;
    assert(tab_size < 257*257*3);

    RansState rans0, rans1, rans2, rans3;
    RansEncInit(&rans0);
    RansEncInit(&rans1);
    RansEncInit(&rans2);
    RansEncInit(&rans3);

    uint8_t* ptr = out_end;

    int isz4 = in_size>>2;
    int i0 = 1*isz4-2;
    int i1 = 2*isz4-2;
    int i2 = 3*isz4-2;
    int i3 = 4*isz4-2;

    unsigned char l0 = in[i0+1];
    unsigned char l1 = in[i1+1];
    unsigned char l2 = in[i2+1];
    unsigned char l3 = in[i3+1];

    // Deal with the remainder
    l3 = in[in_size-1];
    for (i3 = in_size-2; i3 > 4*isz4-2; i3--) {
	unsigned char c3 = in[i3];
	RansEncPutSymbol(&rans3, &ptr, &syms[c3][l3]);
	l3 = c3;
    }

    for (; i0 >= 0; i0--, i1--, i2--, i3--) {
	unsigned char c0, c1, c2, c3;
	RansEncSymbol *s3 = &syms[c3 = in[i3]][l3];
	RansEncSymbol *s2 = &syms[c2 = in[i2]][l2];
	RansEncSymbol *s1 = &syms[c1 = in[i1]][l1];
	RansEncSymbol *s0 = &syms[c0 = in[i0]][l0];

	RansEncPutSymbol(&rans3, &ptr, s3);
	RansEncPutSymbol(&rans2, &ptr, s2);
	RansEncPutSymbol(&rans1, &ptr, s1);
	RansEncPutSymbol(&rans0, &ptr, s0);

	l0 = c0;
	l1 = c1;
	l2 = c2;
	l3 = c3;
    }

    RansEncPutSymbol(&rans3, &ptr, &syms[0][l3]);
    RansEncPutSymbol(&rans2, &ptr, &syms[0][l2]);
    RansEncPutSymbol(&rans1, &ptr, &syms[0][l1]);
    RansEncPutSymbol(&rans0, &ptr, &syms[0][l0]);

    RansEncFlush(&rans3, &ptr);
    RansEncFlush(&rans2, &ptr);
    RansEncFlush(&rans1, &ptr);
    RansEncFlush(&rans0, &ptr);

    *out_size = (out_end - ptr) + tab_size;

    cp = out_buf;
    *cp++ = 1; // order

    *cp++ = ((*out_size-9)>> 0) & 0xff;
    *cp++ = ((*out_size-9)>> 8) & 0xff;
    *cp++ = ((*out_size-9)>>16) & 0xff;
    *cp++ = ((*out_size-9)>>24) & 0xff;

    *cp++ = (in_size>> 0) & 0xff;
    *cp++ = (in_size>> 8) & 0xff;
    *cp++ = (in_size>>16) & 0xff;
    *cp++ = (in_size>>24) & 0xff;

    memmove(out_buf + tab_size, ptr, out_end-ptr);

 cleanup:
    free(syms);
    free(F);
    free(T);

    return out_buf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
cmpl $0x4, -0x14(%rbp)
jae 0x597f5
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
callq 0x58010
movq %rax, -0x8(%rbp)
jmp 0x5a415
movl $0x100000, %edi         # imm = 0x100000
callq 0x47a0
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x5980f
jmp 0x5a3f2
movl $0x100, %edi            # imm = 0x100
movl $0x400, %esi            # imm = 0x400
callq 0x4370
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
jne 0x5982e
jmp 0x5a3f2
movl $0x100, %edi            # imm = 0x100
movl $0x4, %esi
callq 0x4370
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
jne 0x5984d
jmp 0x5a3f2
movl -0x14(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd 0x23443(%rip), %xmm1    # 0x7cca0
mulsd %xmm1, %xmm0
movsd 0x23e8f(%rip), %xmm1    # 0x7d6f8
addsd %xmm1, %xmm0
movsd 0x23e8b(%rip), %xmm1    # 0x7d700
addsd %xmm1, %xmm0
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rdi
movq %rdi, %rcx
sarq $0x3f, %rcx
movsd 0x21230(%rip), %xmm1    # 0x7aac0
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
andq %rcx, %rax
orq %rax, %rdi
callq 0x47a0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x598b4
jmp 0x5a3f2
movq -0x28(%rbp), %rax
movl -0x14(%rbp), %ecx
cvtsi2sd %rcx, %xmm1
movsd 0x233d8(%rip), %xmm0    # 0x7cca0
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
addq $0x30603, %rax          # imm = 0x30603
addq $0x9, %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
addq $0x9, %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x64(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x64(%rbp), %eax
cmpl -0x14(%rbp), %eax
jae 0x59950
movq -0x58(%rbp), %rax
movl -0x3c(%rbp), %ecx
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
movslq -0x64(%rbp), %rdx
movb (%rcx,%rdx), %cl
movb %cl, -0x69(%rbp)
movzbl %cl, %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x60(%rbp), %rax
movl -0x3c(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movzbl -0x69(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x598fe
movq -0x58(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x14(%rbp), %edx
shrl $0x2, %edx
shll $0x0, %edx
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x58(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x14(%rbp), %edx
shrl $0x2, %edx
shll %edx
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x58(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x14(%rbp), %edx
shrl $0x2, %edx
imull $0x3, %edx, %edx
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x60(%rbp), %rax
movl (%rax), %ecx
addl $0x3, %ecx
movl %ecx, (%rax)
movl $0x0, -0x64(%rbp)
movl $0x0, -0x44(%rbp)
cmpl $0x100, -0x64(%rbp)     # imm = 0x100
jge 0x59e17
movq -0x60(%rbp), %rax
movslq -0x64(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x599e8
jmp 0x59e09
movq -0x60(%rbp), %rax
movslq -0x64(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm1
movsd 0x23d0b(%rip), %xmm0    # 0x7d708
divsd %xmm1, %xmm0
movsd %xmm0, -0x88(%rbp)
movl $0x0, -0x68(%rbp)
movl $0x0, -0x78(%rbp)
movl $0x0, -0x74(%rbp)
movl $0x0, -0x70(%rbp)
cmpl $0x100, -0x68(%rbp)     # imm = 0x100
jge 0x59afe
movq -0x58(%rbp), %rax
movslq -0x64(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movslq -0x68(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x59a50
jmp 0x59af0
movl -0x74(%rbp), %eax
movq -0x58(%rbp), %rcx
movslq -0x64(%rbp), %rdx
shlq $0xa, %rdx
addq %rdx, %rcx
movslq -0x68(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x59a8a
movq -0x58(%rbp), %rax
movslq -0x64(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movslq -0x68(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x74(%rbp)
movl -0x68(%rbp), %eax
movl %eax, -0x78(%rbp)
movsd -0x88(%rbp), %xmm1
movq -0x58(%rbp), %rcx
movslq -0x64(%rbp), %rax
shlq $0xa, %rax
addq %rax, %rcx
movslq -0x68(%rbp), %rdx
cvtsi2sdl (%rcx,%rdx,4), %xmm0
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, (%rcx,%rdx,4)
cmpl $0x0, %eax
jne 0x59ad4
movq -0x58(%rbp), %rax
movslq -0x64(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movslq -0x68(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
movq -0x58(%rbp), %rax
movslq -0x64(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movslq -0x68(%rbp), %rcx
movl (%rax,%rcx,4), %eax
addl -0x70(%rbp), %eax
movl %eax, -0x70(%rbp)
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x59a25
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
cmpl $0x1000, -0x70(%rbp)    # imm = 0x1000
jge 0x59b33
movl $0x1000, %edx           # imm = 0x1000
subl -0x70(%rbp), %edx
movq -0x58(%rbp), %rax
movslq -0x64(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movslq -0x78(%rbp), %rcx
addl (%rax,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
jmp 0x59b57
movl -0x70(%rbp), %esi
subl $0x1000, %esi           # imm = 0x1000
movq -0x58(%rbp), %rax
movslq -0x64(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movslq -0x78(%rbp), %rcx
movl (%rax,%rcx,4), %edx
subl %esi, %edx
movl %edx, (%rax,%rcx,4)
cmpl $0x0, -0x44(%rbp)
je 0x59b6b
movl -0x44(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x59c07
movl -0x64(%rbp), %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
cmpl $0x0, -0x64(%rbp)
je 0x59c05
movq -0x60(%rbp), %rax
movl -0x64(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x59c05
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
xorl %eax, %eax
cmpl $0x100, -0x44(%rbp)     # imm = 0x100
movb %al, -0xe9(%rbp)
jae 0x59bc8
movq -0x60(%rbp), %rax
movl -0x44(%rbp), %ecx
cmpl $0x0, (%rax,%rcx,4)
setne %al
movb %al, -0xe9(%rbp)
movb -0xe9(%rbp), %al
testb $0x1, %al
jne 0x59bd4
jmp 0x59be1
jmp 0x59bd6
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x59ba3
movl -0x64(%rbp), %ecx
addl $0x1, %ecx
movl -0x44(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
jmp 0x59c07
movq -0x58(%rbp), %rax
movslq -0x64(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movq %rax, -0x90(%rbp)
movl $0x0, -0x7c(%rbp)
movl $0x0, -0x48(%rbp)
movl $0x0, -0x68(%rbp)
cmpl $0x100, -0x68(%rbp)     # imm = 0x100
jge 0x59df7
movq -0x90(%rbp), %rax
movslq -0x68(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x59de7
cmpl $0x0, -0x48(%rbp)
je 0x59c68
movl -0x48(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x59d18
movl -0x68(%rbp), %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
cmpl $0x0, -0x48(%rbp)
jne 0x59d16
cmpl $0x0, -0x68(%rbp)
je 0x59d16
movq -0x90(%rbp), %rax
movl -0x68(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x59d16
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
xorl %eax, %eax
cmpl $0x100, -0x48(%rbp)     # imm = 0x100
movb %al, -0xea(%rbp)
jae 0x59cd9
movq -0x90(%rbp), %rax
movl -0x48(%rbp), %ecx
cmpl $0x0, (%rax,%rcx,4)
setne %al
movb %al, -0xea(%rbp)
movb -0xea(%rbp), %al
testb $0x1, %al
jne 0x59ce5
jmp 0x59cf2
jmp 0x59ce7
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x59cb1
movl -0x68(%rbp), %ecx
addl $0x1, %ecx
movl -0x48(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
jmp 0x59d18
movq -0x90(%rbp), %rax
movslq -0x68(%rbp), %rcx
cmpl $0x80, (%rax,%rcx,4)
jge 0x59d4f
movq -0x90(%rbp), %rax
movslq -0x68(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
jmp 0x59d9e
movq -0x90(%rbp), %rax
movslq -0x68(%rbp), %rcx
movl (%rax,%rcx,4), %eax
sarl $0x8, %eax
orl $0x80, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movq -0x90(%rbp), %rax
movslq -0x68(%rbp), %rcx
movl (%rax,%rcx,4), %eax
andl $0xff, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movq -0x50(%rbp), %rdi
movslq -0x64(%rbp), %rax
shlq $0xc, %rax
addq %rax, %rdi
movslq -0x68(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
movl -0x7c(%rbp), %esi
movq -0x90(%rbp), %rax
movslq -0x68(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movl $0xc, %ecx
callq 0x58970
movq -0x90(%rbp), %rax
movslq -0x68(%rbp), %rcx
movl (%rax,%rcx,4), %eax
addl -0x7c(%rbp), %eax
movl %eax, -0x7c(%rbp)
jmp 0x59de9
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x59c32
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb $0x0, (%rax)
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x599c8
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb $0x0, (%rax)
movq -0x38(%rbp), %rax
movq -0x28(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x40(%rbp)
cmpl $0x30603, -0x40(%rbp)   # imm = 0x30603
jae 0x59e42
jmp 0x59e61
leaq 0x239ad(%rip), %rdi     # 0x7d7f6
leaq 0x238e7(%rip), %rsi     # 0x7d737
movl $0x1e3, %edx            # imm = 0x1E3
leaq 0x239af(%rip), %rcx     # 0x7d80b
callq 0x4360
leaq -0x94(%rbp), %rdi
callq 0x58b10
leaq -0x98(%rbp), %rdi
callq 0x58b10
leaq -0x9c(%rbp), %rdi
callq 0x58b10
leaq -0xa0(%rbp), %rdi
callq 0x58b10
movq -0x30(%rbp), %rax
movq %rax, -0xa8(%rbp)
movl -0x14(%rbp), %eax
shrl $0x2, %eax
movl %eax, -0xac(%rbp)
movl -0xac(%rbp), %eax
shll $0x0, %eax
subl $0x2, %eax
movl %eax, -0xb0(%rbp)
movl -0xac(%rbp), %eax
shll %eax
subl $0x2, %eax
movl %eax, -0xb4(%rbp)
imull $0x3, -0xac(%rbp), %eax
subl $0x2, %eax
movl %eax, -0xb8(%rbp)
movl -0xac(%rbp), %eax
shll $0x2, %eax
subl $0x2, %eax
movl %eax, -0xbc(%rbp)
movq -0x10(%rbp), %rax
movl -0xb0(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0xbd(%rbp)
movq -0x10(%rbp), %rax
movl -0xb4(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0xbe(%rbp)
movq -0x10(%rbp), %rax
movl -0xb8(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0xbf(%rbp)
movq -0x10(%rbp), %rax
movl -0xbc(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0xc0(%rbp)
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movb (%rax,%rcx), %al
movb %al, -0xc0(%rbp)
movl -0x14(%rbp), %eax
subl $0x2, %eax
movl %eax, -0xbc(%rbp)
movl -0xbc(%rbp), %eax
movl -0xac(%rbp), %ecx
shll $0x2, %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jle 0x59fec
movq -0x10(%rbp), %rax
movslq -0xbc(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0xc1(%rbp)
movq -0x50(%rbp), %rdx
movzbl -0xc1(%rbp), %eax
shlq $0xc, %rax
addq %rax, %rdx
movzbl -0xc0(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rdx
leaq -0xa0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x58b30
movb -0xc1(%rbp), %al
movb %al, -0xc0(%rbp)
movl -0xbc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xbc(%rbp)
jmp 0x59f72
jmp 0x59fee
cmpl $0x0, -0xb0(%rbp)
jl 0x5a1b0
movq -0x50(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq -0xbc(%rbp), %rdx
movb (%rcx,%rdx), %cl
movb %cl, -0xc5(%rbp)
movzbl %cl, %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movzbl -0xc0(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0xd0(%rbp)
movq -0x50(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq -0xb8(%rbp), %rdx
movb (%rcx,%rdx), %cl
movb %cl, -0xc4(%rbp)
movzbl %cl, %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movzbl -0xbf(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0xd8(%rbp)
movq -0x50(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq -0xb4(%rbp), %rdx
movb (%rcx,%rdx), %cl
movb %cl, -0xc3(%rbp)
movzbl %cl, %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movzbl -0xbe(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0xe0(%rbp)
movq -0x50(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq -0xb0(%rbp), %rdx
movb (%rcx,%rdx), %cl
movb %cl, -0xc2(%rbp)
movzbl %cl, %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movzbl -0xbd(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0xe8(%rbp)
movq -0xd0(%rbp), %rdx
leaq -0xa0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x58b30
movq -0xd8(%rbp), %rdx
leaq -0x9c(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x58b30
movq -0xe0(%rbp), %rdx
leaq -0x98(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x58b30
movq -0xe8(%rbp), %rdx
leaq -0x94(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x58b30
movb -0xc2(%rbp), %al
movb %al, -0xbd(%rbp)
movb -0xc3(%rbp), %al
movb %al, -0xbe(%rbp)
movb -0xc4(%rbp), %al
movb %al, -0xbf(%rbp)
movb -0xc5(%rbp), %al
movb %al, -0xc0(%rbp)
movl -0xb0(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xb0(%rbp)
movl -0xb4(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xb4(%rbp)
movl -0xb8(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xb8(%rbp)
movl -0xbc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xbc(%rbp)
jmp 0x59fee
movq -0x50(%rbp), %rdx
movzbl -0xc0(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rdx
leaq -0xa0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x58b30
movq -0x50(%rbp), %rdx
movzbl -0xbf(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rdx
leaq -0x9c(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x58b30
movq -0x50(%rbp), %rdx
movzbl -0xbe(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rdx
leaq -0x98(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x58b30
movq -0x50(%rbp), %rdx
movzbl -0xbd(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rdx
leaq -0x94(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x58b30
leaq -0xa0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x58c10
leaq -0x9c(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x58c10
leaq -0x98(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x58c10
leaq -0x94(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x58c10
movq -0x30(%rbp), %rax
movq -0xa8(%rbp), %rcx
subq %rcx, %rax
movl -0x40(%rbp), %ecx
addq %rcx, %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb $0x1, (%rax)
movq -0x20(%rbp), %rax
movl (%rax), %eax
subl $0x9, %eax
shrl $0x0, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movq -0x20(%rbp), %rax
movl (%rax), %eax
subl $0x9, %eax
shrl $0x8, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movq -0x20(%rbp), %rax
movl (%rax), %eax
subl $0x9, %eax
shrl $0x10, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movq -0x20(%rbp), %rax
movl (%rax), %eax
subl $0x9, %eax
shrl $0x18, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x14(%rbp), %eax
shrl $0x0, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x14(%rbp), %eax
shrl $0x8, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x14(%rbp), %eax
shrl $0x10, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x14(%rbp), %eax
shrl $0x18, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movq -0x28(%rbp), %rdi
movl -0x40(%rbp), %eax
addq %rax, %rdi
movq -0xa8(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0xa8(%rbp), %rax
subq %rax, %rdx
callq 0x4970
movq -0x50(%rbp), %rdi
callq 0x46a0
movq -0x58(%rbp), %rdi
callq 0x46a0
movq -0x60(%rbp), %rdi
callq 0x46a0
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xf0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)