// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/samtools-0.1.18/razf.c
// Function: load_zindex
static void load_zindex(RAZF *rz, int fd){
#endif
	int32_t i, v32;
	int is_be;
	if(!rz->load_index) return;
	if(rz->index == NULL) rz->index = malloc(sizeof(ZBlockIndex));
	is_be = is_big_endian();
#ifdef _USE_KNETFILE
	knet_read(fp, &rz->index->size, sizeof(int));
#else
	read(fd, &rz->index->size, sizeof(int));
#endif
	if(!is_be) rz->index->size = byte_swap_4((uint32_t)rz->index->size);
	rz->index->cap = rz->index->size;
	v32 = rz->index->size / RZ_BIN_SIZE + 1;
	rz->index->bin_offsets  = malloc(sizeof(int64_t) * v32);
#ifdef _USE_KNETFILE
	knet_read(fp, rz->index->bin_offsets, sizeof(int64_t) * v32);
#else
	read(fd, rz->index->bin_offsets, sizeof(int64_t) * v32);
#endif
	rz->index->cell_offsets = malloc(sizeof(int) * rz->index->size);
#ifdef _USE_KNETFILE
	knet_read(fp, rz->index->cell_offsets, sizeof(int) * rz->index->size);
#else
	read(fd, rz->index->cell_offsets, sizeof(int) * rz->index->size);
#endif
	if(!is_be){
		for(i=0;i<v32;i++) rz->index->bin_offsets[i] = byte_swap_8((uint64_t)rz->index->bin_offsets[i]);
		for(i=0;i<rz->index->size;i++) rz->index->cell_offsets[i] = byte_swap_4((uint32_t)rz->index->cell_offsets[i]);
	}
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movq 0x10(%rsp), %rax
cmpl $0x0, 0x94(%rax)
jne 0x4fda70
jmp 0x4fdc48
movq 0x10(%rsp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x4fda92
movl $0x18, %edi
callq 0x19ef8
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x18(%rax)
callq 0x4fdc90
movl %eax, (%rsp)
movl 0xc(%rsp), %edi
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rsi
addq $0x10, %rsi
movl $0x4, %edx
callq 0x19a00
cmpl $0x0, (%rsp)
jne 0x4fdada
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movl 0x10(%rax), %edi
callq 0x4fdc50
movl %eax, %ecx
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movl %ecx, 0x10(%rax)
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movl 0x10(%rax), %ecx
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movl %ecx, 0x14(%rax)
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movslq 0x10(%rax), %rax
shrq $0x11, %rax
addq $0x1, %rax
movl %eax, 0x4(%rsp)
movslq 0x4(%rsp), %rdi
shlq $0x3, %rdi
callq 0x19ef8
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq %rcx, 0x8(%rax)
movl 0xc(%rsp), %edi
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rsi
movslq 0x4(%rsp), %rdx
shlq $0x3, %rdx
callq 0x19a00
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movslq 0x10(%rax), %rdi
shlq $0x2, %rdi
callq 0x19ef8
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq %rcx, (%rax)
movl 0xc(%rsp), %edi
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rsi
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movslq 0x10(%rax), %rdx
shlq $0x2, %rdx
callq 0x19a00
cmpl $0x0, (%rsp)
jne 0x4fdc48
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
cmpl 0x4(%rsp), %eax
jge 0x4fdbf0
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movslq 0x8(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x4fd630
movq %rax, %rdx
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movslq 0x8(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x4fdba5
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
movq 0x10(%rsp), %rcx
movq 0x18(%rcx), %rcx
cmpl 0x10(%rcx), %eax
jge 0x4fdc46
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
movslq 0x8(%rsp), %rcx
movl (%rax,%rcx,4), %edi
callq 0x4fdc50
movl %eax, %edx
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
movslq 0x8(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x4fdbf8
jmp 0x4fdc48
addq $0x18, %rsp
retq
nopl (%rax)