// File: /workspace/github_c_makefile_star2_O0/DReichLab[P]adna/sam.c
// Function: bam_write1
int bam_write1(BGZF *fp, const bam1_t *b)
{
	const bam1_core_t *c = &b->core;
	uint32_t x[8], block_len = b->l_data + 32, y;
	int i;
	x[0] = c->tid;
	x[1] = c->pos;
	x[2] = (uint32_t)c->bin<<16 | c->qual<<8 | c->l_qname;
	x[3] = (uint32_t)c->flag<<16 | c->n_cigar;
	x[4] = c->l_qseq;
	x[5] = c->mtid;
	x[6] = c->mpos;
	x[7] = c->isize;
	bgzf_flush_try(fp, 4 + block_len);
	if (fp->is_be) {
		for (i = 0; i < 8; ++i) ed_swap_4p(x + i);
		y = block_len;
		bgzf_write(fp, ed_swap_4p(&y), 4);
		swap_data(c, b->l_data, b->data);
	} else bgzf_write(fp, &block_len, 4);
	bgzf_write(fp, x, 32);
	bgzf_write(fp, b->data, b->l_data);
	if (fp->is_be) swap_data(c, b->l_data, b->data);
	return 4 + block_len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
addl $0x20, %eax
movl %eax, -0x44(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x3c(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
andq $0xffff, %rax           # imm = 0xFFFF
shll $0x10, %eax
movq -0x18(%rbp), %rcx
movq 0x8(%rcx), %rcx
shrq $0x10, %rcx
andq $0xff, %rcx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x18(%rbp), %rcx
movq 0x8(%rcx), %rcx
shrq $0x18, %rcx
andq $0xff, %rcx
orl %ecx, %eax
movl %eax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x20, %rax
andq $0xffff, %rax           # imm = 0xFFFF
shll $0x10, %eax
movq -0x18(%rbp), %rcx
movq 0x8(%rcx), %rcx
shrq $0x30, %rcx
orl %ecx, %eax
movl %eax, -0x34(%rbp)
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x18(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movl -0x44(%rbp), %eax
addl $0x4, %eax
movl %eax, %eax
movl %eax, %esi
callq 0x5710
movq -0x8(%rbp), %rax
movl (%rax), %eax
shll $0xc, %eax
sarl $0x1e, %eax
cmpl $0x0, %eax
je 0xd7a9
movl $0x0, -0x4c(%rbp)
cmpl $0x8, -0x4c(%rbp)
jge 0xd767
leaq -0x40(%rbp), %rdi
movslq -0x4c(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
callq 0xcb00
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0xd742
movl -0x44(%rbp), %eax
movl %eax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq -0x48(%rbp), %rdi
callq 0xcb00
movq -0x58(%rbp), %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x57d0
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x20(%rax), %esi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdx
callq 0xd3b0
jmp 0xd7bb
movq -0x8(%rbp), %rdi
leaq -0x44(%rbp), %rsi
movl $0x4, %edx
callq 0x57d0
movq -0x8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
movl $0x20, %edx
callq 0x57d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
movq -0x10(%rbp), %rax
movslq 0x20(%rax), %rdx
callq 0x57d0
movq -0x8(%rbp), %rax
movl (%rax), %eax
shll $0xc, %eax
sarl $0x1e, %eax
cmpl $0x0, %eax
je 0xd80f
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x20(%rax), %esi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdx
callq 0xd3b0
movl -0x44(%rbp), %eax
addl $0x4, %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)