// File: ef-gy[P]libefgy/src/test-case/pi.cpp
// Function: testPi(std::ostream&)
bool testPi(std::ostream &log) {
  pi<longDouble> piD1(1, 1);
  pi<longDouble> piD2(1, 2);
  pi<longDouble> piD3(1, 3);
  pi<longDouble> piD4(1, 4);

  log << "pi<longDouble,1> = " << (long double)longDouble(piD1) << "\n";
  log << "pi<longDouble,2> = " << (long double)longDouble(piD2) << "\n";
  log << "pi<longDouble,3> = " << (long double)longDouble(piD3) << "\n";
  log << "pi<longDouble,4> = " << (long double)longDouble(piD4) << "\n";

  if (longDouble(piD1) != pi<longDouble>::get(1)) {
    log << "constexpr method returned unexpected result\n";
    return false;
  }

  if (longDouble(piD2) != pi<longDouble>::get(2)) {
    log << "constexpr method returned unexpected result\n";
    return false;
  }

  if (longDouble(piD3) != pi<longDouble>::get(3)) {
    log << "constexpr method returned unexpected result\n";
    return false;
  }

  if (longDouble(piD4) != pi<longDouble>::get(4)) {
    log << "constexpr method returned unexpected result\n";
    return false;
  }

  pi<long double> piDL1(1, 1);
  pi<long double> piDL2(1, 2);
  pi<long double> piDL3(1, 3);
  pi<long double> piDL4(1, 4);

  if ((long double)(piDL1) != pi<long double>::get(1)) {
    log << "constexpr method returned unexpected result\n";
    return false;
  }

  if ((long double)(piDL2) != pi<long double>::get(2)) {
    log << "constexpr method returned unexpected result\n";
    return false;
  }

  if ((long double)(piDL3) != pi<long double>::get(3)) {
    log << "constexpr method returned unexpected result\n";
    return false;
  }

  if ((long double)(piDL4) != pi<long double>::get(4)) {
    log << "constexpr method returned unexpected result\n";
    return false;
  }

  log << "pi<long double,1> = " << (long double)piDL1 << "\n";
  log << "pi<long double,2> = " << (long double)piDL2 << "\n";
  log << "pi<long double,3> = " << (long double)piDL3 << "\n";
  log << "pi<long double,4> = " << (long double)piDL4 << "\n";

  pi<fraction> piQ1(fraction(1), 1);
  pi<fraction> piQ2(fraction(1), 2);
  pi<fraction> piQ3(fraction(1), 3);
  pi<fraction> piQ4(fraction(1), 4);

  log << "pi<fraction,1> = " << fraction(piQ1) << "\n";
  log << "pi<fraction,2> = " << fraction(piQ2) << "\n";
  log << "pi<fraction,3> = " << fraction(piQ3) << "\n";
  log << "pi<fraction,4> = " << fraction(piQ4) << "\n";

  if (fraction(piQ1) != pi<fraction>::get(1)) {
    log << "constexpr method returned unexpected result\n";
    return false;
  }

  if (fraction(piQ2) != pi<fraction>::get(2)) {
    log << "constexpr method returned unexpected result\n";
    return false;
  }

  if (fraction(piQ3) != pi<fraction>::get(3)) {
    log << "constexpr method returned unexpected result\n";
    return false;
  }

  if (fraction(piQ4) != pi<fraction>::get(4)) {
    log << "constexpr method returned unexpected result\n";
    return false;
  }

  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x710, %rsp            # imm = 0x710
movq %rdi, -0x10(%rbp)
fld1
fld %st(0)
fstpt -0x5ec(%rbp)
fstpt -0x50(%rbp)
leaq -0x40(%rbp), %rdi
movq %rdi, -0x678(%rbp)
leaq -0x50(%rbp), %rsi
callq 0x7060
movq -0x678(%rbp), %rsi
movq $0x1, -0x58(%rbp)
leaq -0x30(%rbp), %rdi
movq %rdi, -0x5f8(%rbp)
leaq -0x58(%rbp), %rdx
callq 0x7080
fldt -0x5ec(%rbp)
fstpt -0xa0(%rbp)
leaq -0x90(%rbp), %rdi
movq %rdi, -0x670(%rbp)
leaq -0xa0(%rbp), %rsi
callq 0x7060
movq -0x670(%rbp), %rsi
movq $0x2, -0xa8(%rbp)
leaq -0x80(%rbp), %rdi
movq %rdi, -0x648(%rbp)
leaq -0xa8(%rbp), %rdx
callq 0x7080
fldt -0x5ec(%rbp)
fstpt -0xf0(%rbp)
leaq -0xe0(%rbp), %rdi
movq %rdi, -0x668(%rbp)
leaq -0xf0(%rbp), %rsi
callq 0x7060
movq -0x668(%rbp), %rsi
movq $0x3, -0xf8(%rbp)
leaq -0xd0(%rbp), %rdi
movq %rdi, -0x630(%rbp)
leaq -0xf8(%rbp), %rdx
callq 0x7080
fldt -0x5ec(%rbp)
fstpt -0x140(%rbp)
leaq -0x130(%rbp), %rdi
movq %rdi, -0x660(%rbp)
leaq -0x140(%rbp), %rsi
callq 0x7060
movq -0x660(%rbp), %rsi
movq $0x4, -0x148(%rbp)
leaq -0x120(%rbp), %rdi
movq %rdi, -0x618(%rbp)
leaq -0x148(%rbp), %rdx
callq 0x7080
movq -0x10(%rbp), %rdi
leaq 0x2f4e1(%rip), %rsi     # 0x351f2
callq 0x5360
movq -0x5f8(%rbp), %rsi
movq %rax, -0x650(%rbp)
leaq -0x160(%rbp), %rdi
movq %rdi, -0x658(%rbp)
callq 0x70c0
movq -0x658(%rbp), %rdi
callq 0x7100
movq -0x650(%rbp), %rdi
fldt (%rax)
movq %rsp, %rax
fstpt (%rax)
callq 0x5450
movq %rax, %rdi
leaq 0x2f5f0(%rip), %rsi     # 0x35350
movq %rsi, -0x600(%rbp)
callq 0x5360
movq -0x10(%rbp), %rdi
leaq 0x2f48f(%rip), %rsi     # 0x35206
callq 0x5360
movq -0x648(%rbp), %rsi
movq %rax, -0x638(%rbp)
leaq -0x170(%rbp), %rdi
movq %rdi, -0x640(%rbp)
callq 0x70c0
movq -0x640(%rbp), %rdi
callq 0x7100
movq -0x638(%rbp), %rdi
fldt (%rax)
movq %rsp, %rax
fstpt (%rax)
callq 0x5450
movq -0x600(%rbp), %rsi
movq %rax, %rdi
callq 0x5360
movq -0x10(%rbp), %rdi
leaq 0x2f444(%rip), %rsi     # 0x3521a
callq 0x5360
movq -0x630(%rbp), %rsi
movq %rax, -0x620(%rbp)
leaq -0x180(%rbp), %rdi
movq %rdi, -0x628(%rbp)
callq 0x70c0
movq -0x628(%rbp), %rdi
callq 0x7100
movq -0x620(%rbp), %rdi
fldt (%rax)
movq %rsp, %rax
fstpt (%rax)
callq 0x5450
movq -0x600(%rbp), %rsi
movq %rax, %rdi
callq 0x5360
movq -0x10(%rbp), %rdi
leaq 0x2f3f9(%rip), %rsi     # 0x3522e
callq 0x5360
movq -0x618(%rbp), %rsi
movq %rax, -0x608(%rbp)
leaq -0x190(%rbp), %rdi
movq %rdi, -0x610(%rbp)
callq 0x70c0
movq -0x610(%rbp), %rdi
callq 0x7100
movq -0x608(%rbp), %rdi
fldt (%rax)
movq %rsp, %rax
fstpt (%rax)
callq 0x5450
movq -0x600(%rbp), %rsi
movq %rax, %rdi
callq 0x5360
movq -0x5f8(%rbp), %rsi
leaq -0x1a0(%rbp), %rdi
callq 0x70c0
fldt -0x5ec(%rbp)
movq $0x1, -0x1b8(%rbp)
fstpt -0x1e0(%rbp)
leaq -0x1d0(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x7060
leaq -0x1b0(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
leaq -0x1d0(%rbp), %rdx
callq 0x7140
leaq -0x1a0(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x7110
testb $0x1, %al
jne 0x5ef9
jmp 0x5f12
movq -0x10(%rbp), %rdi
leaq 0x2f33e(%rip), %rsi     # 0x35242
callq 0x5360
movb $0x0, -0x1(%rbp)
jmp 0x6848
leaq -0x1f0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x70c0
movq $0x2, -0x208(%rbp)
fld1
fstpt -0x230(%rbp)
leaq -0x220(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0x7060
leaq -0x200(%rbp), %rdi
leaq -0x208(%rbp), %rsi
leaq -0x220(%rbp), %rdx
callq 0x7140
leaq -0x1f0(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x7110
testb $0x1, %al
jne 0x5f7b
jmp 0x5f94
movq -0x10(%rbp), %rdi
leaq 0x2f2bc(%rip), %rsi     # 0x35242
callq 0x5360
movb $0x0, -0x1(%rbp)
jmp 0x6848
leaq -0x240(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x70c0
movq $0x3, -0x258(%rbp)
fld1
fstpt -0x280(%rbp)
leaq -0x270(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0x7060
leaq -0x250(%rbp), %rdi
leaq -0x258(%rbp), %rsi
leaq -0x270(%rbp), %rdx
callq 0x7140
leaq -0x240(%rbp), %rdi
leaq -0x250(%rbp), %rsi
callq 0x7110
testb $0x1, %al
jne 0x6000
jmp 0x6019
movq -0x10(%rbp), %rdi
leaq 0x2f237(%rip), %rsi     # 0x35242
callq 0x5360
movb $0x0, -0x1(%rbp)
jmp 0x6848
leaq -0x290(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x70c0
movq $0x4, -0x2a8(%rbp)
fld1
fstpt -0x2d0(%rbp)
leaq -0x2c0(%rbp), %rdi
leaq -0x2d0(%rbp), %rsi
callq 0x7060
leaq -0x2a0(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
leaq -0x2c0(%rbp), %rdx
callq 0x7140
leaq -0x290(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0x7110
testb $0x1, %al
jne 0x6085
jmp 0x609e
movq -0x10(%rbp), %rdi
leaq 0x2f1b2(%rip), %rsi     # 0x35242
callq 0x5360
movb $0x0, -0x1(%rbp)
jmp 0x6848
movq $0x1, -0x2f8(%rbp)
movq %rsp, %rax
fld1
fld %st(0)
fstpt -0x690(%rbp)
fstpt (%rax)
leaq -0x2f0(%rbp), %rdi
movq %rdi, -0x698(%rbp)
leaq -0x2f8(%rbp), %rsi
callq 0x71a0
fldt -0x690(%rbp)
movq $0x2, -0x328(%rbp)
movq %rsp, %rax
fstpt (%rax)
leaq -0x320(%rbp), %rdi
leaq -0x328(%rbp), %rsi
callq 0x71a0
fldt -0x690(%rbp)
movq $0x3, -0x358(%rbp)
movq %rsp, %rax
fstpt (%rax)
leaq -0x350(%rbp), %rdi
leaq -0x358(%rbp), %rsi
callq 0x71a0
fldt -0x690(%rbp)
movq $0x4, -0x388(%rbp)
movq %rsp, %rax
fstpt (%rax)
leaq -0x380(%rbp), %rdi
leaq -0x388(%rbp), %rsi
callq 0x71a0
movq -0x698(%rbp), %rdi
callq 0x71d0
fldt -0x690(%rbp)
fxch %st(1)
fstpt -0x684(%rbp)
movq $0x1, -0x390(%rbp)
fstpt -0x3a0(%rbp)
leaq -0x390(%rbp), %rdi
leaq -0x3a0(%rbp), %rsi
callq 0x7200
fldt -0x684(%rbp)
fucompi %st(1), %st
fstp %st(0)
jne 0x619b
jp 0x619b
jmp 0x61b4
movq -0x10(%rbp), %rdi
leaq 0x2f09c(%rip), %rsi     # 0x35242
callq 0x5360
movb $0x0, -0x1(%rbp)
jmp 0x6848
leaq -0x320(%rbp), %rdi
callq 0x71d0
fstpt -0x6a4(%rbp)
movq $0x2, -0x3a8(%rbp)
fld1
fstpt -0x3c0(%rbp)
leaq -0x3a8(%rbp), %rdi
leaq -0x3c0(%rbp), %rsi
callq 0x7200
fldt -0x6a4(%rbp)
fucompi %st(1), %st
fstp %st(0)
jne 0x61fc
jp 0x61fc
jmp 0x6215
movq -0x10(%rbp), %rdi
leaq 0x2f03b(%rip), %rsi     # 0x35242
callq 0x5360
movb $0x0, -0x1(%rbp)
jmp 0x6848
leaq -0x350(%rbp), %rdi
callq 0x71d0
fstpt -0x6b0(%rbp)
movq $0x3, -0x3c8(%rbp)
fld1
fstpt -0x3e0(%rbp)
leaq -0x3c8(%rbp), %rdi
leaq -0x3e0(%rbp), %rsi
callq 0x7200
fldt -0x6b0(%rbp)
fucompi %st(1), %st
fstp %st(0)
jne 0x625d
jp 0x625d
jmp 0x6276
movq -0x10(%rbp), %rdi
leaq 0x2efda(%rip), %rsi     # 0x35242
callq 0x5360
movb $0x0, -0x1(%rbp)
jmp 0x6848
leaq -0x380(%rbp), %rdi
callq 0x71d0
fstpt -0x6bc(%rbp)
movq $0x4, -0x3e8(%rbp)
fld1
fstpt -0x400(%rbp)
leaq -0x3e8(%rbp), %rdi
leaq -0x400(%rbp), %rsi
callq 0x7200
fldt -0x6bc(%rbp)
fucompi %st(1), %st
fstp %st(0)
jne 0x62be
jp 0x62be
jmp 0x62d7
movq -0x10(%rbp), %rdi
leaq 0x2ef79(%rip), %rsi     # 0x35242
callq 0x5360
movb $0x0, -0x1(%rbp)
jmp 0x6848
movq -0x10(%rbp), %rdi
leaq 0x2ef8d(%rip), %rsi     # 0x3526f
callq 0x5360
movq %rax, -0x700(%rbp)
leaq -0x2f0(%rbp), %rdi
callq 0x71d0
movq -0x700(%rbp), %rdi
movq %rsp, %rax
fstpt (%rax)
callq 0x5450
movq %rax, %rdi
leaq 0x2f03b(%rip), %rsi     # 0x35350
callq 0x5360
movq -0x10(%rbp), %rdi
leaq 0x2ef5f(%rip), %rsi     # 0x35284
callq 0x5360
movq %rax, -0x6f8(%rbp)
leaq -0x320(%rbp), %rdi
callq 0x71d0
movq -0x6f8(%rbp), %rdi
movq %rsp, %rax
fstpt (%rax)
callq 0x5450
movq %rax, %rdi
leaq 0x2eff8(%rip), %rsi     # 0x35350
callq 0x5360
movq -0x10(%rbp), %rdi
leaq 0x2ef31(%rip), %rsi     # 0x35299
callq 0x5360
movq %rax, -0x6f0(%rbp)
leaq -0x350(%rbp), %rdi
callq 0x71d0
movq -0x6f0(%rbp), %rdi
movq %rsp, %rax
fstpt (%rax)
callq 0x5450
movq %rax, %rdi
leaq 0x2efb5(%rip), %rsi     # 0x35350
callq 0x5360
movq -0x10(%rbp), %rdi
leaq 0x2ef03(%rip), %rsi     # 0x352ae
callq 0x5360
movq %rax, -0x6e8(%rbp)
leaq -0x380(%rbp), %rdi
callq 0x71d0
movq -0x6e8(%rbp), %rdi
movq %rsp, %rax
fstpt (%rax)
callq 0x5450
movq %rax, %rdi
leaq 0x2ef72(%rip), %rsi     # 0x35350
callq 0x5360
leaq -0x428(%rbp), %rdi
movl $0x1, %esi
callq 0x7230
movq $0x1, -0x430(%rbp)
movq -0x428(%rbp), %rsi
movq -0x420(%rbp), %rdx
leaq -0x418(%rbp), %rdi
leaq -0x430(%rbp), %rcx
callq 0x7260
leaq -0x458(%rbp), %rdi
movl $0x1, %esi
callq 0x7230
movq $0x2, -0x460(%rbp)
movq -0x458(%rbp), %rsi
movq -0x450(%rbp), %rdx
leaq -0x448(%rbp), %rdi
leaq -0x460(%rbp), %rcx
callq 0x7260
leaq -0x488(%rbp), %rdi
movl $0x1, %esi
callq 0x7230
movq $0x3, -0x490(%rbp)
movq -0x488(%rbp), %rsi
movq -0x480(%rbp), %rdx
leaq -0x478(%rbp), %rdi
leaq -0x490(%rbp), %rcx
callq 0x7260
leaq -0x4b8(%rbp), %rdi
movl $0x1, %esi
callq 0x7230
movq $0x4, -0x4c0(%rbp)
movq -0x4b8(%rbp), %rsi
movq -0x4b0(%rbp), %rdx
leaq -0x4a8(%rbp), %rdi
leaq -0x4c0(%rbp), %rcx
callq 0x7260
movq -0x10(%rbp), %rdi
leaq 0x2ede1(%rip), %rsi     # 0x352c3
callq 0x5360
movq %rax, -0x6e0(%rbp)
leaq -0x418(%rbp), %rdi
callq 0x72f0
movq -0x6e0(%rbp), %rdi
movq %rax, -0x4d0(%rbp)
movq %rdx, -0x4c8(%rbp)
leaq -0x4d0(%rbp), %rsi
callq 0x72a0
movq %rax, %rdi
leaq 0x2ee2b(%rip), %rsi     # 0x35350
callq 0x5360
movq -0x10(%rbp), %rdi
leaq 0x2eda0(%rip), %rsi     # 0x352d5
callq 0x5360
movq %rax, -0x6d8(%rbp)
leaq -0x448(%rbp), %rdi
callq 0x72f0
movq -0x6d8(%rbp), %rdi
movq %rax, -0x4e0(%rbp)
movq %rdx, -0x4d8(%rbp)
leaq -0x4e0(%rbp), %rsi
callq 0x72a0
movq %rax, %rdi
leaq 0x2edd8(%rip), %rsi     # 0x35350
callq 0x5360
movq -0x10(%rbp), %rdi
leaq 0x2ed5f(%rip), %rsi     # 0x352e7
callq 0x5360
movq %rax, -0x6d0(%rbp)
leaq -0x478(%rbp), %rdi
callq 0x72f0
movq -0x6d0(%rbp), %rdi
movq %rax, -0x4f0(%rbp)
movq %rdx, -0x4e8(%rbp)
leaq -0x4f0(%rbp), %rsi
callq 0x72a0
movq %rax, %rdi
leaq 0x2ed85(%rip), %rsi     # 0x35350
callq 0x5360
movq -0x10(%rbp), %rdi
leaq 0x2ed1e(%rip), %rsi     # 0x352f9
callq 0x5360
movq %rax, -0x6c8(%rbp)
leaq -0x4a8(%rbp), %rdi
callq 0x72f0
movq -0x6c8(%rbp), %rdi
movq %rax, -0x500(%rbp)
movq %rdx, -0x4f8(%rbp)
leaq -0x500(%rbp), %rsi
callq 0x72a0
movq %rax, %rdi
leaq 0x2ed32(%rip), %rsi     # 0x35350
callq 0x5360
leaq -0x418(%rbp), %rdi
callq 0x72f0
movq %rax, -0x510(%rbp)
movq %rdx, -0x508(%rbp)
movq $0x1, -0x528(%rbp)
leaq -0x538(%rbp), %rdi
movl $0x1, %esi
callq 0x7230
leaq -0x528(%rbp), %rdi
leaq -0x538(%rbp), %rsi
callq 0x7360
movq %rax, -0x520(%rbp)
movq %rdx, -0x518(%rbp)
leaq -0x510(%rbp), %rdi
leaq -0x520(%rbp), %rsi
callq 0x7330
testb $0x1, %al
jne 0x6693
jmp 0x66ac
movq -0x10(%rbp), %rdi
leaq 0x2eba4(%rip), %rsi     # 0x35242
callq 0x5360
movb $0x0, -0x1(%rbp)
jmp 0x6848
leaq -0x448(%rbp), %rdi
callq 0x72f0
movq %rax, -0x548(%rbp)
movq %rdx, -0x540(%rbp)
movq $0x2, -0x560(%rbp)
leaq -0x570(%rbp), %rdi
movl $0x1, %esi
callq 0x7230
leaq -0x560(%rbp), %rdi
leaq -0x570(%rbp), %rsi
callq 0x7360
movq %rax, -0x558(%rbp)
movq %rdx, -0x550(%rbp)
leaq -0x548(%rbp), %rdi
leaq -0x558(%rbp), %rsi
callq 0x7330
testb $0x1, %al
jne 0x671c
jmp 0x6735
movq -0x10(%rbp), %rdi
leaq 0x2eb1b(%rip), %rsi     # 0x35242
callq 0x5360
movb $0x0, -0x1(%rbp)
jmp 0x6848
leaq -0x478(%rbp), %rdi
callq 0x72f0
movq %rax, -0x580(%rbp)
movq %rdx, -0x578(%rbp)
movq $0x3, -0x598(%rbp)
leaq -0x5a8(%rbp), %rdi
movl $0x1, %esi
callq 0x7230
leaq -0x598(%rbp), %rdi
leaq -0x5a8(%rbp), %rsi
callq 0x7360
movq %rax, -0x590(%rbp)
movq %rdx, -0x588(%rbp)
leaq -0x580(%rbp), %rdi
leaq -0x590(%rbp), %rsi
callq 0x7330
testb $0x1, %al
jne 0x67a5
jmp 0x67be
movq -0x10(%rbp), %rdi
leaq 0x2ea92(%rip), %rsi     # 0x35242
callq 0x5360
movb $0x0, -0x1(%rbp)
jmp 0x6848
leaq -0x4a8(%rbp), %rdi
callq 0x72f0
movq %rax, -0x5b8(%rbp)
movq %rdx, -0x5b0(%rbp)
movq $0x4, -0x5d0(%rbp)
leaq -0x5e0(%rbp), %rdi
movl $0x1, %esi
callq 0x7230
leaq -0x5d0(%rbp), %rdi
leaq -0x5e0(%rbp), %rsi
callq 0x7360
movq %rax, -0x5c8(%rbp)
movq %rdx, -0x5c0(%rbp)
leaq -0x5b8(%rbp), %rdi
leaq -0x5c8(%rbp), %rsi
callq 0x7330
testb $0x1, %al
jne 0x682e
jmp 0x6844
movq -0x10(%rbp), %rdi
leaq 0x2ea09(%rip), %rsi     # 0x35242
callq 0x5360
movb $0x0, -0x1(%rbp)
jmp 0x6848
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x710, %rsp            # imm = 0x710
popq %rbp
retq
nopw %cs:(%rax,%rax)