// File: kklis[P]resolver/resolver_test.cpp
// Function: main
int main() {
    Test *t;

    t = new Test(new Foo());
    assert(t->getName().compare("Foo") == 0);
    delete t;

    t = new Test(new Bar());
    assert(t->getName().compare("Bar") == 0);
    delete t;

    Resolver::Register<IFooBar>(new Foo());
    t = new Test();
    assert(t->getName().compare("Foo") == 0);
    delete t;

    Resolver::Register<IFooBar>(new Bar());
    t = new Test();
    assert(t->getName().compare("Bar") == 0);
    delete t;

    cout << "All tests passed" << endl;

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movl $0x0, -0x4(%rbp)
movl $0x8, %edi
movq %rdi, -0xb8(%rbp)
callq 0x2160
movq -0xb8(%rbp), %rdi
movq %rax, -0xb0(%rbp)
callq 0x2160
movq %rax, -0xa8(%rbp)
jmp 0x241f
movq -0xa8(%rbp), %rdi
movq $0x0, (%rdi)
callq 0x2820
movq -0xb0(%rbp), %rdi
movq -0xa8(%rbp), %rsi
callq 0x2860
jmp 0x2447
movq -0xb0(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x2890
leaq -0x40(%rbp), %rdi
leaq 0x2b9a(%rip), %rsi      # 0x5004
callq 0x2070
cmpl $0x0, %eax
jne 0x2476
jmp 0x24b7
leaq 0x2b8b(%rip), %rdi      # 0x5008
leaq 0x2ba5(%rip), %rsi      # 0x5029
movl $0x4f, %edx
leaq 0x2bab(%rip), %rcx      # 0x503b
callq 0x20d0
movq -0xb0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x8, %esi
callq 0x2170
jmp 0x2811
leaq -0x40(%rbp), %rdi
callq 0x20c0
movq -0x10(%rbp), %rax
movq %rax, -0xc0(%rbp)
cmpq $0x0, %rax
je 0x24ee
movq -0xc0(%rbp), %rdi
callq 0x28c0
movq -0xc0(%rbp), %rdi
movl $0x8, %esi
callq 0x2170
movl $0x8, %edi
movq %rdi, -0xd8(%rbp)
callq 0x2160
movq -0xd8(%rbp), %rdi
movq %rax, -0xd0(%rbp)
callq 0x2160
movq %rax, -0xc8(%rbp)
jmp 0x251b
movq -0xc8(%rbp), %rdi
movq $0x0, (%rdi)
callq 0x28f0
movq -0xd0(%rbp), %rdi
movq -0xc8(%rbp), %rsi
callq 0x2860
jmp 0x2543
movq -0xd0(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x2890
leaq -0x60(%rbp), %rdi
leaq 0x2ae0(%rip), %rsi      # 0x5046
callq 0x2070
cmpl $0x0, %eax
jne 0x2572
jmp 0x25b3
leaq 0x2ad1(%rip), %rdi      # 0x504a
leaq 0x2aa9(%rip), %rsi      # 0x5029
movl $0x53, %edx
leaq 0x2aaf(%rip), %rcx      # 0x503b
callq 0x20d0
movq -0xd0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x8, %esi
callq 0x2170
jmp 0x2811
leaq -0x60(%rbp), %rdi
callq 0x20c0
movq -0x10(%rbp), %rax
movq %rax, -0xe0(%rbp)
cmpq $0x0, %rax
je 0x25ea
movq -0xe0(%rbp), %rdi
callq 0x28c0
movq -0xe0(%rbp), %rdi
movl $0x8, %esi
callq 0x2170
movl $0x8, %edi
movq %rdi, -0xf0(%rbp)
callq 0x2160
movq %rax, %rdi
movq %rdi, -0xf8(%rbp)
movq $0x0, (%rdi)
callq 0x2820
movq -0xf8(%rbp), %rdi
callq 0x2930
movq -0xf0(%rbp), %rdi
callq 0x2160
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xe8(%rbp)
callq 0x29f0
jmp 0x263d
movq -0xe8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0x2890
leaq -0x80(%rbp), %rdi
leaq 0x29a4(%rip), %rsi      # 0x5004
callq 0x2070
cmpl $0x0, %eax
jne 0x266c
jmp 0x26ad
leaq 0x2995(%rip), %rdi      # 0x5008
leaq 0x29af(%rip), %rsi      # 0x5029
movl $0x58, %edx
leaq 0x29b5(%rip), %rcx      # 0x503b
callq 0x20d0
movq -0xe8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x8, %esi
callq 0x2170
jmp 0x2811
leaq -0x80(%rbp), %rdi
callq 0x20c0
movq -0x10(%rbp), %rax
movq %rax, -0x100(%rbp)
cmpq $0x0, %rax
je 0x26e4
movq -0x100(%rbp), %rdi
callq 0x28c0
movq -0x100(%rbp), %rdi
movl $0x8, %esi
callq 0x2170
movl $0x8, %edi
movq %rdi, -0x110(%rbp)
callq 0x2160
movq %rax, %rdi
movq %rdi, -0x118(%rbp)
movq $0x0, (%rdi)
callq 0x28f0
movq -0x118(%rbp), %rdi
callq 0x2930
movq -0x110(%rbp), %rdi
callq 0x2160
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x108(%rbp)
callq 0x29f0
jmp 0x2737
movq -0x108(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
callq 0x2890
leaq -0xa0(%rbp), %rdi
leaq 0x28e6(%rip), %rsi      # 0x5046
callq 0x2070
cmpl $0x0, %eax
jne 0x276c
jmp 0x27aa
leaq 0x28d7(%rip), %rdi      # 0x504a
leaq 0x28af(%rip), %rsi      # 0x5029
movl $0x5d, %edx
leaq 0x28b5(%rip), %rcx      # 0x503b
callq 0x20d0
movq -0x108(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x8, %esi
callq 0x2170
jmp 0x2811
leaq -0xa0(%rbp), %rdi
callq 0x20c0
movq -0x10(%rbp), %rax
movq %rax, -0x120(%rbp)
cmpq $0x0, %rax
je 0x27e4
movq -0x120(%rbp), %rdi
callq 0x28c0
movq -0x120(%rbp), %rdi
movl $0x8, %esi
callq 0x2170
movq 0x57ed(%rip), %rdi      # 0x7fd8
leaq 0x2879(%rip), %rsi      # 0x506b
callq 0x2150
movq %rax, %rdi
movq 0x57c7(%rip), %rsi      # 0x7fc8
callq 0x2190
xorl %eax, %eax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x2220
nopw (%rax,%rax)