// File: ctSkennerton[P]fxtract/util/bloom_t.c
// Function: main
int
main(void)
{
    plan_tests(6);
    setvbuf(stdout, 0, _IOLBF, 0);

    BLOOM *bp = bloom_create(12, 16, 2);
    ok(bp, "created");

    int rc = bloom_chk(bp, "AB");
    ok(rc == 0, "Check 'AB' not in empty table: %d", rc);

    printf("# Add AB\n");
    bloom_add(bp, "AB");

    rc = bloom_chk(bp, "AB");
    ok(rc != 0, "Check 'AB' after add: %d", rc);

    printf("# Add AC\n");
    bloom_add(bp, "AC");

    rc = bloom_chk(bp, "!@");
    ok(rc != 0, "Check '!@' without add: %d (false positive)", rc);

    printf("# Before adding CA...DZ\n");
    bloom_dump(bp, stdout);

    int antestat = bloom_stat(bp), anteover = bloom_over(bp);

    char hash[] = "__";
    for (hash[1] = 'A'; hash[1] <= 'D'; ++hash[1])
        for (hash[0] = 'C'; hash[0] <= 'Z'; ++hash[0])
            bloom_add(bp, hash);

    printf("# After adding CA...DZ:\n");
    bloom_dump(bp, stdout);

    for (hash[1] = 'A'; hash[1] <= 'D'; ++hash[1])
        for (hash[0] = 'C'; hash[0] <= 'Z'; ++hash[0])
            bloom_del(bp, hash);

    printf("# After deleting CA...DZ:\n");
    bloom_dump(bp, stdout);

    int poststat = bloom_stat(bp), postover = bloom_over(bp);
    ok(poststat == antestat, "stat %d -> %d", antestat, poststat);
    ok(postover == anteover, "over %d -> %d", anteover, postover);

    bloom_destroy(bp);

    return exit_status();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x58, %rsp
movl $0x0, -0xc(%rbp)
movl $0x6, %edi
callq 0x7070
movq 0x7b27(%rip), %rax      # 0xafc8
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %ecx
movl $0x1, %edx
movq %rcx, %rsi
callq 0x3030
movl $0xc, %edi
movl $0x10, %esi
movl $0x2, %edx
callq 0x3a00
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x3515
xorl %edi, %edi
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %r8d
leaq 0x4b1d(%rip), %r9       # 0x8004
leaq 0x4b1b(%rip), %r10      # 0x8009
leaq 0x4b1e(%rip), %rax      # 0x8013
movq %r8, %rdx
movq %r8, %rcx
movq %r10, (%rsp)
movl $0x22, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movb $0x0, %al
callq 0x6390
jmp 0x3552
xorl %edi, %edi
xorl %eax, %eax
movl %eax, %r8d
leaq 0x4ae1(%rip), %r9       # 0x8004
leaq 0x4adf(%rip), %r10      # 0x8009
leaq 0x4ae2(%rip), %rax      # 0x8013
movq %r8, %rsi
movq %r8, %rdx
movq %r8, %rcx
movq %r10, (%rsp)
movl $0x22, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movb $0x0, %al
callq 0x6390
movq -0x18(%rbp), %rdi
leaq 0x4abe(%rip), %rsi      # 0x801b
callq 0x3f40
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x35b3
movl -0x1c(%rbp), %eax
xorl %edi, %edi
movl $0x1, %esi
xorl %ecx, %ecx
movl %ecx, %r8d
leaq 0x4a83(%rip), %r9       # 0x8004
leaq 0x4a81(%rip), %r11      # 0x8009
leaq 0x4a8f(%rip), %r10      # 0x801e
movq %r8, %rdx
movq %r8, %rcx
movq %r11, (%rsp)
movl $0x25, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movl %eax, 0x18(%rsp)
movb $0x0, %al
callq 0x6390
jmp 0x35f7
movl -0x1c(%rbp), %eax
xorl %edi, %edi
xorl %ecx, %ecx
movl %ecx, %r8d
leaq 0x4a40(%rip), %r9       # 0x8004
leaq 0x4a3e(%rip), %r11      # 0x8009
leaq 0x4a4c(%rip), %r10      # 0x801e
movq %r8, %rsi
movq %r8, %rdx
movq %r8, %rcx
movq %r11, (%rsp)
movl $0x25, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movl %eax, 0x18(%rsp)
movb $0x0, %al
callq 0x6390
leaq 0x4a42(%rip), %rdi      # 0x8040
movb $0x0, %al
callq 0x3050
movq -0x18(%rbp), %rdi
leaq 0x4a0b(%rip), %rsi      # 0x801b
callq 0x3b40
movq -0x18(%rbp), %rdi
leaq 0x49fb(%rip), %rsi      # 0x801b
callq 0x3f40
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x3676
movl -0x1c(%rbp), %eax
xorl %edi, %edi
movl $0x1, %esi
xorl %ecx, %ecx
movl %ecx, %r8d
leaq 0x49c0(%rip), %r9       # 0x8004
leaq 0x49be(%rip), %r11      # 0x8009
leaq 0x49f8(%rip), %r10      # 0x804a
movq %r8, %rdx
movq %r8, %rcx
movq %r11, (%rsp)
movl $0x2b, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movl %eax, 0x18(%rsp)
movb $0x0, %al
callq 0x6390
jmp 0x36ba
movl -0x1c(%rbp), %eax
xorl %edi, %edi
xorl %ecx, %ecx
movl %ecx, %r8d
leaq 0x497d(%rip), %r9       # 0x8004
leaq 0x497b(%rip), %r11      # 0x8009
leaq 0x49b5(%rip), %r10      # 0x804a
movq %r8, %rsi
movq %r8, %rdx
movq %r8, %rcx
movq %r11, (%rsp)
movl $0x2b, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movl %eax, 0x18(%rsp)
movb $0x0, %al
callq 0x6390
leaq 0x49a2(%rip), %rdi      # 0x8063
movb $0x0, %al
callq 0x3050
movq -0x18(%rbp), %rdi
leaq 0x499a(%rip), %rsi      # 0x806d
callq 0x3b40
movq -0x18(%rbp), %rdi
leaq 0x498d(%rip), %rsi      # 0x8070
callq 0x3f40
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x3739
movl -0x1c(%rbp), %eax
xorl %edi, %edi
movl $0x1, %esi
xorl %ecx, %ecx
movl %ecx, %r8d
leaq 0x48fd(%rip), %r9       # 0x8004
leaq 0x48fb(%rip), %r11      # 0x8009
leaq 0x495e(%rip), %r10      # 0x8073
movq %r8, %rdx
movq %r8, %rcx
movq %r11, (%rsp)
movl $0x31, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movl %eax, 0x18(%rsp)
movb $0x0, %al
callq 0x6390
jmp 0x377d
movl -0x1c(%rbp), %eax
xorl %edi, %edi
xorl %ecx, %ecx
movl %ecx, %r8d
leaq 0x48ba(%rip), %r9       # 0x8004
leaq 0x48b8(%rip), %r11      # 0x8009
leaq 0x491b(%rip), %r10      # 0x8073
movq %r8, %rsi
movq %r8, %rdx
movq %r8, %rcx
movq %r11, (%rsp)
movl $0x31, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movl %eax, 0x18(%rsp)
movb $0x0, %al
callq 0x6390
leaq 0x491b(%rip), %rdi      # 0x809f
movb $0x0, %al
callq 0x3050
movq -0x18(%rbp), %rdi
movq 0x7832(%rip), %rax      # 0xafc8
movq (%rax), %rsi
callq 0x4080
movq -0x18(%rbp), %rdi
callq 0x3fc0
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x4020
movl %eax, -0x24(%rbp)
movw 0x48fb(%rip), %ax       # 0x80b8
movw %ax, -0x27(%rbp)
movb 0x48f3(%rip), %al       # 0x80ba
movb %al, -0x25(%rbp)
movb $0x41, -0x26(%rbp)
movsbl -0x26(%rbp), %eax
cmpl $0x44, %eax
jg 0x3807
movb $0x43, -0x27(%rbp)
movsbl -0x27(%rbp), %eax
cmpl $0x5a, %eax
jg 0x37fb
movq -0x18(%rbp), %rdi
leaq -0x27(%rbp), %rsi
callq 0x3b40
movb -0x27(%rbp), %al
addb $0x1, %al
movb %al, -0x27(%rbp)
jmp 0x37db
jmp 0x37fd
movb -0x26(%rbp), %al
addb $0x1, %al
movb %al, -0x26(%rbp)
jmp 0x37ce
leaq 0x48ad(%rip), %rdi      # 0x80bb
movb $0x0, %al
callq 0x3050
movq -0x18(%rbp), %rdi
movq 0x77a8(%rip), %rax      # 0xafc8
movq (%rax), %rsi
callq 0x4080
movb $0x41, -0x26(%rbp)
movsbl -0x26(%rbp), %eax
cmpl $0x44, %eax
jg 0x3865
movb $0x43, -0x27(%rbp)
movsbl -0x27(%rbp), %eax
cmpl $0x5a, %eax
jg 0x3859
movq -0x18(%rbp), %rdi
leaq -0x27(%rbp), %rsi
callq 0x3d80
movb -0x27(%rbp), %al
addb $0x1, %al
movb %al, -0x27(%rbp)
jmp 0x3839
jmp 0x385b
movb -0x26(%rbp), %al
addb $0x1, %al
movb %al, -0x26(%rbp)
jmp 0x382c
leaq 0x4868(%rip), %rdi      # 0x80d4
movb $0x0, %al
callq 0x3050
movq -0x18(%rbp), %rdi
movq 0x774a(%rip), %rax      # 0xafc8
movq (%rax), %rsi
callq 0x4080
movq -0x18(%rbp), %rdi
callq 0x3fc0
movl %eax, -0x2c(%rbp)
movq -0x18(%rbp), %rdi
callq 0x4020
movl %eax, -0x30(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jne 0x38f7
movl -0x20(%rbp), %r10d
movl -0x2c(%rbp), %eax
xorl %edi, %edi
movl $0x1, %esi
xorl %ecx, %ecx
movl %ecx, %r8d
leaq 0x4744(%rip), %r9       # 0x8004
leaq 0x4742(%rip), %rbx      # 0x8009
leaq 0x4821(%rip), %r11      # 0x80ef
movq %r8, %rdx
movq %r8, %rcx
movq %rbx, (%rsp)
movl $0x48, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movl %r10d, 0x18(%rsp)
movl %eax, 0x20(%rsp)
movb $0x0, %al
callq 0x6390
jmp 0x3944
movl -0x20(%rbp), %r10d
movl -0x2c(%rbp), %eax
xorl %edi, %edi
xorl %ecx, %ecx
movl %ecx, %r8d
leaq 0x46f8(%rip), %r9       # 0x8004
leaq 0x46f6(%rip), %rbx      # 0x8009
leaq 0x47d5(%rip), %r11      # 0x80ef
movq %r8, %rsi
movq %r8, %rdx
movq %r8, %rcx
movq %rbx, (%rsp)
movl $0x48, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movl %r10d, 0x18(%rsp)
movl %eax, 0x20(%rsp)
movb $0x0, %al
callq 0x6390
movl -0x30(%rbp), %eax
cmpl -0x24(%rbp), %eax
jne 0x399d
movl -0x24(%rbp), %r10d
movl -0x30(%rbp), %eax
xorl %edi, %edi
movl $0x1, %esi
xorl %ecx, %ecx
movl %ecx, %r8d
leaq 0x469e(%rip), %r9       # 0x8004
leaq 0x469c(%rip), %rbx      # 0x8009
leaq 0x4789(%rip), %r11      # 0x80fd
movq %r8, %rdx
movq %r8, %rcx
movq %rbx, (%rsp)
movl $0x49, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movl %r10d, 0x18(%rsp)
movl %eax, 0x20(%rsp)
movb $0x0, %al
callq 0x6390
jmp 0x39ea
movl -0x24(%rbp), %r10d
movl -0x30(%rbp), %eax
xorl %edi, %edi
xorl %ecx, %ecx
movl %ecx, %r8d
leaq 0x4652(%rip), %r9       # 0x8004
leaq 0x4650(%rip), %rbx      # 0x8009
leaq 0x473d(%rip), %r11      # 0x80fd
movq %r8, %rsi
movq %r8, %rdx
movq %r8, %rcx
movq %rbx, (%rsp)
movl $0x49, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movl %r10d, 0x18(%rsp)
movl %eax, 0x20(%rsp)
movb $0x0, %al
callq 0x6390
movq -0x18(%rbp), %rdi
callq 0x3b00
callq 0x73c0
addq $0x58, %rsp
popq %rbx
popq %rbp
retq
nop