// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/parseutils.c
// Function: parse_range
static int parse_range(GtRange *range, const char *start, const char *end,
                       unsigned int line_number, const char *filename,
                       bool tidy, bool correct_negative, GtError *err)
{
  GtWord start_val, end_val;
  char *ep;

  gt_assert(start && end && filename);
  gt_error_check(err);

  range->start = GT_UNDEF_UWORD;
  range->end = GT_UNDEF_UWORD;

  /* parse and check start */
  errno = 0;
  start_val = strtol(start, &ep, 10);
  if (start[0] == '\0' || *ep != '\0') {
    gt_error_set(err, "could not parse number '%s' on line %u in file '%s'",
                 start, line_number, filename);
    return -1;
  }
  if (errno == ERANGE && (start_val == LONG_MAX || start_val == LONG_MIN)) {
    gt_error_set(err, "number '%s' out of range on line %u in file '%s'", start,
                 line_number, filename);
    return -1;
  }
  if (start_val < 0) {
    if (tidy || correct_negative) {
      gt_warning("start '%s' is negative on line %u in file '%s'; reset to 1",
                 start, line_number, filename);
      start_val = 1;
    }
    else {
      gt_error_set(err, "start '%s' is negative on line %u in file '%s'", start,
                   line_number, filename);
      return -1;
    }
  }
  if (start_val == 0 && tidy) {
    gt_warning("start '%s' is zero on line %u in file '%s' (GFF3 files are "
               "1-based); reset to 1", start, line_number, filename);
    start_val = 1;
  }

  /* parse and check end */
  errno = 0;
  end_val = strtol(end, &ep, 10);
  if (end[0] == '\0' || *ep != '\0') {
    gt_error_set(err, "could not parse number '%s' on line %u in file '%s'",
                 end, line_number, filename);
    return -1;
  }
  if (errno == ERANGE && (end_val == LONG_MAX || end_val == LONG_MIN)) {
    gt_error_set(err, "number '%s' out of range on line %u in file '%s'", end,
                 line_number, filename);
    return -1;
  }
  if (end_val < 0) {
    if (tidy || correct_negative) {
      gt_warning("end '%s' is negative on line %u in file '%s'; reset to 1",
                 end, line_number, filename);
      end_val = 1;
    }
    else {
      gt_error_set(err, "end '%s' is negative on line %u in file '%s'", end,
                   line_number, filename);
      return -1;
    }
  }
  if (end_val == 0 && tidy) {
    gt_warning("end '%s' is zero on line %u in file '%s' (GFF3 files are "
               "1-based); reset to 1", end, line_number, filename);
    end_val = 1;
  }

  /* check range */
  if (start_val > end_val) {
    if (tidy) {
      long tmp_val;
      gt_warning("start '" GT_WU "' is larger then end '" GT_WU "' on line %u "
                 "in file '%s'; swap them", start_val, end_val, line_number,
                 filename);
      tmp_val = start_val;
      start_val = end_val;
      end_val = tmp_val;
    }
    else {
      gt_error_set(err, "start '" GT_WU "' is larger then end '" GT_WU "' on "
                   "line %u in file '%s'", start_val, end_val, line_number,
                   filename);
      return -1;
    }
  }

  /* set result */
  range->start = start_val;
  range->end = end_val;

  return 0;
}

