// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/str.c
// Function: gt_str_read_next_line
int gt_str_read_next_line(GtStr *s, FILE *fpin)
{
  int cc;
  char c;
  gt_assert(s && fpin);
  for (;;) {
    cc = gt_xfgetc(fpin);
    if (cc == EOF)
      return EOF;
    if (cc == '\n') {
      if ((s->length+1) * sizeof (char) > s->allocated) {
        s->cstr = gt_dynalloc(s->cstr, &s->allocated,
                              (s->length+1) * sizeof (char));
      }
      s->cstr[s->length] = '\0';
      return 0;
    }
    else if (cc == '\r') {
      /* check if we have a Windows newline "\r\n" */
      int ncc;
      char nc;
      ncc = gt_xfgetc(fpin);
      if (ncc == EOF) {
        c = cc;
        if ((s->length+2) * sizeof (char) > s->allocated) {
          s->cstr = gt_dynalloc(s->cstr, &s->allocated,
                                (s->length+2) * sizeof (char));
        }
        s->cstr[s->length++] = c;
        return EOF;
      }
      if (ncc == '\n') {
        if ((s->length+1) * sizeof (char) > s->allocated) {
          s->cstr = gt_dynalloc(s->cstr, &s->allocated,
                                (s->length+1) * sizeof (char));
        }
        s->cstr[s->length] = '\0';
        return 0;
      }
      c = cc;
      nc = ncc;
      if ((s->length+3) * sizeof (char) > s->allocated) {
        s->cstr = gt_dynalloc(s->cstr, &s->allocated,
                              (s->length+3) * sizeof (char));
      }
      s->cstr[s->length++] = c;
      s->cstr[s->length++] = nc;
      continue;
    }

    c = cc;
    if ((s->length+2) * sizeof (char) > s->allocated) {
      s->cstr = gt_dynalloc(s->cstr, &s->allocated,
                            (s->length+2) * sizeof (char));
    }
    s->cstr[s->length++] = c;
  }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
cmpq $0x0, 0x18(%rsp)
je 0x19e1e
cmpq $0x0, 0x10(%rsp)
jne 0x19e56
movq 0x19a1b3(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x144237(%rip), %rsi    # 0x15e066
leaq 0x146873(%rip), %rdx    # 0x1606a9
leaq 0x146876(%rip), %rcx    # 0x1606b3
leaq 0x1466ca(%rip), %r8     # 0x16050e
movl $0x109, %r9d            # imm = 0x109
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x19e58
jmp 0x19e5a
movq 0x10(%rsp), %rdi
callq 0x1c770
movl %eax, 0xc(%rsp)
cmpl $-0x1, 0xc(%rsp)
jne 0x19e7c
movl $0xffffffff, 0x24(%rsp) # imm = 0xFFFFFFFF
jmp 0x1a13d
cmpl $0xa, 0xc(%rsp)
jne 0x19ef3
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
addq $0x1, %rax
shlq $0x0, %rax
movq 0x18(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jbe 0x19ed1
movq 0x18(%rsp), %rax
movq (%rax), %rdi
movq 0x18(%rsp), %rsi
addq $0x10, %rsi
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdx
addq $0x1, %rdx
shlq $0x0, %rdx
callq 0x7f2b0
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rsp), %rcx
movq 0x8(%rcx), %rcx
movb $0x0, (%rax,%rcx)
movl $0x0, 0x24(%rsp)
jmp 0x1a13d
cmpl $0xd, 0xc(%rsp)
jne 0x1a0bd
movq 0x10(%rsp), %rdi
callq 0x1c770
movl %eax, 0x4(%rsp)
cmpl $-0x1, 0x4(%rsp)
jne 0x19f9d
movl 0xc(%rsp), %eax
movb %al, 0xb(%rsp)
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
addq $0x2, %rax
shlq $0x0, %rax
movq 0x18(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jbe 0x19f6d
movq 0x18(%rsp), %rax
movq (%rax), %rdi
movq 0x18(%rsp), %rsi
addq $0x10, %rsi
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdx
addq $0x2, %rdx
shlq $0x0, %rdx
callq 0x7f2b0
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
movb 0xb(%rsp), %dl
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rsp), %rsi
movq 0x8(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x8(%rsi)
movb %dl, (%rax,%rcx)
movl $0xffffffff, 0x24(%rsp) # imm = 0xFFFFFFFF
jmp 0x1a13d
cmpl $0xa, 0x4(%rsp)
jne 0x1a014
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
addq $0x1, %rax
shlq $0x0, %rax
movq 0x18(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jbe 0x19ff2
movq 0x18(%rsp), %rax
movq (%rax), %rdi
movq 0x18(%rsp), %rsi
addq $0x10, %rsi
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdx
addq $0x1, %rdx
shlq $0x0, %rdx
callq 0x7f2b0
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rsp), %rcx
movq 0x8(%rcx), %rcx
movb $0x0, (%rax,%rcx)
movl $0x0, 0x24(%rsp)
jmp 0x1a13d
movl 0xc(%rsp), %eax
movb %al, 0xb(%rsp)
movl 0x4(%rsp), %eax
movb %al, 0x3(%rsp)
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
addq $0x3, %rax
shlq $0x0, %rax
movq 0x18(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jbe 0x1a072
movq 0x18(%rsp), %rax
movq (%rax), %rdi
movq 0x18(%rsp), %rsi
addq $0x10, %rsi
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdx
addq $0x3, %rdx
shlq $0x0, %rdx
callq 0x7f2b0
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
movb 0xb(%rsp), %dl
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rsp), %rsi
movq 0x8(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x8(%rsi)
movb %dl, (%rax,%rcx)
movb 0x3(%rsp), %dl
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rsp), %rsi
movq 0x8(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x8(%rsi)
movb %dl, (%rax,%rcx)
jmp 0x19e5a
jmp 0x1a0bf
movl 0xc(%rsp), %eax
movb %al, 0xb(%rsp)
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
addq $0x2, %rax
shlq $0x0, %rax
movq 0x18(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jbe 0x1a115
movq 0x18(%rsp), %rax
movq (%rax), %rdi
movq 0x18(%rsp), %rsi
addq $0x10, %rsi
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdx
addq $0x2, %rdx
shlq $0x0, %rdx
callq 0x7f2b0
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
movb 0xb(%rsp), %dl
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rsp), %rsi
movq 0x8(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x8(%rsi)
movb %dl, (%rax,%rcx)
jmp 0x19e5a
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)