// File: /workspace/github_c_makefile_star2_O0/cgaebel[P]pipe/pipe.c
// Function: _pipe_push
void __pipe_push(pipe_t* p,
                 const void* restrict elems,
                 size_t count)
{
    size_t elem_size = __pipe_elem_size(p);

    if(unlikely(count == 0))
        return;

    size_t pushed = 0;

    { mutex_lock(&p->end_lock);
        size_t max_cap;
        snapshot_t s = wait_for_room(p, &max_cap);

        // if no more consumers...
        if(unlikely(p->consumer_refcount == 0))
        {
            mutex_unlock(&p->end_lock);
            return;
        }

        s = validate_size(p, s, count);

        // Finally, we can now begin with pushing as many elements into the
        // queue as possible.
        p->end = process_push(s, elems,
                     pushed = min(count, capacity(s) - bytes_in_use(s)));
    } mutex_unlock(&p->end_lock);

    assertume(pushed > 0);

    // Signal if we've only pushed one element, broadcast if we've pushed more.
    if(unlikely(pushed == elem_size))
        cond_signal(&p->just_pushed);
    else
        cond_broadcast(&p->just_pushed);

    // We might not be done pushing. If the max_cap was reached, we'll need to
    // recurse.
    size_t bytes_remaining = count - pushed;

    if(unlikely(bytes_remaining))
        __pipe_push(p, (const char*)elems + pushed, bytes_remaining);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1290
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x18(%rbp)
sete %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x1dbe
jmp 0x2002
movq $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rdi
addq $0x70, %rdi
callq 0x1160
movq -0x8(%rbp), %rsi
leaq -0x58(%rbp), %rdi
leaq -0x30(%rbp), %rdx
callq 0x2010
movq -0x8(%rbp), %rax
cmpq $0x0, 0x40(%rax)
sete %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x1e0f
movq -0x8(%rbp), %rdi
addq $0x70, %rdi
callq 0x10e0
jmp 0x2002
movq -0x8(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x20(%rax)
movups -0x58(%rbp), %xmm0
movups -0x48(%rbp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
leaq -0x80(%rbp), %rdi
callq 0x2160
leaq -0x58(%rbp), %rdi
leaq -0x80(%rbp), %rsi
movl $0x28, %edx
callq 0x10c0
movq -0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x38(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x20(%rax)
movups -0x58(%rbp), %xmm0
movups -0x48(%rbp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x2490
movq %rax, -0x98(%rbp)
movq -0x38(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x20(%rax)
movups -0x58(%rbp), %xmm0
movups -0x48(%rbp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x24b0
movq -0x98(%rbp), %rcx
movq %rax, %rdx
movq -0x90(%rbp), %rax
subq %rdx, %rcx
cmpq %rcx, %rax
ja 0x1ecd
movq -0x18(%rbp), %rax
movq %rax, -0xa8(%rbp)
jmp 0x1f26
movq -0x38(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x20(%rax)
movups -0x58(%rbp), %xmm0
movups -0x48(%rbp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x2490
movq %rax, -0xb0(%rbp)
movq -0x38(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x20(%rax)
movups -0x58(%rbp), %xmm0
movups -0x48(%rbp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x24b0
movq %rax, %rcx
movq -0xb0(%rbp), %rax
subq %rcx, %rax
movq %rax, -0xa8(%rbp)
movq -0xa0(%rbp), %rdi
movq -0xa8(%rbp), %rsi
movq %rsi, -0x28(%rbp)
movq -0x38(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x20(%rax)
movups -0x58(%rbp), %xmm0
movups -0x48(%rbp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x2310
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rdi
addq $0x70, %rdi
callq 0x10e0
cmpq $0x0, -0x28(%rbp)
jbe 0x1f78
jmp 0x1f97
leaq 0x317e(%rip), %rdi      # 0x50fd
leaq 0x30d9(%rip), %rsi      # 0x505f
movl $0x37d, %edx            # imm = 0x37D
leaq 0x3176(%rip), %rcx      # 0x5108
callq 0x1080
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
sete %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x1fc1
movq -0x8(%rbp), %rdi
addq $0x98, %rdi
callq 0x10b0
jmp 0x1fd1
movq -0x8(%rbp), %rdi
addq $0x98, %rdi
callq 0x1040
movq -0x18(%rbp), %rax
subq -0x28(%rbp), %rax
movq %rax, -0x88(%rbp)
cmpq $0x0, -0x88(%rbp)
je 0x2002
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq -0x28(%rbp), %rsi
movq -0x88(%rbp), %rdx
callq 0x1d80
addq $0xe0, %rsp
popq %rbp
retq
nopl (%rax,%rax)