// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x117c
movq %rax, %r15
testq %rax, %rax
je 0x13ec
movq 0x28(%r15), %rdi
callq *0x10(%rdi)
testq %rax, %rax
jne 0x15ae
movq %rsp, %rsi
movq %r15, %rdi
callq *0x8(%r15)
testb %al, %al
je 0x14da
leaq 0x4(%rsp), %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq *0x8(%r15)
testb %al, %al
je 0x14f6
leaq 0x8(%rsp), %r14
movq %r15, %rdi
movq %r14, %rsi
callq *0x8(%r15)
testb %al, %al
je 0x1512
movq 0x28(%r15), %rdi
callq *0x10(%rdi)
cmpq %rax, %rbx
jne 0x152e
movq %r15, %rdi
callq *0x18(%r15)
pushq $0x1
popq %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x117c
movq %rax, %r15
testq %rax, %rax
je 0x1467
movq 0x28(%r15), %rdi
callq *0x10(%rdi)
testq %rax, %rax
jne 0x15c7
movq %rsp, %rsi
movq %r15, %rdi
callq *0x8(%r15)
testb %al, %al
je 0x154a
movq %r15, %rdi
movq %rbx, %rsi
callq *0x8(%r15)
testb %al, %al
je 0x1563
movq %r15, %rdi
movq %r14, %rsi
callq *0x8(%r15)
testb %al, %al
je 0x157c
movq 0x28(%r15), %rdi
callq *0x10(%rdi)
cmpq %rax, %rbx
jne 0x1595
movq %r15, %rdi
callq *0x18(%r15)
movq 0x3b1d(%rip), %rax      # 0x4fd8
movq (%rax), %rcx
leaq 0x1ce6(%rip), %rdi      # 0x31ab
pushq $0x21
popq %rsi
pushq $0x1
popq %rdx
callq 0x1070
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1c4e(%rip), %rdi      # 0x312f
leaq 0x1b23(%rip), %rsi      # 0x300b
leaq 0x1beb(%rip), %rcx      # 0x30da
pushq $0x59
jmp 0x15de
leaq 0x1c49(%rip), %rdi      # 0x3146
leaq 0x1b07(%rip), %rsi      # 0x300b
leaq 0x1bcf(%rip), %rcx      # 0x30da
pushq $0x5a
jmp 0x15de
leaq 0x1c48(%rip), %rdi      # 0x3161
leaq 0x1aeb(%rip), %rsi      # 0x300b
leaq 0x1bb3(%rip), %rcx      # 0x30da
pushq $0x5b
jmp 0x15de
leaq 0x1c47(%rip), %rdi      # 0x317c
leaq 0x1acf(%rip), %rsi      # 0x300b
leaq 0x1b97(%rip), %rcx      # 0x30da
pushq $0x5c
jmp 0x15de
leaq 0x1bde(%rip), %rdi      # 0x312f
leaq 0x1ab3(%rip), %rsi      # 0x300b
leaq 0x1b7b(%rip), %rcx      # 0x30da
pushq $0x61
jmp 0x15de
leaq 0x1bdc(%rip), %rdi      # 0x3146
leaq 0x1a9a(%rip), %rsi      # 0x300b
leaq 0x1b62(%rip), %rcx      # 0x30da
pushq $0x62
jmp 0x15de
leaq 0x1bde(%rip), %rdi      # 0x3161
leaq 0x1a81(%rip), %rsi      # 0x300b
leaq 0x1b49(%rip), %rcx      # 0x30da
pushq $0x63
jmp 0x15de
leaq 0x1be0(%rip), %rdi      # 0x317c
leaq 0x1a68(%rip), %rsi      # 0x300b
leaq 0x1b30(%rip), %rcx      # 0x30da
pushq $0x64
jmp 0x15de
leaq 0x1b4f(%rip), %rdi      # 0x3104
leaq 0x1a4f(%rip), %rsi      # 0x300b
leaq 0x1b17(%rip), %rcx      # 0x30da
pushq $0x58
jmp 0x15de
leaq 0x1b36(%rip), %rdi      # 0x3104
leaq 0x1a36(%rip), %rsi      # 0x300b
leaq 0x1afe(%rip), %rcx      # 0x30da
pushq $0x60
popq %rdx
callq 0x1040