// File: /workspace/github_c_makefile_star2_O2/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 0xe6a81(%rip), %rsi     # 0x37c6d4
pushq $0x58
popq %rdi
movl $0xc3, %edx
callq 0x93160
testq %r13, %r13
je 0x29617b
movq %rax, %r14
movq %r13, %rdi
callq 0x113464
movb %al, 0x38(%r14)
movb $0x0, 0x39(%r14)
movq %r13, %rdi
callq 0x1133d0
testb %al, %al
movq %r13, 0x8(%rsp)
je 0x295d81
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x28(%r14)
movq %r13, %rdi
callq 0x112de7
movq %rax, 0x20(%r14)
leaq 0x1(%rax), %rdi
leaq 0xe6a21(%rip), %r15     # 0x37c6d4
movq %r15, %rsi
movl $0xa4, %edx
callq 0x93160
movq %rax, (%r14)
movq 0x20(%r14), %rdi
incq %rdi
movq %r15, %rsi
movl $0xa5, %edx
callq 0x93160
movq %rax, 0x8(%r14)
andq $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 0x296ce8
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x112ed0
movq %rax, %rdi
callq 0x172d0
leaq 0x1(%rax), %r15
leaq 0xe69b2(%rip), %rsi     # 0x37c6d4
movq %r15, %rdi
movl $0xcc, %edx
callq 0x93160
movq %rax, %r12
movq %rax, 0x18(%r14)
movq %rbx, %rdi
callq 0x112ed0
movq %r12, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x17630
andw $0x0, 0x3a(%r14)
andq $0x0, 0x40(%r14)
movq %rbx, %rdi
callq 0x112e2b
movq %rax, 0x50(%r14)
movq %rbx, %rdi
callq 0x112de7
movq %rax, 0x48(%r14)
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
callq 0x112f14
movl %eax, %ebp
movq %r13, %rdi
callq 0x112da3
movq %r15, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0x113a8f
movq %rax, 0x28(%r14)
movq %r13, %rdi
callq 0x112f14
movl %eax, %ebp
movq %r13, %rdi
callq 0x112e6f
movq %r15, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0x113a8f
movq %rax, 0x30(%r14)
movq %r13, %rdi
callq 0x1131f6
movl %eax, %ebp
xorl %ebx, %ebx
xorl %r15d, %r15d
cmpw %bx, %bp
je 0x295dfe
movzwl %bx, %r12d
movq %r13, %rdi
movl %r12d, %esi
callq 0x11328f
movq %r13, %rdi
movl %r12d, %esi
callq 0x11323c
movl %eax, %eax
addq %rax, %r15
incl %ebx
jmp 0x295dd6
movq %r13, %rdi
callq 0x112de7
cmpq %rax, %r15
jb 0x2961a9
movq %r15, 0x20(%r14)
incq %r15
leaq 0xe68b7(%rip), %r12     # 0x37c6d4
movq %r15, %rdi
movq %r12, %rsi
movl $0xb4, %edx
callq 0x93160
movq %rax, (%r14)
movq 0x20(%r14), %rdi
incq %rdi
movq %r12, %rsi
movl $0xb5, %edx
callq 0x93160
movq %rax, 0x8(%r14)
movq 0x20(%r14), %rdi
incq %rdi
movq %r12, %rsi
movl $0xb6, %edx
callq 0x93160
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 0x296ce8
movq 0x20(%r14), %rbx
movq %r13, %rdi
callq 0x112de7
cmpq %rax, %rbx
jb 0x2961d6
movq 0x20(%r14), %r12
movq %r13, %rdi
callq 0x112de7
subq %rax, %r12
movq %r13, %rdi
callq 0x1131f6
movzwl %ax, %eax
movq %rax, 0x20(%rsp)
decq %rax
movq %rax, 0x18(%rsp)
xorl %edi, %edi
xorl %ebx, %ebx
movq 0x8(%rsp), %r13
cmpq 0x20(%rsp), %rdi
je 0x295d02
movq %rdi, 0x10(%rsp)
movzwl %di, %r15d
movq %r13, %rdi
movl %r15d, %esi
callq 0x11328f
movl %eax, %ebp
movq %r13, %rdi
movl %r15d, %esi
callq 0x11323c
movzbl %bpl, %ecx
leal -0x48(%rcx), %edx
cmpl $0x10, %edx
ja 0x295f99
leaq 0xe677b(%rip), %rsi     # 0x37c690
movslq (%rsi,%rdx,4), %rcx
addq %rsi, %rcx
movq 0x10(%rsp), %rdi
jmpq *%rcx
testq %rdi, %rdi
je 0x295fd4
cmpq %rdi, 0x18(%rsp)
jne 0x296151
movzwl %ax, %ecx
addq %rcx, 0x30(%r14)
jmp 0x29602d
cmpq %rbx, %r12
je 0x295f7b
jbe 0x296113
movq (%r14), %rcx
movb (%rcx,%r12), %dl
cmpb $0x2d, %dl
je 0x2960bf
movq 0x8(%r14), %rsi
cmpb $0x7f, (%rsi,%r12)
je 0x2960e9
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
subw $0x1, %ax
jae 0x295f43
movb $0x1, 0x39(%r14)
jmp 0x296033
cmpl $0x3d, %ecx
movq 0x10(%rsp), %rdi
je 0x29602d
cmpl $0x44, %ecx
jne 0x296149
movzwl %ax, %eax
subl $0x1, %eax
jb 0x295f8f
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
jmp 0x295fb3
movzwl %ax, %ecx
subq %rcx, 0x28(%r14)
jmp 0x29602d
cmpq %rbx, %r12
je 0x296011
jbe 0x296068
movq (%r14), %rcx
movb (%rcx,%r12), %dl
cmpb $0x2d, %dl
je 0x29603b
movq 0x8(%r14), %rsi
cmpb $0x7f, (%rsi,%r12)
je 0x296095
movb %dl, (%rcx,%rbx)
movq 0x8(%r14), %rcx
movb (%rcx,%r12), %dl
movb %dl, (%rcx,%rbx)
movb $0x3f, %cl
cmpb $0x3d, %bpl
jne 0x296020
movq (%r14), %rcx
movb (%rcx,%r12), %cl
movq 0x10(%r14), %rdx
movb %cl, (%rdx,%rbx)
incq %rbx
incq %r12
subw $0x1, %ax
jae 0x295fdd
incq %rdi
jmp 0x295ed2
movq 0x1a1f26(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x4efc7(%rip), %rsi     # 0x2e5013
leaq 0xe6b59(%rip), %rdx     # 0x37cbac
leaq 0xe6b2d(%rip), %rcx     # 0x37cb87
leaq 0xe6673(%rip), %r8      # 0x37c6d4
pushq $0x6e
jmp 0x29613b
movq 0x1a1ef9(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x4ef9a(%rip), %rsi     # 0x2e5013
leaq 0xe68a3(%rip), %rdx     # 0x37c923
leaq 0xe6b00(%rip), %rcx     # 0x37cb87
leaq 0xe6646(%rip), %r8      # 0x37c6d4
pushq $0x6d
jmp 0x29613b
movq 0x1a1ecc(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x4ef6d(%rip), %rsi     # 0x2e5013
leaq 0xe68bf(%rip), %rdx     # 0x37c96c
leaq 0xe6ad3(%rip), %rcx     # 0x37cb87
leaq 0xe6619(%rip), %r8      # 0x37c6d4
pushq $0x6f
jmp 0x29613b
movq 0x1a1ea2(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x4ef43(%rip), %rsi     # 0x2e5013
leaq 0xe6ad5(%rip), %rdx     # 0x37cbac
leaq 0xe6aa9(%rip), %rcx     # 0x37cb87
leaq 0xe65ef(%rip), %r8      # 0x37c6d4
pushq $0x7e
jmp 0x29613b
movq 0x1a1e78(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x4ef19(%rip), %rsi     # 0x2e5013
leaq 0xe686b(%rip), %rdx     # 0x37c96c
leaq 0xe6a7f(%rip), %rcx     # 0x37cb87
leaq 0xe65c5(%rip), %r8      # 0x37c6d4
pushq $0x7f
jmp 0x29613b
movq 0x1a1e4e(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x4eeef(%rip), %rsi     # 0x2e5013
leaq 0xe67f8(%rip), %rdx     # 0x37c923
leaq 0xe6a55(%rip), %rcx     # 0x37cb87
leaq 0xe659b(%rip), %r8      # 0x37c6d4
pushq $0x7d
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390
pushq $0x2
popq %rdi
callq 0x178f0
movq 0x1a1e10(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x4eeb1(%rip), %rsi     # 0x2e5013
leaq 0x90883(%rip), %rdx     # 0x3269ec
leaq 0xe6a17(%rip), %rcx     # 0x37cb87
leaq 0xe655d(%rip), %r8      # 0x37c6d4
pushq $0x64
jmp 0x29613b
movq 0x1a1de6(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x4ee87(%rip), %rsi     # 0x2e5013
leaq 0xbf636(%rip), %rdx     # 0x3557c9
leaq 0xe6559(%rip), %rcx     # 0x37c6f3
leaq 0xe6533(%rip), %r8      # 0x37c6d4
movl $0xc4, %r9d
jmp 0x29613d
movq 0x1a1db8(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x4ee59(%rip), %rsi     # 0x2e5013
leaq 0xe699d(%rip), %rdx     # 0x37cb5e
leaq 0xe6974(%rip), %rcx     # 0x37cb3c
leaq 0xe6505(%rip), %r8      # 0x37c6d4
pushq $0x37
jmp 0x29613b
movq 0x1a1d8b(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x4ee2c(%rip), %rsi     # 0x2e5013
leaq 0xe696c(%rip), %rdx     # 0x37cb5a
leaq 0xe6992(%rip), %rcx     # 0x37cb87
leaq 0xe64d8(%rip), %r8      # 0x37c6d4
pushq $0x55
jmp 0x29613b