LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/png/deflate.c
// Function: deflateBound
uLong ZEXPORT deflateBound(strm, sourceLen)
    z_streamp strm;
    uLong sourceLen;
{
    deflate_state *s;
    uLong complen, wraplen;
    Bytef *str;

    /* conservative upper bound for compressed data */
    complen = sourceLen +
              ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 5;

    /* if can't get parameters, return conservative bound plus zlib wrapper */
    if (strm == Z_NULL || strm->state == Z_NULL)
        return complen + 6;

    /* compute wrapper length */
    s = strm->state;
    switch (s->wrap) {
    case 0:                                 /* raw deflate */
        wraplen = 0;
        break;
    case 1:                                 /* zlib wrapper */
        wraplen = 6 + (s->strstart ? 4 : 0);
        break;
    case 2:                                 /* gzip wrapper */
        wraplen = 18;
        if (s->gzhead != Z_NULL) {          /* user-supplied gzip header */
            if (s->gzhead->extra != Z_NULL)
                wraplen += 2 + s->gzhead->extra_len;
            str = s->gzhead->name;
            if (str != Z_NULL)
                do {
                    wraplen++;
                } while (*str++);
            str = s->gzhead->comment;
            if (str != Z_NULL)
                do {
                    wraplen++;
                } while (*str++);
            if (s->gzhead->hcrc)
                wraplen += 2;
        }
        break;
    default:                                /* for compiler happiness */
        wraplen = 6;
    }

    /* if not default parameters, return conservative bound */
    if (s->w_bits != 15 || s->hash_bits != 8 + 7)
        return complen + wraplen;

    /* default settings: return tight bound for that case */
    return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
           (sourceLen >> 25) + 13 - 6 + wraplen;
}

