// File: karel-brinda[P]ococo/ext/htslib/cram/sam_header.c
// Function: sam_hdr_update_hashes
static int sam_hdr_update_hashes(SAM_hdr *sh,
				 int type,
				 SAM_hdr_type *h_type) {
    /* Add to reference hash? */
    if ((type>>8) == 'S' && (type&0xff) == 'Q') {
	SAM_hdr_tag *tag;
	SAM_SQ *new_ref;
	int nref = sh->nref;

	new_ref = realloc(sh->ref, (sh->nref+1)*sizeof(*sh->ref));
	if (!new_ref)
	    return -1;
	sh->ref = new_ref;

	tag = h_type->tag;
	sh->ref[nref].name = NULL;
	sh->ref[nref].len  = 0;
	sh->ref[nref].ty = h_type;
	sh->ref[nref].tag  = tag;

	while (tag) {
	    if (tag->str[0] == 'S' && tag->str[1] == 'N') {
		if (!(sh->ref[nref].name = malloc(tag->len)))
		    return -1;
		strncpy(sh->ref[nref].name, tag->str+3, tag->len-3);
		sh->ref[nref].name[tag->len-3] = 0;
	    } else if (tag->str[0] == 'L' && tag->str[1] == 'N') {
		sh->ref[nref].len = atoi(tag->str+3);
	    }
	    tag = tag->next;
	}

	if (sh->ref[nref].name) {
	    khint_t k;
	    int r;
	    k = kh_put(m_s2i, sh->ref_hash, sh->ref[nref].name, &r);
	    if (-1 == r) return -1;
	    kh_val(sh->ref_hash, k) = nref;
	} else {
	    return -1; // SN should be present, according to spec.
	}

	sh->nref++;
    }

    /* Add to read-group hash? */
    if ((type>>8) == 'R' && (type&0xff) == 'G') {
	SAM_hdr_tag *tag;
	SAM_RG *new_rg;
	int nrg = sh->nrg;

	new_rg = realloc(sh->rg, (sh->nrg+1)*sizeof(*sh->rg));
	if (!new_rg)
	    return -1;
	sh->rg = new_rg;

	tag = h_type->tag;
	sh->rg[nrg].name = NULL;
	sh->rg[nrg].name_len = 0;
	sh->rg[nrg].ty   = h_type;
	sh->rg[nrg].tag  = tag;
	sh->rg[nrg].id   = nrg;

	while (tag) {
	    if (tag->str[0] == 'I' && tag->str[1] == 'D') {
		if (!(sh->rg[nrg].name = malloc(tag->len)))
		    return -1;
		strncpy(sh->rg[nrg].name, tag->str+3, tag->len-3);
		sh->rg[nrg].name[tag->len-3] = 0;
		sh->rg[nrg].name_len = strlen(sh->rg[nrg].name);
	    }
	    tag = tag->next;
	}

	if (sh->rg[nrg].name) {
	    khint_t k;
	    int r;
	    k = kh_put(m_s2i, sh->rg_hash, sh->rg[nrg].name, &r);
	    if (-1 == r) return -1;
	    kh_val(sh->rg_hash, k) = nrg;
	} else {
	    return -1; // ID should be present, according to spec.
	}

	sh->nrg++;
    }

    /* Add to program hash? */
    if ((type>>8) == 'P' && (type&0xff) == 'G') {
	SAM_hdr_tag *tag;
	SAM_PG *new_pg;
	int npg = sh->npg;

	new_pg = realloc(sh->pg, (sh->npg+1)*sizeof(*sh->pg));
	if (!new_pg)
	    return -1;
	sh->pg = new_pg;

	tag = h_type->tag;
	sh->pg[npg].name = NULL;
	sh->pg[npg].name_len = 0;
	sh->pg[npg].ty  = h_type;
	sh->pg[npg].tag  = tag;
	sh->pg[npg].id   = npg;
	sh->pg[npg].prev_id = -1;

	while (tag) {
	    if (tag->str[0] == 'I' && tag->str[1] == 'D') {
		if (!(sh->pg[npg].name = malloc(tag->len)))
		    return -1;
		strncpy(sh->pg[npg].name, tag->str+3, tag->len-3);
		sh->pg[npg].name[tag->len-3] = 0;
		sh->pg[npg].name_len = strlen(sh->pg[npg].name);
	    } else if (tag->str[0] == 'P' && tag->str[1] == 'P') {
		// Resolve later if needed
		khint_t k;
		char tmp = tag->str[tag->len]; tag->str[tag->len] = 0;
		k = kh_get(m_s2i, sh->pg_hash, tag->str+3);
		tag->str[tag->len] = tmp;

		if (k != kh_end(sh->pg_hash)) {
		    int p_id = kh_val(sh->pg_hash, k);
		    sh->pg[npg].prev_id = sh->pg[p_id].id;

		    /* Unmark previous entry as a PG termination */
		    if (sh->npg_end > 0 &&
			sh->pg_end[sh->npg_end-1] == p_id) {
			sh->npg_end--;
		    } else {
			int i;
			for (i = 0; i < sh->npg_end; i++) {
			    if (sh->pg_end[i] == p_id) {
				memmove(&sh->pg_end[i], &sh->pg_end[i+1],
					(sh->npg_end-i-1)*sizeof(*sh->pg_end));
				sh->npg_end--;
			    }
			}
		    }
		} else {
		    sh->pg[npg].prev_id = -1;
		}
	    }
	    tag = tag->next;
	}

	if (sh->pg[npg].name) {
	    khint_t k;
	    int r;
	    k = kh_put(m_s2i, sh->pg_hash, sh->pg[npg].name, &r);
	    if (-1 == r) return -1;
	    kh_val(sh->pg_hash, k) = npg;
	} else {
	    return -1; // ID should be present, according to spec.
	}

	/* Add to npg_end[] array. Remove later if we find a PP line */
	if (sh->npg_end >= sh->npg_end_alloc) {
	    int *new_pg_end;
	    int  new_alloc = sh->npg_end_alloc ? sh->npg_end_alloc*2 : 4;

	    new_pg_end = realloc(sh->pg_end, new_alloc * sizeof(int));
	    if (!new_pg_end)
		return -1;
	    sh->npg_end_alloc = new_alloc;
	    sh->pg_end = new_pg_end;
	}
	sh->pg_end[sh->npg_end++] = npg;

	sh->npg++;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl -0x14(%rbp), %eax
sarl $0x8, %eax
cmpl $0x53, %eax
jne 0x5c082
movl -0x14(%rbp), %eax
andl $0xff, %eax
cmpl $0x51, %eax
jne 0x5c082
movq -0x10(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x38(%rax), %eax
addl $0x1, %eax
movslq %eax, %rsi
shlq $0x5, %rsi
callq 0x4990
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x5be55
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5c878
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x34(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x34(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl $0x0, 0x8(%rax)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x34(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x34(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, 0x18(%rax)
cmpq $0x0, -0x28(%rbp)
je 0x5bff9
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x53, %eax
jne 0x5bf9d
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movsbl 0x1(%rax), %eax
cmpl $0x4e, %eax
jne 0x5bf9d
movq -0x28(%rbp), %rax
movslq 0x10(%rax), %rdi
callq 0x47a0
movq -0x10(%rbp), %rcx
movq 0x40(%rcx), %rcx
movslq -0x34(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0x5bf40
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5c878
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x34(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rsi
addq $0x3, %rsi
movq -0x28(%rbp), %rax
movl 0x10(%rax), %eax
subl $0x3, %eax
movslq %eax, %rdx
callq 0x42c0
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x34(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x3, %ecx
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
jmp 0x5bfe9
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x4c, %eax
jne 0x5bfe7
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movsbl 0x1(%rax), %eax
cmpl $0x4e, %eax
jne 0x5bfe7
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
addq $0x3, %rdi
callq 0x4910
movl %eax, %ecx
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x34(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
jmp 0x5bfe9
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x5bed7
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x34(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
je 0x5c069
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x34(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rsi
leaq -0x3c(%rbp), %rdx
callq 0x5f660
movl %eax, -0x38(%rbp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl -0x3c(%rbp), %eax
jne 0x5c052
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5c878
movl -0x34(%rbp), %edx
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x20(%rax), %rax
movl -0x38(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
jmp 0x5c075
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5c878
movq -0x10(%rbp), %rax
movl 0x38(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x38(%rax)
movl -0x14(%rbp), %eax
sarl $0x8, %eax
cmpl $0x52, %eax
jne 0x5c30c
movl -0x14(%rbp), %eax
andl $0xff, %eax
cmpl $0x47, %eax
jne 0x5c30c
movq -0x10(%rbp), %rax
movl 0x50(%rax), %eax
movl %eax, -0x54(%rbp)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x50(%rax), %eax
addl $0x1, %eax
movslq %eax, %rsi
shlq $0x5, %rsi
callq 0x4990
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x5c0e1
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5c878
movq -0x50(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x54(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x54(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl $0x0, 0x18(%rax)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x54(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq -0x48(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x54(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movl -0x54(%rbp), %ecx
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x54(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movl %ecx, 0x1c(%rax)
cmpq $0x0, -0x48(%rbp)
je 0x5c283
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x49, %eax
jne 0x5c273
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movsbl 0x1(%rax), %eax
cmpl $0x44, %eax
jne 0x5c273
movq -0x48(%rbp), %rax
movslq 0x10(%rax), %rdi
callq 0x47a0
movq -0x10(%rbp), %rcx
movq 0x58(%rcx), %rcx
movslq -0x54(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0x5c1e5
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5c878
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x54(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rsi
addq $0x3, %rsi
movq -0x48(%rbp), %rax
movl 0x10(%rax), %eax
subl $0x3, %eax
movslq %eax, %rdx
callq 0x42c0
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x54(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x48(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x3, %ecx
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x54(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x4230
movl %eax, %ecx
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x54(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movl %ecx, 0x18(%rax)
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x5c17c
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x54(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
je 0x5c2f3
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x54(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rsi
leaq -0x5c(%rbp), %rdx
callq 0x5f660
movl %eax, -0x58(%rbp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl -0x5c(%rbp), %eax
jne 0x5c2dc
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5c878
movl -0x54(%rbp), %edx
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movq 0x20(%rax), %rax
movl -0x58(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
jmp 0x5c2ff
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5c878
movq -0x10(%rbp), %rax
movl 0x50(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x50(%rax)
movl -0x14(%rbp), %eax
sarl $0x8, %eax
cmpl $0x50, %eax
jne 0x5c871
movl -0x14(%rbp), %eax
andl $0xff, %eax
cmpl $0x47, %eax
jne 0x5c871
movq -0x10(%rbp), %rax
movl 0x68(%rax), %eax
movl %eax, -0x74(%rbp)
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x68(%rax), %eax
addl $0x1, %eax
cltq
imulq $0x28, %rax, %rsi
callq 0x4990
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x70(%rbp)
jne 0x5c36a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5c878
movq -0x70(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x78(%rax)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x74(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x74(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x18(%rax)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x74(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq -0x68(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x74(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movl -0x74(%rbp), %ecx
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x74(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x1c(%rax)
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x74(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, 0x20(%rax) # imm = 0xFFFFFFFF
cmpq $0x0, -0x68(%rbp)
je 0x5c717
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x49, %eax
jne 0x5c51b
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rax
movsbl 0x1(%rax), %eax
cmpl $0x44, %eax
jne 0x5c51b
movq -0x68(%rbp), %rax
movslq 0x10(%rax), %rdi
callq 0x47a0
movq -0x10(%rbp), %rcx
movq 0x78(%rcx), %rcx
movslq -0x74(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rcx
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0x5c488
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5c878
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x74(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rsi
addq $0x3, %rsi
movq -0x68(%rbp), %rax
movl 0x10(%rax), %eax
subl $0x3, %eax
movslq %eax, %rdx
callq 0x42c0
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x74(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x68(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x3, %ecx
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x74(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x4230
movl %eax, %ecx
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x74(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x18(%rax)
jmp 0x5c707
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x50, %eax
jne 0x5c705
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rax
movsbl 0x1(%rax), %eax
cmpl $0x50, %eax
jne 0x5c705
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x68(%rbp), %rcx
movslq 0x10(%rcx), %rcx
movb (%rax,%rcx), %al
movb %al, -0x79(%rbp)
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x68(%rbp), %rcx
movslq 0x10(%rcx), %rcx
movb $0x0, (%rax,%rcx)
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rdi
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rsi
addq $0x3, %rsi
callq 0x5d540
movl %eax, -0x78(%rbp)
movb -0x79(%rbp), %dl
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x68(%rbp), %rcx
movslq 0x10(%rcx), %rcx
movb %dl, (%rax,%rcx)
movl -0x78(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x80(%rcx), %rcx
cmpl (%rcx), %eax
je 0x5c6e9
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rax
movq 0x20(%rax), %rax
movl -0x78(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x80(%rbp)
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x80(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %ecx
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x74(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x20(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x6c(%rax)
jle 0x5c639
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x6c(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x80(%rbp), %eax
jne 0x5c639
movq -0x10(%rbp), %rax
movl 0x6c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x6c(%rax)
jmp 0x5c6e7
movl $0x0, -0x84(%rbp)
movl -0x84(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x6c(%rcx), %eax
jge 0x5c6e5
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0x84(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x80(%rbp), %eax
jne 0x5c6cf
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rdi
movslq -0x84(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rsi
movl -0x84(%rbp), %eax
addl $0x1, %eax
cltq
shlq $0x2, %rax
addq %rax, %rsi
movq -0x10(%rbp), %rax
movl 0x6c(%rax), %eax
subl -0x84(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rdx
shlq $0x2, %rdx
callq 0x4970
movq -0x10(%rbp), %rax
movl 0x6c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x6c(%rax)
jmp 0x5c6d1
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x5c643
jmp 0x5c6e7
jmp 0x5c703
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x74(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, 0x20(%rax) # imm = 0xFFFFFFFF
jmp 0x5c705
jmp 0x5c707
movq -0x68(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x68(%rbp)
jmp 0x5c41f
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x74(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
je 0x5c799
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x74(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rsi
leaq -0x8c(%rbp), %rdx
callq 0x5f660
movl %eax, -0x88(%rbp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl -0x8c(%rbp), %eax
jne 0x5c77c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5c878
movl -0x74(%rbp), %edx
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rax
movq 0x20(%rax), %rax
movl -0x88(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
jmp 0x5c7a5
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5c878
movq -0x10(%rbp), %rax
movl 0x6c(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x70(%rcx), %eax
jl 0x5c841
movq -0x10(%rbp), %rax
cmpl $0x0, 0x70(%rax)
je 0x5c7d4
movq -0x10(%rbp), %rax
movl 0x70(%rax), %eax
shll %eax
movl %eax, -0xa0(%rbp)
jmp 0x5c7e1
movl $0x4, %eax
movl %eax, -0xa0(%rbp)
jmp 0x5c7e1
movl -0xa0(%rbp), %eax
movl %eax, -0x9c(%rbp)
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rdi
movslq -0x9c(%rbp), %rsi
shlq $0x2, %rsi
callq 0x4990
movq %rax, -0x98(%rbp)
cmpq $0x0, -0x98(%rbp)
jne 0x5c822
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5c878
movl -0x9c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x70(%rax)
movq -0x98(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x88(%rax)
movl -0x74(%rbp), %edx
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rax
movq -0x10(%rbp), %rsi
movl 0x6c(%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, 0x6c(%rsi)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movq -0x10(%rbp), %rax
movl 0x68(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x68(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)