// File: /workspace/github_c_makefile_star2_O3/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 0xdd8d
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 0xddc9
movq %rdx, %rcx
movl %eax, %edx
addq %r12, %rdx
addl $0x8, %eax
movl %eax, (%rsp)
jmp 0xddd2
leaq 0x8(%rdx), %rcx
movq %rcx, 0x8(%rsp)
movl (%rdx), %edx
testl %edx, %edx
je 0xddfc
cmpl $0x28, %eax
ja 0xdde5
addl $0x8, %eax
movl %eax, (%rsp)
jmp 0xddee
addq $0x8, %rcx
movq %rcx, 0x8(%rsp)
movl %edx, %esi
negl %esi
cmovsl %edx, %esi
addl %esi, %ebp
movq %rcx, %rdx
jmp 0xddb4
movl %ebp, %r14d
xorl %edi, %edi
movq %r14, %rsi
callq 0x9def
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 0xde3e
movq %rdx, %rcx
addq 0x10(%rsp), %rcx
addl $0x8, %edx
movl %edx, (%rsp)
jmp 0xde4c
movq 0x8(%rsp), %rcx
leaq 0x8(%rcx), %rsi
movq %rsi, 0x8(%rsp)
movl (%rcx), %ecx
testl %ecx, %ecx
je 0xdea5
cmpl $0x28, %edx
ja 0xde66
movl %edx, %esi
addq 0x10(%rsp), %rsi
addl $0x8, %edx
movl %edx, (%rsp)
jmp 0xde74
movq 0x8(%rsp), %rsi
leaq 0x8(%rsi), %rdx
movq %rdx, 0x8(%rsp)
movq (%rsi), %rdx
testl %ecx, %ecx
js 0xde8a
movb %dl, (%rax)
incq %rax
shrq $0x8, %rdx
decl %ecx
jne 0xde7b
jmp 0xde25
notl %ecx
shll $0x3, %ecx
movq %rdx, %rsi
shrq %cl, %rsi
movb %sil, (%rax)
incq %rax
addl $-0x8, %ecx
cmpl $-0x8, %ecx
jne 0xde8f
jmp 0xde25
movl %ebx, %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0xc0bf
movq %r15, %rdi
callq 0x3050
movl %ebp, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq