// File: /workspace/github_c_makefile_star2_O2/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 0x36e5(%rip), %rsi      # 0x5060
movq 0x36e6(%rip), %rdx      # 0x5068
pushq $0x1
popq %rdi
callq *0x36c5(%rip)           # 0x5050
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
callq *0x8(%rax)
testb %al, %al
je 0x1aa1
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq *0x8(%rbx)
testb %al, %al
je 0x1abd
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq *0x8(%rbx)
testb %al, %al
je 0x1ad9
movq %rbx, %rdi
callq *0x18(%rbx)
movq 0x368e(%rip), %rsi      # 0x5060
movq 0x368f(%rip), %rdx      # 0x5068
pushq $0x2
popq %rdi
callq *0x366e(%rip)           # 0x5050
movq %rax, %rbx
leaq 0x14(%rsp), %rsi
movq %rax, %rdi
callq *0x8(%rax)
testb %al, %al
je 0x1af5
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq *0x8(%rbx)
testb %al, %al
je 0x1b0e
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq *0x8(%rbx)
testb %al, %al
je 0x1b27
movq %rbx, %rdi
callq *0x18(%rbx)
movq 0x3635(%rip), %rsi      # 0x5060
movq 0x3636(%rip), %rdx      # 0x5068
pushq $0x14
popq %rdi
callq *0x3615(%rip)           # 0x5050
movq %rax, %rbx
leaq 0x14(%rsp), %rsi
movq %rax, %rdi
callq *0x8(%rax)
testb %al, %al
je 0x1b40
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq *0x8(%rbx)
testb %al, %al
je 0x1b59
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq *0x8(%rbx)
testb %al, %al
je 0x1b72
movq %rbx, %rdi
callq *0x18(%rbx)
movq 0x3554(%rip), %rax      # 0x4fd8
movq (%rax), %rcx
leaq 0x1947(%rip), %rdi      # 0x33d5
pushq $0x9
popq %rsi
pushq $0x1
popq %rdx
callq 0x1070
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq 0x18d5(%rip), %rdi      # 0x337d
leaq 0x185e(%rip), %rsi      # 0x330d
leaq 0x18df(%rip), %rcx      # 0x3395
pushq $0x59
jmp 0x1b89
leaq 0x18e1(%rip), %rdi      # 0x33a5
leaq 0x1842(%rip), %rsi      # 0x330d
leaq 0x18c3(%rip), %rcx      # 0x3395
pushq $0x5a
jmp 0x1b89
leaq 0x18dd(%rip), %rdi      # 0x33bd
leaq 0x1826(%rip), %rsi      # 0x330d
leaq 0x18a7(%rip), %rcx      # 0x3395
pushq $0x5b
jmp 0x1b89
leaq 0x1881(%rip), %rdi      # 0x337d
leaq 0x180a(%rip), %rsi      # 0x330d
leaq 0x188b(%rip), %rcx      # 0x3395
pushq $0x5f
jmp 0x1b89
leaq 0x1890(%rip), %rdi      # 0x33a5
leaq 0x17f1(%rip), %rsi      # 0x330d
leaq 0x1872(%rip), %rcx      # 0x3395
pushq $0x60
jmp 0x1b89
leaq 0x188f(%rip), %rdi      # 0x33bd
leaq 0x17d8(%rip), %rsi      # 0x330d
leaq 0x1859(%rip), %rcx      # 0x3395
pushq $0x61
jmp 0x1b89
leaq 0x1836(%rip), %rdi      # 0x337d
leaq 0x17bf(%rip), %rsi      # 0x330d
leaq 0x1840(%rip), %rcx      # 0x3395
pushq $0x65
jmp 0x1b89
leaq 0x1845(%rip), %rdi      # 0x33a5
leaq 0x17a6(%rip), %rsi      # 0x330d
leaq 0x1827(%rip), %rcx      # 0x3395
pushq $0x66
jmp 0x1b89
leaq 0x1844(%rip), %rdi      # 0x33bd
leaq 0x178d(%rip), %rsi      # 0x330d
leaq 0x180e(%rip), %rcx      # 0x3395
pushq $0x67
popq %rdx
callq 0x1040