// File: dsharlet[P]array/test/main.cpp
// Function: main
int main(int argc, const char** argv) {
  // By default, the filter matches all tests.
  const char* filter = "*";
  if (argc > 1) {
    filter = argv[1];
    std::cout << "Running tests matching '" << filter << "'..." << std::endl;
  }

  size_t passed = 0;
  size_t total = 0;
  for (auto& i : tests()) {
    if (!wildcard_match(filter, i.first.c_str())) continue;

    std::cout << i.first << " ";
    std::flush(std::cout);
    try {
      i.second();
      std::cout << "passed" << std::endl;
      passed++;
    } catch (const std::exception& e) { std::cout << "failed: " << e.what() << std::endl; }
    total++;
  }
  std::cout << passed << " of " << total << " tests passed, " << tests().size() - total
            << " skipped" << std::endl;
  return passed < total ? -1 : 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0xb0d18(%rip), %rax     # 0x1f6438
movq %rax, -0x18(%rbp)
cmpl $0x1, -0x8(%rbp)
jle 0x145773
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movq 0x14c88b(%rip), %rdi    # 0x291fc8
leaq 0xb0cf6(%rip), %rsi     # 0x1f643a
callq 0x3220
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x3220
movq %rax, %rdi
leaq 0xb0cf4(%rip), %rsi     # 0x1f6453
callq 0x3220
movq %rax, %rdi
movq 0x14c842(%rip), %rsi    # 0x291fb0
callq 0x3250
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
callq 0x1456a0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x145c30
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
callq 0x145c60
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x145c90
testb $0x1, %al
jne 0x1457bc
jmp 0x145913
leaq -0x38(%rbp), %rdi
callq 0x145cd0
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x48(%rbp), %rdi
callq 0x3090
movq -0x68(%rbp), %rdi
movq %rax, %rsi
callq 0x1459d0
testb $0x1, %al
jne 0x1457ef
jmp 0x1458ed
movq -0x48(%rbp), %rsi
movq 0x14c7ce(%rip), %rdi    # 0x291fc8
movq %rdi, -0x70(%rbp)
callq 0x31f0
movq %rax, %rdi
leaq 0xb0c6e(%rip), %rsi     # 0x1f647b
callq 0x3220
movq -0x70(%rbp), %rdi
callq 0x32e0
movq -0x48(%rbp), %rdi
addq $0x20, %rdi
callq 0x145cf0
jmp 0x14582a
movq 0x14c797(%rip), %rdi    # 0x291fc8
leaq 0xb0c20(%rip), %rsi     # 0x1f6458
callq 0x3220
movq %rax, -0x78(%rbp)
jmp 0x145843
movq -0x78(%rbp), %rdi
movq 0x14c762(%rip), %rsi    # 0x291fb0
callq 0x3250
jmp 0x145855
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x1458e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x1459b0
movq -0x50(%rbp), %rdi
callq 0x3080
movq %rax, -0x60(%rbp)
movq 0x14c735(%rip), %rdi    # 0x291fc8
leaq 0xb0bc5(%rip), %rsi     # 0x1f645f
callq 0x3220
movq %rax, -0x80(%rbp)
jmp 0x1458a5
movq -0x60(%rbp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq -0x80(%rbp), %rdi
movq %rax, %rsi
callq 0x3220
movq %rax, -0x88(%rbp)
jmp 0x1458c7
movq -0x88(%rbp), %rdi
movq 0x14c6db(%rip), %rsi    # 0x291fb0
callq 0x3250
jmp 0x1458dc
callq 0x3370
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x145d30
jmp 0x1457a6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
callq 0x3370
jmp 0x14590e
jmp 0x1459b0
movq -0x20(%rbp), %rsi
movq 0x14c6aa(%rip), %rdi    # 0x291fc8
callq 0x3040
movq %rax, %rdi
leaq 0xb0b3b(%rip), %rsi     # 0x1f6468
callq 0x3220
movq %rax, %rdi
movq -0x28(%rbp), %rsi
callq 0x3040
movq %rax, %rdi
leaq 0xb0b25(%rip), %rsi     # 0x1f646d
callq 0x3220
movq %rax, -0x90(%rbp)
callq 0x1456a0
movq %rax, %rdi
callq 0x145d50
movq -0x90(%rbp), %rdi
movq %rax, %rsi
subq -0x28(%rbp), %rsi
callq 0x3040
movq %rax, %rdi
leaq 0xb0aff(%rip), %rsi     # 0x1f647d
callq 0x3220
movq %rax, %rdi
movq 0x14c623(%rip), %rsi    # 0x291fb0
callq 0x3250
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rsi
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rsi, %rdx
cmovbl %ecx, %eax
addq $0x90, %rsp
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x33a0
movq %rax, %rdi
callq 0x116d0
nopw %cs:(%rax,%rax)