// File: /workspace/github_cpp_makefile_star2_O3/ef-gy[P]libefgy/src/test-case/unit.cpp
// Function: testUnitMetric(std::ostream&)
bool testUnitMetric(std::ostream &log) {
  metre<fraction>::unit one(fraction(1));

  if (one != fraction(1)) {
    log << "variable did not have the expected value after initialisation\n";
    return false;
  }

  metre<fraction>::milli onem = one;

  if (onem == one) {
    log << "value in ::milli should not have been the same as the unit value\n";
    return false;
  }

  if (onem < one) {
    log << "value in ::milli should be larger than the unit value\n";
    return false;
  }

  metre<fraction>::unit oneu = onem;

  if (oneu != one) {
    log << "value before and after converting should have been the same\n";
    return false;
  }

  metre<fraction>::micro onemi = onem;

  if (onemi == onem) {
    log << "value in ::micro should not have been the same as the ::milli "
           "value\n";
    return false;
  }

  if (onemi < onem) {
    log << "value in ::micro should be larger than the ::milli value\n";
    return false;
  }

  if (metre<fraction>::milli(onemi) != onem) {
    log << "value in ::micro should be the same in ::milli after conversion\n";
    return false;
  }

  if (onem != metre<fraction>::milli(fraction(1000))) {
    log << "value should have been precisely 1000\n";
    return false;
  }

  if (onemi != metre<fraction>::micro(fraction(1000000))) {
    log << "value should have been precisely 1000000\n";
    return false;
  }

  if (metre<fraction>::milli(onemi) != metre<fraction>::milli(fraction(1000))) {
    log << "value should have been precisely 1000\n";
    return false;
  }

  metre<fraction>::mega oneM = one;

  if (oneM == one) {
    log << "value in ::mega should not have been the same as the unit value\n";
    return false;
  }

  if (oneM > one) {
    log << "value in ::mega should be smaller than the unit value\n";
    return false;
  }

  if (oneM != metre<fraction>::mega(fraction(1, 1000000))) {
    log << "value should have been precisely 1/1000000\n";
    return false;
  }

  return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl $0x1, %r12d
movq %rsp, %rdi
movq %r12, (%rdi)
movq %r12, 0x8(%rdi)
callq 0x13bda
movq %rax, %r14
movq %rdx, %r15
cmpq %r12, %rax
jne 0x4ca5
cmpq $0x1, %r15
jne 0x4cc6
leaq 0x1047f(%rip), %rsi     # 0x1511a
movl $0x41, %edx
jmp 0x4e05
testq %r14, %r14
sets %al
cmpq %r14, %r15
setg %cl
orb %al, %cl
je 0x4cc8
leaq 0x104a0(%rip), %rsi     # 0x1515c
movl $0x36, %edx
jmp 0x4e05
jg 0x4cb5
movq %rsp, %rdi
movq %r14, (%rdi)
movq %r15, 0x8(%rdi)
callq 0x13c8c
xorq $0x1, %rax
xorq $0x1, %rdx
orq %rax, %rdx
jne 0x4d14
movq %rsp, %rdi
movq %r14, (%rdi)
movq %r15, 0x8(%rdi)
callq 0x13bda
movq %rax, %r12
movq %rdx, %r13
cmpq %r14, %rax
jne 0x4d25
cmpq %r15, %r13
jne 0x4d2a
leaq 0x104c6(%rip), %rsi     # 0x151d0
movl $0x44, %edx
jmp 0x4e05
leaq 0x10478(%rip), %rsi     # 0x15193
movl $0x3c, %edx
jmp 0x4e05
testq %r12, %r12
js 0x4d3d
movq %r13, %rax
imulq %r14, %rax
movq %r12, %rcx
imulq %r15, %rcx
cmpq %rcx, %rax
jle 0x4d4e
leaq 0x104d1(%rip), %rsi     # 0x15215
movl $0x39, %edx
jmp 0x4e05
movq %rsp, %rdi
movq %r12, (%rdi)
movq %r13, 0x8(%rdi)
callq 0x13c8c
xorq %r14, %rax
xorq %r15, %rdx
orq %rax, %rdx
jne 0x4ddd
xorq $0x3e8, %r14            # imm = 0x3E8
xorq $0x1, %r15
orq %r14, %r15
jne 0x4deb
xorq $0xf4240, %r12          # imm = 0xF4240
xorq $0x1, %r13
orq %r12, %r13
jne 0x4df9
movq %rsp, %rdi
movq $0xf4240, (%rdi)        # imm = 0xF4240
movq $0x1, 0x8(%rdi)
callq 0x13c8c
xorq $0x3e8, %rax            # imm = 0x3E8
xorq $0x1, %rdx
orq %rax, %rdx
jne 0x4deb
movl $0x1, %r12d
movq %rsp, %rdi
movq %r12, (%rdi)
movq %r12, 0x8(%rdi)
callq 0x13cde
movq %rax, %r15
movq %rdx, %r14
cmpq %r12, %rax
jne 0x4e1d
cmpq $0x1, %r14
jne 0x4e39
leaq 0x10506(%rip), %rsi     # 0x152e1
jmp 0x4de4
leaq 0x1046b(%rip), %rsi     # 0x1524f
movl $0x40, %edx
jmp 0x4e05
leaq 0x1049e(%rip), %rsi     # 0x15290
movl $0x26, %edx
jmp 0x4e05
leaq 0x104b7(%rip), %rsi     # 0x152b7
movl $0x29, %edx
movq %rbx, %rdi
callq 0x42b0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
testq %r15, %r15
setns %al
cmpq %r14, %r15
setg %cl
testb %cl, %al
je 0x4e3b
leaq 0x104ee(%rip), %rsi     # 0x15322
jmp 0x4cbc
jl 0x4e2d
movq %rsp, %r12
movq $0x1, (%r12)
movq $0xf4240, 0x8(%r12)     # imm = 0xF4240
movq %r12, %rdi
callq 0x13d6a
cmpq (%r12), %r15
jne 0x4e66
movb $0x1, %al
cmpq 0x8(%rsp), %r14
je 0x4e0f
leaq 0x104ec(%rip), %rsi     # 0x15359
movl $0x2b, %edx
jmp 0x4e05