// File: halfflat[P]tinyopt/test/googletest/googletest/src/gtest.cc
// Function: testing::internal::DoubleNearPredFormat(char const*, char const*, char const*, double, double, double)
AssertionResult DoubleNearPredFormat(const char* expr1, const char* expr2,
                                     const char* abs_error_expr, double val1,
                                     double val2, double abs_error) {
  const double diff = fabs(val1 - val2);
  if (diff <= abs_error) return AssertionSuccess();

  // Find the value which is closest to zero.
  const double min_abs = std::min(fabs(val1), fabs(val2));
  // Find the distance to the next double from that value.
  const double epsilon =
      nextafter(min_abs, std::numeric_limits<double>::infinity()) - min_abs;
  // Detect the case where abs_error is so small that EXPECT_NEAR is
  // effectively the same as EXPECT_EQUAL, and give an informative error
  // message so that the situation can be more easily understood without
  // requiring exotic floating-point knowledge.
  // Don't do an epsilon check if abs_error is zero because that implies
  // that an equality check was actually intended.
  if (!(std::isnan)(val1) && !(std::isnan)(val2) && abs_error > 0 &&
      abs_error < epsilon) {
    return AssertionFailure()
           << "The difference between " << expr1 << " and " << expr2 << " is "
           << diff << ", where\n"
           << expr1 << " evaluates to " << val1 << ",\n"
           << expr2 << " evaluates to " << val2 << ".\nThe abs_error parameter "
           << abs_error_expr << " evaluates to " << abs_error
           << " which is smaller than the minimum distance between doubles for "
              "numbers of this magnitude which is "
           << epsilon
           << ", thus making this EXPECT_NEAR check equivalent to "
              "EXPECT_EQUAL. Consider using EXPECT_DOUBLE_EQ instead.";
  }
  return AssertionFailure()
         << "The difference between " << expr1 << " and " << expr2 << " is "
         << diff << ", which exceeds " << abs_error_expr << ", where\n"
         << expr1 << " evaluates to " << val1 << ",\n"
         << expr2 << " evaluates to " << val2 << ", and\n"
         << abs_error_expr << " evaluates to " << abs_error << ".";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x210, %rsp            # imm = 0x210
movq %rdi, -0xa0(%rbp)
movq %rdi, %rax
movq %rax, -0x98(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movsd %xmm0, -0x28(%rbp)
movsd %xmm1, -0x30(%rbp)
movsd %xmm2, -0x38(%rbp)
movsd -0x28(%rbp), %xmm0
subsd -0x30(%rbp), %xmm0
movaps 0x47834(%rip), %xmm1    # 0xcd890
pand %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x40(%rbp), %xmm1
movsd -0x38(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x86086
movq -0xa0(%rbp), %rdi
callq 0x75c30
jmp 0x86635
movsd -0x28(%rbp), %xmm0
movaps 0x477fe(%rip), %xmm1    # 0xcd890
pand %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x30(%rbp), %xmm0
movaps 0x477e9(%rip), %xmm1    # 0xcd890
pand %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0xa5ed0
movsd (%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0xa8(%rbp)
callq 0xa5f10
movaps %xmm0, %xmm1
movsd -0xa8(%rbp), %xmm0
callq 0x10540
subsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x28(%rbp), %xmm0
callq 0xa5f20
testb $0x1, %al
jne 0x863b7
movsd -0x30(%rbp), %xmm0
callq 0xa5f20
testb $0x1, %al
jne 0x863b7
movsd -0x38(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x863b7
movsd -0x38(%rbp), %xmm1
movsd -0x60(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x863b7
leaq -0x70(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x75c60
movq -0xb8(%rbp), %rdi
leaq 0x483e5(%rip), %rsi     # 0xce53f
callq 0xa5f40
movq %rax, -0xb0(%rbp)
jmp 0x86168
movq -0xb0(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0xa5fc0
movq %rax, -0xc0(%rbp)
jmp 0x86181
movq -0xc0(%rbp), %rdi
leaq 0x483c8(%rip), %rsi     # 0xce557
callq 0xa6040
movq %rax, -0xc8(%rbp)
jmp 0x8619d
movq -0xc8(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0xa5fc0
movq %rax, -0xd0(%rbp)
jmp 0x861b6
movq -0xd0(%rbp), %rdi
leaq 0x4842b(%rip), %rsi     # 0xce5ef
callq 0xa60c0
movq %rax, -0xd8(%rbp)
jmp 0x861d2
movq -0xd8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0xa6140
movq %rax, -0xe0(%rbp)
jmp 0x861eb
movq -0xe0(%rbp), %rdi
leaq 0x48364(%rip), %rsi     # 0xce55d
callq 0xa61c0
movq %rax, -0xe8(%rbp)
jmp 0x86207
movq -0xe8(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0xa5fc0
movq %rax, -0xf0(%rbp)
jmp 0x86220
movq -0xf0(%rbp), %rdi
leaq 0x48338(%rip), %rsi     # 0xce566
callq 0xa6240
movq %rax, -0xf8(%rbp)
jmp 0x8623c
movq -0xf8(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0xa6140
movq %rax, -0x100(%rbp)
jmp 0x86255
movq -0x100(%rbp), %rdi
leaq 0x48e6c(%rip), %rsi     # 0xcf0cf
callq 0xa62c0
movq %rax, -0x108(%rbp)
jmp 0x86271
movq -0x108(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0xa5fc0
movq %rax, -0x110(%rbp)
jmp 0x8628a
movq -0x110(%rbp), %rdi
leaq 0x482ce(%rip), %rsi     # 0xce566
callq 0xa6240
movq %rax, -0x118(%rbp)
jmp 0x862a6
movq -0x118(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0xa6140
movq %rax, -0x120(%rbp)
jmp 0x862bf
movq -0x120(%rbp), %rdi
leaq 0x482a8(%rip), %rsi     # 0xce575
callq 0xa6340
movq %rax, -0x128(%rbp)
jmp 0x862db
movq -0x128(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0xa5fc0
movq %rax, -0x130(%rbp)
jmp 0x862f4
movq -0x130(%rbp), %rdi
leaq 0x48264(%rip), %rsi     # 0xce566
callq 0xa6240
movq %rax, -0x138(%rbp)
jmp 0x86310
movq -0x138(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0xa6140
movq %rax, -0x140(%rbp)
jmp 0x86329
movq -0x140(%rbp), %rdi
leaq 0x48259(%rip), %rsi     # 0xce590
callq 0xa63c0
movq %rax, -0x148(%rbp)
jmp 0x86345
movq -0x148(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0xa6140
movq %rax, -0x150(%rbp)
jmp 0x8635e
movq -0x150(%rbp), %rdi
leaq 0x48288(%rip), %rsi     # 0xce5f4
callq 0xa6440
movq %rax, -0x158(%rbp)
jmp 0x8637a
movq -0x158(%rbp), %rsi
movq -0xa0(%rbp), %rdi
callq 0x75a60
jmp 0x8638f
leaq -0x70(%rbp), %rdi
callq 0x1d520
jmp 0x86635
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x1d520
jmp 0x86645
leaq -0x90(%rbp), %rdi
movq %rdi, -0x168(%rbp)
callq 0x75c60
movq -0x168(%rbp), %rdi
leaq 0x48167(%rip), %rsi     # 0xce53f
callq 0xa5f40
movq %rax, -0x160(%rbp)
jmp 0x863e6
movq -0x160(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0xa5fc0
movq %rax, -0x170(%rbp)
jmp 0x863ff
movq -0x170(%rbp), %rdi
leaq 0x4814a(%rip), %rsi     # 0xce557
callq 0xa6040
movq %rax, -0x178(%rbp)
jmp 0x8641b
movq -0x178(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0xa5fc0
movq %rax, -0x180(%rbp)
jmp 0x86434
movq -0x180(%rbp), %rdi
leaq 0x481ad(%rip), %rsi     # 0xce5ef
callq 0xa60c0
movq %rax, -0x188(%rbp)
jmp 0x86450
movq -0x188(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0xa6140
movq %rax, -0x190(%rbp)
jmp 0x86469
movq -0x190(%rbp), %rdi
leaq 0x481e7(%rip), %rsi     # 0xce65e
callq 0xa64c0
movq %rax, -0x198(%rbp)
jmp 0x86485
movq -0x198(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0xa5fc0
movq %rax, -0x1a0(%rbp)
jmp 0x8649e
movq -0x1a0(%rbp), %rdi
leaq 0x480b1(%rip), %rsi     # 0xce55d
callq 0xa61c0
movq %rax, -0x1a8(%rbp)
jmp 0x864ba
movq -0x1a8(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0xa5fc0
movq %rax, -0x1b0(%rbp)
jmp 0x864d3
movq -0x1b0(%rbp), %rdi
leaq 0x48085(%rip), %rsi     # 0xce566
callq 0xa6240
movq %rax, -0x1b8(%rbp)
jmp 0x864ef
movq -0x1b8(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0xa6140
movq %rax, -0x1c0(%rbp)
jmp 0x86508
movq -0x1c0(%rbp), %rdi
leaq 0x48bb9(%rip), %rsi     # 0xcf0cf
callq 0xa62c0
movq %rax, -0x1c8(%rbp)
jmp 0x86524
movq -0x1c8(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0xa5fc0
movq %rax, -0x1d0(%rbp)
jmp 0x8653d
movq -0x1d0(%rbp), %rdi
leaq 0x4801b(%rip), %rsi     # 0xce566
callq 0xa6240
movq %rax, -0x1d8(%rbp)
jmp 0x86559
movq -0x1d8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0xa6140
movq %rax, -0x1e0(%rbp)
jmp 0x86572
movq -0x1e0(%rbp), %rdi
leaq 0x480ef(%rip), %rsi     # 0xce66f
callq 0xa6540
movq %rax, -0x1e8(%rbp)
jmp 0x8658e
movq -0x1e8(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0xa5fc0
movq %rax, -0x1f0(%rbp)
jmp 0x865a7
movq -0x1f0(%rbp), %rdi
leaq 0x47fb1(%rip), %rsi     # 0xce566
callq 0xa6240
movq %rax, -0x1f8(%rbp)
jmp 0x865c3
movq -0x1f8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0xa6140
movq %rax, -0x200(%rbp)
jmp 0x865dc
movq -0x200(%rbp), %rdi
leaq 0x43499(%rip), %rsi     # 0xc9a83
callq 0xa65c0
movq %rax, -0x208(%rbp)
jmp 0x865f8
movq -0x208(%rbp), %rsi
movq -0xa0(%rbp), %rdi
callq 0x75a60
jmp 0x8660d
leaq -0x90(%rbp), %rdi
callq 0x1d520
jmp 0x86635
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x1d520
jmp 0x86645
movq -0x98(%rbp), %rax
addq $0x210, %rsp            # imm = 0x210
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0x10e00
nop