// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/cram/cram_io.c
// Function: sanitise_SQ_lines
static void sanitise_SQ_lines(cram_fd *fd) {
    int i;

    if (!fd->header)
	return;

    if (!fd->refs || !fd->refs->h_meta)
	return;

    for (i = 0; i < fd->header->nref; i++) {
	char *name = fd->header->ref[i].name;
	khint_t k = kh_get(refs, fd->refs->h_meta, name);
	ref_entry *r;

	// We may have @SQ lines which have no known .fai, but do not
	// in themselves pose a problem because they are unused in the file.
	if (k == kh_end(fd->refs->h_meta))
	    continue;

	if (!(r = (ref_entry *)kh_val(fd->refs->h_meta, k)))
	    continue;

	if (r->length && r->length != fd->header->ref[i].len) {
	    assert(strcmp(r->name, fd->header->ref[i].name) == 0);

	    // Should we also check MD5sums here to ensure the correct
	    // reference was given?
	    fprintf(stderr, "WARNING: Header @SQ length mismatch for "
		    "ref %s, %d vs %d\n",
		    r->name, fd->header->ref[i].len, (int)r->length);

	    // Fixing the parsed @SQ header will make MD:Z: strings work
	    // and also stop it producing N for the sequence.
	    fd->header->ref[i].len = r->length;
	}
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x8361c
jmp 0x837c8
movq -0x8(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x83636
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x8(%rax)
jne 0x8363b
jmp 0x837c8
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpl 0x38(%rcx), %eax
jge 0x837c8
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x40(%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x80f70
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x48(%rcx), %rcx
movq 0x8(%rcx), %rcx
cmpl (%rcx), %eax
jne 0x836a4
jmp 0x837ba
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq 0x20(%rax), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x836ca
jmp 0x837ba
movq -0x28(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x837b8
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq 0x40(%rcx), %rcx
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
cmpq %rcx, %rax
je 0x837b8
movq -0x28(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x40(%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rsi
callq 0x6a40
cmpl $0x0, %eax
jne 0x83731
jmp 0x83750
leaq 0x5fb19(%rip), %rdi     # 0xe3251
leaq 0x5f547(%rip), %rsi     # 0xe2c86
movl $0x7a6, %edx            # imm = 0x7A6
leaq 0x5fb34(%rip), %rcx     # 0xe327f
callq 0x6450
movq 0x81879(%rip), %rax     # 0x104fd0
movq (%rax), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x40(%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl %eax, %r8d
leaq 0x5fb14(%rip), %rsi     # 0xe32a1
movb $0x0, %al
callq 0x6a80
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x40(%rax), %rax
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
jmp 0x837ba
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x83642
addq $0x30, %rsp
popq %rbp
retq
nop