// File: msotoodeh[P]asymmetric-passwords/demo/demo.cpp
// Function: main
int main(int argc, char**argv)
{
    if (SelfTest() != 0 ) return 1;

    std::string userid      = "jack";
    std::string password    = "password";
    std::string domain      = "www.example.com";

    demoRegisterNewUser(userid, password, domain);
    demoUserLogin(userid, password, domain);
    demoUserLogin("joe", password, domain);
    demoUserLogin(userid, "WRONG-PASSWORD", domain);
    demoChangeUserPassword(userid, password, "new-password", domain);
    demoUserLogin(userid, "new-password", domain);

    printf("\n-----------------------------------------------------------------\n");
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0x405300
cmpl $0x0, %eax
je 0x4054df
movl $0x1, -0x4(%rbp)
jmp 0x4058bb
leaq -0x31(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x412d90
movq -0x140(%rbp), %rdx
leaq 0x17c1b2(%rip), %rsi    # 0x5816af
leaq -0x30(%rbp), %rdi
callq 0x405970
jmp 0x405508
leaq -0x31(%rbp), %rdi
callq 0x412db0
leaq -0x69(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x412d90
movq -0x148(%rbp), %rdx
leaq 0x17c1ac(%rip), %rsi    # 0x5816db
leaq -0x68(%rbp), %rdi
callq 0x405970
jmp 0x40553a
leaq -0x69(%rbp), %rdi
callq 0x412db0
leaq -0x91(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0x412d90
movq -0x150(%rbp), %rdx
leaq 0x17c150(%rip), %rsi    # 0x5816b4
leaq -0x90(%rbp), %rdi
callq 0x405970
jmp 0x405572
leaq -0x91(%rbp), %rdi
callq 0x412db0
leaq -0x30(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x90(%rbp), %rdx
callq 0x404700
jmp 0x405594
leaq -0x30(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x90(%rbp), %rdx
callq 0x404b20
jmp 0x4055aa
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x158(%rbp)
callq 0x412d90
movq -0x158(%rbp), %rdx
leaq 0x17c0f9(%rip), %rsi    # 0x5816c4
leaq -0xb8(%rbp), %rdi
callq 0x405970
jmp 0x4055d9
leaq -0xb8(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x90(%rbp), %rdx
callq 0x404b20
jmp 0x4055f2
leaq -0xb8(%rbp), %rdi
callq 0x47ebf0
leaq -0xb9(%rbp), %rdi
callq 0x412db0
leaq -0xe1(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0x412d90
movq -0x160(%rbp), %rdx
leaq 0x17c09d(%rip), %rsi    # 0x5816c8
leaq -0xe0(%rbp), %rdi
callq 0x405970
jmp 0x405639
leaq -0x30(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
leaq -0x90(%rbp), %rdx
callq 0x404b20
jmp 0x405652
leaq -0xe0(%rbp), %rdi
callq 0x47ebf0
leaq -0xe1(%rbp), %rdi
callq 0x412db0
leaq -0x109(%rbp), %rdi
movq %rdi, -0x168(%rbp)
callq 0x412d90
movq -0x168(%rbp), %rdx
leaq 0x17c04c(%rip), %rsi    # 0x5816d7
leaq -0x108(%rbp), %rdi
callq 0x405970
jmp 0x405699
leaq -0x30(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x108(%rbp), %rdx
leaq -0x90(%rbp), %rcx
callq 0x404f00
jmp 0x4056b6
leaq -0x108(%rbp), %rdi
callq 0x47ebf0
leaq -0x109(%rbp), %rdi
callq 0x412db0
leaq -0x131(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0x412d90
movq -0x170(%rbp), %rdx
leaq 0x17bfe8(%rip), %rsi    # 0x5816d7
leaq -0x130(%rbp), %rdi
callq 0x405970
jmp 0x4056fd
leaq -0x30(%rbp), %rdi
leaq -0x130(%rbp), %rsi
leaq -0x90(%rbp), %rdx
callq 0x404b20
jmp 0x405716
leaq -0x130(%rbp), %rdi
callq 0x47ebf0
leaq -0x131(%rbp), %rdi
callq 0x412db0
leaq 0x17bfaf(%rip), %rdi    # 0x5816e4
xorl %eax, %eax
callq 0x4d79b0
jmp 0x40573e
movl $0x0, -0x4(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x47ebf0
leaq -0x68(%rbp), %rdi
callq 0x47ebf0
leaq -0x30(%rbp), %rdi
callq 0x47ebf0
jmp 0x4058bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x412db0
jmp 0x4058c7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x69(%rbp), %rdi
callq 0x412db0
jmp 0x4058b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x91(%rbp), %rdi
callq 0x412db0
jmp 0x4058a7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x40589b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x4057f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x47ebf0
leaq -0xb9(%rbp), %rdi
callq 0x412db0
jmp 0x40589b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x405827
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x47ebf0
leaq -0xe1(%rbp), %rdi
callq 0x412db0
jmp 0x40589b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x40585b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x47ebf0
leaq -0x109(%rbp), %rdi
callq 0x412db0
jmp 0x40589b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x40588f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x47ebf0
leaq -0x131(%rbp), %rdi
callq 0x412db0
leaq -0x90(%rbp), %rdi
callq 0x47ebf0
leaq -0x68(%rbp), %rdi
callq 0x47ebf0
leaq -0x30(%rbp), %rdi
callq 0x47ebf0
jmp 0x4058c7
movl -0x4(%rbp), %eax
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x4b0e70