// File: /workspace/github_cpp_makefile_star2_O3/williewillus[P]panda_scratchpad/src/utils/ClassLoader.h
// Function: int utils::ClassLoader<tests::BaseTestCase>::load_class<tests::BaseTestCase* (*)()>(char const*, char const*, char const*)
int load_class(const char *path, const char *factory_name,
      const char *defactory_name) {
    const char* dl_error = NULL;

    loader_handle = dlopen(path, RTLD_LAZY);
    if (loader_handle == NULL) {
      std::cerr << "Error loading class " << path << std::endl
        << dlerror() << std::endl;
      return CASE_HANDLE_ERR;
    }

    // Get needed methods from loaded class.
    factory = dlsym(loader_handle, factory_name);
    dl_error = dlerror();
    if (dl_error) {
      std::cerr << "Error gettig factory method " << dl_error << std::endl;
      dlclose(loader_handle);
      factory = NULL;
      defactory = NULL;
      loader_handle = NULL;
      return CASE_INIT_ERR;
    }
    defactory = dlsym(loader_handle, defactory_name);
    dl_error = dlerror();
    if (dl_error) {
      std::cerr << "Error gettig deleter method " << dl_error << std::endl;
      dlclose(loader_handle);
      factory = NULL;
      defactory = NULL;
      loader_handle = NULL;
      return CASE_DEST_ERR;
    }
    instance = ((F)(factory))();
    return SUCCESS;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
movl $0x1, %esi
callq 0x55a0
movq %rax, (%rbx)
testq %rax, %rax
je 0x1008c
movq %rax, %rdi
movq %r12, %rsi
callq 0x5440
movq %rax, 0x8(%rbx)
callq 0x5450
testq %rax, %rax
je 0x100cf
movq %rax, %r12
movq 0xbfd5(%rip), %r14      # 0x1bff0
leaq 0x53f4(%rip), %rsi      # 0x15416
movl $0x1c, %edx
movq %r14, %rdi
callq 0x54f0
movq %r12, %rdi
callq 0x51f0
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x54f0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq %r14, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
movq (%rbx), %rdi
callq 0x5390
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jmp 0x10212
movq 0xbf5d(%rip), %rbx      # 0x1bff0
leaq 0x5367(%rip), %rsi      # 0x15401
movl $0x14, %edx
movq %rbx, %rdi
callq 0x54f0
testq %r14, %r14
je 0x10167
movq %r14, %rdi
callq 0x51f0
movq 0xbf31(%rip), %rdi      # 0x1bff0
movq %r14, %rsi
movq %rax, %rdx
callq 0x54f0
jmp 0x1017e
movq (%rbx), %rdi
movq %r15, %rsi
callq 0x5440
movq %rax, 0x10(%rbx)
callq 0x5450
testq %rax, %rax
je 0x1021b
movq %rax, %r15
movq 0xbefa(%rip), %r14      # 0x1bff0
leaq 0x5336(%rip), %rsi      # 0x15433
movl $0x1c, %edx
movq %r14, %rdi
callq 0x54f0
movq %r15, %rdi
callq 0x51f0
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x54f0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq %r14, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
movq (%rbx), %rdi
callq 0x5390
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
jmp 0x10212
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x5770
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
movq %rax, %rbx
callq 0x5450
testq %rax, %rax
je 0x101cd
movq %rax, %r14
movq %rax, %rdi
callq 0x51f0
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x54f0
jmp 0x101e6
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq %rbx, %rdi
addq %rax, %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x5770
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq *0x8(%rbx)
movq %rax, 0x18(%rbx)
xorl %eax, %eax
jmp 0x10212