// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/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 0xb1354
movq -0x10(%rbp), %rax
cmpl $0x7fffffff, 0x224(%rax) # imm = 0x7FFFFFFF
je 0xb1354
movq -0x18(%rbp), %rax
movl $0x0, 0x410(%rax)
movq -0x10(%rbp), %rax
movl 0x224(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xb1129
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 0xb114e
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 0xb1176
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 0xb119b
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 0xb11c3
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 0xb11eb
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 0xb1213
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 0xb123d
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 0xb1267
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 0xb1291
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 0xb12b3
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 0xb12dd
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 0xb1307
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 0xb1331
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 0x7f790
cmpl $0x0, %eax
je 0xb1352
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xb1d42
jmp 0xb13b7
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 0xb13ab
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x7f790
cmpl $0x0, %eax
je 0xb139e
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xb1d42
jmp 0xb13a0
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0xb1369
movl $0x0, -0x4(%rbp)
jmp 0xb1d42
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl 0x20(%rax), %eax
addl $0x1, %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x6460
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0xb13e8
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xb1d42
jmp 0xb13ea
movq -0x18(%rbp), %rax
movl 0x410(%rax), %eax
andl $0x400000, %eax         # imm = 0x400000
cmpl $0x0, %eax
je 0xb1414
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 0xb143e
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 0xb1468
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 0xb1492
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 0xb14bc
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 0xb14e6
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 0xb1510
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 0xb1538
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 0xb1560
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 0xb158a
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 0xb15b4
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 0xb15db
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 0xb1603
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 0xb162d
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 0xb1657
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 0xb1681
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 0xb16a8
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 0xb16d2
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 0xb16fc
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 0xb1730
movq -0x18(%rbp), %rax
movl 0x410(%rax), %eax
andl $0x8000, %eax           # imm = 0x8000
cmpl $0x0, %eax
je 0xb1730
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 0xb175a
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 0xb18c8
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rdx
leaq 0x559f5(%rip), %rcx     # 0x107180
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 0xb17bd
jmp 0xb18ba
cmpq $0x0, -0x48(%rbp)
jne 0xb17c9
jmp 0xb18ba
movq -0x48(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
callq 0xd4c60
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0xa4(%rbp)
subl $-0x2, %eax
je 0xb17f6
jmp 0xb17e9
movl -0xa4(%rbp), %eax
subl $-0x1, %eax
je 0xb17fb
jmp 0xb1807
jmp 0xb189d
movl $0x1, -0x2c(%rbp)
jmp 0xb189d
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
movq -0x20(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x20(%rcx), %eax
jge 0xb189b
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x4, 0x8(%rax)
jne 0xb188b
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 0xb188b
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 0x7f790
cmpl $0x0, %eax
je 0xb1889
movq -0x28(%rbp), %rdi
callq 0x6880
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xb1d42
jmp 0xb188b
jmp 0xb188d
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0xb180e
jmp 0xb189d
cmpl $-0x2, -0x3c(%rbp)
je 0xb18ab
movl -0x38(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jne 0xb18ad
jmp 0xb18b8
movl -0x3c(%rbp), %eax
movl %eax, -0x38(%rbp)
jmp 0xb17d9
jmp 0xb18ba
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0xb176e
movq -0x10(%rbp), %rax
movl 0x224(%rax), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
jne 0xb18f4
movq -0x18(%rbp), %rax
movl 0x410(%rax), %eax
andl $0x40000000, %eax       # imm = 0x40000000
cmpl $0x0, %eax
je 0xb1a4b
movl $0x0, -0x30(%rbp)
cmpl $0x20, -0x30(%rbp)
jge 0xb1a49
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq 0x180(%rax,%rcx,8), %rax
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
je 0xb1a39
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x68(%rbp)
jne 0xb1939
jmp 0xb1919
movq -0x68(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0xd4c60
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movl %eax, -0xa8(%rbp)
subl $-0x2, %eax
je 0xb1966
jmp 0xb1959
movl -0xa8(%rbp), %eax
subl $-0x1, %eax
je 0xb196b
jmp 0xb1977
jmp 0xb1a0d
movl $0x1, -0x2c(%rbp)
jmp 0xb1a0d
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
movq -0x20(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x20(%rcx), %eax
jge 0xb1a0b
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x54(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x4, 0x8(%rax)
jne 0xb19fb
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 0xb19fb
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 0x7f790
cmpl $0x0, %eax
je 0xb19f9
movq -0x28(%rbp), %rdi
callq 0x6880
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xb1d42
jmp 0xb19fb
jmp 0xb19fd
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0xb197e
jmp 0xb1a0d
cmpl $-0x2, -0x50(%rbp)
je 0xb1a1b
movl -0x4c(%rbp), %eax
cmpl -0x50(%rbp), %eax
jne 0xb1a1d
jmp 0xb1a28
movl -0x50(%rbp), %eax
movl %eax, -0x4c(%rbp)
jmp 0xb1949
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0xb1919
jmp 0xb1a3b
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0xb18fb
jmp 0xb1a4b
movl $0x0, -0x30(%rbp)
movslq -0x30(%rbp), %rax
cmpq $0x1c, %rax
jae 0xb1b8b
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rdx
leaq 0x55711(%rip), %rcx     # 0x107180
movslq (%rcx,%rdx,4), %rcx
movq 0x280(%rax,%rcx,8), %rax
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x80(%rbp)
jne 0xb1a8b
jmp 0xb1b7d
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xd4c60
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
movl %eax, -0xac(%rbp)
subl $-0x2, %eax
je 0xb1ab8
jmp 0xb1aab
movl -0xac(%rbp), %eax
subl $-0x1, %eax
je 0xb1abd
jmp 0xb1ae1
jmp 0xb1b60
cmpl $0x0, -0x2c(%rbp)
je 0xb1adf
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 0xb1b60
movl $0x0, -0x74(%rbp)
movl -0x74(%rbp), %eax
movq -0x20(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x20(%rcx), %eax
jge 0xb1b5e
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x74(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x4, 0x8(%rax)
jne 0xb1b51
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 0xb1b51
movq -0x28(%rbp), %rax
movslq -0x74(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0xb1b4f
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 0xb1b51
jmp 0xb1b53
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0xb1ae8
jmp 0xb1b60
cmpl $-0x2, -0x70(%rbp)
je 0xb1b6e
movl -0x6c(%rbp), %eax
cmpl -0x70(%rbp), %eax
jne 0xb1b70
jmp 0xb1b7b
movl -0x70(%rbp), %eax
movl %eax, -0x6c(%rbp)
jmp 0xb1a9b
jmp 0xb1b7d
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0xb1a52
movl $0x0, -0x30(%rbp)
cmpl $0x20, -0x30(%rbp)
jge 0xb1d1d
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq 0x180(%rax,%rcx,8), %rax
movq %rax, -0x98(%rbp)
cmpq $0x0, -0x98(%rbp)
je 0xb1d0d
movq -0x98(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xa0(%rbp)
cmpq $0x0, -0xa0(%rbp)
jne 0xb1bdf
jmp 0xb1bb3
movq -0xa0(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0xd4c60
movl %eax, -0x84(%rbp)
movl -0x84(%rbp), %eax
movl %eax, -0xb0(%rbp)
subl $-0x2, %eax
je 0xb1c18
jmp 0xb1c0b
movl -0xb0(%rbp), %eax
subl $-0x1, %eax
je 0xb1c1d
jmp 0xb1c38
jmp 0xb1ccc
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x40000000, %ecx       # imm = 0x40000000
movl %ecx, 0x410(%rax)
jmp 0xb1ccc
movl $0x0, -0x8c(%rbp)
movl -0x8c(%rbp), %eax
movq -0x20(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x20(%rcx), %eax
jge 0xb1cca
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x8c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x0, 0x8(%rax)
je 0xb1cb4
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 0xb1cb4
movq -0x28(%rbp), %rax
movslq -0x8c(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0xb1cb2
movq -0x18(%rbp), %rax
movl 0x410(%rax), %ecx
orl $0x40000000, %ecx       # imm = 0x40000000
movl %ecx, 0x410(%rax)
jmp 0xb1cb4
jmp 0xb1cb6
movl -0x8c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8c(%rbp)
jmp 0xb1c42
jmp 0xb1ccc
cmpl $-0x2, -0x88(%rbp)
je 0xb1ce3
movl -0x84(%rbp), %eax
cmpl -0x88(%rbp), %eax
jne 0xb1ce5
jmp 0xb1cf6
movl -0x88(%rbp), %eax
movl %eax, -0x84(%rbp)
jmp 0xb1bf8
movq -0x98(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x98(%rbp)
jmp 0xb1bb3
jmp 0xb1d0f
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0xb1b92
jmp 0xb1d1f
movl -0x34(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x410(%rcx), %eax
jne 0xb13ea
movq -0x28(%rbp), %rdi
callq 0x6880
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
nop