// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/core/mathsupport.c
// Function: gt_mathsupport_unit_test
int gt_mathsupport_unit_test(GtError *err)
{
  int had_err = 0;
  GtUword i;
  double less_than_epsilon = 0.0000000000000001;
  gt_error_check(err);

  gt_ensure(!gt_double_equals_one(1.1));
  gt_ensure(gt_double_equals_one(1));
  gt_ensure(gt_double_equals_one(1+less_than_epsilon));
  gt_ensure(!gt_double_equals_one(-1-less_than_epsilon));

  gt_ensure(!gt_double_equals_double(1.0, 2.0));
  gt_ensure(!gt_double_equals_double(-1.0, 1.0));
  gt_ensure(!gt_double_equals_double(1.0, -1.0));
  gt_ensure(!gt_double_equals_double(-1.0, 1+less_than_epsilon));
  gt_ensure(!gt_double_equals_double(1.0, 1.1));
  gt_ensure(gt_double_equals_double(1.0, 1+less_than_epsilon));
  gt_ensure(gt_double_equals_double(1.0, 1.0));
  gt_ensure(gt_double_equals_double(0.0, 0.0));
  gt_ensure(gt_double_equals_double(-1.0, -1.0));
  gt_ensure(gt_double_equals_double(-1.0+less_than_epsilon, -1.0));
  gt_ensure(gt_double_equals_double(-1.0, -1.0+less_than_epsilon));
  gt_ensure(gt_double_equals_double(1.0+less_than_epsilon, 1.0));
  gt_ensure(gt_double_equals_double(1.0, 1.0+less_than_epsilon));

  gt_ensure(gt_double_compare(1.0, 1.0) == 0);
  gt_ensure(gt_double_compare(1.0, 1.1) < 0);
  gt_ensure(gt_double_compare(1.1, 1.0) > 0);
  gt_ensure(gt_double_compare(1.1, -1.0) > 0);
  gt_ensure(gt_double_compare(-1.1, -1.0) < 0);
  gt_ensure(gt_double_compare(1+less_than_epsilon, 1.0) == 0);
  gt_ensure(gt_double_compare(1+less_than_epsilon, -1.0) > 0);
  gt_ensure(gt_double_compare(-1+less_than_epsilon, -1.0) == 0);
  gt_ensure(gt_double_compare(-1+less_than_epsilon, 1.0) < 0);

  gt_ensure(gt_double_smaller_double(1.0, 1.1));
  gt_ensure(gt_double_smaller_double(-1.0, 1.1));
  gt_ensure(gt_double_smaller_double(-1.1, -1.0));
  gt_ensure(!gt_double_smaller_double(-1.0, -1.1));
  gt_ensure(!gt_double_smaller_double(1.0-less_than_epsilon, 1.0));

  gt_ensure(0L == gt_round_to_long(0.5));
  gt_ensure(1L == gt_round_to_long(0.51));
  gt_ensure(-1L == gt_round_to_long(-0.51));
  gt_ensure(0L == gt_round_to_long(-0.5));
  gt_ensure(-2L == gt_round_to_long(-1.5));
  gt_ensure(-2L == gt_round_to_long(-2.5));
  gt_ensure(-3L == gt_round_to_long(-2.51));

  for (i = 0; !had_err && i < GT_MAXLOG2VALUE; ++i) {
    gt_ensure(i+1 == gt_determinebitspervalue(1UL << i));
    gt_ensure((GtWord) i == gt_round_to_long(
               gt_log_base((double) (1UL << i), (double) 2.0)));
  }
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rdi, %rdi
je 0x7a592
movq %rbx, %rdi
callq 0x3566a
testb %al, %al
jne 0x7a670
xorl %r14d, %r14d
leaq 0x7756e(%rip), %r13     # 0xf1b0a
leaq 0x77409(%rip), %rbp     # 0xf19ac
leaq 0x1(%r14), %r15
movl $0x1, %r12d
movl %r14d, %ecx
shlq %cl, %r12
movq %r12, %rdi
callq 0x7a294
movl %eax, %eax
cmpq %rax, %r15
jne 0x7a601
movq %r12, %xmm1
punpckldq 0x66eb1(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x66eb9(%rip), %xmm1    # 0xe1490
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
callq 0xb4d0
divsd 0x773a8(%rip), %xmm0    # 0xf1998
callq 0x7a3a3
cmpq %rax, %r14
jne 0x7a623
xorl %eax, %eax
movb $0x1, %r12b
jmp 0x7a64f
xorl %r12d, %r12d
movq %rbx, %rdi
leaq 0x68b6b(%rip), %rsi     # 0xe3179
leaq 0x7750e(%rip), %rdx     # 0xf1b23
movq %r13, %rcx
movq %rbp, %r8
movl $0x143, %r9d            # imm = 0x143
jmp 0x7a643
xorl %r12d, %r12d
movq %rbx, %rdi
leaq 0x68b49(%rip), %rsi     # 0xe3179
leaq 0x77516(%rip), %rdx     # 0xf1b4d
movq %r13, %rcx
movq %rbp, %r8
movl $0x145, %r9d            # imm = 0x145
xorl %eax, %eax
callq 0x3559f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb %r12b, %r12b
je 0x7a661
cmpq $0x3e, %r14
movq %r15, %r14
jb 0x7a5a3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1cd38
nopl (%rax)