// File: /workspace/github_c_makefile_star2_O3/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, %r15d
movl %r8d, %r14d
movl %esi, %r12d
movq %rdi, %rbp
movl (%rdi), %eax
cmpl 0x4(%rdi), %eax
jne 0x12ccf
movslq %eax, %r13
leal (%rax,%rax), %esi
testl %eax, %eax
movl $0x4, %eax
cmovnel %esi, %eax
movl %eax, 0x4(%rbp)
movq 0x8(%rbp), %rdi
movslq %eax, %rsi
shlq $0x6, %rsi
movl %ecx, 0x4(%rsp)
movl %edx, (%rsp)
callq 0x2330
movq %rax, %rbx
movq %rax, 0x8(%rbp)
movq %r13, %rdi
shlq $0x6, %rdi
addq %rax, %rdi
movslq 0x4(%rbp), %rdx
subq %r13, %rdx
shlq $0x6, %rdx
xorl %esi, %esi
callq 0x21e0
movl (%rsp), %edx
movl 0x4(%rsp), %ecx
movl (%rbp), %eax
jmp 0x12cd3
movq 0x8(%rbp), %rbx
movl 0x48(%rsp), %r13d
leal 0x1(%rax), %esi
movl %esi, (%rbp)
movslq %eax, %rbp
shlq $0x6, %rbp
movl %r12d, 0x20(%rbx,%rbp)
movl %edx, 0x24(%rbx,%rbp)
movl %ecx, 0x28(%rbx,%rbp)
andl $0x1fffffff, %r14d      # imm = 0x1FFFFFFF
movl $0xa0000000, %eax       # imm = 0xA0000000
andl 0x30(%rbx,%rbp), %eax
movq $0x0, (%rbx,%rbp)
addl %r14d, %eax
addl $0x40000000, %eax       # imm = 0x40000000
movl %eax, 0x30(%rbx,%rbp)
testl %r15d, %r15d
jns 0x12d28
movq 0x40(%rsp), %rdi
callq 0x2170
movq %rax, %r15
movq 0x50(%rsp), %r14
addq %rbp, %rbx
testl %r13d, %r13d
jns 0x12d40
movq %r14, %rdi
callq 0x2170
movq %rax, %r13
movslq %r15d, %r15
leaq 0x1(%r15), %rax
cmpq 0x8(%rbx), %rax
jae 0x12d55
movq 0x10(%rbx), %rax
xorl %edi, %edi
jmp 0x12d9d
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(%rbx)
movq 0x10(%rbx), %rdi
callq 0x2330
movq %rax, 0x10(%rbx)
movq (%rbx), %rdi
addq %rax, %rdi
movq 0x40(%rsp), %rsi
movq %r15, %rdx
callq 0x2280
movq (%rbx), %rax
addq %r15, %rax
movq %rax, (%rbx)
movq 0x10(%rbx), %rcx
movb $0x0, (%rcx,%rax)
movq (%rbx), %rcx
leaq 0x1(%rcx), %rdx
cmpq 0x8(%rbx), %rdx
jae 0x12dd1
movq 0x10(%rbx), %rax
jmp 0x12e1d
movq %rdx, %rax
shrq %rax
orq %rdx, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rsi
shrq $0x10, %rsi
orq %rcx, %rsi
incq %rsi
movq %rsi, 0x8(%rbx)
movq 0x10(%rbx), %rdi
callq 0x2330
movq %rax, 0x10(%rbx)
movq (%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%rbx)
xorl %edx, %edx
movb %dl, (%rax,%rcx)
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
movb %dl, (%rcx,%rax)
movq (%rbx), %rdi
movslq %r13d, %r12
leaq (%r12,%rdi), %rax
incq %rax
cmpq 0x8(%rbx), %rax
jae 0x12e48
movq 0x10(%rbx), %rax
jmp 0x12e90
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(%rbx)
movq 0x10(%rbx), %rdi
callq 0x2330
movq %rax, 0x10(%rbx)
movq (%rbx), %rdi
addq %rax, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2280
addq (%rbx), %r12
movq %r12, (%rbx)
movq 0x10(%rbx), %rax
movb $0x0, (%rax,%r12)
movq 0x10(%rbx), %rax
addq %r15, %rax
incq %rax
movq %rax, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq