// File: karel-brinda[P]ococo/ext/htslib/cram/cram_io.c
// Function: cram_free_compression_header
void cram_free_compression_header(cram_block_compression_hdr *hdr) {
    int i;

    if (hdr->landmark)
	free(hdr->landmark);

    if (hdr->preservation_map)
	kh_destroy(map, hdr->preservation_map);

    for (i = 0; i < CRAM_MAP_HASH; i++) {
	cram_map *m, *m2;
	for (m = hdr->rec_encoding_map[i]; m; m = m2) {
	    m2 = m->next;
	    if (m->codec)
		m->codec->free(m->codec);
	    free(m);
	}
    }

    for (i = 0; i < CRAM_MAP_HASH; i++) {
	cram_map *m, *m2;
	for (m = hdr->tag_encoding_map[i]; m; m = m2) {
	    m2 = m->next;
	    if (m->codec)
		m->codec->free(m->codec);
	    free(m);
	}
    }

    for (i = 0; i < DS_END; i++) {
	if (hdr->codecs[i])
	    hdr->codecs[i]->free(hdr->codecs[i]);
    }

    if (hdr->TL)
	free(hdr->TL);
    if (hdr->TD_blk)
	cram_free_block(hdr->TD_blk);
    if (hdr->TD_hash)
	kh_destroy(m_s2i, hdr->TD_hash);
    if (hdr->TD_keys)
	string_pool_destroy(hdr->TD_keys);

    free(hdr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x4b754
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x46a0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x78(%rax)
je 0x4b76c
movq -0x8(%rbp), %rax
movq 0x78(%rax), %rdi
callq 0x4f630
movl $0x0, -0xc(%rbp)
cmpl $0x20, -0xc(%rbp)
jge 0x4b7e1
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movq 0x80(%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x4b7d4
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x4b7c1
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x10(%rcx), %rdi
callq *%rax
movq -0x18(%rbp), %rdi
callq 0x46a0
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x4b78d
jmp 0x4b7d6
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x4b773
movl $0x0, -0xc(%rbp)
cmpl $0x20, -0xc(%rbp)
jge 0x4b856
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movq 0x180(%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x4b849
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x4b836
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq -0x28(%rbp), %rcx
movq 0x10(%rcx), %rdi
callq *%rax
movq -0x28(%rbp), %rdi
callq 0x46a0
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x4b802
jmp 0x4b84b
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x4b7e8
movl $0x0, -0xc(%rbp)
cmpl $0x2f, -0xc(%rbp)
jge 0x4b8a9
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
cmpq $0x0, 0x280(%rax,%rcx,8)
je 0x4b89c
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movq 0x280(%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rcx
movslq -0xc(%rbp), %rdx
movq 0x280(%rcx,%rdx,8), %rdi
callq *%rax
jmp 0x4b89e
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x4b85d
movq -0x8(%rbp), %rax
cmpq $0x0, 0x60(%rax)
je 0x4b8c1
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rdi
callq 0x46a0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0x4b8d9
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0x470c0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x68(%rax)
je 0x4b8f1
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rdi
callq 0x4f5e0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x70(%rax)
je 0x4b909
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rdi
callq 0x5ff50
movq -0x8(%rbp), %rdi
callq 0x46a0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)