// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movq %rdi, %r13
pushq $0x1
popq %rax
leaq 0x1a0(%rsp), %r14
movq %rax, (%r14)
fld1
fld %st(0)
fstpt 0x1b0(%rsp)
leaq 0x160(%rsp), %rbp
movq $0x2, (%rbp)
fld %st(0)
fstpt 0x170(%rsp)
leaq 0x140(%rsp), %r15
movq $0x3, (%r15)
fld %st(0)
fstpt 0x150(%rsp)
leaq 0x100(%rsp), %rax
movq $0x4, (%rax)
fstpt 0x110(%rsp)
leaq 0xe7f3(%rip), %rsi      # 0x1313a
callq 0x4280
movq %rax, %r12
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x5306
fldt 0x20(%rsp)
fstpt (%rsp)
movq %r12, %rdi
callq 0x4150
leaq 0xe950(%rip), %r12      # 0x132c2
movq %rax, %rdi
movq %r12, %rsi
callq 0x4280
leaq 0xe7ca(%rip), %rsi      # 0x1314e
movq %r13, %rdi
callq 0x4280
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
movq %rbp, %rsi
callq 0x5306
fldt 0x20(%rsp)
fstpt (%rsp)
movq %rbx, %rdi
callq 0x4150
movq %rax, %rdi
movq %r12, %rsi
callq 0x4280
leaq 0xe7a5(%rip), %rsi      # 0x13162
movq %r13, %rdi
callq 0x4280
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
movq %r15, %rsi
callq 0x5306
fldt 0x20(%rsp)
fstpt (%rsp)
movq %rbx, %rdi
callq 0x4150
movq %rax, %rdi
movq %r12, %rsi
callq 0x4280
leaq 0xe780(%rip), %rsi      # 0x13176
movq %r13, %rdi
callq 0x4280
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x5306
fldt 0x20(%rsp)
fstpt (%rsp)
movq %rbx, %rdi
callq 0x4150
movq %rax, %rdi
movq %r12, %rsi
pushq $0x1
popq %r12
callq 0x4280
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x5306
leaq 0xc0(%rsp), %rsi
movq %r12, (%rsi)
fld1
fstpt 0x80(%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0x80(%rsp), %rdx
callq 0x5318
fldt 0x20(%rsp)
fldt 0xa0(%rsp)
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
jne 0x5000
jp 0x5000
leaq 0x20(%rsp), %rdi
leaq 0x160(%rsp), %rsi
callq 0x5306
leaq 0xc0(%rsp), %rsi
movq $0x2, (%rsi)
fld1
fstpt 0x80(%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0x80(%rsp), %rdx
callq 0x5318
fldt 0x20(%rsp)
fldt 0xa0(%rsp)
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
jne 0x5000
jp 0x5000
leaq 0x20(%rsp), %rdi
leaq 0x140(%rsp), %rsi
callq 0x5306
leaq 0xc0(%rsp), %rsi
movq $0x3, (%rsi)
fld1
fstpt 0x80(%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0x80(%rsp), %rdx
callq 0x5318
fldt 0x20(%rsp)
fldt 0xa0(%rsp)
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
jne 0x5000
jp 0x5000
leaq 0x20(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x5306
leaq 0xc0(%rsp), %rsi
movq $0x4, (%rsi)
fld1
fstpt 0x80(%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0x80(%rsp), %rdx
callq 0x5318
fldt 0x20(%rsp)
fldt 0xa0(%rsp)
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
jne 0x5000
jp 0x5000
leaq 0x20(%rsp), %rdi
movq %r12, (%rdi)
fld1
fld %st(0)
fstpt 0x30(%rsp)
movq $0x2, 0xa0(%rsp)
fld %st(0)
fstpt 0xb0(%rsp)
movq $0x3, 0x80(%rsp)
fld %st(0)
fstpt 0x90(%rsp)
movq $0x4, 0xc0(%rsp)
fstpt 0xd0(%rsp)
callq 0x5336
fstpt 0x14(%rsp)
leaq 0xe8(%rsp), %rdi
movq %r12, (%rdi)
fld1
fstpt 0x60(%rsp)
leaq 0x60(%rsp), %rsi
callq 0x5340
fldt 0x14(%rsp)
fucompi %st(1), %st
fstp %st(0)
jne 0x5000
jp 0x5000
leaq 0xa0(%rsp), %rdi
callq 0x5336
fstpt 0x14(%rsp)
leaq 0xe8(%rsp), %rdi
movq $0x2, (%rdi)
fld1
fstpt 0x60(%rsp)
leaq 0x60(%rsp), %rsi
callq 0x5340
fldt 0x14(%rsp)
fucompi %st(1), %st
fstp %st(0)
jne 0x5000
jp 0x5000
leaq 0x80(%rsp), %rdi
callq 0x5336
fstpt 0x14(%rsp)
leaq 0xe8(%rsp), %rdi
movq $0x3, (%rdi)
fld1
fstpt 0x60(%rsp)
leaq 0x60(%rsp), %rsi
callq 0x5340
fldt 0x14(%rsp)
fucompi %st(1), %st
fstp %st(0)
jne 0x5000
jp 0x5000
leaq 0xc0(%rsp), %rdi
callq 0x5336
fstpt 0x14(%rsp)
leaq 0xe8(%rsp), %rdi
movq $0x4, (%rdi)
fld1
fstpt 0x60(%rsp)
leaq 0x60(%rsp), %rsi
callq 0x5340
fldt 0x14(%rsp)
fucompi %st(1), %st
fstp %st(0)
jne 0x5000
jp 0x5000
leaq 0xe4c7(%rip), %rsi      # 0x131b7
movq %r13, %rdi
callq 0x4280
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x5336
fstpt (%rsp)
movq %rbx, %rdi
callq 0x4150
leaq 0xe5ab(%rip), %rbp      # 0x132c2
movq %rax, %rdi
movq %rbp, %rsi
callq 0x4280
leaq 0xe4a3(%rip), %rsi      # 0x131cc
movq %r13, %rdi
callq 0x4280
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x5336
fstpt (%rsp)
movq %rbx, %rdi
callq 0x4150
movq %rax, %rdi
movq %rbp, %rsi
callq 0x4280
leaq 0xe483(%rip), %rsi      # 0x131e1
movq %r13, %rdi
callq 0x4280
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x5336
fstpt (%rsp)
movq %rbx, %rdi
callq 0x4150
movq %rax, %rdi
movq %rbp, %rsi
callq 0x4280
leaq 0xe463(%rip), %rsi      # 0x131f6
movq %r13, %rdi
callq 0x4280
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
callq 0x5336
fstpt (%rsp)
movq %rbx, %rdi
callq 0x4150
movq %rax, %rdi
movq %rbp, %rsi
callq 0x4280
leaq 0x60(%rsp), %r14
movq %r12, (%r14)
movq %r12, 0x8(%r14)
movq %r12, 0x10(%r14)
leaq 0xe8(%rsp), %r15
movq $0x2, (%r15)
movq %r12, 0x8(%r15)
movq %r12, 0x10(%r15)
leaq 0x128(%rsp), %rax
movq $0x3, (%rax)
movq %r12, 0x8(%rax)
movq %r12, 0x10(%rax)
leaq 0x188(%rsp), %r12
movq $0x4, (%r12)
pushq $0x1
popq %rax
movq %rax, 0x8(%r12)
movq %rax, 0x10(%r12)
leaq 0xe3e8(%rip), %rsi      # 0x1320b
movq %r13, %rdi
callq 0x4280
movq %rax, %rbx
movq %r14, %rdi
callq 0x537e
leaq 0x50(%rsp), %r14
movq %rax, (%r14)
movq %rdx, 0x8(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5356
movq %rax, %rdi
movq %rbp, %rsi
callq 0x4280
leaq 0xe3be(%rip), %rsi      # 0x1321d
movq %r13, %rdi
callq 0x4280
movq %rax, %rbx
movq %r15, %rdi
callq 0x537e
movq %rax, (%r14)
movq %rdx, 0x8(%r14)
leaq 0x50(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5356
movq %rax, %rdi
movq %rbp, %rsi
callq 0x4280
leaq 0xe394(%rip), %rsi      # 0x1322f
movq %r13, %rdi
callq 0x4280
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0x537e
movq %rax, (%r14)
movq %rdx, 0x8(%r14)
leaq 0x50(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5356
movq %rax, %rdi
movq %rbp, %rsi
callq 0x4280
leaq 0xe365(%rip), %rsi      # 0x13241
movq %r13, %rdi
callq 0x4280
movq %rax, %rbx
movq %r12, %rdi
pushq $0x1
popq %r12
callq 0x537e
movq %rax, (%r14)
movq %rdx, 0x8(%r14)
leaq 0x50(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5356
movq %rax, %rdi
movq %rbp, %rsi
callq 0x4280
leaq 0x60(%rsp), %rdi
callq 0x537e
movq %rax, %rbx
movq %rdx, %r15
leaq 0x48(%rsp), %rdi
movq %r12, (%rdi)
movq %r12, (%r14)
movq %r12, 0x8(%r14)
leaq 0x50(%rsp), %rsi
callq 0x5388
xorq %rbx, %rax
xorq %r15, %rdx
orq %rax, %rdx
jne 0x5000
leaq 0xe8(%rsp), %rdi
callq 0x537e
movq %rax, %rbx
movq %rdx, %r14
leaq 0x48(%rsp), %rdi
movq $0x2, (%rdi)
leaq 0x50(%rsp), %rsi
movq %r12, (%rsi)
movq %r12, 0x8(%rsi)
callq 0x5388
xorq %rbx, %rax
xorq %r14, %rdx
orq %rax, %rdx
jne 0x5000
leaq 0x128(%rsp), %rdi
callq 0x537e
movq %rax, %rbx
movq %rdx, %r14
leaq 0x48(%rsp), %rdi
movq $0x3, (%rdi)
leaq 0x50(%rsp), %rsi
movq %r12, (%rsi)
movq %r12, 0x8(%rsi)
callq 0x5388
xorq %rbx, %rax
xorq %r14, %rdx
orq %rax, %rdx
jne 0x5000
leaq 0x188(%rsp), %rdi
callq 0x537e
movq %rax, %rbx
movq %rdx, %r14
leaq 0x48(%rsp), %rdi
movq $0x4, (%rdi)
leaq 0x50(%rsp), %rsi
movq %r12, (%rsi)
movq %r12, 0x8(%rsi)
callq 0x5388
xorq %rbx, %rax
xorq %r14, %rdx
orq %rax, %rdx
movb $0x1, %al
je 0x5011
leaq 0xe183(%rip), %rsi      # 0x1318a
movq %r13, %rdi
callq 0x4280
xorl %eax, %eax
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop