// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/sam_alignment.c
// Function: gt_sam_alignment_qualitystring_external_buffer
void gt_sam_alignment_qualitystring_external_buffer(
    GtSamAlignment *sam_alignment, GtUchar **qual_buffer,
    GtUword *bufsize)
{
  GtUword query_len, idx;
  uint8_t *qual;

  gt_assert(qual_buffer != NULL);
  gt_assert(bufsize != NULL);
  query_len = (GtUword) sam_alignment->s_alignment->core.l_qseq;
  if ((*bufsize) < query_len) {
    (*qual_buffer) = gt_realloc((*qual_buffer), sizeof (**qual_buffer) *
        (query_len + 1UL));
    (*bufsize) = query_len;
  }
  gt_assert((*qual_buffer) != NULL);
  qual = bam1_qual(sam_alignment->s_alignment);
  for (idx = 0UL; idx < query_len; idx++) {
    (*qual_buffer)[idx] = (GtUchar)(qual[idx] + PHREDOFFSET);
  }
  (*qual_buffer)[query_len] = (GtUchar)'\0';
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
cmpq $0x0, 0x28(%rsp)
jne 0x1ce673
movq 0x46d95e(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3479c7(%rip), %rsi    # 0x516013
leaq 0x3958b3(%rip), %rdx    # 0x563f06
leaq 0x3958c0(%rip), %rcx    # 0x563f1a
leaq 0x395774(%rip), %r8     # 0x563dd5
movl $0xaa, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1ce675
jmp 0x1ce677
cmpq $0x0, 0x20(%rsp)
jne 0x1ce6b7
movq 0x46d91a(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x347983(%rip), %rsi    # 0x516013
leaq 0x3958b2(%rip), %rdx    # 0x563f49
leaq 0x39587c(%rip), %rcx    # 0x563f1a
leaq 0x395730(%rip), %r8     # 0x563dd5
movl $0xab, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1ce6b9
movq 0x30(%rsp), %rax
movq (%rax), %rax
movslq 0x10(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq (%rax), %rax
cmpq 0x18(%rsp), %rax
jae 0x1ce717
movq 0x28(%rsp), %rax
movq (%rax), %rdi
movq 0x18(%rsp), %rsi
addq $0x1, %rsi
shlq $0x0, %rsi
leaq 0x3956e0(%rip), %rdx    # 0x563dd5
movl $0xaf, %ecx
callq 0xe8540
movq %rax, %rcx
movq 0x28(%rsp), %rax
movq %rcx, (%rax)
movq 0x18(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
jmp 0x1ce719
movq 0x28(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x1ce75c
movq 0x46d875(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3478de(%rip), %rsi    # 0x516013
leaq 0x39581d(%rip), %rdx    # 0x563f59
leaq 0x3957d7(%rip), %rcx    # 0x563f1a
leaq 0x39568b(%rip), %r8     # 0x563dd5
movl $0xb2, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1ce75e
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq 0x30(%rax), %rax
movq 0x30(%rsp), %rcx
movq (%rcx), %rcx
movq 0x8(%rcx), %rcx
shrq $0x30, %rcx
shll $0x2, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq 0x30(%rsp), %rcx
movq (%rcx), %rcx
movq 0x8(%rcx), %rcx
shrq $0x18, %rcx
andq $0xff, %rcx
movslq %ecx, %rcx
addq %rcx, %rax
movq 0x30(%rsp), %rcx
movq (%rcx), %rcx
movl 0x10(%rcx), %ecx
addl $0x1, %ecx
sarl %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x18(%rsp), %rax
jae 0x1ce803
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
movzbl (%rax,%rcx), %eax
addl $0x21, %eax
movb %al, %dl
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rcx
movb %dl, (%rax,%rcx)
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x1ce7c4
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rsp), %rcx
movb $0x0, (%rax,%rcx)
addq $0x38, %rsp
retq
nopl (%rax)