// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/fmi-sufbwtstream.c
// Function: copytheindexfile
static int copytheindexfile(const char *destindex,
                            const char *sourceindex,
                            const char *suffix,
                            uint64_t maxlength,
                            GtError *err)
{
  FILE *fpdest = NULL, *fpsource = NULL;
  int cc;
  bool haserr = false;

  gt_error_check(err);
  fpdest = gt_fa_fopen_with_suffix(destindex,suffix,"wb",err);
  if (fpdest == NULL)
  {
    haserr = true;
  }
  if (!haserr)
  {
    fpsource = gt_fa_fopen_with_suffix(sourceindex,suffix,"rb",err);
    if (fpsource == NULL)
    {
      haserr = true;
    }
  }
  printf("# cp %s%s %s%s\n",sourceindex,suffix,destindex,suffix);
  if (!haserr)
  {
    if (maxlength == 0)
    {
      while ((cc = fgetc(fpsource)) != EOF)
      {
        (void) putc(cc,fpdest);
      }
    } else
    {
      uint64_t pos;

      for (pos = 0; pos < maxlength; pos++)
      {
        if ((cc = fgetc(fpsource)) == EOF)
        {
          break;
        }
        (void) putc(cc,fpdest);
      }
    }
  }
  gt_fa_xfclose(fpdest);
  gt_fa_xfclose(fpsource);
  return haserr ? -1 : 0;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq %r8, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0xb(%rsp)
cmpq $0x0, 0x20(%rsp)
je 0x24e964
movq 0x20(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x24e92c
jmp 0x24e964
movq 0x3ed66d(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2c76d6(%rip), %rsi    # 0x516013
leaq 0x2c787b(%rip), %rdx    # 0x5161bf
leaq 0x32a9a9(%rip), %rcx    # 0x5792f4
leaq 0x32a8d1(%rip), %r8     # 0x579223
movl $0x32, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x24e966
movq 0x40(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x20(%rsp), %r9
leaq 0x2d8221(%rip), %rdx    # 0x526b9d
leaq 0x32a8a0(%rip), %rcx    # 0x579223
movl $0x33, %r8d
callq 0xd92c0
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0x24e9a0
movb $0x1, 0xb(%rsp)
testb $0x1, 0xb(%rsp)
jne 0x24e9e3
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x20(%rsp), %r9
leaq 0x329528(%rip), %rdx    # 0x577ee5
leaq 0x32a85f(%rip), %rcx    # 0x579223
movl $0x3a, %r8d
callq 0xd92c0
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x24e9e1
movb $0x1, 0xb(%rsp)
jmp 0x24e9e3
movq 0x38(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x40(%rsp), %rcx
movq 0x30(%rsp), %r8
leaq 0x32a907(%rip), %rdi    # 0x579305
movb $0x0, %al
callq 0x19070
testb $0x1, 0xb(%rsp)
jne 0x24ea83
cmpq $0x0, 0x28(%rsp)
jne 0x24ea3b
jmp 0x24ea16
movq 0x10(%rsp), %rdi
callq 0x19b50
movl %eax, 0xc(%rsp)
cmpl $-0x1, %eax
je 0x24ea39
movl 0xc(%rsp), %edi
movq 0x18(%rsp), %rsi
callq 0x19e80
jmp 0x24ea16
jmp 0x24ea81
movq $0x0, (%rsp)
movq (%rsp), %rax
cmpq 0x28(%rsp), %rax
jae 0x24ea7f
movq 0x10(%rsp), %rdi
callq 0x19b50
movl %eax, 0xc(%rsp)
cmpl $-0x1, %eax
jne 0x24ea63
jmp 0x24ea7f
movl 0xc(%rsp), %edi
movq 0x18(%rsp), %rsi
callq 0x19e80
movq (%rsp), %rax
addq $0x1, %rax
movq %rax, (%rsp)
jmp 0x24ea43
jmp 0x24ea81
jmp 0x24ea83
movq 0x18(%rsp), %rdi
callq 0xd9570
movq 0x10(%rsp), %rdi
callq 0xd9570
movb 0xb(%rsp), %dl
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testb $0x1, %dl
cmovnel %ecx, %eax
addq $0x48, %rsp
retq
nopl (%rax)