// File: /workspace/github_c_makefile_star2_O3/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 0x167b
movq 0x18(%rdi), %rcx
movq 0x40(%rdi), %rax
testq %rcx, %rcx
je 0x1672
testq %rax, %rax
je 0x167d
movq 0x28(%rdi), %rax
testq %rax, %rax
je 0x169c
movq 0x30(%rdi), %r8
testq %r8, %r8
je 0x16bb
movq 0x20(%rdi), %rdx
testq %rdx, %rdx
je 0x16da
movq (%rdi), %rsi
testq %rsi, %rsi
je 0x16f9
leaq (%rcx,%rax), %r9
movq %rdx, %r10
subq %r9, %r10
movq %rax, %r11
negq %r11
cmpq %r8, %rax
cmovaeq %r10, %r11
addq %r8, %r11
subq %rsi, %r11
movq %rdx, %r10
subq %rsi, %r10
subq %rcx, %r10
cmpq %r10, %r11
ja 0x1718
cmpq %rcx, %rax
jb 0x1737
cmpq %rdx, %rax
ja 0x1737
cmpq %rcx, %r8
jb 0x1756
cmpq %rdx, %r8
ja 0x1756
cmpq %r8, %rax
jne 0x1644
addq %rax, %rdx
addq %rsi, %r9
subq %r9, %rdx
cmpq %r10, %rdx
jne 0x1794
addq %rsi, %r10
cmpq 0x8(%rdi), %r10
jb 0x1653
cmpq 0x10(%rdi), %r10
jbe 0x167b
leaq 0x2bff(%rip), %rdi      # 0x4259
leaq 0x29fe(%rip), %rsi      # 0x405f
leaq 0x2acf(%rip), %rcx      # 0x4137
movl $0x206, %edx            # imm = 0x206
callq 0x1090
testq %rax, %rax
jne 0x1775
popq %rbx
retq
leaq 0x2ad3(%rip), %rdi      # 0x4157
leaq 0x29d4(%rip), %rsi      # 0x405f
leaq 0x2aa5(%rip), %rcx      # 0x4137
movl $0x1f1, %edx            # imm = 0x1F1
callq 0x1090
leaq 0x2ace(%rip), %rdi      # 0x4171
leaq 0x29b5(%rip), %rsi      # 0x405f
leaq 0x2a86(%rip), %rcx      # 0x4137
movl $0x1f6, %edx            # imm = 0x1F6
callq 0x1090
leaq 0x2ab7(%rip), %rdi      # 0x4179
leaq 0x2996(%rip), %rsi      # 0x405f
leaq 0x2a67(%rip), %rcx      # 0x4137
movl $0x1f7, %edx            # imm = 0x1F7
callq 0x1090
leaq 0x2c43(%rip), %rdi      # 0x4324
leaq 0x2977(%rip), %rsi      # 0x405f
leaq 0x2a48(%rip), %rcx      # 0x4137
movl $0x1f8, %edx            # imm = 0x1F8
callq 0x1090
leaq 0x2a7f(%rip), %rdi      # 0x417f
leaq 0x2958(%rip), %rsi      # 0x405f
leaq 0x2a29(%rip), %rcx      # 0x4137
movl $0x1fa, %edx            # imm = 0x1FA
callq 0x1090
leaq 0x2a72(%rip), %rdi      # 0x4191
leaq 0x2939(%rip), %rsi      # 0x405f
leaq 0x2a0a(%rip), %rcx      # 0x4137
movl $0x1fd, %edx            # imm = 0x1FD
callq 0x1090
leaq 0x2ab0(%rip), %rdi      # 0x41ee
leaq 0x291a(%rip), %rsi      # 0x405f
leaq 0x29eb(%rip), %rcx      # 0x4137
movl $0x1ff, %edx            # imm = 0x1FF
callq 0x1090
leaq 0x2ab8(%rip), %rdi      # 0x4215
leaq 0x28fb(%rip), %rsi      # 0x405f
leaq 0x29cc(%rip), %rcx      # 0x4137
movl $0x200, %edx            # imm = 0x200
callq 0x1090
leaq 0x29a1(%rip), %rdi      # 0x411d
leaq 0x28dc(%rip), %rsi      # 0x405f
leaq 0x29ad(%rip), %rcx      # 0x4137
movl $0x1ec, %edx            # imm = 0x1EC
callq 0x1090
leaq 0x2a9f(%rip), %rdi      # 0x423a
leaq 0x28bd(%rip), %rsi      # 0x405f
leaq 0x298e(%rip), %rcx      # 0x4137
movl $0x203, %edx            # imm = 0x203
callq 0x1090