// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/atomic.c
// Function: bcf_add_atom
static void bcf_add_atom(bcf_atom_v *a, int rid, int pos, int rlen, int anum, int l_ref, const char *ref, int l_alt, const char *alt)
{
	bcf_atom_t *p;
	if (a->n == a->m) {
		int oldm = a->m;
		a->m = a->m? a->m<<1 : 4;
		a->a = (bcf_atom_t*)realloc(a->a, a->m * sizeof(bcf_atom_t));
		memset(a->a + oldm, 0, (a->m - oldm) * sizeof(bcf_atom_t));
	}
	p = &a->a[a->n++];
	p->rid = rid, p->pos = pos, p->rlen = rlen, p->anum = anum;
	p->ref.l = 0;
	p->from_new = 1;
	if (l_ref < 0) l_ref = strlen(ref);
	if (l_alt < 0) l_alt = strlen(alt);
	kputsn(ref, l_ref, &p->ref); kputc('\0', &p->ref);
	kputsn(alt, l_alt, &p->ref);
	p->alt = p->ref.s + l_ref + 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %r14d
movl %r8d, %ebx
movl %esi, %r12d
movq %rdi, %r15
movslq 0x4(%rdi), %r13
cmpl %r13d, (%rdi)
jne 0x1279d
leal (,%r13,2), %eax
testl %r13d, %r13d
movl %ecx, 0x4(%rsp)
movl $0x4, %ecx
cmovnel %eax, %ecx
movl %ecx, 0x4(%r15)
movq 0x8(%r15), %rdi
movslq %ecx, %rsi
shlq $0x6, %rsi
movl %edx, %ebp
callq 0x2330
movq %rax, 0x8(%r15)
movq %r13, %rdi
shlq $0x6, %rdi
addq %rax, %rdi
movslq 0x4(%r15), %rdx
subq %r13, %rdx
shlq $0x6, %rdx
xorl %esi, %esi
callq 0x21e0
movl %ebp, %edx
movl 0x4(%rsp), %ecx
movl 0x48(%rsp), %esi
movq 0x8(%r15), %rbp
movslq (%r15), %r13
leal 0x1(%r13), %eax
movl %eax, (%r15)
shlq $0x6, %r13
movl %r12d, 0x20(%rbp,%r13)
movl %edx, 0x24(%rbp,%r13)
movl %ecx, 0x28(%rbp,%r13)
andl $0x1fffffff, %ebx       # imm = 0x1FFFFFFF
movl $0xa0000000, %eax       # imm = 0xA0000000
andl 0x30(%rbp,%r13), %eax
movq $0x0, (%rbp,%r13)
addl %ebx, %eax
addl $0x40000000, %eax       # imm = 0x40000000
movl %eax, 0x30(%rbp,%r13)
testl %r14d, %r14d
jns 0x127ff
movq 0x40(%rsp), %rdi
movq %rsi, %rbx
callq 0x2170
movq %rbx, %rsi
movq %rax, %r14
movq 0x50(%rsp), %rbx
addq %r13, %rbp
testl %esi, %esi
movq %rsi, %r15
jns 0x12819
movq %rbx, %rdi
callq 0x2170
movq %rax, %r15
movslq %r14d, %r14
leaq 0x1(%r14), %rax
cmpq 0x8(%rbp), %rax
jb 0x1286b
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rsi
shrq $0x10, %rsi
orq %rax, %rsi
incq %rsi
movq %rsi, 0x8(%rbp)
movq 0x10(%rbp), %rdi
callq 0x2330
movq %rax, 0x10(%rbp)
movq 0x10(%rbp), %rdi
addq (%rbp), %rdi
movq 0x40(%rsp), %rsi
movq %r14, %rdx
callq 0x2280
movq (%rbp), %rax
addq %r14, %rax
movq %rax, (%rbp)
movq 0x10(%rbp), %rcx
movb $0x0, (%rcx,%rax)
movq (%rbp), %rax
incq %rax
cmpq 0x8(%rbp), %rax
jb 0x128e5
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rsi
shrq $0x10, %rsi
orq %rax, %rsi
incq %rsi
movq %rsi, 0x8(%rbp)
movq 0x10(%rbp), %rdi
callq 0x2330
movq %rax, 0x10(%rbp)
movq (%rbp), %rax
movq 0x10(%rbp), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rbp)
xorl %edx, %edx
movb %dl, (%rcx,%rax)
movq (%rbp), %rax
movq 0x10(%rbp), %rcx
movb %dl, (%rcx,%rax)
movq (%rbp), %rax
movslq %r15d, %r15
addq %r15, %rax
incq %rax
cmpq 0x8(%rbp), %rax
jb 0x1295d
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rsi
shrq $0x10, %rsi
orq %rax, %rsi
incq %rsi
movq %rsi, 0x8(%rbp)
movq 0x10(%rbp), %rdi
callq 0x2330
movq %rax, 0x10(%rbp)
movq 0x10(%rbp), %rdi
addq (%rbp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2280
addq (%rbp), %r15
movq %r15, (%rbp)
movq 0x10(%rbp), %rax
movb $0x0, (%rax,%r15)
movq 0x10(%rbp), %rax
addq %r14, %rax
incq %rax
movq %rax, 0x18(%rbp)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq