// File: ef-gy[P]libefgy/src/test-case/vector.cpp
// Function: testRealVectors(std::ostream&)
bool testRealVectors(std::ostream &log) {
  vector<int, 3> v1 = {{1, 2, 3}};
  vector<int, 3> v2 = {{2, 3, 4}};
  vector<int, 3> r = v1 + v2;

  log << v1 << " + " << v2 << " = " << r << "\n";
  log << "sizeof(int) = " << sizeof(int) << "\n";
  log << "sizeof(vector<int,3>) = " << sizeof(vector<int, 3>) << "\n";

  if (r != vector<int, 3>({3, 5, 7})) {
    log << "unexpected result after vector addition; expected ([real] 3, 5, 7) "
           "but have "
        << r << "\n";
    return false;
  }

  vector<double, 3, format::polar> vp1 = {{1, 2, 3}};
  vector<double, 3, format::polar> vp2 = {{2, -1, 1}};
  vector<double, 3, format::polar> rp = vp1 + vp2;

  log << vp1 << " + " << vp2 << " = " << rp << "\n";
  log << "sizeof(double) = " << sizeof(double) << "\n";
  log << "sizeof(vector<double,3,format::polar>) = "
      << sizeof(vector<double, 3, format::polar>) << "\n";

  if (rp != vector<double, 3, format::polar>({3, 1, 4})) {
    log << "unexpected result after vector addition; expected ([polar:10] 3, "
           "1, 4) but have "
        << rp << "\n";
    return false;
  }

  vector<double, 3> rpc = rp;

  log << rp << " = " << rpc << "\n";

  vector<double, 3, format::polar> rpcr = rpc;

  log << rpc << " = " << rpcr << "\n";

  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x210, %rsp            # imm = 0x210
movq %rdi, -0x10(%rbp)
movl $0x1, -0x28(%rbp)
movl $0x2, -0x24(%rbp)
movl $0x3, -0x20(%rbp)
leaq -0x1c(%rbp), %rdi
leaq -0x28(%rbp), %rsi
leaq -0x29(%rbp), %rdx
callq 0x69a0
movl $0x2, -0x44(%rbp)
movl $0x3, -0x40(%rbp)
movl $0x4, -0x3c(%rbp)
leaq -0x38(%rbp), %rdi
movq %rdi, -0x1e8(%rbp)
leaq -0x44(%rbp), %rsi
leaq -0x45(%rbp), %rdx
callq 0x69a0
movq -0x1e8(%rbp), %rdx
movl -0x14(%rbp), %eax
movl %eax, -0x58(%rbp)
movq -0x1c(%rbp), %rax
movq %rax, -0x60(%rbp)
movl -0x58(%rbp), %eax
movl %eax, -0x68(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
movl -0x68(%rbp), %esi
callq 0x69d0
movl %edx, -0x78(%rbp)
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x54(%rbp)
movl -0x78(%rbp), %eax
movl %eax, -0x4c(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
callq 0x6a60
movq %rax, %rdi
leaq 0x2e56d(%rip), %rsi     # 0x3421a
callq 0x5380
movq %rax, %rdi
leaq -0x38(%rbp), %rsi
callq 0x6a60
movq %rax, %rdi
leaq 0x2e57a(%rip), %rsi     # 0x34242
callq 0x5380
movq %rax, %rdi
leaq -0x54(%rbp), %rsi
callq 0x6a60
movq %rax, %rdi
leaq 0x2e682(%rip), %rsi     # 0x34365
callq 0x5380
movq -0x10(%rbp), %rdi
leaq 0x2e52b(%rip), %rsi     # 0x3421e
callq 0x5380
movq %rax, %rdi
movl $0x4, %esi
callq 0x50b0
movq %rax, %rdi
leaq 0x2e656(%rip), %rsi     # 0x34365
callq 0x5380
movq -0x10(%rbp), %rdi
leaq 0x2e50e(%rip), %rsi     # 0x3422d
callq 0x5380
movq %rax, %rdi
movl $0xc, %esi
callq 0x50b0
movq %rax, %rdi
leaq 0x2e62a(%rip), %rsi     # 0x34365
callq 0x5380
movl $0x3, -0x98(%rbp)
movl $0x5, -0x94(%rbp)
movl $0x7, -0x90(%rbp)
leaq -0x8c(%rbp), %rdi
leaq -0x98(%rbp), %rsi
leaq -0x99(%rbp), %rdx
callq 0x69a0
leaq -0x54(%rbp), %rdi
leaq -0x8c(%rbp), %rsi
callq 0x6b10
testb $0x1, %al
jne 0x5d8e
jmp 0x5dc2
movq -0x10(%rbp), %rdi
leaq 0x2e4ad(%rip), %rsi     # 0x34246
callq 0x5380
movq %rax, %rdi
leaq -0x54(%rbp), %rsi
callq 0x6a60
movq %rax, %rdi
leaq 0x2e5b1(%rip), %rsi     # 0x34365
callq 0x5380
movb $0x0, -0x1(%rbp)
jmp 0x60f4
movq 0x2e367(%rip), %rax     # 0x34130
movq %rax, -0xd8(%rbp)
movq 0x2e361(%rip), %rax     # 0x34138
movq %rax, -0xd0(%rbp)
movq 0x2e35b(%rip), %rax     # 0x34140
movq %rax, -0xc8(%rbp)
leaq -0xe0(%rbp), %rdi
movl $0xa, %esi
callq 0x6b40
leaq -0xc0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
leaq -0xe0(%rbp), %rdx
callq 0x6b60
movq 0x2e32a(%rip), %rax     # 0x34148
movq %rax, -0x118(%rbp)
movq 0x2e324(%rip), %rax     # 0x34150
movq %rax, -0x110(%rbp)
movq 0x2e31e(%rip), %rax     # 0x34158
movq %rax, -0x108(%rbp)
leaq -0x120(%rbp), %rdi
movl $0xa, %esi
callq 0x6b40
leaq -0x100(%rbp), %rdi
leaq -0x118(%rbp), %rsi
leaq -0x120(%rbp), %rdx
callq 0x6b60
movq -0xc0(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0x158(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0x150(%rbp)
movq -0xa8(%rbp), %rax
movq %rax, -0x148(%rbp)
leaq -0x140(%rbp), %rdi
leaq -0x160(%rbp), %rax
leaq -0x100(%rbp), %rsi
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
callq 0x6ba0
movq -0x10(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x6c40
movq %rax, %rdi
leaq 0x2e320(%rip), %rsi     # 0x3421a
callq 0x5380
movq %rax, %rdi
leaq -0x100(%rbp), %rsi
callq 0x6c40
movq %rax, %rdi
leaq 0x2e32a(%rip), %rsi     # 0x34242
callq 0x5380
movq %rax, %rdi
leaq -0x140(%rbp), %rsi
callq 0x6c40
movq %rax, %rdi
leaq 0x2e42f(%rip), %rsi     # 0x34365
callq 0x5380
movq -0x10(%rbp), %rdi
leaq 0x2e34d(%rip), %rsi     # 0x34293
callq 0x5380
movq %rax, %rdi
movl $0x8, %esi
callq 0x50b0
movq %rax, %rdi
leaq 0x2e403(%rip), %rsi     # 0x34365
callq 0x5380
movq -0x10(%rbp), %rdi
leaq 0x2e333(%rip), %rsi     # 0x342a5
callq 0x5380
movq %rax, %rdi
movl $0x20, %esi
callq 0x50b0
movq %rax, %rdi
leaq 0x2e3d7(%rip), %rsi     # 0x34365
callq 0x5380
movq 0x2e1c6(%rip), %rax     # 0x34160
movq %rax, -0x198(%rbp)
movq 0x2e1c0(%rip), %rax     # 0x34168
movq %rax, -0x190(%rbp)
movq 0x2e1ba(%rip), %rax     # 0x34170
movq %rax, -0x188(%rbp)
leaq -0x1a0(%rbp), %rdi
movl $0xa, %esi
callq 0x6b40
leaq -0x180(%rbp), %rdi
leaq -0x198(%rbp), %rsi
leaq -0x1a0(%rbp), %rdx
callq 0x6b60
leaq -0x140(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x6cf0
testb $0x1, %al
jne 0x6001
jmp 0x6038
movq -0x10(%rbp), %rdi
leaq 0x2e2c3(%rip), %rsi     # 0x342cf
callq 0x5380
movq %rax, %rdi
leaq -0x140(%rbp), %rsi
callq 0x6c40
movq %rax, %rdi
leaq 0x2e33b(%rip), %rsi     # 0x34365
callq 0x5380
movb $0x0, -0x1(%rbp)
jmp 0x60f4
leaq -0x1b8(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x6d20
movq -0x10(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x6c40
movq %rax, %rdi
leaq 0x2e1dd(%rip), %rsi     # 0x34242
callq 0x5380
movq %rax, %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x6e70
movq %rax, %rdi
leaq 0x2e2e2(%rip), %rsi     # 0x34365
callq 0x5380
leaq -0x1e0(%rbp), %rdi
movl $0xa, %esi
callq 0x6b40
leaq -0x1d8(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
leaq -0x1e0(%rbp), %rdx
callq 0x6f20
movq -0x10(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x6e70
movq %rax, %rdi
leaq 0x2e175(%rip), %rsi     # 0x34242
callq 0x5380
movq %rax, %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x6c40
movq %rax, %rdi
leaq 0x2e27a(%rip), %rsi     # 0x34365
callq 0x5380
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x210, %rsp            # imm = 0x210
popq %rbp
retq
nopw %cs:(%rax,%rax)