// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x1, -0x4(%rbp)
movl $0x2, -0x8(%rbp)
movl $0x3, -0xc(%rbp)
movq $0x0, -0x18(%rbp)
movq 0x416c(%rip), %rax      # 0x6058
movq 0x4175(%rip), %rsi      # 0x6068
movq 0x4176(%rip), %rdx      # 0x6070
movl $0x1, %edi
callq *%rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rdi
leaq -0x4(%rbp), %rsi
callq *%rax
testb $0x1, %al
jne 0x1f1d
jmp 0x1f1f
jmp 0x1f3e
leaq 0x24a1(%rip), %rdi      # 0x43c7
leaq 0x242a(%rip), %rsi      # 0x4357
movl $0x59, %edx
leaq 0x24a6(%rip), %rcx      # 0x43df
callq 0x1040
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rdi
leaq -0x8(%rbp), %rsi
callq *%rax
testb $0x1, %al
jne 0x1f56
jmp 0x1f58
jmp 0x1f77
leaq 0x2490(%rip), %rdi      # 0x43ef
leaq 0x23f1(%rip), %rsi      # 0x4357
movl $0x5a, %edx
leaq 0x246d(%rip), %rcx      # 0x43df
callq 0x1040
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rdi
leaq -0xc(%rbp), %rsi
callq *%rax
testb $0x1, %al
jne 0x1f8f
jmp 0x1f91
jmp 0x1fb0
leaq 0x246f(%rip), %rdi      # 0x4407
leaq 0x23b8(%rip), %rsi      # 0x4357
movl $0x5b, %edx
leaq 0x2434(%rip), %rcx      # 0x43df
callq 0x1040
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x18(%rbp), %rdi
callq *%rax
movq %rax, -0x18(%rbp)
movq 0x408f(%rip), %rax      # 0x6058
movq 0x4098(%rip), %rsi      # 0x6068
movq 0x4099(%rip), %rdx      # 0x6070
movl $0x2, %edi
callq *%rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rdi
leaq -0x4(%rbp), %rsi
callq *%rax
testb $0x1, %al
jne 0x1ffa
jmp 0x1ffc
jmp 0x201b
leaq 0x23c4(%rip), %rdi      # 0x43c7
leaq 0x234d(%rip), %rsi      # 0x4357
movl $0x5f, %edx
leaq 0x23c9(%rip), %rcx      # 0x43df
callq 0x1040
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rdi
leaq -0x8(%rbp), %rsi
callq *%rax
testb $0x1, %al
jne 0x2033
jmp 0x2035
jmp 0x2054
leaq 0x23b3(%rip), %rdi      # 0x43ef
leaq 0x2314(%rip), %rsi      # 0x4357
movl $0x60, %edx
leaq 0x2390(%rip), %rcx      # 0x43df
callq 0x1040
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rdi
leaq -0xc(%rbp), %rsi
callq *%rax
testb $0x1, %al
jne 0x206c
jmp 0x206e
jmp 0x208d
leaq 0x2392(%rip), %rdi      # 0x4407
leaq 0x22db(%rip), %rsi      # 0x4357
movl $0x61, %edx
leaq 0x2357(%rip), %rcx      # 0x43df
callq 0x1040
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x18(%rbp), %rdi
callq *%rax
movq %rax, -0x18(%rbp)
movq 0x3fb2(%rip), %rax      # 0x6058
movq 0x3fbb(%rip), %rsi      # 0x6068
movq 0x3fbc(%rip), %rdx      # 0x6070
movl $0x14, %edi
callq *%rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rdi
leaq -0x4(%rbp), %rsi
callq *%rax
testb $0x1, %al
jne 0x20d7
jmp 0x20d9
jmp 0x20f8
leaq 0x22e7(%rip), %rdi      # 0x43c7
leaq 0x2270(%rip), %rsi      # 0x4357
movl $0x65, %edx
leaq 0x22ec(%rip), %rcx      # 0x43df
callq 0x1040
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rdi
leaq -0x8(%rbp), %rsi
callq *%rax
testb $0x1, %al
jne 0x2110
jmp 0x2112
jmp 0x2131
leaq 0x22d6(%rip), %rdi      # 0x43ef
leaq 0x2237(%rip), %rsi      # 0x4357
movl $0x66, %edx
leaq 0x22b3(%rip), %rcx      # 0x43df
callq 0x1040
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rdi
leaq -0xc(%rbp), %rsi
callq *%rax
testb $0x1, %al
jne 0x2149
jmp 0x214b
jmp 0x216a
leaq 0x22b5(%rip), %rdi      # 0x4407
leaq 0x21fe(%rip), %rsi      # 0x4357
movl $0x67, %edx
leaq 0x227a(%rip), %rcx      # 0x43df
callq 0x1040
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x18(%rbp), %rdi
callq *%rax
movq %rax, -0x18(%rbp)
movq 0x3e55(%rip), %rax      # 0x5fd8
movq (%rax), %rdi
leaq 0x2292(%rip), %rsi      # 0x441f
movb $0x0, %al
callq 0x1070
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)