// File: /workspace/github_cpp_makefile_star2_O1/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 0x13bdc
movq %rax, %r14
xorq %r12, %rax
xorq %rdx, %r12
orq %rax, %r12
jne 0x4ca2
leaq 0x10482(%rip), %rsi     # 0x1511a
movl $0x41, %edx
jmp 0x4d42
movq %rdx, %r15
testq %r14, %r14
sets %al
cmpq %r14, %rdx
setg %cl
orb %al, %cl
je 0x4cc3
leaq 0x104a0(%rip), %rsi     # 0x1515c
movl $0x36, %edx
jmp 0x4d42
movq %rsp, %rdi
movq %r14, (%rdi)
movq %r15, 0x8(%rdi)
callq 0x13c8e
xorq $0x1, %rax
xorq $0x1, %rdx
orq %rax, %rdx
jne 0x4d0d
movq %rsp, %rdi
movq %r14, (%rdi)
movq %r15, 0x8(%rdi)
callq 0x13bdc
movq %rax, %r12
xorq %r14, %rax
movq %rdx, %rcx
xorq %r15, %rcx
orq %rax, %rcx
jne 0x4d1b
leaq 0x104ca(%rip), %rsi     # 0x151d0
movl $0x44, %edx
jmp 0x4d42
leaq 0x1047f(%rip), %rsi     # 0x15193
movl $0x3c, %edx
jmp 0x4d42
testq %r12, %r12
js 0x4d36
movq %rdx, %r13
movq %rdx, %rax
imulq %r14, %rax
movq %r12, %rcx
imulq %r15, %rcx
cmpq %rcx, %rax
jle 0x4d5a
leaq 0x104d8(%rip), %rsi     # 0x15215
movl $0x39, %edx
movq %rbx, %rdi
callq 0x42b0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rsp, %rdi
movq %r12, (%rdi)
movq %r13, 0x8(%rdi)
callq 0x13c8e
xorq %r14, %rax
xorq %r15, %rdx
orq %rax, %rdx
jne 0x4de3
xorq $0x3e8, %r14            # imm = 0x3E8
xorq $0x1, %r15
orq %r14, %r15
jne 0x4df4
movq %r12, %rax
xorq $0xf4240, %rax          # imm = 0xF4240
movq %r13, %rcx
xorq $0x1, %rcx
orq %rax, %rcx
jne 0x4e05
movq %rsp, %rdi
movq %r12, (%rdi)
movq %r13, 0x8(%rdi)
callq 0x13c8e
xorq $0x3e8, %rax            # imm = 0x3E8
xorq $0x1, %rdx
orq %rax, %rdx
jne 0x4df4
movl $0x1, %r12d
movq %rsp, %rdi
movq %r12, (%rdi)
movq %r12, 0x8(%rdi)
callq 0x13ce0
movq %rax, %r15
xorq %r12, %rax
xorq %rdx, %r12
orq %rax, %r12
jne 0x4e16
leaq 0x10500(%rip), %rsi     # 0x152e1
jmp 0x4dea
leaq 0x10465(%rip), %rsi     # 0x1524f
movl $0x40, %edx
jmp 0x4d42
leaq 0x10495(%rip), %rsi     # 0x15290
movl $0x26, %edx
jmp 0x4d42
leaq 0x104ab(%rip), %rsi     # 0x152b7
movl $0x29, %edx
jmp 0x4d42
movq %rdx, %r14
testq %r15, %r15
setns %al
cmpq %rdx, %r15
setg %cl
testb %cl, %al
je 0x4e35
leaq 0x104f2(%rip), %rsi     # 0x15322
jmp 0x4cbc
movq %rsp, %r12
movq $0x1, (%r12)
movq $0xf4240, 0x8(%r12)     # imm = 0xF4240
movq %r12, %rdi
callq 0x13d6c
cmpq (%r12), %r15
jne 0x4e64
movb $0x1, %al
cmpq 0x8(%rsp), %r14
je 0x4d4c
leaq 0x104ee(%rip), %rsi     # 0x15359
movl $0x2b, %edx
jmp 0x4d42