// File: /workspace/github_cpp_makefile_star2_O3/ef-gy[P]libefgy/src/test-case/unit.cpp
// Function: testUnitBinary(std::ostream&)
bool testUnitBinary(std::ostream &log) {
  byte<fraction>::kibi kib_2(fraction(2));

  if (fraction(2) != fraction(kib_2)) {
    log << "variable was not initialised to the expected value: " << kib_2
        << " instead of 2/1\n";
    return false;
  }

  byte<fraction>::unit b_2 = kib_2;

  if (fraction(2048) != b_2) {
    log << "variable was not converted to the expected value: " << b_2
        << " instead of 2048/1\n";
    return false;
  }

  byte<fraction>::mebi mib_2 = kib_2;

  if (fraction(1, 512) != mib_2) {
    log << "variable was not converted to the expected value: " << mib_2
        << " instead of 1/512\n";
    return false;
  }

  byte<fraction>::kilo kb_2 = kib_2;

  if (fraction(256, 125) != kb_2) {
    log << "variable was not converted to the expected value: " << kb_2
        << " instead of 256/125\n";
    return false;
  }

  byte<fraction>::mega mb_2 = kib_2;

  if (fraction(32, 15625) != mb_2) {
    log << "variable was not converted to the expected value: " << mb_2
        << " instead of 32/15625\n";
    return false;
  }

  return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movq $0x2, 0x28(%rsp)
movl $0x1, %r15d
movq %r15, 0x30(%rsp)
movl $0x800, %r12d           # imm = 0x800
leaq 0x48(%rsp), %r14
movq %r12, (%r14)
movq %r15, 0x8(%r14)
movq %r14, %rdi
callq 0x13d6a
movq (%r14), %rax
movq 0x8(%r14), %rcx
movq %rax, 0x38(%rsp)
movq %rcx, 0x40(%rsp)
xorq %r12, %rax
xorq %r15, %rcx
orq %rax, %rcx
jne 0x52bd
leaq 0x48(%rsp), %r14
movq $0x2, (%r14)
movq $0x400, 0x8(%r14)       # imm = 0x400
movq %r14, %rdi
callq 0x13d6a
movq (%r14), %r12
movq 0x8(%r14), %r15
movq %r12, (%r14)
movq %r15, 0x8(%r14)
leaq 0x18(%rsp), %r14
movq $0x1, (%r14)
movq $0x200, 0x8(%r14)       # imm = 0x200
movq %r14, %rdi
callq 0x13d6a
cmpq %r12, (%r14)
jne 0x52ec
cmpq %r15, 0x20(%rsp)
jne 0x52ec
leaq 0x18(%rsp), %r14
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x578e
leaq 0x8(%rsp), %r15
movq $0x100, (%r15)          # imm = 0x100
movq $0x7d, 0x8(%r15)
movq %r15, %rdi
callq 0x13d6a
movq (%r15), %rax
cmpq (%r14), %rax
jne 0x531b
movq 0x10(%rsp), %rax
cmpq 0x20(%rsp), %rax
jne 0x531b
leaq 0x8(%rsp), %r14
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x5824
leaq 0x58(%rsp), %r15
movq $0x20, (%r15)
movq $0x3d09, 0x8(%r15)      # imm = 0x3D09
movq %r15, %rdi
callq 0x13d6a
movq (%r15), %rax
cmpq (%r14), %rax
jne 0x535e
movq 0x60(%rsp), %rax
cmpq 0x10(%rsp), %rax
jne 0x535e
movb $0x1, %al
jmp 0x5352
leaq 0x101dd(%rip), %rsi     # 0x154a1
movl $0x32, %edx
movq %rbx, %rdi
callq 0x42b0
leaq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0x5755
leaq 0x101ef(%rip), %rsi     # 0x154d4
movl $0x13, %edx
jmp 0x5348
leaq 0x101ae(%rip), %rsi     # 0x154a1
movl $0x32, %edx
movq %rbx, %rdi
callq 0x42b0
leaq 0x48(%rsp), %rsi
movq %rbx, %rdi
callq 0x5755
leaq 0x101d4(%rip), %rsi     # 0x154e8
movl $0x12, %edx
jmp 0x5348
leaq 0x1017f(%rip), %rsi     # 0x154a1
movl $0x32, %edx
movq %rbx, %rdi
callq 0x42b0
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x5755
leaq 0x101b8(%rip), %rsi     # 0x154fb
movl $0x14, %edx
movq %rax, %rdi
callq 0x42b0
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1013c(%rip), %rsi     # 0x154a1
movl $0x32, %edx
movq %rbx, %rdi
callq 0x42b0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x5755
leaq 0x1018a(%rip), %rsi     # 0x15510
movl $0x15, %edx
jmp 0x5348
nop