// File: /workspace/github_c_makefile_star2_O3/lh3[P]bgt/bgt.c
// Function: bgt_al_from_bcf
void bgt_al_from_bcf(const bcf_hdr_t *h, const bcf1_t *b, bgt_allele_t *a, bgt_allele_t *r)
{
	char *ref, *alt;
	const char *chr;
	int l_ref, l_alt, min_l, shift, l_chr;
	bcf_get_ref_alt1(b, &l_ref, &ref, &l_alt, &alt);
	min_l = l_ref < l_alt? l_ref : l_alt;
	for (shift = 0; shift < min_l && ref[shift] == alt[shift]; ++shift);
	a->rid = b->rid, a->pos = b->pos + shift, a->rlen = b->rlen - shift;
	a->chr.l = 0;
	chr = h->id[BCF_DT_CTG][b->rid].key;
	l_chr = strlen(chr);
	kputsn(chr, l_chr, &a->chr);
	kputc(0, &a->chr);
	kputsn(alt + shift, l_alt - shift, &a->chr);
	a->al = a->chr.s + l_chr + 1;
	if (r) {
		r->rid = b->rid, r->pos = b->pos + shift, r->rlen = b->rlen - shift;
		r->chr.l = 0;
		kputsn(chr, l_chr, &r->chr);
		kputc(0, &r->chr);
		kputsn(ref + shift, l_ref - shift, &r->chr);
		r->al = r->chr.s + l_chr + 1;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %rbx
movq %rdx, %r13
movq %rdi, %r14
leaq 0xc(%rsp), %r12
leaq 0x30(%rsp), %rdx
leaq 0x8(%rsp), %rbp
leaq 0x28(%rsp), %r8
movq %rsi, 0x20(%rsp)
movq %rsi, %rdi
movq %r12, %rsi
movq %rbp, %rcx
callq 0x1127d
movl (%r12), %eax
movl (%rbp), %r15d
cmpl %r15d, %eax
cmovll %eax, %r15d
testl %r15d, %r15d
jle 0x1a712
movq 0x30(%rsp), %rax
movq 0x28(%rsp), %rcx
movl %r15d, %esi
xorl %edx, %edx
movb (%rax,%rdx), %dil
cmpb (%rcx,%rdx), %dil
jne 0x1a717
incq %rdx
cmpq %rdx, %rsi
jne 0x1a6fe
jmp 0x1a71a
xorl %r15d, %r15d
jmp 0x1a71a
movl %edx, %r15d
movq 0x20(%rsp), %rdx
movslq (%rdx), %rax
movl %eax, 0x20(%r13)
movl 0x4(%rdx), %ecx
addl %r15d, %ecx
movl %ecx, 0x24(%r13)
movl 0x8(%rdx), %ecx
subl %r15d, %ecx
movl %ecx, 0x28(%r13)
movq $0x0, (%r13)
movq 0x20(%r14), %rcx
shlq $0x4, %rax
movq (%rcx,%rax), %rbp
movq %rbp, %rdi
callq 0x2170
movslq %eax, %r12
leaq 0x1(%r12), %r14
cmpq 0x8(%r13), %r14
jae 0x1a76c
movq 0x10(%r13), %rax
xorl %edi, %edi
jmp 0x1a7b5
movq %r14, %rax
shrq %rax
orq %r14, %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(%r13)
movq 0x10(%r13), %rdi
callq 0x2330
movq %rax, 0x10(%r13)
movq (%r13), %rdi
addq %rax, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x2280
movq (%r13), %rax
addq %r12, %rax
movq %rax, (%r13)
movq 0x10(%r13), %rcx
movb $0x0, (%rcx,%rax)
movq (%r13), %rcx
leaq 0x1(%rcx), %rdx
cmpq 0x8(%r13), %rdx
movq %r12, 0x40(%rsp)
movq %rbp, 0x18(%rsp)
jae 0x1a7f4
movq 0x10(%r13), %rax
jmp 0x1a841
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(%r13)
movq 0x10(%r13), %rdi
callq 0x2330
movq %rax, 0x10(%r13)
movq (%r13), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%r13)
xorl %edx, %edx
movb %dl, (%rax,%rcx)
movq (%r13), %rax
movq 0x10(%r13), %rcx
movb %dl, (%rcx,%rax)
movl %r15d, %eax
movq 0x28(%rsp), %rbp
movq %rax, 0x10(%rsp)
addq %rax, %rbp
movslq 0x8(%rsp), %r12
movslq %r15d, %rax
movq %rax, 0x38(%rsp)
subq %rax, %r12
movq (%r13), %rdi
leaq (%rdi,%r12), %rax
incq %rax
cmpq 0x8(%r13), %rax
jae 0x1a88c
movq 0x10(%r13), %rax
jmp 0x1a8d5
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(%r13)
movq 0x10(%r13), %rdi
callq 0x2330
movq %rax, 0x10(%r13)
movq (%r13), %rdi
addq %rax, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x2280
addq (%r13), %r12
movq %r12, (%r13)
movq 0x10(%r13), %rax
movb $0x0, (%rax,%r12)
movq 0x10(%r13), %rax
movq 0x40(%rsp), %r12
addq %r12, %rax
incq %rax
movq %rax, 0x18(%r13)
testq %rbx, %rbx
je 0x1aab8
movq 0x20(%rsp), %rcx
movl (%rcx), %eax
movl %eax, 0x20(%rbx)
movl 0x4(%rcx), %eax
addl %r15d, %eax
movl %eax, 0x24(%rbx)
movl 0x8(%rcx), %eax
subl %r15d, %eax
movl %eax, 0x28(%rbx)
movq $0x0, (%rbx)
cmpq 0x8(%rbx), %r14
jae 0x1a941
movq 0x10(%rbx), %rax
xorl %edi, %edi
jmp 0x1a989
movq %r14, %rax
shrq %rax
orq %r14, %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), %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %r14
addq %rax, %rdi
movq %r12, %rdx
callq 0x2280
movq (%rbx), %rax
addq %r12, %rax
movq %rax, (%rbx)
movq 0x10(%rbx), %rcx
movb $0x0, (%rcx,%rax)
movq (%rbx), %rcx
leaq 0x1(%rcx), %rdx
cmpq 0x8(%rbx), %rdx
jae 0x1a9c2
movq 0x10(%rbx), %rax
jmp 0x1aa0e
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)
addq 0x30(%rsp), %r14
movslq 0xc(%rsp), %r15
subq 0x38(%rsp), %r15
movq (%rbx), %rdi
leaq (%rdi,%r15), %rax
incq %rax
cmpq 0x8(%rbx), %rax
jae 0x1aa45
movq 0x10(%rbx), %rax
jmp 0x1aa8d
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 %r15, %rdx
callq 0x2280
addq (%rbx), %r15
movq %r15, (%rbx)
movq 0x10(%rbx), %rax
movb $0x0, (%rax,%r15)
movq 0x10(%rbx), %rax
addq %r12, %rax
incq %rax
movq %rax, 0x18(%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq