LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/qq-smart[P]qq_sh_server/core/qq_queue.c
// Function: qq_queue_sort
void
qq_queue_sort(qq_queue_t *queue,
    qq_int_t (*cmp)(const qq_queue_t *, const qq_queue_t *))
{
    qq_queue_t  *q, *prev, *next;

    q = qq_queue_head(queue);
    if (q == qq_queue_last(queue)) {
        return;
    }

    for (q = qq_queue_next(q); q != qq_queue_sentinel(queue); q = next) {
        prev = qq_queue_prev(q);
        next = qq_queue_next(q);

        qq_queue_remove(q);

        do {
            if (cmp(prev, q) <= 0) {
                break;
            }

            prev = qq_queue_prev(prev);

        } while (prev != qq_queue_sentinel(queue));

        qq_queue_insert_after(prev, q);
    }
}

// Assembly:
movq 0x8(%rdi), %rax
cmpq (%rdi), %rax
je 0x7f4a
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x8(%rax), %r13
cmpq %rdi, %r13
je 0x7f3c
movq %rsi, %rbx
movq %r13, %r15
movq (%r13), %r12
movq 0x8(%r13), %r13
movq %r12, (%r13)
movq %r13, 0x8(%r12)
movq %r12, %rdi
movq %r15, %rsi
callq *%rbx
testq %rax, %rax
jle 0x7f23
movq (%r12), %r12
cmpq %r14, %r12
jne 0x7f0d
movq 0x8(%r12), %rax
movq %rax, 0x8(%r15)
movq %r15, (%rax)
movq %r12, (%r15)
movq %r15, 0x8(%r12)
cmpq %r14, %r13
jne 0x7ef9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/qq-smart[P]qq_sh_server/core/qq_string.c
// Function: qq_cpystrn
u_char *
qq_cpystrn(u_char *dst, u_char *src, size_t n)
{
    if (n == 0) {
        return dst;
    }

    while (--n) {
        *dst = *src;

        if (*dst == '\0') {
            return dst;
        }

        dst++;
        src++;
    }

    *dst = '\0';

    return dst;
}

