// File: /workspace/github_c_makefile_star2_O1/madler[P]pigz/pigz.c
// Function: put
local unsigned put(int out, ...) {
    // compute the total number of bytes
    unsigned count = 0;
    int n;
    va_list ap;
    va_start(ap, out);
    while ((n = va_arg(ap, int)) != 0) {
        va_arg(ap, val_t);
        count += (unsigned)abs(n);
    }
    va_end(ap);

    // allocate memory for the data
    unsigned char *wrap = alloc(NULL, count);
    unsigned char *next = wrap;

    // write the requested data to wrap[]
    va_start(ap, out);
    while ((n = va_arg(ap, int)) != 0) {
        val_t val = va_arg(ap, val_t);
        if (n < 0) {            // big endian
            n = -n << 3;
            do {
                n -= 8;
                *next++ = (unsigned char)(val >> n);
            } while (n);
        }
        else                    // little endian
            do {
                *next++ = (unsigned char)val;
                val >>= 8;
            } while (--n);
    }
    va_end(ap);

    // write wrap[] to out and return the number of bytes written
    writen(out, wrap, count);
    FREE(wrap);
    return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movl %edi, %ebx
leaq 0x20(%rsp), %r12
movq %rsi, 0x8(%r12)
movq %rdx, 0x10(%r12)
movq %rcx, 0x18(%r12)
movq %r8, 0x20(%r12)
movq %r9, 0x28(%r12)
testb %al, %al
je 0xd9f7
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %r12, 0x10(%rsp)
leaq 0x110(%rsp), %rdx
movq %rdx, 0x8(%rsp)
movabsq $0x3000000008, %r13     # imm = 0x3000000008
movq %r13, (%rsp)
movl $0x8, %eax
xorl %ebp, %ebp
cmpl $0x28, %eax
ja 0xda33
movq %rdx, %rcx
movl %eax, %edx
addq %r12, %rdx
addl $0x8, %eax
movl %eax, (%rsp)
jmp 0xda3c
leaq 0x8(%rdx), %rcx
movq %rcx, 0x8(%rsp)
movl (%rdx), %edx
testl %edx, %edx
je 0xda66
cmpl $0x28, %eax
ja 0xda4f
addl $0x8, %eax
movl %eax, (%rsp)
jmp 0xda58
addq $0x8, %rcx
movq %rcx, 0x8(%rsp)
movl %edx, %esi
negl %esi
cmovsl %edx, %esi
addl %esi, %ebp
movq %rcx, %rdx
jmp 0xda1e
movl %ebp, %r14d
xorl %edi, %edi
movq %r14, %rsi
callq 0x9af2
movq %rax, %r15
movq %r13, (%rsp)
leaq 0x110(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r12, 0x10(%rsp)
movq %r15, %rax
movl (%rsp), %edx
cmpq $0x28, %rdx
ja 0xdaa8
movq %rdx, %rcx
addq 0x10(%rsp), %rcx
addl $0x8, %edx
movl %edx, (%rsp)
jmp 0xdab6
movq 0x8(%rsp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsp)
movl (%rcx), %ecx
testl %ecx, %ecx
je 0xdb17
movl (%rsp), %esi
cmpq $0x28, %rsi
ja 0xdad5
movq %rsi, %rdx
addq 0x10(%rsp), %rdx
addl $0x8, %esi
movl %esi, (%rsp)
jmp 0xdae3
movq 0x8(%rsp), %rdx
leaq 0x8(%rdx), %rsi
movq %rsi, 0x8(%rsp)
movq (%rdx), %rdx
testl %ecx, %ecx
js 0xdaf9
movb %dl, (%rax)
incq %rax
shrq $0x8, %rdx
decl %ecx
jne 0xdaea
jmp 0xda8f
notl %ecx
shll $0x3, %ecx
movq %rdx, %rsi
shrq %cl, %rsi
movb %sil, (%rax)
incq %rax
addl $-0x8, %ecx
cmpl $-0x8, %ecx
jne 0xdafe
jmp 0xda8f
movl %ebx, %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0xbcde
movq %r15, %rdi
callq 0x3050
movl %ebp, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq