LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/pigz.c
// Function: time2dos
local unsigned long time2dos(time_t t) {
    struct tm *tm;
    unsigned long dos;

    if (t == 0)
        t = time(NULL);
    tm = localtime(&t);
    if (tm->tm_year < 80 || tm->tm_year > 207)
        return 0;
    dos = (unsigned long)(tm->tm_year - 80) << 25;
    dos += (unsigned long)(tm->tm_mon + 1) << 21;
    dos += (unsigned long)tm->tm_mday << 16;
    dos += (unsigned long)tm->tm_hour << 11;
    dos += (unsigned long)tm->tm_min << 5;
    dos += (unsigned long)(tm->tm_sec + 1) >> 1;    // round to even seconds
    return dos;
}

// Assembly:
pushq %rax
movq %rdi, (%rsp)
testq %rdi, %rdi
jne 0xd3de
xorl %edi, %edi
callq 0x3380
movq %rax, (%rsp)
movq %rsp, %rdi
callq 0x3060
movl 0x14(%rax), %ecx
leal -0xd0(%rcx), %edx
cmpl $-0x80, %edx
jae 0xd3f8
xorl %eax, %eax
jmp 0xd43d
addl $-0x50, %ecx
shlq $0x19, %rcx
movslq 0x10(%rax), %rdx
shlq $0x15, %rdx
movslq 0xc(%rax), %rsi
shlq $0x10, %rsi
addq %rdx, %rsi
addq %rcx, %rsi
movslq 0x8(%rax), %rcx
shlq $0xb, %rcx
movslq 0x4(%rax), %rdx
shlq $0x5, %rdx
addq %rcx, %rdx
addq %rsi, %rdx
movslq (%rax), %rax
incq %rax
shrq %rax
addq %rdx, %rax
addq $0x200000, %rax         # imm = 0x200000
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/pigz.c
// Function: grow_space
local void grow_space(struct space *space) {
    size_t more;

    // compute next size up
    more = grow(space->size);
    if (more == space->size)
        throw(ERANGE, "overflow");

    // reallocate the buffer
    space->buf = alloc(space->buf, more);
    space->size = more;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %r15
movq %r15, %rdi
callq 0xab48
cmpq %r15, %rax
je 0xd475
movq %rax, %r14
movq 0x8(%rbx), %rdi
movq %rax, %rsi
callq 0x9db6
movq %rax, 0x8(%rbx)
movq %r14, 0x10(%rbx)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x8047(%rip), %rsi      # 0x154c3
pushq $0x22
popq %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xdd45
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/pigz.c
// Function: deflate_engine
local void deflate_engine(z_stream *strm, struct space *out, int flush) {
    size_t room;

    do {
        room = out->size - out->len;
        if (room == 0) {
            grow_space(out);
            room = out->size - out->len;
        }
        strm->next_out = out->buf + out->len;
        strm->avail_out = room < UINT_MAX ? (unsigned)room : UINT_MAX;
        (void)deflate(strm, flush);
        out->len = (size_t)(strm->next_out - out->buf);
    } while (strm->avail_out == 0);
    assert(strm->avail_in == 0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
movq 0x18(%rsi), %rax
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movq 0x10(%r15), %rcx
subq %rax, %rcx
jne 0xd4be
movq %r15, %rdi
callq 0xd43f
movq 0x10(%r15), %rcx
movq 0x18(%r15), %rax
subq %rax, %rcx
addq 0x8(%r15), %rax
movq %rax, 0x18(%r14)
cmpq %r12, %rcx
cmovaeq %r12, %rcx
movl %ecx, 0x20(%r14)
movq %r14, %rdi
movl %ebx, %esi
callq 0x3240
movq 0x18(%r14), %rax
subq 0x8(%r15), %rax
movq %rax, 0x18(%r15)
cmpl $0x0, 0x20(%r14)
je 0xd4a2
cmpl $0x0, 0x8(%r14)
jne 0xd501
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x851b(%rip), %rdi      # 0x15a23
leaq 0x6df1(%rip), %rsi      # 0x14300
leaq 0x8521(%rip), %rcx      # 0x15a37
movl $0x691, %edx            # imm = 0x691
callq 0x3220
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/pigz.c
// Function: free_pool
local int free_pool(struct pool *pool) {
    int count;
    struct space *space;

    possess(pool->have);
    count = 0;
    while ((space = pool->head) != NULL) {
        pool->head = space->next;
        FREE(space->buf);
        free_lock(space->use);
        FREE(space);
        count++;
    }
    assert(count == pool->made);
    release(pool->have);
    free_lock(pool->have);
    return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
leaq 0x6dcc(%rip), %r14      # 0x14300
movl $0x610, %edx            # imm = 0x610
movq %r14, %rsi
callq 0xd763
xorl %ebp, %ebp
movq 0x8(%rbx), %r15
testq %r15, %r15
je 0xd579
movq 0x28(%r15), %rax
movq %rax, 0x8(%rbx)
movq 0x8(%r15), %rdi
callq 0x3050
movq (%r15), %rdi
movl $0x615, %edx            # imm = 0x615
movq %r14, %rsi
callq 0xd8e3
movq %r15, %rdi
callq 0x3050
incl %ebp
jmp 0xd543
cmpl %ebp, 0x1c(%rbx)
jne 0xd5af
movq (%rbx), %rdi
leaq 0x6d78(%rip), %r14      # 0x14300
movl $0x61a, %edx            # imm = 0x61A
movq %r14, %rsi
callq 0xd792
movq (%rbx), %rdi
movl $0x61b, %edx            # imm = 0x61B
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xd8e3
leaq 0x8539(%rip), %rdi      # 0x15aef
leaq 0x6d43(%rip), %rsi      # 0x14300
leaq 0x853f(%rip), %rcx      # 0x15b03
movl $0x619, %edx            # imm = 0x619
callq 0x3220
nop
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/yarn.c
// Function: new_lock_
lock *new_lock_(long initial, char const *file, long line) {
    lock *bolt = my_malloc(sizeof(struct lock_s), file, line);
    int ret = pthread_mutex_init(&(bolt->mutex), NULL);
    if (ret)
        fail(ret, file, line, "mutex_init");
    ret = pthread_cond_init(&(bolt->cond), NULL);
    if (ret)
        fail(ret, file, line, "cond_init");
    bolt->value = initial;
    return bolt;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
pushq $0x60
popq %rdi
callq 0xd64a
movq %rax, %r12
movq %rax, %rdi
xorl %esi, %esi
callq 0x35d0
testl %eax, %eax
jne 0xd62d
leaq 0x28(%r12), %rdi
xorl %esi, %esi
callq 0x33a0
testl %eax, %eax
jne 0xd636
movq %r15, 0x58(%r12)
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x8505(%rip), %rcx      # 0x15b39
jmp 0xd63d
leaq 0x8507(%rip), %rcx      # 0x15b44
movl %eax, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xd67c
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/yarn.c
// Function: my_malloc
local void *my_malloc(size_t size, char const *file, long line) {
    void *block;

    if ((block = my_malloc_f(size)) == NULL)
        fail(ENOMEM, file, line, "malloc");
    return block;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
callq *0xecc6(%rip)           # 0x1c320
testq %rax, %rax
je 0xd667
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x857b(%rip), %rcx      # 0x15be9
pushq $0xc
popq %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xd67c
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/yarn.c
// Function: fail
local void fail(int err, char const *file, long line, char const *func) {
    fprintf(stderr, "%s: ", yarn_prefix);
    switch (err) {
        case EPERM:
            fputs("already unlocked", stderr);
            break;
        case ESRCH:
            fputs("no such thread", stderr);
            break;
        case EDEADLK:
            fputs("resource deadlock", stderr);
            break;
        case ENOMEM:
            fputs("out of memory", stderr);
            break;
        case EBUSY:
            fputs("can't destroy locked resource", stderr);
            break;
        case EINVAL:
            fputs("invalid request", stderr);
            break;
        case EAGAIN:
            fputs("resource unavailable", stderr);
            break;
        default:
            fprintf(stderr, "internal error %d", err);
    }
    fprintf(stderr, " (%s:%ld:%s)\n", file, line, func);
    if (yarn_abort != NULL)
        yarn_abort(err);
    exit(err);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movl %edi, %ebx
movq 0xe959(%rip), %r13      # 0x1bff0
movq (%r13), %rdi
movq 0xec76(%rip), %rdx      # 0x1c318
leaq 0x7b48(%rip), %rsi      # 0x151f1
xorl %eax, %eax
callq 0x3340
movq (%r13), %rsi
cmpl $0x23, %ebx
je 0xd6fb
cmpl $0x3, %ebx
je 0xd725
cmpl $0xb, %ebx
je 0xd71c
cmpl $0xc, %ebx
je 0xd6e0
cmpl $0x10, %ebx
je 0xd6f2
cmpl $0x16, %ebx
je 0xd6e9
cmpl $0x1, %ebx
jne 0xd704
leaq 0x8512(%rip), %rdi      # 0x15bf0
jmp 0xd72c
leaq 0x8640(%rip), %rdi      # 0x15d27
jmp 0xd72c
leaq 0x8550(%rip), %rdi      # 0x15c40
jmp 0xd72c
leaq 0x8529(%rip), %rdi      # 0x15c22
jmp 0xd72c
leaq 0x850e(%rip), %rdi      # 0x15c10
jmp 0xd72c
leaq 0x855a(%rip), %rax      # 0x15c65
movq %rsi, %rdi
movq %rax, %rsi
movl %ebx, %edx
xorl %eax, %eax
callq 0x3340
jmp 0xd731
leaq 0x852d(%rip), %rdi      # 0x15c50
jmp 0xd72c
leaq 0x84d5(%rip), %rdi      # 0x15c01
callq 0x3230
movq (%r13), %rdi
leaq 0x853b(%rip), %rsi      # 0x15c77
movq %r12, %rdx
movq %r15, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x3340
movq 0x2eead(%rip), %rax     # 0x3c600
testq %rax, %rax
je 0xd75c
movl %ebx, %edi
callq *%rax
movl %ebx, %edi
callq 0x3540
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/yarn.c
// Function: twist_
void twist_(lock *bolt, enum twist_op op, long val,
            char const *file, long line) {
    if (op == TO)
        bolt->value = val;
    else if (op == BY)
        bolt->value += val;
    int ret = pthread_cond_broadcast(&(bolt->cond));
    if (ret)
        fail(ret, file, line, "cond_broadcast");
    ret = pthread_mutex_unlock(&(bolt->mutex));
    if (ret)
        fail(ret, file, line, "mutex_unlock");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %r8, %rbx
movq %rcx, %r14
movq %rdi, %r15
cmpl $0x1, %esi
je 0xd7de
testl %esi, %esi
jne 0xd7e2
movq %rdx, 0x58(%r15)
jmp 0xd7e2
addq %rdx, 0x58(%r15)
leaq 0x28(%r15), %rdi
callq 0x30c0
testl %eax, %eax
jne 0xd801
movq %r15, %rdi
callq 0x33c0
testl %eax, %eax
jne 0xd80a
popq %rbx
popq %r14
popq %r15
retq
leaq 0x835e(%rip), %rcx      # 0x15b66
jmp 0xd811
leaq 0x8348(%rip), %rcx      # 0x15b59
movl %eax, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xd67c
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/yarn.c
// Function: wait_for_
void wait_for_(lock *bolt, enum wait_op op, long val,
               char const *file, long line) {
    switch (op) {
        case TO_BE:
            until (bolt->value == val) {
                int ret = pthread_cond_wait(&(bolt->cond), &(bolt->mutex));
                if (ret)
                    fail(ret, file, line, "cond_wait");
            }
            break;
        case NOT_TO_BE:
            until (bolt->value != val) {
                int ret = pthread_cond_wait(&(bolt->cond), &(bolt->mutex));
                if (ret)
                    fail(ret, file, line, "cond_wait");
            }
            break;
        case TO_BE_MORE_THAN:
            until (bolt->value > val) {
                int ret = pthread_cond_wait(&(bolt->cond), &(bolt->mutex));
                if (ret)
                    fail(ret, file, line, "cond_wait");
            }
            break;
        case TO_BE_LESS_THAN:
            until (bolt->value < val) {
                int ret = pthread_cond_wait(&(bolt->cond), &(bolt->mutex));
                if (ret)
                    fail(ret, file, line, "cond_wait");
            }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
cmpl $0x3, %esi
ja 0xd8d4
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, %r12
movl %esi, %eax
leaq 0x82df(%rip), %rcx      # 0x15b24
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x28(%r12), %r13
cmpq %r15, 0x58(%r12)
je 0xd8d4
movq %r13, %rdi
movq %r12, %rsi
callq 0x3150
testl %eax, %eax
je 0xd853
jmp 0xd8c0
leaq 0x28(%r12), %r13
cmpq %r15, 0x58(%r12)
jg 0xd8d4
movq %r13, %rdi
movq %r12, %rsi
callq 0x3150
testl %eax, %eax
je 0xd870
jmp 0xd8c0
leaq 0x28(%r12), %r13
cmpq %r15, 0x58(%r12)
jl 0xd8d4
movq %r13, %rdi
movq %r12, %rsi
callq 0x3150
testl %eax, %eax
je 0xd88d
jmp 0xd8c0
leaq 0x28(%r12), %r13
cmpq %r15, 0x58(%r12)
jne 0xd8d4
movq %r13, %rdi
movq %r12, %rsi
callq 0x3150
testl %eax, %eax
je 0xd8aa
leaq 0x82ae(%rip), %rcx      # 0x15b75
movl %eax, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xd67c
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/yarn.c
// Function: free_lock_
void free_lock_(lock *bolt, char const *file, long line) {
    if (bolt == NULL)
        return;
    int ret = pthread_cond_destroy(&(bolt->cond));
    if (ret)
        fail(ret, file, line, "cond_destroy");
    ret = pthread_mutex_destroy(&(bolt->mutex));
    if (ret)
        fail(ret, file, line, "mutex_destroy");
    my_free(bolt);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0xd91d
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
addq $0x28, %rdi
callq 0x34e0
testl %eax, %eax
jne 0xd923
movq %r15, %rdi
callq 0x31e0
testl %eax, %eax
jne 0xd92c
movq %r15, %rdi
popq %rbx
popq %r14
popq %r15
jmpq *0xea0b(%rip)           # 0x1c328
popq %rbx
popq %r14
popq %r15
retq
leaq 0x8255(%rip), %rcx      # 0x15b7f
jmp 0xd933
leaq 0x8259(%rip), %rcx      # 0x15b8c
movl %eax, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xd67c
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/yarn.c
// Function: launch_
thread *launch_(void (*probe)(void *), void *payload,
                char const *file, long line) {
    // construct the requested call and argument for the ignition() routine
    // (allocated instead of automatic so that we're sure this will still be
    // there when ignition() actually starts up -- ignition() will free this
    // allocation)
    struct capsule *capsule = my_malloc(sizeof(struct capsule), file, line);
    capsule->probe = probe;
    capsule->payload = payload;
    capsule->file = file;
    capsule->line = line;

    // assure this thread is in the list before join_all() or ignition() looks
    // for it
    possess_(&(threads_lock), file, line);

    // create the thread and call ignition() from that thread
    thread *th = my_malloc(sizeof(struct thread_s), file, line);
    pthread_attr_t attr;
    int ret = pthread_attr_init(&attr);
    if (ret)
        fail(ret, file, line, "attr_init");
    ret = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
    if (ret)
        fail(ret, file, line, "attr_setdetachstate");
    ret = pthread_create(&(th->id), &attr, ignition, capsule);
    if (ret)
        fail(ret, file, line, "create");
    ret = pthread_attr_destroy(&attr);
    if (ret)
        fail(ret, file, line, "attr_destroy");

    // put the thread in the threads list for join_all()
    th->done = 0;
    th->next = threads;
    threads = th;
    release_(&(threads_lock), file, line);
    return th;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r13
pushq $0x20
popq %rdi
movq %rdx, %rsi
movq %rcx, %rdx
callq 0xd64a
movq %rax, %r12
movq %r13, (%rax)
movq %r15, 0x8(%rax)
movq %r14, 0x10(%rax)
movq %rbx, 0x18(%rax)
leaq 0x2ec88(%rip), %rdi     # 0x3c608
movq %r14, %rsi
movq %rbx, %rdx
callq 0xd763
pushq $0x18
popq %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xd64a
movq %rax, %r15
leaq 0x8(%rsp), %rdi
callq 0x32d0
testl %eax, %eax
jne 0xda1d
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0x33b0
testl %eax, %eax
jne 0xda26
leaq 0x8b(%rip), %rdx        # 0xda4c
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
movq %r12, %rcx
callq 0x3460
testl %eax, %eax
jne 0xda2f
leaq 0x8(%rsp), %rdi
callq 0x3510
testl %eax, %eax
jne 0xda38
andl $0x0, 0x8(%r15)
movq 0x2ec79(%rip), %rax     # 0x3c668
movq %rax, 0x10(%r15)
movq %r15, 0x2ec6e(%rip)     # 0x3c668
leaq 0x2ec07(%rip), %rdi     # 0x3c608
movq %r14, %rsi
movq %rbx, %rdx
callq 0xd792
movq %r15, %rax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x8176(%rip), %rcx      # 0x15b9a
jmp 0xda3f
leaq 0x8177(%rip), %rcx      # 0x15ba4
jmp 0xda3f
leaq 0x8182(%rip), %rcx      # 0x15bb8
jmp 0xda3f
leaq 0x8180(%rip), %rcx      # 0x15bbf
movl %eax, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xd67c
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/yarn.c
// Function: ignition
local void *ignition(void *arg) {
    struct capsule *capsule = arg;

    // run reenter() before leaving
    pthread_cleanup_push(reenter, arg);

    // execute the requested function with argument
    capsule->probe(capsule->payload);

    // mark this thread as done, letting join_all() know, and free capsule
    pthread_cleanup_pop(1);

    // exit thread
    return NULL;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movq %rsp, %rdi
xorl %esi, %esi
callq 0x35c0
testl %eax, %eax
jne 0xda8f
movq %rsp, %r14
movq %r14, %rdi
callq 0x3580
movq 0x8(%rbx), %rdi
callq *(%rbx)
movq %r14, %rdi
callq 0x31f0
movq %rbx, %rdi
callq 0xdc1a
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
callq 0xdc1a
movq %rsp, %rdi
callq 0x3440
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/yarn.c
// Function: join_
void join_(thread *ally, char const *file, long line) {
    // wait for thread to exit and return its resources
    int ret = pthread_join(ally->id, NULL);
    if (ret)
        fail(ret, file, line, "join");

    // find the thread in the threads list
    possess_(&(threads_lock), file, line);
    thread **prior = &(threads);
    thread *match;
    while ((match = *prior) != NULL) {
        if (match == ally)
            break;
        prior = &(match->next);
    }
    if (match == NULL)
        fail(ESRCH, file, line, "join lost");

    // remove thread from list and update exited count, free thread
    if (match->done)
        threads_lock.value--;
    *prior = match->next;
    release_(&(threads_lock), file, line);
    my_free(ally);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rdi
xorl %esi, %esi
callq 0x3590
testl %eax, %eax
jne 0xdb20
leaq 0x2eb46(%rip), %rdi     # 0x3c608
movq %r14, %rsi
movq %rbx, %rdx
callq 0xd763
leaq 0x2eb94(%rip), %rcx     # 0x3c668
movq %rcx, %rax
movq (%rcx), %rdx
leaq 0x10(%rdx), %rcx
testq %rdx, %rdx
je 0xdae8
cmpq %r15, %rdx
jne 0xdad4
testq %rdx, %rdx
je 0xdb2b
cmpl $0x0, 0x8(%rdx)
je 0xdafa
decq 0x2eb66(%rip)           # 0x3c660
movq (%rcx), %rcx
movq %rcx, (%rax)
leaq 0x2eb01(%rip), %rdi     # 0x3c608
movq %r14, %rsi
movq %rbx, %rdx
callq 0xd792
movq %r15, %rdi
popq %rbx
popq %r14
popq %r15
jmpq *0xe808(%rip)           # 0x1c328
leaq 0x80a5(%rip), %rcx      # 0x15bcc
movl %eax, %edi
jmp 0xdb35
leaq 0x809f(%rip), %rcx      # 0x15bd1
pushq $0x3
popq %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xd67c
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/yarn.c
// Function: join_all_
int join_all_(char const *file, long line) {
    // grab the threads list and initialize the joined count
    int count = 0;
    possess_(&(threads_lock), file, line);

    // do until threads list is empty
    while (threads != NULL) {
        // wait until at least one thread has reentered
        wait_for_(&(threads_lock), NOT_TO_BE, 0, file, line);

        // find the first thread marked done (should be at or near the top)
        thread **prior = &(threads);
        thread *match;
        while ((match = *prior) != NULL) {
            if (match->done)
                break;
            prior = &(match->next);
        }
        if (match == NULL)
            fail(ESRCH, file, line, "join_all lost");

        // join the thread (will be almost immediate), remove from the threads
        // list, update the reenter count, and free the thread
        int ret = pthread_join(match->id, NULL);
        if (ret)
            fail(ret, file, line, "join");
        threads_lock.value--;
        *prior = match->next;
        my_free(match);
        count++;
    }

    // let go of the threads list and return the number of threads joined
    release_(&(threads_lock), file, line);
    return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x2eab0(%rip), %rdi     # 0x3c608
movq %r14, %rsi
movq %rbx, %rdx
callq 0xd763
xorl %r15d, %r15d
leaq 0x2eafb(%rip), %rbp     # 0x3c668
cmpq $0x0, 0x2eaf3(%rip)     # 0x3c668
je 0xdbd6
leaq 0x2ea8a(%rip), %rdi     # 0x3c608
pushq $0x1
popq %rsi
xorl %edx, %edx
movq %r14, %rcx
movq %rbx, %r8
callq 0xd81e
movq %rbp, %r12
movq (%r12), %r13
testq %r13, %r13
je 0xdbfa
cmpl $0x0, 0x8(%r13)
jne 0xdbaa
addq $0x10, %r13
movq %r13, %r12
jmp 0xdb91
movq (%r13), %rdi
xorl %esi, %esi
callq 0x3590
testl %eax, %eax
jne 0xdc0f
decq 0x2eaa0(%rip)           # 0x3c660
movq 0x10(%r13), %rax
movq %rax, (%r12)
movq %r13, %rdi
callq *0xe757(%rip)           # 0x1c328
incl %r15d
jmp 0xdb6d
leaq 0x2ea2b(%rip), %rdi     # 0x3c608
movq %r14, %rsi
movq %rbx, %rdx
callq 0xd792
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7fda(%rip), %rcx      # 0x15bdb
pushq $0x3
popq %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xd67c
leaq 0x7fb6(%rip), %rcx      # 0x15bcc
movl %eax, %edi
jmp 0xdc04
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/yarn.c
// Function: reenter
local void reenter(void *arg) {
    struct capsule *capsule = arg;

    // find this thread in the threads list by matching the thread id
    pthread_t me = pthread_self();
    possess_(&(threads_lock), capsule->file, capsule->line);
    thread **prior = &(threads);
    thread *match;
    while ((match = *prior) != NULL) {
        if (pthread_equal(match->id, me))
            break;
        prior = &(match->next);
    }
    if (match == NULL)
        fail(ESRCH, capsule->file, capsule->line, "reenter lost");

    // mark this thread as done and move it to the head of the list
    match->done = 1;
    if (threads != match) {
        *prior = match->next;
        match->next = threads;
        threads = match;
    }

    // update the count of threads to be joined and alert join_all()
    twist_(&(threads_lock), BY, +1, capsule->file, capsule->line);

    // free the capsule resource, even if the thread is cancelled (though yarn
    // doesn't use pthread_cancel() -- you never know)
    my_free(capsule);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x34d0
movq %rax, %r14
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
leaq 0x2e9cc(%rip), %rdi     # 0x3c608
callq 0xd763
leaq 0x2ea20(%rip), %r12     # 0x3c668
movq (%r12), %r15
testq %r15, %r15
je 0xdcc2
movq (%r15), %rdi
movq %r14, %rsi
callq 0x34b0
testl %eax, %eax
jne 0xdc69
addq $0x10, %r15
movq %r15, %r12
jmp 0xdc48
movl $0x1, 0x8(%r15)
cmpq %r15, 0x2e9f0(%rip)     # 0x3c668
je 0xdc94
movq 0x10(%r15), %rax
movq %rax, (%r12)
movq 0x2e9df(%rip), %rax     # 0x3c668
movq %rax, 0x10(%r15)
movq %r15, 0x2e9d4(%rip)     # 0x3c668
movq 0x10(%rbx), %rcx
movq 0x18(%rbx), %r8
leaq 0x2e965(%rip), %rdi     # 0x3c608
pushq $0x1
popq %rsi
pushq $0x1
popq %rdx
callq 0xd7c1
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmpq *0xe666(%rip)           # 0x1c328
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
leaq 0x7fb4(%rip), %rcx      # 0x15c85
pushq $0x3
popq %rdi
callq 0xd67c
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/zopfli/src/zopfli/deflate.c
// Function: ZopfliCalculateBlockSize
double ZopfliCalculateBlockSize(const ZopfliLZ77Store* lz77,
                                size_t lstart, size_t lend, int btype) {
  unsigned ll_lengths[ZOPFLI_NUM_LL];
  unsigned d_lengths[ZOPFLI_NUM_D];

  double result = 3; /* bfinal and btype bits */

  if (btype == 0) {
    size_t length = ZopfliLZ77GetByteRange(lz77, lstart, lend);
    size_t rem = length % 65535;
    size_t blocks = length / 65535 + (rem ? 1 : 0);
    /* An uncompressed block must actually be split into multiple blocks if it's
       larger than 65535 bytes long. Eeach block header is 5 bytes: 3 bits,
       padding, LEN and NLEN (potential less padding for first one ignored). */
    return blocks * 5 * 8 + length * 8;
  } if (btype == 1) {
    GetFixedTree(ll_lengths, d_lengths);
    result += CalculateBlockSymbolSize(
        ll_lengths, d_lengths, lz77, lstart, lend);
  } else {
    result += GetDynamicLengths(lz77, lstart, lend, ll_lengths, d_lengths);
  }

  return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf10, %rsp            # imm = 0xF10
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
cmpl $0x1, %ecx
je 0xe15d
testl %ecx, %ecx
jne 0xe198
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x11093
movq %rax, %rcx
movl $0xffff, %esi           # imm = 0xFFFF
xorl %edx, %edx
divq %rsi
cmpq $0x1, %rdx
sbbq $-0x1, %rax
imulq $0x28, %rax, %rax
leaq (%rax,%rcx,8), %rax
movq %rax, %xmm1
punpckldq 0x5edc(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x5ee4(%rip), %xmm1     # 0x14030
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
jmp 0xe224
leaq 0x190(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xe235
leaq 0x360(%rbx), %rax
cmpq %r14, %rax
jbe 0xe1b5
leaq 0x190(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movq %r15, %rdx
movq %rbx, %rcx
movq %r14, %r8
callq 0xf3db
jmp 0xe1fb
leaq 0x190(%rsp), %rcx
leaq 0x10(%rsp), %r8
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xe2a8
jmp 0xe21c
leaq 0x610(%rsp), %r12
leaq 0x90(%rsp), %r13
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x110c5
movq %r14, (%rsp)
leaq 0x190(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %r8
movq %rbx, %r9
callq 0xf4f2
movq %rax, %xmm1
punpckldq 0x5e18(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x5e20(%rip), %xmm1     # 0x14030
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
addsd 0x7b9c(%rip), %xmm0     # 0x15dc0
addq $0xf10, %rsp            # imm = 0xF10
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/zopfli/src/zopfli/deflate.c
// Function: ZopfliCalculateBlockSizeAutoType
double ZopfliCalculateBlockSizeAutoType(const ZopfliLZ77Store* lz77,
                                        size_t lstart, size_t lend) {
  double uncompressedcost = ZopfliCalculateBlockSize(lz77, lstart, lend, 0);
  /* Don't do the expensive fixed cost calculation for larger blocks that are
     unlikely to use it. */
  double fixedcost = (lz77->size > 1000) ?
      uncompressedcost : ZopfliCalculateBlockSize(lz77, lstart, lend, 1);
  double dyncost = ZopfliCalculateBlockSize(lz77, lstart, lend, 2);
  return (uncompressedcost < fixedcost && uncompressedcost < dyncost)
      ? uncompressedcost
      : (fixedcost < dyncost ? fixedcost : dyncost);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %ecx, %ecx
callq 0xe0e6
cmpq $0x3e8, 0x10(%r15)      # imm = 0x3E8
movapd %xmm0, 0x10(%rsp)
ja 0xe529
pushq $0x1
popq %rcx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xe0e6
movapd %xmm0, (%rsp)
pushq $0x2
popq %rcx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xe0e6
movapd (%rsp), %xmm4
movapd 0x10(%rsp), %xmm3
movapd %xmm3, %xmm1
cmpltpd %xmm0, %xmm1
movapd %xmm3, %xmm2
cmpltpd %xmm4, %xmm2
andpd %xmm1, %xmm2
movd %xmm2, %eax
testb $0x1, %al
jne 0xe570
minsd %xmm0, %xmm4
movapd %xmm4, %xmm3
movapd %xmm3, %xmm0
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/zopfli/src/zopfli/deflate.c
// Function: ZopfliDeflate
void ZopfliDeflate(const ZopfliOptions* options, int btype, int final,
                   const unsigned char* in, size_t insize,
                   unsigned char* bp, unsigned char** out, size_t* outsize) {
 size_t offset = *outsize;
#if ZOPFLI_MASTER_BLOCK_SIZE == 0
  ZopfliDeflatePart(options, btype, final, in, 0, insize, bp, out, outsize);
#else
  size_t i = 0;
  do {
    int masterfinal = (i + ZOPFLI_MASTER_BLOCK_SIZE >= insize);
    int final2 = final && masterfinal;
    size_t size = masterfinal ? insize - i : ZOPFLI_MASTER_BLOCK_SIZE;
    ZopfliDeflatePart(options, btype, final2,
                      in, i, i + size, bp, out, outsize);
    i += size;
  } while (i < insize);
#endif
  if (options->verbose) {
    fprintf(stderr,
            "Original Size: %lu, Deflate: %lu, Compression: %f%% Removed\n",
            (unsigned long)insize, (unsigned long)(*outsize - offset),
            100.0 * (double)(insize - (*outsize - offset)) / (double)insize);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, 0x20(%rsp)
movq %r8, %r14
movq %rcx, 0x18(%rsp)
movl %edx, 0xc(%rsp)
movl %esi, 0x8(%rsp)
movq %rdi, %r12
movq 0x68(%rsp), %r13
movq 0x60(%rsp), %r15
movq (%r13), %rax
movq %rax, 0x10(%rsp)
xorl %r8d, %r8d
movl $0xf4240, %ebp          # imm = 0xF4240
cmpl $0x0, 0xc(%rsp)
setne %al
leaq (%r8,%rbp), %rcx
movq %r14, %rbx
subq %r8, %rbx
cmpq %r14, %rcx
cmovbq %rbp, %rbx
setae %cl
andb %al, %cl
movzbl %cl, %edx
addq %r8, %rbx
subq $0x8, %rsp
movq %r12, %rdi
movl 0x10(%rsp), %esi
movq 0x20(%rsp), %rcx
movq %rbx, %r9
pushq %r13
pushq %r15
pushq 0x38(%rsp)
callq 0xe57e
addq $0x20, %rsp
movq %rbx, %r8
cmpq %r14, %rbx
jb 0xf2ef
cmpl $0x0, (%r12)
jne 0xf355
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xcc94(%rip), %rax      # 0x1bff0
movq (%rax), %rdi
movq (%r13), %rcx
subq 0x10(%rsp), %rcx
movq %r14, %rax
subq %rcx, %rax
movq %rax, %xmm1
movq 0x4ca5(%rip), %xmm2     # 0x14020
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x4ca9(%rip), %xmm3     # 0x14030
subpd %xmm3, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x4f29(%rip), %xmm0     # 0x142c8
movq %r14, %xmm1
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
subpd %xmm3, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
leaq 0x6a0d(%rip), %rsi      # 0x15dd0
movq %r14, %rdx
movb $0x1, %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3340
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/zopfli/src/zopfli/deflate.c
// Function: CalculateBlockSymbolSizeSmall
static size_t CalculateBlockSymbolSizeSmall(const unsigned* ll_lengths,
                                            const unsigned* d_lengths,
                                            const ZopfliLZ77Store* lz77,
                                            size_t lstart, size_t lend) {
  size_t result = 0;
  size_t i;
  for (i = lstart; i < lend; i++) {
    assert(i < lz77->size);
    assert(lz77->litlens[i] < 259);
    if (lz77->dists[i] == 0) {
      result += ll_lengths[lz77->litlens[i]];
    } else {
      int ll_symbol = ZopfliGetLengthSymbol(lz77->litlens[i]);
      int d_symbol = ZopfliGetDistSymbol(lz77->dists[i]);
      result += ll_lengths[ll_symbol];
      result += d_lengths[d_symbol];
      result += ZopfliGetLengthSymbolExtraBits(ll_symbol);
      result += ZopfliGetDistSymbolExtraBits(d_symbol);
    }
  }
  result += ll_lengths[256]; /*end symbol*/
  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, 0x10(%rsp)
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, 0x8(%rsp)
movq %rdi, (%rsp)
xorl %ebp, %ebp
cmpq 0x10(%rsp), %r14
jae 0xf495
cmpq 0x10(%r15), %r14
jae 0xf4b4
movq (%r15), %rax
movzwl (%rax,%r14,2), %edi
cmpl $0x103, %edi            # imm = 0x103
jae 0xf4d3
movq 0x8(%r15), %rax
cmpw $0x0, (%rax,%r14,2)
je 0xf481
callq 0x137a5
movl %eax, %r13d
movq 0x8(%r15), %rax
movzwl (%rax,%r14,2), %edi
callq 0x13764
movslq %r13d, %rdi
movq (%rsp), %rcx
movl (%rcx,%rdi,4), %ecx
addq %rcx, %rbp
movslq %eax, %r13
movq 0x8(%rsp), %rax
movl (%rax,%r13,4), %ebx
callq 0x137b3
movslq %eax, %r12
addq %rbx, %r12
addq %rbp, %r12
movl %r13d, %edi
callq 0x137c5
movslq %eax, %rbp
addq %r12, %rbp
jmp 0xf48d
movl %edi, %eax
movq (%rsp), %rcx
movl (%rcx,%rax,4), %eax
addq %rax, %rbp
incq %r14
jmp 0xf3ff
movq (%rsp), %rax
movl 0x400(%rax), %eax
addq %rax, %rbp
movq %rbp, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6952(%rip), %rdi      # 0x15e0d
leaq 0x695a(%rip), %rsi      # 0x15e1c
leaq 0x696f(%rip), %rcx      # 0x15e38
movl $0x163, %edx            # imm = 0x163
callq 0x3220
leaq 0x69d8(%rip), %rdi      # 0x15eb2
leaq 0x693b(%rip), %rsi      # 0x15e1c
leaq 0x6950(%rip), %rcx      # 0x15e38
movl $0x164, %edx            # imm = 0x164
callq 0x3220
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/zopfli/src/zopfli/deflate.c
// Function: CalculateBlockSymbolSizeGivenCounts
static size_t CalculateBlockSymbolSizeGivenCounts(const size_t* ll_counts,
                                                  const size_t* d_counts,
                                                  const unsigned* ll_lengths,
                                                  const unsigned* d_lengths,
                                                  const ZopfliLZ77Store* lz77,
                                                  size_t lstart, size_t lend) {
  size_t result = 0;
  size_t i;
  if (lstart + ZOPFLI_NUM_LL * 3 > lend) {
    return CalculateBlockSymbolSizeSmall(
        ll_lengths, d_lengths, lz77, lstart, lend);
  } else {
    for (i = 0; i < 256; i++) {
      result += ll_lengths[i] * ll_counts[i];
    }
    for (i = 257; i < 286; i++) {
      result += ll_lengths[i] * ll_counts[i];
      result += ZopfliGetLengthSymbolExtraBits(i) * ll_counts[i];
    }
    for (i = 0; i < 30; i++) {
      result += d_lengths[i] * d_counts[i];
      result += ZopfliGetDistSymbolExtraBits(i) * d_counts[i];
    }
    result += ll_lengths[256]; /*end symbol*/
    return result;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq 0x40(%rsp), %rax
leaq 0x360(%r9), %rdx
cmpq %rax, %rdx
jbe 0xf533
movq %r14, %rdi
movq %rcx, %rsi
movq %r8, %rdx
movq %r9, %rcx
movq %rax, %r8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf3db
movq %rsi, %r15
movq %rdi, %r13
xorl %r12d, %r12d
xorl %eax, %eax
cmpq $0x100, %rax            # imm = 0x100
je 0xf558
movl (%r14,%rax,4), %edx
imulq (%r13,%rax,8), %rdx
addq %rdx, %r12
incq %rax
jmp 0xf53e
movq %rcx, (%rsp)
movl $0x101, %ebp            # imm = 0x101
cmpq $0x11e, %rbp            # imm = 0x11E
je 0xf58e
movl (%r14,%rbp,4), %ebx
imulq (%r13,%rbp,8), %rbx
movl %ebp, %edi
callq 0x137b3
cltq
imulq (%r13,%rbp,8), %rax
addq %rax, %r12
addq %rbx, %r12
incq %rbp
jmp 0xf561
xorl %r13d, %r13d
movq (%rsp), %rbp
cmpq $0x1e, %r13
je 0xf5bf
movl (%rbp,%r13,4), %ebx
imulq (%r15,%r13,8), %rbx
movl %r13d, %edi
callq 0x137c5
cltq
imulq (%r15,%r13,8), %rax
addq %rax, %r12
addq %rbx, %r12
incq %r13
jmp 0xf595
movl 0x400(%r14), %eax
addq %rax, %r12
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/zopfli/src/zopfli/deflate.c
// Function: CalculateTreeSize
static size_t CalculateTreeSize(const unsigned* ll_lengths,
                                const unsigned* d_lengths) {
  size_t result = 0;
  int i;

  for(i = 0; i < 8; i++) {
    size_t size = EncodeTree(ll_lengths, d_lengths,
                             i & 1, i & 2, i & 4,
                             0, 0, 0);
    if (result == 0 || size < result) result = size;
  }

  return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorl %r12d, %r12d
xorl %r15d, %r15d
cmpl $0x8, %r12d
je 0xf66a
movl %r12d, %edx
andl $0x1, %edx
movl %r12d, %ecx
andl $0x2, %ecx
movl %r12d, %r8d
andl $0x4, %r8d
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
movq %rbx, %rsi
xorl %r9d, %r9d
callq 0xf679
leaq -0x1(%r15), %rcx
cmpq %rax, %rcx
cmovaeq %rax, %r15
incl %r12d
jmp 0xf62c
movq %r15, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/zopfli/src/zopfli/lz77.c
// Function: ZopfliAppendLZ77Store
void ZopfliAppendLZ77Store(const ZopfliLZ77Store* store,
                           ZopfliLZ77Store* target) {
  size_t i;
  for (i = 0; i < store->size; i++) {
    ZopfliStoreLitLenDist(store->litlens[i], store->dists[i],
                          store->pos[i], target);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
cmpq 0x10(%r14), %r15
jae 0x1108d
movq (%r14), %rax
movq 0x8(%r14), %rcx
movzwl (%rax,%r15,2), %edi
movzwl (%rcx,%r15,2), %esi
movq 0x20(%r14), %rax
movq (%rax,%r15,8), %rdx
movq %rbx, %rcx
callq 0x10c30
incq %r15
jmp 0x11061
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/zopfli/src/zopfli/lz77.c
// Function: ZopfliLZ77GetByteRange
size_t ZopfliLZ77GetByteRange(const ZopfliLZ77Store* lz77,
                              size_t lstart, size_t lend) {
  size_t l = lend - 1;
  if (lstart == lend) return 0;
  return lz77->pos[l] + ((lz77->dists[l] == 0) ?
      1 : lz77->litlens[l]) - lz77->pos[lstart];
}

// Assembly:
cmpq %rdx, %rsi
jne 0x1109b
xorl %eax, %eax
retq
movq 0x8(%rdi), %rax
movq 0x20(%rdi), %rcx
movq -0x8(%rcx,%rdx,8), %r8
cmpw $0x0, -0x2(%rax,%rdx,2)
je 0x110ba
movq (%rdi), %rax
movzwl -0x2(%rax,%rdx,2), %eax
jmp 0x110bd
pushq $0x1
popq %rax
addq %r8, %rax
subq (%rcx,%rsi,8), %rax
retq
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/zopfli/src/zopfli/lz77.c
// Function: ZopfliLZ77GetHistogram
void ZopfliLZ77GetHistogram(const ZopfliLZ77Store* lz77,
                           size_t lstart, size_t lend,
                           size_t* ll_counts, size_t* d_counts) {
  size_t i;
  if (lstart + ZOPFLI_NUM_LL * 3 > lend) {
    memset(ll_counts, 0, sizeof(*ll_counts) * ZOPFLI_NUM_LL);
    memset(d_counts, 0, sizeof(*d_counts) * ZOPFLI_NUM_D);
    for (i = lstart; i < lend; i++) {
      ll_counts[lz77->ll_symbol[i]]++;
      if (lz77->dists[i] != 0) d_counts[lz77->d_symbol[i]]++;
    }
  } else {
    /* Subtract the cumulative histograms at the end and the start to get the
    histogram for this range. */
    ZopfliLZ77GetHistogramAt(lz77, lend - 1, ll_counts, d_counts);
    if (lstart > 0) {
      size_t ll_counts2[ZOPFLI_NUM_LL];
      size_t d_counts2[ZOPFLI_NUM_D];
      ZopfliLZ77GetHistogramAt(lz77, lstart - 1, ll_counts2, d_counts2);

      for (i = 0; i < ZOPFLI_NUM_LL; i++) {
        ll_counts[i] -= ll_counts2[i];
      }
      for (i = 0; i < ZOPFLI_NUM_D; i++) {
        d_counts[i] -= d_counts2[i];
      }
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa00, %rsp            # imm = 0xA00
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %r12
leaq 0x360(%rsi), %rax
cmpq %rdx, %rax
jbe 0x11145
movl $0x900, %edx            # imm = 0x900
movq %r14, %rdi
xorl %esi, %esi
callq 0x3260
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3260
cmpq %r13, %r15
jae 0x111a7
movq 0x28(%r12), %rax
movzwl (%rax,%r15,2), %eax
incq (%r14,%rax,8)
movq 0x8(%r12), %rax
cmpw $0x0, (%rax,%r15,2)
je 0x11140
movq 0x30(%r12), %rax
movzwl (%rax,%r15,2), %eax
incq (%rbx,%rax,8)
incq %r15
jmp 0x1110e
decq %r13
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x111b8
testq %r15, %r15
je 0x111a7
decq %r15
leaq 0x100(%rsp), %rdx
movq %rsp, %rcx
movq %r12, %rdi
movq %r15, %rsi
callq 0x111b8
xorl %eax, %eax
cmpq $0x120, %rax            # imm = 0x120
je 0x11192
movq 0x100(%rsp,%rax,8), %rcx
subq %rcx, (%r14,%rax,8)
incq %rax
jmp 0x11179
xorl %eax, %eax
cmpq $0x20, %rax
je 0x111a7
movq (%rsp,%rax,8), %rcx
subq %rcx, (%rbx,%rax,8)
incq %rax
jmp 0x11194
addq $0xa00, %rsp            # imm = 0xA00
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/zopfli/src/zopfli/lz77.c
// Function: ZopfliLZ77GetHistogramAt
static void ZopfliLZ77GetHistogramAt(const ZopfliLZ77Store* lz77, size_t lpos,
                                     size_t* ll_counts, size_t* d_counts) {
  /* The real histogram is created by using the histogram for this chunk, but
  all superfluous values of this chunk subtracted. */
  size_t llpos = ZOPFLI_NUM_LL * (lpos / ZOPFLI_NUM_LL);
  size_t dpos = ZOPFLI_NUM_D * (lpos / ZOPFLI_NUM_D);
  size_t i;
  for (i = 0; i < ZOPFLI_NUM_LL; i++) {
    ll_counts[i] = lz77->ll_counts[llpos + i];
  }
  for (i = lpos + 1; i < llpos + ZOPFLI_NUM_LL && i < lz77->size; i++) {
    ll_counts[lz77->ll_symbol[i]]--;
  }
  for (i = 0; i < ZOPFLI_NUM_D; i++) {
    d_counts[i] = lz77->d_counts[dpos + i];
  }
  for (i = lpos + 1; i < dpos + ZOPFLI_NUM_D && i < lz77->size; i++) {
    if (lz77->dists[i] != 0) d_counts[lz77->d_symbol[i]]--;
  }
}

// Assembly:
movq %rdx, %r8
xorl %r10d, %r10d
movl $0x120, %r9d            # imm = 0x120
movq %rsi, %rax
xorl %edx, %edx
divq %r9
movq %rsi, %r9
subq %rdx, %r9
leaq (,%r9,8), %rax
addq 0x38(%rdi), %rax
cmpq $0x120, %r10            # imm = 0x120
je 0x111f4
movq (%rax,%r10,8), %rdx
movq %rdx, (%r8,%r10,8)
incq %r10
jmp 0x111de
movq %rsi, %rax
andq $-0x20, %rax
incq %rsi
addq $0x120, %r9             # imm = 0x120
movq %rsi, %rdx
cmpq %r9, %rdx
jae 0x11225
cmpq 0x10(%rdi), %rdx
jae 0x11225
movq 0x28(%rdi), %r10
movzwl (%r10,%rdx,2), %r10d
decq (%r8,%r10,8)
incq %rdx
jmp 0x11208
leaq (,%rax,8), %rdx
addq 0x40(%rdi), %rdx
xorl %r8d, %r8d
cmpq $0x20, %r8
je 0x11247
movq (%rdx,%r8,8), %r9
movq %r9, (%rcx,%r8,8)
incq %r8
jmp 0x11234
addq $0x20, %rax
cmpq %rax, %rsi
jae 0x11272
cmpq 0x10(%rdi), %rsi
jae 0x11272
movq 0x8(%rdi), %rdx
cmpw $0x0, (%rdx,%rsi,2)
je 0x1126d
movq 0x30(%rdi), %rdx
movzwl (%rdx,%rsi,2), %edx
decq (%rcx,%rdx,8)
incq %rsi
jmp 0x1124b
retq
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/zopfli/src/zopfli/lz77.c
// Function: ZopfliInitBlockState
void ZopfliInitBlockState(const ZopfliOptions* options,
                          size_t blockstart, size_t blockend, int add_lmc,
                          ZopfliBlockState* s) {
  s->options = options;
  s->blockstart = blockstart;
  s->blockend = blockend;
#ifdef ZOPFLI_LONGEST_MATCH_CACHE
  if (add_lmc) {
    s->lmc = (ZopfliLongestMatchCache*)malloc(sizeof(ZopfliLongestMatchCache));
    ZopfliInitCache(blockend - blockstart, s->lmc);
  } else {
    s->lmc = 0;
  }
#endif
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %r8, %rbx
movq %rdi, (%r8)
movq %rsi, 0x10(%r8)
movq %rdx, 0x18(%r8)
testl %ecx, %ecx
je 0x112af
movq %rdx, %r14
movq %rsi, %r15
pushq $0x18
popq %rdi
callq 0x33d0
movq %rax, 0x8(%rbx)
subq %r15, %r14
movq %r14, %rdi
movq %rax, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x11d6c
andq $0x0, 0x8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/zopfli/src/zopfli/lz77.c
// Function: ZopfliCleanBlockState
void ZopfliCleanBlockState(ZopfliBlockState* s) {
#ifdef ZOPFLI_LONGEST_MATCH_CACHE
  if (s->lmc) {
    ZopfliCleanCache(s->lmc);
    free(s->lmc);
  }
#endif
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x112d6
callq 0x11e18
movq 0x8(%rbx), %rdi
popq %rbx
jmp 0x3050
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/zopfli/src/zopfli/cache.c
// Function: ZopfliInitCache
void ZopfliInitCache(size_t blocksize, ZopfliLongestMatchCache* lmc) {
  size_t i;
  lmc->length = (unsigned short*)malloc(sizeof(unsigned short) * blocksize);
  lmc->dist = (unsigned short*)malloc(sizeof(unsigned short) * blocksize);
  /* Rather large amount of memory. */
  lmc->sublen = (unsigned char*)malloc(ZOPFLI_CACHE_LENGTH * 3 * blocksize);
  if(lmc->sublen == NULL) {
    fprintf(stderr,
        "Error: Out of memory. Tried allocating %zu bytes of memory.\n",
        ZOPFLI_CACHE_LENGTH * 3 * blocksize);
    exit (EXIT_FAILURE);
  }

  /* length > 0 and dist 0 is invalid combination, which indicates on purpose
  that this cache value is not filled in yet. */
  for (i = 0; i < blocksize; i++) lmc->length[i] = 1;
  for (i = 0; i < blocksize; i++) lmc->dist[i] = 0;
  for (i = 0; i < ZOPFLI_CACHE_LENGTH * blocksize * 3; i++) lmc->sublen[i] = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
leaq (%rdi,%rdi), %r14
movq %r14, %rdi
callq 0x33d0
movq %rax, %r13
movq %rax, (%rbx)
movq %r14, %rdi
callq 0x33d0
movq %rax, %r12
movq %rax, 0x8(%rbx)
imulq $0x18, %r15, %r14
movq %r14, %rdi
callq 0x33d0
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x11df5
xorl %eax, %eax
cmpq %rax, %r15
je 0x11dc5
movw $0x1, (%r13,%rax,2)
incq %rax
jmp 0x11db3
xorl %eax, %eax
cmpq %rax, %r15
je 0x11dd7
andw $0x0, (%r12,%rax,2)
incq %rax
jmp 0x11dc7
xorl %eax, %eax
cmpq %rax, %r14
je 0x11deb
movq 0x10(%rbx), %rcx
movb $0x0, (%rcx,%rax)
incq %rax
jmp 0x11dd9
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0xa1f4(%rip), %rax      # 0x1bff0
movq (%rax), %rdi
leaq 0x49db(%rip), %rsi      # 0x167e1
movq %r14, %rdx
xorl %eax, %eax
callq 0x3340
pushq $0x1
popq %rdi
callq 0x3540
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/zopfli/src/zopfli/hash.c
// Function: ZopfliResetHash
void ZopfliResetHash(size_t window_size, ZopfliHash* h) {
  size_t i;

  h->val = 0;
  for (i = 0; i < 65536; i++) {
    h->head[i] = -1;  /* -1 indicates no head so far. */
  }
  for (i = 0; i < window_size; i++) {
    h->prev[i] = i;  /* If prev[j] == j, then prev[j] is uninitialized. */
    h->hashval[i] = -1;
  }

#ifdef ZOPFLI_HASH_SAME
  for (i = 0; i < window_size; i++) {
    h->same[i] = 0;
  }
#endif

#ifdef ZOPFLI_HASH_SAME_HASH
  h->val2 = 0;
  for (i = 0; i < 65536; i++) {
    h->head2[i] = -1;
  }
  for (i = 0; i < window_size; i++) {
    h->prev2[i] = i;
    h->hashval2[i] = -1;
  }
#endif
}

// Assembly:
andl $0x0, 0x18(%rsi)
movq (%rsi), %rax
xorl %ecx, %ecx
cmpq $0x10000, %rcx          # imm = 0x10000
je 0x12033
orl $-0x1, (%rax,%rcx,4)
incq %rcx
jmp 0x12021
xorl %eax, %eax
cmpq %rax, %rdi
je 0x1204f
movq 0x8(%rsi), %rcx
movw %ax, (%rcx,%rax,2)
movq 0x10(%rsi), %rcx
orl $-0x1, (%rcx,%rax,4)
incq %rax
jmp 0x12035
xorl %eax, %eax
cmpq %rax, %rdi
je 0x12064
movq 0x40(%rsi), %rcx
andw $0x0, (%rcx,%rax,2)
incq %rax
jmp 0x12051
andl $0x0, 0x38(%rsi)
movq 0x20(%rsi), %rax
xorl %ecx, %ecx
cmpq $0x10000, %rcx          # imm = 0x10000
je 0x12080
orl $-0x1, (%rax,%rcx,4)
incq %rcx
jmp 0x1206e
xorl %eax, %eax
cmpq %rax, %rdi
je 0x1209c
movq 0x28(%rsi), %rcx
movw %ax, (%rcx,%rax,2)
movq 0x30(%rsi), %rcx
orl $-0x1, (%rcx,%rax,4)
incq %rax
jmp 0x12082
retq
// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/zopfli/src/zopfli/squeeze.c
// Function: GetCostStat
static double GetCostStat(unsigned litlen, unsigned dist, void* context) {
  SymbolStats* stats = (SymbolStats*)context;
  if (dist == 0) {
    return stats->ll_symbols[litlen];
  } else {
    int lsym = ZopfliGetLengthSymbol(litlen);
    int lbits = ZopfliGetLengthExtraBits(litlen);
    int dsym = ZopfliGetDistSymbol(dist);
    int dbits = ZopfliGetDistExtraBits(dist);
    return lbits + dbits + stats->ll_symbols[lsym] + stats->d_symbols[dsym];
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movl %edi, %r14d
testl %esi, %esi
je 0x13147
movl %esi, %ebp
movl %r14d, %edi
callq 0x137a5
movl %eax, %r15d
movl %r14d, %edi
callq 0x13789
movl %eax, %r14d
movl %ebp, %edi
callq 0x13764
movl %eax, %r12d
movl %ebp, %edi
callq 0x13728
addl %r14d, %eax
cvtsi2sd %eax, %xmm0
movslq %r15d, %rax
addsd 0xa00(%rbx,%rax,8), %xmm0
movslq %r12d, %rax
addsd 0x1300(%rbx,%rax,8), %xmm0
jmp 0x13153
movl %r14d, %eax
movsd 0xa00(%rbx,%rax,8), %xmm0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq