// File: /workspace/github_c_makefile_star2_O1/cgaebel[P]pipe/pipe.c
// Function: check_invariants
static inline void check_invariants(pipe_t* p)
{
    if(p == NULL) return;

    // p->buffer may be NULL. When it is, we must have no issued consumers.
    // It's just a way to save memory when we've deallocated all consumers
    // and people are still trying to push like idiots.
    if(p->buffer == NULL)
    {
        assertume(p->consumer_refcount == 0);
        return;
    }
    else
    {
        assertume(p->consumer_refcount != 0);
    }

    snapshot_t s = make_snapshot(p);

    assertume(s.begin);
    assertume(s.end);
    assertume(s.bufend);

    assertume(p->elem_size != 0);

    assertume(bytes_in_use(s) <= capacity(s)
            && "There are more elements in the buffer than its capacity.");

    assertume(in_bounds(s.buffer, s.begin, s.bufend));
    assertume(in_bounds(s.buffer, s.end, s.bufend));

    if(s.begin == s.end)
        assertume(bytes_in_use(s) == capacity(s));

    //assertume(in_bounds(DEFAULT_MINCAP*p->elem_size, p->min_cap, p->max_cap));
    assertume(in_bounds(p->min_cap, capacity(s) + p->elem_size, p->max_cap));
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x1668
movq 0x18(%rdi), %rax
movq 0x40(%rdi), %rcx
testq %rax, %rax
je 0x165f
testq %rcx, %rcx
je 0x166a
movq 0x28(%rdi), %rdx
testq %rdx, %rdx
je 0x1689
movq 0x30(%rdi), %rsi
testq %rsi, %rsi
je 0x16a8
movq 0x20(%rdi), %rcx
testq %rcx, %rcx
je 0x16c7
movq (%rdi), %r8
testq %r8, %r8
je 0x16e6
leaq (%rax,%rdx), %r9
movq %rcx, %r10
subq %r9, %r10
addq %rsi, %r10
movq %rsi, %r11
subq %rdx, %r11
cmovbeq %r10, %r11
subq %r8, %r11
movq %rcx, %r10
subq %r8, %r10
subq %rax, %r10
cmpq %r10, %r11
ja 0x1705
cmpq %rax, %rdx
jb 0x1724
cmpq %rcx, %rdx
ja 0x1724
cmpq %rax, %rsi
jb 0x1743
cmpq %rcx, %rsi
ja 0x1743
cmpq %rsi, %rdx
jne 0x1631
addq %rsi, %rcx
addq %r8, %r9
subq %r9, %rcx
cmpq %r10, %rcx
jne 0x1781
addq %r8, %r10
cmpq 0x8(%rdi), %r10
jb 0x1640
cmpq 0x10(%rdi), %r10
jbe 0x1668
leaq 0x2c56(%rip), %rdi      # 0x429d
leaq 0x2a11(%rip), %rsi      # 0x405f
leaq 0x2b26(%rip), %rcx      # 0x417b
movl $0x206, %edx            # imm = 0x206
callq 0x1090
testq %rcx, %rcx
jne 0x1762
popq %rbx
retq
leaq 0x2b2a(%rip), %rdi      # 0x419b
leaq 0x29e7(%rip), %rsi      # 0x405f
leaq 0x2afc(%rip), %rcx      # 0x417b
movl $0x1f1, %edx            # imm = 0x1F1
callq 0x1090
leaq 0x2b25(%rip), %rdi      # 0x41b5
leaq 0x29c8(%rip), %rsi      # 0x405f
leaq 0x2add(%rip), %rcx      # 0x417b
movl $0x1f6, %edx            # imm = 0x1F6
callq 0x1090
leaq 0x2b0e(%rip), %rdi      # 0x41bd
leaq 0x29a9(%rip), %rsi      # 0x405f
leaq 0x2abe(%rip), %rcx      # 0x417b
movl $0x1f7, %edx            # imm = 0x1F7
callq 0x1090
leaq 0x2c9a(%rip), %rdi      # 0x4368
leaq 0x298a(%rip), %rsi      # 0x405f
leaq 0x2a9f(%rip), %rcx      # 0x417b
movl $0x1f8, %edx            # imm = 0x1F8
callq 0x1090
leaq 0x2ad6(%rip), %rdi      # 0x41c3
leaq 0x296b(%rip), %rsi      # 0x405f
leaq 0x2a80(%rip), %rcx      # 0x417b
movl $0x1fa, %edx            # imm = 0x1FA
callq 0x1090
leaq 0x2ac9(%rip), %rdi      # 0x41d5
leaq 0x294c(%rip), %rsi      # 0x405f
leaq 0x2a61(%rip), %rcx      # 0x417b
movl $0x1fd, %edx            # imm = 0x1FD
callq 0x1090
leaq 0x2b07(%rip), %rdi      # 0x4232
leaq 0x292d(%rip), %rsi      # 0x405f
leaq 0x2a42(%rip), %rcx      # 0x417b
movl $0x1ff, %edx            # imm = 0x1FF
callq 0x1090
leaq 0x2b0f(%rip), %rdi      # 0x4259
leaq 0x290e(%rip), %rsi      # 0x405f
leaq 0x2a23(%rip), %rcx      # 0x417b
movl $0x200, %edx            # imm = 0x200
callq 0x1090
leaq 0x29f8(%rip), %rdi      # 0x4161
leaq 0x28ef(%rip), %rsi      # 0x405f
leaq 0x2a04(%rip), %rcx      # 0x417b
movl $0x1ec, %edx            # imm = 0x1EC
callq 0x1090
leaq 0x2af6(%rip), %rdi      # 0x427e
leaq 0x28d0(%rip), %rsi      # 0x405f
leaq 0x29e5(%rip), %rcx      # 0x417b
movl $0x203, %edx            # imm = 0x203
callq 0x1090