// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/extended/aligned_segment.c
// Function: gt_aligned_segment_new_from_sa
GtAlignedSegment *gt_aligned_segment_new_from_sa(GtSamAlignment *sa,
    GtSamfileEncseqMapping *sem)
{
  GtAlignedSegment *as;
  size_t dlen;
  as = gt_malloc(sizeof (GtAlignedSegment));
  gt_assert(sa != NULL);
  as->r_reverse = gt_sam_alignment_is_reverse(sa);
  as->has_indels = false;
  if (gt_sam_alignment_is_unmapped(sa))
    gt_aligned_segment_init_from_unmapped_sa(as, sa);
  else
    gt_aligned_segment_init_from_mapped_sa(as, sa, sem);
  dlen = strlen(gt_sam_alignment_identifier(sa)) + 1UL;
  as->d = gt_malloc(sizeof (*as->d) * dlen);
  (void)memcpy(as->d, gt_sam_alignment_identifier(sa), sizeof (*as->d) * dlen);
  as->s_edited = false;
  as->r_edited = false;
  as->s_orig = NULL;
  as->mapq = gt_sam_alignment_mapping_quality(sa);
  as->orig_seqlen = gt_sam_alignment_read_length(sa);
  return as;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r15
movq %rdi, %r13
leaq 0xe1a59(%rip), %rsi     # 0x3e5a04
movl $0x58, %edi
movl $0xc3, %edx
callq 0x1092b2
testq %r13, %r13
je 0x3043d6
movq %rax, %r14
movq %r13, %rdi
callq 0x1788c0
movb %al, 0x38(%r14)
movb $0x0, 0x39(%r14)
movq %r13, %rdi
callq 0x178892
testb %al, %al
movq %r13, 0x8(%rsp)
je 0x304060
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x28(%r14)
movq %r13, %rdi
callq 0x178583
movq %rax, 0x20(%r14)
leaq 0x1(%rax), %rdi
leaq 0xe19fb(%rip), %r15     # 0x3e5a04
movq %r15, %rsi
movl $0xa4, %edx
callq 0x1092b2
movq %rax, (%r14)
movq 0x20(%r14), %rdi
incq %rdi
movq %r15, %rsi
movl $0xa5, %edx
callq 0x1092b2
movq %rax, 0x8(%r14)
movq $0x0, 0x10(%r14)
movq (%r14), %rax
movq 0x20(%r14), %rcx
xorl %edx, %edx
movb %dl, (%rax,%rcx)
movq 0x8(%r14), %rax
movq 0x20(%r14), %rcx
movb %dl, (%rax,%rcx)
movq %r14, %rdi
movq %r13, %rsi
callq 0x304889
jmp 0x30432b
movq %r13, %rdi
callq 0x1785ed
movl %eax, %ebp
movq %r13, %rdi
callq 0x178570
movq %r15, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0x178d38
movq %rax, 0x28(%r14)
movq %r13, %rdi
callq 0x1785ed
movl %eax, %ebp
movq %r13, %rdi
callq 0x1785a9
movq %r15, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0x178d38
movq %rax, 0x30(%r14)
movq %r13, %rdi
callq 0x1787e8
testw %ax, %ax
je 0x3040e5
movl %eax, %ebp
xorl %r15d, %r15d
xorl %eax, %eax
movzwl %ax, %r12d
movq %r13, %rdi
movl %r12d, %esi
callq 0x17881b
movq %r13, %rdi
movl %r12d, %esi
callq 0x1787fb
movl %eax, %eax
addq %rax, %r15
leal 0x1(%r12), %eax
cmpw %ax, %bp
jne 0x3040ba
jmp 0x3040e8
xorl %r15d, %r15d
movq %r13, %rdi
callq 0x178583
cmpq %rax, %r15
jb 0x3043e0
movq %r15, 0x20(%r14)
incq %r15
leaq 0xe18fd(%rip), %r12     # 0x3e5a04
movq %r15, %rdi
movq %r12, %rsi
movl $0xb4, %edx
callq 0x1092b2
movq %rax, (%r14)
movq 0x20(%r14), %rdi
incq %rdi
movq %r12, %rsi
movl $0xb5, %edx
callq 0x1092b2
movq %rax, 0x8(%r14)
movq 0x20(%r14), %rdi
incq %rdi
movq %r12, %rsi
movl $0xb6, %edx
callq 0x1092b2
movq %rax, 0x10(%r14)
movq (%r14), %rax
movq 0x20(%r14), %rcx
xorl %edx, %edx
movb %dl, (%rax,%rcx)
movq 0x8(%r14), %rax
movq 0x20(%r14), %rcx
movb %dl, (%rax,%rcx)
movq 0x10(%r14), %rax
movq 0x20(%r14), %rcx
movb %dl, (%rax,%rcx)
movq %r14, %rdi
movq %r13, %rsi
callq 0x304889
movq 0x20(%r14), %rbx
movq %r13, %rdi
callq 0x178583
cmpq %rax, %rbx
jb 0x3043e5
movq 0x20(%r14), %r12
movq %r13, %rdi
callq 0x178583
movq %rax, %r15
movq %r13, %rdi
callq 0x1787e8
testw %ax, %ax
je 0x30432b
subq %r15, %r12
movzwl %ax, %eax
movq %rax, 0x20(%rsp)
decq %rax
movq %rax, 0x18(%rsp)
xorl %edi, %edi
xorl %ebx, %ebx
movq 0x8(%rsp), %r13
movq %rdi, 0x10(%rsp)
movzwl %di, %r15d
movq %r13, %rdi
movl %r15d, %esi
callq 0x17881b
movl %eax, %ebp
movq %r13, %rdi
movl %r15d, %esi
callq 0x1787fb
movzbl %bpl, %ecx
leal -0x48(%rcx), %edx
cmpl $0x10, %edx
ja 0x304260
leaq 0xe17c4(%rip), %rsi     # 0x3e59c0
movslq (%rsi,%rdx,4), %rcx
addq %rsi, %rcx
movq 0x10(%rsp), %rdi
jmpq *%rcx
testw %ax, %ax
je 0x304298
cmpq %r12, %rbx
je 0x30424b
jae 0x3043c2
movq (%r14), %rcx
movb (%rcx,%r12), %dl
cmpb $0x2d, %dl
je 0x3043bd
movq 0x8(%r14), %rsi
cmpb $0x7f, (%rsi,%r12)
je 0x3043c7
movb %dl, (%rcx,%rbx)
movq 0x8(%r14), %rcx
movb (%rcx,%r12), %dl
movb %dl, (%rcx,%rbx)
movq 0x10(%r14), %rcx
movb $0x2d, (%rcx,%rbx)
incq %rbx
incq %r12
decw %ax
jne 0x304213
jmp 0x304298
cmpl $0x3d, %ecx
movq 0x10(%rsp), %rdi
je 0x3042bf
cmpl $0x44, %ecx
jne 0x3043cc
andl $0xffff, %eax           # imm = 0xFFFF
je 0x304298
movq (%r14), %rcx
movb $0x2d, (%rcx,%rbx)
movq 0x8(%r14), %rcx
movb $0x7f, (%rcx,%rbx)
movq 0x10(%r14), %rcx
movb $0x3f, (%rcx,%rbx)
incq %rbx
decl %eax
jne 0x30427a
movb $0x1, 0x39(%r14)
jmp 0x30431d
testq %rdi, %rdi
je 0x3042b8
cmpq %rdi, 0x18(%rsp)
jne 0x3043db
movzwl %ax, %ecx
addq %rcx, 0x30(%r14)
jmp 0x3042bf
movzwl %ax, %ecx
subq %rcx, 0x28(%r14)
testw %ax, %ax
je 0x30431d
cmpq %r12, %rbx
je 0x3042fc
jae 0x3043b3
movq (%r14), %rcx
movb (%rcx,%r12), %dl
cmpb $0x2d, %dl
je 0x3043ae
movq 0x8(%r14), %rsi
cmpb $0x7f, (%rsi,%r12)
je 0x3043b8
movb %dl, (%rcx,%rbx)
movq 0x8(%r14), %rcx
movb (%rcx,%r12), %dl
movb %dl, (%rcx,%rbx)
movb $0x3f, %cl
cmpb $0x3d, %bpl
jne 0x30430b
movq (%r14), %rcx
movb (%rcx,%r12), %cl
movq 0x10(%r14), %rdx
movb %cl, (%rdx,%rbx)
incq %rbx
incq %r12
decw %ax
jne 0x3042c4
incq %rdi
cmpq 0x20(%rsp), %rdi
jne 0x3041c8
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x1785da
movq %rax, %rdi
callq 0x172f0
leaq 0x1(%rax), %r15
leaq 0xe16b9(%rip), %rsi     # 0x3e5a04
movq %r15, %rdi
movl $0xcc, %edx
callq 0x1092b2
movq %rax, %r12
movq %rax, 0x18(%r14)
movq %rbx, %rdi
callq 0x1785da
movq %r12, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x17660
movw $0x0, 0x3a(%r14)
movq $0x0, 0x40(%r14)
movq %rbx, %rdi
callq 0x178596
movq %rax, 0x50(%r14)
movq %rbx, %rdi
callq 0x178583
movq %rax, 0x48(%r14)
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x8b8b9
callq 0x8b84b
callq 0x8b882
callq 0x8b7dd
callq 0x8b76f
callq 0x8b7a6
movl $0x2, %edi
callq 0x17940
callq 0x8b95e
callq 0x8b814
callq 0x8b927
callq 0x8b8f0