// File: /workspace/github_c_makefile_star2_O3/vidarr[P]ringbuffer/test/test_helper.c
// Function: test_add
void test_add() {

    int a = 1;
    int b = 2;
    int c = 3;

    Ringbuffer* buffer = 0;

    buffer = create(1, free_item, free_item_additional_arg);
    assert(buffer->add(buffer, &a));
    assert(buffer->add(buffer, &b));
    assert(buffer->add(buffer, &c));
    buffer = buffer->free(buffer);

    buffer = create(2, free_item, free_item_additional_arg);
    assert(buffer->add(buffer, &a));
    assert(buffer->add(buffer, &b));
    assert(buffer->add(buffer, &c));
    buffer = buffer->free(buffer);

    buffer = create(20, free_item, free_item_additional_arg);
    assert(buffer->add(buffer, &a));
    assert(buffer->add(buffer, &b));
    assert(buffer->add(buffer, &c));
    buffer = buffer->free(buffer);

    fprintf(stdout, "add() OK\n");

}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
leaq 0x14(%rsp), %r14
movl $0x1, (%r14)
movl $0x2, 0x10(%rsp)
movl $0x3, 0xc(%rsp)
movq 0x35d7(%rip), %rsi      # 0x5060
movq 0x35d8(%rip), %rdx      # 0x5068
movl $0x1, %edi
callq *0x35b5(%rip)           # 0x5050
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
callq *0x8(%rax)
testb %al, %al
je 0x1bb9
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq *0x8(%rbx)
testb %al, %al
je 0x1bd8
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq *0x8(%rbx)
testb %al, %al
je 0x1bf7
movq %rbx, %rdi
callq *0x18(%rbx)
movq 0x357e(%rip), %rsi      # 0x5060
movq 0x357f(%rip), %rdx      # 0x5068
movl $0x2, %edi
callq *0x355c(%rip)           # 0x5050
movq %rax, %rbx
leaq 0x14(%rsp), %rsi
movq %rax, %rdi
callq *0x8(%rax)
testb %al, %al
je 0x1c16
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq *0x8(%rbx)
testb %al, %al
je 0x1c35
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq *0x8(%rbx)
testb %al, %al
je 0x1c54
movq %rbx, %rdi
callq *0x18(%rbx)
movq 0x3523(%rip), %rsi      # 0x5060
movq 0x3524(%rip), %rdx      # 0x5068
movl $0x14, %edi
callq *0x3501(%rip)           # 0x5050
movq %rax, %rbx
leaq 0x14(%rsp), %rsi
movq %rax, %rdi
callq *0x8(%rax)
testb %al, %al
je 0x1c73
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq *0x8(%rbx)
testb %al, %al
je 0x1c92
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq *0x8(%rbx)
testb %al, %al
je 0x1cb1
movq %rbx, %rdi
callq *0x18(%rbx)
movq 0x3440(%rip), %rax      # 0x4fd8
movq (%rax), %rcx
leaq 0x187f(%rip), %rdi      # 0x3421
movl $0x9, %esi
movl $0x1, %edx
callq 0x1070
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq 0x1809(%rip), %rdi      # 0x33c9
leaq 0x1792(%rip), %rsi      # 0x3359
leaq 0x1813(%rip), %rcx      # 0x33e1
movl $0x59, %edx
callq 0x1040
leaq 0x1812(%rip), %rdi      # 0x33f1
leaq 0x1773(%rip), %rsi      # 0x3359
leaq 0x17f4(%rip), %rcx      # 0x33e1
movl $0x5a, %edx
callq 0x1040
leaq 0x180b(%rip), %rdi      # 0x3409
leaq 0x1754(%rip), %rsi      # 0x3359
leaq 0x17d5(%rip), %rcx      # 0x33e1
movl $0x5b, %edx
callq 0x1040
leaq 0x17ac(%rip), %rdi      # 0x33c9
leaq 0x1735(%rip), %rsi      # 0x3359
leaq 0x17b6(%rip), %rcx      # 0x33e1
movl $0x5f, %edx
callq 0x1040
leaq 0x17b5(%rip), %rdi      # 0x33f1
leaq 0x1716(%rip), %rsi      # 0x3359
leaq 0x1797(%rip), %rcx      # 0x33e1
movl $0x60, %edx
callq 0x1040
leaq 0x17ae(%rip), %rdi      # 0x3409
leaq 0x16f7(%rip), %rsi      # 0x3359
leaq 0x1778(%rip), %rcx      # 0x33e1
movl $0x61, %edx
callq 0x1040
leaq 0x174f(%rip), %rdi      # 0x33c9
leaq 0x16d8(%rip), %rsi      # 0x3359
leaq 0x1759(%rip), %rcx      # 0x33e1
movl $0x65, %edx
callq 0x1040
leaq 0x1758(%rip), %rdi      # 0x33f1
leaq 0x16b9(%rip), %rsi      # 0x3359
leaq 0x173a(%rip), %rcx      # 0x33e1
movl $0x66, %edx
callq 0x1040
leaq 0x1751(%rip), %rdi      # 0x3409
leaq 0x169a(%rip), %rsi      # 0x3359
leaq 0x171b(%rip), %rcx      # 0x33e1
movl $0x67, %edx
callq 0x1040