// Assembly:
movq %rdi, %rax
testq %rdx, %rdx
je 0x85f5
decq %rdx
je 0x85e9
xorl %ecx, %ecx
movb (%rsi,%rcx), %dil
movb %dil, (%rax,%rcx)
testb %dil, %dil
je 0x85f2
incq %rcx
cmpq %rcx, %rdx
jne 0x85d1
addq %rcx, %rax
pushq %rbp
movq %rsp, %rbp
movb $0x0, (%rax)
popq %rbp
retq
addq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O3/qq-smart[P]qq_sh_server/core/qq_string.c
// Function: qq_hex_dump
u_char *
qq_hex_dump(u_char *dst, u_char *src, size_t len)
{
    static u_char  hex[] = "0123456789abcdef";

    while (len--) {
        *dst++ = hex[*src >> 4];
        *dst++ = hex[*src++ & 0xf];
    }

    return dst;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rax
testq %rdx, %rdx
je 0x8640
xorl %ecx, %ecx
leaq 0x2a15(%rip), %rdi      # 0xb020
xorl %r8d, %r8d
movzbl (%rsi,%r8), %r9d
shrl $0x4, %r9d
movb (%r9,%rdi), %r9b
movb %r9b, (%rax,%r8,2)
movzbl (%rsi,%r8), %r9d
andl $0xf, %r9d
movb (%r9,%rdi), %r9b
movb %r9b, 0x1(%rax,%r8,2)
incq %r8
addq $-0x2, %rcx
cmpq %r8, %rdx
jne 0x860e
subq %rcx, %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/qq-smart[P]qq_sh_server/core/qq_string.c
// Function: qq_str_to_hex
qq_int_t
qq_str_to_hex(u_char *str, u_char *hex, size_t strlen)
{
    if (strlen % 2) {
        return QQ_ERROR;
    }

    while (strlen) {
        if (*str >= 48 && *str <= 57) {
            *hex = *str - 48;
        } else if (*str >= 65 && *str <= 70) {
            *hex = *str - 55;
        } else if (*str >= 97 && *str <= 102) {
            *hex = *str - 87;
        } else {
            return QQ_ERROR;
        }

        str ++;
        *hex = *hex << 4;

        if (*str >= 48 && *str <= 57) {
            *hex += *str - 48;
        } else if (*str >= 65 && *str <= 70) {
            *hex += *str - 55;
        } else if (*str >= 97 && *str <= 102) {
            *hex += *str - 87;
        } else {
            return QQ_ERROR;
        }

        str ++;
        hex ++;

        strlen -= 2;
    }

    return QQ_OK;
}

// Assembly:
movq $-0x1, %rax
testb $0x1, %dl
jne 0x86e7
testq %rdx, %rdx
je 0x86e5
pushq %rbp
movq %rsp, %rbp
xorl %ecx, %ecx
movb (%rdi,%rcx), %r9b
leal -0x30(%r9), %r8d
cmpb $0xa, %r8b
jb 0x8690
leal -0x41(%r9), %r8d
cmpb $0x5, %r8b
ja 0x867f
addb $-0x37, %r9b
jmp 0x868d
leal -0x61(%r9), %r8d
cmpb $0x5, %r8b
ja 0x86e3
addb $-0x57, %r9b
movl %r9d, %r8d
shlb $0x4, %r8b
movb %r8b, (%rsi)
movb 0x1(%rdi,%rcx), %r9b
leal -0x30(%r9), %r10d
cmpb $0x9, %r10b
ja 0x86ab
orb %r8b, %r10b
jmp 0x86d2
leal -0x41(%r9), %r10d
cmpb $0x5, %r10b
ja 0x86be
addb %r8b, %r9b
addb $-0x37, %r9b
jmp 0x86cf
leal -0x61(%r9), %r10d
cmpb $0x5, %r10b
ja 0x86e3
addb %r8b, %r9b
addb $-0x57, %r9b
movl %r9d, %r10d
movb %r10b, (%rsi)
incq %rsi
addq $0x2, %rcx
cmpq %rcx, %rdx
jne 0x8661
xorl %eax, %eax
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/qq-smart[P]qq_sh_server/core/qq_string.c
// Function: qq_str_rbtree_insert_value
void
qq_str_rbtree_insert_value(qq_rbtree_node_t *temp,
    qq_rbtree_node_t *node, qq_rbtree_node_t *sentinel)
{
    qq_str_rbtree_node_t   *n, *t;
    qq_rbtree_node_t      **p;

    for ( ;; ) {
        n = (qq_str_rbtree_node_t *) node;
        t = (qq_str_rbtree_node_t *) temp;

        if (node->key != temp->key) {
            p = (node->key < temp->key) ? &temp->left : &temp->right;
        } else if (n->str.len != t->str.len) {
            p = (n->str.len < t->str.len) ? &temp->left : &temp->right;
        } else {
            p = (memcmp(n->str.data, t->str.data, n->str.len) < 0)
                 ? &temp->left : &temp->right;
        }

        if (*p == sentinel) {
            break;
        }

        temp = *p;
    }

    *p = node;
    node->parent = temp;
    node->left = sentinel;
    node->right = sentinel;
    qq_rbt_red(node);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
movq (%rsi), %r12
movq %rdi, %r15
cmpq (%rdi), %r12
jne 0x8720
movq 0x28(%rbx), %rdx
cmpq 0x28(%r15), %rdx
jne 0x8720
movq 0x30(%rbx), %rdi
movq 0x30(%r15), %rsi
callq 0x20e0
shrl $0x1f, %eax
jmp 0x8723
setb %al
xorb $0x1, %al
movzbl %al, %eax
movq 0x8(%r15,%rax,8), %rdi
cmpq %r14, %rdi
jne 0x86fc
leaq 0x8(,%rax,8), %rax
movq %rbx, (%r15,%rax)
movq %r15, 0x18(%rbx)
movq %r14, 0x8(%rbx)
movq %r14, 0x10(%rbx)
movb $0x1, 0x20(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/qq-smart[P]qq_sh_server/core/qq_string.c
// Function: qq_str_rbtree_lookup
qq_str_rbtree_node_t *
qq_str_rbtree_lookup(qq_rbtree_t *rbtree, qq_str_t *val, uint32_t hash)
{
    qq_int_t               rc;
    qq_str_rbtree_node_t  *n;
    qq_rbtree_node_t      *node, *sentinel;

    node = rbtree->root;
    sentinel = rbtree->sentinel;

    while (node != sentinel) {
        n = (qq_str_rbtree_node_t *) node;

        if (hash != node->key) {
            node = (hash < node->key) ? node->left : node->right;
            continue;
        }

        if (val->len != n->str.len) {
            node = (val->len < n->str.len) ? node->left : node->right;
            continue;
        }

        rc = memcmp(val->data, n->str.data, val->len);
        if (rc < 0) {
            node = node->left;
            continue;
        }

        if (rc > 0) {
            node = node->right;
            continue;
        }

        return n;
    }

    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq (%rdi), %rbx
movq 0x8(%rdi), %r15
cmpq %r15, %rbx
je 0x87bd
movq %rsi, %r14
movl %edx, %r12d
cmpq %r12, (%rbx)
jne 0x87a1
movq (%r14), %rdx
cmpq 0x28(%rbx), %rdx
jne 0x87a6
movq 0x8(%r14), %rdi
movq 0x30(%rbx), %rsi
callq 0x20e0
movl $0x8, %ecx
testl %eax, %eax
js 0x87b4
movl $0x10, %ecx
jne 0x87b4
jmp 0x87bf
setbe %al
jmp 0x87a9
setae %al
movzbl %al, %eax
leaq 0x8(,%rax,8), %rcx
movq (%rbx,%rcx), %rbx
cmpq %r15, %rbx
jne 0x8774
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/qq-smart[P]qq_sh_server/os/qq_tcp_recv.c
// Function: qq_tcp_recv
ssize_t
qq_tcp_recv(qq_connection_t *c, u_char *buf, size_t size)
{
    ssize_t       n;
    qq_err_t      err;
    qq_event_t   *rev;

    rev = c->read;

#if (QQ_HAVE_EPOLLRDHUP)
    qq_log_debug("recv: eof:%d, avail:%d", rev->pending_eof, rev->available);
    if (!rev->available && !rev->pending_eof) {
        rev->ready = 0;
        return QQ_AGAIN;
    }
#endif

    do {
        n = recv(c->fd, buf, size, 0);
        qq_log_debug("recv: fd:%d n:%d of size:%d", c->fd, n, size);

        if (n == 0) {
            rev->ready = 0;
            rev->eof = 1;
            return 0;
        }

        if (n > 0) {
#if (QQ_HAVE_EPOLLRDHUP)
            if ((size_t) n < size) {
                if (!rev->pending_eof) {
                    rev->ready = 0;
                }
                rev->available = 0;
            }
            return n;
#endif

            if ((size_t) n < size) {
                rev->ready = 0;
            }
            return n;
        }

        err = errno;
        if (err == QQ_EAGAIN || err == QQ_EINTR) {
            qq_log_debug("recv() not ready");
            n = QQ_AGAIN;
        } else {
            qq_log_debug("recv() failed");
            n = QQ_ERROR;
            break;
        }
    } while (err == QQ_EINTR);

    rev->ready = 0;
    rev->error = 1;

    return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x8(%rdi), %r13
movl 0x8(%r13), %edx
movl %edx, %esi
shrl $0xe, %esi
andl $0x1, %esi
shrl $0x14, %edx
andl $0x1, %edx
leaq 0x2831(%rip), %rdi      # 0xb031
xorl %eax, %eax
callq 0x6c74
movl 0x8(%r13), %eax
testl $0x104000, %eax         # imm = 0x104000
je 0x887d
movq %r13, -0x30(%rbp)
leaq 0x282b(%rip), %r13      # 0xb048
movl 0x18(%r15), %edi
movq %r14, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x20b0
movq %rax, %r12
movl 0x18(%r15), %esi
movq %r13, %rdi
movq %rax, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x6c74
testq %r12, %r12
je 0x888b
jg 0x88a2
callq 0x2030
movl (%rax), %r12d
cmpl $0xb, %r12d
je 0x8860
cmpl $0x4, %r12d
jne 0x88c4
leaq 0x27fd(%rip), %rdi      # 0xb064
xorl %eax, %eax
callq 0x6c74
cmpl $0x4, %r12d
je 0x881d
movq $-0x2, %r12
jmp 0x88d9
andl $0xffefbfdf, %eax       # imm = 0xFFEFBFDF
movq $-0x2, %r12
jmp 0x88eb
movl $0xfffffedf, %eax       # imm = 0xFFFFFEDF
movq -0x30(%rbp), %r13
andl 0x8(%r13), %eax
orl $0x100, %eax            # imm = 0x100
xorl %r12d, %r12d
jmp 0x88eb
cmpq %rbx, %r12
jae 0x88ef
movq -0x30(%rbp), %r13
movl 0x8(%r13), %ecx
movl %ecx, %eax
andl $0xffefbfdf, %eax       # imm = 0xFFEFBFDF
btl $0xe, %ecx
cmovbl %ecx, %eax
andl $0xffefffff, %eax       # imm = 0xFFEFFFFF
jmp 0x88eb
leaq 0x27aa(%rip), %rdi      # 0xb075
xorl %eax, %eax
callq 0x6c74
movq $-0x1, %r12
movl $0xfffffddf, %eax       # imm = 0xFFFFFDDF
movq -0x30(%rbp), %r13
andl 0x8(%r13), %eax
orl $0x200, %eax            # imm = 0x200
movl %eax, 0x8(%r13)
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/qq-smart[P]qq_sh_server/os/qq_tcp_send.c
// Function: qq_tcp_send
ssize_t
qq_tcp_send(qq_connection_t *c, u_char *buf, size_t size)
{
    ssize_t       n;
    qq_err_t      err;
    qq_event_t   *wev;

    wev = c->write;

    for ( ;; ) {
        n = send(c->fd, buf, size, 0);

        qq_log_debug("send: fd:%d n:%d of size:%d", c->fd, n, size);

        if (n > 0) {
            if (n < (ssize_t) size) {
                wev->ready = 0;
            }
            return n;
        }

        err = errno;
        if (n == 0) {
            qq_log_error(err, "send() returned zero");
            wev->ready = 0;
            return n;
        }

        if (err == QQ_EAGAIN || err == QQ_EINTR) {
            wev->ready = 0;

            qq_log_debug("send() not ready");

            if (err == QQ_EAGAIN) {
                return QQ_AGAIN;
            }
        } else {
            wev->error = 1;
            return QQ_ERROR;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq 0x10(%rdi), %rax
movq %rax, -0x30(%rbp)
movl 0x18(%r12), %edi
movq %r15, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x2130
movq %rax, %rbx
movl 0x18(%r12), %esi
leaq 0x273f(%rip), %rdi      # 0xb083
movq %rax, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x6c74
testq %rbx, %rbx
jg 0x8994
callq 0x2030
movl (%rax), %r13d
testq %rbx, %rbx
je 0x899b
cmpl $0xb, %r13d
je 0x896f
cmpl $0x4, %r13d
jne 0x89ba
movq -0x30(%rbp), %rax
andb $-0x21, 0x8(%rax)
leaq 0x2736(%rip), %rdi      # 0xb0b4
xorl %eax, %eax
callq 0x6c74
cmpl $0xb, %r13d
jne 0x8923
movq $-0x2, %rbx
jmp 0x89d0
cmpq %r14, %rbx
jl 0x89ae
jmp 0x89d0
leaq 0x26fd(%rip), %rsi      # 0xb09f
xorl %ebx, %ebx
movl %r13d, %edi
xorl %eax, %eax
callq 0x6b27
movq -0x30(%rbp), %rcx
movl 0x8(%rcx), %eax
andl $-0x21, %eax
jmp 0x89cd
movl $0x200, %eax            # imm = 0x200
movq -0x30(%rbp), %rcx
orl 0x8(%rcx), %eax
movq $-0x1, %rbx
movl %eax, 0x8(%rcx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/qq-smart[P]qq_sh_server/core/qq_time.c
// Function: qq_time_update
void
qq_time_update(void)
{
    u_char          *p;
    struct tm        t;
    time_t           sec;
    qq_uint_t        msec;
    struct timeval   tv;

    gettimeofday(&tv, NULL);

    sec = tv.tv_sec;
    msec = tv.tv_usec / 1000;

    qq_current_msec = (qq_msec_t) sec * 1000 + msec;
#if (QQ_HAVE_TIMESTAMP_JSON_PKG)
    sprintf(qq_timestamp_json_pkg, "{\"timestamp\":%lu}", qq_current_msec);
    qq_timestamp_json_pkg_size = strlen(qq_timestamp_json_pkg) + 1;
#endif


    qq_localtime(sec, &t);

    p = cached_err_log_time;
    (void) sprintf(p, "%4d/%02d/%02d_%02d:%02d:%02d",
                   t.tm_year, t.tm_mon,
                   t.tm_mday, t.tm_hour,
                   t.tm_min,  t.tm_sec);

    qq_cached_err_log_time.data = p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
leaq -0x28(%rbp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x22c0
movq (%rbx), %r14
movabsq $0x20c49ba5e353f7cf, %rax # imm = 0x20C49BA5E353F7CF
imulq 0x8(%rbx)
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x7, %rdx
addq %rax, %rdx
imulq $0x3e8, %r14, %rax      # imm = 0x3E8
addq %rdx, %rax
movq %rax, 0x6c7e(%rip)      # 0xf6c0
movq 0x6c77(%rip), %rdx      # 0xf6c0
leaq 0x6b60(%rip), %rbx      # 0xf5b0
leaq 0x266e(%rip), %rsi      # 0xb0c5
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2070
movq %rbx, %rdi
callq 0x20d0
incq %rax
movq %rax, 0x6c55(%rip)      # 0xf6c8
leaq -0x18(%rbp), %rdi
movq %r14, (%rdi)
callq 0x21b0
movl (%rax), %r10d
movl 0x4(%rax), %r11d
movl 0x8(%rax), %r9d
movl 0xc(%rax), %r8d
movl 0x10(%rax), %ecx
incl %ecx
movl $0x76c, %edx            # imm = 0x76C
addl 0x14(%rax), %edx
leaq 0x6c2e(%rip), %rbx      # 0xf6d0
leaq 0x262e(%rip), %rsi      # 0xb0d7
movq %rbx, %rdi
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0x2070
addq $0x10, %rsp
movq %rbx, 0x6bf6(%rip)      # 0xf6b8
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/qq-smart[P]qq_sh_server/os/qq_udp_recv.c
// Function: qq_udp_recv
ssize_t
qq_udp_recv(qq_connection_t *c, u_char *buf, size_t size)
{
    ssize_t       n;
    qq_err_t      err;
    qq_event_t   *rev;

    rev = c->read;

    do {
        n = recv(c->fd, buf, size, 0);

        qq_log_debug("recv: fd:%d %d of %d", c->fd, n, size);

        if (n >= 0) {
            return n;
        }

        err = errno;

        if (err == QQ_EAGAIN || err == QQ_EINTR) {
            qq_log_debug("recv() not ready");
            n = QQ_AGAIN;
        } else {
            n = QQ_ERROR;
            break;
        }
    } while (err == QQ_EINTR);

    rev->ready = 0;

    if (n == QQ_ERROR) {
        rev->error = 1;
    }
	
    return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x8(%rdi), %rax
movq %rax, -0x30(%rbp)
movl 0x18(%r15), %edi
movq %r14, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x20b0
movq %rax, %r13
movl 0x18(%r15), %esi
leaq 0x25a2(%rip), %rdi      # 0xb0f4
movq %rax, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x6c74
testq %r13, %r13
jns 0x8bbc
callq 0x2030
movl (%rax), %r12d
cmpl $0xb, %r12d
je 0x8b78
cmpl $0x4, %r12d
jne 0x8b95
leaq 0x24e5(%rip), %rdi      # 0xb064
xorl %eax, %eax
callq 0x6c74
cmpl $0x4, %r12d
je 0x8b33
movq $-0x2, %r13
jmp 0x8b9c
movq $-0x1, %r13
movq -0x30(%rbp), %rdx
movl 0x8(%rdx), %eax
movl %eax, %ecx
andl $-0x21, %ecx
andl $0xfffffddf, %eax       # imm = 0xFFFFFDDF
orl $0x200, %eax            # imm = 0x200
cmpl $0xb, %r12d
cmovel %ecx, %eax
movl %eax, 0x8(%rdx)
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/qq-smart[P]qq_sh_server/os/qq_udp_send.c
// Function: qq_udp_send
ssize_t
qq_udp_send(qq_connection_t *c, u_char *buf, size_t size)
{
    ssize_t       n;
    qq_err_t      err;
    qq_event_t   *wev;

    wev = c->write;

    for ( ;; ) {
        n = sendto(c->fd, buf, size, 0, c->sockaddr, c->socklen);

        qq_log_debug("sendto: fd:%d %d of %d to \"%s\"",
                     c->fd, n, size, c->addr_text);

        if (n >= 0) {
            if ((size_t) n != size) {
                wev->error = 1;
                return QQ_ERROR;
            }
            return n;
        }

        err = errno;

        if (err == QQ_EAGAIN) {
            wev->ready = 0;
            qq_log_debug("sendto() not ready");
            return QQ_AGAIN;
        }

        if (err != QQ_EINTR) {
            wev->error = 1;
            return QQ_ERROR;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x10(%rdi), %rax
movq %rax, -0x30(%rbp)
leaq 0x2513(%rip), %r12      # 0xb109
movl 0x18(%r15), %edi
movq 0x50(%r15), %r8
movl 0x58(%r15), %r9d
movq %r14, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x2040
movq %rax, %r13
movl 0x18(%r15), %esi
movq 0x60(%r15), %r8
movq %r12, %rdi
movq %rax, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x6c74
testq %r13, %r13
jns 0x8c5f
callq 0x2030
movl (%rax), %eax
cmpl $0x4, %eax
je 0x8bf6
cmpl $0xb, %eax
jne 0x8c64
movq -0x30(%rbp), %rax
andb $-0x21, 0x8(%rax)
leaq 0x24d9(%rip), %rdi      # 0xb128
xorl %eax, %eax
callq 0x6c74
movq $-0x2, %rbx
jmp 0x8c73
cmpq %rbx, %r13
je 0x8c73
movq -0x30(%rbp), %rax
orb $0x2, 0x9(%rax)
movq $-0x1, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/qq-smart[P]qq_sh_server/app/qq_video_audio_device.c
// Function: qq_video_audio_device_init
qq_int_t
qq_video_audio_device_init(qq_cycle_t *cycle)
{
    if (qq_add_listening_config(SOCK_DGRAM,
        QQ_VIDEO_AUDIO_DEVICE_UDP_LISTENING_PORT,
        QQ_VIDEO_AUDIO_DEVICE_UDP_LISTENING_POOL_SIZE,
        qq_video_audio_device_process_request_handler) == QQ_ERROR)
    {
        qq_log_error(0, "qq_video_audio_device_init()->qq_add_listening_config() failed");
        return QQ_ERROR;
    }

    return QQ_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x37(%rip), %rcx        # 0x8cca
movl $0x200, %edx            # imm = 0x200
movl $0x2, %edi
movl $0x32c8, %esi           # imm = 0x32C8
callq 0x6464
cmpq $-0x1, %rax
je 0x8cb1
xorl %eax, %eax
jmp 0x8cc8
leaq 0x2483(%rip), %rsi      # 0xb13b
xorl %edi, %edi
xorl %eax, %eax
callq 0x6b27
movq $-0x1, %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/qq-smart[P]qq_sh_server/app/qq_wifi_device.c
// Function: qq_wifi_device_init
qq_int_t
qq_wifi_device_init(qq_cycle_t *cycle)
{
    if (qq_add_listening_config(SOCK_STREAM,
        QQ_WIFI_DEVICE_TCP_LISTENING_PORT,
        QQ_WIFI_DEVICE_TCP_LISTENING_POOL_SIZE,
        qq_wifi_device_init_connection_handler) == QQ_ERROR)
    {
        qq_log_error(0, "qq_wifi_device_init()->qq_add_listening_config() failed");
        return QQ_ERROR;
    }

    qq_rbtree_init(&qq_wifi_device_rbtree, &qq_wifi_device_sentinel,
                    qq_wifi_device_rbtree_insert_value);

    qq_wifi_device_md5_id_str_pos = strlen(QQ_WIFI_DEVICE_MD5_CORE_STR);
    memcpy(qq_wifi_device_md5_str, QQ_WIFI_DEVICE_MD5_CORE_STR, strlen(QQ_WIFI_DEVICE_MD5_CORE_STR));

    return QQ_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x87(%rip), %rcx        # 0x8dae
movl $0x200, %edx            # imm = 0x200
movl $0x1, %edi
movl $0x2ee0, %esi           # imm = 0x2EE0
callq 0x6464
cmpq $-0x1, %rax
je 0x8d95
movb $0x0, 0x69c8(%rip)      # 0xf710
leaq 0x69a1(%rip), %rax      # 0xf6f0
movq %rax, 0x69c2(%rip)      # 0xf718
movq %rax, 0x69c3(%rip)      # 0xf720
leaq 0xe3(%rip), %rax        # 0x8e47
movq %rax, 0x69bd(%rip)      # 0xf728
movb $0x1, 0x69be(%rip)      # 0xf730
movups 0x24a7(%rip), %xmm0     # 0xb220
movaps %xmm0, 0x69c0(%rip)     # 0xf740
movabsq $0x65696b766d353833, %rax # imm = 0x65696B766D353833
movq %rax, 0x69bc(%rip)      # 0xf74d
xorl %eax, %eax
jmp 0x8dac
leaq 0x244c(%rip), %rsi      # 0xb1e8
xorl %edi, %edi
xorl %eax, %eax
callq 0x6b27
movq $-0x1, %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/qq-smart[P]qq_sh_server/app/qq_wifi_device.c
// Function: qq_wifi_device_init_connection_handler
static void
qq_wifi_device_init_connection_handler(qq_connection_t *c)
{
    qq_event_t   *rev, *wev;

    qq_log_debug("qq_wifi_device_init_connection_handler()");

    rev = c->read;
    rev->handler = qq_wifi_device_pretreatment_process_handler;

    wev = c->write;
    wev->handler = qq_wifi_device_write_event_handler;

    qq_event_add_timer(rev, QQ_WIFI_DEVICE_CONNECTION_TIMEOUT);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x248d(%rip), %rdi      # 0xb24c
xorl %eax, %eax
callq 0x6c74
movq 0x8(%rbx), %r14
leaq 0x119(%rip), %rax       # 0x8eea
movq %rax, 0x10(%r14)
movq 0x10(%rbx), %rax
leaq 0x296(%rip), %rcx       # 0x9076
movq %rcx, 0x10(%rax)
leaq 0x68d5(%rip), %rax      # 0xf6c0
movl $0xbb8, %ebx            # imm = 0xBB8
addq (%rax), %rbx
testb $0x8, 0x9(%r14)
je 0x8e29
movq %rbx, %rax
subq 0x20(%r14), %rax
movq %rax, %rcx
negq %rcx
cmovsq %rax, %rcx
cmpq $0x12c, %rcx            # imm = 0x12C
jb 0x8e42
leaq 0x20(%r14), %rsi
leaq 0x64f1(%rip), %rdi      # 0xf310
callq 0x81c4
andb $-0x9, 0x9(%r14)
leaq 0x20(%r14), %rsi
movq %rbx, 0x20(%r14)
leaq 0x64d8(%rip), %rdi      # 0xf310
callq 0x7f4c
orb $0x8, 0x9(%r14)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/qq-smart[P]qq_sh_server/app/qq_wifi_device.c
// Function: qq_wifi_device_rbtree_insert_value
static void
qq_wifi_device_rbtree_insert_value(qq_rbtree_node_t *temp,
    qq_rbtree_node_t *node, qq_rbtree_node_t *sentinel)
{
    qq_wifi_device_rbtree_node_t   *n, *t;
    qq_rbtree_node_t               **p;

    for ( ;; ) {
        n = (qq_wifi_device_rbtree_node_t *) node;
        t = (qq_wifi_device_rbtree_node_t *) temp;

        if (node->key != temp->key) {
            p = (node->key < temp->key) ? &temp->left : &temp->right;
        } else {
            p = (memcmp(n->id, t->id, 16) < 0)
                 ? &temp->left : &temp->right;
        }

        if (*p == sentinel) {
            break;
        }

        temp = *p;
    }

    *p = node;
    node->parent = temp;
    node->left = sentinel;
    node->right = sentinel;
    qq_rbt_red(node);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rsi), %rax
movq %rdi, %rcx
cmpq (%rdi), %rax
jne 0x8e95
movq 0x28(%rsi), %rdi
bswapq %rdi
movq 0x28(%rcx), %r9
bswapq %r9
cmpq %r9, %rdi
jne 0x8e7f
movq 0x30(%rsi), %rdi
movq 0x30(%rcx), %r9
bswapq %rdi
bswapq %r9
xorl %r8d, %r8d
cmpq %r9, %rdi
je 0x8e8f
cmpq %r9, %rdi
movl $0x0, %r8d
sbbl %r8d, %r8d
orl $0x1, %r8d
shrl $0x1f, %r8d
jmp 0x8e99
setb %r8b
xorb $0x1, %r8b
movzbl %r8b, %r8d
movq 0x8(%rcx,%r8,8), %rdi
cmpq %rdx, %rdi
jne 0x8e4e
leaq 0x8(,%r8,8), %rax
movq %rsi, (%rcx,%rax)
movq %rcx, 0x18(%rsi)
movq %rdx, 0x8(%rsi)
movq %rdx, 0x10(%rsi)
movb $0x1, 0x20(%rsi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/qq-smart[P]qq_sh_server/event/qq_event_timer.h
// Function: qq_event_add_timer
static inline void
qq_event_add_timer(qq_event_t *ev, qq_msec_t timer)
{
    qq_msec_t      key;
    qq_msec_int_t  diff;

    key = qq_current_msec + timer;

    if (ev->timer_set) {
        diff = (qq_msec_int_t) (key - ev->timer.key);
        if (qq_abs(diff) < QQ_TIMER_LAZY_DELAY) {
            return;
        }

        qq_event_del_timer(ev);
    }

    ev->timer.key = key;
    qq_rbtree_insert(&qq_event_timer_rbtree, &ev->timer);
    ev->timer_set = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x6630(%rip), %rax      # 0xf6c0
addq (%rax), %r14
testb $0x8, 0x9(%rdi)
je 0x90c7
movq %r14, %rax
subq 0x20(%rbx), %rax
movq %rax, %rcx
negq %rcx
cmovsq %rax, %rcx
cmpq $0x12c, %rcx            # imm = 0x12C
jb 0x90df
leaq 0x20(%rbx), %rsi
leaq 0x6252(%rip), %rdi      # 0xf310
callq 0x81c4
andb $-0x9, 0x9(%rbx)
leaq 0x20(%rbx), %rsi
movq %r14, 0x20(%rbx)
leaq 0x623a(%rip), %rdi      # 0xf310
callq 0x7f4c
orb $0x8, 0x9(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/qq-smart[P]qq_sh_server/app/qq_wifi_device.c
// Function: qq_wifi_device_close
static void
qq_wifi_device_close(qq_connection_t *c, qq_int_t reason)
{
    switch (reason) {
        case QQ_WIFI_DEVICE_PKG_FAILED:
            c->send(c, QQ_JSON_PKG_PKG_FAILED_STR, QQ_JSON_PKG_PKG_FAILED_STR_SIZE);
            return;
        case QQ_WIFI_DEVICE_MD5_FAILED:
            c->send(c, QQ_JSON_PKG_MD5_FAILED_STR, QQ_JSON_PKG_MD5_FAILED_STR_SIZE);
            break;
        case QQ_WIFI_DEVICE_NOTHINGNESS:
            c->send(c, QQ_JSON_PKG_DEVICE_NOTHINGNESS_STR, QQ_JSON_PKG_DEVICE_NOTHINGNESS_STR_SIZE);
            break;
        case QQ_WIFI_DEVICE_NO_APP:
            c->send(c, QQ_JSON_PKG_NO_APP, QQ_JSON_PKG_NO_APP_SIZE);
            break;
        case QQ_WIFI_DEVICE_APP_OVERRANGING:
            c->send(c, QQ_JSON_PKG_APP_OVERRANGING, QQ_JSON_PKG_APP_OVERRANGING_SIZE);
            break;
        case QQ_WIFI_DEVICE_MAIN_APP_ERROR:
            c->send(c, QQ_JSON_PKG_MAIN_APP_ERROR, QQ_JSON_PKG_MAIN_APP_ERROR_SIZE);
            break;
        case QQ_WIFI_DEVICE_CONFLICT:
            c->send(c, QQ_JSON_PKG_DEVICE_CONFLICT_STR, QQ_JSON_PKG_DEVICE_CONFLICT_STR_SIZE);
            break;
        case QQ_WIFI_DEVICE_INSUFFICIENT_MEMORY:
            c->send(c, QQ_JSON_PKG_INSUFFICIENT_MEMORY, QQ_JSON_PKG_INSUFFICIENT_MEMORY_SIZE);
            break;
        case QQ_WIFI_DEVICE_CONNECTION_CLOSE:
            break;
        case QQ_WIFI_DEVICE_CONNECTION_ERROR:
            break;
        case QQ_WIFI_DEVICE_DISCONNECTION:
            break; 
    }

    qq_app_close_connection(c);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
decq %rsi
cmpq $0x7, %rsi
ja 0x950f
leaq 0x1d3e(%rip), %rax      # 0xb1c8
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x30(%rbx), %rax
leaq 0x1ed0(%rip), %rsi      # 0xb36e
movl $0x24, %edx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmpq *%rax
leaq 0x1f41(%rip), %rsi      # 0xb3f6
jmp 0x9504
leaq 0x1ef4(%rip), %rsi      # 0xb3b2
movl $0x28, %edx
jmp 0x9509
leaq 0x1f0e(%rip), %rsi      # 0xb3da
movl $0x1c, %edx
jmp 0x9509
leaq 0x1f8a(%rip), %rsi      # 0xb464
movl $0x29, %edx
jmp 0x9509
leaq 0x1eaa(%rip), %rsi      # 0xb392
movl $0x20, %edx
jmp 0x9509
leaq 0x1f25(%rip), %rsi      # 0xb41b
movl $0x24, %edx
jmp 0x9509
leaq 0x1f3b(%rip), %rsi      # 0xb43f
movl $0x25, %edx
movq %rbx, %rdi
callq *0x30(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x26a2
// File: /workspace/github_c_makefile_star2_O3/qq-smart[P]qq_sh_server/app/qq_wifi_device.c
// Function: qq_wifi_device_md5_confirm
static qq_int_t
qq_wifi_device_md5_confirm(char *id, u_char *pwd)
{
    MD5_CTX   md5;
    u_char    md5_pwd[16];

    memcpy(&qq_wifi_device_md5_str[qq_wifi_device_md5_id_str_pos], id, 32);

    MD5Init(&md5);
    MD5Update(&md5, qq_wifi_device_md5_str, strlen((char *)qq_wifi_device_md5_str));
    MD5Final(&md5, md5_pwd);

    if (memcmp(pwd, md5_pwd, 16) == 0) {
        return QQ_OK;
    }

    return QQ_WIFI_DEVICE_MD5_FAILED;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x78, %rsp
movq %rsi, %rbx
cmpb $0x0, 0x61fc(%rip)      # 0xf730
leaq 0x621a(%rip), %rax      # 0xf755
leaq 0x61fe(%rip), %r14      # 0xf740
cmoveq %r14, %rax
movups (%rdi), %xmm0
movups 0x10(%rdi), %xmm1
movups %xmm0, (%rax)
movups %xmm1, 0x10(%rax)
leaq -0x88(%rbp), %r15
movq %r15, %rdi
callq 0x6f9c
movq %r14, %rdi
callq 0x20d0
movq %r15, %rdi
movq %r14, %rsi
movl %eax, %edx
callq 0x6fba
leaq -0x30(%rbp), %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x78c8
movdqu (%rbx), %xmm0
pcmpeqb (%r14), %xmm0
pmovmskb %xmm0, %ecx
xorl %eax, %eax
cmpl $0xffff, %ecx           # imm = 0xFFFF
setne %al
addl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/qq-smart[P]qq_sh_server/app/qq_wifi_device.c
// Function: qq_wifi_device_conflict_confirm
static qq_wifi_device_rbtree_node_t *
qq_wifi_device_rbtree_lookup(qq_rbtree_t *rbtree, u_char *id)
{
    qq_int_t                       rc;
    qq_wifi_device_rbtree_node_t  *n;
    qq_rbtree_node_t              *node, *sentinel;
    uint32_t                       hash;

    node = rbtree->root;
    sentinel = rbtree->sentinel;
    hash = qq_wifi_device_rbtree_key(id);

    while (node != sentinel) {
        n = (qq_wifi_device_rbtree_node_t *) node;

        if (hash != node->key) {
            node = (hash < node->key) ? node->left : node->right;
            continue;
        }

        rc = memcmp(id, n->id, 16);
        if (rc < 0) {
            node = node->left;
            continue;
        }
        if (rc > 0) {
            node = node->right;
            continue;
        }

        return n;
    }

    return NULL;
}

// Assembly:
movq 0x616d(%rip), %rdx      # 0xf720
movq 0x615e(%rip), %rcx      # 0xf718
xorl %eax, %eax
cmpq %rdx, %rcx
je 0x9659
pushq %rbp
movq %rsp, %rbp
movl (%rdi), %r8d
cmpq %r8, (%rcx)
jne 0x9618
movq (%rdi), %r9
bswapq %r9
movq 0x28(%rcx), %r10
bswapq %r10
cmpq %r10, %r9
jne 0x95f9
movq 0x8(%rdi), %r9
movq 0x30(%rcx), %r10
bswapq %r9
bswapq %r10
xorl %r11d, %r11d
cmpq %r10, %r9
je 0x9609
cmpq %r10, %r9
movl $0x0, %r11d
sbbl %r11d, %r11d
orl $0x1, %r11d
testl %r11d, %r11d
js 0x962a
movl $0x10, %r9d
jne 0x9630
jmp 0x963b
setbe %r9b
movzbl %r9b, %r9d
leaq 0x8(,%r9,8), %r9
jmp 0x9630
movl $0x8, %r9d
movq (%rcx,%r9), %rcx
cmpq %rdx, %rcx
jne 0x95cc
jmp 0x9658
movl 0x38(%rcx), %eax
xorl (%rsi), %eax
movzwl 0x3c(%rcx), %ecx
xorw 0x4(%rsi), %cx
movzwl %cx, %ecx
xorl %edx, %edx
orl %eax, %ecx
movl $0x7, %eax
cmoveq %rdx, %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/qq-smart[P]qq_sh_server/app/qq_wifi_device.c
// Function: qq_wifi_device_mysql_confirm
static qq_int_t
qq_wifi_device_mysql_confirm(qq_connection_t *c, u_char *id)
{
    MYSQL_RES              *res;
    MYSQL_ROW               row;
    qq_uint_t               n, i;
    qq_wifi_device_t       *wd;
    qq_int_t                reason, main_app, app_type;

    reason = QQ_OK;
    main_app = 0;

    res = qq_mysql_wifi_device_select(id);
    if (res == NULL) {
        return QQ_WIFI_DEVICE_NOTHINGNESS;
    }

    n = mysql_num_rows(res);
    if (n == 0) {
        reason = QQ_WIFI_DEVICE_NO_APP;
    }
    else if (n > QQ_WIFI_DEVICE_MAX_APP_NUMBER) {
        reason = QQ_WIFI_DEVICE_APP_OVERRANGING;
    }

    if (reason == QQ_OK) {
        wd = c->data;
        wd->napp = n;

        i = 0;
        while ((row = mysql_fetch_row(res)) != NULL) {
            wd->app[i].app_type = (int) *row[1];
            app_type = wd->app[i].app_type & ~QQ_MAIN_APP_FLAGS;
            main_app += (wd->app[i].app_type & QQ_MAIN_APP_FLAGS) ? 1 : 0;

            if (app_type == QQ_APP_TYPE_ANDROID) {
                wd->app[i].app = (void *) qq_android_app_node((char *) row[0]);
            }
            else if (app_type == QQ_APP_TYPE_IOS) {
                wd->app[i].app = (void *) qq_ios_app_node((char *) row[0]);
            }
        }
    }

    if (main_app != 1) {
        reason = QQ_WIFI_DEVICE_MAIN_APP_ERROR;
    }

    mysql_free_result(res);

    return reason;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
movq %rsi, %rdi
callq 0x7a64
testq %rax, %rax
je 0x9729
movq %rax, %rbx
movq %rax, %rdi
callq 0x21d0
movl $0x6, %r14d
testq %rax, %rax
je 0x971f
xorl %r12d, %r12d
cmpq $0xb, %rax
setae %r13b
jae 0x971f
movq (%r15), %r15
movq %rax, 0x110(%r15)
movq %rbx, %rdi
callq 0x2200
testq %rax, %rax
je 0x971f
movb %r13b, %r12b
leaq (%r12,%r12,4), %r12
xorl %r14d, %r14d
movq 0x8(%rax), %rcx
movb (%rcx), %r13b
movsbl %r13b, %ecx
movl %ecx, 0x78(%r15)
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl $0x2, %ecx
je 0x96ed
cmpl $0x1, %ecx
jne 0x96f9
movq (%rax), %rdi
callq 0x2579
jmp 0x96f5
movq (%rax), %rdi
callq 0x3cda
movq %rax, 0x70(%r15)
shrb $0x7, %r13b
movzbl %r13b, %eax
addq %rax, %r14
movq %rbx, %rdi
callq 0x2200
testq %rax, %rax
jne 0x96c4
cmpq $0x1, %r14
movl $0x6, %r14d
cmoveq %r12, %r14
movq %rbx, %rdi
callq 0x21f0
jmp 0x972f
movl $0x3, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/src/b5compat.c
// Function: permanentwritespritetile
void permanentwritespritetile(int thex, int they, short tilenum, signed char shade,
        int cx1, int cy1, int cx2, int cy2, unsigned char dapalnum) {
    int x, y, xsiz, ysiz, tx1, ty1, tx2, ty2;
    
    (void)thex; (void)they;
    xsiz = tilesizx[tilenum]; tx1 = cx1/xsiz; tx2 = cx2/xsiz;
    ysiz = tilesizy[tilenum]; ty1 = cy1/ysiz; ty2 = cy2/ysiz;
    
    for (x=tx1;x<=tx2;x++) {
        for (y=ty1;y<=ty2;y++) {
            rotatesprite(x*xsiz<<16,y*ysiz<<16,65536L,0,tilenum,shade,
                         dapalnum,8+16+64+128,cx1,cy1,cx2,cy2);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r9d, %r10d
movl %r8d, %r11d
movl %edx, %esi
movl 0x70(%rsp), %r14d
movslq %edx, %rdi
leaq 0x5b6f1c(%rip), %rax    # 0x5c0ea0
movswl (%rax,%rdi,2), %r8d
movl %r11d, %eax
cltd
idivl %r8d
movl %eax, %r9d
movl %r14d, %eax
cltd
movl %r8d, 0x8(%rsp)
idivl %r8d
movl %eax, %r8d
leaq 0x5a86b7(%rip), %rax    # 0x5b2660
movswl (%rax,%rdi,2), %r12d
movl %r10d, %eax
cltd
idivl %r12d
movl %eax, 0xc(%rsp)
movq %r9, 0x10(%rsp)
movl %r8d, 0x24(%rsp)
cmpl %r8d, %r9d
jg 0xa0ae
movb 0x80(%rsp), %dil
movl 0x78(%rsp), %r15d
shll $0x10, 0x8(%rsp)
movl %r15d, %eax
cltd
idivl %r12d
movl %eax, 0x20(%rsp)
movl %eax, %edx
movl 0xc(%rsp), %eax
subl %eax, %edx
incl %edx
movl %edx, 0x1c(%rsp)
imull %r12d, %eax
shll $0x10, %r12d
shll $0x10, %eax
movl %eax, 0x18(%rsp)
movzbl %dil, %r13d
movswl %si, %edx
movsbl %cl, %esi
movl %r12d, 0x30(%rsp)
movl %edx, 0x2c(%rsp)
movl %esi, 0x28(%rsp)
movl 0x20(%rsp), %eax
cmpl %eax, 0xc(%rsp)
jg 0xa097
movl 0x8(%rsp), %eax
imull 0x10(%rsp), %eax
movl %eax, 0x34(%rsp)
movl 0x18(%rsp), %ebp
movl 0x1c(%rsp), %ebx
movl 0x34(%rsp), %edi
movl %ebp, %esi
movl $0x10000, %edx          # imm = 0x10000
xorl %ecx, %ecx
movl 0x2c(%rsp), %r8d
movl 0x28(%rsp), %r9d
pushq %r15
pushq %r14
pushq %r10
pushq %r11
pushq $0xd8
pushq %r13
movq %r14, %r12
movq %r10, %r14
movq %r13, %r15
movq %r11, %r13
callq 0x4dcbd
movq %r13, %r11
movq %r15, %r13
movq %r14, %r10
movq %r12, %r14
movl 0x60(%rsp), %r12d
movl 0xa8(%rsp), %r15d
addq $0x30, %rsp
addl %r12d, %ebp
decl %ebx
jne 0xa03c
movq 0x10(%rsp), %rcx
leal 0x1(%rcx), %eax
cmpl 0x24(%rsp), %ecx
movq %rax, 0x10(%rsp)
jne 0xa01d
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/src/config.c
// Function: writesetup
int writesetup(const char *fn)
{
	BFILE *fp;
	int item;

	fp = Bfopen(fn,"wt");
	if (!fp) return -1;

#if USE_POLYMOST
	tmprenderer = getrendermode();
#endif
#ifdef RENDERTYPEWIN
	tmpmaxrefreshfreq = win_getmaxrefreshfreq();
#endif
	tmpsamplerate = option[7]>>4;
	tmpmusic = option[2];
	tmpmouse = !!(option[3]&1);
	tmpjoystick = !!(option[3]&2);

	for (item = 0; configspec[item].name; item++) {
		if (configspec[item].doc) {
			if (item > 0) fputs("\n", fp);
			fputs(configspec[item].doc, fp);
		}
		fputs(configspec[item].name, fp);
		fputs(" = ", fp);
		switch (configspec[item].type) {
			case type_bool: {
				fprintf(fp, "%d\n", (*(int*)configspec[item].store != 0));
				break;
			}
			case type_int: {
				fprintf(fp, "%d\n", *(int*)configspec[item].store);
				break;
			}
			case type_hex: {
				fprintf(fp, "%X\n", *(int*)configspec[item].store);
				break;
			}
			case type_double: {
				fprintf(fp, "%g\n", *(double*)configspec[item].store);
				break;
			}
			default: {
				fputs("?\n", fp);
				break;
			}
		}
	}

	Bfclose(fp);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x83be0(%rip), %rsi     # 0x8e064
callq 0x91d0
testq %rax, %rax
je 0xa5d0
movq %rax, %rbx
callq 0x4fb14
movl %eax, 0xc74a0(%rip)     # 0xd1940
leaq 0xc74d1(%rip), %rax     # 0xd1978
movzbl 0x7(%rax), %ecx
shrl $0x4, %ecx
movl %ecx, 0xc7490(%rip)     # 0xd1944
movzbl 0x2(%rax), %ecx
movl %ecx, 0xc748a(%rip)     # 0xd1948
movzbl 0x3(%rax), %eax
movl %eax, %ecx
andl $0x1, %ecx
movl %ecx, 0xc747f(%rip)     # 0xd194c
shrl %eax
andl $0x1, %eax
movl %eax, 0xc7478(%rip)     # 0xd1950
leaq 0x83b97(%rip), %r13     # 0x8e076
leaq 0xc57da(%rip), %r12     # 0xcfcc0
leaq 0x83b27(%rip), %r15     # 0x8e014
xorl %r14d, %r14d
movq 0x18(%r14,%r12), %rbp
testq %rbp, %rbp
je 0xa519
testq %r14, %r14
je 0xa50e
leaq 0x9bc1a(%rip), %rdi     # 0xa6120
movq %rbx, %rsi
callq 0x8470
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x8470
movq %r13, %rdi
movq %rbx, %rsi
callq 0x8470
leaq 0x83b3c(%rip), %rdi     # 0x8e067
movq %rbx, %rsi
callq 0x8470
movl 0x8(%r14,%r12), %eax
cmpq $0x3, %rax
ja 0xa59f
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
movq 0x10(%r14,%r12), %rax
xorl %edx, %edx
cmpl $0x0, (%rax)
setne %dl
jmp 0xa55d
movq 0x10(%r14,%r12), %rax
movl (%rax), %edx
movq %rbx, %rdi
leaq 0x9b5bc(%rip), %rsi     # 0xa5b23
jmp 0xa57a
movq 0x10(%r14,%r12), %rax
movl (%rax), %edx
movq %rbx, %rdi
leaq 0x83af1(%rip), %rsi     # 0x8e06b
xorl %eax, %eax
callq 0x8290
jmp 0xa5ae
movq 0x10(%r14,%r12), %rax
movsd (%rax), %xmm0
movq %rbx, %rdi
leaq 0x83ad9(%rip), %rsi     # 0x8e06f
movb $0x1, %al
callq 0x8290
jmp 0xa5ae
leaq 0x83acd(%rip), %rdi     # 0x8e073
movq %rbx, %rsi
callq 0x8470
movq 0x20(%r14,%r12), %r13
addq $0x20, %r14
cmpq $0x5e0, %r14            # imm = 0x5E0
jne 0xa4f0
movq %rbx, %rdi
callq 0x8640
xorl %eax, %eax
jmp 0xa5d5
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/src/tekchng.c
// Function: changescore
void
changescore(short snum, short deltascore)
{
     if( toggles[TOGGLE_GODMODE] != 0 ) {
          return;
     }

     score[snum] += deltascore;
     score[snum]&=0xFFFFFFFE;

     if( (score[snum] < 0) || (score[snum] > 99999999) )
          score[snum]=0;

}

// Assembly:
leaq 0xc7336(%rip), %rax     # 0xd1a60
cmpl $0x0, 0x1c(%rax)
je 0xa731
retq
movswl %si, %eax
movswq %di, %rcx
leaq 0x122f41(%rip), %rdx    # 0x12d680
addl (%rdx,%rcx,4), %eax
movl %eax, %esi
andl $-0x2, %esi
xorl %edi, %edi
cmpl $0x5f5e100, %esi        # imm = 0x5F5E100
cmovgel %edi, %esi
testl %eax, %eax
cmovsl %edi, %esi
movl %esi, (%rdx,%rcx,4)
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/src/tekchng.c
// Function: tekchangestun
void
tekchangestun(short snum,short deltastun)
{
     if( toggles[TOGGLE_GODMODE] != 0 ) {
          return;
     }

     switch (difficulty) {
     case 1:
          deltastun/=2;
          break;
     case 3:
          deltastun*=2;
          break;
     }
     stun[snum]+=deltastun;
     if (stun[snum] < 0) {
          stun[snum]=0;
     }
}

// Assembly:
leaq 0xc72fe(%rip), %rax     # 0xd1a60
cmpl $0x0, 0x1c(%rax)
je 0xa769
retq
leaq 0x1268b4(%rip), %rax    # 0x131024
movl (%rax), %eax
cmpl $0x3, %eax
je 0xa78b
cmpl $0x1, %eax
jne 0xa78d
movzwl %si, %eax
shrl $0xf, %eax
addl %esi, %eax
movswl %ax, %esi
shrl %esi
jmp 0xa78d
addl %esi, %esi
movswl %si, %eax
movswq %di, %rcx
leaq 0xd9bf5(%rip), %rdx     # 0xe4390
addl (%rdx,%rcx,4), %eax
xorl %esi, %esi
testl %eax, %eax
cmovgl %eax, %esi
movl %esi, (%rdx,%rcx,4)
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/src/tekchng.c
// Function: tekhealstun
void
tekhealstun(short snum)
{
     if( toggles[TOGGLE_GODMODE] != 0 ) {
          return;
     }

     if (stun[snum] < MAXSTUNPOINTS) {
          if (stuntics[snum] >= CLKIPS) {
               stuntics[snum]-=CLKIPS;
               tekchangestun(snum,1);
          }
     }
}

// Assembly:
leaq 0xc72b0(%rip), %rax     # 0xd1a60
cmpl $0x0, 0x1c(%rax)
je 0xa7b7
retq
movswq %di, %rax
leaq 0xd9bce(%rip), %rcx     # 0xe4390
movl (%rcx,%rax,4), %edx
cmpl $0x3e7, %edx            # imm = 0x3E7
jg 0xa7b6
leaq 0xd9bfc(%rip), %rsi     # 0xe43d0
movl (%rsi,%rax,4), %edi
cmpl $0x78, %edi
jl 0xa7b6
addl $-0x78, %edi
movl %edi, (%rsi,%rax,4)
leaq 0x12683b(%rip), %rsi    # 0x131024
movl (%rsi), %esi
xorl %edi, %edi
cmpl $0x3, %esi
sete %dil
incl %edi
xorl %r8d, %r8d
cmpl $0x1, %esi
cmovel %r8d, %edi
addl %edx, %edi
testl %edi, %edi
cmovlel %r8d, %edi
movl %edi, (%rcx,%rax,4)
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/src/tekgame.c
// Function: debugout
void
debugout(short p)
{
     static int dbglines;

     if (dbgcolumn != 0) {
          fprintf(dbgfp,"\n");
     }
     fprintf(dbgfp,"%2d %6d %3d %04X %04d %06d %06d %06d %06d %d\n",
                    p,lockclock,movefifoplc,syncbits[p],ang[p],posx[p],posy[p],posz[p],
                    health[p],randomseed);
     dbglines++;
     dbgcolumn=0;
     if (dbglines > 2000) {
          dbglines=0;
          fclose(dbgfp);
          sprintf(dbgfname,"DEBUG.%03d",dbgfilen++);
          dbgfp=fopen(dbgfname,"wt");
          fprintf(dbgfp," P  CLOCK PLC BITS  ANG   X     Y     Z   HEALTH RSEED\n");
          fprintf(dbgfp,"== ====== === ==== ==== ===== ===== ===== ====== =========\n");
     }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
cmpl $0x0, 0xd9a4f(%rip)     # 0xe4478
je 0xaa3c
movq 0xd9a4e(%rip), %rsi     # 0xe4480
movl $0xa, %edi
callq 0x8cb0
movq 0xd9a3d(%rip), %rdi     # 0xe4480
movswl %bx, %edx
movl 0xd9a3c(%rip), %ecx     # 0xe4488
movl 0xd9a39(%rip), %r8d     # 0xe448c
movswq %dx, %rax
leaq 0xd9a32(%rip), %rsi     # 0xe4490
movzwl (%rsi,%rax,2), %r9d
leaq 0xd9a46(%rip), %rsi     # 0xe44b0
movswl (%rsi,%rax,2), %r10d
leaq 0xd9a5a(%rip), %rsi     # 0xe44d0
movl (%rsi,%rax,4), %r11d
leaq 0xd9a8f(%rip), %rsi     # 0xe4510
movl (%rsi,%rax,4), %ebx
leaq 0xd9ac5(%rip), %rsi     # 0xe4550
movl (%rsi,%rax,4), %r14d
leaq 0xd9afa(%rip), %rsi     # 0xe4590
movl (%rsi,%rax,4), %r15d
leaq 0x5dc967(%rip), %rax    # 0x5e7408
movl (%rax), %r12d
leaq 0x843dd(%rip), %rsi     # 0x8ee88
xorl %eax, %eax
pushq %r12
pushq %r15
pushq %r14
pushq %rbx
pushq %r11
pushq %r10
callq 0x8290
addq $0x30, %rsp
movl 0xd99ad(%rip), %eax     # 0xe4474
leal 0x1(%rax), %ecx
movl %ecx, 0xd99a4(%rip)     # 0xe4474
movl $0x0, 0xd999e(%rip)     # 0xe4478
cmpl $0x7d0, %eax            # imm = 0x7D0
jl 0xab79
movl $0x0, 0xd9985(%rip)     # 0xe4474
movq 0xd998a(%rip), %rdi     # 0xe4480
callq 0x8640
movl 0xd9adf(%rip), %edx     # 0xe45e0
leal 0x1(%rdx), %eax
movl %eax, 0xd9ad6(%rip)     # 0xe45e0
leaq 0xd9abf(%rip), %rbx     # 0xe45d0
leaq 0x8439e(%rip), %rsi     # 0x8eeb6
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8f20
leaq 0x8353b(%rip), %rsi     # 0x8e064
movq %rbx, %rdi
callq 0x91d0
movq %rax, 0xd9948(%rip)     # 0xe4480
leaq 0x84382(%rip), %rdi     # 0x8eec1
movl $0x37, %esi
movl $0x1, %edx
movq %rax, %rcx
callq 0x8ff0
movq 0xd9928(%rip), %rcx     # 0xe4480
leaq 0x8439a(%rip), %rdi     # 0x8eef9
movl $0x3b, %esi
movl $0x1, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x8ff0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/src/tekgame.c
// Function: movethings
void
movethings()
{
     int      i;

     gotlastpacketclock = totalclock;
     for( i=connecthead; i>=0; i=connectpoint2[i] ) {
          baksyncvel[movefifoend][i] = fsyncvel[i];
          baksyncsvel[movefifoend][i] = fsyncsvel[i];
          baksyncangvel[movefifoend][i] = fsyncangvel[i];
          baksyncbits[movefifoend][i] = fsyncbits[i];
     }
     movefifoend = ((movefifoend+1)&(MOVEFIFOSIZ-1));

     // do this for Master/Slave switching
     for( i=connectpoint2[connecthead]; i>=0; i=connectpoint2[i] ) {
          if( syncbits[i]&512 ) {
               ready2send = 0;
          }
     }

     tektime();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
leaq 0x5501c2(%rip), %rax    # 0x55d368
movl (%rax), %eax
movl %eax, 0xd72aa(%rip)     # 0xe4458
leaq 0x79897b(%rip), %rax    # 0x7a5b30
movslq (%rax), %rax
movslq 0xd8335(%rip), %rcx     # 0xe54f4
testq %rax, %rax
js 0xd254
leaq 0xd8381(%rip), %rdx     # 0xe5550
movq %rcx, %rdi
shlq $0x4, %rdi
leaq 0xd8a83(%rip), %rsi     # 0xe5c60
addq %rdi, %rsi
leaq 0xd83b9(%rip), %rdi     # 0xe55a0
movq %rcx, %r14
shlq $0x5, %r14
leaq 0xd9a6b(%rip), %r8      # 0xe6c60
addq %r14, %r8
leaq 0xd8401(%rip), %r9      # 0xe5600
leaq 0xdba5a(%rip), %r10     # 0xe8c60
addq %r14, %r10
leaq 0xd8430(%rip), %r11     # 0xe5640
leaq 0xdda49(%rip), %rbx     # 0xeac60
addq %r14, %rbx
leaq 0x79891f(%rip), %r14    # 0x7a5b40
movl %eax, %ebp
movl %ebp, %r15d
movb (%r15,%rdx), %bpl
movb %bpl, (%r15,%rsi)
movzwl (%rdi,%r15,2), %ebp
movw %bp, (%r8,%r15,2)
movzwl (%r9,%r15,2), %ebp
movw %bp, (%r10,%r15,2)
movzwl (%r11,%r15,2), %ebp
movw %bp, (%rbx,%r15,2)
movl (%r14,%r15,4), %ebp
testl %ebp, %ebp
jns 0xd223
incl %ecx
movzbl %cl, %ecx
movl %ecx, 0xd8295(%rip)     # 0xe54f4
leaq 0x7988da(%rip), %rcx    # 0x7a5b40
movl (%rcx,%rax,4), %edx
testl %edx, %edx
js 0xd28b
leaq 0xd721c(%rip), %rax     # 0xe4490
movl %edx, %edx
testb $0x2, 0x1(%rax,%rdx,2)
je 0xd284
movb $0x0, 0xd71cf(%rip)     # 0xe4453
movl (%rcx,%rdx,4), %edx
testl %edx, %edx
jns 0xd274
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x16fb0
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/src/tekgame.c
// Function: doanimations
void
doanimations()
{
     int i, j;

     for(i=animatecnt-1;i>=0;i--)
     {
          j = *animateptr[i];

          if (j < animategoal[i])
               j = min(j+animatevel[i]*TICSPERFRAME,animategoal[i]);
          else
               j = max(j-animatevel[i]*TICSPERFRAME,animategoal[i]);
          animatevel[i] += animateacc[i];

          *animateptr[i] = j;

          if (j == animategoal[i])
          {
               animatecnt--;
               if (i != animatecnt)
               {
                    animateptr[i] = animateptr[animatecnt];
                    animategoal[i] = animategoal[animatecnt];
                    animatevel[i] = animatevel[animatecnt];
                    animateacc[i] = animateacc[animatecnt];
               }
          }
     }
}

// Assembly:
movslq 0xd5e4d(%rip), %r8      # 0xe4470
testq %r8, %r8
jle 0xe6e7
pushq %rbx
incq %r8
leaq 0x11c659(%rip), %rax    # 0x12ac90
leaq 0x11d652(%rip), %rcx    # 0x12bc90
leaq 0x11de4b(%rip), %rdx    # 0x12c490
leaq 0x11e644(%rip), %rsi    # 0x12cc90
movq %r8, %rdi
movq -0x10(%rax,%r8,8), %r9
movl (%r9), %r11d
movl -0x8(%rcx,%r8,4), %r8d
movl -0x8(%rdx,%rdi,4), %r10d
leal (%r10,%r10,2), %ebx
cmpl %r8d, %r11d
jge 0xe676
addl %r11d, %ebx
cmpl %r8d, %ebx
cmovgel %r8d, %ebx
jmp 0xe683
subl %ebx, %r11d
cmpl %r8d, %r11d
cmovlel %r8d, %r11d
movl %r11d, %ebx
leaq -0x1(%rdi), %r8
addl -0x8(%rsi,%rdi,4), %r10d
movl %r10d, -0x8(%rdx,%rdi,4)
movl %ebx, (%r9)
cmpl -0x8(%rcx,%rdi,4), %ebx
jne 0xe6dc
movl 0xd5dcf(%rip), %r9d     # 0xe4470
leal -0x1(%r9), %r10d
movl %r10d, 0xd5dc4(%rip)    # 0xe4470
cmpq %r9, %r8
je 0xe6dc
movslq %r9d, %r9
movq -0x8(%rax,%r9,8), %r10
movq %r10, -0x10(%rax,%rdi,8)
movl -0x4(%rcx,%r9,4), %r10d
movl %r10d, -0x8(%rcx,%rdi,4)
movl -0x4(%rdx,%r9,4), %r10d
movl %r10d, -0x8(%rdx,%rdi,4)
movl -0x4(%rsi,%r9,4), %r9d
movl %r9d, -0x8(%rsi,%rdi,4)
cmpq $0x1, %r8
ja 0xe64c
popq %rbx
retq