// File: ef-gy[P]libefgy/src/test-case/exponential.cpp
// Function: testIntegralExponents(std::ostream&)
bool testIntegralExponents(std::ostream &log) {
  if (exponentiate::integral<fraction, 0>::raise(fraction(21, 5)) !=
      fraction(1, 1)) {
    log << "(21/5)^0 should be (1/1) but is "
        << exponentiate::integral<fraction, 0>::raise(fraction(21, 5)) << "\n";
    return false;
  }

  if (exponentiate::integral<fraction, 1>::raise(fraction(21, 5)) !=
      fraction(21, 5)) {
    log << "(21/5)^1 should be (21/5) but is "
        << exponentiate::integral<fraction, 1>::raise(fraction(21, 5)) << "\n";
    return false;
  }

  if (exponentiate::integral<fraction, 2>::raise(fraction(21, 5)) !=
      fraction(441, 25)) {
    log << "(21/5)^2 should be (441/25) but is "
        << exponentiate::integral<fraction, 2>::raise(fraction(21, 5)) << "\n";
    return false;
  }

  if (exponentiate::integral<fraction, 3>::raise(fraction(21, 5)) !=
      fraction(9261, 125)) {
    log << "(21/5)^3 should be (9261/125) but is "
        << exponentiate::integral<fraction, 3>::raise(fraction(21, 5)) << "\n";
    return false;
  }

  if (exponentiate::integral<fraction, 4>::raise(fraction(21, 5)) !=
      fraction(194481, 625)) {
    log << "(21/5)^4 should be (194481/625) but is "
        << exponentiate::integral<fraction, 4>::raise(fraction(21, 5)) << "\n";
    return false;
  }

  if (exponentiate::integral<fraction, 5>::raise(fraction(21, 5)) !=
      fraction(4084101l, 3125)) {
    log << "(21/5)^5 should be (4084101/3125) but is "
        << exponentiate::integral<fraction, 5>::raise(fraction(21, 5)) << "\n";
    return false;
  }

  if (exponentiate::integral<fraction, -1>::raise(fraction(21, 5)) !=
      fraction(5, 21)) {
    log << "(21/5)^(-1) should be (5/21) but is "
        << exponentiate::integral<fraction, -1>::raise(fraction(21, 5)) << "\n";
    return false;
  }

  if (exponentiate::integral<fraction, -2>::raise(fraction(21, 5)) !=
      fraction(25, 441)) {
    log << "(21/5)^(-2) should be (25/441) but is "
        << exponentiate::integral<fraction, -2>::raise(fraction(21, 5)) << "\n";
    return false;
  }

  if (exponentiate::integral<fraction, -3>::raise(fraction(21, 5)) !=
      fraction(125, 9261)) {
    log << "(21/5)^(-3) should be (125/9261) but is "
        << exponentiate::integral<fraction, -3>::raise(fraction(21, 5)) << "\n";
    return false;
  }

  if (exponentiate::integral<fraction, -4>::raise(fraction(21, 5)) !=
      fraction(625, 194481)) {
    log << "(21/5)^(-4) should be (625/194481) but is "
        << exponentiate::integral<fraction, -4>::raise(fraction(21, 5)) << "\n";
    return false;
  }

  if (exponentiate::integral<fraction, -5>::raise(fraction(21, 5)) !=
      fraction(3125, 4084101l)) {
    log << "(21/5)^(-5) should be (3125/4084101) but is "
        << exponentiate::integral<fraction, -5>::raise(fraction(21, 5)) << "\n";
    return false;
  }

  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3e0, %rsp            # imm = 0x3E0
movq %rdi, -0x10(%rbp)
leaq -0x30(%rbp), %rdi
movl $0x15, %esi
movl $0x5, %edx
callq 0x7810
leaq -0x30(%rbp), %rdi
callq 0x77e0
movq %rax, -0x20(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x40(%rbp), %rdi
movl $0x1, %edx
movq %rdx, %rsi
callq 0x7810
leaq -0x20(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x77b0
testb $0x1, %al
jne 0x5c87
jmp 0x5cea
movq -0x10(%rbp), %rdi
leaq 0x2f534(%rip), %rsi     # 0x351c6
callq 0x5360
movq %rax, -0x388(%rbp)
leaq -0x60(%rbp), %rdi
movl $0x15, %esi
movl $0x5, %edx
callq 0x7810
leaq -0x60(%rbp), %rdi
callq 0x77e0
movq -0x388(%rbp), %rdi
movq %rax, -0x50(%rbp)
movq %rdx, -0x48(%rbp)
leaq -0x50(%rbp), %rsi
callq 0x7850
movq %rax, %rdi
leaq 0x2f6db(%rip), %rsi     # 0x353b7
callq 0x5360
movb $0x0, -0x1(%rbp)
jmp 0x6506
leaq -0x80(%rbp), %rdi
movl $0x15, %esi
movl $0x5, %edx
callq 0x7810
leaq -0x80(%rbp), %rdi
callq 0x78a0
movq %rax, -0x70(%rbp)
movq %rdx, -0x68(%rbp)
leaq -0x90(%rbp), %rdi
movl $0x15, %esi
movl $0x5, %edx
callq 0x7810
leaq -0x70(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x77b0
testb $0x1, %al
jne 0x5d3a
jmp 0x5dac
movq -0x10(%rbp), %rdi
leaq 0x2f4a2(%rip), %rsi     # 0x351e7
callq 0x5360
movq %rax, -0x390(%rbp)
leaq -0xb0(%rbp), %rdi
movl $0x15, %esi
movl $0x5, %edx
callq 0x7810
leaq -0xb0(%rbp), %rdi
callq 0x78a0
movq -0x390(%rbp), %rdi
movq %rax, -0xa0(%rbp)
movq %rdx, -0x98(%rbp)
leaq -0xa0(%rbp), %rsi
callq 0x7850
movq %rax, %rdi
leaq 0x2f619(%rip), %rsi     # 0x353b7
callq 0x5360
movb $0x0, -0x1(%rbp)
jmp 0x6506
leaq -0xd0(%rbp), %rdi
movl $0x15, %esi
movl $0x5, %edx
callq 0x7810
leaq -0xd0(%rbp), %rdi
callq 0x78c0
movq %rax, -0xc0(%rbp)
movq %rdx, -0xb8(%rbp)
leaq -0xe0(%rbp), %rdi
movl $0x1b9, %esi            # imm = 0x1B9
movl $0x19, %edx
callq 0x7810
leaq -0xc0(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x77b0
testb $0x1, %al
jne 0x5e0b
jmp 0x5e7d
movq -0x10(%rbp), %rdi
leaq 0x2f3f3(%rip), %rsi     # 0x35209
callq 0x5360
movq %rax, -0x398(%rbp)
leaq -0x100(%rbp), %rdi
movl $0x15, %esi
movl $0x5, %edx
callq 0x7810
leaq -0x100(%rbp), %rdi
callq 0x78c0
movq -0x398(%rbp), %rdi
movq %rax, -0xf0(%rbp)
movq %rdx, -0xe8(%rbp)
leaq -0xf0(%rbp), %rsi
callq 0x7850
movq %rax, %rdi
leaq 0x2f548(%rip), %rsi     # 0x353b7
callq 0x5360
movb $0x0, -0x1(%rbp)
jmp 0x6506
leaq -0x120(%rbp), %rdi
movl $0x15, %esi
movl $0x5, %edx
callq 0x7810
leaq -0x120(%rbp), %rdi
callq 0x7950
movq %rax, -0x110(%rbp)
movq %rdx, -0x108(%rbp)
leaq -0x130(%rbp), %rdi
movl $0x242d, %esi           # imm = 0x242D
movl $0x7d, %edx
callq 0x7810
leaq -0x110(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x77b0
testb $0x1, %al
jne 0x5edc
jmp 0x5f4e
movq -0x10(%rbp), %rdi
leaq 0x2f346(%rip), %rsi     # 0x3522d
callq 0x5360
movq %rax, -0x3a0(%rbp)
leaq -0x150(%rbp), %rdi
movl $0x15, %esi
movl $0x5, %edx
callq 0x7810
leaq -0x150(%rbp), %rdi
callq 0x7950
movq -0x3a0(%rbp), %rdi
movq %rax, -0x140(%rbp)
movq %rdx, -0x138(%rbp)
leaq -0x140(%rbp), %rsi
callq 0x7850
movq %rax, %rdi
leaq 0x2f477(%rip), %rsi     # 0x353b7
callq 0x5360
movb $0x0, -0x1(%rbp)
jmp 0x6506
leaq -0x170(%rbp), %rdi
movl $0x15, %esi
movl $0x5, %edx
callq 0x7810
leaq -0x170(%rbp), %rdi
callq 0x79e0
movq %rax, -0x160(%rbp)
movq %rdx, -0x158(%rbp)
leaq -0x180(%rbp), %rdi
movl $0x2f7b1, %esi          # imm = 0x2F7B1
movl $0x271, %edx            # imm = 0x271
callq 0x7810
leaq -0x160(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x77b0
testb $0x1, %al
jne 0x5fad
jmp 0x601f
movq -0x10(%rbp), %rdi
leaq 0x2f29b(%rip), %rsi     # 0x35253
callq 0x5360
movq %rax, -0x3a8(%rbp)
leaq -0x1a0(%rbp), %rdi
movl $0x15, %esi
movl $0x5, %edx
callq 0x7810
leaq -0x1a0(%rbp), %rdi
callq 0x79e0
movq -0x3a8(%rbp), %rdi
movq %rax, -0x190(%rbp)
movq %rdx, -0x188(%rbp)
leaq -0x190(%rbp), %rsi
callq 0x7850
movq %rax, %rdi
leaq 0x2f3a6(%rip), %rsi     # 0x353b7
callq 0x5360
movb $0x0, -0x1(%rbp)
jmp 0x6506
leaq -0x1c0(%rbp), %rdi
movl $0x15, %esi
movl $0x5, %edx
callq 0x7810
leaq -0x1c0(%rbp), %rdi
callq 0x7a70
movq %rax, -0x1b0(%rbp)
movq %rdx, -0x1a8(%rbp)
leaq -0x1d0(%rbp), %rdi
movl $0x3e5185, %esi         # imm = 0x3E5185
movl $0xc35, %edx            # imm = 0xC35
callq 0x7810
leaq -0x1b0(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x77b0
testb $0x1, %al
jne 0x607e
jmp 0x60f0
movq -0x10(%rbp), %rdi
leaq 0x2f1f2(%rip), %rsi     # 0x3527b
callq 0x5360
movq %rax, -0x3b0(%rbp)
leaq -0x1f0(%rbp), %rdi
movl $0x15, %esi
movl $0x5, %edx
callq 0x7810
leaq -0x1f0(%rbp), %rdi
callq 0x7a70
movq -0x3b0(%rbp), %rdi
movq %rax, -0x1e0(%rbp)
movq %rdx, -0x1d8(%rbp)
leaq -0x1e0(%rbp), %rsi
callq 0x7850
movq %rax, %rdi
leaq 0x2f2d5(%rip), %rsi     # 0x353b7
callq 0x5360
movb $0x0, -0x1(%rbp)
jmp 0x6506
leaq -0x210(%rbp), %rdi
movl $0x15, %esi
movl $0x5, %edx
callq 0x7810
leaq -0x210(%rbp), %rdi
callq 0x7b00
movq %rax, -0x200(%rbp)
movq %rdx, -0x1f8(%rbp)
leaq -0x220(%rbp), %rdi
movl $0x5, %esi
movl $0x15, %edx
callq 0x7810
leaq -0x200(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0x77b0
testb $0x1, %al
jne 0x614f
jmp 0x61c1
movq -0x10(%rbp), %rdi
leaq 0x2f14b(%rip), %rsi     # 0x352a5
callq 0x5360
movq %rax, -0x3b8(%rbp)
leaq -0x240(%rbp), %rdi
movl $0x15, %esi
movl $0x5, %edx
callq 0x7810
leaq -0x240(%rbp), %rdi
callq 0x7b00
movq -0x3b8(%rbp), %rdi
movq %rax, -0x230(%rbp)
movq %rdx, -0x228(%rbp)
leaq -0x230(%rbp), %rsi
callq 0x7850
movq %rax, %rdi
leaq 0x2f204(%rip), %rsi     # 0x353b7
callq 0x5360
movb $0x0, -0x1(%rbp)
jmp 0x6506
leaq -0x260(%rbp), %rdi
movl $0x15, %esi
movl $0x5, %edx
callq 0x7810
leaq -0x260(%rbp), %rdi
callq 0x7b50
movq %rax, -0x250(%rbp)
movq %rdx, -0x248(%rbp)
leaq -0x270(%rbp), %rdi
movl $0x19, %esi
movl $0x1b9, %edx            # imm = 0x1B9
callq 0x7810
leaq -0x250(%rbp), %rdi
leaq -0x270(%rbp), %rsi
callq 0x77b0
testb $0x1, %al
jne 0x6220
jmp 0x6292
movq -0x10(%rbp), %rdi
leaq 0x2f09f(%rip), %rsi     # 0x352ca
callq 0x5360
movq %rax, -0x3c0(%rbp)
leaq -0x290(%rbp), %rdi
movl $0x15, %esi
movl $0x5, %edx
callq 0x7810
leaq -0x290(%rbp), %rdi
callq 0x7b50
movq -0x3c0(%rbp), %rdi
movq %rax, -0x280(%rbp)
movq %rdx, -0x278(%rbp)
leaq -0x280(%rbp), %rsi
callq 0x7850
movq %rax, %rdi
leaq 0x2f133(%rip), %rsi     # 0x353b7
callq 0x5360
movb $0x0, -0x1(%rbp)
jmp 0x6506
leaq -0x2b0(%rbp), %rdi
movl $0x15, %esi
movl $0x5, %edx
callq 0x7810
leaq -0x2b0(%rbp), %rdi
callq 0x7be0
movq %rax, -0x2a0(%rbp)
movq %rdx, -0x298(%rbp)
leaq -0x2c0(%rbp), %rdi
movl $0x7d, %esi
movl $0x242d, %edx           # imm = 0x242D
callq 0x7810
leaq -0x2a0(%rbp), %rdi
leaq -0x2c0(%rbp), %rsi
callq 0x77b0
testb $0x1, %al
jne 0x62f1
jmp 0x6363
movq -0x10(%rbp), %rdi
leaq 0x2eff5(%rip), %rsi     # 0x352f1
callq 0x5360
movq %rax, -0x3c8(%rbp)
leaq -0x2e0(%rbp), %rdi
movl $0x15, %esi
movl $0x5, %edx
callq 0x7810
leaq -0x2e0(%rbp), %rdi
callq 0x7be0
movq -0x3c8(%rbp), %rdi
movq %rax, -0x2d0(%rbp)
movq %rdx, -0x2c8(%rbp)
leaq -0x2d0(%rbp), %rsi
callq 0x7850
movq %rax, %rdi
leaq 0x2f062(%rip), %rsi     # 0x353b7
callq 0x5360
movb $0x0, -0x1(%rbp)
jmp 0x6506
leaq -0x300(%rbp), %rdi
movl $0x15, %esi
movl $0x5, %edx
callq 0x7810
leaq -0x300(%rbp), %rdi
callq 0x7c70
movq %rax, -0x2f0(%rbp)
movq %rdx, -0x2e8(%rbp)
leaq -0x310(%rbp), %rdi
movl $0x271, %esi            # imm = 0x271
movl $0x2f7b1, %edx          # imm = 0x2F7B1
callq 0x7810
leaq -0x2f0(%rbp), %rdi
leaq -0x310(%rbp), %rsi
callq 0x77b0
testb $0x1, %al
jne 0x63c2
jmp 0x6434
movq -0x10(%rbp), %rdi
leaq 0x2ef4d(%rip), %rsi     # 0x3531a
callq 0x5360
movq %rax, -0x3d0(%rbp)
leaq -0x330(%rbp), %rdi
movl $0x15, %esi
movl $0x5, %edx
callq 0x7810
leaq -0x330(%rbp), %rdi
callq 0x7c70
movq -0x3d0(%rbp), %rdi
movq %rax, -0x320(%rbp)
movq %rdx, -0x318(%rbp)
leaq -0x320(%rbp), %rsi
callq 0x7850
movq %rax, %rdi
leaq 0x2ef91(%rip), %rsi     # 0x353b7
callq 0x5360
movb $0x0, -0x1(%rbp)
jmp 0x6506
leaq -0x350(%rbp), %rdi
movl $0x15, %esi
movl $0x5, %edx
callq 0x7810
leaq -0x350(%rbp), %rdi
callq 0x7d00
movq %rax, -0x340(%rbp)
movq %rdx, -0x338(%rbp)
leaq -0x360(%rbp), %rdi
movl $0xc35, %esi            # imm = 0xC35
movl $0x3e5185, %edx         # imm = 0x3E5185
callq 0x7810
leaq -0x340(%rbp), %rdi
leaq -0x360(%rbp), %rsi
callq 0x77b0
testb $0x1, %al
jne 0x6493
jmp 0x6502
movq -0x10(%rbp), %rdi
leaq 0x2eea7(%rip), %rsi     # 0x35345
callq 0x5360
movq %rax, -0x3d8(%rbp)
leaq -0x380(%rbp), %rdi
movl $0x15, %esi
movl $0x5, %edx
callq 0x7810
leaq -0x380(%rbp), %rdi
callq 0x7d00
movq -0x3d8(%rbp), %rdi
movq %rax, -0x370(%rbp)
movq %rdx, -0x368(%rbp)
leaq -0x370(%rbp), %rsi
callq 0x7850
movq %rax, %rdi
leaq 0x2eec0(%rip), %rsi     # 0x353b7
callq 0x5360
movb $0x0, -0x1(%rbp)
jmp 0x6506
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x3e0, %rsp            # imm = 0x3E0
popq %rbp
retq
nopw %cs:(%rax,%rax)