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

    int a[10];

    assert(0 == caching_ringbuffer_get_cached(0));

    Ringbuffer* buffer = caching_ringbuffer_create(1, 0, 0);
    assert(0 == caching_ringbuffer_get_cached(buffer));
    assert(buffer->add(buffer, a));
    assert(buffer->add(buffer, a + 1));
    assert(buffer->add(buffer, a + 2));
    assert(a + 1 == caching_ringbuffer_get_cached(buffer));
    buffer = buffer->free(buffer);

    buffer = caching_ringbuffer_create(1, 0, 0);
    assert(0 == caching_ringbuffer_get_cached(buffer));
    assert(buffer->add(buffer, a));
    assert(buffer->add(buffer, a + 1));
    assert(buffer->add(buffer, a + 2));
    assert(a + 1 == caching_ringbuffer_get_cached(buffer));

    buffer = buffer->free(buffer);

    fprintf(stdout, "caching ringbuffer_get_cached OK\n");

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movl $0x1, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x119c
movq %rax, %r15
testq %rax, %rax
je 0x1423
movq 0x28(%r15), %rdi
callq *0x10(%rdi)
testq %rax, %rax
jne 0x160f
movq %rsp, %rsi
movq %r15, %rdi
callq *0x8(%r15)
testb %al, %al
je 0x1517
leaq 0x4(%rsp), %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq *0x8(%r15)
testb %al, %al
je 0x1536
leaq 0x8(%rsp), %r14
movq %r15, %rdi
movq %r14, %rsi
callq *0x8(%r15)
testb %al, %al
je 0x1555
movq 0x28(%r15), %rdi
callq *0x10(%rdi)
cmpq %rax, %rbx
jne 0x1574
movq %r15, %rdi
callq *0x18(%r15)
movl $0x1, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x119c
movq %rax, %r15
testq %rax, %rax
je 0x14a0
movq 0x28(%r15), %rdi
callq *0x10(%rdi)
testq %rax, %rax
jne 0x162e
movq %rsp, %rsi
movq %r15, %rdi
callq *0x8(%r15)
testb %al, %al
je 0x1593
movq %r15, %rdi
movq %rbx, %rsi
callq *0x8(%r15)
testb %al, %al
je 0x15b2
movq %r15, %rdi
movq %r14, %rsi
callq *0x8(%r15)
testb %al, %al
je 0x15d1
movq 0x28(%r15), %rdi
callq *0x10(%rdi)
cmpq %rax, %rbx
jne 0x15f0
movq %r15, %rdi
callq *0x18(%r15)
movq 0x3ae4(%rip), %rax      # 0x4fd8
movq (%rax), %rcx
leaq 0x1cf9(%rip), %rdi      # 0x31f7
movl $0x21, %esi
movl $0x1, %edx
callq 0x1070
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1c5d(%rip), %rdi      # 0x317b
leaq 0x1b32(%rip), %rsi      # 0x3057
leaq 0x1bfa(%rip), %rcx      # 0x3126
movl $0x59, %edx
callq 0x1040
leaq 0x1c55(%rip), %rdi      # 0x3192
leaq 0x1b13(%rip), %rsi      # 0x3057
leaq 0x1bdb(%rip), %rcx      # 0x3126
movl $0x5a, %edx
callq 0x1040
leaq 0x1c51(%rip), %rdi      # 0x31ad
leaq 0x1af4(%rip), %rsi      # 0x3057
leaq 0x1bbc(%rip), %rcx      # 0x3126
movl $0x5b, %edx
callq 0x1040
leaq 0x1c4d(%rip), %rdi      # 0x31c8
leaq 0x1ad5(%rip), %rsi      # 0x3057
leaq 0x1b9d(%rip), %rcx      # 0x3126
movl $0x5c, %edx
callq 0x1040
leaq 0x1be1(%rip), %rdi      # 0x317b
leaq 0x1ab6(%rip), %rsi      # 0x3057
leaq 0x1b7e(%rip), %rcx      # 0x3126
movl $0x61, %edx
callq 0x1040
leaq 0x1bd9(%rip), %rdi      # 0x3192
leaq 0x1a97(%rip), %rsi      # 0x3057
leaq 0x1b5f(%rip), %rcx      # 0x3126
movl $0x62, %edx
callq 0x1040
leaq 0x1bd5(%rip), %rdi      # 0x31ad
leaq 0x1a78(%rip), %rsi      # 0x3057
leaq 0x1b40(%rip), %rcx      # 0x3126
movl $0x63, %edx
callq 0x1040
leaq 0x1bd1(%rip), %rdi      # 0x31c8
leaq 0x1a59(%rip), %rsi      # 0x3057
leaq 0x1b21(%rip), %rcx      # 0x3126
movl $0x64, %edx
callq 0x1040
leaq 0x1b3a(%rip), %rdi      # 0x3150
leaq 0x1a3a(%rip), %rsi      # 0x3057
leaq 0x1b02(%rip), %rcx      # 0x3126
movl $0x58, %edx
callq 0x1040
leaq 0x1b1b(%rip), %rdi      # 0x3150
leaq 0x1a1b(%rip), %rsi      # 0x3057
leaq 0x1ae3(%rip), %rcx      # 0x3126
movl $0x60, %edx
callq 0x1040