// File: /workspace/github_c_makefile_star2_O2/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 0xd28a
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)
pushq $0x8
popq %rax
xorl %ebp, %ebp
cmpl $0x28, %eax
ja 0xd2c4
movq %rdx, %rcx
movl %eax, %edx
addq %r12, %rdx
addl $0x8, %eax
movl %eax, (%rsp)
jmp 0xd2cd
leaq 0x8(%rdx), %rcx
movq %rcx, 0x8(%rsp)
movl (%rdx), %edx
testl %edx, %edx
je 0xd2f7
cmpl $0x28, %eax
ja 0xd2e0
addl $0x8, %eax
movl %eax, (%rsp)
jmp 0xd2e9
addq $0x8, %rcx
movq %rcx, 0x8(%rsp)
movl %edx, %esi
negl %esi
cmovsl %edx, %esi
addl %esi, %ebp
movq %rcx, %rdx
jmp 0xd2af
movl %ebp, %r14d
xorl %edi, %edi
movq %r14, %rsi
callq 0x9db6
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 0xd339
movq %rdx, %rcx
addq 0x10(%rsp), %rcx
addl $0x8, %edx
movl %edx, (%rsp)
jmp 0xd347
movq 0x8(%rsp), %rcx
leaq 0x8(%rcx), %rsi
movq %rsi, 0x8(%rsp)
movl (%rcx), %ecx
testl %ecx, %ecx
je 0xd3a0
cmpl $0x28, %edx
ja 0xd361
movl %edx, %esi
addq 0x10(%rsp), %rsi
addl $0x8, %edx
movl %edx, (%rsp)
jmp 0xd36f
movq 0x8(%rsp), %rsi
leaq 0x8(%rsi), %rdx
movq %rdx, 0x8(%rsp)
movq (%rsi), %rdx
testl %ecx, %ecx
js 0xd385
movb %dl, (%rax)
incq %rax
shrq $0x8, %rdx
decl %ecx
jne 0xd376
jmp 0xd320
notl %ecx
shll $0x3, %ecx
movq %rdx, %rsi
shrq %cl, %rsi
movb %sil, (%rax)
incq %rax
addl $-0x8, %ecx
cmpl $-0x8, %ecx
jne 0xd38a
jmp 0xd320
movl %ebx, %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0xb58d
movq %r15, %rdi
callq 0x3050
movl %ebp, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq