// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/tools/gt_sam_interface.c
// Function: gt_sam_interface_runner
static int gt_sam_interface_runner(GT_UNUSED int argc,
                                   GT_UNUSED const char **argv,
                                   GT_UNUSED int parsed_args,
                                   void *tool_arguments, GtError *err)
{
  GtSamInterfaceArguments *arguments = tool_arguments;
  int had_err = 0, count_out = 0;
  GtSamfileIterator *sa_iter;
  GtSamAlignment *sa_align;
  GtAlphabet *alpha = gt_alphabet_new_dna();

  gt_error_check(err);
  gt_assert(arguments);

  if (arguments->bool_is_sam) {
    if (gt_option_is_set(arguments->ref_idxfile))
      sa_iter = gt_samfile_iterator_new_sam(argv[parsed_args], alpha,
                                        gt_str_get(arguments->indexfilename),
                                        err);
    else
      sa_iter  = gt_samfile_iterator_new_sam(argv[parsed_args], alpha,
                                        NULL,
                                        err);

  }
  else {
    sa_iter = gt_samfile_iterator_new_bam(argv[parsed_args], alpha, err);
  }
  while (gt_samfile_iterator_next(sa_iter, &sa_align) > 0 &&
         arguments->lines - count_out) {
    uint16_t cig_len, idx;

    cig_len = gt_sam_alignment_cigar_length(sa_align);

    printf("%s\t%d\t%s\t",
           gt_sam_alignment_identifier(sa_align),
           (int) gt_sam_alignment_flag(sa_align),
           gt_samfile_iterator_reference_name(sa_iter,
                                         gt_sam_alignment_ref_num(sa_align)));
    if (gt_sam_alignment_is_unmapped(sa_align))
      printf("*");
    else {
      for (idx = 0; idx < cig_len; idx++) {
        printf("%d%c",
               (int) gt_sam_alignment_cigar_i_length(sa_align, idx),
               gt_sam_alignment_cigar_i_operation(sa_align, idx));
      }
    }
    printf("\t");
    gt_alphabet_decode_seq_to_fp(alpha, stdout,
        gt_sam_alignment_sequence(sa_align),
        gt_sam_alignment_read_length(sa_align));
    printf("\t%s\n",
           (char *) gt_sam_alignment_qualitystring(sa_align));
    count_out++;
  }
  gt_samfile_iterator_delete(sa_iter);
  gt_alphabet_delete(alpha);
  return had_err;
}

