// File: /workspace/github_c_makefile_star2_O1/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 0x3623(%rip), %rsi      # 0x5060
movq 0x3624(%rip), %rdx      # 0x5068
movl $0x1, %edi
callq *0x3601(%rip)           # 0x5050
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
callq *0x8(%rax)
testb %al, %al
je 0x1b6d
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq *0x8(%rbx)
testb %al, %al
je 0x1b8c
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq *0x8(%rbx)
testb %al, %al
je 0x1bab
movq %rbx, %rdi
callq *0x18(%rbx)
movq 0x35ca(%rip), %rsi      # 0x5060
movq 0x35cb(%rip), %rdx      # 0x5068
movl $0x2, %edi
callq *0x35a8(%rip)           # 0x5050
movq %rax, %rbx
leaq 0x14(%rsp), %rsi
movq %rax, %rdi
callq *0x8(%rax)
testb %al, %al
je 0x1bca
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq *0x8(%rbx)
testb %al, %al
je 0x1be9
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq *0x8(%rbx)
testb %al, %al
je 0x1c08
movq %rbx, %rdi
callq *0x18(%rbx)
movq 0x356f(%rip), %rsi      # 0x5060
movq 0x3570(%rip), %rdx      # 0x5068
movl $0x14, %edi
callq *0x354d(%rip)           # 0x5050
movq %rax, %rbx
leaq 0x14(%rsp), %rsi
movq %rax, %rdi
callq *0x8(%rax)
testb %al, %al
je 0x1c27
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq *0x8(%rbx)
testb %al, %al
je 0x1c46
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq *0x8(%rbx)
testb %al, %al
je 0x1c65
movq %rbx, %rdi
callq *0x18(%rbx)
movq 0x348c(%rip), %rax      # 0x4fd8
movq (%rax), %rcx
leaq 0x187f(%rip), %rdi      # 0x33d5
movl $0x9, %esi
movl $0x1, %edx
callq 0x1070
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq 0x1809(%rip), %rdi      # 0x337d
leaq 0x1792(%rip), %rsi      # 0x330d
leaq 0x1813(%rip), %rcx      # 0x3395
movl $0x59, %edx
callq 0x1040
leaq 0x1812(%rip), %rdi      # 0x33a5
leaq 0x1773(%rip), %rsi      # 0x330d
leaq 0x17f4(%rip), %rcx      # 0x3395
movl $0x5a, %edx
callq 0x1040
leaq 0x180b(%rip), %rdi      # 0x33bd
leaq 0x1754(%rip), %rsi      # 0x330d
leaq 0x17d5(%rip), %rcx      # 0x3395
movl $0x5b, %edx
callq 0x1040
leaq 0x17ac(%rip), %rdi      # 0x337d
leaq 0x1735(%rip), %rsi      # 0x330d
leaq 0x17b6(%rip), %rcx      # 0x3395
movl $0x5f, %edx
callq 0x1040
leaq 0x17b5(%rip), %rdi      # 0x33a5
leaq 0x1716(%rip), %rsi      # 0x330d
leaq 0x1797(%rip), %rcx      # 0x3395
movl $0x60, %edx
callq 0x1040
leaq 0x17ae(%rip), %rdi      # 0x33bd
leaq 0x16f7(%rip), %rsi      # 0x330d
leaq 0x1778(%rip), %rcx      # 0x3395
movl $0x61, %edx
callq 0x1040
leaq 0x174f(%rip), %rdi      # 0x337d
leaq 0x16d8(%rip), %rsi      # 0x330d
leaq 0x1759(%rip), %rcx      # 0x3395
movl $0x65, %edx
callq 0x1040
leaq 0x1758(%rip), %rdi      # 0x33a5
leaq 0x16b9(%rip), %rsi      # 0x330d
leaq 0x173a(%rip), %rcx      # 0x3395
movl $0x66, %edx
callq 0x1040
leaq 0x1751(%rip), %rdi      # 0x33bd
leaq 0x169a(%rip), %rsi      # 0x330d
leaq 0x171b(%rip), %rcx      # 0x3395
movl $0x67, %edx
callq 0x1040