// File: karel-brinda[P]ococo/ext/htslib/cram/rANS_static.c
// Function: rans_uncompress_O1
unsigned char *rans_uncompress_O1(unsigned char *in, unsigned int in_size,
				  unsigned int *out_size) {
    /* Load in the static tables */
    unsigned char *cp = in + 9;
    int i, j = -999, x, out_sz, in_sz, rle_i, rle_j;
    char *out_buf = NULL;
    ari_decoder *D = NULL;              /* D[256] */
    RansDecSymbol (*syms)[256] = NULL;  /* syms[256][256] */

    if (*in++ != 1) // Order-1 check
	return NULL;

    in_sz  = ((in[0])<<0) | ((in[1])<<8) | ((in[2])<<16) | ((in[3])<<24);
    out_sz = ((in[4])<<0) | ((in[5])<<8) | ((in[6])<<16) | ((in[7])<<24);
    if (in_sz != in_size-9)
	return NULL;

    D = calloc(256, sizeof(*D));
    if (!D) goto cleanup;
    syms = malloc(256 * sizeof(*syms));
    if (!syms) goto cleanup;

    //fprintf(stderr, "out_sz=%d\n", out_sz);

    //i = *cp++;
    rle_i = 0;
    i = *cp++;
    do {
	rle_j = x = 0;
	j = *cp++;
	do {
	    if ((D[i].fc[j].F = *cp++) >= 128) {
		D[i].fc[j].F &= ~128;
		D[i].fc[j].F = ((D[i].fc[j].F & 127) << 8) | *cp++;
	    }
	    D[i].fc[j].C = x;

	    //fprintf(stderr, "i=%d j=%d F=%d C=%d\n", i, j, D[i].fc[j].F, D[i].fc[j].C);

	    if (!D[i].fc[j].F)
		D[i].fc[j].F = TOTFREQ;

	    RansDecSymbolInit(&syms[i][j], D[i].fc[j].C, D[i].fc[j].F);

	    /* Build reverse lookup table */
	    if (!D[i].R) {
                D[i].R = (unsigned char *)malloc(TOTFREQ);
                if (!D[i].R)
                    goto cleanup;
            }
	    memset(&D[i].R[x], j, D[i].fc[j].F);

	    x += D[i].fc[j].F;
	    assert(x <= TOTFREQ);

	    if (!rle_j && j+1 == *cp) {
		j = *cp++;
		rle_j = *cp++;
	    } else if (rle_j) {
		rle_j--;
		j++;
	    } else {
		j = *cp++;
	    }
	} while(j);

	if (!rle_i && i+1 == *cp) {
	    i = *cp++;
	    rle_i = *cp++;
	} else if (rle_i) {
	    rle_i--;
	    i++;
	} else {
	    i = *cp++;
	}
    } while (i);

    // Precompute reverse lookup of frequency.

    RansState rans0, rans1, rans2, rans3;
    uint8_t *ptr = cp;
    RansDecInit(&rans0, &ptr);
    RansDecInit(&rans1, &ptr);
    RansDecInit(&rans2, &ptr);
    RansDecInit(&rans3, &ptr);

    int isz4 = out_sz>>2;
    int l0 = 0;
    int l1 = 0;
    int l2 = 0;
    int l3 = 0;
    int i4[] = {0*isz4, 1*isz4, 2*isz4, 3*isz4};

    RansState R[4];
    R[0] = rans0;
    R[1] = rans1;
    R[2] = rans2;
    R[3] = rans3;

    /* Allocate output buffer */
    out_buf = malloc(out_sz);
    if (!out_buf) goto cleanup;

    for (; i4[0] < isz4; i4[0]++, i4[1]++, i4[2]++, i4[3]++) {
	uint32_t m[4] = {R[0] & ((1u << TF_SHIFT)-1),
			 R[1] & ((1u << TF_SHIFT)-1),
			 R[2] & ((1u << TF_SHIFT)-1),
			 R[3] & ((1u << TF_SHIFT)-1)};

	uint8_t c[4] = {D[l0].R[m[0]],
			D[l1].R[m[1]],
			D[l2].R[m[2]],
			D[l3].R[m[3]]};

	out_buf[i4[0]] = c[0];
	out_buf[i4[1]] = c[1];
	out_buf[i4[2]] = c[2];
	out_buf[i4[3]] = c[3];

	//RansDecAdvanceSymbolStep(&R[0], &syms[l0][c[0]], TF_SHIFT);
	//RansDecAdvanceSymbolStep(&R[1], &syms[l1][c[1]], TF_SHIFT);
	//RansDecAdvanceSymbolStep(&R[2], &syms[l2][c[2]], TF_SHIFT);
	//RansDecAdvanceSymbolStep(&R[3], &syms[l3][c[3]], TF_SHIFT);

	R[0] = syms[l0][c[0]].freq * (R[0]>>TF_SHIFT);
	R[1] = syms[l1][c[1]].freq * (R[1]>>TF_SHIFT);
	R[2] = syms[l2][c[2]].freq * (R[2]>>TF_SHIFT);
	R[3] = syms[l3][c[3]].freq * (R[3]>>TF_SHIFT);

	R[0] += m[0] - syms[l0][c[0]].start;
	R[1] += m[1] - syms[l1][c[1]].start;
	R[2] += m[2] - syms[l2][c[2]].start;
	R[3] += m[3] - syms[l3][c[3]].start;

	RansDecRenorm(&R[0], &ptr);
	RansDecRenorm(&R[1], &ptr);
	RansDecRenorm(&R[2], &ptr);
	RansDecRenorm(&R[3], &ptr);

	l0 = c[0];
	l1 = c[1];
	l2 = c[2];
	l3 = c[3];
    }

    rans0 = R[0];
    rans1 = R[1];
    rans2 = R[2];
    rans3 = R[3];

    // Remainder
    for (; i4[3] < out_sz; i4[3]++) {
	unsigned char c3 = D[l3].R[RansDecGet(&rans3, TF_SHIFT)];
	out_buf[i4[3]] = c3;
	RansDecAdvanceSymbol(&rans3, &ptr, &syms[l3][c3], TF_SHIFT);
	l3 = c3;
    }

    *out_size = out_sz;

 cleanup:
    if (D) {
        for (i = 0; i < 256; i++)
            if (D[i].R) free(D[i].R);
        free(D);
    }
    free(syms);

    return (unsigned char *)out_buf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
addq $0x9, %rax
movq %rax, -0x28(%rbp)
movl $0xfffffc19, -0x30(%rbp) # imm = 0xFFFFFC19
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movzbl (%rax), %eax
cmpl $0x1, %eax
je 0x5a495
movq $0x0, -0x8(%rbp)
jmp 0x5ae87
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
shll $0x0, %eax
movq -0x10(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x10(%rbp), %rcx
movzbl 0x2(%rcx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x10(%rbp), %rcx
movzbl 0x3(%rcx), %ecx
shll $0x18, %ecx
orl %ecx, %eax
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x4(%rax), %eax
shll $0x0, %eax
movq -0x10(%rbp), %rcx
movzbl 0x5(%rcx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x10(%rbp), %rcx
movzbl 0x6(%rcx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x10(%rbp), %rcx
movzbl 0x7(%rcx), %ecx
shll $0x18, %ecx
orl %ecx, %eax
movl %eax, -0x38(%rbp)
movl -0x3c(%rbp), %eax
movl -0x14(%rbp), %ecx
subl $0x9, %ecx
cmpl %ecx, %eax
je 0x5a518
movq $0x0, -0x8(%rbp)
jmp 0x5ae87
movl $0x100, %edi            # imm = 0x100
movl $0x808, %esi            # imm = 0x808
callq 0x4370
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
jne 0x5a537
jmp 0x5ae0f
movl $0x40000, %edi          # imm = 0x40000
callq 0x47a0
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
jne 0x5a551
jmp 0x5ae0f
movl $0x0, -0x40(%rbp)
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movzbl (%rax), %eax
movl %eax, -0x2c(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x44(%rbp)
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movzbl (%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movzbl (%rax), %eax
movq -0x58(%rbp), %rcx
movslq -0x2c(%rbp), %rdx
imulq $0x808, %rdx, %rdx      # imm = 0x808
addq %rdx, %rcx
movslq -0x30(%rbp), %rdx
movl %eax, (%rcx,%rdx,8)
cmpl $0x80, %eax
jl 0x5a630
movq -0x58(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x808, %rcx, %rcx      # imm = 0x808
addq %rcx, %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,8), %edx
andl $0xffffff7f, %edx       # imm = 0xFFFFFF7F
movl %edx, (%rax,%rcx,8)
movq -0x58(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x808, %rcx, %rcx      # imm = 0x808
addq %rcx, %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,8), %edx
andl $0x7f, %edx
shll $0x8, %edx
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movzbl (%rax), %eax
orl %eax, %edx
movq -0x58(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x808, %rcx, %rcx      # imm = 0x808
addq %rcx, %rax
movslq -0x30(%rbp), %rcx
movl %edx, (%rax,%rcx,8)
movl -0x34(%rbp), %edx
movq -0x58(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x808, %rcx, %rcx      # imm = 0x808
addq %rcx, %rax
movslq -0x30(%rbp), %rcx
movl %edx, 0x4(%rax,%rcx,8)
movq -0x58(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x808, %rcx, %rcx      # imm = 0x808
addq %rcx, %rax
movslq -0x30(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,8)
jne 0x5a686
movq -0x58(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x808, %rcx, %rcx      # imm = 0x808
addq %rcx, %rax
movslq -0x30(%rbp), %rcx
movl $0x1000, (%rax,%rcx,8)  # imm = 0x1000
movq -0x60(%rbp), %rdi
movslq -0x2c(%rbp), %rax
shlq $0xa, %rax
addq %rax, %rdi
movslq -0x30(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0x58(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x808, %rcx, %rcx      # imm = 0x808
addq %rcx, %rax
movslq -0x30(%rbp), %rcx
movl 0x4(%rax,%rcx,8), %esi
movq -0x58(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x808, %rcx, %rcx      # imm = 0x808
addq %rcx, %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,8), %edx
callq 0x595b0
movq -0x58(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x808, %rcx, %rcx      # imm = 0x808
addq %rcx, %rax
cmpq $0x0, 0x800(%rax)
jne 0x5a73d
movl $0x1000, %edi           # imm = 0x1000
callq 0x47a0
movq %rax, %rcx
movq -0x58(%rbp), %rax
movslq -0x2c(%rbp), %rdx
imulq $0x808, %rdx, %rdx      # imm = 0x808
addq %rdx, %rax
movq %rcx, 0x800(%rax)
movq -0x58(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x808, %rcx, %rcx      # imm = 0x808
addq %rcx, %rax
cmpq $0x0, 0x800(%rax)
jne 0x5a73b
jmp 0x5ae0f
jmp 0x5a73d
movq -0x58(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x808, %rcx, %rcx      # imm = 0x808
addq %rcx, %rax
movq 0x800(%rax), %rdi
movslq -0x34(%rbp), %rax
addq %rax, %rdi
movl -0x30(%rbp), %eax
movq -0x58(%rbp), %rcx
movslq -0x2c(%rbp), %rdx
imulq $0x808, %rdx, %rdx      # imm = 0x808
addq %rdx, %rcx
movslq -0x30(%rbp), %rdx
movslq (%rcx,%rdx,8), %rdx
movzbl %al, %esi
callq 0x42d0
movq -0x58(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x808, %rcx, %rcx      # imm = 0x808
addq %rcx, %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,8), %eax
addl -0x34(%rbp), %eax
movl %eax, -0x34(%rbp)
cmpl $0x1000, -0x34(%rbp)    # imm = 0x1000
jg 0x5a7ac
jmp 0x5a7cb
leaq 0x230a7(%rip), %rdi     # 0x7d85a
leaq 0x22f7d(%rip), %rsi     # 0x7d737
movl $0x26a, %edx            # imm = 0x26A
leaq 0x230a1(%rip), %rcx     # 0x7d867
callq 0x4360
cmpl $0x0, -0x44(%rbp)
jne 0x5a80e
movl -0x30(%rbp), %eax
addl $0x1, %eax
movq -0x28(%rbp), %rcx
movzbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x5a80e
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movzbl (%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movzbl (%rax), %eax
movl %eax, -0x44(%rbp)
jmp 0x5a83f
cmpl $0x0, -0x44(%rbp)
je 0x5a828
movl -0x44(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x44(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x5a83d
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movzbl (%rax), %eax
movl %eax, -0x30(%rbp)
jmp 0x5a83f
jmp 0x5a841
cmpl $0x0, -0x30(%rbp)
jne 0x5a590
cmpl $0x0, -0x40(%rbp)
jne 0x5a88e
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movq -0x28(%rbp), %rcx
movzbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x5a88e
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movzbl (%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movzbl (%rax), %eax
movl %eax, -0x40(%rbp)
jmp 0x5a8bf
cmpl $0x0, -0x40(%rbp)
je 0x5a8a8
movl -0x40(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x40(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x5a8bd
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movzbl (%rax), %eax
movl %eax, -0x2c(%rbp)
jmp 0x5a8bf
jmp 0x5a8c1
cmpl $0x0, -0x2c(%rbp)
jne 0x5a56d
movq -0x28(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x64(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x59640
leaq -0x68(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x59640
leaq -0x6c(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x59640
leaq -0x70(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x59640
movl -0x38(%rbp), %eax
sarl $0x2, %eax
movl %eax, -0x7c(%rbp)
movl $0x0, -0x80(%rbp)
movl $0x0, -0x84(%rbp)
movl $0x0, -0x88(%rbp)
movl $0x0, -0x8c(%rbp)
imull $0x0, -0x7c(%rbp), %eax
movl %eax, -0xa0(%rbp)
movl -0x7c(%rbp), %eax
shll $0x0, %eax
movl %eax, -0x9c(%rbp)
movl -0x7c(%rbp), %eax
shll %eax
movl %eax, -0x98(%rbp)
imull $0x3, -0x7c(%rbp), %eax
movl %eax, -0x94(%rbp)
movl -0x64(%rbp), %eax
movl %eax, -0xb0(%rbp)
movl -0x68(%rbp), %eax
movl %eax, -0xac(%rbp)
movl -0x6c(%rbp), %eax
movl %eax, -0xa8(%rbp)
movl -0x70(%rbp), %eax
movl %eax, -0xa4(%rbp)
movslq -0x38(%rbp), %rdi
callq 0x47a0
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x5a99d
jmp 0x5ae0f
jmp 0x5a99f
movl -0xa0(%rbp), %eax
cmpl -0x7c(%rbp), %eax
jge 0x5ad27
movl -0xb0(%rbp), %eax
andl $0xfff, %eax            # imm = 0xFFF
movl %eax, -0xc0(%rbp)
movl -0xac(%rbp), %eax
andl $0xfff, %eax            # imm = 0xFFF
movl %eax, -0xbc(%rbp)
movl -0xa8(%rbp), %eax
andl $0xfff, %eax            # imm = 0xFFF
movl %eax, -0xb8(%rbp)
movl -0xa4(%rbp), %eax
andl $0xfff, %eax            # imm = 0xFFF
movl %eax, -0xb4(%rbp)
movq -0x58(%rbp), %rax
movslq -0x80(%rbp), %rcx
imulq $0x808, %rcx, %rcx      # imm = 0x808
addq %rcx, %rax
movq 0x800(%rax), %rax
movl -0xc0(%rbp), %ecx
movb (%rax,%rcx), %al
movb %al, -0xc4(%rbp)
movq -0x58(%rbp), %rax
movslq -0x84(%rbp), %rcx
imulq $0x808, %rcx, %rcx      # imm = 0x808
addq %rcx, %rax
movq 0x800(%rax), %rax
movl -0xbc(%rbp), %ecx
movb (%rax,%rcx), %al
movb %al, -0xc3(%rbp)
movq -0x58(%rbp), %rax
movslq -0x88(%rbp), %rcx
imulq $0x808, %rcx, %rcx      # imm = 0x808
addq %rcx, %rax
movq 0x800(%rax), %rax
movl -0xb8(%rbp), %ecx
movb (%rax,%rcx), %al
movb %al, -0xc2(%rbp)
movq -0x58(%rbp), %rax
movslq -0x8c(%rbp), %rcx
imulq $0x808, %rcx, %rcx      # imm = 0x808
addq %rcx, %rax
movq 0x800(%rax), %rax
movl -0xb4(%rbp), %ecx
movb (%rax,%rcx), %al
movb %al, -0xc1(%rbp)
movb -0xc4(%rbp), %dl
movq -0x50(%rbp), %rax
movslq -0xa0(%rbp), %rcx
movb %dl, (%rax,%rcx)
movb -0xc3(%rbp), %dl
movq -0x50(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movb -0xc2(%rbp), %dl
movq -0x50(%rbp), %rax
movslq -0x98(%rbp), %rcx
movb %dl, (%rax,%rcx)
movb -0xc1(%rbp), %dl
movq -0x50(%rbp), %rax
movslq -0x94(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x60(%rbp), %rax
movslq -0x80(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movzbl -0xc4(%rbp), %ecx
movzwl 0x2(%rax,%rcx,4), %eax
movl -0xb0(%rbp), %ecx
shrl $0xc, %ecx
imull %ecx, %eax
movl %eax, -0xb0(%rbp)
movq -0x60(%rbp), %rax
movslq -0x84(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movzbl -0xc3(%rbp), %ecx
movzwl 0x2(%rax,%rcx,4), %eax
movl -0xac(%rbp), %ecx
shrl $0xc, %ecx
imull %ecx, %eax
movl %eax, -0xac(%rbp)
movq -0x60(%rbp), %rax
movslq -0x88(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movzbl -0xc2(%rbp), %ecx
movzwl 0x2(%rax,%rcx,4), %eax
movl -0xa8(%rbp), %ecx
shrl $0xc, %ecx
imull %ecx, %eax
movl %eax, -0xa8(%rbp)
movq -0x60(%rbp), %rax
movslq -0x8c(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movzbl -0xc1(%rbp), %ecx
movzwl 0x2(%rax,%rcx,4), %eax
movl -0xa4(%rbp), %ecx
shrl $0xc, %ecx
imull %ecx, %eax
movl %eax, -0xa4(%rbp)
movl -0xc0(%rbp), %eax
movq -0x60(%rbp), %rcx
movslq -0x80(%rbp), %rdx
shlq $0xa, %rdx
addq %rdx, %rcx
movzbl -0xc4(%rbp), %edx
movzwl (%rcx,%rdx,4), %ecx
subl %ecx, %eax
addl -0xb0(%rbp), %eax
movl %eax, -0xb0(%rbp)
movl -0xbc(%rbp), %eax
movq -0x60(%rbp), %rcx
movslq -0x84(%rbp), %rdx
shlq $0xa, %rdx
addq %rdx, %rcx
movzbl -0xc3(%rbp), %edx
movzwl (%rcx,%rdx,4), %ecx
subl %ecx, %eax
addl -0xac(%rbp), %eax
movl %eax, -0xac(%rbp)
movl -0xb8(%rbp), %eax
movq -0x60(%rbp), %rcx
movslq -0x88(%rbp), %rdx
shlq $0xa, %rdx
addq %rdx, %rcx
movzbl -0xc2(%rbp), %edx
movzwl (%rcx,%rdx,4), %ecx
subl %ecx, %eax
addl -0xa8(%rbp), %eax
movl %eax, -0xa8(%rbp)
movl -0xb4(%rbp), %eax
movq -0x60(%rbp), %rcx
movslq -0x8c(%rbp), %rdx
shlq $0xa, %rdx
addq %rdx, %rcx
movzbl -0xc1(%rbp), %edx
movzwl (%rcx,%rdx,4), %ecx
subl %ecx, %eax
addl -0xa4(%rbp), %eax
movl %eax, -0xa4(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x596c0
leaq -0xb0(%rbp), %rdi
addq $0x4, %rdi
leaq -0x78(%rbp), %rsi
callq 0x596c0
leaq -0xb0(%rbp), %rdi
addq $0x8, %rdi
leaq -0x78(%rbp), %rsi
callq 0x596c0
leaq -0xb0(%rbp), %rdi
addq $0xc, %rdi
leaq -0x78(%rbp), %rsi
callq 0x596c0
movzbl -0xc4(%rbp), %eax
movl %eax, -0x80(%rbp)
movzbl -0xc3(%rbp), %eax
movl %eax, -0x84(%rbp)
movzbl -0xc2(%rbp), %eax
movl %eax, -0x88(%rbp)
movzbl -0xc1(%rbp), %eax
movl %eax, -0x8c(%rbp)
movl -0xa0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa0(%rbp)
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
movl -0x94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x94(%rbp)
jmp 0x5a99f
movl -0xb0(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0xac(%rbp), %eax
movl %eax, -0x68(%rbp)
movl -0xa8(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl -0xa4(%rbp), %eax
movl %eax, -0x70(%rbp)
movl -0x94(%rbp), %eax
cmpl -0x38(%rbp), %eax
jge 0x5ae06
movq -0x58(%rbp), %rax
movslq -0x8c(%rbp), %rcx
imulq $0x808, %rcx, %rcx      # imm = 0x808
addq %rcx, %rax
movq 0x800(%rax), %rax
movq %rax, -0xd0(%rbp)
leaq -0x70(%rbp), %rdi
movl $0xc, %esi
callq 0x59730
movl %eax, %ecx
movq -0xd0(%rbp), %rax
movl %ecx, %ecx
movb (%rax,%rcx), %al
movb %al, -0xc5(%rbp)
movb -0xc5(%rbp), %dl
movq -0x50(%rbp), %rax
movslq -0x94(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x60(%rbp), %rdx
movslq -0x8c(%rbp), %rax
shlq $0xa, %rax
addq %rax, %rdx
movzbl -0xc5(%rbp), %eax
shlq $0x2, %rax
addq %rax, %rdx
leaq -0x70(%rbp), %rdi
leaq -0x78(%rbp), %rsi
movl $0xc, %ecx
callq 0x59760
movzbl -0xc5(%rbp), %eax
movl %eax, -0x8c(%rbp)
movl -0x94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x94(%rbp)
jmp 0x5ad4b
movl -0x38(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
cmpq $0x0, -0x58(%rbp)
je 0x5ae76
movl $0x0, -0x2c(%rbp)
cmpl $0x100, -0x2c(%rbp)     # imm = 0x100
jge 0x5ae6d
movq -0x58(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x808, %rcx, %rcx      # imm = 0x808
addq %rcx, %rax
cmpq $0x0, 0x800(%rax)
je 0x5ae60
movq -0x58(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x808, %rcx, %rcx      # imm = 0x808
addq %rcx, %rax
movq 0x800(%rax), %rdi
callq 0x46a0
jmp 0x5ae62
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x5ae1d
movq -0x58(%rbp), %rdi
callq 0x46a0
movq -0x60(%rbp), %rdi
callq 0x46a0
movq -0x50(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)