// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x60, %rsp
movq %rdi, %rbx
pushq $0x1
popq %rax
leaq 0x20(%rsp), %r14
movq %rax, (%r14)
movq %rax, 0x8(%r14)
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x52e8
movq (%r15), %rax
cmpq (%r14), %rax
jne 0x4a14
movq 0x18(%rsp), %rax
cmpq 0x28(%rsp), %rax
jne 0x4a14
leaq 0xe708(%rip), %rsi      # 0x1311a
jmp 0x4a91
leaq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x539e
testb %al, %al
je 0x4a30
leaq 0xe72e(%rip), %rsi      # 0x1315c
jmp 0x4a91
leaq 0x50(%rsp), %r14
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x530c
movq (%r14), %rax
cmpq 0x20(%rsp), %rax
jne 0x4a8a
movq 0x58(%rsp), %rax
cmpq 0x28(%rsp), %rax
jne 0x4a8a
leaq 0x30(%rsp), %r14
leaq 0x10(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x5332
movq (%r14), %rax
cmpq (%r15), %rax
jne 0x4aa5
movq 0x38(%rsp), %rax
cmpq 0x18(%rsp), %rax
jne 0x4aa5
leaq 0xe748(%rip), %rsi      # 0x131d0
jmp 0x4a91
leaq 0xe702(%rip), %rsi      # 0x13193
movq %rbx, %rdi
callq 0x4270
xorl %eax, %eax
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x539e
testb %al, %al
je 0x4ac1
leaq 0xe756(%rip), %rsi      # 0x13215
jmp 0x4a91
movq %rsp, %r14
leaq 0x30(%rsp), %rsi
movq %r14, %rdi
callq 0x5356
movq (%r14), %rax
cmpq 0x10(%rsp), %rax
jne 0x4b61
movq 0x8(%rsp), %rcx
cmpq 0x18(%rsp), %rcx
jne 0x4b61
xorq $0x3e8, %rax            # imm = 0x3E8
xorq $0x1, %rcx
orq %rax, %rcx
jne 0x4b6d
cmpq $0xf4240, 0x30(%rsp)    # imm = 0xF4240
jne 0x4b79
cmpq $0x1, 0x38(%rsp)
jne 0x4b79
movq %rsp, %r14
leaq 0x30(%rsp), %rsi
movq %r14, %rdi
callq 0x5356
cmpq $0x3e8, (%r14)          # imm = 0x3E8
jne 0x4b6d
cmpq $0x1, 0x8(%rsp)
jne 0x4b6d
movq %rsp, %r14
leaq 0x20(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x537a
movq (%r14), %rax
cmpq (%r15), %rax
jne 0x4b85
movq 0x8(%rsp), %rax
cmpq 0x28(%rsp), %rax
jne 0x4b85
leaq 0xe785(%rip), %rsi      # 0x132e1
jmp 0x4a91
leaq 0xe6e7(%rip), %rsi      # 0x1324f
jmp 0x4a91
leaq 0xe71c(%rip), %rsi      # 0x13290
jmp 0x4a91
leaq 0xe737(%rip), %rsi      # 0x132b7
jmp 0x4a91
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x539e
testb %al, %al
je 0x4ba2
leaq 0xe785(%rip), %rsi      # 0x13322
jmp 0x4a91
leaq 0x40(%rsp), %r14
movq $0x1, (%r14)
movq $0xf4240, 0x8(%r14)     # imm = 0xF4240
movq %r14, %rdi
callq 0x11f0e
movq (%rsp), %rax
leaq 0xe790(%rip), %rsi      # 0x13359
cmpq (%r14), %rax
jne 0x4a91
movq 0x48(%rsp), %rcx
movb $0x1, %al
cmpq %rcx, 0x8(%rsp)
je 0x4a9b
jmp 0x4a91