// Assembly:
subq $0x78, %rsp
movl %r9d, %eax
movl %ecx, 0xc(%rsp)
movq %rdx, %rcx
movl 0xc(%rsp), %edx
movq %rcx, 0x10(%rsp)
movq %rsi, %rcx
movq 0x10(%rsp), %rsi
movq %rcx, 0x18(%rsp)
movq %rdi, %r9
movq 0x18(%rsp), %rdi
movb %al, %cl
movq 0x88(%rsp), %rax
movb 0x80(%rsp), %al
movq %r9, 0x68(%rsp)
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movl %edx, 0x54(%rsp)
movq %r8, 0x48(%rsp)
andb $0x1, %cl
movb %cl, 0x47(%rsp)
andb $0x1, %al
movb %al, 0x46(%rsp)
cmpq $0x0, 0x60(%rsp)
je 0x1584a
cmpq $0x0, 0x58(%rsp)
je 0x1584a
cmpq $0x0, 0x48(%rsp)
jne 0x15882
movq 0x19e787(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x14880b(%rip), %rsi    # 0x15e066
leaq 0x14a47c(%rip), %rdx    # 0x15fcde
leaq 0x14a48e(%rip), %rcx    # 0x15fcf7
leaq 0x14a1c1(%rip), %r8     # 0x15fa31
movl $0x7b, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x15884
jmp 0x15886
cmpq $0x0, 0x88(%rsp)
je 0x158dc
movq 0x88(%rsp), %rdi
callq 0xc270
testb $0x1, %al
jne 0x158a4
jmp 0x158dc
movq 0x19e72d(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x1487b1(%rip), %rsi    # 0x15e066
leaq 0x148d8c(%rip), %rdx    # 0x15e648
leaq 0x14a434(%rip), %rcx    # 0x15fcf7
leaq 0x14a167(%rip), %r8     # 0x15fa31
movl $0x7c, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x158de
movq 0x68(%rsp), %rax
movq $-0x1, (%rax)
movq 0x68(%rsp), %rax
movq $-0x1, 0x8(%rax)
callq 0xb060
movl $0x0, (%rax)
movq 0x60(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movl $0xa, %edx
callq 0xb860
movq %rax, 0x38(%rsp)
movq 0x60(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x15935
movq 0x28(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x15966
movq 0x88(%rsp), %rdi
movq 0x60(%rsp), %rdx
movl 0x54(%rsp), %ecx
movq 0x48(%rsp), %r8
leaq 0x14a3b1(%rip), %rsi    # 0x15fd03
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
jmp 0x15c84
callq 0xb060
cmpl $0x22, (%rax)
jne 0x159c3
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
cmpq %rax, 0x38(%rsp)
je 0x15992
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
cmpq %rax, 0x38(%rsp)
jne 0x159c3
movq 0x88(%rsp), %rdi
movq 0x60(%rsp), %rdx
movl 0x54(%rsp), %ecx
movq 0x48(%rsp), %r8
leaq 0x14a388(%rip), %rsi    # 0x15fd37
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
jmp 0x15c84
cmpq $0x0, 0x38(%rsp)
jge 0x15a33
testb $0x1, 0x47(%rsp)
jne 0x159d9
testb $0x1, 0x46(%rsp)
je 0x15a00
movq 0x60(%rsp), %rsi
movl 0x54(%rsp), %edx
movq 0x48(%rsp), %rcx
leaq 0x14a37a(%rip), %rdi    # 0x15fd68
movb $0x0, %al
callq 0x1c550
movq $0x1, 0x38(%rsp)
jmp 0x15a31
movq 0x88(%rsp), %rdi
movq 0x60(%rsp), %rdx
movl 0x54(%rsp), %ecx
movq 0x48(%rsp), %r8
leaq 0x14a386(%rip), %rsi    # 0x15fda3
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
jmp 0x15c84
jmp 0x15a33
cmpq $0x0, 0x38(%rsp)
jne 0x15a67
testb $0x1, 0x47(%rsp)
je 0x15a67
movq 0x60(%rsp), %rsi
movl 0x54(%rsp), %edx
movq 0x48(%rsp), %rcx
leaq 0x14a37b(%rip), %rdi    # 0x15fdd2
movb $0x0, %al
callq 0x1c550
movq $0x1, 0x38(%rsp)
callq 0xb060
movl $0x0, (%rax)
movq 0x58(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movl $0xa, %edx
callq 0xb860
movq %rax, 0x30(%rsp)
movq 0x58(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x15aa5
movq 0x28(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x15ad6
movq 0x88(%rsp), %rdi
movq 0x58(%rsp), %rdx
movl 0x54(%rsp), %ecx
movq 0x48(%rsp), %r8
leaq 0x14a241(%rip), %rsi    # 0x15fd03
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
jmp 0x15c84
callq 0xb060
cmpl $0x22, (%rax)
jne 0x15b33
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
cmpq %rax, 0x30(%rsp)
je 0x15b02
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
cmpq %rax, 0x30(%rsp)
jne 0x15b33
movq 0x88(%rsp), %rdi
movq 0x58(%rsp), %rdx
movl 0x54(%rsp), %ecx
movq 0x48(%rsp), %r8
leaq 0x14a218(%rip), %rsi    # 0x15fd37
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
jmp 0x15c84
cmpq $0x0, 0x30(%rsp)
jge 0x15ba3
testb $0x1, 0x47(%rsp)
jne 0x15b49
testb $0x1, 0x46(%rsp)
je 0x15b70
movq 0x58(%rsp), %rsi
movl 0x54(%rsp), %edx
movq 0x48(%rsp), %rcx
leaq 0x14a2c4(%rip), %rdi    # 0x15fe22
movb $0x0, %al
callq 0x1c550
movq $0x1, 0x30(%rsp)
jmp 0x15ba1
movq 0x88(%rsp), %rdi
movq 0x58(%rsp), %rdx
movl 0x54(%rsp), %ecx
movq 0x48(%rsp), %r8
leaq 0x14a2ce(%rip), %rsi    # 0x15fe5b
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
jmp 0x15c84
jmp 0x15ba3
cmpq $0x0, 0x30(%rsp)
jne 0x15bd7
testb $0x1, 0x47(%rsp)
je 0x15bd7
movq 0x58(%rsp), %rsi
movl 0x54(%rsp), %edx
movq 0x48(%rsp), %rcx
leaq 0x14a2c1(%rip), %rdi    # 0x15fe88
movb $0x0, %al
callq 0x1c550
movq $0x1, 0x30(%rsp)
movq 0x38(%rsp), %rax
cmpq 0x30(%rsp), %rax
jle 0x15c61
testb $0x1, 0x47(%rsp)
je 0x15c2b
movq 0x38(%rsp), %rsi
movq 0x30(%rsp), %rdx
movl 0x54(%rsp), %ecx
movq 0x48(%rsp), %r8
leaq 0x14a2d2(%rip), %rdi    # 0x15fed6
movb $0x0, %al
callq 0x1c550
movq 0x38(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x15c5f
movq 0x88(%rsp), %rdi
movq 0x38(%rsp), %rdx
movq 0x30(%rsp), %rcx
movl 0x54(%rsp), %r8d
movq 0x48(%rsp), %r9
leaq 0x14a2d0(%rip), %rsi    # 0x15ff1e
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
jmp 0x15c84
jmp 0x15c61
movq 0x38(%rsp), %rcx
movq 0x68(%rsp), %rax
movq %rcx, (%rax)
movq 0x30(%rsp), %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x8(%rax)
movl $0x0, 0x74(%rsp)
movl 0x74(%rsp), %eax
addq $0x78, %rsp
retq
nopl (%rax)