// File: /workspace/github_c_makefile_star2_O0/madler[P]pigz/pigz.c
// Function: put_trailer
local void put_trailer(length_t ulen, length_t clen,
                       unsigned long check, length_t head) {
    if (g.form > 1) {               // zip
        // write Zip64 data descriptor, as promised in the local header
        length_t desc = put(g.outd,
            4, (val_t)0x08074b50,
            4, (val_t)check,
            8, (val_t)clen,
            8, (val_t)ulen,
            0);

        // zip64 is true if either the compressed or the uncompressed length
        // does not fit in 32 bits, in which case there needs to be a Zip64
        // extra block in the central directory entry
        int zip64 = ulen >= LOW32 || clen >= LOW32;

        // write central file header
        length_t cent = put(g.outd,
            4, (val_t)0x02014b50,   // central header signature
            1, (val_t)45,           // made by 4.5 for Zip64 V1 end record
            1, (val_t)255,          // ignore external attributes
            2, (val_t)45,           // version needed to extract (4.5)
            2, (val_t)8,            // data descriptor is present
            2, (val_t)8,            // deflate
            4, (val_t)time2dos(g.mtime),
            4, (val_t)check,        // crc
            4, (val_t)(zip64 ? LOW32 : clen),   // compressed length
            4, (val_t)(zip64 ? LOW32 : ulen),   // uncompressed length
            2, (val_t)(strlen(g.name == NULL ? g.alias : g.name)),  // name len
            2, (val_t)(zip64 ? 29 : 9), // extra field size (see below)
            2, (val_t)(g.comment == NULL ? 0 : strlen(g.comment)),  // comment
            2, (val_t)0,            // disk number 0
            2, (val_t)0,            // internal file attributes
            4, (val_t)0,            // external file attributes (ignored)
            4, (val_t)0,            // offset of local header
            0);

        // write file name (use g.alias for stdin)
        cent += writen(g.outd, g.name == NULL ? g.alias : g.name,
                       strlen(g.name == NULL ? g.alias : g.name));

        // write Zip64 extra field block (20 bytes)
        if (zip64)
            cent += put(g.outd,
                2, (val_t)0x0001,   // Zip64 extended information ID
                2, (val_t)16,       // number of data bytes in this block
                8, (val_t)ulen,     // uncompressed length
                8, (val_t)clen,     // compressed length
                0);

        // write extended timestamp extra field block (9 bytes)
        cent += put(g.outd,
            2, (val_t)0x5455,       // extended timestamp signature
            2, (val_t)5,            // number of data bytes in this block
            1, (val_t)1,            // flag presence of mod time
            4, (val_t)g.mtime,      // mod time
            0);

        // write comment, if requested
        if (g.comment != NULL)
            cent += writen(g.outd, g.comment, strlen(g.comment));

        // here zip64 is true if the offset of the central directory does not
        // fit in 32 bits, in which case insert the Zip64 end records to
        // provide a 64-bit offset
        zip64 = head + clen + desc >= LOW32;
        if (zip64) {
            // write Zip64 end of central directory record and locator
            put(g.outd,
                4, (val_t)0x06064b50,   // Zip64 end of central dir sig
                8, (val_t)44,       // size of the remainder of this record
                2, (val_t)45,       // version made by
                2, (val_t)45,       // version needed to extract
                4, (val_t)0,        // number of this disk
                4, (val_t)0,        // disk with start of central directory
                8, (val_t)1,        // number of entries on this disk
                8, (val_t)1,        // total number of entries
                8, (val_t)cent,     // size of central directory
                8, (val_t)(head + clen + desc), // central dir offset
                4, (val_t)0x07064b50,   // Zip64 end locator signature
                4, (val_t)0,        // disk with Zip64 end of central dir
                8, (val_t)(head + clen + desc + cent),  // location
                4, (val_t)1,        // total number of disks
                0);
        }

        // write end of central directory record
        put(g.outd,
            4, (val_t)0x06054b50,   // end of central directory signature
            2, (val_t)0,            // number of this disk
            2, (val_t)0,            // disk with start of central directory
            2, (val_t)(zip64 ? 0xffff : 1), // entries on this disk
            2, (val_t)(zip64 ? 0xffff : 1), // total number of entries
            4, (val_t)(zip64 ? LOW32 : cent),   // size of central directory
            4, (val_t)(zip64 ? LOW32 : head + clen + desc), // offset
            2, (val_t)0,            // no zip file comment
            0);
    }
    else if (g.form)                // zlib
        put(g.outd,
            -4, (val_t)check,       // zlib format uses big-endian order
            0);
    else                            // gzip
        put(g.outd,
            4, (val_t)check,
            4, (val_t)ulen,
            0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1f0, %rsp            # imm = 0x1F0
movq %rdi, -0x28(%rbp)
movq %rsi, -0x30(%rbp)
movq %rdx, -0x38(%rbp)
movq %rcx, -0x40(%rbp)
cmpl $0x1, 0x1304f(%rip)     # 0x237c8
jle 0x10e55
movl 0x1300f(%rip), %edi     # 0x23794
movq -0x38(%rbp), %r8
movq -0x30(%rbp), %r10
movq -0x28(%rbp), %rax
movl $0x4, %ecx
movl $0x8074b50, %edx        # imm = 0x8074B50
movl $0x8, %r9d
xorl %esi, %esi
movl %ecx, %esi
movq %r10, (%rsp)
movl $0x8, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movl $0x0, 0x18(%rsp)
movb $0x0, %al
callq 0x10eb0
movl %eax, %eax
movq %rax, -0x48(%rbp)
movb $0x1, %al
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, -0x28(%rbp)
movb %al, -0x59(%rbp)
jae 0x107ea
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, -0x30(%rbp)
setae %al
movb %al, -0x59(%rbp)
movb -0x59(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4c(%rbp)
movl 0x12f99(%rip), %eax     # 0x23794
movl %eax, -0x74(%rbp)
movq 0x12ff3(%rip), %rdi     # 0x237f8
callq 0x111d0
movq %rax, -0x70(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x68(%rbp)
cmpl $0x0, -0x4c(%rbp)
je 0x10827
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, -0x80(%rbp)
jmp 0x1082f
movq -0x30(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x88(%rbp)
cmpl $0x0, -0x4c(%rbp)
je 0x1084e
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, -0x90(%rbp)
jmp 0x10859
movq -0x28(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x98(%rbp)
cmpq $0x0, 0x12f71(%rip)     # 0x237e0
jne 0x10881
movq 0x12f70(%rip), %rax     # 0x237e8
movq %rax, -0xa0(%rbp)
jmp 0x1088f
movq 0x12f58(%rip), %rax     # 0x237e0
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rdi
callq 0x31a0
movq %rax, -0xb0(%rbp)
movl -0x4c(%rbp), %edx
movl $0x9, %eax
movl $0x1d, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
cltq
movq %rax, -0xa8(%rbp)
cmpq $0x0, 0x12f2a(%rip)     # 0x237f0
jne 0x108d3
xorl %eax, %eax
movq %rax, -0xb8(%rbp)
jmp 0x108e6
movq 0x12f16(%rip), %rdi     # 0x237f0
callq 0x31a0
movq %rax, -0xb8(%rbp)
movq -0xa8(%rbp), %r10
movq -0xb0(%rbp), %r11
movq -0x98(%rbp), %rbx
movq -0x88(%rbp), %r14
movq -0x68(%rbp), %r15
movq -0x70(%rbp), %r12
movl -0x74(%rbp), %edi
movq -0xb8(%rbp), %rax
movl $0x4, %esi
movl $0x2014b50, %edx        # imm = 0x2014B50
movl $0x1, %r9d
movl $0x2d, %r8d
xorl %ecx, %ecx
xorl %ecx, %ecx
movl %r9d, %ecx
movq $0xff, (%rsp)
movl $0x2, 0x8(%rsp)
movq $0x2d, 0x10(%rsp)
movl $0x2, 0x18(%rsp)
movq $0x8, 0x20(%rsp)
movl $0x2, 0x28(%rsp)
movq $0x8, 0x30(%rsp)
movl $0x4, 0x38(%rsp)
movq %r12, 0x40(%rsp)
movl $0x4, 0x48(%rsp)
movq %r15, 0x50(%rsp)
movl $0x4, 0x58(%rsp)
movq %r14, 0x60(%rsp)
movl $0x4, 0x68(%rsp)
movq %rbx, 0x70(%rsp)
movl $0x2, 0x78(%rsp)
movq %r11, 0x80(%rsp)
movl $0x2, 0x88(%rsp)
movq %r10, 0x90(%rsp)
movl $0x2, 0x98(%rsp)
movq %rax, 0xa0(%rsp)
movl $0x2, 0xa8(%rsp)
movq $0x0, 0xb0(%rsp)
movl $0x2, 0xb8(%rsp)
movq $0x0, 0xc0(%rsp)
movl $0x4, 0xc8(%rsp)
movq $0x0, 0xd0(%rsp)
movl $0x4, 0xd8(%rsp)
movq $0x0, 0xe0(%rsp)
movl $0x0, 0xe8(%rsp)
movb $0x0, %al
callq 0x10eb0
movl %eax, %eax
movq %rax, -0x58(%rbp)
movl 0x12d44(%rip), %eax     # 0x23794
movl %eax, -0xbc(%rbp)
cmpq $0x0, 0x12d82(%rip)     # 0x237e0
jne 0x10a70
movq 0x12d81(%rip), %rax     # 0x237e8
movq %rax, -0xc8(%rbp)
jmp 0x10a7e
movq 0x12d69(%rip), %rax     # 0x237e0
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
movq %rax, -0xd0(%rbp)
cmpq $0x0, 0x12d4c(%rip)     # 0x237e0
jne 0x10aa6
movq 0x12d4b(%rip), %rax     # 0x237e8
movq %rax, -0xd8(%rbp)
jmp 0x10ab4
movq 0x12d33(%rip), %rax     # 0x237e0
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rdi
callq 0x31a0
movl -0xbc(%rbp), %edi
movq -0xd0(%rbp), %rsi
movq %rax, %rdx
callq 0xe2c0
addq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
cmpl $0x0, -0x4c(%rbp)
je 0x10b35
movl 0x12cab(%rip), %edi     # 0x23794
movq -0x28(%rbp), %r10
movq -0x30(%rbp), %rax
movl $0x2, %ecx
movl $0x1, %edx
movl $0x10, %r8d
movl $0x8, %r9d
xorl %esi, %esi
movl %ecx, %esi
movq %r10, (%rsp)
movl $0x8, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movl $0x0, 0x18(%rsp)
movb $0x0, %al
callq 0x10eb0
movl %eax, %eax
addq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
movl 0x12c59(%rip), %edi     # 0x23794
movq 0x12cb6(%rip), %rax     # 0x237f8
movl $0x2, %ecx
movl $0x5455, %edx           # imm = 0x5455
movl $0x5, %r8d
movl $0x1, %r9d
xorl %esi, %esi
movl %ecx, %esi
movq $0x1, (%rsp)
movl $0x4, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movl $0x0, 0x18(%rsp)
movb $0x0, %al
callq 0x10eb0
movl %eax, %eax
addq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, 0x12c5e(%rip)     # 0x237f0
je 0x10bd7
movl 0x12bfa(%rip), %eax     # 0x23794
movl %eax, -0xe4(%rbp)
movq 0x12c49(%rip), %rax     # 0x237f0
movq %rax, -0xe0(%rbp)
movq 0x12c3b(%rip), %rdi     # 0x237f0
callq 0x31a0
movl -0xe4(%rbp), %edi
movq -0xe0(%rbp), %rsi
movq %rax, %rdx
callq 0xe2c0
addq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x40(%rbp), %rax
addq -0x30(%rbp), %rax
addq -0x48(%rbp), %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %rax
setae %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x4c(%rbp)
je 0x10d23
movl 0x12b8e(%rip), %edi     # 0x23794
movq -0x58(%rbp), %r11
movq -0x40(%rbp), %r10
addq -0x30(%rbp), %r10
addq -0x48(%rbp), %r10
movq -0x40(%rbp), %rax
addq -0x30(%rbp), %rax
addq -0x48(%rbp), %rax
addq -0x58(%rbp), %rax
movl $0x4, %esi
movl $0x6064b50, %edx        # imm = 0x6064B50
movl $0x8, %ecx
movl $0x2c, %r8d
movl $0x2, %r9d
xorl %ebx, %ebx
xorl %ebx, %ebx
movq $0x2d, (%rsp)
movl $0x2, 0x8(%rsp)
movq $0x2d, 0x10(%rsp)
movl $0x4, 0x18(%rsp)
movq $0x0, 0x20(%rsp)
movl $0x4, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
movl $0x8, 0x38(%rsp)
movq $0x1, 0x40(%rsp)
movl $0x8, 0x48(%rsp)
movq $0x1, 0x50(%rsp)
movl $0x8, 0x58(%rsp)
movq %r11, 0x60(%rsp)
movl $0x8, 0x68(%rsp)
movq %r10, 0x70(%rsp)
movl $0x4, 0x78(%rsp)
movq $0x7064b50, 0x80(%rsp) # imm = 0x7064B50
movl $0x4, 0x88(%rsp)
movq $0x0, 0x90(%rsp)
movl $0x8, 0x98(%rsp)
movq %rax, 0xa0(%rsp)
movl $0x4, 0xa8(%rsp)
movq $0x1, 0xb0(%rsp)
movl $0x0, 0xb8(%rsp)
movb $0x0, %al
callq 0x10eb0
movl 0x12a6b(%rip), %eax     # 0x23794
movl %eax, -0xfc(%rbp)
movl -0x4c(%rbp), %edx
movl $0x1, %eax
movl $0xffff, %ecx           # imm = 0xFFFF
cmpl $0x0, %edx
cmovnel %ecx, %eax
cltq
movq %rax, -0xf8(%rbp)
movl -0x4c(%rbp), %edx
movl $0x1, %eax
movl $0xffff, %ecx           # imm = 0xFFFF
cmpl $0x0, %edx
cmovnel %ecx, %eax
cltq
movq %rax, -0xf0(%rbp)
cmpl $0x0, -0x4c(%rbp)
je 0x10d7b
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, -0x108(%rbp)
jmp 0x10d86
movq -0x58(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x108(%rbp), %rax
movq %rax, -0x110(%rbp)
cmpl $0x0, -0x4c(%rbp)
je 0x10da8
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, -0x118(%rbp)
jmp 0x10dbb
movq -0x40(%rbp), %rax
addq -0x30(%rbp), %rax
addq -0x48(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x110(%rbp), %r10
movq -0xf0(%rbp), %r11
movq -0xf8(%rbp), %rbx
movl -0xfc(%rbp), %edi
movq -0x118(%rbp), %rax
movl $0x4, %esi
movl $0x6054b50, %edx        # imm = 0x6054B50
movl $0x2, %r9d
xorl %ecx, %ecx
movl %ecx, %r8d
xorl %ecx, %ecx
movl %r9d, %ecx
movq $0x0, (%rsp)
movl $0x2, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movl $0x2, 0x18(%rsp)
movq %r11, 0x20(%rsp)
movl $0x4, 0x28(%rsp)
movq %r10, 0x30(%rsp)
movl $0x4, 0x38(%rsp)
movq %rax, 0x40(%rsp)
movl $0x2, 0x48(%rsp)
movq $0x0, 0x50(%rsp)
movl $0x0, 0x58(%rsp)
movb $0x0, %al
callq 0x10eb0
jmp 0x10e99
cmpl $0x0, 0x1296c(%rip)     # 0x237c8
je 0x10e78
movl 0x12930(%rip), %edi     # 0x23794
movq -0x38(%rbp), %rdx
movl $0xfffffffc, %esi       # imm = 0xFFFFFFFC
xorl %ecx, %ecx
movb $0x0, %al
callq 0x10eb0
jmp 0x10e97
movl 0x12916(%rip), %edi     # 0x23794
movq -0x38(%rbp), %rdx
movq -0x28(%rbp), %r8
movl $0x4, %ecx
xorl %r9d, %r9d
movl %ecx, %esi
movb $0x0, %al
callq 0x10eb0
jmp 0x10e99
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)