// File: /workspace/github_c_makefile_star2_O0/mgrosvenor[P]evec/demo3.c
// Function: main
int main(int argc, char** argv)
{
    int* a = NULL;

    printf("Initial Set\n");
    evpsh(a, 6);
    evpsh(a, 4);
    evpsh(a, 2);
    evpsh(a, 2);
    evpsh(a, 4);
    evpsh(a, 6);

    for(int i = 0; i < evcnt(a); i++){
        printf("%i: %i\n", i, a[i]);
    }
    printf("\n");

    printf("Sorted Set\n");
    evsort(a,compare);

    for(int i = 0; i < evcnt(a); i++){
        printf("%i: %i\n", i, a[i]);
    }
    printf("\n");


    printf("De-duplicated Set\n");
    for(int i = 1; i < evcnt(a); i++){
        if(a[i] == a[i-1]){
            evdel(a,i);
            i--;
        }
    }

    for(int i = 0; i < evcnt(a); i++){
        printf("%i: %i\n", i, a[i]);
    }
    printf("\n");

    a = evfree(a);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
leaq 0x11d5(%rip), %rdi      # 0x342a
movb $0x0, %al
callq 0x1060
movl $0x6, -0x1c(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
movl $0x4, %edx
callq 0x1920
movq %rax, -0x18(%rbp)
jmp 0x227b
movl $0x4, -0x20(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
movl $0x4, %edx
callq 0x1920
movq %rax, -0x18(%rbp)
jmp 0x229a
movl $0x2, -0x24(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x24(%rbp), %rsi
movl $0x4, %edx
callq 0x1920
movq %rax, -0x18(%rbp)
jmp 0x22b9
movl $0x2, -0x28(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x28(%rbp), %rsi
movl $0x4, %edx
callq 0x1920
movq %rax, -0x18(%rbp)
jmp 0x22d8
movl $0x4, -0x2c(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
movl $0x4, %edx
callq 0x1920
movq %rax, -0x18(%rbp)
jmp 0x22f7
movl $0x6, -0x30(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x4, %edx
callq 0x1920
movq %rax, -0x18(%rbp)
movl $0x0, -0x34(%rbp)
movslq -0x34(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1a80
movq %rax, %rcx
movq -0x48(%rbp), %rax
cmpq %rcx, %rax
jae 0x235f
movl -0x34(%rbp), %esi
movq -0x18(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %edx
leaq 0x10ea(%rip), %rdi      # 0x3437
movb $0x0, %al
callq 0x1060
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x231b
leaq 0xdfe(%rip), %rdi       # 0x3164
movb $0x0, %al
callq 0x1060
leaq 0x10cb(%rip), %rdi      # 0x343f
movb $0x0, %al
callq 0x1060
movq -0x18(%rbp), %rdi
leaq -0x186(%rip), %rsi      # 0x2200
callq 0x2140
movl $0x0, -0x38(%rbp)
movslq -0x38(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1a80
movq %rax, %rcx
movq -0x50(%rbp), %rax
cmpq %rcx, %rax
jae 0x23d6
movl -0x38(%rbp), %esi
movq -0x18(%rbp), %rax
movslq -0x38(%rbp), %rcx
movl (%rax,%rcx,4), %edx
leaq 0x1073(%rip), %rdi      # 0x3437
movb $0x0, %al
callq 0x1060
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x2392
leaq 0xd87(%rip), %rdi       # 0x3164
movb $0x0, %al
callq 0x1060
leaq 0x1060(%rip), %rdi      # 0x344b
movb $0x0, %al
callq 0x1060
movl $0x1, -0x3c(%rbp)
movslq -0x3c(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1a80
movq %rax, %rcx
movq -0x58(%rbp), %rax
cmpq %rcx, %rax
jae 0x2456
movq -0x18(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x18(%rbp), %rcx
movl -0x3c(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jne 0x2449
movq -0x18(%rbp), %rdi
movslq -0x3c(%rbp), %rsi
callq 0x1f80
movl -0x3c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x244b
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x23f9
movl $0x0, -0x40(%rbp)
movslq -0x40(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1a80
movq %rax, %rcx
movq -0x60(%rbp), %rax
cmpq %rcx, %rax
jae 0x24a1
movl -0x40(%rbp), %esi
movq -0x18(%rbp), %rax
movslq -0x40(%rbp), %rcx
movl (%rax,%rcx,4), %edx
leaq 0xfa8(%rip), %rdi       # 0x3437
movb $0x0, %al
callq 0x1060
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x245d
leaq 0xcbc(%rip), %rdi       # 0x3164
movb $0x0, %al
callq 0x1060
movq -0x18(%rbp), %rdi
callq 0x1ef0
movq %rax, -0x18(%rbp)
xorl %eax, %eax
addq $0x60, %rsp
popq %rbp
retq