LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0x78b6
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rax), %r15
cmpq %r14, %r15
je 0x78a8
movq (%r15), %r12
movq 0x8(%r15), %r13
movq %r12, (%r13)
movq %r13, 0x8(%r12)
movq %r12, %rdi
movq %r15, %rsi
callq *%rbx
testq %rax, %rax
jle 0x788f
movq (%r12), %r12
cmpq %r14, %r12
jne 0x7879
movq 0x8(%r12), %rax
movq %rax, 0x8(%r15)
movq %r15, (%rax)
movq %r12, (%r15)
movq %r15, 0x8(%r12)
movq %r13, %r15
jmp 0x7864
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rax
testq %rdx, %rdx
je 0x7dde
decq %rdx
xorl %ecx, %ecx
cmpq %rcx, %rdx
je 0x7dd2
movb (%rsi,%rcx), %dil
movb %dil, (%rax,%rcx)
testb %dil, %dil
je 0x7ddb
incq %rcx
jmp 0x7dbb
movb $0x0, (%rax,%rcx)
addq %rcx, %rax
jmp 0x7dde
addq %rcx, %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
xorl %ecx, %ecx
leaq 0x2230(%rip), %rdi      # 0xa020
cmpq %rcx, %rdx
je 0x7e1f
movzbl (%rsi,%rcx), %r8d
shrl $0x4, %r8d
movb (%r8,%rdi), %r8b
movb %r8b, (%rax)
movzbl (%rsi,%rcx), %r8d
andl $0xf, %r8d
movb (%r8,%rdi), %r8b
movb %r8b, 0x1(%rax)
addq $0x2, %rax
incq %rcx
jmp 0x7df0
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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:
movabsq $-0x1, %rax
testb $0x1, %dl
jne 0x7ec6
pushq %rbp
movq %rsp, %rbp
xorl %ecx, %ecx
cmpq %rcx, %rdx
je 0x7ec3
movb (%rdi,%rcx), %r9b
leal -0x30(%r9), %r8d
cmpb $0xa, %r8b
jb 0x7e72
leal -0x41(%r9), %r8d
cmpb $0x5, %r8b
ja 0x7e61
addb $-0x37, %r9b
jmp 0x7e6f
leal -0x61(%r9), %r8d
cmpb $0x5, %r8b
ja 0x7ec5
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 0x7e8d
orb %r8b, %r10b
jmp 0x7eb4
leal -0x41(%r9), %r10d
cmpb $0x5, %r10b
ja 0x7ea0
addb %r8b, %r9b
addb $-0x37, %r9b
jmp 0x7eb1
leal -0x61(%r9), %r10d
cmpb $0x5, %r10b
ja 0x7ec5
addb %r8b, %r9b
addb $-0x57, %r9b
movl %r9d, %r10d
movb %r10b, (%rsi)
incq %rsi
addq $0x2, %rcx
jmp 0x7e3a
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x7eff
movq 0x28(%rbx), %rdx
cmpq 0x28(%r15), %rdx
jne 0x7eff
movq 0x30(%rbx), %rdi
movq 0x30(%r15), %rsi
callq 0x20e0
shrl $0x1f, %eax
jmp 0x7f02
setb %al
xorb $0x1, %al
movzbl %al, %eax
movq 0x8(%r15,%rax,8), %rdi
cmpq %r14, %rdi
jne 0x7edb
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_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %r15
movl %edx, %r12d
pushq $0x8
popq %r13
movq (%rbx), %rbx
cmpq %r15, %rbx
je 0x7f9e
cmpq %r12, (%rbx)
jne 0x7f86
movq (%r14), %rdx
cmpq 0x28(%rbx), %rdx
jne 0x7f8b
movq 0x8(%r14), %rdi
movq 0x30(%rbx), %rsi
callq 0x20e0
movq %r13, %rcx
testl %eax, %eax
js 0x7f99
pushq $0x10
popq %rcx
jne 0x7f99
jmp 0x7fa0
setbe %al
jmp 0x7f8e
setae %al
movzbl %al, %eax
leaq 0x8(,%rax,8), %rcx
addq %rcx, %rbx
jmp 0x7f55
xorl %ebx, %ebx
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_O2/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 0x2049(%rip), %rdi      # 0xa031
xorl %eax, %eax
callq 0x6706
movl 0x8(%r13), %eax
testl $0x104000, %eax         # imm = 0x104000
je 0x8060
movq %r13, -0x30(%rbp)
leaq 0x2043(%rip), %r13      # 0xa048
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 0x6706
testq %r12, %r12
je 0x806b
jg 0x8082
callq 0x2030
movl (%rax), %r12d
cmpl $0xb, %r12d
je 0x8048
cmpl $0x4, %r12d
jne 0x80a4
leaq 0x2015(%rip), %rdi      # 0xa064
xorl %eax, %eax
callq 0x6706
cmpl $0x4, %r12d
je 0x8005
pushq $-0x2
jmp 0x80b4
andl $0xffefbfdf, %eax       # imm = 0xFFEFBFDF
pushq $-0x2
popq %r12
jmp 0x80c8
movl $0xfffffedf, %eax       # imm = 0xFFFFFEDF
movq -0x30(%rbp), %r13
andl 0x8(%r13), %eax
orl $0x100, %eax            # imm = 0x100
xorl %r12d, %r12d
jmp 0x80c8
cmpq %rbx, %r12
jae 0x80cc
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 0x80c8
leaq 0x1fca(%rip), %rdi      # 0xa075
xorl %eax, %eax
callq 0x6706
pushq $-0x1
popq %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
nop
// File: /workspace/github_c_makefile_star2_O2/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, %rbx
movq %rsi, %r15
movq %rdi, %r12
movq 0x10(%rdi), %rax
movq %rax, -0x30(%rbp)
movl 0x18(%r12), %edi
movq %r15, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x2130
movq %rax, %r13
movl 0x18(%r12), %esi
leaq 0x1f63(%rip), %rdi      # 0xa083
movq %rax, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x6706
testq %r13, %r13
jg 0x816c
callq 0x2030
movl (%rax), %r14d
testq %r13, %r13
je 0x8173
cmpl $0xb, %r14d
je 0x814b
cmpl $0x4, %r14d
jne 0x8193
movq -0x30(%rbp), %rax
andb $-0x21, 0x8(%rax)
leaq 0x1f5a(%rip), %rdi      # 0xa0b4
xorl %eax, %eax
callq 0x6706
cmpl $0xb, %r14d
jne 0x80ff
pushq $-0x2
popq %rax
jmp 0x81a9
cmpq %rbx, %r13
jl 0x8187
jmp 0x81a6
leaq 0x1f25(%rip), %rsi      # 0xa09f
xorl %r13d, %r13d
movl %r14d, %edi
xorl %eax, %eax
callq 0x65bd
movq -0x30(%rbp), %rcx
movl 0x8(%rcx), %eax
andl $-0x21, %eax
jmp 0x81a3
movl $0x200, %eax            # imm = 0x200
movq -0x30(%rbp), %rcx
orl 0x8(%rcx), %eax
pushq $-0x1
popq %r13
movl %eax, 0x8(%rcx)
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 $0x50, %rsp
leaq -0x20(%rbp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x22d0
movq (%r14), %rbx
movq 0x8(%r14), %rax
movl $0x3e8, %ecx            # imm = 0x3E8
cqto
idivq %rcx
imulq $0x3e8, %rbx, %rcx      # imm = 0x3E8
addq %rax, %rcx
movq %rcx, 0x64b8(%rip)      # 0xe6c0
movq 0x64b1(%rip), %rdx      # 0xe6c0
leaq 0x639a(%rip), %r14      # 0xe5b0
leaq 0x1ea8(%rip), %rsi      # 0xa0c5
movq %r14, %rdi
xorl %eax, %eax
callq 0x2070
movq %r14, %rdi
callq 0x20d0
incq %rax
movq %rax, 0x648f(%rip)      # 0xe6c8
leaq -0x58(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x828d
movl 0x14(%r14), %edx
movl 0x10(%r14), %ecx
movl 0xc(%r14), %r8d
movl 0x8(%r14), %r9d
movl (%r14), %r10d
movl 0x4(%r14), %r11d
leaq 0x646a(%rip), %rbx      # 0xe6d0
leaq 0x1e6a(%rip), %rsi      # 0xa0d7
movq %rbx, %rdi
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0x2070
popq %rcx
popq %rdx
movq %rbx, 0x6434(%rip)      # 0xe6b8
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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, %r14
movq %rsi, %r15
movq %rdi, %r12
movq 0x8(%rdi), %rax
movq %rax, -0x30(%rbp)
leaq 0x1dfa(%rip), %r13      # 0xa0f4
movl 0x18(%r12), %edi
movq %r15, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x20b0
movq %rax, %rbx
movl 0x18(%r12), %esi
movq %r13, %rdi
movq %rax, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x6706
testq %rbx, %rbx
jns 0x8351
callq 0x2030
movl (%rax), %ebx
cmpl $0xb, %ebx
je 0x833a
cmpl $0x4, %ebx
jne 0x8356
leaq 0x1d23(%rip), %rdi      # 0xa064
xorl %eax, %eax
callq 0x6706
cmpl $0x4, %ebx
je 0x82fa
pushq $-0x2
jmp 0x8358
movq %rbx, %rax
jmp 0x837a
pushq $-0x1
popq %rax
movq -0x30(%rbp), %rsi
movl 0x8(%rsi), %edx
movl %edx, %ecx
andl $-0x21, %ecx
andl $0xfffffddf, %edx       # imm = 0xFFFFFDDF
orl $0x200, %edx            # imm = 0x200
cmpl $0xb, %ebx
cmovel %ecx, %edx
movl %edx, 0x8(%rsi)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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 0x1d57(%rip), %r12      # 0xa109
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 0x6706
testq %r13, %r13
jns 0x8416
callq 0x2030
movl (%rax), %eax
cmpl $0x4, %eax
je 0x83b2
cmpl $0xb, %eax
jne 0x841b
movq -0x30(%rbp), %rax
andb $-0x21, 0x8(%rax)
leaq 0x1d1d(%rip), %rdi      # 0xa128
xorl %eax, %eax
callq 0x6706
pushq $-0x2
jmp 0x8425
cmpq %rbx, %r13
je 0x8426
movq -0x30(%rbp), %rax
orb $0x2, 0x9(%rax)
pushq $-0x1
popq %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x31(%rip), %rcx        # 0x8474
pushq $0x2
popq %rdi
movl $0x200, %edx            # imm = 0x200
movl $0x32c8, %esi           # imm = 0x32C8
callq 0x5f10
cmpq $-0x1, %rax
je 0x845f
xorl %eax, %eax
jmp 0x8472
leaq 0x1cd5(%rip), %rsi      # 0xa13b
xorl %edi, %edi
xorl %eax, %eax
callq 0x65bd
pushq $-0x1
popq %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x81(%rip), %rcx        # 0x8550
pushq $0x1
popq %rdi
movl $0x200, %edx            # imm = 0x200
movl $0x2ee0, %esi           # imm = 0x2EE0
callq 0x5f10
cmpq $-0x1, %rax
je 0x853b
movb $0x0, 0x6222(%rip)      # 0xe710
leaq 0x61fb(%rip), %rax      # 0xe6f0
movq %rax, 0x621c(%rip)      # 0xe718
movq %rax, 0x621d(%rip)      # 0xe720
leaq 0x8b(%rip), %rax        # 0x8595
movq %rax, 0x6217(%rip)      # 0xe728
movb $0x1, 0x6218(%rip)      # 0xe730
movups 0x1d01(%rip), %xmm0     # 0xa220
movaps %xmm0, 0x621a(%rip)     # 0xe740
movabsq $0x65696b766d353833, %rax # imm = 0x65696B766D353833
movq %rax, 0x6216(%rip)      # 0xe74d
xorl %eax, %eax
jmp 0x854e
leaq 0x1ca6(%rip), %rsi      # 0xa1e8
xorl %edi, %edi
xorl %eax, %eax
callq 0x65bd
pushq $-0x1
popq %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1cec(%rip), %rdi      # 0xa24c
xorl %eax, %eax
callq 0x6706
movq 0x8(%rbx), %rdi
leaq 0xc1(%rip), %rax        # 0x8633
movq %rax, 0x10(%rdi)
movq 0x10(%rbx), %rax
leaq 0x67e(%rip), %rcx       # 0x8bff
movq %rcx, 0x10(%rax)
movl $0xbb8, %esi            # imm = 0xBB8
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x8c05
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq (%rsi), %r13
movq %rsi, -0x30(%rbp)
leaq 0x28(%rsi), %r15
pushq $0x10
popq %r12
movq %rdi, %rbx
cmpq (%rdi), %r13
jne 0x85d1
leaq 0x28(%rbx), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x20e0
shrl $0x1f, %eax
jmp 0x85d4
setb %al
xorb $0x1, %al
movzbl %al, %eax
movq 0x8(%rbx,%rax,8), %rdi
cmpq %r14, %rdi
jne 0x85b5
leaq 0x8(,%rax,8), %rax
movq -0x30(%rbp), %rcx
movq %rcx, (%rbx,%rax)
movq %rbx, 0x18(%rcx)
movq %r14, 0x8(%rcx)
movq %r14, 0x10(%rcx)
movb $0x1, 0x20(%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x8cf8
leaq 0x1542(%rip), %rax      # 0xa1c8
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x30(%rbx), %rax
leaq 0x16d4(%rip), %rsi      # 0xa36e
pushq $0x24
popq %rdx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmpq *%rax
leaq 0x1747(%rip), %rsi      # 0xa3f6
jmp 0x8cef
leaq 0x16fa(%rip), %rsi      # 0xa3b2
pushq $0x28
jmp 0x8cf1
leaq 0x1717(%rip), %rsi      # 0xa3da
pushq $0x1c
jmp 0x8cf1
leaq 0x1796(%rip), %rsi      # 0xa464
pushq $0x29
jmp 0x8cf1
leaq 0x16b9(%rip), %rsi      # 0xa392
pushq $0x20
jmp 0x8cf1
leaq 0x1737(%rip), %rsi      # 0xa41b
pushq $0x24
jmp 0x8cf1
leaq 0x1750(%rip), %rsi      # 0xa43f
pushq $0x25
popq %rdx
movq %rbx, %rdi
callq *0x30(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x26aa
// File: /workspace/github_c_makefile_star2_O2/KhuramAli[P]JAM-Benchmark/Summation_lock_synchronzied_cppThread/code11.cpp
// Function: sumUp(unsigned long long&, std::vector<int, std::allocator<int>> const&, unsigned long long, unsigned long long)
void sumUp(unsigned long long& sum, const std::vector<int>& val, unsigned long long beg, unsigned long long end) {
	for (auto it = beg; it < end; ++it) {
		myMutex.lock();
		sum += val[it];
		myMutex.unlock();
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x2e20(%rip), %r13      # 0x40e8
cmpq %rbx, %r14
jae 0x12ed
movq %r13, %rdi
callq 0x1584
movq (%r15), %rax
movslq (%rax,%r14,4), %rax
addq %rax, (%r12)
movq %r13, %rdi
callq 0x10b0
incq %r14
jmp 0x12c8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r8d, %eax
movl %edx, %esi
movb 0x80(%rsp), %dil
movl 0x78(%rsp), %r10d
movl 0x70(%rsp), %r11d
movslq %edx, %r8
leaq 0x5adad2(%rip), %rdx    # 0x5b6ea0
movswl (%rdx,%r8,2), %ebx
movq %rax, 0x28(%rsp)
cltd
idivl %ebx
movl %eax, %r13d
movl %r11d, %eax
cltd
idivl %ebx
movl %eax, 0x18(%rsp)
leaq 0x59f271(%rip), %rax    # 0x5a8660
movswl (%rax,%r8,2), %r8d
movq %r9, 0x30(%rsp)
movl %r9d, %eax
cltd
idivl %r8d
movl %eax, %r9d
movl %r10d, %eax
cltd
idivl %r8d
movl %eax, 0x24(%rsp)
shll $0x10, %ebx
movl %ebx, 0x14(%rsp)
movl %r9d, 0x10(%rsp)
imull %r8d, %r9d
shll $0x10, %r8d
movl %r8d, 0x20(%rsp)
shll $0x10, %r9d
movl %r9d, 0xc(%rsp)
movzbl %dil, %r14d
movswl %si, %ebp
movsbl %cl, %r15d
cmpl 0x18(%rsp), %r13d
jg 0x94a7
movl 0x14(%rsp), %r12d
movl %r13d, 0x1c(%rsp)
imull %r13d, %r12d
movl 0xc(%rsp), %ebx
movl 0x10(%rsp), %r13d
cmpl 0x24(%rsp), %r13d
jg 0x949d
movl %r12d, %edi
movl %ebx, %esi
movl $0x10000, %edx          # imm = 0x10000
xorl %ecx, %ecx
movl %ebp, %r8d
movl %r15d, %r9d
movl 0x78(%rsp), %eax
pushq %rax
movl 0x78(%rsp), %eax
pushq %rax
pushq 0x40(%rsp)
pushq 0x40(%rsp)
pushq $0xd8
pushq %r14
callq 0x48ebe
addq $0x30, %rsp
incl %r13d
addl 0x20(%rsp), %ebx
jmp 0x9459
movl 0x1c(%rsp), %r13d
incl %r13d
jmp 0x943b
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x7681e(%rip), %rsi     # 0x80064
callq 0x91d0
testq %rax, %rax
je 0x998f
movq %rax, %rbx
callq 0x4a914
movl %eax, 0xbe0de(%rip)     # 0xc7940
leaq 0xbe10f(%rip), %rax     # 0xc7978
movzbl 0x7(%rax), %ecx
shrl $0x4, %ecx
movl %ecx, 0xbe0ce(%rip)     # 0xc7944
movzbl 0x2(%rax), %ecx
movl %ecx, 0xbe0c8(%rip)     # 0xc7948
movzbl 0x3(%rax), %eax
movl %eax, %ecx
andl $0x1, %ecx
movl %ecx, 0xbe0bd(%rip)     # 0xc794c
shrl %eax
andl $0x1, %eax
movl %eax, 0xbe0b6(%rip)     # 0xc7950
leaq 0xbc41f(%rip), %r12     # 0xc5cc0
leaq 0x7676c(%rip), %r15     # 0x80014
xorl %r14d, %r14d
cmpq $0x5e0, %r14            # imm = 0x5E0
je 0x9983
movq (%r14,%r12), %r13
movq 0x18(%r14,%r12), %rbp
testq %rbp, %rbp
je 0x98e5
testq %r14, %r14
je 0x98da
leaq 0x8e65e(%rip), %rdi     # 0x97f30
movq %rbx, %rsi
callq 0x8470
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x8470
movq %r13, %rdi
movq %rbx, %rsi
callq 0x8470
leaq 0x76770(%rip), %rdi     # 0x80067
movq %rbx, %rsi
callq 0x8470
movl 0x8(%r14,%r12), %eax
cmpq $0x3, %rax
ja 0x996b
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
movq 0x10(%r14,%r12), %rax
xorl %edx, %edx
cmpl $0x0, (%rax)
setne %dl
jmp 0x9929
movq 0x10(%r14,%r12), %rax
movl (%rax), %edx
movq %rbx, %rdi
leaq 0x8e090(%rip), %rsi     # 0x979c3
jmp 0x9946
movq 0x10(%r14,%r12), %rax
movl (%rax), %edx
movq %rbx, %rdi
leaq 0x76725(%rip), %rsi     # 0x8006b
xorl %eax, %eax
callq 0x8290
jmp 0x997a
movq 0x10(%r14,%r12), %rax
movsd (%rax), %xmm0
movq %rbx, %rdi
leaq 0x7670d(%rip), %rsi     # 0x8006f
movb $0x1, %al
callq 0x8290
jmp 0x997a
leaq 0x76701(%rip), %rdi     # 0x80073
movq %rbx, %rsi
callq 0x8470
addq $0x20, %r14
jmp 0x98ab
movq %rbx, %rdi
callq 0x8640
xorl %eax, %eax
jmp 0x9992
pushq $-0x1
popq %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_O2/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 0xbdf7d(%rip), %rax     # 0xc7a60
cmpl $0x0, 0x1c(%rax)
je 0x9aea
retq
movswl %si, %eax
movswq %di, %rcx
leaq 0x119b88(%rip), %rdx    # 0x123680
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_O2/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 0xbdf45(%rip), %rax     # 0xc7a60
cmpl $0x0, 0x1c(%rax)
je 0x9b22
retq
leaq 0x11d4fb(%rip), %rax    # 0x127024
movl (%rax), %eax
cmpl $0x3, %eax
je 0x9b44
cmpl $0x1, %eax
jne 0x9b46
movw $0x2, %cx
movl %esi, %eax
cwtd
idivw %cx
movl %eax, %esi
jmp 0x9b46
addl %esi, %esi
movswl %si, %eax
movswq %di, %rcx
leaq 0xd083c(%rip), %rdx     # 0xda390
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_O2/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 0xbdef7(%rip), %rax     # 0xc7a60
cmpl $0x0, 0x1c(%rax)
jne 0x9ba3
movswq %di, %rax
leaq 0xd0816(%rip), %rcx     # 0xda390
cmpl $0x3e7, (%rcx,%rax,4)   # imm = 0x3E7
jg 0x9ba3
leaq 0xd0846(%rip), %rcx     # 0xda3d0
movl (%rcx,%rax,4), %edx
cmpl $0x78, %edx
jl 0x9ba3
addl $-0x78, %edx
movl %edx, (%rcx,%rax,4)
movswl %ax, %edi
pushq $0x1
popq %rsi
jmp 0x9b14
retq
// File: /workspace/github_c_makefile_star2_O2/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, 0xd0787(%rip)     # 0xda478
je 0x9d02
movq 0xd0786(%rip), %rsi     # 0xda480
pushq $0xa
popq %rdi
callq 0x8cb0
movq 0xd0777(%rip), %rdi     # 0xda480
movswl %bx, %edx
movl 0xd0776(%rip), %ecx     # 0xda488
movl 0xd0773(%rip), %r8d     # 0xda48c
movswq %dx, %rax
leaq 0xd076c(%rip), %rsi     # 0xda490
movzwl (%rsi,%rax,2), %r9d
leaq 0xd0780(%rip), %rsi     # 0xda4b0
movswl (%rsi,%rax,2), %r10d
leaq 0xd0794(%rip), %rsi     # 0xda4d0
movl (%rsi,%rax,4), %r11d
leaq 0xd07c9(%rip), %rsi     # 0xda510
movl (%rsi,%rax,4), %ebx
leaq 0xd07ff(%rip), %rsi     # 0xda550
movl (%rsi,%rax,4), %r14d
leaq 0xd0834(%rip), %rsi     # 0xda590
movl (%rsi,%rax,4), %r15d
leaq 0x5d36a1(%rip), %rax    # 0x5dd408
movl (%rax), %r12d
leaq 0x77117(%rip), %rsi     # 0x80e88
xorl %eax, %eax
pushq %r12
pushq %r15
pushq %r14
pushq %rbx
pushq %r11
pushq %r10
callq 0x8290
addq $0x30, %rsp
movl 0xd06e7(%rip), %eax     # 0xda474
leal 0x1(%rax), %ecx
movl %ecx, 0xd06de(%rip)     # 0xda474
andl $0x0, 0xd06db(%rip)     # 0xda478
cmpl $0x7d0, %eax            # imm = 0x7D0
jl 0x9e34
andl $0x0, 0xd06c5(%rip)     # 0xda474
movq 0xd06ca(%rip), %rdi     # 0xda480
callq 0x8640
movl 0xd081f(%rip), %edx     # 0xda5e0
leal 0x1(%rdx), %eax
movl %eax, 0xd0816(%rip)     # 0xda5e0
leaq 0xd07ff(%rip), %rbx     # 0xda5d0
leaq 0x770de(%rip), %rsi     # 0x80eb6
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8f20
leaq 0x7627b(%rip), %rsi     # 0x80064
movq %rbx, %rdi
callq 0x91d0
movq %rax, 0xd0688(%rip)     # 0xda480
leaq 0x770c2(%rip), %rdi     # 0x80ec1
pushq $0x37
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
movq %rax, %rcx
callq 0x8ff0
movq 0xd0669(%rip), %rcx     # 0xda480
leaq 0x770db(%rip), %rdi     # 0x80ef9
pushq $0x3b
popq %rsi
movq %rbx, %rdx
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_O2/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 %r14
pushq %rbx
leaq 0x546f85(%rip), %rax    # 0x553368
movl (%rax), %eax
movl %eax, 0xce06d(%rip)     # 0xda458
movslq 0xcf102(%rip), %rax     # 0xdb4f4
leaq 0x78f737(%rip), %rdx    # 0x79bb30
leaq 0xcf150(%rip), %rsi     # 0xdb550
movq %rax, %rcx
shlq $0x4, %rcx
leaq 0xcf852(%rip), %rdi     # 0xdbc60
addq %rcx, %rdi
leaq 0xcf188(%rip), %r8      # 0xdb5a0
movq %rax, %rcx
shlq $0x5, %rcx
leaq 0xd083a(%rip), %r9      # 0xdcc60
addq %rcx, %r9
leaq 0xcf1d0(%rip), %r10     # 0xdb600
leaq 0xd2829(%rip), %r11     # 0xdec60
addq %rcx, %r11
leaq 0xcf1ff(%rip), %rbx     # 0xdb640
leaq 0xd4818(%rip), %r14     # 0xe0c60
addq %rcx, %r14
leaq 0x78f6ee(%rip), %rcx    # 0x79bb40
movslq (%rdx), %rdx
testq %rdx, %rdx
js 0xc488
movb (%rdx,%rsi), %bpl
movb %bpl, (%rdx,%rdi)
movzwl (%r8,%rdx,2), %ebp
movw %bp, (%r9,%rdx,2)
movzwl (%r10,%rdx,2), %ebp
movw %bp, (%r11,%rdx,2)
movzwl (%rbx,%rdx,2), %ebp
movw %bp, (%r14,%rdx,2)
shlq $0x2, %rdx
addq %rcx, %rdx
jmp 0xc452
incl %eax
movzbl %al, %eax
movl %eax, 0xcf061(%rip)     # 0xdb4f4
leaq 0x78f696(%rip), %rax    # 0x79bb30
movslq (%rax), %rax
leaq 0xcdfec(%rip), %rdx     # 0xda490
movslq (%rcx,%rax,4), %rax
testq %rax, %rax
js 0xc4bd
testb $0x2, 0x1(%rdx,%rax,2)
je 0xc4a4
movb $0x0, 0xcdf98(%rip)     # 0xda453
jmp 0xc4a4
popq %rbx
popq %r14
popq %rbp
jmp 0x15b53
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbx
movl 0xccd52(%rip), %eax     # 0xda470
leaq 0x11356b(%rip), %rcx    # 0x120c90
leaq 0x114564(%rip), %rdx    # 0x121c90
leaq 0x114d5d(%rip), %rsi    # 0x122490
leaq 0x115556(%rip), %rdi    # 0x122c90
testl %eax, %eax
jle 0xd7d5
movq -0x8(%rcx,%rax,8), %r8
movl (%r8), %ebx
movl -0x4(%rdx,%rax,4), %r11d
movl -0x4(%rsi,%rax,4), %r9d
cmpl %r11d, %ebx
jge 0xd769
leal (%r9,%r9,2), %r10d
addl %ebx, %r10d
cmpl %r11d, %r10d
cmovgel %r11d, %r10d
jmp 0xd777
imull $-0x3, %r9d, %r10d
addl %ebx, %r10d
cmpl %r11d, %r10d
cmovlel %r11d, %r10d
addl -0x4(%rdi,%rax,4), %r9d
movl %r9d, -0x4(%rsi,%rax,4)
movl %r10d, (%r8)
cmpl -0x4(%rdx,%rax,4), %r10d
jne 0xd7cd
movl 0xcccde(%rip), %r8d     # 0xda470
leal -0x1(%r8), %r9d
movl %r9d, 0xcccd3(%rip)     # 0xda470
cmpq %r8, %rax
je 0xd7cd
movslq %r8d, %r8
movq -0x8(%rcx,%r8,8), %r9
movq %r9, -0x8(%rcx,%rax,8)
movl -0x4(%rdx,%r8,4), %r9d
movl %r9d, -0x4(%rdx,%rax,4)
movl -0x4(%rsi,%r8,4), %r9d
movl %r9d, -0x4(%rsi,%rax,4)
movl -0x4(%rdi,%r8,4), %r8d
movl %r8d, -0x4(%rdi,%rax,4)
decq %rax
jmp 0xd73a
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekgame.c
// Function: setanimation
int
setanimation(int *animptr, int thegoal, int thevel, int theacc)
{
     int i, j;

     if (animatecnt >= MAXANIMATES) return(-1);

     j = animatecnt;
     for(i=animatecnt-1;i>=0;i--)
          if (animptr == animateptr[i])
               { j = i; break; }

     animateptr[j] = animptr;
     animategoal[j] = thegoal;
     animatevel[j] = thevel;
     animateacc[j] = theacc;
     if (j == animatecnt) animatecnt++;
     return(j);
}

// Assembly:
movl 0xccc66(%rip), %r8d     # 0xda470
cmpl $0x1ff, %r8d            # imm = 0x1FF
jle 0xd817
pushq $-0x1
popq %rax
retq
leaq -0x1(%r8), %r10
leaq 0x11346e(%rip), %r9     # 0x120c90
movl %r8d, %eax
testl %eax, %eax
jle 0xd839
movl %r10d, %r11d
decl %eax
decq %r10
cmpq %rdi, (%r9,%r11,8)
jne 0xd825
jmp 0xd83c
movl %r8d, %eax
movslq %eax, %r10
movq %rdi, (%r9,%r10,8)
leaq 0x114446(%rip), %rdi    # 0x121c90
movl %esi, (%rdi,%r10,4)
leaq 0x114c3b(%rip), %rsi    # 0x122490
movl %edx, (%rsi,%r10,4)
leaq 0x115430(%rip), %rdx    # 0x122c90
movl %ecx, (%rdx,%r10,4)
cmpl %r8d, %r10d
jne 0xd876
leal 0x1(%r8), %eax
movl %eax, 0xccbfd(%rip)     # 0xda470
movl %r8d, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekgun.c
// Function: restockammo
void
restockammo(int snum)
{
     ammo1[snum]=MAXAMMO;
     ammo2[snum]=MAXAMMO>>1;
     ammo3[snum]=20;
     ammo4[snum]=0;
     ammo5[snum]=MAXAMMO;
     ammo6[snum]=0;
     ammo7[snum]=0;
     ammo8[snum]=0;
}

// Assembly:
movslq %edi, %rax
leaq 0x116ecd(%rip), %rcx    # 0x1251e0
movw $0x64, %dx
movw %dx, (%rcx,%rax,2)
leaq 0x116ede(%rip), %rcx    # 0x125200
movw $0x32, (%rcx,%rax,2)
leaq 0x116f11(%rip), %rcx    # 0x125240
andw $0x0, (%rcx,%rax,2)
leaq 0x116ee5(%rip), %rcx    # 0x125220
movw $0x14, (%rcx,%rax,2)
leaq 0x116f18(%rip), %rcx    # 0x125260
movw %dx, (%rcx,%rax,2)
leaq 0x116f2d(%rip), %rcx    # 0x125280
andw $0x0, (%rcx,%rax,2)
leaq 0x116f41(%rip), %rcx    # 0x1252a0
andw $0x0, (%rcx,%rax,2)
leaq 0x116f55(%rip), %rcx    # 0x1252c0
andw $0x0, (%rcx,%rax,2)
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekgun.c
// Function: tekfiregun
void
tekfiregun(int gun,short p)  // this kicks off an animation sequence
{
     if( fireseq[p] != 0 ) {
          return;
     }
     if( tekgunrep(gun) || ((oflags[p]&2048) == 0) ) {
//          if( hasammo(gun,p) ) {
               fireseq[p]=1;
               oneshot[p]=0;
//          }
     }
}

// Assembly:
movslq %esi, %rax
leaq 0x116ea0(%rip), %rcx    # 0x1252e0
cmpl $0x0, (%rcx,%rax,4)
je 0xe447
retq
incl %edi
movslq %edi, %rdx
imulq $0x12, %rdx, %rdx
leaq 0xb97f9(%rip), %rsi     # 0xc7c50
cmpb $0x0, 0x6(%rdx,%rsi)
jne 0xe46c
leaq 0xcd4fb(%rip), %rdx     # 0xdb960
testb $0x8, 0x1(%rdx,%rax,2)
jne 0xe446
movl $0x1, (%rcx,%rax,4)
leaq 0x116ea6(%rip), %rcx    # 0x125320
andl $0x0, (%rcx,%rax,4)
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekgun.c
// Function: playerwoundplayer
void
playerwoundplayer(short plrhit, short plr, char guntype)
{
     int       killed=0,damage=0,score=0;

     if( !validplayer(plrhit) || !validplayer(plr) ) {
          return;
     }

     switch( guntype ) {
     case 2:  score=5;  damage=48;   break;
     case 3:  score=10; damage=192;  break;
     case 4:  score=10; damage=512;  break;
     case 5:  score=15; damage=1024; break;
     case 6:  score=10; damage=24;   break;
     case 7:  score=10; damage=512;  break;
     default: score=5;  damage=32;   break;
     }

     killed=changehealth(plrhit,-damage);

     if( killed ) {
          changescore(plr, (score<<1));
     }
     else {
          changescore(plr, score);
     }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %r14d
movl %esi, %ebx
movl %edi, %ebp
callq 0xe2e0
testl %eax, %eax
je 0xe4ca
movswl %bx, %ebx
movl %ebx, %edi
callq 0xe2e0
testl %eax, %eax
je 0xe4ca
addb $-0x2, %r14b
cmpb $0x5, %r14b
ja 0xe4cf
movzbl %r14b, %ecx
addl %ecx, %ecx
leaq 0x72f1c(%rip), %rax     # 0x813d4
movzwl (%rcx,%rax), %eax
leaq 0x72f1d(%rip), %rdx     # 0x813e0
movzwl (%rcx,%rdx), %r14d
jmp 0xe4d8
popq %rbx
popq %r14
popq %rbp
retq
movw $0x5, %r14w
movw $0xffe0, %ax            # imm = 0xFFE0
movswl %bp, %edi
movswl %ax, %esi
callq 0x99a8
testl %eax, %eax
setne %cl
shll %cl, %r14d
movswl %r14w, %esi
movl %ebx, %edi
popq %rbx
popq %r14
popq %rbp
jmp 0x9adc
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekgun.c
// Function: playerpainsound
void
playerpainsound(int p)
{
     if( !validplayer(p) ) {
          crashgame("playerpainsnd: bad plr num");
     }

     if( krand_intercept(" GUN 341") < 1024 ) {
          playsound(S_PAIN1+(krand_intercept(" GUN 342")&1),posx[p],posy[p],0,ST_NOUPDATE);
     }
}

// Assembly:
pushq %rbx
movl %edi, %ebx
callq 0xe2e0
testl %eax, %eax
jne 0xe610
leaq 0x72de3(%rip), %rdi     # 0x813ec
xorl %eax, %eax
callq 0x2acb8
leaq 0x72df0(%rip), %rdi     # 0x81407
callq 0x2945b
cmpl $0x3ff, %eax            # imm = 0x3FF
jg 0xe658
leaq 0x72de6(%rip), %rdi     # 0x81410
callq 0x2945b
andl $0x1, %eax
leal 0x7b(%rax), %edi
movslq %ebx, %rax
leaq 0xcbe91(%rip), %rcx     # 0xda4d0
movl (%rcx,%rax,4), %esi
leaq 0xcbec7(%rip), %rcx     # 0xda510
movl (%rcx,%rax,4), %edx
pushq $0x4
popq %r8
xorl %ecx, %ecx
popq %rbx
jmp 0x1ab2a
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekgun.c
// Function: tekhasweapon
int
tekhasweapon(int gun,short snum)
{
     int       hasit=0;

     if( mission == 7 ) {
          if( gun != 7 ) {
               if( snum == screenpeek ) {
                    notininventory=1;
               }
               return(0);
          }
          else {
               return(1);
          }
     }
     else {
          if( gun == 7 ) {
               if( snum == screenpeek ) {
                    showmessage("ONLY IN MATRIX");
               }
               return(0);
          }
     }

     hasit=(weapons[snum]&flags32[gun+1]);
     if( hasit )
          return(1);

     notininventory=1;
     return(0);
}

// Assembly:
pushq %rbx
leaq 0x114ab0(%rip), %rax    # 0x125510
cmpl $0x7, (%rax)
jne 0x10a84
cmpl $0x7, %edi
je 0x10ac7
leaq 0xc99ed(%rip), %rax     # 0xda45e
xorl %ebx, %ebx
cmpw %si, (%rax)
jne 0x10aca
leaq 0x11651d(%rip), %rax    # 0x126f9c
movb $0x1, (%rax)
jmp 0x10aca
cmpl $0x7, %edi
jne 0x10aa9
leaq 0xc99ce(%rip), %rax     # 0xda45e
xorl %ebx, %ebx
cmpw %si, (%rax)
jne 0x10aca
leaq 0x70a06(%rip), %rdi     # 0x814a4
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x1373a
jmp 0x10aca
movswq %si, %rax
leaq 0x1149cc(%rip), %rcx    # 0x125480
movslq %edi, %rdx
leaq 0xb7e32(%rip), %rsi     # 0xc88f0
movl 0x4(%rsi,%rdx,4), %edx
testl %edx, (%rcx,%rax,4)
je 0x10ace
pushq $0x1
popq %rbx
movl %ebx, %eax
popq %rbx
retq
leaq 0x1164c7(%rip), %rax    # 0x126f9c
movb $0x1, (%rax)
xorl %ebx, %ebx
jmp 0x10aca