// Assembly:
subq $0xa8, %rsp
movl %edi, 0xa4(%rsp)
movq %rsi, 0x98(%rsp)
movl %edx, 0x94(%rsp)
movq %rcx, 0x88(%rsp)
movq %r8, 0x80(%rsp)
movq 0x88(%rsp), %rax
movq %rax, 0x78(%rsp)
movl $0x0, 0x74(%rsp)
movl $0x0, 0x70(%rsp)
callq 0x7e4b0
movq %rax, 0x58(%rsp)
cmpq $0x0, 0x80(%rsp)
je 0x5c2fa
movq 0x80(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x5c2c2
jmp 0x5c2fa
movq 0x5dfcd7(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4b9d40(%rip), %rsi    # 0x516013
leaq 0x4b9ee5(%rip), %rdx    # 0x5161bf
leaq 0x4caa61(%rip), %rcx    # 0x526d42
leaq 0x4ca938(%rip), %r8     # 0x526c20
movl $0x6b, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x5c2fc
jmp 0x5c2fe
cmpq $0x0, 0x78(%rsp)
jne 0x5c33e
movq 0x5dfc93(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4b9cfc(%rip), %rsi    # 0x516013
leaq 0x51e841(%rip), %rdx    # 0x57ab5f
leaq 0x4caa1d(%rip), %rcx    # 0x526d42
leaq 0x4ca8f4(%rip), %r8     # 0x526c20
movl $0x6c, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x5c340
movq 0x78(%rsp), %rax
testb $0x1, (%rax)
je 0x5c3e5
movq 0x78(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0xf74a0
testb $0x1, %al
jne 0x5c362
jmp 0x5c3b4
movq 0x98(%rsp), %rax
movslq 0x94(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x40(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x78(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x11dee0
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq %rax, %rdx
movq 0x80(%rsp), %rcx
callq 0x1cf9f0
movq %rax, 0x68(%rsp)
jmp 0x5c3e3
movq 0x98(%rsp), %rax
movslq 0x94(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
movq 0x58(%rsp), %rsi
movq 0x80(%rsp), %rcx
xorl %eax, %eax
movl %eax, %edx
callq 0x1cf9f0
movq %rax, 0x68(%rsp)
jmp 0x5c410
movq 0x98(%rsp), %rax
movslq 0x94(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
movq 0x58(%rsp), %rsi
movq 0x80(%rsp), %rdx
callq 0x1cf9b0
movq %rax, 0x68(%rsp)
jmp 0x5c412
movq 0x68(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x1cfa30
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0x3f(%rsp)
jle 0x5c444
movq 0x78(%rsp), %rax
movl 0x4(%rax), %eax
subl 0x70(%rsp), %eax
cmpl $0x0, %eax
setne %al
movb %al, 0x3f(%rsp)
movb 0x3f(%rsp), %al
testb $0x1, %al
jne 0x5c451
jmp 0x5c5b7
movq 0x60(%rsp), %rdi
callq 0x1ce850
movw %ax, 0x56(%rsp)
movq 0x60(%rsp), %rdi
callq 0x1ce2e0
movq %rax, 0x30(%rsp)
movq 0x60(%rsp), %rdi
callq 0x1cea30
movl %eax, 0x38(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x60(%rsp), %rdi
callq 0x1ce340
movq 0x28(%rsp), %rdi
movl %eax, %esi
callq 0x1cfba0
movq 0x30(%rsp), %rsi
movl 0x38(%rsp), %edx
movq %rax, %rcx
leaq 0x4ca8aa(%rip), %rdi    # 0x526d5a
movb $0x0, %al
callq 0x19070
movq 0x60(%rsp), %rdi
callq 0x1ceb90
testb $0x1, %al
jne 0x5c4c7
jmp 0x5c4d7
leaq 0x5411ba(%rip), %rdi    # 0x59d688
movb $0x0, %al
callq 0x19070
jmp 0x5c535
movw $0x0, 0x54(%rsp)
movzwl 0x54(%rsp), %eax
movzwl 0x56(%rsp), %ecx
cmpl %ecx, %eax
jge 0x5c533
movq 0x60(%rsp), %rdi
movzwl 0x54(%rsp), %esi
callq 0x1ce8b0
movl %eax, 0x24(%rsp)
movq 0x60(%rsp), %rdi
movzwl 0x54(%rsp), %esi
callq 0x1ce940
movl 0x24(%rsp), %esi
movzbl %al, %edx
leaq 0x4ca848(%rip), %rdi    # 0x526d64
movb $0x0, %al
callq 0x19070
movw 0x54(%rsp), %ax
addw $0x1, %ax
movw %ax, 0x54(%rsp)
jmp 0x5c4de
jmp 0x5c535
leaq 0x536669(%rip), %rdi    # 0x592ba5
movb $0x0, %al
callq 0x19070
movq 0x58(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x5df9e4(%rip), %rax    # 0x63bf38
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x60(%rsp), %rdi
callq 0x1ce5f0
movq %rax, 0x18(%rsp)
movq 0x60(%rsp), %rdi
callq 0x1ce180
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %rax, %rcx
callq 0x7ed90
movq 0x60(%rsp), %rdi
callq 0x1ce820
movq %rax, %rsi
leaq 0x4ca94b(%rip), %rdi    # 0x526eeb
movb $0x0, %al
callq 0x19070
movl 0x70(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x70(%rsp)
jmp 0x5c412
movq 0x68(%rsp), %rdi
callq 0x1cf910
movq 0x58(%rsp), %rdi
callq 0x7e3d0
movl 0x74(%rsp), %eax
addq $0xa8, %rsp
retq
nopw (%rax,%rax)