// File: halfflat[P]tinyopt/test/googletest/googletest/include/gtest/gtest-printers.h
// Function: int testing::internal::AppropriateResolution<double>(double)
int AppropriateResolution(FloatType val) {
  int full = std::numeric_limits<FloatType>::max_digits10;
  if (val < 0) val = -val;

#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
#endif
  if (val < 1000000) {
    FloatType mulfor6 = 1e10;
    // Without these static casts, the template instantiation for float would
    // fail to compile when -Wdouble-promotion is enabled, as the arithmetic and
    // comparison logic would promote floats to doubles.
    if (val >= static_cast<FloatType>(100000.0)) {  // 100,000 to 999,999
      mulfor6 = 1.0;
    } else if (val >= static_cast<FloatType>(10000.0)) {
      mulfor6 = 1e1;
    } else if (val >= static_cast<FloatType>(1000.0)) {
      mulfor6 = 1e2;
    } else if (val >= static_cast<FloatType>(100.0)) {
      mulfor6 = 1e3;
    } else if (val >= static_cast<FloatType>(10.0)) {
      mulfor6 = 1e4;
    } else if (val >= static_cast<FloatType>(1.0)) {
      mulfor6 = 1e5;
    } else if (val >= static_cast<FloatType>(0.1)) {
      mulfor6 = 1e6;
    } else if (val >= static_cast<FloatType>(0.01)) {
      mulfor6 = 1e7;
    } else if (val >= static_cast<FloatType>(0.001)) {
      mulfor6 = 1e8;
    } else if (val >= static_cast<FloatType>(0.0001)) {
      mulfor6 = 1e9;
    }
    if (static_cast<FloatType>(static_cast<int32_t>(
            val * mulfor6 + (static_cast<FloatType>(0.5)))) /
            mulfor6 ==
        val)
      return 6;
  } else if (val < static_cast<FloatType>(1e10)) {
    FloatType divfor6 = static_cast<FloatType>(1.0);
    if (val >= static_cast<FloatType>(1e9)) {  // 1,000,000,000 to 9,999,999,999
      divfor6 = 10000;
    } else if (val >=
               static_cast<FloatType>(1e8)) {  // 100,000,000 to 999,999,999
      divfor6 = 1000;
    } else if (val >=
               static_cast<FloatType>(1e7)) {  // 10,000,000 to 99,999,999
      divfor6 = 100;
    } else if (val >= static_cast<FloatType>(1e6)) {  // 1,000,000 to 9,999,999
      divfor6 = 10;
    }
    if (static_cast<FloatType>(static_cast<int32_t>(
            val / divfor6 + (static_cast<FloatType>(0.5)))) *
            divfor6 ==
        val)
      return 6;
  }
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
  return full;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movsd %xmm0, -0x10(%rbp)
movl $0x11, -0x14(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x10(%rbp), %xmm0
jbe 0x22c7b
movsd -0x10(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x10(%rbp)
movsd 0xa56c5(%rip), %xmm0    # 0xc8348
ucomisd -0x10(%rbp), %xmm0
jbe 0x22e52
movsd 0xa56ba(%rip), %xmm0    # 0xc8350
movsd %xmm0, -0x20(%rbp)
movsd -0x10(%rbp), %xmm0
movsd 0xa56f0(%rip), %xmm1    # 0xc8398
ucomisd %xmm1, %xmm0
jb 0x22cc0
movsd 0xa5682(%rip), %xmm0    # 0xc8338
movsd %xmm0, -0x20(%rbp)
jmp 0x22e11
movsd -0x10(%rbp), %xmm0
movsd 0xa56bb(%rip), %xmm1    # 0xc8388
ucomisd %xmm1, %xmm0
jb 0x22ce5
movsd 0xa5695(%rip), %xmm0    # 0xc8370
movsd %xmm0, -0x20(%rbp)
jmp 0x22e0f
movsd -0x10(%rbp), %xmm0
movsd 0xa568e(%rip), %xmm1    # 0xc8380
ucomisd %xmm1, %xmm0
jb 0x22d0a
movsd 0xa5678(%rip), %xmm0    # 0xc8378
movsd %xmm0, -0x20(%rbp)
jmp 0x22e0d
movsd -0x10(%rbp), %xmm0
movsd 0xa5661(%rip), %xmm1    # 0xc8378
ucomisd %xmm1, %xmm0
jb 0x22d2f
movsd 0xa565b(%rip), %xmm0    # 0xc8380
movsd %xmm0, -0x20(%rbp)
jmp 0x22e0b
movsd -0x10(%rbp), %xmm0
movsd 0xa5634(%rip), %xmm1    # 0xc8370
ucomisd %xmm1, %xmm0
jb 0x22d54
movsd 0xa563e(%rip), %xmm0    # 0xc8388
movsd %xmm0, -0x20(%rbp)
jmp 0x22e09
movsd -0x10(%rbp), %xmm0
movsd 0xa55d7(%rip), %xmm1    # 0xc8338
ucomisd %xmm1, %xmm0
jb 0x22d79
movsd 0xa5629(%rip), %xmm0    # 0xc8398
movsd %xmm0, -0x20(%rbp)
jmp 0x22e07
movsd -0x10(%rbp), %xmm0
movsd 0xa561a(%rip), %xmm1    # 0xc83a0
ucomisd %xmm1, %xmm0
jb 0x22d9b
movsd 0xa55b4(%rip), %xmm0    # 0xc8348
movsd %xmm0, -0x20(%rbp)
jmp 0x22e05
movsd -0x10(%rbp), %xmm0
movsd 0xa5600(%rip), %xmm1    # 0xc83a8
ucomisd %xmm1, %xmm0
jb 0x22dbd
movsd 0xa55b2(%rip), %xmm0    # 0xc8368
movsd %xmm0, -0x20(%rbp)
jmp 0x22e03
movsd -0x10(%rbp), %xmm0
movsd 0xa55e6(%rip), %xmm1    # 0xc83b0
ucomisd %xmm1, %xmm0
jb 0x22ddf
movsd 0xa5588(%rip), %xmm0    # 0xc8360
movsd %xmm0, -0x20(%rbp)
jmp 0x22e01
movsd -0x10(%rbp), %xmm0
movsd 0xa55cc(%rip), %xmm1    # 0xc83b8
ucomisd %xmm1, %xmm0
jb 0x22dff
movsd 0xa555e(%rip), %xmm0    # 0xc8358
movsd %xmm0, -0x20(%rbp)
jmp 0x22e01
jmp 0x22e03
jmp 0x22e05
jmp 0x22e07
jmp 0x22e09
jmp 0x22e0b
jmp 0x22e0d
jmp 0x22e0f
jmp 0x22e11
movsd -0x10(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0xa5569(%rip), %xmm1    # 0xc8390
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
cvtsi2sd %eax, %xmm0
divsd -0x20(%rbp), %xmm0
ucomisd -0x10(%rbp), %xmm0
jne 0x22e4d
jp 0x22e4d
movl $0x6, -0x4(%rbp)
jmp 0x22f3d
jmp 0x22f37
movsd 0xa54f6(%rip), %xmm0    # 0xc8350
ucomisd -0x10(%rbp), %xmm0
jbe 0x22f35
movsd 0xa54cb(%rip), %xmm0    # 0xc8338
movsd %xmm0, -0x28(%rbp)
movsd -0x10(%rbp), %xmm0
movsd 0xa54d9(%rip), %xmm1    # 0xc8358
ucomisd %xmm1, %xmm0
jb 0x22e94
movsd 0xa54fb(%rip), %xmm0    # 0xc8388
movsd %xmm0, -0x28(%rbp)
jmp 0x22efe
movsd -0x10(%rbp), %xmm0
movsd 0xa54bf(%rip), %xmm1    # 0xc8360
ucomisd %xmm1, %xmm0
jb 0x22eb6
movsd 0xa54d1(%rip), %xmm0    # 0xc8380
movsd %xmm0, -0x28(%rbp)
jmp 0x22efc
movsd -0x10(%rbp), %xmm0
movsd 0xa54a5(%rip), %xmm1    # 0xc8368
ucomisd %xmm1, %xmm0
jb 0x22ed8
movsd 0xa54a7(%rip), %xmm0    # 0xc8378
movsd %xmm0, -0x28(%rbp)
jmp 0x22efa
movsd -0x10(%rbp), %xmm0
movsd 0xa5463(%rip), %xmm1    # 0xc8348
ucomisd %xmm1, %xmm0
jb 0x22ef8
movsd 0xa547d(%rip), %xmm0    # 0xc8370
movsd %xmm0, -0x28(%rbp)
jmp 0x22efa
jmp 0x22efc
jmp 0x22efe
movsd -0x10(%rbp), %xmm0
divsd -0x28(%rbp), %xmm0
movsd 0xa5480(%rip), %xmm1    # 0xc8390
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
cvtsi2sd %eax, %xmm0
mulsd -0x28(%rbp), %xmm0
ucomisd -0x10(%rbp), %xmm0
jne 0x22f33
jp 0x22f33
movl $0x6, -0x4(%rbp)
jmp 0x22f3d
jmp 0x22f35
jmp 0x22f37
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)