// File: /workspace/github_c_makefile_star2_O1/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 0x1427
movq 0x28(%r15), %rdi
callq *0x10(%rdi)
testq %rax, %rax
jne 0x1625
movq %rsp, %rsi
movq %r15, %rdi
callq *0x8(%r15)
testb %al, %al
je 0x152d
leaq 0x4(%rsp), %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq *0x8(%r15)
testb %al, %al
je 0x154c
leaq 0x8(%rsp), %r14
movq %r15, %rdi
movq %r14, %rsi
callq *0x8(%r15)
testb %al, %al
je 0x156b
testq %r15, %r15
je 0x1475
movq 0x28(%r15), %rdi
callq *0x10(%rdi)
jmp 0x1477
xorl %eax, %eax
cmpq %rax, %rbx
jne 0x158a
movq %r15, %rdi
callq *0x18(%r15)
movl $0x1, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x119c
movq %rax, %r15
testq %rax, %rax
je 0x14ad
movq 0x28(%r15), %rdi
callq *0x10(%rdi)
testq %rax, %rax
jne 0x1644
movq %rsp, %rsi
movq %r15, %rdi
callq *0x8(%r15)
testb %al, %al
je 0x15a9
movq %r15, %rdi
movq %rbx, %rsi
callq *0x8(%r15)
testb %al, %al
je 0x15c8
movq %r15, %rdi
movq %r14, %rsi
callq *0x8(%r15)
testb %al, %al
je 0x15e7
testq %r15, %r15
je 0x14f1
movq 0x28(%r15), %rdi
callq *0x10(%rdi)
jmp 0x14f3
xorl %eax, %eax
cmpq %rax, %rbx
jne 0x1606
movq %r15, %rdi
callq *0x18(%r15)
movq 0x3ace(%rip), %rax      # 0x4fd8
movq (%rax), %rcx
leaq 0x1c97(%rip), %rdi      # 0x31ab
movl $0x21, %esi
movl $0x1, %edx
callq 0x1070
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1bfb(%rip), %rdi      # 0x312f
leaq 0x1ad0(%rip), %rsi      # 0x300b
leaq 0x1b98(%rip), %rcx      # 0x30da
movl $0x59, %edx
callq 0x1040
leaq 0x1bf3(%rip), %rdi      # 0x3146
leaq 0x1ab1(%rip), %rsi      # 0x300b
leaq 0x1b79(%rip), %rcx      # 0x30da
movl $0x5a, %edx
callq 0x1040
leaq 0x1bef(%rip), %rdi      # 0x3161
leaq 0x1a92(%rip), %rsi      # 0x300b
leaq 0x1b5a(%rip), %rcx      # 0x30da
movl $0x5b, %edx
callq 0x1040
leaq 0x1beb(%rip), %rdi      # 0x317c
leaq 0x1a73(%rip), %rsi      # 0x300b
leaq 0x1b3b(%rip), %rcx      # 0x30da
movl $0x5c, %edx
callq 0x1040
leaq 0x1b7f(%rip), %rdi      # 0x312f
leaq 0x1a54(%rip), %rsi      # 0x300b
leaq 0x1b1c(%rip), %rcx      # 0x30da
movl $0x61, %edx
callq 0x1040
leaq 0x1b77(%rip), %rdi      # 0x3146
leaq 0x1a35(%rip), %rsi      # 0x300b
leaq 0x1afd(%rip), %rcx      # 0x30da
movl $0x62, %edx
callq 0x1040
leaq 0x1b73(%rip), %rdi      # 0x3161
leaq 0x1a16(%rip), %rsi      # 0x300b
leaq 0x1ade(%rip), %rcx      # 0x30da
movl $0x63, %edx
callq 0x1040
leaq 0x1b6f(%rip), %rdi      # 0x317c
leaq 0x19f7(%rip), %rsi      # 0x300b
leaq 0x1abf(%rip), %rcx      # 0x30da
movl $0x64, %edx
callq 0x1040
leaq 0x1ad8(%rip), %rdi      # 0x3104
leaq 0x19d8(%rip), %rsi      # 0x300b
leaq 0x1aa0(%rip), %rcx      # 0x30da
movl $0x58, %edx
callq 0x1040
leaq 0x1ab9(%rip), %rdi      # 0x3104
leaq 0x19b9(%rip), %rsi      # 0x300b
leaq 0x1a81(%rip), %rcx      # 0x30da
movl $0x60, %edx
callq 0x1040