// File: ef-gy[P]libefgy/src/test-case/global.cpp
// Function: testBeacon(std::ostream&)
bool testBeacon(std::ostream &log) {
  int a, b, c, d;
  auto &root = global<beacons<int>>();

  if (root.size() != 0) {
    log << "beacon set size before registering anything should be 0 but is: "
        << root.size() << "\n";
    return false;
  }

  {
    beacon<int> ba(a);

    if (root.size() != 1) {
      log << "beacon set size after adding one element should be 1 but is: "
          << root.size() << "\n";
      return false;
    }

    {
      beacon<int> bb(b);
      beacon<int> bc(c);
      beacon<int> bd(d);

      if (root.size() != 4) {
        log << "beacon set size at this scope should be 4 but is: "
            << root.size() << "\n";
        return false;
      }
    }

    if (root.size() != 1) {
      log << "beacon set size after expiring three elements should be 1 but "
             "is: "
          << root.size() << "\n";
      return false;
    }
  }

  if (root.size() != 0) {
    log << "beacon set size after expiring all elements should be 0 but is: "
        << root.size() << "\n";
    return false;
  }

  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x10(%rbp)
callq 0x5f00
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x6760
cmpq $0x0, %rax
je 0x5c08
movq -0x10(%rbp), %rdi
leaq 0x2e5f4(%rip), %rsi     # 0x341c6
callq 0x5350
movq %rax, -0x80(%rbp)
movq -0x28(%rbp), %rdi
callq 0x6760
movq -0x80(%rbp), %rdi
movq %rax, %rsi
callq 0x50a0
movq %rax, %rdi
leaq 0x2e747(%rip), %rsi     # 0x34341
callq 0x5350
movb $0x0, -0x1(%rbp)
jmp 0x5ede
callq 0x5f00
movq %rax, %rdx
leaq -0x38(%rbp), %rdi
leaq -0x14(%rbp), %rsi
callq 0x6780
movq -0x28(%rbp), %rdi
callq 0x6760
cmpq $0x1, %rax
je 0x5c9c
movq -0x10(%rbp), %rdi
leaq 0x2e5d0(%rip), %rsi     # 0x34207
callq 0x5350
movq %rax, -0x88(%rbp)
jmp 0x5c45
movq -0x28(%rbp), %rdi
callq 0x6760
movq -0x88(%rbp), %rdi
movq %rax, %rsi
callq 0x50a0
movq %rax, -0x90(%rbp)
jmp 0x5c66
movq -0x90(%rbp), %rdi
leaq 0x2e6cd(%rip), %rsi     # 0x34341
callq 0x5350
jmp 0x5c7b
movb $0x0, -0x1(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x5e68
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x5ecf
callq 0x5f00
movq %rax, -0x98(%rbp)
jmp 0x5caa
movq -0x98(%rbp), %rdx
leaq -0x58(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x6780
jmp 0x5cc0
callq 0x5f00
movq %rax, -0xa0(%rbp)
jmp 0x5cce
movq -0xa0(%rbp), %rdx
leaq -0x68(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
callq 0x6780
jmp 0x5ce4
callq 0x5f00
movq %rax, -0xa8(%rbp)
jmp 0x5cf2
movq -0xa8(%rbp), %rdx
leaq -0x78(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x6780
jmp 0x5d08
movq -0x28(%rbp), %rdi
callq 0x6760
cmpq $0x4, %rax
je 0x5db3
movq -0x10(%rbp), %rdi
leaq 0x2e51f(%rip), %rsi     # 0x34245
callq 0x5350
movq %rax, -0xb0(%rbp)
jmp 0x5d34
movq -0x28(%rbp), %rdi
callq 0x6760
movq -0xb0(%rbp), %rdi
movq %rax, %rsi
callq 0x50a0
movq %rax, -0xb8(%rbp)
jmp 0x5d55
movq -0xb8(%rbp), %rdi
leaq 0x2e5de(%rip), %rsi     # 0x34341
callq 0x5350
jmp 0x5d6a
movb $0x0, -0x1(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x5dba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x5e56
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x5e4d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x67d0
jmp 0x5e4d
movl $0x0, -0x48(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x67d0
leaq -0x68(%rbp), %rdi
callq 0x67d0
leaq -0x58(%rbp), %rdi
callq 0x67d0
movl -0x48(%rbp), %eax
testl %eax, %eax
jne 0x5e68
jmp 0x5de2
movq -0x28(%rbp), %rdi
callq 0x6760
cmpq $0x1, %rax
je 0x5e61
movq -0x10(%rbp), %rdi
leaq 0x2e47c(%rip), %rsi     # 0x34278
callq 0x5350
movq %rax, -0xc0(%rbp)
jmp 0x5e0a
movq -0x28(%rbp), %rdi
callq 0x6760
movq -0xc0(%rbp), %rdi
movq %rax, %rsi
callq 0x50a0
movq %rax, -0xc8(%rbp)
jmp 0x5e2b
movq -0xc8(%rbp), %rdi
leaq 0x2e508(%rip), %rsi     # 0x34341
callq 0x5350
jmp 0x5e40
movb $0x0, -0x1(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x5e68
leaq -0x68(%rbp), %rdi
callq 0x67d0
leaq -0x58(%rbp), %rdi
callq 0x67d0
jmp 0x5ecf
movl $0x0, -0x48(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x67d0
movl -0x48(%rbp), %eax
testl %eax, %eax
je 0x5e7c
jmp 0x5e7a
jmp 0x5ede
movq -0x28(%rbp), %rdi
callq 0x6760
cmpq $0x0, %rax
je 0x5eda
movq -0x10(%rbp), %rdi
leaq 0x2e425(%rip), %rsi     # 0x342bb
callq 0x5350
movq %rax, -0xd0(%rbp)
movq -0x28(%rbp), %rdi
callq 0x6760
movq -0xd0(%rbp), %rdi
movq %rax, %rsi
callq 0x50a0
movq %rax, %rdi
leaq 0x2e47d(%rip), %rsi     # 0x34341
callq 0x5350
movb $0x0, -0x1(%rbp)
jmp 0x5ede
leaq -0x38(%rbp), %rdi
callq 0x67d0
jmp 0x5eec
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xd0, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x55a0
nopw %cs:(%rax,%rax)