// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x50, %rsp
xorl %eax, %eax
movl %eax, %edi
callq 0x1470
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jne 0x168d
jmp 0x16ac
leaq 0x2a46(%rip), %rdi      # 0x40da
leaq 0x2970(%rip), %rsi      # 0x400b
movl $0x55, %edx
leaq 0x2a59(%rip), %rcx      # 0x4100
callq 0x1040
movl $0x1, %edi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x1190
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
callq 0x1470
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jne 0x16d6
jmp 0x16f5
leaq 0x2a4d(%rip), %rdi      # 0x412a
leaq 0x2927(%rip), %rsi      # 0x400b
movl $0x58, %edx
leaq 0x2a10(%rip), %rcx      # 0x4100
callq 0x1040
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x38(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq *%rax
testb $0x1, %al
jne 0x170d
jmp 0x170f
jmp 0x172e
leaq 0x2a3f(%rip), %rdi      # 0x4155
leaq 0x28ee(%rip), %rsi      # 0x400b
movl $0x59, %edx
leaq 0x29d7(%rip), %rcx      # 0x4100
callq 0x1040
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x38(%rbp), %rdi
leaq -0x30(%rbp), %rsi
addq $0x4, %rsi
callq *%rax
testb $0x1, %al
jne 0x174a
jmp 0x174c
jmp 0x176b
leaq 0x2a19(%rip), %rdi      # 0x416c
leaq 0x28b1(%rip), %rsi      # 0x400b
movl $0x5a, %edx
leaq 0x299a(%rip), %rcx      # 0x4100
callq 0x1040
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x38(%rbp), %rdi
leaq -0x30(%rbp), %rsi
addq $0x8, %rsi
callq *%rax
testb $0x1, %al
jne 0x1787
jmp 0x1789
jmp 0x17a8
leaq 0x29f7(%rip), %rdi      # 0x4187
leaq 0x2874(%rip), %rsi      # 0x400b
movl $0x5b, %edx
leaq 0x295d(%rip), %rcx      # 0x4100
callq 0x1040
leaq -0x30(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
callq 0x1470
movq %rax, %rcx
movq -0x40(%rbp), %rax
cmpq %rcx, %rax
jne 0x17cb
jmp 0x17ea
leaq 0x29d0(%rip), %rdi      # 0x41a2
leaq 0x2832(%rip), %rsi      # 0x400b
movl $0x5c, %edx
leaq 0x291b(%rip), %rcx      # 0x4100
callq 0x1040
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x38(%rbp), %rdi
callq *%rax
movq %rax, -0x38(%rbp)
movl $0x1, %edi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x1190
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
callq 0x1470
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jne 0x1826
jmp 0x1845
leaq 0x28fd(%rip), %rdi      # 0x412a
leaq 0x27d7(%rip), %rsi      # 0x400b
movl $0x60, %edx
leaq 0x28c0(%rip), %rcx      # 0x4100
callq 0x1040
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x38(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq *%rax
testb $0x1, %al
jne 0x185d
jmp 0x185f
jmp 0x187e
leaq 0x28ef(%rip), %rdi      # 0x4155
leaq 0x279e(%rip), %rsi      # 0x400b
movl $0x61, %edx
leaq 0x2887(%rip), %rcx      # 0x4100
callq 0x1040
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x38(%rbp), %rdi
leaq -0x30(%rbp), %rsi
addq $0x4, %rsi
callq *%rax
testb $0x1, %al
jne 0x189a
jmp 0x189c
jmp 0x18bb
leaq 0x28c9(%rip), %rdi      # 0x416c
leaq 0x2761(%rip), %rsi      # 0x400b
movl $0x62, %edx
leaq 0x284a(%rip), %rcx      # 0x4100
callq 0x1040
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x38(%rbp), %rdi
leaq -0x30(%rbp), %rsi
addq $0x8, %rsi
callq *%rax
testb $0x1, %al
jne 0x18d7
jmp 0x18d9
jmp 0x18f8
leaq 0x28a7(%rip), %rdi      # 0x4187
leaq 0x2724(%rip), %rsi      # 0x400b
movl $0x63, %edx
leaq 0x280d(%rip), %rcx      # 0x4100
callq 0x1040
leaq -0x30(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rdi
callq 0x1470
movq %rax, %rcx
movq -0x48(%rbp), %rax
cmpq %rcx, %rax
jne 0x191b
jmp 0x193a
leaq 0x2880(%rip), %rdi      # 0x41a2
leaq 0x26e2(%rip), %rsi      # 0x400b
movl $0x64, %edx
leaq 0x27cb(%rip), %rcx      # 0x4100
callq 0x1040
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x38(%rbp), %rdi
callq *%rax
movq %rax, -0x38(%rbp)
movq 0x4685(%rip), %rax      # 0x5fd8
movq (%rax), %rdi
leaq 0x2874(%rip), %rsi      # 0x41d1
movb $0x0, %al
callq 0x1070
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)