// Assembly:
leaq 0x7(%rsi), %rcx
movq %rcx, %rax
shrq $0x3, %rax
addq %rsi, %rax
leaq 0x3f(%rsi), %rdx
shrq $0x6, %rdx
testq %rdi, %rdi
je 0x86498
movq 0x38(%rdi), %rdi
testq %rdi, %rdi
je 0x86498
movl 0x2c(%rdi), %r10d
testq %r10, %r10
je 0x86505
cmpl $0x2, %r10d
je 0x864a0
cmpl $0x1, %r10d
jne 0x864be
xorl %r8d, %r8d
cmpl $0x0, 0x9c(%rdi)
setne %r8b
leaq 0x6(,%r8,4), %r10
jmp 0x86505
addq %rdx, %rax
addq $0xb, %rax
retq
movq 0x30(%rdi), %r8
testq %r8, %r8
je 0x864c2
cmpq $0x0, 0x18(%r8)
je 0x864c8
movl 0x20(%r8), %r9d
addl $0x2, %r9d
addq $0x12, %r9
jmp 0x864cc
pushq $0x6
jmp 0x864c4
pushq $0x12
popq %r10
jmp 0x86505
pushq $0x12
popq %r9
movq 0x28(%r8), %r10
testq %r10, %r10
je 0x864e2
incq %r9
cmpb $0x0, (%r10)
leaq 0x1(%r10), %r10
jne 0x864d5
movq 0x38(%r8), %r10
testq %r10, %r10
je 0x864f8
incq %r9
cmpb $0x0, (%r10)
leaq 0x1(%r10), %r10
jne 0x864eb
leaq 0x2(%r9), %r10
cmpl $0x0, 0x44(%r8)
cmoveq %r9, %r10
cmpl $0xf, 0x48(%rdi)
jne 0x86533
cmpl $0xf, 0x78(%rdi)
jne 0x86533
movq %rsi, %rax
shrq $0xc, %rax
movq %rsi, %rdx
shrq $0xe, %rdx
shrq $0x19, %rsi
addq %rdx, %rsi
addq %rax, %rcx
addq %rsi, %rcx
addq %r10, %rcx
movq %rcx, %rax
retq
addq %rdx, %rax
addq $0x5, %rax
addq %r10, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/png/deflate.c
// Function: flush_pending
local void flush_pending(strm)
    z_streamp strm;
{
    unsigned len = strm->state->pending;

    if (len > strm->avail_out) len = strm->avail_out;
    if (len == 0) return;

    zmemcpy(strm->next_out, strm->state->pending_out, len);
    strm->next_out  += len;
    strm->state->pending_out  += len;
    strm->total_out += len;
    strm->avail_out  -= len;
    strm->state->pending -= len;
    if (strm->state->pending == 0) {
        strm->state->pending_out = strm->state->pending_buf;
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq 0x38(%rdi), %rax
movl 0x28(%rax), %ecx
movl 0x20(%rdi), %ebp
cmpl %ebp, %ecx
cmovbl %ecx, %ebp
testl %ebp, %ebp
je 0x865ae
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq 0x20(%rax), %rsi
movl %ebp, %r14d
movq %r14, %rdx
callq 0xe380
addq %r14, 0x18(%rbx)
movq 0x38(%rbx), %rax
addq %r14, 0x20(%rax)
addq %r14, 0x28(%rbx)
subl %ebp, 0x20(%rbx)
subl %ebp, 0x28(%rax)
jne 0x865ae
movq 0x10(%rax), %rcx
movq %rcx, 0x20(%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/png/inflate.c
// Function: inflateReset
int ZEXPORT inflateReset(strm)
z_streamp strm;
{
    struct inflate_state FAR *state;

    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
    state = (struct inflate_state FAR *)strm->state;
    strm->total_in = strm->total_out = state->total = 0;
    strm->msg = Z_NULL;
    strm->adler = 1;        /* to support ill-conceived Java test suite */
    state->mode = HEAD;
    state->last = 0;
    state->havedict = 0;
    state->dmax = 32768U;
    state->head = Z_NULL;
    state->wsize = 0;
    state->whave = 0;
    state->wnext = 0;
    state->hold = 0;
    state->bits = 0;
    state->lencode = state->distcode = state->next = state->codes;
    state->sane = 1;
    state->back = -1;
    Tracev((stderr, "inflate: reset\n"));
    return Z_OK;
}

// Assembly:
pushq $-0x2
popq %rax
testq %rdi, %rdi
je 0x87655
movq 0x38(%rdi), %rcx
testq %rcx, %rcx
je 0x87655
andq $0x0, 0x20(%rcx)
andq $0x0, 0x10(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rdi)
movq $0x1, 0x60(%rdi)
andq $0x0, (%rcx)
andl $0x0, 0xc(%rcx)
movl $0x8000, 0x14(%rcx)     # imm = 0x8000
andq $0x0, 0x28(%rcx)
andq $0x0, 0x34(%rcx)
andl $0x0, 0x3c(%rcx)
andq $0x0, 0x48(%rcx)
andl $0x0, 0x50(%rcx)
leaq 0x550(%rcx), %rax
movq %rax, 0x88(%rcx)
movq %rax, 0x68(%rcx)
movq %rax, 0x60(%rcx)
movabsq $-0xffffffff, %rax      # imm = 0xFFFFFFFF00000001
movq %rax, 0x1be0(%rcx)
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/png/inflate.c
// Function: inflateReset2
int ZEXPORT inflateReset2(strm, windowBits)
z_streamp strm;
int windowBits;
{
    int wrap;
    struct inflate_state FAR *state;

    /* get the state */
    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
    state = (struct inflate_state FAR *)strm->state;

    /* extract wrap request from windowBits parameter */
    if (windowBits < 0) {
        wrap = 0;
        windowBits = -windowBits;
    }
    else {
        wrap = (windowBits >> 4) + 1;
#ifdef GUNZIP
        if (windowBits < 48)
            windowBits &= 15;
#endif
    }

    /* set number of window bits, free window if different */
    if (windowBits && (windowBits < 8 || windowBits > 15))
        return Z_STREAM_ERROR;
    if (state->window != Z_NULL && state->wbits != (unsigned)windowBits) {
        ZFREE(strm, state->window);
        state->window = Z_NULL;
    }

    /* update state and reset the rest of it */
    state->wrap = wrap;
    state->wbits = (unsigned)windowBits;
    return inflateReset(strm);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x876d4
movq %rdi, %rbx
movq 0x38(%rdi), %r14
testq %r14, %r14
je 0x876d4
movl %esi, %ebp
testl %esi, %esi
js 0x8768b
movl %ebp, %r15d
shrl $0x4, %r15d
incl %r15d
movl %ebp, %eax
andl $0xf, %eax
cmpl $0x30, %ebp
cmovbl %eax, %ebp
jmp 0x87690
negl %ebp
xorl %r15d, %r15d
cmpl $0xf, %ebp
ja 0x876d4
movl $0xff01, %eax           # imm = 0xFF01
btl %ebp, %eax
jae 0x876d4
movq 0x40(%r14), %rsi
testq %rsi, %rsi
je 0x876ba
cmpl %ebp, 0x30(%r14)
je 0x876ba
movq 0x50(%rbx), %rdi
callq *0x48(%rbx)
andq $0x0, 0x40(%r14)
movl %r15d, 0x8(%r14)
movl %ebp, 0x30(%r14)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x875dc
pushq $-0x2
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/png/inflate.c
// Function: inflateInit2_
int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size)
z_streamp strm;
int windowBits;
const char *version;
int stream_size;
{
    int ret;
    struct inflate_state FAR *state;

    if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
        stream_size != (int)(sizeof(z_stream)))
        return Z_VERSION_ERROR;
    if (strm == Z_NULL) return Z_STREAM_ERROR;
    strm->msg = Z_NULL;                 /* in case we return an error */
    if (strm->zalloc == (alloc_func)0) {
        strm->zalloc = zcalloc;
        strm->opaque = (voidpf)0;
    }
    if (strm->zfree == (free_func)0) strm->zfree = zcfree;
    state = (struct inflate_state FAR *)
            ZALLOC(strm, 1, sizeof(struct inflate_state));
    if (state == Z_NULL) return Z_MEM_ERROR;
    Tracev((stderr, "inflate: allocated\n"));
    strm->state = (struct internal_state FAR *)state;
    state->window = Z_NULL;
    ret = inflateReset2(strm, windowBits);
    if (ret != Z_OK) {
        ZFREE(strm, state);
        strm->state = Z_NULL;
    }
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
pushq $-0x6
popq %r14
testq %rdx, %rdx
je 0x8778b
cmpl $0x70, %ecx
jne 0x8778b
cmpb $0x31, (%rdx)
jne 0x8778b
movq %rdi, %rbx
testq %rdi, %rdi
je 0x87783
movl %esi, %ebp
andq $0x0, 0x30(%rbx)
movq 0x40(%rbx), %rax
testq %rax, %rax
jne 0x87730
leaq 0x3e76(%rip), %rax      # 0x8b59d
movq %rax, 0x40(%rbx)
andq $0x0, 0x50(%rbx)
cmpq $0x0, 0x48(%rbx)
jne 0x87742
leaq 0x3e69(%rip), %rcx      # 0x8b5a7
movq %rcx, 0x48(%rbx)
movq 0x50(%rbx), %rdi
pushq $0x1
popq %rsi
movl $0x1bf0, %edx           # imm = 0x1BF0
callq *%rax
testq %rax, %rax
je 0x87787
movq %rax, %r15
movq %rax, 0x38(%rbx)
andq $0x0, 0x40(%rax)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x87656
testl %eax, %eax
je 0x87799
movl %eax, %r14d
movq 0x50(%rbx), %rdi
movq %r15, %rsi
callq *0x48(%rbx)
andq $0x0, 0x38(%rbx)
jmp 0x8778b
pushq $-0x2
jmp 0x87789
pushq $-0x4
popq %r14
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %r14d, %r14d
jmp 0x8778b
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/png/inflate.c
// Function: inflatePrime
int ZEXPORT inflatePrime(strm, bits, value)
z_streamp strm;
int bits;
int value;
{
    struct inflate_state FAR *state;

    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
    state = (struct inflate_state FAR *)strm->state;
    if (bits < 0) {
        state->hold = 0;
        state->bits = 0;
        return Z_OK;
    }
    if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR;
    value &= (1L << bits) - 1;
    state->hold += value << state->bits;
    state->bits += bits;
    return Z_OK;
}

// Assembly:
pushq $-0x2
popq %rax
testq %rdi, %rdi
je 0x877fb
movq 0x38(%rdi), %r8
testq %r8, %r8
je 0x877fb
testl %esi, %esi
js 0x877ef
cmpl $0x10, %esi
ja 0x877fb
movl 0x50(%r8), %edi
leal (%rdi,%rsi), %r9d
cmpl $0x20, %r9d
ja 0x877fb
pushq $-0x1
popq %rax
movl %esi, %ecx
shlq %cl, %rax
notl %eax
andl %edx, %eax
movl %edi, %ecx
shll %cl, %eax
cltq
addq %rax, 0x48(%r8)
movl %r9d, 0x50(%r8)
jmp 0x877f9
andq $0x0, 0x48(%r8)
andl $0x0, 0x50(%r8)
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/png/inflate.c
// Function: updatewindow
local int updatewindow(strm, out)
z_streamp strm;
unsigned out;
{
    struct inflate_state FAR *state;
    unsigned copy, dist;

    state = (struct inflate_state FAR *)strm->state;

    /* if it hasn't been done already, allocate space for the window */
    if (state->window == Z_NULL) {
        state->window = (unsigned char FAR *)
                        ZALLOC(strm, 1U << state->wbits,
                               sizeof(unsigned char));
        if (state->window == Z_NULL) return 1;
    }

    /* if window not in use yet, initialize */
    if (state->wsize == 0) {
        state->wsize = 1U << state->wbits;
        state->wnext = 0;
        state->whave = 0;
    }

    /* copy state->wsize or less output bytes into the circular window */
    copy = out - strm->avail_out;
    if (copy >= state->wsize) {
        zmemcpy(state->window, strm->next_out - state->wsize, state->wsize);
        state->wnext = 0;
        state->whave = state->wsize;
    }
    else {
        dist = state->wsize - state->wnext;
        if (dist > copy) dist = copy;
        zmemcpy(state->window + state->wnext, strm->next_out - copy, dist);
        copy -= dist;
        if (copy) {
            zmemcpy(state->window, strm->next_out - copy, copy);
            state->wnext = copy;
            state->whave = state->wsize;
        }
        else {
            state->wnext += dist;
            if (state->wnext == state->wsize) state->wnext = 0;
            if (state->whave < state->wsize) state->whave += dist;
        }
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movq 0x38(%rdi), %r12
movq 0x40(%r12), %rdi
pushq $0x1
popq %rbp
testq %rdi, %rdi
jne 0x89343
movq 0x50(%r14), %rdi
movb 0x30(%r12), %cl
movl %ebp, %esi
shll %cl, %esi
movl %ebp, %edx
callq *0x40(%r14)
movq %rax, %rdi
movq %rax, 0x40(%r12)
testq %rax, %rax
je 0x893d5
movl 0x34(%r12), %r13d
testl %r13d, %r13d
jne 0x89362
movb 0x30(%r12), %cl
shll %cl, %ebp
movl %ebp, 0x34(%r12)
andq $0x0, 0x38(%r12)
movl %ebp, %r13d
subl 0x20(%r14), %ebx
cmpl %r13d, %ebx
jae 0x893b4
movl 0x3c(%r12), %eax
subl %eax, %r13d
cmpl %ebx, %r13d
movl %ebx, %r15d
cmovbl %r13d, %r15d
addq %rax, %rdi
movq 0x18(%r14), %rsi
movl %ebx, %eax
subq %rax, %rsi
movq %r15, %rdx
callq 0xe380
cmpl %r13d, %ebx
jbe 0x893e6
subl %r15d, %ebx
movq 0x40(%r12), %rdi
movq 0x18(%r14), %rsi
subq %rbx, %rsi
movq %rbx, %rdx
callq 0xe380
movl %ebx, 0x3c(%r12)
jmp 0x893c9
movq 0x18(%r14), %rsi
movl %r13d, %edx
subq %rdx, %rsi
callq 0xe380
andl $0x0, 0x3c(%r12)
movl 0x34(%r12), %eax
movl %eax, 0x38(%r12)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x3c(%r12), %ecx
addl %r15d, %ecx
movl 0x34(%r12), %edx
movl 0x38(%r12), %eax
xorl %ebp, %ebp
cmpl %edx, %ecx
cmovel %ebp, %ecx
movl %ecx, 0x3c(%r12)
cmpl %edx, %eax
jae 0x893d5
addl %r15d, %eax
movl %eax, 0x38(%r12)
jmp 0x893d5
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/png/trees.c
// Function: init_block
local void init_block(s)
    deflate_state *s;
{
    int n; /* iterates over tree elements */

    /* Initialize the trees. */
    for (n = 0; n < L_CODES;  n++) s->dyn_ltree[n].Freq = 0;
    for (n = 0; n < D_CODES;  n++) s->dyn_dtree[n].Freq = 0;
    for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;

    s->dyn_ltree[END_BLOCK].Freq = 1;
    s->opt_len = s->static_len = 0L;
    s->last_lit = s->matches = 0;
}

// Assembly:
pushq $0x31
popq %rax
cmpq $0x14f, %rax            # imm = 0x14F
je 0x89d58
andw $0x0, (%rdi,%rax,4)
incq %rax
jmp 0x89d46
xorl %eax, %eax
cmpq $0x1e, %rax
je 0x89d6e
andw $0x0, 0x9b8(%rdi,%rax,4)
incq %rax
jmp 0x89d5a
xorl %eax, %eax
cmpq $0x13, %rax
je 0x89d84
andw $0x0, 0xaac(%rdi,%rax,4)
incq %rax
jmp 0x89d70
movw $0x1, 0x4c4(%rdi)
andl $0x0, 0x16fc(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x1708(%rdi)
andl $0x0, 0x1718(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/png/trees.c
// Function: tr_stored_block
void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last)
    deflate_state *s;
    charf *buf;       /* input block */
    ulg stored_len;   /* length of input block */
    int last;         /* one if this is the last block for a file */
{
    send_bits(s, (STORED_BLOCK<<1)+last, 3);    /* send block type */
#ifdef DEBUG
    s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
    s->compressed_len += (stored_len + 4) << 3;
#endif
    copy_block(s, buf, (unsigned)stored_len, 1); /* with header */
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %ecx, %r8d
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl 0x1724(%rdi), %eax
cmpl $0xe, %eax
jl 0x89e21
movzwl %r8w, %edx
movl %eax, %ecx
shll %cl, %r8d
orw 0x1720(%r15), %r8w
movw %r8w, 0x1720(%r15)
movq 0x10(%r15), %rax
movl 0x28(%r15), %ecx
leal 0x1(%rcx), %esi
movl %esi, 0x28(%r15)
movb %r8b, (%rax,%rcx)
movb 0x1721(%r15), %al
movq 0x10(%r15), %rcx
movl 0x28(%r15), %esi
leal 0x1(%rsi), %edi
movl %edi, 0x28(%r15)
movb %al, (%rcx,%rsi)
movl 0x1724(%r15), %eax
movb $0x10, %cl
subb %al, %cl
shrl %cl, %edx
movw %dx, 0x1720(%r15)
addl $-0xd, %eax
jmp 0x89e31
movl %eax, %ecx
shll %cl, %r8d
orw %r8w, 0x1720(%r15)
addl $0x3, %eax
movl %eax, 0x1724(%r15)
movq %r15, %rdi
callq 0x8ae09
movl $0x8, 0x171c(%r15)
movq 0x10(%r15), %rax
movl 0x28(%r15), %ecx
leal 0x1(%rcx), %edx
movl %edx, 0x28(%r15)
movb %bl, (%rax,%rcx)
movq 0x10(%r15), %rax
movl 0x28(%r15), %ecx
leal 0x1(%rcx), %edx
movl %edx, 0x28(%r15)
movb %bh, (%rax,%rcx)
movl %ebx, %eax
xorl $0xffff, %eax           # imm = 0xFFFF
movq 0x10(%r15), %rcx
movl 0x28(%r15), %edx
leal 0x1(%rdx), %esi
movl %esi, 0x28(%r15)
movb %al, (%rcx,%rdx)
shrl $0x8, %eax
xorl %ecx, %ecx
movq 0x10(%r15), %rdx
movl 0x28(%r15), %esi
leal 0x1(%rsi), %edi
movl %edi, 0x28(%r15)
movb %al, (%rdx,%rsi)
cmpl %ecx, %ebx
je 0x89eac
movb (%r14,%rcx), %al
incq %rcx
jmp 0x89e8d
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/png/trees.c
// Function: tr_align
void ZLIB_INTERNAL _tr_align(s)
    deflate_state *s;
{
    send_bits(s, STATIC_TREES<<1, 3);
    send_code(s, END_BLOCK, static_ltree);
#ifdef DEBUG
    s->compressed_len += 10L; /* 3 for block type, 7 for EOB */
#endif
    bi_flush(s);
    /* Of the 10 bits for the empty block, we have already sent
     * (10 - bi_valid) bits. The lookahead for the last real code (before
     * the EOB of the previous block) was thus at least one plus the length
     * of the EOB plus what we have just sent of the empty static block.
     */
    if (1 + s->last_eob_len + 10 - s->bi_valid < 9) {
        send_bits(s, STATIC_TREES<<1, 3);
        send_code(s, END_BLOCK, static_ltree);
#ifdef DEBUG
        s->compressed_len += 10L;
#endif
        bi_flush(s);
    }
    s->last_eob_len = 7;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x1724(%rdi), %eax
pushq $0x2
popq %rbp
movl %ebp, %edx
movl %eax, %ecx
shll %cl, %edx
orw 0x1720(%rdi), %dx
movw %dx, 0x1720(%rdi)
cmpl $0xe, %eax
jl 0x89f1a
movq 0x10(%rbx), %rax
movl 0x28(%rbx), %ecx
leal 0x1(%rcx), %esi
movl %esi, 0x28(%rbx)
movb %dl, (%rax,%rcx)
movb 0x1721(%rbx), %al
movq 0x10(%rbx), %rcx
movl 0x28(%rbx), %edx
leal 0x1(%rdx), %esi
movl %esi, 0x28(%rbx)
movb %al, (%rcx,%rdx)
movl 0x1724(%rbx), %eax
movb $0x10, %cl
subb %al, %cl
movl %ebp, %edx
shrl %cl, %edx
movw %dx, 0x1720(%rbx)
addl $-0xd, %eax
jmp 0x89f1d
addl $0x3, %eax
movl %eax, 0x1724(%rbx)
cmpl $0xa, %eax
jl 0x89f61
movq 0x10(%rbx), %rax
movl 0x28(%rbx), %ecx
leal 0x1(%rcx), %esi
movl %esi, 0x28(%rbx)
movb %dl, (%rax,%rcx)
movb 0x1721(%rbx), %al
movq 0x10(%rbx), %rcx
movl 0x28(%rbx), %edx
leal 0x1(%rdx), %esi
movl %esi, 0x28(%rbx)
movb %al, (%rcx,%rdx)
andw $0x0, 0x1720(%rbx)
movl 0x1724(%rbx), %eax
addl $-0x9, %eax
jmp 0x89f64
addl $0x7, %eax
movl %eax, 0x1724(%rbx)
movq %rbx, %rdi
callq 0x8a04e
movl 0x171c(%rbx), %ecx
movl 0x1724(%rbx), %eax
subl %eax, %ecx
addl $0xb, %ecx
cmpl $0x8, %ecx
jg 0x8a03d
movl %ebp, %edx
movl %eax, %ecx
shll %cl, %edx
orw 0x1720(%rbx), %dx
movw %dx, 0x1720(%rbx)
cmpl $0xe, %eax
jl 0x89fe5
movq 0x10(%rbx), %rax
movl 0x28(%rbx), %ecx
leal 0x1(%rcx), %esi
movl %esi, 0x28(%rbx)
movb %dl, (%rax,%rcx)
movb 0x1721(%rbx), %al
movq 0x10(%rbx), %rcx
movl 0x28(%rbx), %edx
leal 0x1(%rdx), %esi
movl %esi, 0x28(%rbx)
movb %al, (%rcx,%rdx)
movl 0x1724(%rbx), %eax
movb $0x10, %cl
subb %al, %cl
shrl %cl, %ebp
movw %bp, 0x1720(%rbx)
addl $-0xd, %eax
movl %ebp, %edx
jmp 0x89fe8
addl $0x3, %eax
movl %eax, 0x1724(%rbx)
cmpl $0xa, %eax
jl 0x8a02c
movq 0x10(%rbx), %rax
movl 0x28(%rbx), %ecx
leal 0x1(%rcx), %esi
movl %esi, 0x28(%rbx)
movb %dl, (%rax,%rcx)
movb 0x1721(%rbx), %al
movq 0x10(%rbx), %rcx
movl 0x28(%rbx), %edx
leal 0x1(%rdx), %esi
movl %esi, 0x28(%rbx)
movb %al, (%rcx,%rdx)
andw $0x0, 0x1720(%rbx)
movl 0x1724(%rbx), %eax
addl $-0x9, %eax
jmp 0x8a02f
addl $0x7, %eax
movl %eax, 0x1724(%rbx)
movq %rbx, %rdi
callq 0x8a04e
movl $0x7, 0x171c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/png/trees.c
// Function: bi_flush
local void bi_flush(s)
    deflate_state *s;
{
    if (s->bi_valid == 16) {
        put_short(s, s->bi_buf);
        s->bi_buf = 0;
        s->bi_valid = 0;
    } else if (s->bi_valid >= 8) {
        put_byte(s, (Byte)s->bi_buf);
        s->bi_buf >>= 8;
        s->bi_valid -= 8;
    }
}

// Assembly:
movl 0x1724(%rdi), %eax
cmpl $0x10, %eax
jne 0x8a091
movb 0x1720(%rdi), %al
movq 0x10(%rdi), %rcx
movl 0x28(%rdi), %edx
leal 0x1(%rdx), %esi
movl %esi, 0x28(%rdi)
movb %al, (%rcx,%rdx)
movb 0x1721(%rdi), %al
movq 0x10(%rdi), %rcx
movl 0x28(%rdi), %edx
leal 0x1(%rdx), %esi
movl %esi, 0x28(%rdi)
movb %al, (%rcx,%rdx)
andw $0x0, 0x1720(%rdi)
xorl %eax, %eax
jmp 0x8a0c3
cmpl $0x8, %eax
jl 0x8a0c9
movb 0x1720(%rdi), %al
movq 0x10(%rdi), %rcx
movl 0x28(%rdi), %edx
leal 0x1(%rdx), %esi
movl %esi, 0x28(%rdi)
movb %al, (%rcx,%rdx)
movzbl 0x1721(%rdi), %eax
movw %ax, 0x1720(%rdi)
movl 0x1724(%rdi), %eax
addl $-0x8, %eax
movl %eax, 0x1724(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/png/trees.c
// Function: bi_windup
local void bi_windup(s)
    deflate_state *s;
{
    if (s->bi_valid > 8) {
        put_short(s, s->bi_buf);
    } else if (s->bi_valid > 0) {
        put_byte(s, (Byte)s->bi_buf);
    }
    s->bi_buf = 0;
    s->bi_valid = 0;
#ifdef DEBUG
    s->bits_sent = (s->bits_sent+7) & ~7;
#endif
}

// Assembly:
movl 0x1724(%rdi), %eax
cmpl $0x9, %eax
jl 0x8ae3f
movb 0x1720(%rdi), %dl
leaq 0x10(%rdi), %rcx
movq 0x10(%rdi), %rsi
leaq 0x28(%rdi), %rax
movl 0x28(%rdi), %r8d
leal 0x1(%r8), %r9d
movl %r9d, 0x28(%rdi)
movb %dl, (%rsi,%r8)
movzbl 0x1721(%rdi), %edx
jmp 0x8ae52
testl %eax, %eax
jle 0x8ae61
movzwl 0x1720(%rdi), %edx
leaq 0x10(%rdi), %rcx
leaq 0x28(%rdi), %rax
movq (%rcx), %rcx
movl (%rax), %esi
leal 0x1(%rsi), %r8d
movl %r8d, (%rax)
movb %dl, (%rcx,%rsi)
andw $0x0, 0x1720(%rdi)
andl $0x0, 0x1724(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/png/trees.c
// Function: pqdownheap
local void pqdownheap(s, tree, k)
    deflate_state *s;
    ct_data *tree;  /* the tree to restore */
    int k;               /* node to move down */
{
    int v = s->heap[k];
    int j = k << 1;  /* left son of k */
    while (j <= s->heap_len) {
        /* Set j to the smallest of the two sons: */
        if (j < s->heap_len &&
            smaller(tree, s->heap[j+1], s->heap[j], s->depth)) {
            j++;
        }
        /* Exit if v is smaller than both sons */
        if (smaller(tree, v, s->heap[j], s->depth)) break;

        /* Exchange v with the smallest son */
        s->heap[k] = s->heap[j];  k = j;

        /* And continue down the tree, setting j to the left son of k */
        j <<= 1;
    }
    s->heap[k] = v;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %eax
movl 0xbb0(%rdi,%rax,4), %eax
movslq %eax, %rcx
movslq %edx, %r8
addl %edx, %edx
cmpl 0x14a4(%rdi), %edx
jg 0x8afa3
jge 0x8af56
movl %edx, %r10d
orl $0x1, %r10d
movslq %r10d, %r11
movslq 0xbb0(%rdi,%r11,4), %rbx
movslq %edx, %r9
movslq 0xbb0(%rdi,%r9,4), %r14
movzwl (%rsi,%r14,4), %ebp
cmpw %bp, (%rsi,%rbx,4)
jae 0x8af8e
movq %r11, %r9
movl %r10d, %edx
jmp 0x8af59
movslq %edx, %r9
movl 0xbb0(%rdi,%r9,4), %r9d
movslq %r9d, %r10
movzwl (%rsi,%r10,4), %r11d
cmpw %r11w, (%rsi,%rcx,4)
jb 0x8afa3
jne 0x8af84
movb 0x14ac(%rdi,%rcx), %r11b
cmpb 0x14ac(%rdi,%r10), %r11b
jbe 0x8afa3
movl %r9d, 0xbb0(%rdi,%r8,4)
jmp 0x8af17
jne 0x8af59
movb 0x14ac(%rdi,%rbx), %bl
cmpb 0x14ac(%rdi,%r14), %bl
jbe 0x8af4e
jmp 0x8af59
movl %eax, 0xbb0(%rdi,%r8,4)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/png/trees.c
// Function: scan_tree
local void scan_tree (s, tree, max_code)
    deflate_state *s;
    ct_data *tree;   /* the tree to be scanned */
    int max_code;    /* and its largest code of non zero frequency */
{
    int n;                     /* iterates over all tree elements */
    int prevlen = -1;          /* last emitted length */
    int curlen;                /* length of current code */
    int nextlen = tree[0].Len; /* length of next code */
    int count = 0;             /* repeat count of the current code */
    int max_count = 7;         /* max repeat count */
    int min_count = 4;         /* min repeat count */

    if (nextlen == 0) max_count = 138, min_count = 3;
    tree[max_code+1].Len = (ush)0xffff; /* guard */

    for (n = 0; n <= max_code; n++) {
        curlen = nextlen; nextlen = tree[n+1].Len;
        if (++count < max_count && curlen == nextlen) {
            continue;
        } else if (count < min_count) {
            s->bl_tree[curlen].Freq += count;
        } else if (curlen != 0) {
            if (curlen != prevlen) s->bl_tree[curlen].Freq++;
            s->bl_tree[REP_3_6].Freq++;
        } else if (count <= 10) {
            s->bl_tree[REPZ_3_10].Freq++;
        } else {
            s->bl_tree[REPZ_11_138].Freq++;
        }
        count = 0; prevlen = curlen;
        if (nextlen == 0) {
            max_count = 138, min_count = 3;
        } else if (curlen == nextlen) {
            max_count = 6, min_count = 3;
        } else {
            max_count = 7, min_count = 4;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movzwl 0x2(%rsi), %ecx
xorl %ebx, %ebx
testl %ecx, %ecx
movl $0x8a, %eax
movl $0x7, %ebp
cmovel %eax, %ebp
setne %bl
addl $0x3, %ebx
movslq %edx, %rdx
orw $-0x1, 0x6(%rsi,%rdx,4)
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
xorl %r8d, %r8d
movl $0x4, %r9d
movl $0x3, %r10d
movl %r11d, %r15d
xorl %r14d, %r14d
cmpq %rdx, %r8
jg 0x8b088
movl %ecx, %r11d
movzwl 0x6(%rsi,%r8,4), %ecx
incq %r8
incl %r14d
cmpl %ebp, %r14d
jge 0x8b019
cmpl %ecx, %r11d
je 0x8aff7
movl %r11d, %r12d
cmpl %ebx, %r14d
jge 0x8b034
addl 0xaac(%rdi,%r12,4), %r14d
movw %r14w, 0xaac(%rdi,%r12,4)
jmp 0x8b069
testl %r11d, %r11d
je 0x8b050
cmpl %r15d, %r11d
je 0x8b047
incw 0xaac(%rdi,%r12,4)
incw 0xaec(%rdi)
jmp 0x8b069
decl %r14d
cmpl $0x9, %r14d
ja 0x8b062
incw 0xaf0(%rdi)
jmp 0x8b069
incw 0xaf4(%rdi)
xorl %ebp, %ebp
cmpl %ecx, %r11d
sete %bpl
movl %r9d, %ebx
subl %ebp, %ebx
xorl $0x7, %ebp
testl %ecx, %ecx
cmovel %eax, %ebp
cmovel %r10d, %ebx
jmp 0x8aff1
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/png/pngrutil.c
// Function: png_get_uint_31
png_uint_32 PNGAPI
png_get_uint_31(png_structp png_ptr, png_bytep buf)
{
   png_uint_32 i = png_get_uint_32(buf);
   if (i > PNG_UINT_31_MAX)
     png_error(png_ptr, "PNG unsigned integer out of range");
   return (i);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movzbl (%rsi), %ebp
shll $0x18, %ebp
movzbl 0x1(%rsi), %r14d
movzbl 0x2(%rsi), %ebx
movzbl 0x3(%rsi), %r15d
jns 0x8b5d9
leaq 0x17f2c(%rip), %rsi     # 0xa3500
callq 0x849c0
shll $0x10, %r14d
orl %r15d, %r14d
shll $0x8, %ebx
orl %r14d, %ebx
orl %ebp, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/png/pngrutil.c
// Function: png_crc_finish
int /* PRIVATE */
png_crc_finish(png_structp png_ptr, png_uint_32 skip)
{
   png_size_t i;
   png_size_t istop = png_ptr->zbuf_size;

   for (i = (png_size_t)skip; i > istop; i -= istop)
   {
      png_crc_read(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size);
   }
   if (i)
   {
      png_crc_read(png_ptr, png_ptr->zbuf, i);
   }

   if (png_crc_error(png_ptr))
   {
      if (((png_ptr->chunk_name[0] & 0x20) &&                /* Ancillary */
          !(png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_NOWARN)) ||
          (!(png_ptr->chunk_name[0] & 0x20) &&             /* Critical  */
          (png_ptr->flags & PNG_FLAG_CRC_CRITICAL_USE)))
      {
         png_chunk_warning(png_ptr, "CRC error");
      }
      else
      {
         png_chunk_benign_error(png_ptr, "CRC error");
         return (0);
      }
      return (1);
   }

   return (0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x1a0(%rdi), %r14
movl %esi, %edx
movq %rdx, %r15
subq %r14, %r15
jbe 0x8b739
movq 0x198(%rbx), %rsi
movq 0x1a0(%rbx), %rdx
movq %rbx, %rdi
callq 0x8b6d7
movq %r15, %rdx
jmp 0x8b719
testq %rdx, %rdx
je 0x8b74d
movq 0x198(%rbx), %rsi
movq %rbx, %rdi
callq 0x8b6d7
movq %rbx, %rdi
callq 0x8b7a6
xorl %ebp, %ebp
testl %eax, %eax
je 0x8b799
testb $0x20, 0x244(%rbx)
movl 0x120(%rbx), %eax
jne 0x8b784
btl $0xa, %eax
jae 0x8b78a
leaq 0x12418(%rip), %rsi     # 0x9db8f
movq %rbx, %rdi
callq 0x84b9e
pushq $0x1
popq %rbp
jmp 0x8b799
btl $0x9, %eax
jae 0x8b770
leaq 0x123fe(%rip), %rsi     # 0x9db8f
movq %rbx, %rdi
callq 0x84abb
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/png/pngrutil.c
// Function: png_handle_IEND
void /* PRIVATE */
png_handle_IEND(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
{
   png_debug(1, "in png_handle_IEND");

   if (!(png_ptr->mode & PNG_HAVE_IHDR) || !(png_ptr->mode & PNG_HAVE_IDAT))
   {
      png_error(png_ptr, "No image in file");
   }

   png_ptr->mode |= (PNG_AFTER_IDAT | PNG_HAVE_IEND);

   if (length != 0)
   {
      png_warning(png_ptr, "Incorrect IEND chunk length");
   }
   png_crc_finish(png_ptr, length);

   info_ptr = info_ptr + 0; /* Quiet compiler warnings about unused info_ptr */
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rdi, %r14
movl 0x11c(%rdi), %eax
movl %eax, %ecx
notl %ecx
testb $0x5, %cl
je 0x8be16
leaq 0x178b1(%rip), %rsi     # 0xa36b8
movq %r14, %rdi
callq 0x849c0
movl 0x11c(%r14), %eax
orl $0x18, %eax
movl %eax, 0x11c(%r14)
testl %ebx, %ebx
je 0x8be33
leaq 0x1789e(%rip), %rsi     # 0xa36c9
movq %r14, %rdi
callq 0x84a53
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x8b703
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/png/pngrutil.c
// Function: png_handle_hIST
void /* PRIVATE */
png_handle_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
{
   unsigned int num, i;
   png_uint_16 readbuf[PNG_MAX_PALETTE_LENGTH];

   png_debug(1, "in png_handle_hIST");

   if (!(png_ptr->mode & PNG_HAVE_IHDR))
      png_error(png_ptr, "Missing IHDR before hIST");
   else if (png_ptr->mode & PNG_HAVE_IDAT)
   {
      png_warning(png_ptr, "Invalid hIST after IDAT");
      png_crc_finish(png_ptr, length);
      return;
   }
   else if (!(png_ptr->mode & PNG_HAVE_PLTE))
   {
      png_warning(png_ptr, "Missing PLTE before hIST");
      png_crc_finish(png_ptr, length);
      return;
   }
   else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_hIST))
   {
      png_warning(png_ptr, "Duplicate hIST chunk");
      png_crc_finish(png_ptr, length);
      return;
   }

   num = length / 2 ;
   if (num != (unsigned int) png_ptr->num_palette || num >
      (unsigned int) PNG_MAX_PALETTE_LENGTH)
   {
      png_warning(png_ptr, "Incorrect hIST chunk length");
      png_crc_finish(png_ptr, length);
      return;
   }

   for (i = 0; i < num; i++)
   {
      png_byte buf[2];

      png_crc_read(png_ptr, buf, 2);
      readbuf[i] = png_get_uint_16(buf);
   }

   if (png_crc_finish(png_ptr, 0))
      return;

   png_set_hIST(png_ptr, info_ptr, readbuf);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x11c(%rdi), %eax
testb $0x1, %al
jne 0x8cf31
leaq 0x16e35(%rip), %rsi     # 0xa3d13
movq %rbx, %rdi
callq 0x849c0
cmpl $0x201, %ebp            # imm = 0x201
ja 0x8cf42
movl %ebp, %eax
shrl %eax
movzwl 0x240(%rbx), %ecx
cmpl %ecx, %eax
jne 0x8cf42
movl %eax, %r13d
xorl %ebp, %ebp
leaq 0xe(%rsp), %r15
pushq $0x2
popq %r12
movq %rbx, %rdi
cmpq %rbp, %r13
je 0x8cf4b
movq %r15, %rsi
movq %r12, %rdx
callq 0x8b6d7
movzwl 0xe(%rsp), %eax
rolw $0x8, %ax
movw %ax, 0x10(%rsp,%rbp,2)
incq %rbp
jmp 0x8cf0b
testb $0x4, %al
jne 0x8cf78
testb $0x2, %al
jne 0x8cfa2
leaq 0x16e04(%rip), %rsi     # 0xa3d44
jmp 0x8cf7f
leaq 0x16e29(%rip), %rsi     # 0xa3d72
jmp 0x8cf7f
xorl %esi, %esi
callq 0x8b703
testl %eax, %eax
jne 0x8cf66
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7b02e
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x16dad(%rip), %rsi     # 0xa3d2c
movq %rbx, %rdi
callq 0x84a53
movq %rbx, %rdi
movl %ebp, %esi
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8b703
testq %r14, %r14
je 0x8cee6
testb $0x40, 0x8(%r14)
je 0x8cee6
leaq 0x16da0(%rip), %rsi     # 0xa3d5d
jmp 0x8cf7f
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/png/pngrutil.c
// Function: png_handle_pHYs
void /* PRIVATE */
png_handle_pHYs(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
{
   png_byte buf[9];
   png_uint_32 res_x, res_y;
   int unit_type;

   png_debug(1, "in png_handle_pHYs");

   if (!(png_ptr->mode & PNG_HAVE_IHDR))
      png_error(png_ptr, "Missing IHDR before pHYs");
   else if (png_ptr->mode & PNG_HAVE_IDAT)
   {
      png_warning(png_ptr, "Invalid pHYs after IDAT");
      png_crc_finish(png_ptr, length);
      return;
   }
   else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs))
   {
      png_warning(png_ptr, "Duplicate pHYs chunk");
      png_crc_finish(png_ptr, length);
      return;
   }

   if (length != 9)
   {
      png_warning(png_ptr, "Incorrect pHYs chunk length");
      png_crc_finish(png_ptr, length);
      return;
   }

   png_crc_read(png_ptr, buf, 9);
   if (png_crc_finish(png_ptr, 0))
      return;

   res_x = png_get_uint_32(buf);
   res_y = png_get_uint_32(buf + 4);
   unit_type = buf[8];
   png_set_pHYs(png_ptr, info_ptr, res_x, res_y, unit_type);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x11c(%rdi), %eax
testb $0x1, %al
jne 0x8d031
leaq 0x16dae(%rip), %rsi     # 0xa3d8e
movq %rbx, %rdi
callq 0x849c0
cmpl $0x9, %ebp
jne 0x8d04a
leaq 0x7(%rsp), %rsi
pushq $0x9
popq %rdx
movq %rbx, %rdi
callq 0x8b6d7
movq %rbx, %rdi
xorl %esi, %esi
callq 0x8b703
testl %eax, %eax
jne 0x8d028
movl 0x7(%rsp), %edx
movl 0xb(%rsp), %ecx
bswapl %edx
bswapl %ecx
movzbl 0xf(%rsp), %r8d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7b3b6
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
testb $0x4, %al
jne 0x8d053
testq %r14, %r14
je 0x8cfe8
testb $-0x80, 0x8(%r14)
je 0x8cfe8
leaq 0x16d77(%rip), %rsi     # 0xa3dbf
jmp 0x8d05a
leaq 0x16d83(%rip), %rsi     # 0xa3dd4
jmp 0x8d05a
leaq 0x16d4d(%rip), %rsi     # 0xa3da7
movq %rbx, %rdi
callq 0x84a53
movq %rbx, %rdi
movl %ebp, %esi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x8b703
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/png/pngrutil.c
// Function: png_handle_oFFs
void /* PRIVATE */
png_handle_oFFs(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
{
   png_byte buf[9];
   png_int_32 offset_x, offset_y;
   int unit_type;

   png_debug(1, "in png_handle_oFFs");

   if (!(png_ptr->mode & PNG_HAVE_IHDR))
      png_error(png_ptr, "Missing IHDR before oFFs");
   else if (png_ptr->mode & PNG_HAVE_IDAT)
   {
      png_warning(png_ptr, "Invalid oFFs after IDAT");
      png_crc_finish(png_ptr, length);
      return;
   }
   else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs))
   {
      png_warning(png_ptr, "Duplicate oFFs chunk");
      png_crc_finish(png_ptr, length);
      return;
   }

   if (length != 9)
   {
      png_warning(png_ptr, "Incorrect oFFs chunk length");
      png_crc_finish(png_ptr, length);
      return;
   }

   png_crc_read(png_ptr, buf, 9);
   if (png_crc_finish(png_ptr, 0))
      return;

   offset_x = png_get_int_32(buf);
   offset_y = png_get_int_32(buf + 4);
   unit_type = buf[8];
   png_set_oFFs(png_ptr, info_ptr, offset_x, offset_y, unit_type);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x11c(%rdi), %eax
testb $0x1, %al
jne 0x8d0ed
leaq 0x16d5b(%rip), %rsi     # 0xa3df0
movq %rbx, %rdi
callq 0x849c0
cmpl $0x9, %ebp
jne 0x8d106
leaq 0x7(%rsp), %rsi
pushq $0x9
popq %rdx
movq %rbx, %rdi
callq 0x8b6d7
movq %rbx, %rdi
xorl %esi, %esi
callq 0x8b703
testl %eax, %eax
jne 0x8d1a6
movzbl 0x7(%rsp), %eax
testb %al, %al
js 0x8d130
shll $0x18, %eax
movzbl 0x8(%rsp), %ecx
shll $0x10, %ecx
orl %eax, %ecx
movzbl 0x9(%rsp), %eax
shll $0x8, %eax
orl %ecx, %eax
movzbl 0xa(%rsp), %edx
orl %eax, %edx
jmp 0x8d14e
testb $0x4, %al
jne 0x8d10f
testq %r14, %r14
je 0x8d09d
testb $0x1, 0x9(%r14)
je 0x8d09d
leaq 0x16d1d(%rip), %rsi     # 0xa3e21
jmp 0x8d116
leaq 0x16d29(%rip), %rsi     # 0xa3e36
jmp 0x8d116
leaq 0x16cf3(%rip), %rsi     # 0xa3e09
movq %rbx, %rdi
callq 0x84a53
movq %rbx, %rdi
movl %ebp, %esi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x8b703
movzbl 0x8(%rsp), %ecx
shll $0x10, %ecx
shll $0x18, %eax
orl %ecx, %eax
movzbl 0x9(%rsp), %ecx
shll $0x8, %ecx
orl %eax, %ecx
movzbl 0xa(%rsp), %edx
orl %ecx, %edx
movzbl 0xb(%rsp), %eax
testb %al, %al
js 0x8d177
shll $0x18, %eax
movzbl 0xc(%rsp), %ecx
shll $0x10, %ecx
orl %eax, %ecx
movzbl 0xd(%rsp), %eax
shll $0x8, %eax
orl %ecx, %eax
movzbl 0xe(%rsp), %ecx
orl %eax, %ecx
jmp 0x8d195
movzbl 0xc(%rsp), %ecx
shll $0x10, %ecx
shll $0x18, %eax
orl %ecx, %eax
movzbl 0xd(%rsp), %esi
shll $0x8, %esi
orl %eax, %esi
movzbl 0xe(%rsp), %ecx
orl %esi, %ecx
movzbl 0xf(%rsp), %r8d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7b1a4
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/png/pngrutil.c
// Function: png_handle_tIME
void /* PRIVATE */
png_handle_tIME(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
{
   png_byte buf[7];
   png_time mod_time;

   png_debug(1, "in png_handle_tIME");

   if (!(png_ptr->mode & PNG_HAVE_IHDR))
      png_error(png_ptr, "Out of place tIME chunk");
   else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_tIME))
   {
      png_warning(png_ptr, "Duplicate tIME chunk");
      png_crc_finish(png_ptr, length);
      return;
   }

   if (png_ptr->mode & PNG_HAVE_IDAT)
      png_ptr->mode |= PNG_AFTER_IDAT;

   if (length != 7)
   {
      png_warning(png_ptr, "Incorrect tIME chunk length");
      png_crc_finish(png_ptr, length);
      return;
   }

   png_crc_read(png_ptr, buf, 7);
   if (png_crc_finish(png_ptr, 0))
      return;

   mod_time.second = buf[6];
   mod_time.minute = buf[5];
   mod_time.hour = buf[4];
   mod_time.day = buf[3];
   mod_time.month = buf[2];
   mod_time.year = png_get_uint_16(buf);

   png_set_tIME(png_ptr, info_ptr, &mod_time);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x11c(%rdi), %eax
testb $0x1, %al
jne 0x8d6bf
leaq 0x16966(%rip), %rsi     # 0xa4015
movq %rbx, %rdi
callq 0x849c0
movl 0x11c(%rbx), %eax
jmp 0x8d6cb
testq %r14, %r14
je 0x8d6cb
testb $0x2, 0x9(%r14)
jne 0x8d737
testb $0x4, %al
je 0x8d6d8
orl $0x8, %eax
movl %eax, 0x11c(%rbx)
cmpl $0x7, %ebp
jne 0x8d72e
leaq 0x1(%rsp), %rsi
pushq $0x7
popq %rdx
movq %rbx, %rdi
callq 0x8b6d7
movq %rbx, %rdi
xorl %esi, %esi
callq 0x8b703
testl %eax, %eax
jne 0x8d725
movb 0x7(%rsp), %al
leaq 0x8(%rsp), %rdx
movb %al, 0x6(%rdx)
movl 0x3(%rsp), %eax
movl %eax, 0x2(%rdx)
movzwl 0x1(%rsp), %eax
rolw $0x8, %ax
movw %ax, (%rdx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7b9ad
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x1690d(%rip), %rsi     # 0xa4042
jmp 0x8d73e
leaq 0x168ef(%rip), %rsi     # 0xa402d
movq %rbx, %rdi
callq 0x84a53
movq %rbx, %rdi
movl %ebp, %esi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x8b703
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/png/pngtrans.c
// Function: png_do_packswap
void /* PRIVATE */
png_do_packswap(png_row_infop row_info, png_bytep row)
{
   png_debug(1, "in png_do_packswap");

   if (
       row_info->bit_depth < 8)
   {
      png_bytep rp, end, table;

      end = row + row_info->rowbytes;

      if (row_info->bit_depth == 1)
         table = (png_bytep)onebppswaptable;
      else if (row_info->bit_depth == 2)
         table = (png_bytep)twobppswaptable;
      else if (row_info->bit_depth == 4)
         table = (png_bytep)fourbppswaptable;
      else
         return;

      for (rp = row; rp < end; rp++)
         *rp = table[*rp];
   }
}

// Assembly:
movzbl 0x11(%rdi), %ecx
cmpl $0x7, %ecx
ja 0x8eeaa
movq 0x8(%rdi), %rax
addq %rsi, %rax
cmpl $0x1, %ecx
je 0x8ee91
cmpl $0x4, %ecx
je 0x8ee88
cmpl $0x2, %ecx
jne 0x8eeaa
leaq 0x156da(%rip), %rcx     # 0xa4560
jmp 0x8eea5
leaq 0x157d1(%rip), %rcx     # 0xa4660
jmp 0x8eea5
leaq 0x155c8(%rip), %rcx     # 0xa4460
jmp 0x8eea5
movzbl (%rsi), %edx
movb (%rcx,%rdx), %dl
movb %dl, (%rsi)
incq %rsi
cmpq %rax, %rsi
jb 0x8ee9a
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/png/pngwutil.c
// Function: png_write_sig
void PNGAPI
png_write_sig(png_structp png_ptr)
{
   png_byte png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10};

#ifdef PNG_IO_STATE_SUPPORTED
   /* Inform the I/O callback that the signature is being written */
   png_ptr->io_state = PNG_IO_WRITING | PNG_IO_SIGNATURE;
#endif

   /* Write the rest of the 8 byte signature */
   png_write_data(png_ptr, &png_signature[png_ptr->sig_bytes],
      (png_size_t)(8 - png_ptr->sig_bytes));
   if (png_ptr->sig_bytes < 3)
      png_ptr->mode |= PNG_HAVE_PNG_SIGNATURE;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movabsq $0xa1a0a0d474e5089, %rax # imm = 0xA1A0A0D474E5089
movq %rax, 0x8(%rsp)
movl $0x12, 0x490(%rdi)
movzbl 0x254(%rdi), %eax
leaq 0x8(%rsp,%rax), %rsi
pushq $0x8
popq %rdx
subq %rax, %rdx
callq 0x921cc
cmpb $0x2, 0x254(%rbx)
ja 0x8f1f6
orb $0x10, 0x11d(%rbx)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/png/pngwutil.c
// Function: png_write_chunk
void PNGAPI
png_write_chunk(png_structp png_ptr, png_bytep chunk_name,
   png_bytep data, png_size_t length)
{
   if (png_ptr == NULL)
      return;
   png_write_chunk_start(png_ptr, chunk_name, (png_uint_32)length);
   png_write_chunk_data(png_ptr, data, (png_size_t)length);
   png_write_chunk_end(png_ptr);
}

// Assembly:
testq %rdi, %rdi
je 0x8f232
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, %rbx
movl %r14d, %edx
callq 0x8f233
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x8f2a4
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x8f2e3
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/png/pngwutil.c
// Function: png_write_chunk_start
void PNGAPI
png_write_chunk_start(png_structp png_ptr, png_bytep chunk_name,
   png_uint_32 length)
{
   png_byte buf[8];

   png_debug2(0, "Writing %s chunk, length = %lu", chunk_name,
      (unsigned long)length);

   if (png_ptr == NULL)
      return;

#ifdef PNG_IO_STATE_SUPPORTED
   /* Inform the I/O callback that the chunk header is being written.
    * PNG_IO_CHUNK_HDR requires a single I/O call.
    */
   png_ptr->io_state = PNG_IO_WRITING | PNG_IO_CHUNK_HDR;
#endif

   /* Write the length and the chunk name */
   png_save_uint_32(buf, length);
   png_memcpy(buf + 4, chunk_name, 4);
   png_write_data(png_ptr, buf, (png_size_t)8);
   /* Put the chunk name into png_ptr->chunk_name */
   png_memcpy(png_ptr->chunk_name, chunk_name, 4);
   /* Reset the crc and run it over the chunk name */
   png_reset_crc(png_ptr);
   png_calculate_crc(png_ptr, chunk_name, 4);

#ifdef PNG_IO_STATE_SUPPORTED
   /* Inform the I/O callback that chunk data will (possibly) be written.
    * PNG_IO_CHUNK_DATA does NOT require a specific number of I/O calls.
    */
   png_ptr->io_state = PNG_IO_WRITING | PNG_IO_CHUNK_DATA;
#endif
}

// Assembly:
testq %rdi, %rdi
je 0x8f2a3
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl $0x22, 0x490(%rdi)
movl %edx, %eax
shrl $0x18, %eax
movq %rsp, %rsi
movb %al, (%rsi)
movl %edx, %eax
shrl $0x10, %eax
movb %al, 0x1(%rsi)
movb %dh, 0x2(%rsp)
movb %dl, 0x3(%rsi)
movl (%r14), %eax
movl %eax, 0x4(%rsi)
pushq $0x8
popq %rdx
callq 0x921cc
movl (%r14), %eax
movl %eax, 0x244(%rbx)
movq %rbx, %rdi
callq 0x7a213
pushq $0x4
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7a22a
movl $0x42, 0x490(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/png/pngwutil.c
// Function: png_write_PLTE
void /* PRIVATE */
png_write_PLTE(png_structp png_ptr, png_colorp palette, png_uint_32 num_pal)
{
   PNG_PLTE;
   png_uint_32 i;
   png_colorp pal_ptr;
   png_byte buf[3];

   png_debug(1, "in png_write_PLTE");

   if ((
#ifdef PNG_MNG_FEATURES_SUPPORTED
        !(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE) &&
#endif
        num_pal == 0) || num_pal > 256)
   {
     if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
     {
        png_error(png_ptr, "Invalid number of colors in palette");
     }
     else
     {
        png_warning(png_ptr, "Invalid number of colors in palette");
        return;
     }
   }

   if (!(png_ptr->color_type&PNG_COLOR_MASK_COLOR))
   {
      png_warning(png_ptr,
        "Ignoring request to write a PLTE chunk in grayscale PNG");
      return;
   }

   png_ptr->num_palette = (png_uint_16)num_pal;
   png_debug1(3, "num_palette = %d", png_ptr->num_palette);

   png_write_chunk_start(png_ptr, (png_bytep)png_PLTE,
     (png_uint_32)(num_pal * 3));
#ifdef PNG_POINTER_INDEXING_SUPPORTED
   for (i = 0, pal_ptr = palette; i < num_pal; i++, pal_ptr++)
   {
      buf[0] = pal_ptr->red;
      buf[1] = pal_ptr->green;
      buf[2] = pal_ptr->blue;
      png_write_chunk_data(png_ptr, buf, (png_size_t)3);
   }
#else
   /* This is a little slower but some buggy compilers need to do this
    * instead
    */
   pal_ptr=palette;
   for (i = 0; i < num_pal; i++)
   {
      buf[0] = pal_ptr[i].red;
      buf[1] = pal_ptr[i].green;
      buf[2] = pal_ptr[i].blue;
      png_write_chunk_data(png_ptr, buf, (png_size_t)3);
   }
#endif
   png_write_chunk_end(png_ptr);
   png_ptr->mode |= PNG_HAVE_PLTE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
movb $0x0, 0xc(%rsp)
movl $0x45544c50, 0x8(%rsp)  # imm = 0x45544C50
cmpl $0x100, %edx            # imm = 0x100
ja 0x8f70c
movl 0x408(%rbx), %eax
andl $0x1, %eax
orl %r14d, %eax
jne 0x8f728
cmpb $0x3, 0x24e(%rbx)
jne 0x8f7aa
leaq 0x152fb(%rip), %rsi     # 0xa4a1b
movq %rbx, %rdi
callq 0x849c0
testb $0x2, 0x24e(%rbx)
jne 0x8f73a
leaq 0x15307(%rip), %rsi     # 0xa4a3f
jmp 0x8f7b1
movw %r14w, 0x240(%rbx)
leal (%r14,%r14,2), %edx
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x8f233
leaq 0x5(%rsp), %r12
pushq $0x3
popq %r13
subl $0x1, %r14d
jb 0x8f78d
movb (%r15), %al
movb %al, 0x5(%rsp)
movb 0x1(%r15), %al
movb %al, 0x6(%rsp)
movb 0x2(%r15), %al
movb %al, 0x7(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x8f2a4
addq $0x3, %r15
jmp 0x8f75c
movq %rbx, %rdi
callq 0x8f2e3
orb $0x2, 0x11c(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x1526a(%rip), %rsi     # 0xa4a1b
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x84a53
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/png/pngwutil.c
// Function: png_write_gAMA
void /* PRIVATE */
png_write_gAMA(png_structp png_ptr, double file_gamma)
{
   PNG_gAMA;
   png_uint_32 igamma;
   png_byte buf[4];

   png_debug(1, "in png_write_gAMA");

   /* file_gamma is saved in 1/100,000ths */
   igamma = (png_uint_32)(file_gamma * 100000.0 + 0.5);
   png_save_uint_32(buf, igamma);
   png_write_chunk(png_ptr, (png_bytep)png_gAMA, buf, (png_size_t)4);
}

// Assembly:
subq $0x18, %rsp
leaq 0x10(%rsp), %rsi
movb $0x0, 0x4(%rsi)
mulsd 0xd89c(%rip), %xmm0     # 0x9d1d8
addsd 0x36cc(%rip), %xmm0     # 0x93010
cvttsd2si %xmm0, %rax
movl $0x414d4167, (%rsi)     # imm = 0x414D4167
bswapl %eax
leaq 0xc(%rsp), %rdx
movl %eax, (%rdx)
pushq $0x4
popq %rcx
callq 0x8f1fc
addq $0x18, %rsp
retq