// File: karel-brinda[P]ococo/ext/htslib/cram/cram_decode.c
// Function: cram_dependent_data_series
int cram_dependent_data_series(cram_fd *fd,
			       cram_block_compression_hdr *hdr,
			       cram_slice *s) {
    int *block_used;
    int core_used = 0;
    int i;
    static int i_to_id[] = {
	DS_BF, DS_AP, DS_FP, DS_RL, DS_DL, DS_NF, DS_BA, DS_QS,
	DS_FC, DS_FN, DS_BS, DS_IN, DS_RG, DS_MQ, DS_TL, DS_RN,
	DS_NS, DS_NP, DS_TS, DS_MF, DS_CF, DS_RI, DS_RS, DS_PD,
	DS_HC, DS_SC, DS_BB, DS_QQ,
    };
    uint32_t orig_ds;

    /*
     * Set the data_series bit field based on fd->required_fields
     * contents.
     */
    if (fd->required_fields && fd->required_fields != INT_MAX) {
	hdr->data_series = 0;

	if (fd->required_fields & SAM_QNAME)
	    hdr->data_series |= CRAM_RN;

	if (fd->required_fields & SAM_FLAG)
	    hdr->data_series |= CRAM_BF;

	if (fd->required_fields & SAM_RNAME)
	    hdr->data_series |= CRAM_RI | CRAM_BF;

	if (fd->required_fields & SAM_POS)
	    hdr->data_series |= CRAM_AP | CRAM_BF;

	if (fd->required_fields & SAM_MAPQ)
	    hdr->data_series |= CRAM_MQ;

	if (fd->required_fields & SAM_CIGAR)
	    hdr->data_series |= CRAM_CIGAR;

	if (fd->required_fields & SAM_RNEXT)
	    hdr->data_series |= CRAM_CF | CRAM_NF | CRAM_RI | CRAM_NS |CRAM_BF;

	if (fd->required_fields & SAM_PNEXT)
	    hdr->data_series |= CRAM_CF | CRAM_NF | CRAM_AP | CRAM_NP | CRAM_BF;

	if (fd->required_fields & SAM_TLEN)
	    hdr->data_series |= CRAM_CF | CRAM_NF | CRAM_AP | CRAM_TS |
		CRAM_BF | CRAM_MF | CRAM_RI | CRAM_CIGAR;

	if (fd->required_fields & SAM_SEQ)
	    hdr->data_series |= CRAM_SEQ;

	if (!(fd->required_fields & SAM_AUX))
	    // No easy way to get MD/NM without other tags at present
	    fd->decode_md = 0;

	if (fd->required_fields & SAM_QUAL)
	    hdr->data_series |= CRAM_QUAL;

	if (fd->required_fields & SAM_AUX)
	    hdr->data_series |= CRAM_RG | CRAM_TL | CRAM_aux;

	if (fd->required_fields & SAM_RGAUX)
	    hdr->data_series |= CRAM_RG | CRAM_BF;

	// Always uncompress CORE block
	if (cram_uncompress_block(s->block[0]))
	    return -1;
    } else {
	hdr->data_series = CRAM_ALL;

	for (i = 0; i < s->hdr->num_blocks; i++) {
	    if (cram_uncompress_block(s->block[i]))
		return -1;
	}

	return 0;
    }

    block_used = calloc(s->hdr->num_blocks+1, sizeof(int));
    if (!block_used)
	return -1;

    do {
	/*
	 * Also set data_series based on code prerequisites. Eg if we need
	 * CRAM_QS then we also need to know CRAM_RL so we know how long it
	 * is, or if we need FC/FP then we also need FN (number of features).
	 *
	 * It's not reciprocal though. We may be needing to decode FN
	 * but have no need to decode FC, FP and cigar ops.
	 */
	if (hdr->data_series & CRAM_RS)    hdr->data_series |= CRAM_FC|CRAM_FP;
	if (hdr->data_series & CRAM_PD)    hdr->data_series |= CRAM_FC|CRAM_FP;
	if (hdr->data_series & CRAM_HC)    hdr->data_series |= CRAM_FC|CRAM_FP;
	if (hdr->data_series & CRAM_QS)    hdr->data_series |= CRAM_FC|CRAM_FP;
	if (hdr->data_series & CRAM_IN)    hdr->data_series |= CRAM_FC|CRAM_FP;
	if (hdr->data_series & CRAM_SC)    hdr->data_series |= CRAM_FC|CRAM_FP;
	if (hdr->data_series & CRAM_BS)    hdr->data_series |= CRAM_FC|CRAM_FP;
	if (hdr->data_series & CRAM_DL)    hdr->data_series |= CRAM_FC|CRAM_FP;
	if (hdr->data_series & CRAM_BA)    hdr->data_series |= CRAM_FC|CRAM_FP;
	if (hdr->data_series & CRAM_BB)    hdr->data_series |= CRAM_FC|CRAM_FP;
	if (hdr->data_series & CRAM_QQ)    hdr->data_series |= CRAM_FC|CRAM_FP;

	// cram_decode_seq() needs seq[] array
	if (hdr->data_series & (CRAM_SEQ|CRAM_CIGAR)) hdr->data_series |= CRAM_RL;

	if (hdr->data_series & CRAM_FP)    hdr->data_series |= CRAM_FC;
	if (hdr->data_series & CRAM_FC)    hdr->data_series |= CRAM_FN;
	if (hdr->data_series & CRAM_aux)   hdr->data_series |= CRAM_TL;
	if (hdr->data_series & CRAM_MF)    hdr->data_series |= CRAM_CF;
	if (hdr->data_series & CRAM_MQ)    hdr->data_series |= CRAM_BF;
	if (hdr->data_series & CRAM_BS)    hdr->data_series |= CRAM_RI;
	if (hdr->data_series & (CRAM_MF |CRAM_NS |CRAM_NP |CRAM_TS |CRAM_NF))
	    hdr->data_series |= CRAM_CF;
	if (!hdr->read_names_included && hdr->data_series & CRAM_RN)
	    hdr->data_series |= CRAM_CF | CRAM_NF;
	if (hdr->data_series & (CRAM_BA | CRAM_QS | CRAM_BB | CRAM_QQ))
	    hdr->data_series |= CRAM_BF | CRAM_CF | CRAM_RL;

	orig_ds = hdr->data_series;

	// Find which blocks are in use.
	for (i = 0; i < sizeof(i_to_id)/sizeof(*i_to_id); i++) {
	    int bnum1, bnum2, j;
	    cram_codec *c = hdr->codecs[i_to_id[i]];

	    if (!(hdr->data_series & (1<<i)))
		continue;

	    if (!c)
		continue;

	    bnum1 = cram_codec_to_id(c, &bnum2);

	    for (;;) {
		switch (bnum1) {
		case -2:
		    break;

		case -1:
		    core_used = 1;
		    break;

		default:
		    for (j = 0; j < s->hdr->num_blocks; j++) {
			if (s->block[j]->content_type == EXTERNAL &&
			    s->block[j]->content_id == bnum1) {
			    block_used[j] = 1;
			    if (cram_uncompress_block(s->block[j])) {
				free(block_used);
				return -1;
			    }
			}
		    }
		    break;
		}

		if (bnum2 == -2 || bnum1 == bnum2)
		    break;

		bnum1 = bnum2; // 2nd pass
	    }
	}

	// Tags too
	if ((fd->required_fields & SAM_AUX) ||
	    (hdr->data_series & CRAM_aux)) {
	    for (i = 0; i < CRAM_MAP_HASH; i++) {
		int bnum1, bnum2, j;
		cram_map *m = hdr->tag_encoding_map[i];

		while (m) {
		    cram_codec *c = m->codec;
		    if (!c)
			continue;

		    bnum1 = cram_codec_to_id(c, &bnum2);

		    for (;;) {
			switch (bnum1) {
			case -2:
			    break;

			case -1:
			    core_used = 1;
			    break;

			default:
			    for (j = 0; j < s->hdr->num_blocks; j++) {
				if (s->block[j]->content_type == EXTERNAL &&
				    s->block[j]->content_id == bnum1) {
				    block_used[j] = 1;
				    if (cram_uncompress_block(s->block[j])) {
					free(block_used);
					return -1;
				    }
				}
			    }
			    break;
			}

			if (bnum2 == -2 || bnum1 == bnum2)
			    break;

			bnum1 = bnum2; // 2nd pass
		    }

		    m = m->next;
		}
	    }
	}

	// We now know which blocks are in used, so repeat and find
	// which other data series need to be added.
	for (i = 0; i < sizeof(i_to_id)/sizeof(*i_to_id); i++) {
	    int bnum1, bnum2, j;
	    cram_codec *c = hdr->codecs[i_to_id[i]];

	    if (!c)
		continue;

	    bnum1 = cram_codec_to_id(c, &bnum2);

	    for (;;) {
		switch (bnum1) {
		case -2:
		    break;

		case -1:
		    if (core_used) {
			//printf(" + data series %08x:\n", 1<<i);
			hdr->data_series |= 1<<i;
		    }
		    break;

		default:
		    for (j = 0; j < s->hdr->num_blocks; j++) {
			if (s->block[j]->content_type == EXTERNAL &&
			    s->block[j]->content_id == bnum1) {
			    if (block_used[j]) {
				//printf(" + data series %08x:\n", 1<<i);
				hdr->data_series |= 1<<i;
			    }
			}
		    }
		    break;
		}

		if (bnum2 == -2 || bnum1 == bnum2)
		    break;

		bnum1 = bnum2; // 2nd pass
	    }
	}

	// Tags too
	for (i = 0; i < CRAM_MAP_HASH; i++) {
	    int bnum1, bnum2, j;
	    cram_map *m = hdr->tag_encoding_map[i];

	    while (m) {
		cram_codec *c = m->codec;
		if (!c)
		    continue;

		bnum1 = cram_codec_to_id(c, &bnum2);
		
		for (;;) {
		    switch (bnum1) {
		    case -2:
			break;

		    case -1:
			//printf(" + data series %08x:\n", CRAM_aux);
			hdr->data_series |= CRAM_aux;
			break;

		    default:
			for (j = 0; j < s->hdr->num_blocks; j++) {
			    if (s->block[j]->content_type &&
				s->block[j]->content_id == bnum1) {
				if (block_used[j]) {
				    //printf(" + data series %08x:\n",
				    //       CRAM_aux);
				    hdr->data_series |= CRAM_aux;
				}
			    }
			}
			break;
		    }

		    if (bnum2 == -2 || bnum1 == bnum2)
			break;

		    bnum1 = bnum2; // 2nd pass
		}

		m = m->next;
	    }
	}
    } while (orig_ds != hdr->data_series);

    free(block_used);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x224(%rax)
je 0x268a4
movq -0x10(%rbp), %rax
cmpl $0x7fffffff, 0x224(%rax) # imm = 0x7FFFFFFF
je 0x268a4
movq -0x18(%rbp), %rax
movl $0x0, 0x410(%rax)
movq -0x10(%rbp), %rax
movl 0x224(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x26679
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x8000, %ecx           # imm = 0x8000
movl %ecx, 0x410(%rax)
movq -0x10(%rbp), %rax
movl 0x224(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x2669e
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0x410(%rax)
movq -0x10(%rbp), %rax
movl 0x224(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x266c6
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x200001, %ecx         # imm = 0x200001
movl %ecx, 0x410(%rax)
movq -0x10(%rbp), %rax
movl 0x224(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x266eb
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x3, %ecx
movl %ecx, 0x410(%rax)
movq -0x10(%rbp), %rax
movl 0x224(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x26713
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x2000, %ecx           # imm = 0x2000
movl %ecx, 0x410(%rax)
movq -0x10(%rbp), %rax
movl 0x224(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x2673b
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x3c00b1d, %ecx        # imm = 0x3C00B1D
movl %ecx, 0x410(%rax)
movq -0x10(%rbp), %rax
movl 0x224(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x26763
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x310021, %ecx         # imm = 0x310021
movl %ecx, 0x410(%rax)
movq -0x10(%rbp), %rax
movl 0x224(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x2678d
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x120023, %ecx         # imm = 0x120023
movl %ecx, 0x410(%rax)
movq -0x10(%rbp), %rax
movl 0x224(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x267b7
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x3fc0b3f, %ecx        # imm = 0x3FC0B3F
movl %ecx, 0x410(%rax)
movq -0x10(%rbp), %rax
movl 0x224(%rax), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
je 0x267e1
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x7c00f5f, %ecx        # imm = 0x7C00F5F
movl %ecx, 0x410(%rax)
movq -0x10(%rbp), %rax
movl 0x224(%rax), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
jne 0x26803
movq -0x10(%rbp), %rax
movl $0x0, 0x1f8(%rax)
movq -0x10(%rbp), %rax
movl 0x224(%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x2682d
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x13c00b9f, %ecx       # imm = 0x13C00B9F
movl %ecx, 0x410(%rax)
movq -0x10(%rbp), %rax
movl 0x224(%rax), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x26857
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x40005000, %ecx       # imm = 0x40005000
movl %ecx, 0x410(%rax)
movq -0x10(%rbp), %rax
movl 0x224(%rax), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
je 0x26881
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x1001, %ecx           # imm = 0x1001
movl %ecx, 0x410(%rax)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rdi
callq 0x47100
cmpl $0x0, %eax
je 0x268a2
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x27292
jmp 0x26907
movq -0x18(%rbp), %rax
movl $0x7fffffff, 0x410(%rax) # imm = 0x7FFFFFFF
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
movq -0x20(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x20(%rcx), %eax
jge 0x268fb
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x47100
cmpl $0x0, %eax
je 0x268ee
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x27292
jmp 0x268f0
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x268b9
movl $0x0, -0x4(%rbp)
jmp 0x27292
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl 0x20(%rax), %eax
addl $0x1, %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x4370
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x26938
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x27292
jmp 0x2693a
movq -0x18(%rbp), %rax
movl 0x410(%rax), %eax
andl $0x400000, %eax         # imm = 0x400000
cmpl $0x0, %eax
je 0x26964
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x104, %ecx            # imm = 0x104
movl %ecx, 0x410(%rax)
movq -0x18(%rbp), %rax
movl 0x410(%rax), %eax
andl $0x800000, %eax         # imm = 0x800000
cmpl $0x0, %eax
je 0x2698e
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x104, %ecx            # imm = 0x104
movl %ecx, 0x410(%rax)
movq -0x18(%rbp), %rax
movl 0x410(%rax), %eax
andl $0x1000000, %eax        # imm = 0x1000000
cmpl $0x0, %eax
je 0x269b8
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x104, %ecx            # imm = 0x104
movl %ecx, 0x410(%rax)
movq -0x18(%rbp), %rax
movl 0x410(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x269e2
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x104, %ecx            # imm = 0x104
movl %ecx, 0x410(%rax)
movq -0x18(%rbp), %rax
movl 0x410(%rax), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x26a0c
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x104, %ecx            # imm = 0x104
movl %ecx, 0x410(%rax)
movq -0x18(%rbp), %rax
movl 0x410(%rax), %eax
andl $0x2000000, %eax        # imm = 0x2000000
cmpl $0x0, %eax
je 0x26a36
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x104, %ecx            # imm = 0x104
movl %ecx, 0x410(%rax)
movq -0x18(%rbp), %rax
movl 0x410(%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x26a60
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x104, %ecx            # imm = 0x104
movl %ecx, 0x410(%rax)
movq -0x18(%rbp), %rax
movl 0x410(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x26a88
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x104, %ecx            # imm = 0x104
movl %ecx, 0x410(%rax)
movq -0x18(%rbp), %rax
movl 0x410(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x26ab0
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x104, %ecx            # imm = 0x104
movl %ecx, 0x410(%rax)
movq -0x18(%rbp), %rax
movl 0x410(%rax), %eax
andl $0x4000000, %eax        # imm = 0x4000000
cmpl $0x0, %eax
je 0x26ada
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x104, %ecx            # imm = 0x104
movl %ecx, 0x410(%rax)
movq -0x18(%rbp), %rax
movl 0x410(%rax), %eax
andl $0x10000000, %eax       # imm = 0x10000000
cmpl $0x0, %eax
je 0x26b04
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x104, %ecx            # imm = 0x104
movl %ecx, 0x410(%rax)
movq -0x18(%rbp), %rax
movl 0x410(%rax), %eax
andl $0x7c00f5f, %eax        # imm = 0x7C00F5F
cmpl $0x0, %eax
je 0x26b2b
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x8, %ecx
movl %ecx, 0x410(%rax)
movq -0x18(%rbp), %rax
movl 0x410(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x26b53
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x100, %ecx            # imm = 0x100
movl %ecx, 0x410(%rax)
movq -0x18(%rbp), %rax
movl 0x410(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x26b7d
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x200, %ecx            # imm = 0x200
movl %ecx, 0x410(%rax)
movq -0x18(%rbp), %rax
movl 0x410(%rax), %eax
andl $0x40000000, %eax       # imm = 0x40000000
cmpl $0x0, %eax
je 0x26ba7
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x4000, %ecx           # imm = 0x4000
movl %ecx, 0x410(%rax)
movq -0x18(%rbp), %rax
movl 0x410(%rax), %eax
andl $0x80000, %eax          # imm = 0x80000
cmpl $0x0, %eax
je 0x26bd1
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x100000, %ecx         # imm = 0x100000
movl %ecx, 0x410(%rax)
movq -0x18(%rbp), %rax
movl 0x410(%rax), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x26bf8
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0x410(%rax)
movq -0x18(%rbp), %rax
movl 0x410(%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x26c22
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x200000, %ecx         # imm = 0x200000
movl %ecx, 0x410(%rax)
movq -0x18(%rbp), %rax
movl 0x410(%rax), %eax
andl $0xf0020, %eax          # imm = 0xF0020
cmpl $0x0, %eax
je 0x26c4c
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x100000, %ecx         # imm = 0x100000
movl %ecx, 0x410(%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x26c80
movq -0x18(%rbp), %rax
movl 0x410(%rax), %eax
andl $0x8000, %eax           # imm = 0x8000
cmpl $0x0, %eax
je 0x26c80
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x100020, %ecx         # imm = 0x100020
movl %ecx, 0x410(%rax)
movq -0x18(%rbp), %rax
movl 0x410(%rax), %eax
andl $0x140000c0, %eax       # imm = 0x140000C0
cmpl $0x0, %eax
je 0x26caa
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x100009, %ecx         # imm = 0x100009
movl %ecx, 0x410(%rax)
movq -0x18(%rbp), %rax
movl 0x410(%rax), %eax
movl %eax, -0x34(%rbp)
movl $0x0, -0x30(%rbp)
movslq -0x30(%rbp), %rax
cmpq $0x1c, %rax
jae 0x26e18
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rdx
leaq 0x63925(%rip), %rcx     # 0x8a600
movslq (%rcx,%rdx,4), %rcx
movq 0x280(%rax,%rcx,8), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movl 0x410(%rax), %eax
movl -0x30(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
jne 0x26d0d
jmp 0x26e0a
cmpq $0x0, -0x48(%rbp)
jne 0x26d19
jmp 0x26e0a
movq -0x48(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
callq 0x758a0
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0xa4(%rbp)
subl $-0x2, %eax
je 0x26d46
jmp 0x26d39
movl -0xa4(%rbp), %eax
subl $-0x1, %eax
je 0x26d4b
jmp 0x26d57
jmp 0x26ded
movl $0x1, -0x2c(%rbp)
jmp 0x26ded
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
movq -0x20(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x20(%rcx), %eax
jge 0x26deb
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x4, 0x8(%rax)
jne 0x26ddb
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0xc(%rax), %eax
cmpl -0x38(%rbp), %eax
jne 0x26ddb
movq -0x28(%rbp), %rax
movslq -0x40(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x47100
cmpl $0x0, %eax
je 0x26dd9
movq -0x28(%rbp), %rdi
callq 0x46a0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x27292
jmp 0x26ddb
jmp 0x26ddd
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x26d5e
jmp 0x26ded
cmpl $-0x2, -0x3c(%rbp)
je 0x26dfb
movl -0x38(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jne 0x26dfd
jmp 0x26e08
movl -0x3c(%rbp), %eax
movl %eax, -0x38(%rbp)
jmp 0x26d29
jmp 0x26e0a
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x26cbe
movq -0x10(%rbp), %rax
movl 0x224(%rax), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
jne 0x26e44
movq -0x18(%rbp), %rax
movl 0x410(%rax), %eax
andl $0x40000000, %eax       # imm = 0x40000000
cmpl $0x0, %eax
je 0x26f9b
movl $0x0, -0x30(%rbp)
cmpl $0x20, -0x30(%rbp)
jge 0x26f99
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq 0x180(%rax,%rcx,8), %rax
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
je 0x26f89
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x68(%rbp)
jne 0x26e89
jmp 0x26e69
movq -0x68(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x758a0
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movl %eax, -0xa8(%rbp)
subl $-0x2, %eax
je 0x26eb6
jmp 0x26ea9
movl -0xa8(%rbp), %eax
subl $-0x1, %eax
je 0x26ebb
jmp 0x26ec7
jmp 0x26f5d
movl $0x1, -0x2c(%rbp)
jmp 0x26f5d
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
movq -0x20(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x20(%rcx), %eax
jge 0x26f5b
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x54(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x4, 0x8(%rax)
jne 0x26f4b
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x54(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0xc(%rax), %eax
cmpl -0x4c(%rbp), %eax
jne 0x26f4b
movq -0x28(%rbp), %rax
movslq -0x54(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x54(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x47100
cmpl $0x0, %eax
je 0x26f49
movq -0x28(%rbp), %rdi
callq 0x46a0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x27292
jmp 0x26f4b
jmp 0x26f4d
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x26ece
jmp 0x26f5d
cmpl $-0x2, -0x50(%rbp)
je 0x26f6b
movl -0x4c(%rbp), %eax
cmpl -0x50(%rbp), %eax
jne 0x26f6d
jmp 0x26f78
movl -0x50(%rbp), %eax
movl %eax, -0x4c(%rbp)
jmp 0x26e99
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0x26e69
jmp 0x26f8b
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x26e4b
jmp 0x26f9b
movl $0x0, -0x30(%rbp)
movslq -0x30(%rbp), %rax
cmpq $0x1c, %rax
jae 0x270db
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rdx
leaq 0x63641(%rip), %rcx     # 0x8a600
movslq (%rcx,%rdx,4), %rcx
movq 0x280(%rax,%rcx,8), %rax
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x80(%rbp)
jne 0x26fdb
jmp 0x270cd
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x758a0
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
movl %eax, -0xac(%rbp)
subl $-0x2, %eax
je 0x27008
jmp 0x26ffb
movl -0xac(%rbp), %eax
subl $-0x1, %eax
je 0x2700d
jmp 0x27031
jmp 0x270b0
cmpl $0x0, -0x2c(%rbp)
je 0x2702f
movl -0x30(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, %ecx
movq -0x18(%rbp), %rax
orl 0x410(%rax), %ecx
movl %ecx, 0x410(%rax)
jmp 0x270b0
movl $0x0, -0x74(%rbp)
movl -0x74(%rbp), %eax
movq -0x20(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x20(%rcx), %eax
jge 0x270ae
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x74(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x4, 0x8(%rax)
jne 0x270a1
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x74(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0xc(%rax), %eax
cmpl -0x6c(%rbp), %eax
jne 0x270a1
movq -0x28(%rbp), %rax
movslq -0x74(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x2709f
movl -0x30(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, %ecx
movq -0x18(%rbp), %rax
orl 0x410(%rax), %ecx
movl %ecx, 0x410(%rax)
jmp 0x270a1
jmp 0x270a3
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x27038
jmp 0x270b0
cmpl $-0x2, -0x70(%rbp)
je 0x270be
movl -0x6c(%rbp), %eax
cmpl -0x70(%rbp), %eax
jne 0x270c0
jmp 0x270cb
movl -0x70(%rbp), %eax
movl %eax, -0x6c(%rbp)
jmp 0x26feb
jmp 0x270cd
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x26fa2
movl $0x0, -0x30(%rbp)
cmpl $0x20, -0x30(%rbp)
jge 0x2726d
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq 0x180(%rax,%rcx,8), %rax
movq %rax, -0x98(%rbp)
cmpq $0x0, -0x98(%rbp)
je 0x2725d
movq -0x98(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xa0(%rbp)
cmpq $0x0, -0xa0(%rbp)
jne 0x2712f
jmp 0x27103
movq -0xa0(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x758a0
movl %eax, -0x84(%rbp)
movl -0x84(%rbp), %eax
movl %eax, -0xb0(%rbp)
subl $-0x2, %eax
je 0x27168
jmp 0x2715b
movl -0xb0(%rbp), %eax
subl $-0x1, %eax
je 0x2716d
jmp 0x27188
jmp 0x2721c
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x40000000, %ecx       # imm = 0x40000000
movl %ecx, 0x410(%rax)
jmp 0x2721c
movl $0x0, -0x8c(%rbp)
movl -0x8c(%rbp), %eax
movq -0x20(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x20(%rcx), %eax
jge 0x2721a
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x8c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x0, 0x8(%rax)
je 0x27204
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x8c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0xc(%rax), %eax
cmpl -0x84(%rbp), %eax
jne 0x27204
movq -0x28(%rbp), %rax
movslq -0x8c(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x27202
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x40000000, %ecx       # imm = 0x40000000
movl %ecx, 0x410(%rax)
jmp 0x27204
jmp 0x27206
movl -0x8c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8c(%rbp)
jmp 0x27192
jmp 0x2721c
cmpl $-0x2, -0x88(%rbp)
je 0x27233
movl -0x84(%rbp), %eax
cmpl -0x88(%rbp), %eax
jne 0x27235
jmp 0x27246
movl -0x88(%rbp), %eax
movl %eax, -0x84(%rbp)
jmp 0x27148
movq -0x98(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x98(%rbp)
jmp 0x27103
jmp 0x2725f
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x270e2
jmp 0x2726f
movl -0x34(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x410(%rcx), %eax
jne 0x2693a
movq -0x28(%rbp), %rdi
callq 0x46a0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
nop