// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/cram/cram_index.c
// Function: cram_index_build_multiref
static int cram_index_build_multiref(cram_fd *fd,
				     cram_container *c,
				     cram_slice *s,
				     zfp *fp,
				     off_t cpos,
				     int32_t landmark,
				     int sz) {
    int i, ref = -2, ref_start = 0, ref_end;
    char buf[1024];

    if (0 != cram_decode_slice(fd, c, s, fd->header))
	return -1;

    ref_end = INT_MIN;
    for (i = 0; i < s->hdr->num_records; i++) {
	if (s->crecs[i].ref_id == ref) {
	    if (ref_end < s->crecs[i].aend)
		ref_end = s->crecs[i].aend;
	    continue;
	}

	if (ref != -2) {
	    sprintf(buf, "%d\t%d\t%d\t%"PRId64"\t%d\t%d\n",
		    ref, ref_start, ref_end - ref_start + 1,
		    (int64_t)cpos, landmark, sz);
	    zfputs(buf, fp);
	}

	ref = s->crecs[i].ref_id;
	ref_start = s->crecs[i].apos;
	ref_end = INT_MIN;
    }

    if (ref != -2) {
	sprintf(buf, "%d\t%d\t%d\t%"PRId64"\t%d\t%d\n",
		ref, ref_start, ref_end - ref_start + 1,
		(int64_t)cpos, landmark, sz);
	zfputs(buf, fp);
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x460, %rsp            # imm = 0x460
movl 0x10(%rbp), %eax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movl %r9d, -0x34(%rbp)
movl $0xfffffffe, -0x3c(%rbp) # imm = 0xFFFFFFFE
movl $0x0, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
callq 0xb23d0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x7b401
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7b564
movl $0x80000000, -0x44(%rbp) # imm = 0x80000000
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq -0x20(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x10(%rcx), %eax
jge 0x7b50d
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x38(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpl -0x3c(%rbp), %eax
jne 0x7b476
movl -0x44(%rbp), %eax
movq -0x20(%rbp), %rcx
movq 0x28(%rcx), %rcx
movslq -0x38(%rbp), %rdx
imulq $0x70, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x5c(%rcx), %eax
jge 0x7b471
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x38(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movl 0x5c(%rax), %eax
movl %eax, -0x44(%rbp)
jmp 0x7b4ff
cmpl $-0x2, -0x3c(%rbp)
je 0x7b4c6
leaq -0x450(%rbp), %rdi
movl -0x3c(%rbp), %edx
movl -0x40(%rbp), %ecx
movl -0x44(%rbp), %r8d
subl -0x40(%rbp), %r8d
addl $0x1, %r8d
movq -0x30(%rbp), %r9
movl -0x34(%rbp), %r10d
movl 0x10(%rbp), %eax
leaq 0x67401(%rip), %rsi     # 0xe28a8
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x6160
leaq -0x450(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x99d00
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x38(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x3c(%rbp)
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x38(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
movl %eax, -0x40(%rbp)
movl $0x80000000, -0x44(%rbp) # imm = 0x80000000
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x7b40f
cmpl $-0x2, -0x3c(%rbp)
je 0x7b55d
leaq -0x450(%rbp), %rdi
movl -0x3c(%rbp), %edx
movl -0x40(%rbp), %ecx
movl -0x44(%rbp), %r8d
subl -0x40(%rbp), %r8d
addl $0x1, %r8d
movq -0x30(%rbp), %r9
movl -0x34(%rbp), %r10d
movl 0x10(%rbp), %eax
leaq 0x6736a(%rip), %rsi     # 0xe28a8
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x6160
leaq -0x450(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x99d00
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x460, %rsp            # imm = 0x460
popq %rbp
retq